@arcgis/map-components 5.1.0-next.124 → 5.1.0-next.125
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.
- package/dist/cdn/K4QY44EL.js +2 -0
- package/dist/cdn/{XYUG5M3W.js → T6JFYEP2.js} +1 -1
- package/dist/cdn/YJT2XNV5.js +2 -0
- package/dist/cdn/ZJINX5IW.js +2 -0
- package/dist/cdn/assets/feature-templates/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-daylight/customElement.d.ts +1 -1
- package/dist/components/arcgis-daylight/customElement.js +34 -27
- package/dist/components/arcgis-feature-templates/customElement.d.ts +10 -8
- package/dist/components/arcgis-feature-templates/customElement.js +198 -247
- package/dist/components/arcgis-layer-list/customElement.d.ts +3 -0
- package/dist/components/arcgis-layer-list-next/customElement.d.ts +319 -32
- package/dist/components/arcgis-layer-list-next/customElement.js +5 -1
- package/dist/components/arcgis-paste/PasteViewModel.d.ts +2 -2
- package/dist/components/arcgis-slider-scale-range/customElement.js +1 -1
- package/dist/components/arcgis-template-image/customElement.d.ts +2 -2
- package/dist/components/arcgis-version-management/customElement.js +21 -20
- package/dist/components/arcgis-version-management/index.js +1 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/DZMN2UH5.js +0 -2
- package/dist/cdn/GMOWIPQL.js +0 -2
- package/dist/cdn/OCMGQ4AF.js +0 -2
- package/dist/components/arcgis-feature-templates/TemplateItem.d.ts +0 -33
|
@@ -1,75 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { m as
|
|
8
|
-
import { property as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
import { c as T } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as g, html as o } from "lit";
|
|
4
|
+
import { LitElement as b, createEvent as h } from "@arcgis/lumina";
|
|
5
|
+
import { u as w } from "../../chunks/useT9n.js";
|
|
6
|
+
import { u as F } from "../../chunks/useView.js";
|
|
7
|
+
import { m as M } from "../../chunks/useViewModel.js";
|
|
8
|
+
import { property as l, subclass as S } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
9
|
+
import _ from "@arcgis/core/core/Accessor.js";
|
|
10
|
+
import u from "@arcgis/core/editing/templates/TemplateListItem.js";
|
|
11
|
+
import { getAllStandardFeatureTemplatesForLayer as $, getTemplatesForLayers as x } from "@arcgis/core/applications/Components/templateUtils.js";
|
|
12
|
+
import { i as y, c as v } from "../../chunks/layer-utils.js";
|
|
13
|
+
import { isTable as m, getEffectiveLayerCapabilities as B } from "@arcgis/core/applications/Components/layerUtils.js";
|
|
14
|
+
import { usePropertyChange as D } from "@arcgis/lumina/controllers";
|
|
15
|
+
import { watch as f } from "@arcgis/core/core/reactiveUtils.js";
|
|
16
|
+
import { debounce as L } from "@arcgis/toolkit/function";
|
|
17
|
+
const E = g`: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}`;
|
|
18
|
+
var U = Object.defineProperty, I = Object.getOwnPropertyDescriptor, a = (t, e, i, r) => {
|
|
19
|
+
for (var n = r > 1 ? void 0 : r ? I(e, i) : e, p = t.length - 1, c; p >= 0; p--)
|
|
20
|
+
(c = t[p]) && (n = (r ? c(e, i, n) : c(n)) || n);
|
|
21
|
+
return r && n && U(e, i, n), n;
|
|
21
22
|
};
|
|
22
|
-
|
|
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) {
|
|
23
|
+
function C(t) {
|
|
73
24
|
switch (t) {
|
|
74
25
|
case "point":
|
|
75
26
|
case "multipoint":
|
|
@@ -81,8 +32,8 @@ function P(t) {
|
|
|
81
32
|
}
|
|
82
33
|
return "noneSpecified";
|
|
83
34
|
}
|
|
84
|
-
const
|
|
85
|
-
let
|
|
35
|
+
const R = (t) => C(t.layer.geometryType ?? "");
|
|
36
|
+
let s = class extends _ {
|
|
86
37
|
//#region Lifecycle
|
|
87
38
|
constructor(t) {
|
|
88
39
|
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 = [];
|
|
@@ -105,7 +56,7 @@ let a = class extends b {
|
|
|
105
56
|
if (await Promise.allSettled(t.map((e) => e.load())), this.sharedTemplatesDisabled) {
|
|
106
57
|
const e = [];
|
|
107
58
|
for (const i of t) {
|
|
108
|
-
const r =
|
|
59
|
+
const r = $(i);
|
|
109
60
|
r.length > 0 && e.push({
|
|
110
61
|
layer: i,
|
|
111
62
|
templates: r
|
|
@@ -114,7 +65,7 @@ let a = class extends b {
|
|
|
114
65
|
this.mapTemplates = e;
|
|
115
66
|
return;
|
|
116
67
|
}
|
|
117
|
-
this.mapTemplates = await
|
|
68
|
+
this.mapTemplates = await x(t, this.view, void 0, {
|
|
118
69
|
returnVisibleTemplatesOnly: !0
|
|
119
70
|
}), await this._restore();
|
|
120
71
|
} catch {
|
|
@@ -204,8 +155,8 @@ let a = class extends b {
|
|
|
204
155
|
noneSpecified: 7
|
|
205
156
|
};
|
|
206
157
|
t = t.toSorted((i, r) => {
|
|
207
|
-
const
|
|
208
|
-
return
|
|
158
|
+
const n = e[i.sectionName] ?? 10, p = e[r.sectionName] ?? 10;
|
|
159
|
+
return n - p;
|
|
209
160
|
});
|
|
210
161
|
}
|
|
211
162
|
for (const e of t)
|
|
@@ -216,16 +167,16 @@ let a = class extends b {
|
|
|
216
167
|
if (!this.view)
|
|
217
168
|
return !0;
|
|
218
169
|
let e = t;
|
|
219
|
-
|
|
170
|
+
y(t) && (e = t.parent);
|
|
220
171
|
const i = this.view.allLayerViews.find((r) => r.layer === e);
|
|
221
172
|
if (!i)
|
|
222
173
|
return !0;
|
|
223
|
-
if (
|
|
174
|
+
if (y(t)) {
|
|
224
175
|
const r = this.view.scale;
|
|
225
176
|
if (i.visibleAtCurrentScale) {
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
return !
|
|
177
|
+
const n = t.minScale, p = t.maxScale;
|
|
178
|
+
let c = !n, d = !p;
|
|
179
|
+
return !c && r <= n && (c = !0), !d && r >= p && (d = !0), c && d;
|
|
229
180
|
}
|
|
230
181
|
}
|
|
231
182
|
return i.visibleAtCurrentScale;
|
|
@@ -233,7 +184,7 @@ let a = class extends b {
|
|
|
233
184
|
get activeLayers() {
|
|
234
185
|
const t = [];
|
|
235
186
|
for (const e of this.layers ?? [])
|
|
236
|
-
if (
|
|
187
|
+
if (v(e))
|
|
237
188
|
for (const i of e.sublayers)
|
|
238
189
|
t.push(i);
|
|
239
190
|
else
|
|
@@ -245,7 +196,7 @@ let a = class extends b {
|
|
|
245
196
|
])
|
|
246
197
|
if (e.type === "feature" || e.type === "scene" || e.type === "geojson" || e.type === "oriented-imagery" || e.type === "knowledge-graph")
|
|
247
198
|
t.push(e);
|
|
248
|
-
else if (
|
|
199
|
+
else if (v(e))
|
|
249
200
|
for (const i of e.sublayers)
|
|
250
201
|
t.push(i);
|
|
251
202
|
}
|
|
@@ -264,10 +215,10 @@ let a = class extends b {
|
|
|
264
215
|
return this._sortTemplates(this.templates.flatMap((t) => t.templates));
|
|
265
216
|
}
|
|
266
217
|
inclusionFilter(t) {
|
|
267
|
-
if (this.excludeTables &&
|
|
218
|
+
if (this.excludeTables && m(t.layer) || this.applicationFilterFunction?.(t) === !1)
|
|
268
219
|
return !1;
|
|
269
|
-
const e =
|
|
270
|
-
return e?.supportsEditing === !1 && !e?.supportsAdd ? !1 :
|
|
220
|
+
const e = B(t.layer)?.operations;
|
|
221
|
+
return e?.supportsEditing === !1 && !e?.supportsAdd ? !1 : m(t.layer) ? !0 : !(this.hideTemplatesMode === "visible" && !t.layer.visible || this.hideTemplatesMode === "scale" && !this._layerIsVisibleAtCurrentScale(t.layer));
|
|
271
222
|
}
|
|
272
223
|
get templateSetKey() {
|
|
273
224
|
return this._sortTemplates(this.allTemplates).map((t) => t.id).join(",");
|
|
@@ -279,7 +230,7 @@ let a = class extends b {
|
|
|
279
230
|
t.add(e);
|
|
280
231
|
continue;
|
|
281
232
|
}
|
|
282
|
-
if (!
|
|
233
|
+
if (!m(e.layer)) {
|
|
283
234
|
if (this.disableTemplatesMode === "visible" && !e.layer.visible) {
|
|
284
235
|
t.add(e);
|
|
285
236
|
continue;
|
|
@@ -297,20 +248,20 @@ let a = class extends b {
|
|
|
297
248
|
}
|
|
298
249
|
get organizedMapTemplates() {
|
|
299
250
|
if (this.groupByFunction || this.groupBy === "geometry") {
|
|
300
|
-
const t = !this.groupByFunction, e = this.groupByFunction ??
|
|
251
|
+
const t = !this.groupByFunction, e = this.groupByFunction ?? R, i = /* @__PURE__ */ new Map();
|
|
301
252
|
for (const r of this.mapTemplates ?? [])
|
|
302
|
-
for (const
|
|
303
|
-
const p = new
|
|
304
|
-
if (
|
|
305
|
-
if (i.has(
|
|
306
|
-
i.get(
|
|
253
|
+
for (const n of r.templates) {
|
|
254
|
+
const p = new u({ template: n, layer: r.layer }), c = e(p);
|
|
255
|
+
if (c != null)
|
|
256
|
+
if (i.has(c))
|
|
257
|
+
i.get(c)?.templates.push(p);
|
|
307
258
|
else {
|
|
308
|
-
const
|
|
309
|
-
sectionName:
|
|
259
|
+
const d = {
|
|
260
|
+
sectionName: c,
|
|
310
261
|
...t ? { autoTranslate: !0 } : {},
|
|
311
262
|
templates: [p]
|
|
312
263
|
};
|
|
313
|
-
i.set(
|
|
264
|
+
i.set(c, d);
|
|
314
265
|
}
|
|
315
266
|
}
|
|
316
267
|
return this._sortSections(Array.from(i.values()));
|
|
@@ -318,7 +269,7 @@ let a = class extends b {
|
|
|
318
269
|
return this._sortSections(
|
|
319
270
|
(this.mapTemplates ?? []).map(({ layer: t, templates: e }) => ({
|
|
320
271
|
sectionName: t.title ?? "",
|
|
321
|
-
templates: e.map((i) => new
|
|
272
|
+
templates: e.map((i) => new u({ layer: t, template: i }))
|
|
322
273
|
})).filter((t) => t.templates.length > 0)
|
|
323
274
|
);
|
|
324
275
|
}
|
|
@@ -344,142 +295,142 @@ let a = class extends b {
|
|
|
344
295
|
}
|
|
345
296
|
//#endregion
|
|
346
297
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
],
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
],
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
],
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
],
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
],
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
],
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
],
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
],
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
],
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
],
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
],
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
],
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
],
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
],
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
],
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
],
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
],
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
],
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
],
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
],
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
],
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
],
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
],
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
],
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
],
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
],
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
],
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
],
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
],
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
],
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
],
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
],
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
],
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
],
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
],
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
],
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
],
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
],
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
],
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
],
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
],
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
],
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
],
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
],
|
|
479
|
-
const
|
|
480
|
-
class
|
|
298
|
+
a([
|
|
299
|
+
l()
|
|
300
|
+
], s.prototype, "loading", 1);
|
|
301
|
+
a([
|
|
302
|
+
l()
|
|
303
|
+
], s.prototype, "_hasRunInitialLoad", 2);
|
|
304
|
+
a([
|
|
305
|
+
l()
|
|
306
|
+
], s.prototype, "activeLayers", 1);
|
|
307
|
+
a([
|
|
308
|
+
l()
|
|
309
|
+
], s.prototype, "favoritesEnabled", 2);
|
|
310
|
+
a([
|
|
311
|
+
l()
|
|
312
|
+
], s.prototype, "recentlyUsedEnabled", 2);
|
|
313
|
+
a([
|
|
314
|
+
l()
|
|
315
|
+
], s.prototype, "hideTemplateDescription", 2);
|
|
316
|
+
a([
|
|
317
|
+
l()
|
|
318
|
+
], s.prototype, "filterText", 2);
|
|
319
|
+
a([
|
|
320
|
+
l()
|
|
321
|
+
], s.prototype, "recentFilterText", 2);
|
|
322
|
+
a([
|
|
323
|
+
l()
|
|
324
|
+
], s.prototype, "favoritesFilterText", 2);
|
|
325
|
+
a([
|
|
326
|
+
l()
|
|
327
|
+
], s.prototype, "selectedTemplateId", 2);
|
|
328
|
+
a([
|
|
329
|
+
l()
|
|
330
|
+
], s.prototype, "selectedTemplate", 1);
|
|
331
|
+
a([
|
|
332
|
+
l()
|
|
333
|
+
], s.prototype, "layers", 2);
|
|
334
|
+
a([
|
|
335
|
+
l()
|
|
336
|
+
], s.prototype, "restoreFavorites", 2);
|
|
337
|
+
a([
|
|
338
|
+
l()
|
|
339
|
+
], s.prototype, "restoreRecentlyUsed", 2);
|
|
340
|
+
a([
|
|
341
|
+
l()
|
|
342
|
+
], s.prototype, "applicationDisabledFunction", 2);
|
|
343
|
+
a([
|
|
344
|
+
l()
|
|
345
|
+
], s.prototype, "applicationFilterFunction", 2);
|
|
346
|
+
a([
|
|
347
|
+
l()
|
|
348
|
+
], s.prototype, "display", 2);
|
|
349
|
+
a([
|
|
350
|
+
l()
|
|
351
|
+
], s.prototype, "groupBy", 2);
|
|
352
|
+
a([
|
|
353
|
+
l()
|
|
354
|
+
], s.prototype, "hideTemplatesMode", 2);
|
|
355
|
+
a([
|
|
356
|
+
l()
|
|
357
|
+
], s.prototype, "disableTemplatesMode", 2);
|
|
358
|
+
a([
|
|
359
|
+
l()
|
|
360
|
+
], s.prototype, "groupByFunction", 2);
|
|
361
|
+
a([
|
|
362
|
+
l()
|
|
363
|
+
], s.prototype, "sectionSortBy", 2);
|
|
364
|
+
a([
|
|
365
|
+
l()
|
|
366
|
+
], s.prototype, "templateSortBy", 2);
|
|
367
|
+
a([
|
|
368
|
+
l()
|
|
369
|
+
], s.prototype, "sectionSortByFunction", 2);
|
|
370
|
+
a([
|
|
371
|
+
l()
|
|
372
|
+
], s.prototype, "templateSortByFunction", 2);
|
|
373
|
+
a([
|
|
374
|
+
l()
|
|
375
|
+
], s.prototype, "sharedTemplatesDisabled", 2);
|
|
376
|
+
a([
|
|
377
|
+
l()
|
|
378
|
+
], s.prototype, "excludeTables", 2);
|
|
379
|
+
a([
|
|
380
|
+
l()
|
|
381
|
+
], s.prototype, "favorites", 2);
|
|
382
|
+
a([
|
|
383
|
+
l()
|
|
384
|
+
], s.prototype, "effectiveTemplates", 1);
|
|
385
|
+
a([
|
|
386
|
+
l()
|
|
387
|
+
], s.prototype, "templateList", 1);
|
|
388
|
+
a([
|
|
389
|
+
l()
|
|
390
|
+
], s.prototype, "allTemplates", 1);
|
|
391
|
+
a([
|
|
392
|
+
l()
|
|
393
|
+
], s.prototype, "templateSetKey", 1);
|
|
394
|
+
a([
|
|
395
|
+
l()
|
|
396
|
+
], s.prototype, "disabledTemplates", 1);
|
|
397
|
+
a([
|
|
398
|
+
l()
|
|
399
|
+
], s.prototype, "templates", 1);
|
|
400
|
+
a([
|
|
401
|
+
l()
|
|
402
|
+
], s.prototype, "mapTemplates", 2);
|
|
403
|
+
a([
|
|
404
|
+
l()
|
|
405
|
+
], s.prototype, "organizedMapTemplates", 1);
|
|
406
|
+
a([
|
|
407
|
+
l()
|
|
408
|
+
], s.prototype, "fetchingTemplateMetaData", 2);
|
|
409
|
+
a([
|
|
410
|
+
l()
|
|
411
|
+
], s.prototype, "updating", 1);
|
|
412
|
+
a([
|
|
413
|
+
l()
|
|
414
|
+
], s.prototype, "applicationTemplates", 2);
|
|
415
|
+
a([
|
|
416
|
+
l()
|
|
417
|
+
], s.prototype, "favoriteTemplates", 1);
|
|
418
|
+
a([
|
|
419
|
+
l()
|
|
420
|
+
], s.prototype, "recentTemplates", 1);
|
|
421
|
+
a([
|
|
422
|
+
l()
|
|
423
|
+
], s.prototype, "recentlyUsed", 2);
|
|
424
|
+
a([
|
|
425
|
+
l()
|
|
426
|
+
], s.prototype, "view", 2);
|
|
427
|
+
s = a([
|
|
428
|
+
S("components.feature-templates.FeatureTemplatesViewModel")
|
|
429
|
+
], s);
|
|
430
|
+
const A = M(s);
|
|
431
|
+
class P extends b {
|
|
481
432
|
constructor() {
|
|
482
|
-
super(...arguments), this._messages =
|
|
433
|
+
super(...arguments), this._messages = w(), this.viewModel = A(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 = F(this), this.autoDestroyDisabled = !1, this.updating = this.viewModel.updating, this.disabled = !1, this.showCollapseButton = !1, this.showFilter = !1, this.arcgisPropertyChange = D()("effectiveTemplates", "filterText", "recentlyUsed", "favorites"), this.arcgisReady = h(), this.arcgisTemplatesChanged = h(), this.arcgisSelectTemplate = h();
|
|
483
434
|
}
|
|
484
435
|
static {
|
|
485
436
|
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 };
|
|
@@ -493,18 +444,18 @@ class N extends M {
|
|
|
493
444
|
loaded() {
|
|
494
445
|
this.manager.onLifecycle(() => [
|
|
495
446
|
// Ensure the view is always mapped to the viewmodel
|
|
496
|
-
|
|
447
|
+
f(() => this.view, () => {
|
|
497
448
|
this.viewModel.view = this.view;
|
|
498
449
|
}, { initial: !0 }),
|
|
499
|
-
|
|
450
|
+
f(() => this.viewModel.templateSetKey, () => {
|
|
500
451
|
this.arcgisTemplatesChanged.emit();
|
|
501
452
|
}),
|
|
502
453
|
// Watch if the list of active layers changes. This will trigger a reload
|
|
503
|
-
|
|
454
|
+
f(() => [
|
|
504
455
|
this.viewModel.activeLayers?.map((e) => e.id).join(","),
|
|
505
456
|
this.viewModel?.applicationTemplates,
|
|
506
457
|
this.viewModel?.sharedTemplatesDisabled
|
|
507
|
-
],
|
|
458
|
+
], L(() => (
|
|
508
459
|
// Trigger refetching of templates
|
|
509
460
|
this.viewModel.handleTemplateSourceDefinitionChanged()
|
|
510
461
|
), 10), { initial: !0 })
|
|
@@ -521,40 +472,40 @@ class N extends M {
|
|
|
521
472
|
this.viewModel.removeRecent(e);
|
|
522
473
|
}
|
|
523
474
|
_renderTemplates() {
|
|
524
|
-
return this.effectiveTemplates.length === 0 ?
|
|
475
|
+
return this.effectiveTemplates.length === 0 ? o`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${this._messages.noTemplates}</div></calcite-notice>` : o`<calcite-list .filterPlaceholder=${this._messages.filterPlaceholder ?? ""} .filterText=${this.filterText} .label=${this._messages?.templates ?? ""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${(e) => {
|
|
525
476
|
this.filterText = e.target.filterText;
|
|
526
|
-
}}>${this.display === "grouped" ? this.effectiveTemplates.map((e) =>
|
|
477
|
+
}}>${this.display === "grouped" ? this.effectiveTemplates.map((e) => o`<calcite-list-item-group .heading=${e.autoTranslate ? this._messages[e.sectionName] ?? "" : e.sectionName}>${e.templates.map((i) => o`<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
478
|
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) =>
|
|
479
|
+
}}><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) => o`<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
480
|
this._handleSelectTemplate(e);
|
|
530
481
|
}}><arcgis-template-image slot=content-start .template=${e}></arcgis-template-image>${this._renderAddFavorite(e)}</calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`;
|
|
531
482
|
}
|
|
532
483
|
_renderAddFavorite(e) {
|
|
533
|
-
return this.viewModel.favoritesEnabled ?
|
|
484
|
+
return this.viewModel.favoritesEnabled ? o`<calcite-action slot=actions-end .icon=${this.viewModel.favorites.has(e.id) ? "heart-f" : "heart"} @click=${() => {
|
|
534
485
|
this.viewModel.favorites.has(e.id) ? this.viewModel.removeFavorite(e) : this.viewModel.addFavorite(e);
|
|
535
486
|
}} .text=${this._messages.addFavorite ?? ""}></calcite-action>` : "";
|
|
536
487
|
}
|
|
537
488
|
_renderList(e) {
|
|
538
489
|
const i = e === "favorites" ? this.viewModel.favoriteTemplates : this.viewModel.recentTemplates;
|
|
539
|
-
return i.length === 0 ?
|
|
490
|
+
return i.length === 0 ? o`<calcite-notice icon=list open class="filter-no-results"><div slot=message>${e === "favorites" ? this._messages.noFavorites : this._messages.noRecent}</div></calcite-notice>` : o`<calcite-list .filterText=${e === "favorites" ? this.favoritesFilterText : this.recentFilterText} .filterPlaceholder=${this._messages.filterPlaceholder ?? ""} .label=${(e === "favorites" ? this._messages.favorites : this._messages.recent) ?? ""} .filterEnabled=${this.showFilter} selection-appearance=border selection-mode=single @calciteListFilter=${(r) => {
|
|
540
491
|
this.filterText = r.target.filterText;
|
|
541
|
-
}}>${i.map((r) =>
|
|
492
|
+
}}>${i.map((r) => o`<calcite-list-item .disabled=${this.viewModel.disabledTemplates.has(r)} .label=${r.label} .description=${this.hideTemplateDescription ? void 0 : r.description} .value=${r.id} @calciteListItemSelect=${() => {
|
|
542
493
|
this._handleSelectTemplate(r);
|
|
543
494
|
}}><arcgis-template-image slot=content-start .template=${r}></arcgis-template-image><calcite-action slot=actions-end icon=x @click=${() => {
|
|
544
495
|
this._removeTemplateFromList(r, e);
|
|
545
496
|
}} .text=${(e === "favorites" ? this._messages.removeFavorite : this._messages.removeRecent) ?? ""}></calcite-action></calcite-list-item>`)}${this._renderFilteredEmpty()}</calcite-list>`;
|
|
546
497
|
}
|
|
547
498
|
_renderFilteredEmpty() {
|
|
548
|
-
return
|
|
499
|
+
return o`<calcite-notice icon=filter slot=filter-no-results open class="filter-no-results"><div slot=message>${this._messages.noMatchingTemplates}</div></calcite-notice>`;
|
|
549
500
|
}
|
|
550
501
|
_renderContent() {
|
|
551
|
-
return this.effectiveTemplates.length === 0 && this.viewModel.loading ? null : this.favoritesEnabled || this.recentlyUsedEnabled ?
|
|
502
|
+
return this.effectiveTemplates.length === 0 && this.viewModel.loading ? null : this.favoritesEnabled || this.recentlyUsedEnabled ? o`<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 ? o`<calcite-tab-title icon-start=clock>${this._messages.recent}</calcite-tab-title>` : ""}${this.favoritesEnabled ? o`<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
503
|
}
|
|
553
504
|
render() {
|
|
554
|
-
return
|
|
505
|
+
return o`<div class="root">${this._renderContent()}${this.viewModel.updating || this.disabled ? o`<calcite-scrim><calcite-loader scale=s label .hidden=${!this.viewModel.updating}></calcite-loader></calcite-scrim>` : null}</div>`;
|
|
555
506
|
}
|
|
556
507
|
}
|
|
557
|
-
|
|
508
|
+
T("arcgis-feature-templates", P);
|
|
558
509
|
export {
|
|
559
|
-
|
|
510
|
+
P as ArcgisFeatureTemplates
|
|
560
511
|
};
|
|
@@ -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 {
|