123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import {
- B,
- P
- } from "./chunk-WZQZRKNH.js";
- // node_modules/@arcgis/core/layers/support/FieldsIndex.js
- function t(e) {
- return e.type === "date" || e.type === "esriFieldTypeDate";
- }
- function s(e) {
- return e.type === "oid" || e.type === "esriFieldTypeOID";
- }
- function l(e) {
- return e.type === "global-id" || e.type === "esriFieldTypeGlobalID";
- }
- var d = class {
- constructor(i) {
- if (this.fields = i, this._fieldsMap = new Map(), this._dateFieldsSet = new Set(), this._numericFieldsSet = new Set(), this.dateFields = [], this.numericFields = [], this._requiredFields = null, !i)
- return;
- const d2 = [];
- for (const n of i) {
- const i2 = n && n.name;
- if (i2) {
- const u = r(i2);
- this._fieldsMap.set(i2, n), this._fieldsMap.set(u, n), d2.push(u), t(n) ? (this.dateFields.push(n), this._dateFieldsSet.add(n)) : B(n) && (this._numericFieldsSet.add(n), this.numericFields.push(n)), s(n) || l(n) || (n.editable = n.editable == null || !!n.editable, n.nullable = n.nullable == null || !!n.nullable);
- }
- }
- d2.sort(), this.uid = d2.join(",");
- }
- destroy() {
- this._fieldsMap.clear();
- }
- get requiredFields() {
- if (!this._requiredFields) {
- this._requiredFields = [];
- for (const e of this.fields)
- s(e) || l(e) || e.nullable || P(e) !== void 0 || this._requiredFields.push(e);
- }
- return this._requiredFields;
- }
- has(e) {
- return this.get(e) != null;
- }
- get(e) {
- return e != null ? this._fieldsMap.get(e) || this._fieldsMap.get(r(e)) : void 0;
- }
- isDateField(e) {
- return this._dateFieldsSet.has(this.get(e));
- }
- isNumericField(e) {
- return this._numericFieldsSet.has(this.get(e));
- }
- normalizeFieldName(e) {
- const i = this.get(e);
- if (i)
- return i.name;
- }
- };
- function r(e) {
- return e.toLowerCase().trim();
- }
- export {
- d
- };
- //# sourceMappingURL=chunk-KMAHKQ2G.js.map
|