@arcgis/map-components 5.2.0-next.11 → 5.2.0-next.13
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/4BGPI3L3.js +2 -0
- package/dist/cdn/{GTOGU3CL.js → 5D3ZCD2V.js} +1 -1
- package/dist/cdn/{HNGHLDNZ.js → 5Z6MDFHN.js} +1 -1
- package/dist/cdn/64S26ZIP.js +2 -0
- package/dist/cdn/IJZYN6XT.js +2 -0
- package/dist/cdn/{3QWDXECJ.js → K6O7QOW4.js} +1 -1
- package/dist/cdn/MCIDCKIS.js +2 -0
- package/dist/cdn/O3S3JGUF.js +2 -0
- package/dist/cdn/QQPVIXFY.js +2 -0
- package/dist/cdn/R66ZOECE.js +2 -0
- package/dist/cdn/TPZUKUI7.js +2 -0
- package/dist/cdn/UCPXN4Y5.js +2 -0
- package/dist/cdn/assets/print/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-daylight/customElement.js +32 -23
- package/dist/components/arcgis-features/customElement.d.ts +15 -0
- package/dist/components/arcgis-features/customElement.js +33 -33
- package/dist/components/arcgis-features-next/customElement.d.ts +14 -0
- package/dist/components/arcgis-features-next/customElement.js +15 -12
- package/dist/components/arcgis-labeled-switch/customElement.js +5 -5
- package/dist/components/arcgis-layer-list-next/customElement.d.ts +2 -15
- package/dist/components/arcgis-layer-list-next/customElement.js +97 -77
- package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +71 -72
- package/dist/components/arcgis-layer-list-next/types.d.ts +18 -0
- package/dist/components/arcgis-map/customElement.d.ts +126 -105
- package/dist/components/arcgis-multi-feature-form/customElement.js +14 -14
- package/dist/components/arcgis-print/customElement.d.ts +3 -0
- package/dist/components/arcgis-print-datum-transformation-input/customElement.js +74 -0
- package/dist/components/arcgis-print-datum-transformation-input/index.js +3 -0
- package/dist/components/arcgis-print-layout-advanced-options/customElement.js +14 -11
- package/dist/components/arcgis-print-layout-advanced-options/index.js +1 -0
- package/dist/components/arcgis-print-template-selector/customElement.js +8 -8
- package/dist/components/arcgis-slider-scale-range/customElement.d.ts +4 -5
- package/dist/components/arcgis-slider-scale-range/customElement.js +69 -56
- 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/dist/loader.js +3 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cdn/AGOMMJPB.js +0 -2
- package/dist/cdn/CTHUSEAE.js +0 -2
- package/dist/cdn/DNZU7DTQ.js +0 -2
- package/dist/cdn/EVMYQ43N.js +0 -2
- package/dist/cdn/IKSY73X2.js +0 -2
- package/dist/cdn/JE5LMTIW.js +0 -2
- package/dist/cdn/OUYGGJ47.js +0 -2
- package/dist/cdn/VNP4GF74.js +0 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as e } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as m, html as o } from "lit";
|
|
4
|
+
import { watch as u } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
|
+
import { LitElement as l } from "@arcgis/lumina";
|
|
6
|
+
import f from "@arcgis/core/geometry/operators/support/GeographicTransformation.js";
|
|
7
|
+
import c from "@arcgis/core/geometry/operators/support/GeographicTransformationStep.js";
|
|
8
|
+
const d = m`.invalid-wkid-text{color:var(--calcite-color-status-danger);font-size:var(--calcite-font-size--0)}`, p = /^\s*\d+(?:\s*\+\s*\d+)*(?:\s*,\s*\d+(?:\s*\+\s*\d+)*)*\s*$/u;
|
|
9
|
+
function h(s) {
|
|
10
|
+
if (!/^\d+$/u.test(s))
|
|
11
|
+
return null;
|
|
12
|
+
const t = Number(s);
|
|
13
|
+
return Number.isSafeInteger(t) && t > 0 ? t : null;
|
|
14
|
+
}
|
|
15
|
+
function T(s) {
|
|
16
|
+
if (!p.test(s))
|
|
17
|
+
return null;
|
|
18
|
+
const t = [];
|
|
19
|
+
for (const i of s.split(",")) {
|
|
20
|
+
const a = [];
|
|
21
|
+
for (const r of i.split("+")) {
|
|
22
|
+
const n = h(r.trim());
|
|
23
|
+
if (n == null)
|
|
24
|
+
return null;
|
|
25
|
+
a.push(new c({ wkid: n }));
|
|
26
|
+
}
|
|
27
|
+
t.push(new f({ steps: a }));
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
function v(s) {
|
|
32
|
+
return s == null || s.length === 0 ? "" : s.map(
|
|
33
|
+
(t) => t.steps.map((i) => i.wkid).filter((i) => i != null).join("+")
|
|
34
|
+
).filter((t) => t.length > 0).join(",");
|
|
35
|
+
}
|
|
36
|
+
class w extends l {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments), this._isValidDatumTransformations = !0;
|
|
39
|
+
}
|
|
40
|
+
static {
|
|
41
|
+
this.properties = { _datumTransformations: 16, _isValidDatumTransformations: 16, templateOptions: 0, viewModel: 0, messages: 0 };
|
|
42
|
+
}
|
|
43
|
+
static {
|
|
44
|
+
this.styles = d;
|
|
45
|
+
}
|
|
46
|
+
loaded() {
|
|
47
|
+
this.manager.onLifecycle(() => [
|
|
48
|
+
u(() => this.viewModel.datumTransformations, (t) => {
|
|
49
|
+
this._datumTransformations = v(t), this._isValidDatumTransformations = !0;
|
|
50
|
+
}, { initial: !0 })
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const { messages: t } = this, i = this.viewModel.cimVersion;
|
|
55
|
+
if (!(i != null && Number.parseFloat(i) < 3.7))
|
|
56
|
+
return o`<div><calcite-label>${t.datumTransformations}<calcite-input .value=${this._datumTransformations ?? ""} .max=${Number.MAX_SAFE_INTEGER} @calciteInputInput=${({ currentTarget: a }) => {
|
|
57
|
+
const r = a.value?.trim() ?? "";
|
|
58
|
+
if (this._datumTransformations = r, r === "") {
|
|
59
|
+
this.viewModel.datumTransformations = null, this._isValidDatumTransformations = !0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const n = T(r);
|
|
63
|
+
if (n == null) {
|
|
64
|
+
this._isValidDatumTransformations = !1;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this._isValidDatumTransformations = !0, this.viewModel.datumTransformations = n;
|
|
68
|
+
}}></calcite-input>${this._isValidDatumTransformations ? null : o`<div class="invalid-wkid-text">${t.invalidWkid}</div>`}</calcite-label></div>`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
e("arcgis-print-datum-transformation-input", w);
|
|
72
|
+
export {
|
|
73
|
+
w as PrintDatumTransformationInput
|
|
74
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as r, html as t } from "lit";
|
|
4
|
-
import { watch as
|
|
4
|
+
import { watch as s } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
5
|
import { LitElement as c } from "@arcgis/lumina";
|
|
6
6
|
import { u as h } from "../../chunks/useHandles.js";
|
|
7
7
|
const u = r`.advanced-options-container{padding:var(--calcite-spacing-xxs);display:flex;flex-direction:column;gap:var(--calcite-spacing-xs)}`, d = [
|
|
@@ -16,11 +16,11 @@ const u = r`.advanced-options-container{padding:var(--calcite-spacing-xxs);displ
|
|
|
16
16
|
function p(i) {
|
|
17
17
|
if (!i)
|
|
18
18
|
return !1;
|
|
19
|
-
const { map: e, graphics:
|
|
20
|
-
return
|
|
19
|
+
const { map: e, graphics: n } = i;
|
|
20
|
+
return n?.length ? !0 : e?.allLayers.some((a) => {
|
|
21
21
|
if (a.type === "feature" && "source" in a) {
|
|
22
|
-
const { type:
|
|
23
|
-
return
|
|
22
|
+
const { type: l } = a.source;
|
|
23
|
+
return l !== "feature-layer" && l !== "ogc-feature";
|
|
24
24
|
}
|
|
25
25
|
return d.includes(a.type);
|
|
26
26
|
}) ?? !1;
|
|
@@ -41,8 +41,8 @@ class g extends c {
|
|
|
41
41
|
}
|
|
42
42
|
loaded() {
|
|
43
43
|
this.manager.onLifecycle(() => [
|
|
44
|
-
|
|
45
|
-
this._handles.removeHandles("template-handle"), this._selectedTemplate = e ? this.viewModel.getLayoutTemplateById(e) ?? void 0 : void 0, this._handles.addHandles(
|
|
44
|
+
s(() => this.viewModel.templateOptions.id, (e) => {
|
|
45
|
+
this._handles.removeHandles("template-handle"), this._selectedTemplate = e ? this.viewModel.getLayoutTemplateById(e) ?? void 0 : void 0, this._handles.addHandles(s(() => [
|
|
46
46
|
this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText,
|
|
47
47
|
this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText,
|
|
48
48
|
this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend,
|
|
@@ -52,13 +52,13 @@ class g extends c {
|
|
|
52
52
|
this._showAuthorInput = this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText ?? !0, this._showCopyrightInput = this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText ?? !0, this._showLegendInput = this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend ?? !0, this._showNorthArrowInput = !!this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length, this._showScaleBarInput = !!this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length, this._showForceFeatureAttributes = p(this.viewModel.view) && !!this._selectedTemplate?.layoutItem?.id && !this.hideFeatureAttributes, this._showTablesInput = m(this.viewModel.view) && !!this._selectedTemplate?.layoutItem?.id && !this.hideIncludeTables;
|
|
53
53
|
}, { initial: !0 }), "template-handle");
|
|
54
54
|
}, { initial: !0 }),
|
|
55
|
-
|
|
55
|
+
s(() => [this.viewModel.portal?.user, this.autoPopulateAuthor], () => {
|
|
56
56
|
!this.viewModel.templateOptions.author && this.autoPopulateAuthor && this.viewModel.portal?.user?.username && (this.viewModel.templateOptions.author = this.viewModel.portal.user.username, this.requestUpdate());
|
|
57
57
|
}, { initial: !0 })
|
|
58
58
|
]);
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
return t`<div aria-labelledby=${`${this.el.id}__advancedOptionsForLayout`} class="advanced-options-container">${this._renderScaleSection()}${this._renderAuthorSection()}${this._renderCopyrightSection()}${this._renderDpiSection()}${this._renderOutSpatialReferenceSection()}${this._renderCustomTextElementSection()}${this._renderLegendSection()}${this._renderNorthArrowSection()}${this._renderScaleBarSection()}${this._renderForceFeatureAttributesSection()}${this._renderIncludeTablesSection()}</div>`;
|
|
61
|
+
return t`<div aria-labelledby=${`${this.el.id}__advancedOptionsForLayout`} class="advanced-options-container">${this._renderScaleSection()}${this._renderAuthorSection()}${this._renderCopyrightSection()}${this._renderDpiSection()}${this._renderOutSpatialReferenceSection()}${this._renderDatumTransformationSection()}${this._renderCustomTextElementSection()}${this._renderLegendSection()}${this._renderNorthArrowSection()}${this._renderScaleBarSection()}${this._renderForceFeatureAttributesSection()}${this._renderIncludeTablesSection()}</div>`;
|
|
62
62
|
}
|
|
63
63
|
_renderScaleSection() {
|
|
64
64
|
return t`<arcgis-print-scale-section .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-print-scale-section>`;
|
|
@@ -75,6 +75,9 @@ class g extends c {
|
|
|
75
75
|
_renderOutSpatialReferenceSection() {
|
|
76
76
|
return t`<arcgis-print-out-spatial-reference-input .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-print-out-spatial-reference-input>`;
|
|
77
77
|
}
|
|
78
|
+
_renderDatumTransformationSection() {
|
|
79
|
+
return t`<arcgis-print-datum-transformation-input .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-print-datum-transformation-input>`;
|
|
80
|
+
}
|
|
78
81
|
_renderCustomTextElementSection() {
|
|
79
82
|
return t`<arcgis-print-custom-text-elements .viewModel=${this.viewModel}></arcgis-print-custom-text-elements>`;
|
|
80
83
|
}
|
|
@@ -96,7 +99,7 @@ class g extends c {
|
|
|
96
99
|
return this._showTablesInput ? t`<div><calcite-label layout=inline><calcite-checkbox .checked=${!!this.viewModel.templateOptions.includeTables} @calciteCheckboxChange=${(e) => this.viewModel.templateOptions.includeTables = e.target.checked}></calcite-checkbox>${this.messages.includeTables}</calcite-label></div>` : null;
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
|
-
|
|
102
|
+
o("arcgis-print-layout-advanced-options", g);
|
|
100
103
|
export {
|
|
101
104
|
g as PrintLayoutAdvancedOptions
|
|
102
105
|
};
|
|
@@ -3,6 +3,7 @@ import "@esri/calcite-components/components/calcite-label";
|
|
|
3
3
|
import "@esri/calcite-components/components/calcite-input";
|
|
4
4
|
import "../arcgis-print-dpi-input/index.js";
|
|
5
5
|
import "../arcgis-print-out-spatial-reference-input/index.js";
|
|
6
|
+
import "../arcgis-print-datum-transformation-input/index.js";
|
|
6
7
|
import "../arcgis-print-custom-text-elements/index.js";
|
|
7
8
|
import "@esri/calcite-components/components/calcite-checkbox";
|
|
8
9
|
import "@esri/calcite-components/components/calcite-select";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as m } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as p, html as l } from "lit";
|
|
4
|
-
import { watch as
|
|
4
|
+
import { watch as o } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
5
|
import { LitElement as u, nothing as h } from "@arcgis/lumina";
|
|
6
|
-
import { i as
|
|
6
|
+
import { i as c, r as g, a as v, g as f, b as T } from "../../chunks/utils3.js";
|
|
7
7
|
import { u as w } from "../../chunks/useHandles.js";
|
|
8
|
-
const $ = p`:host{overflow-y:hidden;display:flex;flex:1 0}.template-select-flow-item-container{display:flex;flex-direction:column;justify-content:space-between;overflow-y:hidden;flex-grow:1}.template-select-flow-item-container .template-select-flow-item-content{display:flex;flex-direction:column;overflow-y:auto;flex:1 0}.template-select-flow-item-container .template-select-flow-item-content .template-select-flow-item-list-heading{display:flex;gap:var(--calcite-spacing-xs);align-items:center;padding:var(--calcite-spacing-md) var(--calcite-spacing-lg);background-color:var(--calcite-color-foreground-2);border-bottom:1px solid var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-semibold)}.template-button-container{padding:var(--calcite-spacing-md)}.template-done-button{width:100%}`;
|
|
8
|
+
const $ = p`:host{overflow-y:hidden;display:flex;flex:1 0}.template-select-flow-item-container{display:flex;flex-direction:column;justify-content:space-between;overflow-y:hidden;flex-grow:1}.template-select-flow-item-container .template-select-flow-item-content{display:flex;flex-direction:column;overflow-y:auto;flex:1 0}.template-select-flow-item-container .template-select-flow-item-content .template-select-flow-item-list-heading{display:flex;gap:var(--calcite-spacing-xs);align-items:center;justify-content:space-between;padding:var(--calcite-spacing-md) var(--calcite-spacing-lg);background-color:var(--calcite-color-foreground-2);border-bottom:1px solid var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-semibold)}.template-button-container{padding:var(--calcite-spacing-md)}.template-done-button{width:100%}`;
|
|
9
9
|
class y extends u {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this._handles = w("disconnect");
|
|
@@ -18,19 +18,19 @@ class y extends u {
|
|
|
18
18
|
}
|
|
19
19
|
loaded() {
|
|
20
20
|
this.manager.onLifecycle(() => [
|
|
21
|
-
|
|
22
|
-
this._handles.removeHandles("template-handle"), this._selectedTemplate = e ? this.viewModel.getLayoutTemplateById(e) ?? void 0 : void 0, this._handles.addHandles(
|
|
21
|
+
o(() => this.viewModel.templateOptions.id, (e) => {
|
|
22
|
+
this._handles.removeHandles("template-handle"), this._selectedTemplate = e ? this.viewModel.getLayoutTemplateById(e) ?? void 0 : void 0, this._handles.addHandles(o(() => this._selectedTemplate?.state, () => this.requestUpdate(), { initial: !0 }), "template-handle");
|
|
23
23
|
}, { initial: !0 })
|
|
24
24
|
]);
|
|
25
25
|
}
|
|
26
26
|
_getPortalTemplates() {
|
|
27
|
-
return this.viewModel.includeDefaultTemplates && !this.excludeOrganizationTemplates ? this.viewModel.defaultTemplates.toArray().filter(({ layout: e, layoutItem: i }) => !
|
|
27
|
+
return this.viewModel.includeDefaultTemplates && !this.excludeOrganizationTemplates ? this.viewModel.defaultTemplates.toArray().filter(({ layout: e, layoutItem: i }) => !c(e) && !!i?.id) : [];
|
|
28
28
|
}
|
|
29
29
|
_getDefaultTemplates() {
|
|
30
|
-
return this.viewModel.includeDefaultTemplates ? this.viewModel.defaultTemplates.toArray().filter(({ layout: e, layoutItem: i }) => !
|
|
30
|
+
return this.viewModel.includeDefaultTemplates ? this.viewModel.defaultTemplates.toArray().filter(({ layout: e, layoutItem: i }) => !c(e) && !i?.id) : [];
|
|
31
31
|
}
|
|
32
32
|
_getPrintServiceTemplates() {
|
|
33
|
-
return !this.viewModel.includeDefaultTemplates || !this._getDefaultTemplates().length ? this.viewModel.printServiceTemplates.toArray().filter(({ layout: e }) => !
|
|
33
|
+
return !this.viewModel.includeDefaultTemplates || !this._getDefaultTemplates().length ? this.viewModel.printServiceTemplates.toArray().filter(({ layout: e }) => !c(e)) : [];
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
36
|
const { messages: e } = this, i = g.test(this.viewModel.portal?.url), t = this.viewModel.browseTemplates.toArray(), a = this._getPortalTemplates(), s = this._getDefaultTemplates(), n = this._getPrintServiceTemplates(), r = t.length + a.length + s.length + n.length > 15;
|
|
@@ -66,11 +66,10 @@ export abstract class ArcgisSliderScaleRange extends LitElement {
|
|
|
66
66
|
* and [maxScale](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/#maxScale) values will match the scale range
|
|
67
67
|
* within which the layer will render.
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* to prevent the slider thumbs from moving past the min/max scale defined on the map service. The unavailable range will be designated with a dashed line.
|
|
69
|
+
* If a [TileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/TileLayer/) with resampling disabled is provided,
|
|
70
|
+
* the slider thumbs will not be allowed to move past the `lods` of the layer's tiling scheme.
|
|
71
|
+
* If a [MapImageLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/) is provided, the same restrictions to the thumbs
|
|
72
|
+
* will be applied via the min/max scale defined by the map service. The unavailable range will be designated with a dashed line.
|
|
74
73
|
*/
|
|
75
74
|
accessor layer: Layer | Sublayer | SubtypeSublayer | undefined;
|
|
76
75
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { g as x, c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { LitElement as
|
|
2
|
+
import { g as x, c as _ } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as p } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as g, createEvent as d, safeStyleMap as u, nothing as M } from "@arcgis/lumina";
|
|
5
5
|
import { watch as f } from "@arcgis/core/core/reactiveUtils.js";
|
|
6
|
-
import { u as
|
|
6
|
+
import { u as v } from "../../chunks/useView.js";
|
|
7
7
|
import { u as y } from "../../chunks/useT9n.js";
|
|
8
|
-
import { css as
|
|
9
|
-
import { usePropertyChange as
|
|
10
|
-
import { createRef as
|
|
11
|
-
import
|
|
8
|
+
import { css as b, html as o } from "lit";
|
|
9
|
+
import { usePropertyChange as $ } from "@arcgis/lumina/controllers";
|
|
10
|
+
import { createRef as L, ref as w } from "lit/directives/ref.js";
|
|
11
|
+
import R from "@arcgis/core/portal/Portal.js";
|
|
12
12
|
const h = /* @__PURE__ */ new Set([
|
|
13
13
|
"ar-iq",
|
|
14
14
|
"ar-kw",
|
|
@@ -84,7 +84,7 @@ const h = /* @__PURE__ */ new Set([
|
|
|
84
84
|
"th-th",
|
|
85
85
|
"zh-cn",
|
|
86
86
|
"zh-tw"
|
|
87
|
-
]),
|
|
87
|
+
]), T = {
|
|
88
88
|
ar: "iq",
|
|
89
89
|
bg: "bg",
|
|
90
90
|
cs: "cz",
|
|
@@ -112,7 +112,7 @@ const h = /* @__PURE__ */ new Set([
|
|
|
112
112
|
sv: "se",
|
|
113
113
|
th: "th",
|
|
114
114
|
zh: "cn"
|
|
115
|
-
}, P =
|
|
115
|
+
}, P = b`:host{display:block;width:310px;max-width:100%}.slider{height:50px}.scale-indicator-container{position:relative;width:100%;margin-top:2px}.scale-indicator-icon{transform:scale(.8,1.7);margin-left:-6px;width:1px;--calcite-icon-color: var(--calcite-color-text-3)}.scale-menu-list{max-height:220px;overflow-y:auto}.scale-menu-input{max-width:120px}.scale-menu-button-container{display:flex;direction:ltr;justify-content:space-between}.scale-menu-button{min-width:0}:dir(rtl) .scale-menu-button-container>*{direction:rtl}.preview-container{padding:6px;background-color:var(--calcite-color-foreground-1);box-shadow:0 1px 2px #0000004d}`, l = [
|
|
116
116
|
{ id: "world", scale: 147914382, minScale: 147914382, maxScale: 1e8 },
|
|
117
117
|
{ id: "continent", scale: 5e7, minScale: 99999999, maxScale: 35e6 },
|
|
118
118
|
{ id: "countriesBig", scale: 25e6, minScale: 34999999, maxScale: 15e6 },
|
|
@@ -134,9 +134,9 @@ const h = /* @__PURE__ */ new Set([
|
|
|
134
134
|
{ id: "rooms", scale: 400, minScale: 400, maxScale: 101 },
|
|
135
135
|
{ id: "room", scale: 100, minScale: 100, maxScale: 0 }
|
|
136
136
|
];
|
|
137
|
-
class I extends
|
|
137
|
+
class I extends g {
|
|
138
138
|
constructor() {
|
|
139
|
-
super(...arguments), this.messages = y(), this._sliderRef =
|
|
139
|
+
super(...arguments), this.messages = y(), this._sliderRef = L(), this._activeMenu = null, this._customScaleSelected = null, this._portalRegion = null, this._layerMaxScaleLimit = l[l.length - 1].maxScale, this._layerMinScaleLimit = l[0].minScale, this.autoDestroyDisabled = !1, this.disabled = !1, this.hidePreview = !1, this.hideMaxScaleMenu = !1, this.hideMinScaleMenu = !1, this.icon = "actual-size", this.maxScale = 0, this.maxScaleLimit = l[l.length - 1].maxScale, this.minScale = 0, this.minScaleLimit = l[0].minScale, this.mode = "range", this.showWorldValue = !1, this.view = v(this), this.arcgisChange = d(), this.arcgisInput = d(), this.arcgisPropertyChange = $()("state", "minScale", "maxScale"), this.arcgisReady = d();
|
|
140
140
|
}
|
|
141
141
|
static {
|
|
142
142
|
this.properties = { _activeMenu: 16, _customScaleSelected: 16, _portalRegion: 16, _layerMaxScaleLimit: 16, _layerMinScaleLimit: 16, autoDestroyDisabled: 5, disabled: 7, hidePreview: 5, hideMaxScaleMenu: 5, hideMinScaleMenu: 5, icon: 1, label: 1, layer: 0, maxScale: 9, maxScaleLimit: 9, minScale: 9, minScaleLimit: 9, mode: 1, referenceElement: 1, region: 1, showWorldValue: 5, state: 32, view: 0 };
|
|
@@ -152,7 +152,7 @@ class I extends _ {
|
|
|
152
152
|
await this.manager.destroy();
|
|
153
153
|
}
|
|
154
154
|
willUpdate(e) {
|
|
155
|
-
if ((e.has("maxScaleLimit") || e.has("minScaleLimit")) && (this.minScaleLimit === 0 && (this.minScaleLimit =
|
|
155
|
+
if ((e.has("maxScaleLimit") || e.has("minScaleLimit")) && (this.minScaleLimit === 0 && (this.minScaleLimit = l[0].minScale), this.maxScaleLimit === 0 && (this.maxScaleLimit = l[l.length - 1].maxScale), this.minScaleLimit = Math.min(this.minScaleLimit, l[0].minScale), this.maxScaleLimit = Math.max(this.maxScaleLimit, l[l.length - 1].maxScale), this.minScale !== 0 && (this.minScale = Math.min(this.minScale, this._interactiveMinScale)), this.maxScale !== 0 && (this.maxScale = Math.max(this.maxScale, this._interactiveMaxScale)), this.hasUpdated && this._syncLayerScale()), e.has("maxScale") || e.has("minScale")) {
|
|
156
156
|
if (this.minScale !== 0) {
|
|
157
157
|
const i = this._clampScale("min", this.minScale);
|
|
158
158
|
this.minScale = i === this.minScaleLimit ? 0 : i;
|
|
@@ -162,11 +162,11 @@ class I extends _ {
|
|
|
162
162
|
this.maxScale = i === this.maxScaleLimit ? 0 : i;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
e.has("layer") && this.layer
|
|
166
|
-
}), e.has("mode") && (this.mode === "max-scale-only" ? this.minScale = 0 : this.mode === "min-scale-only" && (this.maxScale = 0), e.get("mode") !== void 0 && this._syncLayerScale());
|
|
165
|
+
e.has("layer") && (this.layer ? this.layer.load().catch(() => {
|
|
166
|
+
}) : (this._layerMinScaleLimit = l[0].minScale, this._layerMaxScaleLimit = l[l.length - 1].maxScale)), e.has("mode") && (this.mode === "max-scale-only" ? this.minScale = 0 : this.mode === "min-scale-only" && (this.maxScale = 0), e.get("mode") !== void 0 && this._syncLayerScale());
|
|
167
167
|
}
|
|
168
168
|
loaded() {
|
|
169
|
-
|
|
169
|
+
R.getDefault().load().then((i) => {
|
|
170
170
|
const a = i.user?.culture ?? i.culture;
|
|
171
171
|
a && (this._portalRegion = a.split("-")[1]?.toLowerCase() ?? null);
|
|
172
172
|
}).catch(() => {
|
|
@@ -179,37 +179,46 @@ class I extends _ {
|
|
|
179
179
|
}), ({ loaded: i, ready: a }) => {
|
|
180
180
|
if (!i || !a || !this.layer)
|
|
181
181
|
return;
|
|
182
|
+
this._layerMinScaleLimit = l[0].minScale, this._layerMaxScaleLimit = l[l.length - 1].maxScale;
|
|
182
183
|
const s = this.layer.type === "wcs" || this.layer.type === "imagery-tile" && this.layer.raster?.tileType === "Raster" ? null : "tileInfo" in this.layer ? this.layer.tileInfo?.lods : null;
|
|
183
184
|
if (s)
|
|
184
|
-
this._layerMinScaleLimit = s[0].scale === 0 ? l[0].minScale : Math.min(l[0].minScale, s[0].scale),
|
|
185
|
+
!("resampling" in this.layer) || this.layer.resampling || (this._layerMinScaleLimit = s[0].scale === 0 ? l[0].minScale : Math.min(l[0].minScale, s[0].scale), this._layerMaxScaleLimit = s[s.length - 1].scale);
|
|
185
186
|
else {
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
|
|
187
|
+
const n = this.layer && "maxScaleRange" in this.layer ? this.layer.maxScaleRange : null;
|
|
188
|
+
let r = 0, m = 0;
|
|
189
|
+
n && (r = n.minScale, m = n.maxScale), m !== 0 && (this._layerMaxScaleLimit = m), r !== 0 && (this._layerMinScaleLimit = r);
|
|
189
190
|
}
|
|
190
|
-
this.minScaleLimit = Math.min(this.minScaleLimit, this._layerMinScaleLimit), this.maxScaleLimit = Math.max(this.maxScaleLimit, this._layerMaxScaleLimit);
|
|
191
191
|
const c = this.layer;
|
|
192
|
-
c && "minScale" in c && "maxScale" in c && (c.minScale !== 0 && this.minScale === 0 && (this.minScale = Math.min(c.minScale, this.
|
|
192
|
+
c && "minScale" in c && "maxScale" in c && (c.minScale !== 0 && this.minScale === 0 && (this.minScale = Math.min(c.minScale, this._interactiveMinScale)), c.maxScale !== 0 && this.maxScale === 0 && (this.maxScale = Math.max(c.maxScale, this._interactiveMaxScale)));
|
|
193
193
|
}, { initial: !0 })
|
|
194
194
|
]);
|
|
195
195
|
}
|
|
196
|
+
get _interactiveMinScale() {
|
|
197
|
+
return Math.min(this.minScaleLimit, this._layerMinScaleLimit);
|
|
198
|
+
}
|
|
199
|
+
get _interactiveMaxScale() {
|
|
200
|
+
return Math.max(this.maxScaleLimit, this._layerMaxScaleLimit);
|
|
201
|
+
}
|
|
196
202
|
get _effectiveMinScale() {
|
|
197
|
-
return this.minScale === 0 ? this.
|
|
203
|
+
return this.minScale === 0 ? this._interactiveMinScale : this.minScale;
|
|
198
204
|
}
|
|
199
205
|
get _effectiveMaxScale() {
|
|
200
|
-
return this.maxScale === 0 ? this.
|
|
206
|
+
return this.maxScale === 0 ? this._interactiveMaxScale : this.maxScale;
|
|
207
|
+
}
|
|
208
|
+
get _sliderFullRangeMin() {
|
|
209
|
+
return this._mapScaleToSlider(this.minScaleLimit);
|
|
210
|
+
}
|
|
211
|
+
get _sliderFullRangeMax() {
|
|
212
|
+
return this._mapScaleToSlider(this.maxScaleLimit);
|
|
201
213
|
}
|
|
202
214
|
_clampScale(e, i) {
|
|
203
|
-
return e === "min" ? Math.min(Math.max(i, this._effectiveMaxScale + 1), this.
|
|
215
|
+
return e === "min" ? Math.min(Math.max(i, this._effectiveMaxScale + 1), this._interactiveMinScale) : Math.max(Math.min(i, this._effectiveMinScale - 1), this._interactiveMaxScale);
|
|
204
216
|
}
|
|
205
217
|
_getDropdownLabel(e) {
|
|
206
218
|
const i = e === "min" ? this._effectiveMinScale : this._effectiveMaxScale, a = Math.floor(this._mapScaleToSlider(i)), t = this.messages.scaleRangeLabels;
|
|
207
219
|
return t ? t[l[a].id] : "";
|
|
208
220
|
}
|
|
209
221
|
_getSpriteSheetFile() {
|
|
210
|
-
const e = this.messages._lang.toLowerCase();
|
|
211
|
-
if (h.has(e))
|
|
212
|
-
return e;
|
|
213
222
|
if (this.region) {
|
|
214
223
|
const a = this.region.toLowerCase(), t = `${this.messages._t9nLocale}-${a}`;
|
|
215
224
|
if (h.has(t))
|
|
@@ -218,12 +227,15 @@ class I extends _ {
|
|
|
218
227
|
if (s.endsWith(`-${a}`))
|
|
219
228
|
return s;
|
|
220
229
|
}
|
|
230
|
+
const e = this.messages._lang.toLowerCase();
|
|
231
|
+
if (h.has(e))
|
|
232
|
+
return e;
|
|
221
233
|
if (this._portalRegion) {
|
|
222
234
|
const a = `${this.messages._t9nLocale}-${this._portalRegion}`;
|
|
223
235
|
if (h.has(a))
|
|
224
236
|
return a;
|
|
225
237
|
}
|
|
226
|
-
const i =
|
|
238
|
+
const i = T[this.messages._t9nLocale];
|
|
227
239
|
if (i) {
|
|
228
240
|
const a = `${this.messages._t9nLocale}-${i}`;
|
|
229
241
|
if (h.has(a))
|
|
@@ -242,20 +254,20 @@ class I extends _ {
|
|
|
242
254
|
const e = this._sliderRef.value;
|
|
243
255
|
if (e) {
|
|
244
256
|
if (this.mode === "max-scale-only") {
|
|
245
|
-
const i = Math.max(this._mapSliderToScale(e.values[0]), this.
|
|
246
|
-
this.maxScale = i === this.
|
|
257
|
+
const i = Math.max(this._mapSliderToScale(e.values[0]), this._interactiveMaxScale);
|
|
258
|
+
this.maxScale = i === this._interactiveMaxScale ? 0 : i;
|
|
247
259
|
} else if (this.mode === "min-scale-only") {
|
|
248
|
-
const i = Math.min(this._mapSliderToScale(e.values[0]), this.
|
|
249
|
-
this.minScale = i === this.
|
|
260
|
+
const i = Math.min(this._mapSliderToScale(e.values[0]), this._interactiveMinScale);
|
|
261
|
+
this.minScale = i === this._interactiveMinScale ? 0 : i;
|
|
250
262
|
} else {
|
|
251
|
-
const i = Math.min(this._mapSliderToScale(e.values[0]), this.
|
|
252
|
-
this.minScale = i === this.
|
|
263
|
+
const i = Math.min(this._mapSliderToScale(e.values[0]), this._interactiveMinScale), a = Math.max(this._mapSliderToScale(e.values[1]), this._interactiveMaxScale);
|
|
264
|
+
this.minScale = i === this._interactiveMinScale ? 0 : i, this.maxScale = a === this._interactiveMaxScale ? 0 : a;
|
|
253
265
|
}
|
|
254
266
|
this._syncLayerScale();
|
|
255
267
|
}
|
|
256
268
|
}
|
|
257
269
|
_mapScaleToSlider(e) {
|
|
258
|
-
const i = Math.min(l[0].minScale, Math.max(l[l.length - 1].maxScale, e)), a = l.findIndex((
|
|
270
|
+
const i = Math.min(l[0].minScale, Math.max(l[l.length - 1].maxScale, e)), a = l.findIndex((r) => i >= r.maxScale && i <= r.minScale), t = l[a], s = a, c = a + 0.9999;
|
|
259
271
|
return t ? s + (i - t.minScale) * (c - s) / (t.maxScale - t.minScale) : 0;
|
|
260
272
|
}
|
|
261
273
|
_mapSliderToScale(e) {
|
|
@@ -270,21 +282,22 @@ class I extends _ {
|
|
|
270
282
|
}
|
|
271
283
|
_renderScalePreviewPopover() {
|
|
272
284
|
const e = this._renderScalePreview();
|
|
273
|
-
return this.hidePreview || !e ? null :
|
|
285
|
+
return this.hidePreview || !e ? null : o`<div slot=popover>${e}</div>`;
|
|
274
286
|
}
|
|
275
287
|
render() {
|
|
276
|
-
|
|
288
|
+
const e = this._mapScaleToSlider(this._interactiveMinScale), i = this._mapScaleToSlider(this._interactiveMaxScale), a = this._sliderFullRangeMin, t = this._sliderFullRangeMax;
|
|
289
|
+
return o`<div><arcgis-slider class="slider" .disabled=${this.disabled} layout=horizontal .fillPlacement=${this.mode === "max-scale-only" ? "start" : this.mode === "min-scale-only" ? "end" : void 0} .fullRangeMin=${a < e ? a : void 0} .fullRangeMax=${t > i ? t : void 0} .max=${i} .min=${e} .labelFormatter=${(s, c, n) => n(Math.round(this._mapSliderToScale(s)))} .values=${this.mode === "max-scale-only" ? [this._mapScaleToSlider(this._effectiveMaxScale)] : this.mode === "min-scale-only" ? [this._mapScaleToSlider(this._effectiveMinScale)] : [this._mapScaleToSlider(this._effectiveMinScale), this._mapScaleToSlider(this._effectiveMaxScale)]} @arcgisInput=${this._handleSliderThumbDrag} ${w(this._sliderRef)}>${this._renderScalePreviewPopover()}${this.view?.scale != null && this._renderCurrentScaleIndicator(this.view.scale) || ""}</arcgis-slider><div class="scale-menu-button-container" slot=content-end>${this.mode !== "max-scale-only" && !this.hideMinScaleMenu ? [this._renderScaleMenuButtons("min"), this._renderScaleMenuPopover("min")] : o`<div></div>`}${this.mode !== "min-scale-only" && !this.hideMaxScaleMenu && [this._renderScaleMenuButtons("max"), this._renderScaleMenuPopover("max")] || ""}</div></div>`;
|
|
277
290
|
}
|
|
278
291
|
_renderCurrentScaleIndicator(e) {
|
|
279
|
-
const i = this.
|
|
280
|
-
return
|
|
292
|
+
const i = this._sliderFullRangeMin, t = this._sliderFullRangeMax - i, s = Math.min(100, Math.max(0, (this._mapScaleToSlider(e) - i) / t * 100));
|
|
293
|
+
return p("scale-indicator", o`<div class="scale-indicator-container" slot=content-end><div class="scale-indicator-icon" style=${u({
|
|
281
294
|
position: "absolute",
|
|
282
|
-
left: `${
|
|
295
|
+
left: `${s}%`
|
|
283
296
|
})} .title=${`${this.messages.currentScale} 1:${Math.round(e).toLocaleString(this.messages._t9nLocale)}`}><calcite-icon icon=caret-up scale=s></calcite-icon></div></div>`);
|
|
284
297
|
}
|
|
285
298
|
_renderCustomScaleValue(e, i) {
|
|
286
299
|
const a = Math.round(i).toString();
|
|
287
|
-
return
|
|
300
|
+
return o`<calcite-list-item .label=${this.messages?.featuredScaleLabels?.custom} .selected=${this._customScaleSelected === e} @calciteListItemSelect=${(t) => {
|
|
288
301
|
const s = t.target.querySelector("calcite-input-number");
|
|
289
302
|
this._handleCustomScaleInput(e, s?.value ?? ""), this._customScaleSelected = e;
|
|
290
303
|
}}><calcite-input-number dir=ltr class="scale-menu-input" slot=content-end group-separator inputmode=numeric .max=${l[0].minScale} .min=${l[l.length - 1].maxScale} number-button-type=none .placeholder=${this.messages?.customScaleInputTooltip} prefix-text=1: scale=s step=1 .value=${a} @click=${(t) => t.stopPropagation()} @keydown=${(t) => {
|
|
@@ -292,10 +305,10 @@ class I extends _ {
|
|
|
292
305
|
}}></calcite-input-number></calcite-list-item>`;
|
|
293
306
|
}
|
|
294
307
|
_renderScaleMenuButtons(e) {
|
|
295
|
-
return
|
|
308
|
+
return o`<calcite-button .disabled=${this.disabled} class="scale-menu-button" .id=${`scale-menu-button-${e}`} icon-end=chevron-down scale=s .appearance=${this._activeMenu === e ? "outline" : "transparent"}>${this._getDropdownLabel(e)}</calcite-button>`;
|
|
296
309
|
}
|
|
297
310
|
_renderScaleMenuPopover(e) {
|
|
298
|
-
return
|
|
311
|
+
return o`<calcite-popover auto-close .label=${`${e === "min" ? "Min" : "Max"} scale menu`} .referenceElement=${`scale-menu-button-${e}`} .placement=${e === "max" ? "bottom-end" : "bottom-start"} .open=${this._activeMenu === e} scale=s @calcitePopoverOpen=${() => this._activeMenu = e} @calcitePopoverClose=${() => {
|
|
299
312
|
this._activeMenu === e && (this._activeMenu = null);
|
|
300
313
|
}}>${this._renderScaleMenu(e)}</calcite-popover>`;
|
|
301
314
|
}
|
|
@@ -303,24 +316,24 @@ class I extends _ {
|
|
|
303
316
|
const i = Math.floor(this._mapScaleToSlider(this._effectiveMaxScale)), a = Math.floor(this._mapScaleToSlider(this._effectiveMinScale)), t = e === "min" ? this._effectiveMinScale : this._effectiveMaxScale, s = this.messages.featuredScaleLabels;
|
|
304
317
|
if (!s)
|
|
305
318
|
return;
|
|
306
|
-
const c = Math.floor(this._mapScaleToSlider(this.
|
|
307
|
-
scaleLabel: s[
|
|
308
|
-
scaleValue:
|
|
309
|
-
isSelected: t ===
|
|
310
|
-
valueVisible:
|
|
319
|
+
const c = Math.floor(this._mapScaleToSlider(this._interactiveMaxScale)), n = Math.floor(this._mapScaleToSlider(this._interactiveMinScale)), r = l.filter((m, S) => e === "min" ? S < i && S >= n : S > a && S <= c).map((m) => this._renderScaleMenuItem({
|
|
320
|
+
scaleLabel: s[m.id],
|
|
321
|
+
scaleValue: m.scale,
|
|
322
|
+
isSelected: t === m.scale,
|
|
323
|
+
valueVisible: m.id !== "world" || this.showWorldValue,
|
|
311
324
|
type: e
|
|
312
325
|
}));
|
|
313
|
-
return
|
|
326
|
+
return o`<calcite-list label="Scale Menu List" scale=s class="scale-menu-list" selection-appearance=icon selection-mode=single-persist>${this.view?.scale != null && this._renderCustomScaleValue(e, t) || ""}${this.view?.scale != null ? this._renderScaleMenuItem({
|
|
314
327
|
scaleValue: this.view.scale,
|
|
315
328
|
scaleLabel: s.current,
|
|
316
329
|
isSelected: t === this.view.scale,
|
|
317
330
|
valueVisible: !0,
|
|
318
331
|
type: e
|
|
319
|
-
}) : null}${
|
|
332
|
+
}) : null}${r}</calcite-list>`;
|
|
320
333
|
}
|
|
321
334
|
_renderScaleMenuItem(e) {
|
|
322
335
|
const { scaleValue: i, scaleLabel: a, isSelected: t, valueVisible: s } = e, c = i === l[0].scale ? ` ${this.messages.aboveSuffix}` : i === l[l.length - 1].scale ? ` ${this.messages.belowSuffix}` : "";
|
|
323
|
-
return
|
|
336
|
+
return o`<calcite-list-item .label=${a} .selected=${t && this._customScaleSelected !== e.type} .description=${s ? `1:${Math.round(i).toLocaleString(this.messages._t9nLocale)}${c}` : void 0} @calciteListItemSelect=${() => {
|
|
324
337
|
this._setScale(e.type, i), this._customScaleSelected = null;
|
|
325
338
|
}}></calcite-list-item>`;
|
|
326
339
|
}
|
|
@@ -328,17 +341,17 @@ class I extends _ {
|
|
|
328
341
|
const e = this._sliderRef.value?.activeValue;
|
|
329
342
|
if (typeof e != "number")
|
|
330
343
|
return null;
|
|
331
|
-
const i = Math.min(l.length - 1, Math.max(0, Math.floor(e))), a = 5, t = 128, s = t * (i % a), c = t * Math.floor(i / a),
|
|
332
|
-
return
|
|
344
|
+
const i = Math.min(l.length - 1, Math.max(0, Math.floor(e))), a = 5, t = 128, s = t * (i % a), c = t * Math.floor(i / a), n = `-${s}px -${c}px`, r = this._getSpriteSheetFile();
|
|
345
|
+
return o`<div class="preview-container"><img src=${x(`./assets/slider-scale-range/images/${r}.avif`) ?? M} style=${u({
|
|
333
346
|
display: "block",
|
|
334
347
|
height: `${t}px`,
|
|
335
348
|
width: `${t}px`,
|
|
336
|
-
objectPosition:
|
|
349
|
+
objectPosition: n,
|
|
337
350
|
objectFit: "none"
|
|
338
351
|
})}></div>`;
|
|
339
352
|
}
|
|
340
353
|
}
|
|
341
|
-
|
|
354
|
+
_("arcgis-slider-scale-range", I);
|
|
342
355
|
export {
|
|
343
356
|
I as ArcgisSliderScaleRange
|
|
344
357
|
};
|