@arcgis/portal-components 5.0.0-next.14 → 5.0.0-next.140

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 (214) hide show
  1. package/dist/cdn/2M22BAW3.js +4 -0
  2. package/dist/cdn/7SFLX2NJ.js +4 -0
  3. package/dist/cdn/BACNQ4AP.js +6 -0
  4. package/dist/cdn/BRMGO6M4.js +4 -0
  5. package/dist/cdn/CFZDEZJ5.js +4 -0
  6. package/dist/cdn/{YBZHLIFY.js → CKZ4AQIJ.js} +1 -1
  7. package/dist/cdn/CXTCB6C7.js +4 -0
  8. package/dist/cdn/F5BFVGJF.js +4 -0
  9. package/dist/cdn/G7IJQ2TS.js +4 -0
  10. package/dist/cdn/HQ56AUMW.js +4 -0
  11. package/dist/cdn/JPJGQTYG.js +4 -0
  12. package/dist/cdn/KXECN73X.js +4 -0
  13. package/dist/cdn/{HJFZ3UZA.js → S2MMJDT7.js} +2 -2
  14. package/dist/cdn/{E2UQO7Z7.js → SWFRE4FH.js} +2 -2
  15. package/dist/cdn/UXCVRW3L.js +4 -0
  16. package/dist/cdn/WCJUWWB5.js +4 -0
  17. package/dist/cdn/ZHVW7NN6.js +4 -0
  18. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
  19. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
  20. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
  21. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
  22. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
  23. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
  24. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
  25. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
  26. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
  27. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
  28. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
  29. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
  30. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
  31. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
  32. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
  33. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
  34. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
  35. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
  36. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
  37. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
  38. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
  39. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
  40. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
  41. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
  42. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
  43. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
  44. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
  45. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
  46. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
  47. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
  48. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
  49. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
  50. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
  51. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
  52. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
  53. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
  54. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
  55. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
  56. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
  57. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
  58. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
  59. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
  60. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
  61. package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
  62. package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
  63. package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
  64. package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
  65. package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
  66. package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
  67. package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
  68. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
  69. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
  70. package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
  71. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
  72. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
  73. package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
  74. package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
  75. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
  76. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
  77. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
  78. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
  79. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
  80. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
  81. package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
  82. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
  83. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
  84. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
  85. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
  86. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
  87. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
  88. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
  89. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
  90. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
  91. package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
  92. package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
  93. package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
  94. package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
  95. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
  96. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
  97. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
  98. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ar.json +1 -0
  99. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bg.json +1 -0
  100. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bs.json +1 -0
  101. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ca.json +1 -0
  102. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.cs.json +1 -0
  103. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.da.json +1 -0
  104. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.de.json +1 -0
  105. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.el.json +1 -0
  106. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -0
  107. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.es.json +1 -0
  108. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.et.json +1 -0
  109. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fi.json +1 -0
  110. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fr.json +1 -0
  111. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.he.json +1 -0
  112. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hr.json +1 -0
  113. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hu.json +1 -0
  114. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.id.json +1 -0
  115. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.it.json +1 -0
  116. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ja.json +1 -0
  117. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ko.json +1 -0
  118. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lt.json +1 -0
  119. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lv.json +1 -0
  120. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.nl.json +1 -0
  121. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.no.json +1 -0
  122. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pl.json +1 -0
  123. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-BR.json +1 -0
  124. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-PT.json +1 -0
  125. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ro.json +1 -0
  126. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ru.json +1 -0
  127. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sk.json +1 -0
  128. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sl.json +1 -0
  129. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sr.json +1 -0
  130. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sv.json +1 -0
  131. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.th.json +1 -0
  132. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.tr.json +1 -0
  133. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.uk.json +1 -0
  134. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.vi.json +1 -0
  135. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-CN.json +1 -0
  136. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-HK.json +1 -0
  137. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-TW.json +1 -0
  138. package/dist/cdn/index.js +2 -2
  139. package/dist/cdn/main.css +1 -1
  140. package/dist/chunks/common.js +1 -1
  141. package/dist/chunks/fieldAddDelete.js +153 -226
  142. package/dist/chunks/item.js +103 -0
  143. package/dist/chunks/loadClassificationData.js +1 -1
  144. package/dist/chunks/requests.js +2 -2
  145. package/dist/chunks/runtime.js +2 -2
  146. package/dist/chunks/useT9n.js +1 -1
  147. package/dist/components/arcgis-portal-classification-banner/customElement.d.ts +39 -34
  148. package/dist/components/arcgis-portal-classification-banner/customElement.js +18 -17
  149. package/dist/components/arcgis-portal-classification-banner/index.d.ts +0 -1
  150. package/dist/components/arcgis-portal-classification-config/customElement.d.ts +67 -38
  151. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  152. package/dist/components/arcgis-portal-classification-config/index.d.ts +0 -11
  153. package/dist/components/arcgis-portal-classification-favorite/customElement.d.ts +61 -16
  154. package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
  155. package/dist/components/arcgis-portal-classification-favorite/index.d.ts +0 -11
  156. package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +27 -12
  157. package/dist/components/arcgis-portal-classification-form-element/customElement.js +7 -7
  158. package/dist/components/arcgis-portal-classification-form-element/index.d.ts +0 -8
  159. package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +124 -0
  160. package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
  161. package/dist/components/arcgis-portal-extent-picker/index.d.ts +1 -0
  162. package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
  163. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
  164. package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
  165. package/dist/components/arcgis-portal-field-delete/customElement.d.ts +88 -21
  166. package/dist/components/arcgis-portal-field-delete/customElement.js +81 -78
  167. package/dist/components/arcgis-portal-field-delete/index.d.ts +0 -9
  168. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +43 -0
  169. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +151 -0
  170. package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +1 -0
  171. package/dist/components/arcgis-portal-replacement-item-redirect/index.js +6 -0
  172. package/dist/docs/api.json +1 -1174
  173. package/dist/docs/docs.json +1 -1076
  174. package/dist/docs/vscode.css-custom-data.json +1 -6
  175. package/dist/docs/vscode.html-custom-data.json +1 -98
  176. package/dist/docs/web-types.json +1 -313
  177. package/dist/index.d.ts +73 -61
  178. package/dist/index.js +1 -1
  179. package/dist/loader.d.ts +1 -1
  180. package/dist/loader.js +11 -8
  181. package/dist/models/classificationModel.d.ts +1 -68
  182. package/dist/types/classification.d.ts +89 -165
  183. package/dist/types/components.d.ts +2 -1
  184. package/dist/types/lumina.d.ts +30 -15
  185. package/dist/types/preact.d.ts +32 -15
  186. package/dist/types/react.d.ts +34 -15
  187. package/dist/types/stencil.d.ts +30 -15
  188. package/dist/utils/fieldAddDelete.d.ts +12 -3
  189. package/dist/utils/types.d.ts +25 -24
  190. package/package.json +8 -7
  191. package/dist/cdn/GAVE7GOE.js +0 -4
  192. package/dist/cdn/GCTEBF5M.js +0 -4
  193. package/dist/cdn/IQGOBW2Z.js +0 -4
  194. package/dist/cdn/MCC56U5S.js +0 -4
  195. package/dist/cdn/NIHR6VOM.js +0 -4
  196. package/dist/cdn/NNI54DSU.js +0 -4
  197. package/dist/cdn/OB7YFCHE.js +0 -4
  198. package/dist/cdn/ORW2D6UX.js +0 -4
  199. package/dist/cdn/UYVWH4TJ.js +0 -6
  200. package/dist/components/arcgis-portal-field-delete/types.d.ts +0 -5
  201. package/dist/controllers/loadClassificationData.d.ts +0 -11
  202. package/dist/controllers/useClassificationModel.d.ts +0 -9
  203. package/dist/controllers/useT9n.d.ts +0 -1
  204. package/dist/runtime.d.ts +0 -6
  205. package/dist/types/preact10.d.ts +0 -54
  206. package/dist/utils/arcade.d.ts +0 -27
  207. package/dist/utils/common.d.ts +0 -29
  208. package/dist/utils/commonEnums.d.ts +0 -5
  209. package/dist/utils/commonFunctions.d.ts +0 -11
  210. package/dist/utils/functionalComponents/FieldIcons.d.ts +0 -6
  211. package/dist/utils/item.d.ts +0 -21
  212. package/dist/utils/portal.d.ts +0 -2
  213. package/dist/utils/requests.d.ts +0 -15
  214. package/dist/utils/url.d.ts +0 -1
