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