@arcgis/portal-components 5.0.0-next.5 → 5.0.0-next.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cdn/{QW5O24WW.js → 7A2XRILR.js} +2 -2
  2. package/dist/cdn/{2EN2LO5R.js → 7OIE2W6P.js} +2 -2
  3. package/dist/cdn/{DPPZMN4X.js → EFXP4CKB.js} +2 -2
  4. package/dist/cdn/{XLVSXTZH.js → LYLDBOGV.js} +2 -2
  5. package/dist/cdn/{QUOSVTQE.js → MC5BA5LJ.js} +2 -2
  6. package/dist/cdn/PH5ES4FQ.js +4 -0
  7. package/dist/cdn/{EGC7BUWT.js → QGOURTHC.js} +1 -1
  8. package/dist/cdn/{NBW4G3NC.js → RGLT2HTS.js} +1 -1
  9. package/dist/cdn/{OZA4QYRU.js → S5LALRMR.js} +1 -1
  10. package/dist/cdn/TFRAOOJH.js +4 -0
  11. package/dist/cdn/XWNKVLDC.js +4 -0
  12. package/dist/cdn/ZBGAM24G.js +4 -0
  13. package/dist/cdn/index.js +2 -2
  14. package/dist/chunks/common.js +1 -1
  15. package/dist/chunks/fieldAddDelete.js +164 -151
  16. package/dist/chunks/loadClassificationData.js +1 -1
  17. package/dist/chunks/requests.js +1 -1
  18. package/dist/chunks/runtime.js +1 -1
  19. package/dist/chunks/useT9n.js +1 -1
  20. package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
  21. package/dist/components/arcgis-portal-classification-config/customElement.d.ts +1 -1
  22. package/dist/components/arcgis-portal-classification-config/customElement.js +111 -103
  23. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  24. package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +2 -1
  25. package/dist/components/arcgis-portal-classification-form-element/customElement.js +12 -12
  26. package/dist/components/arcgis-portal-field-delete/customElement.d.ts +4 -2
  27. package/dist/components/arcgis-portal-field-delete/customElement.js +28 -28
  28. package/dist/controllers/useClassificationModel.d.ts +1 -1
  29. package/dist/docs/api.json +26 -3
  30. package/dist/docs/docs.json +41 -5
  31. package/dist/docs/vscode.html-custom-data.json +1 -1
  32. package/dist/docs/web-types.json +18 -4
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +1 -1
  35. package/dist/loader.js +2 -2
  36. package/dist/types/lumina.d.ts +2 -1
  37. package/dist/types/preact.d.ts +2 -1
  38. package/dist/types/preact10.d.ts +2 -1
  39. package/dist/types/react.d.ts +2 -1
  40. package/dist/types/stencil.d.ts +2 -1
  41. package/dist/utils/commonFunctions.d.ts +2 -1
  42. package/package.json +4 -4
  43. package/dist/cdn/7ULNW5LN.js +0 -4
  44. package/dist/cdn/FK4753G2.js +0 -4
  45. package/dist/cdn/KM2LN47M.js +0 -4
  46. package/dist/cdn/XWISIBQI.js +0 -4
@@ -1,18 +1,18 @@
1
1
  import { c as k } from "../../chunks/runtime.js";
2
- import { html as p, css as P } from "lit";
3
- import { LitElement as M, createEvent as F, renderElement as T } from "@arcgis/lumina";
4
- import { createRef as E, ref as N } from "lit/directives/ref.js";
5
- import { Task as O } from "@lit/task";
2
+ import { html as p, css as M } from "lit";
3
+ import { LitElement as O, createEvent as v, renderElement as T } from "@arcgis/lumina";
4
+ import { createRef as I, ref as N } from "lit/directives/ref.js";
5
+ import { Task as P } from "@lit/task";
6
6
  import * as x from "@arcgis/core/core/lang.js";
7
7
  import L from "@arcgis/core/layers/support/FeatureTemplate.js";
8
8
  import S from "@arcgis/core/Graphic.js";
9
- import j from "@arcgis/core/identity/IdentityManager.js";
9
+ import B from "@arcgis/core/identity/IdentityManager.js";
10
10
  import y from "@arcgis/core/request.js";
11
- import { a as B, g as U, b as q, d as R, e as w, f as J, i as D } from "../../chunks/fieldAddDelete.js";
12
- import { u as z } from "../../chunks/useT9n.js";
11
+ import { a as j, g as U, b as q, d as R, s as J, e as D, f as z, i as w } from "../../chunks/fieldAddDelete.js";
12
+ import { u as W } from "../../chunks/useT9n.js";
13
13
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
14
14
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
15
- v5.0.0-next.5 */
15
+ v5.0.0-next.51 */
16
16
  const n = /* @__PURE__ */ new Map();
17
17
  n.set("oid", "key");
