@arcgis/map-components 5.2.0-next.4 → 5.2.0-next.6

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 (103) hide show
  1. package/dist/cdn/5DNVHLO6.js +2 -0
  2. package/dist/cdn/5T3MHTWU.js +2 -0
  3. package/dist/cdn/{AOC4VUP6.js → 6OOQ7GIC.js} +1 -1
  4. package/dist/cdn/{A7P3DUN2.js → 7DIC4O5E.js} +1 -1
  5. package/dist/cdn/ABPHGXQN.js +2 -0
  6. package/dist/cdn/BMQSD7CZ.js +2 -0
  7. package/dist/cdn/CZXCSL3K.js +2 -0
  8. package/dist/cdn/{6BUPJWLA.js → J2IWIVXJ.js} +1 -1
  9. package/dist/cdn/L34RL7Y3.js +2 -0
  10. package/dist/cdn/{4XVCI45D.js → XF5VBSRX.js} +1 -1
  11. package/dist/cdn/assets/feature-templates/t9n/messages.ar.json +1 -0
  12. package/dist/cdn/assets/feature-templates/t9n/messages.bg.json +1 -0
  13. package/dist/cdn/assets/feature-templates/t9n/messages.bs.json +1 -0
  14. package/dist/cdn/assets/feature-templates/t9n/messages.ca.json +1 -0
  15. package/dist/cdn/assets/feature-templates/t9n/messages.cs.json +1 -0
  16. package/dist/cdn/assets/feature-templates/t9n/messages.da.json +1 -0
  17. package/dist/cdn/assets/feature-templates/t9n/messages.de.json +1 -0
  18. package/dist/cdn/assets/feature-templates/t9n/messages.el.json +1 -0
  19. package/dist/cdn/assets/feature-templates/t9n/messages.en.json +1 -0
  20. package/dist/cdn/assets/feature-templates/t9n/messages.es.json +1 -0
  21. package/dist/cdn/assets/feature-templates/t9n/messages.et.json +1 -0
  22. package/dist/cdn/assets/feature-templates/t9n/messages.fi.json +1 -0
  23. package/dist/cdn/assets/feature-templates/t9n/messages.fr.json +1 -0
  24. package/dist/cdn/assets/feature-templates/t9n/messages.he.json +1 -0
  25. package/dist/cdn/assets/feature-templates/t9n/messages.hr.json +1 -0
  26. package/dist/cdn/assets/feature-templates/t9n/messages.hu.json +1 -0
  27. package/dist/cdn/assets/feature-templates/t9n/messages.id.json +1 -0
  28. package/dist/cdn/assets/feature-templates/t9n/messages.it.json +1 -0
  29. package/dist/cdn/assets/feature-templates/t9n/messages.ja.json +1 -0
  30. package/dist/cdn/assets/feature-templates/t9n/messages.ko.json +1 -0
  31. package/dist/cdn/assets/feature-templates/t9n/messages.lt.json +1 -0
  32. package/dist/cdn/assets/feature-templates/t9n/messages.lv.json +1 -0
  33. package/dist/cdn/assets/feature-templates/t9n/messages.nl.json +1 -0
  34. package/dist/cdn/assets/feature-templates/t9n/messages.no.json +1 -0
  35. package/dist/cdn/assets/feature-templates/t9n/messages.pl.json +1 -0
  36. package/dist/cdn/assets/feature-templates/t9n/messages.pt-BR.json +1 -0
  37. package/dist/cdn/assets/feature-templates/t9n/messages.pt-PT.json +1 -0
  38. package/dist/cdn/assets/feature-templates/t9n/messages.ro.json +1 -0
  39. package/dist/cdn/assets/feature-templates/t9n/messages.ru.json +1 -0
  40. package/dist/cdn/assets/feature-templates/t9n/messages.sk.json +1 -0
  41. package/dist/cdn/assets/feature-templates/t9n/messages.sl.json +1 -0
  42. package/dist/cdn/assets/feature-templates/t9n/messages.sr.json +1 -0
  43. package/dist/cdn/assets/feature-templates/t9n/messages.sv.json +1 -0
  44. package/dist/cdn/assets/feature-templates/t9n/messages.th.json +1 -0
  45. package/dist/cdn/assets/feature-templates/t9n/messages.tr.json +1 -0
  46. package/dist/cdn/assets/feature-templates/t9n/messages.uk.json +1 -0
  47. package/dist/cdn/assets/feature-templates/t9n/messages.vi.json +1 -0
  48. package/dist/cdn/assets/feature-templates/t9n/messages.zh-CN.json +1 -0
  49. package/dist/cdn/assets/feature-templates/t9n/messages.zh-HK.json +1 -0
  50. package/dist/cdn/assets/feature-templates/t9n/messages.zh-TW.json +1 -0
  51. package/dist/cdn/index.js +1 -1
  52. package/dist/cdn/main.css +1 -1
  53. package/dist/components/arcgis-daylight/customElement.d.ts +1 -1
  54. package/dist/components/arcgis-daylight/customElement.js +34 -27
  55. package/dist/components/arcgis-direct-line-measurement-3d/customElement.js +20 -20
  56. package/dist/components/arcgis-feature-table/customElement.js +27 -27
  57. package/dist/components/arcgis-feature-templates/TemplateItem.d.ts +33 -0
  58. package/dist/components/arcgis-feature-templates/customElement.d.ts +275 -0
  59. package/dist/components/arcgis-feature-templates/customElement.js +560 -0
  60. package/dist/components/arcgis-feature-templates/index.d.ts +1 -0
  61. package/dist/components/arcgis-feature-templates/index.js +13 -0
  62. package/dist/components/arcgis-features/customElement.d.ts +4 -17
  63. package/dist/components/arcgis-layer-list/customElement.d.ts +3 -0
  64. package/dist/components/arcgis-layer-list-next/customElement.d.ts +319 -32
  65. package/dist/components/arcgis-layer-list-next/customElement.js +5 -1
  66. package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +23 -23
  67. package/dist/components/arcgis-link-chart/customElement.d.ts +27 -3
  68. package/dist/components/arcgis-map/customElement.d.ts +26 -2
  69. package/dist/components/arcgis-oriented-imagery-viewer/customElement.js +3 -3
  70. package/dist/components/arcgis-paste/PasteViewModel.d.ts +1 -1
  71. package/dist/components/arcgis-paste/customElement.js +27 -38
  72. package/dist/components/arcgis-paste/index.js +1 -1
  73. package/dist/components/arcgis-popup/customElement.d.ts +13 -20
  74. package/dist/components/arcgis-scene/customElement.d.ts +26 -2
  75. package/dist/components/arcgis-slider-binary-color-size-legacy/customElement.d.ts +10 -10
  76. package/dist/components/arcgis-slider-classed-color-legacy/customElement.d.ts +6 -6
  77. package/dist/components/arcgis-slider-classed-size-legacy/customElement.d.ts +6 -6
  78. package/dist/components/arcgis-slider-color-legacy/customElement.d.ts +10 -10
  79. package/dist/components/arcgis-slider-color-size-legacy/customElement.d.ts +10 -10
  80. package/dist/components/arcgis-slider-opacity-legacy/customElement.d.ts +10 -10
  81. package/dist/components/arcgis-slider-scale-range/customElement.js +16 -16
  82. package/dist/components/arcgis-slider-size-legacy/customElement.d.ts +10 -10
  83. package/dist/components/arcgis-template-image/customElement.d.ts +14 -0
  84. package/dist/components/arcgis-template-image/customElement.js +119 -0
  85. package/dist/components/arcgis-template-image/index.d.ts +1 -0
  86. package/dist/components/arcgis-template-image/index.js +1 -0
  87. package/dist/components/arcgis-version-management/customElement.js +21 -20
  88. package/dist/components/arcgis-version-management/index.js +1 -0
  89. package/dist/docs/api.json +1 -1
  90. package/dist/docs/docs.json +1 -1
  91. package/dist/docs/vscode.html-custom-data.json +1 -1
  92. package/dist/docs/web-types.json +1 -1
  93. package/dist/index.d.ts +14 -0
  94. package/dist/loader.js +2 -0
  95. package/dist/types/lumina.d.ts +14 -0
  96. package/dist/types/preact.d.ts +16 -0
  97. package/dist/types/react.d.ts +18 -0
  98. package/dist/types/stencil.d.ts +14 -0
  99. package/package.json +5 -5
  100. package/dist/cdn/IBTOXDST.js +0 -2
  101. package/dist/cdn/PMZAIPWC.js +0 -2
  102. package/dist/cdn/RL5PFJGE.js +0 -2
  103. package/dist/cdn/YJCBT5VK.js +0 -2
