@vonage/vivid 4.2.0 → 4.3.0
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/appearance-ui/index.cjs +1 -2
- package/appearance-ui/index.js +1 -2
- package/custom-elements.json +43 -0
- package/lib/button/button.d.ts +1 -0
- package/lib/switch/switch.d.ts +1 -1
- package/package.json +1 -1
- package/shared/affix.cjs +1 -2
- package/shared/affix.js +1 -2
- package/shared/anchored.cjs +1 -2
- package/shared/anchored.js +1 -2
- package/shared/calendar-event.cjs +1 -2
- package/shared/calendar-event.js +1 -2
- package/shared/definition.cjs +1 -2
- package/shared/definition.js +1 -2
- package/shared/definition11.cjs +29 -13
- package/shared/definition11.js +29 -14
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition13.cjs +1 -2
- package/shared/definition13.js +1 -2
- package/shared/definition14.cjs +1 -2
- package/shared/definition14.js +1 -2
- package/shared/definition15.cjs +1 -2
- package/shared/definition15.js +1 -2
- package/shared/definition16.cjs +1 -2
- package/shared/definition16.js +1 -2
- package/shared/definition17.cjs +4 -8
- package/shared/definition17.js +4 -8
- package/shared/definition18.cjs +14 -22
- package/shared/definition18.js +14 -22
- package/shared/definition19.cjs +29 -50
- package/shared/definition19.js +29 -50
- package/shared/definition20.cjs +1 -2
- package/shared/definition20.js +1 -2
- package/shared/definition21.cjs +1 -2
- package/shared/definition21.js +1 -2
- package/shared/definition23.cjs +1 -2
- package/shared/definition23.js +1 -2
- package/shared/definition24.cjs +2 -3
- package/shared/definition24.js +2 -3
- package/shared/definition25.cjs +22 -47
- package/shared/definition25.js +22 -47
- package/shared/definition26.cjs +1 -2
- package/shared/definition26.js +1 -2
- package/shared/definition28.cjs +1 -2
- package/shared/definition28.js +1 -2
- package/shared/definition29.cjs +19 -39
- package/shared/definition29.js +19 -39
- package/shared/definition3.cjs +1 -2
- package/shared/definition3.js +1 -2
- package/shared/definition31.cjs +1 -2
- package/shared/definition31.js +1 -2
- package/shared/definition34.cjs +1 -2
- package/shared/definition34.js +1 -2
- package/shared/definition35.cjs +14 -26
- package/shared/definition35.js +14 -26
- package/shared/definition36.cjs +1 -2
- package/shared/definition36.js +1 -2
- package/shared/definition37.cjs +8 -16
- package/shared/definition37.js +8 -16
- package/shared/definition38.cjs +1 -2
- package/shared/definition38.js +1 -2
- package/shared/definition39.cjs +1 -2
- package/shared/definition39.js +1 -2
- package/shared/definition4.cjs +7 -13
- package/shared/definition4.js +7 -13
- package/shared/definition40.cjs +1 -2
- package/shared/definition40.js +1 -2
- package/shared/definition42.cjs +52 -91
- package/shared/definition42.js +52 -91
- package/shared/definition43.cjs +7 -6
- package/shared/definition43.js +5 -4
- package/shared/definition44.cjs +4 -8
- package/shared/definition44.js +4 -8
- package/shared/definition45.cjs +1 -2
- package/shared/definition45.js +1 -2
- package/shared/definition46.cjs +1 -2
- package/shared/definition46.js +1 -2
- package/shared/definition47.cjs +1 -2
- package/shared/definition47.js +1 -2
- package/shared/definition48.cjs +2 -3
- package/shared/definition48.js +2 -3
- package/shared/definition5.cjs +1 -2
- package/shared/definition5.js +1 -2
- package/shared/definition50.cjs +1 -2
- package/shared/definition50.js +1 -2
- package/shared/definition51.cjs +5 -10
- package/shared/definition51.js +5 -10
- package/shared/definition52.cjs +1 -2
- package/shared/definition52.js +1 -2
- package/shared/definition53.cjs +1 -2
- package/shared/definition53.js +1 -2
- package/shared/definition54.cjs +9 -21
- package/shared/definition54.js +9 -21
- package/shared/definition55.cjs +24 -43
- package/shared/definition55.js +24 -43
- package/shared/definition56.cjs +23 -38
- package/shared/definition56.js +23 -38
- package/shared/definition57.cjs +22 -45
- package/shared/definition57.js +22 -45
- package/shared/definition58.cjs +18 -37
- package/shared/definition58.js +18 -37
- package/shared/definition59.cjs +1 -2
- package/shared/definition59.js +1 -2
- package/shared/definition6.cjs +1 -2
- package/shared/definition6.js +1 -2
- package/shared/definition62.cjs +1 -2
- package/shared/definition62.js +1 -2
- package/shared/definition63.cjs +1 -2
- package/shared/definition63.js +1 -2
- package/shared/definition7.cjs +1 -2
- package/shared/definition7.js +1 -2
- package/shared/definition8.cjs +1 -2
- package/shared/definition8.js +1 -2
- package/shared/definition9.cjs +1 -2
- package/shared/definition9.js +1 -2
- package/shared/icon.cjs +2 -3
- package/shared/icon.js +2 -3
- package/shared/index2.cjs +3 -6
- package/shared/index2.js +3 -6
- package/shared/listbox.cjs +1 -2
- package/shared/listbox.js +1 -2
- package/shared/patterns/chevron.d.ts +2 -0
- package/shared/presentationDate.cjs +1 -2
- package/shared/presentationDate.js +1 -2
- package/shared/radio.cjs +1 -2
- package/shared/radio.js +1 -2
- package/shared/text-anchor.cjs +1 -2
- package/shared/text-anchor.js +1 -2
- package/shared/video-player.cjs +4 -8
- package/shared/video-player.js +4 -8
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +3021 -1112
package/shared/definition42.cjs
CHANGED
|
@@ -45,38 +45,23 @@ const inverseLerp = (a, b, value) => slider_template.limit(0, 1, (value - a) / (
|
|
|
45
45
|
|
|
46
46
|
var __defProp = Object.defineProperty;
|
|
47
47
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
48
|
+
var __typeError = (msg) => {
|
|
49
|
+
throw TypeError(msg);
|
|
50
|
+
};
|
|
48
51
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
49
52
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
50
53
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
51
54
|
if (decorator = decorators[i])
|
|
52
55
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
53
|
-
if (kind && result)
|
|
54
|
-
__defProp(target, key, result);
|
|
56
|
+
if (kind && result) __defProp(target, key, result);
|
|
55
57
|
return result;
|
|
56
58
|
};
|
|
57
|
-
var __accessCheck = (obj, member, msg) =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
64
|
-
};
|
|
65
|
-
var __privateAdd = (obj, member, value) => {
|
|
66
|
-
if (member.has(obj))
|
|
67
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
68
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
69
|
-
};
|
|
70
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
71
|
-
__accessCheck(obj, member, "write to private field");
|
|
72
|
-
member.set(obj, value);
|
|
73
|
-
return value;
|
|
74
|
-
};
|
|
75
|
-
var __privateMethod = (obj, member, method) => {
|
|
76
|
-
__accessCheck(obj, member, "access private method");
|
|
77
|
-
return method;
|
|
78
|
-
};
|
|
79
|
-
var _isInternalValueUpdate, _updateValues, updateValues_fn, _applyStep, applyStep_fn, _updateFormValue, updateFormValue_fn, _thumbs, thumbs_get, _thumbConstraints, thumbConstraints_get, _draggingThumb, _updateThumbPositions, updateThumbPositions_fn, _thumbTrackEndOffset, thumbTrackEndOffset_fn, _calculateValueFromMouseEvent, calculateValueFromMouseEvent_fn, _roundToNearestStep, roundToNearestStep_fn, _registerThumbListeners, registerThumbListeners_fn, _unregisterThumbListeners, unregisterThumbListeners_fn, _onThumbMousedown, _onThumbKeydown, _registerDragHandlers, registerDragHandlers_fn, _unregisterDragListeners, unregisterDragListeners_fn, _onDragMove, _onDragEnd;
|
|
59
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
62
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
63
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
64
|
+
var _isInternalValueUpdate, _RangeSlider_instances, updateValues_fn, applyStep_fn, updateFormValue_fn, thumbs_get, thumbConstraints_get, _draggingThumb, updateThumbPositions_fn, thumbTrackEndOffset_fn, calculateValueFromMouseEvent_fn, roundToNearestStep_fn, registerThumbListeners_fn, unregisterThumbListeners_fn, _onThumbMousedown, _onThumbKeydown, registerDragHandlers_fn, unregisterDragListeners_fn, _onDragMove, _onDragEnd;
|
|
80
65
|
const Direction = {
|
|
81
66
|
Increment: 1,
|
|
82
67
|
Decrement: -1
|
|
@@ -84,20 +69,7 @@ const Direction = {
|
|
|
84
69
|
let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
85
70
|
constructor() {
|
|
86
71
|
super(...arguments);
|
|
87
|
-
__privateAdd(this,
|
|
88
|
-
__privateAdd(this, _applyStep);
|
|
89
|
-
__privateAdd(this, _updateFormValue);
|
|
90
|
-
__privateAdd(this, _thumbs);
|
|
91
|
-
__privateAdd(this, _thumbConstraints);
|
|
92
|
-
__privateAdd(this, _updateThumbPositions);
|
|
93
|
-
__privateAdd(this, _thumbTrackEndOffset);
|
|
94
|
-
__privateAdd(this, _calculateValueFromMouseEvent);
|
|
95
|
-
__privateAdd(this, _roundToNearestStep);
|
|
96
|
-
// --- Event handling ---
|
|
97
|
-
__privateAdd(this, _registerThumbListeners);
|
|
98
|
-
__privateAdd(this, _unregisterThumbListeners);
|
|
99
|
-
__privateAdd(this, _registerDragHandlers);
|
|
100
|
-
__privateAdd(this, _unregisterDragListeners);
|
|
72
|
+
__privateAdd(this, _RangeSlider_instances);
|
|
101
73
|
// --- Start & end values ---
|
|
102
74
|
__privateAdd(this, _isInternalValueUpdate, false);
|
|
103
75
|
this.start = "";
|
|
@@ -137,27 +109,27 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
137
109
|
}
|
|
138
110
|
target.focus();
|
|
139
111
|
__privateSet(this, _draggingThumb, target === this._startThumbEl ? "start" : "end");
|
|
140
|
-
__privateMethod(this,
|
|
112
|
+
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
141
113
|
});
|
|
142
114
|
__privateAdd(this, _onThumbKeydown, (e) => {
|
|
143
115
|
const thumb = e.target === this._startThumbEl ? "start" : "end";
|
|
144
116
|
if (e.key === keyCodes.keyHome) {
|
|
145
117
|
e.preventDefault();
|
|
146
|
-
__privateMethod(this,
|
|
118
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
|
|
147
119
|
} else if (e.key === keyCodes.keyEnd) {
|
|
148
120
|
e.preventDefault();
|
|
149
|
-
__privateMethod(this,
|
|
121
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
|
|
150
122
|
} else if (!e.shiftKey) {
|
|
151
123
|
switch (e.key) {
|
|
152
124
|
case keyCodes.keyArrowRight:
|
|
153
125
|
case keyCodes.keyArrowDown:
|
|
154
126
|
e.preventDefault();
|
|
155
|
-
__privateMethod(this,
|
|
127
|
+
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
|
|
156
128
|
break;
|
|
157
129
|
case keyCodes.keyArrowLeft:
|
|
158
130
|
case keyCodes.keyArrowUp:
|
|
159
131
|
e.preventDefault();
|
|
160
|
-
__privateMethod(this,
|
|
132
|
+
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
|
|
161
133
|
break;
|
|
162
134
|
}
|
|
163
135
|
}
|
|
@@ -167,14 +139,14 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
167
139
|
return;
|
|
168
140
|
}
|
|
169
141
|
const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
|
|
170
|
-
const value = __privateMethod(this,
|
|
171
|
-
__privateMethod(this,
|
|
172
|
-
[__privateGet(this, _draggingThumb)]: `${__privateMethod(this,
|
|
142
|
+
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, sourceEvent);
|
|
143
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
144
|
+
[__privateGet(this, _draggingThumb)]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, __privateGet(this, _draggingThumb), value)}`
|
|
173
145
|
});
|
|
174
146
|
});
|
|
175
147
|
__privateAdd(this, _onDragEnd, () => {
|
|
176
148
|
__privateSet(this, _draggingThumb, false);
|
|
177
|
-
__privateMethod(this,
|
|
149
|
+
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
178
150
|
});
|
|
179
151
|
}
|
|
180
152
|
/**
|
|
@@ -184,10 +156,10 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
184
156
|
this.currentStart = this.start;
|
|
185
157
|
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
186
158
|
this.dirtyValue = true;
|
|
187
|
-
__privateMethod(this,
|
|
159
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
188
160
|
}
|
|
189
161
|
if (this.$fastController.isConnected) {
|
|
190
|
-
__privateMethod(this,
|
|
162
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
191
163
|
}
|
|
192
164
|
}
|
|
193
165
|
/**
|
|
@@ -223,10 +195,10 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
223
195
|
this.currentEnd = this.end;
|
|
224
196
|
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
225
197
|
this.dirtyValue = true;
|
|
226
|
-
__privateMethod(this,
|
|
198
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
227
199
|
}
|
|
228
200
|
if (this.$fastController.isConnected) {
|
|
229
|
-
__privateMethod(this,
|
|
201
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
230
202
|
}
|
|
231
203
|
}
|
|
232
204
|
/**
|
|
@@ -260,7 +232,7 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
260
232
|
*/
|
|
261
233
|
orientationChanged() {
|
|
262
234
|
if (this.$fastController.isConnected) {
|
|
263
|
-
__privateMethod(this,
|
|
235
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
264
236
|
}
|
|
265
237
|
}
|
|
266
238
|
// --- Form handling ---
|
|
@@ -269,10 +241,10 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
269
241
|
*/
|
|
270
242
|
nameChanged(previous, next) {
|
|
271
243
|
super.nameChanged(previous, next);
|
|
272
|
-
__privateMethod(this,
|
|
244
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
273
245
|
}
|
|
274
246
|
formResetCallback() {
|
|
275
|
-
__privateMethod(this,
|
|
247
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
276
248
|
start: this.initialStart ?? this.min.toString(),
|
|
277
249
|
end: this.initialEnd ?? this.max.toString()
|
|
278
250
|
});
|
|
@@ -281,17 +253,17 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
281
253
|
// --- Lifecycle ---
|
|
282
254
|
connectedCallback() {
|
|
283
255
|
super.connectedCallback();
|
|
284
|
-
__privateMethod(this,
|
|
256
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
285
257
|
start: this.start || this.initialStart || this.min.toString(),
|
|
286
258
|
end: this.end || this.initialEnd || this.max.toString()
|
|
287
259
|
}, false);
|
|
288
|
-
__privateMethod(this,
|
|
289
|
-
__privateMethod(this,
|
|
260
|
+
__privateMethod(this, _RangeSlider_instances, registerThumbListeners_fn).call(this);
|
|
261
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
290
262
|
}
|
|
291
263
|
disconnectedCallback() {
|
|
292
264
|
super.disconnectedCallback();
|
|
293
|
-
__privateMethod(this,
|
|
294
|
-
__privateMethod(this,
|
|
265
|
+
__privateMethod(this, _RangeSlider_instances, unregisterThumbListeners_fn).call(this);
|
|
266
|
+
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
295
267
|
}
|
|
296
268
|
/**
|
|
297
269
|
* @internal
|
|
@@ -300,20 +272,20 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
300
272
|
if (this.disabled || __privateGet(this, _draggingThumb)) {
|
|
301
273
|
return;
|
|
302
274
|
}
|
|
303
|
-
const value = __privateMethod(this,
|
|
275
|
+
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
|
|
304
276
|
const startDistance = Math.abs(value - Number(this.start));
|
|
305
277
|
const endDistance = Math.abs(value - Number(this.end));
|
|
306
278
|
const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
|
|
307
|
-
__privateMethod(this,
|
|
308
|
-
[thumb]: `${__privateMethod(this,
|
|
279
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
280
|
+
[thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
|
|
309
281
|
});
|
|
310
282
|
__privateSet(this, _draggingThumb, thumb);
|
|
311
|
-
__privateGet(this,
|
|
312
|
-
__privateMethod(this,
|
|
283
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].focus();
|
|
284
|
+
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
313
285
|
}
|
|
314
286
|
};
|
|
315
287
|
_isInternalValueUpdate = new WeakMap();
|
|
316
|
-
|
|
288
|
+
_RangeSlider_instances = new WeakSet();
|
|
317
289
|
updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
318
290
|
if (start === this.start) {
|
|
319
291
|
start = void 0;
|
|
@@ -343,15 +315,13 @@ updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
|
343
315
|
this.$emit("change");
|
|
344
316
|
this.dirtyValue = true;
|
|
345
317
|
}
|
|
346
|
-
__privateMethod(this,
|
|
318
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
347
319
|
};
|
|
348
|
-
_applyStep = new WeakSet();
|
|
349
320
|
applyStep_fn = function(thumb, direction) {
|
|
350
|
-
__privateMethod(this,
|
|
351
|
-
[thumb]: __privateMethod(this,
|
|
321
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
322
|
+
[thumb]: __privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, Number(this[thumb]) + direction * this.step).toString()
|
|
352
323
|
});
|
|
353
324
|
};
|
|
354
|
-
_updateFormValue = new WeakSet();
|
|
355
325
|
updateFormValue_fn = function() {
|
|
356
326
|
if (!this.name) {
|
|
357
327
|
this.setFormValue(null);
|
|
@@ -362,14 +332,12 @@ updateFormValue_fn = function() {
|
|
|
362
332
|
this.setFormValue(formData);
|
|
363
333
|
}
|
|
364
334
|
};
|
|
365
|
-
_thumbs = new WeakSet();
|
|
366
335
|
thumbs_get = function() {
|
|
367
336
|
return {
|
|
368
337
|
start: this._startThumbEl,
|
|
369
338
|
end: this._endThumbEl
|
|
370
339
|
};
|
|
371
340
|
};
|
|
372
|
-
_thumbConstraints = new WeakSet();
|
|
373
341
|
thumbConstraints_get = function() {
|
|
374
342
|
return {
|
|
375
343
|
start: { min: this.min, max: this.endAsNumber },
|
|
@@ -377,21 +345,18 @@ thumbConstraints_get = function() {
|
|
|
377
345
|
};
|
|
378
346
|
};
|
|
379
347
|
_draggingThumb = new WeakMap();
|
|
380
|
-
_updateThumbPositions = new WeakSet();
|
|
381
348
|
updateThumbPositions_fn = function() {
|
|
382
|
-
const startOffsetPct = __privateMethod(this,
|
|
383
|
-
const endOffsetPct = __privateMethod(this,
|
|
349
|
+
const startOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.startAsNumber);
|
|
350
|
+
const endOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.endAsNumber);
|
|
384
351
|
const [dirProp, dimProp] = this.orientation === aria.Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
|
|
385
352
|
const transition = `transition: ${__privateGet(this, _draggingThumb) ? "none" : "all 0.2s ease"};`;
|
|
386
353
|
this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
|
|
387
354
|
this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
|
|
388
355
|
this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
|
|
389
356
|
};
|
|
390
|
-
_thumbTrackEndOffset = new WeakSet();
|
|
391
357
|
thumbTrackEndOffset_fn = function(value) {
|
|
392
358
|
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
393
359
|
};
|
|
394
|
-
_calculateValueFromMouseEvent = new WeakSet();
|
|
395
360
|
calculateValueFromMouseEvent_fn = function(e) {
|
|
396
361
|
const trackClientRect = this._trackEl.getBoundingClientRect();
|
|
397
362
|
const [minPos, maxPos, valuePos] = this.orientation === aria.Orientation.horizontal ? [
|
|
@@ -405,39 +370,37 @@ calculateValueFromMouseEvent_fn = function(e) {
|
|
|
405
370
|
];
|
|
406
371
|
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
407
372
|
};
|
|
408
|
-
_roundToNearestStep = new WeakSet();
|
|
409
373
|
roundToNearestStep_fn = function(thumb, value) {
|
|
410
374
|
return slider_template.limit(
|
|
411
|
-
__privateGet(this,
|
|
412
|
-
__privateGet(this,
|
|
375
|
+
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min,
|
|
376
|
+
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max,
|
|
413
377
|
roundToStepValue(value - this.min, this.step) + this.min
|
|
414
378
|
);
|
|
415
379
|
};
|
|
416
|
-
|
|
380
|
+
// --- Event handling ---
|
|
417
381
|
registerThumbListeners_fn = function() {
|
|
418
382
|
for (const thumb of ["start", "end"]) {
|
|
419
|
-
__privateGet(this,
|
|
420
|
-
__privateGet(this,
|
|
383
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
384
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
421
385
|
"mousedown",
|
|
422
386
|
__privateGet(this, _onThumbMousedown),
|
|
423
387
|
{ passive: true }
|
|
424
388
|
);
|
|
425
|
-
__privateGet(this,
|
|
389
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
426
390
|
"touchstart",
|
|
427
391
|
__privateGet(this, _onThumbMousedown),
|
|
428
392
|
{ passive: true }
|
|
429
393
|
);
|
|
430
394
|
}
|
|
431
395
|
};
|
|
432
|
-
_unregisterThumbListeners = new WeakSet();
|
|
433
396
|
unregisterThumbListeners_fn = function() {
|
|
434
397
|
for (const thumb of ["start", "end"]) {
|
|
435
|
-
__privateGet(this,
|
|
436
|
-
__privateGet(this,
|
|
398
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
399
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
437
400
|
"mousedown",
|
|
438
401
|
__privateGet(this, _onThumbMousedown)
|
|
439
402
|
);
|
|
440
|
-
__privateGet(this,
|
|
403
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
441
404
|
"touchstart",
|
|
442
405
|
__privateGet(this, _onThumbMousedown)
|
|
443
406
|
);
|
|
@@ -445,7 +408,6 @@ unregisterThumbListeners_fn = function() {
|
|
|
445
408
|
};
|
|
446
409
|
_onThumbMousedown = new WeakMap();
|
|
447
410
|
_onThumbKeydown = new WeakMap();
|
|
448
|
-
_registerDragHandlers = new WeakSet();
|
|
449
411
|
registerDragHandlers_fn = function() {
|
|
450
412
|
window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
|
|
451
413
|
window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
|
|
@@ -453,7 +415,6 @@ registerDragHandlers_fn = function() {
|
|
|
453
415
|
window.addEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
454
416
|
window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
455
417
|
};
|
|
456
|
-
_unregisterDragListeners = new WeakSet();
|
|
457
418
|
unregisterDragListeners_fn = function() {
|
|
458
419
|
window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
459
420
|
window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
|