@arcgis/portal-components 5.0.0-next.13 → 5.0.0-next.130

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 (216) hide show
  1. package/dist/cdn/2KZZPVXE.js +4 -0
  2. package/dist/cdn/3E2C5GC4.js +4 -0
  3. package/dist/cdn/3TVMBNSG.js +4 -0
  4. package/dist/cdn/{BWCHLKYH.js → 5IVNTZIK.js} +2 -2
  5. package/dist/cdn/5N7A6QPT.js +4 -0
  6. package/dist/cdn/{SPL3N6ET.js → 652FN34L.js} +1 -1
  7. package/dist/cdn/73Y4DGUS.js +4 -0
  8. package/dist/cdn/BBVYKMTF.js +4 -0
  9. package/dist/cdn/CJPXKRMI.js +4 -0
  10. package/dist/cdn/DEHRKWFH.js +4 -0
  11. package/dist/cdn/DS7M5QVJ.js +4 -0
  12. package/dist/cdn/ED3DTJE2.js +4 -0
  13. package/dist/cdn/FYKU2XYE.js +4 -0
  14. package/dist/cdn/HDBWKON4.js +4 -0
  15. package/dist/cdn/JWB6OMHQ.js +4 -0
  16. package/dist/cdn/L65QEUTQ.js +4 -0
  17. package/dist/cdn/MEPRQCQD.js +6 -0
  18. package/dist/cdn/MJSDZEEP.js +4 -0
  19. package/dist/cdn/MMJY4UUQ.js +4 -0
  20. package/dist/cdn/MNAVANS5.js +4 -0
  21. package/dist/cdn/MVFEDTNC.js +4 -0
  22. package/dist/cdn/NPVRYPWN.js +4 -0
  23. package/dist/cdn/OMZVSMZD.js +4 -0
  24. package/dist/cdn/PVY7S6MU.js +6 -0
  25. package/dist/cdn/{5MZF4USY.js → Q5YHXBL4.js} +2 -2
  26. package/dist/cdn/QBACE6MQ.js +4 -0
  27. package/dist/cdn/TAXP6R2V.js +4 -0
  28. package/dist/cdn/TE2R2GXI.js +4 -0
  29. package/dist/cdn/U45XPLZN.js +4 -0
  30. package/dist/cdn/VJAE2RWH.js +4 -0
  31. package/dist/cdn/XFE2JKC3.js +4 -0
  32. package/dist/cdn/YBV7UFLL.js +4 -0
  33. package/dist/cdn/YVA74N2A.js +4 -0
  34. package/dist/cdn/ZXDJCERM.js +4 -0
  35. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
  36. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
  37. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
  38. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
  39. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
  40. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
  41. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
  42. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
  43. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
  44. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
  45. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
  46. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
  47. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
  48. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
  49. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
  50. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
  51. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
  52. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
  53. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
  54. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
  55. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
  56. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
  57. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
  58. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
  59. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
  60. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
  61. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
  62. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
  63. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
  64. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
  65. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
  66. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
  67. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
  68. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
  69. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
  70. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
  71. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
  72. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
  73. package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
  74. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
  75. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
  76. package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
  77. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
  78. package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
  79. package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
  80. package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
  81. package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
  82. package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
  83. package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
  84. package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
  85. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
  86. package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
  87. package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
  88. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
  89. package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
  90. package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
  91. package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
  92. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
  93. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
  94. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
  95. package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
  96. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
  97. package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
  98. package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
  99. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
  100. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
  101. package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
  102. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
  103. package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
  104. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
  105. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
  106. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
  107. package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
  108. package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
  109. package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
  110. package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
  111. package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
  112. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
  113. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
  114. package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
  115. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ar.json +1 -0
  116. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bg.json +1 -0
  117. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bs.json +1 -0
  118. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ca.json +1 -0
  119. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.cs.json +1 -0
  120. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.da.json +1 -0
  121. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.de.json +1 -0
  122. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.el.json +1 -0
  123. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -0
  124. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.es.json +1 -0
  125. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.et.json +1 -0
  126. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fi.json +1 -0
  127. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fr.json +1 -0
  128. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.he.json +1 -0
  129. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hr.json +1 -0
  130. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hu.json +1 -0
  131. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.id.json +1 -0
  132. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.it.json +1 -0
  133. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ja.json +1 -0
  134. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ko.json +1 -0
  135. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lt.json +1 -0
  136. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lv.json +1 -0
  137. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.nl.json +1 -0
  138. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.no.json +1 -0
  139. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pl.json +1 -0
  140. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-BR.json +1 -0
  141. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-PT.json +1 -0
  142. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ro.json +1 -0
  143. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ru.json +1 -0
  144. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sk.json +1 -0
  145. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sl.json +1 -0
  146. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sr.json +1 -0
  147. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sv.json +1 -0
  148. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.th.json +1 -0
  149. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.tr.json +1 -0
  150. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.uk.json +1 -0
  151. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.vi.json +1 -0
  152. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-CN.json +1 -0
  153. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-HK.json +1 -0
  154. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-TW.json +1 -0
  155. package/dist/cdn/index.js +2 -2
  156. package/dist/cdn/main.css +1 -1
  157. package/dist/chunks/common.js +1 -1
  158. package/dist/chunks/fieldAddDelete.js +153 -226
  159. package/dist/chunks/item.js +103 -0
  160. package/dist/chunks/loadClassificationData.js +1 -1
  161. package/dist/chunks/requests.js +2 -2
  162. package/dist/chunks/runtime.js +2 -2
  163. package/dist/chunks/useT9n.js +1 -1
  164. package/dist/components/arcgis-portal-classification-banner/customElement.js +18 -17
  165. package/dist/components/arcgis-portal-classification-config/customElement.d.ts +4 -1
  166. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  167. package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
  168. package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +3 -0
  169. package/dist/components/arcgis-portal-classification-form-element/customElement.js +7 -7
  170. package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +56 -0
  171. package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
  172. package/dist/components/arcgis-portal-extent-picker/index.d.ts +8 -0
  173. package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
  174. package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +28 -0
  175. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +29 -0
  176. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
  177. package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +3 -0
  178. package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
  179. package/dist/components/arcgis-portal-field-delete/customElement.d.ts +10 -2
  180. package/dist/components/arcgis-portal-field-delete/customElement.js +81 -78
  181. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +31 -0
  182. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +151 -0
  183. package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +6 -0
  184. package/dist/components/arcgis-portal-replacement-item-redirect/index.js +6 -0
  185. package/dist/components/arcgis-portal-replacement-item-redirect/types/actions.d.ts +11 -0
  186. package/dist/components/arcgis-portal-replacement-item-redirect/utils/actions.d.ts +24 -0
  187. package/dist/components/arcgis-portal-replacement-item-redirect/utils/capabilities.d.ts +4 -0
  188. package/dist/components/arcgis-portal-replacement-item-redirect/utils/info.d.ts +2 -0
  189. package/dist/controllers/useClassificationModel.d.ts +1 -1
  190. package/dist/docs/api.json +795 -360
  191. package/dist/docs/docs.json +498 -54
  192. package/dist/docs/vscode.html-custom-data.json +49 -5
  193. package/dist/docs/web-types.json +179 -8
  194. package/dist/index.d.ts +53 -55
  195. package/dist/index.js +1 -1
  196. package/dist/loader.d.ts +1 -1
  197. package/dist/loader.js +8 -5
  198. package/dist/types/classification.d.ts +1 -1
  199. package/dist/types/components.d.ts +2 -1
  200. package/dist/types/lumina.d.ts +20 -5
  201. package/dist/types/preact.d.ts +22 -5
  202. package/dist/types/react.d.ts +24 -5
  203. package/dist/types/stencil.d.ts +20 -5
  204. package/dist/utils/commonFunctions.d.ts +2 -1
  205. package/dist/utils/style.d.ts +1 -0
  206. package/package.json +8 -7
  207. package/dist/cdn/DZQS2M4E.js +0 -4
  208. package/dist/cdn/EFM3HPLS.js +0 -4
  209. package/dist/cdn/FEI4JVX3.js +0 -4
  210. package/dist/cdn/K3RNTGH6.js +0 -4
  211. package/dist/cdn/L7VL65PY.js +0 -4
  212. package/dist/cdn/NJ55C63G.js +0 -6
  213. package/dist/cdn/RVTQSMRW.js +0 -4
  214. package/dist/cdn/RZRCOHHX.js +0 -4
  215. package/dist/cdn/WVDGOBKY.js +0 -4
  216. package/dist/types/preact10.d.ts +0 -54
