@arcgis/common-components 5.2.0-next.146 → 5.2.0-next.148
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/3MYGEZOP.js +2 -0
- package/dist/cdn/QP6SIWPE.js +2 -0
- package/dist/cdn/YHEO5776.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-label-input/customElement.js +1 -1
- package/dist/components/arcgis-slider/customElement.js +522 -451
- package/dist/components/arcgis-ticks/customElement.js +8 -8
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/DBBRUMRI.js +0 -2
- package/dist/cdn/HCF255AI.js +0 -2
- package/dist/cdn/IFXBIZ77.js +0 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { makeAccessorController as
|
|
6
|
-
import { classes as
|
|
2
|
+
import { c as re } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as q } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as ie, createEvent as M, safeClassMap as S, safeStyleMap as F, nothing as P } from "@arcgis/lumina";
|
|
5
|
+
import { makeAccessorController as se } from "@arcgis/lumina-toolkit/useAccessor";
|
|
6
|
+
import { classes as le, getClosestElement as oe } from "@arcgis/toolkit/dom";
|
|
7
7
|
import { slotChangeHasAssignedElement as H } from "@arcgis/toolkit/dom/slots";
|
|
8
|
-
import { css as
|
|
9
|
-
import { map as
|
|
10
|
-
import { createRef as
|
|
11
|
-
import { u as
|
|
12
|
-
import { a as
|
|
13
|
-
import
|
|
14
|
-
import { property as
|
|
15
|
-
import { watch as
|
|
16
|
-
import { generateGuid as
|
|
17
|
-
const
|
|
8
|
+
import { css as ce, html as w } from "lit";
|
|
9
|
+
import { map as X } from "lit/directives/map.js";
|
|
10
|
+
import { createRef as j, ref as U } from "lit/directives/ref.js";
|
|
11
|
+
import { u as de } from "../../chunks/useT9n.js";
|
|
12
|
+
import { a as ue } from "../../chunks/locale.js";
|
|
13
|
+
import he from "@arcgis/core/core/Accessor.js";
|
|
14
|
+
import { property as E, subclass as ge } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
15
|
+
import { watch as K } from "@arcgis/core/core/reactiveUtils.js";
|
|
16
|
+
import { generateGuid as W } from "@arcgis/toolkit/string";
|
|
17
|
+
const _ = {
|
|
18
18
|
increment: "ArrowUp",
|
|
19
19
|
incrementHorizontal: "ArrowRight",
|
|
20
20
|
decrement: "ArrowDown",
|
|
@@ -25,85 +25,85 @@ const b = {
|
|
|
25
25
|
jumpToEnd: "End",
|
|
26
26
|
confirmEdit: "Enter"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
const i =
|
|
28
|
+
function Y({ key: r, shiftKey: e }, t, n) {
|
|
29
|
+
const i = me(r);
|
|
30
30
|
if (i == null)
|
|
31
31
|
return null;
|
|
32
|
-
const
|
|
32
|
+
const a = pe(r) || fe(r) && e ? ve(t) : 1;
|
|
33
33
|
return {
|
|
34
|
-
direction:
|
|
35
|
-
count:
|
|
34
|
+
direction: n ? i * -1 : i,
|
|
35
|
+
count: a
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function me(r) {
|
|
39
|
+
return r === _.increment || r === _.incrementHorizontal || r === _.pageIncrement ? 1 : r === _.decrement || r === _.decrementHorizontal || r === _.pageDecrement ? -1 : null;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
41
|
+
function J(r) {
|
|
42
|
+
return r === _.jumpToEnd || r === _.jumpToStart;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function fe(r) {
|
|
45
|
+
return r === _.increment || r === _.decrement || r === _.decrementHorizontal || r === _.incrementHorizontal;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
47
|
+
function pe(r) {
|
|
48
|
+
return r === _.pageIncrement || r === _.pageDecrement;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const e = Number.isFinite(
|
|
50
|
+
function ve(r) {
|
|
51
|
+
const e = Number.isFinite(r) ? Math.floor(r) : 1;
|
|
52
52
|
return Math.max(1, e);
|
|
53
53
|
}
|
|
54
|
-
const fe = se`:host{display:flex;width:100%;height:100%;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-internal-slider-show-range-labels: 0;--arcgis-internal-slider-show-value-labels: 0;--arcgis-internal-slider-value-labels-placement-start: 0;--arcgis-internal-slider-value-labels-placement-end: 0;--arcgis-internal-slider-range-labels-placement-center: 0;--arcgis-internal-slider-range-labels-placement-end: 0;--arcgis-internal-slider-handle-color: var(--calcite-color-text-3);--arcgis-internal-slider-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-internal-slider-label-input-margin: calc(var(--arcgis-internal-slider-handle-offset) + 4px);--arcgis-internal-slider-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-brand);--arcgis-internal-slider-track-size: 2px}:host([show-range-labels]){--arcgis-internal-slider-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-internal-slider-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-internal-slider-value-labels-placement-start: var(--arcgis-internal-slider-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-internal-slider-value-labels-placement-end: var(--arcgis-internal-slider-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-internal-slider-range-labels-placement-center: var(--arcgis-internal-slider-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-internal-slider-range-labels-placement-end: var(--arcgis-internal-slider-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-internal-slider-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)}: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-interactive{&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-border-2)}&.filled.active{outline-color:var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}.track-range{background-color:var(--arcgis-internal-slider-track-range-background-color);pointer-events:none}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range-interactive.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range-interactive.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range-interactive.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-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;width:2px;height:2px;margin:-1px;position:absolute}.thumb-content{width:0;height:0;position:absolute;top:50%;left:50%}.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))))}}.thumb.labels-only .handle{visibility:hidden;pointer-events:none}.thumb.labels-only{background-color:transparent}.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(--arcgis-internal-slider-handle-color) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--arcgis-internal-slider-transition-duration, var(--calcite-animation-timing, .125s)) ease-in-out;position:absolute;top:calc(var(--arcgis-internal-slider-handle-offset) * -1);left:calc(var(--arcgis-internal-slider-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}:host([layout="vertical"]) .fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) / 1.5);height:calc(var(--arcgis-slider-handle-size) * 1.5);cursor:ns-resize}.fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) * 1.5);height:calc(var(--arcgis-slider-handle-size) / 1.5);top:0;left:0;transform:translate(-50%,-50%);cursor:ew-resize}.label{position:absolute;will-change:transform}.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}:dir(rtl){.content-start,.content-end,.label,.max,.min,.popover{direction:rtl}}: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-internal-slider-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-internal-slider-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-internal-slider-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-internal-slider-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-internal-slider-content-start-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height)) );--arcgis-internal-slider-content-end-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) );column-gap:calc(var(--arcgis-internal-slider-show-range-labels) * var(--arcgis-internal-slider-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-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-internal-slider-content-start-min-height),auto) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) var(--arcgis-internal-slider-track-size) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:var(--arcgis-internal-slider-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="end"]){min-inline-size:min-content;.content{--arcgis-internal-slider-content-start-min-height: calc( var(--arcgis-internal-slider-handle-offset) + var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height) );--arcgis-internal-slider-content-end-min-height: calc( var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height) );padding-inline:var(--arcgis-internal-slider-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 0 auto;grid-template-rows:minmax(var(--arcgis-internal-slider-content-start-min-height),auto) var(--arcgis-internal-slider-track-size) var(--arcgis-internal-slider-handle-offset) calc(var(--arcgis-internal-slider-range-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label{top:calc(var(--arcgis-internal-slider-label-input-margin) + var(--arcgis-internal-slider-range-labels-placement-end) * (var(--arcgis-internal-slider-label-input-height)))}}.min,.max{--arcgis-internal-slider-range-translation: calc(var(--arcgis-internal-slider-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;margin-inline-start:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:3;margin-inline-end:calc(var(--arcgis-internal-slider-range-translation) * -1)}}&:host([mirrored]){.min{grid-column:3;margin-inline-end:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:1;margin-inline-start:calc(var(--arcgis-internal-slider-range-translation) * -1)}}}`;
|
|
55
|
-
var
|
|
56
|
-
throw TypeError(
|
|
57
|
-
}, V = (
|
|
58
|
-
for (var i =
|
|
59
|
-
(
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
function
|
|
54
|
+
const be = ce`:host{display:flex;width:100%;height:100%;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-internal-slider-show-range-labels: 0;--arcgis-internal-slider-show-value-labels: 0;--arcgis-internal-slider-value-labels-placement-start: 0;--arcgis-internal-slider-value-labels-placement-end: 0;--arcgis-internal-slider-range-labels-placement-center: 0;--arcgis-internal-slider-range-labels-placement-end: 0;--arcgis-internal-slider-handle-color: var(--calcite-color-text-3);--arcgis-internal-slider-handle-offset: calc(var(--arcgis-slider-handle-size) / 2);--arcgis-internal-slider-label-input-margin: calc(var(--arcgis-internal-slider-handle-offset) + 4px);--arcgis-internal-slider-label-input-height: var(--calcite-input-number-height, 1.5rem);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-brand);--arcgis-internal-slider-track-size: 2px}:host([show-range-labels]){--arcgis-internal-slider-show-range-labels: 1}:host(:not([value-labels-display="hidden"])){--arcgis-internal-slider-show-value-labels: 1}:host([value-labels-placement="start"]){--arcgis-internal-slider-value-labels-placement-start: var(--arcgis-internal-slider-show-value-labels)}:host([value-labels-placement="end"]){--arcgis-internal-slider-value-labels-placement-end: var(--arcgis-internal-slider-show-value-labels)}:host([range-labels-placement="center"]){--arcgis-internal-slider-range-labels-placement-center: var(--arcgis-internal-slider-show-range-labels)}:host([range-labels-placement="end"]){--arcgis-internal-slider-range-labels-placement-end: var(--arcgis-internal-slider-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-internal-slider-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(--arcgis-slider-track-background-color)}: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-interactive{&.active{box-shadow:0 0 8px #00000029;outline:1px solid var(--calcite-color-border-2)}&.filled.active{outline-color:var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}}.track-range{background-color:var(--arcgis-internal-slider-track-range-background-color);pointer-events:none}:host([disabled]) .track-range{background-color:var(--calcite-color-text-3)}:host([disabled]),:host([disabled][layout="horizontal"]),:host([disabled][layout="vertical"]){.track-range-interactive.interactive:after{cursor:default;pointer-events:none}}:host([layout="horizontal"]){.track-range-interactive.interactive:after{all:initial;cursor:ew-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-handle-offset));block-size:var(--arcgis-slider-handle-size);margin-top:1px}}:host([layout="vertical"]){.track-range-interactive.interactive:after{all:initial;cursor:ns-resize;position:absolute;inline-size:100%;content:"";inset-block-start:calc(-1 * var(--arcgis-internal-slider-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:var(--arcgis-internal-slider-track-size);position:absolute;top:0;left:0}.thumb{-webkit-user-select:none;user-select:none;background-color:#4c4c4c;width:2px;height:2px;margin:-1px;position:absolute}.thumb-content{width:0;height:0;position:absolute;top:50%;left:50%}.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))))}}.thumb.labels-only .handle{visibility:hidden;pointer-events:none}.thumb.labels-only{background-color:transparent}.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(--arcgis-internal-slider-handle-color) inset;border-radius:var(--arcgis-slider-handle-size);width:var(--arcgis-slider-handle-size);height:var(--arcgis-slider-handle-size);transition:all var(--arcgis-internal-slider-transition-duration, var(--calcite-animation-timing, .125s)) ease-in-out;position:absolute;top:calc(var(--arcgis-internal-slider-handle-offset) * -1);left:calc(var(--arcgis-internal-slider-handle-offset) * -1)}.handle:hover{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}:host([layout="vertical"]) .fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) / 1.5);height:calc(var(--arcgis-slider-handle-size) * 1.5);cursor:ns-resize}.fixed-thumb .handle{width:calc(var(--arcgis-slider-handle-size) * 1.5);height:calc(var(--arcgis-slider-handle-size) / 1.5);top:0;left:0;transform:translate(-50%,-50%);cursor:ew-resize}.label{position:absolute;will-change:transform}.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}:dir(rtl){.content-start,.content-end,.label,.max,.min,.popover{direction:rtl}}: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-internal-slider-handle-offset)}.track-container{flex-direction:column}.track{flex:1;width:var(--arcgis-internal-slider-track-size)}.segment{writing-mode:vertical-lr}.label{top:calc(var(--arcgis-internal-slider-label-input-height) * -.5)}&:host([value-labels-placement="start"]){.label{right:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label{left:var(--arcgis-internal-slider-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="center"]){.content{--arcgis-internal-slider-content-start-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height)) );--arcgis-internal-slider-content-end-min-height: calc( ((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-handle-offset)) + (var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) );column-gap:calc(var(--arcgis-internal-slider-show-range-labels) * var(--arcgis-internal-slider-handle-offset) / 2);padding-inline:calc((1 - var(--arcgis-internal-slider-show-range-labels)) * var(--arcgis-internal-slider-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-internal-slider-content-start-min-height),auto) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) var(--arcgis-internal-slider-track-size) calc(var(--arcgis-internal-slider-show-range-labels) * calc(calc(var(--arcgis-internal-slider-label-input-height) / 2) - calc(var(--arcgis-internal-slider-track-size) / 2))) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label,.label-separator{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label,.label-separator{top:var(--arcgis-internal-slider-label-input-margin)}}}.label-separator{position:absolute;width:1em;height:var(--arcgis-internal-slider-label-input-height);margin:0;padding:0;pointer-events:none;text-align:center;z-index:0}.label-separator:before{content:"—"}:host([layout="horizontal"]) .label-separator{transform:translate(-50%)}:host([layout="horizontal"][range-labels-placement="end"]){min-inline-size:min-content;.content{--arcgis-internal-slider-content-start-min-height: calc( var(--arcgis-internal-slider-handle-offset) + var(--arcgis-internal-slider-value-labels-placement-start) * var(--arcgis-internal-slider-label-input-height) );--arcgis-internal-slider-content-end-min-height: calc( var(--arcgis-internal-slider-value-labels-placement-end) * var(--arcgis-internal-slider-label-input-height) );padding-inline:var(--arcgis-internal-slider-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 0 auto;grid-template-rows:minmax(var(--arcgis-internal-slider-content-start-min-height),auto) var(--arcgis-internal-slider-track-size) var(--arcgis-internal-slider-handle-offset) calc(var(--arcgis-internal-slider-range-labels-placement-end) * var(--arcgis-internal-slider-label-input-height)) minmax(var(--arcgis-internal-slider-content-end-min-height),auto)}.track{flex:1;height:var(--arcgis-internal-slider-track-size)}&:host([value-labels-placement="start"]){.label,.label-separator{bottom:var(--arcgis-internal-slider-label-input-margin)}}&:host([value-labels-placement="end"]){.label,.label-separator{top:calc(var(--arcgis-internal-slider-label-input-margin) + var(--arcgis-internal-slider-range-labels-placement-end) * (var(--arcgis-internal-slider-label-input-height)))}}.min,.max{--arcgis-internal-slider-range-translation: calc(var(--arcgis-internal-slider-handle-offset) + .5rem + 1px);grid-area:unset;grid-row:-3}&:host(:not([mirrored])){.min{grid-column:1;margin-inline-start:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:3;margin-inline-end:calc(var(--arcgis-internal-slider-range-translation) * -1)}}&:host([mirrored]){.min{grid-column:3;margin-inline-end:calc(var(--arcgis-internal-slider-range-translation) * -1)}.max{grid-column:1;margin-inline-start:calc(var(--arcgis-internal-slider-range-translation) * -1)}}}`;
|
|
55
|
+
var _e = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, ee = (r) => {
|
|
56
|
+
throw TypeError(r);
|
|
57
|
+
}, V = (r, e, t, n) => {
|
|
58
|
+
for (var i = n > 1 ? void 0 : n ? xe(e, t) : e, a = r.length - 1, o; a >= 0; a--)
|
|
59
|
+
(o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
|
|
60
|
+
return n && i && _e(e, t, i), i;
|
|
61
|
+
}, te = (r, e, t) => e.has(r) || ee("Cannot " + t), we = (r, e, t) => (te(r, e, "read from private field"), e.get(r)), ye = (r, e, t) => e.has(r) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ke = (r, e, t, n) => (te(r, e, "write to private field"), e.set(r, t), t), A;
|
|
62
|
+
function De() {
|
|
63
63
|
return {
|
|
64
64
|
min: 0,
|
|
65
65
|
max: 100,
|
|
66
66
|
values: []
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
let k = class extends
|
|
69
|
+
let k = class extends he {
|
|
70
70
|
//--------------------------------------------------------------------------
|
|
71
71
|
//
|
|
72
72
|
// Lifecycle
|
|
73
73
|
//
|
|
74
74
|
//--------------------------------------------------------------------------
|
|
75
|
-
constructor(
|
|
76
|
-
super({ ...
|
|
75
|
+
constructor(r = {}) {
|
|
76
|
+
super({ ...De(), properties: r }), this._entries = /* @__PURE__ */ new Map(), this.precision = 4, this.ready = !1, ye(this, A);
|
|
77
77
|
}
|
|
78
78
|
startup() {
|
|
79
|
-
const { precision:
|
|
80
|
-
let { min: e, max: t, values:
|
|
81
|
-
t =
|
|
82
|
-
const i = new Map(
|
|
83
|
-
this._entries = i,
|
|
79
|
+
const { precision: r } = this;
|
|
80
|
+
let { min: e, max: t, values: n } = this;
|
|
81
|
+
t = y(t, r), e = y(e, r), n = n?.map((a) => L(y(a, r), e, t)).sort((a, o) => a - o), this._set("min", e), this._set("max", t), this._set("values", n);
|
|
82
|
+
const i = new Map(n?.map((a) => [W(), a]));
|
|
83
|
+
this._entries = i, K(
|
|
84
84
|
() => this.min,
|
|
85
|
-
(
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
(a) => {
|
|
86
|
+
const o = this.values;
|
|
87
|
+
a != null && o?.length && o.some((s) => s < a) && (this._entries.forEach((s, l) => {
|
|
88
|
+
s < a && this._entries.set(l, a);
|
|
89
89
|
}), this._updatesValues());
|
|
90
90
|
},
|
|
91
91
|
{ sync: !0 }
|
|
92
|
-
),
|
|
92
|
+
), K(
|
|
93
93
|
() => this.max,
|
|
94
|
-
(
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
(a) => {
|
|
95
|
+
const o = this.values;
|
|
96
|
+
a != null && o?.length && o.some((s) => s > a) && (this._entries.forEach((s, l) => {
|
|
97
|
+
s > a && this._entries.set(l, a);
|
|
98
98
|
}), this._updatesValues());
|
|
99
99
|
},
|
|
100
100
|
{ sync: !0 }
|
|
101
|
-
),
|
|
101
|
+
), K(
|
|
102
102
|
() => this.precision,
|
|
103
|
-
(
|
|
104
|
-
const { min:
|
|
105
|
-
this._set("min",
|
|
106
|
-
this._entries.set(d,
|
|
103
|
+
(a) => {
|
|
104
|
+
const { min: o, max: s, values: l } = this;
|
|
105
|
+
this._set("min", y(o, a)), this._set("max", y(s, a)), l?.length && (this._entries.forEach((c, d) => {
|
|
106
|
+
this._entries.set(d, y(c, a));
|
|
107
107
|
}), this._updatesValues());
|
|
108
108
|
},
|
|
109
109
|
{ sync: !0 }
|
|
@@ -112,42 +112,42 @@ let k = class extends ce {
|
|
|
112
112
|
get entries() {
|
|
113
113
|
return this._entries;
|
|
114
114
|
}
|
|
115
|
-
set max(
|
|
115
|
+
set max(r) {
|
|
116
116
|
if (!this.ready) {
|
|
117
|
-
this._set("max",
|
|
117
|
+
this._set("max", r);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
const e = this._get("max"), t =
|
|
120
|
+
const e = this._get("max"), t = y(r, this.precision);
|
|
121
121
|
e !== t && this._set("max", t);
|
|
122
122
|
}
|
|
123
|
-
set min(
|
|
123
|
+
set min(r) {
|
|
124
124
|
if (!this.ready) {
|
|
125
|
-
this._set("min",
|
|
125
|
+
this._set("min", r);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
const e = this._get("min"), t =
|
|
128
|
+
const e = this._get("min"), t = y(r, this.precision);
|
|
129
129
|
e !== t && this._set("min", t);
|
|
130
130
|
}
|
|
131
|
-
set values(
|
|
132
|
-
if (
|
|
131
|
+
set values(r) {
|
|
132
|
+
if (we(this, A) === r)
|
|
133
133
|
return;
|
|
134
|
-
if (
|
|
135
|
-
this._set("values",
|
|
134
|
+
if (ke(this, A, r), !this.ready) {
|
|
135
|
+
this._set("values", r);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
const e = this._get("values");
|
|
139
|
-
if (
|
|
139
|
+
if (r = r?.map((n) => L(y(n, this.precision), this.min, this.max)).sort((n, i) => n - i), e?.length === r?.length && e.every((n, i) => n === r[i]))
|
|
140
140
|
return;
|
|
141
|
-
const t = new Map(
|
|
142
|
-
this._entries = t, this._set("values",
|
|
141
|
+
const t = new Map(r?.map((n) => [W(), n]));
|
|
142
|
+
this._entries = t, this._set("values", r);
|
|
143
143
|
}
|
|
144
144
|
//--------------------------------------------------------------------------
|
|
145
145
|
//
|
|
146
146
|
// Public Methods
|
|
147
147
|
//
|
|
148
148
|
//--------------------------------------------------------------------------
|
|
149
|
-
getValue(
|
|
150
|
-
return this._entries.get(
|
|
149
|
+
getValue(r) {
|
|
150
|
+
return this._entries.get(r);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Updates a thumb [value](#values) based on the provided index. The provided value
|
|
@@ -156,354 +156,354 @@ let k = class extends ce {
|
|
|
156
156
|
*
|
|
157
157
|
* @returns `true` if the value was changed, otherwise `false`.
|
|
158
158
|
*/
|
|
159
|
-
setValue(
|
|
159
|
+
setValue(r, e) {
|
|
160
160
|
if (this.values == null)
|
|
161
161
|
return !1;
|
|
162
|
-
const { min: t, max:
|
|
163
|
-
return i ===
|
|
162
|
+
const { min: t, max: n } = this, i = this._entries.get(r), a = L(y(e, this.precision), t, n);
|
|
163
|
+
return i === a ? !1 : (this._entries.set(r, a), this._updatesValues(), !0);
|
|
164
164
|
}
|
|
165
|
-
setValues(
|
|
165
|
+
setValues(r) {
|
|
166
166
|
if (this.values == null)
|
|
167
167
|
return !1;
|
|
168
168
|
let e = !1;
|
|
169
|
-
const { min: t, max:
|
|
170
|
-
for (const [i,
|
|
171
|
-
const
|
|
172
|
-
|
|
169
|
+
const { min: t, max: n } = this;
|
|
170
|
+
for (const [i, a] of r) {
|
|
171
|
+
const o = this._entries.get(i), s = L(y(a, this.precision), t, n);
|
|
172
|
+
o !== s && (e = !0, this._entries.set(i, s));
|
|
173
173
|
}
|
|
174
174
|
return e ? (this._updatesValues(), !0) : !1;
|
|
175
175
|
}
|
|
176
176
|
_updatesValues() {
|
|
177
|
-
const
|
|
178
|
-
this._set("values",
|
|
177
|
+
const r = Array.from(this._entries.values()).sort((e, t) => e - t);
|
|
178
|
+
this._set("values", r);
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
A = /* @__PURE__ */ new WeakMap();
|
|
182
182
|
V([
|
|
183
|
-
|
|
183
|
+
E()
|
|
184
184
|
], k.prototype, "_entries", 2);
|
|
185
185
|
V([
|
|
186
|
-
|
|
186
|
+
E({ readOnly: !0 })
|
|
187
187
|
], k.prototype, "entries", 1);
|
|
188
188
|
V([
|
|
189
|
-
|
|
189
|
+
E()
|
|
190
190
|
], k.prototype, "max", 1);
|
|
191
191
|
V([
|
|
192
|
-
|
|
192
|
+
E()
|
|
193
193
|
], k.prototype, "min", 1);
|
|
194
194
|
V([
|
|
195
|
-
|
|
195
|
+
E({ cast: (r) => L(r, 0, 20) })
|
|
196
196
|
], k.prototype, "precision", 2);
|
|
197
197
|
V([
|
|
198
|
-
|
|
198
|
+
E({ readOnly: !0 })
|
|
199
199
|
], k.prototype, "ready", 2);
|
|
200
200
|
V([
|
|
201
|
-
|
|
201
|
+
E()
|
|
202
202
|
], k.prototype, "values", 1);
|
|
203
203
|
k = V([
|
|
204
|
-
|
|
204
|
+
ge("esri.widgets.Slider.SliderData")
|
|
205
205
|
], k);
|
|
206
|
-
function
|
|
207
|
-
return Math.min(Math.max(
|
|
206
|
+
function L(r, e, t) {
|
|
207
|
+
return Math.min(Math.max(r, e), t);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return Number.parseFloat(
|
|
209
|
+
function y(r, e) {
|
|
210
|
+
return Number.parseFloat(r.toFixed(e));
|
|
211
211
|
}
|
|
212
|
-
class
|
|
212
|
+
class Ie {
|
|
213
213
|
constructor(e) {
|
|
214
214
|
this.steps = e, this.minIndex = 0, this.maxIndex = this.steps.length - 1;
|
|
215
215
|
}
|
|
216
216
|
indexToValue(e) {
|
|
217
|
-
return this.steps[
|
|
217
|
+
return this.steps[I(e, this.minIndex, this.maxIndex)];
|
|
218
218
|
}
|
|
219
219
|
valueToIndex(e) {
|
|
220
220
|
const t = this.steps.indexOf(e);
|
|
221
221
|
return t !== -1 ? t : this.steps.reduce(
|
|
222
|
-
(
|
|
222
|
+
(n, i, a, o) => Math.abs(i - e) < Math.abs(o[n] - e) ? a : n,
|
|
223
223
|
0
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
getClosestStepDistances(e, t) {
|
|
227
227
|
if (t <= 0)
|
|
228
228
|
return [];
|
|
229
|
-
const
|
|
229
|
+
const n = [];
|
|
230
230
|
for (let i = this.minIndex; i <= this.maxIndex; i++) {
|
|
231
|
-
const
|
|
232
|
-
let
|
|
233
|
-
for (let
|
|
234
|
-
if (
|
|
235
|
-
|
|
231
|
+
const a = this.indexToValue(i), o = Math.abs(a - e);
|
|
232
|
+
let s = !1;
|
|
233
|
+
for (let l = 0; l < n.length; l++)
|
|
234
|
+
if (o < n[l].dist) {
|
|
235
|
+
n.splice(l, 0, { idx: i, value: a, dist: o }), s = !0;
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
238
|
-
!
|
|
238
|
+
!s && n.length < t && n.push({ idx: i, value: a, dist: o }), n.length > t && (n.length = t);
|
|
239
239
|
}
|
|
240
|
-
return
|
|
240
|
+
return n;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
class
|
|
244
|
-
constructor(e, t,
|
|
245
|
-
this.min = e, this.max = t, this.stepSize =
|
|
243
|
+
class Ve {
|
|
244
|
+
constructor(e, t, n) {
|
|
245
|
+
this.min = e, this.max = t, this.stepSize = n, this.minIndex = 0, this.maxIndex = Math.round((this.max - this.min) / this.stepSize);
|
|
246
246
|
}
|
|
247
247
|
indexToValue(e) {
|
|
248
|
-
return this.min +
|
|
248
|
+
return this.min + I(e, this.minIndex, this.maxIndex) * this.stepSize;
|
|
249
249
|
}
|
|
250
250
|
valueToIndex(e) {
|
|
251
|
-
return e =
|
|
251
|
+
return e = I(e, this.min, this.max), Math.round((e - this.min) / this.stepSize);
|
|
252
252
|
}
|
|
253
253
|
getClosestStepDistances(e, t) {
|
|
254
254
|
if (t <= 0)
|
|
255
255
|
return [];
|
|
256
|
-
const
|
|
257
|
-
let
|
|
258
|
-
for (;
|
|
259
|
-
if (
|
|
256
|
+
const n = [], i = this.minIndex, a = this.maxIndex, s = (I(e, this.min, this.max) - this.min) / this.stepSize;
|
|
257
|
+
let l = Math.floor(s), c = l + 1;
|
|
258
|
+
for (; n.length < t && (l >= i || c <= a); ) {
|
|
259
|
+
if (l < i) {
|
|
260
260
|
const m = this.indexToValue(c);
|
|
261
|
-
|
|
261
|
+
n.push({ idx: c, value: m, dist: Math.abs(m - e) }), c++;
|
|
262
262
|
continue;
|
|
263
263
|
}
|
|
264
|
-
if (c >
|
|
265
|
-
const m = this.indexToValue(
|
|
266
|
-
|
|
264
|
+
if (c > a) {
|
|
265
|
+
const m = this.indexToValue(l);
|
|
266
|
+
n.push({ idx: l, value: m, dist: Math.abs(m - e) }), l--;
|
|
267
267
|
continue;
|
|
268
268
|
}
|
|
269
|
-
const d = this.indexToValue(
|
|
270
|
-
|
|
269
|
+
const d = this.indexToValue(l), h = this.indexToValue(c), u = Math.abs(d - e), f = Math.abs(h - e);
|
|
270
|
+
u <= f ? (n.push({ idx: l, value: d, dist: u }), l--) : (n.push({ idx: c, value: h, dist: f }), c++);
|
|
271
271
|
}
|
|
272
|
-
return
|
|
272
|
+
return n;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
if (
|
|
275
|
+
function Ee(r) {
|
|
276
|
+
if (r.steps == null)
|
|
277
277
|
return null;
|
|
278
|
-
const e =
|
|
279
|
-
return Array.isArray(e) ? e.length === 0 ? null : new
|
|
280
|
-
}
|
|
281
|
-
function
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
for (const [
|
|
285
|
-
|
|
286
|
-
return
|
|
287
|
-
}
|
|
288
|
-
const
|
|
289
|
-
const c =
|
|
290
|
-
return { uuid:
|
|
291
|
-
}),
|
|
292
|
-
i.sort((
|
|
293
|
-
for (const
|
|
294
|
-
const
|
|
295
|
-
|
|
278
|
+
const e = r.steps;
|
|
279
|
+
return Array.isArray(e) ? e.length === 0 ? null : new Ie(e) : e <= 0 ? null : new Ve(r.min, r.max, e);
|
|
280
|
+
}
|
|
281
|
+
function Ce(r, e, t) {
|
|
282
|
+
if (r == null) {
|
|
283
|
+
const s = /* @__PURE__ */ new Map();
|
|
284
|
+
for (const [l, c] of e.entries())
|
|
285
|
+
s.set(l, c + t);
|
|
286
|
+
return s;
|
|
287
|
+
}
|
|
288
|
+
const n = e.size, i = Array.from(e.entries()).map(([s, l]) => {
|
|
289
|
+
const c = l + t, d = r.getClosestStepDistances(c, n);
|
|
290
|
+
return { uuid: s, stepDistances: d };
|
|
291
|
+
}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
292
|
+
i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
|
|
293
|
+
for (const s of i) {
|
|
294
|
+
const l = s.stepDistances.find((c) => !a.has(c.idx));
|
|
295
|
+
l ? (a.add(l.idx), o.set(s.uuid, l.value)) : o.set(s.uuid, e.get(s.uuid));
|
|
296
296
|
}
|
|
297
|
-
return
|
|
297
|
+
return o;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
const { allowValuesOverlap:
|
|
301
|
-
let
|
|
302
|
-
if (
|
|
299
|
+
function O(r, e, t, n, i) {
|
|
300
|
+
const { allowValuesOverlap: a, precision: o, min: s, max: l } = i, c = e.get(t) ?? 0, d = c + n, h = n >= 0 ? -1 : 1;
|
|
301
|
+
let u, f, m;
|
|
302
|
+
if (r) {
|
|
303
303
|
const p = /* @__PURE__ */ new Set();
|
|
304
|
-
if (!
|
|
304
|
+
if (!a)
|
|
305
305
|
for (const [v, x] of e.entries())
|
|
306
|
-
v !== t && p.add(
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
let
|
|
310
|
-
|
|
306
|
+
v !== t && p.add(r.valueToIndex(x));
|
|
307
|
+
const b = r.getClosestStepDistances(d, e.size + 1);
|
|
308
|
+
b.sort((v, x) => z(v.dist, o) - z(x.dist, o) || h * (x.value - v.value));
|
|
309
|
+
let g = 0;
|
|
310
|
+
u = b[g].value, m = (v) => !a && p.has(r.valueToIndex(v)), f = () => (g++, b[g]?.value);
|
|
311
311
|
} else {
|
|
312
312
|
const p = /* @__PURE__ */ new Set();
|
|
313
|
-
for (const [
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
return
|
|
313
|
+
for (const [g, v] of e.entries())
|
|
314
|
+
g !== t && p.add(z(v, o));
|
|
315
|
+
const b = 1 / Math.pow(10, o);
|
|
316
|
+
u = I(z(d, o), s, l), m = (g) => !a && p.has(g), f = () => {
|
|
317
|
+
const g = z(u + h * b, o);
|
|
318
|
+
return g === u || g < s || g > l ? void 0 : g;
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
if (!m(
|
|
322
|
-
return
|
|
321
|
+
if (!m(u))
|
|
322
|
+
return u;
|
|
323
323
|
for (; ; ) {
|
|
324
324
|
const p = f();
|
|
325
325
|
if (p === void 0)
|
|
326
326
|
return c;
|
|
327
|
-
if (
|
|
328
|
-
return
|
|
327
|
+
if (u = p, !m(u))
|
|
328
|
+
return u;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return Number.parseFloat(
|
|
331
|
+
function z(r, e) {
|
|
332
|
+
return Number.parseFloat(r.toFixed(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
const i =
|
|
336
|
-
let
|
|
337
|
-
for (let
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
334
|
+
function Pe(r, e, t, n = 1) {
|
|
335
|
+
const i = ne(n);
|
|
336
|
+
let a = e, o = !1;
|
|
337
|
+
for (let s = 0; s < i; s++) {
|
|
338
|
+
const l = Se(r, a, t);
|
|
339
|
+
if (o ||= l.changed, a = l.entries, !l.changed)
|
|
340
340
|
break;
|
|
341
341
|
}
|
|
342
|
-
return { changed:
|
|
343
|
-
}
|
|
344
|
-
function
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
return
|
|
348
|
-
const
|
|
349
|
-
let
|
|
350
|
-
for (let
|
|
351
|
-
const c =
|
|
352
|
-
if (c ===
|
|
342
|
+
return { changed: o, entries: a };
|
|
343
|
+
}
|
|
344
|
+
function Te(r, e, t, n, i = 1) {
|
|
345
|
+
const a = ne(i);
|
|
346
|
+
if (a === 1)
|
|
347
|
+
return N(r, e, t, n);
|
|
348
|
+
const o = new Map(e);
|
|
349
|
+
let s = o.get(t);
|
|
350
|
+
for (let l = 0; l < a; l++) {
|
|
351
|
+
const c = N(r, o, t, n);
|
|
352
|
+
if (c === s)
|
|
353
353
|
break;
|
|
354
|
-
|
|
354
|
+
s = c, o.set(t, s);
|
|
355
355
|
}
|
|
356
|
-
return
|
|
356
|
+
return s;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
const e = Number.isFinite(
|
|
358
|
+
function ne(r) {
|
|
359
|
+
const e = Number.isFinite(r) ? Math.floor(r) : 1;
|
|
360
360
|
return Math.max(1, e);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const
|
|
364
|
-
let
|
|
365
|
-
for (const [
|
|
366
|
-
if (
|
|
367
|
-
const d =
|
|
368
|
-
c === d && (
|
|
362
|
+
function Se(r, e, t) {
|
|
363
|
+
const n = /* @__PURE__ */ new Map(), i = t > 0 ? Re : ae, a = Array.from(e).sort((l, c) => i(l[1], c[1]));
|
|
364
|
+
let o = !1, s = !0;
|
|
365
|
+
for (const [l, c] of a)
|
|
366
|
+
if (n.set(l, c), s) {
|
|
367
|
+
const d = N(r, n, l, t);
|
|
368
|
+
c === d && (s = !1), o ||= s, n.set(l, d);
|
|
369
369
|
}
|
|
370
|
-
return { changed:
|
|
370
|
+
return { changed: o, entries: n };
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
const { allowValuesOverlap: i, stepsProvider:
|
|
374
|
-
if (
|
|
375
|
-
let
|
|
372
|
+
function N(r, e, t, n) {
|
|
373
|
+
const { allowValuesOverlap: i, stepsProvider: a, resolution: o, min: s, max: l } = r, c = e.get(t);
|
|
374
|
+
if (n = n > 0 ? 1 : -1, !a) {
|
|
375
|
+
let g = I(c + n * o, s, l);
|
|
376
376
|
if (i)
|
|
377
|
-
return
|
|
377
|
+
return g;
|
|
378
378
|
const v = /* @__PURE__ */ new Set();
|
|
379
|
-
for (const [x,
|
|
380
|
-
x !== t && v.add(
|
|
381
|
-
for (; v.has(
|
|
382
|
-
const x =
|
|
383
|
-
if (
|
|
379
|
+
for (const [x, D] of e)
|
|
380
|
+
x !== t && v.add(D);
|
|
381
|
+
for (; v.has(g) && g <= l && g >= s; ) {
|
|
382
|
+
const x = g;
|
|
383
|
+
if (g = I(g + n * o, s, l), g === x)
|
|
384
384
|
return c;
|
|
385
385
|
}
|
|
386
|
-
return v.has(
|
|
386
|
+
return v.has(g) || g > l || g < s ? c : g;
|
|
387
387
|
}
|
|
388
|
-
const d =
|
|
388
|
+
const d = a.valueToIndex(c);
|
|
389
389
|
if (d === -1)
|
|
390
390
|
return c;
|
|
391
391
|
if (i) {
|
|
392
|
-
const
|
|
393
|
-
return
|
|
394
|
-
}
|
|
395
|
-
const
|
|
396
|
-
for (const [
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
const m =
|
|
400
|
-
let
|
|
401
|
-
for (;
|
|
402
|
-
if (!
|
|
392
|
+
const g = I(d + n, a.minIndex, a.maxIndex);
|
|
393
|
+
return a.indexToValue(g);
|
|
394
|
+
}
|
|
395
|
+
const h = /* @__PURE__ */ new Set();
|
|
396
|
+
for (const [g, v] of e)
|
|
397
|
+
g !== t && h.add(a.valueToIndex(v));
|
|
398
|
+
let u = d, f = !1;
|
|
399
|
+
const m = a.minIndex, p = a.maxIndex;
|
|
400
|
+
let b = 0;
|
|
401
|
+
for (; b < Math.abs(p - m) && (u += n, !(u < m || u > p)); ) {
|
|
402
|
+
if (!h.has(u)) {
|
|
403
403
|
f = !0;
|
|
404
404
|
break;
|
|
405
405
|
}
|
|
406
|
-
|
|
406
|
+
b++;
|
|
407
407
|
}
|
|
408
|
-
return f ?
|
|
408
|
+
return f ? a.indexToValue(u) : c;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
const { allowValuesOverlap: i, stepsProvider:
|
|
412
|
-
if (
|
|
410
|
+
function ze(r, e, t, n) {
|
|
411
|
+
const { allowValuesOverlap: i, stepsProvider: a, resolution: o, min: s, max: l } = r, c = e.get(t);
|
|
412
|
+
if (n = n > 0 ? 1 : -1, !a) {
|
|
413
413
|
const f = new Set(
|
|
414
414
|
Array.from(e).filter(([p]) => p !== t).map(([, p]) => p)
|
|
415
415
|
);
|
|
416
|
-
let m =
|
|
416
|
+
let m = n > 0 ? l : s;
|
|
417
417
|
if (i)
|
|
418
418
|
return m;
|
|
419
419
|
for (; f.has(m); )
|
|
420
|
-
if (m -=
|
|
420
|
+
if (m -= n * o, n > 0 && m > l || n < 0 && m < s) {
|
|
421
421
|
m = c;
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
return m;
|
|
425
425
|
}
|
|
426
426
|
if (i)
|
|
427
|
-
return
|
|
428
|
-
const d =
|
|
427
|
+
return n > 0 ? a.indexToValue(a.maxIndex) : a.indexToValue(a.minIndex);
|
|
428
|
+
const d = a.valueToIndex(c);
|
|
429
429
|
if (d === -1)
|
|
430
430
|
return c;
|
|
431
|
-
const
|
|
432
|
-
Array.from(e).filter(([f]) => f !== t).map(([, f]) =>
|
|
431
|
+
const h = new Set(
|
|
432
|
+
Array.from(e).filter(([f]) => f !== t).map(([, f]) => a.valueToIndex(f))
|
|
433
433
|
);
|
|
434
|
-
let
|
|
435
|
-
for (;
|
|
436
|
-
if (
|
|
437
|
-
|
|
434
|
+
let u = n > 0 ? a.maxIndex : a.minIndex;
|
|
435
|
+
for (; h.has(u); )
|
|
436
|
+
if (u -= n, n > 0 && u > l || n < 0 && u < s) {
|
|
437
|
+
u = d;
|
|
438
438
|
break;
|
|
439
439
|
}
|
|
440
|
-
return
|
|
440
|
+
return a.indexToValue(u);
|
|
441
441
|
}
|
|
442
|
-
function $e(
|
|
443
|
-
const { stepsProvider:
|
|
444
|
-
if (
|
|
442
|
+
function $e(r, e, t) {
|
|
443
|
+
const { stepsProvider: n, min: i, max: a } = r, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, d) => ae(c[1], d[1]));
|
|
444
|
+
if (n) {
|
|
445
445
|
let c = 0;
|
|
446
446
|
if (t > 0) {
|
|
447
|
-
const d =
|
|
448
|
-
c =
|
|
447
|
+
const d = s[s.length - 1], h = n.valueToIndex(d[1]);
|
|
448
|
+
c = n.maxIndex - h;
|
|
449
449
|
} else {
|
|
450
|
-
const d =
|
|
451
|
-
c =
|
|
450
|
+
const d = s[0], h = n.valueToIndex(d[1]);
|
|
451
|
+
c = n.minIndex - h;
|
|
452
452
|
}
|
|
453
453
|
if (c === 0)
|
|
454
|
-
for (const [d,
|
|
455
|
-
|
|
456
|
-
for (const [d,
|
|
457
|
-
const
|
|
458
|
-
|
|
454
|
+
for (const [d, h] of s)
|
|
455
|
+
o.set(d, h);
|
|
456
|
+
for (const [d, h] of s) {
|
|
457
|
+
const u = n.indexToValue(n.valueToIndex(h) + c);
|
|
458
|
+
o.set(d, u);
|
|
459
459
|
}
|
|
460
|
-
return
|
|
460
|
+
return o;
|
|
461
461
|
}
|
|
462
|
-
let
|
|
462
|
+
let l = 0;
|
|
463
463
|
if (t > 0) {
|
|
464
|
-
const c =
|
|
465
|
-
|
|
464
|
+
const c = s[s.length - 1];
|
|
465
|
+
l = a - c[1];
|
|
466
466
|
} else {
|
|
467
|
-
const c =
|
|
468
|
-
|
|
467
|
+
const c = s[0];
|
|
468
|
+
l = i - c[1];
|
|
469
469
|
}
|
|
470
|
-
for (const [c, d] of
|
|
471
|
-
|
|
472
|
-
return
|
|
470
|
+
for (const [c, d] of s)
|
|
471
|
+
o.set(c, d + l);
|
|
472
|
+
return o;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
474
|
+
function ae(r, e) {
|
|
475
|
+
return r - e;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return e -
|
|
477
|
+
function Re(r, e) {
|
|
478
|
+
return e - r;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return Math.max(e, Math.min(t,
|
|
480
|
+
function I(r, e, t) {
|
|
481
|
+
return Math.max(e, Math.min(t, r));
|
|
482
482
|
}
|
|
483
|
-
const
|
|
484
|
-
class
|
|
483
|
+
const Le = se(k);
|
|
484
|
+
class Me extends ie {
|
|
485
485
|
constructor() {
|
|
486
|
-
super(...arguments), this._stepsProvider = null, this._popoverElement =
|
|
486
|
+
super(...arguments), this._stepsProvider = null, this._popoverElement = j(), this._trackElement = j(), this.messages = de({}), this._onPointerMoveDragUpdate = (e) => {
|
|
487
487
|
this._updateDrag(this._mapEventToRange(e));
|
|
488
488
|
}, this._onPointerUpDragEnd = (e) => {
|
|
489
|
-
|
|
489
|
+
R(e) && this._endDrag();
|
|
490
490
|
}, this._onPointerCancelDragEnd = () => {
|
|
491
491
|
this._endDrag();
|
|
492
|
-
}, this._formatLabel = (e, t,
|
|
493
|
-
const i =
|
|
494
|
-
if (!
|
|
495
|
-
return i.format(
|
|
496
|
-
const
|
|
497
|
-
return
|
|
492
|
+
}, this._formatLabel = (e, t, n) => {
|
|
493
|
+
const i = ue(this.messages._lang, t), a = this.labelFormatter;
|
|
494
|
+
if (!a)
|
|
495
|
+
return i.format(n);
|
|
496
|
+
const o = a(n, e, (s) => i.format(s));
|
|
497
|
+
return o ?? i.format(n);
|
|
498
498
|
}, 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(() => {
|
|
499
|
-
this._layoutLabelInputs();
|
|
500
|
-
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._activePart = null, this._sliderData =
|
|
499
|
+
this._layoutLabelInputs(), this._updatePopoverReferenceElement();
|
|
500
|
+
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._measurablePopoverReferenceElement = "", this._activePart = null, this._sliderData = Le(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.popoverDisplay = "auto", this.popoverLabel = "", this.popoverPlacement = "start", this.precision = this._sliderData.precision, this.valuesDraggingDisabled = !1, 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 = M({ cancelable: !1 }), this.arcgisChange = M({ cancelable: !1 }), this.arcgisInput = M({ cancelable: !1 }), this.arcgisRangeChange = M({ cancelable: !1 });
|
|
501
501
|
}
|
|
502
502
|
static {
|
|
503
|
-
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, popoverDisplay: 1, popoverLabel: 1, popoverPlacement: 3, precision: 11, valuesDraggingDisabled: 7, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 3, segmentsDraggingDisabled: 5, showRangeLabels: 7, steps: [9, { converter: {
|
|
503
|
+
this.properties = { _dragInfo: 16, _hasPopoverContent: 16, _hasContentStart: 16, _hasContentEnd: 16, _measurablePopoverReferenceElement: 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, popoverDisplay: 1, popoverLabel: 1, popoverPlacement: 3, precision: 11, valuesDraggingDisabled: 7, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 3, segmentsDraggingDisabled: 5, showRangeLabels: 7, steps: [9, { converter: {
|
|
504
504
|
fromAttribute(e) {
|
|
505
505
|
if (e.includes(","))
|
|
506
|
-
return e.split(",").filter((
|
|
506
|
+
return e.split(",").filter((n) => n.trim() !== "").map(parseFloat).filter((n) => Number.isFinite(n));
|
|
507
507
|
const t = parseFloat(e);
|
|
508
508
|
return Number.isFinite(t) ? t : void 0;
|
|
509
509
|
}
|
|
@@ -514,7 +514,7 @@ class Se extends ae {
|
|
|
514
514
|
} }], messageOverrides: 0 };
|
|
515
515
|
}
|
|
516
516
|
static {
|
|
517
|
-
this.styles =
|
|
517
|
+
this.styles = be;
|
|
518
518
|
}
|
|
519
519
|
static {
|
|
520
520
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -539,8 +539,8 @@ class Se extends ae {
|
|
|
539
539
|
return this.disabled || this.values.length === 0 || this._invalid;
|
|
540
540
|
}
|
|
541
541
|
get _invalid() {
|
|
542
|
-
const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min,
|
|
543
|
-
return this.min >= this.max || !e || !t || !
|
|
542
|
+
const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min, n = this.fullRangeMax == null || this.fullRangeMax >= this.max;
|
|
543
|
+
return this.min >= this.max || !e || !t || !n;
|
|
544
544
|
}
|
|
545
545
|
get resolution() {
|
|
546
546
|
const e = (this._sliderData.max - this._sliderData.min) / this._trackWidthOrHeight;
|
|
@@ -557,7 +557,7 @@ class Se extends ae {
|
|
|
557
557
|
this._sliderData.startup();
|
|
558
558
|
}
|
|
559
559
|
willUpdate(e) {
|
|
560
|
-
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider =
|
|
560
|
+
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider = Ee(this)), (e.has("values") || e.has("steps") || e.has("min") || e.has("max") || e.has("precision") || e.has("allowValuesOverlap")) && !this.allowValuesOverlap) {
|
|
561
561
|
const t = this._resolveOverlappingValues();
|
|
562
562
|
t && this._setValues(t);
|
|
563
563
|
}
|
|
@@ -576,7 +576,7 @@ class Se extends ae {
|
|
|
576
576
|
t && (e.has("values") || e.has("min") || e.has("max")) && t.reposition();
|
|
577
577
|
}
|
|
578
578
|
loaded() {
|
|
579
|
-
this._resizeObserver.observe(this.el);
|
|
579
|
+
this._resizeObserver.observe(this.el), this._updatePopoverReferenceElement();
|
|
580
580
|
}
|
|
581
581
|
disconnectedCallback() {
|
|
582
582
|
super.disconnectedCallback(), this._removeDragListeners();
|
|
@@ -588,28 +588,89 @@ class Se extends ae {
|
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
async _layoutLabelInputs() {
|
|
591
|
-
if (
|
|
591
|
+
if (!this._trackElement.value || this.valueLabelsDisplay === "hidden")
|
|
592
592
|
return;
|
|
593
|
-
const e = this.renderRoot.querySelectorAll("arcgis-label-input"), t = this.componentOnReady().then(() => Promise.all(Array.from(e, (
|
|
593
|
+
const e = this.renderRoot.querySelectorAll("arcgis-label-input"), t = this.componentOnReady().then(() => Promise.all(Array.from(e, (s) => s.updateComplete)));
|
|
594
594
|
if (this._labelInputsUpdateComplete = t, await t, t !== this._labelInputsUpdateComplete)
|
|
595
595
|
return;
|
|
596
596
|
this._labelInputsUpdateComplete = null;
|
|
597
|
-
const
|
|
598
|
-
if (!
|
|
597
|
+
const n = this._trackElement.value;
|
|
598
|
+
if (!n)
|
|
599
599
|
return;
|
|
600
|
-
const i =
|
|
601
|
-
for (const
|
|
602
|
-
const l = this._activePart === "range" || this._activePart ===
|
|
600
|
+
const i = n.getBoundingClientRect(), a = [], o = this.isHorizontal;
|
|
601
|
+
for (const s of this._sliderData.entries.keys()) {
|
|
602
|
+
const l = this._activePart === "range" || this._activePart === s;
|
|
603
603
|
if (this.valueLabelsDisplay === "always" || l) {
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
604
|
+
const d = Be(this, s), h = Z(this, s);
|
|
605
|
+
if (!d || !h)
|
|
606
606
|
continue;
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
607
|
+
const u = d.getBoundingClientRect(), f = o ? u.left + u.width / 2 : u.top + u.height / 2;
|
|
608
|
+
if (o) {
|
|
609
|
+
const m = h.getBoundingClientRect(), p = h.getLabelBoundingClientRect(), b = u.width / 2, g = Math.round(p.width / 2);
|
|
610
|
+
let v = m.width / 2;
|
|
611
|
+
const x = i.left - b, D = i.right + b, C = f - g, G = f + g;
|
|
612
|
+
C < x ? v += C - x : G > D && (v += G - D), h.style.transform = `translateX(${-Math.round(v)}px)`;
|
|
613
|
+
} else
|
|
614
|
+
h.style.removeProperty("transform");
|
|
615
|
+
a.push({
|
|
616
|
+
handleBounds: u,
|
|
617
|
+
handleCenter: f,
|
|
618
|
+
labelInput: h
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
this._layoutCollidingLabelInputs(a);
|
|
623
|
+
}
|
|
624
|
+
_layoutCollidingLabelInputs(e) {
|
|
625
|
+
const t = this.isHorizontal, n = Array.from(this.renderRoot.querySelectorAll(".label-separator")), i = e.slice().sort((s, l) => s.handleCenter - l.handleCenter);
|
|
626
|
+
if (i.length === 0)
|
|
627
|
+
return;
|
|
628
|
+
const a = this._trackElement.value?.getBoundingClientRect(), o = i.map((s) => [s]);
|
|
629
|
+
for (let s = 0; s < i.length; s++) {
|
|
630
|
+
for (const c of n)
|
|
631
|
+
c.hidden = !0, c.style.removeProperty("left");
|
|
632
|
+
let l = 0;
|
|
633
|
+
for (const c of o) {
|
|
634
|
+
const d = (c[0].handleCenter + c[c.length - 1].handleCenter) / 2, h = c.reduce((f, m) => f + (t ? m.labelInput.getBoundingClientRect().width : m.labelInput.getBoundingClientRect().height), 0);
|
|
635
|
+
let u = c.length === 1 ? t ? c[0].labelInput.getBoundingClientRect().left : c[0].labelInput.getBoundingClientRect().top : d - h / 2;
|
|
636
|
+
if (a && c.length > 1) {
|
|
637
|
+
const f = c[0], m = c[c.length - 1];
|
|
638
|
+
if (t) {
|
|
639
|
+
const p = f.labelInput.getLabelBoundingClientRect().left - f.labelInput.getBoundingClientRect().left, b = m.labelInput.getBoundingClientRect().right - m.labelInput.getLabelBoundingClientRect().right, g = a.left - f.handleBounds.width / 2 - p, v = a.right + m.handleBounds.width / 2 + b - h;
|
|
640
|
+
u = T(u, g, v);
|
|
641
|
+
} else {
|
|
642
|
+
const p = f.labelInput.getBoundingClientRect().height / 2, b = m.labelInput.getBoundingClientRect().height / 2, g = a.top - p, v = a.bottom + b - h;
|
|
643
|
+
u = T(u, g, v);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
for (let f = 0; f < c.length; f++) {
|
|
647
|
+
const m = c[f], p = m.labelInput.getBoundingClientRect(), b = t ? p.width : p.height, g = (t ? p.left : p.top) + b / 2, v = this._getLabelTranslate(m.labelInput, t), x = u + b / 2, D = `${t ? "translateX" : "translateY"}(${Math.round(v + x - g)}px)`;
|
|
648
|
+
if (m.labelInput.style.transform !== D && (m.labelInput.style.transform = D), u += b, t && f < c.length - 1) {
|
|
649
|
+
const C = n[l++];
|
|
650
|
+
if (!C)
|
|
651
|
+
continue;
|
|
652
|
+
C.hidden = !1, C.style.left = `${u - (a?.left ?? 0)}px`;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
611
655
|
}
|
|
656
|
+
if (!this._mergeCollidingLabelGroups(o))
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
_mergeCollidingLabelGroups(e) {
|
|
661
|
+
const t = this.isHorizontal;
|
|
662
|
+
for (let n = 0; n < e.length - 1; ) {
|
|
663
|
+
const i = e[n], a = e[n + 1], o = i[i.length - 1], s = a[0], l = o.labelInput.getBoundingClientRect(), c = s.labelInput.getBoundingClientRect(), d = t ? l.right : l.bottom;
|
|
664
|
+
if ((t ? c.left : c.top) > d)
|
|
665
|
+
n++;
|
|
666
|
+
else
|
|
667
|
+
return i.push(...a), e.splice(n + 1, 1), !0;
|
|
612
668
|
}
|
|
669
|
+
return !1;
|
|
670
|
+
}
|
|
671
|
+
_getLabelTranslate(e, t) {
|
|
672
|
+
const n = t ? /translateX\((-?\d+(?:\.\d+)?)px\)/u : /translateY\((-?\d+(?:\.\d+)?)px\)/u, i = e.style.transform.match(n);
|
|
673
|
+
return i ? Number.parseFloat(i[1]) : 0;
|
|
613
674
|
}
|
|
614
675
|
_onTrackFocus() {
|
|
615
676
|
this._setActivePart("range");
|
|
@@ -618,39 +679,39 @@ class Se extends ae {
|
|
|
618
679
|
this._setActivePart(null);
|
|
619
680
|
}
|
|
620
681
|
_onTrackRangePointerDown(e) {
|
|
621
|
-
this._disabledOrInvalid || !
|
|
682
|
+
this._disabledOrInvalid || !R(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
|
|
622
683
|
}
|
|
623
684
|
async _onPointerDown(e) {
|
|
624
|
-
if (this._disabledOrInvalid || !
|
|
685
|
+
if (this._disabledOrInvalid || !R(e))
|
|
625
686
|
return;
|
|
626
687
|
const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
|
|
627
688
|
if (e.target === t)
|
|
628
689
|
return;
|
|
629
690
|
if (t) {
|
|
630
|
-
t.blur(), this._focusEntry(
|
|
691
|
+
t.blur(), this._focusEntry($(t));
|
|
631
692
|
return;
|
|
632
693
|
}
|
|
633
|
-
if (
|
|
694
|
+
if (Fe(e.target) || this.values?.length > 1)
|
|
634
695
|
return;
|
|
635
|
-
const
|
|
636
|
-
this._startDrag(i,
|
|
637
|
-
const
|
|
696
|
+
const n = this._mapEventToRange(e), [i, a] = this._sliderData.entries.entries().next().value, o = n * this._fullRange + this._fullMin - a, s = B(this._fullMin, this._fullMax, a) / 100;
|
|
697
|
+
this._startDrag(i, s);
|
|
698
|
+
const l = O(this._stepsProvider, this._sliderData.entries, i, o, {
|
|
638
699
|
allowValuesOverlap: this.allowValuesOverlap,
|
|
639
700
|
precision: this.precision,
|
|
640
701
|
min: this.min,
|
|
641
702
|
max: this.max
|
|
642
703
|
});
|
|
643
|
-
this._setValue(i,
|
|
704
|
+
this._setValue(i, l), this._focusEntry(i);
|
|
644
705
|
}
|
|
645
706
|
_onThumbPointerDown(e) {
|
|
646
|
-
const t =
|
|
647
|
-
if (!
|
|
707
|
+
const t = $(e.currentTarget);
|
|
708
|
+
if (!R(e) || this._disabledOrInvalid || !t)
|
|
648
709
|
return;
|
|
649
|
-
const
|
|
650
|
-
e.target ===
|
|
710
|
+
const n = Z(this, t);
|
|
711
|
+
e.target === n && n?.editing || (e.stopPropagation(), e.preventDefault(), this._focusEntry(t), this._startDrag(t, this._mapEventToRange(e)));
|
|
651
712
|
}
|
|
652
713
|
_onFixedThumbPointerDown(e) {
|
|
653
|
-
this._disabledOrInvalid || !
|
|
714
|
+
this._disabledOrInvalid || !R(e) || (e.preventDefault(), e.currentTarget.focus());
|
|
654
715
|
}
|
|
655
716
|
_endDrag() {
|
|
656
717
|
if (this._disabledOrInvalid)
|
|
@@ -659,8 +720,8 @@ class Se extends ae {
|
|
|
659
720
|
let e = !1;
|
|
660
721
|
if (this._dragInfo) {
|
|
661
722
|
const { entries: t } = this._dragInfo;
|
|
662
|
-
for (const [
|
|
663
|
-
if (this._sliderData.getValue(
|
|
723
|
+
for (const [n, i] of t)
|
|
724
|
+
if (this._sliderData.getValue(n) !== i) {
|
|
664
725
|
e = !0;
|
|
665
726
|
break;
|
|
666
727
|
}
|
|
@@ -670,43 +731,43 @@ class Se extends ae {
|
|
|
670
731
|
_startDrag(e, t) {
|
|
671
732
|
if (this._disabledOrInvalid)
|
|
672
733
|
return;
|
|
673
|
-
const { min:
|
|
674
|
-
let
|
|
734
|
+
const { min: n, max: i, values: a } = this;
|
|
735
|
+
let o = n, s = i;
|
|
675
736
|
if (this._setActivePart(e), e === "range") {
|
|
676
737
|
if (this.segmentsDraggingDisabled)
|
|
677
738
|
return;
|
|
678
|
-
|
|
739
|
+
o = n - a[0], s = i - a[a.length - 1];
|
|
679
740
|
}
|
|
680
741
|
this._dragInfo = {
|
|
681
742
|
position: t,
|
|
682
743
|
entries: new Map(this._sliderData.entries.entries()),
|
|
683
|
-
minDiff:
|
|
684
|
-
maxDiff:
|
|
744
|
+
minDiff: o,
|
|
745
|
+
maxDiff: s
|
|
685
746
|
}, this._addDragListeners();
|
|
686
747
|
}
|
|
687
748
|
_updateDrag(e) {
|
|
688
749
|
if (!this._dragInfo || !this._activePart)
|
|
689
750
|
return;
|
|
690
|
-
const { _activePart: t, _dragInfo: { position:
|
|
691
|
-
if (
|
|
751
|
+
const { _activePart: t, _dragInfo: { position: n, entries: i, minDiff: a, maxDiff: o } } = this;
|
|
752
|
+
if (n === e)
|
|
692
753
|
return;
|
|
693
|
-
let
|
|
754
|
+
let s = (e - n) * this._fullRange;
|
|
694
755
|
if (t === "range") {
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
this._setValues(
|
|
756
|
+
s = Math.min(o, Math.max(a, s));
|
|
757
|
+
const l = Ce(this._stepsProvider, i, s);
|
|
758
|
+
this._setValues(l);
|
|
698
759
|
} else {
|
|
699
|
-
const
|
|
760
|
+
const l = O(this._stepsProvider, i, t, s, {
|
|
700
761
|
allowValuesOverlap: this.allowValuesOverlap,
|
|
701
762
|
precision: this.precision,
|
|
702
763
|
min: this.min,
|
|
703
764
|
max: this.max
|
|
704
765
|
});
|
|
705
|
-
this._setValue(t,
|
|
766
|
+
this._setValue(t, l);
|
|
706
767
|
}
|
|
707
768
|
}
|
|
708
769
|
_focusEntry(e) {
|
|
709
|
-
e &&
|
|
770
|
+
e && Q(this, e)?.focus();
|
|
710
771
|
}
|
|
711
772
|
_addDragListeners() {
|
|
712
773
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -721,72 +782,72 @@ class Se extends ae {
|
|
|
721
782
|
this._sliderData.setValue(e, t) && (this._dragInfo || this.arcgisChange.emit(), this.arcgisInput.emit());
|
|
722
783
|
}
|
|
723
784
|
_resolveOverlappingValues() {
|
|
724
|
-
const e = new Map(this._sliderData.entries), t = Array.from(e.entries()).sort((i,
|
|
725
|
-
let
|
|
726
|
-
for (const [i,
|
|
727
|
-
const
|
|
728
|
-
if (!Array.from(e).some(([c, d]) => c !== i &&
|
|
785
|
+
const e = new Map(this._sliderData.entries), t = Array.from(e.entries()).sort((i, a) => i[1] - a[1]);
|
|
786
|
+
let n = !1;
|
|
787
|
+
for (const [i, a] of t) {
|
|
788
|
+
const o = T(a, this.min, this.max);
|
|
789
|
+
if (!Array.from(e).some(([c, d]) => c !== i && T(d, this.min, this.max) === o))
|
|
729
790
|
continue;
|
|
730
|
-
const
|
|
791
|
+
const l = O(this._stepsProvider, e, i, o - a, {
|
|
731
792
|
allowValuesOverlap: !1,
|
|
732
793
|
precision: this.precision,
|
|
733
794
|
min: this.min,
|
|
734
795
|
max: this.max
|
|
735
796
|
});
|
|
736
|
-
|
|
797
|
+
l !== a && (n = !0), e.set(i, l);
|
|
737
798
|
}
|
|
738
|
-
return
|
|
799
|
+
return n ? e : null;
|
|
739
800
|
}
|
|
740
801
|
_onThumbFocus(e) {
|
|
741
|
-
const t =
|
|
802
|
+
const t = $(e.currentTarget);
|
|
742
803
|
this._setActivePart(t);
|
|
743
804
|
}
|
|
744
805
|
_onThumbBlur() {
|
|
745
806
|
this._setActivePart(null);
|
|
746
807
|
}
|
|
747
808
|
_onRangeInputChange(e) {
|
|
748
|
-
const t = e.currentTarget,
|
|
749
|
-
let
|
|
809
|
+
const t = e.currentTarget, n = t.value, i = t.dataset.type;
|
|
810
|
+
let a = !1;
|
|
750
811
|
switch (e.stopPropagation(), i) {
|
|
751
812
|
case "min": {
|
|
752
|
-
|
|
813
|
+
n < this.max ? (this.min = n, a = !0) : t.value = this.min;
|
|
753
814
|
break;
|
|
754
815
|
}
|
|
755
816
|
case "max": {
|
|
756
|
-
|
|
817
|
+
n > this.min ? (this.max = n, a = !0) : t.value = this.max;
|
|
757
818
|
break;
|
|
758
819
|
}
|
|
759
820
|
}
|
|
760
|
-
|
|
821
|
+
a && this.arcgisRangeChange.emit();
|
|
761
822
|
}
|
|
762
823
|
_onValueInputChange(e) {
|
|
763
|
-
const t = e.currentTarget,
|
|
764
|
-
if (
|
|
824
|
+
const t = e.currentTarget, n = $(t), i = t.value;
|
|
825
|
+
if (n) {
|
|
765
826
|
e.stopPropagation();
|
|
766
|
-
const
|
|
827
|
+
const a = this._sliderData.getValue(n), o = O(this._stepsProvider, this._sliderData.entries, n, i - a, {
|
|
767
828
|
allowValuesOverlap: this.allowValuesOverlap,
|
|
768
829
|
precision: this.precision,
|
|
769
830
|
min: this.min,
|
|
770
831
|
max: this.max
|
|
771
832
|
});
|
|
772
|
-
this._setValue(
|
|
833
|
+
this._setValue(n, o), t.value = this._sliderData.getValue(n);
|
|
773
834
|
}
|
|
774
835
|
}
|
|
775
836
|
_mapEventToRange(e) {
|
|
776
837
|
const t = this._trackElement.value?.getBoundingClientRect();
|
|
777
838
|
if (!t)
|
|
778
839
|
return 0;
|
|
779
|
-
const
|
|
780
|
-
return this.mirrored ? 1 -
|
|
840
|
+
const n = this.isHorizontal ? (e.clientX - t.left) / t.width : 1 - (e.clientY - t.top) / t.height;
|
|
841
|
+
return this.mirrored ? 1 - n : n;
|
|
781
842
|
}
|
|
782
843
|
_getPositionStyleForElement(e) {
|
|
783
|
-
const t =
|
|
844
|
+
const t = B(this._fullMin, this._fullMax, e);
|
|
784
845
|
return {
|
|
785
846
|
[this.isHorizontal ? this.mirrored ? "right" : "left" : this.mirrored ? "top" : "bottom"]: `${t}%`
|
|
786
847
|
};
|
|
787
848
|
}
|
|
788
849
|
_popoverSlotChange(e) {
|
|
789
|
-
this._hasPopoverContent = H(e);
|
|
850
|
+
this._hasPopoverContent = H(e), this._updatePopoverReferenceElement();
|
|
790
851
|
}
|
|
791
852
|
_onContentStartSlotChange(e) {
|
|
792
853
|
this._hasContentStart = H(e);
|
|
@@ -795,43 +856,43 @@ class Se extends ae {
|
|
|
795
856
|
this._hasContentEnd = H(e);
|
|
796
857
|
}
|
|
797
858
|
_onThumbKeyDown(e) {
|
|
798
|
-
const t =
|
|
859
|
+
const t = $(e.currentTarget);
|
|
799
860
|
if (!t)
|
|
800
861
|
return;
|
|
801
|
-
const
|
|
802
|
-
if (!
|
|
862
|
+
const n = e.currentTarget.querySelector("arcgis-label-input");
|
|
863
|
+
if (!n || n.editing)
|
|
803
864
|
return;
|
|
804
|
-
if (e.key ===
|
|
805
|
-
|
|
865
|
+
if (e.key === _.confirmEdit) {
|
|
866
|
+
n.edit();
|
|
806
867
|
return;
|
|
807
868
|
}
|
|
808
|
-
const i =
|
|
869
|
+
const i = Y(e, this.keyboardLargeStep, this.mirrored);
|
|
809
870
|
if (i) {
|
|
810
871
|
e.preventDefault();
|
|
811
|
-
const
|
|
812
|
-
this._setValue(t,
|
|
872
|
+
const a = Te(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
|
|
873
|
+
this._setValue(t, a);
|
|
813
874
|
return;
|
|
814
875
|
}
|
|
815
|
-
if (
|
|
876
|
+
if (J(e.key)) {
|
|
816
877
|
e.preventDefault();
|
|
817
|
-
const
|
|
818
|
-
this._setValue(t,
|
|
878
|
+
const a = ze(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
|
|
879
|
+
this._setValue(t, a);
|
|
819
880
|
}
|
|
820
881
|
}
|
|
821
882
|
_onTrackRangeKeyDown(e) {
|
|
822
883
|
if (this._disabledOrInvalid)
|
|
823
884
|
return;
|
|
824
|
-
const t =
|
|
885
|
+
const t = Y(e, this.keyboardLargeStep, this.mirrored);
|
|
825
886
|
if (t) {
|
|
826
887
|
e.preventDefault();
|
|
827
|
-
const { entries:
|
|
828
|
-
this._setValues(
|
|
888
|
+
const { entries: n } = Pe(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
889
|
+
this._setValues(n);
|
|
829
890
|
return;
|
|
830
891
|
}
|
|
831
|
-
if (
|
|
892
|
+
if (J(e.key)) {
|
|
832
893
|
e.preventDefault();
|
|
833
|
-
const
|
|
834
|
-
this._setValues(
|
|
894
|
+
const n = $e(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
895
|
+
this._setValues(n);
|
|
835
896
|
}
|
|
836
897
|
}
|
|
837
898
|
_getStepsConfiguration() {
|
|
@@ -844,32 +905,38 @@ class Se extends ae {
|
|
|
844
905
|
};
|
|
845
906
|
}
|
|
846
907
|
_getDirectionForHomeEndKey(e) {
|
|
847
|
-
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e ===
|
|
908
|
+
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e === _.jumpToEnd ? -1 : 1 : e === _.jumpToStart ? -1 : 1;
|
|
848
909
|
}
|
|
849
910
|
_setActivePart(e) {
|
|
850
|
-
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
911
|
+
this._activePart !== e && (this._activePart = e, this._updatePopoverReferenceElement(), this.arcgisActiveValueChange.emit());
|
|
851
912
|
}
|
|
852
913
|
_resolveFillPlacement(e) {
|
|
853
914
|
const { fillPlacement: t } = this;
|
|
854
915
|
return e ? t === "between" || t === "not-between" || t === "none" ? t : "between" : t === "start" || t === "end" || t === "none" ? t : "start";
|
|
855
916
|
}
|
|
917
|
+
_updatePopoverReferenceElement() {
|
|
918
|
+
const { _activePart: e, popoverDisplay: t } = this;
|
|
919
|
+
let n = "";
|
|
920
|
+
if (this._hasPopoverContent)
|
|
921
|
+
if (t === "always" && this.values.length > 1) {
|
|
922
|
+
const s = Array.from(this._sliderData.entries), [l, c] = s[0];
|
|
923
|
+
n = s.every(([, h]) => h === c) ? l : "track-range";
|
|
924
|
+
} else e && Oe(e) ? n = e : this.values.length > 1 ? n = "track-range" : n = this._sliderData.entries.keys().next().value ?? "";
|
|
925
|
+
let i = null;
|
|
926
|
+
n && (n === "track-range" ? i = this.renderRoot.querySelector("#track-range") : i = Q(this, n));
|
|
927
|
+
const a = i?.getBoundingClientRect(), o = !!a && a.width > 0 && a.height > 0;
|
|
928
|
+
this._measurablePopoverReferenceElement = o ? n : "";
|
|
929
|
+
}
|
|
856
930
|
render() {
|
|
857
|
-
return w`<div class=${
|
|
931
|
+
return w`<div class=${S({
|
|
858
932
|
content: !0,
|
|
859
933
|
disabled: this._disabledOrInvalid
|
|
860
934
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
861
935
|
}
|
|
862
936
|
_renderPopover() {
|
|
863
|
-
const { _activePart: e, layout: t, popoverDisplay:
|
|
864
|
-
let
|
|
865
|
-
|
|
866
|
-
if (a === "always" && this.values.length > 1) {
|
|
867
|
-
const h = Array.from(this._sliderData.entries), [f, m] = h[0];
|
|
868
|
-
s = h.every(([, _]) => _ === m) ? f : "track-range";
|
|
869
|
-
} else e && Fe(e) ? s = e : this.values.length > 1 ? s = "track-range" : s = this._sliderData.entries.keys().next().value ?? "";
|
|
870
|
-
const c = this._hasPopoverContent && (a === "always" || !!e), d = t === "horizontal" ? r === "start" ? "top" : "bottom" : r === "start" ? "left" : "right";
|
|
871
|
-
let g = 14;
|
|
872
|
-
return s && s !== "track-range" && (g -= 1), l !== "hidden" && r === o && (g += 24), w`<calcite-popover class="popover" focus-trap-disabled .label=${i} .open=${c} .offsetDistance=${g} .placement=${d} .referenceElement=${s} scale=s trigger-disabled ${B(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
937
|
+
const { _activePart: e, layout: t, popoverDisplay: n, popoverLabel: i, popoverPlacement: a, valueLabelsDisplay: o, valueLabelsPlacement: s } = this, l = this._measurablePopoverReferenceElement, c = this._hasPopoverContent && !!l && (n === "always" || !!e), d = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
|
|
938
|
+
let h = 14;
|
|
939
|
+
return l && l !== "track-range" && (h -= 1), o !== "hidden" && a === s && (h += 24), w`<calcite-popover class="popover" focus-trap-disabled .label=${i} .open=${c} .offsetDistance=${h} .placement=${d} .referenceElement=${l} scale=s trigger-disabled ${U(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
873
940
|
}
|
|
874
941
|
_renderContentStart() {
|
|
875
942
|
return w`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
@@ -878,48 +945,52 @@ class Se extends ae {
|
|
|
878
945
|
return w`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`;
|
|
879
946
|
}
|
|
880
947
|
_renderTrackRange() {
|
|
881
|
-
return w`<div class="track-container">${this._renderTrack()}<slot name=track-overlay></slot>${this._renderThumbs()}</div>`;
|
|
948
|
+
return w`<div class="track-container">${this._renderTrack()}<slot name=track-overlay></slot>${this._renderThumbs()}${this._renderLabelSeparators()}</div>`;
|
|
949
|
+
}
|
|
950
|
+
_renderLabelSeparators() {
|
|
951
|
+
const e = Math.max(0, this.values.length - 1);
|
|
952
|
+
return Array.from({ length: e }, (t, n) => q(n, w`<div aria-hidden=true class="label-separator" hidden></div>`));
|
|
882
953
|
}
|
|
883
954
|
_renderTrack() {
|
|
884
|
-
return w`<div class="track" ${
|
|
955
|
+
return w`<div class="track" ${U(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
885
956
|
}
|
|
886
957
|
_renderTrackBackground() {
|
|
887
|
-
const { max: e, min: t, fillPlacement:
|
|
888
|
-
let
|
|
889
|
-
const
|
|
890
|
-
return this._invalid ? w`<div class="segment track-bounds" style=${F({ left: "0%", right: "0%", top: "0%", bottom: "0%" })}></div>` : (
|
|
958
|
+
const { max: e, min: t, fillPlacement: n, values: i } = this, a = i.length > 1;
|
|
959
|
+
let o = this._fullMin, s = this._fullMax;
|
|
960
|
+
const l = [];
|
|
961
|
+
return this._invalid ? w`<div class="segment track-bounds" style=${F({ left: "0%", right: "0%", top: "0%", bottom: "0%" })}></div>` : (o < t && (l.push(this._renderSegment(o, t, [
|
|
891
962
|
this.mirrored ? "track-effective-end" : "track-effective-start",
|
|
892
|
-
!
|
|
893
|
-
])),
|
|
963
|
+
!a && n === "start" ? "track-fill" : null
|
|
964
|
+
])), o = t), s > e && (l.push(this._renderSegment(e, s, [
|
|
894
965
|
this.mirrored ? "track-effective-start" : "track-effective-end",
|
|
895
|
-
!
|
|
896
|
-
])),
|
|
966
|
+
!a && n === "end" ? "track-fill" : null
|
|
967
|
+
])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
|
|
897
968
|
}
|
|
898
969
|
_renderFillSegment() {
|
|
899
|
-
const { values: e, min: t, max:
|
|
970
|
+
const { values: e, min: t, max: n } = this;
|
|
900
971
|
if (!e?.length || this._invalid)
|
|
901
972
|
return;
|
|
902
|
-
const i = [...e].sort((
|
|
903
|
-
let
|
|
904
|
-
switch (
|
|
973
|
+
const i = [...e].sort((h, u) => h - u), a = i[0], o = i[i.length - 1], s = this._resolveFillPlacement(i.length > 1);
|
|
974
|
+
let l;
|
|
975
|
+
switch (s) {
|
|
905
976
|
case "start":
|
|
906
|
-
t <
|
|
977
|
+
t < a && (l = this._renderSegment(t, a, ["track-range"]));
|
|
907
978
|
break;
|
|
908
979
|
case "end":
|
|
909
|
-
|
|
980
|
+
n > o && (l = this._renderSegment(o, n, ["track-range"]));
|
|
910
981
|
break;
|
|
911
982
|
case "between":
|
|
912
|
-
i.length > 1 && (
|
|
983
|
+
i.length > 1 && (l = this._renderSegment(a, o, ["track-range"]));
|
|
913
984
|
break;
|
|
914
985
|
case "not-between":
|
|
915
|
-
i.length > 1 && (
|
|
986
|
+
i.length > 1 && (l = [this._renderSegment(t, a, ["track-range"]), this._renderSegment(o, n, ["track-range"])]);
|
|
916
987
|
break;
|
|
917
988
|
}
|
|
918
989
|
if (!(i.length > 1))
|
|
919
|
-
return
|
|
920
|
-
const c = this.segmentsDraggingDisabled, d = this._renderSegment(
|
|
990
|
+
return l;
|
|
991
|
+
const c = this.segmentsDraggingDisabled, d = this._renderSegment(a, o, [
|
|
921
992
|
"track-range-interactive",
|
|
922
|
-
|
|
993
|
+
s === "between" ? "filled" : null,
|
|
923
994
|
c ? null : "interactive",
|
|
924
995
|
this._activePart === "range" && !this.segmentsDraggingDisabled ? "active" : null
|
|
925
996
|
], {
|
|
@@ -929,95 +1000,95 @@ class Se extends ae {
|
|
|
929
1000
|
onPointerDown: c ? void 0 : this._onTrackRangePointerDown,
|
|
930
1001
|
onKeyDown: c ? void 0 : this._onTrackRangeKeyDown
|
|
931
1002
|
});
|
|
932
|
-
return [
|
|
1003
|
+
return [l, d];
|
|
933
1004
|
}
|
|
934
|
-
_renderSegment(e, t,
|
|
935
|
-
const { _fullMin:
|
|
936
|
-
|
|
937
|
-
100 -
|
|
1005
|
+
_renderSegment(e, t, n, i) {
|
|
1006
|
+
const { _fullMin: a, _fullMax: o, mirrored: s } = this, l = [
|
|
1007
|
+
B(a, o, T(e, a, o)),
|
|
1008
|
+
100 - B(a, o, T(t, a, o))
|
|
938
1009
|
];
|
|
939
|
-
|
|
1010
|
+
s && l.reverse();
|
|
940
1011
|
const c = this.isHorizontal ? {
|
|
941
|
-
left: `${
|
|
942
|
-
right: `${
|
|
1012
|
+
left: `${l[0]}%`,
|
|
1013
|
+
right: `${l[1]}%`
|
|
943
1014
|
} : {
|
|
944
|
-
top: `${
|
|
945
|
-
bottom: `${
|
|
946
|
-
}, d =
|
|
947
|
-
return w`<div id=${i?.id ??
|
|
1015
|
+
top: `${l[1]}%`,
|
|
1016
|
+
bottom: `${l[0]}%`
|
|
1017
|
+
}, d = le("segment", ...n);
|
|
1018
|
+
return w`<div id=${i?.id ?? P} class=${S(d)} style=${F(c)} .tabIndex=${i?.onPointerDown ? 0 : -1} @focus=${i?.onFocus} @blur=${i?.onBlur} @pointerdown=${i?.onPointerDown} @keydown=${i?.onKeyDown}></div>`;
|
|
948
1019
|
}
|
|
949
1020
|
_renderThumbs() {
|
|
950
|
-
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, i]) => i >= this._fullMin && i <= this._fullMax),
|
|
951
|
-
if (this.valuesDraggingDisabled &&
|
|
952
|
-
const i =
|
|
953
|
-
if (i != null &&
|
|
954
|
-
const
|
|
1021
|
+
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, i]) => i >= this._fullMin && i <= this._fullMax), n = t.map(([, i]) => i).sort((i, a) => i - a);
|
|
1022
|
+
if (this.valuesDraggingDisabled && n.length > 1) {
|
|
1023
|
+
const i = n[0], a = n.at(-1);
|
|
1024
|
+
if (i != null && a != null) {
|
|
1025
|
+
const o = (i + a) / 2;
|
|
955
1026
|
return [
|
|
956
|
-
this._renderFixedThumb(
|
|
957
|
-
|
|
1027
|
+
this._renderFixedThumb(o),
|
|
1028
|
+
X(t, ([s, l]) => this._renderThumb(s, l, !0))
|
|
958
1029
|
];
|
|
959
1030
|
}
|
|
960
1031
|
}
|
|
961
|
-
return
|
|
1032
|
+
return X(t, ([i, a]) => this._renderThumb(i, a, !1));
|
|
962
1033
|
}
|
|
963
1034
|
_renderFixedThumb(e) {
|
|
964
|
-
const { _disabledOrInvalid: t, segmentsDraggingDisabled:
|
|
965
|
-
return w`<div .ariaLabel=${this.messages.sliderValue} .ariaOrientation=${i ? "horizontal" : "vertical"} .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${e} class=${
|
|
1035
|
+
const { _disabledOrInvalid: t, segmentsDraggingDisabled: n, isHorizontal: i } = this;
|
|
1036
|
+
return w`<div .ariaLabel=${this.messages.sliderValue} .ariaOrientation=${i ? "horizontal" : "vertical"} .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${e} class=${S({
|
|
966
1037
|
thumb: !0,
|
|
967
1038
|
"fixed-thumb": !0,
|
|
968
1039
|
active: this._activePart === "range"
|
|
969
|
-
})} @blur=${this._onTrackBlur} @focus=${this._onTrackFocus} @keydown=${
|
|
1040
|
+
})} @blur=${this._onTrackBlur} @focus=${this._onTrackFocus} @keydown=${n ? void 0 : this._onTrackRangeKeyDown} @pointerdown=${n ? this._onFixedThumbPointerDown : this._onTrackRangePointerDown} role=slider style=${F({
|
|
970
1041
|
...this._getPositionStyleForElement(e),
|
|
971
1042
|
"z-index": this._activePart === "range" ? 1 : 0
|
|
972
1043
|
})} .tabIndex=${t ? -1 : 0}><div class="thumb-content"><span class="handle"></span></div></div>`;
|
|
973
1044
|
}
|
|
974
|
-
_renderThumb(e, t,
|
|
975
|
-
const { valueLabelsDisplay: i } = this,
|
|
976
|
-
return
|
|
1045
|
+
_renderThumb(e, t, n) {
|
|
1046
|
+
const { valueLabelsDisplay: i } = this, a = this._disabledOrInvalid, o = !n && (this._activePart === e || this._activePart === "range"), s = !n && (this._activePart === "range" || this._activePart === e), l = i === "always" || i === "auto" && (s || n && this._activePart === "range"), c = this.isHorizontal, d = c ? "horizontal" : "vertical", h = `label-${e}`, u = c ? "center" : this.valueLabelsPlacement === "start" ? "end" : "start";
|
|
1047
|
+
return q(e, w`<div id=${e ?? P} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(i ? h : void 0) ?? P} .ariaOrientation=${d} .ariaValueMin=${this.min} .ariaValueMax=${this.max} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${S({
|
|
977
1048
|
thumb: !0,
|
|
978
|
-
active:
|
|
979
|
-
"labels-only":
|
|
980
|
-
})} data-entry=${e ??
|
|
1049
|
+
active: o,
|
|
1050
|
+
"labels-only": n
|
|
1051
|
+
})} data-entry=${e ?? P} @pointerdown=${n ? void 0 : this._onThumbPointerDown} @focus=${n ? void 0 : this._onThumbFocus} @blur=${n ? void 0 : this._onThumbBlur} @keydown=${n ? void 0 : this._onThumbKeyDown} role=slider style=${F({
|
|
981
1052
|
...this._getPositionStyleForElement(t),
|
|
982
|
-
"z-index": this._activePart === e ?
|
|
983
|
-
})} .tabIndex=${
|
|
1053
|
+
"z-index": this._activePart === e ? 2 : 1
|
|
1054
|
+
})} .tabIndex=${n || a ? -1 : 0}><div class="thumb-content"><span class="handle"></span><arcgis-label-input .alignment=${u} class="label" .hidden=${!l} id=${h ?? P} .labelFormatter=${this._valueFormatter} @focus=${a ? void 0 : this._onThumbFocus} @blur=${a ? void 0 : this._onThumbBlur} @arcgisChange=${this._onValueInputChange} .readOnly=${!this.valueLabelsEditingEnabled} tabindex=-1 .value=${t} ${U(this._makeResizeRef())}></arcgis-label-input></div></div>`);
|
|
984
1055
|
}
|
|
985
1056
|
_renderRangeLabel(e) {
|
|
986
1057
|
let t = "center";
|
|
987
|
-
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")), w`<arcgis-label-input .alignment=${t} class=${
|
|
1058
|
+
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")), w`<arcgis-label-input .alignment=${t} class=${S(e)} data-type=${e ?? P} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`;
|
|
988
1059
|
}
|
|
989
1060
|
}
|
|
990
|
-
function
|
|
991
|
-
return "dataset" in
|
|
1061
|
+
function Fe(r) {
|
|
1062
|
+
return "dataset" in r && r.tagName === "ARCGIS-LABEL-INPUT" && (r.dataset.type === "min" || r.dataset.type === "max");
|
|
992
1063
|
}
|
|
993
|
-
function
|
|
994
|
-
const e =
|
|
1064
|
+
function $(r) {
|
|
1065
|
+
const e = oe(r, "[data-entry]");
|
|
995
1066
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
996
1067
|
}
|
|
997
|
-
function
|
|
998
|
-
return typeof
|
|
1068
|
+
function Oe(r) {
|
|
1069
|
+
return typeof r != null && r !== "range";
|
|
999
1070
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return e ?
|
|
1071
|
+
function Q(r, e) {
|
|
1072
|
+
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
1002
1073
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return e ?
|
|
1074
|
+
function Be(r, e) {
|
|
1075
|
+
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
1005
1076
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return e ?
|
|
1077
|
+
function Z(r, e) {
|
|
1078
|
+
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
1008
1079
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return
|
|
1080
|
+
function R(r) {
|
|
1081
|
+
return r.isPrimary && r.button === 0;
|
|
1011
1082
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function
|
|
1014
|
-
const
|
|
1015
|
-
return Number.parseFloat(i.toFixed(
|
|
1083
|
+
const Ae = 5;
|
|
1084
|
+
function B(r, e, t) {
|
|
1085
|
+
const n = e - r, i = (t - r) / n * 100;
|
|
1086
|
+
return Number.parseFloat(i.toFixed(Ae));
|
|
1016
1087
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return Math.max(e, Math.min(t,
|
|
1088
|
+
function T(r, e, t) {
|
|
1089
|
+
return Math.max(e, Math.min(t, r));
|
|
1019
1090
|
}
|
|
1020
|
-
|
|
1091
|
+
re("arcgis-slider", Me);
|
|
1021
1092
|
export {
|
|
1022
|
-
|
|
1093
|
+
Me as ArcgisSlider
|
|
1023
1094
|
};
|