ropav 0.1.5 → 0.1.7
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 +10 -0
- package/dist/accordion.css +17 -17
- package/dist/accordion.js +125 -154
- package/dist/alert.css +18 -18
- package/dist/alert.js +20 -20
- package/dist/aria.js +14 -0
- package/dist/aspect-ratio.js +1 -1
- package/dist/attributes.js +9 -0
- package/dist/attributes2.js +29 -0
- package/dist/avatar.css +19 -19
- package/dist/avatar.js +10 -18
- package/dist/badge.css +16 -16
- package/dist/badge.js +6 -6
- package/dist/base.css +18 -13
- package/dist/button-group.js +1 -1
- package/dist/button-link.js +13 -14
- package/dist/button.css +32 -27
- package/dist/button.js +13 -14
- package/dist/{useButtonColor.js → button.scss_vue_type_style_index_0_src_true_lang.js} +3 -2
- package/dist/card.js +1 -1
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +23 -29
- package/dist/collapse.css +6 -6
- package/dist/collapse.js +8 -7
- package/dist/collectionNavigation.js +2 -99
- package/dist/color-input.css +19 -19
- package/dist/color-input.js +15 -14
- package/dist/color-picker.css +40 -40
- package/dist/color-picker.js +222 -202
- package/dist/color-picker2.js +1 -9
- package/dist/color-swatch.css +4 -4
- package/dist/color-swatch.js +7 -9
- package/dist/color.js +5 -10
- package/dist/componentColors.js +165 -84
- package/dist/componentRef.js +26 -0
- package/dist/components/accordion/accordionContext.d.ts +3 -0
- package/dist/components/accordion/accordionModel.d.ts +14 -0
- package/dist/components/accordion/index.d.ts +2 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/types.d.ts +1 -2
- package/dist/components/accordion/useAccordion.d.ts +2 -2
- package/dist/components/accordion/useAccordionItem.d.ts +2 -0
- package/dist/components/checkbox/useCheckbox.d.ts +2 -3
- package/dist/components/color-input/color-input.d.ts +2 -2
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/types.d.ts +2 -2
- package/dist/components/color-picker/useColorPickerSaturation.d.ts +22 -0
- package/dist/components/color-picker/useColorPickerSlider.d.ts +20 -0
- package/dist/components/color-picker/useColorPickerValue.d.ts +1 -1
- package/dist/components/dialog/{dialog-core.d.ts → dialogContext.d.ts} +2 -6
- package/dist/components/dialog/useDialogContentInteractions.d.ts +18 -0
- package/dist/components/dialog/useDialogRootState.d.ts +19 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-model.d.ts +8 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components/dropdown-menu/{dropdown-menu-primitive-core.d.ts → dropdownMenuContext.d.ts} +17 -19
- package/dist/components/dropdown-menu/dropdownMenuDataModel.d.ts +20 -0
- package/dist/components/dropdown-menu/dropdownMenuInteraction.d.ts +3 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionNavigation.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionRegistry.d.ts +42 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionTypes.d.ts +85 -0
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +11 -11
- package/dist/components/dropdown-menu/useDropdownMenuContextTrigger.d.ts +9 -0
- package/dist/components/dropdown-menu/useDropdownMenuDataController.d.ts +34 -0
- package/dist/components/dropdown-menu/useDropdownMenuDataRegistration.d.ts +22 -0
- package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +6 -5
- package/dist/components/dropdown-menu/useDropdownMenuInteractionDismissal.d.ts +17 -0
- package/dist/components/dropdown-menu/useDropdownMenuInteractionKeyboard.d.ts +19 -0
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +0 -1
- package/dist/components/dropdown-menu/useDropdownMenuPresentation.d.ts +29 -0
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +1 -1
- package/dist/components/dropdown-menu/useDropdownMenuTargetBindings.d.ts +19 -0
- package/dist/components/floating/hoverDisclosureInteractionModel.d.ts +42 -0
- package/dist/components/floating/index.js +1 -1
- package/dist/components/floating/useFloatingPosition.d.ts +0 -1
- package/dist/components/floating/useHoverDisclosureInteractions.d.ts +32 -0
- package/dist/components/floating/useHoverDisclosureOpenState.d.ts +25 -0
- package/dist/components/floating/useHoverDisclosureTargetBinding.d.ts +27 -0
- package/dist/components/input/useInput.d.ts +1 -1
- package/dist/components/number-input/numberInputModel.d.ts +15 -0
- package/dist/components/number-input/useNumberInput.d.ts +4 -18
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/paginationModel.d.ts +4 -0
- package/dist/components/pagination/types.d.ts +15 -0
- package/dist/components/pagination/usePagination.d.ts +3 -19
- package/dist/components/popover/usePopoverBindings.d.ts +16 -0
- package/dist/components/progress/progressModel.d.ts +8 -0
- package/dist/components/progress/useProgress.d.ts +1 -7
- package/dist/components/radio/useRadio.d.ts +3 -4
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/scrollAreaModel.d.ts +64 -0
- package/dist/components/scroll-area/types.d.ts +4 -0
- package/dist/components/scroll-area/useScrollArea.d.ts +70 -52
- package/dist/components/scroll-area/{useScrollAreaPresentation.d.ts → useScrollAreaAttributes.d.ts} +37 -14
- package/dist/components/scroll-area/useScrollAreaDerivedState.d.ts +8 -0
- package/dist/components/scroll-area/useScrollAreaMeasurement.d.ts +35 -0
- package/dist/components/scroll-area/useScrollAreaPointer.d.ts +10 -8
- package/dist/components/scroll-area/useScrollAreaVisibility.d.ts +15 -20
- package/dist/components/select/useSelect.d.ts +2 -1
- package/dist/components/select/useSelectNativeValue.d.ts +1 -7
- package/dist/components/slider/rangeSliderModel.d.ts +41 -0
- package/dist/components/slider/{sliderCore.d.ts → sliderModel.d.ts} +2 -2
- package/dist/components/slider/useRangeSlider.d.ts +9 -17
- package/dist/components/slider/useRangeSliderValueState.d.ts +40 -0
- package/dist/components/slider/useSlider.d.ts +8 -14
- package/dist/components/slider/useSliderPointerPreview.d.ts +22 -0
- package/dist/components/slider/useSliderTooltipState.d.ts +40 -0
- package/dist/components/slider/useSliderValueState.d.ts +33 -0
- package/dist/components/switch/useSwitch.d.ts +1 -1
- package/dist/components/teleport-provider/index.js +1 -1
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +1 -2
- package/dist/components/textarea/useTextarea.d.ts +1 -1
- package/dist/components/toast/useToastLifecycle.d.ts +19 -0
- package/dist/components/tooltip/useTooltip.d.ts +1 -2
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +2 -0
- package/dist/composables/useControllableValue.d.ts +14 -0
- package/dist/css.js +12 -0
- package/dist/dialog.js +227 -216
- package/dist/dropdown-menu.js +1493 -1118
- package/dist/events.js +59 -0
- package/dist/field.css +8 -8
- package/dist/field.js +13 -25
- package/dist/floating.js +553 -312
- package/dist/floatingOffset.js +11 -0
- package/dist/focus-trap.js +7 -5
- package/dist/focusNavigation.js +37 -0
- package/dist/icon-button.css +12 -173
- package/dist/icon-button.js +8 -7
- package/dist/index.d.ts +5 -4
- package/dist/index.js +13 -11
- package/dist/input.css +24 -24
- package/dist/input.js +20 -32
- package/dist/interactive.js +18 -0
- package/dist/modal.js +11 -7
- package/dist/number-input.css +18 -18
- package/dist/number-input.js +15 -13
- package/dist/number.js +22 -0
- package/dist/overlay.js +3 -2
- package/dist/pagination.css +28 -28
- package/dist/pagination.js +67 -65
- package/dist/pointer.js +9 -0
- package/dist/popover.css +34 -34
- package/dist/popover.js +93 -91
- package/dist/progress.css +29 -21
- package/dist/progress.js +25 -21
- package/dist/query.js +40 -0
- package/dist/radio.css +18 -18
- package/dist/radio.js +31 -37
- package/dist/rafScheduler.js +34 -0
- package/dist/scroll-area.css +35 -26
- package/dist/scroll-area.js +553 -500
- package/dist/select.css +45 -45
- package/dist/select.js +70 -56
- package/dist/slider.css +191 -191
- package/dist/slider.js +695 -628
- package/dist/styles-api.d.ts +0 -1
- package/dist/styles-api.js +1 -4
- package/dist/switch.css +17 -17
- package/dist/switch.js +15 -16
- package/dist/tabs.css +46 -46
- package/dist/tabs.js +51 -68
- package/dist/text.js +17 -0
- package/dist/textarea.css +26 -26
- package/dist/textarea.js +22 -33
- package/dist/toast.css +26 -26
- package/dist/toast.js +157 -129
- package/dist/tooltip.css +12 -12
- package/dist/tooltip.js +46 -47
- package/dist/useCollapse.js +19 -17
- package/dist/useControlState.js +4 -7
- package/dist/useControllableValue.js +8 -2
- package/dist/useFloatingPosition.js +122 -1128
- package/dist/useFormControl.js +3 -2
- package/dist/useOverlayZIndex.js +2 -6
- package/dist/useRequiredInject.js +1 -1
- package/dist/useTeleportTarget.js +3 -14
- package/dist/useTypeahead.js +94 -0
- package/dist/utils/aria.d.ts +3 -0
- package/dist/utils/attributes.d.ts +2 -0
- package/dist/utils/bem.d.ts +3 -0
- package/dist/utils/collectionNavigation.d.ts +2 -0
- package/dist/utils/color.d.ts +7 -0
- package/dist/{components/color-picker/color-picker-utils.d.ts → utils/colorPicker.d.ts} +5 -4
- package/dist/utils/componentColors.d.ts +7 -0
- package/dist/utils/css.d.ts +3 -0
- package/dist/utils/dom/ancestry.d.ts +7 -0
- package/dist/utils/dom/attributes.d.ts +16 -0
- package/dist/utils/dom/componentRef.d.ts +4 -0
- package/dist/utils/dom/events.d.ts +5 -0
- package/dist/utils/dom/focusNavigation.d.ts +7 -0
- package/dist/utils/dom/interactive.d.ts +2 -0
- package/dist/utils/dom/pointer.d.ts +2 -0
- package/dist/utils/dom/query.d.ts +4 -0
- package/dist/utils/dom/scroll.d.ts +23 -0
- package/dist/utils/floatingOffset.d.ts +10 -0
- package/dist/utils/geometry.d.ts +14 -0
- package/dist/utils/indexPath.d.ts +6 -0
- package/dist/utils/number.d.ts +4 -0
- package/dist/utils/rafScheduler.d.ts +4 -0
- package/dist/utils/text.d.ts +2 -0
- package/docs/code-architecture.md +118 -0
- package/docs/public-composables-api.md +52 -0
- package/docs/public-floating-api.md +6 -5
- package/package.json +54 -46
- package/src/styles/_mixins.scss +4 -0
- package/src/styles/_tokens.scss +12 -12
- package/src/styles/_variables.scss +1 -1
- package/dist/button-link.css +0 -167
- package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +0 -3
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +0 -21
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +0 -37
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +0 -29
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +0 -52
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +0 -17
- package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +0 -18
- package/dist/components/scroll-area/scrollAreaCore.d.ts +0 -25
- package/dist/components/scroll-area/useScrollAreaControls.d.ts +0 -25
- package/dist/components/scroll-area/useScrollAreaMetrics.d.ts +0 -35
- /package/dist/components/alert/{useAlertColor.d.ts → alertColor.d.ts} +0 -0
- /package/dist/components/avatar/{useAvatarColor.d.ts → avatarColor.d.ts} +0 -0
- /package/dist/components/badge/{useBadgeColor.d.ts → badgeColor.d.ts} +0 -0
- /package/dist/components/button/{useButtonColor.d.ts → buttonColor.d.ts} +0 -0
- /package/dist/components/color-swatch/{useColorSwatchColor.d.ts → colorSwatchColor.d.ts} +0 -0
- /package/dist/components/toast/{useToastColor.d.ts → toastColor.d.ts} +0 -0
- /package/dist/{composables → internal/composables}/useOverlayLayer.d.ts +0 -0
package/dist/popover.js
CHANGED
|
@@ -1,53 +1,81 @@
|
|
|
1
1
|
import './popover.css';
|
|
2
|
+
import { t as useControllableValue } from "./useControllableValue.js";
|
|
3
|
+
import { t as useStylesApi } from "./styles-api.js";
|
|
4
|
+
import { n as toPresenceAttribute } from "./attributes.js";
|
|
2
5
|
import { t as bem } from "./bem.js";
|
|
3
|
-
import {
|
|
6
|
+
import { t as isElement } from "./query.js";
|
|
4
7
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
8
|
+
import { a as snapshotAttributes, i as restoreAttributes } from "./attributes2.js";
|
|
9
|
+
import { n as mergeAriaIdRefs } from "./aria.js";
|
|
10
|
+
import { i as isNodeWithinElement } from "./events.js";
|
|
5
11
|
import { n as useOverlayZIndex, r as useOverlayLayer } from "./useOverlayZIndex.js";
|
|
12
|
+
import { t as getFloatingOffsetStyle } from "./floatingOffset.js";
|
|
6
13
|
import { t as useFocusTrap } from "./useFocusTrap.js";
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import { VaporTeleport, VaporTransition, applyVShow, computed, createComponent, createIf,
|
|
10
|
-
//#region src/components/popover/
|
|
11
|
-
var DEFAULT_PLACEMENT = "bottom";
|
|
12
|
-
var DEFAULT_ROLE = "dialog";
|
|
14
|
+
import { n as useFloatingTarget, t as useFloatingPosition } from "./useFloatingPosition.js";
|
|
15
|
+
import { n as useTeleportTarget } from "./useTeleportTarget.js";
|
|
16
|
+
import { VaporTeleport, VaporTransition, applyVShow, computed, createComponent, createIf, createSlot, createTemplateRefSetter, defineVaporComponent, extend, isRef, nextTick, on, ref, renderEffect, setAttr, setDynamicProps, setInsertionState, setStyle, setTemplateRefBinding, template, unref, useAttrs, useId, useSlots, watch } from "vue";
|
|
17
|
+
//#region src/components/popover/usePopoverBindings.ts
|
|
13
18
|
var TARGET_ATTRIBUTES = [
|
|
14
19
|
"aria-controls",
|
|
15
20
|
"aria-expanded",
|
|
16
21
|
"aria-haspopup"
|
|
17
22
|
];
|
|
18
|
-
function addIdReference(currentValue, id) {
|
|
19
|
-
const ids = (currentValue ?? "").split(/\s+/).filter(Boolean);
|
|
20
|
-
if (!ids.includes(id)) ids.push(id);
|
|
21
|
-
return ids.join(" ");
|
|
22
|
-
}
|
|
23
|
-
function snapshotAttributes(element) {
|
|
24
|
-
const snapshot = {};
|
|
25
|
-
for (const attribute of TARGET_ATTRIBUTES) snapshot[attribute] = element.getAttribute(attribute);
|
|
26
|
-
return snapshot;
|
|
27
|
-
}
|
|
28
|
-
function restoreAttributes(element, snapshot) {
|
|
29
|
-
for (const attribute of TARGET_ATTRIBUTES) {
|
|
30
|
-
const value = snapshot[attribute];
|
|
31
|
-
if (value == null) element.removeAttribute(attribute);
|
|
32
|
-
else element.setAttribute(attribute, value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
23
|
function applyTargetAttributes(element, snapshot, options) {
|
|
36
|
-
element.setAttribute("aria-controls",
|
|
24
|
+
element.setAttribute("aria-controls", mergeAriaIdRefs(snapshot.get("aria-controls"), options.id) ?? "");
|
|
37
25
|
element.setAttribute("aria-expanded", String(options.expanded));
|
|
38
26
|
element.setAttribute("aria-haspopup", options.role);
|
|
39
27
|
}
|
|
28
|
+
function usePopoverBindings({ isExplicitTarget, targetElement, popoverId, popoverRole, isVisible, isDisabled, onTriggerClick, onDocumentClick, onDocumentPointerDown, onDocumentKeydown }) {
|
|
29
|
+
watch([isExplicitTarget, targetElement], ([explicit, target], _previous, onCleanup) => {
|
|
30
|
+
if (!explicit || !target) return;
|
|
31
|
+
target.addEventListener("click", onTriggerClick);
|
|
32
|
+
onCleanup(() => target.removeEventListener("click", onTriggerClick));
|
|
33
|
+
}, { flush: "sync" });
|
|
34
|
+
watch([
|
|
35
|
+
isExplicitTarget,
|
|
36
|
+
targetElement,
|
|
37
|
+
popoverId,
|
|
38
|
+
popoverRole,
|
|
39
|
+
isVisible,
|
|
40
|
+
isDisabled
|
|
41
|
+
], ([explicit, target, id, role, visible, disabled], _previous, onCleanup) => {
|
|
42
|
+
if (!explicit || !target || disabled) return;
|
|
43
|
+
const snapshot = snapshotAttributes(target, TARGET_ATTRIBUTES);
|
|
44
|
+
applyTargetAttributes(target, snapshot, {
|
|
45
|
+
id,
|
|
46
|
+
expanded: visible,
|
|
47
|
+
role
|
|
48
|
+
});
|
|
49
|
+
onCleanup(() => restoreAttributes(target, snapshot));
|
|
50
|
+
}, { flush: "sync" });
|
|
51
|
+
watch(isVisible, (visible, _previous, onCleanup) => {
|
|
52
|
+
if (!visible || typeof document === "undefined") return;
|
|
53
|
+
document.addEventListener("click", onDocumentClick, true);
|
|
54
|
+
document.addEventListener("mousedown", onDocumentPointerDown, true);
|
|
55
|
+
document.addEventListener("touchstart", onDocumentPointerDown, true);
|
|
56
|
+
document.addEventListener("keydown", onDocumentKeydown);
|
|
57
|
+
onCleanup(() => {
|
|
58
|
+
document.removeEventListener("click", onDocumentClick, true);
|
|
59
|
+
document.removeEventListener("mousedown", onDocumentPointerDown, true);
|
|
60
|
+
document.removeEventListener("touchstart", onDocumentPointerDown, true);
|
|
61
|
+
document.removeEventListener("keydown", onDocumentKeydown);
|
|
62
|
+
});
|
|
63
|
+
}, {
|
|
64
|
+
flush: "sync",
|
|
65
|
+
immediate: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/popover/usePopover.ts
|
|
70
|
+
var DEFAULT_PLACEMENT = "bottom";
|
|
71
|
+
var DEFAULT_ROLE = "dialog";
|
|
72
|
+
var POPOVER_OFFSET_PROPERTIES = {
|
|
73
|
+
mainAxis: "--_rp-popover-main-axis-offset",
|
|
74
|
+
crossAxis: "--_rp-popover-cross-axis-offset"
|
|
75
|
+
};
|
|
40
76
|
function isFocusTrapContainer(value) {
|
|
41
77
|
return typeof HTMLElement !== "undefined" && value instanceof HTMLElement || typeof SVGElement !== "undefined" && value instanceof SVGElement;
|
|
42
78
|
}
|
|
43
|
-
function resolveOffsetStyle(offset) {
|
|
44
|
-
if (offset == null) return void 0;
|
|
45
|
-
if (typeof offset === "number") return { "--_rp-popover-main-axis-offset": `${offset}px` };
|
|
46
|
-
const style = {};
|
|
47
|
-
if (offset.mainAxis != null) style["--_rp-popover-main-axis-offset"] = `${offset.mainAxis}px`;
|
|
48
|
-
if (offset.crossAxis != null) style["--_rp-popover-cross-axis-offset"] = `${offset.crossAxis}px`;
|
|
49
|
-
return Object.keys(style).length > 0 ? style : void 0;
|
|
50
|
-
}
|
|
51
79
|
function usePopover(props, emitOpenChange) {
|
|
52
80
|
const slots = useSlots();
|
|
53
81
|
const attrs = useAttrs();
|
|
@@ -55,17 +83,20 @@ function usePopover(props, emitOpenChange) {
|
|
|
55
83
|
const rootRef = ref(null);
|
|
56
84
|
const contentRef = ref(null);
|
|
57
85
|
const arrowRef = ref(null);
|
|
58
|
-
const
|
|
86
|
+
const controllableOpen = useControllableValue({
|
|
87
|
+
modelValue: () => props.open,
|
|
88
|
+
defaultValue: () => false,
|
|
89
|
+
onChange: (open) => emitOpenChange?.(open)
|
|
90
|
+
});
|
|
59
91
|
const popoverId = computed(() => props.id ?? `${generatedId}-popover`);
|
|
60
92
|
const placement = computed(() => props.placement ?? DEFAULT_PLACEMENT);
|
|
61
93
|
const popoverRole = computed(() => props.role ?? DEFAULT_ROLE);
|
|
62
94
|
const teleportTo = useTeleportTarget(() => props.teleportTo);
|
|
63
|
-
const teleportPositioningKey = useTeleportPositioningKey();
|
|
64
95
|
const { isExplicitTarget, reference, resolvedTarget } = useFloatingTarget(() => props.target, rootRef);
|
|
65
|
-
const targetElement = computed(() =>
|
|
96
|
+
const targetElement = computed(() => isElement(resolvedTarget.value) ? resolvedTarget.value : null);
|
|
66
97
|
const hasContent = computed(() => Boolean(slots.content || isExplicitTarget.value && slots.default));
|
|
67
98
|
const isDisabled = computed(() => Boolean(props.disabled || !hasContent.value));
|
|
68
|
-
const isOpen =
|
|
99
|
+
const isOpen = controllableOpen.value;
|
|
69
100
|
const isVisible = computed(() => isOpen.value && !isDisabled.value);
|
|
70
101
|
const layer = useOverlayLayer({
|
|
71
102
|
active: isVisible,
|
|
@@ -103,12 +134,7 @@ function usePopover(props, emitOpenChange) {
|
|
|
103
134
|
flipOptions: () => props.flipOptions,
|
|
104
135
|
shift: () => props.shift !== false,
|
|
105
136
|
collisionPadding: () => props.collisionPadding ?? 8,
|
|
106
|
-
autoUpdateOptions: () => props.autoUpdateOptions
|
|
107
|
-
restartKey: () => [
|
|
108
|
-
Boolean(props.teleport),
|
|
109
|
-
teleportTo.value,
|
|
110
|
-
teleportPositioningKey.value
|
|
111
|
-
]
|
|
137
|
+
autoUpdateOptions: () => props.autoUpdateOptions
|
|
112
138
|
});
|
|
113
139
|
const placementSide = computed(() => floating.actualPlacement.value.split("-")[0]);
|
|
114
140
|
const rootClass = computed(() => bem("rp-popover", {
|
|
@@ -120,7 +146,7 @@ function usePopover(props, emitOpenChange) {
|
|
|
120
146
|
}));
|
|
121
147
|
const contentStyle = computed(() => ({
|
|
122
148
|
...floating.floatingStyle.value,
|
|
123
|
-
...
|
|
149
|
+
...getFloatingOffsetStyle(props.offset, POPOVER_OFFSET_PROPERTIES),
|
|
124
150
|
zIndex: layer.zIndex.value
|
|
125
151
|
}));
|
|
126
152
|
const triggerProps = computed(() => ({
|
|
@@ -153,9 +179,7 @@ function usePopover(props, emitOpenChange) {
|
|
|
153
179
|
allowOutsideClick: true
|
|
154
180
|
});
|
|
155
181
|
function setOpen(nextOpen) {
|
|
156
|
-
|
|
157
|
-
if (props.open === void 0) uncontrolledOpen.value = nextOpen;
|
|
158
|
-
if (previousOpen !== nextOpen) emitOpenChange?.(nextOpen);
|
|
182
|
+
if (isOpen.value !== nextOpen) controllableOpen.setValue(nextOpen);
|
|
159
183
|
}
|
|
160
184
|
function openPopover() {
|
|
161
185
|
if (!isDisabled.value) setOpen(true);
|
|
@@ -189,7 +213,7 @@ function usePopover(props, emitOpenChange) {
|
|
|
189
213
|
}
|
|
190
214
|
function onCompositeFocusout(event) {
|
|
191
215
|
const nextTarget = event.relatedTarget;
|
|
192
|
-
if (nextTarget
|
|
216
|
+
if (isNodeWithinElement(nextTarget, rootRef.value) || isNodeWithinElement(nextTarget, contentRef.value) || isNodeWithinElement(nextTarget, targetElement.value)) return;
|
|
193
217
|
const listener = attrs.onFocusout;
|
|
194
218
|
const listeners = Array.isArray(listener) ? listener : [listener];
|
|
195
219
|
for (const current of listeners) if (typeof current === "function") current(event);
|
|
@@ -224,43 +248,17 @@ function usePopover(props, emitOpenChange) {
|
|
|
224
248
|
flush: "post",
|
|
225
249
|
immediate: true
|
|
226
250
|
});
|
|
227
|
-
|
|
228
|
-
if (!explicit || !target) return;
|
|
229
|
-
target.addEventListener("click", onTriggerClick);
|
|
230
|
-
onCleanup(() => target.removeEventListener("click", onTriggerClick));
|
|
231
|
-
}, { flush: "sync" });
|
|
232
|
-
watch([
|
|
251
|
+
usePopoverBindings({
|
|
233
252
|
isExplicitTarget,
|
|
234
253
|
targetElement,
|
|
235
254
|
popoverId,
|
|
236
255
|
popoverRole,
|
|
237
256
|
isVisible,
|
|
238
|
-
isDisabled
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
id,
|
|
244
|
-
expanded: visible,
|
|
245
|
-
role
|
|
246
|
-
});
|
|
247
|
-
onCleanup(() => restoreAttributes(target, snapshot));
|
|
248
|
-
}, { flush: "sync" });
|
|
249
|
-
watch(isVisible, (visible, _previous, onCleanup) => {
|
|
250
|
-
if (!visible || typeof document === "undefined") return;
|
|
251
|
-
document.addEventListener("click", onDocumentClick, true);
|
|
252
|
-
document.addEventListener("mousedown", onDocumentPointerDown, true);
|
|
253
|
-
document.addEventListener("touchstart", onDocumentPointerDown, true);
|
|
254
|
-
document.addEventListener("keydown", onDocumentKeydown);
|
|
255
|
-
onCleanup(() => {
|
|
256
|
-
document.removeEventListener("click", onDocumentClick, true);
|
|
257
|
-
document.removeEventListener("mousedown", onDocumentPointerDown, true);
|
|
258
|
-
document.removeEventListener("touchstart", onDocumentPointerDown, true);
|
|
259
|
-
document.removeEventListener("keydown", onDocumentKeydown);
|
|
260
|
-
});
|
|
261
|
-
}, {
|
|
262
|
-
flush: "sync",
|
|
263
|
-
immediate: true
|
|
257
|
+
isDisabled,
|
|
258
|
+
onTriggerClick,
|
|
259
|
+
onDocumentClick,
|
|
260
|
+
onDocumentPointerDown,
|
|
261
|
+
onDocumentKeydown
|
|
264
262
|
});
|
|
265
263
|
return {
|
|
266
264
|
rootRef,
|
|
@@ -295,10 +293,9 @@ function usePopover(props, emitOpenChange) {
|
|
|
295
293
|
}
|
|
296
294
|
//#endregion
|
|
297
295
|
//#region src/components/popover/popover.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
298
|
-
var t0 = template("<span data-v-
|
|
299
|
-
var t1 = template("<section data-v-
|
|
300
|
-
var t2 = template("<span data-v-
|
|
301
|
-
delegateEvents("focusout");
|
|
296
|
+
var t0 = template("<span data-v-519e9856 class=rp-popover__arrow aria-hidden=true>");
|
|
297
|
+
var t1 = template("<section data-v-519e9856>");
|
|
298
|
+
var t2 = template("<span data-v-519e9856>", 1);
|
|
302
299
|
//#endregion
|
|
303
300
|
//#region src/components/popover/popover.vue
|
|
304
301
|
var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -377,12 +374,17 @@ var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
377
374
|
const { rootRef, contentRef, arrowRef, popoverId, isDisabled, isTargetMode, popoverRole, ariaLabel, ariaLabelledby, ariaDescribedby, shouldRenderContent, shouldShowContent, rootClass, contentStyle, slotProps, contentSlotProps, actualPlacement, placementSide, arrowStyle, teleportTo, onCompositeFocusout } = usePopover(props, (open) => {
|
|
378
375
|
emit("update:open", open);
|
|
379
376
|
});
|
|
377
|
+
const templateRefs = {
|
|
378
|
+
root: rootRef,
|
|
379
|
+
content: contentRef,
|
|
380
|
+
arrow: arrowRef
|
|
381
|
+
};
|
|
380
382
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
381
383
|
const publicRootAttrs = computed(() => getRootAttrs({
|
|
382
384
|
class: rootClass.value,
|
|
383
385
|
onFocusout: onCompositeFocusout,
|
|
384
386
|
"data-state": slotProps.value.isOpen ? "open" : "closed",
|
|
385
|
-
"data-disabled":
|
|
387
|
+
"data-disabled": toPresenceAttribute(isDisabled.value)
|
|
386
388
|
}, {}, ["onFocusout"]));
|
|
387
389
|
const styledTriggerProps = computed(() => {
|
|
388
390
|
const partAttrs = getPartAttrs("trigger");
|
|
@@ -391,7 +393,7 @@ var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
391
393
|
...props.classNames?.trigger !== void 0 ? { class: partAttrs.class } : {},
|
|
392
394
|
...props.styles?.trigger !== void 0 ? { style: partAttrs.style } : {},
|
|
393
395
|
"data-state": slotProps.value.isOpen ? "open" : "closed",
|
|
394
|
-
"data-disabled":
|
|
396
|
+
"data-disabled": toPresenceAttribute(isDisabled.value)
|
|
395
397
|
};
|
|
396
398
|
});
|
|
397
399
|
const contentAttrs = computed(() => ({
|
|
@@ -455,23 +457,23 @@ var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
455
457
|
setInsertionState(n13, null, 1);
|
|
456
458
|
createIf(() => __props.arrow, () => {
|
|
457
459
|
const n12 = t0();
|
|
458
|
-
_setTemplateRef(n12, arrowRef, null, "arrowRef");
|
|
459
460
|
renderEffect(() => {
|
|
460
461
|
setAttr(n12, "data-side", unref(placementSide));
|
|
461
462
|
setStyle(n12, unref(arrowStyle));
|
|
463
|
+
_setTemplateRef(n12, templateRefs.arrow);
|
|
462
464
|
});
|
|
463
465
|
return n12;
|
|
464
466
|
});
|
|
465
467
|
applyVShow(n13, () => unref(shouldShowContent));
|
|
466
|
-
n13
|
|
467
|
-
|
|
468
|
+
on(n13, "focusout", (e) => unref(onCompositeFocusout)(e));
|
|
469
|
+
setTemplateRefBinding(n13, () => templateRefs.content, _setTemplateRef);
|
|
468
470
|
return n13;
|
|
469
471
|
}, null, 129);
|
|
470
472
|
}, { _: 8 }));
|
|
471
473
|
});
|
|
472
|
-
|
|
474
|
+
setTemplateRefBinding(n16, () => templateRefs.root);
|
|
473
475
|
return n16;
|
|
474
476
|
}
|
|
475
|
-
}), [["__scopeId", "data-v-
|
|
477
|
+
}), [["__scopeId", "data-v-519e9856"]]);
|
|
476
478
|
//#endregion
|
|
477
479
|
export { popover_default as t };
|
package/dist/progress.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-progress[data-v-
|
|
2
|
+
.rp-progress[data-v-4a492ff8] {
|
|
3
3
|
--_rp-progress-color: var(--rp-color-control-selected-bg);
|
|
4
4
|
--_rp-progress-track-bg: var(--rp-color-control-track-bg);
|
|
5
5
|
--_rp-progress-track-height: 8px;
|
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
font-size: var(--_rp-progress-font-size);
|
|
16
16
|
line-height: var(--rp-line-height-md);
|
|
17
17
|
}
|
|
18
|
-
.rp-progress__header[data-v-
|
|
18
|
+
.rp-progress__header[data-v-4a492ff8] {
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
min-width: 0;
|
|
23
23
|
gap: var(--rp-spacing-3);
|
|
24
24
|
}
|
|
25
|
-
.rp-progress__label[data-v-
|
|
25
|
+
.rp-progress__label[data-v-4a492ff8] {
|
|
26
26
|
min-width: 0;
|
|
27
27
|
color: var(--rp-color-text);
|
|
28
28
|
}
|
|
29
|
-
.rp-progress__value[data-v-
|
|
29
|
+
.rp-progress__value[data-v-4a492ff8] {
|
|
30
30
|
flex-shrink: 0;
|
|
31
31
|
color: var(--rp-color-dimmed);
|
|
32
32
|
font-variant-numeric: tabular-nums;
|
|
33
33
|
}
|
|
34
|
-
.rp-progress__track[data-v-
|
|
34
|
+
.rp-progress__track[data-v-4a492ff8] {
|
|
35
35
|
position: relative;
|
|
36
36
|
display: block;
|
|
37
37
|
width: 100%;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
background: var(--_rp-progress-track-bg);
|
|
41
41
|
border-radius: var(--_rp-progress-radius);
|
|
42
42
|
}
|
|
43
|
-
.rp-progress__indicator[data-v-
|
|
43
|
+
.rp-progress__indicator[data-v-4a492ff8] {
|
|
44
44
|
display: block;
|
|
45
45
|
width: var(--_rp-progress-value);
|
|
46
46
|
height: 100%;
|
|
@@ -48,54 +48,62 @@
|
|
|
48
48
|
border-radius: inherit;
|
|
49
49
|
transition: width var(--rp-transition-base);
|
|
50
50
|
}
|
|
51
|
-
.rp-progress--indeterminate .rp-progress__indicator[data-v-
|
|
51
|
+
.rp-progress--indeterminate .rp-progress__indicator[data-v-4a492ff8] {
|
|
52
52
|
position: absolute;
|
|
53
53
|
width: 38%;
|
|
54
54
|
min-width: 2rem;
|
|
55
|
-
animation: rp-progress-indeterminate-
|
|
55
|
+
animation: rp-progress-indeterminate-4a492ff8 1200ms ease-in-out infinite;
|
|
56
56
|
}
|
|
57
|
-
.rp-progress--size-xs[data-v-
|
|
57
|
+
.rp-progress--size-xs[data-v-4a492ff8] {
|
|
58
58
|
--_rp-progress-track-height: 3px;
|
|
59
59
|
--_rp-progress-font-size: var(--rp-font-size-xs);
|
|
60
60
|
}
|
|
61
|
-
.rp-progress--size-sm[data-v-
|
|
61
|
+
.rp-progress--size-sm[data-v-4a492ff8] {
|
|
62
62
|
--_rp-progress-track-height: 5px;
|
|
63
63
|
--_rp-progress-font-size: var(--rp-font-size-sm);
|
|
64
64
|
}
|
|
65
|
-
.rp-progress--size-md[data-v-
|
|
65
|
+
.rp-progress--size-md[data-v-4a492ff8] {
|
|
66
66
|
--_rp-progress-track-height: 8px;
|
|
67
67
|
--_rp-progress-font-size: var(--rp-font-size-md);
|
|
68
68
|
}
|
|
69
|
-
.rp-progress--size-lg[data-v-
|
|
69
|
+
.rp-progress--size-lg[data-v-4a492ff8] {
|
|
70
70
|
--_rp-progress-track-height: 12px;
|
|
71
71
|
--_rp-progress-font-size: var(--rp-font-size-lg);
|
|
72
72
|
}
|
|
73
|
-
.rp-progress--size-xl[data-v-
|
|
73
|
+
.rp-progress--size-xl[data-v-4a492ff8] {
|
|
74
74
|
--_rp-progress-track-height: 16px;
|
|
75
75
|
--_rp-progress-font-size: var(--rp-font-size-xl);
|
|
76
76
|
}
|
|
77
|
-
.rp-progress--radius-none[data-v-
|
|
77
|
+
.rp-progress--radius-none[data-v-4a492ff8] {
|
|
78
78
|
--_rp-progress-radius: var(--rp-radius-none);
|
|
79
79
|
}
|
|
80
|
-
.rp-progress--radius-xs[data-v-
|
|
80
|
+
.rp-progress--radius-xs[data-v-4a492ff8] {
|
|
81
81
|
--_rp-progress-radius: var(--rp-radius-xs);
|
|
82
82
|
}
|
|
83
|
-
.rp-progress--radius-sm[data-v-
|
|
83
|
+
.rp-progress--radius-sm[data-v-4a492ff8] {
|
|
84
84
|
--_rp-progress-radius: var(--rp-radius-sm);
|
|
85
85
|
}
|
|
86
|
-
.rp-progress--radius-md[data-v-
|
|
86
|
+
.rp-progress--radius-md[data-v-4a492ff8] {
|
|
87
87
|
--_rp-progress-radius: var(--rp-radius-md);
|
|
88
88
|
}
|
|
89
|
-
.rp-progress--radius-lg[data-v-
|
|
89
|
+
.rp-progress--radius-lg[data-v-4a492ff8] {
|
|
90
90
|
--_rp-progress-radius: var(--rp-radius-lg);
|
|
91
91
|
}
|
|
92
|
-
.rp-progress--radius-xl[data-v-
|
|
92
|
+
.rp-progress--radius-xl[data-v-4a492ff8] {
|
|
93
93
|
--_rp-progress-radius: var(--rp-radius-xl);
|
|
94
94
|
}
|
|
95
|
-
.rp-progress--radius-full[data-v-
|
|
95
|
+
.rp-progress--radius-full[data-v-4a492ff8] {
|
|
96
96
|
--_rp-progress-radius: var(--rp-radius-full);
|
|
97
97
|
}
|
|
98
|
-
@
|
|
98
|
+
@media (prefers-reduced-motion: reduce) {
|
|
99
|
+
.rp-progress__indicator[data-v-4a492ff8] {
|
|
100
|
+
transition: none;
|
|
101
|
+
}
|
|
102
|
+
.rp-progress--indeterminate .rp-progress__indicator[data-v-4a492ff8] {
|
|
103
|
+
animation: none;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
@keyframes rp-progress-indeterminate-4a492ff8 {
|
|
99
107
|
0% {
|
|
100
108
|
transform: translateX(-110%);
|
|
101
109
|
}
|
package/dist/progress.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import './progress.css';
|
|
2
|
+
import { t as useStylesApi } from "./styles-api.js";
|
|
2
3
|
import { t as bem } from "./bem.js";
|
|
3
|
-
import { n as useStylesApi } from "./styles-api.js";
|
|
4
|
-
import { n as getComponentColorValue, t as componentColors } from "./componentColors.js";
|
|
5
4
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
5
|
+
import { n as getValuePercent, t as clamp } from "./number.js";
|
|
6
|
+
import { i as getComponentColorValue, t as componentColors } from "./componentColors.js";
|
|
6
7
|
import { t as useControlState } from "./useControlState.js";
|
|
7
|
-
import { child, computed, createIf, createSlot, defineVaporComponent, renderEffect, setDynamicProps, setInsertionState, setText, template, toDisplayString, unref } from "vue";
|
|
8
|
-
//#region src/components/progress/
|
|
8
|
+
import { child, computed, createIf, createSlot, defineVaporComponent, renderEffect, setDynamicProps, setInsertionState, setText, template, toDisplayString, unref, useId, useSlots } from "vue";
|
|
9
|
+
//#region src/components/progress/progressModel.ts
|
|
9
10
|
function normalizeProgressBounds(min, max) {
|
|
10
11
|
const safeMin = Number.isFinite(min) ? min : 0;
|
|
11
12
|
const safeMax = Number.isFinite(max) ? max : 100;
|
|
@@ -18,15 +19,9 @@ function normalizeProgressBounds(min, max) {
|
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
function normalizeProgressValue(value, min, max) {
|
|
21
|
-
|
|
22
|
-
return Math.min(max, Math.max(min, safeValue));
|
|
23
|
-
}
|
|
24
|
-
function getProgressValuePercent(value, min, max) {
|
|
25
|
-
if (max <= min) return 0;
|
|
26
|
-
const percent = (value - min) / (max - min) * 100;
|
|
27
|
-
return Math.min(100, Math.max(0, percent));
|
|
22
|
+
return clamp(Number.isFinite(value) ? Number(value) : min, min, max);
|
|
28
23
|
}
|
|
29
|
-
function
|
|
24
|
+
function formatProgressValue(value, percent, formatter) {
|
|
30
25
|
return formatter ? formatter(value, percent) : `${Math.round(percent)}%`;
|
|
31
26
|
}
|
|
32
27
|
function getProgressAriaValueText(value, percent, ariaValueText, formatter) {
|
|
@@ -34,13 +29,15 @@ function getProgressAriaValueText(value, percent, ariaValueText, formatter) {
|
|
|
34
29
|
if (ariaValueText != null && ariaValueText !== "") return String(ariaValueText);
|
|
35
30
|
if (formatter) return String(formatter(value, percent));
|
|
36
31
|
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/progress/useProgress.ts
|
|
37
34
|
function useProgress(props) {
|
|
38
35
|
const control = useControlState(props);
|
|
39
36
|
const bounds = computed(() => normalizeProgressBounds(props.min, props.max));
|
|
40
37
|
const isIndeterminate = computed(() => props.indeterminate || props.value == null);
|
|
41
38
|
const normalizedValue = computed(() => normalizeProgressValue(props.value, bounds.value.min, bounds.value.max));
|
|
42
|
-
const valuePercent = computed(() =>
|
|
43
|
-
const formattedValue = computed(() =>
|
|
39
|
+
const valuePercent = computed(() => getValuePercent(normalizedValue.value, bounds.value.min, bounds.value.max));
|
|
40
|
+
const formattedValue = computed(() => formatProgressValue(normalizedValue.value, valuePercent.value, props.formatValue));
|
|
44
41
|
const ariaValueText = computed(() => isIndeterminate.value ? void 0 : getProgressAriaValueText(normalizedValue.value, valuePercent.value, props.ariaValueText, props.formatValue));
|
|
45
42
|
return {
|
|
46
43
|
control,
|
|
@@ -70,10 +67,10 @@ function useProgress(props) {
|
|
|
70
67
|
}
|
|
71
68
|
//#endregion
|
|
72
69
|
//#region src/components/progress/progress.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
73
|
-
var t0 = template("<span data-v-
|
|
70
|
+
var t0 = template("<span data-v-4a492ff8>");
|
|
74
71
|
var t1 = template(" ");
|
|
75
|
-
var t2 = template("<span data-v-
|
|
76
|
-
var t3 = template("<div data-v-
|
|
72
|
+
var t2 = template("<span data-v-4a492ff8 class=rp-progress__header>");
|
|
73
|
+
var t3 = template("<div data-v-4a492ff8><span data-v-4a492ff8><span data-v-4a492ff8>", 1);
|
|
77
74
|
//#endregion
|
|
78
75
|
//#region src/components/progress/progress.vue
|
|
79
76
|
var progress_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -106,16 +103,23 @@ var progress_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
106
103
|
},
|
|
107
104
|
setup(__props, { slots: $slots }) {
|
|
108
105
|
const props = __props;
|
|
106
|
+
const slots = useSlots();
|
|
107
|
+
const labelId = `${useId()}-label`;
|
|
109
108
|
const { control, rootClass, rootStyle, isIndeterminate, normalizedValue, valuePercent, formattedValue, ariaValueText, ariaValueMin, ariaValueMax, ariaValueNow } = useProgress(props);
|
|
110
109
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
110
|
+
const ariaLabel = computed(() => props.ariaLabel?.trim() || void 0);
|
|
111
|
+
const ariaLabelledby = computed(() => {
|
|
112
|
+
if (ariaLabel.value) return void 0;
|
|
113
|
+
return control.ariaLabelledby || (slots.default ? labelId : void 0);
|
|
114
|
+
});
|
|
111
115
|
const rootAttrs = computed(() => getRootAttrs({
|
|
112
116
|
id: control.id,
|
|
113
117
|
class: rootClass.value,
|
|
114
118
|
style: rootStyle.value,
|
|
115
119
|
role: "progressbar",
|
|
116
120
|
"data-state": isIndeterminate.value ? "indeterminate" : "determinate",
|
|
117
|
-
"aria-label":
|
|
118
|
-
"aria-labelledby":
|
|
121
|
+
"aria-label": ariaLabel.value,
|
|
122
|
+
"aria-labelledby": ariaLabelledby.value,
|
|
119
123
|
"aria-describedby": control.ariaDescribedby,
|
|
120
124
|
"aria-valuemin": ariaValueMin.value,
|
|
121
125
|
"aria-valuemax": ariaValueMax.value,
|
|
@@ -132,7 +136,7 @@ var progress_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
132
136
|
setInsertionState(n14, null, 0);
|
|
133
137
|
createIf(() => $slots.default, () => {
|
|
134
138
|
const n5 = t0();
|
|
135
|
-
renderEffect(() => setDynamicProps(n5, [unref(getPartAttrs)("label", { class: "rp-progress__label" })]));
|
|
139
|
+
renderEffect(() => setDynamicProps(n5, [{ id: labelId }, unref(getPartAttrs)("label", { class: "rp-progress__label" })]));
|
|
136
140
|
setInsertionState(n5, null, 0);
|
|
137
141
|
createSlot("default", null, null, 1);
|
|
138
142
|
return n5;
|
|
@@ -164,7 +168,7 @@ var progress_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
164
168
|
});
|
|
165
169
|
return n17;
|
|
166
170
|
}
|
|
167
|
-
}), [["__scopeId", "data-v-
|
|
171
|
+
}), [["__scopeId", "data-v-4a492ff8"]]);
|
|
168
172
|
//#endregion
|
|
169
173
|
//#region src/components/progress/types.ts
|
|
170
174
|
var progressParts = [
|
package/dist/query.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/utils/dom/query.ts
|
|
2
|
+
function isElement(value) {
|
|
3
|
+
if (value == null || typeof value !== "object") return false;
|
|
4
|
+
if (typeof Element !== "undefined" && value instanceof Element) return true;
|
|
5
|
+
const candidate = value;
|
|
6
|
+
const ElementConstructor = ("ownerDocument" in value ? candidate.ownerDocument : null)?.defaultView?.Element;
|
|
7
|
+
if (ElementConstructor && value instanceof ElementConstructor) return true;
|
|
8
|
+
return candidate.nodeType === 1 && typeof candidate.getAttribute === "function";
|
|
9
|
+
}
|
|
10
|
+
function matchesSelectorSafe(element, selector) {
|
|
11
|
+
try {
|
|
12
|
+
return element.matches(selector);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function getQueryRoot(root) {
|
|
18
|
+
if (root !== void 0) return root;
|
|
19
|
+
return typeof document !== "undefined" ? document : null;
|
|
20
|
+
}
|
|
21
|
+
function querySelectorSafe(selector, root) {
|
|
22
|
+
const queryRoot = getQueryRoot(root);
|
|
23
|
+
if (!queryRoot) return null;
|
|
24
|
+
try {
|
|
25
|
+
return queryRoot.querySelector(selector);
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function querySelectorAllSafe(selector, root) {
|
|
31
|
+
const queryRoot = getQueryRoot(root);
|
|
32
|
+
if (!queryRoot) return [];
|
|
33
|
+
try {
|
|
34
|
+
return Array.from(queryRoot.querySelectorAll(selector));
|
|
35
|
+
} catch {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { querySelectorSafe as i, matchesSelectorSafe as n, querySelectorAllSafe as r, isElement as t };
|