18
18
  n.set("guid", "key");
@@ -30,23 +30,23 @@ n.set("date-only", "calendar");
30
30
  n.set("time-only", "clock");
31
31
  n.set("timestamp-offset", "time-zone");
32
32
  n.set("string", "string");
33
- const W = ({ fieldType: $ }) => p`<calcite-icon scale=s .icon=${n.get($)}></calcite-icon>`, _ = P`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`;
34
- class V extends M {
33
+ const _ = ({ fieldType: $ }) => p`<calcite-icon scale=s .icon=${n.get($)}></calcite-icon>`, V = M`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`;
34
+ class G extends O {
35
35
  constructor() {
36
- super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = E(), this.dialogNode = E(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = z({ blocking: !0 }), this._propWatcherTask = new O(this, {
36
+ super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = I(), this.dialogNode = I(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = W({ blocking: !0 }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this._propWatcherTask = new P(this, {
37
37
  task: async ([e, t]) => {
38
- if (!(D(e) && D(t)))
38
+ if (!(w(e) && w(t)))
39
39
  throw console.error("Required properties are missing."), new Error();
40
40
  this._propWatcherTask.autoRun = !1, await this.processProps();
41
41
  },
42
42
  args: () => [this.layer, this.fieldNames]
43
- }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this.arcgisFieldsDeleted = F(), this.arcgisBeforeModalClose = F(), this.arcgisClose = F();
43
+ }), this.arcgisBeforeModalClose = v(), this.arcgisClose = v(), this.arcgisBeforeDelete = v(), this.arcgisFieldsDeleted = v();
44
44
  }
45
45
  static {
46
- this.properties = { currentLayerInfo: 16, deleteInProgress: 16, fieldsAreDeletable: 16, config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
46
+ this.properties = { config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
47
47
  }
48
48
  static {
49
- this.styles = _;
49
+ this.styles = V;
50
50
  }
51
51
  async processProps() {
52
52
  const { layer: e, mapView: t, fieldNames: s } = this;
@@ -59,7 +59,7 @@ class V extends M {
59
59
  if (!this.layerFields?.length || a)
60
60
  this.fieldsAreDeletable = !1;
61
61
  else {
62
- const o = await Promise.all(this.layerFields.map(async (r) => await B(t, e, r, this.options)));
62
+ const o = await Promise.all(this.layerFields.map(async (r) => await j(t, e, r, this.options)));
63
63
  if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
64
64
  return;
65
65
  }
@@ -67,7 +67,7 @@ class V extends M {
67
67
  this.fieldsAreDeletable = !1;
68
68
  return;
69
69
  }
70
- await j.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
70
+ await B.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
71
71
  }
72
72
  getFieldLabel(e) {
73
73
  const { layer: t, arcadeExpMap: s } = this;
@@ -75,12 +75,12 @@ class V extends M {
75
75
  return this.getFieldDisplayNameFromLayerFields(e);
76
76
  {
77
77
  const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
78
- return o ? R(o, s) : this.getFieldDisplayNameFromLayerFields(e);
78
+ return o ? R(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
79
79
  }
80
80
  }
81
81
  getFieldDisplayNameFromLayerFields(e) {
82
- const t = this.layerFieldsMap.get(e);
83
- return t.alias ?? t.name;
82
+ const { layer: t } = this, s = this.layerFieldsMap.get(e);
83
+ return J(t) ? t.getFieldAlias(e) : s.alias ?? s.name;
84
84
  }
85
85
  async deleteFields() {
86
86
  const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
@@ -161,7 +161,7 @@ class V extends M {
161
161
  responseType: "json"
162
162
  }).then(async (h) => {
163
163
  if (h.data?.success) {
164
- const u = `${w(this.portal)}content/items/${this.item.id}/data`;
164
+ const u = `${D(this.portal)}content/items/${this.item.id}/data`;
165
165
  if (this.options?.ignorePopupTemplate || s.forEach((i) => {
166
166
  t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
167
167
  l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((m) => m.fieldName !== i));
@@ -185,11 +185,11 @@ class V extends M {
185
185
  c?.attributeTableInfo?.attributeTableElements && (c.attributeTableInfo.attributeTableElements = c.attributeTableInfo.attributeTableElements.filter((f) => !(f.type === "field" && f.fieldName === g)), c.attributeTableInfo.orderByFields = c.attributeTableInfo.orderByFields.filter((f) => f.field !== g));
186
186
  }), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
187
187
  s.forEach((b) => {
188
- c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== b), c.popupInfo.popupElements?.forEach((v, I) => {
189
- v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[I].fieldInfos = c.popupInfo.popupElements[I].fieldInfos.filter((C) => C.fieldName !== b));
188
+ c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((F) => F.fieldName !== b), c.popupInfo.popupElements?.forEach((F, E) => {
189
+ F.type === "fields" && F.fieldInfos && (c.popupInfo.popupElements[E].fieldInfos = c.popupInfo.popupElements[E].fieldInfos.filter((C) => C.fieldName !== b));
190
190
  });
191
191
  });
192
- const g = `${w(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
192
+ const g = `${D(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
193
193
  d ? (f.tables = m, l.layers && (f.layers = l.layers)) : (f.layers = m, l.tables && (f.tables = l.tables));
194
194
  const A = {
195
195
  f: "json",
@@ -247,7 +247,7 @@ class V extends M {
247
247
  const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
248
248
  return p`<calcite-list .label=${o.fields}>${e.map((r) => {
249
249
  const h = t.find((u) => u.name === r);
250
- return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${W({ fieldType: J(r, s, a) })}</div></calcite-list-item>`;
250
+ return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${_({ fieldType: z(r, s, a) })}</div></calcite-list-item>`;
251
251
  })}</calcite-list>`;
252
252
  }
253
253
  renderCancelButton() {
@@ -258,11 +258,11 @@ class V extends M {
258
258
  const { messages: e, fieldNames: t } = this;
259
259
  return p`<calcite-button kind=danger slot=footer-end @click=${async (s) => {
260
260
  const { portal: a } = this;
261
- s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, await this.deleteFields());
261
+ s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, this.requestUpdate(), this.arcgisBeforeDelete.emit(), await this.deleteFields());
262
262
  }}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
263
263
  }
264
264
  }
265
- k("arcgis-portal-field-delete", V);
265
+ k("arcgis-portal-field-delete", G);
266
266
  export {
267
- V as ArcgisPortalFieldDelete
267
+ G as ArcgisPortalFieldDelete
268
268
  };
@@ -3,7 +3,7 @@
3
3
  * Use this controller to access and update shared classification info
4
4
  * between multiple instances of the classification banner.
5
5
  */
6
- export declare const useClassificationModel: (component: import('@arcgis/lumina').LitElement & Omit<Pick<import('../models/classificationModel').ClassificationModel, "portalClassificationSchema">, "set" | "addHandles" | "declaredClass" | "destroyed" | "hasHandles" | "initialized" | "removeHandles" | "watch"> & {
6
+ export declare const useClassificationModel: (component: import('@arcgis/lumina').LitElement & Omit<Pick<import('../models/classificationModel').ClassificationModel, "portalClassificationSchema">, "addHandles" | "declaredClass" | "destroyed" | "hasHandles" | "initialized" | "removeHandles" | "set" | "watch"> & {
7
7
  autoDestroyDisabled: boolean;
8
8
  destroy: () => Promise<void>;
9
9
  }) => import('../models/classificationModel').ClassificationModel;
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-09-30T04:38:01",
2
+ "timestamp": "2025-11-11T04:41:33",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.5",
5
+ "version": "5.0.0-next.51",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "schemaVersion": "1.0.0",
@@ -471,7 +471,7 @@
471
471
  "name": "arcgisPropertyChange",
472
472
  "description": "Event emitted when component property values status, values, or valid change.",
473
473
  "type": {
474
- "text": "{ name: \"values\" | \"valid\" | \"status\"; }"
474
+ "text": "{ name: \"values\" | \"status\" | \"valid\"; }"
475
475
  }
476
476
  }
477
477
  ]
@@ -913,6 +913,22 @@
913
913
  }
914
914
  ]
915
915
  },
916
+ {
917
+ "kind": "field",
918
+ "name": "isRequiredErrors",
919
+ "type": {
920
+ "text": "Set<string>",
921
+ "references": [
922
+ {
923
+ "name": "Set",
924
+ "package": "typescript",
925
+ "module": "lib/lib.es2015.collection.d.ts",
926
+ "start": 0,
927
+ "end": 3
928
+ }
929
+ ]
930
+ }
931
+ },
916
932
  {
917
933
  "kind": "field",
918
934
  "name": "renderingInfo",
@@ -1114,6 +1130,13 @@
1114
1130
  }
1115
1131
  ],
1116
1132
  "events": [
1133
+ {
1134
+ "name": "arcgisBeforeDelete",
1135
+ "description": "Emitted when the user initiates the delete process.",
1136
+ "type": {
1137
+ "text": "void"
1138
+ }
1139
+ },
1117
1140
  {
1118
1141
  "name": "arcgisBeforeModalClose",
1119
1142
  "description": "Emitted before the modal is closed if the alert is handled in consumer.",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-09-30T04:38:01",
2
+ "timestamp": "2025-11-11T04:41:33",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.5",
5
+ "version": "5.0.0-next.51",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "components": [
@@ -425,11 +425,11 @@
425
425
  "events": [
426
426
  {
427
427
  "event": "arcgisPropertyChange",
428
- "detail": "{ name: \"values\" | \"valid\" | \"status\"; }",
428
+ "detail": "{ name: \"values\" | \"status\" | \"valid\"; }",
429
429
  "bubbles": true,
430
430
  "complexType": {
431
- "original": "{ name: \"values\" | \"valid\" | \"status\"; }",
432
- "resolved": "{ name: \"values\" | \"valid\" | \"status\"; }",
431
+ "original": "{ name: \"values\" | \"status\" | \"valid\"; }",
432
+ "resolved": "{ name: \"values\" | \"status\" | \"valid\"; }",
433
433
  "references": {}
434
434
  },
435
435
  "cancelable": true,
@@ -737,6 +737,28 @@
737
737
  "optional": true,
738
738
  "required": false
739
739
  },
740
+ {
741
+ "name": "isRequiredErrors",
742
+ "type": "Set<string>",
743
+ "complexType": {
744
+ "original": "Set<string>",
745
+ "resolved": "Set<string>",
746
+ "references": {
747
+ "Set": {
748
+ "location": "import",
749
+ "path": "typescript/lib/lib.es2015.collection.d.ts",
750
+ "id": "notImplemented"
751
+ }
752
+ }
753
+ },
754
+ "mutable": true,
755
+ "reflectToAttr": false,
756
+ "docs": "",
757
+ "docsTags": [],
758
+ "values": [],
759
+ "optional": true,
760
+ "required": false
761
+ },
740
762
  {
741
763
  "name": "renderingInfo",
742
764
  "type": "{\n attributeValidationResult: string | null;\n valueExpressionResult: Array<Readonly<{\n label: string;\n value: string;\n }>> | Record<string, Array<Readonly<{\n label: string;\n value: string;\n }>>> | null;\n}",
@@ -1001,6 +1023,20 @@
1001
1023
  }
1002
1024
  ],
1003
1025
  "events": [
1026
+ {
1027
+ "event": "arcgisBeforeDelete",
1028
+ "detail": "void",
1029
+ "bubbles": true,
1030
+ "complexType": {
1031
+ "original": "void",
1032
+ "resolved": "void",
1033
+ "references": {}
1034
+ },
1035
+ "cancelable": true,
1036
+ "composed": true,
1037
+ "docs": "Emitted when the user initiates the delete process.",
1038
+ "docsTags": []
1039
+ },
1004
1040
  {
1005
1041
  "event": "arcgisBeforeModalClose",
1006
1042
  "detail": "string",
@@ -90,7 +90,7 @@
90
90
  },
91
91
  {
92
92
  "name": "arcgis-portal-field-delete",
93
- "description": "### Events\n- **arcgisBeforeModalClose** - Emitted before the modal is closed if the alert is handled in consumer.\n- **arcgisClose** - Emitted when the component is closed for any reason.\n- **arcgisFieldsDeleted** - Emitted when the field is successfully deleted.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
93
+ "description": "### Events\n- **arcgisBeforeDelete** - Emitted when the user initiates the delete process.\n- **arcgisBeforeModalClose** - Emitted before the modal is closed if the alert is handled in consumer.\n- **arcgisClose** - Emitted when the component is closed for any reason.\n- **arcgisFieldsDeleted** - Emitted when the field is successfully deleted.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
94
94
  "attributes": [],
95
95
  "references": []
96
96
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@arcgis/portal-components",
4
- "version": "5.0.0-next.5",
4
+ "version": "5.0.0-next.51",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -99,7 +99,7 @@
99
99
  "events": [
100
100
  {
101
101
  "name": "arcgisPropertyChange",
102
- "type": "{ name: \"values\" | \"valid\" | \"status\"; }",
102
+ "type": "{ name: \"values\" | \"status\" | \"valid\"; }",
103
103
  "description": "Event emitted when component property values status, values, or valid change."
104
104
  }
105
105
  ],
@@ -129,7 +129,7 @@
129
129
  "events": [
130
130
  {
131
131
  "name": "arcgisPropertyChange",
132
- "type": "{ name: \"values\" | \"valid\" | \"status\"; }",
132
+ "type": "{ name: \"values\" | \"status\" | \"valid\"; }",
133
133
  "description": "Event emitted when component property values status, values, or valid change."
134
134
  }
135
135
  ]
@@ -213,6 +213,10 @@
213
213
  "name": "attributeKey",
214
214
  "type": "string"
215
215
  },
216
+ {
217
+ "name": "isRequiredErrors",
218
+ "type": "Set<string>"
219
+ },
216
220
  {
217
221
  "name": "renderingInfo",
218
222
  "type": "{\n attributeValidationResult: string | null;\n valueExpressionResult: Array<Readonly<{\n label: string;\n value: string;\n }>> | Record<string, Array<Readonly<{\n label: string;\n value: string;\n }>>> | null;\n}"
@@ -233,9 +237,14 @@
233
237
  },
234
238
  {
235
239
  "name": "arcgis-portal-field-delete",
236
- "description": "### Events\n- **arcgisBeforeModalClose** - Emitted before the modal is closed if the alert is handled in consumer.\n- **arcgisClose** - Emitted when the component is closed for any reason.\n- **arcgisFieldsDeleted** - Emitted when the field is successfully deleted.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
240
+ "description": "### Events\n- **arcgisBeforeDelete** - Emitted when the user initiates the delete process.\n- **arcgisBeforeModalClose** - Emitted before the modal is closed if the alert is handled in consumer.\n- **arcgisClose** - Emitted when the component is closed for any reason.\n- **arcgisFieldsDeleted** - Emitted when the field is successfully deleted.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
237
241
  "attributes": [],
238
242
  "events": [
243
+ {
244
+ "name": "arcgisBeforeDelete",
245
+ "type": "void",
246
+ "description": "Emitted when the user initiates the delete process."
247
+ },
239
248
  {
240
249
  "name": "arcgisBeforeModalClose",
241
250
  "type": "string",
@@ -281,6 +290,11 @@
281
290
  }
282
291
  ],
283
292
  "events": [
293
+ {
294
+ "name": "arcgisBeforeDelete",
295
+ "type": "void",
296
+ "description": "Emitted when the user initiates the delete process."
297
+ },
284
298
  {
285
299
  "name": "arcgisBeforeModalClose",
286
300
  "type": "string",
package/dist/index.d.ts CHANGED
@@ -71,6 +71,7 @@ declare global {
71
71
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
72
72
  }
73
73
  interface HTMLArcgisPortalFieldDeleteElementEventMap {
74
+ "arcgisBeforeDelete": ArcgisPortalFieldDelete["arcgisBeforeDelete"]["detail"];
74
75
  "arcgisBeforeModalClose": ArcgisPortalFieldDelete["arcgisBeforeModalClose"]["detail"];
75
76
  "arcgisClose": ArcgisPortalFieldDelete["arcgisClose"]["detail"];
76
77
  "arcgisFieldsDeleted": ArcgisPortalFieldDelete["arcgisFieldsDeleted"]["detail"];
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { g as a, s as t } from "./chunks/runtime.js";
2
2
  import { c as o, a as r } from "./chunks/fieldAddDelete.js";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
5
- v5.0.0-next.5 */
5
+ v5.0.0-next.51 */
6
6
  export {
7
7
  o as canAddField,
8
8
  r as canDeleteField,
package/dist/loader.js CHANGED
@@ -2,12 +2,12 @@ import { r as i } from "./chunks/runtime.js";
2
2
  import { makeDefineCustomElements as t } from "@arcgis/lumina";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
5
- v5.0.0-next.5 */
5
+ v5.0.0-next.51 */
6
6
  const s = t(i, {
7
7
  "arcgis-portal-classification-banner": [() => import("./components/arcgis-portal-classification-banner/customElement.js"), "autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],
8
8
  "arcgis-portal-classification-config": [() => import("./components/arcgis-portal-classification-config/customElement.js"), "autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],
9
9
  "arcgis-portal-classification-favorite": [() => import("./components/arcgis-portal-classification-favorite/customElement.js"), "attributeExpressionResults:,classificationValue:,favoriteClassifications:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],
10
- "arcgis-portal-classification-form-element": [() => import("./components/arcgis-portal-classification-form-element/customElement.js"), "attribute:,attributeKey,renderingInfo:,value:"],
10
+ "arcgis-portal-classification-form-element": [() => import("./components/arcgis-portal-classification-form-element/customElement.js"), "attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],
11
11
  "arcgis-portal-field-delete": [() => import("./components/arcgis-portal-field-delete/customElement.js"), "config:,fieldNames:,layer:,mapView:,options:"]
12
12
  });
13
13
  export {
@@ -16,11 +16,12 @@ interface LuminaArcgisPortalClassificationConfig extends Required<Pick<ArcgisPor
16
16
  interface LuminaArcgisPortalClassificationFavorite extends Partial<Pick<ArcgisPortalClassificationFavorite, 'attributeExpressionResults' | 'classificationValue' | 'favoriteClassifications' | 'portalItem' | 'resetFavoriteClassification' | 'selectedFavoriteClassificationName' | 'updateClassificationData'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalClassificationFavoriteElement> {
17
17
  }
18
18
 
19
- interface LuminaArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'renderingInfo' | 'value'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
19
+ interface LuminaArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'isRequiredErrors' | 'renderingInfo' | 'value'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
20
20
  onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
21
21
  }
22
22
 
23
23
  interface LuminaArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
24
+ onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
24
25
  onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
25
26
  onarcgisClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisClose"]>;
26
27
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
@@ -17,11 +17,12 @@ interface PreactArcgisPortalClassificationConfig extends Required<Pick<ArcgisPor
17
17
  interface PreactArcgisPortalClassificationFavorite extends Partial<Pick<ArcgisPortalClassificationFavorite, 'attributeExpressionResults' | 'classificationValue' | 'favoriteClassifications' | 'portalItem' | 'resetFavoriteClassification' | 'selectedFavoriteClassificationName' | 'updateClassificationData'>>, HTMLAttributes<HTMLArcgisPortalClassificationFavoriteElement> {
18
18
  }
19
19
 
20
- interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'renderingInfo' | 'value'>>, HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
20
+ interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'isRequiredErrors' | 'renderingInfo' | 'value'>>, HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
21
21
  onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
22
22
  }
23
23
 
24
24
  interface PreactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
25
+ onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
25
26
  onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
26
27
  onarcgisClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisClose"]>;
27
28
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
@@ -21,12 +21,13 @@ interface PreactArcgisPortalClassificationFavorite extends Partial<Pick<ArcgisPo
21
21
  }
22
22
 
23
23
  /** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
24
- interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'renderingInfo' | 'value'>>, PreactJsx.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
24
+ interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'isRequiredErrors' | 'renderingInfo' | 'value'>>, PreactJsx.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
25
25
  onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
26
26
  }
27
27
 
28
28
  /** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
29
29
  interface PreactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, PreactJsx.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
30
+ onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
30
31
  onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
31
32
  onarcgisClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisClose"]>;
32
33
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
@@ -17,11 +17,12 @@ interface ReactArcgisPortalClassificationConfig extends Required<Pick<ArcgisPort
17
17
  interface ReactArcgisPortalClassificationFavorite extends Partial<Pick<ArcgisPortalClassificationFavorite, 'attributeExpressionResults' | 'classificationValue' | 'favoriteClassifications' | 'portalItem' | 'resetFavoriteClassification' | 'selectedFavoriteClassificationName' | 'updateClassificationData'>>, HTMLProps<HTMLArcgisPortalClassificationFavoriteElement> {
18
18
  }
19
19
 
20
- interface ReactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'renderingInfo' | 'value'>>, HTMLProps<HTMLArcgisPortalClassificationFormElementElement> {
20
+ interface ReactArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'isRequiredErrors' | 'renderingInfo' | 'value'>>, HTMLProps<HTMLArcgisPortalClassificationFormElementElement> {
21
21
  onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
22
22
  }
23
23
 
24
24
  interface ReactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, HTMLProps<HTMLArcgisPortalFieldDeleteElement> {
25
+ onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
25
26
  onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
26
27
  onarcgisClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisClose"]>;
27
28
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
@@ -17,11 +17,12 @@ interface StencilArcgisPortalClassificationConfig extends Required<Pick<ArcgisPo
17
17
  interface StencilArcgisPortalClassificationFavorite extends Partial<Pick<ArcgisPortalClassificationFavorite, 'attributeExpressionResults' | 'classificationValue' | 'favoriteClassifications' | 'portalItem' | 'resetFavoriteClassification' | 'selectedFavoriteClassificationName' | 'updateClassificationData'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalClassificationFavoriteElement> {
18
18
  }
19
19
 
20
- interface StencilArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'renderingInfo' | 'value'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
20
+ interface StencilArcgisPortalClassificationFormElement extends Partial<Pick<ArcgisPortalClassificationFormElement, 'attribute' | 'attributeKey' | 'isRequiredErrors' | 'renderingInfo' | 'value'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalClassificationFormElementElement> {
21
21
  onArcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
22
22
  }
23
23
 
24
24
  interface StencilArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
25
+ onArcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
25
26
  onArcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
26
27
  onArcgisClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisClose"]>;
27
28
  onArcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
@@ -1,10 +1,11 @@
1
1
  /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ export declare function supportsFieldConfigurations(layer: any): boolean;
2
3
  /**
3
4
  * Returns true if the value is defined
4
5
  * @param value - value to check
5
6
  */
6
7
  export declare function isDefined<T>(value?: T | null): value is T;
7
- export declare function getFieldDisplayName(field: __esri.FieldInfo, arcadeMap: Map<string, __esri.ExpressionInfo>): string;
8
+ export declare function getFieldDisplayName(layer: any, field: __esri.FieldInfo, arcadeMap: Map<string, __esri.ExpressionInfo>): string;
8
9
  export declare function getFieldType(fieldName: string, layerFieldsMap: Map<string, __esri.Field>, arcadeExpMap: Map<string, __esri.ExpressionInfo>): string;
9
10
  export declare function generateLayerFieldsMap(layer: any): Promise<Map<string, __esri.Field>>;
10
11
  export declare function generateArcadeExpressionMap(popupTemplate: __esri.PopupTemplate): Map<string, __esri.ExpressionInfo>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/portal-components",
3
- "version": "5.0.0-next.5",
3
+ "version": "5.0.0-next.51",
4
4
  "description": "ArcGIS Portal Components",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -38,15 +38,15 @@
38
38
  ],
39
39
  "license": "SEE LICENSE IN LICENSE.md",
40
40
  "dependencies": {
41
- "@arcgis/lumina": "5.0.0-next.5",
42
- "@arcgis/toolkit": "5.0.0-next.5",
41
+ "@arcgis/lumina": "5.0.0-next.51",
42
+ "@arcgis/toolkit": "5.0.0-next.51",
43
43
  "@lit/task": "^1.0.2",
44
44
  "lit": "^3.3.0",
45
45
  "tslib": "^2.8.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@arcgis/core": ">=5.0.0-next.1 <5.1",
49
- "@esri/calcite-components": "^3.3.0"
49
+ "@esri/calcite-components": "^3.3.2"
50
50
  },
51
51
  "css.customData": [
52
52
  "dist/docs/vscode.css-custom-data.json"
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
- v5.0.0-next.5 */
4
- import{b as J}from"./DPPZMN4X.js";import{d as B}from"./QW5O24WW.js";import{B as S,C as A,D as j,G as D,I as R,h as M,j as y,p as x}from"./NBW4G3NC.js";export default $arcgis.t(([H,ge,we,be,$,I,Y,X,k,P,T])=>{var C=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(C||{});function N(i){return i!=null}function W(i,e){let t=i.fieldName;if(t.includes(C.expression)){let s=e.get(t);return s?.title?s.title:t}else return i.label?i.label:t}function q(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function _(i){return new Map((await Z(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function V(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${C.expression}${t.name}`;e.set(s,t)}),e}async function Z(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let n=new Map(s.fields.map(o=>[o.name,o])),c=a.thematicGroup.fieldNames,p=[];c.forEach(o=>{n.has(o)&&p.push(n.get(o))}),e(p)}else e(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}var ee=i=>i&&!i.endsWith("/")?`${i}/`:i;function F(i){return ee(i.restUrl)}function te(i,e){return z(i,e)||ie(i,e)}function z(i,e){return i.owner===e.username}function ie(i,e){let t=i.owner,s=i.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return i.portal?.isPortal&&!z(i,e)&&s&&t?.includes("esri_")&&!r.includes(t)?!1:s}function se(i){return i.typeKeywords?.includes("Spatiotemporal")}function re(i){return i.typeKeywords?.includes("View Service")}function ae(i){return i.typeKeywords?.includes("Hosted Service")}function ne(i){return i.typeKeywords?.includes("Multi Services View")}function oe(i){return i?.hasViews&&!i.sourceSchemaChangesAllowed}async function le(i){let e=i?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal;if(t?.user){let s=`${F(t)}community/users/${t.user.username}`;return await P(s,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.groups??[];return await Promise.resolve(a)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function de(i){let e=i?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal,s=`${F(t)}content/items/${e.id}/groups`;return await P(s,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.admin??[],n=r.data?.member??[],c=r.data?.other??[],p=[...a,...n,...c];return await Promise.resolve(p)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function ce(i,e,{relationshipType:t,direction:s}){let r=`${F(e)}content/items/${i}/relatedItems`;return await P(r,{query:{f:"json",relationshipType:t,direction:s},responseType:"json"})}function pe(i,e){return i?.some(t=>e?.some(s=>t.id===s.id&&t.capabilities.includes("updateitemcontrol")))}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function U(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!ae(a)||re(a)||ne(a)||oe(n)||a.portal.isPortal&&se(a)||["oid","global-id","geometry"].includes(t.type))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,o=c?.shapeAreaFieldName;if(d(p,t.name)||d(o,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!s?.ignoreLayerRenderer&&e.featureReduction){let u=new Set;if(await I.collectFeatureReductionFields(u,e,e.featureReduction),Array.from(u).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(u=>d(u,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let u=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(u&&((await I.getExpressionFields(e,u)).some(b=>d(b,t.name))||await G(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await T.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await ue(e,t,s)||await me(e,t))return!1;if(await he(e,t))return await Promise.resolve(!1);if(await ye(e,t))return await Promise.resolve(!1);if(fe(i,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=te(a,a.portal.user),v=s?.userItemInfo?.userGroups??await le(e)??[],h=s?.userItemInfo?.itemGroups??await de(e)??[],w=pe(v,h);if(!f&&!w)return!1;let g=s?.userItemInfo?.relatedItems??await ce(a.id,a.portal,{relationshipType:"Service2Service"});return!(g?.data?.relatedItems&&g.data.relatedItems.some(u=>["WMTS","Map Service","Vector Tile Service"].includes(u.type)))}function fe(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function G(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(n=>N(n.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>N(n.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async n=>await T.parseWhereClause(n.where,i.fieldsIndex)))],a=!1;for(let n=0;n<r.length;n++){let c=r[n].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ue(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${F(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await P(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===i.layerId),c=n?.layerDefinition?.drawingInfo?.renderer,p=n?.layerDefinition?.featureReduction,o=n?.layerDefinition?.definitionExpression;if(!c&&!p&&!o)return!1;if(!t?.ignoreItemRenderer&&c){let l=k.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await K(i,e,p)||o&&(await T.parseWhereClause(o,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function me(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=k.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await K(i,e,r))}async function he(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await G(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function ye(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await T.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function K(i,e,t){let s=t.type==="binning"?Y.fromJSON(t):X.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!Array.from(r).some(a=>d(a,e.name))}var m=new Map;m.set("oid","key");m.set("guid","key");m.set("global-id","key");m.set("blob","binary");m.set("integer","integer");m.set("small-integer","integer");m.set("big-integer","integer");m.set("single","number");m.set("double","number");m.set("long","number");m.set("number","number");m.set("date","date-time");m.set("date-only","calendar");m.set("time-only","clock");m.set("timestamp-offset","time-zone");m.set("string","string");var Ie=({fieldType:i})=>y`<calcite-icon scale=s .icon=${m.get(i)}></calcite-icon>`,ve=M`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,L=class extends j{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=S(),this.dialogNode=S(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=B({blocking:!0}),this._propWatcherTask=new J(this,{task:async([e,t])=>{if(!(N(e)&&N(t)))throw console.error("Required properties are missing."),new Error;this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this.arcgisFieldsDeleted=x(),this.arcgisBeforeModalClose=x(),this.arcgisClose=x()}static{this.properties={currentLayerInfo:16,deleteInProgress:16,fieldsAreDeletable:16,config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=ve}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.some(a=>!e.fields.find(n=>n.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async n=>await U(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await _(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=V(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await be.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?W(r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let t=this.layerFieldsMap.get(e);return t.alias??t.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await $(s,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async n=>{if(n.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(o=>{e.type==="feature"&&e.floorInfo?.floorField===o&&(e.floorInfo=null)});let p=await $(c,{query:{f:"json"},responseType:"json"});if(p){let o=p.data;this.currentLayerInfo=p.data,o&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{o.templates?.length?o.templates.forEach(f=>delete f.prototype.attributes[l]):o.types?.forEach(f=>{f.templates.forEach(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(o))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let n=new ge;n.description=a.description??"",n.name=a.name||s.newFeature,n.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(o=>{let l=!1;for(let f=0;f<a.prototype.attributes.length;f++)if(a.prototype.attributes[f]===o.name){l=!0,c[o.name]=a.prototype.attributes[o.name];break}!l&&o.editable&&(c[o.name]=o.defaultValue||null)});let p=new we({attributes:c});n.prototype=p,r.push(n)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,n={f:"json",updateDefinition:JSON.stringify(r)};await $(a,{query:{...n,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${F(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.forEach(o=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==o)),t.popupTemplate?.content?.forEach((l,f)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[f].fieldInfos=(t.popupTemplate?.content)[f].fieldInfos?.filter(v=>v.fieldName!==o))})}),t.attributeTableTemplate){let o=t.attributeTableTemplate.clone();o.elements=o.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=o}if(t.fieldConfigurations?.length){let o=H.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=o}await $(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(w=>w.id===t.layerId);if(s.forEach(w=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(g=>!(g.type==="field"&&g.fieldName===w)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(g=>g.field!==w))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(w=>!s.includes(w.name))),h?.popupInfo){s.forEach(b=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(E=>E.fieldName!==b),h.popupInfo.popupElements?.forEach((E,O)=>{E.type==="fields"&&E.fieldInfos&&(h.popupInfo.popupElements[O].fieldInfos=h.popupInfo.popupElements[O].fieldInfos.filter(Q=>Q.fieldName!==b))})});let w=`${F(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,g={};f?(g.tables=v,l.layers&&(g.layers=l.layers)):(g.layers=v,l.tables&&(g.tables=l.tables));let u={f:"json",text:JSON.stringify(g)};await $(w,{query:{...u},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else o.httpStatus===200&&(!o.data||JSON.stringify(o.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=D(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=D(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=D(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?console.error("Field cannot be deleted"):console.error("One or more fields cannot be deleted"):console.error("You must select at least one field.")),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${s?.length===1?e.deleteField:e.deleteFields} ${A(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(n=>{let c=t.find(p=>p.name===n);return y`<calcite-list-item .label=${this.getFieldLabel(n)} .description=${`{${n}}`} .value=${n} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ie({fieldType:q(n,s,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${A(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};R("arcgis-portal-field-delete",L);return L},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")