@@ -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.140 */
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";
@@ -1,23 +1,90 @@
1
- /// <reference types="@arcgis/core/interfaces.d.ts" />
2
1
  /// <reference path="../../index.d.ts" />
3
- import { PublicLitElement as LitElement, TargetedEvent, JsxNode } from '@arcgis/lumina';
4
- import { FieldDeleteOptions, IConfig } from '../../utils/types';
2
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
3
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina/PublicLitElement";
4
+ import type { FieldDeleteOptions, IConfig } from "../../utils/types.js";
5
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
5
6
 
6
- export declare class ArcgisPortalFieldDelete extends LitElement {
7
- /** For documentation links. */
8
- config?: IConfig;
9
- /** The fields to delete. */
10
- fieldNames?: string[];
11
- /** The layer whose field is being deleted. */
12
- layer?: __esri.FeatureLayer | __esri.OrientedImageryLayer;
13
- /** The MapView instance. */
14
- mapView?: __esri.MapView;
15
- /** Properties that may need to be passed in case values differ from what is available on Map Viewer. */
16
- options?: FieldDeleteOptions;
17
- /** Emitted when the field is successfully deleted. */
18
- readonly arcgisFieldsDeleted: TargetedEvent<this, void>;
19
- /** Emitted before the modal is closed if the alert is handled in consumer. */
20
- readonly arcgisBeforeModalClose: TargetedEvent<this, string>;
21
- /** Emitted when the component is closed for any reason. */
22
- readonly arcgisClose: TargetedEvent<this, void>;
23
- }
7
+ export abstract class ArcgisPortalFieldDelete extends LitElement {
8
+ /** For documentation links. */
9
+ accessor config: IConfig | undefined;
10
+ /** The fields to delete. */
11
+ accessor fieldNames: string[] | undefined;
12
+ /** The layer whose field is being deleted. */
13
+ accessor layer: __esri.FeatureLayer | __esri.OrientedImageryLayer | undefined;
14
+ /** The MapView instance. */
15
+ accessor mapView: __esri.MapView | undefined;
16
+ /** @internal */
17
+ protected messages: {
18
+ cancel: string;
19
+ error: string;
20
+ errorOccurred: string;
21
+ fields: string;
22
+ deletePrompt: string;
23
+ deleteMultiplePrompt: string;
24
+ deleteField: string;
25
+ deleteFields: string;
26
+ deleteFieldsWithNumber: string;
27
+ deletingField: string;
28
+ deletingFields: string;
29
+ newFeature: string;
30
+ fieldDeleted: string;
31
+ fieldsDeleted: string;
32
+ fieldDeletionUnsuccessful: string;
33
+ fieldInUse: string;
34
+ expressions: string;
35
+ popups: string;
36
+ forms: string;
37
+ charts: string;
38
+ deleteWarning: string;
39
+ deleteMultipleWarning: string;
40
+ learnMore: string;
41
+ savingFailed: string;
42
+ readOnlyErrorMessage: string;
43
+ readOnlyErrorMessageEnterprise: string;
44
+ healthDashboard: string;
45
+ } & T9nMeta<{
46
+ cancel: string;
47
+ error: string;
48
+ errorOccurred: string;
49
+ fields: string;
50
+ deletePrompt: string;
51
+ deleteMultiplePrompt: string;
52
+ deleteField: string;
53
+ deleteFields: string;
54
+ deleteFieldsWithNumber: string;
55
+ deletingField: string;
56
+ deletingFields: string;
57
+ newFeature: string;
58
+ fieldDeleted: string;
59
+ fieldsDeleted: string;
60
+ fieldDeletionUnsuccessful: string;
61
+ fieldInUse: string;
62
+ expressions: string;
63
+ popups: string;
64
+ forms: string;
65
+ charts: string;
66
+ deleteWarning: string;
67
+ deleteMultipleWarning: string;
68
+ learnMore: string;
69
+ savingFailed: string;
70
+ readOnlyErrorMessage: string;
71
+ readOnlyErrorMessageEnterprise: string;
72
+ healthDashboard: string;
73
+ }>;
74
+ /** Properties that may need to be passed in case values differ from what is available on Map Viewer. */
75
+ accessor options: FieldDeleteOptions | undefined;
76
+ /** Emitted when the user initiates the delete process. */
77
+ readonly arcgisBeforeDelete: import("@arcgis/lumina").TargetedEvent<this, void>;
78
+ /** Emitted before the modal is closed if the alert is handled in consumer. */
79
+ readonly arcgisBeforeModalClose: import("@arcgis/lumina").TargetedEvent<this, string>;
80
+ /** Emitted when the component is closed for any reason. */
81
+ readonly arcgisClose: import("@arcgis/lumina").TargetedEvent<this, void>;
82
+ /** Emitted when the field is successfully deleted. */
83
+ readonly arcgisFieldsDeleted: import("@arcgis/lumina").TargetedEvent<this, void>;
84
+ readonly "@eventTypes": {
85
+ arcgisBeforeDelete: ArcgisPortalFieldDelete["arcgisBeforeDelete"]["detail"];
86
+ arcgisBeforeModalClose: ArcgisPortalFieldDelete["arcgisBeforeModalClose"]["detail"];
87
+ arcgisClose: ArcgisPortalFieldDelete["arcgisClose"]["detail"];
88
+ arcgisFieldsDeleted: ArcgisPortalFieldDelete["arcgisFieldsDeleted"]["detail"];
89
+ };
90
+ }
@@ -1,18 +1,20 @@
1
- import { c as k } from "../../chunks/runtime.js";
2
- import { html as p, css as P } from "lit";
3
- import { LitElement as M, createEvent as F, renderElement as T } from "@arcgis/lumina";
4
- import { createRef as E, ref as N } from "lit/directives/ref.js";
5
- import { Task as O } from "@lit/task";
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";
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";
10
10
  import y from "@arcgis/core/request.js";
