base-ui-vue 0.1.0 → 0.2.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/README.md +41 -1
- package/dist/button/Button.cjs +53 -12
- package/dist/button/Button.cjs.map +1 -1
- package/dist/button/Button.js +26 -15
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ToolbarButton.cjs +367 -0
- package/dist/button/ToolbarButton.cjs.map +1 -0
- package/dist/button/ToolbarButton.js +320 -0
- package/dist/button/ToolbarButton.js.map +1 -0
- package/dist/button/ToolbarButtonDataAttributes.cjs +27 -0
- package/dist/button/ToolbarButtonDataAttributes.cjs.map +1 -0
- package/dist/button/ToolbarButtonDataAttributes.js +21 -0
- package/dist/button/ToolbarButtonDataAttributes.js.map +1 -0
- package/dist/checkbox/index.cjs +1173 -0
- package/dist/checkbox/index.cjs.map +1 -0
- package/dist/checkbox/index.js +1048 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/checkbox-group/CheckboxGroup.cjs +629 -0
- package/dist/checkbox-group/CheckboxGroup.cjs.map +1 -0
- package/dist/checkbox-group/CheckboxGroup.js +540 -0
- package/dist/checkbox-group/CheckboxGroup.js.map +1 -0
- package/dist/checkbox-group/CheckboxGroupDataAttributes.cjs +18 -0
- package/dist/checkbox-group/CheckboxGroupDataAttributes.cjs.map +1 -0
- package/dist/checkbox-group/CheckboxGroupDataAttributes.js +12 -0
- package/dist/checkbox-group/CheckboxGroupDataAttributes.js.map +1 -0
- package/dist/composite/composite.cjs +167 -0
- package/dist/composite/composite.cjs.map +1 -1
- package/dist/composite/composite.js +96 -1
- package/dist/composite/composite.js.map +1 -1
- package/dist/composite/constants.cjs +12 -0
- package/dist/composite/constants.cjs.map +1 -0
- package/dist/composite/constants.js +6 -0
- package/dist/composite/constants.js.map +1 -0
- package/dist/control/FieldControl.cjs +18 -343
- package/dist/control/FieldControl.cjs.map +1 -1
- package/dist/control/FieldControl.js +14 -285
- package/dist/control/FieldControl.js.map +1 -1
- package/dist/control/SliderControl.cjs +636 -0
- package/dist/control/SliderControl.cjs.map +1 -0
- package/dist/control/SliderControl.js +553 -0
- package/dist/control/SliderControl.js.map +1 -0
- package/dist/control/SliderControlDataAttributes.cjs +47 -0
- package/dist/control/SliderControlDataAttributes.cjs.map +1 -0
- package/dist/control/SliderControlDataAttributes.js +41 -0
- package/dist/control/SliderControlDataAttributes.js.map +1 -0
- package/dist/csp-provider/CSPContext.cjs +32 -0
- package/dist/csp-provider/CSPContext.cjs.map +1 -0
- package/dist/csp-provider/CSPContext.js +21 -0
- package/dist/csp-provider/CSPContext.js.map +1 -0
- package/dist/csp-provider/CSPProvider.cjs +46 -0
- package/dist/csp-provider/CSPProvider.cjs.map +1 -0
- package/dist/csp-provider/CSPProvider.js +41 -0
- package/dist/csp-provider/CSPProvider.js.map +1 -0
- package/dist/description/FieldDescription.cjs +5 -5
- package/dist/description/FieldDescription.cjs.map +1 -1
- package/dist/description/FieldDescription.js +1 -1
- package/dist/direction-provider/DirectionProvider.cjs +2 -2
- package/dist/direction-provider/DirectionProvider.cjs.map +1 -1
- package/dist/direction-provider/DirectionProvider.js +1 -1
- package/dist/error/FieldError.cjs +10 -288
- package/dist/error/FieldError.cjs.map +1 -1
- package/dist/error/FieldError.js +4 -246
- package/dist/error/FieldError.js.map +1 -1
- package/dist/form/Form.cjs +5 -4
- package/dist/form/Form.cjs.map +1 -1
- package/dist/form/Form.js +5 -4
- package/dist/form/Form.js.map +1 -1
- package/dist/group/ToolbarGroup.cjs +92 -0
- package/dist/group/ToolbarGroup.cjs.map +1 -0
- package/dist/group/ToolbarGroup.js +87 -0
- package/dist/group/ToolbarGroup.js.map +1 -0
- package/dist/group/ToolbarGroupDataAttributes.cjs +23 -0
- package/dist/group/ToolbarGroupDataAttributes.cjs.map +1 -0
- package/dist/group/ToolbarGroupDataAttributes.js +17 -0
- package/dist/group/ToolbarGroupDataAttributes.js.map +1 -0
- package/dist/header/AccordionHeader.cjs +2 -2
- package/dist/header/AccordionHeader.js +1 -1
- package/dist/image/AvatarImage.cjs +4 -4
- package/dist/image/AvatarImage.cjs.map +1 -1
- package/dist/image/AvatarImage.js +1 -1
- package/dist/index.cjs +80 -10
- package/dist/index.d.cts +2751 -612
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +2751 -612
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index2.cjs +3651 -370
- package/dist/index2.cjs.map +1 -1
- package/dist/index2.js +3365 -270
- package/dist/index2.js.map +1 -1
- package/package.json +8 -4
- package/src/accordion/root/AccordionRoot.vue +2 -1
- package/src/checkbox/index.ts +23 -0
- package/src/checkbox/indicator/CheckboxIndicator.vue +102 -0
- package/src/checkbox/indicator/CheckboxIndicatorDataAttributes.ts +61 -0
- package/src/checkbox/root/CheckboxRoot.vue +632 -0
- package/src/checkbox/root/CheckboxRootContext.ts +22 -0
- package/src/checkbox/root/CheckboxRootDataAttributes.ts +54 -0
- package/src/checkbox/utils/useStateAttributesMapping.ts +30 -0
- package/src/checkbox-group/CheckboxGroup.vue +241 -0
- package/src/checkbox-group/CheckboxGroupContext.ts +39 -0
- package/src/checkbox-group/CheckboxGroupDataAttributes.ts +6 -0
- package/src/checkbox-group/index.ts +11 -0
- package/src/checkbox-group/useCheckboxGroupParent.ts +173 -0
- package/src/collapsible/panel/useCollapsiblePanel.ts +2 -1
- package/src/collapsible/root/useCollapsibleRoot.ts +3 -1
- package/src/composite/composite.ts +2 -0
- package/src/composite/item/CompositeItem.vue +7 -8
- package/src/composite/root/CompositeRoot.vue +12 -1
- package/src/csp-provider/CSPContext.ts +26 -0
- package/src/csp-provider/CSPProvider.vue +40 -0
- package/src/csp-provider/index.ts +5 -0
- package/src/field/item/FieldItem.vue +6 -1
- package/src/field/label/FieldLabel.vue +10 -51
- package/src/field/root/FieldRoot.vue +16 -3
- package/src/floating-ui-vue/types.ts +1 -4
- package/src/floating-ui-vue/utils/element.ts +12 -0
- package/src/floating-ui-vue/utils/shadowDom.ts +44 -0
- package/src/floating-ui-vue/utils.ts +3 -0
- package/src/form/Form.vue +5 -3
- package/src/index.ts +9 -0
- package/src/labelable-provider/LabelableContext.ts +2 -2
- package/src/labelable-provider/LabelableProvider.vue +21 -4
- package/src/labelable-provider/index.ts +2 -0
- package/src/labelable-provider/useAriaLabelledBy.ts +9 -9
- package/src/labelable-provider/useLabel.ts +115 -0
- package/src/labelable-provider/useLabelableId.ts +12 -10
- package/src/separator/Separator.vue +65 -0
- package/src/separator/SeparatorDataAttributes.ts +7 -0
- package/src/separator/index.ts +3 -0
- package/src/slider/control/SliderControl.vue +497 -0
- package/src/slider/control/SliderControlDataAttributes.ts +35 -0
- package/src/slider/index.ts +35 -0
- package/src/slider/indicator/SliderIndicator.vue +144 -0
- package/src/slider/indicator/SliderIndicatorDataAttributes.ts +35 -0
- package/src/slider/label/SliderLabel.vue +75 -0
- package/src/slider/root/SliderRoot.vue +557 -0
- package/src/slider/root/SliderRootContext.ts +126 -0
- package/src/slider/root/SliderRootDataAttributes.ts +35 -0
- package/src/slider/root/stateAttributesMapping.ts +13 -0
- package/src/slider/thumb/SliderThumb.vue +601 -0
- package/src/slider/thumb/SliderThumbDataAttributes.ts +39 -0
- package/src/slider/thumb/prehydrationScript.min.ts +5 -0
- package/src/slider/thumb/prehydrationScript.template.js +69 -0
- package/src/slider/track/SliderTrack.vue +48 -0
- package/src/slider/track/SliderTrackDataAttributes.ts +10 -0
- package/src/slider/utils/asc.ts +3 -0
- package/src/slider/utils/getMidpoint.ts +9 -0
- package/src/slider/utils/getPushedThumbValues.ts +68 -0
- package/src/slider/utils/getSliderValue.ts +25 -0
- package/src/slider/utils/replaceArrayItemAtIndex.ts +15 -0
- package/src/slider/utils/resolveThumbCollision.ts +177 -0
- package/src/slider/utils/roundValueToStep.ts +19 -0
- package/src/slider/utils/test-utils.ts +25 -0
- package/src/slider/utils/validateMinimumDistance.ts +20 -0
- package/src/slider/utils/valueArrayToPercentages.ts +10 -0
- package/src/slider/value/SliderValue.vue +90 -0
- package/src/slider/value/SliderValueDataAttributes.ts +35 -0
- package/src/switch/index.ts +14 -0
- package/src/switch/root/SwitchRoot.vue +448 -0
- package/src/switch/root/SwitchRootContext.ts +22 -0
- package/src/switch/root/SwitchRootDataAttributes.ts +46 -0
- package/src/switch/stateAttributesMapping.ts +23 -0
- package/src/switch/thumb/SwitchThumb.vue +59 -0
- package/src/switch/thumb/SwitchThumbDataAttributes.ts +46 -0
- package/src/toggle/Toggle.vue +211 -0
- package/src/toggle/ToggleDataAttributes.ts +6 -0
- package/src/toggle/index.ts +3 -0
- package/src/toggle-group/ToggleGroup.vue +224 -0
- package/src/toggle-group/ToggleGroupContext.ts +45 -0
- package/src/toggle-group/ToggleGroupDataAttributes.ts +15 -0
- package/src/toggle-group/index.ts +5 -0
- package/src/toolbar/button/ToolbarButton.vue +99 -0
- package/src/toolbar/button/ToolbarButtonDataAttributes.ts +15 -0
- package/src/toolbar/group/ToolbarGroup.vue +70 -0
- package/src/toolbar/group/ToolbarGroupContext.ts +23 -0
- package/src/toolbar/group/ToolbarGroupDataAttributes.ts +11 -0
- package/src/toolbar/index.ts +27 -0
- package/src/toolbar/input/ToolbarInput.vue +114 -0
- package/src/toolbar/input/ToolbarInputDataAttributes.ts +15 -0
- package/src/toolbar/link/ToolbarLink.vue +54 -0
- package/src/toolbar/link/ToolbarLinkDataAttributes.ts +7 -0
- package/src/toolbar/root/ToolbarRoot.vue +144 -0
- package/src/toolbar/root/ToolbarRootContext.ts +29 -0
- package/src/toolbar/root/ToolbarRootDataAttributes.ts +11 -0
- package/src/toolbar/separator/ToolbarSeparator.vue +41 -0
- package/src/toolbar/separator/ToolbarSeparatorDataAttributes.ts +7 -0
- package/src/use-button/useButton.ts +2 -1
- package/src/utils/areArraysEqual.ts +12 -0
- package/src/utils/clamp.ts +7 -0
- package/src/utils/createBaseUIEventDetails.ts +9 -0
- package/src/utils/formatNumber.ts +7 -0
- package/src/utils/owner.ts +5 -0
- package/src/utils/resolveAriaLabelledBy.ts +10 -0
- package/src/utils/useControllableState.ts +78 -14
- package/src/utils/useFocusableWhenDisabled.ts +6 -1
- package/src/utils/useMergedRefs.ts +26 -2
- package/src/utils/useRegisteredLabelId.ts +21 -0
- package/src/utils/valueToPercent.ts +7 -0
- package/src/utils/visuallyHidden.ts +24 -0
- package/dist/direction-provider/DirectionContext.cjs +0 -26
- package/dist/direction-provider/DirectionContext.cjs.map +0 -1
- package/dist/direction-provider/DirectionContext.js +0 -15
- package/dist/direction-provider/DirectionContext.js.map +0 -1
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { mergeProps as mergeProps$1, useRenderElement } from "../button/Button.js";
|
|
2
|
+
import { REASONS, createChangeEventDetails, createGenericEventDetails, useAnimationFrame } from "../checkbox/index.js";
|
|
3
|
+
import { fieldValidityMapping } from "../checkbox-group/CheckboxGroup.js";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, defineComponent, inject, mergeProps, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, unref, useAttrs, watchEffect, withCtx } from "vue";
|
|
5
|
+
import { isElement, isShadowRoot } from "@floating-ui/utils/dom";
|
|
6
|
+
|
|
7
|
+
//#region src/direction-provider/DirectionContext.ts
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
const directionContextKey = Symbol("DirectionContext");
|
|
12
|
+
function useDirection() {
|
|
13
|
+
const context = inject(directionContextKey, void 0);
|
|
14
|
+
return computed(() => context?.direction.value ?? "ltr");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/floating-ui-vue/utils/shadowDom.ts
|
|
19
|
+
function activeElement(doc) {
|
|
20
|
+
let element = doc.activeElement;
|
|
21
|
+
while (element?.shadowRoot?.activeElement != null) element = element.shadowRoot.activeElement;
|
|
22
|
+
return element;
|
|
23
|
+
}
|
|
24
|
+
function contains(parent, child) {
|
|
25
|
+
if (!parent || !child) return false;
|
|
26
|
+
const rootNode = child.getRootNode?.();
|
|
27
|
+
if (parent.contains(child)) return true;
|
|
28
|
+
if (rootNode && isShadowRoot(rootNode)) {
|
|
29
|
+
let next = child;
|
|
30
|
+
while (next) {
|
|
31
|
+
if (parent === next) return true;
|
|
32
|
+
next = next.parentNode ?? next.host ?? null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
function getTarget(event) {
|
|
38
|
+
if ("composedPath" in event && typeof event.composedPath === "function") return event.composedPath()[0];
|
|
39
|
+
return event.target;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/utils/owner.ts
|
|
44
|
+
function ownerDocument(node) {
|
|
45
|
+
return node?.ownerDocument || (typeof document !== "undefined" ? document : null);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/utils/clamp.ts
|
|
50
|
+
function clamp(value, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
51
|
+
return Math.min(Math.max(value, min), max);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/slider/root/SliderRootContext.ts
|
|
56
|
+
const sliderRootContextKey = Symbol("SliderRootContext");
|
|
57
|
+
function useSliderRootContext(optional = false) {
|
|
58
|
+
const context = inject(sliderRootContextKey, void 0);
|
|
59
|
+
if (!context && !optional) throw new Error("Base UI Vue: SliderRootContext is missing. Slider parts must be placed within <SliderRoot>.");
|
|
60
|
+
return context;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/slider/root/stateAttributesMapping.ts
|
|
65
|
+
const sliderStateAttributesMapping = {
|
|
66
|
+
activeThumbIndex: () => null,
|
|
67
|
+
max: () => null,
|
|
68
|
+
min: () => null,
|
|
69
|
+
minStepsBetweenValues: () => null,
|
|
70
|
+
step: () => null,
|
|
71
|
+
values: () => null,
|
|
72
|
+
...fieldValidityMapping
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/slider/utils/getMidpoint.ts
|
|
77
|
+
function getMidpoint(element) {
|
|
78
|
+
const rect = element.getBoundingClientRect();
|
|
79
|
+
return {
|
|
80
|
+
x: (rect.left + rect.right) / 2,
|
|
81
|
+
y: (rect.top + rect.bottom) / 2
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/slider/utils/getPushedThumbValues.ts
|
|
87
|
+
function getPushedThumbValues({ values, index, nextValue, min, max, step, minStepsBetweenValues, initialValues }) {
|
|
88
|
+
if (values.length === 0) return [];
|
|
89
|
+
const nextValues = values.slice();
|
|
90
|
+
const minValueDifference = step * minStepsBetweenValues;
|
|
91
|
+
const lastIndex = nextValues.length - 1;
|
|
92
|
+
const baseInitialValues = initialValues ?? values;
|
|
93
|
+
nextValues[index] = clamp(nextValue, min + index * minValueDifference, max - (lastIndex - index) * minValueDifference);
|
|
94
|
+
for (let i = index + 1; i <= lastIndex; i += 1) {
|
|
95
|
+
const minAllowed = nextValues[i - 1] + minValueDifference;
|
|
96
|
+
const maxAllowed = max - (lastIndex - i) * minValueDifference;
|
|
97
|
+
const initialValue = baseInitialValues[i] ?? nextValues[i];
|
|
98
|
+
let candidate = Math.max(nextValues[i], minAllowed);
|
|
99
|
+
if (initialValue < candidate) candidate = Math.max(initialValue, minAllowed);
|
|
100
|
+
nextValues[i] = clamp(candidate, minAllowed, maxAllowed);
|
|
101
|
+
}
|
|
102
|
+
for (let i = index - 1; i >= 0; i -= 1) {
|
|
103
|
+
const maxAllowed = nextValues[i + 1] - minValueDifference;
|
|
104
|
+
const minAllowed = min + i * minValueDifference;
|
|
105
|
+
const initialValue = baseInitialValues[i] ?? nextValues[i];
|
|
106
|
+
let candidate = Math.min(nextValues[i], maxAllowed);
|
|
107
|
+
if (initialValue > candidate) candidate = Math.min(initialValue, maxAllowed);
|
|
108
|
+
nextValues[i] = clamp(candidate, minAllowed, maxAllowed);
|
|
109
|
+
}
|
|
110
|
+
for (let i = 0; i <= lastIndex; i += 1) nextValues[i] = Number(nextValues[i].toFixed(12));
|
|
111
|
+
return nextValues;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/slider/utils/resolveThumbCollision.ts
|
|
116
|
+
function resolveThumbCollision({ behavior, values, currentValues, initialValues, pressedIndex, nextValue, min, max, step, minStepsBetweenValues }) {
|
|
117
|
+
const activeValues = currentValues ?? values;
|
|
118
|
+
const baselineValues = initialValues ?? values;
|
|
119
|
+
if (!(activeValues.length > 1)) return {
|
|
120
|
+
value: nextValue,
|
|
121
|
+
thumbIndex: 0,
|
|
122
|
+
didSwap: false
|
|
123
|
+
};
|
|
124
|
+
const minValueDifference = step * minStepsBetweenValues;
|
|
125
|
+
switch (behavior) {
|
|
126
|
+
case "swap": {
|
|
127
|
+
const pressedInitialValue = activeValues[pressedIndex];
|
|
128
|
+
const epsilon = 1e-7;
|
|
129
|
+
const candidateValues = activeValues.slice();
|
|
130
|
+
const previousNeighbor = candidateValues[pressedIndex - 1];
|
|
131
|
+
const nextNeighbor = candidateValues[pressedIndex + 1];
|
|
132
|
+
const constrainedValue = clamp(nextValue, previousNeighbor != null ? previousNeighbor + minValueDifference : min, nextNeighbor != null ? nextNeighbor - minValueDifference : max);
|
|
133
|
+
const pressedValueAfterClamp = Number(constrainedValue.toFixed(12));
|
|
134
|
+
candidateValues[pressedIndex] = pressedValueAfterClamp;
|
|
135
|
+
const movingForward = nextValue > pressedInitialValue;
|
|
136
|
+
const movingBackward = nextValue < pressedInitialValue;
|
|
137
|
+
const shouldSwapForward = movingForward && nextNeighbor != null && nextValue >= nextNeighbor - epsilon;
|
|
138
|
+
const shouldSwapBackward = movingBackward && previousNeighbor != null && nextValue <= previousNeighbor + epsilon;
|
|
139
|
+
if (!shouldSwapForward && !shouldSwapBackward) return {
|
|
140
|
+
value: candidateValues,
|
|
141
|
+
thumbIndex: pressedIndex,
|
|
142
|
+
didSwap: false
|
|
143
|
+
};
|
|
144
|
+
const targetIndex = shouldSwapForward ? pressedIndex + 1 : pressedIndex - 1;
|
|
145
|
+
const initialValuesForPush = candidateValues.map((_, index) => {
|
|
146
|
+
if (index === pressedIndex) return pressedValueAfterClamp;
|
|
147
|
+
const baseline = baselineValues[index];
|
|
148
|
+
if (baseline != null) return baseline;
|
|
149
|
+
return activeValues[index];
|
|
150
|
+
});
|
|
151
|
+
let nextValueForTarget = nextValue;
|
|
152
|
+
if (shouldSwapForward) nextValueForTarget = Math.max(nextValue, candidateValues[targetIndex]);
|
|
153
|
+
else nextValueForTarget = Math.min(nextValue, candidateValues[targetIndex]);
|
|
154
|
+
const adjustedValues = getPushedThumbValues({
|
|
155
|
+
values: candidateValues,
|
|
156
|
+
index: targetIndex,
|
|
157
|
+
nextValue: nextValueForTarget,
|
|
158
|
+
min,
|
|
159
|
+
max,
|
|
160
|
+
step,
|
|
161
|
+
minStepsBetweenValues,
|
|
162
|
+
initialValues: initialValuesForPush
|
|
163
|
+
});
|
|
164
|
+
const neighborIndex = shouldSwapForward ? targetIndex - 1 : targetIndex + 1;
|
|
165
|
+
if (neighborIndex >= 0 && neighborIndex < adjustedValues.length) {
|
|
166
|
+
const previousValue = adjustedValues[neighborIndex - 1];
|
|
167
|
+
const nextValueAfter = adjustedValues[neighborIndex + 1];
|
|
168
|
+
let neighborLowerBound = previousValue != null ? previousValue + minValueDifference : min;
|
|
169
|
+
neighborLowerBound = Math.max(neighborLowerBound, min + neighborIndex * minValueDifference);
|
|
170
|
+
let neighborUpperBound = nextValueAfter != null ? nextValueAfter - minValueDifference : max;
|
|
171
|
+
neighborUpperBound = Math.min(neighborUpperBound, max - (adjustedValues.length - 1 - neighborIndex) * minValueDifference);
|
|
172
|
+
const restoredValue = clamp(pressedValueAfterClamp, neighborLowerBound, neighborUpperBound);
|
|
173
|
+
adjustedValues[neighborIndex] = Number(restoredValue.toFixed(12));
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
value: adjustedValues,
|
|
177
|
+
thumbIndex: targetIndex,
|
|
178
|
+
didSwap: true
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
case "push": return {
|
|
182
|
+
value: getPushedThumbValues({
|
|
183
|
+
values: activeValues,
|
|
184
|
+
index: pressedIndex,
|
|
185
|
+
nextValue,
|
|
186
|
+
min,
|
|
187
|
+
max,
|
|
188
|
+
step,
|
|
189
|
+
minStepsBetweenValues
|
|
190
|
+
}),
|
|
191
|
+
thumbIndex: pressedIndex,
|
|
192
|
+
didSwap: false
|
|
193
|
+
};
|
|
194
|
+
default: {
|
|
195
|
+
const candidateValues = activeValues.slice();
|
|
196
|
+
const previousNeighbor = candidateValues[pressedIndex - 1];
|
|
197
|
+
const nextNeighbor = candidateValues[pressedIndex + 1];
|
|
198
|
+
const constrainedValue = clamp(nextValue, previousNeighbor != null ? previousNeighbor + minValueDifference : min, nextNeighbor != null ? nextNeighbor - minValueDifference : max);
|
|
199
|
+
candidateValues[pressedIndex] = Number(constrainedValue.toFixed(12));
|
|
200
|
+
return {
|
|
201
|
+
value: candidateValues,
|
|
202
|
+
thumbIndex: pressedIndex,
|
|
203
|
+
didSwap: false
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/slider/utils/roundValueToStep.ts
|
|
211
|
+
function getDecimalPrecision(num) {
|
|
212
|
+
if (Math.abs(num) < 1) {
|
|
213
|
+
const parts = num.toExponential().split("e-");
|
|
214
|
+
const mantissaDecimalPart = parts[0].split(".")[1];
|
|
215
|
+
return (mantissaDecimalPart ? mantissaDecimalPart.length : 0) + Number.parseInt(parts[1], 10);
|
|
216
|
+
}
|
|
217
|
+
const decimalPart = num.toString().split(".")[1];
|
|
218
|
+
return decimalPart ? decimalPart.length : 0;
|
|
219
|
+
}
|
|
220
|
+
function roundValueToStep(value, step, min) {
|
|
221
|
+
if (!Number.isFinite(step) || step <= 0) return value;
|
|
222
|
+
const nearest = Math.round((value - min) / step) * step + min;
|
|
223
|
+
return Number(nearest.toFixed(getDecimalPrecision(step)));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/slider/utils/validateMinimumDistance.ts
|
|
228
|
+
function validateMinimumDistance(values, step, minStepsBetweenValues) {
|
|
229
|
+
if (!Array.isArray(values)) return true;
|
|
230
|
+
const distances = values.reduce((acc, val, index, vals) => {
|
|
231
|
+
if (index === vals.length - 1) return acc;
|
|
232
|
+
acc.push(Math.abs(val - vals[index + 1]));
|
|
233
|
+
return acc;
|
|
234
|
+
}, []);
|
|
235
|
+
return Math.min(...distances) >= step * minStepsBetweenValues;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/slider/control/SliderControl.vue?vue&type=script&setup=true&lang.ts
|
|
240
|
+
/**
|
|
241
|
+
* The clickable, interactive part of the slider.
|
|
242
|
+
* Renders a `<div>` element.
|
|
243
|
+
*
|
|
244
|
+
* Documentation: [Base UI Vue Slider](https://baseui-vue.com/docs/components/slider)
|
|
245
|
+
*/
|
|
246
|
+
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
247
|
+
var SliderControl_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
248
|
+
name: "SliderControl",
|
|
249
|
+
inheritAttrs: false,
|
|
250
|
+
__name: "SliderControl",
|
|
251
|
+
props: {
|
|
252
|
+
as: {
|
|
253
|
+
type: null,
|
|
254
|
+
required: false,
|
|
255
|
+
default: "div"
|
|
256
|
+
},
|
|
257
|
+
class: {
|
|
258
|
+
type: Function,
|
|
259
|
+
required: false,
|
|
260
|
+
skipCheck: true
|
|
261
|
+
},
|
|
262
|
+
style: {
|
|
263
|
+
type: [
|
|
264
|
+
Boolean,
|
|
265
|
+
null,
|
|
266
|
+
String,
|
|
267
|
+
Object,
|
|
268
|
+
Array,
|
|
269
|
+
Function
|
|
270
|
+
],
|
|
271
|
+
required: false,
|
|
272
|
+
skipCheck: true
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
setup(__props) {
|
|
276
|
+
const props = __props;
|
|
277
|
+
function getControlOffset(styles, vertical) {
|
|
278
|
+
if (!styles) return {
|
|
279
|
+
start: 0,
|
|
280
|
+
end: 0
|
|
281
|
+
};
|
|
282
|
+
function parseSize(value) {
|
|
283
|
+
const parsed = value != null ? Number.parseFloat(value) : 0;
|
|
284
|
+
return Number.isNaN(parsed) ? 0 : parsed;
|
|
285
|
+
}
|
|
286
|
+
const start = !vertical ? "InlineStart" : "Top";
|
|
287
|
+
const end = !vertical ? "InlineEnd" : "Bottom";
|
|
288
|
+
return {
|
|
289
|
+
start: parseSize(styles[`border${start}Width`]) + parseSize(styles[`padding${start}`]),
|
|
290
|
+
end: parseSize(styles[`border${end}Width`]) + parseSize(styles[`padding${end}`])
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function getFingerCoords(event, touchIdRef) {
|
|
294
|
+
if (touchIdRef.value != null && "changedTouches" in event) {
|
|
295
|
+
for (let i = 0; i < event.changedTouches.length; i += 1) {
|
|
296
|
+
const touch = event.changedTouches[i];
|
|
297
|
+
if (touch.identifier === touchIdRef.value) return {
|
|
298
|
+
x: touch.clientX,
|
|
299
|
+
y: touch.clientY
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
x: event.clientX,
|
|
306
|
+
y: event.clientY
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
const attrs = useAttrs();
|
|
310
|
+
const rootContext = useSliderRootContext();
|
|
311
|
+
const direction = useDirection();
|
|
312
|
+
const focusFrame = useAnimationFrame();
|
|
313
|
+
const range = computed(() => rootContext.values.value.length > 1);
|
|
314
|
+
const vertical = computed(() => rootContext.orientation.value === "vertical");
|
|
315
|
+
const controlRef = ref(null);
|
|
316
|
+
const stylesRef = ref(null);
|
|
317
|
+
function setStylesRef(element) {
|
|
318
|
+
if (element && stylesRef.value == null) stylesRef.value = getComputedStyle(element);
|
|
319
|
+
}
|
|
320
|
+
const touchIdRef = ref(null);
|
|
321
|
+
const moveCountRef = ref(0);
|
|
322
|
+
const insetThumbOffsetRef = ref(0);
|
|
323
|
+
const latestValuesRef = ref(rootContext.values.value);
|
|
324
|
+
function updatePressedThumb(nextIndex) {
|
|
325
|
+
if (rootContext.pressedThumbIndexRef.value !== nextIndex) rootContext.pressedThumbIndexRef.value = nextIndex;
|
|
326
|
+
const thumbElement = rootContext.thumbRefs.value[nextIndex];
|
|
327
|
+
if (!thumbElement) {
|
|
328
|
+
rootContext.pressedThumbCenterOffsetRef.value = null;
|
|
329
|
+
rootContext.pressedInputRef.value = null;
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
rootContext.pressedInputRef.value = thumbElement.querySelector("input[type=\"range\"]");
|
|
333
|
+
}
|
|
334
|
+
function getFingerState(fingerCoords) {
|
|
335
|
+
const control = controlRef.value;
|
|
336
|
+
if (!control) return null;
|
|
337
|
+
const { width, height, bottom, left, right } = control.getBoundingClientRect();
|
|
338
|
+
const controlOffset = getControlOffset(stylesRef.value, vertical.value);
|
|
339
|
+
const insetThumbOffset = insetThumbOffsetRef.value;
|
|
340
|
+
const controlSize = (vertical.value ? height : width) - controlOffset.start - controlOffset.end - insetThumbOffset * 2;
|
|
341
|
+
const thumbCenterOffset = rootContext.pressedThumbCenterOffsetRef.value ?? 0;
|
|
342
|
+
const fingerX = fingerCoords.x - thumbCenterOffset;
|
|
343
|
+
const fingerY = fingerCoords.y - thumbCenterOffset;
|
|
344
|
+
const valueRescaled = clamp(((vertical.value ? bottom - fingerY - controlOffset.end : (direction.value === "rtl" ? right - fingerX : fingerX - left) - controlOffset.start) - insetThumbOffset) / controlSize, 0, 1);
|
|
345
|
+
let newValue = (rootContext.max.value - rootContext.min.value) * valueRescaled + rootContext.min.value;
|
|
346
|
+
newValue = roundValueToStep(newValue, rootContext.step.value, rootContext.min.value);
|
|
347
|
+
newValue = clamp(newValue, rootContext.min.value, rootContext.max.value);
|
|
348
|
+
if (!range.value) return {
|
|
349
|
+
value: newValue,
|
|
350
|
+
thumbIndex: 0,
|
|
351
|
+
didSwap: false
|
|
352
|
+
};
|
|
353
|
+
const thumbIndex = rootContext.pressedThumbIndexRef.value;
|
|
354
|
+
if (thumbIndex < 0) return null;
|
|
355
|
+
const collisionResult = resolveThumbCollision({
|
|
356
|
+
behavior: rootContext.thumbCollisionBehavior.value,
|
|
357
|
+
values: rootContext.values.value,
|
|
358
|
+
currentValues: latestValuesRef.value ?? rootContext.values.value,
|
|
359
|
+
initialValues: rootContext.pressedValuesRef.value,
|
|
360
|
+
pressedIndex: thumbIndex,
|
|
361
|
+
nextValue: newValue,
|
|
362
|
+
min: rootContext.min.value,
|
|
363
|
+
max: rootContext.max.value,
|
|
364
|
+
step: rootContext.step.value,
|
|
365
|
+
minStepsBetweenValues: rootContext.minStepsBetweenValues.value
|
|
366
|
+
});
|
|
367
|
+
if (rootContext.thumbCollisionBehavior.value === "swap" && collisionResult.didSwap) updatePressedThumb(collisionResult.thumbIndex);
|
|
368
|
+
else rootContext.pressedThumbIndexRef.value = collisionResult.thumbIndex;
|
|
369
|
+
return collisionResult;
|
|
370
|
+
}
|
|
371
|
+
function startPressing(fingerCoords) {
|
|
372
|
+
rootContext.pressedValuesRef.value = range.value ? rootContext.values.value.slice() : null;
|
|
373
|
+
latestValuesRef.value = rootContext.values.value;
|
|
374
|
+
const pressedThumbIndex = rootContext.pressedThumbIndexRef.value;
|
|
375
|
+
let closestThumbIndex = pressedThumbIndex;
|
|
376
|
+
if (pressedThumbIndex > -1 && pressedThumbIndex < rootContext.values.value.length) {
|
|
377
|
+
if (rootContext.values.value[pressedThumbIndex] === rootContext.max.value) {
|
|
378
|
+
let candidateIndex = pressedThumbIndex;
|
|
379
|
+
while (candidateIndex > 0 && rootContext.values.value[candidateIndex - 1] === rootContext.max.value) candidateIndex -= 1;
|
|
380
|
+
closestThumbIndex = candidateIndex;
|
|
381
|
+
}
|
|
382
|
+
} else {
|
|
383
|
+
const axis = !vertical.value ? "x" : "y";
|
|
384
|
+
let minDistance;
|
|
385
|
+
closestThumbIndex = -1;
|
|
386
|
+
for (let i = 0; i < rootContext.thumbRefs.value.length; i += 1) {
|
|
387
|
+
const thumbEl = rootContext.thumbRefs.value[i];
|
|
388
|
+
if (isElement(thumbEl)) {
|
|
389
|
+
const midpoint = getMidpoint(thumbEl);
|
|
390
|
+
const distance = Math.abs(fingerCoords[axis] - midpoint[axis]);
|
|
391
|
+
if (minDistance === void 0 || distance <= minDistance) {
|
|
392
|
+
closestThumbIndex = i;
|
|
393
|
+
minDistance = distance;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (closestThumbIndex > -1 && closestThumbIndex !== pressedThumbIndex) updatePressedThumb(closestThumbIndex);
|
|
399
|
+
if (rootContext.inset.value) {
|
|
400
|
+
const thumbEl = rootContext.thumbRefs.value[closestThumbIndex];
|
|
401
|
+
if (isElement(thumbEl)) insetThumbOffsetRef.value = thumbEl.getBoundingClientRect()[vertical.value ? "height" : "width"] / 2;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function focusThumb(thumbIndex) {
|
|
405
|
+
const input = rootContext.thumbRefs.value?.[thumbIndex]?.querySelector("input[type=\"range\"]");
|
|
406
|
+
if (!input) return;
|
|
407
|
+
input.focus({ preventScroll: true });
|
|
408
|
+
}
|
|
409
|
+
function stopListening() {
|
|
410
|
+
const doc = ownerDocument(controlRef.value);
|
|
411
|
+
if (!doc) return;
|
|
412
|
+
doc.removeEventListener("pointermove", handleTouchMove);
|
|
413
|
+
doc.removeEventListener("pointerup", handleTouchEnd);
|
|
414
|
+
doc.removeEventListener("touchmove", handleTouchMove);
|
|
415
|
+
doc.removeEventListener("touchend", handleTouchEnd);
|
|
416
|
+
rootContext.pressedValuesRef.value = null;
|
|
417
|
+
}
|
|
418
|
+
function handleTouchMove(nativeEvent) {
|
|
419
|
+
const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
|
|
420
|
+
if (fingerCoords == null) return;
|
|
421
|
+
moveCountRef.value += 1;
|
|
422
|
+
if (nativeEvent.type === "pointermove" && nativeEvent.buttons === 0) {
|
|
423
|
+
handleTouchEnd(nativeEvent);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const finger = getFingerState(fingerCoords);
|
|
427
|
+
if (finger == null) return;
|
|
428
|
+
if (validateMinimumDistance(finger.value, rootContext.step.value, rootContext.minStepsBetweenValues.value)) {
|
|
429
|
+
if (!rootContext.dragging.value && moveCountRef.value > INTENTIONAL_DRAG_COUNT_THRESHOLD) rootContext.setDragging(true);
|
|
430
|
+
rootContext.setValue(finger.value, createChangeEventDetails(REASONS.drag, nativeEvent, void 0, { activeThumbIndex: finger.thumbIndex }));
|
|
431
|
+
latestValuesRef.value = Array.isArray(finger.value) ? finger.value : [finger.value];
|
|
432
|
+
if (finger.didSwap) focusThumb(finger.thumbIndex);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function handleTouchEnd(nativeEvent) {
|
|
436
|
+
rootContext.setActive(-1);
|
|
437
|
+
rootContext.setDragging(false);
|
|
438
|
+
rootContext.pressedInputRef.value = null;
|
|
439
|
+
rootContext.pressedThumbCenterOffsetRef.value = null;
|
|
440
|
+
const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
|
|
441
|
+
const finger = fingerCoords != null ? getFingerState(fingerCoords) : null;
|
|
442
|
+
if (finger != null) {
|
|
443
|
+
const commitReason = rootContext.lastChangeReasonRef.value;
|
|
444
|
+
rootContext.onValueCommitted(rootContext.lastChangedValueRef.value ?? finger.value, createGenericEventDetails(commitReason, nativeEvent));
|
|
445
|
+
}
|
|
446
|
+
if ("pointerId" in nativeEvent && typeof controlRef.value?.hasPointerCapture === "function" && controlRef.value.hasPointerCapture(nativeEvent.pointerId) && typeof controlRef.value.releasePointerCapture === "function") controlRef.value.releasePointerCapture(nativeEvent.pointerId);
|
|
447
|
+
rootContext.pressedThumbIndexRef.value = -1;
|
|
448
|
+
touchIdRef.value = null;
|
|
449
|
+
rootContext.pressedValuesRef.value = null;
|
|
450
|
+
stopListening();
|
|
451
|
+
}
|
|
452
|
+
function handleTouchStart(nativeEvent) {
|
|
453
|
+
if (rootContext.disabled.value) return;
|
|
454
|
+
const touch = nativeEvent.changedTouches[0];
|
|
455
|
+
if (touch != null) touchIdRef.value = touch.identifier;
|
|
456
|
+
const fingerCoords = getFingerCoords(nativeEvent, touchIdRef);
|
|
457
|
+
if (fingerCoords != null) {
|
|
458
|
+
startPressing(fingerCoords);
|
|
459
|
+
const finger = getFingerState(fingerCoords);
|
|
460
|
+
if (finger == null) return;
|
|
461
|
+
focusThumb(finger.thumbIndex);
|
|
462
|
+
rootContext.setValue(finger.value, createChangeEventDetails(REASONS.trackPress, nativeEvent, void 0, { activeThumbIndex: finger.thumbIndex }));
|
|
463
|
+
latestValuesRef.value = Array.isArray(finger.value) ? finger.value : [finger.value];
|
|
464
|
+
if (finger.didSwap) focusThumb(finger.thumbIndex);
|
|
465
|
+
}
|
|
466
|
+
moveCountRef.value = 0;
|
|
467
|
+
const doc = ownerDocument(controlRef.value);
|
|
468
|
+
if (!doc) return;
|
|
469
|
+
doc.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
470
|
+
doc.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
471
|
+
}
|
|
472
|
+
onMounted(() => {
|
|
473
|
+
const control = controlRef.value;
|
|
474
|
+
if (!control) return;
|
|
475
|
+
control.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
476
|
+
});
|
|
477
|
+
onBeforeUnmount(() => {
|
|
478
|
+
controlRef.value?.removeEventListener("touchstart", handleTouchStart);
|
|
479
|
+
focusFrame.cancel();
|
|
480
|
+
stopListening();
|
|
481
|
+
});
|
|
482
|
+
function mergedRef(node) {
|
|
483
|
+
const element = node instanceof HTMLElement ? node : null;
|
|
484
|
+
controlRef.value = element;
|
|
485
|
+
rootContext.registerFieldControlRef(element);
|
|
486
|
+
setStylesRef(element);
|
|
487
|
+
}
|
|
488
|
+
watchEffect(() => {
|
|
489
|
+
if (rootContext.disabled.value) stopListening();
|
|
490
|
+
});
|
|
491
|
+
const controlProps = computed(() => mergeProps$1(attrs, {
|
|
492
|
+
"data-base-ui-slider-control": rootContext.renderBeforeHydration.value ? "" : void 0,
|
|
493
|
+
onPointerdown(event) {
|
|
494
|
+
const control = controlRef.value;
|
|
495
|
+
const target = getTarget(event);
|
|
496
|
+
if (!control || rootContext.disabled.value || event.defaultPrevented || !isElement(target) || event.button !== 0) return;
|
|
497
|
+
const fingerCoords = getFingerCoords(event, touchIdRef);
|
|
498
|
+
if (fingerCoords != null) {
|
|
499
|
+
startPressing(fingerCoords);
|
|
500
|
+
const finger = getFingerState(fingerCoords);
|
|
501
|
+
if (finger == null) return;
|
|
502
|
+
const focusedElement = ownerDocument(control) ? activeElement(ownerDocument(control)) : null;
|
|
503
|
+
if (contains(rootContext.thumbRefs.value[finger.thumbIndex], focusedElement)) event.preventDefault();
|
|
504
|
+
else focusFrame.request(() => {
|
|
505
|
+
focusThumb(finger.thumbIndex);
|
|
506
|
+
});
|
|
507
|
+
rootContext.setDragging(true);
|
|
508
|
+
if (!(rootContext.pressedThumbCenterOffsetRef.value != null)) {
|
|
509
|
+
rootContext.setValue(finger.value, createChangeEventDetails(REASONS.trackPress, event, void 0, { activeThumbIndex: finger.thumbIndex }));
|
|
510
|
+
latestValuesRef.value = Array.isArray(finger.value) ? finger.value : [finger.value];
|
|
511
|
+
if (finger.didSwap) focusThumb(finger.thumbIndex);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
if (event.pointerId && typeof control.setPointerCapture === "function") control.setPointerCapture(event.pointerId);
|
|
515
|
+
moveCountRef.value = 0;
|
|
516
|
+
const doc = ownerDocument(control);
|
|
517
|
+
if (!doc) return;
|
|
518
|
+
doc.addEventListener("pointermove", handleTouchMove, { passive: true });
|
|
519
|
+
doc.addEventListener("pointerup", handleTouchEnd, { once: true });
|
|
520
|
+
}
|
|
521
|
+
}));
|
|
522
|
+
const { tag, mergedProps, renderless, ref: renderRef } = useRenderElement({
|
|
523
|
+
componentProps: props,
|
|
524
|
+
state: rootContext.state,
|
|
525
|
+
props: controlProps,
|
|
526
|
+
defaultTagName: "div",
|
|
527
|
+
ref: mergedRef,
|
|
528
|
+
stateAttributesMapping: sliderStateAttributesMapping
|
|
529
|
+
});
|
|
530
|
+
return (_ctx, _cache) => {
|
|
531
|
+
return unref(renderless) ? renderSlot(_ctx.$slots, "default", {
|
|
532
|
+
key: 0,
|
|
533
|
+
ref: unref(renderRef),
|
|
534
|
+
props: unref(mergedProps),
|
|
535
|
+
state: unref(rootContext).state
|
|
536
|
+
}) : (openBlock(), createBlock(resolveDynamicComponent(unref(tag)), mergeProps({
|
|
537
|
+
key: 1,
|
|
538
|
+
ref: unref(renderRef)
|
|
539
|
+
}, unref(mergedProps)), {
|
|
540
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
541
|
+
_: 3
|
|
542
|
+
}, 16));
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
//#endregion
|
|
548
|
+
//#region src/slider/control/SliderControl.vue
|
|
549
|
+
var SliderControl_default = SliderControl_vue_vue_type_script_setup_true_lang_default;
|
|
550
|
+
|
|
551
|
+
//#endregion
|
|
552
|
+
export { SliderControl_default, activeElement, clamp, contains, directionContextKey, getMidpoint, getTarget, ownerDocument, roundValueToStep, sliderRootContextKey, sliderStateAttributesMapping, useDirection, useSliderRootContext, validateMinimumDistance };
|
|
553
|
+
//# sourceMappingURL=SliderControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderControl.js","names":[],"sources":["../../src/direction-provider/DirectionContext.ts","../../src/floating-ui-vue/utils/shadowDom.ts","../../src/utils/owner.ts","../../src/utils/clamp.ts","../../src/slider/root/SliderRootContext.ts","../../src/slider/root/stateAttributesMapping.ts","../../src/slider/utils/getMidpoint.ts","../../src/slider/utils/getPushedThumbValues.ts","../../src/slider/utils/resolveThumbCollision.ts","../../src/slider/utils/roundValueToStep.ts","../../src/slider/utils/validateMinimumDistance.ts","../../src/slider/control/SliderControl.vue","../../src/slider/control/SliderControl.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;AAYA,MAAa,sBAAsB,OACjC,mBACD;AAUD,SAAgB,eAA2C;CACzD,MAAM,UAAU,OAAO,qBAAqB,OAAU;AAEtD,QAAO,eAAe,SAAS,UAAU,SAAS,MAAM;;;;;ACzB1D,SAAgB,cAAc,KAAe;CAC3C,IAAI,UAAU,IAAI;AAElB,QAAO,SAAS,YAAY,iBAAiB,KAC3C,WAAU,QAAQ,WAAW;AAG/B,QAAO;;AAGT,SAAgB,SAAS,QAAyB,OAAwB;AACxE,KAAI,CAAC,UAAU,CAAC,MACd,QAAO;CAGT,MAAM,WAAW,MAAM,eAAe;AAEtC,KAAI,OAAO,SAAS,MAAM,CACxB,QAAO;AAGT,KAAI,YAAY,aAAa,SAAS,EAAE;EACtC,IAAI,OAAuB;AAC3B,SAAO,MAAM;AACX,OAAI,WAAW,KACb,QAAO;AAGT,UAAQ,KAAK,cAAmC,KAA+B,QAAQ;;;AAI3F,QAAO;;AAGT,SAAgB,UAAU,OAAc;AACtC,KAAI,kBAAkB,SAAS,OAAO,MAAM,iBAAiB,WAC3D,QAAO,MAAM,cAAc,CAAC;AAG9B,QAAQ,MAAgB;;;;;ACxC1B,SAAgB,cAAc,MAAuC;AACnE,QAAO,MAAM,kBAAkB,OAAO,aAAa,cAAc,WAAW;;;;;ACH9E,SAAgB,MACd,OACA,MAAc,OAAO,kBACrB,MAAc,OAAO,kBACb;AACR,QAAO,KAAK,IAAI,KA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,sBAAgB,QAAQ,MAAM,QAAQ,OAAO,MAAM,GAAG,OAAO,QAAQ,CAAC,OAAO,MAAK;AAElF,UAAI,OAAO,QACT,YAAW,OAAO,WAAU;;;AAKlC,QAAI,MAAM,aAAa,OAAO,QAAQ,sBAAsB,WAC1D,SAAQ,kBAAkB,MAAM,UAAS;AAG3C,iBAAa,QAAQ;IACrB,MAAM,MAAM,cAAc,QAAO;AACjC,QAAI,CAAC,IACH;AAEF,QAAI,iBAAiB,eAAe,iBAAiB,EAAE,SAAS,MAAM,CAAA;AACtE,QAAI,iBAAiB,aAAa,gBAAgB,EAAE,MAAM,MAAM,CAAA;;GAEnE,CACF,CAAA;EAED,MAAM,EAAE,KAAK,aAAa,YAAY,KAAK,cAAc,iBAAiB;GACxE,gBAAgB;GAChB,OAAO,YAAY;GACnB,OAAO;GACP,gBAAgB;GAChB,KAAK;GACL,wBAAwB;GACzB,CAAA;;UAIa,MAAA,WAAU,GAAtB,WAA2F,KAAA,QAAA,WAAA;;IAAlE,KAAK,MAAA,UAAS;IAAG,OAAO,MAAA,YAAW;IAAG,OAAO,MAAA,YAAW,CAAC;sBAClF,YAEY,wBAFI,MAAA,IAAG,CAAA,EAAnB,WAEY;;IAFiB,KAAK,MAAA,UAAS;MAAU,MAAA,YAAW,CAAA,EAAA;2BACtD,CAAR,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/slider/control/SliderControlDataAttributes.ts
|
|
3
|
+
let SliderControlDataAttributes = /* @__PURE__ */ function(SliderControlDataAttributes) {
|
|
4
|
+
/**
|
|
5
|
+
* Present while the user is dragging.
|
|
6
|
+
*/
|
|
7
|
+
SliderControlDataAttributes["dragging"] = "data-dragging";
|
|
8
|
+
/**
|
|
9
|
+
* Indicates the orientation of the slider.
|
|
10
|
+
* @type {'horizontal' | 'vertical'}
|
|
11
|
+
*/
|
|
12
|
+
SliderControlDataAttributes["orientation"] = "data-orientation";
|
|
13
|
+
/**
|
|
14
|
+
* Present when the slider is disabled.
|
|
15
|
+
*/
|
|
16
|
+
SliderControlDataAttributes["disabled"] = "data-disabled";
|
|
17
|
+
/**
|
|
18
|
+
* Present when the slider is in valid state (when wrapped in Field.Root).
|
|
19
|
+
*/
|
|
20
|
+
SliderControlDataAttributes["valid"] = "data-valid";
|
|
21
|
+
/**
|
|
22
|
+
* Present when the slider is in invalid state (when wrapped in Field.Root).
|
|
23
|
+
*/
|
|
24
|
+
SliderControlDataAttributes["invalid"] = "data-invalid";
|
|
25
|
+
/**
|
|
26
|
+
* Present when the slider has been touched (when wrapped in Field.Root).
|
|
27
|
+
*/
|
|
28
|
+
SliderControlDataAttributes["touched"] = "data-touched";
|
|
29
|
+
/**
|
|
30
|
+
* Present when the slider's value has changed (when wrapped in Field.Root).
|
|
31
|
+
*/
|
|
32
|
+
SliderControlDataAttributes["dirty"] = "data-dirty";
|
|
33
|
+
/**
|
|
34
|
+
* Present when the slider is focused (when wrapped in Field.Root).
|
|
35
|
+
*/
|
|
36
|
+
SliderControlDataAttributes["focused"] = "data-focused";
|
|
37
|
+
return SliderControlDataAttributes;
|
|
38
|
+
}({});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
Object.defineProperty(exports, 'SliderControlDataAttributes', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return SliderControlDataAttributes;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=SliderControlDataAttributes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderControlDataAttributes.cjs","names":[],"sources":["../../src/slider/control/SliderControlDataAttributes.ts"],"sourcesContent":[],"mappings":";;AAAA,IAAY,oFAAL;;;;AAIL;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/slider/control/SliderControlDataAttributes.ts
|
|
2
|
+
let SliderControlDataAttributes = /* @__PURE__ */ function(SliderControlDataAttributes) {
|
|
3
|
+
/**
|
|
4
|
+
* Present while the user is dragging.
|
|
5
|
+
*/
|
|
6
|
+
SliderControlDataAttributes["dragging"] = "data-dragging";
|
|
7
|
+
/**
|
|
8
|
+
* Indicates the orientation of the slider.
|
|
9
|
+
* @type {'horizontal' | 'vertical'}
|
|
10
|
+
*/
|
|
11
|
+
SliderControlDataAttributes["orientation"] = "data-orientation";
|
|
12
|
+
/**
|
|
13
|
+
* Present when the slider is disabled.
|
|
14
|
+
*/
|
|
15
|
+
SliderControlDataAttributes["disabled"] = "data-disabled";
|
|
16
|
+
/**
|
|
17
|
+
* Present when the slider is in valid state (when wrapped in Field.Root).
|
|
18
|
+
*/
|
|
19
|
+
SliderControlDataAttributes["valid"] = "data-valid";
|
|
20
|
+
/**
|
|
21
|
+
* Present when the slider is in invalid state (when wrapped in Field.Root).
|
|
22
|
+
*/
|
|
23
|
+
SliderControlDataAttributes["invalid"] = "data-invalid";
|
|
24
|
+
/**
|
|
25
|
+
* Present when the slider has been touched (when wrapped in Field.Root).
|
|
26
|
+
*/
|
|
27
|
+
SliderControlDataAttributes["touched"] = "data-touched";
|
|
28
|
+
/**
|
|
29
|
+
* Present when the slider's value has changed (when wrapped in Field.Root).
|
|
30
|
+
*/
|
|
31
|
+
SliderControlDataAttributes["dirty"] = "data-dirty";
|
|
32
|
+
/**
|
|
33
|
+
* Present when the slider is focused (when wrapped in Field.Root).
|
|
34
|
+
*/
|
|
35
|
+
SliderControlDataAttributes["focused"] = "data-focused";
|
|
36
|
+
return SliderControlDataAttributes;
|
|
37
|
+
}({});
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { SliderControlDataAttributes };
|
|
41
|
+
//# sourceMappingURL=SliderControlDataAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderControlDataAttributes.js","names":[],"sources":["../../src/slider/control/SliderControlDataAttributes.ts"],"sourcesContent":[],"mappings":";AAAA,IAAY,oFAAL;;;;AAIL;;;;;AAKA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA"}
|