@arcgis/portal-components 5.0.0-next.1 → 5.0.0-next.11

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 (41) hide show
  1. package/dist/cdn/{TBZVZ3NK.js → 3CVUNHTA.js} +2 -2
  2. package/dist/cdn/{YKLWML27.js → DBMF5ITG.js} +1 -1
  3. package/dist/cdn/{YXRYHZH5.js → DX5BPMJT.js} +1 -1
  4. package/dist/cdn/{36SCONH7.js → GOKJITNU.js} +1 -1
  5. package/dist/cdn/JP7TWM5C.js +4 -0
  6. package/dist/cdn/{QXPXCLIB.js → KWTI237N.js} +2 -2
  7. package/dist/cdn/{OHA5XBKC.js → LZUP5EZ4.js} +2 -2
  8. package/dist/cdn/MVTC5ZD6.js +4 -0
  9. package/dist/cdn/QFO3SJJB.js +4 -0
  10. package/dist/cdn/{UAMIU7I6.js → UIE3JFL6.js} +2 -2
  11. package/dist/cdn/{M5TSWZEI.js → V3MB3BKX.js} +2 -2
  12. package/dist/cdn/{UYHDCO7W.js → YMNDATMC.js} +2 -2
  13. package/dist/cdn/index.js +2 -2
  14. package/dist/chunks/common.js +1 -1
  15. package/dist/chunks/fieldAddDelete.js +139 -148
  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 +1 -1
  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.js +62 -57
  27. package/dist/controllers/useClassificationModel.d.ts +1 -1
  28. package/dist/docs/api.json +19 -3
  29. package/dist/docs/docs.json +27 -5
  30. package/dist/docs/web-types.json +7 -3
  31. package/dist/index.js +1 -1
  32. package/dist/loader.js +2 -2
  33. package/dist/types/lumina.d.ts +1 -1
  34. package/dist/types/preact.d.ts +1 -1
  35. package/dist/types/preact10.d.ts +1 -1
  36. package/dist/types/react.d.ts +1 -1
  37. package/dist/types/stencil.d.ts +1 -1
  38. package/package.json +5 -5
  39. package/dist/cdn/3C7EKA4P.js +0 -4
  40. package/dist/cdn/MMZ2SLQM.js +0 -4
  41. package/dist/cdn/VUHRSXSV.js +0 -4
@@ -1,17 +1,18 @@
1
- import { c as C } from "../../chunks/runtime.js";
1
+ import { c as k } from "../../chunks/runtime.js";
2
2
  import { html as p, css as P } from "lit";
3
3
  import { LitElement as M, createEvent as F, renderElement as T } from "@arcgis/lumina";
4
4
  import { createRef as E, ref as N } from "lit/directives/ref.js";
5
5
  import { Task as O } from "@lit/task";
6
- import x from "@arcgis/core/layers/support/FeatureTemplate.js";
7
- import L from "@arcgis/core/Graphic.js";
8
- import S from "@arcgis/core/identity/IdentityManager.js";
6
+ import * as x from "@arcgis/core/core/lang.js";
7
+ import L from "@arcgis/core/layers/support/FeatureTemplate.js";
8
+ import S from "@arcgis/core/Graphic.js";
9
+ import j from "@arcgis/core/identity/IdentityManager.js";
9
10
  import y from "@arcgis/core/request.js";
10
- import { a as j, g as B, b as U, d as q, e as w, f as R, i as D } from "../../chunks/fieldAddDelete.js";
11
- import { u as J } from "../../chunks/useT9n.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";
12
13
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
13
14
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
14
- v5.0.0-next.1 */
15
+ v5.0.0-next.11 */
15
16
  const n = /* @__PURE__ */ new Map();
16
17
  n.set("oid", "key");
17
18
  n.set("guid", "key");
@@ -29,10 +30,10 @@ n.set("date-only", "calendar");
29
30
  n.set("time-only", "clock");
30
31
  n.set("timestamp-offset", "time-zone");
31
32
  n.set("string", "string");
