@arcgis/common-components 5.1.0-next.60 → 5.1.0-next.62
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/{SW77BUCP.js → 3B5FXQSX.js} +1 -1
- package/dist/cdn/{WOLQO3JI.js → 7OF5SF2A.js} +1 -1
- package/dist/cdn/{DYZ3HBS2.js → AQWVYBZF.js} +1 -1
- package/dist/cdn/{DWXXQFPQ.js → HYLC5GEB.js} +1 -1
- package/dist/cdn/{DLNJ7OOB.js → IQXW4J56.js} +1 -1
- package/dist/cdn/{V5Y3VGWN.js → IRXTWEQW.js} +1 -1
- package/dist/cdn/MPLWDVLG.js +2 -0
- package/dist/cdn/{5EKB3CUO.js → NHRIURQU.js} +1 -1
- package/dist/cdn/{W2DRQHS5.js → QH2547O7.js} +1 -1
- package/dist/cdn/{SDI7RS6X.js → QLSLMEU5.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-slider/customElement.d.ts +12 -15
- package/dist/components/arcgis-slider/customElement.js +292 -286
- package/dist/components/arcgis-ticks/customElement.d.ts +10 -9
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -4
- package/dist/cdn/MIIXLLQJ.js +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
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 I, subclass as
|
|
14
|
-
import { watch as
|
|
15
|
-
import { generateGuid as
|
|
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
16
|
const p = {
|
|
17
17
|
increment: "ArrowUp",
|
|
18
18
|
incrementHorizontal: "ArrowRight",
|
|
@@ -24,60 +24,62 @@ const p = {
|
|
|
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
|
-
direction:
|
|
33
|
+
direction: a ? i * -1 : i,
|
|
34
34
|
count: r
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
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
|
|
40
|
+
function U(n) {
|
|
41
|
+
return n === p.jumpToEnd || n === p.jumpToStart;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function he(n) {
|
|
44
|
+
return n === p.increment || n === p.decrement || n === p.decrementHorizontal || n === p.incrementHorizontal;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function ue(n) {
|
|
47
|
+
return n === p.pageIncrement || n === p.pageDecrement;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const e = Number.isFinite(
|
|
49
|
+
function ge(n) {
|
|
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 w = class extends
|
|
68
|
+
let w = class extends oe {
|
|
67
69
|
//--------------------------------------------------------------------------
|
|
68
70
|
//
|
|
69
71
|
// Lifecycle
|
|
70
72
|
//
|
|
71
73
|
//--------------------------------------------------------------------------
|
|
72
|
-
constructor(
|
|
73
|
-
super({ ...
|
|
74
|
+
constructor(n = {}) {
|
|
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
|
-
const { precision:
|
|
77
|
-
let { min: e, max: t, values:
|
|
78
|
-
t = x(t,
|
|
79
|
-
const i = new Map(
|
|
80
|
-
this._entries = i,
|
|
78
|
+
const { precision: n } = this;
|
|
79
|
+
let { min: e, max: t, values: a } = this;
|
|
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
85
|
const o = this.values;
|
|
@@ -86,7 +88,7 @@ let w = class extends ie {
|
|
|
86
88
|
}), this._updatesValues());
|
|
87
89
|
},
|
|
88
90
|
{ sync: !0 }
|
|
89
|
-
),
|
|
91
|
+
), A(
|
|
90
92
|
() => this.max,
|
|
91
93
|
(r) => {
|
|
92
94
|
const o = this.values;
|
|
@@ -95,7 +97,7 @@ let w = class extends ie {
|
|
|
95
97
|
}), this._updatesValues());
|
|
96
98
|
},
|
|
97
99
|
{ sync: !0 }
|
|
98
|
-
),
|
|
100
|
+
), A(
|
|
99
101
|
() => this.precision,
|
|
100
102
|
(r) => {
|
|
101
103
|
const { min: o, max: s, values: l } = this;
|
|
@@ -109,40 +111,42 @@ let w = class extends ie {
|
|
|
109
111
|
get entries() {
|
|
110
112
|
return this._entries;
|
|
111
113
|
}
|
|
112
|
-
set max(
|
|
114
|
+
set max(n) {
|
|
113
115
|
if (!this.ready) {
|
|
114
|
-
this._set("max",
|
|
116
|
+
this._set("max", n);
|
|
115
117
|
return;
|
|
116
118
|
}
|
|
117
|
-
const e = this._get("max"), t = x(
|
|
119
|
+
const e = this._get("max"), t = x(n, this.precision);
|
|
118
120
|
e !== t && this._set("max", t);
|
|
119
121
|
}
|
|
120
|
-
set min(
|
|
122
|
+
set min(n) {
|
|
121
123
|
if (!this.ready) {
|
|
122
|
-
this._set("min",
|
|
124
|
+
this._set("min", n);
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
const e = this._get("min"), t = x(
|
|
127
|
+
const e = this._get("min"), t = x(n, this.precision);
|
|
126
128
|
e !== t && this._set("min", t);
|
|
127
129
|
}
|
|
128
|
-
set values(
|
|
129
|
-
if (
|
|
130
|
-
|
|
130
|
+
set values(n) {
|
|
131
|
+
if (ve(this, F) === n)
|
|
132
|
+
return;
|
|
133
|
+
if (_e(this, F, n), !this.ready) {
|
|
134
|
+
this._set("values", n);
|
|
131
135
|
return;
|
|
132
136
|
}
|
|
133
137
|
const e = this._get("values");
|
|
134
|
-
if (
|
|
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(
|
|
137
|
-
this._entries = t, this._set("values",
|
|
140
|
+
const t = new Map(n?.map((a) => [K(), a]));
|
|
141
|
+
this._entries = t, this._set("values", n);
|
|
138
142
|
}
|
|
139
143
|
//--------------------------------------------------------------------------
|
|
140
144
|
//
|
|
141
145
|
// Public Methods
|
|
142
146
|
//
|
|
143
147
|
//--------------------------------------------------------------------------
|
|
144
|
-
getValue(
|
|
145
|
-
return this._entries.get(
|
|
148
|
+
getValue(n) {
|
|
149
|
+
return this._entries.get(n);
|
|
146
150
|
}
|
|
147
151
|
/**
|
|
148
152
|
* Updates a thumb [value](#values) based on the provided index. The provided value
|
|
@@ -151,28 +155,29 @@ let w = class extends ie {
|
|
|
151
155
|
*
|
|
152
156
|
* @returns `true` if the value was changed, otherwise `false`.
|
|
153
157
|
*/
|
|
154
|
-
setValue(
|
|
158
|
+
setValue(n, e) {
|
|
155
159
|
if (this.values == null)
|
|
156
160
|
return !1;
|
|
157
|
-
const { min: t, max:
|
|
158
|
-
return i === r ? !1 : (this._entries.set(
|
|
161
|
+
const { min: t, max: a } = this, i = this._entries.get(n), r = T(x(e, this.precision), t, a);
|
|
162
|
+
return i === r ? !1 : (this._entries.set(n, r), this._updatesValues(), !0);
|
|
159
163
|
}
|
|
160
|
-
setValues(
|
|
164
|
+
setValues(n) {
|
|
161
165
|
if (this.values == null)
|
|
162
166
|
return !1;
|
|
163
167
|
let e = !1;
|
|
164
|
-
const { min: t, max:
|
|
165
|
-
for (const [i, r] of
|
|
166
|
-
const o = this._entries.get(i), s = T(x(r, this.precision), t,
|
|
168
|
+
const { min: t, max: a } = this;
|
|
169
|
+
for (const [i, r] of n) {
|
|
170
|
+
const o = this._entries.get(i), s = T(x(r, this.precision), t, a);
|
|
167
171
|
o !== s && (e = !0, this._entries.set(i, s));
|
|
168
172
|
}
|
|
169
173
|
return e ? (this._updatesValues(), !0) : !1;
|
|
170
174
|
}
|
|
171
175
|
_updatesValues() {
|
|
172
|
-
const
|
|
173
|
-
this._set("values",
|
|
176
|
+
const n = Array.from(this._entries.values()).sort((e, t) => e - t);
|
|
177
|
+
this._set("values", n);
|
|
174
178
|
}
|
|
175
179
|
};
|
|
180
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
176
181
|
D([
|
|
177
182
|
I()
|
|
178
183
|
], w.prototype, "_entries", 2);
|
|
@@ -186,7 +191,7 @@ D([
|
|
|
186
191
|
I()
|
|
187
192
|
], w.prototype, "min", 1);
|
|
188
193
|
D([
|
|
189
|
-
I({ cast: (
|
|
194
|
+
I({ cast: (n) => T(n, 0, 20) })
|
|
190
195
|
], w.prototype, "precision", 2);
|
|
191
196
|
D([
|
|
192
197
|
I({ readOnly: !0 })
|
|
@@ -195,15 +200,15 @@ D([
|
|
|
195
200
|
I()
|
|
196
201
|
], w.prototype, "values", 1);
|
|
197
202
|
w = D([
|
|
198
|
-
|
|
203
|
+
ce("esri.widgets.Slider.SliderData")
|
|
199
204
|
], w);
|
|
200
|
-
function T(
|
|
201
|
-
return Math.min(Math.max(
|
|
205
|
+
function T(n, e, t) {
|
|
206
|
+
return Math.min(Math.max(n, e), t);
|
|
202
207
|
}
|
|
203
|
-
function x(
|
|
204
|
-
return Number.parseFloat(
|
|
208
|
+
function x(n, e) {
|
|
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
|
}
|
|
@@ -213,29 +218,30 @@ class fe {
|
|
|
213
218
|
valueToIndex(e) {
|
|
214
219
|
const t = this.steps.indexOf(e);
|
|
215
220
|
return t !== -1 ? t : this.steps.reduce(
|
|
216
|
-
(
|
|
221
|
+
(a, i, r, o) => Math.abs(i - e) < Math.abs(o[a] - e) ? r : a,
|
|
222
|
+
0
|
|
217
223
|
);
|
|
218
224
|
}
|
|
219
225
|
getClosestStepDistances(e, t) {
|
|
220
226
|
if (t <= 0)
|
|
221
227
|
return [];
|
|
222
|
-
const
|
|
228
|
+
const a = [];
|
|
223
229
|
for (let i = this.minIndex; i <= this.maxIndex; i++) {
|
|
224
230
|
const r = this.indexToValue(i), o = Math.abs(r - e);
|
|
225
231
|
let s = !1;
|
|
226
|
-
for (let l = 0; l <
|
|
227
|
-
if (o <
|
|
228
|
-
|
|
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;
|
|
229
235
|
break;
|
|
230
236
|
}
|
|
231
|
-
!s &&
|
|
237
|
+
!s && a.length < t && a.push({ idx: i, value: r, dist: o }), a.length > t && (a.length = t);
|
|
232
238
|
}
|
|
233
|
-
return
|
|
239
|
+
return a;
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
|
-
class
|
|
237
|
-
constructor(e, t,
|
|
238
|
-
this.min = e, this.max = t, this.stepSize =
|
|
242
|
+
class we {
|
|
243
|
+
constructor(e, t, a) {
|
|
244
|
+
this.min = e, this.max = t, this.stepSize = a, this.minIndex = 0, this.maxIndex = Math.round((this.max - this.min) / this.stepSize);
|
|
239
245
|
}
|
|
240
246
|
indexToValue(e) {
|
|
241
247
|
return this.min + k(e, this.minIndex, this.maxIndex) * this.stepSize;
|
|
@@ -246,40 +252,40 @@ class pe {
|
|
|
246
252
|
getClosestStepDistances(e, t) {
|
|
247
253
|
if (t <= 0)
|
|
248
254
|
return [];
|
|
249
|
-
const
|
|
255
|
+
const a = [], i = this.minIndex, r = this.maxIndex, s = (k(e, this.min, this.max) - this.min) / this.stepSize;
|
|
250
256
|
let l = Math.floor(s), c = l + 1;
|
|
251
|
-
for (;
|
|
257
|
+
for (; a.length < t && (l >= i || c <= r); ) {
|
|
252
258
|
if (l < i) {
|
|
253
|
-
const
|
|
254
|
-
|
|
259
|
+
const u = this.indexToValue(c);
|
|
260
|
+
a.push({ idx: c, value: u, dist: Math.abs(u - e) }), c++;
|
|
255
261
|
continue;
|
|
256
262
|
}
|
|
257
263
|
if (c > r) {
|
|
258
|
-
const
|
|
259
|
-
|
|
264
|
+
const u = this.indexToValue(l);
|
|
265
|
+
a.push({ idx: l, value: u, dist: Math.abs(u - e) }), l--;
|
|
260
266
|
continue;
|
|
261
267
|
}
|
|
262
|
-
const d = this.indexToValue(l),
|
|
263
|
-
g <= f ? (
|
|
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++);
|
|
264
270
|
}
|
|
265
|
-
return
|
|
271
|
+
return a;
|
|
266
272
|
}
|
|
267
273
|
}
|
|
268
|
-
function
|
|
269
|
-
if (
|
|
274
|
+
function ke(n) {
|
|
275
|
+
if (n.steps == null)
|
|
270
276
|
return null;
|
|
271
|
-
const e =
|
|
272
|
-
return Array.isArray(e) ? e.length === 0 ? null : new
|
|
277
|
+
const e = n.steps;
|
|
278
|
+
return Array.isArray(e) ? e.length === 0 ? null : new ye(e) : e <= 0 ? null : new we(n.min, n.max, e);
|
|
273
279
|
}
|
|
274
|
-
function
|
|
275
|
-
if (
|
|
280
|
+
function De(n, e, t) {
|
|
281
|
+
if (n == null) {
|
|
276
282
|
const s = /* @__PURE__ */ new Map();
|
|
277
283
|
for (const [l, c] of e.entries())
|
|
278
284
|
s.set(l, c + t);
|
|
279
285
|
return s;
|
|
280
286
|
}
|
|
281
|
-
const
|
|
282
|
-
const c = l + t, d =
|
|
287
|
+
const a = e.size, i = Array.from(e.entries()).map(([s, l]) => {
|
|
288
|
+
const c = l + t, d = n.getClosestStepDistances(c, a);
|
|
283
289
|
return { uuid: s, stepDistances: d };
|
|
284
290
|
}), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
285
291
|
i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
|
|
@@ -289,101 +295,101 @@ function be(a, e, t) {
|
|
|
289
295
|
}
|
|
290
296
|
return o;
|
|
291
297
|
}
|
|
292
|
-
function
|
|
298
|
+
function X(n, e, t, a, i) {
|
|
293
299
|
const r = e.get(t) ?? 0;
|
|
294
|
-
if (!
|
|
295
|
-
return r +
|
|
296
|
-
const o = r +
|
|
300
|
+
if (!n)
|
|
301
|
+
return r + a;
|
|
302
|
+
const o = r + a, s = n.minIndex, l = n.maxIndex, c = /* @__PURE__ */ new Set();
|
|
297
303
|
if (!i)
|
|
298
|
-
for (const [
|
|
299
|
-
|
|
300
|
-
const d = k(
|
|
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);
|
|
301
307
|
if (!c.has(d))
|
|
302
|
-
return
|
|
303
|
-
let
|
|
308
|
+
return n.indexToValue(d);
|
|
309
|
+
let h = null, g = 1 / 0;
|
|
304
310
|
const f = Math.min(Math.max(d - s, l - d), c.size + 1);
|
|
305
|
-
for (let
|
|
306
|
-
const v = d -
|
|
311
|
+
for (let u = 1; u <= f; u++) {
|
|
312
|
+
const v = d - u;
|
|
307
313
|
if (v >= s && !c.has(v)) {
|
|
308
|
-
const m =
|
|
309
|
-
|
|
314
|
+
const m = n.indexToValue(v), b = Math.abs(m - o);
|
|
315
|
+
h = v, g = b;
|
|
310
316
|
}
|
|
311
|
-
const _ = d +
|
|
317
|
+
const _ = d + u;
|
|
312
318
|
if (_ <= l && !c.has(_)) {
|
|
313
|
-
const m =
|
|
314
|
-
(
|
|
319
|
+
const m = n.indexToValue(_), b = Math.abs(m - o);
|
|
320
|
+
(h == null || b < g) && (h = _, g = b);
|
|
315
321
|
}
|
|
316
|
-
if (
|
|
317
|
-
return
|
|
322
|
+
if (h != null)
|
|
323
|
+
return n.indexToValue(h);
|
|
318
324
|
}
|
|
319
|
-
return
|
|
325
|
+
return h == null ? r : n.indexToValue(h);
|
|
320
326
|
}
|
|
321
|
-
function
|
|
322
|
-
const i =
|
|
327
|
+
function Ie(n, e, t, a = 1) {
|
|
328
|
+
const i = J(a);
|
|
323
329
|
let r = e, o = !1;
|
|
324
330
|
for (let s = 0; s < i; s++) {
|
|
325
|
-
const l =
|
|
331
|
+
const l = Ve(n, r, t);
|
|
326
332
|
if (o ||= l.changed, r = l.entries, !l.changed)
|
|
327
333
|
break;
|
|
328
334
|
}
|
|
329
335
|
return { changed: o, entries: r };
|
|
330
336
|
}
|
|
331
|
-
function
|
|
332
|
-
const r =
|
|
337
|
+
function Ee(n, e, t, a, i = 1) {
|
|
338
|
+
const r = J(i);
|
|
333
339
|
if (r === 1)
|
|
334
|
-
return
|
|
340
|
+
return H(n, e, t, a);
|
|
335
341
|
const o = new Map(e);
|
|
336
342
|
let s = o.get(t);
|
|
337
343
|
for (let l = 0; l < r; l++) {
|
|
338
|
-
const c =
|
|
344
|
+
const c = H(n, o, t, a);
|
|
339
345
|
if (c === s)
|
|
340
346
|
break;
|
|
341
347
|
s = c, o.set(t, s);
|
|
342
348
|
}
|
|
343
349
|
return s;
|
|
344
350
|
}
|
|
345
|
-
function
|
|
346
|
-
const e = Number.isFinite(
|
|
351
|
+
function J(n) {
|
|
352
|
+
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
347
353
|
return Math.max(1, e);
|
|
348
354
|
}
|
|
349
|
-
function
|
|
350
|
-
const
|
|
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]));
|
|
351
357
|
let o = !1, s = !0;
|
|
352
358
|
for (const [l, c] of r)
|
|
353
|
-
if (
|
|
354
|
-
const d =
|
|
355
|
-
c === d && (s = !1), o ||= s,
|
|
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);
|
|
356
362
|
}
|
|
357
|
-
return { changed: o, entries:
|
|
363
|
+
return { changed: o, entries: a };
|
|
358
364
|
}
|
|
359
|
-
function
|
|
360
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } =
|
|
361
|
-
if (
|
|
362
|
-
let m = k(c +
|
|
365
|
+
function H(n, e, t, a) {
|
|
366
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
|
|
367
|
+
if (a = a > 0 ? 1 : -1, !r) {
|
|
368
|
+
let m = k(c + a * o, s, l);
|
|
363
369
|
if (i)
|
|
364
370
|
return m;
|
|
365
371
|
const b = /* @__PURE__ */ new Set();
|
|
366
|
-
for (const [
|
|
367
|
-
|
|
372
|
+
for (const [C, M] of e)
|
|
373
|
+
C !== t && b.add(M);
|
|
368
374
|
for (; b.has(m) && m <= l && m >= s; )
|
|
369
|
-
m = k(m +
|
|
375
|
+
m = k(m + a * o, s, l);
|
|
370
376
|
return b.has(m) || m > l || m < s ? c : m;
|
|
371
377
|
}
|
|
372
378
|
const d = r.valueToIndex(c);
|
|
373
379
|
if (d === -1)
|
|
374
380
|
return c;
|
|
375
381
|
if (i) {
|
|
376
|
-
const m = k(d +
|
|
382
|
+
const m = k(d + a, r.minIndex, r.maxIndex);
|
|
377
383
|
return r.indexToValue(m);
|
|
378
384
|
}
|
|
379
|
-
const
|
|
385
|
+
const h = /* @__PURE__ */ new Set();
|
|
380
386
|
for (const [m, b] of e)
|
|
381
|
-
m !== t &&
|
|
387
|
+
m !== t && h.add(r.valueToIndex(b));
|
|
382
388
|
let g = d, f = !1;
|
|
383
|
-
const
|
|
389
|
+
const u = r.minIndex, v = r.maxIndex;
|
|
384
390
|
let _ = 0;
|
|
385
|
-
for (; _ < Math.abs(v -
|
|
386
|
-
if (!
|
|
391
|
+
for (; _ < Math.abs(v - u) && (g += a, !(g < u || g > v)); ) {
|
|
392
|
+
if (!h.has(g)) {
|
|
387
393
|
f = !0;
|
|
388
394
|
break;
|
|
389
395
|
}
|
|
@@ -391,54 +397,54 @@ function A(a, e, t, n) {
|
|
|
391
397
|
}
|
|
392
398
|
return f ? r.indexToValue(g) : c;
|
|
393
399
|
}
|
|
394
|
-
function
|
|
395
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } =
|
|
396
|
-
if (
|
|
400
|
+
function Te(n, e, t, a) {
|
|
401
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } = n, c = e.get(t);
|
|
402
|
+
if (a = a > 0 ? 1 : -1, !r) {
|
|
397
403
|
const f = new Set(
|
|
398
404
|
Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
|
|
399
405
|
);
|
|
400
|
-
let
|
|
406
|
+
let u = a > 0 ? l : s;
|
|
401
407
|
if (i)
|
|
402
|
-
return
|
|
403
|
-
for (; f.has(
|
|
404
|
-
if (
|
|
405
|
-
|
|
408
|
+
return u;
|
|
409
|
+
for (; f.has(u); )
|
|
410
|
+
if (u -= a * o, a > 0 && u > l || a < 0 && u < s) {
|
|
411
|
+
u = c;
|
|
406
412
|
break;
|
|
407
413
|
}
|
|
408
|
-
return
|
|
414
|
+
return u;
|
|
409
415
|
}
|
|
410
416
|
if (i)
|
|
411
|
-
return
|
|
417
|
+
return a > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
|
|
412
418
|
const d = r.valueToIndex(c);
|
|
413
419
|
if (d === -1)
|
|
414
420
|
return c;
|
|
415
|
-
const
|
|
421
|
+
const h = new Set(
|
|
416
422
|
Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
|
|
417
423
|
);
|
|
418
|
-
let g =
|
|
419
|
-
for (;
|
|
420
|
-
if (g -=
|
|
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) {
|
|
421
427
|
g = d;
|
|
422
428
|
break;
|
|
423
429
|
}
|
|
424
430
|
return r.indexToValue(g);
|
|
425
431
|
}
|
|
426
|
-
function
|
|
427
|
-
const { stepsProvider:
|
|
428
|
-
if (
|
|
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]));
|
|
434
|
+
if (a) {
|
|
429
435
|
let c = 0;
|
|
430
436
|
if (t > 0) {
|
|
431
|
-
const d = s[s.length - 1],
|
|
432
|
-
c =
|
|
437
|
+
const d = s[s.length - 1], h = a.valueToIndex(d[1]);
|
|
438
|
+
c = a.maxIndex - h;
|
|
433
439
|
} else {
|
|
434
|
-
const d = s[0],
|
|
435
|
-
c =
|
|
440
|
+
const d = s[0], h = a.valueToIndex(d[1]);
|
|
441
|
+
c = a.minIndex - h;
|
|
436
442
|
}
|
|
437
443
|
if (c === 0)
|
|
438
|
-
for (const [d,
|
|
439
|
-
o.set(d,
|
|
440
|
-
for (const [d,
|
|
441
|
-
const g =
|
|
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);
|
|
442
448
|
o.set(d, g);
|
|
443
449
|
}
|
|
444
450
|
return o;
|
|
@@ -455,39 +461,39 @@ function ke(a, e, t) {
|
|
|
455
461
|
o.set(c, d + l);
|
|
456
462
|
return o;
|
|
457
463
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
464
|
+
function Y(n, e) {
|
|
465
|
+
return n - e;
|
|
460
466
|
}
|
|
461
|
-
function
|
|
462
|
-
return e -
|
|
467
|
+
function Me(n, e) {
|
|
468
|
+
return e - n;
|
|
463
469
|
}
|
|
464
|
-
function k(
|
|
465
|
-
return Math.max(e, Math.min(t,
|
|
470
|
+
function k(n, e, t) {
|
|
471
|
+
return Math.max(e, Math.min(t, n));
|
|
466
472
|
}
|
|
467
|
-
const
|
|
468
|
-
class
|
|
473
|
+
const $e = te(w);
|
|
474
|
+
class Pe extends ee {
|
|
469
475
|
constructor() {
|
|
470
|
-
super(...arguments), this._stepsProvider = null, this._popoverElement =
|
|
476
|
+
super(...arguments), this._stepsProvider = null, this._popoverElement = B(), this._trackElement = B(), this.messages = se({}), this._onPointerMoveDragUpdate = (e) => {
|
|
471
477
|
this._updateDrag(this._mapEventToRange(e));
|
|
472
478
|
}, this._onPointerUpDragEnd = (e) => {
|
|
473
479
|
S(e) && this._endDrag();
|
|
474
480
|
}, this._onPointerCancelDragEnd = () => {
|
|
475
481
|
this._endDrag();
|
|
476
|
-
}, this._formatLabel = (e, t,
|
|
477
|
-
const i =
|
|
482
|
+
}, this._formatLabel = (e, t, a) => {
|
|
483
|
+
const i = le(this.messages._lang, t), r = this.labelFormatter;
|
|
478
484
|
if (!r)
|
|
479
|
-
return i.format(
|
|
480
|
-
const o = r(
|
|
481
|
-
return o ?? i.format(
|
|
485
|
+
return i.format(a);
|
|
486
|
+
const o = r(a, e, (s) => i.format(s));
|
|
487
|
+
return o ?? i.format(a);
|
|
482
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(() => {
|
|
483
489
|
this._layoutLabelInputs();
|
|
484
|
-
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._activePart = null, 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 });
|
|
485
491
|
}
|
|
486
492
|
static {
|
|
487
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: {
|
|
488
494
|
fromAttribute(e) {
|
|
489
495
|
if (e.includes(","))
|
|
490
|
-
return e.split(",").filter((
|
|
496
|
+
return e.split(",").filter((a) => a.trim() !== "").map(parseFloat).filter((a) => Number.isFinite(a));
|
|
491
497
|
const t = parseFloat(e);
|
|
492
498
|
return Number.isFinite(t) ? t : void 0;
|
|
493
499
|
}
|
|
@@ -498,7 +504,7 @@ class Ee extends Y {
|
|
|
498
504
|
} }], messageOverrides: 0 };
|
|
499
505
|
}
|
|
500
506
|
static {
|
|
501
|
-
this.styles =
|
|
507
|
+
this.styles = me;
|
|
502
508
|
}
|
|
503
509
|
static {
|
|
504
510
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -523,8 +529,8 @@ class Ee extends Y {
|
|
|
523
529
|
return this.disabled || this.values.length === 0 || this._invalid;
|
|
524
530
|
}
|
|
525
531
|
get _invalid() {
|
|
526
|
-
const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min,
|
|
527
|
-
return this.min >= this.max || !e || !t || !
|
|
532
|
+
const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min, a = this.fullRangeMax == null || this.fullRangeMax >= this.max;
|
|
533
|
+
return this.min >= this.max || !e || !t || !a;
|
|
528
534
|
}
|
|
529
535
|
get resolution() {
|
|
530
536
|
const e = (this._sliderData.max - this._sliderData.min) / this._trackWidthOrHeight;
|
|
@@ -541,7 +547,7 @@ class Ee extends Y {
|
|
|
541
547
|
this._sliderData.startup();
|
|
542
548
|
}
|
|
543
549
|
willUpdate(e) {
|
|
544
|
-
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")) {
|
|
545
551
|
const t = this.max != null && this.min != null && this.max - this.min > 10 ? 2 : this.precision;
|
|
546
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);
|
|
547
553
|
}
|
|
@@ -570,20 +576,20 @@ class Ee extends Y {
|
|
|
570
576
|
if (this._labelInputsUpdateComplete = t, await t, t !== this._labelInputsUpdateComplete)
|
|
571
577
|
return;
|
|
572
578
|
this._labelInputsUpdateComplete = null;
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
579
|
+
const a = this._trackElement.value;
|
|
580
|
+
if (!a)
|
|
575
581
|
return;
|
|
576
|
-
const i =
|
|
582
|
+
const i = a.getBoundingClientRect();
|
|
577
583
|
for (const r of this._sliderData.entries.keys()) {
|
|
578
584
|
const o = this._activePart === "range" || this._activePart === r;
|
|
579
585
|
if (this.valueLabelsDisplay === "always" || o) {
|
|
580
|
-
const l =
|
|
586
|
+
const l = Le(this, r), c = q(this, r);
|
|
581
587
|
if (!l || !c)
|
|
582
588
|
continue;
|
|
583
|
-
const d = l.getBoundingClientRect(),
|
|
584
|
-
let _ =
|
|
585
|
-
const m = i.left - f, b = i.right + f,
|
|
586
|
-
|
|
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)`;
|
|
587
593
|
}
|
|
588
594
|
}
|
|
589
595
|
}
|
|
@@ -606,19 +612,19 @@ class Ee extends Y {
|
|
|
606
612
|
t.blur(), this._focusEntry(V(t));
|
|
607
613
|
return;
|
|
608
614
|
}
|
|
609
|
-
if (
|
|
615
|
+
if (Se(e.target) || this.values?.length > 1)
|
|
610
616
|
return;
|
|
611
|
-
const
|
|
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;
|
|
612
618
|
this._startDrag(i, s);
|
|
613
|
-
const l =
|
|
619
|
+
const l = X(this._stepsProvider, this._sliderData.entries, i, o, this.allowValuesOverlap);
|
|
614
620
|
this._setValue(i, l), this._focusEntry(i);
|
|
615
621
|
}
|
|
616
622
|
_onThumbPointerDown(e) {
|
|
617
623
|
const t = V(e.currentTarget);
|
|
618
624
|
if (!S(e) || this._disabledOrInvalid || !t)
|
|
619
625
|
return;
|
|
620
|
-
const
|
|
621
|
-
e.target ===
|
|
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)));
|
|
622
628
|
}
|
|
623
629
|
_endDrag() {
|
|
624
630
|
if (this._disabledOrInvalid)
|
|
@@ -627,8 +633,8 @@ class Ee extends Y {
|
|
|
627
633
|
let e = !1;
|
|
628
634
|
if (this._dragInfo) {
|
|
629
635
|
const { entries: t } = this._dragInfo;
|
|
630
|
-
for (const [
|
|
631
|
-
if (this._sliderData.getValue(
|
|
636
|
+
for (const [a, i] of t)
|
|
637
|
+
if (this._sliderData.getValue(a) !== i) {
|
|
632
638
|
e = !0;
|
|
633
639
|
break;
|
|
634
640
|
}
|
|
@@ -638,12 +644,12 @@ class Ee extends Y {
|
|
|
638
644
|
_startDrag(e, t) {
|
|
639
645
|
if (this._disabledOrInvalid)
|
|
640
646
|
return;
|
|
641
|
-
const { min:
|
|
642
|
-
let o =
|
|
647
|
+
const { min: a, max: i, values: r } = this;
|
|
648
|
+
let o = a, s = i;
|
|
643
649
|
if (this._setActivePart(e), e === "range") {
|
|
644
650
|
if (this.segmentsDraggingDisabled)
|
|
645
651
|
return;
|
|
646
|
-
o =
|
|
652
|
+
o = a - r[0], s = i - r[r.length - 1];
|
|
647
653
|
}
|
|
648
654
|
this._dragInfo = {
|
|
649
655
|
position: t,
|
|
@@ -655,21 +661,21 @@ class Ee extends Y {
|
|
|
655
661
|
_updateDrag(e) {
|
|
656
662
|
if (!this._dragInfo || !this._activePart)
|
|
657
663
|
return;
|
|
658
|
-
const { _activePart: t, _dragInfo: { position:
|
|
659
|
-
if (
|
|
664
|
+
const { _activePart: t, _dragInfo: { position: a, entries: i, minDiff: r, maxDiff: o } } = this;
|
|
665
|
+
if (a === e)
|
|
660
666
|
return;
|
|
661
|
-
let s = (e -
|
|
667
|
+
let s = (e - a) * this._fullRange;
|
|
662
668
|
if (t === "range") {
|
|
663
669
|
s = Math.min(o, Math.max(r, s));
|
|
664
|
-
const l =
|
|
670
|
+
const l = De(this._stepsProvider, i, s);
|
|
665
671
|
this._setValues(l);
|
|
666
672
|
} else {
|
|
667
|
-
const l =
|
|
673
|
+
const l = X(this._stepsProvider, i, t, s, this.allowValuesOverlap);
|
|
668
674
|
this._setValue(t, l);
|
|
669
675
|
}
|
|
670
676
|
}
|
|
671
677
|
_focusEntry(e) {
|
|
672
|
-
e &&
|
|
678
|
+
e && Fe(this, e)?.focus();
|
|
673
679
|
}
|
|
674
680
|
_addDragListeners() {
|
|
675
681
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -691,30 +697,30 @@ class Ee extends Y {
|
|
|
691
697
|
this._setActivePart(null);
|
|
692
698
|
}
|
|
693
699
|
_onRangeInputChange(e) {
|
|
694
|
-
const t = e.currentTarget,
|
|
700
|
+
const t = e.currentTarget, a = t.value, i = t.dataset.type;
|
|
695
701
|
let r = !1;
|
|
696
702
|
switch (e.stopPropagation(), i) {
|
|
697
703
|
case "min": {
|
|
698
|
-
|
|
704
|
+
a < this.max ? (this.min = a, r = !0) : t.value = this.min;
|
|
699
705
|
break;
|
|
700
706
|
}
|
|
701
707
|
case "max": {
|
|
702
|
-
|
|
708
|
+
a > this.min ? (this.max = a, r = !0) : t.value = this.max;
|
|
703
709
|
break;
|
|
704
710
|
}
|
|
705
711
|
}
|
|
706
712
|
r && this.arcgisRangeChange.emit();
|
|
707
713
|
}
|
|
708
714
|
_onValueInputChange(e) {
|
|
709
|
-
const t = e.currentTarget,
|
|
710
|
-
|
|
715
|
+
const t = e.currentTarget, a = V(t), i = t.value;
|
|
716
|
+
a && (e.stopPropagation(), this._setValue(a, i), t.value = this._sliderData.getValue(a));
|
|
711
717
|
}
|
|
712
718
|
_mapEventToRange(e) {
|
|
713
719
|
const t = this._trackElement.value?.getBoundingClientRect();
|
|
714
720
|
if (!t)
|
|
715
721
|
return 0;
|
|
716
|
-
const
|
|
717
|
-
return this.mirrored ? 1 -
|
|
722
|
+
const a = this.isHorizontal ? (e.clientX - t.left) / t.width : 1 - (e.clientY - t.top) / t.height;
|
|
723
|
+
return this.mirrored ? 1 - a : a;
|
|
718
724
|
}
|
|
719
725
|
_getPositionStyleForElement(e) {
|
|
720
726
|
const t = z(this._fullMin, this._fullMax, e);
|
|
@@ -723,52 +729,52 @@ class Ee extends Y {
|
|
|
723
729
|
};
|
|
724
730
|
}
|
|
725
731
|
_popoverSlotChange(e) {
|
|
726
|
-
this._hasPopoverContent =
|
|
732
|
+
this._hasPopoverContent = R(e);
|
|
727
733
|
}
|
|
728
734
|
_onContentStartSlotChange(e) {
|
|
729
|
-
this._hasContentStart =
|
|
735
|
+
this._hasContentStart = R(e);
|
|
730
736
|
}
|
|
731
737
|
_onContentEndSlotChange(e) {
|
|
732
|
-
this._hasContentEnd =
|
|
738
|
+
this._hasContentEnd = R(e);
|
|
733
739
|
}
|
|
734
740
|
_onThumbKeyDown(e) {
|
|
735
741
|
const t = V(e.currentTarget);
|
|
736
742
|
if (!t)
|
|
737
743
|
return;
|
|
738
|
-
const
|
|
739
|
-
if (!
|
|
744
|
+
const a = e.currentTarget.querySelector("arcgis-label-input");
|
|
745
|
+
if (!a || a.editing)
|
|
740
746
|
return;
|
|
741
747
|
if (e.key === p.confirmEdit) {
|
|
742
|
-
|
|
748
|
+
a.edit();
|
|
743
749
|
return;
|
|
744
750
|
}
|
|
745
|
-
const i =
|
|
751
|
+
const i = N(e, this.keyboardLargeStep, this.mirrored);
|
|
746
752
|
if (i) {
|
|
747
753
|
e.preventDefault();
|
|
748
|
-
const r =
|
|
754
|
+
const r = Ee(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
|
|
749
755
|
this._setValue(t, r);
|
|
750
756
|
return;
|
|
751
757
|
}
|
|
752
|
-
if (
|
|
758
|
+
if (U(e.key)) {
|
|
753
759
|
e.preventDefault();
|
|
754
|
-
const r =
|
|
760
|
+
const r = Te(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
|
|
755
761
|
this._setValue(t, r);
|
|
756
762
|
}
|
|
757
763
|
}
|
|
758
764
|
_onTrackRangeKeyDown(e) {
|
|
759
765
|
if (this._disabledOrInvalid)
|
|
760
766
|
return;
|
|
761
|
-
const t =
|
|
767
|
+
const t = N(e, this.keyboardLargeStep, this.mirrored);
|
|
762
768
|
if (t) {
|
|
763
769
|
e.preventDefault();
|
|
764
|
-
const { entries:
|
|
765
|
-
this._setValues(
|
|
770
|
+
const { entries: a } = Ie(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
771
|
+
this._setValues(a);
|
|
766
772
|
return;
|
|
767
773
|
}
|
|
768
|
-
if (
|
|
774
|
+
if (U(e.key)) {
|
|
769
775
|
e.preventDefault();
|
|
770
|
-
const
|
|
771
|
-
this._setValues(
|
|
776
|
+
const a = Ce(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
777
|
+
this._setValues(a);
|
|
772
778
|
}
|
|
773
779
|
}
|
|
774
780
|
_getStepsConfiguration() {
|
|
@@ -787,15 +793,15 @@ class Ee extends Y {
|
|
|
787
793
|
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
788
794
|
}
|
|
789
795
|
render() {
|
|
790
|
-
return y`<div class=${
|
|
796
|
+
return y`<div class=${P({
|
|
791
797
|
content: !0,
|
|
792
798
|
disabled: this._disabledOrInvalid
|
|
793
799
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
794
800
|
}
|
|
795
801
|
_renderPopover() {
|
|
796
|
-
const { _activePart: e, layout: t, popoverPlacement:
|
|
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";
|
|
797
803
|
let d = 14;
|
|
798
|
-
return r !== "hidden" &&
|
|
804
|
+
return r !== "hidden" && a === i && (d += 24), y`<calcite-popover flip-disabled focus-trap-disabled .label=${o} .open=${l} .offsetDistance=${d} .placement=${c} pointer-disabled .referenceElement=${s} scale=s trigger-disabled ${O(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
799
805
|
}
|
|
800
806
|
_renderContentStart() {
|
|
801
807
|
return y`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
@@ -807,30 +813,30 @@ class Ee extends Y {
|
|
|
807
813
|
return y`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`;
|
|
808
814
|
}
|
|
809
815
|
_renderTrack() {
|
|
810
|
-
return y`<div class="track" ${
|
|
816
|
+
return y`<div class="track" ${O(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
811
817
|
}
|
|
812
818
|
_renderTrackBackground() {
|
|
813
|
-
const { max: e, min: t, fillPlacement:
|
|
819
|
+
const { max: e, min: t, fillPlacement: a, values: i } = this, r = i.length > 1;
|
|
814
820
|
let o = this._fullMin, s = this._fullMax;
|
|
815
821
|
const l = [];
|
|
816
|
-
return this._invalid ? y`<div class="segment track-bounds" style=${
|
|
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, [
|
|
817
823
|
this.mirrored ? "track-effective-end" : "track-effective-start",
|
|
818
|
-
!r &&
|
|
824
|
+
!r && a === "start" ? "track-fill" : null
|
|
819
825
|
])), o = t), s > e && (l.push(this._renderSegment(e, s, [
|
|
820
826
|
this.mirrored ? "track-effective-start" : "track-effective-end",
|
|
821
|
-
!r &&
|
|
827
|
+
!r && a === "end" ? "track-fill" : null
|
|
822
828
|
])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
|
|
823
829
|
}
|
|
824
830
|
_renderFillSegment() {
|
|
825
|
-
const { values: e, fillPlacement: t, min:
|
|
831
|
+
const { values: e, fillPlacement: t, min: a, max: i } = this;
|
|
826
832
|
if (!e?.length || this._invalid)
|
|
827
833
|
return;
|
|
828
834
|
const r = [...e].sort((s, l) => s - l);
|
|
829
835
|
if (r.length === 1)
|
|
830
836
|
switch (t) {
|
|
831
837
|
case "start":
|
|
832
|
-
if (
|
|
833
|
-
return this._renderSegment(
|
|
838
|
+
if (a < r[0])
|
|
839
|
+
return this._renderSegment(a, r[0], ["track-range"]);
|
|
834
840
|
break;
|
|
835
841
|
case "end":
|
|
836
842
|
if (i > r[0])
|
|
@@ -846,10 +852,10 @@ class Ee extends Y {
|
|
|
846
852
|
onKeyDown: o ? void 0 : this._onTrackRangeKeyDown
|
|
847
853
|
});
|
|
848
854
|
}
|
|
849
|
-
_renderSegment(e, t,
|
|
855
|
+
_renderSegment(e, t, a, i) {
|
|
850
856
|
const { _fullMin: r, _fullMax: o, mirrored: s } = this, l = [
|
|
851
|
-
z(r, o,
|
|
852
|
-
100 - z(r, o,
|
|
857
|
+
z(r, o, j(e, r, o)),
|
|
858
|
+
100 - z(r, o, j(t, r, o))
|
|
853
859
|
];
|
|
854
860
|
s && l.reverse();
|
|
855
861
|
const c = this.isHorizontal ? {
|
|
@@ -858,59 +864,59 @@ class Ee extends Y {
|
|
|
858
864
|
} : {
|
|
859
865
|
top: `${l[1]}%`,
|
|
860
866
|
bottom: `${l[0]}%`
|
|
861
|
-
}, d =
|
|
862
|
-
return y`<div id=${i?.id ?? E} class=${
|
|
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>`;
|
|
863
869
|
}
|
|
864
870
|
_renderThumbs() {
|
|
865
|
-
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([,
|
|
866
|
-
return
|
|
871
|
+
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, a]) => a >= this._fullMin && a <= this._fullMax);
|
|
872
|
+
return ie(t, ([a, i]) => this._renderThumb(a, i));
|
|
867
873
|
}
|
|
868
874
|
_renderThumb(e, t) {
|
|
869
|
-
const { valueLabelsDisplay:
|
|
870
|
-
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({
|
|
871
877
|
thumb: !0,
|
|
872
878
|
active: r
|
|
873
|
-
})} data-entry=${e ?? E} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${
|
|
879
|
+
})} data-entry=${e ?? E} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${L({
|
|
874
880
|
...this._getPositionStyleForElement(t),
|
|
875
881
|
"z-index": this._activePart === e ? 1 : 0
|
|
876
|
-
})} .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>`);
|
|
877
883
|
}
|
|
878
884
|
_renderRangeLabel(e) {
|
|
879
885
|
let t = "center";
|
|
880
|
-
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=${
|
|
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>`;
|
|
881
887
|
}
|
|
882
888
|
}
|
|
883
|
-
function
|
|
884
|
-
return "dataset" in
|
|
889
|
+
function Se(n) {
|
|
890
|
+
return "dataset" in n && n.tagName === "ARCGIS-LABEL-INPUT" && (n.dataset.type === "min" || n.dataset.type === "max");
|
|
885
891
|
}
|
|
886
|
-
function V(
|
|
887
|
-
const e =
|
|
892
|
+
function V(n) {
|
|
893
|
+
const e = ne(n, "[data-entry]");
|
|
888
894
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
889
895
|
}
|
|
890
|
-
function
|
|
891
|
-
return typeof
|
|
896
|
+
function ze(n) {
|
|
897
|
+
return typeof n != null && n !== "range";
|
|
892
898
|
}
|
|
893
|
-
function
|
|
894
|
-
return e ?
|
|
899
|
+
function Fe(n, e) {
|
|
900
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
895
901
|
}
|
|
896
|
-
function
|
|
897
|
-
return e ?
|
|
902
|
+
function Le(n, e) {
|
|
903
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
898
904
|
}
|
|
899
|
-
function
|
|
900
|
-
return e ?
|
|
905
|
+
function q(n, e) {
|
|
906
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
901
907
|
}
|
|
902
|
-
function S(
|
|
903
|
-
return
|
|
908
|
+
function S(n) {
|
|
909
|
+
return n.isPrimary && n.button === 0;
|
|
904
910
|
}
|
|
905
|
-
const
|
|
906
|
-
function z(
|
|
907
|
-
const
|
|
908
|
-
return Number.parseFloat(i.toFixed(
|
|
911
|
+
const Re = 5;
|
|
912
|
+
function z(n, e, t) {
|
|
913
|
+
const a = e - n, i = (t - n) / a * 100;
|
|
914
|
+
return Number.parseFloat(i.toFixed(Re));
|
|
909
915
|
}
|
|
910
|
-
function
|
|
911
|
-
return Math.max(e, Math.min(t,
|
|
916
|
+
function j(n, e, t) {
|
|
917
|
+
return Math.max(e, Math.min(t, n));
|
|
912
918
|
}
|
|
913
|
-
|
|
919
|
+
Q("arcgis-slider", Pe);
|
|
914
920
|
export {
|
|
915
|
-
|
|
921
|
+
Pe as ArcgisSlider
|
|
916
922
|
};
|