ropav 0.0.10 → 0.0.12
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 +9 -0
- package/dist/accordion.css +115 -111
- package/dist/accordion.js +60 -16
- package/dist/alert.css +110 -108
- package/dist/alert.js +48 -26
- package/dist/aspect-ratio.css +17 -15
- package/dist/aspect-ratio.js +20 -6
- package/dist/avatar.css +98 -96
- package/dist/avatar.js +27 -16
- package/dist/badge.css +95 -93
- package/dist/badge.js +29 -16
- package/dist/base.css +672 -671
- package/dist/button-group.css +39 -37
- package/dist/button-group.js +23 -12
- package/dist/button-link.css +160 -158
- package/dist/button-link.js +43 -24
- package/dist/button.css +160 -158
- package/dist/button.js +37 -19
- package/dist/card.css +109 -107
- package/dist/card.js +42 -17
- package/dist/checkbox.css +139 -137
- package/dist/checkbox.js +103 -33
- package/dist/collapse.css +29 -27
- package/dist/collapse.js +44 -10
- package/dist/color-input.css +137 -107
- package/dist/color-input.js +117 -30
- package/dist/color-picker.css +309 -303
- package/dist/color-picker.js +147 -54
- package/dist/color-picker2.js +9 -1
- package/dist/color-swatch.css +48 -46
- package/dist/color-swatch.js +15 -11
- package/dist/color-swatch2.js +4 -0
- package/dist/components/accordion/accordion-item.d.ts +13 -1
- package/dist/components/accordion/index.d.ts +2 -1
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/accordion/types.d.ts +9 -4
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +2 -2
- package/dist/components/alert/types.d.ts +4 -1
- package/dist/components/aspect-ratio/index.d.ts +2 -1
- package/dist/components/aspect-ratio/index.js +2 -2
- package/dist/components/aspect-ratio/types.d.ts +4 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/types.d.ts +4 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +2 -2
- package/dist/components/badge/types.d.ts +4 -1
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/types.d.ts +4 -1
- package/dist/components/button-group/index.d.ts +2 -1
- package/dist/components/button-group/index.js +2 -2
- package/dist/components/button-group/types.d.ts +4 -1
- package/dist/components/button-link/index.d.ts +2 -1
- package/dist/components/button-link/index.js +2 -2
- package/dist/components/button-link/types.d.ts +4 -1
- package/dist/components/card/index.d.ts +2 -1
- package/dist/components/card/index.js +2 -2
- package/dist/components/card/types.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts +4 -1
- package/dist/components/checkbox/index.d.ts +2 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/checkbox/types.d.ts +11 -2
- package/dist/components/checkbox/useCheckbox.d.ts +3 -1
- package/dist/components/collapse/collapse.d.ts +2 -2
- package/dist/components/collapse/index.d.ts +2 -1
- package/dist/components/collapse/index.js +2 -2
- package/dist/components/collapse/types.d.ts +9 -2
- package/dist/components/color-input/index.d.ts +2 -1
- package/dist/components/color-input/index.js +2 -2
- package/dist/components/color-input/types.d.ts +8 -2
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/color-input/useColorInputValue.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/types.d.ts +13 -1
- package/dist/components/color-swatch/index.d.ts +2 -1
- package/dist/components/color-swatch/index.js +2 -1
- package/dist/components/color-swatch/types.d.ts +4 -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 -0
- 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 +6 -3
- package/dist/components/dropdown-menu/index.d.ts +32 -1
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/dropdown-menu/types.d.ts +145 -6
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +15 -3
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +10 -3
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +2 -1
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +4 -4
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +19 -0
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +27 -0
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +14 -2
- package/dist/components/field/index.d.ts +2 -1
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/types.d.ts +4 -1
- package/dist/components/floating/index.d.ts +3 -0
- package/dist/components/floating/index.js +3 -0
- package/dist/components/floating/types.d.ts +105 -0
- package/dist/components/floating/useFloatingPosition.d.ts +15 -0
- package/dist/components/floating/useHoverDisclosure.d.ts +2 -0
- package/dist/components/focus-trap/focus-trap.d.ts +31 -0
- package/dist/components/focus-trap/index.d.ts +4 -0
- package/dist/components/focus-trap/index.js +3 -0
- package/dist/components/focus-trap/types.d.ts +41 -0
- package/dist/components/focus-trap/useFocusTrap.d.ts +2 -0
- package/dist/components/icon-button/index.d.ts +2 -1
- package/dist/components/icon-button/index.js +2 -1
- package/dist/components/icon-button/types.d.ts +4 -1
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/index.js +2 -1
- package/dist/components/input/input.d.ts +4 -1
- package/dist/components/input/types.d.ts +7 -2
- package/dist/components/modal/index.d.ts +2 -1
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/modal/types.d.ts +11 -1
- package/dist/components/modal/useModal.d.ts +7 -4
- package/dist/components/number-input/index.d.ts +2 -1
- package/dist/components/number-input/index.js +2 -2
- package/dist/components/number-input/types.d.ts +7 -2
- package/dist/components/number-input/useNumberInput.d.ts +2 -1
- package/dist/components/overlay/index.d.ts +2 -1
- package/dist/components/overlay/index.js +2 -1
- package/dist/components/overlay/types.d.ts +4 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/types.d.ts +20 -11
- package/dist/components/popover/usePopover.d.ts +9 -1
- package/dist/components/progress/index.d.ts +2 -2
- package/dist/components/progress/index.js +2 -2
- package/dist/components/progress/types.d.ts +4 -1
- package/dist/components/radio/index.d.ts +2 -1
- package/dist/components/radio/index.js +2 -2
- package/dist/components/radio/radio.d.ts +8 -3
- package/dist/components/radio/types.d.ts +37 -4
- package/dist/components/radio/useRadio.d.ts +12 -4
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/types.d.ts +10 -2
- package/dist/components/select/useSelect.d.ts +3 -1
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/range-slider-tooltip.d.ts +3 -0
- package/dist/components/slider/range-slider.d.ts +7 -4
- package/dist/components/slider/slider.d.ts +4 -1
- package/dist/components/slider/sliderCore.d.ts +4 -4
- package/dist/components/slider/types.d.ts +22 -4
- package/dist/components/slider/useRangeSlider.d.ts +2 -2
- package/dist/components/slider/useSlider.d.ts +2 -2
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/switch/switch.d.ts +4 -1
- package/dist/components/switch/types.d.ts +11 -2
- package/dist/components/switch/useSwitch.d.ts +3 -1
- package/dist/components/tabs/index.d.ts +2 -1
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tabs/types.d.ts +13 -4
- package/dist/components/teleport-provider/index.d.ts +3 -0
- package/dist/components/teleport-provider/index.js +3 -0
- package/dist/components/teleport-provider/teleport-provider.d.ts +21 -0
- package/dist/components/teleport-provider/types.d.ts +4 -0
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +6 -0
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/textarea/textarea.d.ts +4 -1
- package/dist/components/textarea/types.d.ts +10 -2
- package/dist/components/textarea/useTextarea.d.ts +2 -1
- package/dist/components/toast/index.d.ts +3 -2
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-store.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/toast/types.d.ts +20 -10
- package/dist/components/toast/useToast.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/components/tooltip/index.js +2 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/types.d.ts +13 -12
- package/dist/components/tooltip/useTooltip.d.ts +12 -2
- package/dist/composables/useOverlayLayer.d.ts +32 -0
- package/dist/dialog.js +510 -0
- package/dist/dropdown-menu.css +191 -108
- package/dist/dropdown-menu.js +1954 -198
- package/dist/field.css +41 -39
- package/dist/field.js +40 -16
- package/dist/floating.js +403 -0
- package/dist/focus-trap.js +80 -0
- package/dist/icon-button.css +193 -189
- package/dist/icon-button.js +23 -18
- package/dist/icon-button2.js +8 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +39 -32
- package/dist/input.css +122 -120
- package/dist/input.js +63 -40
- package/dist/input2.js +9 -0
- package/dist/legacy-unlayered.css +5382 -0
- package/dist/modal.css +129 -127
- package/dist/modal.js +182 -281
- package/dist/number-input.css +87 -85
- package/dist/number-input.js +98 -26
- package/dist/overlay.css +26 -24
- package/dist/overlay.js +17 -9
- package/dist/overlay2.js +4 -0
- package/dist/popover.css +140 -107
- package/dist/popover.js +276 -196
- package/dist/popover2.js +6 -1
- package/dist/progress.css +101 -99
- package/dist/progress.js +50 -28
- package/dist/radio.css +114 -105
- package/dist/radio.js +237 -61
- package/dist/select.css +255 -242
- package/dist/select.js +257 -94
- package/dist/slider.css +1090 -1031
- package/dist/slider.js +443 -175
- package/dist/styles-api.d.ts +22 -0
- package/dist/styles-api.js +49 -0
- package/dist/switch.css +120 -108
- package/dist/switch.js +112 -38
- package/dist/tabs.css +286 -278
- package/dist/tabs.js +60 -21
- package/dist/teleport-provider.js +15 -0
- package/dist/textarea.css +132 -130
- package/dist/textarea.js +83 -31
- package/dist/toast.css +229 -225
- package/dist/toast.js +189 -118
- package/dist/tooltip.css +61 -106
- package/dist/tooltip.js +184 -228
- package/dist/tooltip2.js +8 -0
- package/dist/useControlState.js +4 -0
- package/dist/useFloatingPosition.js +1317 -0
- package/dist/useFocusTrap.js +130 -0
- package/dist/useFormControl.js +107 -0
- package/dist/useOverlayLayer.js +262 -0
- package/dist/useTeleportTarget.js +40 -0
- package/docs/public-floating-api.md +148 -0
- package/docs/public-styles-api.md +134 -0
- package/docs/public-tokens.md +545 -0
- package/package.json +37 -9
- package/src/styles/_tokens.scss +33 -28
- package/src/styles/_utilities.scss +11 -9
- package/src/styles/styles-manifest.json +4125 -0
- package/dist/rafScheduler.js +0 -34
- package/dist/useClickOutside.js +0 -24
package/dist/popover.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import './popover.css';
|
|
2
2
|
import { t as bem } from "./bem.js";
|
|
3
|
+
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
3
4
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
5
|
+
import { t as useOverlayLayer } from "./useOverlayLayer.js";
|
|
6
|
+
import { t as useFocusTrap } from "./useFocusTrap.js";
|
|
7
|
+
import { n as useFloatingPosition, r as useFloatingTarget, t as isElementReference } from "./useFloatingPosition.js";
|
|
8
|
+
import { n as useTeleportPositioningKey, r as useTeleportTarget } from "./useTeleportTarget.js";
|
|
9
|
+
import { VaporTeleport, VaporTransition, applyVShow, computed, createComponent, createIf, createInvoker, createSlot, createTemplateRefSetter, defineVaporComponent, delegateEvents, extend, isRef, nextTick, ref, renderEffect, setAttr, setDynamicProps, setInsertionState, setStaticTemplateRef, setStyle, template, unref, useAttrs, useId, useSlots, watch } from "vue";
|
|
6
10
|
//#region src/components/popover/usePopover.ts
|
|
7
11
|
var DEFAULT_PLACEMENT = "bottom";
|
|
8
12
|
var DEFAULT_ROLE = "dialog";
|
|
@@ -11,51 +15,6 @@ var TARGET_ATTRIBUTES = [
|
|
|
11
15
|
"aria-expanded",
|
|
12
16
|
"aria-haspopup"
|
|
13
17
|
];
|
|
14
|
-
function isHTMLElement(value) {
|
|
15
|
-
return typeof HTMLElement !== "undefined" && value instanceof HTMLElement;
|
|
16
|
-
}
|
|
17
|
-
function getTargetPosition(rect, placement) {
|
|
18
|
-
const centerX = rect.left + rect.width / 2;
|
|
19
|
-
const centerY = rect.top + rect.height / 2;
|
|
20
|
-
const [side, alignment = "center"] = placement.split("-");
|
|
21
|
-
const alignedX = alignment === "start" ? rect.left : alignment === "end" ? rect.right : centerX;
|
|
22
|
-
const alignedY = alignment === "start" ? rect.top : alignment === "end" ? rect.bottom : centerY;
|
|
23
|
-
switch (side) {
|
|
24
|
-
case "right": return {
|
|
25
|
-
x: rect.right,
|
|
26
|
-
y: alignedY
|
|
27
|
-
};
|
|
28
|
-
case "bottom": return {
|
|
29
|
-
x: alignedX,
|
|
30
|
-
y: rect.bottom
|
|
31
|
-
};
|
|
32
|
-
case "left": return {
|
|
33
|
-
x: rect.left,
|
|
34
|
-
y: alignedY
|
|
35
|
-
};
|
|
36
|
-
default: return {
|
|
37
|
-
x: alignedX,
|
|
38
|
-
y: rect.top
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function setPixelVar(style, variable, value) {
|
|
43
|
-
if (value != null) style[variable] = `${value}px`;
|
|
44
|
-
}
|
|
45
|
-
function styleOrUndefined(style) {
|
|
46
|
-
return Object.keys(style).length > 0 ? style : void 0;
|
|
47
|
-
}
|
|
48
|
-
function resolveOffsetStyle(offset) {
|
|
49
|
-
if (offset == null) return void 0;
|
|
50
|
-
const style = {};
|
|
51
|
-
if (typeof offset === "number") {
|
|
52
|
-
setPixelVar(style, "--_rp-popover-main-axis-offset", offset);
|
|
53
|
-
return style;
|
|
54
|
-
}
|
|
55
|
-
setPixelVar(style, "--_rp-popover-main-axis-offset", offset.mainAxis);
|
|
56
|
-
setPixelVar(style, "--_rp-popover-cross-axis-offset", offset.crossAxis);
|
|
57
|
-
return styleOrUndefined(style);
|
|
58
|
-
}
|
|
59
18
|
function addIdReference(currentValue, id) {
|
|
60
19
|
const ids = (currentValue ?? "").split(/\s+/).filter(Boolean);
|
|
61
20
|
if (!ids.includes(id)) ids.push(id);
|
|
@@ -78,53 +37,86 @@ function applyTargetAttributes(element, snapshot, options) {
|
|
|
78
37
|
element.setAttribute("aria-expanded", String(options.expanded));
|
|
79
38
|
element.setAttribute("aria-haspopup", options.role);
|
|
80
39
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
40
|
+
function isFocusTrapContainer(value) {
|
|
41
|
+
return typeof HTMLElement !== "undefined" && value instanceof HTMLElement || typeof SVGElement !== "undefined" && value instanceof SVGElement;
|
|
42
|
+
}
|
|
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;
|
|
91
50
|
}
|
|
92
51
|
function usePopover(props, emitOpenChange) {
|
|
93
52
|
const slots = useSlots();
|
|
53
|
+
const attrs = useAttrs();
|
|
94
54
|
const generatedId = useId();
|
|
95
55
|
const rootRef = ref(null);
|
|
96
|
-
const
|
|
97
|
-
const
|
|
56
|
+
const contentRef = ref(null);
|
|
57
|
+
const arrowRef = ref(null);
|
|
98
58
|
const uncontrolledOpen = ref(false);
|
|
99
|
-
const positionScheduler = createRafScheduler(updateTargetPosition, () => targetElement.value?.ownerDocument.defaultView);
|
|
100
59
|
const popoverId = computed(() => props.id ?? `${generatedId}-popover`);
|
|
101
60
|
const placement = computed(() => props.placement ?? DEFAULT_PLACEMENT);
|
|
102
61
|
const popoverRole = computed(() => props.role ?? DEFAULT_ROLE);
|
|
103
|
-
const
|
|
104
|
-
const
|
|
62
|
+
const teleportTo = useTeleportTarget(() => props.teleportTo);
|
|
63
|
+
const teleportPositioningKey = useTeleportPositioningKey();
|
|
64
|
+
const { isExplicitTarget, reference, resolvedTarget } = useFloatingTarget(() => props.target, rootRef);
|
|
65
|
+
const targetElement = computed(() => isElementReference(resolvedTarget.value) ? resolvedTarget.value : null);
|
|
66
|
+
const hasContent = computed(() => Boolean(slots.content || isExplicitTarget.value && slots.default));
|
|
105
67
|
const isDisabled = computed(() => Boolean(props.disabled || !hasContent.value));
|
|
106
68
|
const isOpen = computed(() => props.open ?? uncontrolledOpen.value);
|
|
107
69
|
const isVisible = computed(() => isOpen.value && !isDisabled.value);
|
|
70
|
+
const layer = useOverlayLayer({
|
|
71
|
+
active: isVisible,
|
|
72
|
+
element: contentRef,
|
|
73
|
+
baseZIndex: 100
|
|
74
|
+
});
|
|
108
75
|
const shouldRenderContent = computed(() => !isDisabled.value && (Boolean(props.keepMounted) || isVisible.value));
|
|
109
76
|
const shouldShowContent = computed(() => !props.keepMounted || isVisible.value);
|
|
110
|
-
const shouldWireTarget = computed(() => isTargetMode.value && !isDisabled.value);
|
|
111
77
|
const ariaLabel = computed(() => props.ariaLabel || void 0);
|
|
112
78
|
const ariaLabelledby = computed(() => props.ariaLabelledby || void 0);
|
|
113
79
|
const ariaDescribedby = computed(() => props.ariaDescribedby || void 0);
|
|
80
|
+
const focusTrapContainers = computed(() => {
|
|
81
|
+
const content = contentRef.value;
|
|
82
|
+
if (!content) return null;
|
|
83
|
+
const trigger = targetElement.value ?? rootRef.value;
|
|
84
|
+
return isFocusTrapContainer(trigger) ? [
|
|
85
|
+
trigger,
|
|
86
|
+
content,
|
|
87
|
+
...layer.focusBranches.value
|
|
88
|
+
] : [content, ...layer.focusBranches.value];
|
|
89
|
+
});
|
|
90
|
+
const floating = useFloatingPosition({
|
|
91
|
+
reference,
|
|
92
|
+
floating: contentRef,
|
|
93
|
+
arrow: arrowRef,
|
|
94
|
+
open: isVisible,
|
|
95
|
+
placement: () => placement.value,
|
|
96
|
+
strategy: () => props.strategy ?? "absolute",
|
|
97
|
+
offset: () => props.offset,
|
|
98
|
+
flip: () => props.flip !== false,
|
|
99
|
+
shift: () => props.shift !== false,
|
|
100
|
+
collisionPadding: () => props.collisionPadding ?? 8,
|
|
101
|
+
restartKey: () => [
|
|
102
|
+
Boolean(props.teleport),
|
|
103
|
+
teleportTo.value,
|
|
104
|
+
teleportPositioningKey.value
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
const placementSide = computed(() => floating.actualPlacement.value.split("-")[0]);
|
|
114
108
|
const rootClass = computed(() => bem("rp-popover", {
|
|
115
|
-
[`placement-${
|
|
116
|
-
target:
|
|
109
|
+
[`placement-${floating.actualPlacement.value}`]: true,
|
|
110
|
+
target: isExplicitTarget.value,
|
|
117
111
|
open: isVisible.value,
|
|
118
|
-
disabled: props.disabled
|
|
112
|
+
disabled: props.disabled,
|
|
113
|
+
arrow: props.arrow
|
|
114
|
+
}));
|
|
115
|
+
const contentStyle = computed(() => ({
|
|
116
|
+
...floating.floatingStyle.value,
|
|
117
|
+
...resolveOffsetStyle(props.offset),
|
|
118
|
+
zIndex: layer.zIndex.value
|
|
119
119
|
}));
|
|
120
|
-
const contentStyle = computed(() => {
|
|
121
|
-
const style = { ...resolveOffsetStyle(props.offset) };
|
|
122
|
-
if (isTargetMode.value && targetPosition.value) {
|
|
123
|
-
setPixelVar(style, "--_rp-popover-target-x", targetPosition.value.x);
|
|
124
|
-
setPixelVar(style, "--_rp-popover-target-y", targetPosition.value.y);
|
|
125
|
-
}
|
|
126
|
-
return styleOrUndefined(style);
|
|
127
|
-
});
|
|
128
120
|
const triggerProps = computed(() => ({
|
|
129
121
|
"aria-controls": isDisabled.value ? void 0 : popoverId.value,
|
|
130
122
|
"aria-expanded": isDisabled.value ? void 0 : isVisible.value,
|
|
@@ -142,18 +134,38 @@ function usePopover(props, emitOpenChange) {
|
|
|
142
134
|
triggerProps: triggerProps.value,
|
|
143
135
|
...contentSlotProps.value
|
|
144
136
|
}));
|
|
137
|
+
let shouldReturnFocus = props.returnFocus !== false;
|
|
138
|
+
const focusTrap = useFocusTrap(focusTrapContainers, {
|
|
139
|
+
...props.focusTrapOptions,
|
|
140
|
+
initialFocus: () => {
|
|
141
|
+
const initialFocus = props.initialFocus;
|
|
142
|
+
return isRef(initialFocus) ? initialFocus.value ?? void 0 : initialFocus ?? void 0;
|
|
143
|
+
},
|
|
144
|
+
fallbackFocus: () => contentRef.value,
|
|
145
|
+
returnFocusOnDeactivate: props.returnFocus !== false,
|
|
146
|
+
escapeDeactivates: false,
|
|
147
|
+
allowOutsideClick: true
|
|
148
|
+
});
|
|
145
149
|
function setOpen(nextOpen) {
|
|
146
150
|
const previousOpen = isOpen.value;
|
|
147
151
|
if (props.open === void 0) uncontrolledOpen.value = nextOpen;
|
|
148
152
|
if (previousOpen !== nextOpen) emitOpenChange?.(nextOpen);
|
|
149
153
|
}
|
|
150
154
|
function openPopover() {
|
|
151
|
-
if (isDisabled.value)
|
|
152
|
-
setOpen(true);
|
|
155
|
+
if (!isDisabled.value) setOpen(true);
|
|
153
156
|
}
|
|
154
157
|
function closePopover() {
|
|
158
|
+
shouldReturnFocus = props.returnFocus !== false;
|
|
155
159
|
setOpen(false);
|
|
156
160
|
}
|
|
161
|
+
function closePopoverWithoutReturnFocus() {
|
|
162
|
+
shouldReturnFocus = false;
|
|
163
|
+
if (props.trapFocus) focusTrap.deactivate({ returnFocus: false });
|
|
164
|
+
setOpen(false);
|
|
165
|
+
nextTick(() => {
|
|
166
|
+
if (props.trapFocus && isVisible.value) focusTrap.activate();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
157
169
|
function togglePopover() {
|
|
158
170
|
if (isVisible.value) closePopover();
|
|
159
171
|
else openPopover();
|
|
@@ -162,117 +174,97 @@ function usePopover(props, emitOpenChange) {
|
|
|
162
174
|
togglePopover();
|
|
163
175
|
}
|
|
164
176
|
function onTriggerKeydown(event) {
|
|
165
|
-
if (event.key !== "Escape") return;
|
|
177
|
+
if (event.key !== "Escape" || !isVisible.value) return;
|
|
166
178
|
event.stopPropagation();
|
|
167
179
|
closePopover();
|
|
168
180
|
}
|
|
169
|
-
function onTargetClick() {
|
|
170
|
-
togglePopover();
|
|
171
|
-
}
|
|
172
|
-
function readTarget() {
|
|
173
|
-
return isRef(props.target) ? props.target.value : props.target;
|
|
174
|
-
}
|
|
175
|
-
function updateTargetPosition() {
|
|
176
|
-
if (!isTargetMode.value || !targetElement.value) {
|
|
177
|
-
targetPosition.value = null;
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
targetPosition.value = getTargetPosition(targetElement.value.getBoundingClientRect(), placement.value);
|
|
181
|
-
}
|
|
182
181
|
function isEventInsidePopover(event) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
return layer.isInside(event, [rootRef.value, targetElement.value]);
|
|
183
|
+
}
|
|
184
|
+
function onCompositeFocusout(event) {
|
|
185
|
+
const nextTarget = event.relatedTarget;
|
|
186
|
+
if (nextTarget instanceof Node && (rootRef.value?.contains(nextTarget) || contentRef.value?.contains(nextTarget) || targetElement.value?.contains(nextTarget))) return;
|
|
187
|
+
const listener = attrs.onFocusout;
|
|
188
|
+
const listeners = Array.isArray(listener) ? listener : [listener];
|
|
189
|
+
for (const current of listeners) if (typeof current === "function") current(event);
|
|
186
190
|
}
|
|
187
191
|
function onDocumentClick(event) {
|
|
192
|
+
if (!layer.isTopLayer()) return;
|
|
188
193
|
if (props.closeOnOutsideClick === false || isEventInsidePopover(event)) return;
|
|
189
|
-
|
|
194
|
+
closePopoverWithoutReturnFocus();
|
|
195
|
+
}
|
|
196
|
+
function onDocumentPointerDown(event) {
|
|
197
|
+
if (!layer.isTopLayer()) return;
|
|
198
|
+
if (props.closeOnOutsideClick === false || isEventInsidePopover(event)) return;
|
|
199
|
+
closePopoverWithoutReturnFocus();
|
|
190
200
|
}
|
|
191
201
|
function onDocumentKeydown(event) {
|
|
202
|
+
if (!layer.isTopLayer()) return;
|
|
192
203
|
if (props.closeOnEscape === false || event.key !== "Escape") return;
|
|
193
204
|
closePopover();
|
|
194
205
|
}
|
|
195
|
-
function syncTargetElement() {
|
|
196
|
-
positionScheduler.cancel();
|
|
197
|
-
const nextTarget = isTargetMode.value ? resolveTargetElement(readTarget()) : null;
|
|
198
|
-
if (targetElement.value !== nextTarget) targetElement.value = nextTarget;
|
|
199
|
-
if (!nextTarget) {
|
|
200
|
-
targetPosition.value = null;
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
206
|
watch(isDisabled, (disabled) => {
|
|
205
207
|
if (disabled) closePopover();
|
|
206
208
|
});
|
|
207
|
-
watch(() =>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
});
|
|
209
|
+
watch([isVisible, () => props.trapFocus], ([visible, trapFocus]) => {
|
|
210
|
+
if (visible && trapFocus) {
|
|
211
|
+
shouldReturnFocus = props.returnFocus !== false;
|
|
212
|
+
focusTrap.activate();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
focusTrap.deactivate({ returnFocus: shouldReturnFocus && props.returnFocus !== false });
|
|
216
|
+
shouldReturnFocus = props.returnFocus !== false;
|
|
217
|
+
}, {
|
|
218
|
+
flush: "post",
|
|
219
|
+
immediate: true
|
|
220
|
+
});
|
|
221
|
+
watch([isExplicitTarget, targetElement], ([explicit, target], _previous, onCleanup) => {
|
|
222
|
+
if (!explicit || !target) return;
|
|
223
|
+
target.addEventListener("click", onTriggerClick);
|
|
224
|
+
onCleanup(() => target.removeEventListener("click", onTriggerClick));
|
|
214
225
|
}, { flush: "sync" });
|
|
215
226
|
watch([
|
|
216
|
-
|
|
227
|
+
isExplicitTarget,
|
|
217
228
|
targetElement,
|
|
218
229
|
popoverId,
|
|
219
230
|
popoverRole,
|
|
220
|
-
isVisible
|
|
221
|
-
|
|
222
|
-
|
|
231
|
+
isVisible,
|
|
232
|
+
isDisabled
|
|
233
|
+
], ([explicit, target, id, role, visible, disabled], _previous, onCleanup) => {
|
|
234
|
+
if (!explicit || !target || disabled) return;
|
|
223
235
|
const snapshot = snapshotAttributes(target);
|
|
224
236
|
applyTargetAttributes(target, snapshot, {
|
|
225
|
-
id
|
|
226
|
-
expanded:
|
|
227
|
-
role
|
|
228
|
-
});
|
|
229
|
-
onCleanup(() => {
|
|
230
|
-
restoreAttributes(target, snapshot);
|
|
231
|
-
});
|
|
232
|
-
}, { flush: "sync" });
|
|
233
|
-
watch([
|
|
234
|
-
isVisible,
|
|
235
|
-
isTargetMode,
|
|
236
|
-
targetElement
|
|
237
|
-
], ([visible, targetMode, target], _previous, onCleanup) => {
|
|
238
|
-
const view = target?.ownerDocument.defaultView;
|
|
239
|
-
if (!visible || !targetMode || !view) return;
|
|
240
|
-
view.addEventListener("resize", positionScheduler.schedule);
|
|
241
|
-
view.addEventListener("scroll", positionScheduler.schedule, true);
|
|
242
|
-
onCleanup(() => {
|
|
243
|
-
view.removeEventListener("resize", positionScheduler.schedule);
|
|
244
|
-
view.removeEventListener("scroll", positionScheduler.schedule, true);
|
|
245
|
-
positionScheduler.cancel();
|
|
237
|
+
id,
|
|
238
|
+
expanded: visible,
|
|
239
|
+
role
|
|
246
240
|
});
|
|
241
|
+
onCleanup(() => restoreAttributes(target, snapshot));
|
|
247
242
|
}, { flush: "sync" });
|
|
248
243
|
watch(isVisible, (visible, _previous, onCleanup) => {
|
|
249
244
|
if (!visible || typeof document === "undefined") return;
|
|
250
245
|
document.addEventListener("click", onDocumentClick, true);
|
|
246
|
+
document.addEventListener("mousedown", onDocumentPointerDown, true);
|
|
247
|
+
document.addEventListener("touchstart", onDocumentPointerDown, true);
|
|
251
248
|
document.addEventListener("keydown", onDocumentKeydown);
|
|
252
249
|
onCleanup(() => {
|
|
253
250
|
document.removeEventListener("click", onDocumentClick, true);
|
|
251
|
+
document.removeEventListener("mousedown", onDocumentPointerDown, true);
|
|
252
|
+
document.removeEventListener("touchstart", onDocumentPointerDown, true);
|
|
254
253
|
document.removeEventListener("keydown", onDocumentKeydown);
|
|
255
254
|
});
|
|
256
255
|
}, {
|
|
257
256
|
flush: "sync",
|
|
258
257
|
immediate: true
|
|
259
258
|
});
|
|
260
|
-
watch([
|
|
261
|
-
targetElement,
|
|
262
|
-
placement,
|
|
263
|
-
isVisible
|
|
264
|
-
], () => {
|
|
265
|
-
positionScheduler.cancel();
|
|
266
|
-
if (isVisible.value) updateTargetPosition();
|
|
267
|
-
}, { flush: "sync" });
|
|
268
|
-
onMounted(syncTargetElement);
|
|
269
|
-
onBeforeUnmount(positionScheduler.cancel);
|
|
270
259
|
return {
|
|
271
260
|
rootRef,
|
|
261
|
+
contentRef,
|
|
262
|
+
arrowRef,
|
|
272
263
|
popoverId,
|
|
273
264
|
isOpen,
|
|
265
|
+
isDisabled,
|
|
274
266
|
isVisible,
|
|
275
|
-
isTargetMode,
|
|
267
|
+
isTargetMode: isExplicitTarget,
|
|
276
268
|
popoverRole,
|
|
277
269
|
ariaLabel,
|
|
278
270
|
ariaLabelledby,
|
|
@@ -284,26 +276,32 @@ function usePopover(props, emitOpenChange) {
|
|
|
284
276
|
triggerProps,
|
|
285
277
|
slotProps,
|
|
286
278
|
contentSlotProps,
|
|
279
|
+
actualPlacement: floating.actualPlacement,
|
|
280
|
+
placementSide,
|
|
281
|
+
arrowStyle: floating.arrowStyle,
|
|
282
|
+
teleportTo,
|
|
287
283
|
openPopover,
|
|
288
284
|
closePopover,
|
|
289
285
|
togglePopover,
|
|
290
|
-
onTriggerKeydown
|
|
286
|
+
onTriggerKeydown,
|
|
287
|
+
onCompositeFocusout
|
|
291
288
|
};
|
|
292
289
|
}
|
|
293
290
|
//#endregion
|
|
294
291
|
//#region src/components/popover/popover.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
295
|
-
var t0 = template("<
|
|
296
|
-
var t1 = template("<
|
|
292
|
+
var t0 = template("<span data-v-8af57bff class=rp-popover__arrow aria-hidden=true>");
|
|
293
|
+
var t1 = template("<section data-v-8af57bff>");
|
|
294
|
+
var t2 = template("<span data-v-8af57bff>", 1);
|
|
295
|
+
delegateEvents("focusout");
|
|
297
296
|
//#endregion
|
|
298
297
|
//#region src/components/popover/popover.vue
|
|
299
298
|
var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
300
299
|
name: "RpPopover",
|
|
300
|
+
inheritAttrs: false,
|
|
301
301
|
__name: "popover",
|
|
302
302
|
props: {
|
|
303
303
|
id: {},
|
|
304
|
-
|
|
305
|
-
placement: { default: "bottom" },
|
|
306
|
-
offset: {},
|
|
304
|
+
contentClass: {},
|
|
307
305
|
open: {
|
|
308
306
|
type: Boolean,
|
|
309
307
|
default: void 0
|
|
@@ -327,65 +325,147 @@ var popover_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
327
325
|
keepMounted: {
|
|
328
326
|
type: Boolean,
|
|
329
327
|
default: false
|
|
330
|
-
}
|
|
328
|
+
},
|
|
329
|
+
trapFocus: {
|
|
330
|
+
type: Boolean,
|
|
331
|
+
default: false
|
|
332
|
+
},
|
|
333
|
+
initialFocus: { default: null },
|
|
334
|
+
returnFocus: {
|
|
335
|
+
type: Boolean,
|
|
336
|
+
default: true
|
|
337
|
+
},
|
|
338
|
+
focusTrapOptions: { default: () => ({}) },
|
|
339
|
+
target: {},
|
|
340
|
+
placement: { default: "bottom" },
|
|
341
|
+
strategy: { default: "absolute" },
|
|
342
|
+
offset: {},
|
|
343
|
+
flip: {
|
|
344
|
+
type: Boolean,
|
|
345
|
+
default: true
|
|
346
|
+
},
|
|
347
|
+
shift: {
|
|
348
|
+
type: Boolean,
|
|
349
|
+
default: true
|
|
350
|
+
},
|
|
351
|
+
collisionPadding: { default: 8 },
|
|
352
|
+
arrow: {
|
|
353
|
+
type: Boolean,
|
|
354
|
+
default: false
|
|
355
|
+
},
|
|
356
|
+
teleport: {
|
|
357
|
+
type: Boolean,
|
|
358
|
+
default: true
|
|
359
|
+
},
|
|
360
|
+
teleportTo: {},
|
|
361
|
+
classNames: {},
|
|
362
|
+
styles: {}
|
|
331
363
|
},
|
|
332
364
|
emits: ["update:open"],
|
|
333
365
|
setup(__props, { emit: __emit }) {
|
|
334
366
|
const props = __props;
|
|
335
367
|
const emit = __emit;
|
|
336
|
-
const { rootRef, popoverId, isTargetMode, popoverRole, ariaLabel, ariaLabelledby, ariaDescribedby, shouldRenderContent, shouldShowContent, rootClass, contentStyle, slotProps, contentSlotProps } = usePopover(props, (open) => {
|
|
368
|
+
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) => {
|
|
337
369
|
emit("update:open", open);
|
|
338
370
|
});
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
371
|
+
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
372
|
+
const publicRootAttrs = computed(() => getRootAttrs({
|
|
373
|
+
class: rootClass.value,
|
|
374
|
+
onFocusout: onCompositeFocusout,
|
|
375
|
+
"data-state": slotProps.value.isOpen ? "open" : "closed",
|
|
376
|
+
"data-disabled": presence(isDisabled.value)
|
|
377
|
+
}, {}, ["onFocusout"]));
|
|
378
|
+
const styledTriggerProps = computed(() => {
|
|
379
|
+
const partAttrs = getPartAttrs("trigger");
|
|
380
|
+
return {
|
|
381
|
+
...slotProps.value.triggerProps,
|
|
382
|
+
...props.classNames?.trigger !== void 0 ? { class: partAttrs.class } : {},
|
|
383
|
+
...props.styles?.trigger !== void 0 ? { style: partAttrs.style } : {},
|
|
384
|
+
"data-state": slotProps.value.isOpen ? "open" : "closed",
|
|
385
|
+
"data-disabled": presence(isDisabled.value)
|
|
386
|
+
};
|
|
387
|
+
});
|
|
388
|
+
const contentAttrs = computed(() => ({
|
|
389
|
+
...getPartAttrs("content", {
|
|
390
|
+
class: "rp-popover__content",
|
|
391
|
+
compatibilityClass: props.contentClass,
|
|
392
|
+
style: contentStyle.value
|
|
393
|
+
}),
|
|
394
|
+
"data-state": slotProps.value.isOpen ? "open" : "closed",
|
|
395
|
+
"data-placement": actualPlacement.value
|
|
396
|
+
}));
|
|
397
|
+
const _setTemplateRef = createTemplateRefSetter();
|
|
398
|
+
const n16 = t2();
|
|
399
|
+
renderEffect(() => setDynamicProps(n16, [publicRootAttrs.value]));
|
|
400
|
+
setInsertionState(n16, null, 0);
|
|
342
401
|
createIf(() => !unref(isTargetMode), () => {
|
|
343
402
|
return createSlot("default", {
|
|
344
|
-
triggerProps: () =>
|
|
403
|
+
triggerProps: () => styledTriggerProps.value,
|
|
345
404
|
isOpen: () => unref(slotProps).isOpen,
|
|
346
405
|
open: () => unref(slotProps).open,
|
|
347
406
|
close: () => unref(slotProps).close,
|
|
348
407
|
toggle: () => unref(slotProps).toggle
|
|
349
408
|
}, null, 1);
|
|
350
409
|
});
|
|
351
|
-
setInsertionState(
|
|
352
|
-
createComponent(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
return
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
410
|
+
setInsertionState(n16, null, 1);
|
|
411
|
+
createComponent(VaporTeleport, {
|
|
412
|
+
to: () => unref(teleportTo),
|
|
413
|
+
disabled: () => !__props.teleport
|
|
414
|
+
}, () => {
|
|
415
|
+
return createComponent(VaporTransition, {
|
|
416
|
+
name: "rp-popover-content",
|
|
417
|
+
persisted: ""
|
|
418
|
+
}, extend(() => {
|
|
419
|
+
return createIf(() => unref(shouldRenderContent), () => {
|
|
420
|
+
const n13 = t1();
|
|
421
|
+
renderEffect(() => setDynamicProps(n13, [
|
|
422
|
+
{ id: unref(popoverId) },
|
|
423
|
+
contentAttrs.value,
|
|
424
|
+
{
|
|
425
|
+
role: unref(popoverRole),
|
|
426
|
+
"aria-label": unref(ariaLabel),
|
|
427
|
+
"aria-labelledby": unref(ariaLabelledby),
|
|
428
|
+
"aria-describedby": unref(ariaDescribedby),
|
|
429
|
+
"data-side": unref(placementSide),
|
|
430
|
+
tabindex: __props.trapFocus ? -1 : void 0
|
|
431
|
+
}
|
|
432
|
+
]));
|
|
433
|
+
setInsertionState(n13, null, 0);
|
|
434
|
+
createSlot("content", {
|
|
435
|
+
isOpen: () => unref(contentSlotProps).isOpen,
|
|
436
|
+
open: () => unref(contentSlotProps).open,
|
|
437
|
+
close: () => unref(contentSlotProps).close,
|
|
438
|
+
toggle: () => unref(contentSlotProps).toggle
|
|
439
|
+
}, () => {
|
|
440
|
+
return createIf(() => unref(isTargetMode), () => {
|
|
441
|
+
return createSlot("default", {
|
|
442
|
+
isOpen: () => unref(contentSlotProps).isOpen,
|
|
443
|
+
open: () => unref(contentSlotProps).open,
|
|
444
|
+
close: () => unref(contentSlotProps).close,
|
|
445
|
+
toggle: () => unref(contentSlotProps).toggle
|
|
446
|
+
}, null, 1);
|
|
447
|
+
}, null, 129);
|
|
448
|
+
}, 1);
|
|
449
|
+
setInsertionState(n13, null, 1);
|
|
450
|
+
createIf(() => __props.arrow, () => {
|
|
451
|
+
const n12 = t0();
|
|
452
|
+
_setTemplateRef(n12, arrowRef, null, "arrowRef");
|
|
453
|
+
renderEffect(() => {
|
|
454
|
+
setAttr(n12, "data-side", unref(placementSide));
|
|
455
|
+
setStyle(n12, unref(arrowStyle));
|
|
456
|
+
});
|
|
457
|
+
return n12;
|
|
458
|
+
});
|
|
459
|
+
applyVShow(n13, () => unref(shouldShowContent));
|
|
460
|
+
n13.$evtfocusout = createInvoker((e) => unref(onCompositeFocusout)(e));
|
|
461
|
+
_setTemplateRef(n13, contentRef, null, "contentRef");
|
|
462
|
+
return n13;
|
|
463
|
+
}, null, 129);
|
|
464
|
+
}, { _: 8 }));
|
|
465
|
+
});
|
|
466
|
+
setStaticTemplateRef(n16, rootRef, null, "rootRef");
|
|
467
|
+
return n16;
|
|
388
468
|
}
|
|
389
|
-
}), [["__scopeId", "data-v-
|
|
469
|
+
}), [["__scopeId", "data-v-8af57bff"]]);
|
|
390
470
|
//#endregion
|
|
391
471
|
export { popover_default as t };
|
package/dist/popover2.js
CHANGED