@arcgis/common-components 5.1.0-next.2 → 5.1.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/cdn/23DDMSOB.js +2 -0
- package/dist/cdn/3O7GAC23.js +2 -0
- package/dist/cdn/4CW7U27R.js +2 -0
- package/dist/cdn/4DCAUWTC.js +2 -0
- package/dist/cdn/EKKJN7WZ.js +2 -0
- package/dist/cdn/GAR4QMLU.js +2 -0
- package/dist/cdn/JTRO7GRS.js +2 -0
- package/dist/cdn/ZLXAKPUH.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/commonFunctions.js +3 -13
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +1 -0
- package/dist/components/arcgis-ckeditor5/types.d.ts +9 -0
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +1 -0
- package/dist/components/arcgis-color-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-info/customElement.js +10 -10
- package/dist/components/arcgis-field-info/utils/basic.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +1 -0
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +5 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +46 -28
- package/dist/components/arcgis-label-input/customElement.d.ts +5 -4
- package/dist/components/arcgis-picker-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ramp-color/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-color-break/customElement.d.ts +2 -0
- package/dist/components/arcgis-ramp-opacity/customElement.d.ts +1 -0
- package/dist/components/arcgis-slider/customElement.d.ts +269 -73
- package/dist/components/arcgis-slider/customElement.js +318 -289
- package/dist/components/arcgis-slider-input/customElement.d.ts +1 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +101 -13
- package/dist/components/arcgis-ticks/customElement.js +27 -27
- package/dist/components/arcgis-ticks/types.d.ts +23 -0
- package/dist/components/arcgis-unique-values-list/customElement.d.ts +8 -1
- package/dist/components/arcgis-unique-values-list/customElement.js +155 -149
- package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +1 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/types.d.ts +24 -7
- package/package.json +3 -3
- package/dist/cdn/6MGBOM6S.js +0 -2
- package/dist/cdn/6NYYZIHB.js +0 -2
- package/dist/cdn/BAVGT3I5.js +0 -2
- package/dist/cdn/GQLKGVRX.js +0 -2
- package/dist/cdn/P45VPBNI.js +0 -2
- package/dist/cdn/S7T3XQPB.js +0 -2
- package/dist/cdn/ZP76EPVI.js +0 -2
|
@@ -1,46 +1,83 @@
|
|
|
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 k, subclass as
|
|
14
|
-
import { watch as
|
|
15
|
-
import { generateGuid as
|
|
16
|
-
const re = J`: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-leading: 0;--arcgis-slider-internal-value-labels-placement-trailing: 0;--arcgis-slider-internal-range-labels-placement-center: 0;--arcgis-slider-internal-range-labels-placement-trailing: 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="leading"]){--arcgis-slider-internal-value-labels-placement-leading: var(--arcgis-slider-internal-show-value-labels)}:host([value-labels-placement="trailing"]){--arcgis-slider-internal-value-labels-placement-trailing: 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="trailing"]){--arcgis-slider-internal-range-labels-placement-trailing: 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-leading{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-trailing{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-leading{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-trailing{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="leading"]){.label{right:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="trailing"]){.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-leading) * 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-trailing) * 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="leading"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="trailing"]){.label{top:var(--arcgis-slider-internal-label-input-margin)}}}:host([layout="horizontal"][range-labels-placement="trailing"]){.content{--arcgis-slider-internal-content-start-min-height: calc( var(--arcgis-slider-internal-handle-offset) + var(--arcgis-slider-internal-value-labels-placement-leading) * var(--arcgis-slider-internal-label-input-height) );--arcgis-slider-internal-content-end-min-height: calc( var(--arcgis-slider-internal-value-labels-placement-trailing) * 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-trailing) * 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="leading"]){.label{bottom:var(--arcgis-slider-internal-label-input-margin)}}&:host([value-labels-placement="trailing"]){.label{top:calc(var(--arcgis-slider-internal-label-input-margin) + var(--arcgis-slider-internal-range-labels-placement-trailing) * (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))}}}`;
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { c as W } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as J } from "lit/directives/keyed.js";
|
|
4
|
+
import { LitElement as Y, createEvent as T, safeClassMap as z, safeStyleMap as F, nothing as I } from "@arcgis/lumina";
|
|
5
|
+
import { makeAccessorController as Q } from "@arcgis/lumina/controllers/accessor";
|
|
6
|
+
import { slotChangeHasAssignedElement as L, classes as Z, getClosestElement as ee } from "@arcgis/toolkit/dom";
|
|
7
|
+
import { css as te, html as _ } from "lit";
|
|
8
|
+
import { map as ae } from "lit/directives/map.js";
|
|
9
|
+
import { createRef as H, ref as R } from "lit/directives/ref.js";
|
|
10
|
+
import { u as ne } from "../../chunks/useT9n.js";
|
|
11
|
+
import { g as re } from "../../chunks/locale.js";
|
|
12
|
+
import ie from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { property as k, subclass as se } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
14
|
+
import { watch as O } from "@arcgis/core/core/reactiveUtils.js";
|
|
15
|
+
import { generateGuid as B } from "@arcgis/toolkit/string";
|
|
16
|
+
const m = {
|
|
17
|
+
increment: "ArrowUp",
|
|
18
|
+
incrementHorizontal: "ArrowRight",
|
|
19
|
+
decrement: "ArrowDown",
|
|
20
|
+
decrementHorizontal: "ArrowLeft",
|
|
21
|
+
pageIncrement: "PageUp",
|
|
22
|
+
pageDecrement: "PageDown",
|
|
23
|
+
jumpToStart: "Home",
|
|
24
|
+
jumpToEnd: "End",
|
|
25
|
+
confirmEdit: "Enter"
|
|
26
|
+
};
|
|
27
|
+
function K({ key: n, shiftKey: e }, t, a) {
|
|
28
|
+
const i = le(n);
|
|
29
|
+
if (i == null)
|
|
30
|
+
return null;
|
|
31
|
+
const r = ce(n) || oe(n) && e ? de(t) : 1;
|
|
32
|
+
return {
|
|
33
|
+
direction: a ? i * -1 : i,
|
|
34
|
+
count: r
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function le(n) {
|
|
38
|
+
return n === m.increment || n === m.incrementHorizontal || n === m.pageIncrement ? 1 : n === m.decrement || n === m.decrementHorizontal || n === m.pageDecrement ? -1 : null;
|
|
39
|
+
}
|
|
40
|
+
function N(n) {
|
|
41
|
+
return n === m.jumpToEnd || n === m.jumpToStart;
|
|
42
|
+
}
|
|
43
|
+
function oe(n) {
|
|
44
|
+
return n === m.increment || n === m.decrement || n === m.decrementHorizontal || n === m.incrementHorizontal;
|
|
45
|
+
}
|
|
46
|
+
function ce(n) {
|
|
47
|
+
return n === m.pageIncrement || n === m.pageDecrement;
|
|
48
|
+
}
|
|
49
|
+
function de(n) {
|
|
50
|
+
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
51
|
+
return Math.max(1, e);
|
|
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 he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, w = (n, e, t, a) => {
|
|
55
|
+
for (var i = a > 1 ? void 0 : a ? ge(e, t) : e, r = n.length - 1, l; r >= 0; r--)
|
|
19
56
|
(l = n[r]) && (i = (a ? l(e, t, i) : l(i)) || i);
|
|
20
|
-
return a && i &&
|
|
57
|
+
return a && i && he(e, t, i), i;
|
|
21
58
|
};
|
|
22
|
-
function
|
|
59
|
+
function me() {
|
|
23
60
|
return {
|
|
24
61
|
min: 0,
|
|
25
62
|
max: 100,
|
|
26
63
|
values: []
|
|
27
64
|
};
|
|
28
65
|
}
|
|
29
|
-
let
|
|
66
|
+
let x = class extends ie {
|
|
30
67
|
//--------------------------------------------------------------------------
|
|
31
68
|
//
|
|
32
69
|
// Lifecycle
|
|
33
70
|
//
|
|
34
71
|
//--------------------------------------------------------------------------
|
|
35
72
|
constructor(n = {}) {
|
|
36
|
-
super({ ...
|
|
73
|
+
super({ ...me(), properties: n }), this._entries = /* @__PURE__ */ new Map(), this.precision = 4, this.ready = !1;
|
|
37
74
|
}
|
|
38
75
|
startup() {
|
|
39
76
|
const { precision: n } = this;
|
|
40
77
|
let { min: e, max: t, values: a } = this;
|
|
41
|
-
t =
|
|
42
|
-
const i = new Map(a?.map((r) => [
|
|
43
|
-
this._entries = i,
|
|
78
|
+
t = b(t, n), e = b(e, n), a = a?.map((r) => $(b(r, n), e, t)), this._set("min", e), this._set("max", t), this._set("values", a);
|
|
79
|
+
const i = new Map(a?.map((r) => [B(), r]));
|
|
80
|
+
this._entries = i, O(
|
|
44
81
|
() => this.min,
|
|
45
82
|
(r) => {
|
|
46
83
|
const l = this.values;
|
|
@@ -49,7 +86,7 @@ let _ = class extends te {
|
|
|
49
86
|
}), this._updatesValues());
|
|
50
87
|
},
|
|
51
88
|
{ sync: !0 }
|
|
52
|
-
),
|
|
89
|
+
), O(
|
|
53
90
|
() => this.max,
|
|
54
91
|
(r) => {
|
|
55
92
|
const l = this.values;
|
|
@@ -58,12 +95,12 @@ let _ = class extends te {
|
|
|
58
95
|
}), this._updatesValues());
|
|
59
96
|
},
|
|
60
97
|
{ sync: !0 }
|
|
61
|
-
),
|
|
98
|
+
), O(
|
|
62
99
|
() => this.precision,
|
|
63
100
|
(r) => {
|
|
64
101
|
const { min: l, max: s, values: o } = this;
|
|
65
|
-
this._set("min",
|
|
66
|
-
this._entries.set(
|
|
102
|
+
this._set("min", b(l, r)), this._set("max", b(s, r)), o?.length && (this._entries.forEach((c, d) => {
|
|
103
|
+
this._entries.set(d, b(c, r));
|
|
67
104
|
}), this._updatesValues());
|
|
68
105
|
},
|
|
69
106
|
{ sync: !0 }
|
|
@@ -77,7 +114,7 @@ let _ = class extends te {
|
|
|
77
114
|
this._set("max", n);
|
|
78
115
|
return;
|
|
79
116
|
}
|
|
80
|
-
const e = this._get("max"), t =
|
|
117
|
+
const e = this._get("max"), t = b(n, this.precision);
|
|
81
118
|
e !== t && this._set("max", t);
|
|
82
119
|
}
|
|
83
120
|
set min(n) {
|
|
@@ -85,7 +122,7 @@ let _ = class extends te {
|
|
|
85
122
|
this._set("min", n);
|
|
86
123
|
return;
|
|
87
124
|
}
|
|
88
|
-
const e = this._get("min"), t =
|
|
125
|
+
const e = this._get("min"), t = b(n, this.precision);
|
|
89
126
|
e !== t && this._set("min", t);
|
|
90
127
|
}
|
|
91
128
|
set values(n) {
|
|
@@ -94,9 +131,9 @@ let _ = class extends te {
|
|
|
94
131
|
return;
|
|
95
132
|
}
|
|
96
133
|
const e = this._get("values");
|
|
97
|
-
if (n = n?.map((a) =>
|
|
134
|
+
if (n = n?.map((a) => $(b(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]))
|
|
98
135
|
return;
|
|
99
|
-
const t = new Map(n?.map((a) => [
|
|
136
|
+
const t = new Map(n?.map((a) => [B(), a]));
|
|
100
137
|
this._entries = t, this._set("values", n);
|
|
101
138
|
}
|
|
102
139
|
//--------------------------------------------------------------------------
|
|
@@ -117,7 +154,7 @@ let _ = class extends te {
|
|
|
117
154
|
setValue(n, e) {
|
|
118
155
|
if (this.values == null)
|
|
119
156
|
return !1;
|
|
120
|
-
const { min: t, max: a } = this, i = this._entries.get(n), r =
|
|
157
|
+
const { min: t, max: a } = this, i = this._entries.get(n), r = $(b(e, this.precision), t, a);
|
|
121
158
|
return i === r ? !1 : (this._entries.set(n, r), this._updatesValues(), !0);
|
|
122
159
|
}
|
|
123
160
|
setValues(n) {
|
|
@@ -126,7 +163,7 @@ let _ = class extends te {
|
|
|
126
163
|
let e = !1;
|
|
127
164
|
const { min: t, max: a } = this;
|
|
128
165
|
for (const [i, r] of n) {
|
|
129
|
-
const l = this._entries.get(i), s =
|
|
166
|
+
const l = this._entries.get(i), s = $(b(r, this.precision), t, a);
|
|
130
167
|
l !== s && (e = !0, this._entries.set(i, s));
|
|
131
168
|
}
|
|
132
169
|
return e ? (this._updatesValues(), !0) : !1;
|
|
@@ -138,40 +175,40 @@ let _ = class extends te {
|
|
|
138
175
|
};
|
|
139
176
|
w([
|
|
140
177
|
k()
|
|
141
|
-
],
|
|
178
|
+
], x.prototype, "_entries", 2);
|
|
142
179
|
w([
|
|
143
180
|
k({ readOnly: !0 })
|
|
144
|
-
],
|
|
181
|
+
], x.prototype, "entries", 1);
|
|
145
182
|
w([
|
|
146
183
|
k()
|
|
147
|
-
],
|
|
184
|
+
], x.prototype, "max", 1);
|
|
148
185
|
w([
|
|
149
186
|
k()
|
|
150
|
-
],
|
|
187
|
+
], x.prototype, "min", 1);
|
|
151
188
|
w([
|
|
152
|
-
k({ cast: (n) =>
|
|
153
|
-
],
|
|
189
|
+
k({ cast: (n) => $(n, 0, 20) })
|
|
190
|
+
], x.prototype, "precision", 2);
|
|
154
191
|
w([
|
|
155
192
|
k({ readOnly: !0 })
|
|
156
|
-
],
|
|
193
|
+
], x.prototype, "ready", 2);
|
|
157
194
|
w([
|
|
158
195
|
k()
|
|
159
|
-
],
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
],
|
|
163
|
-
function
|
|
196
|
+
], x.prototype, "values", 1);
|
|
197
|
+
x = w([
|
|
198
|
+
se("esri.widgets.Slider.SliderData")
|
|
199
|
+
], x);
|
|
200
|
+
function $(n, e, t) {
|
|
164
201
|
return Math.min(Math.max(n, e), t);
|
|
165
202
|
}
|
|
166
|
-
function
|
|
203
|
+
function b(n, e) {
|
|
167
204
|
return Number.parseFloat(n.toFixed(e));
|
|
168
205
|
}
|
|
169
|
-
class
|
|
206
|
+
class fe {
|
|
170
207
|
constructor(e) {
|
|
171
208
|
this.steps = e, this.minIndex = 0, this.maxIndex = this.steps.length - 1;
|
|
172
209
|
}
|
|
173
210
|
indexToValue(e) {
|
|
174
|
-
return this.steps[
|
|
211
|
+
return this.steps[E(e, this.minIndex, this.maxIndex)];
|
|
175
212
|
}
|
|
176
213
|
valueToIndex(e) {
|
|
177
214
|
const t = this.steps.indexOf(e);
|
|
@@ -180,204 +217,232 @@ class le {
|
|
|
180
217
|
);
|
|
181
218
|
}
|
|
182
219
|
}
|
|
183
|
-
class
|
|
220
|
+
class pe {
|
|
184
221
|
constructor(e, t, a) {
|
|
185
222
|
this.min = e, this.max = t, this.stepSize = a, this.minIndex = 0, this.maxIndex = Math.round((this.max - this.min) / this.stepSize);
|
|
186
223
|
}
|
|
187
224
|
indexToValue(e) {
|
|
188
|
-
return this.min +
|
|
225
|
+
return this.min + E(e, this.minIndex, this.maxIndex) * this.stepSize;
|
|
189
226
|
}
|
|
190
227
|
valueToIndex(e) {
|
|
191
|
-
return e =
|
|
228
|
+
return e = E(e, this.min, this.max), Math.round((e - this.min) / this.stepSize);
|
|
192
229
|
}
|
|
193
230
|
}
|
|
194
|
-
function
|
|
231
|
+
function ve(n) {
|
|
195
232
|
if (n.steps == null)
|
|
196
233
|
return null;
|
|
197
234
|
const e = n.steps;
|
|
198
|
-
return Array.isArray(e) ? e.length === 0 ? null : new
|
|
235
|
+
return Array.isArray(e) ? e.length === 0 ? null : new fe(e) : new pe(n.min, n.max, e);
|
|
199
236
|
}
|
|
200
|
-
function
|
|
237
|
+
function be(n, e, t) {
|
|
201
238
|
if (n == null) {
|
|
202
239
|
const s = /* @__PURE__ */ new Map();
|
|
203
|
-
for (const [o,
|
|
204
|
-
s.set(o,
|
|
240
|
+
for (const [o, c] of e.entries())
|
|
241
|
+
s.set(o, c + t);
|
|
205
242
|
return s;
|
|
206
243
|
}
|
|
207
244
|
const a = e.size, i = Array.from(e.entries()).map(([s, o]) => {
|
|
208
|
-
const
|
|
209
|
-
for (let
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
for (let
|
|
213
|
-
if (
|
|
214
|
-
|
|
245
|
+
const c = o + t, d = [];
|
|
246
|
+
for (let u = n.minIndex; u <= n.maxIndex; u++) {
|
|
247
|
+
const h = n.indexToValue(u), f = Math.abs(h - c);
|
|
248
|
+
let p = !1;
|
|
249
|
+
for (let v = 0; v < d.length; v++)
|
|
250
|
+
if (f < d[v].dist) {
|
|
251
|
+
d.splice(v, 0, { idx: u, value: h, dist: f }), p = !0;
|
|
215
252
|
break;
|
|
216
253
|
}
|
|
217
|
-
!
|
|
254
|
+
!p && d.length < a && d.push({ idx: u, value: h, dist: f }), d.length > a && (d.length = a);
|
|
218
255
|
}
|
|
219
|
-
return { uuid: s, stepDistances:
|
|
256
|
+
return { uuid: s, stepDistances: d };
|
|
220
257
|
}), r = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
221
258
|
i.sort((s, o) => s.stepDistances[0].dist - o.stepDistances[0].dist);
|
|
222
259
|
for (const s of i) {
|
|
223
|
-
const o = s.stepDistances.find((
|
|
260
|
+
const o = s.stepDistances.find((c) => !r.has(c.idx));
|
|
224
261
|
o ? (r.add(o.idx), l.set(s.uuid, o.value)) : l.set(s.uuid, e.get(s.uuid));
|
|
225
262
|
}
|
|
226
263
|
return l;
|
|
227
264
|
}
|
|
228
|
-
function
|
|
265
|
+
function U(n, e, t, a, i) {
|
|
229
266
|
const r = e.get(t) ?? 0;
|
|
230
267
|
if (!n)
|
|
231
268
|
return r + a;
|
|
232
269
|
const l = r + a, s = /* @__PURE__ */ new Set();
|
|
233
270
|
if (!i)
|
|
234
|
-
for (const [
|
|
235
|
-
|
|
236
|
-
let o = null,
|
|
237
|
-
for (let
|
|
238
|
-
if (s.has(
|
|
271
|
+
for (const [d, u] of e.entries())
|
|
272
|
+
d !== t && s.add(n.valueToIndex(u));
|
|
273
|
+
let o = null, c = 1 / 0;
|
|
274
|
+
for (let d = n.minIndex; d <= n.maxIndex; d++) {
|
|
275
|
+
if (s.has(d))
|
|
239
276
|
continue;
|
|
240
|
-
const
|
|
241
|
-
|
|
277
|
+
const u = n.indexToValue(d), h = Math.abs(u - l);
|
|
278
|
+
h < c && (c = h, o = d);
|
|
242
279
|
}
|
|
243
280
|
return o == null ? r : n.indexToValue(o);
|
|
244
281
|
}
|
|
245
|
-
function
|
|
246
|
-
const
|
|
282
|
+
function _e(n, e, t, a = 1) {
|
|
283
|
+
const i = q(a);
|
|
284
|
+
let r = e, l = !1;
|
|
285
|
+
for (let s = 0; s < i; s++) {
|
|
286
|
+
const o = ye(n, r, t);
|
|
287
|
+
if (l ||= o.changed, r = o.entries, !o.changed)
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return { changed: l, entries: r };
|
|
291
|
+
}
|
|
292
|
+
function xe(n, e, t, a, i = 1) {
|
|
293
|
+
const r = q(i);
|
|
294
|
+
if (r === 1)
|
|
295
|
+
return A(n, e, t, a);
|
|
296
|
+
const l = new Map(e);
|
|
297
|
+
let s = l.get(t);
|
|
298
|
+
for (let o = 0; o < r; o++) {
|
|
299
|
+
const c = A(n, l, t, a);
|
|
300
|
+
if (c === s)
|
|
301
|
+
break;
|
|
302
|
+
s = c, l.set(t, s);
|
|
303
|
+
}
|
|
304
|
+
return s;
|
|
305
|
+
}
|
|
306
|
+
function q(n) {
|
|
307
|
+
const e = Number.isFinite(n) ? Math.floor(n) : 1;
|
|
308
|
+
return Math.max(1, e);
|
|
309
|
+
}
|
|
310
|
+
function ye(n, e, t) {
|
|
311
|
+
const a = /* @__PURE__ */ new Map(), i = t > 0 ? De : G, r = Array.from(e).sort((o, c) => i(o[1], c[1]));
|
|
247
312
|
let l = !1, s = !0;
|
|
248
|
-
for (const [o,
|
|
249
|
-
if (a.set(o,
|
|
250
|
-
const
|
|
251
|
-
|
|
313
|
+
for (const [o, c] of r)
|
|
314
|
+
if (a.set(o, c), s) {
|
|
315
|
+
const d = A(n, a, o, t);
|
|
316
|
+
c === d && (s = !1), l ||= s, a.set(o, d);
|
|
252
317
|
}
|
|
253
318
|
return { changed: l, entries: a };
|
|
254
319
|
}
|
|
255
|
-
function
|
|
256
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: l, min: s, max: o } = n,
|
|
320
|
+
function A(n, e, t, a) {
|
|
321
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: l, min: s, max: o } = n, c = e.get(t);
|
|
257
322
|
if (a = a > 0 ? 1 : -1, !r) {
|
|
258
|
-
let g =
|
|
323
|
+
let g = E(c + a * l, s, o);
|
|
259
324
|
if (i)
|
|
260
325
|
return g;
|
|
261
|
-
const
|
|
262
|
-
for (const [P,
|
|
263
|
-
P !== t &&
|
|
264
|
-
for (;
|
|
265
|
-
g =
|
|
266
|
-
return
|
|
267
|
-
}
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
return
|
|
326
|
+
const y = /* @__PURE__ */ new Set();
|
|
327
|
+
for (const [P, C] of e)
|
|
328
|
+
P !== t && y.add(C);
|
|
329
|
+
for (; y.has(g) && g <= o && g >= s; )
|
|
330
|
+
g = E(g + a * l, s, o);
|
|
331
|
+
return y.has(g) || g > o || g < s ? c : g;
|
|
332
|
+
}
|
|
333
|
+
const d = r.valueToIndex(c);
|
|
334
|
+
if (d === -1)
|
|
335
|
+
return c;
|
|
271
336
|
if (i) {
|
|
272
|
-
const g =
|
|
337
|
+
const g = E(d + a, r.minIndex, r.maxIndex);
|
|
273
338
|
return r.indexToValue(g);
|
|
274
339
|
}
|
|
275
|
-
const
|
|
276
|
-
for (const [g,
|
|
277
|
-
g !== t &&
|
|
278
|
-
let
|
|
279
|
-
const
|
|
280
|
-
let
|
|
281
|
-
for (;
|
|
282
|
-
if (!
|
|
283
|
-
|
|
340
|
+
const u = /* @__PURE__ */ new Set();
|
|
341
|
+
for (const [g, y] of e)
|
|
342
|
+
g !== t && u.add(r.valueToIndex(y));
|
|
343
|
+
let h = d, f = !1;
|
|
344
|
+
const p = r.minIndex, v = r.maxIndex;
|
|
345
|
+
let D = 0;
|
|
346
|
+
for (; D < Math.abs(v - p) && (h += a, !(h < p || h > v)); ) {
|
|
347
|
+
if (!u.has(h)) {
|
|
348
|
+
f = !0;
|
|
284
349
|
break;
|
|
285
350
|
}
|
|
286
|
-
|
|
351
|
+
D++;
|
|
287
352
|
}
|
|
288
|
-
return
|
|
353
|
+
return f ? r.indexToValue(h) : c;
|
|
289
354
|
}
|
|
290
|
-
function
|
|
291
|
-
const { allowValuesOverlap: i, stepsProvider: r, resolution: l, min: s, max: o } = n,
|
|
355
|
+
function we(n, e, t, a) {
|
|
356
|
+
const { allowValuesOverlap: i, stepsProvider: r, resolution: l, min: s, max: o } = n, c = e.get(t);
|
|
292
357
|
if (a = a > 0 ? 1 : -1, !r) {
|
|
293
|
-
const
|
|
294
|
-
Array.from(e).filter(([
|
|
358
|
+
const f = new Set(
|
|
359
|
+
Array.from(e).filter(([v]) => v !== t).map(([, v]) => v)
|
|
295
360
|
);
|
|
296
|
-
let
|
|
361
|
+
let p = a > 0 ? o : s;
|
|
297
362
|
if (i)
|
|
298
|
-
return
|
|
299
|
-
for (;
|
|
300
|
-
if (
|
|
301
|
-
|
|
363
|
+
return p;
|
|
364
|
+
for (; f.has(p); )
|
|
365
|
+
if (p -= a * l, a > 0 && p > o || a < 0 && p < s) {
|
|
366
|
+
p = c;
|
|
302
367
|
break;
|
|
303
368
|
}
|
|
304
|
-
return
|
|
369
|
+
return p;
|
|
305
370
|
}
|
|
306
371
|
if (i)
|
|
307
372
|
return a > 0 ? r.indexToValue(r.maxIndex) : r.indexToValue(r.minIndex);
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
310
|
-
return
|
|
311
|
-
const
|
|
312
|
-
Array.from(e).filter(([
|
|
373
|
+
const d = r.valueToIndex(c);
|
|
374
|
+
if (d === -1)
|
|
375
|
+
return c;
|
|
376
|
+
const u = new Set(
|
|
377
|
+
Array.from(e).filter(([f]) => f !== t).map(([, f]) => r.valueToIndex(f))
|
|
313
378
|
);
|
|
314
|
-
let
|
|
315
|
-
for (;
|
|
316
|
-
if (
|
|
317
|
-
|
|
379
|
+
let h = a > 0 ? r.maxIndex : r.minIndex;
|
|
380
|
+
for (; u.has(h); )
|
|
381
|
+
if (h -= a, a > 0 && h > o || a < 0 && h < s) {
|
|
382
|
+
h = d;
|
|
318
383
|
break;
|
|
319
384
|
}
|
|
320
|
-
return r.indexToValue(
|
|
385
|
+
return r.indexToValue(h);
|
|
321
386
|
}
|
|
322
|
-
function
|
|
323
|
-
const { stepsProvider: a, min: i, max: r } = n, l = /* @__PURE__ */ new Map(), s = Array.from(e).sort((
|
|
387
|
+
function ke(n, e, t) {
|
|
388
|
+
const { stepsProvider: a, min: i, max: r } = n, l = /* @__PURE__ */ new Map(), s = Array.from(e).sort((c, d) => G(c[1], d[1]));
|
|
324
389
|
if (a) {
|
|
325
|
-
let
|
|
390
|
+
let c = 0;
|
|
326
391
|
if (t > 0) {
|
|
327
|
-
const
|
|
328
|
-
|
|
392
|
+
const d = s[s.length - 1], u = a.valueToIndex(d[1]);
|
|
393
|
+
c = a.maxIndex - u;
|
|
329
394
|
} else {
|
|
330
|
-
const
|
|
331
|
-
|
|
395
|
+
const d = s[0], u = a.valueToIndex(d[1]);
|
|
396
|
+
c = a.minIndex - u;
|
|
332
397
|
}
|
|
333
|
-
if (
|
|
334
|
-
for (const [
|
|
335
|
-
l.set(
|
|
336
|
-
for (const [
|
|
337
|
-
const
|
|
338
|
-
l.set(
|
|
398
|
+
if (c === 0)
|
|
399
|
+
for (const [d, u] of s)
|
|
400
|
+
l.set(d, u);
|
|
401
|
+
for (const [d, u] of s) {
|
|
402
|
+
const h = a.indexToValue(a.valueToIndex(u) + c);
|
|
403
|
+
l.set(d, h);
|
|
339
404
|
}
|
|
340
405
|
return l;
|
|
341
406
|
}
|
|
342
407
|
let o = 0;
|
|
343
408
|
if (t > 0) {
|
|
344
|
-
const
|
|
345
|
-
o = r -
|
|
409
|
+
const c = s[s.length - 1];
|
|
410
|
+
o = r - c[1];
|
|
346
411
|
} else {
|
|
347
|
-
const
|
|
348
|
-
o = i -
|
|
412
|
+
const c = s[0];
|
|
413
|
+
o = i - c[1];
|
|
349
414
|
}
|
|
350
|
-
for (const [
|
|
351
|
-
l.set(
|
|
415
|
+
for (const [c, d] of s)
|
|
416
|
+
l.set(c, d + o);
|
|
352
417
|
return l;
|
|
353
418
|
}
|
|
354
|
-
function
|
|
419
|
+
function G(n, e) {
|
|
355
420
|
return n - e;
|
|
356
421
|
}
|
|
357
|
-
function
|
|
422
|
+
function De(n, e) {
|
|
358
423
|
return e - n;
|
|
359
424
|
}
|
|
360
|
-
function
|
|
425
|
+
function E(n, e, t) {
|
|
361
426
|
return Math.max(e, Math.min(t, n));
|
|
362
427
|
}
|
|
363
|
-
const
|
|
364
|
-
class
|
|
428
|
+
const Ie = Q(x);
|
|
429
|
+
class Ee extends Y {
|
|
365
430
|
constructor() {
|
|
366
|
-
super(...arguments), this._popoverElement =
|
|
431
|
+
super(...arguments), this._popoverElement = H(), this._trackElement = H(), this.messages = ne({}), this._onPointerMoveDragUpdate = (e) => {
|
|
367
432
|
this._updateDrag(this._mapEventToRange(e));
|
|
368
433
|
}, this._onPointerUpDragEnd = (e) => {
|
|
369
|
-
|
|
434
|
+
M(e) && this._endDrag();
|
|
370
435
|
}, this._onPointerCancelDragEnd = () => {
|
|
371
436
|
this._endDrag();
|
|
372
437
|
}, this._formatLabel = (e, t, a) => {
|
|
373
|
-
const i =
|
|
438
|
+
const i = re(this.messages._lang, t), r = this.labelFormatter;
|
|
374
439
|
if (!r)
|
|
375
440
|
return i.format(a);
|
|
376
441
|
const l = r(a, e, (s) => i.format(s));
|
|
377
442
|
return l ?? i.format(a);
|
|
378
443
|
}, 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(() => {
|
|
379
444
|
this._layoutLabelInputs();
|
|
380
|
-
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._sliderData =
|
|
445
|
+
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._sliderData = Ie(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 = T({ cancelable: !1 }), this.arcgisChange = T({ cancelable: !1 }), this.arcgisInput = T({ cancelable: !1 }), this.arcgisRangeChange = T({ cancelable: !1 });
|
|
381
446
|
}
|
|
382
447
|
static {
|
|
383
448
|
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: {
|
|
@@ -387,14 +452,14 @@ class pe extends j {
|
|
|
387
452
|
const t = parseFloat(e);
|
|
388
453
|
return Number.isFinite(t) ? t : void 0;
|
|
389
454
|
}
|
|
390
|
-
} }], valueLabelsDisplay: 3, valueLabelsPlacement: 3, valueLabelsEditingEnabled: 5, values: [1, { converter: {
|
|
455
|
+
} }], valueLabelsDisplay: 3, valueLabelsPlacement: 3, valueLabelsEditingEnabled: 5, keyboardLargeStep: 9, values: [1, { converter: {
|
|
391
456
|
fromAttribute(e) {
|
|
392
457
|
return e.includes(",") ? e.split(",").filter((t) => t.trim() !== "").map(parseFloat).filter((t) => Number.isFinite(t)) : [parseFloat(e)].filter((t) => Number.isFinite(t));
|
|
393
458
|
}
|
|
394
459
|
} }], messageOverrides: 0 };
|
|
395
460
|
}
|
|
396
461
|
static {
|
|
397
|
-
this.styles =
|
|
462
|
+
this.styles = ue;
|
|
398
463
|
}
|
|
399
464
|
static {
|
|
400
465
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -437,7 +502,7 @@ class pe extends j {
|
|
|
437
502
|
this._sliderData.startup();
|
|
438
503
|
}
|
|
439
504
|
willUpdate(e) {
|
|
440
|
-
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider =
|
|
505
|
+
if ((e.has("steps") || e.has("min") || e.has("max")) && (this._stepsProvider = ve(this)), e.has("messages") || e.has("min") || e.has("max") || e.has("precision") || e.has("labelFormatter")) {
|
|
441
506
|
const t = this.max != null && this.min != null && this.max - this.min > 10 ? 2 : this.precision;
|
|
442
507
|
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);
|
|
443
508
|
}
|
|
@@ -473,13 +538,13 @@ class pe extends j {
|
|
|
473
538
|
for (const r of this._sliderData.entries.keys()) {
|
|
474
539
|
const l = this._activePart === "range" || this._activePart === r;
|
|
475
540
|
if (this.valueLabelsDisplay === "always" || l) {
|
|
476
|
-
const o =
|
|
477
|
-
if (!o || !
|
|
541
|
+
const o = Ce(this, r), c = j(this, r);
|
|
542
|
+
if (!o || !c)
|
|
478
543
|
continue;
|
|
479
|
-
const
|
|
480
|
-
let
|
|
481
|
-
const g = i.left -
|
|
482
|
-
P < g ?
|
|
544
|
+
const d = o.getBoundingClientRect(), u = c.getBoundingClientRect(), h = c.getLabelBoundingClientRect(), f = d.width / 2, p = Math.round(d.left + f), v = Math.round(h.width / 2);
|
|
545
|
+
let D = u.width / 2;
|
|
546
|
+
const g = i.left - f, y = i.right + f, P = p - v, C = p + v;
|
|
547
|
+
P < g ? D += P - g : C > y && (D += C - y), c.style.transform = `translateX(${-Math.round(D)}px)`;
|
|
483
548
|
}
|
|
484
549
|
}
|
|
485
550
|
}
|
|
@@ -490,10 +555,10 @@ class pe extends j {
|
|
|
490
555
|
this._setActivePart(null);
|
|
491
556
|
}
|
|
492
557
|
_onTrackRangePointerDown(e) {
|
|
493
|
-
this._disabledOrInvalid || !
|
|
558
|
+
this._disabledOrInvalid || !M(e) || (e.preventDefault(), this._startDrag("range", this._mapEventToRange(e)));
|
|
494
559
|
}
|
|
495
560
|
async _onPointerDown(e) {
|
|
496
|
-
if (this._disabledOrInvalid || !
|
|
561
|
+
if (this._disabledOrInvalid || !M(e))
|
|
497
562
|
return;
|
|
498
563
|
const t = this.renderRoot.querySelector("arcgis-label-input[editing]");
|
|
499
564
|
if (e.target === t)
|
|
@@ -502,19 +567,19 @@ class pe extends j {
|
|
|
502
567
|
t.blur(), this._focusEntry(V(t));
|
|
503
568
|
return;
|
|
504
569
|
}
|
|
505
|
-
if (
|
|
570
|
+
if (Ve(e.target) || this.values?.length > 1)
|
|
506
571
|
return;
|
|
507
|
-
const a = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value, l = a * this._fullRange + this._fullMin - r, s =
|
|
572
|
+
const a = this._mapEventToRange(e), [i, r] = this._sliderData.entries.entries().next().value, l = a * this._fullRange + this._fullMin - r, s = S(this._fullMin, this._fullMax, r) / 100;
|
|
508
573
|
this._startDrag(i, s);
|
|
509
|
-
const o =
|
|
574
|
+
const o = U(this._stepsProvider, this._sliderData.entries, i, l, this.allowValuesOverlap);
|
|
510
575
|
this._setValue(i, o), this._focusEntry(i);
|
|
511
576
|
}
|
|
512
577
|
_onThumbPointerDown(e) {
|
|
513
578
|
const t = V(e.currentTarget);
|
|
514
|
-
if (!
|
|
579
|
+
if (!M(e) || this._disabledOrInvalid || !t)
|
|
515
580
|
return;
|
|
516
|
-
const a =
|
|
517
|
-
e.target === a && a?.editing || (e.stopPropagation(), this._startDrag(t, this._mapEventToRange(e)));
|
|
581
|
+
const a = j(this, t);
|
|
582
|
+
e.target === a && a?.editing || (e.stopPropagation(), e.preventDefault(), this._startDrag(t, this._mapEventToRange(e)));
|
|
518
583
|
}
|
|
519
584
|
_endDrag() {
|
|
520
585
|
if (this._disabledOrInvalid)
|
|
@@ -557,15 +622,15 @@ class pe extends j {
|
|
|
557
622
|
let s = (e - a) * this._fullRange;
|
|
558
623
|
if (t === "range") {
|
|
559
624
|
s = Math.min(l, Math.max(r, s));
|
|
560
|
-
const o =
|
|
625
|
+
const o = be(this._stepsProvider, i, s);
|
|
561
626
|
this._setValues(o);
|
|
562
627
|
} else {
|
|
563
|
-
const o =
|
|
628
|
+
const o = U(this._stepsProvider, i, t, s, this.allowValuesOverlap);
|
|
564
629
|
this._setValue(t, o);
|
|
565
630
|
}
|
|
566
631
|
}
|
|
567
632
|
_focusEntry(e) {
|
|
568
|
-
e &&
|
|
633
|
+
e && Pe(this, e)?.focus();
|
|
569
634
|
}
|
|
570
635
|
_addDragListeners() {
|
|
571
636
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -613,19 +678,19 @@ class pe extends j {
|
|
|
613
678
|
return this.mirrored ? 1 - a : a;
|
|
614
679
|
}
|
|
615
680
|
_getPositionStyleForElement(e) {
|
|
616
|
-
const t =
|
|
681
|
+
const t = S(this._fullMin, this._fullMax, e);
|
|
617
682
|
return {
|
|
618
683
|
[this.isHorizontal ? this.mirrored ? "right" : "left" : this.mirrored ? "top" : "bottom"]: `${t}%`
|
|
619
684
|
};
|
|
620
685
|
}
|
|
621
686
|
_popoverSlotChange(e) {
|
|
622
|
-
this._hasPopoverContent =
|
|
687
|
+
this._hasPopoverContent = L(e);
|
|
623
688
|
}
|
|
624
689
|
_onContentStartSlotChange(e) {
|
|
625
|
-
this._hasContentStart =
|
|
690
|
+
this._hasContentStart = L(e);
|
|
626
691
|
}
|
|
627
692
|
_onContentEndSlotChange(e) {
|
|
628
|
-
this._hasContentEnd =
|
|
693
|
+
this._hasContentEnd = L(e);
|
|
629
694
|
}
|
|
630
695
|
_onThumbKeyDown(e) {
|
|
631
696
|
const t = V(e.currentTarget);
|
|
@@ -634,122 +699,86 @@ class pe extends j {
|
|
|
634
699
|
const a = e.currentTarget.querySelector("arcgis-label-input");
|
|
635
700
|
if (!a || a.editing)
|
|
636
701
|
return;
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
let r = i === "ArrowUp" || i === "ArrowRight" ? 1 : -1;
|
|
653
|
-
r = this.mirrored ? r * -1 : r;
|
|
654
|
-
const l = N({
|
|
655
|
-
allowValuesOverlap: this.allowValuesOverlap,
|
|
656
|
-
stepsProvider: this._stepsProvider,
|
|
657
|
-
resolution: this.resolution,
|
|
658
|
-
min: this.min,
|
|
659
|
-
max: this.max
|
|
660
|
-
}, this._sliderData.entries, t, r);
|
|
661
|
-
this._setValue(t, l);
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
case "End":
|
|
665
|
-
case "Home": {
|
|
666
|
-
e.preventDefault();
|
|
667
|
-
const l = this.isHorizontal && this.mirrored || this.layout === "vertical" ? i === "End" ? -1 : 1 : i === "Home" ? -1 : 1, s = ue({
|
|
668
|
-
allowValuesOverlap: this.allowValuesOverlap,
|
|
669
|
-
stepsProvider: this._stepsProvider,
|
|
670
|
-
resolution: this.resolution,
|
|
671
|
-
min: this.min,
|
|
672
|
-
max: this.max
|
|
673
|
-
}, this._sliderData.entries, t, l);
|
|
674
|
-
this._setValue(t, s);
|
|
675
|
-
break;
|
|
676
|
-
}
|
|
702
|
+
if (e.key === m.confirmEdit) {
|
|
703
|
+
a.edit();
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
const i = K(e, this.keyboardLargeStep, this.mirrored);
|
|
707
|
+
if (i) {
|
|
708
|
+
e.preventDefault();
|
|
709
|
+
const r = xe(this._getStepsConfiguration(), this._sliderData.entries, t, i.direction, i.count);
|
|
710
|
+
this._setValue(t, r);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (N(e.key)) {
|
|
714
|
+
e.preventDefault();
|
|
715
|
+
const r = we(this._getStepsConfiguration(), this._sliderData.entries, t, this._getDirectionForHomeEndKey(e.key));
|
|
716
|
+
this._setValue(t, r);
|
|
677
717
|
}
|
|
678
718
|
}
|
|
679
719
|
_onTrackRangeKeyDown(e) {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
const { entries: i } = he({
|
|
694
|
-
allowValuesOverlap: this.allowValuesOverlap,
|
|
695
|
-
stepsProvider: this._stepsProvider,
|
|
696
|
-
resolution: this.resolution,
|
|
697
|
-
min: this.min,
|
|
698
|
-
max: this.max
|
|
699
|
-
}, this._sliderData.entries, a);
|
|
700
|
-
this._setValues(i);
|
|
701
|
-
break;
|
|
702
|
-
}
|
|
703
|
-
case "End":
|
|
704
|
-
case "Home": {
|
|
705
|
-
e.preventDefault();
|
|
706
|
-
const i = this.isHorizontal && this.mirrored || this.layout === "vertical" ? t === "End" ? -1 : 1 : t === "Home" ? -1 : 1, r = ge({
|
|
707
|
-
allowValuesOverlap: this.allowValuesOverlap,
|
|
708
|
-
stepsProvider: this._stepsProvider,
|
|
709
|
-
resolution: this.resolution,
|
|
710
|
-
min: this.min,
|
|
711
|
-
max: this.max
|
|
712
|
-
}, this._sliderData.entries, i);
|
|
713
|
-
this._setValues(r);
|
|
714
|
-
break;
|
|
715
|
-
}
|
|
720
|
+
if (this._disabledOrInvalid)
|
|
721
|
+
return;
|
|
722
|
+
const t = K(e, this.keyboardLargeStep, this.mirrored);
|
|
723
|
+
if (t) {
|
|
724
|
+
e.preventDefault();
|
|
725
|
+
const { entries: a } = _e(this._getStepsConfiguration(), this._sliderData.entries, t.direction, t.count);
|
|
726
|
+
this._setValues(a);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
if (N(e.key)) {
|
|
730
|
+
e.preventDefault();
|
|
731
|
+
const a = ke(this._getStepsConfiguration(), this._sliderData.entries, this._getDirectionForHomeEndKey(e.key));
|
|
732
|
+
this._setValues(a);
|
|
716
733
|
}
|
|
717
734
|
}
|
|
735
|
+
_getStepsConfiguration() {
|
|
736
|
+
return {
|
|
737
|
+
allowValuesOverlap: this.allowValuesOverlap,
|
|
738
|
+
stepsProvider: this._stepsProvider,
|
|
739
|
+
resolution: this.resolution,
|
|
740
|
+
min: this.min,
|
|
741
|
+
max: this.max
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
_getDirectionForHomeEndKey(e) {
|
|
745
|
+
return this.isHorizontal && this.mirrored || this.layout === "vertical" ? e === m.jumpToEnd ? -1 : 1 : e === m.jumpToStart ? -1 : 1;
|
|
746
|
+
}
|
|
718
747
|
_setActivePart(e) {
|
|
719
748
|
this._activePart !== e && (this._activePart = e, this.arcgisActiveValueChange.emit());
|
|
720
749
|
}
|
|
721
750
|
render() {
|
|
722
|
-
return
|
|
751
|
+
return _`<div class=${z({
|
|
723
752
|
content: !0,
|
|
724
753
|
disabled: this._disabledOrInvalid
|
|
725
754
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
726
755
|
}
|
|
727
756
|
_renderPopover() {
|
|
728
|
-
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: l } = this, s = e ?
|
|
729
|
-
let
|
|
730
|
-
return r !== "hidden" && a === i && (
|
|
757
|
+
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: l } = this, s = e ? $e(e) ? e : "track-range" : "", o = this._hasPopoverContent && !!s, c = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
|
|
758
|
+
let d = 14;
|
|
759
|
+
return r !== "hidden" && a === i && (d += 24), _`<calcite-popover flip-disabled focus-trap-disabled .label=${l} .open=${o} .offsetDistance=${d} .placement=${c} pointer-disabled .referenceElement=${s} scale=s trigger-disabled ${R(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
731
760
|
}
|
|
732
761
|
_renderContentStart() {
|
|
733
|
-
return
|
|
762
|
+
return _`<div class="content-start" .hidden=${!this._hasContentStart}><slot name=content-start @slotchange=${this._onContentStartSlotChange}></slot></div>`;
|
|
734
763
|
}
|
|
735
764
|
_renderContentEnd() {
|
|
736
|
-
return
|
|
765
|
+
return _`<div class="content-end" .hidden=${!this._hasContentEnd}><slot name=content-end @slotchange=${this._onContentEndSlotChange}></slot></div>`;
|
|
737
766
|
}
|
|
738
767
|
_renderTrackRange() {
|
|
739
|
-
return
|
|
768
|
+
return _`<div class="track-container">${this._renderTrack()}${this._renderThumbs()}</div>`;
|
|
740
769
|
}
|
|
741
770
|
_renderTrack() {
|
|
742
|
-
return
|
|
771
|
+
return _`<div class="track" ${R(this._trackElement)}>${this._renderTrackBackground()}${this._renderFillSegment()}</div>`;
|
|
743
772
|
}
|
|
744
773
|
_renderTrackBackground() {
|
|
745
774
|
const { max: e, min: t, fillPlacement: a, values: i } = this, r = i.length > 1;
|
|
746
775
|
let l = this._fullMin, s = this._fullMax;
|
|
747
776
|
const o = [];
|
|
748
|
-
return this._invalid ?
|
|
749
|
-
this.mirrored ? "track-effective-
|
|
777
|
+
return this._invalid ? _`<div class="segment track-bounds" style=${F({ left: "0%", right: "0%", top: "0%", bottom: "0%" })}></div>` : (l < t && (o.push(this._renderSegment(l, t, [
|
|
778
|
+
this.mirrored ? "track-effective-end" : "track-effective-start",
|
|
750
779
|
!r && a === "start" ? "track-fill" : null
|
|
751
780
|
])), l = t), s > e && (o.push(this._renderSegment(e, s, [
|
|
752
|
-
this.mirrored ? "track-effective-
|
|
781
|
+
this.mirrored ? "track-effective-start" : "track-effective-end",
|
|
753
782
|
!r && a === "end" ? "track-fill" : null
|
|
754
783
|
])), s = e), o.push(this._renderSegment(l, s, ["track-bounds"])), o);
|
|
755
784
|
}
|
|
@@ -780,69 +809,69 @@ class pe extends j {
|
|
|
780
809
|
}
|
|
781
810
|
_renderSegment(e, t, a, i) {
|
|
782
811
|
const { _fullMin: r, _fullMax: l, mirrored: s } = this, o = [
|
|
783
|
-
|
|
784
|
-
100 -
|
|
812
|
+
S(r, l, X(e, r, l)),
|
|
813
|
+
100 - S(r, l, X(t, r, l))
|
|
785
814
|
];
|
|
786
815
|
s && o.reverse();
|
|
787
|
-
const
|
|
816
|
+
const c = this.isHorizontal ? {
|
|
788
817
|
left: `${o[0]}%`,
|
|
789
818
|
right: `${o[1]}%`
|
|
790
819
|
} : {
|
|
791
820
|
top: `${o[1]}%`,
|
|
792
821
|
bottom: `${o[0]}%`
|
|
793
|
-
},
|
|
794
|
-
return
|
|
822
|
+
}, d = Z("segment", ...a);
|
|
823
|
+
return _`<div id=${i?.id ?? I} class=${z(d)} style=${F(c)} .tabIndex=${i?.onPointerDown ? 0 : -1} @focus=${i?.onFocus} @blur=${i?.onBlur} @pointerdown=${i?.onPointerDown} @keydown=${i?.onKeyDown}></div>`;
|
|
795
824
|
}
|
|
796
825
|
_renderThumbs() {
|
|
797
826
|
const { _sliderData: e } = this, t = Array.from(e.entries).filter(([, a]) => a >= this._fullMin && a <= this._fullMax);
|
|
798
|
-
return
|
|
827
|
+
return ae(t, ([a, i]) => this._renderThumb(a, i));
|
|
799
828
|
}
|
|
800
829
|
_renderThumb(e, t) {
|
|
801
|
-
const { valueLabelsDisplay: a } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range", l = this._activePart === "range" || this._activePart === e, s = a === "always" || a === "auto" && l, o = this.isHorizontal,
|
|
802
|
-
return
|
|
830
|
+
const { valueLabelsDisplay: a } = this, i = this._disabledOrInvalid, r = this._activePart === e || this._activePart === "range", l = this._activePart === "range" || this._activePart === e, s = a === "always" || a === "auto" && l, o = this.isHorizontal, c = o ? "horizontal" : "vertical", d = `label-${e}`, u = o ? "center" : this.valueLabelsPlacement === "start" ? "end" : "start";
|
|
831
|
+
return J(e, _`<div id=${e ?? I} .ariaLabel=${this.messages.sliderValue} aria-labelledby=${(a ? d : void 0) ?? I} .ariaOrientation=${c} .ariaValueMin=${this._minFormatter(this.min)} .ariaValueMax=${this._maxFormatter(this.max)} .ariaValueNow=${t} .ariaValueText=${this._valueFormatter(t)} class=${z({
|
|
803
832
|
thumb: !0,
|
|
804
833
|
active: r
|
|
805
|
-
})} data-entry=${e ??
|
|
834
|
+
})} data-entry=${e ?? I} @pointerdown=${this._onThumbPointerDown} @focus=${this._onThumbFocus} @blur=${this._onThumbBlur} @keydown=${this._onThumbKeyDown} role=slider style=${F({
|
|
806
835
|
...this._getPositionStyleForElement(t),
|
|
807
836
|
"z-index": this._activePart === e ? 1 : 0
|
|
808
|
-
})} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${
|
|
837
|
+
})} .tabIndex=${i ? -1 : 0}><span class="handle"></span><arcgis-label-input .alignment=${u} class="label" .hidden=${!s} id=${d ?? I} .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} ${R(this._makeResizeRef())}></arcgis-label-input></div>`);
|
|
809
838
|
}
|
|
810
839
|
_renderRangeLabel(e) {
|
|
811
840
|
let t = "center";
|
|
812
|
-
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "
|
|
841
|
+
return this.isHorizontal && (t = e === "min" ? "end" : "start", this.rangeLabelsPlacement === "end" && (t = t === "end" ? "start" : "end"), this.mirrored && (t = t === "end" ? "start" : "end")), _`<arcgis-label-input .alignment=${t} class=${z(e)} data-type=${e ?? I} .hidden=${!this.showRangeLabels} .labelFormatter=${this[`_${e}Formatter`]} @arcgisChange=${this._onRangeInputChange} .readOnly=${!this.rangeLabelsEditingEnabled} .value=${this[e]}></arcgis-label-input>`;
|
|
813
842
|
}
|
|
814
843
|
}
|
|
815
|
-
function
|
|
844
|
+
function Ve(n) {
|
|
816
845
|
return "dataset" in n && n.tagName === "ARCGIS-LABEL-INPUT" && (n.dataset.type === "min" || n.dataset.type === "max");
|
|
817
846
|
}
|
|
818
847
|
function V(n) {
|
|
819
|
-
const e =
|
|
848
|
+
const e = ee(n, "[data-entry]");
|
|
820
849
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
821
850
|
}
|
|
822
|
-
function
|
|
851
|
+
function $e(n) {
|
|
823
852
|
return typeof n != null && n !== "range";
|
|
824
853
|
}
|
|
825
|
-
function
|
|
854
|
+
function Pe(n, e) {
|
|
826
855
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
827
856
|
}
|
|
828
|
-
function
|
|
857
|
+
function Ce(n, e) {
|
|
829
858
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] span.handle`) : null;
|
|
830
859
|
}
|
|
831
|
-
function
|
|
860
|
+
function j(n, e) {
|
|
832
861
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"] arcgis-label-input`) : null;
|
|
833
862
|
}
|
|
834
|
-
function
|
|
863
|
+
function M(n) {
|
|
835
864
|
return n.isPrimary && n.button === 0;
|
|
836
865
|
}
|
|
837
|
-
const
|
|
838
|
-
function
|
|
866
|
+
const Te = 5;
|
|
867
|
+
function S(n, e, t) {
|
|
839
868
|
const a = e - n, i = (t - n) / a * 100;
|
|
840
|
-
return Number.parseFloat(i.toFixed(
|
|
869
|
+
return Number.parseFloat(i.toFixed(Te));
|
|
841
870
|
}
|
|
842
|
-
function
|
|
871
|
+
function X(n, e, t) {
|
|
843
872
|
return Math.max(e, Math.min(t, n));
|
|
844
873
|
}
|
|
845
|
-
|
|
874
|
+
W("arcgis-slider", Ee);
|
|
846
875
|
export {
|
|
847
|
-
|
|
876
|
+
Ee as ArcgisSlider
|
|
848
877
|
};
|