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