@@ -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.128 */
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,18 @@ 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>;
25
+ "@eventTypes": {
26
+ "arcgisBeforeDelete": ArcgisPortalFieldDelete["arcgisBeforeDelete"]["detail"];
27
+ "arcgisBeforeModalClose": ArcgisPortalFieldDelete["arcgisBeforeModalClose"]["detail"];
28
+ "arcgisClose": ArcgisPortalFieldDelete["arcgisClose"]["detail"];
29
+ "arcgisFieldsDeleted": ArcgisPortalFieldDelete["arcgisFieldsDeleted"]["detail"];
30
+ };
23
31
  }
@@ -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.13 */
17
+ v5.0.0-next.128 */
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
  };
@@ -0,0 +1,31 @@
1
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ /// <reference path="../../index.d.ts" />
3
+ import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina';
4
+ import { SearchResultItem } from '@arcgis/app-components';
5
+ import { ItemAction } from './types/actions';
6
+ import { PropertyValues } from 'lit';
7
+
8
+ /**
9
+ * 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
10
+ * via the `ReplacementItem2Item` relationship.
11
+ *
12
+ * 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.
13
+ *
14
+ * @internal
15
+ */
16
+ export declare class ArcgisPortalReplacementItemRedirect extends LitElement {
17
+ /** The id of a deprecated/retired item to be checked for a replacement */
18
+ itemId: string;
19
+ /** The portal instance */
20
+ portal: __esri.Portal;
21
+ /** The user. Defaults to `portal.user` if omitted */
22
+ user?: __esri.PortalUser;
23
+ /** Set focus on the component */
24
+ setFocus(): Promise<void>;
25
+ readonly arcgisPortalReplacementItemFetch: TargetedEvent<this, {
26
+ replacementItem: __esri.PortalItem | object | null;
27
+ }>;
28
+ "@eventTypes": {
29
+ "arcgisPortalReplacementItemFetch": ArcgisPortalReplacementItemRedirect["arcgisPortalReplacementItemFetch"]["detail"];
30
+ };
31
+ }
@@ -0,0 +1,151 @@
1
+ import { c as d } from "../../chunks/runtime.js";
2
+ import { LitElement as h, createEvent as u, nothing as p } from "@arcgis/lumina";
3
+ import { g as f, h as I } from "../../chunks/item.js";
4
+ import { u as $ } from "../../chunks/useT9n.js";
5
+ import { createRef as w, ref as g } from "lit/directives/ref.js";
6
+ import { unsafeHTML as R } from "lit/directives/unsafe-html.js";
7
+ import y from "@arcgis/core/identity/IdentityManager.js";
8
+ import { css as A, html as o } from "lit";
9
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
11
+ v5.0.0-next.128 */
12
+ function T(e, t) {
13
+ return t && (b(e, t) || ["update", "admin"].includes(e.itemControl));
14
+ }
15
+ function b(e, t) {
16
+ return e.owner === t?.username;
17
+ }
18
+ const k = (e) => e.type === "PDF";
19
+ async function D({ item: e, user: t, portal: i }) {
20
+ const r = await y.getCredential(i.url), n = { item: e, user: t, portal: i, credential: r };
21
+ return k(e) ? {
22
+ action: async () => await v(n),
23
+ newTab: !0
24
+ } : e.type === "StoryMap" ? { link: e.url, newTab: !0 } : null;
25
+ }
26
+ async function v({ item: e, user: t, portal: i, credential: r }) {
27
+ const n = P(e, i, r);
28
+ await C({ item: e, user: t, portal: i, url: n });
29
+ }
30
+ function P(e, t, i) {
31
+ if (!e)
32
+ return "";
33
+ const r = U(e, t), n = i?.token;
34
+ let a = n ? `?token=${n}` : "";
35
+ return e.type === "KML" ? (a = e.access !== "public" && n ? `?token=${n}` : "", e.url?.includes(r) ? `${r}${a}` : `${e.url}${a}`) : `${r}${a}`;
36
+ }
37
+ function U(e, t) {
38
+ return `${f(t)}content/items/${e.id}/data`;
39
+ }
40
+ async function C({ item: e, user: t, portal: i, url: r }) {
41
+ if (T(e, t))
42
+ l(r);
43
+ else
44
+ try {
45
+ if (await F(r, i))
46
+ l(r, !0);
47
+ else
48
+ throw new Error("Access denied");
49
+ } catch (n) {
50
+ throw n;
51
+ }
52
+ }
53
+ function l(e, t) {
54
+ window.location.href = e;
55
+ }
56
+ async function F(e, t) {
57
+ try {
58
+ return await fetch(e, {
59
+ method: "HEAD",
60
+ credentials: t?.isPortal ? "include" : "same-origin"
61
+ }), !0;
62
+ } catch {
63
+ return !1;
64
+ }
65
+ }
66
+ const E = A`.thumbnail-container{width:100%}`, H = 1e4;
67
+ class L extends h {
68
+ constructor() {
69
+ super(...arguments), this.replacementId = null, this.timerId = void 0, this.t9n = $({ blocking: !0 }), this.primaryActionRef = w(), this.getItemDetailsUrl = ({ portal: t, itemId: i }) => {
70
+ const r = t.restUrl;
71
+ return r ? `${r.replace("sharing/rest", "home")}/item.html?id=${i}` : "";
72
+ }, this.itemTitle = "", this.replacementItem = null, this.redirectAction = null, this.canRedirect = !1, this.open = !1, this.arcgisPortalReplacementItemFetch = u();
73
+ }
74
+ static {
75
+ this.properties = { itemTitle: 16, replacementItem: 16, redirectAction: 16, canRedirect: 16, open: 16, itemId: 1, portal: 0, user: 0 };
76
+ }
77
+ static {
78
+ this.styles = E;
79
+ }
80
+ async setFocus() {
81
+ this.primaryActionRef.value?.setFocus();
82
+ }
83
+ willUpdate(t) {
84
+ (t.has("itemId") || t.has("portal") || t.has("user")) && this.initItem();
85
+ }
86
+ async handleRedirectAction() {
87
+ const { action: t, link: i } = this.redirectAction || {};
88
+ if ((t || i) && (this.canRedirect = !0), t) {
89
+ t();
90
+ return;
91
+ } else i && window.open(i, "_self");
92
+ }
93
+ setupTimer({ onComplete: t }) {
94
+ typeof this.timerId == "number" && clearTimeout(this.timerId);
95
+ const i = setTimeout(() => {
96
+ t(), this.timerId = void 0;
97
+ }, H);
98
+ this.timerId = +i;
99
+ }
100
+ cancelTimer({ onCancel: t } = {}) {
101
+ t?.(), clearTimeout(this.timerId);
102
+ }
103
+ handleClose() {
104
+ this.cancelTimer(), this.itemId = "", this.itemTitle = "", this.open = !1;
105
+ }
106
+ async initItem() {
107
+ if (!this.itemId)
108
+ return;
109
+ const { itemId: t, portal: i } = this, r = await i.queryItems({ query: `id:${t}` });
110
+ this.itemTitle = r?.results[0]?.title || "";
111
+ const n = await I(t, i, {
112
+ relationshipType: "ReplacementItem2Item",
113
+ direction: "reverse"
114
+ }), a = n.data?.aggregations?.total?.count > 0 && n.data?.relatedItems?.length === 0, s = n.data?.relatedItems?.[0];
115
+ if (this.arcgisPortalReplacementItemFetch.emit({
116
+ replacementItem: a ? {} : s || null
117
+ }), !s) {
118
+ this.handleClose();
119
+ return;
120
+ }
121
+ this.replacementItem = s, this.redirectAction = await D({
122
+ item: this.replacementItem,
123
+ portal: this.portal,
124
+ user: this.user || this.portal.user
125
+ });
126
+ const { action: c, link: m } = this.redirectAction || {};
127
+ this.canRedirect = !!(c || m), this.replacementId = s.id, this.canRedirect && this.setupTimer({
128
+ onComplete: async () => {
129
+ await this.handleRedirectAction();
130
+ }
131
+ }), this.open = !0;
132
+ }
133
+ viewItemDetailsPage() {
134
+ window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId }), "_self");
135
+ }
136
+ render() {
137
+ const { open: t, t9n: i, itemTitle: r, replacementItem: n, canRedirect: a, portal: s, user: c } = this;
138
+ if (n)
139
+ return o`<calcite-dialog modal .open=${t} width=s kind=info outside-close-disabled .heading=${a ? i.redirectToReplacement : i.replacementAvailable} @calciteDialogClose=${() => {
140
+ this.cancelTimer(), this.itemId = "", this.itemTitle = "", this.open = !1;
141
+ }}><div>${R(i.deprecatedHasReplacement.replace("${itemTitle}", r))}</div><calcite-card thumbnail-position=inline-start><arcgis-item-thumbnail slot=thumbnail class="thumbnail-container" .item=${n} .user=${c || s.user} .portal=${s}></arcgis-item-thumbnail><span slot=heading>${n.title}</span><span slot=description>${`Owned by: ${n.owner}`}</span>${a && o`<calcite-link slot=footer-start icon-start=launch .href=${this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId })}>${i.moreDetails}</calcite-link>` || ""}</calcite-card><calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${() => {
142
+ this.handleClose();
143
+ }}>${i.cancel}</calcite-button><calcite-button slot=footer-end @click=${async () => {
144
+ this.cancelTimer(), this.canRedirect ? await this.handleRedirectAction() : this.viewItemDetailsPage();
145
+ }} icon-end=${(this.canRedirect ? void 0 : "launch") ?? p} ${g(this.primaryActionRef)}>${this.canRedirect ? i.redirect : i.moreDetails}</calcite-button></calcite-dialog>`;
146
+ }
147
+ }
148
+ d("arcgis-portal-replacement-item-redirect", L);
149
+ export {
150
+ L as ArcgisPortalReplacementItemRedirect
151
+ };
@@ -0,0 +1,6 @@
1
+ import "@esri/calcite-components/components/calcite-dialog";
2
+ import "@esri/calcite-components/components/calcite-card";
3
+ import "@arcgis/app-components/dist/components/arcgis-item-thumbnail.js";
4
+ import "@esri/calcite-components/components/calcite-link";
5
+ import "@esri/calcite-components/components/calcite-button";
6
+ export * from "./customElement.js";
@@ -0,0 +1,6 @@
1
+ import "@esri/calcite-components/components/calcite-dialog";
2
+ import "@esri/calcite-components/components/calcite-card";
3
+ import "@arcgis/app-components/dist/components/arcgis-item-thumbnail.js";
4
+ import "@esri/calcite-components/components/calcite-link";
5
+ import "@esri/calcite-components/components/calcite-button";
6
+ export * from "./customElement.js";
@@ -0,0 +1,11 @@
1
+ export type ItemActionCache = Record<string, ItemAction[]>;
2
+ export interface ItemAction<R = void> {
3
+ action?: () => R;
4
+ link?: string;
5
+ id?: string;
6
+ tooltip?: string;
7
+ disabled?: boolean;
8
+ target?: string;
9
+ desktopOnly?: boolean;
10
+ newTab?: boolean;
11
+ }