32
- const z = ({ fieldType: $ }) => p`<calcite-icon scale=s .icon=${n.get($)}></calcite-icon>`, W = 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}`;
33
- class _ extends M {
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 {
34
35
  constructor() {
35
- super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = E(), this.dialogNode = E(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = J({ blocking: !0 }), this._propWatcherTask = new O(this, {
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
37
  task: async ([e, t]) => {
37
38
  if (!(D(e) && D(t)))
38
39
  throw console.error("Required properties are missing."), new Error();
@@ -45,7 +46,7 @@ class _ extends M {
45
46
  this.properties = { currentLayerInfo: 16, deleteInProgress: 16, fieldsAreDeletable: 16, config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
46
47
  }
47
48
  static {
48
- this.styles = W;
49
+ this.styles = _;
49
50
  }
50
51
  async processProps() {
51
52
  const { layer: e, mapView: t, fieldNames: s } = this;
@@ -54,27 +55,27 @@ class _ extends M {
54
55
  return;
55
56
  }
56
57
  e.loaded || await e.load(), this.layerFields = e.fields.filter((o) => s.includes(o.name));
57
- const a = s.some((o) => !e.fields.find((l) => l.name === o));
58
+ const a = s.some((o) => !e.fields.find((r) => r.name === o));
58
59
  if (!this.layerFields?.length || a)
59
60
  this.fieldsAreDeletable = !1;
60
61
  else {
61
- const o = await Promise.all(this.layerFields.map(async (l) => await j(t, e, l, this.options)));
62
- if (this.fieldsAreDeletable = o.every((l) => l), !this.fieldsAreDeletable)
62
+ const o = await Promise.all(this.layerFields.map(async (r) => await B(t, e, r, this.options)));
63
+ if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
63
64
  return;
64
65
  }
65
- if (this.layerFieldsMap = await B(e), this.options?.ignorePopupTemplate || (this.arcadeExpMap = U(e.popupTemplate)), this.portal = e.portalItem?.portal ?? this.options?.portal, this.item = e.portalItem ?? this.options?.item, !this.item) {
66
+ if (this.layerFieldsMap = await U(e), this.options?.ignorePopupTemplate || (this.arcadeExpMap = q(e.popupTemplate)), this.portal = e.portalItem?.portal ?? this.options?.portal, this.item = e.portalItem ?? this.options?.item, !this.item) {
66
67
  this.fieldsAreDeletable = !1;
67
68
  return;
68
69
  }
69
- await S.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
70
+ await j.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
70
71
  }
71
72
  getFieldLabel(e) {
72
73
  const { layer: t, arcadeExpMap: s } = this;
73
74
  if (this.options?.ignorePopupTemplate)
74
75
  return this.getFieldDisplayNameFromLayerFields(e);
75
76
  {
76
- const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((l) => l.fieldName === e);
77
- return o ? q(o, s) : this.getFieldDisplayNameFromLayerFields(e);
77
+ const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
78
+ return o ? R(o, s) : this.getFieldDisplayNameFromLayerFields(e);
78
79
  }
79
80
  }
80
81
  getFieldDisplayNameFromLayerFields(e) {
@@ -83,8 +84,8 @@ class _ extends M {
83
84
  }
84
85
  async deleteFields() {
85
86
  const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
86
- fields: t.map((l) => ({
87
- name: l
87
+ fields: t.map((r) => ({
88
+ name: r
88
89
  }))
89
90
  }, o = {
90
91
  deleteFromDefinition: JSON.stringify(a)
@@ -93,18 +94,18 @@ class _ extends M {
93
94
  query: { ...o, f: "json", async: !1 },
94
95
  method: "post",
95
96
  responseType: "json"
96
- }).then(async (l) => {
97
- if (l.data?.success) {
97
+ }).then(async (r) => {
98
+ if (r.data?.success) {
98
99
  const h = `${e.url}/${e.layerId}`;
99
100
  t.forEach((i) => {
100
101
  e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
101
102
  });
102
- const m = await y(h, { query: { f: "json" }, responseType: "json" });
103
- if (m) {
104
- const i = m.data;
105
- this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((r) => {
106
- i.templates?.length ? i.templates.forEach((c) => delete c.prototype.attributes[r]) : i.types?.forEach((c) => {
107
- c.templates.forEach((u) => delete u.prototype.attributes[r]);
103
+ const u = await y(h, { query: { f: "json" }, responseType: "json" });
104
+ if (u) {
105
+ const i = u.data;
106
+ this.currentLayerInfo = u.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((l) => {
107
+ i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[l]) : i.types?.forEach((d) => {
108
+ d.templates.forEach((m) => delete m.prototype.attributes[l]);
108
109
  });
109
110
  }), this.updateFeatureService(i));
110
111
  } else
@@ -127,20 +128,20 @@ class _ extends M {
127
128
  updateTemplatesList(e) {
128
129
  const { currentLayerInfo: t, messages: s } = this, a = [];
129
130
  return (e ?? []).forEach((o) => {
130
- const l = new x();
131
- l.description = o.description ?? "", l.name = o.name || s.newFeature, l.drawingTool = o.drawingTool || "point";
131
+ const r = new L();
132
+ r.description = o.description ?? "", r.name = o.name || s.newFeature, r.drawingTool = o.drawingTool || "point";
132
133
  const h = {};
133
134
  t.fields.forEach((i) => {
134
- let r = !1;
135
- for (let c = 0; c < o.prototype.attributes.length; c++)
136
- if (o.prototype.attributes[c] === i.name) {
137
- r = !0, h[i.name] = o.prototype.attributes[i.name];
135
+ let l = !1;
136
+ for (let d = 0; d < o.prototype.attributes.length; d++)
137
+ if (o.prototype.attributes[d] === i.name) {
138
+ l = !0, h[i.name] = o.prototype.attributes[i.name];
138
139
  break;
139
140
  }
140
- !r && i.editable && (h[i.name] = i.defaultValue || null);
141
+ !l && i.editable && (h[i.name] = i.defaultValue || null);
141
142
  });
142
- const m = new L({ attributes: h });
143
- l.prototype = m, a.push(l);
143
+ const u = new S({ attributes: h });
144
+ r.prototype = u, a.push(r);
144
145
  }), a;
145
146
  }
146
147
  addType(e, t) {
@@ -150,42 +151,46 @@ class _ extends M {
150
151
  const { layer: t, fieldNames: s } = this, a = {
151
152
  templates: e.templates,
152
153
  types: e.types
153
- }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, l = {
154
+ }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, r = {
154
155
  f: "json",
155
156
  updateDefinition: JSON.stringify(a)
156
157
  };
157
158
  await y(o, {
158
- query: { ...l, f: "json" },
159
+ query: { ...r, f: "json" },
159
160
  method: "post",
160
161
  responseType: "json"
161
162
  }).then(async (h) => {
162
163
  if (h.data?.success) {
163
- const m = `${w(this.portal)}content/items/${this.item.id}/data`;
164
+ const u = `${w(this.portal)}content/items/${this.item.id}/data`;
164
165
  if (this.options?.ignorePopupTemplate || s.forEach((i) => {
165
- t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((r) => r.fieldName !== i)), t.popupTemplate?.content?.forEach((r, c) => {
166
- r.type === "fields" && r.fieldInfos && ((t.popupTemplate?.content)[c].fieldInfos = (t.popupTemplate?.content)[c].fieldInfos?.filter((u) => u.fieldName !== i));
166
+ t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
167
+ l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((m) => m.fieldName !== i));
167
168
  });
168
169
  }), t.attributeTableTemplate) {
169
170
  const i = t.attributeTableTemplate.clone();
170
- i.elements = i.elements.filter((r) => !(r.type === "field" && s.includes(r.fieldName))), i.orderByFields = i.orderByFields.filter((r) => !s.includes(r.field)), t.attributeTableTemplate = i;
171
+ i.elements = i.elements.filter((l) => !(l.type === "field" && s.includes(l.fieldName))), i.orderByFields = i.orderByFields.filter((l) => !s.includes(l.field)), t.attributeTableTemplate = i;
171
172
  }
172
- await y(m, {
173
+ if (t.fieldConfigurations?.length) {
174
+ const l = x.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
175
+ t.fieldConfigurations = l;
176
+ }
177
+ await y(u, {
173
178
  query: { f: "json" },
174
179
  responseType: "json"
175
180
  }).then(async (i) => {
176
- const r = i.data;
177
- if (r?.layers || r?.tables) {
178
- const c = t.isTable, u = c ? r.tables : r.layers, d = u?.find((g) => g.id === t.layerId);
181
+ const l = i.data;
182
+ if (l?.layers || l?.tables) {
183
+ const d = t.isTable, m = d ? l.tables : l.layers, c = m?.find((g) => g.id === t.layerId);
179
184
  if (s.forEach((g) => {
180
- d?.attributeTableInfo?.attributeTableElements && (d.attributeTableInfo.attributeTableElements = d.attributeTableInfo.attributeTableElements.filter((f) => !(f.type === "field" && f.fieldName === g)), d.attributeTableInfo.orderByFields = d.attributeTableInfo.orderByFields.filter((f) => f.field !== g));
181
- }), d?.fieldConfiguration && (d.fieldConfiguration = d.fieldConfiguration.filter((g) => !s.includes(g.name))), d?.popupInfo) {
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
+ }), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
182
187
  s.forEach((b) => {
183
- d.popupInfo.fieldInfos = d.popupInfo.fieldInfos.filter((v) => v.fieldName !== b), d.popupInfo.popupElements?.forEach((v, I) => {
184
- v.type === "fields" && v.fieldInfos && (d.popupInfo.popupElements[I].fieldInfos = d.popupInfo.popupElements[I].fieldInfos.filter((k) => k.fieldName !== 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));
185
190
  });
186
191
  });
187
192
  const g = `${w(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
188
- c ? (f.tables = u, r.layers && (f.layers = r.layers)) : (f.layers = u, r.tables && (f.tables = r.tables));
193
+ d ? (f.tables = m, l.layers && (f.layers = l.layers)) : (f.layers = m, l.tables && (f.tables = l.tables));
189
194
  const A = {
190
195
  f: "json",
191
196
  text: JSON.stringify(f)
@@ -240,9 +245,9 @@ class _ extends M {
240
245
  }
241
246
  renderFieldsPreview() {
242
247
  const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
243
- return p`<calcite-list .label=${o.fields}>${e.map((l) => {
244
- const h = t.find((m) => m.name === l);
245
- return p`<calcite-list-item .label=${this.getFieldLabel(l)} .description=${`{${l}}`} .value=${l} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${z({ fieldType: R(l, s, a) })}</div></calcite-list-item>`;
248
+ return p`<calcite-list .label=${o.fields}>${e.map((r) => {
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>`;
246
251
  })}</calcite-list>`;
247
252
  }
248
253
  renderCancelButton() {
@@ -257,7 +262,7 @@ class _ extends M {
257
262
  }}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
258
263
  }
259
264
  }
260
- C("arcgis-portal-field-delete", _);
265
+ k("arcgis-portal-field-delete", V);
261
266
  export {
262
- _ as ArcgisPortalFieldDelete
267
+ V as ArcgisPortalFieldDelete
263
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-26T04:37:34",
2
+ "timestamp": "2025-10-05T04:46:50",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.1",
5
+ "version": "5.0.0-next.11",
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",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-09-26T04:37:34",
2
+ "timestamp": "2025-10-05T04:46:50",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.1",
5
+ "version": "5.0.0-next.11",
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}",
@@ -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.1",
4
+ "version": "5.0.0-next.11",
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}"
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.1 */
5
+ v5.0.0-next.11 */
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.1 */
5
+ v5.0.0-next.11 */
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,7 +16,7 @@ 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
 
@@ -17,7 +17,7 @@ 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
 
@@ -21,7 +21,7 @@ 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
 
@@ -17,7 +17,7 @@ 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
 
@@ -17,7 +17,7 @@ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/portal-components",
3
- "version": "5.0.0-next.1",
3
+ "version": "5.0.0-next.11",
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.1",
42
- "@arcgis/toolkit": "5.0.0-next.1",
41
+ "@arcgis/lumina": "5.0.0-next.11",
42
+ "@arcgis/toolkit": "5.0.0-next.11",
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
- "@arcgis/core": ">=4.34.0-next.43 <4.35",
49
- "@esri/calcite-components": "^3.3.0"
48
+ "@arcgis/core": ">=5.0.0-next.1 <5.1",
49
+ "@esri/calcite-components": "^3.3.1"
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.1 */
4
- import{b as J}from"./M5TSWZEI.js";import{d as B}from"./UYHDCO7W.js";import{B as D,C as A,D as j,G as S,I as R,h as M,j as y,p as P}from"./YXRYHZH5.js";export default $arcgis.t(([ge,we,be,E,I,Y,Q,k,T,$])=>{var L=(s=>(s.expression="expression/",s.raster="Raster.",s.relationship="relationships/",s))(L||{});function N(s){return s!=null}function q(s,e){let t=s.fieldName;if(t.includes(L.expression)){let i=e.get(t);return i?.title?i.title:t}else return s.label?s.label:t}function W(s,e,t){let i="";if(/^raster.(?:item|service)pixelvalue/iu.test(s))i="number";else if(e.has(s)){let r=e.get(s);i=r.type?r.type.toLowerCase():""}else if(t.has(s)){let r=t.get(s);i=r.returnType?r.returnType.toLowerCase():""}else i="number";return i}async function V(s){return new Map((await X(s)).filter(e=>e.visible).map(e=>[e.name,e]))}function G(s){let e=new Map;return s?.expressionInfos&&s.expressionInfos.forEach(t=>{let i=`${L.expression}${t.name}`;e.set(i,t)}),e}async function X(s){return await new Promise((e,t)=>{switch(s.type){case"feature":case"ogc-feature":case"stream":e(s.fields);break;case"sublayer":{let i=s,r=i?.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(i.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(i.fields)}).catch(a=>{t(new Error(a))}):e(i.fields);break}case"imagery":case"imagery-tile":case"wcs":e(s.rasterFields);break;default:e("fields"in s?s.fields??[]:[])}})}var Z=s=>s&&!s.endsWith("/")?`${s}/`:s;function F(s){return Z(s.restUrl)}function ee(s,e){return _(s,e)||te(s,e)}function _(s,e){return s.owner===e.username}function te(s,e){let t=s.owner,i=s.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return s.portal?.isPortal&&!_(s,e)&&i&&t?.includes("esri_")&&!r.includes(t)?!1:i}function se(s){return s.typeKeywords?.includes("Spatiotemporal")}function ie(s){return s.typeKeywords?.includes("View Service")}function re(s){return s.typeKeywords?.includes("Hosted Service")}function ae(s){return s.typeKeywords?.includes("Multi Services View")}function ne(s){return s?.hasViews&&!s.sourceSchemaChangesAllowed}async function oe(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal;if(t?.user){let i=`${F(t)}community/users/${t.user.username}`;return await T(i,{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 le(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal,i=`${F(t)}content/items/${e.id}/groups`;return await T(i,{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 de(s,e,{relationshipType:t,direction:i}){let r=`${F(e)}content/items/${s}/relatedItems`;return await T(r,{query:{f:"json",relationshipType:t,direction:i},responseType:"json"})}function ce(s,e){return s?.some(t=>e?.some(i=>t.id===i.id&&t.capabilities.includes("updateitemcontrol")))}function d(s,e){return!s||!e?!1:s.toLocaleLowerCase()===e.toLocaleLowerCase()}async function z(s,e,t,i){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=i?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!re(a)||ie(a)||ae(a)||ne(n)||a.portal.isPortal&&se(a)||["oid","global-id","geometry"].includes(t.type)||await pe(e,t.name,i))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(!i?.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(!i?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(u=>d(u,t.name)))return!1;if(!i?.ignoreLayerLabelingInfo){let u=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(u&&((await I.getExpressionFields(e,u)).some(b=>d(b,t.name))||await U(e,t,"layer")))return!1}if(!i?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await $.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await ue(e,t,i)||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(s,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=ee(a,a.portal.user),v=i?.userItemInfo?.userGroups??await oe(e)??[],h=i?.userItemInfo?.itemGroups??await le(e)??[],w=ce(v,h);if(!f&&!w)return!1;let g=i?.userItemInfo?.relatedItems??await de(a.id,a.portal,{relationshipType:"Service2Service"});return!(g?.data?.relatedItems&&g.data.relatedItems.some(u=>["WMTS","Map Service","Vector Tile Service"].includes(u.type)))}async function pe(s,e,t){let i=`${s.url}/${s.layerId}/fieldGroups`,r=t?.userItemInfo?.fieldGroups??(await T(i,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}function fe(s,e,t){if(!s)return!1;let i=s.map?.applicationProperties?.viewing?.search;if(i){let r=i.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 U(s,e,t){let i=t==="layer"?s.labelingInfo?.filter(n=>N(n.where)):s.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>N(n.where));if(!i?.length)return!1;let r=[...await Promise.all(i.map(async n=>await $.parseWhereClause(n.where,s.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(s,e,t){let i=s.portalItem;if(!i)return!1;let r=`${F(i.portal)}content/items/${i.id}/data`,a=(t?.userItemInfo?.itemData??await T(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===s.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,s.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await K(s,e,p)||o&&(await $.parseWhereClause(o,s.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function me(s,e){let t=s.sourceJSON,i=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!i&&!r)return!1;if(i){let a=k.fromJSON(i);if((await I.getRendererFields(a,s.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await K(s,e,r))}async function he(s,e){let t=s.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let i=t?.map(r=>r.labelExpressionInfo?.expression);if(i){if((await I.getExpressionFields(s,i)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await U(s,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function ye(s,e){let t=s.sourceJSON?.definitionQuery;return t?(await $.parseWhereClause(t,s.fieldsIndex)).fieldNames.some(i=>d(i,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function K(s,e,t){let i=t.type==="binning"?Y.fromJSON(t):Q.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,s,i),!!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:s})=>y`<calcite-icon scale=s .icon=${m.get(s)}></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}`,C=class extends j{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=D(),this.dialogNode=D(),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=P(),this.arcgisBeforeModalClose=P(),this.arcgisClose=P()}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:i}=this;if(!e||!i){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>i.includes(a.name));let r=i.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 z(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await V(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=G(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:i}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?q(r,i):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let t=this.layerFieldsMap.get(e);return t.alias??t.name}async deleteFields(){let{layer:e,fieldNames:t}=this,i=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await E(i,{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 E(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 i=this.updateTemplatesList(t.templates);t.templates=i}else if(t.types){let i=t.types;t.types=[],i.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:i}=this,r=[];return(e??[]).forEach(a=>{let n=new ge;n.description=a.description??"",n.name=a.name||i.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(i=>i.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:i}=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 E(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||i.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"&&i.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!i.includes(l.field)),t.attributeTableTemplate=o}await E(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(i.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?.fieldConfiguration&&(h.fieldConfiguration=h.fieldConfiguration.filter(w=>!i.includes(w.name))),h?.popupInfo){i.forEach(b=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(x=>x.fieldName!==b),h.popupInfo.popupElements?.forEach((x,O)=>{x.type==="fields"&&x.fieldInfos&&(h.popupInfo.popupElements[O].fieldInfos=h.popupInfo.popupElements[O].fieldInfos.filter(H=>H.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 E(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=S(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=S(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=S(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:i,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(i?.length?i?.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=${i?.length===1?e.deleteField:e.deleteFields} ${A(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${i.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:i}=this;return y`<div class=${`loader-container ${i?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!i}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:i,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:W(n,i,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 i=>{let{portal:r}=this;i.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",C);return C},"layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")
@@ -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.1 */
4
- import{a as m}from"./TBZVZ3NK.js";import{d as h}from"./UYHDCO7W.js";import{D as b,F as a,I as d,h as c,j as i,p as u}from"./YXRYHZH5.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function l(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0}}static{this.styles=g}willUpdate(e){e.has("renderingInfo")&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.attribute.isRequired&&!this.value)return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return l(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return l(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!l(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){return l(this.attribute,"single-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} .placeholder=${this.attribute.description??this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} text-label=${t.label??a} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo.valueExpressionResult))return;let e=this.value;return this.renderingInfo.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} text-label=${t.label??a} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return l(this.attribute,"multi-select")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>`:null}_renderGroupedComboboxOptions(){if(!this.renderingInfo.valueExpressionResult||Array.isArray(this.renderingInfo.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} text-label=${t??a} .value=${t}>${r.map(s=>i`<calcite-combobox-item .selected=${e?.includes(s.value)} text-label=${s.label??a} .value=${s.value} data-testid=${`grouped-combobox-item-${s.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return l(this.attribute,"multi-grouped-select-nested")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey??a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${e=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .placeholder=${this.attribute.description??this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};