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

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 (147) hide show
  1. package/dist/cdn/3BOLT543.js +4 -0
  2. package/dist/cdn/5SZ4BUDH.js +4 -0
  3. package/dist/cdn/65ROHP2V.js +4 -0
  4. package/dist/cdn/6TKNVPCV.js +4 -0
  5. package/dist/cdn/{YKLWML27.js → BGIDIIMY.js} +2 -2
  6. package/dist/cdn/BSK7ZXY7.js +6 -0
  7. package/dist/cdn/J27ARXGH.js +4 -0
  8. package/dist/cdn/JM7MX5TZ.js +4 -0
  9. package/dist/cdn/LJ3I2F7B.js +4 -0
  10. package/dist/cdn/PDSESC3R.js +4 -0
  11. package/dist/cdn/PJNXGCYW.js +4 -0
  12. package/dist/cdn/PUEIILLK.js +4 -0
  13. package/dist/cdn/VQFGIEOF.js +4 -0
  14. package/dist/cdn/{36SCONH7.js → WJNAR5WR.js} +1 -1
  15. package/dist/cdn/YJPLZKMU.js +4 -0
  16. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
  17. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
  18. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
  19. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
  20. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
  21. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
  22. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
  23. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
  24. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
  25. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
  26. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
  27. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
  28. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
  29. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
  30. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
  31. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
  32. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
  33. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
  34. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
  35. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
  36. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
  37. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
  38. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
  39. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
  40. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
  41. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
  42. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
  43. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
  44. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
  45. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
  46. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
  47. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
  48. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
  49. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
  50. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
  51. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
  52. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
  53. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
  54. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
  55. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
  56. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
  57. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
  58. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
  59. package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
  60. package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
  61. package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
  62. package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
  63. package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
  64. package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
  65. package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
  66. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
  67. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
  68. package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
  69. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
  70. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
  71. package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
  72. package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
  73. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
  74. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
  75. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
  76. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
  77. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
  78. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
  79. package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
  80. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
  81. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
  82. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
  83. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
  84. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
  85. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
  86. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
  87. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
  88. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
  89. package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
  90. package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
  91. package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
  92. package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
  93. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
  94. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
  95. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
  96. package/dist/cdn/index.js +2 -2
  97. package/dist/cdn/main.css +1 -1
  98. package/dist/chunks/common.js +1 -1
  99. package/dist/chunks/fieldAddDelete.js +71 -67
  100. package/dist/chunks/loadClassificationData.js +1 -1
  101. package/dist/chunks/requests.js +2 -2
  102. package/dist/chunks/runtime.js +2 -2
  103. package/dist/chunks/useT9n.js +1 -1
  104. package/dist/components/arcgis-portal-classification-banner/customElement.js +18 -17
  105. package/dist/components/arcgis-portal-classification-config/customElement.js +111 -103
  106. package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
  107. package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +2 -1
  108. package/dist/components/arcgis-portal-classification-form-element/customElement.js +15 -15
  109. package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +51 -0
  110. package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
  111. package/dist/components/arcgis-portal-extent-picker/index.d.ts +8 -0
  112. package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
  113. package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +28 -0
  114. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +26 -0
  115. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
  116. package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +3 -0
  117. package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
  118. package/dist/components/arcgis-portal-field-delete/customElement.d.ts +4 -2
  119. package/dist/components/arcgis-portal-field-delete/customElement.js +82 -75
  120. package/dist/docs/api.json +316 -38
  121. package/dist/docs/docs.json +310 -9
  122. package/dist/docs/vscode.html-custom-data.json +33 -1
  123. package/dist/docs/web-types.json +133 -2
  124. package/dist/index.d.ts +27 -5
  125. package/dist/index.js +1 -1
  126. package/dist/loader.d.ts +1 -1
  127. package/dist/loader.js +7 -5
  128. package/dist/types/classification.d.ts +1 -1
  129. package/dist/types/components.d.ts +1 -1
  130. package/dist/types/lumina.d.ts +15 -6
  131. package/dist/types/preact.d.ts +16 -6
  132. package/dist/types/preact10.d.ts +17 -6
  133. package/dist/types/react.d.ts +17 -6
  134. package/dist/types/stencil.d.ts +15 -6
  135. package/dist/utils/commonFunctions.d.ts +2 -1
  136. package/dist/utils/style.d.ts +1 -0
  137. package/package.json +6 -6
  138. package/dist/cdn/3C7EKA4P.js +0 -4
  139. package/dist/cdn/M5TSWZEI.js +0 -4
  140. package/dist/cdn/MMZ2SLQM.js +0 -4
  141. package/dist/cdn/OHA5XBKC.js +0 -4
  142. package/dist/cdn/QXPXCLIB.js +0 -4
  143. package/dist/cdn/TBZVZ3NK.js +0 -4
  144. package/dist/cdn/UAMIU7I6.js +0 -4
  145. package/dist/cdn/UYHDCO7W.js +0 -4
  146. package/dist/cdn/VUHRSXSV.js +0 -4
  147. package/dist/cdn/YXRYHZH5.js +0 -6
