@vonage/vivid 4.2.0 → 4.4.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 +435 -41
- package/index.cjs +1 -0
- package/index.js +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +1 -0
- package/lib/empty-state/definition.d.ts +1 -0
- package/lib/empty-state/empty-state.d.ts +5 -0
- package/lib/enums.d.ts +4 -0
- package/lib/popup/popup.d.ts +5 -0
- package/lib/range-slider/range-slider.d.ts +2 -0
- package/lib/slider/slider.d.ts +5 -0
- package/lib/slider/slider.template.d.ts +2 -2
- 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 +2 -3
- package/shared/definition.js +2 -3
- 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 +68 -32
- package/shared/definition21.js +68 -32
- package/shared/definition23.cjs +19 -5
- package/shared/definition23.js +20 -6
- package/shared/definition24.cjs +2 -3
- package/shared/definition24.js +2 -3
- package/shared/definition25.cjs +23 -48
- package/shared/definition25.js +23 -48
- 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/definition30.cjs +1 -1
- package/shared/definition30.js +1 -1
- 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 +172 -106
- package/shared/definition42.js +172 -106
- 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 +96 -12
- package/shared/definition46.js +97 -13
- 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 +24 -39
- package/shared/definition56.js +24 -39
- 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 +156 -4
- package/shared/definition63.js +157 -6
- 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/enums.cjs +6 -0
- package/shared/enums.js +6 -1
- 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/anchored.d.ts +4 -4
- package/shared/patterns/chevron.d.ts +2 -0
- package/shared/presentationDate.cjs +2 -3
- package/shared/presentationDate.js +2 -3
- package/shared/radio.cjs +1 -2
- package/shared/radio.js +1 -2
- package/shared/slider.template.cjs +27 -4
- package/shared/slider.template.js +27 -4
- 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 +3228 -1108
package/shared/definition42.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition63.cjs');
|
|
4
5
|
const keyCodes = require('./key-codes2.cjs');
|
|
5
6
|
require('./affix.cjs');
|
|
6
7
|
const index$1 = require('./index2.cjs');
|
|
@@ -13,7 +14,7 @@ const ref = require('./ref.cjs');
|
|
|
13
14
|
const when = require('./when.cjs');
|
|
14
15
|
const classNames = require('./class-names.cjs');
|
|
15
16
|
|
|
16
|
-
const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline
|
|
17
|
+
const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}.control{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}:host([markers]) .control.horizontal .track-start,:host([markers]) .control.vertical .track-start{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}";
|
|
17
18
|
|
|
18
19
|
class _RangeSlider extends index.FoundationElement {
|
|
19
20
|
}
|
|
@@ -45,38 +46,23 @@ const inverseLerp = (a, b, value) => slider_template.limit(0, 1, (value - a) / (
|
|
|
45
46
|
|
|
46
47
|
var __defProp = Object.defineProperty;
|
|
47
48
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
49
|
+
var __typeError = (msg) => {
|
|
50
|
+
throw TypeError(msg);
|
|
51
|
+
};
|
|
48
52
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
49
53
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
50
54
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
51
55
|
if (decorator = decorators[i])
|
|
52
56
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
53
|
-
if (kind && result)
|
|
54
|
-
__defProp(target, key, result);
|
|
57
|
+
if (kind && result) __defProp(target, key, result);
|
|
55
58
|
return result;
|
|
56
59
|
};
|
|
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;
|
|
60
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
61
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
62
|
+
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);
|
|
63
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
64
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
65
|
+
var _isInternalValueUpdate, _RangeSlider_instances, updateValues_fn, applyStep_fn, updateFormValue_fn, thumbs_get, thumbConstraints_get, getThumbId_fn, getThumbIdFromEvent_fn, updateThumbPositions_fn, thumbTrackEndOffset_fn, calculateValueFromMouseEvent_fn, roundToNearestStep_fn, _isNonVisibleFocus, focusThumbNonVisibly_fn, registerThumbListeners_fn, unregisterThumbListeners_fn, _onThumbFocus, _onThumbBlur, _onMouseOver, _onMouseOut, _onThumbMousedown, _onThumbKeydown, registerDragHandlers_fn, unregisterDragListeners_fn, _onDragMove, _onDragEnd;
|
|
80
66
|
const Direction = {
|
|
81
67
|
Increment: 1,
|
|
82
68
|
Decrement: -1
|
|
@@ -84,20 +70,7 @@ const Direction = {
|
|
|
84
70
|
let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
85
71
|
constructor() {
|
|
86
72
|
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);
|
|
73
|
+
__privateAdd(this, _RangeSlider_instances);
|
|
101
74
|
// --- Start & end values ---
|
|
102
75
|
__privateAdd(this, _isInternalValueUpdate, false);
|
|
103
76
|
this.start = "";
|
|
@@ -109,6 +82,7 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
109
82
|
this.ariaStartLabel = null;
|
|
110
83
|
this.ariaEndLabel = null;
|
|
111
84
|
this.markers = false;
|
|
85
|
+
this.pin = false;
|
|
112
86
|
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
113
87
|
// --- Thumbs ---
|
|
114
88
|
/**
|
|
@@ -123,10 +97,27 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
123
97
|
* @internal
|
|
124
98
|
*/
|
|
125
99
|
this._endThumbEl = null;
|
|
126
|
-
|
|
100
|
+
this._draggingThumb = false;
|
|
101
|
+
this._visiblyFocusedThumb = null;
|
|
102
|
+
this._hoveredThumb = null;
|
|
127
103
|
this._startThumbCss = "";
|
|
128
104
|
this._endThumbCss = "";
|
|
129
105
|
this._selectedRangeCss = "";
|
|
106
|
+
__privateAdd(this, _isNonVisibleFocus, false);
|
|
107
|
+
__privateAdd(this, _onThumbFocus, (e) => {
|
|
108
|
+
if (!__privateGet(this, _isNonVisibleFocus)) {
|
|
109
|
+
this._visiblyFocusedThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
__privateAdd(this, _onThumbBlur, () => {
|
|
113
|
+
this._visiblyFocusedThumb = null;
|
|
114
|
+
});
|
|
115
|
+
__privateAdd(this, _onMouseOver, (e) => {
|
|
116
|
+
this._hoveredThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
117
|
+
});
|
|
118
|
+
__privateAdd(this, _onMouseOut, () => {
|
|
119
|
+
this._hoveredThumb = null;
|
|
120
|
+
});
|
|
130
121
|
__privateAdd(this, _onThumbMousedown, (event) => {
|
|
131
122
|
if (this.disabled || event.defaultPrevented) {
|
|
132
123
|
return;
|
|
@@ -135,46 +126,47 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
135
126
|
if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) {
|
|
136
127
|
target = this._startThumbEl;
|
|
137
128
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
__privateMethod(this,
|
|
129
|
+
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, target);
|
|
130
|
+
this._draggingThumb = __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, target);
|
|
131
|
+
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
141
132
|
});
|
|
142
133
|
__privateAdd(this, _onThumbKeydown, (e) => {
|
|
143
|
-
const thumb =
|
|
134
|
+
const thumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
135
|
+
this._visiblyFocusedThumb = thumb;
|
|
144
136
|
if (e.key === keyCodes.keyHome) {
|
|
145
137
|
e.preventDefault();
|
|
146
|
-
__privateMethod(this,
|
|
138
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
|
|
147
139
|
} else if (e.key === keyCodes.keyEnd) {
|
|
148
140
|
e.preventDefault();
|
|
149
|
-
__privateMethod(this,
|
|
141
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
|
|
150
142
|
} else if (!e.shiftKey) {
|
|
151
143
|
switch (e.key) {
|
|
152
144
|
case keyCodes.keyArrowRight:
|
|
153
145
|
case keyCodes.keyArrowDown:
|
|
154
146
|
e.preventDefault();
|
|
155
|
-
__privateMethod(this,
|
|
147
|
+
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
|
|
156
148
|
break;
|
|
157
149
|
case keyCodes.keyArrowLeft:
|
|
158
150
|
case keyCodes.keyArrowUp:
|
|
159
151
|
e.preventDefault();
|
|
160
|
-
__privateMethod(this,
|
|
152
|
+
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
|
|
161
153
|
break;
|
|
162
154
|
}
|
|
163
155
|
}
|
|
164
156
|
});
|
|
165
157
|
__privateAdd(this, _onDragMove, (e) => {
|
|
166
|
-
if (this.disabled || e.defaultPrevented || !
|
|
158
|
+
if (this.disabled || e.defaultPrevented || !this._draggingThumb) {
|
|
167
159
|
return;
|
|
168
160
|
}
|
|
169
161
|
const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
|
|
170
|
-
const value = __privateMethod(this,
|
|
171
|
-
__privateMethod(this,
|
|
172
|
-
[
|
|
162
|
+
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, sourceEvent);
|
|
163
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
164
|
+
[this._draggingThumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, this._draggingThumb, value)}`
|
|
173
165
|
});
|
|
174
166
|
});
|
|
175
167
|
__privateAdd(this, _onDragEnd, () => {
|
|
176
|
-
|
|
177
|
-
__privateMethod(this,
|
|
168
|
+
this._draggingThumb = false;
|
|
169
|
+
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
178
170
|
});
|
|
179
171
|
}
|
|
180
172
|
/**
|
|
@@ -184,10 +176,10 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
184
176
|
this.currentStart = this.start;
|
|
185
177
|
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
186
178
|
this.dirtyValue = true;
|
|
187
|
-
__privateMethod(this,
|
|
179
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
188
180
|
}
|
|
189
181
|
if (this.$fastController.isConnected) {
|
|
190
|
-
__privateMethod(this,
|
|
182
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
191
183
|
}
|
|
192
184
|
}
|
|
193
185
|
/**
|
|
@@ -223,10 +215,10 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
223
215
|
this.currentEnd = this.end;
|
|
224
216
|
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
225
217
|
this.dirtyValue = true;
|
|
226
|
-
__privateMethod(this,
|
|
218
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
227
219
|
}
|
|
228
220
|
if (this.$fastController.isConnected) {
|
|
229
|
-
__privateMethod(this,
|
|
221
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
230
222
|
}
|
|
231
223
|
}
|
|
232
224
|
/**
|
|
@@ -260,7 +252,7 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
260
252
|
*/
|
|
261
253
|
orientationChanged() {
|
|
262
254
|
if (this.$fastController.isConnected) {
|
|
263
|
-
__privateMethod(this,
|
|
255
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
264
256
|
}
|
|
265
257
|
}
|
|
266
258
|
// --- Form handling ---
|
|
@@ -269,51 +261,57 @@ let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
|
269
261
|
*/
|
|
270
262
|
nameChanged(previous, next) {
|
|
271
263
|
super.nameChanged(previous, next);
|
|
272
|
-
__privateMethod(this,
|
|
264
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
273
265
|
}
|
|
274
266
|
formResetCallback() {
|
|
275
|
-
__privateMethod(this,
|
|
267
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
276
268
|
start: this.initialStart ?? this.min.toString(),
|
|
277
269
|
end: this.initialEnd ?? this.max.toString()
|
|
278
270
|
});
|
|
279
271
|
super.formResetCallback();
|
|
280
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* @internal
|
|
275
|
+
*/
|
|
276
|
+
_isThumbPopupOpen(thumb) {
|
|
277
|
+
return this._visiblyFocusedThumb === thumb || this._hoveredThumb === thumb || this._draggingThumb === thumb;
|
|
278
|
+
}
|
|
281
279
|
// --- Lifecycle ---
|
|
282
280
|
connectedCallback() {
|
|
283
281
|
super.connectedCallback();
|
|
284
|
-
__privateMethod(this,
|
|
282
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
285
283
|
start: this.start || this.initialStart || this.min.toString(),
|
|
286
284
|
end: this.end || this.initialEnd || this.max.toString()
|
|
287
285
|
}, false);
|
|
288
|
-
__privateMethod(this,
|
|
289
|
-
__privateMethod(this,
|
|
286
|
+
__privateMethod(this, _RangeSlider_instances, registerThumbListeners_fn).call(this);
|
|
287
|
+
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
290
288
|
}
|
|
291
289
|
disconnectedCallback() {
|
|
292
290
|
super.disconnectedCallback();
|
|
293
|
-
__privateMethod(this,
|
|
294
|
-
__privateMethod(this,
|
|
291
|
+
__privateMethod(this, _RangeSlider_instances, unregisterThumbListeners_fn).call(this);
|
|
292
|
+
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
295
293
|
}
|
|
296
294
|
/**
|
|
297
295
|
* @internal
|
|
298
296
|
*/
|
|
299
297
|
_onMouseDown(e) {
|
|
300
|
-
if (this.disabled ||
|
|
298
|
+
if (this.disabled || this._draggingThumb) {
|
|
301
299
|
return;
|
|
302
300
|
}
|
|
303
|
-
const value = __privateMethod(this,
|
|
301
|
+
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
|
|
304
302
|
const startDistance = Math.abs(value - Number(this.start));
|
|
305
303
|
const endDistance = Math.abs(value - Number(this.end));
|
|
306
304
|
const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
|
|
307
|
-
__privateMethod(this,
|
|
308
|
-
[thumb]: `${__privateMethod(this,
|
|
305
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
306
|
+
[thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
|
|
309
307
|
});
|
|
310
|
-
|
|
311
|
-
__privateGet(this,
|
|
312
|
-
__privateMethod(this,
|
|
308
|
+
this._draggingThumb = thumb;
|
|
309
|
+
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb]);
|
|
310
|
+
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
313
311
|
}
|
|
314
312
|
};
|
|
315
313
|
_isInternalValueUpdate = new WeakMap();
|
|
316
|
-
|
|
314
|
+
_RangeSlider_instances = new WeakSet();
|
|
317
315
|
updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
318
316
|
if (start === this.start) {
|
|
319
317
|
start = void 0;
|
|
@@ -343,15 +341,13 @@ updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
|
343
341
|
this.$emit("change");
|
|
344
342
|
this.dirtyValue = true;
|
|
345
343
|
}
|
|
346
|
-
__privateMethod(this,
|
|
344
|
+
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
347
345
|
};
|
|
348
|
-
_applyStep = new WeakSet();
|
|
349
346
|
applyStep_fn = function(thumb, direction) {
|
|
350
|
-
__privateMethod(this,
|
|
351
|
-
[thumb]: __privateMethod(this,
|
|
347
|
+
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
348
|
+
[thumb]: __privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, Number(this[thumb]) + direction * this.step).toString()
|
|
352
349
|
});
|
|
353
350
|
};
|
|
354
|
-
_updateFormValue = new WeakSet();
|
|
355
351
|
updateFormValue_fn = function() {
|
|
356
352
|
if (!this.name) {
|
|
357
353
|
this.setFormValue(null);
|
|
@@ -362,36 +358,36 @@ updateFormValue_fn = function() {
|
|
|
362
358
|
this.setFormValue(formData);
|
|
363
359
|
}
|
|
364
360
|
};
|
|
365
|
-
_thumbs = new WeakSet();
|
|
366
361
|
thumbs_get = function() {
|
|
367
362
|
return {
|
|
368
363
|
start: this._startThumbEl,
|
|
369
364
|
end: this._endThumbEl
|
|
370
365
|
};
|
|
371
366
|
};
|
|
372
|
-
_thumbConstraints = new WeakSet();
|
|
373
367
|
thumbConstraints_get = function() {
|
|
374
368
|
return {
|
|
375
369
|
start: { min: this.min, max: this.endAsNumber },
|
|
376
370
|
end: { min: this.startAsNumber, max: this.max }
|
|
377
371
|
};
|
|
378
372
|
};
|
|
379
|
-
|
|
380
|
-
|
|
373
|
+
getThumbId_fn = function(thumb) {
|
|
374
|
+
return thumb === this._startThumbEl ? "start" : "end";
|
|
375
|
+
};
|
|
376
|
+
getThumbIdFromEvent_fn = function(e) {
|
|
377
|
+
return __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, e.target);
|
|
378
|
+
};
|
|
381
379
|
updateThumbPositions_fn = function() {
|
|
382
|
-
const startOffsetPct = __privateMethod(this,
|
|
383
|
-
const endOffsetPct = __privateMethod(this,
|
|
380
|
+
const startOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.startAsNumber);
|
|
381
|
+
const endOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.endAsNumber);
|
|
384
382
|
const [dirProp, dimProp] = this.orientation === aria.Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
|
|
385
|
-
const transition = `transition: ${
|
|
383
|
+
const transition = `transition: ${this._draggingThumb ? "none" : "all 0.2s ease"};`;
|
|
386
384
|
this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
|
|
387
385
|
this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
|
|
388
386
|
this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
|
|
389
387
|
};
|
|
390
|
-
_thumbTrackEndOffset = new WeakSet();
|
|
391
388
|
thumbTrackEndOffset_fn = function(value) {
|
|
392
389
|
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
393
390
|
};
|
|
394
|
-
_calculateValueFromMouseEvent = new WeakSet();
|
|
395
391
|
calculateValueFromMouseEvent_fn = function(e) {
|
|
396
392
|
const trackClientRect = this._trackEl.getBoundingClientRect();
|
|
397
393
|
const [minPos, maxPos, valuePos] = this.orientation === aria.Orientation.horizontal ? [
|
|
@@ -405,47 +401,66 @@ calculateValueFromMouseEvent_fn = function(e) {
|
|
|
405
401
|
];
|
|
406
402
|
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
407
403
|
};
|
|
408
|
-
_roundToNearestStep = new WeakSet();
|
|
409
404
|
roundToNearestStep_fn = function(thumb, value) {
|
|
410
405
|
return slider_template.limit(
|
|
411
|
-
__privateGet(this,
|
|
412
|
-
__privateGet(this,
|
|
406
|
+
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min,
|
|
407
|
+
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max,
|
|
413
408
|
roundToStepValue(value - this.min, this.step) + this.min
|
|
414
409
|
);
|
|
415
410
|
};
|
|
416
|
-
|
|
411
|
+
_isNonVisibleFocus = new WeakMap();
|
|
412
|
+
focusThumbNonVisibly_fn = function(thumb) {
|
|
413
|
+
__privateSet(this, _isNonVisibleFocus, true);
|
|
414
|
+
thumb.focus();
|
|
415
|
+
__privateSet(this, _isNonVisibleFocus, false);
|
|
416
|
+
};
|
|
417
|
+
// --- Event handling ---
|
|
417
418
|
registerThumbListeners_fn = function() {
|
|
418
419
|
for (const thumb of ["start", "end"]) {
|
|
419
|
-
__privateGet(this,
|
|
420
|
-
__privateGet(this,
|
|
420
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
421
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
421
422
|
"mousedown",
|
|
422
423
|
__privateGet(this, _onThumbMousedown),
|
|
423
424
|
{ passive: true }
|
|
424
425
|
);
|
|
425
|
-
__privateGet(this,
|
|
426
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
426
427
|
"touchstart",
|
|
427
428
|
__privateGet(this, _onThumbMousedown),
|
|
428
429
|
{ passive: true }
|
|
429
430
|
);
|
|
431
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseover", __privateGet(this, _onMouseOver), {
|
|
432
|
+
passive: true
|
|
433
|
+
});
|
|
434
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseout", __privateGet(this, _onMouseOut), {
|
|
435
|
+
passive: true
|
|
436
|
+
});
|
|
437
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
438
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
430
439
|
}
|
|
431
440
|
};
|
|
432
|
-
_unregisterThumbListeners = new WeakSet();
|
|
433
441
|
unregisterThumbListeners_fn = function() {
|
|
434
442
|
for (const thumb of ["start", "end"]) {
|
|
435
|
-
__privateGet(this,
|
|
436
|
-
__privateGet(this,
|
|
443
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
444
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
437
445
|
"mousedown",
|
|
438
446
|
__privateGet(this, _onThumbMousedown)
|
|
439
447
|
);
|
|
440
|
-
__privateGet(this,
|
|
448
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
441
449
|
"touchstart",
|
|
442
450
|
__privateGet(this, _onThumbMousedown)
|
|
443
451
|
);
|
|
452
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseover", __privateGet(this, _onMouseOver));
|
|
453
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseout", __privateGet(this, _onMouseOut));
|
|
454
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
455
|
+
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
444
456
|
}
|
|
445
457
|
};
|
|
458
|
+
_onThumbFocus = new WeakMap();
|
|
459
|
+
_onThumbBlur = new WeakMap();
|
|
460
|
+
_onMouseOver = new WeakMap();
|
|
461
|
+
_onMouseOut = new WeakMap();
|
|
446
462
|
_onThumbMousedown = new WeakMap();
|
|
447
463
|
_onThumbKeydown = new WeakMap();
|
|
448
|
-
_registerDragHandlers = new WeakSet();
|
|
449
464
|
registerDragHandlers_fn = function() {
|
|
450
465
|
window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
|
|
451
466
|
window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
|
|
@@ -453,7 +468,6 @@ registerDragHandlers_fn = function() {
|
|
|
453
468
|
window.addEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
454
469
|
window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
455
470
|
};
|
|
456
|
-
_unregisterDragListeners = new WeakSet();
|
|
457
471
|
unregisterDragListeners_fn = function() {
|
|
458
472
|
window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
459
473
|
window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
@@ -505,9 +519,21 @@ __decorateClass([
|
|
|
505
519
|
__decorateClass([
|
|
506
520
|
index.attr
|
|
507
521
|
], RangeSlider.prototype, "connotation", 2);
|
|
522
|
+
__decorateClass([
|
|
523
|
+
index.attr({ mode: "boolean" })
|
|
524
|
+
], RangeSlider.prototype, "pin", 2);
|
|
508
525
|
__decorateClass([
|
|
509
526
|
index.observable
|
|
510
527
|
], RangeSlider.prototype, "valueTextFormatter", 2);
|
|
528
|
+
__decorateClass([
|
|
529
|
+
index.observable
|
|
530
|
+
], RangeSlider.prototype, "_draggingThumb", 2);
|
|
531
|
+
__decorateClass([
|
|
532
|
+
index.observable
|
|
533
|
+
], RangeSlider.prototype, "_visiblyFocusedThumb", 2);
|
|
534
|
+
__decorateClass([
|
|
535
|
+
index.observable
|
|
536
|
+
], RangeSlider.prototype, "_hoveredThumb", 2);
|
|
511
537
|
__decorateClass([
|
|
512
538
|
index.observable
|
|
513
539
|
], RangeSlider.prototype, "_startThumbCss", 2);
|
|
@@ -527,7 +553,12 @@ const getClasses = ({ disabled, connotation }) => classNames.classNames(
|
|
|
527
553
|
["disabled", Boolean(disabled)],
|
|
528
554
|
[`connotation-${connotation}`, Boolean(connotation)]
|
|
529
555
|
);
|
|
530
|
-
const
|
|
556
|
+
const getThumbClassesFor = (thumb) => ({ _visiblyFocusedThumb }) => classNames.classNames("thumb-container", [
|
|
557
|
+
"focus-visible",
|
|
558
|
+
_visiblyFocusedThumb === thumb
|
|
559
|
+
]);
|
|
560
|
+
const RangeSliderTemplate = (context) => {
|
|
561
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
531
562
|
return index.html` <template
|
|
532
563
|
@mousedown="${(x, c) => x._onMouseDown(c.event)}"
|
|
533
564
|
>
|
|
@@ -545,7 +576,7 @@ const RangeSliderTemplate = () => {
|
|
|
545
576
|
</div>
|
|
546
577
|
<div
|
|
547
578
|
${ref.ref("_startThumbEl")}
|
|
548
|
-
class="
|
|
579
|
+
class="${getThumbClassesFor("start")}"
|
|
549
580
|
style="${(x) => x._startThumbCss}"
|
|
550
581
|
role="slider"
|
|
551
582
|
tabindex="${(x) => x.disabled ? null : 0}"
|
|
@@ -557,9 +588,25 @@ const RangeSliderTemplate = () => {
|
|
|
557
588
|
aria-disabled="${(x) => x.disabled}"
|
|
558
589
|
aria-orientation="${(x) => x.orientation}"
|
|
559
590
|
></div>
|
|
591
|
+
${when.when(
|
|
592
|
+
(x) => x.pin,
|
|
593
|
+
index.html`<${popupTag}
|
|
594
|
+
class="popup"
|
|
595
|
+
arrow
|
|
596
|
+
alternate
|
|
597
|
+
:anchor="${(x) => x._startThumbEl}"
|
|
598
|
+
:open=${(x) => x._isThumbPopupOpen("start")}
|
|
599
|
+
:placementStrategy=${(x) => x.orientation === aria.Orientation.horizontal ? definition.PlacementStrategy.AutoPlacementHorizontal : definition.PlacementStrategy.AutoPlacementVertical}
|
|
600
|
+
animation-frame
|
|
601
|
+
exportparts="vvd-theme-alternate"
|
|
602
|
+
aria-hidden="true"
|
|
603
|
+
>
|
|
604
|
+
<div class="tooltip">${(x) => x.valueTextFormatter(x.start)}</div>
|
|
605
|
+
</${popupTag}>`
|
|
606
|
+
)}
|
|
560
607
|
<div
|
|
561
608
|
${ref.ref("_endThumbEl")}
|
|
562
|
-
class="
|
|
609
|
+
class="${getThumbClassesFor("end")}"
|
|
563
610
|
style="${(x) => x._endThumbCss}"
|
|
564
611
|
role="slider"
|
|
565
612
|
tabindex="${(x) => x.disabled ? null : 0}"
|
|
@@ -571,6 +618,22 @@ const RangeSliderTemplate = () => {
|
|
|
571
618
|
aria-disabled="${(x) => x.disabled}"
|
|
572
619
|
aria-orientation="${(x) => x.orientation}"
|
|
573
620
|
></div>
|
|
621
|
+
${when.when(
|
|
622
|
+
(x) => x.pin,
|
|
623
|
+
index.html`<${popupTag}
|
|
624
|
+
class="popup"
|
|
625
|
+
arrow
|
|
626
|
+
alternate
|
|
627
|
+
:anchor="${(x) => x._endThumbEl}"
|
|
628
|
+
:open=${(x) => x._isThumbPopupOpen("end")}
|
|
629
|
+
:placementStrategy=${(x) => x.orientation === aria.Orientation.horizontal ? definition.PlacementStrategy.AutoPlacementHorizontal : definition.PlacementStrategy.AutoPlacementVertical}
|
|
630
|
+
animation-frame
|
|
631
|
+
exportparts="vvd-theme-alternate"
|
|
632
|
+
aria-hidden="true"
|
|
633
|
+
>
|
|
634
|
+
<div class="tooltip">${(x) => x.valueTextFormatter(x.end)}</div>
|
|
635
|
+
</${popupTag}>`
|
|
636
|
+
)}
|
|
574
637
|
</div>
|
|
575
638
|
</div>
|
|
576
639
|
</template>`;
|
|
@@ -584,7 +647,10 @@ const rangeSliderDefinition = RangeSlider.compose({
|
|
|
584
647
|
delegatesFocus: true
|
|
585
648
|
}
|
|
586
649
|
});
|
|
587
|
-
const rangeSliderRegistries = [
|
|
650
|
+
const rangeSliderRegistries = [
|
|
651
|
+
...definition.popupRegistries,
|
|
652
|
+
rangeSliderDefinition()
|
|
653
|
+
];
|
|
588
654
|
const registerRangeSlider = index.registerFactory(rangeSliderRegistries);
|
|
589
655
|
|
|
590
656
|
exports.rangeSliderDefinition = rangeSliderDefinition;
|