@@ -0,0 +1,560 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { c as w } from "../../chunks/runtime.js";
3
+ import { css as F, html as c } from "lit";
4
+ import { LitElement as M, createEvent as f } from "@arcgis/lumina";
5
+ import { u as S } from "../../chunks/useT9n.js";
6
+ import { u as _ } from "../../chunks/useView.js";
7
+ import { m as $ } from "../../chunks/useViewModel.js";
8
+ import { property as s, subclass as g } from "@arcgis/core/core/accessorSupport/decorators.js";
9
+ import b from "@arcgis/core/core/Accessor.js";
10
+ import { getAllStandardFeatureTemplatesForLayer as x, getTemplatesForLayers as B } from "@arcgis/core/applications/Components/templateUtils.js";
11
+ import { i as v, c as T } from "../../chunks/layer-utils.js";
12
+ import { isTable as u, getEffectiveLayerCapabilities as D } from "@arcgis/core/applications/Components/layerUtils.js";
13
+ import { usePropertyChange as L } from "@arcgis/lumina/controllers";
14
+ import { watch as y } from "@arcgis/core/core/reactiveUtils.js";
15
+ import { debounce as U } from "@arcgis/toolkit/function";
16
+ const E = F`:host{display:flex;position:relative;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.filter-no-results{padding:var(--calcite-spacing-md) var(--calcite-spacing-lg)}.root{display:flex;flex:1 1 auto;overflow:hidden auto;transition:max-height .25s ease-in-out}.root>*{width:100%;box-sizing:border-box}.feature-template-tabs{--calcite-tab-background-color: transparent}`;
17
+ var I = Object.defineProperty, C = Object.getOwnPropertyDescriptor, h = (t, e, i, r) => {
18
+ for (var o = r > 1 ? void 0 : r ? C(e, i) : e, p = t.length - 1, n; p >= 0; p--)
19
+ (n = t[p]) && (o = (r ? n(e, i, o) : n(o)) || o);
20
+ return r && o && I(e, i, o), o;
21
+ };
22
+ let d = class extends b {
23
+ /**
24
+ * @public
25
+ * @param properties
26
+ */
27
+ constructor(t) {
28
+ super(t), this.layer = null, this.template = null;
29
+ }
30
+ get description() {
31
+ return this.template?.description ?? "";
32
+ }
33
+ get label() {
34
+ return this.template?.name ?? "";
35
+ }
36
+ get id() {
37
+ return `${this.label ?? ""}–${this.layer?.id}`;
38
+ }
39
+ get supportsUpload() {
40
+ return this.layer?.type === "scene";
41
+ }
42
+ };
43
+ h([
44
+ s()
45
+ ], d.prototype, "description", 1);
46
+ h([
47
+ s()
48
+ ], d.prototype, "label", 1);
49
+ h([
50
+ s()
51
+ ], d.prototype, "layer", 2);
52
+ h([
53
+ s()
54
+ ], d.prototype, "template", 2);
55
+ h([
56
+ s()
57
+ ], d.prototype, "thumbnail", 2);
58
+ h([
59
+ s()
60
+ ], d.prototype, "id", 1);
61
+ h([
62
+ s()
63
+ ], d.prototype, "supportsUpload", 1);
64
+ d = h([
65
+ g("components.feature-templates.TemplateItem")
66
+ ], d);
67
+ var R = Object.defineProperty, A = Object.getOwnPropertyDescriptor, l = (t, e, i, r) => {
68
+ for (var o = r > 1 ? void 0 : r ? A(e, i) : e, p = t.length - 1, n; p >= 0; p--)
69
+ (n = t[p]) && (o = (r ? n(e, i, o) : n(o)) || o);
70
+ return r && o && R(e, i, o), o;
71
+ };
72
+ function P(t) {
73
+ switch (t) {
74
+ case "point":
75
+ case "multipoint":
76
+ case "polyline":
77
+ case "polygon":
78
+ case "extent":
79
+ case "mesh":
80
+ return t;
81
+ }
82
+ return "noneSpecified";
83
+ }
84
+ const V = (t) => P(t.layer.geometryType ?? "");
85
+ let a = class extends b {
86
+ //#region Lifecycle
87
+ constructor(t) {
88
+ super(t), this._hasRunInitialLoad = !1, this.favoritesEnabled = !1, this.recentlyUsedEnabled = !1, this.hideTemplateDescription = !1, this.filterText = "", this.recentFilterText = "", this.favoritesFilterText = "", this.display = "grouped", this.groupBy = "layer", this.hideTemplatesMode = "never", this.disableTemplatesMode = "never", this.sectionSortBy = "system", this.templateSortBy = "alphabetical", this.sharedTemplatesDisabled = !1, this.excludeTables = !1, this.favorites = /* @__PURE__ */ new Set(), this.fetchingTemplateMetaData = !1, this.recentlyUsed = [];
89
+ }
90
+ //#endregion
91
+ //#region Public methods
92
+ /*
93
+ * The template source has changed. This maybe because layers
94
+ * have been added or removed, the map changed or application templates
95
+ * supplied.
96
+ */
97
+ async handleTemplateSourceDefinitionChanged() {
98
+ if (this._hasRunInitialLoad = !1, this.applicationTemplates) {
99
+ await this._restore();
100
+ return;
101
+ }
102
+ try {
103
+ this.fetchingTemplateMetaData = !0;
104
+ const t = this.activeLayers;
105
+ if (await Promise.allSettled(t.map((e) => e.load())), this.sharedTemplatesDisabled) {
106
+ const e = [];
107
+ for (const i of t) {
108
+ const r = x(i);
109
+ r.length > 0 && e.push({
110
+ layer: i,
111
+ templates: r
112
+ });
113
+ }
114
+ this.mapTemplates = e;
115
+ return;
116
+ }
117
+ this.mapTemplates = await B(t, this.view, void 0, {
118
+ returnVisibleTemplatesOnly: !0
119
+ }), await this._restore();
120
+ } catch {
121
+ this.mapTemplates = [];
122
+ } finally {
123
+ this.fetchingTemplateMetaData = !1;
124
+ }
125
+ }
126
+ get loading() {
127
+ return !this._hasRunInitialLoad || this.layers !== void 0 || this.applicationTemplates !== void 0 || !this.view?.ready;
128
+ }
129
+ /*
130
+ * Add a favorite
131
+ */
132
+ async addFavorite(t) {
133
+ this.favorites.add(t.id), this.favorites = new Set(this.favorites);
134
+ }
135
+ /*
136
+ * Remove a favorite
137
+ */
138
+ async removeFavorite(t) {
139
+ this.favorites.delete(t.id), this.favorites = new Set(this.favorites);
140
+ }
141
+ /*
142
+ * Add a recently selected Template
143
+ */
144
+ addRecent(t) {
145
+ if (!this.recentlyUsedEnabled)
146
+ return;
147
+ const e = this.recentlyUsed.filter((i) => i !== t.id);
148
+ e.unshift(t.id) > 20 && (e.length = 20), this.recentlyUsed = e;
149
+ }
150
+ /*
151
+ * Remove a favorite
152
+ */
153
+ async removeRecent(t) {
154
+ this.recentlyUsed = this.recentlyUsed.filter((e) => e !== t.id);
155
+ }
156
+ //#endregion
157
+ //#region Private methods
158
+ /*
159
+ * Restore favorites and recents, if there is a provider.
160
+ */
161
+ async _restore() {
162
+ try {
163
+ if (this.favoritesEnabled && this.restoreFavorites) {
164
+ const t = await this.restoreFavorites();
165
+ this.favorites = new Set(t ?? []);
166
+ }
167
+ } catch {
168
+ }
169
+ try {
170
+ if (this.recentlyUsedEnabled && this.restoreRecentlyUsed) {
171
+ const t = await this.restoreRecentlyUsed();
172
+ this.recentlyUsed = t ?? [];
173
+ }
174
+ } catch {
175
+ }
176
+ }
177
+ /*
178
+ * Sort the templates based on a function or alphabetical.
179
+ */
180
+ _sortTemplates(t) {
181
+ if (this.templateSortByFunction) {
182
+ const e = this.templateSortByFunction(t) ?? null;
183
+ return e === null ? t : e;
184
+ }
185
+ return this.templateSortBy === "alphabetical" ? t.toSorted((e, i) => e.label.localeCompare(i.label)) : t;
186
+ }
187
+ /*
188
+ * Sort the sections based on a function or alphabetical, and sort the templates within the sections as well.
189
+ */
190
+ _sortSections(t) {
191
+ if (this.sectionSortByFunction) {
192
+ const e = this.sectionSortByFunction(t);
193
+ e && (t = e);
194
+ } else if (this.sectionSortBy === "alphabetical")
195
+ t = t.toSorted((e, i) => e.sectionName.localeCompare(i.sectionName));
196
+ else if (this.groupBy === "geometry" && !this.groupByFunction) {
197
+ const e = {
198
+ point: 1,
199
+ multipoint: 2,
200
+ polyline: 3,
201
+ polygon: 4,
202
+ extent: 5,
203
+ mesh: 6,
204
+ noneSpecified: 7
205
+ };
206
+ t = t.toSorted((i, r) => {
207
+ const o = e[i.sectionName] ?? 10, p = e[r.sectionName] ?? 10;
208
+ return o - p;
209
+ });
210
+ }
211
+ for (const e of t)
212
+ e.templates = this._sortTemplates(e.templates);
213
+ return t;
214
+ }
215
+ _layerIsVisibleAtCurrentScale(t) {
216
+ if (!this.view)
217
+ return !0;
218
+ let e = t;
219
+ v(t) && (e = t.parent);
220
+ const i = this.view.allLayerViews.find((r) => r.layer === e);
221
+ if (!i)
222
+ return !0;
223
+ if (v(t)) {
224
+ const r = this.view.scale;
225
+ if (i.visibleAtCurrentScale) {
226
+ const o = t.minScale, p = t.maxScale;
227
+ let n = !o, m = !p;
228
+ return !n && r <= o && (n = !0), !m && r >= p && (m = !0), n && m;
229
+ }
230
+ }
231
+ return i.visibleAtCurrentScale;
232
+ }
233
+ get activeLayers() {
234
+ const t = [];
235
+ for (const e of this.layers ?? [])
236
+ if (T(e))
237
+ for (const i of e.sublayers)
238
+ t.push(i);
239
+ else
240
+ t.push(e);
241
+ if (this.layers === void 0 || this.layers === null) {
242
+ for (const e of [
243
+ ...this.view?.map?.allLayers?.slice(0).reverse() ?? [],
244
+ ...this.excludeTables ? [] : this.view?.map?.allTables?.slice(0).reverse() ?? []
245
+ ])
246
+ if (e.type === "feature" || e.type === "scene" || e.type === "geojson" || e.type === "oriented-imagery" || e.type === "knowledge-graph")
247
+ t.push(e);
248
+ else if (T(e))
249
+ for (const i of e.sublayers)
250
+ t.push(i);
251
+ }
252
+ return t;
253
+ }
254
+ get selectedTemplate() {
255
+ return this.allTemplates.find((t) => t.id === this.selectedTemplateId);
256
+ }
257
+ get effectiveTemplates() {
258
+ return this.templates.map((t) => ({ ...t, templates: t.templates.filter((e) => this.inclusionFilter(e)) })).filter((t) => t.templates.length > 0);
259
+ }
260
+ get templateList() {
261
+ return this._sortTemplates(this.effectiveTemplates.flatMap((t) => t.templates));
262
+ }
263
+ get allTemplates() {
264
+ return this._sortTemplates(this.templates.flatMap((t) => t.templates));
265
+ }
266
+ inclusionFilter(t) {
267
+ if (this.excludeTables && u(t.layer) || this.applicationFilterFunction?.(t) === !1)
268
+ return !1;
269
+ const e = D(t.layer)?.operations;
270
+ return e?.supportsEditing === !1 && !e?.supportsAdd ? !1 : u(t.layer) ? !0 : !(this.hideTemplatesMode === "visible" && !t.layer.visible || this.hideTemplatesMode === "scale" && !this._layerIsVisibleAtCurrentScale(t.layer));
271
+ }
272
+ get templateSetKey() {
273
+ return this._sortTemplates(this.allTemplates).map((t) => t.id).join(",");
274
+ }
275
+ get disabledTemplates() {
276
+ const t = /* @__PURE__ */ new Set();
277
+ for (const e of this.allTemplates) {
278
+ if (this.applicationDisabledFunction && this.applicationDisabledFunction(e)) {
279
+ t.add(e);
280
+ continue;
281
+ }
282
+ if (!u(e.layer)) {
283
+ if (this.disableTemplatesMode === "visible" && !e.layer.visible) {
284
+ t.add(e);
285
+ continue;
286
+ }
287
+ if (this.disableTemplatesMode === "scale" && this.view && !this._layerIsVisibleAtCurrentScale(e.layer)) {
288
+ t.add(e);
289
+ continue;
290
+ }
291
+ }
292
+ }
293
+ return t;
294
+ }
295
+ get templates() {
296
+ return this.applicationTemplates ?? this.organizedMapTemplates;
297
+ }
298
+ get organizedMapTemplates() {
299
+ if (this.groupByFunction || this.groupBy === "geometry") {
300
+ const t = !this.groupByFunction, e = this.groupByFunction ?? V, i = /* @__PURE__ */ new Map();
301
+ for (const r of this.mapTemplates ?? [])
302
+ for (const o of r.templates) {
303
+ const p = new d({ template: o, layer: r.layer }), n = e(p);
304
+ if (n != null)
305
+ if (i.has(n))
306
+ i.get(n)?.templates.push(p);
307
+ else {
308
+ const m = {
309
+ sectionName: n,
310
+ ...t ? { autoTranslate: !0 } : {},
311
+ templates: [p]
312
+ };
313
+ i.set(n, m);
314
+ }
315
+ }
316
+ return this._sortSections(Array.from(i.values()));
317
+ }
318
+ return this._sortSections(
319
+ (this.mapTemplates ?? []).map(({ layer: t, templates: e }) => ({
320
+ sectionName: t.title ?? "",
321
+ templates: e.map((i) => new d({ layer: t, template: i }))
322
+ })).filter((t) => t.templates.length > 0)
323
+ );
324
+ }
325
+ get updating() {
326
+ return this.fetchingTemplateMetaData;
327
+ }
328
+ get favoriteTemplates() {
329
+ const t = [];
330
+ for (const e of this.effectiveTemplates)
331
+ for (const i of e.templates)
332
+ this.favorites.has(i.id) && t.push(i);
333
+ return t;
334
+ }
335
+ get recentTemplates() {
336
+ const t = /* @__PURE__ */ new Map();
337
+ for (const i of this.effectiveTemplates)
338
+ for (const r of i.templates)
339
+ t.set(r.id, r);
340
+ const e = [];
341
+ for (const i of this.recentlyUsed)
342
+ t.has(i) && e.push(t.get(i));
343
+ return e;
344
+ }
345
+ //#endregion
346
+ };
347
+ l([
348
+ s()
349
+ ], a.prototype, "loading", 1);
350
+ l([
351
+ s()
352
+ ], a.prototype, "_hasRunInitialLoad", 2);
353
+ l([
354
+ s()
355
+ ], a.prototype, "activeLayers", 1);
356
+ l([
357
+ s()
358
+ ], a.prototype, "favoritesEnabled", 2);
359
+ l([
360
+ s()
361
+ ], a.prototype, "recentlyUsedEnabled", 2);
362
+ l([
363
+ s()
364
+ ], a.prototype, "hideTemplateDescription", 2);
365
+ l([
366
+ s()
367
+ ], a.prototype, "filterText", 2);
368
+ l([
369
+ s()
370
+ ], a.prototype, "recentFilterText", 2);
371
+ l([
372
+ s()
373
+ ], a.prototype, "favoritesFilterText", 2);
374
+ l([
375
+ s()
376
+ ], a.prototype, "selectedTemplateId", 2);
377
+ l([
378
+ s()
379
+ ], a.prototype, "selectedTemplate", 1);
380
+ l([
381
+ s()
382
+ ], a.prototype, "layers", 2);
383
+ l([
384
+ s()
385
+ ], a.prototype, "restoreFavorites", 2);
386
+ l([
387
+ s()
388
+ ], a.prototype, "restoreRecentlyUsed", 2);
389
+ l([
390
+ s()
391
+ ], a.prototype, "applicationDisabledFunction", 2);
392
+ l([
393
+ s()
394
+ ], a.prototype, "applicationFilterFunction", 2);
395
+ l([
396
+ s()
397
+ ], a.prototype, "display", 2);
398
+ l([
399
+ s()
400
+ ], a.prototype, "groupBy", 2);
401
+ l([
402
+ s()
403
+ ], a.prototype, "hideTemplatesMode", 2);
404
+ l([
405
+ s()
406
+ ], a.prototype, "disableTemplatesMode", 2);
407
+ l([
408
+ s()
409
+ ], a.prototype, "groupByFunction", 2);
410
+ l([
411
+ s()
412
+ ], a.prototype, "sectionSortBy", 2);
413
+ l([
414
+ s()
415
+ ], a.prototype, "templateSortBy", 2);
416
+ l([
417
+ s()
418
+ ], a.prototype, "sectionSortByFunction", 2);
419
+ l([
420
+ s()
421
+ ], a.prototype, "templateSortByFunction", 2);
422
+ l([
423
+ s()
424
+ ], a.prototype, "sharedTemplatesDisabled", 2);
425
+ l([
426
+ s()
427
+ ], a.prototype, "excludeTables", 2);
428
+ l([
429
+ s()
430
+ ], a.prototype, "favorites", 2);
431
+ l([
432
+ s()
433
+ ], a.prototype, "effectiveTemplates", 1);
434
+ l([
435
+ s()
436
+ ], a.prototype, "templateList", 1);
437
+ l([
438
+ s()
439
+ ], a.prototype, "allTemplates", 1);
440
+ l([
441
+ s()
442
+ ], a.prototype, "templateSetKey", 1);
443
+ l([
444
+ s()
445
+ ], a.prototype, "disabledTemplates", 1);
446
+ l([
447
+ s()
448
+ ], a.prototype, "templates", 1);
449
+ l([
450
+ s()
451
+ ], a.prototype, "mapTemplates", 2);
452
+ l([
453
+ s()
454
+ ], a.prototype, "organizedMapTemplates", 1);
455
+ l([
456
+ s()
457
+ ], a.prototype, "fetchingTemplateMetaData", 2);
458
+ l([
459
+ s()
460
+ ], a.prototype, "updating", 1);
461
+ l([
462
+ s()
463
+ ], a.prototype, "applicationTemplates", 2);
464
+ l([
465
+ s()
466
+ ], a.prototype, "favoriteTemplates", 1);
467
+ l([
468
+ s()
469
+ ], a.prototype, "recentTemplates", 1);
470
+ l([
471
+ s()
472
+ ], a.prototype, "recentlyUsed", 2);
473
+ l([
474
+ s()
475
+ ], a.prototype, "view", 2);
476
+ a = l([
477
+ g("components.feature-templates.FeatureTemplatesViewModel")
478
+ ], a);
479
+ const O = $(a);
480
+ class N extends M {
481
+ constructor() {
482
+ super(...arguments), this._messages = S(), this.viewModel = O(this), this.favoritesEnabled = this.viewModel.favoritesEnabled, this.favorites = this.viewModel.favorites, this.restoreFavorites = this.viewModel.restoreFavorites, this.restoreRecentlyUsed = this.viewModel.restoreRecentlyUsed, this.recentlyUsed = this.viewModel.recentlyUsed, this.sharedTemplatesDisabled = this.viewModel.sharedTemplatesDisabled, this.filterText = this.viewModel.filterText, this.recentFilterText = this.viewModel.recentFilterText, this.favoritesFilterText = this.viewModel.favoritesFilterText, this.recentlyUsedEnabled = this.viewModel.recentlyUsedEnabled, this.excludeTables = this.viewModel.excludeTables, this.effectiveTemplates = this.viewModel.effectiveTemplates, this.applicationTemplates = this.viewModel.applicationTemplates, this.selectedTemplateId = this.viewModel.selectedTemplateId, this.selectedTemplate = this.viewModel.selectedTemplate, this.applicationFilterFunction = this.viewModel.applicationFilterFunction, this.applicationDisabledFunction = this.viewModel.applicationDisabledFunction, this.display = this.viewModel.display, this.groupBy = this.viewModel.groupBy, this.sectionSortBy = this.viewModel.sectionSortBy, this.templateSortBy = this.viewModel.templateSortBy, this.templateSortByFunction = this.viewModel.templateSortByFunction, this.sectionSortByFunction = this.viewModel.sectionSortByFunction, this.hideTemplatesMode = this.viewModel.hideTemplatesMode, this.disableTemplatesMode = this.viewModel.disableTemplatesMode, this.groupByFunction = this.viewModel.groupByFunction, this.hideTemplateDescription = this.viewModel.hideTemplateDescription, this.layers = this.viewModel.layers, this.view = _(this), this.autoDestroyDisabled = !1, this.updating = this.viewModel.updating, this.disabled = !1, this.showCollapseButton = !1, this.showFilter = !1, this.arcgisPropertyChange = L()("effectiveTemplates", "filterText", "recentlyUsed", "favorites"), this.arcgisReady = f(), this.arcgisTemplatesChanged = f(), this.arcgisSelectTemplate = f();
483
+ }
484
+ static {
485
+ this.properties = { favoritesEnabled: 5, favorites: 32, restoreFavorites: 0, restoreRecentlyUsed: 0, recentlyUsed: 32, sharedTemplatesDisabled: 5, filterText: 1, recentFilterText: 1, favoritesFilterText: 1, recentlyUsedEnabled: 5, excludeTables: 5, effectiveTemplates: 32, applicationTemplates: 0, selectedTemplateId: 1, selectedTemplate: 32, applicationFilterFunction: 0, applicationDisabledFunction: 0, display: 1, groupBy: 1, sectionSortBy: 1, templateSortBy: 1, templateSortByFunction: 0, sectionSortByFunction: 0, hideTemplatesMode: 1, disableTemplatesMode: 1, groupByFunction: 0, hideTemplateDescription: 5, layers: 0, view: 0, referenceElement: 1, autoDestroyDisabled: 5, updating: 32, disabled: 5, showCollapseButton: 5, showFilter: 5 };
486
+ }
487
+ static {
488
+ this.styles = E;
489
+ }
490
+ async destroy() {
491
+ await this.manager.destroy();
492
+ }
493
+ loaded() {
494
+ this.manager.onLifecycle(() => [
495
+ // Ensure the view is always mapped to the viewmodel
496
+ y(() => this.view, () => {
497
+ this.viewModel.view = this.view;
498
+ }, { initial: !0 }),
499
+ y(() => this.viewModel.templateSetKey, () => {
500
+ this.arcgisTemplatesChanged.emit();
501
+ }),
502
+ // Watch if the list of active layers changes. This will trigger a reload
503
+ y(() => [
504
+ this.viewModel.activeLayers?.map((e) => e.id).join(","),
505
+ this.viewModel?.applicationTemplates,
506
+ this.viewModel?.sharedTemplatesDisabled
507
+ ], U(() => (
508
+ // Trigger refetching of templates
509
+ this.viewModel.handleTemplateSourceDefinitionChanged()
510
+ ), 10), { initial: !0 })
511
+ ]);
512
+ }
513
+ _handleSelectTemplate(e) {
514
+ this.selectedTemplateId = e.id, this.arcgisSelectTemplate.emit({ template: e }), this.viewModel.addRecent(e);
515
+ }
516
+ _removeTemplateFromList(e, i) {
517
+ if (i === "favorites") {
518
+ this.viewModel.removeFavorite(e);
519
+ return;
520
+ }
521
+ this.viewModel.removeRecent(e);
522
+ }
523
+ _renderTemplates() {
524
+ return this.effectiveTemplates.length === 0 ? c`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${this._messages.noTemplates}</div></calcite-notice>` : c`<calcite-list .filterText=${this.filterText} .label=${this._messages?.templates ?? ""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${(e) => {
525
+ this.filterText = e.target.filterText;
526
+ }}>${this.display === "grouped" ? this.effectiveTemplates.map((e) => c`<calcite-list-item-group .heading=${e.autoTranslate ? this._messages[e.sectionName] ?? "" : e.sectionName}>${e.templates.map((i) => c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(i)} .label=${i.label} .selected=${i.id === this.selectedTemplateId} .description=${this.hideTemplateDescription ? void 0 : i.description} .value=${i.id} @calciteListItemSelect=${() => {
527
+ this._handleSelectTemplate(i);
528
+ }}><arcgis-template-image slot=content-start .template=${i}></arcgis-template-image>${this._renderAddFavorite(i)}</calcite-list-item>`)}</calcite-list-item-group>`) : this.viewModel.templateList.map((e) => c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(e)} .label=${e.label} .selected=${e.id === this.selectedTemplateId} .description=${this.hideTemplateDescription ? void 0 : e.description} .value=${e.id} @calciteListItemSelect=${() => {
529
+ this._handleSelectTemplate(e);
530
+ }}><arcgis-template-image slot=content-start .template=${e}></arcgis-template-image>${this._renderAddFavorite(e)}</calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`;
531
+ }
532
+ _renderAddFavorite(e) {
533
+ return this.viewModel.favoritesEnabled ? c`<calcite-action slot=actions-end .icon=${this.viewModel.favorites.has(e.id) ? "heart-f" : "heart"} @click=${() => {
534
+ this.viewModel.favorites.has(e.id) ? this.viewModel.removeFavorite(e) : this.viewModel.addFavorite(e);
535
+ }} .text=${this._messages.addFavorite ?? ""}></calcite-action>` : "";
536
+ }
537
+ _renderList(e) {
538
+ const i = e === "favorites" ? this.viewModel.favoriteTemplates : this.viewModel.recentTemplates;
539
+ return i.length === 0 ? c`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${e === "favorites" ? this._messages.noFavorites : this._messages.noRecent}</div></calcite-notice>` : c`<calcite-list .filterText=${e === "favorites" ? this.favoritesFilterText : this.recentFilterText} .label=${(e === "favorites" ? this._messages.favorites : this._messages.recent) ?? ""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${(r) => {
540
+ this.filterText = r.target.filterText;
541
+ }}>${i.map((r) => c`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(r)} .label=${r.label} .description=${this.hideTemplateDescription ? void 0 : r.description} .value=${r.id} @calciteListItemSelect=${() => {
542
+ this._handleSelectTemplate(r);
543
+ }}><arcgis-template-image slot=content-start .template=${r}></arcgis-template-image><calcite-action slot=actions-end icon=x @click=${() => {
544
+ this._removeTemplateFromList(r, e);
545
+ }} .text=${(e === "favorites" ? this._messages.removeFavorite : this._messages.removeRecent) ?? ""}></calcite-action></calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`;
546
+ }
547
+ _renderFilteredEmpty() {
548
+ return c`<calcite-notice icon=filter slot=filter-no-results open class="filter-no-results"><div slot=message>${this._messages.noMatchingTemplates}</div></calcite-notice>`;
549
+ }
550
+ _renderContent() {
551
+ return this.effectiveTemplates.length === 0 && this.viewModel.loading ? null : this.favoritesEnabled || this.recentlyUsedEnabled ? c`<calcite-tabs class="feature-template-tabs"><calcite-tab-nav slot=title-group><calcite-tab-title icon-start=templates selected>${this._messages.templates}</calcite-tab-title>${this.recentlyUsedEnabled ? c`<calcite-tab-title icon-start=clock>${this._messages.recent}</calcite-tab-title>` : ""}${this.favoritesEnabled ? c`<calcite-tab-title icon-start=heart>${this._messages.favorites}</calcite-tab-title>` : ""}</calcite-tab-nav><calcite-tab selected>${this._renderTemplates()}</calcite-tab><calcite-tab>${this._renderList("recent")}</calcite-tab><calcite-tab>${this._renderList("favorites")}</calcite-tab></calcite-tabs>` : this._renderTemplates();
552
+ }
553
+ render() {
554
+ return c`<div class="root">${this._renderContent()}${this.viewModel.updating || this.disabled ? c`<calcite-scrim><calcite-loader scale=s label .hidden=${!this.viewModel.updating}></calcite-loader></calcite-scrim>` : null}</div>`;
555
+ }
556
+ }
557
+ w("arcgis-feature-templates", N);
558
+ export {
559
+ N as ArcgisFeatureTemplates
560
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,13 @@
1
+ import "@esri/calcite-components/components/calcite-notice";
2
+ import "@esri/calcite-components/components/calcite-list";
3
+ import "@esri/calcite-components/components/calcite-list-item-group";
4
+ import "@esri/calcite-components/components/calcite-list-item";
5
+ import "../arcgis-template-image/index.js";
6
+ import "@esri/calcite-components/components/calcite-action";
7
+ import "@esri/calcite-components/components/calcite-tabs";
8
+ import "@esri/calcite-components/components/calcite-tab-nav";
9
+ import "@esri/calcite-components/components/calcite-tab-title";
10
+ import "@esri/calcite-components/components/calcite-tab";
11
+ import "@esri/calcite-components/components/calcite-scrim";
12
+ import "@esri/calcite-components/components/calcite-loader";
13
+ export * from "./customElement.js";
@@ -493,6 +493,8 @@ export abstract class ArcgisFeatures extends LitElement {
493
493
  * no pending promises, the value is `null`. When the pending promises are
494
494
  * resolved they are removed from this array and the features they return
495
495
  * are pushed into the [features](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#features) array.
496
+ *
497
+ * @deprecated since 5.1.
496
498
  */
497
499
  accessor promises: Array<Promise<Array<Graphic>>>;
498
500
  /**
@@ -576,7 +578,6 @@ export abstract class ArcgisFeatures extends LitElement {
576
578
  * - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
577
579
  * - Values from `date` and `timestamp-offset` fields should respect the view's [time zone](https://developers.arcgis.com/javascript/latest/references/core/views/View/#timeZone).
578
580
  * Alternatively, set the [timeZone](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#timeZone) property.
579
- * - Using the [fetchFeatures()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#fetchFeatures) method or the `fetchFeatures` option in the [open](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#open) method.
580
581
  * - Using the `Zoom to` default action. If the `view` is not specified, set the [includeDefaultActionsDisabled](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#includeDefaultActionsDisabled) property to `true` to remove this default action.
581
582
  *
582
583
  * @since 4.34
@@ -599,25 +600,11 @@ export abstract class ArcgisFeatures extends LitElement {
599
600
  /**
600
601
  * Use this method to return feature(s) at a given screen location. These features are fetched from all of the [LayerViews](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) in the [view](https://developers.arcgis.com/javascript/latest/references/core/views/View/). In order to use this, a layer must already have an associated [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) and have its [popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupEnabled). This method allows a developer to control how the input location is handled. For example, you may want to fetch features on a `click` event or on a `pointer-move` event. This method automatically sets the location based on the input event's screen coordinates.
601
602
  *
603
+ * @deprecated since 5.1. Use the `fetchPopupFeatures` method on the [Map](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/#fetchPopupFeatures), [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/#fetchPopupFeatures), or [Link Chart](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-link-chart/#fetchPopupFeatures) component to fetch features based on a screen location.
602
604
  * @param screenPoint
603
605
  * @param options
606
+ * @deprecated
604
607
  * @see [open](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-features/#open)
605
- * @example
606
- * ```js
607
- * const viewElement = document.querySelector("arcgis-map");
608
- * // Get viewElement's click event
609
- * reactiveUtils.on(()=>viewElement, "arcgisViewClick", async (event)=>{
610
- * // Call fetchFeatures on the component and pass in the click event detail
611
- * await component.fetchFeatures(event.detail);
612
- * });
613
- * // Watch for changes to the features property and open the component when features are available.
614
- * reactiveUtils.watch(
615
- * () => component.features,
616
- * () => {
617
- * component.open = component.features ? true : false;
618
- * },
619
- * );
620
- * ```
621
608
  */
622
609
  fetchFeatures(screenPoint?: ScreenPoint, options?: FetchFeaturesOptions): Promise<void>;
623
610
  /**
@@ -32,6 +32,9 @@ import type { FlowLayer } from "@arcgis/core/widgets/LayerList.js";
32
32
  * >
33
33
  * > - The Layer List supports keyboard navigation using the [Treegrid Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/) for improved accessibility. Refer to the Calcite List component documentation for detailed keyboard interaction guidelines: [Calcite List Keyboard Navigation](https://developers.arcgis.com/calcite-design-system/components/list/#keyboard-navigation).
34
34
  *
35
+ * > [!WARNING]
36
+ * > In version 6.0, the implementation of [arcgis-layer-list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/) will be updated under the hood to that of [arcgis-layer-list-next](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list-next/), and the way events for [catalogLayerList](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/#catalogLayerList) and [tableList](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/#tableList) are handled will change. We encourage using the [arcgis-layer-list-next](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list-next/) component and providing feedback.
37
+ *
35
38
  * @since 4.28
36
39
  */
37
40
  export abstract class ArcgisLayerList extends LitElement {