ropav 0.0.11 → 0.0.13
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 +3 -0
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +33 -14
- package/dist/color-input.css +19 -19
- package/dist/color-input.js +35 -17
- package/dist/components/checkbox/types.d.ts +5 -1
- package/dist/components/checkbox/useCheckbox.d.ts +1 -1
- package/dist/components/color-input/types.d.ts +4 -1
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/color-input/useColorInputValue.d.ts +1 -1
- package/dist/components/dialog/dialog-close.d.ts +21 -0
- package/dist/components/dialog/dialog-content.d.ts +32 -0
- package/dist/components/dialog/dialog-core.d.ts +27 -0
- package/dist/components/dialog/dialog-description.d.ts +21 -0
- package/dist/components/dialog/dialog-overlay.d.ts +21 -0
- package/dist/components/dialog/dialog-portal.d.ts +21 -0
- package/dist/components/dialog/dialog-root.d.ts +28 -0
- package/dist/components/dialog/dialog-title.d.ts +21 -0
- package/dist/components/dialog/dialog-trigger.d.ts +23 -0
- package/dist/components/dialog/index.d.ts +9 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/types.d.ts +61 -0
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +34 -0
- package/dist/components/dropdown-menu/dropdown-menu-context-trigger.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-item-indicator.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +24 -22
- package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +21 -0
- package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +3 -0
- package/dist/components/dropdown-menu/dropdown-menu-portal.d.ts +21 -0
- package/dist/components/dropdown-menu/dropdown-menu-primitive-core.d.ts +110 -0
- package/dist/components/dropdown-menu/dropdown-menu-primitives.d.ts +15 -724
- package/dist/components/dropdown-menu/dropdown-menu-radio-group.d.ts +25 -0
- package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +30 -0
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +19 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +34 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +5 -2
- package/dist/components/dropdown-menu/index.d.ts +28 -49
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/dropdown-menu/types.d.ts +8 -3
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +8 -4
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +7 -2
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +27 -0
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +2 -0
- package/dist/components/floating/index.d.ts +3 -1
- package/dist/components/floating/index.js +3 -0
- package/dist/components/floating/types.d.ts +86 -1
- package/dist/components/floating/useFloatingPosition.d.ts +3 -26
- package/dist/components/floating/useHoverDisclosure.d.ts +2 -0
- package/dist/components/input/input.d.ts +4 -1
- package/dist/components/input/types.d.ts +3 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/modal/types.d.ts +3 -0
- package/dist/components/modal/useModal.d.ts +7 -4
- package/dist/components/number-input/types.d.ts +3 -1
- package/dist/components/number-input/useNumberInput.d.ts +2 -1
- package/dist/components/popover/usePopover.d.ts +2 -2
- package/dist/components/radio/types.d.ts +17 -1
- package/dist/components/radio/useRadio.d.ts +3 -0
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/types.d.ts +6 -1
- package/dist/components/select/useSelect.d.ts +3 -2
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/slider/range-slider.d.ts +3 -3
- package/dist/components/slider/types.d.ts +11 -3
- package/dist/components/slider/useRangeSlider.d.ts +1 -1
- package/dist/components/slider/useSlider.d.ts +1 -1
- package/dist/components/switch/types.d.ts +5 -1
- package/dist/components/switch/useSwitch.d.ts +1 -1
- package/dist/components/teleport-provider/index.d.ts +1 -0
- package/dist/components/teleport-provider/index.js +2 -1
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +4 -3
- package/dist/components/textarea/types.d.ts +4 -1
- package/dist/components/textarea/useTextarea.d.ts +1 -1
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-store.d.ts +2 -0
- package/dist/components/toast/types.d.ts +10 -4
- package/dist/components/toast/useToast.d.ts +2 -2
- package/dist/components/tooltip/useTooltip.d.ts +3 -3
- package/dist/composables/useOverlayLayer.d.ts +32 -0
- package/dist/dialog.js +510 -0
- package/dist/dropdown-menu.css +4 -5
- package/dist/dropdown-menu.js +1155 -886
- package/dist/floating.js +403 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -4
- package/dist/input.css +24 -24
- package/dist/input.js +21 -11
- package/dist/legacy-unlayered.css +424 -503
- package/dist/modal.css +28 -28
- package/dist/modal.js +141 -200
- package/dist/number-input.css +20 -20
- package/dist/number-input.js +44 -16
- package/dist/popover.css +4 -4
- package/dist/popover.js +29 -40
- package/dist/radio.css +18 -18
- package/dist/radio.js +96 -18
- package/dist/select.css +54 -43
- package/dist/select.js +185 -67
- package/dist/slider.css +183 -202
- package/dist/slider.js +138 -37
- package/dist/switch.css +17 -17
- package/dist/switch.js +31 -13
- package/dist/textarea.css +26 -26
- package/dist/textarea.js +19 -9
- package/dist/toast.js +110 -99
- package/dist/tooltip.css +5 -80
- package/dist/tooltip.js +11 -3
- package/dist/useControlState.js +4 -0
- package/dist/useFloatingPosition.js +86 -39
- package/dist/useFormControl.js +107 -0
- package/dist/useOverlayLayer.js +262 -0
- package/dist/useTeleportTarget.js +21 -10
- package/docs/public-floating-api.md +159 -0
- package/docs/public-styles-api.md +2 -1
- package/package.json +10 -6
- package/dist/useClickOutside.js +0 -24
package/dist/slider.js
CHANGED
|
@@ -3,9 +3,10 @@ import { t as bem } from "./bem.js";
|
|
|
3
3
|
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
4
4
|
import { n as getComponentColorValue, t as componentColors } from "./componentColors.js";
|
|
5
5
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
6
|
+
import { i as useFormControl, o as useControllableValue } from "./useFormControl.js";
|
|
6
7
|
import { t as useControlState } from "./useControlState.js";
|
|
7
8
|
import { i as useDelayedOpen, n as resolveTooltipColorStyleWithContrast, r as resolveTooltipOffsetStyle, t as tooltip_default } from "./tooltip.js";
|
|
8
|
-
import { applyVShow, child, computed, createComponent, createFor, createIf, createInvoker, createSlot, createTemplateRefSetter, defineVaporComponent, delegateEvents, next, on, onBeforeUnmount, onMounted, ref, renderEffect, setClass, setDynamicProps, setInsertionState, setProp, setStyle, setText, template, toDisplayString, toRef, txt, unref, useId, useSlots, watch } from "vue";
|
|
9
|
+
import { applyVShow, child, computed, createComponent, createFor, createIf, createInvoker, createSlot, createTemplateRefSetter, defineVaporComponent, delegateEvents, next, nextTick, on, onBeforeUnmount, onMounted, ref, renderEffect, setClass, setDynamicProps, setInsertionState, setProp, setStyle, setText, template, toDisplayString, toRef, txt, unref, useId, useSlots, watch } from "vue";
|
|
9
10
|
//#region src/components/slider/sliderCore.ts
|
|
10
11
|
function normalizeSliderBounds(min, max) {
|
|
11
12
|
const safeMin = Number.isFinite(min) ? min : 0;
|
|
@@ -112,11 +113,11 @@ function getSliderTrackStyle(props, valuePercent) {
|
|
|
112
113
|
});
|
|
113
114
|
return style;
|
|
114
115
|
}
|
|
115
|
-
function useSlider(props, emitUpdate) {
|
|
116
|
+
function useSlider(props, emitUpdate, getValue = () => props.modelValue ?? props.min) {
|
|
116
117
|
const control = useControlState(props);
|
|
117
118
|
const bounds = computed(() => normalizeSliderBounds(props.min, props.max));
|
|
118
119
|
const nativeStep = computed(() => normalizeSliderStep(props.step));
|
|
119
|
-
const normalizedValue = computed(() => normalizeSliderValue(
|
|
120
|
+
const normalizedValue = computed(() => normalizeSliderValue(getValue(), bounds.value.min, bounds.value.max, nativeStep.value));
|
|
120
121
|
const valuePercent = computed(() => getSliderValuePercent(normalizedValue.value, bounds.value.min, bounds.value.max));
|
|
121
122
|
const formattedValue = computed(() => getFormattedSliderValue(normalizedValue.value, props.formatValue));
|
|
122
123
|
const ariaValueText = computed(() => getSliderAriaValueText(normalizedValue.value, props.ariaValueText, props.formatValue));
|
|
@@ -158,7 +159,8 @@ function useSlider(props, emitUpdate) {
|
|
|
158
159
|
marked: markItems.value.length > 0,
|
|
159
160
|
"marks-with-labels": hasMarkLabels.value,
|
|
160
161
|
"tooltip-always-visible": tooltipAlwaysVisible.value,
|
|
161
|
-
disabled: control.disabled
|
|
162
|
+
disabled: control.disabled,
|
|
163
|
+
invalid: control.invalid
|
|
162
164
|
}));
|
|
163
165
|
const trackStyle = computed(() => getSliderTrackStyle(props, valuePercent.value));
|
|
164
166
|
function onInput(e) {
|
|
@@ -256,14 +258,14 @@ function useSlider(props, emitUpdate) {
|
|
|
256
258
|
}
|
|
257
259
|
//#endregion
|
|
258
260
|
//#region src/components/slider/slider.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
259
|
-
var t0$2 = template("<span data-v-
|
|
260
|
-
var t1$2 = template("<span data-v-
|
|
261
|
-
var t2$2 = template("<span data-v-
|
|
262
|
-
var t3$2 = template("<span data-v-
|
|
263
|
-
var t4$2 = template("<span data-v-
|
|
264
|
-
var t5$1 = template("<span data-v-
|
|
265
|
-
var t6$1 = template("<span data-v-
|
|
266
|
-
var t7$1 = template("<label data-v-
|
|
261
|
+
var t0$2 = template("<span data-v-a837ba72>");
|
|
262
|
+
var t1$2 = template("<span data-v-a837ba72 class=rp-slider__header>");
|
|
263
|
+
var t2$2 = template("<span data-v-a837ba72> ");
|
|
264
|
+
var t3$2 = template("<span data-v-a837ba72><span data-v-a837ba72 class=rp-slider__mark-dot></span>");
|
|
265
|
+
var t4$2 = template("<span data-v-a837ba72 class=rp-slider__marks aria-hidden=true>");
|
|
266
|
+
var t5$1 = template("<span data-v-a837ba72><span data-v-a837ba72 class=rp-slider__thumb-content>");
|
|
267
|
+
var t6$1 = template("<span data-v-a837ba72 class=rp-slider__tooltip-anchor aria-hidden=true>", 2);
|
|
268
|
+
var t7$1 = template("<label data-v-a837ba72><span data-v-a837ba72><span data-v-a837ba72></span><input data-v-a837ba72>", 1);
|
|
267
269
|
delegateEvents("pointerdown", "focusin", "focusout", "keydown");
|
|
268
270
|
//#endregion
|
|
269
271
|
//#region src/components/slider/slider.vue
|
|
@@ -274,7 +276,9 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
274
276
|
props: {
|
|
275
277
|
id: {},
|
|
276
278
|
name: {},
|
|
277
|
-
|
|
279
|
+
form: {},
|
|
280
|
+
modelValue: { default: void 0 },
|
|
281
|
+
defaultValue: { default: void 0 },
|
|
278
282
|
min: { default: 0 },
|
|
279
283
|
max: { default: 100 },
|
|
280
284
|
step: { default: 1 },
|
|
@@ -296,11 +300,20 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
296
300
|
type: Boolean,
|
|
297
301
|
default: void 0
|
|
298
302
|
},
|
|
303
|
+
required: {
|
|
304
|
+
type: Boolean,
|
|
305
|
+
default: void 0
|
|
306
|
+
},
|
|
307
|
+
invalid: {
|
|
308
|
+
type: Boolean,
|
|
309
|
+
default: void 0
|
|
310
|
+
},
|
|
299
311
|
ariaLabel: {},
|
|
300
312
|
ariaValueText: {},
|
|
301
313
|
describedby: {},
|
|
302
314
|
labelledby: {},
|
|
303
315
|
inputAttrs: {},
|
|
316
|
+
validationMessage: {},
|
|
304
317
|
classNames: {},
|
|
305
318
|
styles: {}
|
|
306
319
|
},
|
|
@@ -310,17 +323,38 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
310
323
|
const emit = __emit;
|
|
311
324
|
const inputRef = ref(null);
|
|
312
325
|
const slots = useSlots();
|
|
313
|
-
const
|
|
314
|
-
|
|
326
|
+
const controllable = useControllableValue({
|
|
327
|
+
modelValue: () => props.modelValue,
|
|
328
|
+
defaultValue: () => props.defaultValue ?? props.min,
|
|
329
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
330
|
+
});
|
|
331
|
+
const { control, nativeMin, nativeMax, nativeStep, rootClass, normalizedValue, valuePercent, formattedValue, ariaValueText, markItems, trackStyle, tooltipVisible, tooltipOpen, tooltipPlacement, tooltipId, tooltipColor, tooltipOffset, tooltipOpenDelay, tooltipArrow, tooltipContent, onInput, onTooltipPointerDown, onTooltipMouseEnter, onTooltipMouseLeave, onTooltipFocusIn, onTooltipFocusOut, onTooltipKeydown } = useSlider(props, (value) => controllable.setValue(value), () => controllable.value.value);
|
|
332
|
+
useFormControl({
|
|
333
|
+
elements: () => [inputRef.value],
|
|
334
|
+
isControlled: () => controllable.isControlled.value,
|
|
335
|
+
initializeDefault(element) {
|
|
336
|
+
element.defaultValue = String(normalizeSliderValue(controllable.initialValue, nativeMin.value, nativeMax.value, nativeStep.value));
|
|
337
|
+
},
|
|
338
|
+
validationMessage: () => props.validationMessage,
|
|
339
|
+
readResetValue(elements) {
|
|
340
|
+
controllable.resetValue(elements[0].valueAsNumber);
|
|
341
|
+
},
|
|
342
|
+
syncControlledValue(elements) {
|
|
343
|
+
elements[0].value = String(normalizedValue.value);
|
|
344
|
+
}
|
|
315
345
|
});
|
|
316
346
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
317
347
|
const rootAttrs = computed(() => getRootAttrs({
|
|
318
348
|
class: [rootClass.value, { "rp-slider--custom-thumb": Boolean(slots.thumb) }],
|
|
319
349
|
style: trackStyle.value,
|
|
320
350
|
"data-disabled": presence(control.disabled),
|
|
351
|
+
"data-invalid": presence(control.invalid),
|
|
321
352
|
"data-orientation": props.orientation
|
|
322
353
|
}));
|
|
323
|
-
const tooltipClassNames = computed(() => ({
|
|
354
|
+
const tooltipClassNames = computed(() => ({
|
|
355
|
+
root: ["rp-slider__tooltip", props.classNames?.tooltip],
|
|
356
|
+
content: "rp-slider__tooltip-content"
|
|
357
|
+
}));
|
|
324
358
|
const tooltipStyles = computed(() => ({ root: props.styles?.tooltip }));
|
|
325
359
|
const nativeInputAttrs = computed(() => {
|
|
326
360
|
const { class: compatibilityClass, style: compatibilityStyle, onInput: compatibilityOnInput, ...attrs } = props.inputAttrs ?? {};
|
|
@@ -378,12 +412,16 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
378
412
|
_setTemplateRef(n12, inputRef, null, "inputRef");
|
|
379
413
|
renderEffect(() => {
|
|
380
414
|
const _getPartAttrs = unref(getPartAttrs);
|
|
415
|
+
const _nativeInputAttrs = nativeInputAttrs.value;
|
|
381
416
|
const _control = unref(control);
|
|
417
|
+
const _props = props;
|
|
418
|
+
const _props_required_nativeInputAttrs_required = _props.required ?? _nativeInputAttrs.required;
|
|
382
419
|
setDynamicProps(n31, [_getPartAttrs("track", { class: "rp-slider__track" })]);
|
|
383
420
|
setDynamicProps(n11, [_getPartAttrs("range", { class: "rp-slider__bar" }), { "aria-hidden": "true" }]);
|
|
384
|
-
setDynamicProps(n12, [
|
|
421
|
+
setDynamicProps(n12, [_nativeInputAttrs, {
|
|
385
422
|
id: _control.id,
|
|
386
423
|
name: __props.name,
|
|
424
|
+
form: _control.form ?? _nativeInputAttrs.form,
|
|
387
425
|
type: "range",
|
|
388
426
|
value: unref(normalizedValue),
|
|
389
427
|
min: unref(nativeMin),
|
|
@@ -391,12 +429,16 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
391
429
|
step: unref(nativeStep),
|
|
392
430
|
orient: __props.orientation === "vertical" ? "vertical" : void 0,
|
|
393
431
|
disabled: _control.disabled || void 0,
|
|
432
|
+
required: _props_required_nativeInputAttrs_required,
|
|
394
433
|
"aria-label": __props.ariaLabel || void 0,
|
|
395
434
|
"aria-labelledby": _control.ariaLabelledby,
|
|
396
435
|
"aria-describedby": _control.ariaDescribedby,
|
|
397
436
|
"aria-orientation": __props.orientation === "vertical" ? "vertical" : void 0,
|
|
398
437
|
"aria-valuetext": unref(ariaValueText),
|
|
399
|
-
"
|
|
438
|
+
"aria-invalid": _props.invalid === void 0 ? _nativeInputAttrs["aria-invalid"] : _control.invalid || void 0,
|
|
439
|
+
"aria-required": _props_required_nativeInputAttrs_required,
|
|
440
|
+
"data-disabled": unref(presence)(_control.disabled),
|
|
441
|
+
"data-invalid": unref(presence)(_control.invalid)
|
|
400
442
|
}]);
|
|
401
443
|
});
|
|
402
444
|
setInsertionState(n31, null, 2);
|
|
@@ -465,7 +507,7 @@ var slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
465
507
|
n31.$evtkeydown = createInvoker((e) => unref(onTooltipKeydown)(e));
|
|
466
508
|
return n32;
|
|
467
509
|
}
|
|
468
|
-
}), [["__scopeId", "data-v-
|
|
510
|
+
}), [["__scopeId", "data-v-a837ba72"]]);
|
|
469
511
|
//#endregion
|
|
470
512
|
//#region src/components/slider/useRangeSliderTooltipCollision.ts
|
|
471
513
|
var TOOLTIP_COLLISION_GAP = 4;
|
|
@@ -1151,7 +1193,7 @@ function getThumbInput(track, thumb) {
|
|
|
1151
1193
|
function focusThumb(track, thumb) {
|
|
1152
1194
|
getThumbInput(track, thumb)?.focus({ preventScroll: true });
|
|
1153
1195
|
}
|
|
1154
|
-
function useRangeSlider(props, emitUpdate) {
|
|
1196
|
+
function useRangeSlider(props, emitUpdate, getValue = () => props.modelValue ?? [props.min, props.max]) {
|
|
1155
1197
|
const control = useControlState(props);
|
|
1156
1198
|
const activeThumb = ref();
|
|
1157
1199
|
const bounds = computed(() => normalizeSliderBounds(props.min, props.max));
|
|
@@ -1163,7 +1205,7 @@ function useRangeSlider(props, emitUpdate) {
|
|
|
1163
1205
|
});
|
|
1164
1206
|
const hasManualNativeKeyboard = computed(() => valueStep.value !== "any" && nativeStep.value === "any");
|
|
1165
1207
|
const normalizedMinRange = computed(() => normalizeRangeSliderMinRange(props.minRange, bounds.value.min, bounds.value.max));
|
|
1166
|
-
const normalizedValue = computed(() => normalizeRangeSliderValue(
|
|
1208
|
+
const normalizedValue = computed(() => normalizeRangeSliderValue(getValue(), bounds.value.min, bounds.value.max, valueStep.value, normalizedMinRange.value));
|
|
1167
1209
|
const valuePercent = computed(() => [getSliderValuePercent(normalizedValue.value[0], bounds.value.min, bounds.value.max), getSliderValuePercent(normalizedValue.value[1], bounds.value.min, bounds.value.max)]);
|
|
1168
1210
|
const formattedValue = computed(() => getFormattedRangeSliderValue(normalizedValue.value, props.formatValue));
|
|
1169
1211
|
const ariaLabels = computed(() => props.ariaLabel ?? ["Minimum", "Maximum"]);
|
|
@@ -1226,7 +1268,8 @@ function useRangeSlider(props, emitUpdate) {
|
|
|
1226
1268
|
marked: markItems.value.length > 0,
|
|
1227
1269
|
"marks-with-labels": hasMarkLabels.value,
|
|
1228
1270
|
"tooltip-always-visible": tooltipAlwaysVisible.value,
|
|
1229
|
-
disabled: control.disabled
|
|
1271
|
+
disabled: control.disabled,
|
|
1272
|
+
invalid: control.invalid
|
|
1230
1273
|
}));
|
|
1231
1274
|
function getThumbUpdate(thumb, value, anchorValue = normalizedValue.value[getThumbIndex(getOppositeThumb(thumb))]) {
|
|
1232
1275
|
const safeValue = normalizeSliderValue(value, bounds.value.min, bounds.value.max, valueStep.value);
|
|
@@ -1379,14 +1422,14 @@ function useRangeSlider(props, emitUpdate) {
|
|
|
1379
1422
|
}
|
|
1380
1423
|
//#endregion
|
|
1381
1424
|
//#region src/components/slider/range-slider.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
1382
|
-
var t0 = template("<span data-v-
|
|
1383
|
-
var t1 = template("<span data-v-
|
|
1384
|
-
var t2 = template("<input data-v-
|
|
1385
|
-
var t3 = template("<span data-v-
|
|
1386
|
-
var t4 = template("<span data-v-
|
|
1387
|
-
var t5 = template("<span data-v-
|
|
1388
|
-
var t6 = template("<span data-v-
|
|
1389
|
-
var t7 = template("<div data-v-
|
|
1425
|
+
var t0 = template("<span data-v-b0e2c3da>");
|
|
1426
|
+
var t1 = template("<span data-v-b0e2c3da class=rp-range-slider__header>");
|
|
1427
|
+
var t2 = template("<input data-v-b0e2c3da>");
|
|
1428
|
+
var t3 = template("<span data-v-b0e2c3da> ");
|
|
1429
|
+
var t4 = template("<span data-v-b0e2c3da><span data-v-b0e2c3da class=rp-range-slider__mark-dot></span>");
|
|
1430
|
+
var t5 = template("<span data-v-b0e2c3da class=rp-range-slider__marks aria-hidden=true>");
|
|
1431
|
+
var t6 = template("<span data-v-b0e2c3da><span data-v-b0e2c3da class=rp-range-slider__thumb-content>");
|
|
1432
|
+
var t7 = template("<div data-v-b0e2c3da><span data-v-b0e2c3da><span data-v-b0e2c3da></span><!><span data-v-b0e2c3da class=rp-range-slider__thumbs aria-hidden=true>", 1);
|
|
1390
1433
|
delegateEvents("pointerdown");
|
|
1391
1434
|
//#endregion
|
|
1392
1435
|
//#region src/components/slider/range-slider.vue
|
|
@@ -1395,13 +1438,16 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1395
1438
|
inheritAttrs: false,
|
|
1396
1439
|
__name: "range-slider",
|
|
1397
1440
|
props: {
|
|
1398
|
-
modelValue: {},
|
|
1441
|
+
modelValue: { default: void 0 },
|
|
1442
|
+
defaultValue: { default: void 0 },
|
|
1399
1443
|
minRange: { default: 0 },
|
|
1400
1444
|
name: {},
|
|
1401
1445
|
ariaLabel: { default: () => ["Minimum", "Maximum"] },
|
|
1402
1446
|
ariaValueText: {},
|
|
1403
1447
|
inputAttrs: {},
|
|
1448
|
+
validationMessage: {},
|
|
1404
1449
|
id: {},
|
|
1450
|
+
form: {},
|
|
1405
1451
|
min: { default: 0 },
|
|
1406
1452
|
max: { default: 100 },
|
|
1407
1453
|
step: { default: 1 },
|
|
@@ -1423,6 +1469,14 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1423
1469
|
type: Boolean,
|
|
1424
1470
|
default: void 0
|
|
1425
1471
|
},
|
|
1472
|
+
required: {
|
|
1473
|
+
type: Boolean,
|
|
1474
|
+
default: void 0
|
|
1475
|
+
},
|
|
1476
|
+
invalid: {
|
|
1477
|
+
type: Boolean,
|
|
1478
|
+
default: void 0
|
|
1479
|
+
},
|
|
1426
1480
|
describedby: {},
|
|
1427
1481
|
labelledby: {},
|
|
1428
1482
|
classNames: {},
|
|
@@ -1439,8 +1493,43 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1439
1493
|
const lowerInputRef = ref(null);
|
|
1440
1494
|
const upperInputRef = ref(null);
|
|
1441
1495
|
const labelId = computed(() => `${props.id ?? generatedId}-label`);
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1496
|
+
const controllable = useControllableValue({
|
|
1497
|
+
modelValue: () => props.modelValue,
|
|
1498
|
+
defaultValue: () => props.defaultValue ?? [props.min, props.max],
|
|
1499
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
1500
|
+
});
|
|
1501
|
+
const { control, nativeMin, nativeMax, nativeStep, nativeNames, nativeIds, rootClass, normalizedValue, valuePercent, formattedValue, ariaLabels, ariaValueText, markItems, trackStyle, activeThumb, tooltipVisible, tooltipOpen, tooltipPlacement, tooltipIds, mergedTooltipId, tooltipColor, tooltipOffset, tooltipArrow, tooltipContent, mergedTooltipContent, onInput, onTrackPointerDown, onTooltipFocus, onTooltipBlur, onTooltipTrackMouseEnter, onTooltipTrackMouseLeave, onTooltipKeydown } = useRangeSlider(props, (value) => controllable.setValue(value), () => controllable.value.value);
|
|
1502
|
+
const validationMessages = computed(() => Array.isArray(props.validationMessage) ? props.validationMessage : [props.validationMessage, props.validationMessage]);
|
|
1503
|
+
function normalizeInitialValue(value = controllable.initialValue) {
|
|
1504
|
+
return normalizeRangeSliderValue(value, props.min, props.max, props.step, props.minRange);
|
|
1505
|
+
}
|
|
1506
|
+
useFormControl({
|
|
1507
|
+
elements: () => [lowerInputRef.value, upperInputRef.value],
|
|
1508
|
+
isControlled: () => controllable.isControlled.value,
|
|
1509
|
+
initializeDefault(element, index) {
|
|
1510
|
+
const initialValue = normalizeInitialValue();
|
|
1511
|
+
element.defaultValue = String(initialValue[index]);
|
|
1512
|
+
},
|
|
1513
|
+
validationMessage: (_element, index) => validationMessages.value[index],
|
|
1514
|
+
readResetValue(elements) {
|
|
1515
|
+
const resetValue = [normalizedValue.value[0], normalizedValue.value[1]];
|
|
1516
|
+
for (const element of elements) {
|
|
1517
|
+
const index = element === upperInputRef.value ? 1 : 0;
|
|
1518
|
+
resetValue[index] = Number(element.defaultValue);
|
|
1519
|
+
}
|
|
1520
|
+
const nextValue = normalizeInitialValue(resetValue);
|
|
1521
|
+
controllable.resetValue(nextValue);
|
|
1522
|
+
nextTick(() => {
|
|
1523
|
+
if (lowerInputRef.value) lowerInputRef.value.value = String(nextValue[0]);
|
|
1524
|
+
if (upperInputRef.value) upperInputRef.value.value = String(nextValue[1]);
|
|
1525
|
+
});
|
|
1526
|
+
},
|
|
1527
|
+
syncControlledValue(elements) {
|
|
1528
|
+
for (const element of elements) {
|
|
1529
|
+
const index = element === upperInputRef.value ? 1 : 0;
|
|
1530
|
+
element.value = String(normalizedValue.value[index]);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1444
1533
|
});
|
|
1445
1534
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
1446
1535
|
const rootAttrs = computed(() => getRootAttrs({
|
|
@@ -1452,9 +1541,12 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1452
1541
|
role: "group",
|
|
1453
1542
|
"data-active-thumb": activeThumb.value || void 0,
|
|
1454
1543
|
"data-disabled": presence(control.disabled),
|
|
1544
|
+
"data-invalid": presence(control.invalid),
|
|
1455
1545
|
"data-orientation": props.orientation,
|
|
1456
1546
|
"aria-labelledby": groupLabelledby.value,
|
|
1457
|
-
"aria-describedby": control.ariaDescribedby
|
|
1547
|
+
"aria-describedby": control.ariaDescribedby,
|
|
1548
|
+
"aria-invalid": control.invalid || void 0,
|
|
1549
|
+
"aria-required": control.required || void 0
|
|
1458
1550
|
}));
|
|
1459
1551
|
const inputAttrsByThumb = computed(() => {
|
|
1460
1552
|
if (Array.isArray(props.inputAttrs)) return props.inputAttrs;
|
|
@@ -1544,11 +1636,16 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1544
1636
|
createFor(() => rangeSliderThumbs, (_for_item0, _for_key0) => {
|
|
1545
1637
|
const n14 = t2();
|
|
1546
1638
|
renderEffect(() => {
|
|
1639
|
+
const _nativeInputAttrs = nativeInputAttrs.value;
|
|
1547
1640
|
const _index = _for_key0.value;
|
|
1548
1641
|
const _control = unref(control);
|
|
1549
|
-
|
|
1642
|
+
const _props = props;
|
|
1643
|
+
const _nativeInputAttrs_index = _nativeInputAttrs[_index];
|
|
1644
|
+
const _props_required_nativeInputAttrs_index_required = _props.required ?? _nativeInputAttrs_index?.required;
|
|
1645
|
+
setDynamicProps(n14, [_nativeInputAttrs_index, {
|
|
1550
1646
|
id: unref(nativeIds)[_index],
|
|
1551
1647
|
name: unref(nativeNames)[_index],
|
|
1648
|
+
form: _control.form ?? _nativeInputAttrs_index?.form,
|
|
1552
1649
|
type: "range",
|
|
1553
1650
|
value: unref(normalizedValue)[_index],
|
|
1554
1651
|
min: unref(nativeMin)[_index],
|
|
@@ -1556,12 +1653,16 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1556
1653
|
step: unref(nativeStep),
|
|
1557
1654
|
orient: __props.orientation === "vertical" ? "vertical" : void 0,
|
|
1558
1655
|
disabled: _control.disabled || void 0,
|
|
1656
|
+
required: _props_required_nativeInputAttrs_index_required,
|
|
1559
1657
|
"aria-label": unref(ariaLabels)[_index],
|
|
1560
1658
|
"aria-describedby": _control.ariaDescribedby,
|
|
1561
1659
|
"aria-orientation": __props.orientation === "vertical" ? "vertical" : void 0,
|
|
1562
1660
|
"aria-valuetext": unref(ariaValueText)[_index],
|
|
1661
|
+
"aria-invalid": _props.invalid === void 0 ? _nativeInputAttrs_index?.["aria-invalid"] : _control.invalid || void 0,
|
|
1662
|
+
"aria-required": _props_required_nativeInputAttrs_index_required,
|
|
1563
1663
|
"data-thumb": _for_item0.value,
|
|
1564
|
-
"data-disabled": unref(presence)(_control.disabled)
|
|
1664
|
+
"data-disabled": unref(presence)(_control.disabled),
|
|
1665
|
+
"data-invalid": unref(presence)(_control.invalid)
|
|
1565
1666
|
}]);
|
|
1566
1667
|
_setTemplateRef(n14, (element) => setInputRef(_index, element), true);
|
|
1567
1668
|
});
|
|
@@ -1640,7 +1741,7 @@ var range_slider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
1640
1741
|
on(n34, "mouseleave", (e) => unref(onTooltipTrackMouseLeave)(e));
|
|
1641
1742
|
return n35;
|
|
1642
1743
|
}
|
|
1643
|
-
}), [["__scopeId", "data-v-
|
|
1744
|
+
}), [["__scopeId", "data-v-b0e2c3da"]]);
|
|
1644
1745
|
//#endregion
|
|
1645
1746
|
//#region src/components/slider/types.ts
|
|
1646
1747
|
var sliderParts = [
|
package/dist/switch.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-switch[data-v-
|
|
2
|
+
.rp-switch[data-v-d966892e] {
|
|
3
3
|
--_rp-switch-color: var(--rp-color-control-selected-bg);
|
|
4
4
|
--_rp-switch-font-size: var(--rp-font-size-md);
|
|
5
5
|
--_rp-switch-default-track-width: 46px;
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
font-family: var(--rp-font-family);
|
|
27
27
|
user-select: none;
|
|
28
28
|
}
|
|
29
|
-
.rp-switch--disabled[data-v-
|
|
29
|
+
.rp-switch--disabled[data-v-d966892e] {
|
|
30
30
|
opacity: var(--rp-opacity-disabled);
|
|
31
31
|
cursor: not-allowed;
|
|
32
32
|
}
|
|
33
|
-
.rp-switch[data-v-
|
|
33
|
+
.rp-switch[data-v-d966892e] {
|
|
34
34
|
gap: var(--rp-spacing-2);
|
|
35
35
|
font-size: var(--_rp-switch-font-size);
|
|
36
36
|
}
|
|
37
|
-
.rp-switch__native[data-v-
|
|
37
|
+
.rp-switch__native[data-v-d966892e] {
|
|
38
38
|
position: absolute;
|
|
39
39
|
width: 1px;
|
|
40
40
|
height: 1px;
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
border-width: 0;
|
|
47
47
|
pointer-events: none;
|
|
48
48
|
}
|
|
49
|
-
.rp-switch__native:focus-visible + .rp-switch__track[data-v-
|
|
49
|
+
.rp-switch__native:focus-visible + .rp-switch__track[data-v-d966892e] {
|
|
50
50
|
border-color: var(--rp-color-control-border-focus);
|
|
51
51
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
|
|
52
52
|
}
|
|
53
|
-
.rp-switch__track[data-v-
|
|
53
|
+
.rp-switch__track[data-v-d966892e] {
|
|
54
54
|
position: relative;
|
|
55
55
|
display: inline-flex;
|
|
56
56
|
align-items: center;
|
|
@@ -61,17 +61,17 @@
|
|
|
61
61
|
border-radius: var(--rp-radius-full);
|
|
62
62
|
transition: background-color var(--rp-transition-fast);
|
|
63
63
|
}
|
|
64
|
-
.rp-switch--checked .rp-switch__track[data-v-
|
|
64
|
+
.rp-switch--checked .rp-switch__track[data-v-d966892e] {
|
|
65
65
|
background-color: var(--_rp-switch-color);
|
|
66
66
|
}
|
|
67
|
-
.rp-switch--invalid .rp-switch__track[data-v-
|
|
67
|
+
.rp-switch--invalid .rp-switch__track[data-v-d966892e] {
|
|
68
68
|
outline: var(--rp-border-width-thin) solid var(--_rp-switch-invalid-border);
|
|
69
69
|
outline-offset: var(--_rp-switch-thumb-offset);
|
|
70
70
|
}
|
|
71
|
-
.rp-switch--invalid .rp-switch__native:focus-visible + .rp-switch__track[data-v-
|
|
71
|
+
.rp-switch--invalid .rp-switch__native:focus-visible + .rp-switch__track[data-v-d966892e] {
|
|
72
72
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--_rp-switch-invalid-ring);
|
|
73
73
|
}
|
|
74
|
-
.rp-switch__thumb[data-v-
|
|
74
|
+
.rp-switch__thumb[data-v-d966892e] {
|
|
75
75
|
position: absolute;
|
|
76
76
|
left: var(--_rp-switch-thumb-offset);
|
|
77
77
|
width: var(--_rp-switch-thumb-size);
|
|
@@ -81,38 +81,38 @@
|
|
|
81
81
|
box-shadow: var(--rp-shadow-sm);
|
|
82
82
|
transition: transform var(--rp-transition-fast);
|
|
83
83
|
}
|
|
84
|
-
.rp-switch--checked .rp-switch__thumb[data-v-
|
|
84
|
+
.rp-switch--checked .rp-switch__thumb[data-v-d966892e] {
|
|
85
85
|
transform: translateX(calc(var(--_rp-switch-track-width) - var(--_rp-switch-thumb-size) - var(--_rp-switch-thumb-offset) * 2));
|
|
86
86
|
}
|
|
87
|
-
.rp-switch__label[data-v-
|
|
87
|
+
.rp-switch__label[data-v-d966892e] {
|
|
88
88
|
line-height: var(--rp-line-height-md);
|
|
89
89
|
color: var(--rp-color-text);
|
|
90
90
|
}
|
|
91
|
-
.rp-switch--size-xs[data-v-
|
|
91
|
+
.rp-switch--size-xs[data-v-d966892e] {
|
|
92
92
|
--_rp-switch-default-track-width: 32px;
|
|
93
93
|
--_rp-switch-default-track-height: 16px;
|
|
94
94
|
--_rp-switch-default-thumb-size: 12px;
|
|
95
95
|
--_rp-switch-font-size: var(--rp-font-size-xs);
|
|
96
96
|
}
|
|
97
|
-
.rp-switch--size-sm[data-v-
|
|
97
|
+
.rp-switch--size-sm[data-v-d966892e] {
|
|
98
98
|
--_rp-switch-default-track-width: 38px;
|
|
99
99
|
--_rp-switch-default-track-height: 20px;
|
|
100
100
|
--_rp-switch-default-thumb-size: 14px;
|
|
101
101
|
--_rp-switch-font-size: var(--rp-font-size-sm);
|
|
102
102
|
}
|
|
103
|
-
.rp-switch--size-md[data-v-
|
|
103
|
+
.rp-switch--size-md[data-v-d966892e] {
|
|
104
104
|
--_rp-switch-default-track-width: 46px;
|
|
105
105
|
--_rp-switch-default-track-height: 24px;
|
|
106
106
|
--_rp-switch-default-thumb-size: 18px;
|
|
107
107
|
--_rp-switch-font-size: var(--rp-font-size-md);
|
|
108
108
|
}
|
|
109
|
-
.rp-switch--size-lg[data-v-
|
|
109
|
+
.rp-switch--size-lg[data-v-d966892e] {
|
|
110
110
|
--_rp-switch-default-track-width: 56px;
|
|
111
111
|
--_rp-switch-default-track-height: 30px;
|
|
112
112
|
--_rp-switch-default-thumb-size: 22px;
|
|
113
113
|
--_rp-switch-font-size: var(--rp-font-size-lg);
|
|
114
114
|
}
|
|
115
|
-
.rp-switch--size-xl[data-v-
|
|
115
|
+
.rp-switch--size-xl[data-v-d966892e] {
|
|
116
116
|
--_rp-switch-default-track-width: 72px;
|
|
117
117
|
--_rp-switch-default-track-height: 36px;
|
|
118
118
|
--_rp-switch-default-thumb-size: 28px;
|
package/dist/switch.js
CHANGED
|
@@ -3,6 +3,7 @@ import { t as bem } from "./bem.js";
|
|
|
3
3
|
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
4
4
|
import { n as getComponentColorValue } from "./componentColors.js";
|
|
5
5
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
6
|
+
import { o as useControllableValue, r as useCheckedFormControl } from "./useFormControl.js";
|
|
6
7
|
import { t as useControlState } from "./useControlState.js";
|
|
7
8
|
import { child, computed, createIf, createSlot, defineVaporComponent, next, ref, renderEffect, setDynamicProps, setInsertionState, setStaticTemplateRef, template, unref } from "vue";
|
|
8
9
|
//#region src/components/switch/useSwitch.ts
|
|
@@ -11,11 +12,11 @@ function getSwitchColorStyle(color) {
|
|
|
11
12
|
if (!colorValue) return void 0;
|
|
12
13
|
return { "--_rp-switch-color": colorValue };
|
|
13
14
|
}
|
|
14
|
-
function useSwitch(props, emitUpdate) {
|
|
15
|
+
function useSwitch(props, emitUpdate, getValue = () => props.modelValue ?? false) {
|
|
15
16
|
const inputRef = ref(null);
|
|
16
17
|
const control = useControlState(props);
|
|
17
18
|
const rootClass = computed(() => bem("rp-switch", {
|
|
18
|
-
checked:
|
|
19
|
+
checked: getValue(),
|
|
19
20
|
disabled: control.disabled,
|
|
20
21
|
invalid: control.invalid,
|
|
21
22
|
[`size-${props.size}`]: Boolean(props.size)
|
|
@@ -38,8 +39,8 @@ function useSwitch(props, emitUpdate) {
|
|
|
38
39
|
}
|
|
39
40
|
//#endregion
|
|
40
41
|
//#region src/components/switch/switch.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
41
|
-
var t0 = template("<span data-v-
|
|
42
|
-
var t1 = template("<label data-v-
|
|
42
|
+
var t0 = template("<span data-v-d966892e>");
|
|
43
|
+
var t1 = template("<label data-v-d966892e><input data-v-d966892e><span data-v-d966892e><span data-v-d966892e></span></span>", 1);
|
|
43
44
|
//#endregion
|
|
44
45
|
//#region src/components/switch/switch.vue
|
|
45
46
|
var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -49,7 +50,16 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
49
50
|
props: {
|
|
50
51
|
id: {},
|
|
51
52
|
name: {},
|
|
52
|
-
|
|
53
|
+
form: {},
|
|
54
|
+
modelValue: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: void 0
|
|
57
|
+
},
|
|
58
|
+
defaultValue: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
value: { default: "on" },
|
|
53
63
|
color: {},
|
|
54
64
|
size: {},
|
|
55
65
|
disabled: {
|
|
@@ -68,6 +78,7 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
68
78
|
describedby: {},
|
|
69
79
|
labelledby: {},
|
|
70
80
|
inputAttrs: {},
|
|
81
|
+
validationMessage: {},
|
|
71
82
|
classNames: {},
|
|
72
83
|
styles: {}
|
|
73
84
|
},
|
|
@@ -75,16 +86,20 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
75
86
|
setup(__props, { expose: __expose, emit: __emit, slots: $slots }) {
|
|
76
87
|
const props = __props;
|
|
77
88
|
const emit = __emit;
|
|
78
|
-
const
|
|
79
|
-
|
|
89
|
+
const controllable = useControllableValue({
|
|
90
|
+
modelValue: () => props.modelValue,
|
|
91
|
+
defaultValue: () => props.defaultValue,
|
|
92
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
80
93
|
});
|
|
94
|
+
const { inputRef, control, rootClass, rootStyle, onChange, focus } = useSwitch(props, (value) => controllable.setValue(value), () => controllable.value.value);
|
|
95
|
+
useCheckedFormControl(() => inputRef.value, controllable, () => props.validationMessage);
|
|
81
96
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
82
97
|
const rootAttrs = computed(() => getRootAttrs({
|
|
83
98
|
class: rootClass.value,
|
|
84
99
|
style: rootStyle.value,
|
|
85
100
|
"data-disabled": presence(control.disabled),
|
|
86
101
|
"data-invalid": presence(control.invalid),
|
|
87
|
-
"data-state":
|
|
102
|
+
"data-state": controllable.value.value ? "checked" : "unchecked"
|
|
88
103
|
}));
|
|
89
104
|
const nativeInputAttrs = computed(() => {
|
|
90
105
|
const attrs = props.inputAttrs ?? {};
|
|
@@ -114,20 +129,23 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
114
129
|
const n1 = child(n2);
|
|
115
130
|
setStaticTemplateRef(n0, inputRef, null, "inputRef");
|
|
116
131
|
renderEffect(() => {
|
|
132
|
+
const _nativeInputAttrs = nativeInputAttrs.value;
|
|
117
133
|
const _control = unref(control);
|
|
118
|
-
const _modelValue = __props.modelValue;
|
|
119
134
|
const _getPartAttrs = unref(getPartAttrs);
|
|
120
135
|
const _control_required = _control.required;
|
|
136
|
+
const _controllable_value_value = unref(controllable).value.value;
|
|
121
137
|
setDynamicProps(n7, [rootAttrs.value]);
|
|
122
|
-
setDynamicProps(n0, [
|
|
138
|
+
setDynamicProps(n0, [_nativeInputAttrs, {
|
|
123
139
|
id: _control.id,
|
|
124
140
|
name: __props.name,
|
|
141
|
+
form: _control.form ?? _nativeInputAttrs.form,
|
|
125
142
|
type: "checkbox",
|
|
126
143
|
role: "switch",
|
|
127
|
-
|
|
144
|
+
value: __props.value,
|
|
145
|
+
checked: _controllable_value_value,
|
|
128
146
|
disabled: _control.disabled || void 0,
|
|
129
147
|
required: _control_required || void 0,
|
|
130
|
-
"aria-checked":
|
|
148
|
+
"aria-checked": _controllable_value_value,
|
|
131
149
|
"aria-label": __props.ariaLabel || void 0,
|
|
132
150
|
"aria-labelledby": _control.ariaLabelledby,
|
|
133
151
|
"aria-describedby": _control.ariaDescribedby,
|
|
@@ -147,7 +165,7 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
147
165
|
});
|
|
148
166
|
return n7;
|
|
149
167
|
}
|
|
150
|
-
}), [["__scopeId", "data-v-
|
|
168
|
+
}), [["__scopeId", "data-v-d966892e"]]);
|
|
151
169
|
//#endregion
|
|
152
170
|
//#region src/components/switch/types.ts
|
|
153
171
|
var switchParts = [
|