@@ -0,0 +1,60 @@
1
+ import { c as n } from "../../chunks/runtime.js";
2
+ import { createRef as c, ref as d } from "lit/directives/ref.js";
3
+ import { LitElement as u, createEvent as p, safeClassMap as a, nothing as s } from "@arcgis/lumina";
4
+ import { css as h, html as o } from "lit";
5
+ import { useDirection as m } from "@arcgis/lumina/controllers";
6
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
7
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
8
+ v5.0.0-next.100 */
9
+ const g = h`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-status-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-color-status-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`;
10
+ class v extends u {
11
+ constructor() {
12
+ super(...arguments), this._direction = m(), this.inputEl = c(), this.isInvalid = !1, this.currentError = "", this.inputValue = "", this.label = "", this.value = "", this.errorMessage = "", this.min = -180, this.max = 180, this.validateRelated = () => !0, this.relatedErrorMessage = "", this.inputId = "", this.arcgisCoordChange = p();
13
+ }
14
+ static {
15
+ this.properties = { isInvalid: 16, currentError: 16, inputValue: 16, label: 1, value: 1, errorMessage: 1, min: 9, max: 9, validateRelated: 0, relatedErrorMessage: 1, inputId: 1 };
16
+ }
17
+ static {
18
+ this.styles = g;
19
+ }
20
+ checkRelatedField() {
21
+ return !this.inputValue || !this.isInvalid || !this.validate(this.inputValue) ? "" : this.inputValue;
22
+ }
23
+ isValid() {
24
+ return !this.isInvalid;
25
+ }
26
+ setFocus() {
27
+ this.inputEl.value?.focus();
28
+ }
29
+ willUpdate(r) {
30
+ r.has("value") && this.validate(r.get("value"));
31
+ }
32
+ isValidCoord(r, t, i) {
33
+ if (!r?.match(/^-?[0-9]*(\.|,)?[0-9]+$/u))
34
+ return !1;
35
+ const e = this.parseNumber(r);
36
+ return e >= t && e <= i;
37
+ }
38
+ validate(r) {
39
+ if (this.isInvalid = !this.isValidCoord(r, this.min, this.max), this.isInvalid)
40
+ return this.currentError = this.errorMessage, !1;
41
+ const t = this.parseNumber(r);
42
+ return this.isInvalid = !this.validateRelated(t), this.isInvalid ? (this.currentError = this.relatedErrorMessage, !1) : !0;
43
+ }
44
+ parseNumber(r) {
45
+ const t = `-${Array.from({ length: 10 }, (e, l) => l.toString()).join("")}`;
46
+ let i = r.replace(",", ".");
47
+ return i = Array.from(i).filter((e) => t.includes(e) || e === ".").join(""), parseFloat(i);
48
+ }
49
+ render() {
50
+ return o`<div class=${a({ "coord-field": !0, "is-rtl": this._direction === "rtl" })}><label class="coord-label" for=${this.inputId ?? s}>${this.label}</label><calcite-input-number number-button-type=none id=${this.inputId ?? s} class=${a({
51
+ "coordinate-input": !0
52
+ })} .value=${`${this.parseNumber(this.value)}`} @calciteInputNumberChange=${(r) => {
53
+ this.inputValue = r.target.value, this.validate(this.inputValue) && this.arcgisCoordChange.emit(this.inputValue);
54
+ }} .status=${this.isInvalid ? "invalid" : "valid"} ${d(this.inputEl)}></calcite-input-number>${this.isInvalid && o`<div class="coord-error-message"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon><div class="coord-error-message__text">${this.currentError}</div></div>` || ""}</div>`;
55
+ }
56
+ }
57
+ n("arcgis-portal-extent-picker-coord-field", v);
58
+ export {
59
+ v as ArcgisPortalExtentPickerCoordField
60
+ };
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-input-number";
2
+ import "@esri/calcite-components/components/calcite-icon";
3
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-input-number";
2
+ import "@esri/calcite-components/components/calcite-icon";
3
+ export * from "./customElement.js";
@@ -14,10 +14,12 @@ export declare class ArcgisPortalFieldDelete extends LitElement {
14
14
  mapView?: __esri.MapView;
15
15
  /** Properties that may need to be passed in case values differ from what is available on Map Viewer. */
16
16
  options?: FieldDeleteOptions;
17
- /** Emitted when the field is successfully deleted. */
18
- readonly arcgisFieldsDeleted: TargetedEvent<this, void>;
19
17
  /** Emitted before the modal is closed if the alert is handled in consumer. */
20
18
  readonly arcgisBeforeModalClose: TargetedEvent<this, string>;
21
19
  /** Emitted when the component is closed for any reason. */
22
20
  readonly arcgisClose: TargetedEvent<this, void>;
21
+ /** Emitted when the user initiates the delete process. */
22
+ readonly arcgisBeforeDelete: TargetedEvent<this, void>;
23
+ /** Emitted when the field is successfully deleted. */
24
+ readonly arcgisFieldsDeleted: TargetedEvent<this, void>;
23
25
  }
