@arcgis/common-components 5.1.0-next.61 → 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.
|
@@ -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,30 +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,
|
|
217
222
|
0
|
|
218
223
|
);
|
|
219
224
|
}
|
|
220
225
|
getClosestStepDistances(e, t) {
|
|
221
226
|
if (t <= 0)
|
|
222
227
|
return [];
|
|
223
|
-
const
|
|
228
|
+
const a = [];
|
|
224
229
|
for (let i = this.minIndex; i <= this.maxIndex; i++) {
|
|
225
230
|
const r = this.indexToValue(i), o = Math.abs(r - e);
|
|
226
231
|
let s = !1;
|
|
227
|
-
for (let l = 0; l <
|
|
228
|
-
if (o <
|
|
229
|
-
|
|
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;
|
|
230
235
|
break;
|
|
231
236
|
}
|
|
232
|
-
!s &&
|
|
237
|
+
!s && a.length < t && a.push({ idx: i, value: r, dist: o }), a.length > t && (a.length = t);
|
|
233
238
|
}
|
|
234
|
-
return
|
|
239
|
+
return a;
|
|
235
240
|
}
|
|
236
241
|
}
|
|
237
|
-
class
|
|
238
|
-
constructor(e, t,
|
|
239
|
-
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);
|
|
240
245
|
}
|
|
241
246
|
indexToValue(e) {
|
|
242
247
|
return this.min + k(e, this.minIndex, this.maxIndex) * this.stepSize;
|
|
@@ -247,40 +252,40 @@ class pe {
|
|
|
247
252
|
getClosestStepDistances(e, t) {
|
|
248
253
|
if (t <= 0)
|
|
249
254
|
return [];
|
|
250
|
-
const
|
|
255
|
+
const a = [], i = this.minIndex, r = this.maxIndex, s = (k(e, this.min, this.max) - this.min) / this.stepSize;
|
|
251
256
|
let l = Math.floor(s), c = l + 1;
|
|
252
|
-
for (;
|
|
257
|
+
for (; a.length < t && (l >= i || c <= r); ) {
|
|
253
258
|
if (l < i) {
|
|
254
|
-
const
|
|
255
|
-
|
|
259
|
+
const u = this.indexToValue(c);
|
|
260
|
+
a.push({ idx: c, value: u, dist: Math.abs(u - e) }), c++;
|
|
256
261
|
continue;
|
|
257
262
|
}
|
|
258
263
|
if (c > r) {
|
|
259
|
-
const
|
|
260
|
-
|
|
264
|
+
const u = this.indexToValue(l);
|
|
265
|
+
a.push({ idx: l, value: u, dist: Math.abs(u - e) }), l--;
|
|
261
266
|
continue;
|
|
262
267
|
}
|
|
263
|
-
const d = this.indexToValue(l),
|
|
264
|
-
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++);
|
|
265
270
|
}
|
|
266
|
-
return
|
|
271
|
+
return a;
|
|
267
272
|
}
|
|
268
273
|
}
|
|
269
|
-
function
|
|
270
|
-
if (
|
|
274
|
+
function ke(n) {
|
|
275
|
+
if (n.steps == null)
|
|
271
276
|
return null;
|
|
272
|
-
const e =
|
|
273
|
-
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);
|
|
274
279
|
}
|
|
275
|
-
function
|
|
276
|
-
if (
|
|
280
|
+
function De(n, e, t) {
|
|
281
|
+
if (n == null) {
|
|
277
282
|
const s = /* @__PURE__ */ new Map();
|
|
278
283
|
for (const [l, c] of e.entries())
|
|
279
284
|
s.set(l, c + t);
|
|
280
285
|
return s;
|
|
281
286
|
}
|
|
282
|
-
const
|
|
283
|
-
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);
|
|
284
289
|
return { uuid: s, stepDistances: d };
|
|
285
290
|
}), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
286
291
|
i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
|
|
@@ -290,101 +295,101 @@ function be(a, e, t) {
|
|
|
290
295
|
}
|
|
291
296
|
return o;
|
|
292
297
|
}
|
|
293
|
-
function
|
|
298
|
+
function X(n, e, t, a, i) {
|
|
294
299
|
const r = e.get(t) ?? 0;
|
|
295
|
-
if (!
|
|
296
|
-
return r +
|
|
297
|
-
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();
|
|
298
303
|
if (!i)
|
|
299
|
-
for (const [
|
|
300
|
-
|
|
301
|
-
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);
|
|
302
307
|
if (!c.has(d))
|
|
303
|
-
return
|
|
304
|
-
let
|
|
308
|
+
return n.indexToValue(d);
|
|
309
|
+
let h = null, g = 1 / 0;
|
|
305
310
|
const f = Math.min(Math.max(d - s, l - d), c.size + 1);
|
|
306
|
-
for (let
|
|
307
|
-
const v = d -
|
|
311
|
+
for (let u = 1; u <= f; u++) {
|
|
312
|
+
const v = d - u;
|
|
308
313
|
if (v >= s && !c.has(v)) {
|
|
309
|
-
const m =
|
|
310
|
-
|
|
314
|
+
const m = n.indexToValue(v), b = Math.abs(m - o);
|
|
315
|
+
h = v, g = b;
|
|
311
316
|
}
|
|
312
|
-
const _ = d +
|
|
317
|
+
const _ = d + u;
|
|
313
318
|
if (_ <= l && !c.has(_)) {
|
|
314
|
-
const m =
|
|
315
|
-
(
|
|
319
|
+
const m = n.indexToValue(_), b = Math.abs(m - o);
|
|
320
|
+
(h == null || b < g) && (h = _, g = b);
|
|
316
321
|
}
|
|
317
|
-
if (
|
|
318
|
-
return
|
|
322
|
+
if (h != null)
|
|
323
|
+
return n.indexToValue(h);
|
|
319
324
|
}
|
|
320
|
-
return
|
|
325
|
+
return h == null ? r : n.indexToValue(h);
|
|
321
326
|
}
|
|
322
|
-
function
|
|
323
|
-
const i =
|
|
327
|
+
function Ie(n, e, t, a = 1) {
|
|
328
|
+
const i = J(a);
|
|
324
329
|
let r = e, o = !1;
|
|
325
330
|
for (let s = 0; s < i; s++) {
|
|
326
|
-
const l =
|
|
331
|
+
const l = Ve(n, r, t);
|
|
327
332
|
if (o ||= l.changed, r = l.entries, !l.changed)
|
|
328
333
|
break;
|
|
329
334
|
}
|
|
330
335
|
return { changed: o, entries: r };
|
|
331
336
|
}
|
|
332
|
-
function
|
|
333
|
-
const r =
|
|
337
|
+
function Ee(n, e, t, a, i = 1) {
|
|
338
|
+
const r = J(i);
|
|
334
339
|
if (r === 1)
|
|
335
|
-
return
|
|
340
|
+
return H(n, e, t, a);
|
|
336
341
|
const o = new Map(e);
|
|
337
342
|
let s = o.get(t);
|
|
338
343
|
for (let l = 0; l < r; l++) {
|
|
339
|
-
const c =
|
|
344
|
+
const c = H(n, o, t, a);
|
|
340
345
|
if (c === s)
|
|
341
346
|
break;
|
|
342
347
|
s = c, o.set(t, s);
|
|
343
348
|
}
|
|
344
349
|
return s;
|
|
345
350
|
}
|
|
346
|
-
function
|
|
347
|
-
const e = Number.isFinite(
|
|
351
|
+
function J(n) {
|
|
352
|
+
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
348
353
|
return Math.max(1, e);
|
|
349
354
|
}
|
|
350
|
-
function
|
|
351
|
-
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]));
|
|
352
357
|
let o = !1, s = !0;
|
|
353
358
|
for (const [l, c] of r)
|
|
354
|
-
if (
|
|
355
|
-
const d =
|
|
356
|
-
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);
|
|
357
362
|
}
|
|
358
|
-
return { changed: o, entries:
|
|
363
|
+
return { changed: o, entries: a };
|
|
359
364
|
}
|
|
360
|
-
function
|
|
361
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } =
|
|
362
|
-
if (
|
|
363
|
-
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);
|
|
364
369
|
if (i)
|
|
365
370
|
return m;
|
|
366
371
|
const b = /* @__PURE__ */ new Set();
|
|
367
|
-
for (const [
|
|
368
|
-
|
|
372
|
+
for (const [C, M] of e)
|
|
373
|
+
C !== t && b.add(M);
|
|
369
374
|
for (; b.has(m) && m <= l && m >= s; )
|
|
370
|
-
m = k(m +
|
|
375
|
+
m = k(m + a * o, s, l);
|
|
371
376
|
return b.has(m) || m > l || m < s ? c : m;
|
|
372
377
|
}
|
|
373
378
|
const d = r.valueToIndex(c);
|
|
374
379
|
if (d === -1)
|
|
375
380
|
return c;
|
|
376
381
|
if (i) {
|
|
377
|
-
const m = k(d +
|
|
382
|
+
const m = k(d + a, r.minIndex, r.maxIndex);
|
|
378
383
|
return r.indexToValue(m);
|
|
379
384
|
}
|
|
380
|
-
const
|
|
385
|
+
const h = /* @__PURE__ */ new Set();
|
|
381
386
|
for (const [m, b] of e)
|
|
382
|
-
m !== t &&
|
|
387
|
+
m !== t && h.add(r.valueToIndex(b));
|
|
383
388
|
let g = d, f = !1;
|
|
384
|
-
const
|
|
389
|
+
const u = r.minIndex, v = r.maxIndex;
|
|
385
390
|
let _ = 0;
|
|
386
|
-
for (; _ < Math.abs(v -
|
|
387
|
-
if (!
|
|
391
|
+
for (; _ < Math.abs(v - u) && (g += a, !(g < u || g > v)); ) {
|
|
392
|
+
if (!h.has(g)) {
|
|
388
393
|
f = !0;
|
|
389
394
|
break;
|
|
390
395
|
}
|
|
@@ -392,54 +397,54 @@ function A(a, e, t, n) {
|
|
|
392
397
|
}
|
|
393
398
|
return f ? r.indexToValue(g) : c;
|
|
394
399
|
}
|
|
395
|
-
function
|
|
396
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: o, min: s, max: l } =
|
|
397
|
-
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) {
|
|
398
403
|
const f = new Set(
|
|
399
404
|
Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
|
|
400
405
|
);
|
|
401
|
-
let
|
|
406
|
+
let u = a > 0 ? l : s;
|
|
402
407
|
if (i)
|
|
403
|
-
return
|
|
404
|
-
for (; f.has(
|
|
405
|
-
if (
|
|
406
|
-
|
|
408
|
+
return u;
|
|
409
|
+
for (; f.has(u); )
|
|
410
|
+
if (u -= a * o, a > 0 && u > l || a < 0 && u < s) {
|
|
411
|
+
u = c;
|
|
407
412
|
break;
|
|
408
413
|
}
|
|
409
|
-
return
|
|
414
|
+
return u;
|
|
410
415
|
}
|
|
411
416
|
if (i)
|
|
412
|
-
return
|
|
417
|
+
return a > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
|
|
413
418
|
const d = r.valueToIndex(c);
|
|
414
419
|
if (d === -1)
|
|
415
420
|
return c;
|
|
416
|
-
const
|
|
421
|
+
const h = new Set(
|
|
417
422
|
Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
|
|
418
423
|
);
|
|
419
|
-
let g =
|
|
420
|
-
for (;
|
|
421
|
-
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) {
|
|
422
427
|
g = d;
|
|
423
428
|
break;
|
|
424
429
|
}
|
|
425
430
|
return r.indexToValue(g);
|
|
426
431
|
}
|
|
427
|
-
function
|
|
428
|
-
const { stepsProvider:
|
|
429
|
-
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) {
|
|
430
435
|
let c = 0;
|
|
431
436
|
if (t > 0) {
|
|
432
|
-
const d = s[s.length - 1],
|
|
433
|
-
c =
|
|
437
|
+
const d = s[s.length - 1], h = a.valueToIndex(d[1]);
|
|
438
|
+
c = a.maxIndex - h;
|
|
434
439
|
} else {
|
|
435
|
-
const d = s[0],
|
|
436
|
-
c =
|
|
440
|
+
const d = s[0], h = a.valueToIndex(d[1]);
|
|
441
|
+
c = a.minIndex - h;
|
|
437
442
|
}
|
|
438
443
|
if (c === 0)
|
|
439
|
-
for (const [d,
|
|
440
|
-
o.set(d,
|
|
441
|
-
for (const [d,
|
|
442
|
-
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);
|
|
443
448
|
o.set(d, g);
|
|
444
449
|
}
|
|
445
450
|
return o;
|
|
@@ -456,39 +461,39 @@ function ke(a, e, t) {
|
|
|
456
461
|
o.set(c, d + l);
|
|
457
462
|
return o;
|
|
458
463
|
}
|
|
459
|
-
function
|
|
460
|
-
return
|
|
464
|
+
function Y(n, e) {
|
|
465
|
+
return n - e;
|
|
461
466
|
}
|
|
462
|
-
function
|
|
463
|
-
return e -
|
|
467
|
+
function Me(n, e) {
|
|
468
|
+
return e - n;
|
|
464
469
|
}
|
|
465
|
-
function k(
|
|
466
|
-
return Math.max(e, Math.min(t,
|
|
470
|
+
function k(n, e, t) {
|
|
471
|
+
return Math.max(e, Math.min(t, n));
|
|
467
472
|
}
|
|
468
|
-
const
|
|
469
|
-
class
|
|
473
|
+
const $e = te(w);
|
|
474
|
+
class Pe extends ee {
|
|
470
475
|
constructor() {
|
|
471
|
-
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) => {
|
|
472
477
|
this._updateDrag(this._mapEventToRange(e));
|
|
473
478
|
}, this._onPointerUpDragEnd = (e) => {
|
|
474
479
|
S(e) && this._endDrag();
|
|
475
480
|
}, this._onPointerCancelDragEnd = () => {
|
|
476
481
|
this._endDrag();
|
|
477
|
-
}, this._formatLabel = (e, t,
|
|
478
|
-
const i =
|
|
482
|
+
}, this._formatLabel = (e, t, a) => {
|
|
483
|
+
const i = le(this.messages._lang, t), r = this.labelFormatter;
|
|
479
484
|
if (!r)
|
|
480
|
-
return i.format(
|
|
481
|
-
const o = r(
|
|
482
|
-
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);
|
|
483
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(() => {
|
|
484
489
|
this._layoutLabelInputs();
|
|
485
|
-
}), 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 });
|
|
486
491
|
}
|
|
487
492
|
static {
|
|
488
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: {
|
|
489
494
|
fromAttribute(e) {
|
|
490
495
|
if (e.includes(","))
|
|
491
|
-
return e.split(",").filter((
|
|
496
|
+
return e.split(",").filter((a) => a.trim() !== "").map(parseFloat).filter((a) => Number.isFinite(a));
|
|
492
497
|
const t = parseFloat(e);
|
|
493
498
|
return Number.isFinite(t) ? t : void 0;
|
|
494
499
|
}
|
|
@@ -499,7 +504,7 @@ class Ee extends Y {
|
|
|
499
504
|
} }], messageOverrides: 0 };
|
|
500
505
|
}
|
|
501
506
|
static {
|
|
502
|
-
this.styles =
|
|
507
|
+
this.styles = me;
|
|
503
508
|
}
|
|
504
509
|
static {
|
|
505
510
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -524,8 +529,8 @@ class Ee extends Y {
|
|
|
524
529
|
return this.disabled || this.values.length === 0 || this._invalid;
|
|
525
530
|
}
|
|
526
531
|
get _invalid() {
|
|
527
|
-
const e = this.fullRangeMin == null || this.fullRangeMax == null || this.fullRangeMin < this.fullRangeMax, t = this.fullRangeMin == null || this.fullRangeMin <= this.min,
|
|
528
|
-
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;
|
|
529
534
|
}
|
|
530
535
|
get resolution() {
|
|
531
536
|
const e = (this._sliderData.max - this._sliderData.min) / this._trackWidthOrHeight;
|
|
@@ -542,7 +547,7 @@ class Ee extends Y {
|
|
|
542
547
|
this._sliderData.startup();
|
|
543
548
|
}
|
|
544
549
|
willUpdate(e) {
|
|
545
|
-
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")) {
|
|
546
551
|
const t = this.max != null && this.min != null && this.max - this.min > 10 ? 2 : this.precision;
|
|
547
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);
|
|
548
553
|
}
|
|
@@ -571,20 +576,20 @@ class Ee extends Y {
|
|
|
571
576
|
if (this._labelInputsUpdateComplete = t, await t, t !== this._labelInputsUpdateComplete)
|
|
572
577
|
return;
|
|
573
578
|
this._labelInputsUpdateComplete = null;
|
|
574
|
-
const
|
|
575
|
-
if (!
|
|
579
|
+
const a = this._trackElement.value;
|
|
580
|
+
if (!a)
|
|
576
581
|
return;
|
|
577
|
-
const i =
|
|
582
|
+
const i = a.getBoundingClientRect();
|
|
578
583
|
for (const r of this._sliderData.entries.keys()) {
|
|
579
584
|
const o = this._activePart === "range" || this._activePart === r;
|
|
580
585
|
if (this.valueLabelsDisplay === "always" || o) {
|
|
581
|
-
const l =
|
|
586
|
+
const l = Le(this, r), c = q(this, r);
|
|
582
587
|
if (!l || !c)
|
|
583
588
|
continue;
|
|
584
|
-
const d = l.getBoundingClientRect(),
|
|
585
|
-
let _ =
|
|
586
|
-
const m = i.left - f, b = i.right + f,
|
|
587
|
-
|
|
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)`;
|
|
588
593
|
}
|
|
589
594
|
}
|
|
590
595
|
}
|
|
@@ -607,19 +612,19 @@ class Ee extends Y {
|
|
|
607
612
|
t.blur(), this._focusEntry(V(t));
|
|
608
613
|
return;
|
|
609
614
|
}
|
|
610
|
-
if (
|
|
615
|
+
if (Se(e.target) || this.values?.length > 1)
|
|
611
616
|
return;
|
|
612
|
-
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;
|
|
613
618
|
this._startDrag(i, s);
|
|
614
|
-
const l =
|
|
619
|
+
const l = X(this._stepsProvider, this._sliderData.entries, i, o, this.allowValuesOverlap);
|
|
615
620
|
this._setValue(i, l), this._focusEntry(i);
|
|
616
621
|
}
|
|
617
622
|
_onThumbPointerDown(e) {
|
|
618
623
|
const t = V(e.currentTarget);
|
|
619
624
|
if (!S(e) || this._disabledOrInvalid || !t)
|
|
620
625
|
return;
|
|
621
|
-
const
|
|
622
|
-
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)));
|
|
623
628
|
}
|
|
624
629
|
_endDrag() {
|
|
625
630
|
if (this._disabledOrInvalid)
|
|
@@ -628,8 +633,8 @@ class Ee extends Y {
|
|
|
628
633
|
let e = !1;
|
|
629
634
|
if (this._dragInfo) {
|
|
630
635
|
const { entries: t } = this._dragInfo;
|
|
631
|
-
for (const [
|
|
632
|
-
if (this._sliderData.getValue(
|
|
636
|
+
for (const [a, i] of t)
|
|
637
|
+
if (this._sliderData.getValue(a) !== i) {
|
|
633
638
|
e = !0;
|
|
634
639
|
break;
|
|
635
640
|
}
|
|
@@ -639,12 +644,12 @@ class Ee extends Y {
|
|
|
639
644
|
_startDrag(e, t) {
|
|
640
645
|
if (this._disabledOrInvalid)
|
|
641
646
|
return;
|
|
642
|
-
const { min:
|
|
643
|
-
let o =
|
|
647
|
+
const { min: a, max: i, values: r } = this;
|
|
648
|
+
let o = a, s = i;
|
|
644
649
|
if (this._setActivePart(e), e === "range") {
|
|
645
650
|
if (this.segmentsDraggingDisabled)
|
|
646
651
|
return;
|
|
647
|
-
o =
|
|
652
|
+
o = a - r[0], s = i - r[r.length - 1];
|
|
648
653
|
}
|
|
649
654
|
this._dragInfo = {
|
|
650
655
|
position: t,
|
|
@@ -656,21 +661,21 @@ class Ee extends Y {
|
|
|
656
661
|
_updateDrag(e) {
|
|
657
662
|
if (!this._dragInfo || !this._activePart)
|
|
658
663
|
return;
|
|
659
|
-
const { _activePart: t, _dragInfo: { position:
|
|
660
|
-
if (
|
|
664
|
+
const { _activePart: t, _dragInfo: { position: a, entries: i, minDiff: r, maxDiff: o } } = this;
|
|
665
|
+
if (a === e)
|
|
661
666
|
return;
|
|
662
|
-
let s = (e -
|
|
667
|
+
let s = (e - a) * this._fullRange;
|
|
663
668
|
if (t === "range") {
|
|
664
669
|
s = Math.min(o, Math.max(r, s));
|
|
665
|
-
const l =
|
|
670
|
+
const l = De(this._stepsProvider, i, s);
|
|
666
671
|
this._setValues(l);
|
|
667
672
|
} else {
|
|
668
|
-
const l =
|
|
673
|
+
const l = X(this._stepsProvider, i, t, s, this.allowValuesOverlap);
|
|
669
674
|
this._setValue(t, l);
|
|
670
675
|
}
|
|
671
676
|
}
|
|
672
677
|
_focusEntry(e) {
|
|
673
|
-
e &&
|
|
678
|
+
e && Fe(this, e)?.focus();
|
|
674
679
|
}
|
|
675
680
|
_addDragListeners() {
|
|
676
681
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -692,30 +697,30 @@ class Ee extends Y {
|
|
|
692
697
|
this._setActivePart(null);
|
|
693
698
|
}
|
|
694
699
|
_onRangeInputChange(e) {
|
|
695
|
-
const t = e.currentTarget,
|
|
700
|
+
const t = e.currentTarget, a = t.value, i = t.dataset.type;
|
|
696
701
|
let r = !1;
|
|
697
702
|
switch (e.stopPropagation(), i) {
|
|
698
703
|
case "min": {
|
|
699
|
-
|
|
704
|
+
a < this.max ? (this.min = a, r = !0) : t.value = this.min;
|
|
700
705
|
break;
|
|
701
706
|
}
|
|
702
707
|
case "max": {
|
|
703
|
-
|
|
708
|
+
a > this.min ? (this.max = a, r = !0) : t.value = this.max;
|
|
704
709
|
break;
|
|
705
710
|
}
|
|
706
711
|
}
|
|
707
712
|
r && this.arcgisRangeChange.emit();
|
|
708
713
|
}
|
|
709
714
|
_onValueInputChange(e) {
|
|
710
|
-
const t = e.currentTarget,
|
|
711
|
-
|
|
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));
|
|
712
717
|
}
|
|
713
718
|
_mapEventToRange(e) {
|
|
714
719
|
const t = this._trackElement.value?.getBoundingClientRect();
|
|
715
720
|
if (!t)
|
|
716
721
|
return 0;
|
|
717
|
-
const
|
|
718
|
-
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;
|
|
719
724
|
}
|
|
720
725
|
_getPositionStyleForElement(e) {
|
|
721
726
|
const t = z(this._fullMin, this._fullMax, e);
|
|
@@ -724,52 +729,52 @@ class Ee extends Y {
|
|
|
724
729
|
};
|
|
725
730
|
}
|
|
726
731
|
_popoverSlotChange(e) {
|
|
727
|
-
this._hasPopoverContent =
|
|
732
|
+
this._hasPopoverContent = R(e);
|
|
728
733
|
}
|
|
729
734
|
_onContentStartSlotChange(e) {
|
|
730
|
-
this._hasContentStart =
|
|
735
|
+
this._hasContentStart = R(e);
|
|
731
736
|
}
|
|
732
737
|
_onContentEndSlotChange(e) {
|
|
733
|
-
this._hasContentEnd =
|
|
738
|
+
this._hasContentEnd = R(e);
|
|
734
739
|
}
|
|
735
740
|
_onThumbKeyDown(e) {
|
|
736
741
|
const t = V(e.currentTarget);
|
|
737
742
|
if (!t)
|
|
738
743
|
return;
|
|
739
|
-
const
|
|
740
|
-
if (!
|
|
744
|
+
const a = e.currentTarget.querySelector("arcgis-label-input");
|
|
745
|
+
if (!a || a.editing)
|
|
741
746
|
return;
|
|
742
747
|
if (e.key === p.confirmEdit) {
|
|
743
|
-
|
|
748
|
+
a.edit();
|
|
744
749
|
return;
|
|
745
750
|
}
|
|
746
|
-
const i =
|
|
751
|
+
const i = N(e, this.keyboardLargeStep, this.mirrored);
|
|
747
752
|
if (i) {
|
|
748
753
|
e.preventDefault();
|
|
749
|
-
const r =
|
|
754
|
+
const r = Ee(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
|
|
750
755
|
this._setValue(t, r);
|
|
751
756
|
return;
|
|
752
757
|
}
|
|
753
|
-
if (
|
|
758
|
+
if (U(e.key)) {
|
|
754
759
|
e.preventDefault();
|
|
755
|
-
const r =
|
|
760
|
+
const r = Te(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
|
|
756
761
|
this._setValue(t, r);
|
|
757
762
|
}
|
|
758
763
|
}
|
|
759
764
|
_onTrackRangeKeyDown(e) {
|
|
760
765
|
if (this._disabledOrInvalid)
|
|
761
766
|
return;
|
|
762
|
-
const t =
|
|
767
|
+
const t = N(e, this.keyboardLargeStep, this.mirrored);
|
|
763
768
|
if (t) {
|
|
764
769
|
e.preventDefault();
|
|
765
|
-
const { entries:
|
|
766
|
-
this._setValues(
|
|
770
|
+
const { entries: a } = Ie(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
771
|
+
this._setValues(a);
|
|
767
772
|
return;
|
|
768
773
|
}
|
|
769
|
-
if (
|
|
774
|
+
if (U(e.key)) {
|
|
770
775
|
e.preventDefault();
|
|
771
|
-
const
|
|
772
|
-
this._setValues(
|
|
776
|
+
const a = Ce(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
777
|
+
this._setValues(a);
|
|
773
778
|
}
|
|
774
779
|
}
|
|
775
780
|
_getStepsConfiguration() {
|
|
@@ -788,15 +793,15 @@ class Ee extends Y {
|
|
|
788
793
|
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
789
794
|
}
|
|
790
795
|
render() {
|
|
791
|
-
return y`<div class=${
|
|
796
|
+
return y`<div class=${P({
|
|
792
797
|
content: !0,
|
|
793
798
|
disabled: this._disabledOrInvalid
|
|
794
799
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
795
800
|
}
|
|
796
801
|
_renderPopover() {
|
|
797
|
-
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";
|
|
798
803
|
let d = 14;
|
|
799
|
-
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>`;
|
|
800
805
|
}
|
|
801
806
|
_renderContentStart() {
|
|
802
807
|
return y`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
@@ -808,30 +813,30 @@ class Ee extends Y {
|
|
|
808
813
|
return y`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`;
|
|
809
814
|
}
|
|
810
815
|
_renderTrack() {
|
|
811
|
-
return y`<div class="track" ${
|
|
816
|
+
return y`<div class="track" ${O(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
812
817
|
}
|
|
813
818
|
_renderTrackBackground() {
|
|
814
|
-
const { max: e, min: t, fillPlacement:
|
|
819
|
+
const { max: e, min: t, fillPlacement: a, values: i } = this, r = i.length > 1;
|
|
815
820
|
let o = this._fullMin, s = this._fullMax;
|
|
816
821
|
const l = [];
|
|
817
|
-
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, [
|
|
818
823
|
this.mirrored ? "track-effective-end" : "track-effective-start",
|
|
819
|
-
!r &&
|
|
824
|
+
!r && a === "start" ? "track-fill" : null
|
|
820
825
|
])), o = t), s > e && (l.push(this._renderSegment(e, s, [
|
|
821
826
|
this.mirrored ? "track-effective-start" : "track-effective-end",
|
|
822
|
-
!r &&
|
|
827
|
+
!r && a === "end" ? "track-fill" : null
|
|
823
828
|
])), s = e), l.push(this._renderSegment(o, s, ["track-bounds"])), l);
|
|
824
829
|
}
|
|
825
830
|
_renderFillSegment() {
|
|
826
|
-
const { values: e, fillPlacement: t, min:
|
|
831
|
+
const { values: e, fillPlacement: t, min: a, max: i } = this;
|
|
827
832
|
if (!e?.length || this._invalid)
|
|
828
833
|
return;
|
|
829
834
|
const r = [...e].sort((s, l) => s - l);
|
|
830
835
|
if (r.length === 1)
|
|
831
836
|
switch (t) {
|
|
832
837
|
case "start":
|
|
833
|
-
if (
|
|
834
|
-
return this._renderSegment(
|
|
838
|
+
if (a < r[0])
|
|
839
|
+
return this._renderSegment(a, r[0], ["track-range"]);
|
|
835
840
|
break;
|
|
836
841
|
case "end":
|
|
837
842
|
if (i > r[0])
|
|
@@ -847,10 +852,10 @@ class Ee extends Y {
|
|
|
847
852
|
onKeyDown: o ? void 0 : this._onTrackRangeKeyDown
|
|
848
853
|
});
|
|
849
854
|
}
|
|
850
|
-
_renderSegment(e, t,
|
|
855
|
+
_renderSegment(e, t, a, i) {
|
|
851
856
|
const { _fullMin: r, _fullMax: o, mirrored: s } = this, l = [
|
|
852
|
-
z(r, o,
|
|
853
|
-
100 - z(r, o,
|
|
857
|
+
z(r, o, j(e, r, o)),
|
|
858
|
+
100 - z(r, o, j(t, r, o))
|
|
854
859
|
];
|
|
855
860
|
s && l.reverse();
|
|
856
861
|
const c = this.isHorizontal ? {
|
|
@@ -859,59 +864,59 @@ class Ee extends Y {
|
|
|
859
864
|
} : {
|
|
860
865
|
top: `${l[1]}%`,
|
|
861
866
|
bottom: `${l[0]}%`
|
|
862
|
-
}, d =
|
|
863
|
-
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>`;
|
|
864
869
|
}
|
|
865
870
|
_renderThumbs() {
|
|
866
|
-
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([,
|
|
867
|
-
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));
|
|
868
873
|
}
|
|
869
874
|
_renderThumb(e, t) {
|
|
870
|
-
const { valueLabelsDisplay:
|
|
871
|
-
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({
|
|
872
877
|
thumb: !0,
|
|
873
878
|
active: r
|
|
874
|
-
})} 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({
|
|
875
880
|
...this._getPositionStyleForElement(t),
|
|
876
881
|
"z-index": this._activePart === e ? 1 : 0
|
|
877
|
-
})} .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>`);
|
|
878
883
|
}
|
|
879
884
|
_renderRangeLabel(e) {
|
|
880
885
|
let t = "center";
|
|
881
|
-
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>`;
|
|
882
887
|
}
|
|
883
888
|
}
|
|
884
|
-
function
|
|
885
|
-
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");
|
|
886
891
|
}
|
|
887
|
-
function V(
|
|
888
|
-
const e =
|
|
892
|
+
function V(n) {
|
|
893
|
+
const e = ne(n, "[data-entry]");
|
|
889
894
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
890
895
|
}
|
|
891
|
-
function
|
|
892
|
-
return typeof
|
|
896
|
+
function ze(n) {
|
|
897
|
+
return typeof n != null && n !== "range";
|
|
893
898
|
}
|
|
894
|
-
function
|
|
895
|
-
return e ?
|
|
899
|
+
function Fe(n, e) {
|
|
900
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
896
901
|
}
|
|
897
|
-
function
|
|
898
|
-
return e ?
|
|
902
|
+
function Le(n, e) {
|
|
903
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
899
904
|
}
|
|
900
|
-
function
|
|
901
|
-
return e ?
|
|
905
|
+
function q(n, e) {
|
|
906
|
+
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
902
907
|
}
|
|
903
|
-
function S(
|
|
904
|
-
return
|
|
908
|
+
function S(n) {
|
|
909
|
+
return n.isPrimary && n.button === 0;
|
|
905
910
|
}
|
|
906
|
-
const
|
|
907
|
-
function z(
|
|
908
|
-
const
|
|
909
|
-
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));
|
|
910
915
|
}
|
|
911
|
-
function
|
|
912
|
-
return Math.max(e, Math.min(t,
|
|
916
|
+
function j(n, e, t) {
|
|
917
|
+
return Math.max(e, Math.min(t, n));
|
|
913
918
|
}
|
|
914
|
-
|
|
919
|
+
Q("arcgis-slider", Pe);
|
|
915
920
|
export {
|
|
916
|
-
|
|
921
|
+
Pe as ArcgisSlider
|
|
917
922
|
};
|