@arcgis/portal-components 5.0.0-next.124 → 5.0.0-next.126

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 (55) hide show
  1. package/dist/cdn/{RM6AIDDG.js → AHCZTVJ4.js} +2 -2
  2. package/dist/cdn/GCTJZYV7.js +4 -0
  3. package/dist/cdn/GIBWEC6K.js +4 -0
  4. package/dist/cdn/{KMD37AXG.js → HW5C3XJH.js} +1 -1
  5. package/dist/cdn/JA2VDMRG.js +4 -0
  6. package/dist/cdn/MKNHIW7X.js +4 -0
  7. package/dist/cdn/{K7OKVJO4.js → MX35WWUC.js} +2 -2
  8. package/dist/cdn/{DG5T5NHE.js → OY4KOUHF.js} +2 -2
  9. package/dist/cdn/P4LUN5GB.js +4 -0
  10. package/dist/cdn/{BXIFWHHK.js → SM2CK2AO.js} +2 -2
  11. package/dist/cdn/SV22LY6H.js +4 -0
  12. package/dist/cdn/{HWITQHPU.js → UCKMUAOS.js} +2 -2
  13. package/dist/cdn/WKZKBMHW.js +4 -0
  14. package/dist/cdn/{NY2LFOEQ.js → WNOLDDB4.js} +2 -2
  15. package/dist/cdn/{AZHELUFD.js → XUQULGNP.js} +1 -1
  16. package/dist/cdn/{26TRY2HX.js → YMTH6GIB.js} +2 -2
  17. package/dist/cdn/{XBTBPX2A.js → ZXAIECQ4.js} +2 -2
  18. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -0
  19. package/dist/cdn/index.js +2 -2
  20. package/dist/cdn/main.css +1 -1
  21. package/dist/chunks/common.js +1 -1
  22. package/dist/chunks/fieldAddDelete.js +148 -234
  23. package/dist/chunks/item.js +103 -0
  24. package/dist/chunks/loadClassificationData.js +1 -1
  25. package/dist/chunks/requests.js +1 -1
  26. package/dist/chunks/runtime.js +1 -1
  27. package/dist/chunks/useT9n.js +1 -1
  28. package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
  29. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  30. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  31. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  32. package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
  33. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
  34. package/dist/components/arcgis-portal-field-delete/customElement.js +34 -33
  35. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +24 -0
  36. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +72 -0
  37. package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +4 -0
  38. package/dist/components/arcgis-portal-replacement-item-redirect/index.js +4 -0
  39. package/dist/docs/api.json +159 -2
  40. package/dist/docs/docs.json +165 -2
  41. package/dist/docs/vscode.html-custom-data.json +6 -0
  42. package/dist/docs/web-types.json +27 -1
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.js +1 -1
  45. package/dist/loader.js +3 -2
  46. package/dist/types/lumina.d.ts +5 -0
  47. package/dist/types/preact.d.ts +6 -0
  48. package/dist/types/react.d.ts +7 -0
  49. package/dist/types/stencil.d.ts +5 -0
  50. package/package.json +4 -3
  51. package/dist/cdn/CUDVRICK.js +0 -4
  52. package/dist/cdn/J6M2MF6L.js +0 -4
  53. package/dist/cdn/KRHBOI3V.js +0 -4
  54. package/dist/cdn/NHYKXE24.js +0 -4
  55. package/dist/cdn/YJVU6YU3.js +0 -4
@@ -6,7 +6,7 @@ import { css as h, html as s } from "lit";
6
6
  import { rethrowError as o } from "@arcgis/toolkit/log";
7
7
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
8
8
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
9
- v5.0.0-next.124 */
9
+ v5.0.0-next.126 */
10
10
  const m = h`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`;
