@rcarls/rc-range-slider 0.3.2 → 0.4.1
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/CHANGELOG.md +48 -0
- package/dist/custom-elements.json +51 -17
- package/dist/{rc-range-slider-ZmdGXQZw.js → rc-range-slider-45KwZfPx.js} +27 -27
- package/dist/rc-range-slider-45KwZfPx.js.map +1 -0
- package/dist/rc-range-slider-define.js +1 -1
- package/dist/rc-range-slider.js +1 -1
- package/dist/types/packages/rc-range-slider/src/rc-range-slider.d.ts +33 -3
- package/package.json +3 -3
- package/dist/rc-range-slider-ZmdGXQZw.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @rcarls/rc-range-slider
|
|
2
|
+
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @rcarls/rc-common@0.4.1
|
|
8
|
+
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fdcf5b1: Document all `rc-range-slider` attributes and the `--rc-range-slider-vertical-size`,
|
|
14
|
+
`--rc-range-slider-track-size`, and accent-derived range/hover/active/focus CSS
|
|
15
|
+
custom properties in the generated API reference.
|
|
16
|
+
- Updated dependencies [e57277f]
|
|
17
|
+
- Updated dependencies [ccca8e2]
|
|
18
|
+
- Updated dependencies [037b1b3]
|
|
19
|
+
- @rcarls/rc-common@0.4.0
|
|
20
|
+
|
|
21
|
+
## 0.3.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [88b4086]
|
|
26
|
+
- @rcarls/rc-common@0.3.2
|
|
27
|
+
|
|
28
|
+
## 0.3.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- @rcarls/rc-common@0.3.1
|
|
33
|
+
|
|
34
|
+
## 0.3.0
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Update package metadata, README intro, and docs links.
|
|
39
|
+
|
|
40
|
+
### Dependencies
|
|
41
|
+
|
|
42
|
+
- Sync internal dependencies to 0.3.0.
|
|
43
|
+
|
|
44
|
+
## 0.2.0
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- @rcarls/rc-common@0.2.0
|
|
@@ -64,6 +64,16 @@
|
|
|
64
64
|
"name": "--rc-range-slider-control-size",
|
|
65
65
|
"default": "var(--rc-control-block-size)"
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Track length when `orientation=\"vertical\"`.",
|
|
69
|
+
"name": "--rc-range-slider-vertical-size",
|
|
70
|
+
"default": "12.5rem"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"description": "Visual track thickness.",
|
|
74
|
+
"name": "--rc-range-slider-track-size",
|
|
75
|
+
"default": "0.1875rem"
|
|
76
|
+
},
|
|
67
77
|
{
|
|
68
78
|
"description": "Unselected track color.",
|
|
69
79
|
"name": "--rc-range-slider-track-background",
|
|
@@ -74,6 +84,10 @@
|
|
|
74
84
|
"name": "--rc-range-slider-track-radius",
|
|
75
85
|
"default": "var(--rc-control-radius)"
|
|
76
86
|
},
|
|
87
|
+
{
|
|
88
|
+
"description": "Filled selected-range color. Defaults to `--rc-range-slider-accent` (`GrayText` when `disabled`).",
|
|
89
|
+
"name": "--rc-range-slider-range-background"
|
|
90
|
+
},
|
|
77
91
|
{
|
|
78
92
|
"description": "Thumb background color.",
|
|
79
93
|
"name": "--rc-range-slider-thumb-background",
|
|
@@ -89,6 +103,26 @@
|
|
|
89
103
|
"name": "--rc-range-slider-thumb-size",
|
|
90
104
|
"default": "1.125rem"
|
|
91
105
|
},
|
|
106
|
+
{
|
|
107
|
+
"description": "Thumb background on hover. Defaults to `--rc-range-slider-accent` (`ButtonFace` when `disabled`).",
|
|
108
|
+
"name": "--rc-range-slider-thumb-hover-background"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"description": "Thumb border color on hover. Defaults to `--rc-range-slider-accent` (`GrayText` when `disabled`).",
|
|
112
|
+
"name": "--rc-range-slider-thumb-hover-border"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"description": "Thumb background while pressed. Defaults to `--rc-range-slider-accent` (`ButtonFace` when `disabled`).",
|
|
116
|
+
"name": "--rc-range-slider-thumb-active-background"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"description": "Thumb border color while pressed. Defaults to `--rc-range-slider-accent` (`GrayText` when `disabled`).",
|
|
120
|
+
"name": "--rc-range-slider-thumb-active-border"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"description": "Thumb focus ring color. Defaults to `--rc-range-slider-accent` (`GrayText` when `disabled`).",
|
|
124
|
+
"name": "--rc-range-slider-focus-outline"
|
|
125
|
+
},
|
|
92
126
|
{
|
|
93
127
|
"description": "Value display text color.",
|
|
94
128
|
"name": "--rc-range-slider-value-color",
|
|
@@ -346,7 +380,7 @@
|
|
|
346
380
|
},
|
|
347
381
|
{
|
|
348
382
|
"kind": "field",
|
|
349
|
-
"name": "
|
|
383
|
+
"name": "_$lowInput",
|
|
350
384
|
"type": {
|
|
351
385
|
"text": "HTMLInputElement | null"
|
|
352
386
|
},
|
|
@@ -355,7 +389,7 @@
|
|
|
355
389
|
},
|
|
356
390
|
{
|
|
357
391
|
"kind": "field",
|
|
358
|
-
"name": "
|
|
392
|
+
"name": "_$highInput",
|
|
359
393
|
"type": {
|
|
360
394
|
"text": "HTMLInputElement | null"
|
|
361
395
|
},
|
|
@@ -455,13 +489,13 @@
|
|
|
455
489
|
},
|
|
456
490
|
"parameters": [
|
|
457
491
|
{
|
|
458
|
-
"name": "lowInput",
|
|
492
|
+
"name": "$lowInput",
|
|
459
493
|
"type": {
|
|
460
494
|
"text": "HTMLInputElement"
|
|
461
495
|
}
|
|
462
496
|
},
|
|
463
497
|
{
|
|
464
|
-
"name": "highInput",
|
|
498
|
+
"name": "$highInput",
|
|
465
499
|
"type": {
|
|
466
500
|
"text": "HTMLInputElement"
|
|
467
501
|
}
|
|
@@ -515,7 +549,7 @@
|
|
|
515
549
|
},
|
|
516
550
|
"parameters": [
|
|
517
551
|
{
|
|
518
|
-
"name": "input",
|
|
552
|
+
"name": "$input",
|
|
519
553
|
"type": {
|
|
520
554
|
"text": "HTMLInputElement"
|
|
521
555
|
}
|
|
@@ -898,7 +932,7 @@
|
|
|
898
932
|
},
|
|
899
933
|
{
|
|
900
934
|
"kind": "method",
|
|
901
|
-
"name": "
|
|
935
|
+
"name": "_$thumbElement",
|
|
902
936
|
"privacy": "private",
|
|
903
937
|
"return": {
|
|
904
938
|
"type": {
|
|
@@ -975,102 +1009,102 @@
|
|
|
975
1009
|
],
|
|
976
1010
|
"attributes": [
|
|
977
1011
|
{
|
|
1012
|
+
"description": "Minimum slider value.",
|
|
978
1013
|
"name": "min",
|
|
979
1014
|
"type": {
|
|
980
1015
|
"text": "number"
|
|
981
1016
|
},
|
|
982
1017
|
"default": "0",
|
|
983
|
-
"description": "Minimum slider value.",
|
|
984
1018
|
"fieldName": "min"
|
|
985
1019
|
},
|
|
986
1020
|
{
|
|
1021
|
+
"description": "Maximum slider value.",
|
|
987
1022
|
"name": "max",
|
|
988
1023
|
"type": {
|
|
989
1024
|
"text": "number"
|
|
990
1025
|
},
|
|
991
1026
|
"default": "100",
|
|
992
|
-
"description": "Maximum slider value.",
|
|
993
1027
|
"fieldName": "max"
|
|
994
1028
|
},
|
|
995
1029
|
{
|
|
1030
|
+
"description": "Slider step.",
|
|
996
1031
|
"name": "step",
|
|
997
1032
|
"type": {
|
|
998
1033
|
"text": "number"
|
|
999
1034
|
},
|
|
1000
1035
|
"default": "1",
|
|
1001
|
-
"description": "Slider step.",
|
|
1002
1036
|
"fieldName": "step"
|
|
1003
1037
|
},
|
|
1004
1038
|
{
|
|
1039
|
+
"description": "Disable both thumbs and their hidden native input reflectors.",
|
|
1005
1040
|
"name": "disabled",
|
|
1006
1041
|
"type": {
|
|
1007
1042
|
"text": "boolean"
|
|
1008
1043
|
},
|
|
1009
1044
|
"default": "false",
|
|
1010
|
-
"description": "Disable both thumbs and their hidden native input reflectors.",
|
|
1011
1045
|
"fieldName": "disabled"
|
|
1012
1046
|
},
|
|
1013
1047
|
{
|
|
1048
|
+
"description": "Prevents edits while preserving normal focus and display.",
|
|
1014
1049
|
"name": "readonly",
|
|
1015
1050
|
"type": {
|
|
1016
1051
|
"text": "boolean"
|
|
1017
1052
|
},
|
|
1018
1053
|
"default": "false",
|
|
1019
|
-
"description": "Prevents edits while preserving normal focus and display.",
|
|
1020
1054
|
"fieldName": "readonly"
|
|
1021
1055
|
},
|
|
1022
1056
|
{
|
|
1057
|
+
"description": "Accessible label for the low (min) thumb when the input does not provide one.",
|
|
1023
1058
|
"name": "low-label",
|
|
1024
1059
|
"type": {
|
|
1025
1060
|
"text": "string"
|
|
1026
1061
|
},
|
|
1027
1062
|
"default": "\"Minimum\"",
|
|
1028
|
-
"description": "Accessible label for the low (min) thumb when the input does not provide one.",
|
|
1029
1063
|
"fieldName": "lowLabel"
|
|
1030
1064
|
},
|
|
1031
1065
|
{
|
|
1066
|
+
"description": "Accessible label for the high (max) thumb when the input does not provide one.",
|
|
1032
1067
|
"name": "high-label",
|
|
1033
1068
|
"type": {
|
|
1034
1069
|
"text": "string"
|
|
1035
1070
|
},
|
|
1036
1071
|
"default": "\"Maximum\"",
|
|
1037
|
-
"description": "Accessible label for the high (max) thumb when the input does not provide one.",
|
|
1038
1072
|
"fieldName": "highLabel"
|
|
1039
1073
|
},
|
|
1040
1074
|
{
|
|
1075
|
+
"description": "Formatted screen-reader text for the low value. Falls back to the raw number.",
|
|
1041
1076
|
"name": "low-value-text",
|
|
1042
1077
|
"type": {
|
|
1043
1078
|
"text": "string"
|
|
1044
1079
|
},
|
|
1045
1080
|
"default": "\"\"",
|
|
1046
|
-
"description": "Formatted screen-reader text for the low value. Falls back to the raw number.",
|
|
1047
1081
|
"fieldName": "lowValueText"
|
|
1048
1082
|
},
|
|
1049
1083
|
{
|
|
1084
|
+
"description": "Formatted screen-reader text for the high value. Falls back to the raw number.",
|
|
1050
1085
|
"name": "high-value-text",
|
|
1051
1086
|
"type": {
|
|
1052
1087
|
"text": "string"
|
|
1053
1088
|
},
|
|
1054
1089
|
"default": "\"\"",
|
|
1055
|
-
"description": "Formatted screen-reader text for the high value. Falls back to the raw number.",
|
|
1056
1090
|
"fieldName": "highValueText"
|
|
1057
1091
|
},
|
|
1058
1092
|
{
|
|
1093
|
+
"description": "Controls the live value display.\n\n- Absent (default) — no value shown.\n- `display` or `display=\"float\"` — floats each value above its thumb.\n- `display=\"inline-start\"` — renders the value container before the track.\n- `display=\"inline-end\"` — renders the value container after the track.",
|
|
1059
1094
|
"name": "display",
|
|
1060
1095
|
"type": {
|
|
1061
1096
|
"text": "DisplayValue"
|
|
1062
1097
|
},
|
|
1063
1098
|
"default": "null",
|
|
1064
|
-
"description": "Controls the live value display.\n\n- Absent (default) — no value shown.\n- `display` or `display=\"float\"` — floats each value above its thumb.\n- `display=\"inline-start\"` — renders the value container before the track.\n- `display=\"inline-end\"` — renders the value container after the track.",
|
|
1065
1099
|
"fieldName": "display"
|
|
1066
1100
|
},
|
|
1067
1101
|
{
|
|
1102
|
+
"description": "Orientation; reflected as an attribute and forwarded to custom thumbs.",
|
|
1068
1103
|
"name": "orientation",
|
|
1069
1104
|
"type": {
|
|
1070
1105
|
"text": "\"horizontal\" | \"vertical\""
|
|
1071
1106
|
},
|
|
1072
1107
|
"default": "\"horizontal\"",
|
|
1073
|
-
"description": "Orientation; reflected as an attribute and forwarded to custom thumbs.",
|
|
1074
1108
|
"fieldName": "orientation"
|
|
1075
1109
|
}
|
|
1076
1110
|
],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as h, state as
|
|
3
|
-
import { NativeChildController as
|
|
4
|
-
var
|
|
1
|
+
import { LitElement as I, css as x, nothing as u, html as m } from "lit";
|
|
2
|
+
import { property as h, state as $ } from "lit/decorators.js";
|
|
3
|
+
import { NativeChildController as k, getDirectChildren as T, snapToStep as _, valueToPercent as b } from "@rcarls/rc-common";
|
|
4
|
+
var C = Object.defineProperty, z = Object.getOwnPropertyDescriptor, n = (o, t, e, r) => {
|
|
5
5
|
for (var i = r > 1 ? void 0 : r ? z(t, e) : t, a = o.length - 1, l; a >= 0; a--)
|
|
6
6
|
(l = o[a]) && (i = (r ? l(t, e, i) : l(i)) || i);
|
|
7
|
-
return r && i &&
|
|
7
|
+
return r && i && C(t, e, i), i;
|
|
8
8
|
};
|
|
9
9
|
const P = {
|
|
10
10
|
fromAttribute(o) {
|
|
@@ -19,9 +19,9 @@ function v(o, t) {
|
|
|
19
19
|
const e = parseFloat(o);
|
|
20
20
|
return isNaN(e) ? t : e;
|
|
21
21
|
}
|
|
22
|
-
const f = class f extends
|
|
22
|
+
const f = class f extends I {
|
|
23
23
|
constructor() {
|
|
24
|
-
super(...arguments), this.min = 0, this.max = 100, this.step = 1, this._valueInitialized = !1, this.disabled = !1, this.readonly = !1, this.lowLabel = "Minimum", this.highLabel = "Maximum", this.lowValueText = "", this.highValueText = "", this.display = null, this.orientation = "horizontal", this._lowValue = 0, this._highValue = 100, this.
|
|
24
|
+
super(...arguments), this.min = 0, this.max = 100, this.step = 1, this._valueInitialized = !1, this.disabled = !1, this.readonly = !1, this.lowLabel = "Minimum", this.highLabel = "Maximum", this.lowValueText = "", this.highValueText = "", this.display = null, this.orientation = "horizontal", this._lowValue = 0, this._highValue = 100, this._$lowInput = null, this._$highInput = null, this._dragThumb = null, this._dragPointerId = null, this._addedHostRole = !1, this._rangeInputController = new k(this, {
|
|
25
25
|
selector: ':scope > input[type="range"]',
|
|
26
26
|
observe: !0,
|
|
27
27
|
onChange: () => this._resetInputs(),
|
|
@@ -87,7 +87,7 @@ const f = class f extends x {
|
|
|
87
87
|
this._syncInputReflectors();
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
|
-
const t = this.
|
|
90
|
+
const t = this._$lowInput, e = this._$highInput;
|
|
91
91
|
if (!t || !e) return u;
|
|
92
92
|
const r = this.lowValueText || String(this._lowValue), i = this.highValueText || String(this._highValue), a = m`
|
|
93
93
|
<span class="rc-range-slider-values" aria-hidden="true">
|
|
@@ -141,7 +141,7 @@ const f = class f extends x {
|
|
|
141
141
|
`;
|
|
142
142
|
}
|
|
143
143
|
_renderThumb(t) {
|
|
144
|
-
const e = t === "low", r = e ? this.
|
|
144
|
+
const e = t === "low", r = e ? this._$lowInput : this._$highInput, i = e ? this._lowValue : this._highValue, a = e ? this.lowValueText : this.highValueText, l = this._thumbLabel(t), d = r?.getAttribute("aria-labelledby");
|
|
145
145
|
return m`
|
|
146
146
|
<span
|
|
147
147
|
part=${e ? "thumb low-thumb" : "thumb high-thumb"}
|
|
@@ -169,20 +169,20 @@ const f = class f extends x {
|
|
|
169
169
|
* reflectors.
|
|
170
170
|
*/
|
|
171
171
|
_findInputs() {
|
|
172
|
-
const t =
|
|
172
|
+
const t = T(
|
|
173
173
|
this,
|
|
174
174
|
':scope > input[type="range"]'
|
|
175
175
|
).slice(0, 2);
|
|
176
176
|
if (t.length < 2)
|
|
177
177
|
return;
|
|
178
178
|
const [e, r] = t;
|
|
179
|
-
!this.hasAttribute("disabled") && (e.disabled || r.disabled) && (this.disabled = !0), this.
|
|
179
|
+
!this.hasAttribute("disabled") && (e.disabled || r.disabled) && (this.disabled = !0), this._$lowInput = e, this._$highInput = r, this._applyInitialValueToInputs(e, r), this._wireInput(e, this._onLowInput, this._onLowChange), this._wireInput(r, this._onHighInput, this._onHighChange), this._syncInputReflectors();
|
|
180
180
|
}
|
|
181
181
|
_resetInputs() {
|
|
182
182
|
this._unwireInputs(), this._restoreInputs(), this._findInputs(), this.requestUpdate();
|
|
183
183
|
}
|
|
184
184
|
get _nativeInputValue() {
|
|
185
|
-
const t = this.
|
|
185
|
+
const t = this._$lowInput?.valueAsNumber, e = this._$highInput?.valueAsNumber;
|
|
186
186
|
return [
|
|
187
187
|
t === void 0 || isNaN(t) ? this.min : t,
|
|
188
188
|
e === void 0 || isNaN(e) ? this.max : e
|
|
@@ -202,7 +202,7 @@ const f = class f extends x {
|
|
|
202
202
|
}
|
|
203
203
|
_applyValueToInputs(t) {
|
|
204
204
|
const [e, r] = this._normalizeValue(t);
|
|
205
|
-
this._lowValue = e, this._highValue = r, this.
|
|
205
|
+
this._lowValue = e, this._highValue = r, this._$lowInput && (this._$lowInput.value = String(e)), this._$highInput && (this._$highInput.value = String(r));
|
|
206
206
|
}
|
|
207
207
|
_setCurrentValue(t) {
|
|
208
208
|
const [e, r] = this._normalizeValue(t);
|
|
@@ -212,14 +212,14 @@ const f = class f extends x {
|
|
|
212
212
|
t.addEventListener("input", e), t.addEventListener("change", r);
|
|
213
213
|
}
|
|
214
214
|
_unwireInputs() {
|
|
215
|
-
this.
|
|
215
|
+
this._$lowInput?.removeEventListener("input", this._onLowInput), this._$lowInput?.removeEventListener("change", this._onLowChange), this._$highInput?.removeEventListener("input", this._onHighInput), this._$highInput?.removeEventListener("change", this._onHighChange);
|
|
216
216
|
}
|
|
217
217
|
_restoreInputs() {
|
|
218
|
-
for (const t of [this.
|
|
218
|
+
for (const t of [this._$lowInput, this._$highInput])
|
|
219
219
|
t?.removeAttribute("aria-hidden"), t?.removeAttribute("tabindex"), t?.removeAttribute("data-rc-range-slider-reflector"), t?.style.removeProperty("display");
|
|
220
220
|
}
|
|
221
221
|
_syncInputReflectors() {
|
|
222
|
-
const t = this.
|
|
222
|
+
const t = this._$lowInput, e = this._$highInput;
|
|
223
223
|
if (!(!t || !e))
|
|
224
224
|
for (const r of [t, e])
|
|
225
225
|
r.disabled = this.disabled, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), r.setAttribute("data-rc-range-slider-reflector", "");
|
|
@@ -261,7 +261,7 @@ const f = class f extends x {
|
|
|
261
261
|
}
|
|
262
262
|
_onGroupPointerDown(t) {
|
|
263
263
|
if (this.disabled || this.readonly || t.button !== 0) return;
|
|
264
|
-
const e = this._nearestThumb(t), r = this.
|
|
264
|
+
const e = this._nearestThumb(t), r = this._$thumbElement(e);
|
|
265
265
|
this._dragThumb = e, this._dragPointerId = t.pointerId, t.preventDefault();
|
|
266
266
|
try {
|
|
267
267
|
t.currentTarget.setPointerCapture(t.pointerId);
|
|
@@ -280,7 +280,7 @@ const f = class f extends x {
|
|
|
280
280
|
t.currentTarget.releasePointerCapture(t.pointerId);
|
|
281
281
|
} catch {
|
|
282
282
|
}
|
|
283
|
-
this._dispatch("rc-range-slider-change", this.value), this.
|
|
283
|
+
this._dispatch("rc-range-slider-change", this.value), this._$thumbElement(e)?.focus();
|
|
284
284
|
}
|
|
285
285
|
_onGroupPointerCancel(t) {
|
|
286
286
|
this._dragPointerId === t.pointerId && (this._dragThumb = null, this._dragPointerId = null);
|
|
@@ -331,22 +331,22 @@ const f = class f extends x {
|
|
|
331
331
|
return [Math.min(a, l), Math.max(a, l)];
|
|
332
332
|
}
|
|
333
333
|
_min() {
|
|
334
|
-
return v(this.
|
|
334
|
+
return v(this._$lowInput?.min ?? "", this.min);
|
|
335
335
|
}
|
|
336
336
|
_max() {
|
|
337
|
-
return v(this.
|
|
337
|
+
return v(this._$highInput?.max ?? "", this.max);
|
|
338
338
|
}
|
|
339
339
|
_step() {
|
|
340
|
-
return v(this.
|
|
340
|
+
return v(this._$lowInput?.step ?? "", this.step);
|
|
341
341
|
}
|
|
342
342
|
_groupRect() {
|
|
343
343
|
return this.shadowRoot?.querySelector(".rc-range-slider-group")?.getBoundingClientRect() ?? null;
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
_$thumbElement(t) {
|
|
346
346
|
return this.shadowRoot?.querySelector(`[data-thumb="${t}"]`) ?? null;
|
|
347
347
|
}
|
|
348
348
|
_thumbLabel(t) {
|
|
349
|
-
const e = t === "low" ? this.
|
|
349
|
+
const e = t === "low" ? this._$lowInput : this._$highInput, r = t === "low" ? this.lowLabel : this.highLabel, i = e?.getAttribute("aria-label");
|
|
350
350
|
if (i) return i;
|
|
351
351
|
const a = e?.labels?.[0]?.textContent?.trim();
|
|
352
352
|
return a || r || null;
|
|
@@ -361,7 +361,7 @@ const f = class f extends x {
|
|
|
361
361
|
);
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
f.styles =
|
|
364
|
+
f.styles = x`
|
|
365
365
|
:host {
|
|
366
366
|
--rc-range-slider-accent: var(--rc-accent, Highlight);
|
|
367
367
|
--rc-range-slider-track-background: color-mix(in srgb, CanvasText 25%, Canvas);
|
|
@@ -608,12 +608,12 @@ n([
|
|
|
608
608
|
h({ reflect: !0 })
|
|
609
609
|
], s.prototype, "orientation", 2);
|
|
610
610
|
n([
|
|
611
|
-
|
|
611
|
+
$()
|
|
612
612
|
], s.prototype, "_lowValue", 2);
|
|
613
613
|
n([
|
|
614
|
-
|
|
614
|
+
$()
|
|
615
615
|
], s.prototype, "_highValue", 2);
|
|
616
616
|
export {
|
|
617
617
|
s as R
|
|
618
618
|
};
|
|
619
|
-
//# sourceMappingURL=rc-range-slider-
|
|
619
|
+
//# sourceMappingURL=rc-range-slider-45KwZfPx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rc-range-slider-45KwZfPx.js","sources":["../src/rc-range-slider.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport type { ComplexAttributeConverter } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport {\n NativeChildController,\n getDirectChildren,\n snapToStep,\n valueToPercent,\n warnMissingDirectChild,\n} from \"@rcarls/rc-common\";\n\nexport interface RCRangeSliderValueEvent {\n /** Current [low, high] value tuple. */\n value: [number, number];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"rc-range-slider\": RCRangeSlider;\n }\n\n interface HTMLElementEventMap {\n \"rc-range-slider-input\": CustomEvent<RCRangeSliderValueEvent>;\n \"rc-range-slider-change\": CustomEvent<RCRangeSliderValueEvent>;\n }\n}\n\ntype DisplayValue = \"float\" | \"inline-start\" | \"inline-end\" | null;\ntype RangeThumb = \"low\" | \"high\";\n\n/**\n * Normalises the `display` attribute.\n * A bare boolean attribute (`display` with no value) maps to `'float'` so\n * the reflected attribute is always an explicit string, never an empty string.\n */\nconst displayConverter: ComplexAttributeConverter<DisplayValue> = {\n fromAttribute(v: string | null): DisplayValue {\n if (v === null) return null;\n if (v === \"\" || v === \"float\") return \"float\";\n if (v === \"inline-start\") return \"inline-start\";\n if (v === \"inline-end\") return \"inline-end\";\n return null;\n },\n toAttribute(v: DisplayValue): string | null {\n return v;\n },\n};\n\n/**\n * Returns the numeric value of a range input's `min`, `max`, or `step`\n * attribute string, falling back to `defaultVal` when the attribute is absent\n * (empty string) or not a valid number.\n */\nfunction parseAttr(s: string, defaultVal: number): number {\n if (s === \"\") return defaultVal;\n\n const n = parseFloat(s);\n\n return isNaN(n) ? defaultVal : n;\n}\n\n/**\n * Two-thumb range slider backed by native range inputs for min/max values, following the\n * WAI-ARIA Multi-Thumb Slider pattern.\n *\n * Consumers provide two direct child `<input type=\"range\">` elements. Before\n * upgrade, those inputs are the usable progressive-enhancement fallback. After\n * upgrade, the inputs remain in light DOM as hidden form reflectors while the\n * shadow thumbs become the focusable, accessible interaction surface.\n *\n * Form participation is handled natively by each input's `name` attribute.\n *\n * @see {@link https://richardcarls.github.io/rc-webcomponents/components/rc-range-slider rc-range-slider docs}\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/ WAI-ARIA Multi-Thumb Slider pattern}\n *\n * @slot - Consumer-provided native range inputs.\n * @slot track-background - Optional decorative content rendered inside the track before the selected range fill.\n * @slot low-value-display - Optional replacement for the low value text.\n * @slot high-value-display - Optional replacement for the high value text.\n *\n * @fires rc-range-slider-input - Fires while either thumb moves. Detail: `{ value }`.\n * @fires rc-range-slider-change - Fires when a thumb commits a new value. Detail: `{ value }`.\n *\n * @attr min - Minimum slider value.\n * @attr max - Maximum slider value.\n * @attr step - Slider step.\n * @attr disabled - Disables both thumbs and their hidden native input reflectors.\n * @attr readonly - Prevents edits while preserving normal focus and display.\n * @attr low-label - Accessible label for the low (min) thumb when the input does not provide one.\n * @attr high-label - Accessible label for the high (max) thumb when the input does not provide\n * one.\n * @attr low-value-text - Formatted screen-reader text for the low value. Falls back to the raw\n * number.\n * @attr high-value-text - Formatted screen-reader text for the high value. Falls back to the raw\n * number.\n * @attr display - Controls the live value display: absent (none), `float`, `inline-start`, or\n * `inline-end`.\n * @attr orientation - Orientation, forwarded to the custom thumbs: `horizontal` or `vertical`.\n *\n * @cssprop [--rc-range-slider-accent=Highlight] - Accent color for selected range, thumb border, focus, hover, and active states.\n * @cssprop [--rc-range-slider-gap=var(--rc-control-gap)] - Gap between track and inline value display.\n * @cssprop [--rc-range-slider-control-size=var(--rc-control-block-size)] - Track hit-area block size.\n * @cssprop [--rc-range-slider-vertical-size=12.5rem] - Track length when `orientation=\"vertical\"`.\n * @cssprop [--rc-range-slider-track-size=0.1875rem] - Visual track thickness.\n * @cssprop [--rc-range-slider-track-background=color-mix(in srgb, CanvasText 25%, Canvas)] - Unselected track color.\n * @cssprop [--rc-range-slider-track-radius=var(--rc-control-radius)] - Track border radius.\n * @cssprop [--rc-range-slider-range-background] - Filled selected-range color. Defaults to\n * `--rc-range-slider-accent` (`GrayText` when `disabled`).\n * @cssprop [--rc-range-slider-thumb-background=ButtonFace] - Thumb background color.\n * @cssprop [--rc-range-slider-thumb-border=var(--rc-range-slider-accent)] - Thumb border color.\n * @cssprop [--rc-range-slider-thumb-size=1.125rem] - Visual thumb inline/block size.\n * @cssprop [--rc-range-slider-thumb-hover-background] - Thumb background on hover. Defaults to\n * `--rc-range-slider-accent` (`ButtonFace` when `disabled`).\n * @cssprop [--rc-range-slider-thumb-hover-border] - Thumb border color on hover. Defaults to\n * `--rc-range-slider-accent` (`GrayText` when `disabled`).\n * @cssprop [--rc-range-slider-thumb-active-background] - Thumb background while pressed. Defaults\n * to `--rc-range-slider-accent` (`ButtonFace` when `disabled`).\n * @cssprop [--rc-range-slider-thumb-active-border] - Thumb border color while pressed. Defaults to\n * `--rc-range-slider-accent` (`GrayText` when `disabled`).\n * @cssprop [--rc-range-slider-focus-outline] - Thumb focus ring color. Defaults to\n * `--rc-range-slider-accent` (`GrayText` when `disabled`).\n * @cssprop [--rc-range-slider-value-color=var(--rc-text-disabled)] - Value display text color.\n * @cssprop [--rc-thumb-radius=9px] - Half the thumb width; used to align float value displays and range fill.\n * @cssprop [--rc-range-slider-float-value-block-offset=-1.4em] - Block-axis offset for horizontal float value displays.\n * @cssprop [--rc-range-slider-float-value-inline-offset=calc(100% + 0.5rem)] - Inline-axis offset for vertical float value displays.\n *\n * @csspart root - Root layout wrapper.\n * @csspart group - Slider group wrapper.\n * @csspart track - Visual slider track.\n * @csspart range - Filled selected range segment.\n * @csspart thumb - Shared custom slider thumb.\n * @csspart low-thumb - Low-value custom slider thumb.\n * @csspart high-thumb - High-value custom slider thumb.\n * @csspart value-display - Shared rendered value text.\n * @csspart low-value-display - Rendered low value text.\n * @csspart high-value-display - Rendered high value text.\n */\nexport class RCRangeSlider extends LitElement {\n static override styles = css`\n :host {\n --rc-range-slider-accent: var(--rc-accent, Highlight);\n --rc-range-slider-track-background: color-mix(in srgb, CanvasText 25%, Canvas);\n --rc-range-slider-range-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-background: ButtonFace;\n --rc-range-slider-thumb-border: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-hover-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-hover-border: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-active-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-active-border: var(--rc-range-slider-accent);\n --rc-range-slider-focus-outline: var(--rc-range-slider-accent);\n display: block;\n font-family: var(--rc-font-family, inherit);\n font-size: var(--rc-font-size, inherit);\n line-height: var(--rc-line-height, normal);\n }\n\n :host([disabled]) {\n --rc-range-slider-accent: GrayText;\n --rc-range-slider-track-background: color-mix(in srgb, GrayText 35%, Canvas);\n --rc-range-slider-range-background: GrayText;\n --rc-range-slider-thumb-border: GrayText;\n --rc-range-slider-thumb-hover-background: ButtonFace;\n --rc-range-slider-thumb-hover-border: GrayText;\n --rc-range-slider-thumb-active-background: ButtonFace;\n --rc-range-slider-thumb-active-border: GrayText;\n --rc-range-slider-focus-outline: GrayText;\n }\n\n .rc-range-slider-root {\n display: grid;\n gap: var(--rc-range-slider-gap, var(--rc-control-gap, 0.5rem));\n align-items: center;\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] {\n grid-template-columns: auto minmax(0, 1fr);\n }\n\n .rc-range-slider-root[data-display=\"inline-end\"] {\n grid-template-columns: minmax(0, 1fr) auto;\n }\n\n .rc-range-slider-group {\n position: relative;\n display: block;\n min-width: 0;\n min-height: var(--rc-range-slider-control-size, var(--rc-control-block-size, 1.5rem));\n touch-action: none;\n }\n\n .rc-range-slider-track,\n .rc-range-slider-range {\n position: absolute;\n pointer-events: none;\n }\n\n .rc-range-slider-track {\n inset-inline: 0;\n inset-block: calc(50% - var(--rc-range-slider-track-size, 0.1875rem) / 2);\n block-size: var(--rc-range-slider-track-size, 0.1875rem);\n background: var(--rc-range-slider-track-background);\n border-radius: var(--rc-range-slider-track-radius, var(--rc-control-radius, 0));\n overflow: hidden;\n z-index: 0;\n }\n\n ::slotted([slot=\"track-background\"]) {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .rc-range-slider-range {\n inset-block: 0;\n background: var(--rc-range-slider-range-background);\n border-radius: inherit;\n z-index: 1;\n }\n\n .rc-range-slider-thumb {\n position: absolute;\n z-index: 2;\n inline-size: var(--rc-range-slider-thumb-size, 1.125rem);\n block-size: var(--rc-range-slider-thumb-size, 1.125rem);\n background: var(--rc-range-slider-thumb-background);\n border: 2px solid var(--rc-range-slider-thumb-border);\n border-radius: 50%;\n box-sizing: border-box;\n cursor: grab;\n transform: translate(-50%, -50%);\n transition:\n background-color 120ms ease,\n border-color 120ms ease,\n box-shadow 120ms ease,\n transform var(--rc-motion-duration, 120ms) ease;\n }\n\n .rc-range-slider-thumb:focus-visible {\n outline: var(--rc-focus-ring, 2px solid var(--rc-range-slider-focus-outline));\n outline-offset: var(--rc-focus-ring-offset, 2px);\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-thumb:hover {\n background: var(--rc-range-slider-thumb-hover-background);\n border-color: var(--rc-range-slider-thumb-hover-border);\n box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--rc-range-slider-accent) 20%, transparent);\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-thumb:active {\n background: var(--rc-range-slider-thumb-active-background);\n border-color: var(--rc-range-slider-thumb-active-border);\n box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--rc-range-slider-accent) 28%, transparent);\n cursor: grabbing;\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-group:hover .rc-range-slider-track {\n background: color-mix(in srgb, var(--rc-range-slider-track-background) 70%, CanvasText);\n }\n\n .rc-range-slider-thumb[aria-disabled=\"true\"],\n .rc-range-slider-thumb[aria-readonly=\"true\"] {\n cursor: default;\n }\n\n :host([disabled]) .rc-range-slider-root {\n opacity: 0.65;\n }\n\n ::slotted(input[type=\"range\"]) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: 0;\n padding: 0;\n border: 0;\n clip-path: inset(50%);\n opacity: 0;\n overflow: hidden;\n pointer-events: none;\n }\n\n .rc-range-slider-values {\n pointer-events: none;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n color: var(--rc-range-slider-value-color, var(--rc-text-disabled, GrayText));\n }\n\n .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-values {\n position: absolute;\n inset: 0;\n z-index: 5;\n }\n\n .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-value {\n position: absolute;\n inset-block-start: var(--rc-range-slider-float-value-block-offset, -1.4em);\n transform: translateX(-50%);\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] .rc-range-slider-values,\n .rc-range-slider-root[data-display=\"inline-end\"] .rc-range-slider-values {\n display: flex;\n gap: 0.25em;\n align-items: center;\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] .rc-range-slider-value:first-child::after,\n .rc-range-slider-root[data-display=\"inline-end\"] .rc-range-slider-value:first-child::after {\n content: \" -\";\n }\n\n :host([orientation=\"vertical\"]) {\n display: inline-block;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-group {\n inline-size: var(--rc-range-slider-control-size, var(--rc-control-block-size, 1.5rem));\n block-size: var(--rc-range-slider-vertical-size, 12.5rem);\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-track {\n inset-block: 0;\n inset-inline: calc(50% - var(--rc-range-slider-track-size, 0.1875rem) / 2);\n inline-size: var(--rc-range-slider-track-size, 0.1875rem);\n block-size: auto;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-range {\n inset-inline: 0;\n inset-block-start: auto;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-thumb {\n inset-inline-start: 50%;\n transform: translate(-50%, 50%);\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-value {\n inset-block-start: auto;\n inset-inline-start: var(--rc-range-slider-float-value-inline-offset, calc(100% + 0.5rem));\n transform: translateY(50%);\n }\n `;\n\n /** Minimum slider value. */\n @property({ type: Number }) min = 0;\n\n /** Maximum slider value. */\n @property({ type: Number }) max = 100;\n\n /** Slider step. */\n @property({ type: Number }) step = 1;\n\n private _value: [number, number] | undefined;\n private _defaultValue: [number, number] | undefined;\n private _valueInitialized = false;\n\n /** Current [low, high] value. Assign a new tuple reference to trigger a re-render. */\n @property({ attribute: false })\n get value(): [number, number] {\n return this._value ?? this._defaultValue ?? this._nativeInputValue;\n }\n set value(v: [number, number]) {\n const old = this._value;\n this._value = this._normalizeValue(v);\n this._valueInitialized = true;\n this._applyValueToInputs(this._value);\n if (this._value !== old) {\n this.requestUpdate(\"value\", old);\n }\n }\n\n /** Initial uncontrolled [low, high] value. Has no effect after the first user interaction or `value` write. */\n @property({ attribute: false })\n get defaultValue(): [number, number] | undefined {\n return this._defaultValue;\n }\n set defaultValue(v: [number, number] | undefined) {\n const old = this._defaultValue;\n this._defaultValue = v === undefined ? undefined : this._normalizeValue(v);\n if (\n !this._valueInitialized &&\n this._value === undefined &&\n this._defaultValue !== undefined\n ) {\n this._applyValueToInputs(this._defaultValue);\n this.requestUpdate(\"value\", undefined);\n }\n this.requestUpdate(\"defaultValue\", old);\n }\n\n /** Disable both thumbs and their hidden native input reflectors. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Prevents edits while preserving normal focus and display. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Accessible label for the low (min) thumb when the input does not provide one. */\n @property({ attribute: \"low-label\" }) lowLabel = \"Minimum\";\n\n /** Accessible label for the high (max) thumb when the input does not provide one. */\n @property({ attribute: \"high-label\" }) highLabel = \"Maximum\";\n\n /** Formatted screen-reader text for the low value. Falls back to the raw number. */\n @property({ attribute: \"low-value-text\" }) lowValueText = \"\";\n\n /** Formatted screen-reader text for the high value. Falls back to the raw number. */\n @property({ attribute: \"high-value-text\" }) highValueText = \"\";\n\n /**\n * Controls the live value display.\n *\n * - Absent (default) — no value shown.\n * - `display` or `display=\"float\"` — floats each value above its thumb.\n * - `display=\"inline-start\"` — renders the value container before the track.\n * - `display=\"inline-end\"` — renders the value container after the track.\n */\n @property({ reflect: true, converter: displayConverter })\n display: DisplayValue = null;\n\n /** Orientation; reflected as an attribute and forwarded to custom thumbs. */\n @property({ reflect: true }) orientation: \"horizontal\" | \"vertical\" =\n \"horizontal\";\n\n @state() private _lowValue = 0;\n @state() private _highValue = 100;\n\n private _$lowInput: HTMLInputElement | null = null;\n private _$highInput: HTMLInputElement | null = null;\n private _dragThumb: RangeThumb | null = null;\n private _dragPointerId: number | null = null;\n private _addedHostRole = false;\n private readonly _rangeInputController = new NativeChildController<HTMLInputElement>(this, {\n selector: ':scope > input[type=\"range\"]',\n observe: true,\n onChange: () => this._resetInputs(),\n onMissing: () => {\n if (import.meta.env.DEV) {\n warnMissingDirectChild(this, {\n selector: ':scope > input[type=\"range\"]',\n message: '[rc-range-slider] Requires two child <input type=\"range\"> elements.',\n });\n }\n },\n });\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._syncHostRole();\n }\n\n override disconnectedCallback(): void {\n this._unwireInputs();\n this._restoreInputs();\n if (this._addedHostRole) {\n this.removeAttribute(\"role\");\n this._addedHostRole = false;\n }\n super.disconnectedCallback();\n }\n\n override updated(): void {\n this._syncInputReflectors();\n }\n\n override render() {\n const $lo = this._$lowInput;\n const $hi = this._$highInput;\n if (!$lo || !$hi) return nothing;\n\n const lowText = this.lowValueText || String(this._lowValue);\n const highText = this.highValueText || String(this._highValue);\n\n const valuesContainer = html`\n <span class=\"rc-range-slider-values\" aria-hidden=\"true\">\n <span\n part=\"value-display low-value-display\"\n class=\"rc-range-slider-value\"\n style=${this.display === \"float\"\n ? this._floatStyle(this._lowValue)\n : nothing}\n ><slot name=\"low-value-display\">${lowText}</slot></span\n >\n <span\n part=\"value-display high-value-display\"\n class=\"rc-range-slider-value\"\n style=${this.display === \"float\"\n ? this._floatStyle(this._highValue)\n : nothing}\n ><slot name=\"high-value-display\">${highText}</slot></span\n >\n </span>\n `;\n\n return html`\n <div\n part=\"root\"\n class=\"rc-range-slider-root\"\n data-display=${this.display ?? nothing}\n data-orientation=${this.orientation}\n >\n ${this.display === \"inline-start\" ? valuesContainer : nothing}\n\n <div\n part=\"group\"\n class=\"rc-range-slider-group\"\n @pointerdown=${this._onGroupPointerDown}\n @pointermove=${this._onGroupPointerMove}\n @pointerup=${this._onGroupPointerUp}\n @pointercancel=${this._onGroupPointerCancel}\n >\n <span part=\"track\" class=\"rc-range-slider-track\" aria-hidden=\"true\">\n <slot name=\"track-background\"></slot>\n <span\n part=\"range\"\n class=\"rc-range-slider-range\"\n style=${this._rangeStyle()}\n ></span>\n </span>\n\n ${this._renderThumb(\"low\")} ${this._renderThumb(\"high\")}\n <slot @slotchange=${this._onDefaultSlotChange}></slot>\n ${this.display === \"float\" ? valuesContainer : nothing}\n </div>\n\n ${this.display === \"inline-end\" ? valuesContainer : nothing}\n </div>\n `;\n }\n\n private _renderThumb(thumb: RangeThumb) {\n const isLow = thumb === \"low\";\n const $input = isLow ? this._$lowInput : this._$highInput;\n const value = isLow ? this._lowValue : this._highValue;\n const valueText = isLow ? this.lowValueText : this.highValueText;\n const label = this._thumbLabel(thumb);\n const labelledBy = $input?.getAttribute(\"aria-labelledby\");\n\n return html`\n <span\n part=${isLow ? \"thumb low-thumb\" : \"thumb high-thumb\"}\n class=\"rc-range-slider-thumb\"\n data-thumb=${thumb}\n role=\"slider\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n aria-label=${label ?? nothing}\n aria-labelledby=${labelledBy ?? nothing}\n aria-valuemin=${String(isLow ? this._min() : this._lowValue)}\n aria-valuemax=${String(isLow ? this._highValue : this._max())}\n aria-valuenow=${String(value)}\n aria-valuetext=${valueText || nothing}\n aria-orientation=${this.orientation}\n aria-disabled=${this.disabled ? \"true\" : nothing}\n aria-readonly=${this.readonly ? \"true\" : nothing}\n style=${this._thumbStyle(value)}\n @keydown=${isLow ? this._onLowKeydown : this._onHighKeydown}\n ></span>\n `;\n }\n\n /**\n * Finds the first two child `<input type=\"range\">` elements and wires them.\n * Inputs remain in the DOM permanently as form/progressive-enhancement\n * reflectors.\n */\n private _findInputs(): void {\n const $inputs = getDirectChildren<HTMLInputElement>(\n this,\n ':scope > input[type=\"range\"]',\n ).slice(0, 2);\n\n if ($inputs.length < 2) {\n if (import.meta.env.DEV && $inputs.length > 0) {\n warnMissingDirectChild(this, {\n selector: ':scope > input[type=\"range\"]',\n minimum: 2,\n message: '[rc-range-slider] Requires two child <input type=\"range\"> elements.',\n });\n }\n return;\n }\n\n const [$lo, $hi] = $inputs as [HTMLInputElement, HTMLInputElement];\n\n if (!this.hasAttribute(\"disabled\") && ($lo.disabled || $hi.disabled)) {\n this.disabled = true;\n }\n\n this._$lowInput = $lo;\n this._$highInput = $hi;\n this._applyInitialValueToInputs($lo, $hi);\n\n this._wireInput($lo, this._onLowInput, this._onLowChange);\n this._wireInput($hi, this._onHighInput, this._onHighChange);\n this._syncInputReflectors();\n }\n\n private _onDefaultSlotChange = (): void => {\n this._rangeInputController.sync();\n this._resetInputs();\n };\n\n private _resetInputs(): void {\n this._unwireInputs();\n this._restoreInputs();\n this._findInputs();\n this.requestUpdate();\n }\n\n private get _nativeInputValue(): [number, number] {\n const low = this._$lowInput?.valueAsNumber;\n const high = this._$highInput?.valueAsNumber;\n\n return [\n low === undefined || isNaN(low) ? this.min : low,\n high === undefined || isNaN(high) ? this.max : high,\n ];\n }\n\n private _applyInitialValueToInputs(\n $lowInput: HTMLInputElement,\n $highInput: HTMLInputElement,\n ): void {\n if (this._value !== undefined) {\n this._applyValueToInputs(this._value);\n return;\n }\n\n if (this._defaultValue !== undefined) {\n this._applyValueToInputs(this._defaultValue);\n return;\n }\n\n const lowValue = $lowInput.valueAsNumber;\n const highValue = $highInput.valueAsNumber;\n\n this._lowValue = isNaN(lowValue) ? this._min() : lowValue;\n this._highValue = isNaN(highValue) ? this._max() : highValue;\n this._defaultValue = this._normalizeValue([this._lowValue, this._highValue]);\n this._applyValueToInputs(this._defaultValue);\n }\n\n private _applyValueToInputs(value: [number, number]): void {\n const [low, high] = this._normalizeValue(value);\n this._lowValue = low;\n this._highValue = high;\n\n if (this._$lowInput) this._$lowInput.value = String(low);\n if (this._$highInput) this._$highInput.value = String(high);\n }\n\n private _setCurrentValue(value: [number, number]): void {\n const [low, high] = this._normalizeValue(value);\n this._value = [low, high];\n this._valueInitialized = true;\n this._applyValueToInputs(this._value);\n this.requestUpdate(\"value\");\n }\n\n private _wireInput(\n $input: HTMLInputElement,\n onInput: (e: Event) => void,\n onChange: (e: Event) => void,\n ): void {\n $input.addEventListener(\"input\", onInput);\n $input.addEventListener(\"change\", onChange);\n }\n\n private _unwireInputs(): void {\n this._$lowInput?.removeEventListener(\"input\", this._onLowInput);\n this._$lowInput?.removeEventListener(\"change\", this._onLowChange);\n\n this._$highInput?.removeEventListener(\"input\", this._onHighInput);\n this._$highInput?.removeEventListener(\"change\", this._onHighChange);\n }\n\n private _restoreInputs(): void {\n for (const $input of [this._$lowInput, this._$highInput]) {\n $input?.removeAttribute(\"aria-hidden\");\n $input?.removeAttribute(\"tabindex\");\n $input?.removeAttribute(\"data-rc-range-slider-reflector\");\n $input?.style.removeProperty(\"display\");\n }\n }\n\n private _syncInputReflectors(): void {\n const $lo = this._$lowInput;\n const $hi = this._$highInput;\n if (!$lo || !$hi) return;\n\n for (const $input of [$lo, $hi]) {\n $input.disabled = this.disabled;\n $input.tabIndex = -1;\n $input.setAttribute(\"aria-hidden\", \"true\");\n $input.setAttribute(\"data-rc-range-slider-reflector\", \"\");\n }\n }\n\n private _syncHostRole(): void {\n if (this.hasAttribute(\"role\")) return;\n\n this.setAttribute(\"role\", \"group\");\n this._addedHostRole = true;\n }\n\n private readonly _onLowInput = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const $input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([$input.valueAsNumber, this._highValue]);\n this._dispatch(\"rc-range-slider-input\", this.value);\n };\n\n private readonly _onLowChange = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const $input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([$input.valueAsNumber, this._highValue]);\n this._dispatch(\"rc-range-slider-change\", this.value);\n };\n\n private readonly _onHighInput = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const $input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([this._lowValue, $input.valueAsNumber]);\n this._dispatch(\"rc-range-slider-input\", this.value);\n };\n\n private readonly _onHighChange = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const $input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([this._lowValue, $input.valueAsNumber]);\n this._dispatch(\"rc-range-slider-change\", this.value);\n };\n\n /** APG keyboard contract for the low thumb. */\n private readonly _onLowKeydown = (e: KeyboardEvent): void => {\n this._handleThumbKeydown(e, \"low\");\n };\n\n /** APG keyboard contract for the high thumb. */\n private readonly _onHighKeydown = (e: KeyboardEvent): void => {\n this._handleThumbKeydown(e, \"high\");\n };\n\n private _handleThumbKeydown(e: KeyboardEvent, thumb: RangeThumb): void {\n if (this.disabled || this.readonly) return;\n\n const min = this._min();\n const max = this._max();\n const step = this._step();\n const bigStep = step * 10;\n const low = this._lowValue;\n const high = this._highValue;\n const current = thumb === \"low\" ? low : high;\n const effectiveMin = thumb === \"low\" ? min : low;\n const effectiveMax = thumb === \"low\" ? high : max;\n\n let next: number | null = null;\n\n switch (e.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n next = current + step;\n break;\n case \"ArrowLeft\":\n case \"ArrowDown\":\n next = current - step;\n break;\n case \"PageUp\":\n next = current + bigStep;\n break;\n case \"PageDown\":\n next = current - bigStep;\n break;\n case \"Home\":\n next = effectiveMin;\n break;\n case \"End\":\n next = effectiveMax;\n break;\n default:\n return;\n }\n\n e.preventDefault();\n\n const nextValue = snapToStep(next, effectiveMin, effectiveMax, step);\n if (nextValue === current) return;\n\n this._setThumbValue(thumb, nextValue);\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerDown(e: PointerEvent): void {\n if (this.disabled || this.readonly || e.button !== 0) return;\n\n const thumb = this._nearestThumb(e);\n const $thumbEl = this._$thumbElement(thumb);\n this._dragThumb = thumb;\n this._dragPointerId = e.pointerId;\n\n e.preventDefault();\n try {\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n } catch {\n // Synthetic browser-test PointerEvents are not active pointer streams.\n }\n $thumbEl?.focus();\n this._setThumbValue(thumb, this._valueFromPointer(e, thumb));\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerMove(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId || this._dragThumb === null) return;\n\n e.preventDefault();\n this._setThumbValue(this._dragThumb, this._valueFromPointer(e, this._dragThumb));\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerUp(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId || this._dragThumb === null) return;\n\n const thumb = this._dragThumb;\n this._dragThumb = null;\n this._dragPointerId = null;\n try {\n (e.currentTarget as HTMLElement).releasePointerCapture(e.pointerId);\n } catch {\n // Synthetic browser-test PointerEvents are not active pointer streams.\n }\n this._dispatch(\"rc-range-slider-change\", this.value);\n this._$thumbElement(thumb)?.focus();\n }\n\n private _onGroupPointerCancel(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId) return;\n\n this._dragThumb = null;\n this._dragPointerId = null;\n }\n\n private _setThumbValue(thumb: RangeThumb, value: number): void {\n if (thumb === \"low\") {\n this._setCurrentValue([value, this._highValue]);\n return;\n }\n\n this._setCurrentValue([this._lowValue, value]);\n }\n\n private _valueFromPointer(e: PointerEvent, thumb: RangeThumb): number {\n const rect = this._groupRect();\n if (!rect) return thumb === \"low\" ? this._lowValue : this._highValue;\n\n const min = thumb === \"low\" ? this._min() : this._lowValue;\n const max = thumb === \"low\" ? this._highValue : this._max();\n const span = this._max() - this._min();\n if (span <= 0) return min;\n\n const pct =\n this.orientation === \"vertical\"\n ? 1 - (e.clientY - rect.top) / rect.height\n : (e.clientX - rect.left) / rect.width;\n const raw = pct * span + this._min();\n\n return snapToStep(raw, min, max, this._step());\n }\n\n private _nearestThumb(e: PointerEvent): RangeThumb {\n const value = this._valueFromPointer(e, \"low\");\n const lowDistance = Math.abs(value - this._lowValue);\n const highDistance = Math.abs(value - this._highValue);\n\n if (lowDistance === highDistance) {\n return value < this._lowValue ? \"low\" : \"high\";\n }\n\n return lowDistance < highDistance ? \"low\" : \"high\";\n }\n\n private _rangeStyle(): string {\n const loPct = valueToPercent(this._lowValue, this._min(), this._max());\n const hiPct = valueToPercent(this._highValue, this._min(), this._max());\n const loCenter = this._thumbCenterStyle(loPct);\n const hiCenter = this._thumbCenterStyle(hiPct);\n\n if (this.orientation === \"vertical\") {\n return [\n `bottom:${loCenter}`,\n `height:max(0px, calc(${hiCenter} - ${loCenter}))`,\n ].join(\";\");\n }\n\n return [\n `left:${loCenter}`,\n `width:max(0px, calc(${hiCenter} - ${loCenter}))`,\n ].join(\";\");\n }\n\n private _thumbStyle(value: number): string {\n const pct = valueToPercent(value, this._min(), this._max());\n const center = this._thumbCenterStyle(pct);\n\n if (this.orientation === \"vertical\") {\n return `bottom:${center}`;\n }\n\n return `left:${center};top:50%`;\n }\n\n private _thumbCenterStyle(pct: number): string {\n const k = (1 - pct * 2).toFixed(4);\n\n return `calc(${(pct * 100).toFixed(3)}% + ${k} * var(--rc-thumb-radius, 9px))`;\n }\n\n private _floatStyle(value: number): string {\n const pct = valueToPercent(value, this._min(), this._max());\n const center = this._thumbCenterStyle(pct);\n\n if (this.orientation === \"vertical\") {\n return `bottom:${center}`;\n }\n\n return `left:${center}`;\n }\n\n private _normalizeValue([low, high]: [number, number]): [number, number] {\n const min = this._min();\n const max = this._max();\n const steppedLow = snapToStep(low, min, max, this._step());\n const steppedHigh = snapToStep(high, min, max, this._step());\n\n return [Math.min(steppedLow, steppedHigh), Math.max(steppedLow, steppedHigh)];\n }\n\n private _min(): number {\n return parseAttr(this._$lowInput?.min ?? \"\", this.min);\n }\n\n private _max(): number {\n return parseAttr(this._$highInput?.max ?? \"\", this.max);\n }\n\n private _step(): number {\n return parseAttr(this._$lowInput?.step ?? \"\", this.step);\n }\n\n private _groupRect(): DOMRect | null {\n return this.shadowRoot\n ?.querySelector<HTMLElement>(\".rc-range-slider-group\")\n ?.getBoundingClientRect() ?? null;\n }\n\n private _$thumbElement(thumb: RangeThumb): HTMLElement | null {\n return (\n this.shadowRoot?.querySelector<HTMLElement>(`[data-thumb=\"${thumb}\"]`) ??\n null\n );\n }\n\n private _thumbLabel(thumb: RangeThumb): string | null {\n const $input = thumb === \"low\" ? this._$lowInput : this._$highInput;\n const fallback = thumb === \"low\" ? this.lowLabel : this.highLabel;\n const explicitLabel = $input?.getAttribute(\"aria-label\");\n if (explicitLabel) return explicitLabel;\n\n const nativeLabel = $input?.labels?.[0]?.textContent?.trim();\n if (nativeLabel) return nativeLabel;\n\n return fallback || null;\n }\n\n private _dispatch(\n type: \"rc-range-slider-input\" | \"rc-range-slider-change\",\n value: [number, number],\n ): void {\n this.dispatchEvent(\n new CustomEvent<RCRangeSliderValueEvent>(type, {\n bubbles: true,\n composed: true,\n detail: { value },\n }),\n );\n }\n}\n\nexport default RCRangeSlider;\n"],"names":["displayConverter","v","parseAttr","s","defaultVal","n","_RCRangeSlider","LitElement","NativeChildController","e","$input","old","$lo","$hi","nothing","lowText","highText","valuesContainer","html","thumb","isLow","value","valueText","label","labelledBy","$inputs","getDirectChildren","low","high","$lowInput","$highInput","lowValue","highValue","onInput","onChange","min","max","step","bigStep","current","effectiveMin","effectiveMax","next","nextValue","snapToStep","$thumbEl","rect","span","raw","lowDistance","highDistance","loPct","valueToPercent","hiPct","loCenter","hiCenter","pct","center","k","steppedLow","steppedHigh","fallback","explicitLabel","nativeLabel","type","css","RCRangeSlider","__decorateClass","property","state"],"mappings":";;;;;;;;AAmCA,MAAMA,IAA4D;AAAA,EAChE,cAAcC,GAAgC;AAC5C,WAAIA,MAAM,OAAa,OACnBA,MAAM,MAAMA,MAAM,UAAgB,UAClCA,MAAM,iBAAuB,iBAC7BA,MAAM,eAAqB,eACxB;AAAA,EACT;AAAA,EACA,YAAYA,GAAgC;AAC1C,WAAOA;AAAA,EACT;AACF;AAOA,SAASC,EAAUC,GAAWC,GAA4B;AACxD,MAAID,MAAM,GAAI,QAAOC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AM,SAAS,SAAS,IAAM;AAAA,GAnQ/BF,EAmQiC,WAAA,YAAA,CAAA;AAGNC,EAAA;AAAA,EAArCC,EAAS,EAAE,WAAW,YAAA,CAAa;AAAA,GAtQzBF,EAsQ2B,WAAA,YAAA,CAAA;AAGCC,EAAA;AAAA,EAAtCC,EAAS,EAAE,WAAW,aAAA,CAAc;AAAA,GAzQ1BF,EAyQ4B,WAAA,aAAA,CAAA;AAGIC,EAAA;AAAA,EAA1CC,EAAS,EAAE,WAAW,iBAAA,CAAkB;AAAA,GA5Q9BF,EA4QgC,WAAA,gBAAA,CAAA;AAGCC,EAAA;AAAA,EAA3CC,EAAS,EAAE,WAAW,kBAAA,CAAmB;AAAA,GA/Q/BF,EA+QiC,WAAA,iBAAA,CAAA;AAW5CC,EAAA;AAAA,EADCC,EAAS,EAAE,SAAS,IAAM,WAAWpE,GAAkB;AAAA,GAzR7CkE,EA0RX,WAAA,WAAA,CAAA;AAG6BC,EAAA;AAAA,EAA5BC,EAAS,EAAE,SAAS,GAAA,CAAM;AAAA,GA7RhBF,EA6RkB,WAAA,eAAA,CAAA;AAGZC,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAhSIH,EAgSM,WAAA,aAAA,CAAA;AACAC,EAAA;AAAA,EAAhBE,EAAA;AAAM,GAjSIH,EAiSM,WAAA,cAAA,CAAA;"}
|
package/dist/rc-range-slider.js
CHANGED
|
@@ -35,14 +35,44 @@ type DisplayValue = "float" | "inline-start" | "inline-end" | null;
|
|
|
35
35
|
* @fires rc-range-slider-input - Fires while either thumb moves. Detail: `{ value }`.
|
|
36
36
|
* @fires rc-range-slider-change - Fires when a thumb commits a new value. Detail: `{ value }`.
|
|
37
37
|
*
|
|
38
|
+
* @attr min - Minimum slider value.
|
|
39
|
+
* @attr max - Maximum slider value.
|
|
40
|
+
* @attr step - Slider step.
|
|
41
|
+
* @attr disabled - Disables both thumbs and their hidden native input reflectors.
|
|
42
|
+
* @attr readonly - Prevents edits while preserving normal focus and display.
|
|
43
|
+
* @attr low-label - Accessible label for the low (min) thumb when the input does not provide one.
|
|
44
|
+
* @attr high-label - Accessible label for the high (max) thumb when the input does not provide
|
|
45
|
+
* one.
|
|
46
|
+
* @attr low-value-text - Formatted screen-reader text for the low value. Falls back to the raw
|
|
47
|
+
* number.
|
|
48
|
+
* @attr high-value-text - Formatted screen-reader text for the high value. Falls back to the raw
|
|
49
|
+
* number.
|
|
50
|
+
* @attr display - Controls the live value display: absent (none), `float`, `inline-start`, or
|
|
51
|
+
* `inline-end`.
|
|
52
|
+
* @attr orientation - Orientation, forwarded to the custom thumbs: `horizontal` or `vertical`.
|
|
53
|
+
*
|
|
38
54
|
* @cssprop [--rc-range-slider-accent=Highlight] - Accent color for selected range, thumb border, focus, hover, and active states.
|
|
39
55
|
* @cssprop [--rc-range-slider-gap=var(--rc-control-gap)] - Gap between track and inline value display.
|
|
40
56
|
* @cssprop [--rc-range-slider-control-size=var(--rc-control-block-size)] - Track hit-area block size.
|
|
57
|
+
* @cssprop [--rc-range-slider-vertical-size=12.5rem] - Track length when `orientation="vertical"`.
|
|
58
|
+
* @cssprop [--rc-range-slider-track-size=0.1875rem] - Visual track thickness.
|
|
41
59
|
* @cssprop [--rc-range-slider-track-background=color-mix(in srgb, CanvasText 25%, Canvas)] - Unselected track color.
|
|
42
60
|
* @cssprop [--rc-range-slider-track-radius=var(--rc-control-radius)] - Track border radius.
|
|
61
|
+
* @cssprop [--rc-range-slider-range-background] - Filled selected-range color. Defaults to
|
|
62
|
+
* `--rc-range-slider-accent` (`GrayText` when `disabled`).
|
|
43
63
|
* @cssprop [--rc-range-slider-thumb-background=ButtonFace] - Thumb background color.
|
|
44
64
|
* @cssprop [--rc-range-slider-thumb-border=var(--rc-range-slider-accent)] - Thumb border color.
|
|
45
65
|
* @cssprop [--rc-range-slider-thumb-size=1.125rem] - Visual thumb inline/block size.
|
|
66
|
+
* @cssprop [--rc-range-slider-thumb-hover-background] - Thumb background on hover. Defaults to
|
|
67
|
+
* `--rc-range-slider-accent` (`ButtonFace` when `disabled`).
|
|
68
|
+
* @cssprop [--rc-range-slider-thumb-hover-border] - Thumb border color on hover. Defaults to
|
|
69
|
+
* `--rc-range-slider-accent` (`GrayText` when `disabled`).
|
|
70
|
+
* @cssprop [--rc-range-slider-thumb-active-background] - Thumb background while pressed. Defaults
|
|
71
|
+
* to `--rc-range-slider-accent` (`ButtonFace` when `disabled`).
|
|
72
|
+
* @cssprop [--rc-range-slider-thumb-active-border] - Thumb border color while pressed. Defaults to
|
|
73
|
+
* `--rc-range-slider-accent` (`GrayText` when `disabled`).
|
|
74
|
+
* @cssprop [--rc-range-slider-focus-outline] - Thumb focus ring color. Defaults to
|
|
75
|
+
* `--rc-range-slider-accent` (`GrayText` when `disabled`).
|
|
46
76
|
* @cssprop [--rc-range-slider-value-color=var(--rc-text-disabled)] - Value display text color.
|
|
47
77
|
* @cssprop [--rc-thumb-radius=9px] - Half the thumb width; used to align float value displays and range fill.
|
|
48
78
|
* @cssprop [--rc-range-slider-float-value-block-offset=-1.4em] - Block-axis offset for horizontal float value displays.
|
|
@@ -101,8 +131,8 @@ export declare class RCRangeSlider extends LitElement {
|
|
|
101
131
|
orientation: "horizontal" | "vertical";
|
|
102
132
|
private _lowValue;
|
|
103
133
|
private _highValue;
|
|
104
|
-
private
|
|
105
|
-
private
|
|
134
|
+
private _$lowInput;
|
|
135
|
+
private _$highInput;
|
|
106
136
|
private _dragThumb;
|
|
107
137
|
private _dragPointerId;
|
|
108
138
|
private _addedHostRole;
|
|
@@ -154,7 +184,7 @@ export declare class RCRangeSlider extends LitElement {
|
|
|
154
184
|
private _max;
|
|
155
185
|
private _step;
|
|
156
186
|
private _groupRect;
|
|
157
|
-
private
|
|
187
|
+
private _$thumbElement;
|
|
158
188
|
private _thumbLabel;
|
|
159
189
|
private _dispatch;
|
|
160
190
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.4.1",
|
|
7
7
|
"description": "Two-thumb range slider backed by native range inputs for min/max values.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"vitest-browser-lit": "^1.0.1"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@rcarls/rc-common": "
|
|
60
|
+
"@rcarls/rc-common": "0.4.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"lit": "^3.0.0"
|
|
64
64
|
}
|
|
65
|
-
}
|
|
65
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rc-range-slider-ZmdGXQZw.js","sources":["../src/rc-range-slider.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport type { ComplexAttributeConverter } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport {\n NativeChildController,\n getDirectChildren,\n snapToStep,\n valueToPercent,\n warnMissingDirectChild,\n} from \"@rcarls/rc-common\";\n\nexport interface RCRangeSliderValueEvent {\n /** Current [low, high] value tuple. */\n value: [number, number];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"rc-range-slider\": RCRangeSlider;\n }\n\n interface HTMLElementEventMap {\n \"rc-range-slider-input\": CustomEvent<RCRangeSliderValueEvent>;\n \"rc-range-slider-change\": CustomEvent<RCRangeSliderValueEvent>;\n }\n}\n\ntype DisplayValue = \"float\" | \"inline-start\" | \"inline-end\" | null;\ntype RangeThumb = \"low\" | \"high\";\n\n/**\n * Normalises the `display` attribute.\n * A bare boolean attribute (`display` with no value) maps to `'float'` so\n * the reflected attribute is always an explicit string, never an empty string.\n */\nconst displayConverter: ComplexAttributeConverter<DisplayValue> = {\n fromAttribute(v: string | null): DisplayValue {\n if (v === null) return null;\n if (v === \"\" || v === \"float\") return \"float\";\n if (v === \"inline-start\") return \"inline-start\";\n if (v === \"inline-end\") return \"inline-end\";\n return null;\n },\n toAttribute(v: DisplayValue): string | null {\n return v;\n },\n};\n\n/**\n * Returns the numeric value of a range input's `min`, `max`, or `step`\n * attribute string, falling back to `defaultVal` when the attribute is absent\n * (empty string) or not a valid number.\n */\nfunction parseAttr(s: string, defaultVal: number): number {\n if (s === \"\") return defaultVal;\n\n const n = parseFloat(s);\n\n return isNaN(n) ? defaultVal : n;\n}\n\n/**\n * Two-thumb range slider backed by native range inputs for min/max values, following the\n * WAI-ARIA Multi-Thumb Slider pattern.\n *\n * Consumers provide two direct child `<input type=\"range\">` elements. Before\n * upgrade, those inputs are the usable progressive-enhancement fallback. After\n * upgrade, the inputs remain in light DOM as hidden form reflectors while the\n * shadow thumbs become the focusable, accessible interaction surface.\n *\n * Form participation is handled natively by each input's `name` attribute.\n *\n * @see {@link https://richardcarls.github.io/rc-webcomponents/components/rc-range-slider rc-range-slider docs}\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/ WAI-ARIA Multi-Thumb Slider pattern}\n *\n * @slot - Consumer-provided native range inputs.\n * @slot track-background - Optional decorative content rendered inside the track before the selected range fill.\n * @slot low-value-display - Optional replacement for the low value text.\n * @slot high-value-display - Optional replacement for the high value text.\n *\n * @fires rc-range-slider-input - Fires while either thumb moves. Detail: `{ value }`.\n * @fires rc-range-slider-change - Fires when a thumb commits a new value. Detail: `{ value }`.\n *\n * @cssprop [--rc-range-slider-accent=Highlight] - Accent color for selected range, thumb border, focus, hover, and active states.\n * @cssprop [--rc-range-slider-gap=var(--rc-control-gap)] - Gap between track and inline value display.\n * @cssprop [--rc-range-slider-control-size=var(--rc-control-block-size)] - Track hit-area block size.\n * @cssprop [--rc-range-slider-track-background=color-mix(in srgb, CanvasText 25%, Canvas)] - Unselected track color.\n * @cssprop [--rc-range-slider-track-radius=var(--rc-control-radius)] - Track border radius.\n * @cssprop [--rc-range-slider-thumb-background=ButtonFace] - Thumb background color.\n * @cssprop [--rc-range-slider-thumb-border=var(--rc-range-slider-accent)] - Thumb border color.\n * @cssprop [--rc-range-slider-thumb-size=1.125rem] - Visual thumb inline/block size.\n * @cssprop [--rc-range-slider-value-color=var(--rc-text-disabled)] - Value display text color.\n * @cssprop [--rc-thumb-radius=9px] - Half the thumb width; used to align float value displays and range fill.\n * @cssprop [--rc-range-slider-float-value-block-offset=-1.4em] - Block-axis offset for horizontal float value displays.\n * @cssprop [--rc-range-slider-float-value-inline-offset=calc(100% + 0.5rem)] - Inline-axis offset for vertical float value displays.\n *\n * @csspart root - Root layout wrapper.\n * @csspart group - Slider group wrapper.\n * @csspart track - Visual slider track.\n * @csspart range - Filled selected range segment.\n * @csspart thumb - Shared custom slider thumb.\n * @csspart low-thumb - Low-value custom slider thumb.\n * @csspart high-thumb - High-value custom slider thumb.\n * @csspart value-display - Shared rendered value text.\n * @csspart low-value-display - Rendered low value text.\n * @csspart high-value-display - Rendered high value text.\n */\nexport class RCRangeSlider extends LitElement {\n static override styles = css`\n :host {\n --rc-range-slider-accent: var(--rc-accent, Highlight);\n --rc-range-slider-track-background: color-mix(in srgb, CanvasText 25%, Canvas);\n --rc-range-slider-range-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-background: ButtonFace;\n --rc-range-slider-thumb-border: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-hover-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-hover-border: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-active-background: var(--rc-range-slider-accent);\n --rc-range-slider-thumb-active-border: var(--rc-range-slider-accent);\n --rc-range-slider-focus-outline: var(--rc-range-slider-accent);\n display: block;\n font-family: var(--rc-font-family, inherit);\n font-size: var(--rc-font-size, inherit);\n line-height: var(--rc-line-height, normal);\n }\n\n :host([disabled]) {\n --rc-range-slider-accent: GrayText;\n --rc-range-slider-track-background: color-mix(in srgb, GrayText 35%, Canvas);\n --rc-range-slider-range-background: GrayText;\n --rc-range-slider-thumb-border: GrayText;\n --rc-range-slider-thumb-hover-background: ButtonFace;\n --rc-range-slider-thumb-hover-border: GrayText;\n --rc-range-slider-thumb-active-background: ButtonFace;\n --rc-range-slider-thumb-active-border: GrayText;\n --rc-range-slider-focus-outline: GrayText;\n }\n\n .rc-range-slider-root {\n display: grid;\n gap: var(--rc-range-slider-gap, var(--rc-control-gap, 0.5rem));\n align-items: center;\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] {\n grid-template-columns: auto minmax(0, 1fr);\n }\n\n .rc-range-slider-root[data-display=\"inline-end\"] {\n grid-template-columns: minmax(0, 1fr) auto;\n }\n\n .rc-range-slider-group {\n position: relative;\n display: block;\n min-width: 0;\n min-height: var(--rc-range-slider-control-size, var(--rc-control-block-size, 1.5rem));\n touch-action: none;\n }\n\n .rc-range-slider-track,\n .rc-range-slider-range {\n position: absolute;\n pointer-events: none;\n }\n\n .rc-range-slider-track {\n inset-inline: 0;\n inset-block: calc(50% - var(--rc-range-slider-track-size, 0.1875rem) / 2);\n block-size: var(--rc-range-slider-track-size, 0.1875rem);\n background: var(--rc-range-slider-track-background);\n border-radius: var(--rc-range-slider-track-radius, var(--rc-control-radius, 0));\n overflow: hidden;\n z-index: 0;\n }\n\n ::slotted([slot=\"track-background\"]) {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .rc-range-slider-range {\n inset-block: 0;\n background: var(--rc-range-slider-range-background);\n border-radius: inherit;\n z-index: 1;\n }\n\n .rc-range-slider-thumb {\n position: absolute;\n z-index: 2;\n inline-size: var(--rc-range-slider-thumb-size, 1.125rem);\n block-size: var(--rc-range-slider-thumb-size, 1.125rem);\n background: var(--rc-range-slider-thumb-background);\n border: 2px solid var(--rc-range-slider-thumb-border);\n border-radius: 50%;\n box-sizing: border-box;\n cursor: grab;\n transform: translate(-50%, -50%);\n transition:\n background-color 120ms ease,\n border-color 120ms ease,\n box-shadow 120ms ease,\n transform var(--rc-motion-duration, 120ms) ease;\n }\n\n .rc-range-slider-thumb:focus-visible {\n outline: var(--rc-focus-ring, 2px solid var(--rc-range-slider-focus-outline));\n outline-offset: var(--rc-focus-ring-offset, 2px);\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-thumb:hover {\n background: var(--rc-range-slider-thumb-hover-background);\n border-color: var(--rc-range-slider-thumb-hover-border);\n box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--rc-range-slider-accent) 20%, transparent);\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-thumb:active {\n background: var(--rc-range-slider-thumb-active-background);\n border-color: var(--rc-range-slider-thumb-active-border);\n box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--rc-range-slider-accent) 28%, transparent);\n cursor: grabbing;\n }\n\n :host(:not([disabled]):not([readonly])) .rc-range-slider-group:hover .rc-range-slider-track {\n background: color-mix(in srgb, var(--rc-range-slider-track-background) 70%, CanvasText);\n }\n\n .rc-range-slider-thumb[aria-disabled=\"true\"],\n .rc-range-slider-thumb[aria-readonly=\"true\"] {\n cursor: default;\n }\n\n :host([disabled]) .rc-range-slider-root {\n opacity: 0.65;\n }\n\n ::slotted(input[type=\"range\"]) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: 0;\n padding: 0;\n border: 0;\n clip-path: inset(50%);\n opacity: 0;\n overflow: hidden;\n pointer-events: none;\n }\n\n .rc-range-slider-values {\n pointer-events: none;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n color: var(--rc-range-slider-value-color, var(--rc-text-disabled, GrayText));\n }\n\n .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-values {\n position: absolute;\n inset: 0;\n z-index: 5;\n }\n\n .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-value {\n position: absolute;\n inset-block-start: var(--rc-range-slider-float-value-block-offset, -1.4em);\n transform: translateX(-50%);\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] .rc-range-slider-values,\n .rc-range-slider-root[data-display=\"inline-end\"] .rc-range-slider-values {\n display: flex;\n gap: 0.25em;\n align-items: center;\n }\n\n .rc-range-slider-root[data-display=\"inline-start\"] .rc-range-slider-value:first-child::after,\n .rc-range-slider-root[data-display=\"inline-end\"] .rc-range-slider-value:first-child::after {\n content: \" -\";\n }\n\n :host([orientation=\"vertical\"]) {\n display: inline-block;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-group {\n inline-size: var(--rc-range-slider-control-size, var(--rc-control-block-size, 1.5rem));\n block-size: var(--rc-range-slider-vertical-size, 12.5rem);\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-track {\n inset-block: 0;\n inset-inline: calc(50% - var(--rc-range-slider-track-size, 0.1875rem) / 2);\n inline-size: var(--rc-range-slider-track-size, 0.1875rem);\n block-size: auto;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-range {\n inset-inline: 0;\n inset-block-start: auto;\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-thumb {\n inset-inline-start: 50%;\n transform: translate(-50%, 50%);\n }\n\n :host([orientation=\"vertical\"]) .rc-range-slider-root[data-display=\"float\"] .rc-range-slider-value {\n inset-block-start: auto;\n inset-inline-start: var(--rc-range-slider-float-value-inline-offset, calc(100% + 0.5rem));\n transform: translateY(50%);\n }\n `;\n\n /** Minimum slider value. */\n @property({ type: Number }) min = 0;\n\n /** Maximum slider value. */\n @property({ type: Number }) max = 100;\n\n /** Slider step. */\n @property({ type: Number }) step = 1;\n\n private _value: [number, number] | undefined;\n private _defaultValue: [number, number] | undefined;\n private _valueInitialized = false;\n\n /** Current [low, high] value. Assign a new tuple reference to trigger a re-render. */\n @property({ attribute: false })\n get value(): [number, number] {\n return this._value ?? this._defaultValue ?? this._nativeInputValue;\n }\n set value(v: [number, number]) {\n const old = this._value;\n this._value = this._normalizeValue(v);\n this._valueInitialized = true;\n this._applyValueToInputs(this._value);\n if (this._value !== old) {\n this.requestUpdate(\"value\", old);\n }\n }\n\n /** Initial uncontrolled [low, high] value. Has no effect after the first user interaction or `value` write. */\n @property({ attribute: false })\n get defaultValue(): [number, number] | undefined {\n return this._defaultValue;\n }\n set defaultValue(v: [number, number] | undefined) {\n const old = this._defaultValue;\n this._defaultValue = v === undefined ? undefined : this._normalizeValue(v);\n if (\n !this._valueInitialized &&\n this._value === undefined &&\n this._defaultValue !== undefined\n ) {\n this._applyValueToInputs(this._defaultValue);\n this.requestUpdate(\"value\", undefined);\n }\n this.requestUpdate(\"defaultValue\", old);\n }\n\n /** Disable both thumbs and their hidden native input reflectors. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Prevents edits while preserving normal focus and display. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Accessible label for the low (min) thumb when the input does not provide one. */\n @property({ attribute: \"low-label\" }) lowLabel = \"Minimum\";\n\n /** Accessible label for the high (max) thumb when the input does not provide one. */\n @property({ attribute: \"high-label\" }) highLabel = \"Maximum\";\n\n /** Formatted screen-reader text for the low value. Falls back to the raw number. */\n @property({ attribute: \"low-value-text\" }) lowValueText = \"\";\n\n /** Formatted screen-reader text for the high value. Falls back to the raw number. */\n @property({ attribute: \"high-value-text\" }) highValueText = \"\";\n\n /**\n * Controls the live value display.\n *\n * - Absent (default) — no value shown.\n * - `display` or `display=\"float\"` — floats each value above its thumb.\n * - `display=\"inline-start\"` — renders the value container before the track.\n * - `display=\"inline-end\"` — renders the value container after the track.\n */\n @property({ reflect: true, converter: displayConverter })\n display: DisplayValue = null;\n\n /** Orientation; reflected as an attribute and forwarded to custom thumbs. */\n @property({ reflect: true }) orientation: \"horizontal\" | \"vertical\" =\n \"horizontal\";\n\n @state() private _lowValue = 0;\n @state() private _highValue = 100;\n\n private _lowInput: HTMLInputElement | null = null;\n private _highInput: HTMLInputElement | null = null;\n private _dragThumb: RangeThumb | null = null;\n private _dragPointerId: number | null = null;\n private _addedHostRole = false;\n private readonly _rangeInputController = new NativeChildController<HTMLInputElement>(this, {\n selector: ':scope > input[type=\"range\"]',\n observe: true,\n onChange: () => this._resetInputs(),\n onMissing: () => {\n if (import.meta.env.DEV) {\n warnMissingDirectChild(this, {\n selector: ':scope > input[type=\"range\"]',\n message: '[rc-range-slider] Requires two child <input type=\"range\"> elements.',\n });\n }\n },\n });\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._syncHostRole();\n }\n\n override disconnectedCallback(): void {\n this._unwireInputs();\n this._restoreInputs();\n if (this._addedHostRole) {\n this.removeAttribute(\"role\");\n this._addedHostRole = false;\n }\n super.disconnectedCallback();\n }\n\n override updated(): void {\n this._syncInputReflectors();\n }\n\n override render() {\n const lo = this._lowInput;\n const hi = this._highInput;\n if (!lo || !hi) return nothing;\n\n const lowText = this.lowValueText || String(this._lowValue);\n const highText = this.highValueText || String(this._highValue);\n\n const valuesContainer = html`\n <span class=\"rc-range-slider-values\" aria-hidden=\"true\">\n <span\n part=\"value-display low-value-display\"\n class=\"rc-range-slider-value\"\n style=${this.display === \"float\"\n ? this._floatStyle(this._lowValue)\n : nothing}\n ><slot name=\"low-value-display\">${lowText}</slot></span\n >\n <span\n part=\"value-display high-value-display\"\n class=\"rc-range-slider-value\"\n style=${this.display === \"float\"\n ? this._floatStyle(this._highValue)\n : nothing}\n ><slot name=\"high-value-display\">${highText}</slot></span\n >\n </span>\n `;\n\n return html`\n <div\n part=\"root\"\n class=\"rc-range-slider-root\"\n data-display=${this.display ?? nothing}\n data-orientation=${this.orientation}\n >\n ${this.display === \"inline-start\" ? valuesContainer : nothing}\n\n <div\n part=\"group\"\n class=\"rc-range-slider-group\"\n @pointerdown=${this._onGroupPointerDown}\n @pointermove=${this._onGroupPointerMove}\n @pointerup=${this._onGroupPointerUp}\n @pointercancel=${this._onGroupPointerCancel}\n >\n <span part=\"track\" class=\"rc-range-slider-track\" aria-hidden=\"true\">\n <slot name=\"track-background\"></slot>\n <span\n part=\"range\"\n class=\"rc-range-slider-range\"\n style=${this._rangeStyle()}\n ></span>\n </span>\n\n ${this._renderThumb(\"low\")} ${this._renderThumb(\"high\")}\n <slot @slotchange=${this._onDefaultSlotChange}></slot>\n ${this.display === \"float\" ? valuesContainer : nothing}\n </div>\n\n ${this.display === \"inline-end\" ? valuesContainer : nothing}\n </div>\n `;\n }\n\n private _renderThumb(thumb: RangeThumb) {\n const isLow = thumb === \"low\";\n const input = isLow ? this._lowInput : this._highInput;\n const value = isLow ? this._lowValue : this._highValue;\n const valueText = isLow ? this.lowValueText : this.highValueText;\n const label = this._thumbLabel(thumb);\n const labelledBy = input?.getAttribute(\"aria-labelledby\");\n\n return html`\n <span\n part=${isLow ? \"thumb low-thumb\" : \"thumb high-thumb\"}\n class=\"rc-range-slider-thumb\"\n data-thumb=${thumb}\n role=\"slider\"\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n aria-label=${label ?? nothing}\n aria-labelledby=${labelledBy ?? nothing}\n aria-valuemin=${String(isLow ? this._min() : this._lowValue)}\n aria-valuemax=${String(isLow ? this._highValue : this._max())}\n aria-valuenow=${String(value)}\n aria-valuetext=${valueText || nothing}\n aria-orientation=${this.orientation}\n aria-disabled=${this.disabled ? \"true\" : nothing}\n aria-readonly=${this.readonly ? \"true\" : nothing}\n style=${this._thumbStyle(value)}\n @keydown=${isLow ? this._onLowKeydown : this._onHighKeydown}\n ></span>\n `;\n }\n\n /**\n * Finds the first two child `<input type=\"range\">` elements and wires them.\n * Inputs remain in the DOM permanently as form/progressive-enhancement\n * reflectors.\n */\n private _findInputs(): void {\n const inputs = getDirectChildren<HTMLInputElement>(\n this,\n ':scope > input[type=\"range\"]',\n ).slice(0, 2);\n\n if (inputs.length < 2) {\n if (import.meta.env.DEV && inputs.length > 0) {\n warnMissingDirectChild(this, {\n selector: ':scope > input[type=\"range\"]',\n minimum: 2,\n message: '[rc-range-slider] Requires two child <input type=\"range\"> elements.',\n });\n }\n return;\n }\n\n const [lo, hi] = inputs as [HTMLInputElement, HTMLInputElement];\n\n if (!this.hasAttribute(\"disabled\") && (lo.disabled || hi.disabled)) {\n this.disabled = true;\n }\n\n this._lowInput = lo;\n this._highInput = hi;\n this._applyInitialValueToInputs(lo, hi);\n\n this._wireInput(lo, this._onLowInput, this._onLowChange);\n this._wireInput(hi, this._onHighInput, this._onHighChange);\n this._syncInputReflectors();\n }\n\n private _onDefaultSlotChange = (): void => {\n this._rangeInputController.sync();\n this._resetInputs();\n };\n\n private _resetInputs(): void {\n this._unwireInputs();\n this._restoreInputs();\n this._findInputs();\n this.requestUpdate();\n }\n\n private get _nativeInputValue(): [number, number] {\n const low = this._lowInput?.valueAsNumber;\n const high = this._highInput?.valueAsNumber;\n\n return [\n low === undefined || isNaN(low) ? this.min : low,\n high === undefined || isNaN(high) ? this.max : high,\n ];\n }\n\n private _applyInitialValueToInputs(\n lowInput: HTMLInputElement,\n highInput: HTMLInputElement,\n ): void {\n if (this._value !== undefined) {\n this._applyValueToInputs(this._value);\n return;\n }\n\n if (this._defaultValue !== undefined) {\n this._applyValueToInputs(this._defaultValue);\n return;\n }\n\n const lowValue = lowInput.valueAsNumber;\n const highValue = highInput.valueAsNumber;\n\n this._lowValue = isNaN(lowValue) ? this._min() : lowValue;\n this._highValue = isNaN(highValue) ? this._max() : highValue;\n this._defaultValue = this._normalizeValue([this._lowValue, this._highValue]);\n this._applyValueToInputs(this._defaultValue);\n }\n\n private _applyValueToInputs(value: [number, number]): void {\n const [low, high] = this._normalizeValue(value);\n this._lowValue = low;\n this._highValue = high;\n\n if (this._lowInput) this._lowInput.value = String(low);\n if (this._highInput) this._highInput.value = String(high);\n }\n\n private _setCurrentValue(value: [number, number]): void {\n const [low, high] = this._normalizeValue(value);\n this._value = [low, high];\n this._valueInitialized = true;\n this._applyValueToInputs(this._value);\n this.requestUpdate(\"value\");\n }\n\n private _wireInput(\n input: HTMLInputElement,\n onInput: (e: Event) => void,\n onChange: (e: Event) => void,\n ): void {\n input.addEventListener(\"input\", onInput);\n input.addEventListener(\"change\", onChange);\n }\n\n private _unwireInputs(): void {\n this._lowInput?.removeEventListener(\"input\", this._onLowInput);\n this._lowInput?.removeEventListener(\"change\", this._onLowChange);\n\n this._highInput?.removeEventListener(\"input\", this._onHighInput);\n this._highInput?.removeEventListener(\"change\", this._onHighChange);\n }\n\n private _restoreInputs(): void {\n for (const input of [this._lowInput, this._highInput]) {\n input?.removeAttribute(\"aria-hidden\");\n input?.removeAttribute(\"tabindex\");\n input?.removeAttribute(\"data-rc-range-slider-reflector\");\n input?.style.removeProperty(\"display\");\n }\n }\n\n private _syncInputReflectors(): void {\n const lo = this._lowInput;\n const hi = this._highInput;\n if (!lo || !hi) return;\n\n for (const input of [lo, hi]) {\n input.disabled = this.disabled;\n input.tabIndex = -1;\n input.setAttribute(\"aria-hidden\", \"true\");\n input.setAttribute(\"data-rc-range-slider-reflector\", \"\");\n }\n }\n\n private _syncHostRole(): void {\n if (this.hasAttribute(\"role\")) return;\n\n this.setAttribute(\"role\", \"group\");\n this._addedHostRole = true;\n }\n\n private readonly _onLowInput = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([input.valueAsNumber, this._highValue]);\n this._dispatch(\"rc-range-slider-input\", this.value);\n };\n\n private readonly _onLowChange = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([input.valueAsNumber, this._highValue]);\n this._dispatch(\"rc-range-slider-change\", this.value);\n };\n\n private readonly _onHighInput = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([this._lowValue, input.valueAsNumber]);\n this._dispatch(\"rc-range-slider-input\", this.value);\n };\n\n private readonly _onHighChange = (e: Event): void => {\n if (this.readonly) {\n this._applyValueToInputs([this._lowValue, this._highValue]);\n return;\n }\n\n const input = e.currentTarget as HTMLInputElement;\n this._setCurrentValue([this._lowValue, input.valueAsNumber]);\n this._dispatch(\"rc-range-slider-change\", this.value);\n };\n\n /** APG keyboard contract for the low thumb. */\n private readonly _onLowKeydown = (e: KeyboardEvent): void => {\n this._handleThumbKeydown(e, \"low\");\n };\n\n /** APG keyboard contract for the high thumb. */\n private readonly _onHighKeydown = (e: KeyboardEvent): void => {\n this._handleThumbKeydown(e, \"high\");\n };\n\n private _handleThumbKeydown(e: KeyboardEvent, thumb: RangeThumb): void {\n if (this.disabled || this.readonly) return;\n\n const min = this._min();\n const max = this._max();\n const step = this._step();\n const bigStep = step * 10;\n const low = this._lowValue;\n const high = this._highValue;\n const current = thumb === \"low\" ? low : high;\n const effectiveMin = thumb === \"low\" ? min : low;\n const effectiveMax = thumb === \"low\" ? high : max;\n\n let next: number | null = null;\n\n switch (e.key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n next = current + step;\n break;\n case \"ArrowLeft\":\n case \"ArrowDown\":\n next = current - step;\n break;\n case \"PageUp\":\n next = current + bigStep;\n break;\n case \"PageDown\":\n next = current - bigStep;\n break;\n case \"Home\":\n next = effectiveMin;\n break;\n case \"End\":\n next = effectiveMax;\n break;\n default:\n return;\n }\n\n e.preventDefault();\n\n const nextValue = snapToStep(next, effectiveMin, effectiveMax, step);\n if (nextValue === current) return;\n\n this._setThumbValue(thumb, nextValue);\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerDown(e: PointerEvent): void {\n if (this.disabled || this.readonly || e.button !== 0) return;\n\n const thumb = this._nearestThumb(e);\n const thumbEl = this._thumbElement(thumb);\n this._dragThumb = thumb;\n this._dragPointerId = e.pointerId;\n\n e.preventDefault();\n try {\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n } catch {\n // Synthetic browser-test PointerEvents are not active pointer streams.\n }\n thumbEl?.focus();\n this._setThumbValue(thumb, this._valueFromPointer(e, thumb));\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerMove(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId || this._dragThumb === null) return;\n\n e.preventDefault();\n this._setThumbValue(this._dragThumb, this._valueFromPointer(e, this._dragThumb));\n this._dispatch(\"rc-range-slider-input\", this.value);\n }\n\n private _onGroupPointerUp(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId || this._dragThumb === null) return;\n\n const thumb = this._dragThumb;\n this._dragThumb = null;\n this._dragPointerId = null;\n try {\n (e.currentTarget as HTMLElement).releasePointerCapture(e.pointerId);\n } catch {\n // Synthetic browser-test PointerEvents are not active pointer streams.\n }\n this._dispatch(\"rc-range-slider-change\", this.value);\n this._thumbElement(thumb)?.focus();\n }\n\n private _onGroupPointerCancel(e: PointerEvent): void {\n if (this._dragPointerId !== e.pointerId) return;\n\n this._dragThumb = null;\n this._dragPointerId = null;\n }\n\n private _setThumbValue(thumb: RangeThumb, value: number): void {\n if (thumb === \"low\") {\n this._setCurrentValue([value, this._highValue]);\n return;\n }\n\n this._setCurrentValue([this._lowValue, value]);\n }\n\n private _valueFromPointer(e: PointerEvent, thumb: RangeThumb): number {\n const rect = this._groupRect();\n if (!rect) return thumb === \"low\" ? this._lowValue : this._highValue;\n\n const min = thumb === \"low\" ? this._min() : this._lowValue;\n const max = thumb === \"low\" ? this._highValue : this._max();\n const span = this._max() - this._min();\n if (span <= 0) return min;\n\n const pct =\n this.orientation === \"vertical\"\n ? 1 - (e.clientY - rect.top) / rect.height\n : (e.clientX - rect.left) / rect.width;\n const raw = pct * span + this._min();\n\n return snapToStep(raw, min, max, this._step());\n }\n\n private _nearestThumb(e: PointerEvent): RangeThumb {\n const value = this._valueFromPointer(e, \"low\");\n const lowDistance = Math.abs(value - this._lowValue);\n const highDistance = Math.abs(value - this._highValue);\n\n if (lowDistance === highDistance) {\n return value < this._lowValue ? \"low\" : \"high\";\n }\n\n return lowDistance < highDistance ? \"low\" : \"high\";\n }\n\n private _rangeStyle(): string {\n const loPct = valueToPercent(this._lowValue, this._min(), this._max());\n const hiPct = valueToPercent(this._highValue, this._min(), this._max());\n const loCenter = this._thumbCenterStyle(loPct);\n const hiCenter = this._thumbCenterStyle(hiPct);\n\n if (this.orientation === \"vertical\") {\n return [\n `bottom:${loCenter}`,\n `height:max(0px, calc(${hiCenter} - ${loCenter}))`,\n ].join(\";\");\n }\n\n return [\n `left:${loCenter}`,\n `width:max(0px, calc(${hiCenter} - ${loCenter}))`,\n ].join(\";\");\n }\n\n private _thumbStyle(value: number): string {\n const pct = valueToPercent(value, this._min(), this._max());\n const center = this._thumbCenterStyle(pct);\n\n if (this.orientation === \"vertical\") {\n return `bottom:${center}`;\n }\n\n return `left:${center};top:50%`;\n }\n\n private _thumbCenterStyle(pct: number): string {\n const k = (1 - pct * 2).toFixed(4);\n\n return `calc(${(pct * 100).toFixed(3)}% + ${k} * var(--rc-thumb-radius, 9px))`;\n }\n\n private _floatStyle(value: number): string {\n const pct = valueToPercent(value, this._min(), this._max());\n const center = this._thumbCenterStyle(pct);\n\n if (this.orientation === \"vertical\") {\n return `bottom:${center}`;\n }\n\n return `left:${center}`;\n }\n\n private _normalizeValue([low, high]: [number, number]): [number, number] {\n const min = this._min();\n const max = this._max();\n const steppedLow = snapToStep(low, min, max, this._step());\n const steppedHigh = snapToStep(high, min, max, this._step());\n\n return [Math.min(steppedLow, steppedHigh), Math.max(steppedLow, steppedHigh)];\n }\n\n private _min(): number {\n return parseAttr(this._lowInput?.min ?? \"\", this.min);\n }\n\n private _max(): number {\n return parseAttr(this._highInput?.max ?? \"\", this.max);\n }\n\n private _step(): number {\n return parseAttr(this._lowInput?.step ?? \"\", this.step);\n }\n\n private _groupRect(): DOMRect | null {\n return this.shadowRoot\n ?.querySelector<HTMLElement>(\".rc-range-slider-group\")\n ?.getBoundingClientRect() ?? null;\n }\n\n private _thumbElement(thumb: RangeThumb): HTMLElement | null {\n return (\n this.shadowRoot?.querySelector<HTMLElement>(`[data-thumb=\"${thumb}\"]`) ??\n null\n );\n }\n\n private _thumbLabel(thumb: RangeThumb): string | null {\n const input = thumb === \"low\" ? this._lowInput : this._highInput;\n const fallback = thumb === \"low\" ? this.lowLabel : this.highLabel;\n const explicitLabel = input?.getAttribute(\"aria-label\");\n if (explicitLabel) return explicitLabel;\n\n const nativeLabel = input?.labels?.[0]?.textContent?.trim();\n if (nativeLabel) return nativeLabel;\n\n return fallback || null;\n }\n\n private _dispatch(\n type: \"rc-range-slider-input\" | \"rc-range-slider-change\",\n value: [number, number],\n ): void {\n this.dispatchEvent(\n new CustomEvent<RCRangeSliderValueEvent>(type, {\n bubbles: true,\n composed: true,\n detail: { value },\n }),\n );\n }\n}\n\nexport default RCRangeSlider;\n"],"names":["displayConverter","v","parseAttr","s","defaultVal","n","_RCRangeSlider","LitElement","NativeChildController","e","input","old","lo","hi","nothing","lowText","highText","valuesContainer","html","thumb","isLow","value","valueText","label","labelledBy","inputs","getDirectChildren","low","high","lowInput","highInput","lowValue","highValue","onInput","onChange","min","max","step","bigStep","current","effectiveMin","effectiveMax","next","nextValue","snapToStep","thumbEl","rect","span","raw","lowDistance","highDistance","loPct","valueToPercent","hiPct","loCenter","hiCenter","pct","center","k","steppedLow","steppedHigh","fallback","explicitLabel","nativeLabel","type","css","RCRangeSlider","__decorateClass","property","state"],"mappings":";;;;;;;;AAmCA,MAAMA,IAA4D;AAAA,EAChE,cAAcC,GAAgC;AAC5C,WAAIA,MAAM,OAAa,OACnBA,MAAM,MAAMA,MAAM,UAAgB,UAClCA,MAAM,iBAAuB,iBAC7BA,MAAM,eAAqB,eACxB;AAAA,EACT;AAAA,EACA,YAAYA,GAAgC;AAC1C,WAAOA;AAAA,EACT;AACF;AAOA,SAASC,EAAUC,GAAWC,GAA4B;AACxD,MAAID,MAAM,GAAI,QAAOC;AAErB,QAAMC,IAAI,WAAWF,CAAC;AAEtB,SAAO,MAAME,CAAC,IAAID,IAAaC;AACjC;AAgDO,MAAMC,IAAN,MAAMA,UAAsBC,EAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA,GAiNuB,KAAA,MAAM,GAGN,KAAA,MAAM,KAGN,KAAA,OAAO,GAInC,KAAQ,oBAAoB,IAqCgB,KAAA,WAA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