11
- import { a as B, g as U, b as q, d as R, e as w, f as J, i as D } from "../../chunks/fieldAddDelete.js";
12
- import { u as z } from "../../chunks/useT9n.js";
11
+ import { i as $, a as q, g as R, b as J, d as z, s as W, e as _ } from "../../chunks/fieldAddDelete.js";
12
+ import { g as A } from "../../chunks/item.js";
13
+ import { u as V } from "../../chunks/useT9n.js";
14
+ import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
13
15
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
14
16
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
15
- v5.0.0-next.14 */
17
+ v5.0.0-next.140 */
16
18
  const n = /* @__PURE__ */ new Map();
17
19
  n.set("oid", "key");
18
20
  n.set("guid", "key");
@@ -30,23 +32,24 @@ n.set("date-only", "calendar");
30
32
  n.set("time-only", "clock");
31
33
  n.set("timestamp-offset", "time-zone");
32
34
  n.set("string", "string");
33
- const W = ({ fieldType: $ }) => p`<calcite-icon scale=s .icon=${n.get($)}></calcite-icon>`, _ = P`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`;
34
- class V extends M {
35
+ 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}`;
36
+ class Q extends x {
35
37
  constructor() {
36
- super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = E(), this.dialogNode = E(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = z({ blocking: !0 }), this._propWatcherTask = new O(this, {
38
+ 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, {
37
39
  task: async ([e, t]) => {
38
- if (!(D(e) && D(t)))
39
- throw console.error("Required properties are missing."), new Error();
40
+ const s = $(e) && $(t);
41
+ if ($(e) || b("error", this, C("layer")), $(t) || b("error", this, C("fieldNames")), !s)
42
+ throw new Error("Required properties are missing");
40
43
  this._propWatcherTask.autoRun = !1, await this.processProps();
41
44
  },
42
45
  args: () => [this.layer, this.fieldNames]
43
- }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this.arcgisFieldsDeleted = F(), this.arcgisBeforeModalClose = F(), this.arcgisClose = F();
46
+ }), this.arcgisBeforeModalClose = T(), this.arcgisClose = T(), this.arcgisBeforeDelete = T(), this.arcgisFieldsDeleted = T();
44
47
  }
45
48
  static {
46
- this.properties = { currentLayerInfo: 16, deleteInProgress: 16, fieldsAreDeletable: 16, config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
49
+ this.properties = { config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
47
50
  }
48
51
  static {
49
- this.styles = _;
52
+ this.styles = K;
50
53
  }
51
54
  async processProps() {
52
55
  const { layer: e, mapView: t, fieldNames: s } = this;
@@ -55,37 +58,37 @@ class V extends M {
55
58
  return;
56
59
  }
57
60
  e.loaded || await e.load(), this.layerFields = e.fields.filter((o) => s.includes(o.name));
58
- const a = s.some((o) => !e.fields.find((r) => r.name === o));
61
+ const a = s.some((o) => !e.fields.find((l) => l.name === o));
59
62
  if (!this.layerFields?.length || a)
60
63
  this.fieldsAreDeletable = !1;
61
64
  else {
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)
65
+ const o = await Promise.all(this.layerFields.map(async (l) => await q(t, e, l, this.options)));
66
+ if (this.fieldsAreDeletable = o.every((l) => l), !this.fieldsAreDeletable)
64
67
  return;
65
68
  }
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) {
69
+ 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) {
67
70
  this.fieldsAreDeletable = !1;
68
71
  return;
69
72
  }
70
- await j.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
73
+ await U.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
71
74
  }
72
75
  getFieldLabel(e) {
73
76
  const { layer: t, arcadeExpMap: s } = this;
74
77
  if (this.options?.ignorePopupTemplate)
75
78
  return this.getFieldDisplayNameFromLayerFields(e);
76
79
  {
77
- const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
78
- return o ? R(o, s) : this.getFieldDisplayNameFromLayerFields(e);
80
+ const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((l) => l.fieldName === e);
81
+ return o ? z(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
79
82
  }
80
83
  }
81
84
  getFieldDisplayNameFromLayerFields(e) {
82
- const t = this.layerFieldsMap.get(e);
83
- return t.alias ?? t.name;
85
+ const { layer: t } = this, s = this.layerFieldsMap.get(e);
86
+ return W(t) ? t.getFieldAlias(e) : s.alias ?? s.name;
84
87
  }
85
88
  async deleteFields() {
86
89
  const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
87
- fields: t.map((r) => ({
88
- name: r
90
+ fields: t.map((l) => ({
91
+ name: l
89
92
  }))
90
93
  }, o = {
91
94
  deleteFromDefinition: JSON.stringify(a)
@@ -94,18 +97,18 @@ class V extends M {
94
97
  query: { ...o, f: "json", async: !1 },
95
98
  method: "post",
96
99
  responseType: "json"
97
- }).then(async (r) => {
98
- if (r.data?.success) {
100
+ }).then(async (l) => {
101
+ if (l.data?.success) {
99
102
  const h = `${e.url}/${e.layerId}`;
100
103
  t.forEach((i) => {
101
104
  e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
102
105
  });
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]);
106
+ const m = await y(h, { query: { f: "json" }, responseType: "json" });
107
+ if (m) {
108
+ const i = m.data;
109
+ this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((r) => {
110
+ i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[r]) : i.types?.forEach((d) => {
111
+ d.templates.forEach((u) => delete u.prototype.attributes[r]);
109
112
  });
110
113
  }), this.updateFeatureService(i));
111
114
  } else
@@ -128,20 +131,20 @@ class V extends M {
128
131
  updateTemplatesList(e) {
129
132
  const { currentLayerInfo: t, messages: s } = this, a = [];
130
133
  return (e ?? []).forEach((o) => {
131
- const r = new L();
132
- r.description = o.description ?? "", r.name = o.name || s.newFeature, r.drawingTool = o.drawingTool || "point";
134
+ const l = new B();
135
+ l.description = o.description ?? "", l.name = o.name || s.newFeature, l.drawingTool = o.drawingTool || "point";
133
136
  const h = {};
134
137
  t.fields.forEach((i) => {
135
- let l = !1;
138
+ let r = !1;
136
139
  for (let d = 0; d < o.prototype.attributes.length; d++)
137
140
  if (o.prototype.attributes[d] === i.name) {
138
- l = !0, h[i.name] = o.prototype.attributes[i.name];
141
+ r = !0, h[i.name] = o.prototype.attributes[i.name];
139
142
  break;
140
143
  }
141
- !l && i.editable && (h[i.name] = i.defaultValue || null);
144
+ !r && i.editable && (h[i.name] = i.defaultValue || null);
142
145
  });
143
- const u = new S({ attributes: h });
144
- r.prototype = u, a.push(r);
146
+ const m = new j({ attributes: h });
147
+ l.prototype = m, a.push(l);
145
148
  }), a;
146
149
  }
147
150
  addType(e, t) {
@@ -151,58 +154,58 @@ class V extends M {
151
154
  const { layer: t, fieldNames: s } = this, a = {
152
155
  templates: e.templates,
153
156
  types: e.types
154
- }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, r = {
157
+ }, o = `${t.url.replace("/rest/services", "/rest/admin/services")}/${t.layerId}/updateDefinition`, l = {
155
158
  f: "json",
156
159
  updateDefinition: JSON.stringify(a)
157
160
  };
158
161
  await y(o, {
159
- query: { ...r, f: "json" },
162
+ query: { ...l, f: "json" },
160
163
  method: "post",
161
164
  responseType: "json"
162
165
  }).then(async (h) => {
163
166
  if (h.data?.success) {
164
- const u = `${w(this.portal)}content/items/${this.item.id}/data`;
167
+ const m = `${A(this.portal)}content/items/${this.item.id}/data`;
165
168
  if (this.options?.ignorePopupTemplate || s.forEach((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));
169
+ t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((r) => r.fieldName !== i)), t.popupTemplate?.content?.forEach((r, d) => {
170
+ r.type === "fields" && r.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((u) => u.fieldName !== i));
168
171
  });
169
172
  }), t.attributeTableTemplate) {
170
173
  const i = t.attributeTableTemplate.clone();
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;
174
+ 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;
172
175
  }
173
176
  if (t.fieldConfigurations?.length) {
174
- const l = x.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
175
- t.fieldConfigurations = l;
177
+ const r = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
178
+ t.fieldConfigurations = r;
176
179
  }
177
- await y(u, {
180
+ await y(m, {
178
181
  query: { f: "json" },
179
182
  responseType: "json"
180
183
  }).then(async (i) => {
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);
184
+ const r = i.data;
185
+ if (r?.layers || r?.tables) {
186
+ const d = t.isTable, u = d ? r.tables : r.layers, c = u?.find((g) => g.id === t.layerId);
184
187
  if (s.forEach((g) => {
185
188
  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
189
  }), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
187
- s.forEach((b) => {
188
- c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== b), c.popupInfo.popupElements?.forEach((v, I) => {
189
- v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[I].fieldInfos = c.popupInfo.popupElements[I].fieldInfos.filter((C) => C.fieldName !== b));
190
+ s.forEach((F) => {
191
+ c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== F), c.popupInfo.popupElements?.forEach((v, N) => {
192
+ v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[N].fieldInfos = c.popupInfo.popupElements[N].fieldInfos.filter((M) => M.fieldName !== F));
190
193
  });
191
194
  });
192
- const g = `${w(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
193
- d ? (f.tables = m, l.layers && (f.layers = l.layers)) : (f.layers = m, l.tables && (f.tables = l.tables));
194
- const A = {
195
+ const g = `${A(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
196
+ d ? (f.tables = u, r.layers && (f.layers = r.layers)) : (f.layers = u, r.tables && (f.tables = r.tables));
197
+ const k = {
195
198
  f: "json",
196
199
  text: JSON.stringify(f)
197
200
  };
198
201
  await y(g, {
199
202
  query: {
200
- ...A
203
+ ...k
201
204
  },
202
205
  method: "post",
203
206
  responseType: "json"
204
- }).then((b) => {
205
- b.data?.success ? this.handleSuccess() : this.handleError();
207
+ }).then((F) => {
208
+ F.data?.success ? this.handleSuccess() : this.handleError();
206
209
  }, () => this.handleError());
207
210
  } else
208
211
  this.handleSuccess();
@@ -219,20 +222,20 @@ class V extends M {
219
222
  }
220
223
  displaySuccessAlert() {
221
224
  const { messages: e, fieldNames: t } = this;
222
- 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);
225
+ 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);
223
226
  }
224
227
  displayErrorAlert() {
225
228
  const { messages: e } = this;
226
- 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);
229
+ 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);
227
230
  }
228
231
  displayReadOnlyErrorAlert() {
229
232
  const { messages: e, portal: t } = this;
230
- 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);
233
+ 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);
231
234
  }
232
235
  render() {
233
236
  const { messages: e, fieldsAreDeletable: t, fieldNames: s, deleteInProgress: a } = this;
234
237
  return this._propWatcherTask.render({
235
- 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>`)
238
+ 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>`)
236
239
  });
237
240
  }
238
241
  renderError() {
@@ -245,24 +248,24 @@ class V extends M {
245
248
  }
246
249
  renderFieldsPreview() {
247
250
  const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
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>`;
251
+ return p`<calcite-list .label=${o.fields}>${e.map((l) => {
252
+ const h = t.find((m) => m.name === l);
253
+ return p`<calcite-list-item .label=${this.getFieldLabel(l)} .description=${`{${l}}`} .value=${l} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${H({ fieldType: _(l, s, a) })}</div></calcite-list-item>`;
251
254
  })}</calcite-list>`;
252
255
  }
253
256
  renderCancelButton() {
254
257
  const { messages: e } = this;
255
- return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${N(this.cancelNode)}>${e.cancel}</calcite-button>`;
258
+ return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${D(this.cancelNode)}>${e.cancel}</calcite-button>`;
256
259
  }
257
260
  renderDeleteButton() {
258
261
  const { messages: e, fieldNames: t } = this;
259
262
  return p`<calcite-button kind=danger slot=footer-end @click=${async (s) => {
260
263
  const { portal: a } = this;
261
- s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, await this.deleteFields());
264
+ s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, this.requestUpdate(), this.arcgisBeforeDelete.emit(), await this.deleteFields());
262
265
  }}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
263
266
  }
264
267
  }
265
- k("arcgis-portal-field-delete", V);
268
+ P("arcgis-portal-field-delete", Q);
266
269
  export {
267
- V as ArcgisPortalFieldDelete
270
+ Q as ArcgisPortalFieldDelete
268
271
  };
@@ -1,10 +1 @@
1
- import "@esri/calcite-components/components/calcite-icon";
2
- import "@esri/calcite-components/components/calcite-alert";
3
- import "@esri/calcite-components/components/calcite-link";
4
- import "@esri/calcite-components/components/calcite-dialog";
5
- import "@esri/calcite-components/components/calcite-label";
6
- import "@esri/calcite-components/components/calcite-loader";
7
- import "@esri/calcite-components/components/calcite-list";
8
- import "@esri/calcite-components/components/calcite-list-item";
9
- import "@esri/calcite-components/components/calcite-button";
10
1
  export * from "./customElement.js";
@@ -0,0 +1,43 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
3
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina/PublicLitElement";
4
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
5
+
6
+ /**
7
+ * The `arcgis-portal-replacement-item-redirect` component takes an item id on a given portal, and checks if there is a replacement item associated with it
8
+ * via the `ReplacementItem2Item` relationship.
9
+ *
10
+ * If so, it displays a dialog to the user notifying them of the replacement item, and redirects to the replacement item's default Open Action after a timeout.
11
+ *
12
+ * @internal
13
+ */
14
+ export abstract class ArcgisPortalReplacementItemRedirect extends LitElement {
15
+ /** The id of a deprecated/retired item to be checked for a replacement */
16
+ accessor itemId: string;
17
+ /** The portal instance */
18
+ accessor portal: __esri.Portal;
19
+ /** @internal */
20
+ protected t9n: {
21
+ replacementAvailable: string;
22
+ redirectToReplacement: string;
23
+ cancel: string;
24
+ redirect: string;
25
+ deprecatedHasReplacement: string;
26
+ moreDetails: string;
27
+ } & T9nMeta<{
28
+ replacementAvailable: string;
29
+ redirectToReplacement: string;
30
+ cancel: string;
31
+ redirect: string;
32
+ deprecatedHasReplacement: string;
33
+ moreDetails: string;
34
+ }>;
35
+ /** The user. Defaults to `portal.user` if omitted */
36
+ accessor user: __esri.PortalUser | undefined;
37
+ /** Set focus on the component */
38
+ setFocus(): Promise<void>;
39
+ readonly arcgisPortalReplacementItemFetch: import("@arcgis/lumina").TargetedEvent<this, { replacementItem: __esri.PortalItem | object | null; }>;
40
+ readonly "@eventTypes": {
41
+ arcgisPortalReplacementItemFetch: ArcgisPortalReplacementItemRedirect["arcgisPortalReplacementItemFetch"]["detail"];
42
+ };
43
+ }