@arcgis/common-components 6.0.0-next.8 → 6.0.0-next.9
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/5W2BJRHF.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-slider/customElement.js +208 -202
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/UZZGTTQF.js +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/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
|
|
8
|
+
import { css as ce, html as w } from "lit";
|
|
9
|
+
import { map as X } from "lit/directives/map.js";
|
|
10
10
|
import { createRef as j, ref as U } from "lit/directives/ref.js";
|
|
11
|
-
import { u as
|
|
12
|
-
import { a as
|
|
13
|
-
import
|
|
14
|
-
import { property as
|
|
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
15
|
import { watch as K } from "@arcgis/core/core/reactiveUtils.js";
|
|
16
16
|
import { generateGuid as W } from "@arcgis/toolkit/string";
|
|
17
17
|
const _ = {
|
|
@@ -26,59 +26,59 @@ const _ = {
|
|
|
26
26
|
confirmEdit: "Enter"
|
|
27
27
|
};
|
|
28
28
|
function Y({ key: r, shiftKey: e }, t, n) {
|
|
29
|
-
const i =
|
|
29
|
+
const i = me(r);
|
|
30
30
|
if (i == null)
|
|
31
31
|
return null;
|
|
32
|
-
const a =
|
|
32
|
+
const a = pe(r) || fe(r) && e ? ve(t) : 1;
|
|
33
33
|
return {
|
|
34
34
|
direction: n ? i * -1 : i,
|
|
35
35
|
count: a
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function me(r) {
|
|
39
39
|
return r === _.increment || r === _.incrementHorizontal || r === _.pageIncrement ? 1 : r === _.decrement || r === _.decrementHorizontal || r === _.pageDecrement ? -1 : null;
|
|
40
40
|
}
|
|
41
41
|
function J(r) {
|
|
42
42
|
return r === _.jumpToEnd || r === _.jumpToStart;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function fe(r) {
|
|
45
45
|
return r === _.increment || r === _.decrement || r === _.decrementHorizontal || r === _.incrementHorizontal;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function pe(r) {
|
|
48
48
|
return r === _.pageIncrement || r === _.pageDecrement;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ve(r) {
|
|
51
51
|
const e = Number.isFinite(r) ? Math.floor(r) : 1;
|
|
52
52
|
return Math.max(1, e);
|
|
53
53
|
}
|
|
54
|
-
const ve = oe`: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
|
|
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
56
|
throw TypeError(r);
|
|
57
57
|
}, V = (r, e, t, n) => {
|
|
58
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
58
|
+
for (var i = n > 1 ? void 0 : n ? xe(e, t) : e, a = r.length - 1, o; a >= 0; a--)
|
|
59
59
|
(o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
|
|
60
|
-
return n && i &&
|
|
61
|
-
},
|
|
62
|
-
function
|
|
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
75
|
constructor(r = {}) {
|
|
76
|
-
super({ ...
|
|
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
79
|
const { precision: r } = this;
|
|
80
80
|
let { min: e, max: t, values: n } = this;
|
|
81
|
-
t = y(t, r), e = y(e, r), n = n?.map((a) =>
|
|
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
82
|
const i = new Map(n?.map((a) => [W(), a]));
|
|
83
83
|
this._entries = i, K(
|
|
84
84
|
() => this.min,
|
|
@@ -102,8 +102,8 @@ let k = class extends ue {
|
|
|
102
102
|
() => this.precision,
|
|
103
103
|
(a) => {
|
|
104
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,
|
|
106
|
-
this._entries.set(
|
|
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 }
|
|
@@ -129,14 +129,14 @@ let k = class extends ue {
|
|
|
129
129
|
e !== t && this._set("min", t);
|
|
130
130
|
}
|
|
131
131
|
set values(r) {
|
|
132
|
-
if (
|
|
132
|
+
if (we(this, A) === r)
|
|
133
133
|
return;
|
|
134
|
-
if (
|
|
134
|
+
if (ke(this, A, r), !this.ready) {
|
|
135
135
|
this._set("values", r);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
const e = this._get("values");
|
|
139
|
-
if (r = r?.map((n) =>
|
|
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
141
|
const t = new Map(r?.map((n) => [W(), n]));
|
|
142
142
|
this._entries = t, this._set("values", r);
|
|
@@ -159,7 +159,7 @@ let k = class extends ue {
|
|
|
159
159
|
setValue(r, e) {
|
|
160
160
|
if (this.values == null)
|
|
161
161
|
return !1;
|
|
162
|
-
const { min: t, max: n } = this, i = this._entries.get(r), a =
|
|
162
|
+
const { min: t, max: n } = this, i = this._entries.get(r), a = L(y(e, this.precision), t, n);
|
|
163
163
|
return i === a ? !1 : (this._entries.set(r, a), this._updatesValues(), !0);
|
|
164
164
|
}
|
|
165
165
|
setValues(r) {
|
|
@@ -168,7 +168,7 @@ let k = class extends ue {
|
|
|
168
168
|
let e = !1;
|
|
169
169
|
const { min: t, max: n } = this;
|
|
170
170
|
for (const [i, a] of r) {
|
|
171
|
-
const o = this._entries.get(i), s =
|
|
171
|
+
const o = this._entries.get(i), s = L(y(a, this.precision), t, n);
|
|
172
172
|
o !== s && (e = !0, this._entries.set(i, s));
|
|
173
173
|
}
|
|
174
174
|
return e ? (this._updatesValues(), !0) : !1;
|
|
@@ -180,36 +180,36 @@ let k = class extends ue {
|
|
|
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
|
|
206
|
+
function L(r, e, t) {
|
|
207
207
|
return Math.min(Math.max(r, e), t);
|
|
208
208
|
}
|
|
209
209
|
function y(r, e) {
|
|
210
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
|
}
|
|
@@ -240,7 +240,7 @@ class De {
|
|
|
240
240
|
return n;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class Ve {
|
|
244
244
|
constructor(e, t, n) {
|
|
245
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
|
}
|
|
@@ -257,26 +257,26 @@ class Ie {
|
|
|
257
257
|
let l = Math.floor(s), c = l + 1;
|
|
258
258
|
for (; n.length < t && (l >= i || c <= a); ) {
|
|
259
259
|
if (l < i) {
|
|
260
|
-
const
|
|
261
|
-
n.push({ idx: c, value:
|
|
260
|
+
const m = this.indexToValue(c);
|
|
261
|
+
n.push({ idx: c, value: m, dist: Math.abs(m - e) }), c++;
|
|
262
262
|
continue;
|
|
263
263
|
}
|
|
264
264
|
if (c > a) {
|
|
265
|
-
const
|
|
266
|
-
n.push({ idx: l, value:
|
|
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
|
|
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
272
|
return n;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Ee(r) {
|
|
276
276
|
if (r.steps == null)
|
|
277
277
|
return null;
|
|
278
278
|
const e = r.steps;
|
|
279
|
-
return Array.isArray(e) ? e.length === 0 ? null : new
|
|
279
|
+
return Array.isArray(e) ? e.length === 0 ? null : new Ie(e) : e <= 0 ? null : new Ve(r.min, r.max, e);
|
|
280
280
|
}
|
|
281
281
|
function Ce(r, e, t) {
|
|
282
282
|
if (r == null) {
|
|
@@ -286,8 +286,8 @@ function Ce(r, e, t) {
|
|
|
286
286
|
return s;
|
|
287
287
|
}
|
|
288
288
|
const n = e.size, i = Array.from(e.entries()).map(([s, l]) => {
|
|
289
|
-
const c = l + t,
|
|
290
|
-
return { uuid: s, stepDistances:
|
|
289
|
+
const c = l + t, d = r.getClosestStepDistances(c, n);
|
|
290
|
+
return { uuid: s, stepDistances: d };
|
|
291
291
|
}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
292
292
|
i.sort((s, l) => s.stepDistances[0].dist - l.stepDistances[0].dist);
|
|
293
293
|
for (const s of i) {
|
|
@@ -297,52 +297,52 @@ function Ce(r, e, t) {
|
|
|
297
297
|
return o;
|
|
298
298
|
}
|
|
299
299
|
function O(r, e, t, n, i) {
|
|
300
|
-
const { allowValuesOverlap: a, precision: o, min: s, max: l } = i, c = e.get(t) ?? 0,
|
|
301
|
-
let
|
|
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
302
|
if (r) {
|
|
303
303
|
const p = /* @__PURE__ */ new Set();
|
|
304
304
|
if (!a)
|
|
305
305
|
for (const [v, x] of e.entries())
|
|
306
306
|
v !== t && p.add(r.valueToIndex(x));
|
|
307
|
-
const b = r.getClosestStepDistances(
|
|
308
|
-
b.sort((v, x) =>
|
|
309
|
-
let
|
|
310
|
-
|
|
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
|
-
|
|
313
|
+
for (const [g, v] of e.entries())
|
|
314
|
+
g !== t && p.add(z(v, o));
|
|
315
315
|
const b = 1 / Math.pow(10, o);
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
return
|
|
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 (!
|
|
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
|
|
331
|
+
function z(r, e) {
|
|
332
332
|
return Number.parseFloat(r.toFixed(e));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
const i =
|
|
334
|
+
function Pe(r, e, t, n = 1) {
|
|
335
|
+
const i = ne(n);
|
|
336
336
|
let a = e, o = !1;
|
|
337
337
|
for (let s = 0; s < i; s++) {
|
|
338
|
-
const l =
|
|
338
|
+
const l = Se(r, a, t);
|
|
339
339
|
if (o ||= l.changed, a = l.entries, !l.changed)
|
|
340
340
|
break;
|
|
341
341
|
}
|
|
342
342
|
return { changed: o, entries: a };
|
|
343
343
|
}
|
|
344
344
|
function Te(r, e, t, n, i = 1) {
|
|
345
|
-
const a =
|
|
345
|
+
const a = ne(i);
|
|
346
346
|
if (a === 1)
|
|
347
347
|
return N(r, e, t, n);
|
|
348
348
|
const o = new Map(e);
|
|
@@ -355,57 +355,57 @@ function Te(r, e, t, n, i = 1) {
|
|
|
355
355
|
}
|
|
356
356
|
return s;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function ne(r) {
|
|
359
359
|
const e = Number.isFinite(r) ? Math.floor(r) : 1;
|
|
360
360
|
return Math.max(1, e);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const n = /* @__PURE__ */ new Map(), i = t > 0 ?
|
|
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
364
|
let o = !1, s = !0;
|
|
365
365
|
for (const [l, c] of a)
|
|
366
366
|
if (n.set(l, c), s) {
|
|
367
|
-
const
|
|
368
|
-
c ===
|
|
367
|
+
const d = N(r, n, l, t);
|
|
368
|
+
c === d && (s = !1), o ||= s, n.set(l, d);
|
|
369
369
|
}
|
|
370
370
|
return { changed: o, entries: n };
|
|
371
371
|
}
|
|
372
372
|
function N(r, e, t, n) {
|
|
373
373
|
const { allowValuesOverlap: i, stepsProvider: a, resolution: o, min: s, max: l } = r, c = e.get(t);
|
|
374
374
|
if (n = n > 0 ? 1 : -1, !a) {
|
|
375
|
-
let
|
|
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
379
|
for (const [x, D] of e)
|
|
380
380
|
x !== t && v.add(D);
|
|
381
|
-
for (; v.has(
|
|
382
|
-
const x =
|
|
383
|
-
if (
|
|
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
|
|
389
|
-
if (
|
|
388
|
+
const d = a.valueToIndex(c);
|
|
389
|
+
if (d === -1)
|
|
390
390
|
return c;
|
|
391
391
|
if (i) {
|
|
392
|
-
const
|
|
393
|
-
return a.indexToValue(
|
|
392
|
+
const g = I(d + n, a.minIndex, a.maxIndex);
|
|
393
|
+
return a.indexToValue(g);
|
|
394
394
|
}
|
|
395
395
|
const h = /* @__PURE__ */ new Set();
|
|
396
|
-
for (const [
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
const
|
|
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
400
|
let b = 0;
|
|
401
|
-
for (; b < Math.abs(p -
|
|
402
|
-
if (!h.has(
|
|
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 ? a.indexToValue(
|
|
408
|
+
return f ? a.indexToValue(u) : c;
|
|
409
409
|
}
|
|
410
410
|
function ze(r, e, t, n) {
|
|
411
411
|
const { allowValuesOverlap: i, stepsProvider: a, resolution: o, min: s, max: l } = r, c = e.get(t);
|
|
@@ -413,49 +413,49 @@ function ze(r, e, t, n) {
|
|
|
413
413
|
const f = new Set(
|
|
414
414
|
Array.from(e).filter(([p]) => p !== t).map(([, p]) => p)
|
|
415
415
|
);
|
|
416
|
-
let
|
|
416
|
+
let m = n > 0 ? l : s;
|
|
417
417
|
if (i)
|
|
418
|
-
return
|
|
419
|
-
for (; f.has(
|
|
420
|
-
if (
|
|
421
|
-
|
|
418
|
+
return m;
|
|
419
|
+
for (; f.has(m); )
|
|
420
|
+
if (m -= n * o, n > 0 && m > l || n < 0 && m < s) {
|
|
421
|
+
m = c;
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
return
|
|
424
|
+
return m;
|
|
425
425
|
}
|
|
426
426
|
if (i)
|
|
427
427
|
return n > 0 ? a.indexToValue(a.maxIndex) : a.indexToValue(a.minIndex);
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
428
|
+
const d = a.valueToIndex(c);
|
|
429
|
+
if (d === -1)
|
|
430
430
|
return c;
|
|
431
431
|
const h = new Set(
|
|
432
432
|
Array.from(e).filter(([f]) => f !== t).map(([, f]) => a.valueToIndex(f))
|
|
433
433
|
);
|
|
434
|
-
let
|
|
435
|
-
for (; h.has(
|
|
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 a.indexToValue(
|
|
440
|
+
return a.indexToValue(u);
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
const { stepsProvider: n, min: i, max: a } = r, o = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c,
|
|
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
444
|
if (n) {
|
|
445
445
|
let c = 0;
|
|
446
446
|
if (t > 0) {
|
|
447
|
-
const
|
|
447
|
+
const d = s[s.length - 1], h = n.valueToIndex(d[1]);
|
|
448
448
|
c = n.maxIndex - h;
|
|
449
449
|
} else {
|
|
450
|
-
const
|
|
450
|
+
const d = s[0], h = n.valueToIndex(d[1]);
|
|
451
451
|
c = n.minIndex - h;
|
|
452
452
|
}
|
|
453
453
|
if (c === 0)
|
|
454
|
-
for (const [
|
|
455
|
-
o.set(
|
|
456
|
-
for (const [
|
|
457
|
-
const
|
|
458
|
-
o.set(
|
|
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
460
|
return o;
|
|
461
461
|
}
|
|
@@ -467,40 +467,40 @@ function Se(r, e, t) {
|
|
|
467
467
|
const c = s[0];
|
|
468
468
|
l = i - c[1];
|
|
469
469
|
}
|
|
470
|
-
for (const [c,
|
|
471
|
-
o.set(c,
|
|
470
|
+
for (const [c, d] of s)
|
|
471
|
+
o.set(c, d + l);
|
|
472
472
|
return o;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ae(r, e) {
|
|
475
475
|
return r - e;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Re(r, e) {
|
|
478
478
|
return e - r;
|
|
479
479
|
}
|
|
480
480
|
function I(r, e, t) {
|
|
481
481
|
return Math.max(e, Math.min(t, r));
|
|
482
482
|
}
|
|
483
|
-
const Le =
|
|
484
|
-
class Me extends
|
|
483
|
+
const Le = se(k);
|
|
484
|
+
class Me extends ie {
|
|
485
485
|
constructor() {
|
|
486
|
-
super(...arguments), this._stepsProvider = null, this._popoverElement = j(), this._trackElement = j(), this.messages =
|
|
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
492
|
}, this._formatLabel = (e, t, n) => {
|
|
493
|
-
const i =
|
|
493
|
+
const i = ue(this.messages._lang, t), a = this.labelFormatter;
|
|
494
494
|
if (!a)
|
|
495
495
|
return i.format(n);
|
|
496
496
|
const o = a(n, e, (s) => i.format(s));
|
|
497
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 = 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 =
|
|
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
506
|
return e.split(",").filter((n) => n.trim() !== "").map(parseFloat).filter((n) => Number.isFinite(n));
|
|
@@ -514,7 +514,7 @@ class Me extends re {
|
|
|
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 };
|
|
@@ -557,7 +557,7 @@ class Me extends re {
|
|
|
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 Me extends re {
|
|
|
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();
|
|
@@ -601,19 +601,19 @@ class Me extends re {
|
|
|
601
601
|
for (const s of this._sliderData.entries.keys()) {
|
|
602
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
|
|
607
|
+
const u = d.getBoundingClientRect(), f = o ? u.left + u.width / 2 : u.top + u.height / 2;
|
|
608
608
|
if (o) {
|
|
609
|
-
const
|
|
610
|
-
let v =
|
|
611
|
-
const x = i.left - b, D = i.right + b,
|
|
612
|
-
|
|
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
613
|
} else
|
|
614
614
|
h.style.removeProperty("transform");
|
|
615
615
|
a.push({
|
|
616
|
-
handleBounds:
|
|
616
|
+
handleBounds: u,
|
|
617
617
|
handleCenter: f,
|
|
618
618
|
labelInput: h
|
|
619
619
|
});
|
|
@@ -631,25 +631,25 @@ class Me extends re {
|
|
|
631
631
|
c.hidden = !0, c.style.removeProperty("left");
|
|
632
632
|
let l = 0;
|
|
633
633
|
for (const c of o) {
|
|
634
|
-
const
|
|
635
|
-
let
|
|
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
636
|
if (a && c.length > 1) {
|
|
637
|
-
const f = c[0],
|
|
637
|
+
const f = c[0], m = c[c.length - 1];
|
|
638
638
|
if (t) {
|
|
639
|
-
const p = f.labelInput.getLabelBoundingClientRect().left - f.labelInput.getBoundingClientRect().left, b =
|
|
640
|
-
|
|
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
641
|
} else {
|
|
642
|
-
const p = f.labelInput.getBoundingClientRect().height / 2, b =
|
|
643
|
-
|
|
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
644
|
}
|
|
645
645
|
}
|
|
646
646
|
for (let f = 0; f < c.length; f++) {
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
const
|
|
650
|
-
if (!
|
|
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
651
|
continue;
|
|
652
|
-
|
|
652
|
+
C.hidden = !1, C.style.left = `${u - (a?.left ?? 0)}px`;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
}
|
|
@@ -660,8 +660,8 @@ class Me extends re {
|
|
|
660
660
|
_mergeCollidingLabelGroups(e) {
|
|
661
661
|
const t = this.isHorizontal;
|
|
662
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(),
|
|
664
|
-
if ((t ? c.left : c.top) >
|
|
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
665
|
n++;
|
|
666
666
|
else
|
|
667
667
|
return i.push(...a), e.splice(n + 1, 1), !0;
|
|
@@ -679,10 +679,10 @@ class Me extends re {
|
|
|
679
679
|
this._setActivePart(null);
|
|
680
680
|
}
|
|
681
681
|
_onTrackRangePointerDown(e) {
|
|
682
|
-
this._disabledOrInvalid || !
|
|
682
|
+
this._disabledOrInvalid || !R(e) || (e.preventDefault(), e.currentTarget.focus(), this._startDrag("range", this._mapEventToRange(e)));
|
|
683
683
|
}
|
|
684
684
|
async _onPointerDown(e) {
|
|
685
|
-
if (this._disabledOrInvalid || !
|
|
685
|
+
if (this._disabledOrInvalid || !R(e))
|
|
686
686
|
return;
|
|
687
687
|
const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
|
|
688
688
|
if (e.target === t)
|
|
@@ -691,7 +691,7 @@ class Me extends re {
|
|
|
691
691
|
t.blur(), this._focusEntry($(t));
|
|
692
692
|
return;
|
|
693
693
|
}
|
|
694
|
-
if (
|
|
694
|
+
if (Fe(e.target) || this.values?.length > 1)
|
|
695
695
|
return;
|
|
696
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
697
|
this._startDrag(i, s);
|
|
@@ -705,13 +705,13 @@ class Me extends re {
|
|
|
705
705
|
}
|
|
706
706
|
_onThumbPointerDown(e) {
|
|
707
707
|
const t = $(e.currentTarget);
|
|
708
|
-
if (!
|
|
708
|
+
if (!R(e) || this._disabledOrInvalid || !t)
|
|
709
709
|
return;
|
|
710
|
-
const n =
|
|
710
|
+
const n = Z(this, t);
|
|
711
711
|
e.target === n && n?.editing || (e.stopPropagation(), e.preventDefault(), this._focusEntry(t), this._startDrag(t, this._mapEventToRange(e)));
|
|
712
712
|
}
|
|
713
713
|
_onFixedThumbPointerDown(e) {
|
|
714
|
-
this._disabledOrInvalid || !
|
|
714
|
+
this._disabledOrInvalid || !R(e) || (e.preventDefault(), e.currentTarget.focus());
|
|
715
715
|
}
|
|
716
716
|
_endDrag() {
|
|
717
717
|
if (this._disabledOrInvalid)
|
|
@@ -767,7 +767,7 @@ class Me extends re {
|
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
_focusEntry(e) {
|
|
770
|
-
e &&
|
|
770
|
+
e && Q(this, e)?.focus();
|
|
771
771
|
}
|
|
772
772
|
_addDragListeners() {
|
|
773
773
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -785,8 +785,8 @@ class Me extends re {
|
|
|
785
785
|
const e = new Map(this._sliderData.entries), t = Array.from(e.entries()).sort((i, a) => i[1] - a[1]);
|
|
786
786
|
let n = !1;
|
|
787
787
|
for (const [i, a] of t) {
|
|
788
|
-
const o =
|
|
789
|
-
if (!Array.from(e).some(([c,
|
|
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))
|
|
790
790
|
continue;
|
|
791
791
|
const l = O(this._stepsProvider, e, i, o - a, {
|
|
792
792
|
allowValuesOverlap: !1,
|
|
@@ -847,7 +847,7 @@ class Me extends re {
|
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
849
|
_popoverSlotChange(e) {
|
|
850
|
-
this._hasPopoverContent = H(e);
|
|
850
|
+
this._hasPopoverContent = H(e), this._updatePopoverReferenceElement();
|
|
851
851
|
}
|
|
852
852
|
_onContentStartSlotChange(e) {
|
|
853
853
|
this._hasContentStart = H(e);
|
|
@@ -885,13 +885,13 @@ class Me extends re {
|
|
|
885
885
|
const t = Y(e, this.keyboardLargeStep, this.mirrored);
|
|
886
886
|
if (t) {
|
|
887
887
|
e.preventDefault();
|
|
888
|
-
const { entries: n } =
|
|
888
|
+
const { entries: n } = Pe(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
889
889
|
this._setValues(n);
|
|
890
890
|
return;
|
|
891
891
|
}
|
|
892
892
|
if (J(e.key)) {
|
|
893
893
|
e.preventDefault();
|
|
894
|
-
const n =
|
|
894
|
+
const n = $e(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
895
895
|
this._setValues(n);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
@@ -908,29 +908,35 @@ class Me extends re {
|
|
|
908
908
|
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e === _.jumpToEnd ? -1 : 1 : e === _.jumpToStart ? -1 : 1;
|
|
909
909
|
}
|
|
910
910
|
_setActivePart(e) {
|
|
911
|
-
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
911
|
+
this._activePart !== e && (this._activePart = e, this._updatePopoverReferenceElement(), this.arcgisActiveValueChange.emit());
|
|
912
912
|
}
|
|
913
913
|
_resolveFillPlacement(e) {
|
|
914
914
|
const { fillPlacement: t } = this;
|
|
915
915
|
return e ? t === "between" || t === "not-between" || t === "none" ? t : "between" : t === "start" || t === "end" || t === "none" ? t : "start";
|
|
916
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
|
+
}
|
|
917
930
|
render() {
|
|
918
|
-
return w`<div class=${
|
|
931
|
+
return w`<div class=${S({
|
|
919
932
|
content: !0,
|
|
920
933
|
disabled: this._disabledOrInvalid
|
|
921
934
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
922
935
|
}
|
|
923
936
|
_renderPopover() {
|
|
924
|
-
const { _activePart: e, layout: t, popoverDisplay: n, popoverLabel: i, popoverPlacement: a, valueLabelsDisplay: o, valueLabelsPlacement: s } = this;
|
|
925
|
-
let l = "";
|
|
926
|
-
if (this._hasPopoverContent)
|
|
927
|
-
if (n === "always" && this.values.length > 1) {
|
|
928
|
-
const d = Array.from(this._sliderData.entries), [f, g] = d[0];
|
|
929
|
-
l = d.every(([, b]) => b === g) ? f : "track-range";
|
|
930
|
-
} else e && Fe(e) ? l = e : this.values.length > 1 ? l = "track-range" : l = this._sliderData.entries.keys().next().value ?? "";
|
|
931
|
-
const c = this._hasPopoverContent && (n === "always" || !!e), u = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
|
|
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";
|
|
932
938
|
let h = 14;
|
|
933
|
-
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=${
|
|
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>`;
|
|
934
940
|
}
|
|
935
941
|
_renderContentStart() {
|
|
936
942
|
return w`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
@@ -943,7 +949,7 @@ class Me extends re {
|
|
|
943
949
|
}
|
|
944
950
|
_renderLabelSeparators() {
|
|
945
951
|
const e = Math.max(0, this.values.length - 1);
|
|
946
|
-
return Array.from({ length: e }, (t, n) =>
|
|
952
|
+
return Array.from({ length: e }, (t, n) => q(n, w`<div aria-hidden=true class="label-separator" hidden></div>`));
|
|
947
953
|
}
|
|
948
954
|
_renderTrack() {
|
|
949
955
|
return w`<div class="track" ${U(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
@@ -964,7 +970,7 @@ class Me extends re {
|
|
|
964
970
|
const { values: e, min: t, max: n } = this;
|
|
965
971
|
if (!e?.length || this._invalid)
|
|
966
972
|
return;
|
|
967
|
-
const i = [...e].sort((h,
|
|
973
|
+
const i = [...e].sort((h, u) => h - u), a = i[0], o = i[i.length - 1], s = this._resolveFillPlacement(i.length > 1);
|
|
968
974
|
let l;
|
|
969
975
|
switch (s) {
|
|
970
976
|
case "start":
|
|
@@ -982,7 +988,7 @@ class Me extends re {
|
|
|
982
988
|
}
|
|
983
989
|
if (!(i.length > 1))
|
|
984
990
|
return l;
|
|
985
|
-
const c = this.segmentsDraggingDisabled,
|
|
991
|
+
const c = this.segmentsDraggingDisabled, d = this._renderSegment(a, o, [
|
|
986
992
|
"track-range-interactive",
|
|
987
993
|
s === "between" ? "filled" : null,
|
|
988
994
|
c ? null : "interactive",
|
|
@@ -994,12 +1000,12 @@ class Me extends re {
|
|
|
994
1000
|
onPointerDown: c ? void 0 : this._onTrackRangePointerDown,
|
|
995
1001
|
onKeyDown: c ? void 0 : this._onTrackRangeKeyDown
|
|
996
1002
|
});
|
|
997
|
-
return [l,
|
|
1003
|
+
return [l, d];
|
|
998
1004
|
}
|
|
999
1005
|
_renderSegment(e, t, n, i) {
|
|
1000
1006
|
const { _fullMin: a, _fullMax: o, mirrored: s } = this, l = [
|
|
1001
|
-
B(a, o,
|
|
1002
|
-
100 - B(a, o,
|
|
1007
|
+
B(a, o, T(e, a, o)),
|
|
1008
|
+
100 - B(a, o, T(t, a, o))
|
|
1003
1009
|
];
|
|
1004
1010
|
s && l.reverse();
|
|
1005
1011
|
const c = this.isHorizontal ? {
|
|
@@ -1008,8 +1014,8 @@ class Me extends re {
|
|
|
1008
1014
|
} : {
|
|
1009
1015
|
top: `${l[1]}%`,
|
|
1010
1016
|
bottom: `${l[0]}%`
|
|
1011
|
-
},
|
|
1012
|
-
return w`<div id=${i?.id ??
|
|
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>`;
|
|
1013
1019
|
}
|
|
1014
1020
|
_renderThumbs() {
|
|
1015
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);
|
|
@@ -1019,15 +1025,15 @@ class Me extends re {
|
|
|
1019
1025
|
const o = (i + a) / 2;
|
|
1020
1026
|
return [
|
|
1021
1027
|
this._renderFixedThumb(o),
|
|
1022
|
-
|
|
1028
|
+
X(t, ([s, l]) => this._renderThumb(s, l, !0))
|
|
1023
1029
|
];
|
|
1024
1030
|
}
|
|
1025
1031
|
}
|
|
1026
|
-
return
|
|
1032
|
+
return X(t, ([i, a]) => this._renderThumb(i, a, !1));
|
|
1027
1033
|
}
|
|
1028
1034
|
_renderFixedThumb(e) {
|
|
1029
1035
|
const { _disabledOrInvalid: t, segmentsDraggingDisabled: n, isHorizontal: i } = this;
|
|
1030
|
-
return w`<div .ariaLabel=${this.messages.sliderValue} .ariaOrientation=${i ? "horizontal" : "vertical"} .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${e} class=${
|
|
1036
|
+
return w`<div .ariaLabel=${this.messages.sliderValue} .ariaOrientation=${i ? "horizontal" : "vertical"} .ariaValueMax=${this.max} .ariaValueMin=${this.min} .ariaValueNow=${e} class=${S({
|
|
1031
1037
|
thumb: !0,
|
|
1032
1038
|
"fixed-thumb": !0,
|
|
1033
1039
|
active: this._activePart === "range"
|
|
@@ -1037,41 +1043,41 @@ class Me extends re {
|
|
|
1037
1043
|
})} .tabIndex=${t ? -1 : 0}><div class="thumb-content"><span class="handle"></span></div></div>`;
|
|
1038
1044
|
}
|
|
1039
1045
|
_renderThumb(e, t, n) {
|
|
1040
|
-
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,
|
|
1041
|
-
return
|
|
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({
|
|
1042
1048
|
thumb: !0,
|
|
1043
1049
|
active: o,
|
|
1044
1050
|
"labels-only": n
|
|
1045
|
-
})} data-entry=${e ??
|
|
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({
|
|
1046
1052
|
...this._getPositionStyleForElement(t),
|
|
1047
1053
|
"z-index": this._activePart === e ? 2 : 1
|
|
1048
|
-
})} .tabIndex=${n || a ? -1 : 0}><div class="thumb-content"><span class="handle"></span><arcgis-label-input .alignment=${
|
|
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>`);
|
|
1049
1055
|
}
|
|
1050
1056
|
_renderRangeLabel(e) {
|
|
1051
1057
|
let t = "center";
|
|
1052
|
-
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>`;
|
|
1053
1059
|
}
|
|
1054
1060
|
}
|
|
1055
|
-
function
|
|
1061
|
+
function Fe(r) {
|
|
1056
1062
|
return "dataset" in r && r.tagName === "ARCGIS-LABEL-INPUT" && (r.dataset.type === "min" || r.dataset.type === "max");
|
|
1057
1063
|
}
|
|
1058
1064
|
function $(r) {
|
|
1059
|
-
const e =
|
|
1065
|
+
const e = oe(r, "[data-entry]");
|
|
1060
1066
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
1061
1067
|
}
|
|
1062
|
-
function
|
|
1068
|
+
function Oe(r) {
|
|
1063
1069
|
return typeof r != null && r !== "range";
|
|
1064
1070
|
}
|
|
1065
|
-
function
|
|
1071
|
+
function Q(r, e) {
|
|
1066
1072
|
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
1067
1073
|
}
|
|
1068
1074
|
function Be(r, e) {
|
|
1069
1075
|
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
1070
1076
|
}
|
|
1071
|
-
function
|
|
1077
|
+
function Z(r, e) {
|
|
1072
1078
|
return e ? r.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
1073
1079
|
}
|
|
1074
|
-
function
|
|
1080
|
+
function R(r) {
|
|
1075
1081
|
return r.isPrimary && r.button === 0;
|
|
1076
1082
|
}
|
|
1077
1083
|
const Ae = 5;
|
|
@@ -1079,10 +1085,10 @@ function B(r, e, t) {
|
|
|
1079
1085
|
const n = e - r, i = (t - r) / n * 100;
|
|
1080
1086
|
return Number.parseFloat(i.toFixed(Ae));
|
|
1081
1087
|
}
|
|
1082
|
-
function
|
|
1088
|
+
function T(r, e, t) {
|
|
1083
1089
|
return Math.max(e, Math.min(t, r));
|
|
1084
1090
|
}
|
|
1085
|
-
|
|
1091
|
+
re("arcgis-slider", Me);
|
|
1086
1092
|
export {
|
|
1087
1093
|
Me as ArcgisSlider
|
|
1088
1094
|
};
|