@@ -1,17 +1,19 @@
1
- import { c as C } 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";
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";
1
+ import { c as P } from "../../chunks/runtime.js";
2
+ import { html as p, css as O } from "lit";
3
+ import { LitElement as x, createEvent as T, renderElement as E } from "@arcgis/lumina";
4
+ import { createRef as w, ref as D } from "lit/directives/ref.js";
5
+ import { Task as L } from "@lit/task";
6
+ import * as S from "@arcgis/core/core/lang.js";
7
+ import B from "@arcgis/core/layers/support/FeatureTemplate.js";
8
+ import j from "@arcgis/core/Graphic.js";
9
+ import U 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 { i as $, a as q, g as R, b as J, d as z, s as W, e as A, f as _ } from "../../chunks/fieldAddDelete.js";
12
+ import { u as V } from "../../chunks/useT9n.js";
13
+ import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
12
14
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
13
15
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
14
- v5.0.0-next.1 */
16
+ v5.0.0-next.100 */
15
17
  const n = /* @__PURE__ */ new Map();
16
18
  n.set("oid", "key");
17
19
  n.set("guid", "key");
@@ -29,23 +31,24 @@ n.set("date-only", "calendar");
29
31
  n.set("time-only", "clock");
30
32
  n.set("timestamp-offset", "time-zone");
