@arcgis/portal-components 5.0.0-next.125 → 5.0.0-next.127

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 (99) hide show
  1. package/dist/cdn/{H2GRTM3N.js → 3IBU7OXU.js} +2 -2
  2. package/dist/cdn/4ET2VMGZ.js +4 -0
  3. package/dist/cdn/{UQ2KECW6.js → 4SVZNDD5.js} +2 -2
  4. package/dist/cdn/{TGEKIZMB.js → 5C2GWXM2.js} +2 -2
  5. package/dist/cdn/{2IRCL5FI.js → 652FN34L.js} +1 -1
  6. package/dist/cdn/{BXC47IBG.js → ALENKFUQ.js} +2 -2
  7. package/dist/cdn/BJPS5ZJM.js +4 -0
  8. package/dist/cdn/{3UR2FIL6.js → CW3FOKQP.js} +2 -2
  9. package/dist/cdn/DS7M5QVJ.js +4 -0
  10. package/dist/cdn/{2O3Q6DHE.js → ELOTJB56.js} +2 -2
  11. package/dist/cdn/GRJOT5E2.js +4 -0
  12. package/dist/cdn/{O3G7FUPW.js → HXFIUZD3.js} +2 -2
  13. package/dist/cdn/IBJWSLIZ.js +4 -0
  14. package/dist/cdn/{SW2AOG26.js → JWB6OMHQ.js} +1 -1
  15. package/dist/cdn/MROC3UG5.js +4 -0
  16. package/dist/cdn/RYNNPJZT.js +6 -0
  17. package/dist/cdn/XKIPHUMJ.js +4 -0
  18. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ar.json +1 -0
  19. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bg.json +1 -0
  20. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bs.json +1 -0
  21. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ca.json +1 -0
  22. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.cs.json +1 -0
  23. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.da.json +1 -0
  24. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.de.json +1 -0
  25. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.el.json +1 -0
  26. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -0
  27. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.es.json +1 -0
  28. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.et.json +1 -0
  29. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fi.json +1 -0
  30. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fr.json +1 -0
  31. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.he.json +1 -0
  32. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hr.json +1 -0
  33. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hu.json +1 -0
  34. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.id.json +1 -0
  35. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.it.json +1 -0
  36. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ja.json +1 -0
  37. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ko.json +1 -0
  38. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lt.json +1 -0
  39. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lv.json +1 -0
  40. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.nl.json +1 -0
  41. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.no.json +1 -0
  42. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pl.json +1 -0
  43. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-BR.json +1 -0
  44. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-PT.json +1 -0
  45. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ro.json +1 -0
  46. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ru.json +1 -0
  47. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sk.json +1 -0
  48. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sl.json +1 -0
  49. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sr.json +1 -0
  50. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sv.json +1 -0
  51. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.th.json +1 -0
  52. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.tr.json +1 -0
  53. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.uk.json +1 -0
  54. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.vi.json +1 -0
  55. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-CN.json +1 -0
  56. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-HK.json +1 -0
  57. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-TW.json +1 -0
  58. package/dist/cdn/index.js +2 -2
  59. package/dist/cdn/main.css +1 -1
  60. package/dist/chunks/common.js +1 -1
  61. package/dist/chunks/fieldAddDelete.js +148 -234
  62. package/dist/chunks/item.js +103 -0
  63. package/dist/chunks/loadClassificationData.js +1 -1
  64. package/dist/chunks/requests.js +1 -1
  65. package/dist/chunks/runtime.js +1 -1
  66. package/dist/chunks/useT9n.js +1 -1
  67. package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
  68. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  69. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  70. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  71. package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
  72. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
  73. package/dist/components/arcgis-portal-field-delete/customElement.js +34 -33
  74. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +31 -0
  75. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +151 -0
  76. package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +6 -0
  77. package/dist/components/arcgis-portal-replacement-item-redirect/index.js +6 -0
  78. package/dist/components/arcgis-portal-replacement-item-redirect/types/actions.d.ts +11 -0
  79. package/dist/components/arcgis-portal-replacement-item-redirect/utils/actions.d.ts +24 -0
  80. package/dist/components/arcgis-portal-replacement-item-redirect/utils/capabilities.d.ts +4 -0
  81. package/dist/components/arcgis-portal-replacement-item-redirect/utils/info.d.ts +2 -0
  82. package/dist/docs/api.json +163 -2
  83. package/dist/docs/docs.json +167 -2
  84. package/dist/docs/vscode.html-custom-data.json +12 -0
  85. package/dist/docs/web-types.json +45 -1
  86. package/dist/index.d.ts +11 -0
  87. package/dist/index.js +1 -1
  88. package/dist/loader.js +3 -2
  89. package/dist/types/lumina.d.ts +6 -0
  90. package/dist/types/preact.d.ts +7 -0
  91. package/dist/types/react.d.ts +8 -0
  92. package/dist/types/stencil.d.ts +6 -0
  93. package/package.json +5 -4
  94. package/dist/cdn/2UR3MLWP.js +0 -4
  95. package/dist/cdn/COOWY4LG.js +0 -4
  96. package/dist/cdn/IRKTGOZ2.js +0 -4
  97. package/dist/cdn/PIYM3J66.js +0 -4
  98. package/dist/cdn/PTWV27BX.js +0 -4
  99. package/dist/cdn/WNF6TFNA.js +0 -6
