@arcgis/common-components 5.1.0-next.8 → 5.1.0-next.81
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/README.md +24 -1
- package/dist/cdn/{7Y42J3JI.js → 2ROTQXBA.js} +1 -1
- package/dist/cdn/{YVSTPEPS.js → 4NIHDQMD.js} +1 -1
- package/dist/cdn/{ZLXAKPUH.js → 7VQXROCV.js} +1 -1
- package/dist/cdn/BVADJRSO.js +2 -0
- package/dist/cdn/{4CW7U27R.js → CUVAZ6B6.js} +1 -1
- package/dist/cdn/{7HQMPKZO.js → D275NGJ4.js} +1 -1
- package/dist/cdn/{AXTSUI2Q.js → E2CEOXTC.js} +1 -1
- package/dist/cdn/{3O7GAC23.js → EKTUO47P.js} +1 -1
- package/dist/cdn/HW7EX2AG.js +2 -0
- package/dist/cdn/{7CI55VCH.js → HYLC5GEB.js} +1 -1
- package/dist/cdn/I5V5MA2D.js +2 -0
- package/dist/cdn/{ZOWIFVL3.js → JKUKXLWS.js} +1 -1
- package/dist/cdn/{C6JAR4IN.js → KGAUGGUY.js} +1 -1
- package/dist/cdn/MB7UDGWW.js +2 -0
- package/dist/cdn/NNIIOI3K.js +2 -0
- package/dist/cdn/{4DCAUWTC.js → NXOFUUIH.js} +1 -1
- package/dist/cdn/P3YFTGR5.js +2 -0
- package/dist/cdn/{J5X5TNVW.js → QLVAQVQD.js} +1 -1
- package/dist/cdn/{XEB2RUND.js → QY2EUWNN.js} +1 -1
- package/dist/cdn/WJXA24EX.js +4 -0
- package/dist/cdn/{7PB2GGQH.js → WPPESVVG.js} +1 -1
- package/dist/cdn/XHP45CJY.js +2 -0
- package/dist/cdn/{23DDMSOB.js → ZL64N62K.js} +1 -1
- package/dist/cdn/assets/field-pick-list/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.en-US.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/commonFunctions.js +7 -3
- package/dist/components/arcgis-ckeditor5/customElement.js +7 -7
- package/dist/components/arcgis-ckeditor5/types.d.ts +9 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +1 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.d.ts +2 -2
- package/dist/components/arcgis-field-info/utils/basic.d.ts +21 -2
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +3 -3
- package/dist/components/arcgis-field-pick-list/customElement.js +1 -1
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +25 -3
- package/dist/components/arcgis-histogram/customElement.d.ts +21 -21
- package/dist/components/arcgis-histogram/customElement.js +81 -90
- package/dist/components/arcgis-histogram/types.d.ts +1 -3
- package/dist/components/arcgis-label-input/customElement.d.ts +5 -6
- package/dist/components/arcgis-label-input/customElement.js +22 -17
- package/dist/components/arcgis-picker-input/customElement.js +11 -11
- package/dist/components/arcgis-slider/customElement.d.ts +72 -67
- package/dist/components/arcgis-slider/customElement.js +349 -304
- package/dist/components/arcgis-spatial-reference-picker/customElement.d.ts +327 -0
- package/dist/components/arcgis-spatial-reference-picker/customElement.js +7702 -0
- package/dist/components/arcgis-spatial-reference-picker/index.d.ts +1 -0
- package/dist/components/arcgis-spatial-reference-picker/index.js +3 -0
- package/dist/components/arcgis-spatial-reference-picker-tree/customElement.d.ts +35 -0
- package/dist/components/arcgis-spatial-reference-picker-tree/customElement.js +77 -0
- package/dist/components/arcgis-spatial-reference-picker-tree/index.d.ts +1 -0
- package/dist/components/arcgis-spatial-reference-picker-tree/index.js +3 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +21 -24
- package/dist/components/arcgis-ticks/customElement.js +1 -1
- package/dist/components/arcgis-ticks/types.d.ts +23 -0
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +9 -4
- package/dist/components/arcgis-unique-values-list/customElement.js +158 -151
- package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +14 -2
- 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/index.d.ts +20 -0
- package/dist/loader.js +3 -1
- package/dist/types/lumina.d.ts +13 -1
- package/dist/types/preact.d.ts +15 -1
- package/dist/types/react.d.ts +17 -1
- package/dist/types/stencil.d.ts +13 -1
- package/dist/utils/spatial-references.d.ts +1 -0
- package/dist/utils/types.d.ts +19 -6
- package/package.json +5 -6
- package/dist/cdn/2BDHDUXG.js +0 -2
- package/dist/cdn/57I35HLF.js +0 -2
- package/dist/cdn/6DQVLQL6.js +0 -2
- package/dist/cdn/EKKJN7WZ.js +0 -2
- package/dist/cdn/UTXWKXMT.js +0 -4
- package/dist/cdn/ZL3E4ZGE.js +0 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { makeAccessorController as
|
|
6
|
-
import { slotChangeHasAssignedElement as
|
|
7
|
-
import { css as
|
|
8
|
-
import { map as
|
|
9
|
-
import { createRef as
|
|
10
|
-
import { u as
|
|
11
|
-
import { g as
|
|
12
|
-
import
|
|
13
|
-
import { property as
|
|
14
|
-
import { watch as
|
|
15
|
-
import { generateGuid as
|
|
16
|
-
const
|
|
2
|
+
import { c as Q } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as Z } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as ee, createEvent as $, safeClassMap as P, safeStyleMap as L, nothing as E } from "@arcgis/lumina";
|
|
5
|
+
import { makeAccessorController as te } from "@arcgis/lumina/controllers/accessor";
|
|
6
|
+
import { slotChangeHasAssignedElement as R, classes as ae, getClosestElement as ne } from "@arcgis/toolkit/dom";
|
|
7
|
+
import { css as re, html as y } from "lit";
|
|
8
|
+
import { map as ie } from "lit/directives/map.js";
|
|
9
|
+
import { createRef as B, ref as O } from "lit/directives/ref.js";
|
|
10
|
+
import { u as se } from "../../chunks/useT9n.js";
|
|
11
|
+
import { g as le } from "../../chunks/locale.js";
|
|
12
|
+
import oe from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { property as I, subclass as ce } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
14
|
+
import { watch as A } from "@arcgis/core/core/reactiveUtils.js";
|
|
15
|
+
import { generateGuid as K } from "@arcgis/toolkit/string";
|
|
16
|
+
const p = {
|
|
17
17
|
increment: "ArrowUp",
|
|
18
18
|
incrementHorizontal: "ArrowRight",
|
|
19
19
|
decrement: "ArrowDown",
|
|
@@ -24,83 +24,85 @@ const m = {
|
|
|
24
24
|
jumpToEnd: "End",
|
|
25
25
|
confirmEdit: "Enter"
|
|
26
26
|
};
|
|
27
|
-
function
|
|
28
|
-
const i =
|
|
27
|
+
function N({ key: n, shiftKey: e }, t, a) {
|
|
28
|
+
const i = de(n);
|
|
29
29
|
if (i == null)
|
|
30
30
|
return null;
|
|
31
|
-
const r =
|
|
31
|
+
const r = ue(n) || he(n) && e ? ge(t) : 1;
|
|
32
32
|
return {
|
|
33
33
|
direction: a ? i * -1 : i,
|
|
34
34
|
count: r
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return n ===
|
|
37
|
+
function de(n) {
|
|
38
|
+
return n === p.increment || n === p.incrementHorizontal || n === p.pageIncrement ? 1 : n === p.decrement || n === p.decrementHorizontal || n === p.pageDecrement ? -1 : null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return n ===
|
|
40
|
+
function U(n) {
|
|
41
|
+
return n === p.jumpToEnd || n === p.jumpToStart;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return n ===
|
|
43
|
+
function he(n) {
|
|
44
|
+
return n === p.increment || n === p.decrement || n === p.decrementHorizontal || n === p.incrementHorizontal;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return n ===
|
|
46
|
+
function ue(n) {
|
|
47
|
+
return n === p.pageIncrement || n === p.pageDecrement;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function ge(n) {
|
|
50
50
|
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
51
51
|
return Math.max(1, e);
|
|
52
52
|
}
|
|
53
|
-
const ue = te`:host{display:flex;width:100%;height:100%;font-family:Avenir Next,Helvetica Neue,helvetica,arial,sans-serif;font-size:var(--calcite-font-size--2);font-variant-numeric:tabular-nums;--arcgis-slider-dash-length: 5px;--arcgis-slider-handle-size: .875rem;--arcgis-slider-track-background-color: var(--calcite-color-border-2);--arcgis-slider-internal-show-range-labels: 0;--arcgis-slider-internal-show-value-labels: 0;--arcgis-slider-internal-value-labels-placement-start: 0;--arcgis-slider-internal-value-labels-placement-end: 0;--arcgis-slider-internal-range-labels-placement-center: 0;--arcgis-slider-internal-range-labels-placement-end: 0;--arcgis-slider-internal-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-slider-internal-label-input-margin: calc(var(--arcgis-slider-internal-handle-offset) + 4px);--arcgis-slider-internal-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-slider-internal-track-size: 2px}:host([show-range-labels]){--arcgis-slider-internal-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-slider-internal-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-slider-internal-value-labels-placement-start: var(--arcgis-slider-internal-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-slider-internal-value-labels-placement-end: var(--arcgis-slider-internal-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-slider-internal-range-labels-placement-center: var(--arcgis-slider-internal-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-slider-internal-range-labels-placement-end: var(--arcgis-slider-internal-show-range-labels)}:host([disabled]){cursor:default;opacity:var(--calcite-opacity-disabled);pointer-events:none}.content{direction:ltr;flex:1;touch-action:none;user-select:none;display:grid;word-wrap:normal;word-break:normal;padding-block:var(--arcgis-slider-internal-handle-offset)}.track-container{grid-area:track-container;position:relative;display:flex;justify-content:center;align-items:center}.track{touch-action:none;position:relative}.track-bounds{background-color:var(--calcite-color-border-2)}.track-fill{--arcgis-slider-track-background-color: var(--calcite-color-brand)}:host([layout="vertical"]){.track-effective-start{background:repeating-linear-gradient(to bottom,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to top,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}:host([layout="horizontal"]){.track-effective-start{background:repeating-linear-gradient(to right,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to left,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}.track-range{background-color:var(--calcite-color-brand);&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-left:1px;writing-mode:vertical-lr}}.segment{transform-origin:0 0;inset-block-start:0px;block-size:.125rem;position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;position:absolute}.thumb:focus,.thumb.active{.handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px #00000029;outline:2px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}.handle{cursor:pointer;box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--calcite-animation-timing, .125s) ease-in-out;position:absolute;top:calc(var(--arcgis-slider-internal-handle-offset) * -1);left:calc(var(--arcgis-slider-internal-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.label{position:absolute;will-change:transform}.label[hidden]{display:block;opacity:0;pointer-events:none}.min{grid-area:range-start}.max{grid-area:range-end}:host([layout="horizontal"][mirrored][range-labels-placement="center"]),:host([layout="vertical"]:not([mirrored])){.min{grid-area:range-end}.max{grid-area:range-start}}.content-start{grid-area:content-start;display:flex}.content-end{grid-area:content-end;display:flex}:host([layout="vertical"]){.content{grid-template:". range-start range-start range-start ." "content-start content-start track-container content-end content-end" ". range-end range-end range-end .";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto auto auto 1fr;row-gap:var(--arcgis-slider-internal-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-slider-internal-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-slider-internal-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-slider-internal-content-start-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height)) );--arcgis-slider-internal-content-end-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) );column-gap:calc(var(--arcgis-slider-internal-show-range-labels) * var(--arcgis-slider-internal-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset));grid-template:". content-start ." "range-start content-start range-end" "range-start track-container range-end" "range-start content-end range-end" ". content-end .";grid-template-columns:auto 1fr auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) var(--arcgis-slider-internal-track-size) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) minmax(var(--arcgis-slider-internal-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="end"]){.content{--arcgis-slider-internal-content-start-min-height: calc( var(--arcgis-slider-internal-handle-offset) + var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height) );--arcgis-slider-internal-content-end-min-height: calc( var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height) );padding-inline:var(--arcgis-slider-internal-handle-offset);grid-template:"content-start content-start content-start" "track-container track-container track-container" "content-end content-end content-end" "content-end content-end content-end" "content-end content-end content-end";grid-template-columns:auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) var(--arcgis-slider-internal-track-size) var(--arcgis-slider-internal-handle-offset) calc(var(--arcgis-slider-internal-range-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) minmax(var(--arcgis-slider-internal-content-end-min-height),auto);column-gap:var(--arcgis-slider-internal-handle-offset)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:calc(var(--arcgis-slider-internal-label-input-margin) + var(--arcgis-slider-internal-range-labels-placement-end) * (var(--arcgis-slider-internal-label-input-height)))}}.min,.max{--arcgis-slider-internal-range-translation: calc(var(--arcgis-slider-internal-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}.max{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}}&:host([mirrored]){.min{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}.max{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}}}`;
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const me = re`:host{display:flex;width:100%;height:100%;font-family:Avenir Next,Helvetica Neue,helvetica,arial,sans-serif;font-size:var(--calcite-font-size--2);font-variant-numeric:tabular-nums;--arcgis-slider-dash-length: 5px;--arcgis-slider-handle-size: .875rem;--arcgis-slider-track-background-color: var(--calcite-color-border-2);--arcgis-slider-internal-show-range-labels: 0;--arcgis-slider-internal-show-value-labels: 0;--arcgis-slider-internal-value-labels-placement-start: 0;--arcgis-slider-internal-value-labels-placement-end: 0;--arcgis-slider-internal-range-labels-placement-center: 0;--arcgis-slider-internal-range-labels-placement-end: 0;--arcgis-slider-internal-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-slider-internal-label-input-margin: calc(var(--arcgis-slider-internal-handle-offset) + 4px);--arcgis-slider-internal-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-slider-internal-track-size: 2px}:host([show-range-labels]){--arcgis-slider-internal-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-slider-internal-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-slider-internal-value-labels-placement-start: var(--arcgis-slider-internal-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-slider-internal-value-labels-placement-end: var(--arcgis-slider-internal-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-slider-internal-range-labels-placement-center: var(--arcgis-slider-internal-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-slider-internal-range-labels-placement-end: var(--arcgis-slider-internal-show-range-labels)}:host([disabled]){cursor:default;opacity:var(--calcite-opacity-disabled);pointer-events:none}.content{direction:ltr;flex:1;touch-action:none;user-select:none;display:grid;word-wrap:normal;word-break:normal;padding-block:var(--arcgis-slider-internal-handle-offset)}.track-container{grid-area:track-container;position:relative;display:flex;justify-content:center;align-items:center}.track{touch-action:none;position:relative}.track-bounds{background-color:var(--calcite-color-border-2)}.track-fill{--arcgis-slider-track-background-color: var(--calcite-color-brand)}:host([layout="vertical"]){.track-effective-start{background:repeating-linear-gradient(to bottom,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to top,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}:host([layout="horizontal"]){.track-effective-start{background:repeating-linear-gradient(to right,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}.track-effective-end{background:repeating-linear-gradient(to left,var(--arcgis-slider-track-background-color) 0 var(--arcgis-slider-dash-length),color-mix(in srgb,transparent 75%,var(--arcgis-slider-track-background-color) 25%) var(--arcgis-slider-dash-length) calc(var(--arcgis-slider-dash-length) * 2))}}.track-range{background-color:var(--calcite-color-brand);&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-slider-internal-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-left:1px;writing-mode:vertical-lr}}.segment{transform-origin:0 0;inset-block-start:0px;block-size:.125rem;position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;position:absolute}.thumb:focus,.thumb.active{.handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px #00000029;outline:2px solid var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}.handle{cursor:pointer;box-sizing:border-box;z-index:1;touch-action:none;background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--calcite-animation-timing, .125s) ease-in-out;position:absolute;top:calc(var(--arcgis-slider-internal-handle-offset) * -1);left:calc(var(--arcgis-slider-internal-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.label{position:absolute;will-change:transform}.label[hidden]{display:block;opacity:0;pointer-events:none}.min{grid-area:range-start}.max{grid-area:range-end}:host([layout="horizontal"][mirrored][range-labels-placement="center"]),:host([layout="vertical"]:not([mirrored])){.min{grid-area:range-end}.max{grid-area:range-start}}.content-start{grid-area:content-start;display:flex}.content-end{grid-area:content-end;display:flex}:host([layout="vertical"]){.content{grid-template:". range-start range-start range-start ." "content-start content-start track-container content-end content-end" ". range-end range-end range-end .";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto auto auto 1fr;row-gap:var(--arcgis-slider-internal-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-slider-internal-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-slider-internal-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-slider-internal-content-start-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height)) );--arcgis-slider-internal-content-end-min-height: calc( ((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset)) + (var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) );column-gap:calc(var(--arcgis-slider-internal-show-range-labels) * var(--arcgis-slider-internal-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-slider-internal-show-range-labels)) * var(--arcgis-slider-internal-handle-offset));grid-template:". content-start ." "range-start content-start range-end" "range-start track-container range-end" "range-start content-end range-end" ". content-end .";grid-template-columns:auto 1fr auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) var(--arcgis-slider-internal-track-size) calc(var(--arcgis-slider-internal-show-range-labels) * calc(calc(var(--arcgis-slider-internal-label-input-height) / 2) - calc(var(--arcgis-slider-internal-track-size) / 2))) minmax(var(--arcgis-slider-internal-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="end"]){.content{--arcgis-slider-internal-content-start-min-height: calc( var(--arcgis-slider-internal-handle-offset) + var(--arcgis-slider-internal-value-labels-placement-start) * var(--arcgis-slider-internal-label-input-height) );--arcgis-slider-internal-content-end-min-height: calc( var(--arcgis-slider-internal-value-labels-placement-end) * var(--arcgis-slider-internal-label-input-height) );padding-inline:var(--arcgis-slider-internal-handle-offset);grid-template:"content-start content-start content-start" "track-container track-container track-container" "content-end content-end content-end" "content-end content-end content-end" "content-end content-end content-end";grid-template-columns:auto;grid-template-rows:minmax(var(--arcgis-slider-internal-content-start-min-height),auto) var(--arcgis-slider-internal-track-size) var(--arcgis-slider-internal-handle-offset) calc(var(--arcgis-slider-internal-range-labels-placement-end) * var(--arcgis-slider-internal-label-input-height)) minmax(var(--arcgis-slider-internal-content-end-min-height),auto);column-gap:var(--arcgis-slider-internal-handle-offset)}.track{flex:1;height:var(--arcgis-slider-internal-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:calc(var(--arcgis-slider-internal-label-input-margin) + var(--arcgis-slider-internal-range-labels-placement-end) * (var(--arcgis-slider-internal-label-input-height)))}}.min,.max{--arcgis-slider-internal-range-translation: calc(var(--arcgis-slider-internal-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}.max{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}}&:host([mirrored]){.min{grid-column:3;transform:translate(var(--arcgis-slider-internal-range-translation))}.max{grid-column:1;transform:translate(calc(var(--arcgis-slider-internal-range-translation) * -1))}}}`;
|
|
54
|
+
var fe = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, W = (n) => {
|
|
55
|
+
throw TypeError(n);
|
|
56
|
+
}, D = (n, e, t, a) => {
|
|
57
|
+
for (var i = a > 1 ? void 0 : a ? pe(e, t) : e, r = n.length - 1, o; r >= 0; r--)
|
|
58
|
+
(o = n[r]) && (i = (a ? o(e, t, i) : o(i)) || i);
|
|
59
|
+
return a && i && fe(e, t, i), i;
|
|
60
|
+
}, G = (n, e, t) => e.has(n) || W("Cannot " + t), ve = (n, e, t) => (G(n, e, "read from private field"), e.get(n)), be = (n, e, t) => e.has(n) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), _e = (n, e, t, a) => (G(n, e, "write to private field"), e.set(n, t), t), F;
|
|
61
|
+
function xe() {
|
|
60
62
|
return {
|
|
61
63
|
min: 0,
|
|
62
64
|
max: 100,
|
|
63
65
|
values: []
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
|
-
let
|
|
68
|
+
let w = class extends oe {
|
|
67
69
|
//--------------------------------------------------------------------------
|
|
68
70
|
//
|
|
69
71
|
// Lifecycle
|
|
70
72
|
//
|
|
71
73
|
//--------------------------------------------------------------------------
|
|
72
74
|
constructor(n = {}) {
|
|
73
|
-
super({ ...
|
|
75
|
+
super({ ...xe(), properties: n }), this._entries = /* @__PURE__ */ new Map(), this.precision = 4, this.ready = !1, be(this, F);
|
|
74
76
|
}
|
|
75
77
|
startup() {
|
|
76
78
|
const { precision: n } = this;
|
|
77
79
|
let { min: e, max: t, values: a } = this;
|
|
78
|
-
t =
|
|
79
|
-
const i = new Map(a?.map((r) => [
|
|
80
|
-
this._entries = i,
|
|
80
|
+
t = x(t, n), e = x(e, n), a = a?.map((r) => T(x(r, n), e, t)).sort((r, o) => r - o), this._set("min", e), this._set("max", t), this._set("values", a);
|
|
81
|
+
const i = new Map(a?.map((r) => [K(), r]));
|
|
82
|
+
this._entries = i, A(
|
|
81
83
|
() => this.min,
|
|
82
84
|
(r) => {
|
|
83
|
-
const
|
|
84
|
-
r != null &&
|
|
85
|
-
s < r && this._entries.set(
|
|
85
|
+
const o = this.values;
|
|
86
|
+
r != null && o?.length && o.some((s) => s < r) && (this._entries.forEach((s, l) => {
|
|
87
|
+
s < r && this._entries.set(l, r);
|
|
86
88
|
}), this._updatesValues());
|
|
87
89
|
},
|
|
88
90
|
{ sync: !0 }
|
|
89
|
-
),
|
|
91
|
+
), A(
|
|
90
92
|
() => this.max,
|
|
91
93
|
(r) => {
|
|
92
|
-
const
|
|
93
|
-
r != null &&
|
|
94
|
-
s > r && this._entries.set(
|
|
94
|
+
const o = this.values;
|
|
95
|
+
r != null && o?.length && o.some((s) => s > r) && (this._entries.forEach((s, l) => {
|
|
96
|
+
s > r && this._entries.set(l, r);
|
|
95
97
|
}), this._updatesValues());
|
|
96
98
|
},
|
|
97
99
|
{ sync: !0 }
|
|
98
|
-
),
|
|
100
|
+
), A(
|
|
99
101
|
() => this.precision,
|
|
100
102
|
(r) => {
|
|
101
|
-
const { min:
|
|
102
|
-
this._set("min",
|
|
103
|
-
this._entries.set(d,
|
|
103
|
+
const { min: o, max: s, values: l } = this;
|
|
104
|
+
this._set("min", x(o, r)), this._set("max", x(s, r)), l?.length && (this._entries.forEach((c, d) => {
|
|
105
|
+
this._entries.set(d, x(c, r));
|
|
104
106
|
}), this._updatesValues());
|
|
105
107
|
},
|
|
106
108
|
{ sync: !0 }
|
|
@@ -114,7 +116,7 @@ let x = class extends ie {
|
|
|
114
116
|
this._set("max", n);
|
|
115
117
|
return;
|
|
116
118
|
}
|
|
117
|
-
const e = this._get("max"), t =
|
|
119
|
+
const e = this._get("max"), t = x(n, this.precision);
|
|
118
120
|
e !== t && this._set("max", t);
|
|
119
121
|
}
|
|
120
122
|
set min(n) {
|
|
@@ -122,18 +124,20 @@ let x = class extends ie {
|
|
|
122
124
|
this._set("min", n);
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
const e = this._get("min"), t =
|
|
127
|
+
const e = this._get("min"), t = x(n, this.precision);
|
|
126
128
|
e !== t && this._set("min", t);
|
|
127
129
|
}
|
|
128
130
|
set values(n) {
|
|
129
|
-
if (
|
|
131
|
+
if (ve(this, F) === n)
|
|
132
|
+
return;
|
|
133
|
+
if (_e(this, F, n), !this.ready) {
|
|
130
134
|
this._set("values", n);
|
|
131
135
|
return;
|
|
132
136
|
}
|
|
133
137
|
const e = this._get("values");
|
|
134
|
-
if (n = n?.map((a) =>
|
|
138
|
+
if (n = n?.map((a) => T(x(a, this.precision), this.min, this.max)).sort((a, i) => a - i), e && n && e.length === n.length && e.every((a, i) => a === n[i]))
|
|
135
139
|
return;
|
|
136
|
-
const t = new Map(n?.map((a) => [
|
|
140
|
+
const t = new Map(n?.map((a) => [K(), a]));
|
|
137
141
|
this._entries = t, this._set("values", n);
|
|
138
142
|
}
|
|
139
143
|
//--------------------------------------------------------------------------
|
|
@@ -154,7 +158,7 @@ let x = class extends ie {
|
|
|
154
158
|
setValue(n, e) {
|
|
155
159
|
if (this.values == null)
|
|
156
160
|
return !1;
|
|
157
|
-
const { min: t, max: a } = this, i = this._entries.get(n), r =
|
|
161
|
+
const { min: t, max: a } = this, i = this._entries.get(n), r = T(x(e, this.precision), t, a);
|
|
158
162
|
return i === r ? !1 : (this._entries.set(n, r), this._updatesValues(), !0);
|
|
159
163
|
}
|
|
160
164
|
setValues(n) {
|
|
@@ -163,8 +167,8 @@ let x = class extends ie {
|
|
|
163
167
|
let e = !1;
|
|
164
168
|
const { min: t, max: a } = this;
|
|
165
169
|
for (const [i, r] of n) {
|
|
166
|
-
const
|
|
167
|
-
|
|
170
|
+
const o = this._entries.get(i), s = T(x(r, this.precision), t, a);
|
|
171
|
+
o !== s && (e = !0, this._entries.set(i, s));
|
|
168
172
|
}
|
|
169
173
|
return e ? (this._updatesValues(), !0) : !1;
|
|
170
174
|
}
|
|
@@ -173,276 +177,317 @@ let x = class extends ie {
|
|
|
173
177
|
this._set("values", n);
|
|
174
178
|
}
|
|
175
179
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
w
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
w
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
w
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
w
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
w
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
w
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
180
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
181
|
+
D([
|
|
182
|
+
I()
|
|
183
|
+
], w.prototype, "_entries", 2);
|
|
184
|
+
D([
|
|
185
|
+
I({ readOnly: !0 })
|
|
186
|
+
], w.prototype, "entries", 1);
|
|
187
|
+
D([
|
|
188
|
+
I()
|
|
189
|
+
], w.prototype, "max", 1);
|
|
190
|
+
D([
|
|
191
|
+
I()
|
|
192
|
+
], w.prototype, "min", 1);
|
|
193
|
+
D([
|
|
194
|
+
I({ cast: (n) => T(n, 0, 20) })
|
|
195
|
+
], w.prototype, "precision", 2);
|
|
196
|
+
D([
|
|
197
|
+
I({ readOnly: !0 })
|
|
198
|
+
], w.prototype, "ready", 2);
|
|
199
|
+
D([
|
|
200
|
+
I()
|
|
201
|
+
], w.prototype, "values", 1);
|
|
202
|
+
w = D([
|
|
203
|
+
ce("esri.widgets.Slider.SliderData")
|
|
204
|
+
], w);
|
|
205
|
+
function T(n, e, t) {
|
|
201
206
|
return Math.min(Math.max(n, e), t);
|
|
202
207
|
}
|
|
203
|
-
function
|
|
208
|
+
function x(n, e) {
|
|
204
209
|
return Number.parseFloat(n.toFixed(e));
|
|
205
210
|
}
|
|
206
|
-
class
|
|
211
|
+
class ye {
|
|
207
212
|
constructor(e) {
|
|
208
213
|
this.steps = e, this.minIndex = 0, this.maxIndex = this.steps.length - 1;
|
|
209
214
|
}
|
|
210
215
|
indexToValue(e) {
|
|
211
|
-
return this.steps[
|
|
216
|
+
return this.steps[k(e, this.minIndex, this.maxIndex)];
|
|
212
217
|
}
|
|
213
218
|
valueToIndex(e) {
|
|
214
219
|
const t = this.steps.indexOf(e);
|
|
215
220
|
return t !== -1 ? t : this.steps.reduce(
|
|
216
|
-
(a, i, r,
|
|
221
|
+
(a, i, r, o) => Math.abs(i - e) < Math.abs(o[a] - e) ? r : a,
|
|
222
|
+
0
|
|
217
223
|
);
|
|
218
224
|
}
|
|
225
|
+
getClosestStepDistances(e, t) {
|
|
226
|
+
if (t <= 0)
|
|
227
|
+
return [];
|
|
228
|
+
const a = [];
|
|
229
|
+
for (let i = this.minIndex; i <= this.maxIndex; i++) {
|
|
230
|
+
const r = this.indexToValue(i), o = Math.abs(r - e);
|
|
231
|
+
let s = !1;
|
|
232
|
+
for (let l = 0; l < a.length; l++)
|
|
233
|
+
if (o < a[l].dist) {
|
|
234
|
+
a.splice(l, 0, { idx: i, value: r, dist: o }), s = !0;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
!s && a.length < t && a.push({ idx: i, value: r, dist: o }), a.length > t && (a.length = t);
|
|
238
|
+
}
|
|
239
|
+
return a;
|
|
240
|
+
}
|
|
219
241
|
}
|
|
220
|
-
class
|
|
242
|
+
class we {
|
|
221
243
|
constructor(e, t, a) {
|
|
222
244
|
this.min = e, this.max = t, this.stepSize = a, this.minIndex = 0, this.maxIndex = Math.round((this.max - this.min) / this.stepSize);
|
|
223
245
|
}
|
|
224
246
|
indexToValue(e) {
|
|
225
|
-
return this.min +
|
|
247
|
+
return this.min + k(e, this.minIndex, this.maxIndex) * this.stepSize;
|
|
226
248
|
}
|
|
227
249
|
valueToIndex(e) {
|
|
228
|
-
return e =
|
|
250
|
+
return e = k(e, this.min, this.max), Math.round((e - this.min) / this.stepSize);
|
|
251
|
+
}
|
|
252
|
+
getClosestStepDistances(e, t) {
|
|
253
|
+
if (t <= 0)
|
|
254
|
+
return [];
|
|
255
|
+
const a = [], i = this.minIndex, r = this.maxIndex, s = (k(e, this.min, this.max) - this.min) / this.stepSize;
|
|
256
|
+
let l = Math.floor(s), c = l + 1;
|
|
257
|
+
for (; a.length < t && (l >= i || c <= r); ) {
|
|
258
|
+
if (l < i) {
|
|
259
|
+
const u = this.indexToValue(c);
|
|
260
|
+
a.push({ idx: c, value: u, dist: Math.abs(u - e) }), c++;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (c > r) {
|
|
264
|
+
const u = this.indexToValue(l);
|
|
265
|
+
a.push({ idx: l, value: u, dist: Math.abs(u - e) }), l--;
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
const d = this.indexToValue(l), h = this.indexToValue(c), g = Math.abs(d - e), f = Math.abs(h - e);
|
|
269
|
+
g <= f ? (a.push({ idx: l, value: d, dist: g }), l--) : (a.push({ idx: c, value: h, dist: f }), c++);
|
|
270
|
+
}
|
|
271
|
+
return a;
|
|
229
272
|
}
|
|
230
273
|
}
|
|
231
|
-
function
|
|
274
|
+
function ke(n) {
|
|
232
275
|
if (n.steps == null)
|
|
233
276
|
return null;
|
|
234
277
|
const e = n.steps;
|
|
235
|
-
return Array.isArray(e) ? e.length === 0 ? null : new
|
|
278
|
+
return Array.isArray(e) ? e.length === 0 ? null : new ye(e) : e <= 0 ? null : new we(n.min, n.max, e);
|
|
236
279
|
}
|
|
237
|
-
function
|
|
280
|
+
function De(n, e, t) {
|
|
238
281
|
if (n == null) {
|
|
239
282
|
const s = /* @__PURE__ */ new Map();
|
|
240
|
-
for (const [
|
|
241
|
-
s.set(
|
|
283
|
+
for (const [l, c] of e.entries())
|
|
284
|
+
s.set(l, c + t);
|
|
242
285
|
return s;
|
|
243
286
|
}
|
|
244
|
-
const a = e.size, i = Array.from(e.entries()).map(([s,
|
|
245
|
-
const c =
|
|
246
|
-
for (let u = n.minIndex; u <= n.maxIndex; u++) {
|
|
247
|
-
const h = n.indexToValue(u), f = Math.abs(h - c);
|
|
248
|
-
let p = !1;
|
|
249
|
-
for (let v = 0; v < d.length; v++)
|
|
250
|
-
if (f < d[v].dist) {
|
|
251
|
-
d.splice(v, 0, { idx: u, value: h, dist: f }), p = !0;
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
!p && d.length < a && d.push({ idx: u, value: h, dist: f }), d.length > a && (d.length = a);
|
|
255
|
-
}
|
|
287
|
+
const a = e.size, i = Array.from(e.entries()).map(([s, l]) => {
|
|
288
|
+
const c = l + t, d = n.getClosestStepDistances(c, a);
|
|
256
289
|
return { uuid: s, stepDistances: d };
|
|
257
|
-
}), r = /* @__PURE__ */ new Set(),
|
|
258
|
-
i.sort((s,
|
|
290
|
+
}), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
291
|
+
i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
|
|
259
292
|
for (const s of i) {
|
|
260
|
-
const
|
|
261
|
-
|
|
293
|
+
const l = s.stepDistances.find((c) => !r.has(c.idx));
|
|
294
|
+
l ? (r.add(l.idx), o.set(s.uuid, l.value)) : o.set(s.uuid, e.get(s.uuid));
|
|
262
295
|
}
|
|
263
|
-
return
|
|
296
|
+
return o;
|
|
264
297
|
}
|
|
265
|
-
function
|
|
298
|
+
function X(n, e, t, a, i) {
|
|
266
299
|
const r = e.get(t) ?? 0;
|
|
267
300
|
if (!n)
|
|
268
301
|
return r + a;
|
|
269
|
-
const
|
|
302
|
+
const o = r + a, s = n.minIndex, l = n.maxIndex, c = /* @__PURE__ */ new Set();
|
|
270
303
|
if (!i)
|
|
271
|
-
for (const [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
304
|
+
for (const [u, v] of e.entries())
|
|
305
|
+
u !== t && c.add(n.valueToIndex(v));
|
|
306
|
+
const d = k(n.valueToIndex(o), s, l);
|
|
307
|
+
if (!c.has(d))
|
|
308
|
+
return n.indexToValue(d);
|
|
309
|
+
let h = null, g = 1 / 0;
|
|
310
|
+
const f = Math.min(Math.max(d - s, l - d), c.size + 1);
|
|
311
|
+
for (let u = 1; u <= f; u++) {
|
|
312
|
+
const v = d - u;
|
|
313
|
+
if (v >= s && !c.has(v)) {
|
|
314
|
+
const m = n.indexToValue(v), b = Math.abs(m - o);
|
|
315
|
+
h = v, g = b;
|
|
316
|
+
}
|
|
317
|
+
const _ = d + u;
|
|
318
|
+
if (_ <= l && !c.has(_)) {
|
|
319
|
+
const m = n.indexToValue(_), b = Math.abs(m - o);
|
|
320
|
+
(h == null || b < g) && (h = _, g = b);
|
|
321
|
+
}
|
|
322
|
+
if (h != null)
|
|
323
|
+
return n.indexToValue(h);
|
|
324
|
+
}
|
|
325
|
+
return h == null ? r : n.indexToValue(h);
|
|
326
|
+
}
|
|
327
|
+
function Ie(n, e, t, a = 1) {
|
|
328
|
+
const i = J(a);
|
|
329
|
+
let r = e, o = !1;
|
|
285
330
|
for (let s = 0; s < i; s++) {
|
|
286
|
-
const
|
|
287
|
-
if (
|
|
331
|
+
const l = Ve(n, r, t);
|
|
332
|
+
if (o ||= l.changed, r = l.entries, !l.changed)
|
|
288
333
|
break;
|
|
289
334
|
}
|
|
290
|
-
return { changed:
|
|
335
|
+
return { changed: o, entries: r };
|
|
291
336
|
}
|
|
292
|
-
function
|
|
293
|
-
const r =
|
|
337
|
+
function Ee(n, e, t, a, i = 1) {
|
|
338
|
+
const r = J(i);
|
|
294
339
|
if (r === 1)
|
|
295
|
-
return
|
|
296
|
-
const
|
|
297
|
-
let s =
|
|
298
|
-
for (let
|
|
299
|
-
const c =
|
|
340
|
+
return H(n, e, t, a);
|
|
341
|
+
const o = new Map(e);
|
|
342
|
+
let s = o.get(t);
|
|
343
|
+
for (let l = 0; l < r; l++) {
|
|
344
|
+
const c = H(n, o, t, a);
|
|
300
345
|
if (c === s)
|
|
301
346
|
break;
|
|
302
|
-
s = c,
|
|
347
|
+
s = c, o.set(t, s);
|
|
303
348
|
}
|
|
304
349
|
return s;
|
|
305
350
|
}
|
|
306
|
-
function
|
|
351
|
+
function J(n) {
|
|
307
352
|
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
308
353
|
return Math.max(1, e);
|
|
309
354
|
}
|
|
310
|
-
function
|
|
311
|
-
const a = /* @__PURE__ */ new Map(), i = t > 0 ?
|
|
312
|
-
let
|
|
313
|
-
for (const [
|
|
314
|
-
if (a.set(
|
|
315
|
-
const d =
|
|
316
|
-
c === d && (s = !1),
|
|
355
|
+
function Ve(n, e, t) {
|
|
356
|
+
const a = /* @__PURE__ */ new Map(), i = t > 0 ? Me : Y, r = Array.from(e).sort((l, c) => i(l[1], c[1]));
|
|
357
|
+
let o = !1, s = !0;
|
|
358
|
+
for (const [l, c] of r)
|
|
359
|
+
if (a.set(l, c), s) {
|
|
360
|
+
const d = H(n, a, l, t);
|
|
361
|
+
c === d && (s = !1), o ||= s, a.set(l, d);
|
|
317
362
|
}
|
|
318
|
-
return { changed:
|
|
363
|
+
return { changed: o, entries: a };
|
|
319
364
|
}
|
|
320
|
-
function
|
|
321
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution:
|
|
365
|
+
function H(n, e, t, a) {
|
|
366
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
|
|
322
367
|
if (a = a > 0 ? 1 : -1, !r) {
|
|
323
|
-
let
|
|
368
|
+
let m = k(c + a * o, s, l);
|
|
324
369
|
if (i)
|
|
325
|
-
return
|
|
326
|
-
const
|
|
327
|
-
for (const [
|
|
328
|
-
|
|
329
|
-
for (;
|
|
330
|
-
|
|
331
|
-
return
|
|
370
|
+
return m;
|
|
371
|
+
const b = /* @__PURE__ */ new Set();
|
|
372
|
+
for (const [C, M] of e)
|
|
373
|
+
C !== t && b.add(M);
|
|
374
|
+
for (; b.has(m) && m <= l && m >= s; )
|
|
375
|
+
m = k(m + a * o, s, l);
|
|
376
|
+
return b.has(m) || m > l || m < s ? c : m;
|
|
332
377
|
}
|
|
333
378
|
const d = r.valueToIndex(c);
|
|
334
379
|
if (d === -1)
|
|
335
380
|
return c;
|
|
336
381
|
if (i) {
|
|
337
|
-
const
|
|
338
|
-
return r.indexToValue(
|
|
339
|
-
}
|
|
340
|
-
const
|
|
341
|
-
for (const [
|
|
342
|
-
|
|
343
|
-
let
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
for (;
|
|
347
|
-
if (!
|
|
382
|
+
const m = k(d + a, r.minIndex, r.maxIndex);
|
|
383
|
+
return r.indexToValue(m);
|
|
384
|
+
}
|
|
385
|
+
const h = /* @__PURE__ */ new Set();
|
|
386
|
+
for (const [m, b] of e)
|
|
387
|
+
m !== t && h.add(r.valueToIndex(b));
|
|
388
|
+
let g = d, f = !1;
|
|
389
|
+
const u = r.minIndex, v = r.maxIndex;
|
|
390
|
+
let _ = 0;
|
|
391
|
+
for (; _ < Math.abs(v - u) && (g += a, !(g < u || g > v)); ) {
|
|
392
|
+
if (!h.has(g)) {
|
|
348
393
|
f = !0;
|
|
349
394
|
break;
|
|
350
395
|
}
|
|
351
|
-
|
|
396
|
+
_++;
|
|
352
397
|
}
|
|
353
|
-
return f ? r.indexToValue(
|
|
398
|
+
return f ? r.indexToValue(g) : c;
|
|
354
399
|
}
|
|
355
|
-
function
|
|
356
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution:
|
|
400
|
+
function Te(n, e, t, a) {
|
|
401
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
|
|
357
402
|
if (a = a > 0 ? 1 : -1, !r) {
|
|
358
403
|
const f = new Set(
|
|
359
404
|
Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
|
|
360
405
|
);
|
|
361
|
-
let
|
|
406
|
+
let u = a > 0 ? l : s;
|
|
362
407
|
if (i)
|
|
363
|
-
return
|
|
364
|
-
for (; f.has(
|
|
365
|
-
if (
|
|
366
|
-
|
|
408
|
+
return u;
|
|
409
|
+
for (; f.has(u); )
|
|
410
|
+
if (u -= a * o, a > 0 && u > l || a < 0 && u < s) {
|
|
411
|
+
u = c;
|
|
367
412
|
break;
|
|
368
413
|
}
|
|
369
|
-
return
|
|
414
|
+
return u;
|
|
370
415
|
}
|
|
371
416
|
if (i)
|
|
372
417
|
return a > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
|
|
373
418
|
const d = r.valueToIndex(c);
|
|
374
419
|
if (d === -1)
|
|
375
420
|
return c;
|
|
376
|
-
const
|
|
421
|
+
const h = new Set(
|
|
377
422
|
Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
|
|
378
423
|
);
|
|
379
|
-
let
|
|
380
|
-
for (;
|
|
381
|
-
if (
|
|
382
|
-
|
|
424
|
+
let g = a > 0 ? r.maxIndex : r.minIndex;
|
|
425
|
+
for (; h.has(g); )
|
|
426
|
+
if (g -= a, a > 0 && g > l || a < 0 && g < s) {
|
|
427
|
+
g = d;
|
|
383
428
|
break;
|
|
384
429
|
}
|
|
385
|
-
return r.indexToValue(
|
|
430
|
+
return r.indexToValue(g);
|
|
386
431
|
}
|
|
387
|
-
function
|
|
388
|
-
const { stepsProvider: a, min: i, max: r } = n,
|
|
432
|
+
function Ce(n, e, t) {
|
|
433
|
+
const { stepsProvider: a, min: i, max: r } = n, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, d) => Y(c[1], d[1]));
|
|
389
434
|
if (a) {
|
|
390
435
|
let c = 0;
|
|
391
436
|
if (t > 0) {
|
|
392
|
-
const d = s[s.length - 1],
|
|
393
|
-
c = a.maxIndex -
|
|
437
|
+
const d = s[s.length - 1], h = a.valueToIndex(d[1]);
|
|
438
|
+
c = a.maxIndex - h;
|
|
394
439
|
} else {
|
|
395
|
-
const d = s[0],
|
|
396
|
-
c = a.minIndex -
|
|
440
|
+
const d = s[0], h = a.valueToIndex(d[1]);
|
|
441
|
+
c = a.minIndex - h;
|
|
397
442
|
}
|
|
398
443
|
if (c === 0)
|
|
399
|
-
for (const [d,
|
|
400
|
-
|
|
401
|
-
for (const [d,
|
|
402
|
-
const
|
|
403
|
-
|
|
444
|
+
for (const [d, h] of s)
|
|
445
|
+
o.set(d, h);
|
|
446
|
+
for (const [d, h] of s) {
|
|
447
|
+
const g = a.indexToValue(a.valueToIndex(h) + c);
|
|
448
|
+
o.set(d, g);
|
|
404
449
|
}
|
|
405
|
-
return
|
|
450
|
+
return o;
|
|
406
451
|
}
|
|
407
|
-
let
|
|
452
|
+
let l = 0;
|
|
408
453
|
if (t > 0) {
|
|
409
454
|
const c = s[s.length - 1];
|
|
410
|
-
|
|
455
|
+
l = r - c[1];
|
|
411
456
|
} else {
|
|
412
457
|
const c = s[0];
|
|
413
|
-
|
|
458
|
+
l = i - c[1];
|
|
414
459
|
}
|
|
415
460
|
for (const [c, d] of s)
|
|
416
|
-
|
|
417
|
-
return
|
|
461
|
+
o.set(c, d + l);
|
|
462
|
+
return o;
|
|
418
463
|
}
|
|
419
|
-
function
|
|
464
|
+
function Y(n, e) {
|
|
420
465
|
return n - e;
|
|
421
466
|
}
|
|
422
|
-
function
|
|
467
|
+
function Me(n, e) {
|
|
423
468
|
return e - n;
|
|
424
469
|
}
|
|
425
|
-
function
|
|
470
|
+
function k(n, e, t) {
|
|
426
471
|
return Math.max(e, Math.min(t, n));
|
|
427
472
|
}
|
|
428
|
-
const
|
|
429
|
-
class
|
|
473
|
+
const $e = te(w);
|
|
474
|
+
class Pe extends ee {
|
|
430
475
|
constructor() {
|
|
431
|
-
super(...arguments), this._popoverElement =
|
|
476
|
+
super(...arguments), this._stepsProvider = null, this._popoverElement = B(), this._trackElement = B(), this.messages = se({}), this._onPointerMoveDragUpdate = (e) => {
|
|
432
477
|
this._updateDrag(this._mapEventToRange(e));
|
|
433
478
|
}, this._onPointerUpDragEnd = (e) => {
|
|
434
|
-
|
|
479
|
+
S(e) && this._endDrag();
|
|
435
480
|
}, this._onPointerCancelDragEnd = () => {
|
|
436
481
|
this._endDrag();
|
|
437
482
|
}, this._formatLabel = (e, t, a) => {
|
|
438
|
-
const i =
|
|
483
|
+
const i = le(this.messages._lang, t), r = this.labelFormatter;
|
|
439
484
|
if (!r)
|
|
440
485
|
return i.format(a);
|
|
441
|
-
const
|
|
442
|
-
return
|
|
486
|
+
const o = r(a, e, (s) => i.format(s));
|
|
487
|
+
return o ?? i.format(a);
|
|
443
488
|
}, this._numberFormatOptions = {}, this._createFormatter = (e, t) => this._formatLabel.bind(this, e, t), this._minFormatter = this._createFormatter("min", this._numberFormatOptions), this._maxFormatter = this._createFormatter("max", this._numberFormatOptions), this._valueFormatter = this._createFormatter("value", this._numberFormatOptions), this._resizeObserver = new ResizeObserver(() => {
|
|
444
489
|
this._layoutLabelInputs();
|
|
445
|
-
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._sliderData =
|
|
490
|
+
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._activePart = null, this._sliderData = $e(this), this.allowValuesOverlap = !1, this.autoDestroyDisabled = !1, this.disabled = !1, this.fillPlacement = "start", this.layout = "horizontal", this.max = this._sliderData.max, this.min = this._sliderData.min, this.mirrored = !1, this.popoverLabel = "", this.popoverPlacement = "start", this.precision = this._sliderData.precision, this.rangeLabelsEditingEnabled = !1, this.rangeLabelsPlacement = "center", this.segmentsDraggingDisabled = !1, this.showRangeLabels = !1, this.valueLabelsDisplay = "hidden", this.valueLabelsPlacement = "start", this.valueLabelsEditingEnabled = !1, this.keyboardLargeStep = 10, this.values = this._sliderData.values, this.arcgisActiveValueChange = $({ cancelable: !1 }), this.arcgisChange = $({ cancelable: !1 }), this.arcgisInput = $({ cancelable: !1 }), this.arcgisRangeChange = $({ cancelable: !1 });
|
|
446
491
|
}
|
|
447
492
|
static {
|
|
448
493
|
this.properties = { _dragInfo: 16, _hasPopoverContent: 16, _hasContentStart: 16, _hasContentEnd: 16, _activePart: 16, _sliderData: 16, activeValue: 32, allowValuesOverlap: 5, autoDestroyDisabled: 5, disabled: 7, fullRangeMax: 11, fullRangeMin: 11, fillPlacement: 1, labelFormatter: 0, layout: 3, max: 11, min: 11, mirrored: 7, popoverLabel: 1, popoverPlacement: 3, precision: 11, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 3, segmentsDraggingDisabled: 5, showRangeLabels: 7, steps: [9, { converter: {
|
|
@@ -459,7 +504,7 @@ class Ee extends Y {
|
|
|
459
504
|
} }], messageOverrides: 0 };
|
|
460
505
|
}
|
|
461
506
|
static {
|
|
462
|
-
this.styles =
|
|
507
|
+
this.styles = me;
|
|
463
508
|
}
|
|
464
509
|
static {
|
|
465
510
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -502,7 +547,7 @@ class Ee extends Y {
|
|
|
502
547
|
this._sliderData.startup();
|
|
503
548
|
}
|
|
504
549
|
willUpdate(e) {
|
|
505
|
-
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider =
|
|
550
|
+
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider = ke(this)), e.has("messages") || e.has("min") || e.has("max") || e.has("precision") || e.has("labelFormatter")) {
|
|
506
551
|
const t = this.max != null && this.min != null && this.max - this.min > 10 ? 2 : this.precision;
|
|
507
552
|
this._numberFormatOptions = { maximumFractionDigits: t }, this._minFormatter = this._createFormatter("min", this._numberFormatOptions), this._maxFormatter = this._createFormatter("max", this._numberFormatOptions), this._valueFormatter = this._createFormatter("value", this._numberFormatOptions);
|
|
508
553
|
}
|
|
@@ -536,15 +581,15 @@ class Ee extends Y {
|
|
|
536
581
|
return;
|
|
537
582
|
const i = a.getBoundingClientRect();
|
|
538
583
|
for (const r of this._sliderData.entries.keys()) {
|
|
539
|
-
const
|
|
540
|
-
if (this.valueLabelsDisplay === "always" ||
|
|
541
|
-
const
|
|
542
|
-
if (!
|
|
584
|
+
const o = this._activePart === "range" || this._activePart === r;
|
|
585
|
+
if (this.valueLabelsDisplay === "always" || o) {
|
|
586
|
+
const l = Le(this, r), c = q(this, r);
|
|
587
|
+
if (!l || !c)
|
|
543
588
|
continue;
|
|
544
|
-
const d =
|
|
545
|
-
let
|
|
546
|
-
const
|
|
547
|
-
|
|
589
|
+
const d = l.getBoundingClientRect(), h = c.getBoundingClientRect(), g = c.getLabelBoundingClientRect(), f = d.width / 2, u = Math.round(d.left + f), v = Math.round(g.width / 2);
|
|
590
|
+
let _ = h.width / 2;
|
|
591
|
+
const m = i.left - f, b = i.right + f, C = u - v, M = u + v;
|
|
592
|
+
C < m ? _ += C - m : M > b && (_ += M - b), c.style.transform = `translateX(${-Math.round(_)}px)`;
|
|
548
593
|
}
|
|
549
594
|
}
|
|
550
595
|
}
|
|
@@ -555,10 +600,10 @@ class Ee extends Y {
|
|
|
555
600
|
this._setActivePart(null);
|
|
556
601
|
}
|
|
557
602
|
_onTrackRangePointerDown(e) {
|
|
558
|
-
this._disabledOrInvalid || !
|
|
603
|
+
this._disabledOrInvalid || !S(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
|
|
559
604
|
}
|
|
560
605
|
async _onPointerDown(e) {
|
|
561
|
-
if (this._disabledOrInvalid || !
|
|
606
|
+
if (this._disabledOrInvalid || !S(e))
|
|
562
607
|
return;
|
|
563
608
|
const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
|
|
564
609
|
if (e.target === t)
|
|
@@ -567,19 +612,19 @@ class Ee extends Y {
|
|
|
567
612
|
t.blur(), this._focusEntry(V(t));
|
|
568
613
|
return;
|
|
569
614
|
}
|
|
570
|
-
if (
|
|
615
|
+
if (Se(e.target) || this.values?.length > 1)
|
|
571
616
|
return;
|
|
572
|
-
const a = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value,
|
|
617
|
+
const a = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value, o = a * this._fullRange + this._fullMin - r, s = z(this._fullMin, this._fullMax, r) / 100;
|
|
573
618
|
this._startDrag(i, s);
|
|
574
|
-
const
|
|
575
|
-
this._setValue(i,
|
|
619
|
+
const l = X(this._stepsProvider, this._sliderData.entries, i, o, this.allowValuesOverlap);
|
|
620
|
+
this._setValue(i, l), this._focusEntry(i);
|
|
576
621
|
}
|
|
577
622
|
_onThumbPointerDown(e) {
|
|
578
623
|
const t = V(e.currentTarget);
|
|
579
|
-
if (!
|
|
624
|
+
if (!S(e) || this._disabledOrInvalid || !t)
|
|
580
625
|
return;
|
|
581
|
-
const a =
|
|
582
|
-
e.target === a && a?.editing || (e.stopPropagation(), this._startDrag(t, this._mapEventToRange(e)));
|
|
626
|
+
const a = q(this, t);
|
|
627
|
+
e.target === a && a?.editing || (e.stopPropagation(), e.preventDefault(), this._focusEntry(t), this._startDrag(t, this._mapEventToRange(e)));
|
|
583
628
|
}
|
|
584
629
|
_endDrag() {
|
|
585
630
|
if (this._disabledOrInvalid)
|
|
@@ -600,37 +645,37 @@ class Ee extends Y {
|
|
|
600
645
|
if (this._disabledOrInvalid)
|
|
601
646
|
return;
|
|
602
647
|
const { min: a, max: i, values: r } = this;
|
|
603
|
-
let
|
|
648
|
+
let o = a, s = i;
|
|
604
649
|
if (this._setActivePart(e), e === "range") {
|
|
605
650
|
if (this.segmentsDraggingDisabled)
|
|
606
651
|
return;
|
|
607
|
-
|
|
652
|
+
o = a - r[0], s = i - r[r.length - 1];
|
|
608
653
|
}
|
|
609
654
|
this._dragInfo = {
|
|
610
655
|
position: t,
|
|
611
656
|
entries: new Map(this._sliderData.entries.entries()),
|
|
612
|
-
minDiff:
|
|
657
|
+
minDiff: o,
|
|
613
658
|
maxDiff: s
|
|
614
659
|
}, this._addDragListeners();
|
|
615
660
|
}
|
|
616
661
|
_updateDrag(e) {
|
|
617
662
|
if (!this._dragInfo || !this._activePart)
|
|
618
663
|
return;
|
|
619
|
-
const { _activePart: t, _dragInfo: { position: a, entries: i, minDiff: r, maxDiff:
|
|
664
|
+
const { _activePart: t, _dragInfo: { position: a, entries: i, minDiff: r, maxDiff: o } } = this;
|
|
620
665
|
if (a === e)
|
|
621
666
|
return;
|
|
622
667
|
let s = (e - a) * this._fullRange;
|
|
623
668
|
if (t === "range") {
|
|
624
|
-
s = Math.min(
|
|
625
|
-
const
|
|
626
|
-
this._setValues(
|
|
669
|
+
s = Math.min(o, Math.max(r, s));
|
|
670
|
+
const l = De(this._stepsProvider, i, s);
|
|
671
|
+
this._setValues(l);
|
|
627
672
|
} else {
|
|
628
|
-
const
|
|
629
|
-
this._setValue(t,
|
|
673
|
+
const l = X(this._stepsProvider, i, t, s, this.allowValuesOverlap);
|
|
674
|
+
this._setValue(t, l);
|
|
630
675
|
}
|
|
631
676
|
}
|
|
632
677
|
_focusEntry(e) {
|
|
633
|
-
e &&
|
|
678
|
+
e && Fe(this, e)?.focus();
|
|
634
679
|
}
|
|
635
680
|
_addDragListeners() {
|
|
636
681
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -678,19 +723,19 @@ class Ee extends Y {
|
|
|
678
723
|
return this.mirrored ? 1 - a : a;
|
|
679
724
|
}
|
|
680
725
|
_getPositionStyleForElement(e) {
|
|
681
|
-
const t =
|
|
726
|
+
const t = z(this._fullMin, this._fullMax, e);
|
|
682
727
|
return {
|
|
683
728
|
[this.isHorizontal ? this.mirrored ? "right" : "left" : this.mirrored ? "top" : "bottom"]: `${t}%`
|
|
684
729
|
};
|
|
685
730
|
}
|
|
686
731
|
_popoverSlotChange(e) {
|
|
687
|
-
this._hasPopoverContent =
|
|
732
|
+
this._hasPopoverContent = R(e);
|
|
688
733
|
}
|
|
689
734
|
_onContentStartSlotChange(e) {
|
|
690
|
-
this._hasContentStart =
|
|
735
|
+
this._hasContentStart = R(e);
|
|
691
736
|
}
|
|
692
737
|
_onContentEndSlotChange(e) {
|
|
693
|
-
this._hasContentEnd =
|
|
738
|
+
this._hasContentEnd = R(e);
|
|
694
739
|
}
|
|
695
740
|
_onThumbKeyDown(e) {
|
|
696
741
|
const t = V(e.currentTarget);
|
|
@@ -699,36 +744,36 @@ class Ee extends Y {
|
|
|
699
744
|
const a = e.currentTarget.querySelector("arcgis-label-input");
|
|
700
745
|
if (!a || a.editing)
|
|
701
746
|
return;
|
|
702
|
-
if (e.key ===
|
|
747
|
+
if (e.key === p.confirmEdit) {
|
|
703
748
|
a.edit();
|
|
704
749
|
return;
|
|
705
750
|
}
|
|
706
|
-
const i =
|
|
751
|
+
const i = N(e, this.keyboardLargeStep, this.mirrored);
|
|
707
752
|
if (i) {
|
|
708
753
|
e.preventDefault();
|
|
709
|
-
const r =
|
|
754
|
+
const r = Ee(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
|
|
710
755
|
this._setValue(t, r);
|
|
711
756
|
return;
|
|
712
757
|
}
|
|
713
|
-
if (
|
|
758
|
+
if (U(e.key)) {
|
|
714
759
|
e.preventDefault();
|
|
715
|
-
const r =
|
|
760
|
+
const r = Te(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
|
|
716
761
|
this._setValue(t, r);
|
|
717
762
|
}
|
|
718
763
|
}
|
|
719
764
|
_onTrackRangeKeyDown(e) {
|
|
720
765
|
if (this._disabledOrInvalid)
|
|
721
766
|
return;
|
|
722
|
-
const t =
|
|
767
|
+
const t = N(e, this.keyboardLargeStep, this.mirrored);
|
|
723
768
|
if (t) {
|
|
724
769
|
e.preventDefault();
|
|
725
|
-
const { entries: a } =
|
|
770
|
+
const { entries: a } = Ie(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
726
771
|
this._setValues(a);
|
|
727
772
|
return;
|
|
728
773
|
}
|
|
729
|
-
if (
|
|
774
|
+
if (U(e.key)) {
|
|
730
775
|
e.preventDefault();
|
|
731
|
-
const a =
|
|
776
|
+
const a = Ce(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
732
777
|
this._setValues(a);
|
|
733
778
|
}
|
|
734
779
|
}
|
|
@@ -742,51 +787,51 @@ class Ee extends Y {
|
|
|
742
787
|
};
|
|
743
788
|
}
|
|
744
789
|
_getDirectionForHomeEndKey(e) {
|
|
745
|
-
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e ===
|
|
790
|
+
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e === p.jumpToEnd ? -1 : 1 : e === p.jumpToStart ? -1 : 1;
|
|
746
791
|
}
|
|
747
792
|
_setActivePart(e) {
|
|
748
793
|
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
749
794
|
}
|
|
750
795
|
render() {
|
|
751
|
-
return
|
|
796
|
+
return y`<div class=${P({
|
|
752
797
|
content: !0,
|
|
753
798
|
disabled: this._disabledOrInvalid
|
|
754
799
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
755
800
|
}
|
|
756
801
|
_renderPopover() {
|
|
757
|
-
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel:
|
|
802
|
+
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: o } = this, s = e ? ze(e) ? e : "track-range" : "", l = this._hasPopoverContent && !!s, c = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
|
|
758
803
|
let d = 14;
|
|
759
|
-
return r !== "hidden" && a === i && (d += 24),
|
|
804
|
+
return r !== "hidden" && a === i && (d += 24), y`<calcite-popover flip-disabled focus-trap-disabled .label=${o} .open=${l} .offsetDistance=${d} .placement=${c} .referenceElement=${s} scale=s trigger-disabled ${O(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
760
805
|
}
|
|
761
806
|
_renderContentStart() {
|
|
762
|
-
return
|
|
807
|
+
return y`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
763
808
|
}
|
|
764
809
|
_renderContentEnd() {
|
|
765
|
-
return
|
|
810
|
+
return y`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`;
|
|
766
811
|
}
|
|
767
812
|
_renderTrackRange() {
|
|
768
|
-
return
|
|
813
|
+
return y`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`;
|
|
769
814
|
}
|
|
770
815
|
_renderTrack() {
|
|
771
|
-
return
|
|
816
|
+
return y`<div class="track" ${O(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
772
817
|
}
|
|
773
818
|
_renderTrackBackground() {
|
|
774
819
|
const { max: e, min: t, fillPlacement: a, values: i } = this, r = i.length > 1;
|
|
775
|
-
let
|
|
776
|
-
const
|
|
777
|
-
return this._invalid ?
|
|
820
|
+
let o = this._fullMin, s = this._fullMax;
|
|
821
|
+
const l = [];
|
|
822
|
+
return this._invalid ? y`<div class="segment track-bounds" style=${L({ left: "0%", right: "0%", top: "0%", bottom: "0%" })}></div>` : (o < t && (l.push(this._renderSegment(o, t, [
|
|
778
823
|
this.mirrored ? "track-effective-end" : "track-effective-start",
|
|
779
824
|
!r && a === "start" ? "track-fill" : null
|
|
780
|
-
])),
|
|
825
|
+
])), o = t), s > e && (l.push(this._renderSegment(e, s, [
|
|
781
826
|
this.mirrored ? "track-effective-start" : "track-effective-end",
|
|
782
827
|
!r && a === "end" ? "track-fill" : null
|
|
783
|
-
])), s = e),
|
|
828
|
+
])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
|
|
784
829
|
}
|
|
785
830
|
_renderFillSegment() {
|
|
786
831
|
const { values: e, fillPlacement: t, min: a, max: i } = this;
|
|
787
832
|
if (!e?.length || this._invalid)
|
|
788
833
|
return;
|
|
789
|
-
const r = [...e].sort((s,
|
|
834
|
+
const r = [...e].sort((s, l) => s - l);
|
|
790
835
|
if (r.length === 1)
|
|
791
836
|
switch (t) {
|
|
792
837
|
case "start":
|
|
@@ -798,80 +843,80 @@ class Ee extends Y {
|
|
|
798
843
|
return this._renderSegment(r[0], i, ["track-range"]);
|
|
799
844
|
break;
|
|
800
845
|
}
|
|
801
|
-
const
|
|
802
|
-
return this._renderSegment(r[0], r[r.length - 1], ["track-range",
|
|
846
|
+
const o = this.segmentsDraggingDisabled;
|
|
847
|
+
return this._renderSegment(r[0], r[r.length - 1], ["track-range", o ? null : "interactive", this._activePart === "range" ? "active" : null], {
|
|
803
848
|
id: "track-range",
|
|
804
|
-
onFocus:
|
|
805
|
-
onBlur:
|
|
806
|
-
onPointerDown:
|
|
807
|
-
onKeyDown:
|
|
849
|
+
onFocus: o ? void 0 : this._onTrackFocus,
|
|
850
|
+
onBlur: o ? void 0 : this._onTrackBlur,
|
|
851
|
+
onPointerDown: o ? void 0 : this._onTrackRangePointerDown,
|
|
852
|
+
onKeyDown: o ? void 0 : this._onTrackRangeKeyDown
|
|
808
853
|
});
|
|
809
854
|
}
|
|
810
855
|
_renderSegment(e, t, a, i) {
|
|
811
|
-
const { _fullMin: r, _fullMax:
|
|
812
|
-
|
|
813
|
-
100 -
|
|
856
|
+
const { _fullMin: r, _fullMax: o, mirrored: s } = this, l = [
|
|
857
|
+
z(r, o, j(e, r, o)),
|
|
858
|
+
100 - z(r, o, j(t, r, o))
|
|
814
859
|
];
|
|
815
|
-
s &&
|
|
860
|
+
s && l.reverse();
|
|
816
861
|
const c = this.isHorizontal ? {
|
|
817
|
-
left: `${
|
|
818
|
-
right: `${
|
|
862
|
+
left: `${l[0]}%`,
|
|
863
|
+
right: `${l[1]}%`
|
|
819
864
|
} : {
|
|
820
|
-
top: `${
|
|
821
|
-
bottom: `${
|
|
822
|
-
}, d =
|
|
823
|
-
return
|
|
865
|
+
top: `${l[1]}%`,
|
|
866
|
+
bottom: `${l[0]}%`
|
|
867
|
+
}, d = ae("segment", ...a);
|
|
868
|
+
return y`<div id=${i?.id ?? E} class=${P(d)} style=${L(c)} .tabIndex=${i?.onPointerDown ? 0 : -1} @focus=${i?.onFocus} @blur=${i?.onBlur} @pointerdown=${i?.onPointerDown} @keydown=${i?.onKeyDown}></div>`;
|
|
824
869
|
}
|
|
825
870
|
_renderThumbs() {
|
|
826
871
|
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, a]) => a >= this._fullMin && a <= this._fullMax);
|
|
827
|
-
return
|
|
872
|
+
return ie(t, ([a, i]) => this._renderThumb(a, i));
|
|
828
873
|
}
|
|
829
874
|
_renderThumb(e, t) {
|
|
830
|
-
const { valueLabelsDisplay: a } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range",
|
|
831
|
-
return
|
|
875
|
+
const { valueLabelsDisplay: a } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range", o = this._activePart === "range" || this._activePart === e, s = a === "always" || a === "auto" && o, l = this.isHorizontal, c = l ? "horizontal" : "vertical", d = `label-${e}`, h = l ? "center" : this.valueLabelsPlacement === "start" ? "end" : "start";
|
|
876
|
+
return Z(e, y`<div id=${e ?? E} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(a ? d : void 0) ?? E} .ariaOrientation=${c} .ariaValueMin=${this._minFormatter(this.min)} .ariaValueMax=${this._maxFormatter(this.max)} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${P({
|
|
832
877
|
thumb: !0,
|
|
833
878
|
active: r
|
|
834
|
-
})} data-entry=${e ??
|
|
879
|
+
})} data-entry=${e ?? E} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${L({
|
|
835
880
|
...this._getPositionStyleForElement(t),
|
|
836
881
|
"z-index": this._activePart === e ? 1 : 0
|
|
837
|
-
})} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${
|
|
882
|
+
})} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${h} class="label" .hidden=${!s} id=${d ?? E} .labelFormatter=${this._valueFormatter} @focus=${i ? void 0 : this._onThumbFocus} @blur=${i ? void 0 : this._onThumbBlur} @arcgisChange=${this._onValueInputChange} .readOnly=${!this.valueLabelsEditingEnabled} tabindex=-1 .value=${t} ${O(this._makeResizeRef())}></arcgis-label-input></div>`);
|
|
838
883
|
}
|
|
839
884
|
_renderRangeLabel(e) {
|
|
840
885
|
let t = "center";
|
|
841
|
-
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")),
|
|
886
|
+
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")), y`<arcgis-label-input .alignment=${t} class=${P(e)} data-type=${e ?? E} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`;
|
|
842
887
|
}
|
|
843
888
|
}
|
|
844
|
-
function
|
|
889
|
+
function Se(n) {
|
|
845
890
|
return "dataset" in n && n.tagName === "ARCGIS-LABEL-INPUT" && (n.dataset.type === "min" || n.dataset.type === "max");
|
|
846
891
|
}
|
|
847
892
|
function V(n) {
|
|
848
|
-
const e =
|
|
893
|
+
const e = ne(n, "[data-entry]");
|
|
849
894
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
850
895
|
}
|
|
851
|
-
function
|
|
896
|
+
function ze(n) {
|
|
852
897
|
return typeof n != null && n !== "range";
|
|
853
898
|
}
|
|
854
|
-
function
|
|
899
|
+
function Fe(n, e) {
|
|
855
900
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
856
901
|
}
|
|
857
|
-
function
|
|
902
|
+
function Le(n, e) {
|
|
858
903
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
859
904
|
}
|
|
860
|
-
function
|
|
905
|
+
function q(n, e) {
|
|
861
906
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
862
907
|
}
|
|
863
|
-
function
|
|
908
|
+
function S(n) {
|
|
864
909
|
return n.isPrimary && n.button === 0;
|
|
865
910
|
}
|
|
866
|
-
const
|
|
867
|
-
function
|
|
911
|
+
const Re = 5;
|
|
912
|
+
function z(n, e, t) {
|
|
868
913
|
const a = e - n, i = (t - n) / a * 100;
|
|
869
|
-
return Number.parseFloat(i.toFixed(
|
|
914
|
+
return Number.parseFloat(i.toFixed(Re));
|
|
870
915
|
}
|
|
871
|
-
function
|
|
916
|
+
function j(n, e, t) {
|
|
872
917
|
return Math.max(e, Math.min(t, n));
|
|
873
918
|
}
|
|
874
|
-
|
|
919
|
+
Q("arcgis-slider", Pe);
|
|
875
920
|
export {
|
|
876
|
-
|
|
921
|
+
Pe as ArcgisSlider
|
|
877
922
|
};
|