31
33
  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 {
34
+ const H = ({ fieldType: I }) => p`<calcite-icon scale=s .icon=${n.get(I)}></calcite-icon>`, K = O`.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}`;
35
+ class Q extends x {
34
36
  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, {
37
+ super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = w(), this.dialogNode = w(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = V({ blocking: !0 }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this._propWatcherTask = new L(this, {
36
38
  task: async ([e, t]) => {
37
- if (!(D(e) && D(t)))
38
- throw console.error("Required properties are missing."), new Error();
39
+ const s = $(e) && $(t);
40
+ if ($(e) || b("error", this, C("layer")), $(t) || b("error", this, C("fieldNames")), !s)
41
+ throw new Error("Required properties are missing");
39
42
  this._propWatcherTask.autoRun = !1, await this.processProps();
40
43
  },
41
44
  args: () => [this.layer, this.fieldNames]
42
- }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this.arcgisFieldsDeleted = F(), this.arcgisBeforeModalClose = F(), this.arcgisClose = F();
45
+ }), this.arcgisBeforeModalClose = T(), this.arcgisClose = T(), this.arcgisBeforeDelete = T(), this.arcgisFieldsDeleted = T();
43
46
  }
44
47
  static {
45
- this.properties = { currentLayerInfo: 16, deleteInProgress: 16, fieldsAreDeletable: 16, config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
48
+ this.properties = { config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
46
49
  }
47
50
  static {
48
- this.styles = W;
51
+ this.styles = K;
49
52
  }
50
53
  async processProps() {
51
54
  const { layer: e, mapView: t, fieldNames: s } = this;
@@ -54,37 +57,37 @@ class _ extends M {
54
57
  return;
55
58
  }
56
59
  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));
60
+ const a = s.some((o) => !e.fields.find((r) => r.name === o));
58
61
  if (!this.layerFields?.length || a)
59
62
  this.fieldsAreDeletable = !1;
60
63
  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)
64
+ const o = await Promise.all(this.layerFields.map(async (r) => await q(t, e, r, this.options)));
65
+ if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
63
66
  return;
64
67
  }
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) {
68
+ if (this.layerFieldsMap = await R(e), this.options?.ignorePopupTemplate || (this.arcadeExpMap = J(e.popupTemplate)), this.portal = e.portalItem?.portal ?? this.options?.portal, this.item = e.portalItem ?? this.options?.item, !this.item) {
66
69
  this.fieldsAreDeletable = !1;
67
70
  return;
68
71
  }
69
- await S.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
72
+ await U.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
70
73
  }
71
74
  getFieldLabel(e) {
72
75
  const { layer: t, arcadeExpMap: s } = this;
73
76
  if (this.options?.ignorePopupTemplate)
74
77
  return this.getFieldDisplayNameFromLayerFields(e);
75
78
  {
76
- const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((l) => l.fieldName === e);
77
- return o ? q(o, s) : this.getFieldDisplayNameFromLayerFields(e);
79
+ const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
80
+ return o ? z(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
78
81
  }
79
82
  }
80
83
  getFieldDisplayNameFromLayerFields(e) {
81
- const t = this.layerFieldsMap.get(e);
82
- return t.alias ?? t.name;
84
+ const { layer: t } = this, s = this.layerFieldsMap.get(e);
85
+ return W(t) ? t.getFieldAlias(e) : s.alias ?? s.name;
83
86
  }
84
87
  async deleteFields() {
85
88
  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
89
+ fields: t.map((r) => ({
90
+ name: r
88
91
  }))
89
92
  }, o = {
90
93
  deleteFromDefinition: JSON.stringify(a)
@@ -93,8 +96,8 @@ class _ extends M {
93
96
  query: { ...o, f: "json", async: !1 },
94
97
  method: "post",
95
98
  responseType: "json"
96
- }).then(async (l) => {
97
- if (l.data?.success) {
99
+ }).then(async (r) => {
100
+ if (r.data?.success) {
98
101
  const h = `${e.url}/${e.layerId}`;
99
102
  t.forEach((i) => {
100
103
  e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
@@ -102,9 +105,9 @@ class _ extends M {
102
105
  const m = await y(h, { query: { f: "json" }, responseType: "json" });
103
106
  if (m) {
104
107
  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]);
108
+ this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((l) => {
109
+ i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[l]) : i.types?.forEach((d) => {
110
+ d.templates.forEach((u) => delete u.prototype.attributes[l]);
108
111
  });
109
112
  }), this.updateFeatureService(i));
110
113
  } else
@@ -127,20 +130,20 @@ class _ extends M {
127
130
  updateTemplatesList(e) {
128
131
  const { currentLayerInfo: t, messages: s } = this, a = [];
129
132
  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";
133
+ const r = new B();
134
+ r.description = o.description ?? "", r.name = o.name || s.newFeature, r.drawingTool = o.drawingTool || "point";
132
135
  const h = {};
133
136
  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];
137
+ let l = !1;
138
+ for (let d = 0; d < o.prototype.attributes.length; d++)
139
+ if (o.prototype.attributes[d] === i.name) {
140
+ l = !0, h[i.name] = o.prototype.attributes[i.name];
138
141
  break;
139
142
  }
140
- !r && i.editable && (h[i.name] = i.defaultValue || null);
143
+ !l && i.editable && (h[i.name] = i.defaultValue || null);
141
144
  });
142
- const m = new L({ attributes: h });
143
- l.prototype = m, a.push(l);
145
+ const m = new j({ attributes: h });
146
+ r.prototype = m, a.push(r);
144
147
  }), a;
145
148
  }
146
149
  addType(e, t) {
@@ -150,54 +153,58 @@ class _ extends M {
150
153
  const { layer: t, fieldNames: s } = this, a = {
151
154
  templates: e.templates,
152
155
  types: e.types
153
- }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, l = {
156
+ }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, r = {
154
157
  f: "json",
155
158
  updateDefinition: JSON.stringify(a)
156
159
  };
157
160
  await y(o, {
158
- query: { ...l, f: "json" },
161
+ query: { ...r, f: "json" },
159
162
  method: "post",
160
163
  responseType: "json"
161
164
  }).then(async (h) => {
162
165
  if (h.data?.success) {
163
- const m = `${w(this.portal)}content/items/${this.item.id}/data`;
166
+ const m = `${A(this.portal)}content/items/${this.item.id}/data`;
164
167
  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));
168
+ t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
169
+ l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((u) => u.fieldName !== i));
167
170
  });
168
171
  }), t.attributeTableTemplate) {
169
172
  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;
173
+ 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;
174
+ }
175
+ if (t.fieldConfigurations?.length) {
176
+ const l = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
177
+ t.fieldConfigurations = l;
171
178
  }