@@ -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.125 */
9
+ v5.0.0-next.127 */
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.125 */
16
+ v5.0.0-next.127 */
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.125 */
10
+ v5.0.0-next.127 */
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.125 */
8
+ v5.0.0-next.127 */
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.125 */
29
+ v5.0.0-next.127 */
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.125 */
8
+ v5.0.0-next.127 */
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 { g 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.125 */
17
+ v5.0.0-next.127 */
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,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.127 */
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
+ }
@@ -0,0 +1,24 @@
1
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ import { default as PortalUser } from '@arcgis/core/portal/PortalUser';
3
+ import { default as Credential } from '@arcgis/core/identity/Credential';
4
+ import { ItemAction } from '../types/actions';
5
+ interface ActionParams {
6
+ item: __esri.PortalItem;
7
+ user: PortalUser;
8
+ portal: __esri.Portal;
9
+ credential?: Credential;
10
+ }
11
+ interface RedirectParams extends Pick<ActionParams, "item" | "portal" | "user"> {
12
+ url: string;
13
+ }
14
+ export declare function getDefaultActionForItemType({ item, user, portal }: ActionParams): Promise<ItemAction | null>;
15
+ export declare function download({ item, user, portal, credential }: ActionParams): Promise<void>;
16
+ export declare function getItemDataPath(item: __esri.PortalItem, portal: __esri.Portal, credential: Credential): string;
17
+ export declare function getItemDataUrl(item: __esri.PortalItem, portal: __esri.Portal): string;
18
+ /**
19
+ * An item can be public but its /data will be licensed and only allowed access by licensed users.
20
+ * This function makes a HEAD request against /data and check the result. If valid, will open given url
21
+ */
22
+ export declare function checkItemAccessAndRedirect({ item, user, portal, url }: RedirectParams): Promise<void>;
23
+ export declare function openPage(url: string, sameWindow?: boolean): void;
24
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ import { default as PortalUser } from '@arcgis/core/portal/PortalUser';
3
+ export declare function canUpdate(item: Pick<__esri.PortalItem, "itemControl" | "owner">, user: PortalUser): boolean;
4
+ export declare function isItemOwner(item: Pick<__esri.PortalItem, "owner">, user: Pick<PortalUser, "username">): boolean;
@@ -0,0 +1,2 @@
1
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ export declare const isPDF: (item: __esri.PortalItem) => boolean;