11
11
  class p extends l {
12
12
  constructor() {
@@ -13,7 +13,7 @@ import { watch as _ } from "@arcgis/core/core/reactiveUtils.js";
13
13
  import { r as D } from "../../chunks/requests.js";
14
14
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
15
15
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
16
- v5.0.0-next.124 */
16
+ v5.0.0-next.126 */
17
17
  async function T({
18
18
  portalClassificationSchema: a,
19
19
  itemClassification: t
@@ -7,7 +7,7 @@ import { u as d, r as v } from "../../chunks/requests.js";
7
7
  import { g as h } from "../../chunks/common.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
10
- v5.0.0-next.124 */
10
+ v5.0.0-next.126 */
11
11
  const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`;
12
12
  class C extends n {
13
13
  constructor() {
@@ -5,7 +5,7 @@ import { css as d, html as i } from "lit";
5
5
  import { u as h } from "../../chunks/useT9n.js";
6
6
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
7
7
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
8
- v5.0.0-next.124 */
8
+ v5.0.0-next.126 */
9
9
  const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
10
10
  function l(n, e) {
11
11
  return n.uiElement === e;
@@ -26,7 +26,7 @@ import { createRef as d, ref as x } from "lit/directives/ref.js";
26
26
  import { u as B } from "../../chunks/useT9n.js";
27
27
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
28
28
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
29
- v5.0.0-next.124 */
29
+ v5.0.0-next.126 */
30
30
  const W = F`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`;
31
31
  class J {
32
32
  constructor(t) {
@@ -5,7 +5,7 @@ import { css as h, html as o } from "lit";
5
5
  import { useDirection as m } from "@arcgis/lumina/controllers";
6
6
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
7
7
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
8
- v5.0.0-next.124 */
8
+ v5.0.0-next.126 */
9
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
10
  class v extends u {
11
11
  constructor() {
@@ -8,12 +8,13 @@ import B from "@arcgis/core/layers/support/FeatureTemplate.js";
8
8
  import j from "@arcgis/core/Graphic.js";
9
9
  import U from "@arcgis/core/identity/IdentityManager.js";
10
10
  import y from "@arcgis/core/request.js";
11
- import { i as $, a as q, g as R, b as J, d as z, s as W, e as A, f as _ } from "../../chunks/fieldAddDelete.js";
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 { a as A } from "../../chunks/item.js";
12
13
  import { u as V } from "../../chunks/useT9n.js";
13
14
  import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
14
15
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
15
16
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
16
- v5.0.0-next.124 */
17
+ v5.0.0-next.126 */
17
18
  const n = /* @__PURE__ */ new Map();
18
19
  n.set("oid", "key");
19
20
  n.set("guid", "key");
@@ -57,12 +58,12 @@ class Q extends x {
57
58
  return;
58
59
  }
59
60
  e.loaded || await e.load(), this.layerFields = e.fields.filter((o) => s.includes(o.name));
60
- 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));
61
62
  if (!this.layerFields?.length || a)
62
63
  this.fieldsAreDeletable = !1;
63
64
  else {
64
- const o = await Promise.all(this.layerFields.map(async (r) => await q(t, e, r, this.options)));
65
- if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
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)
66
67
  return;
67
68
  }
68
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) {
@@ -76,7 +77,7 @@ class Q extends x {
76
77
  if (this.options?.ignorePopupTemplate)
77
78
  return this.getFieldDisplayNameFromLayerFields(e);
78
79
  {
79
- const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
80
+ const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((l) => l.fieldName === e);
80
81
  return o ? z(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
81
82
  }
82
83
  }
@@ -86,8 +87,8 @@ class Q extends x {
86
87
  }
87
88
  async deleteFields() {
88
89
  const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
89
- fields: t.map((r) => ({
90
- name: r
90
+ fields: t.map((l) => ({
91
+ name: l
91
92
  }))
92
93
  }, o = {
93
94
  deleteFromDefinition: JSON.stringify(a)
@@ -96,8 +97,8 @@ class Q extends x {
96
97
  query: { ...o, f: "json", async: !1 },
97
98
  method: "post",
98
99
  responseType: "json"
99
- }).then(async (r) => {
100
- if (r.data?.success) {
100
+ }).then(async (l) => {
101
+ if (l.data?.success) {
101
102
  const h = `${e.url}/${e.layerId}`;
102
103
  t.forEach((i) => {
103
104
  e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
@@ -105,9 +106,9 @@ class Q extends x {
105
106
  const m = await y(h, { query: { f: "json" }, responseType: "json" });
106
107
  if (m) {
107
108
  const i = m.data;
108
- this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((l) => {
109
- i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[l]) : i.types?.forEach((d) => {
110
- d.templates.forEach((u) => delete u.prototype.attributes[l]);
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]);
111
112
  });
112
113
  }), this.updateFeatureService(i));
113
114
  } else
@@ -130,20 +131,20 @@ class Q extends x {
130
131
  updateTemplatesList(e) {
131
132
  const { currentLayerInfo: t, messages: s } = this, a = [];
132
133
  return (e ?? []).forEach((o) => {
133
- const r = new B();
134
- 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";
135
136
  const h = {};
136
137
  t.fields.forEach((i) => {
137
- let l = !1;
138
+ let r = !1;
138
139
  for (let d = 0; d < o.prototype.attributes.length; d++)
139
140
  if (o.prototype.attributes[d] === i.name) {
140
- l = !0, h[i.name] = o.prototype.attributes[i.name];
141
+ r = !0, h[i.name] = o.prototype.attributes[i.name];
141
142
  break;
142
143
  }
143
- !l && i.editable && (h[i.name] = i.defaultValue || null);
144
+ !r && i.editable && (h[i.name] = i.defaultValue || null);
144
145
  });
145
146
  const m = new j({ attributes: h });
146
- r.prototype = m, a.push(r);
147
+ l.prototype = m, a.push(l);
147
148
  }), a;
148
149
  }
149
150
  addType(e, t) {
@@ -153,36 +154,36 @@ class Q extends x {
153
154
  const { layer: t, fieldNames: s } = this, a = {
154
155
  templates: e.templates,
155
156
  types: e.types
156
- }, 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 = {
157
158
  f: "json",
158
159
  updateDefinition: JSON.stringify(a)
159
160
  };
160
161
  await y(o, {
161
- query: { ...r, f: "json" },
162
+ query: { ...l, f: "json" },
162
163
  method: "post",
163
164
  responseType: "json"
164
165
  }).then(async (h) => {
165
166
  if (h.data?.success) {
166
167
  const m = `${A(this.portal)}content/items/${this.item.id}/data`;
167
168
  if (this.options?.ignorePopupTemplate || s.forEach((i) => {
168
- t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
169
- l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((u) => u.fieldName !== i));
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));
170
171
  });
171
172
  }), t.attributeTableTemplate) {
172
173
  const i = t.attributeTableTemplate.clone();
173
- i.elements = i.elements.filter((l) => !(l.type === "field" && s.includes(l.fieldName))), i.orderByFields = i.orderByFields.filter((l) => !s.includes(l.field)), t.attributeTableTemplate = i;
174
+ 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;
174
175
  }
175
176
  if (t.fieldConfigurations?.length) {
176
- const l = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
177
- t.fieldConfigurations = l;
177
+ const r = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
178
+ t.fieldConfigurations = r;
178
179
  }
179
180
  await y(m, {
180
181
  query: { f: "json" },
181
182
  responseType: "json"
182
183
  }).then(async (i) => {
183
- const l = i.data;
184
- if (l?.layers || l?.tables) {
185
- const d = t.isTable, u = d ? l.tables : l.layers, c = u?.find((g) => g.id === t.layerId);
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);
186
187
  if (s.forEach((g) => {
187
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));
188
189
  }), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
@@ -192,7 +193,7 @@ class Q extends x {
192
193
  });
193
194
  });
194
195
  const g = `${A(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
195
- d ? (f.tables = u, l.layers && (f.layers = l.layers)) : (f.layers = u, l.tables && (f.tables = l.tables));
196
+ d ? (f.tables = u, r.layers && (f.layers = r.layers)) : (f.layers = u, r.tables && (f.tables = r.tables));
196
197
  const k = {
197
198
  f: "json",
198
199
  text: JSON.stringify(f)
@@ -247,9 +248,9 @@ class Q extends x {
247
248
  }
248
249
  renderFieldsPreview() {
249
250
  const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
250
- return p`<calcite-list .label=${o.fields}>${e.map((r) => {
251
- const h = t.find((m) => m.name === r);
252
- return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${H({ fieldType: _(r, s, a) })}</div></calcite-list-item>`;
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>`;
253
254
  })}</calcite-list>`;
254
255
  }
255
256
  renderCancelButton() {
@@ -0,0 +1,24 @@
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 { PropertyValues } from 'lit';
5
+ import { SearchResultItem } from '@arcgis/app-components';
6
+
7
+ /**
8
+ * The `arcgis-portal-replacement-item-redirect` component takes an item on a given portal, and checks if there is a replacement item associated with it
9
+ * via the `ReplacementItem2Item` relationship.
10
+ *
11
+ * 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.
12
+ *
13
+ * @internal
14
+ */
15
+ export declare class ArcgisPortalReplacementItemRedirect extends LitElement {
16
+ /** The deprecated/retired item to be checked for a replacement */
17
+ item: __esri.PortalItem | SearchResultItem;
18
+ /** The portal instance */
19
+ portal: __esri.Portal;
20
+ /** The signed in user */
21
+ user: __esri.PortalUser;
22
+ /** Set focus on the component */
23
+ setFocus(): Promise<void>;
24
+ }
@@ -0,0 +1,72 @@
1
+ import { c as o } from "../../chunks/runtime.js";
2
+ import { LitElement as c, nothing as a } from "@arcgis/lumina";
3
+ import { g as n } from "../../chunks/item.js";
4
+ import { html as l } from "lit";
5
+ import { u as m } from "../../chunks/useT9n.js";
6
+ import { createRef as p, ref as d } from "lit/directives/ref.js";
7
+ import { unsafeHTML as h } from "lit/directives/unsafe-html.js";
8
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
10
+ v5.0.0-next.126 */
11
+ const u = 1e4;
12
+ class f extends c {
13
+ constructor() {
14
+ super(...arguments), this.replacementId = null, this.timerId = void 0, this.t9n = m({ blocking: !0 }), this.primaryActionRef = p(), this.getItemDetailsUrl = ({ portal: t, itemId: e }) => {
15
+ const i = t.restUrl;
16
+ return i ? `${i.replace("sharing/rest", "home")}/item.html?id=${e}` : "";
17
+ }, this.replacementItem = null, this.redirectAction = null, this.open = !1;
18
+ }
19
+ static {
20
+ this.properties = { replacementItem: 16, redirectAction: 16, open: 16, item: 0, portal: 0, user: 0 };
21
+ }
22
+ async setFocus() {
23
+ this.primaryActionRef.value?.setFocus();
24
+ }
25
+ willUpdate(t) {
26
+ t.has("item") && this.initItem();
27
+ }
28
+ getRedirectAction() {
29
+ return null;
30
+ }
31
+ setupTimer({ onComplete: t }) {
32
+ typeof this.timerId == "number" && clearTimeout(this.timerId);
33
+ const e = setTimeout(() => {
34
+ t(), this.timerId = void 0;
35
+ }, u);
36
+ this.timerId = +e;
37
+ }
38
+ cancelTimer({ onCancel: t } = {}) {
39
+ t?.(), clearTimeout(this.timerId);
40
+ }
41
+ async initItem() {
42
+ if (!this.item)
43
+ return;
44
+ const { item: t, portal: e } = this, i = (await n(t.id, e, {
45
+ relationshipType: "ReplacementItem2Item",
46
+ direction: "reverse"
47
+ })).data?.relatedItems?.[0];
48
+ this.redirectAction = this.getRedirectAction(), this.replacementItem = i, this.replacementId = i.id, this.redirectAction && this.setupTimer({
49
+ onComplete: () => {
50
+ this.viewItemDetailsPage();
51
+ }
52
+ }), this.open = !0;
53
+ }
54
+ viewItemDetailsPage() {
55
+ window.open(this.getItemDetailsUrl({ portal: this.portal, itemId: this.replacementId }), "_self");
56
+ }
57
+ render() {
58
+ const { open: t, t9n: e, item: i, replacementItem: s, redirectAction: r } = this;
59
+ if (s)
60
+ return l`<calcite-dialog modal .open=${t} width=s kind=info outside-close-disabled .heading=${r ? e.redirectToReplacement : e.replacementAvailable} @calciteDialogClose=${() => {
61
+ this.cancelTimer(), this.item = null, this.open = !1;
62
+ }}><div>${h(e.deprecatedHasReplacement.replace("${itemTitle}", i?.title || ""))}</div><arcgis-item-card disable-selection .item=${s} .portal=${this.portal} show-item-type show-badges show-item-type-hosted>${!!r && l`<calcite-button appearance=outline-fill kind=neutral slot=actions-end @click=${() => this.viewItemDetailsPage()}>${e.viewItemDetails}</calcite-button>` || ""}</arcgis-item-card><calcite-button slot=footer-end appearance=outline-fill kind=neutral @click=${() => {
63
+ this.cancelTimer(), this.open = !1;
64
+ }}>${e.cancel}</calcite-button><calcite-button slot=footer-end @click=${() => {
65
+ this.cancelTimer(), r ? r() : this.viewItemDetailsPage();
66
+ }} icon-end=${(r ? void 0 : "launch") ?? a} ${d(this.primaryActionRef)}>${r ? e.redirect : e.viewItemDetails}</calcite-button></calcite-dialog>`;
67
+ }
68
+ }
69
+ o("arcgis-portal-replacement-item-redirect", f);
70
+ export {
71
+ f as ArcgisPortalReplacementItemRedirect
72
+ };
@@ -0,0 +1,4 @@
1
+ import "@esri/calcite-components/components/calcite-dialog";
2
+ import "@arcgis/app-components/dist/components/arcgis-item-card.js";
3
+ import "@esri/calcite-components/components/calcite-button";
4
+ export * from "./customElement.js";
@@ -0,0 +1,4 @@
1
+ import "@esri/calcite-components/components/calcite-dialog";
2
+ import "@arcgis/app-components/dist/components/arcgis-item-card.js";
3
+ import "@esri/calcite-components/components/calcite-button";
4
+ export * from "./customElement.js";
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2026-01-14T04:45:25",
2
+ "timestamp": "2026-01-15T04:43:01",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.124",
5
+ "version": "5.0.0-next.126",
6
6
  "typescriptVersion": "5.9.3"
7
7
  },
8
8
  "schemaVersion": "2.1.0",
@@ -1443,6 +1443,163 @@
1443
1443
  }
1444
1444
  }
1445
1445
  ]
1446
+ },
1447
+ {
1448
+ "kind": "javascript-module",
1449
+ "path": "components/arcgis-portal-replacement-item-redirect",
1450
+ "sourcePath": "src/components/portal-replacement-item-redirect/portal-replacement-item-redirect.tsx",
1451
+ "declarations": [
1452
+ {
1453
+ "kind": "class",
1454
+ "customElement": true,
1455
+ "name": "ArcgisPortalReplacementItemRedirect",
1456
+ "tagName": "arcgis-portal-replacement-item-redirect",
1457
+ "pascalCaseName": "ArcgisPortalReplacementItemRedirect",
1458
+ "description": "The `arcgis-portal-replacement-item-redirect` component takes an item on a given portal, and checks if there is a replacement item associated with it\nvia the `ReplacementItem2Item` relationship.\n\nIf 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.",
1459
+ "docsTags": [
1460
+ {
1461
+ "name": "internal"
1462
+ }
1463
+ ],
1464
+ "superclass": {
1465
+ "name": "PublicLitElement",
1466
+ "module": "PublicLitElement",
1467
+ "package": "@arcgis/lumina"
1468
+ },
1469
+ "members": [
1470
+ {
1471
+ "kind": "field",
1472
+ "name": "item",
1473
+ "description": "The deprecated/retired item to be checked for a replacement",
1474
+ "type": {
1475
+ "text": "PortalItem | SearchResultItem",
1476
+ "references": [
1477
+ {
1478
+ "name": "PortalItem",
1479
+ "package": "@arcgis/core",
1480
+ "module": "portal/PortalItem.d.ts",
1481
+ "viewUrl": "https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html",
1482
+ "start": 0,
1483
+ "end": 10
1484
+ },
1485
+ {
1486
+ "name": "SearchResultItem",
1487
+ "package": "@arcgis/app-components",
1488
+ "module": "dist/types/utils/types.d.ts",
1489
+ "start": 13,
1490
+ "end": 29
1491
+ }
1492
+ ],
1493
+ "values": [
1494
+ {
1495
+ "type": "PortalItem"
1496
+ },
1497
+ {
1498
+ "type": "SearchResultItem"
1499
+ }
1500
+ ]
1501
+ }
1502
+ },
1503
+ {
1504
+ "kind": "field",
1505
+ "name": "portal",
1506
+ "description": "The portal instance",
1507
+ "type": {
1508
+ "text": "Portal",
1509
+ "references": [
1510
+ {
1511
+ "name": "Portal",
1512
+ "package": "@arcgis/core",
1513
+ "module": "portal/Portal.d.ts",
1514
+ "viewUrl": "https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html",
1515
+ "start": 0,
1516
+ "end": 6
1517
+ }
1518
+ ]
1519
+ }
1520
+ },
1521
+ {
1522
+ "kind": "field",
1523
+ "name": "user",
1524
+ "description": "The signed in user",
1525
+ "type": {
1526
+ "text": "PortalUser",
1527
+ "references": [
1528
+ {
1529
+ "name": "PortalUser",
1530
+ "package": "@arcgis/core",
1531
+ "module": "portal/PortalUser.d.ts",
1532
+ "viewUrl": "https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html",
1533
+ "start": 0,
1534
+ "end": 10
1535
+ }
1536
+ ]
1537
+ }
1538
+ },
1539
+ {
1540
+ "kind": "method",
1541
+ "name": "componentOnReady",
1542
+ "description": "Create a promise that resolves once component is fully loaded.",
1543
+ "docsTags": [
1544
+ {
1545
+ "name": "example",
1546
+ "text": "```js\nconst arcgisPortalReplacementItemRedirect = document.querySelector(\"arcgis-portal-replacement-item-redirect\");\ndocument.body.append(arcgisPortalReplacementItemRedirect);\nawait arcgisPortalReplacementItemRedirect.componentOnReady();\nconsole.log(\"arcgis-portal-replacement-item-redirect is ready to go!\");\n```"
1547
+ }
1548
+ ],
1549
+ "return": {
1550
+ "type": {
1551
+ "text": "Promise<this>",
1552
+ "references": [
1553
+ {
1554
+ "module": "lib/lib.es5.d.ts",
1555
+ "name": "Promise",
1556
+ "package": "typescript",
1557
+ "start": 0,
1558
+ "end": 7
1559
+ }
1560
+ ]
1561
+ }
1562
+ },
1563
+ "inheritedFrom": {
1564
+ "name": "PublicLitElement",
1565
+ "module": "PublicLitElement",
1566
+ "package": "@arcgis/lumina"
1567
+ },
1568
+ "signature": "(): Promise<this>"
1569
+ },
1570
+ {
1571
+ "kind": "method",
1572
+ "name": "setFocus",
1573
+ "description": "Set focus on the component",
1574
+ "return": {
1575
+ "type": {
1576
+ "text": "Promise<void>",
1577
+ "references": [
1578
+ {
1579
+ "name": "Promise",
1580
+ "package": "typescript",
1581
+ "module": "lib/lib.es5.d.ts",
1582
+ "start": 0,
1583
+ "end": 7
1584
+ }
1585
+ ]
1586
+ }
1587
+ },
1588
+ "signature": "(): Promise<void>"
1589
+ }
1590
+ ],
1591
+ "importPath": "components/arcgis-portal-replacement-item-redirect"
1592
+ }
1593
+ ],
1594
+ "exports": [
1595
+ {
1596
+ "kind": "custom-element-definition",
1597
+ "name": "arcgis-portal-replacement-item-redirect",
1598
+ "declaration": {
1599
+ "name": "ArcgisPortalReplacementItemRedirect"
1600
+ }
1601
+ }
1602
+ ]
1446
1603
  }
1447
1604
  ]
1448
1605
  }