172
179
  await y(m, {
173
180
  query: { f: "json" },
174
181
  responseType: "json"
175
182
  }).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);
183
+ const l = i.data;
184
+ if (l?.layers || l?.tables) {
185
+ const d = t.isTable, u = d ? l.tables : l.layers, c = u?.find((g) => g.id === t.layerId);
179
186
  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) {
182
- 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));
187
+ 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));
188
+ }), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
189
+ s.forEach((F) => {
190
+ c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== F), c.popupInfo.popupElements?.forEach((v, N) => {
191
+ v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[N].fieldInfos = c.popupInfo.popupElements[N].fieldInfos.filter((M) => M.fieldName !== F));
185
192
  });
186
193
  });
187
- 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));
189
- const A = {
194
+ const g = `${A(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
195
+ d ? (f.tables = u, l.layers && (f.layers = l.layers)) : (f.layers = u, l.tables && (f.tables = l.tables));
196
+ const k = {
190
197
  f: "json",
191
198
  text: JSON.stringify(f)
192
199
  };
193
200
  await y(g, {
194
201
  query: {
195
- ...A
202
+ ...k
196
203
  },
197
204
  method: "post",
198
205
  responseType: "json"
199
- }).then((b) => {
200
- b.data?.success ? this.handleSuccess() : this.handleError();
206
+ }).then((F) => {
207
+ F.data?.success ? this.handleSuccess() : this.handleError();
201
208
  }, () => this.handleError());
202
209
  } else
203
210
  this.handleSuccess();
@@ -214,20 +221,20 @@ class _ extends M {
214
221
  }
215
222
  displaySuccessAlert() {
216
223
  const { messages: e, fieldNames: t } = this;
217
- this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode = T(p`<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);
224
+ this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode = E(p`<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);
218
225
  }
219
226
  displayErrorAlert() {
220
227
  const { messages: e } = this;
221
- this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = T(p`<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);
228
+ this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<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);
222
229
  }
223
230
  displayReadOnlyErrorAlert() {
224
231
  const { messages: e, portal: t } = this;
225
- this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = T(p`<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 && p`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>` || ""}</calcite-alert>`), document.body.append(this.errorAlertNode);
232
+ this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<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 && p`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>` || ""}</calcite-alert>`), document.body.append(this.errorAlertNode);
226
233
  }
227
234
  render() {
228
235
  const { messages: e, fieldsAreDeletable: t, fieldNames: s, deleteInProgress: a } = this;
229
236
  return this._propWatcherTask.render({
230
- 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.")), p`<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} ${N(this.dialogNode)}>${t ? p`<div class=${`dialog-content-wrapper ${a ? "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>`)
237
+ complete: () => (t || (s?.length ? s?.length === 1 ? b("error", this, "Field cannot be deleted") : b("error", this, "One or more fields cannot be deleted") : b("error", this, G("fieldNames"))), p`<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} ${D(this.dialogNode)}>${t ? p`<div class=${`dialog-content-wrapper ${a ? "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>`)
231
238
  });
232
239
  }
233
240
  renderError() {
@@ -240,24 +247,24 @@ class _ extends M {
240
247
  }
241
248
  renderFieldsPreview() {
242
249
  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>`;
250
+ return p`<calcite-list .label=${o.fields}>${e.map((r) => {
251
+ const h = t.find((m) => m.name === r);
252
+ return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${H({ fieldType: _(r, s, a) })}</div></calcite-list-item>`;
246
253
  })}</calcite-list>`;
247
254
  }
248
255
  renderCancelButton() {
249
256
  const { messages: e } = this;
250
- return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${N(this.cancelNode)}>${e.cancel}</calcite-button>`;
257
+ return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${D(this.cancelNode)}>${e.cancel}</calcite-button>`;
251
258
  }
252
259
  renderDeleteButton() {
253
260
  const { messages: e, fieldNames: t } = this;
254
261
  return p`<calcite-button kind=danger slot=footer-end @click=${async (s) => {
255
262
  const { portal: a } = this;
256
- 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());
263
+ 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());
257
264
  }}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
258
265
  }
259
266
  }
260
- C("arcgis-portal-field-delete", _);
267
+ P("arcgis-portal-field-delete", Q);
261
268
  export {
262
- _ as ArcgisPortalFieldDelete
269
+ Q as ArcgisPortalFieldDelete
263
270
  };