@plexui/vue 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Badge/Badge.js +1 -1
- package/dist/es/components/Badge/Badge.js.map +1 -1
- package/dist/es/components/Button/Button.js +13 -5
- package/dist/es/components/Button/Button.js.map +1 -1
- package/dist/es/components/Button/ButtonLink.js +7 -1
- package/dist/es/components/Button/ButtonLink.js.map +1 -1
- package/dist/es/components/Button/NavigationButton.js +27 -0
- package/dist/es/components/Button/NavigationButton.js.map +1 -0
- package/dist/es/components/Button/NavigationGlyph.js +27 -0
- package/dist/es/components/Button/NavigationGlyph.js.map +1 -0
- package/dist/es/components/Button/index.js +1 -0
- package/dist/es/components/Button/index.js.map +1 -1
- package/dist/es/components/Checkbox/Checkbox.js +14 -4
- package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/DateInput/DateInput.js +7 -3
- package/dist/es/components/DateInput/DateInput.js.map +1 -1
- package/dist/es/components/DatePicker/Calendar.js +130 -86
- package/dist/es/components/DatePicker/Calendar.js.map +1 -1
- package/dist/es/components/DatePicker/CalendarNavigationIcon.js +31 -0
- package/dist/es/components/DatePicker/CalendarNavigationIcon.js.map +1 -0
- package/dist/es/components/DatePicker/DatePicker.js +16 -4
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DatePicker/context.js.map +1 -1
- package/dist/es/components/DatePicker/useCalendarGutter.js +14 -0
- package/dist/es/components/DatePicker/useCalendarGutter.js.map +1 -0
- package/dist/es/components/DateRangePicker/Calendar.js +92 -71
- package/dist/es/components/DateRangePicker/Calendar.js.map +1 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js +13 -4
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/DateRangePicker/Trigger.js +1 -0
- package/dist/es/components/DateRangePicker/Trigger.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +124 -52
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/index.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +77 -24
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
- package/dist/es/components/Field/Field.js +58 -5
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/FieldGroup/FieldGroup.js +3 -1
- package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
- package/dist/es/components/FileUpload/FileUpload.js +50 -11
- package/dist/es/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +24 -13
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
- package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js +9 -3
- package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js.map +1 -1
- package/dist/es/components/Icon/index.js +1 -0
- package/dist/es/components/Icon/index.js.map +1 -1
- package/dist/es/components/Icon/svg/Disclosure.js +10 -0
- package/dist/es/components/Icon/svg/Disclosure.js.map +1 -0
- package/dist/es/components/Indicator/LoadingIndicator.js +2 -2
- package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
- package/dist/es/components/Input/Input.js +15 -5
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/InputGroup/InputGroup.js +3 -1
- package/dist/es/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js +126 -151
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +217 -35
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/Menu/internal.js +2 -1
- package/dist/es/components/Menu/internal.js.map +1 -1
- package/dist/es/components/OTPInput/OTPInput.js +7 -4
- package/dist/es/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/es/components/Page/Page.js +93 -14
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/Page/index.js +1 -1
- package/dist/es/components/Page/index.js.map +1 -1
- package/dist/es/components/Popover/Popover.js +16 -6
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/Popover/deferredPointerDownOutside.js +6 -0
- package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
- package/dist/es/components/RadioGroup/RadioGroup.js +29 -12
- package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/Select/Select.js +75 -25
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +58 -25
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/SelectControl/index.js +1 -1
- package/dist/es/components/SelectControl/index.js.map +1 -1
- package/dist/es/components/ShimmerText/ShimmerText.js +16 -3
- package/dist/es/components/ShimmerText/ShimmerText.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +56 -16
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Sortable/Sortable.js +20 -13
- package/dist/es/components/Sortable/Sortable.js.map +1 -1
- package/dist/es/components/Switch/Switch.js +6 -3
- package/dist/es/components/Switch/Switch.js.map +1 -1
- package/dist/es/components/Tabs/Tabs.js +12 -11
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/TagInput/TagInput.js +46 -6
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +13 -2
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/components/Toast/ToastRenderer.js +144 -0
- package/dist/es/components/Toast/ToastRenderer.js.map +1 -0
- package/dist/es/components/Toast/Toaster.js +23 -1
- package/dist/es/components/Toast/Toaster.js.map +1 -1
- package/dist/es/components/Toast/toastLifecycle.js +283 -0
- package/dist/es/components/Toast/toastLifecycle.js.map +1 -0
- package/dist/es/components/Toolbar/Toolbar.js +107 -0
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/es/components/Toolbar/index.js +2 -0
- package/dist/es/components/Toolbar/index.js.map +1 -0
- package/dist/es/components/Tooltip/CopyTooltip.js +39 -13
- package/dist/es/components/Tooltip/CopyTooltip.js.map +1 -1
- package/dist/es/components/Tooltip/Tooltip.js +35 -14
- package/dist/es/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/es/composables/useFloatingBoundary.js +48 -0
- package/dist/es/composables/useFloatingBoundary.js.map +1 -0
- package/dist/es/composables/usePhoneSubmenu.js +19 -0
- package/dist/es/composables/usePhoneSubmenu.js.map +1 -0
- package/dist/es/lib/copyToClipboard.js +16 -7
- package/dist/es/lib/copyToClipboard.js.map +1 -1
- package/dist/es/lib/floatingBoundary.js +90 -0
- package/dist/es/lib/floatingBoundary.js.map +1 -0
- package/dist/es/lib/focusRestore.js +56 -0
- package/dist/es/lib/focusRestore.js.map +1 -0
- package/dist/es/lib/helpers.js +0 -18
- package/dist/es/lib/helpers.js.map +1 -1
- package/dist/es/lib/inputMode.js +9 -0
- package/dist/es/lib/inputMode.js.map +1 -0
- package/dist/es/lib/menuInitialFocus.js +100 -0
- package/dist/es/lib/menuInitialFocus.js.map +1 -0
- package/dist/es/lib/menuSubmenuPlacement.js +219 -0
- package/dist/es/lib/menuSubmenuPlacement.js.map +1 -0
- package/dist/es/lib/observeTextareaWidth.js +49 -0
- package/dist/es/lib/observeTextareaWidth.js.map +1 -0
- package/dist/es/lib/selectPress.js +34 -0
- package/dist/es/lib/selectPress.js.map +1 -0
- package/dist/es/lib/sortable.js +74 -20
- package/dist/es/lib/sortable.js.map +1 -1
- package/dist/types/components/Button/Button.d.ts +6 -2
- package/dist/types/components/Button/ButtonLink.d.ts +6 -2
- package/dist/types/components/Button/NavigationButton.d.ts +27 -0
- package/dist/types/components/Button/NavigationGlyph.d.ts +16 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +12 -12
- package/dist/types/components/DateInput/DateInput.d.ts +4 -4
- package/dist/types/components/DatePicker/CalendarNavigationIcon.d.ts +6 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +13 -13
- package/dist/types/components/DatePicker/context.d.ts +1 -0
- package/dist/types/components/DatePicker/useCalendarGutter.d.ts +2 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +13 -13
- package/dist/types/components/Dialog/Dialog.d.ts +46 -11
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Field/Field.d.ts +2 -2
- package/dist/types/components/FileUpload/FileUpload.d.ts +6 -6
- package/dist/types/components/FloatingLabelInput/FloatingLabelInput.d.ts +4 -4
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/Icon/svg/Disclosure.d.ts +3 -0
- package/dist/types/components/Indicator/LoadingIndicator.d.ts +2 -2
- package/dist/types/components/Input/Input.d.ts +2 -2
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +8 -8
- package/dist/types/components/Menu/Menu.d.ts +18 -25
- package/dist/types/components/OTPInput/OTPInput.d.ts +6 -6
- package/dist/types/components/Page/Page.d.ts +48 -7
- package/dist/types/components/Page/index.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +17 -6
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +10 -10
- package/dist/types/components/SelectControl/index.d.ts +1 -1
- package/dist/types/components/Sortable/Sortable.d.ts +8 -8
- package/dist/types/components/Switch/Switch.d.ts +34 -12
- package/dist/types/components/Tabs/Tabs.d.ts +6 -6
- package/dist/types/components/TagInput/TagInput.d.ts +4 -4
- package/dist/types/components/Textarea/Textarea.d.ts +2 -2
- package/dist/types/components/Toast/ToastRenderer.d.ts +79 -0
- package/dist/types/components/Toast/Toaster.d.ts +6 -2
- package/dist/types/components/Toast/toastLifecycle.d.ts +90 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +149 -0
- package/dist/types/components/Toolbar/index.d.ts +1 -0
- package/dist/types/components/Tooltip/CopyTooltip.d.ts +2 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts +6 -6
- package/dist/types/composables/useFloatingBoundary.d.ts +24 -0
- package/dist/types/composables/usePhoneSubmenu.d.ts +3 -0
- package/dist/types/lib/floatingBoundary.d.ts +9 -0
- package/dist/types/lib/focusRestore.d.ts +5 -0
- package/dist/types/lib/helpers.d.ts +0 -4
- package/dist/types/lib/inputMode.d.ts +7 -0
- package/dist/types/lib/menuInitialFocus.d.ts +9 -0
- package/dist/types/lib/menuSubmenuPlacement.d.ts +44 -0
- package/dist/types/lib/observeTextareaWidth.d.ts +2 -0
- package/dist/types/lib/selectPress.d.ts +23 -0
- package/dist/types/lib/sortable.d.ts +1 -1
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ import { useDeferredPointerDownOutside } from "./deferredPointerDownOutside.js";
|
|
|
10
10
|
import { createPointerIntentArea, isPointInPolygon } from "./pointerIntent.js";
|
|
11
11
|
import { PopoverContextKey, usePopoverContext } from "./usePopoverContext.js";
|
|
12
12
|
import { usePopoverController } from "./usePopoverController.js";
|
|
13
|
+
import { isHoverPointer } from "../../lib/inputMode.js";
|
|
13
14
|
import s from "@plexui/styles/components/Popover/Popover.module.css";
|
|
14
15
|
const PopoverComponent = defineComponent({
|
|
15
16
|
name: "Popover",
|
|
@@ -22,7 +23,7 @@ const PopoverComponent = defineComponent({
|
|
|
22
23
|
hoverOpenDelay: { type: Number, default: 150 },
|
|
23
24
|
},
|
|
24
25
|
emits: {
|
|
25
|
-
"update:open": (
|
|
26
|
+
"update:open": (nextState) => typeof nextState === "boolean",
|
|
26
27
|
},
|
|
27
28
|
setup(props, { slots, emit }) {
|
|
28
29
|
const open = ref(false);
|
|
@@ -103,8 +104,8 @@ export const PopoverTrigger = defineComponent({
|
|
|
103
104
|
name: "PopoverTrigger",
|
|
104
105
|
inheritAttrs: false,
|
|
105
106
|
emits: {
|
|
106
|
-
pointerdown: (
|
|
107
|
-
click: (
|
|
107
|
+
pointerdown: (event) => typeof event.type === "string",
|
|
108
|
+
click: (event) => typeof event.type === "string",
|
|
108
109
|
},
|
|
109
110
|
setup(_props, { slots, emit }) {
|
|
110
111
|
const { open, setOpen, showOnHover, temporarilyPreventClickToClose, onTriggerEnter, onTriggerLeave, isPointerInTransitRef, triggerRef, contentRef, } = usePopoverContext();
|
|
@@ -128,7 +129,7 @@ export const PopoverTrigger = defineComponent({
|
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
const handlePointerMove = (evt) => {
|
|
131
|
-
if (evt
|
|
132
|
+
if (!isHoverPointer(evt)) {
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
134
135
|
if (!hasPointerMoveOpened && !isPointerInTransitRef.current) {
|
|
@@ -187,6 +188,8 @@ export const PopoverTrigger = defineComponent({
|
|
|
187
188
|
const contentProps = {
|
|
188
189
|
/** Avoids collisions with the viewport and scroll containers. @default true */
|
|
189
190
|
avoidCollisions: { type: Boolean, default: undefined },
|
|
191
|
+
/** Distance from viewport and scroll container boundaries, in pixels. @default 20 */
|
|
192
|
+
collisionPadding: { type: Number, default: 20 },
|
|
190
193
|
/** `width` of the popover; numbers are pixels. @default "auto" */
|
|
191
194
|
width: [Number, String],
|
|
192
195
|
/** `min-width` of the popover; numbers are pixels. @default 300 */
|
|
@@ -217,7 +220,10 @@ const PopoverContentElement = markRaw(defineComponent({
|
|
|
217
220
|
contentRef.value = el ?? null;
|
|
218
221
|
};
|
|
219
222
|
return () => {
|
|
220
|
-
const {
|
|
223
|
+
const { style, ...rest } = attrs;
|
|
224
|
+
delete rest.dir;
|
|
225
|
+
delete rest["aria-labelledby"];
|
|
226
|
+
delete rest.forceMount;
|
|
221
227
|
return h("div", { ...rest, style: withRadixVariableNames(style, "popover"), ref: setContentRef }, slots.default?.());
|
|
222
228
|
};
|
|
223
229
|
},
|
|
@@ -308,7 +314,7 @@ const PopoverContentImpl = defineComponent({
|
|
|
308
314
|
"alignOffset": props.alignOffset ?? (props.align === "center" ? 0 : -5),
|
|
309
315
|
"avoidCollisions": props.avoidCollisions ?? true,
|
|
310
316
|
"hideWhenDetached": true,
|
|
311
|
-
"collisionPadding":
|
|
317
|
+
"collisionPadding": props.collisionPadding,
|
|
312
318
|
"onOpenAutoFocus": preventDefaultHandler,
|
|
313
319
|
// Escape is handled by the Escape stack in PopoverContent
|
|
314
320
|
"onEscapeKeyDown": preventDefaultHandler,
|
|
@@ -328,6 +334,8 @@ const PopoverContentHoverable = defineComponent({
|
|
|
328
334
|
isPointerInTransitRef.current = false;
|
|
329
335
|
};
|
|
330
336
|
const handleCreateGraceArea = (event, hoverTarget) => {
|
|
337
|
+
if (!isHoverPointer(event))
|
|
338
|
+
return;
|
|
331
339
|
const graceArea = createPointerIntentArea(event, hoverTarget);
|
|
332
340
|
pointerGraceArea.value = graceArea;
|
|
333
341
|
isPointerInTransitRef.current = true;
|
|
@@ -355,6 +363,8 @@ const PopoverContentHoverable = defineComponent({
|
|
|
355
363
|
return;
|
|
356
364
|
}
|
|
357
365
|
const handleTrackPointerGrace = (event) => {
|
|
366
|
+
if (!isHoverPointer(event))
|
|
367
|
+
return;
|
|
358
368
|
const trigger = triggerRef.value;
|
|
359
369
|
const content = contentRef.value;
|
|
360
370
|
const target = event.target;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../../src/components/Popover/Popover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,OAAO,EACP,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EACL,eAAe,GAGhB,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,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Content":["import {\n computed,\n createCommentVNode,\n defineComponent,\n h,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n watchPostEffect,\n type ExtractPropTypes,\n type PropType,\n} from \"vue\"\nimport {\n PopoverAnchor as RekaPopoverAnchor,\n PopoverContent as RekaPopoverContent,\n PopoverPortal as RekaPopoverPortal,\n PopoverRoot as RekaPopoverRoot,\n injectPopoverRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { dataAttributes, focusableElements, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming } from \"../Transition/shared.js\"\nimport { withRadixVariableNames } from \"../Tooltip/Tooltip.js\"\nimport { composeEventHandlers, firstElementChild, mergeSlotProps } from \"../Tooltip/slot.js\"\nimport { useDeferredPointerDownOutside } from \"./deferredPointerDownOutside.js\"\nimport { createPointerIntentArea, isPointInPolygon, type Polygon } from \"./pointerIntent.js\"\nimport { PopoverContextKey, usePopoverContext, type PopoverContextValue } from \"./usePopoverContext.js\"\nimport { usePopoverController } from \"./usePopoverController.js\"\nimport s from \"@plexui/styles/components/Popover/Popover.module.css\"\n\n// Vue port of packages/ui/src/components/Popover/Popover.tsx on Reka UI.\n// Exports are flat (`PopoverTrigger`, `PopoverContent`) because\n// runtime-compiled templates cannot resolve `Popover.Trigger`; the static\n// properties are kept for render functions and SFCs.\n//\n// Reka keeps positioning, the dismissable layer, the focus scope and focus\n// return. As in Tooltip, the port follows Radix where they differ:\n// - The trigger is Radix's: it runs after the child's handlers and toggles\n// only when none called preventDefault(), carries no `id`, and has\n// `aria-controls` only while open.\n// - The content element is rendered here (Reka's `as`): Radix's custom\n// property names (the shared CSS reads `--radix-popover-content-*`), no\n// `dir`, no `aria-labelledby`.\n// - A press outside closes it on the click that follows, as Radix's\n// deferred outside press does (./deferredPointerDownOutside.ts).\n// - The portal renders once mounted, as Radix's does, so a closed popover\n// server-renders nothing.\n\nexport type PopoverSide = \"top\" | \"right\" | \"bottom\" | \"left\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\n\nconst PopoverComponent = defineComponent({\n name: \"Popover\",\n props: {\n /** Controlled visibility (`v-model:open`); uncontrolled when omitted */\n open: { type: Boolean, default: undefined },\n /** Opens on hover and focus instead of click. @default false */\n showOnHover: { type: Boolean, default: false },\n /** Delay before a hover popover opens, in milliseconds. @default 150 */\n hoverOpenDelay: { type: Number, default: 150 },\n },\n emits: {\n \"update:open\": (_nextState: boolean) => true,\n },\n setup(props, { slots, emit }) {\n const open = ref(false)\n const shake = ref(false)\n const triggerRef = shallowRef<HTMLElement | null>(null)\n const contentRef = shallowRef<HTMLElement | null>(null)\n let openTimer: ReturnType<typeof setTimeout> | undefined\n const hoverOpenFocusedWithTab = { current: false }\n const isPointerInTransitRef = { current: false }\n const isOpen = computed(() => props.open ?? open.value)\n\n const temporarilyPreventClickToClose = ref(false)\n watch(temporarilyPreventClickToClose, (prevent, _, onCleanup) => {\n if (!prevent) return\n const id = setTimeout(() => {\n temporarilyPreventClickToClose.value = false\n }, 500)\n onCleanup(() => clearTimeout(id))\n })\n\n const handleOpenChange = (nextState: boolean) => {\n clearTimeout(openTimer)\n\n // No-op if the state is not changing\n if (isOpen.value === nextState) {\n return\n }\n\n if (!nextState) {\n // clear any running shake animation on close\n shake.value = false\n\n // Check for specific hover conditions where focus should be\n // immediately restored to the trigger before closing\n if (props.showOnHover && hoverOpenFocusedWithTab.current) {\n triggerRef.value?.focus()\n }\n\n // Always cleanup this state\n hoverOpenFocusedWithTab.current = false\n }\n\n emit(\"update:open\", nextState)\n open.value = nextState\n\n if (props.showOnHover) {\n temporarilyPreventClickToClose.value = nextState\n }\n }\n\n const handleTriggerEnter = () => {\n openTimer = setTimeout(() => handleOpenChange(true), props.hoverOpenDelay)\n }\n\n const handleTriggerLeave = () => {\n clearTimeout(openTimer)\n }\n\n onBeforeUnmount(() => {\n clearTimeout(openTimer)\n })\n\n const store: PopoverContextValue = {\n open: isOpen,\n setOpen: handleOpenChange,\n shake,\n setShake: (next) => {\n shake.value = next\n },\n showOnHover: computed(() => props.showOnHover),\n temporarilyPreventClickToClose,\n onTriggerEnter: handleTriggerEnter,\n onTriggerLeave: handleTriggerLeave,\n isPointerInTransitRef,\n triggerRef,\n contentRef,\n hoverOpenFocusedWithTab,\n }\n provide(PopoverContextKey, store)\n\n return () =>\n h(\n RekaPopoverRoot,\n { \"open\": isOpen.value, \"onUpdate:open\": handleOpenChange, \"modal\": false },\n { default: () => slots.default?.() },\n )\n },\n})\n\n/**\n * Renders its child (a button, link, ...) as the popover trigger. Like\n * `Popover.Trigger` in React it takes no other props: attributes on it are\n * not passed on.\n */\nexport const PopoverTrigger = defineComponent({\n name: \"PopoverTrigger\",\n inheritAttrs: false,\n emits: {\n pointerdown: (_event: PointerEvent) => true,\n click: (_event: MouseEvent) => true,\n },\n setup(_props, { slots, emit }) {\n const {\n open,\n setOpen,\n showOnHover,\n temporarilyPreventClickToClose,\n onTriggerEnter,\n onTriggerLeave,\n isPointerInTransitRef,\n triggerRef,\n contentRef,\n } = usePopoverContext()\n const rootContext = injectPopoverRootContext()\n rootContext.contentId ||= useId(undefined, \"reka-popover-content\")\n const { forwardRef, currentElement } = useForwardExpose()\n let hasPointerMoveOpened = false\n\n // Focus returns here on close, and pointer-downs on it are not \"outside\".\n // Follows a replaced child element, as Radix's composed ref does\n watchPostEffect(() => {\n triggerRef.value = currentElement.value ?? null\n rootContext.triggerElement.value = currentElement.value\n })\n\n const maybePreventClickClose = (evt: Event) => {\n // Don't prevent temporary close if the trigger is an anchor tag itself\n const isLink = (evt.currentTarget as Element).nodeName.toLocaleLowerCase() === \"a\"\n\n if (!isLink && temporarilyPreventClickToClose.value) {\n // Prevents tooltip listeners from closing\n evt.preventDefault()\n evt.stopPropagation()\n }\n }\n\n const handlePointerMove = (evt: PointerEvent) => {\n if (evt.pointerType === \"touch\") {\n return\n }\n\n if (!hasPointerMoveOpened && !isPointerInTransitRef.current) {\n onTriggerEnter()\n hasPointerMoveOpened = true\n }\n }\n\n const handlePointerLeave = () => {\n if (!hasPointerMoveOpened) {\n return\n }\n\n onTriggerLeave()\n hasPointerMoveOpened = false\n }\n\n const handleBlur = () => {\n setTimeout(() => {\n // Ignore this handler if focus has moved into the popover\n if (contentRef.value?.contains(document.activeElement)) {\n return\n }\n\n setOpen(false)\n }, 50)\n }\n\n const onPointerdown = (evt: PointerEvent) => {\n maybePreventClickClose(evt)\n emit(\"pointerdown\", evt)\n }\n\n const onClick = composeEventHandlers(\n (evt: MouseEvent) => {\n maybePreventClickClose(evt)\n emit(\"click\", evt)\n },\n () => rootContext.onOpenToggle(),\n )\n\n return () => {\n const child = firstElementChild(slots.default?.())\n if (!child) return null\n\n const isOpen = open.value\n const hover = showOnHover.value\n // Radix's PopoverTrigger props, then Plex's handlers\n const triggerProps = {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n onPointerdown,\n onClick,\n \"onPointermove\": hover ? handlePointerMove : undefined,\n \"onPointerleave\": hover ? handlePointerLeave : undefined,\n \"onFocus\": hover ? () => setOpen(true) : undefined,\n \"onBlur\": hover ? handleBlur : undefined,\n }\n\n return h(RekaPopoverAnchor, { asChild: true, ref: forwardRef }, { default: () => mergeSlotProps(child, triggerProps) })\n }\n },\n})\n\nconst contentProps = {\n /** Avoids collisions with the viewport and scroll containers. @default true */\n avoidCollisions: { type: Boolean, default: undefined },\n /** `width` of the popover; numbers are pixels. @default \"auto\" */\n width: [Number, String] as PropType<number | \"auto\">,\n /** `min-width` of the popover; numbers are pixels. @default 300 */\n minWidth: [Number, String] as PropType<number | \"auto\">,\n /** `max-width` of the popover, in pixels */\n maxWidth: Number,\n /** Preferred side of the trigger. @default \"bottom\" */\n side: String as PropType<PopoverSide>,\n /** Distance from the trigger, in pixels. @default 8 */\n sideOffset: { type: Number, default: 8 },\n /** Preferred alignment against the trigger. @default \"center\" */\n align: String as PropType<PopoverAlign>,\n /** Offset from the \"start\" or \"end\" alignment, in pixels. @default 0 */\n alignOffset: Number,\n /** Translucent popover surface. @default false */\n translucent: { type: Boolean, default: undefined },\n /** Moves focus into the popover when it opens. @default true */\n autoFocus: { type: Boolean, default: true },\n}\n\ntype ContentProps = ExtractPropTypes<typeof contentProps>\n\n// The element Reka's content renders (`as`). Raw: Reka passes `as` through\n// reactive props, and Vue warns about a component made reactive.\nconst PopoverContentElement = markRaw(defineComponent({\n name: \"PopoverContentElement\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const { contentRef } = usePopoverContext()\n const setContentRef = (el: unknown) => {\n contentRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n const { \"dir\": _dir, \"aria-labelledby\": _labelledBy, \"forceMount\": _forceMount, style, ...rest } = attrs\n return h(\n \"div\",\n { ...rest, style: withRadixVariableNames(style, \"popover\"), ref: setContentRef },\n slots.default?.(),\n )\n }\n },\n}))\n\nconst PopoverContentImpl = defineComponent({\n name: \"PopoverContentImpl\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { showOnHover, shake, contentRef, setOpen, triggerRef } = usePopoverContext()\n const controller = usePopoverController()\n\n // Radix's non-modal content: a press on the trigger is left to the\n // trigger, and focus does not return to it after a press outside\n let pressedOutside = false\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n if (triggerRef.value?.contains(originalEvent.target as Node)) return\n pressedOutside = true\n setOpen(false)\n })\n const handleCloseAutoFocus = (event: Event) => {\n if (showOnHover.value || pressedOutside) event.preventDefault()\n else keepMovedFocus(event)\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const contentElement = contentRef.value\n\n if (\n // When the current target is our container\n contentElement &&\n evt.target === contentElement &&\n // We know that shift key tabs will lead to closing the popover (because we don't use `modal`)\n evt.key === \"Tab\" &&\n evt.shiftKey\n ) {\n // Prevent that from happening\n evt.preventDefault()\n evt.stopPropagation()\n\n // Move focus to the last focusable element, placing the user in the focus loop\n const focusable = focusableElements(contentElement)\n const lastFocusable = focusable[focusable.length - 1]\n lastFocusable?.focus()\n }\n }\n\n // Important that we send initial focus into the popover, placing it onto the container.\n // This allows focus looping to begin, as well as capturing scoped key presses.\n // We prevent Reka's default behavior of focusing an element, because this can have adverse side-effects.\n // A tick later, as with the Select's list: until Reka's focus scope here has\n // registered, a Dialog around this content sends the focus straight back,\n // and the content takes that for focus moving outside and closes.\n onMounted(() => {\n watch(\n [showOnHover, () => props.autoFocus],\n async () => {\n await nextTick()\n const contentElement = contentRef.value\n\n if (!contentElement || !props.autoFocus) {\n return\n }\n\n // If we're already focused within the content area, no-op.\n // This would be true if some inner component declares autoFocus\n if (contentElement.contains(document.activeElement)) {\n return\n }\n\n // Our focus isn't in the content area - move it there.\n // NOTE: Don't automatically shift focus on hover popovers\n if (!showOnHover.value) {\n contentElement.focus({ preventScroll: true })\n }\n },\n { immediate: true },\n )\n })\n\n return () =>\n h(\n RekaPopoverContent,\n {\n ...dataAttributes(attrs),\n \"forceMount\": true,\n \"as\": PopoverContentElement,\n \"class\": [s.Popover, attrs.class],\n \"style\": toCssVariables({\n \"popover-width\": props.width,\n \"popover-min-width\": props.minWidth,\n \"popover-max-width\": props.maxWidth,\n }),\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n \"onPointerDownOutside\": outsidePress.onPointerDownOutside,\n \"onFocusOutside\": outsidePress.onFocusOutside,\n \"data-animate\": shake.value ? \"shake\" : undefined,\n \"data-translucent\": props.translucent ? \"true\" : undefined,\n \"side\": props.side,\n \"sideOffset\": props.sideOffset,\n \"align\": props.align,\n \"alignOffset\": props.alignOffset ?? (props.align === \"center\" ? 0 : -5),\n \"avoidCollisions\": props.avoidCollisions ?? true,\n \"hideWhenDetached\": true,\n \"collisionPadding\": 20,\n \"onOpenAutoFocus\": preventDefaultHandler,\n // Escape is handled by the Escape stack in PopoverContent\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onKeydown\": handleKeyDown,\n },\n { default: () => slots.default?.(controller) },\n )\n },\n})\n\nconst PopoverContentHoverable = defineComponent({\n name: \"PopoverContentHoverable\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { open, setOpen, triggerRef, contentRef, isPointerInTransitRef, hoverOpenFocusedWithTab } = usePopoverContext()\n const pointerGraceArea = shallowRef<Polygon | null>(null)\n\n const handleRemoveGraceArea = () => {\n pointerGraceArea.value = null\n isPointerInTransitRef.current = false\n }\n\n const handleCreateGraceArea = (event: PointerEvent, hoverTarget: HTMLElement) => {\n const graceArea = createPointerIntentArea(event, hoverTarget)\n pointerGraceArea.value = graceArea\n isPointerInTransitRef.current = true\n }\n\n onBeforeUnmount(handleRemoveGraceArea)\n\n let removeLeaveListeners = () => {}\n onMounted(() => {\n const trigger = triggerRef.value\n const content = contentRef.value\n\n if (!trigger || !content) {\n return\n }\n\n const handleTriggerLeave = (event: PointerEvent) => handleCreateGraceArea(event, content)\n const handleContentLeave = (event: PointerEvent) => handleCreateGraceArea(event, trigger)\n\n trigger.addEventListener(\"pointerleave\", handleTriggerLeave)\n content.addEventListener(\"pointerleave\", handleContentLeave)\n removeLeaveListeners = () => {\n trigger.removeEventListener(\"pointerleave\", handleTriggerLeave)\n content.removeEventListener(\"pointerleave\", handleContentLeave)\n }\n })\n onBeforeUnmount(() => removeLeaveListeners())\n\n watch(pointerGraceArea, (graceArea, _, onCleanup) => {\n if (!graceArea) {\n return\n }\n\n const handleTrackPointerGrace = (event: PointerEvent) => {\n const trigger = triggerRef.value\n const content = contentRef.value\n const target = event.target as HTMLElement\n const pointerPosition = { x: event.clientX, y: event.clientY }\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target)\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, graceArea)\n // Stop considering grace areas when the pointer runs into other control triggers\n const targetHasPopup = target.hasAttribute(\"aria-haspopup\")\n\n if (hasEnteredTarget) {\n handleRemoveGraceArea()\n } else if (isPointerOutsideGraceArea || targetHasPopup) {\n handleRemoveGraceArea()\n setOpen(false)\n }\n }\n document.addEventListener(\"pointermove\", handleTrackPointerGrace)\n onCleanup(() => document.removeEventListener(\"pointermove\", handleTrackPointerGrace))\n })\n\n // Hoverable doesn't place focus in the popover by default.\n // If it is open and Tab is pressed, focus the first focusable element and\n // remember to restore focus to the trigger on close.\n const handleKeyDown = (evt: KeyboardEvent) => {\n // Closed and still leaving: Tab belongs to the page again\n if (!open.value || !contentRef.value) {\n return\n }\n\n // Only assume forward tab is attempting to move into the popup\n if (evt.key === \"Tab\" && !evt.shiftKey) {\n const [firstFocusable] = focusableElements(contentRef.value)\n if (firstFocusable) {\n evt.preventDefault()\n firstFocusable.focus()\n hoverOpenFocusedWithTab.current = true\n document.removeEventListener(\"keydown\", handleKeyDown)\n }\n }\n }\n onMounted(() => document.addEventListener(\"keydown\", handleKeyDown))\n onBeforeUnmount(() => document.removeEventListener(\"keydown\", handleKeyDown))\n\n return () => h(PopoverContentImpl, { ...props, ...dataAttributes(attrs), class: attrs.class }, slots)\n },\n})\n\n/**\n * The floating panel. `class` lands on the panel. The default slot receives\n * `{ close, shake }`, the same functions `usePopoverController()` returns.\n */\nexport const PopoverContent = defineComponent({\n name: \"PopoverContent\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { open, showOnHover, setOpen } = usePopoverContext()\n\n useEscCloseStack(open, () => {\n setOpen(false)\n })\n\n return () =>\n h(RekaPopoverPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n { class: s.Transition, ...overlayTiming, overlay: true },\n {\n default: () => [\n open.value\n ? h(\n showOnHover.value ? PopoverContentHoverable : PopoverContentImpl,\n {\n key: showOnHover.value ? \"popover-hover\" : \"popover\",\n ...(props as ContentProps),\n ...dataAttributes(attrs),\n class: attrs.class,\n },\n slots,\n )\n : createCommentVNode(),\n ],\n },\n ),\n ],\n })\n },\n})\n\n/** Popover root. Uncontrolled by default; bind `v-model:open` to control it. */\n// Typed explicitly so the published declaration refers to the parts instead of\n// expanding them (an expanded component type fails consumers' type checks)\nexport const Popover: typeof PopoverComponent & {\n Trigger: typeof PopoverTrigger\n Content: typeof PopoverContent\n} = Object.assign(PopoverComponent, {\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n})\n\nexport type PopoverProps = InstanceType<typeof PopoverComponent>[\"$props\"]\nexport type PopoverContentProps = InstanceType<typeof PopoverContent>[\"$props\"]\n"]}
|
|
1
|
+
{"version":3,"file":"Popover.js","sourceRoot":"","sources":["../../../../src/components/Popover/Popover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,CAAC,EACD,OAAO,EACP,QAAQ,EACR,eAAe,EACf,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,KAAK,EACL,eAAe,GAGhB,MAAM,KAAK,CAAA;AACZ,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,eAAe,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC/H,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,EAAE,6BAA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AO,EAAE,cAAc;CACxB,CAAC,CAAA","sourcesContent":["import {\n computed,\n createCommentVNode,\n defineComponent,\n h,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n watchPostEffect,\n type ExtractPropTypes,\n type PropType,\n} from \"vue\"\nimport {\n PopoverAnchor as RekaPopoverAnchor,\n PopoverContent as RekaPopoverContent,\n PopoverPortal as RekaPopoverPortal,\n PopoverRoot as RekaPopoverRoot,\n injectPopoverRootContext,\n useForwardExpose,\n useId,\n} from \"reka-ui\"\nimport { useEscCloseStack } from \"../../composables/useEscCloseStack.js\"\nimport { dataAttributes, focusableElements, keepMovedFocus, preventDefaultHandler, toCssVariables } from \"../../lib/helpers.js\"\nimport { TransitionGroup } from \"../Transition/index.js\"\nimport { overlayTiming } from \"../Transition/shared.js\"\nimport { withRadixVariableNames } from \"../Tooltip/Tooltip.js\"\nimport { composeEventHandlers, firstElementChild, mergeSlotProps } from \"../Tooltip/slot.js\"\nimport { useDeferredPointerDownOutside } from \"./deferredPointerDownOutside.js\"\nimport { createPointerIntentArea, isPointInPolygon, type Polygon } from \"./pointerIntent.js\"\nimport { PopoverContextKey, usePopoverContext, type PopoverContextValue } from \"./usePopoverContext.js\"\nimport { usePopoverController } from \"./usePopoverController.js\"\nimport { isHoverPointer } from \"../../lib/inputMode.js\"\nimport s from \"@plexui/styles/components/Popover/Popover.module.css\"\n\n// Vue port of packages/ui/src/components/Popover/Popover.tsx on Reka UI.\n// Exports are flat (`PopoverTrigger`, `PopoverContent`) because\n// runtime-compiled templates cannot resolve `Popover.Trigger`; the static\n// properties are kept for render functions and SFCs.\n//\n// Reka keeps positioning, the dismissable layer, the focus scope and focus\n// return. As in Tooltip, the port follows Radix where they differ:\n// - The trigger is Radix's: it runs after the child's handlers and toggles\n// only when none called preventDefault(), carries no `id`, and has\n// `aria-controls` only while open.\n// - The content element is rendered here (Reka's `as`): Radix's custom\n// property names (the shared CSS reads `--radix-popover-content-*`), no\n// `dir`, no `aria-labelledby`.\n// - A press outside closes it on the click that follows, as Radix's\n// deferred outside press does (./deferredPointerDownOutside.ts).\n// - The portal renders once mounted, as Radix's does, so a closed popover\n// server-renders nothing.\n\nexport type PopoverSide = \"top\" | \"right\" | \"bottom\" | \"left\"\nexport type PopoverAlign = \"start\" | \"center\" | \"end\"\n\nconst PopoverComponent = defineComponent({\n name: \"Popover\",\n props: {\n /** Controlled visibility (`v-model:open`); uncontrolled when omitted */\n open: { type: Boolean, default: undefined },\n /** Opens on hover and focus instead of click. @default false */\n showOnHover: { type: Boolean, default: false },\n /** Delay before a hover popover opens, in milliseconds. @default 150 */\n hoverOpenDelay: { type: Number, default: 150 },\n },\n emits: {\n \"update:open\": (nextState: boolean) => typeof nextState === \"boolean\",\n },\n setup(props, { slots, emit }) {\n const open = ref(false)\n const shake = ref(false)\n const triggerRef = shallowRef<HTMLElement | null>(null)\n const contentRef = shallowRef<HTMLElement | null>(null)\n let openTimer: ReturnType<typeof setTimeout> | undefined\n const hoverOpenFocusedWithTab = { current: false }\n const isPointerInTransitRef = { current: false }\n const isOpen = computed(() => props.open ?? open.value)\n\n const temporarilyPreventClickToClose = ref(false)\n watch(temporarilyPreventClickToClose, (prevent, _, onCleanup) => {\n if (!prevent) return\n const id = setTimeout(() => {\n temporarilyPreventClickToClose.value = false\n }, 500)\n onCleanup(() => clearTimeout(id))\n })\n\n const handleOpenChange = (nextState: boolean) => {\n clearTimeout(openTimer)\n\n // No-op if the state is not changing\n if (isOpen.value === nextState) {\n return\n }\n\n if (!nextState) {\n // clear any running shake animation on close\n shake.value = false\n\n // Check for specific hover conditions where focus should be\n // immediately restored to the trigger before closing\n if (props.showOnHover && hoverOpenFocusedWithTab.current) {\n triggerRef.value?.focus()\n }\n\n // Always cleanup this state\n hoverOpenFocusedWithTab.current = false\n }\n\n emit(\"update:open\", nextState)\n open.value = nextState\n\n if (props.showOnHover) {\n temporarilyPreventClickToClose.value = nextState\n }\n }\n\n const handleTriggerEnter = () => {\n openTimer = setTimeout(() => handleOpenChange(true), props.hoverOpenDelay)\n }\n\n const handleTriggerLeave = () => {\n clearTimeout(openTimer)\n }\n\n onBeforeUnmount(() => {\n clearTimeout(openTimer)\n })\n\n const store: PopoverContextValue = {\n open: isOpen,\n setOpen: handleOpenChange,\n shake,\n setShake: (next) => {\n shake.value = next\n },\n showOnHover: computed(() => props.showOnHover),\n temporarilyPreventClickToClose,\n onTriggerEnter: handleTriggerEnter,\n onTriggerLeave: handleTriggerLeave,\n isPointerInTransitRef,\n triggerRef,\n contentRef,\n hoverOpenFocusedWithTab,\n }\n provide(PopoverContextKey, store)\n\n return () =>\n h(\n RekaPopoverRoot,\n { \"open\": isOpen.value, \"onUpdate:open\": handleOpenChange, \"modal\": false },\n { default: () => slots.default?.() },\n )\n },\n})\n\n/**\n * Renders its child (a button, link, ...) as the popover trigger. Like\n * `Popover.Trigger` in React it takes no other props: attributes on it are\n * not passed on.\n */\nexport const PopoverTrigger = defineComponent({\n name: \"PopoverTrigger\",\n inheritAttrs: false,\n emits: {\n pointerdown: (event: PointerEvent) => typeof event.type === \"string\",\n click: (event: MouseEvent) => typeof event.type === \"string\",\n },\n setup(_props, { slots, emit }) {\n const {\n open,\n setOpen,\n showOnHover,\n temporarilyPreventClickToClose,\n onTriggerEnter,\n onTriggerLeave,\n isPointerInTransitRef,\n triggerRef,\n contentRef,\n } = usePopoverContext()\n const rootContext = injectPopoverRootContext()\n rootContext.contentId ||= useId(undefined, \"reka-popover-content\")\n const { forwardRef, currentElement } = useForwardExpose()\n let hasPointerMoveOpened = false\n\n // Focus returns here on close, and pointer-downs on it are not \"outside\".\n // Follows a replaced child element, as Radix's composed ref does\n watchPostEffect(() => {\n triggerRef.value = currentElement.value ?? null\n rootContext.triggerElement.value = currentElement.value\n })\n\n const maybePreventClickClose = (evt: Event) => {\n // Don't prevent temporary close if the trigger is an anchor tag itself\n const isLink = (evt.currentTarget as Element).nodeName.toLocaleLowerCase() === \"a\"\n\n if (!isLink && temporarilyPreventClickToClose.value) {\n // Prevents tooltip listeners from closing\n evt.preventDefault()\n evt.stopPropagation()\n }\n }\n\n const handlePointerMove = (evt: PointerEvent) => {\n if (!isHoverPointer(evt)) {\n return\n }\n\n if (!hasPointerMoveOpened && !isPointerInTransitRef.current) {\n onTriggerEnter()\n hasPointerMoveOpened = true\n }\n }\n\n const handlePointerLeave = () => {\n if (!hasPointerMoveOpened) {\n return\n }\n\n onTriggerLeave()\n hasPointerMoveOpened = false\n }\n\n const handleBlur = () => {\n setTimeout(() => {\n // Ignore this handler if focus has moved into the popover\n if (contentRef.value?.contains(document.activeElement)) {\n return\n }\n\n setOpen(false)\n }, 50)\n }\n\n const onPointerdown = (evt: PointerEvent) => {\n maybePreventClickClose(evt)\n emit(\"pointerdown\", evt)\n }\n\n const onClick = composeEventHandlers(\n (evt: MouseEvent) => {\n maybePreventClickClose(evt)\n emit(\"click\", evt)\n },\n () => rootContext.onOpenToggle(),\n )\n\n return () => {\n const child = firstElementChild(slots.default?.())\n if (!child) return null\n\n const isOpen = open.value\n const hover = showOnHover.value\n // Radix's PopoverTrigger props, then Plex's handlers\n const triggerProps = {\n \"type\": \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? rootContext.contentId : undefined,\n \"data-state\": isOpen ? \"open\" : \"closed\",\n onPointerdown,\n onClick,\n \"onPointermove\": hover ? handlePointerMove : undefined,\n \"onPointerleave\": hover ? handlePointerLeave : undefined,\n \"onFocus\": hover ? () => setOpen(true) : undefined,\n \"onBlur\": hover ? handleBlur : undefined,\n }\n\n return h(RekaPopoverAnchor, { asChild: true, ref: forwardRef }, { default: () => mergeSlotProps(child, triggerProps) })\n }\n },\n})\n\nconst contentProps = {\n /** Avoids collisions with the viewport and scroll containers. @default true */\n avoidCollisions: { type: Boolean, default: undefined },\n /** Distance from viewport and scroll container boundaries, in pixels. @default 20 */\n collisionPadding: { type: Number, default: 20 },\n /** `width` of the popover; numbers are pixels. @default \"auto\" */\n width: [Number, String] as PropType<number | \"auto\">,\n /** `min-width` of the popover; numbers are pixels. @default 300 */\n minWidth: [Number, String] as PropType<number | \"auto\">,\n /** `max-width` of the popover, in pixels */\n maxWidth: Number,\n /** Preferred side of the trigger. @default \"bottom\" */\n side: String as PropType<PopoverSide>,\n /** Distance from the trigger, in pixels. @default 8 */\n sideOffset: { type: Number, default: 8 },\n /** Preferred alignment against the trigger. @default \"center\" */\n align: String as PropType<PopoverAlign>,\n /** Offset from the \"start\" or \"end\" alignment, in pixels. @default 0 */\n alignOffset: Number,\n /** Translucent popover surface. @default false */\n translucent: { type: Boolean, default: undefined },\n /** Moves focus into the popover when it opens. @default true */\n autoFocus: { type: Boolean, default: true },\n}\n\ntype ContentProps = ExtractPropTypes<typeof contentProps>\n\n// The element Reka's content renders (`as`). Raw: Reka passes `as` through\n// reactive props, and Vue warns about a component made reactive.\nconst PopoverContentElement = markRaw(defineComponent({\n name: \"PopoverContentElement\",\n inheritAttrs: false,\n setup(_props, { slots, attrs }) {\n const { contentRef } = usePopoverContext()\n const setContentRef = (el: unknown) => {\n contentRef.value = (el as HTMLElement | null) ?? null\n }\n\n return () => {\n const { style, ...rest } = attrs\n delete rest.dir\n delete rest[\"aria-labelledby\"]\n delete rest.forceMount\n return h(\n \"div\",\n { ...rest, style: withRadixVariableNames(style, \"popover\"), ref: setContentRef },\n slots.default?.(),\n )\n }\n },\n}))\n\nconst PopoverContentImpl = defineComponent({\n name: \"PopoverContentImpl\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { showOnHover, shake, contentRef, setOpen, triggerRef } = usePopoverContext()\n const controller = usePopoverController()\n\n // Radix's non-modal content: a press on the trigger is left to the\n // trigger, and focus does not return to it after a press outside\n let pressedOutside = false\n const outsidePress = useDeferredPointerDownOutside((originalEvent) => {\n if (triggerRef.value?.contains(originalEvent.target as Node)) return\n pressedOutside = true\n setOpen(false)\n })\n const handleCloseAutoFocus = (event: Event) => {\n if (showOnHover.value || pressedOutside) event.preventDefault()\n else keepMovedFocus(event)\n }\n\n const handleKeyDown = (evt: KeyboardEvent) => {\n const contentElement = contentRef.value\n\n if (\n // When the current target is our container\n contentElement &&\n evt.target === contentElement &&\n // We know that shift key tabs will lead to closing the popover (because we don't use `modal`)\n evt.key === \"Tab\" &&\n evt.shiftKey\n ) {\n // Prevent that from happening\n evt.preventDefault()\n evt.stopPropagation()\n\n // Move focus to the last focusable element, placing the user in the focus loop\n const focusable = focusableElements(contentElement)\n const lastFocusable = focusable[focusable.length - 1]\n lastFocusable?.focus()\n }\n }\n\n // Important that we send initial focus into the popover, placing it onto the container.\n // This allows focus looping to begin, as well as capturing scoped key presses.\n // We prevent Reka's default behavior of focusing an element, because this can have adverse side-effects.\n // A tick later, as with the Select's list: until Reka's focus scope here has\n // registered, a Dialog around this content sends the focus straight back,\n // and the content takes that for focus moving outside and closes.\n onMounted(() => {\n watch(\n [showOnHover, () => props.autoFocus],\n async () => {\n await nextTick()\n const contentElement = contentRef.value\n\n if (!contentElement || !props.autoFocus) {\n return\n }\n\n // If we're already focused within the content area, no-op.\n // This would be true if some inner component declares autoFocus\n if (contentElement.contains(document.activeElement)) {\n return\n }\n\n // Our focus isn't in the content area - move it there.\n // NOTE: Don't automatically shift focus on hover popovers\n if (!showOnHover.value) {\n contentElement.focus({ preventScroll: true })\n }\n },\n { immediate: true },\n )\n })\n\n return () =>\n h(\n RekaPopoverContent,\n {\n ...dataAttributes(attrs),\n \"forceMount\": true,\n \"as\": PopoverContentElement,\n \"class\": [s.Popover, attrs.class],\n \"style\": toCssVariables({\n \"popover-width\": props.width,\n \"popover-min-width\": props.minWidth,\n \"popover-max-width\": props.maxWidth,\n }),\n \"onCloseAutoFocus\": handleCloseAutoFocus,\n \"onPointerDownOutside\": outsidePress.onPointerDownOutside,\n \"onFocusOutside\": outsidePress.onFocusOutside,\n \"data-animate\": shake.value ? \"shake\" : undefined,\n \"data-translucent\": props.translucent ? \"true\" : undefined,\n \"side\": props.side,\n \"sideOffset\": props.sideOffset,\n \"align\": props.align,\n \"alignOffset\": props.alignOffset ?? (props.align === \"center\" ? 0 : -5),\n \"avoidCollisions\": props.avoidCollisions ?? true,\n \"hideWhenDetached\": true,\n \"collisionPadding\": props.collisionPadding,\n \"onOpenAutoFocus\": preventDefaultHandler,\n // Escape is handled by the Escape stack in PopoverContent\n \"onEscapeKeyDown\": preventDefaultHandler,\n \"onKeydown\": handleKeyDown,\n },\n { default: () => slots.default?.(controller) },\n )\n },\n})\n\nconst PopoverContentHoverable = defineComponent({\n name: \"PopoverContentHoverable\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { open, setOpen, triggerRef, contentRef, isPointerInTransitRef, hoverOpenFocusedWithTab } = usePopoverContext()\n const pointerGraceArea = shallowRef<Polygon | null>(null)\n\n const handleRemoveGraceArea = () => {\n pointerGraceArea.value = null\n isPointerInTransitRef.current = false\n }\n\n const handleCreateGraceArea = (event: PointerEvent, hoverTarget: HTMLElement) => {\n if (!isHoverPointer(event)) return\n const graceArea = createPointerIntentArea(event, hoverTarget)\n pointerGraceArea.value = graceArea\n isPointerInTransitRef.current = true\n }\n\n onBeforeUnmount(handleRemoveGraceArea)\n\n let removeLeaveListeners = () => {}\n onMounted(() => {\n const trigger = triggerRef.value\n const content = contentRef.value\n\n if (!trigger || !content) {\n return\n }\n\n const handleTriggerLeave = (event: PointerEvent) => handleCreateGraceArea(event, content)\n const handleContentLeave = (event: PointerEvent) => handleCreateGraceArea(event, trigger)\n\n trigger.addEventListener(\"pointerleave\", handleTriggerLeave)\n content.addEventListener(\"pointerleave\", handleContentLeave)\n removeLeaveListeners = () => {\n trigger.removeEventListener(\"pointerleave\", handleTriggerLeave)\n content.removeEventListener(\"pointerleave\", handleContentLeave)\n }\n })\n onBeforeUnmount(() => removeLeaveListeners())\n\n watch(pointerGraceArea, (graceArea, _, onCleanup) => {\n if (!graceArea) {\n return\n }\n\n const handleTrackPointerGrace = (event: PointerEvent) => {\n if (!isHoverPointer(event)) return\n const trigger = triggerRef.value\n const content = contentRef.value\n const target = event.target as HTMLElement\n const pointerPosition = { x: event.clientX, y: event.clientY }\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target)\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, graceArea)\n // Stop considering grace areas when the pointer runs into other control triggers\n const targetHasPopup = target.hasAttribute(\"aria-haspopup\")\n\n if (hasEnteredTarget) {\n handleRemoveGraceArea()\n } else if (isPointerOutsideGraceArea || targetHasPopup) {\n handleRemoveGraceArea()\n setOpen(false)\n }\n }\n document.addEventListener(\"pointermove\", handleTrackPointerGrace)\n onCleanup(() => document.removeEventListener(\"pointermove\", handleTrackPointerGrace))\n })\n\n // Hoverable doesn't place focus in the popover by default.\n // If it is open and Tab is pressed, focus the first focusable element and\n // remember to restore focus to the trigger on close.\n const handleKeyDown = (evt: KeyboardEvent) => {\n // Closed and still leaving: Tab belongs to the page again\n if (!open.value || !contentRef.value) {\n return\n }\n\n // Only assume forward tab is attempting to move into the popup\n if (evt.key === \"Tab\" && !evt.shiftKey) {\n const [firstFocusable] = focusableElements(contentRef.value)\n if (firstFocusable) {\n evt.preventDefault()\n firstFocusable.focus()\n hoverOpenFocusedWithTab.current = true\n document.removeEventListener(\"keydown\", handleKeyDown)\n }\n }\n }\n onMounted(() => document.addEventListener(\"keydown\", handleKeyDown))\n onBeforeUnmount(() => document.removeEventListener(\"keydown\", handleKeyDown))\n\n return () => h(PopoverContentImpl, { ...props, ...dataAttributes(attrs), class: attrs.class }, slots)\n },\n})\n\n/**\n * The floating panel. `class` lands on the panel. The default slot receives\n * `{ close, shake }`, the same functions `usePopoverController()` returns.\n */\nexport const PopoverContent = defineComponent({\n name: \"PopoverContent\",\n inheritAttrs: false,\n props: contentProps,\n setup(props, { slots, attrs }) {\n const { open, showOnHover, setOpen } = usePopoverContext()\n\n useEscCloseStack(open, () => {\n setOpen(false)\n })\n\n return () =>\n h(RekaPopoverPortal, null, {\n default: () => [\n h(\n TransitionGroup,\n { class: s.Transition, ...overlayTiming, overlay: true },\n {\n default: () => [\n open.value\n ? h(\n showOnHover.value ? PopoverContentHoverable : PopoverContentImpl,\n {\n key: showOnHover.value ? \"popover-hover\" : \"popover\",\n ...(props as ContentProps),\n ...dataAttributes(attrs),\n class: attrs.class,\n },\n slots,\n )\n : createCommentVNode(),\n ],\n },\n ),\n ],\n })\n },\n})\n\n/** Popover root. Uncontrolled by default; bind `v-model:open` to control it. */\n// Typed explicitly so the published declaration refers to the parts instead of\n// expanding them (an expanded component type fails consumers' type checks)\nexport const Popover: typeof PopoverComponent & {\n Trigger: typeof PopoverTrigger\n Content: typeof PopoverContent\n} = Object.assign(PopoverComponent, {\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n})\n\nexport type PopoverProps = InstanceType<typeof PopoverComponent>[\"$props\"]\nexport type PopoverContentProps = InstanceType<typeof PopoverContent>[\"$props\"]\n"]}
|
|
@@ -48,6 +48,10 @@ export const useDeferredPointerDownOutside = (dismiss) => {
|
|
|
48
48
|
};
|
|
49
49
|
// Any later press replaces this one (Reka reports the outside ones again)
|
|
50
50
|
const handlePointerDown = () => reset();
|
|
51
|
+
const handlePointerCancel = (event) => {
|
|
52
|
+
if (event.pointerId === originalEvent.pointerId)
|
|
53
|
+
reset();
|
|
54
|
+
};
|
|
51
55
|
for (const name of OUTSIDE_INTERACTION_EVENTS) {
|
|
52
56
|
ownerDocument.addEventListener(name, handleCapture, true);
|
|
53
57
|
ownerDocument.addEventListener(name, handleBubble);
|
|
@@ -55,6 +59,7 @@ export const useDeferredPointerDownOutside = (dismiss) => {
|
|
|
55
59
|
// After the bubble listener, so a click that got here counts as not stopped
|
|
56
60
|
ownerDocument.addEventListener("click", finish);
|
|
57
61
|
ownerDocument.addEventListener("pointerdown", handlePointerDown, true);
|
|
62
|
+
ownerDocument.addEventListener("pointercancel", handlePointerCancel, true);
|
|
58
63
|
stop = () => {
|
|
59
64
|
active = false;
|
|
60
65
|
for (const name of OUTSIDE_INTERACTION_EVENTS) {
|
|
@@ -63,6 +68,7 @@ export const useDeferredPointerDownOutside = (dismiss) => {
|
|
|
63
68
|
}
|
|
64
69
|
ownerDocument.removeEventListener("click", finish);
|
|
65
70
|
ownerDocument.removeEventListener("pointerdown", handlePointerDown, true);
|
|
71
|
+
ownerDocument.removeEventListener("pointercancel", handlePointerCancel, true);
|
|
66
72
|
};
|
|
67
73
|
};
|
|
68
74
|
const onFocusOutside = (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPointerDownOutside.js","sourceRoot":"","sources":["../../../../src/components/Popover/deferredPointerDownOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAA;AAcrC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAE3G;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAW,CAAA;AAErD,MAAM,sBAAsB,GAAG,CAAC,MAA0B,EAAE,EAAE,CAC5D,MAAM,YAAY,IAAI,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;AAEhG;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,OAA8C,EAAE,EAAE;IAC9F,IAAI,IAA8B,CAAA;IAElC,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,IAAI,EAAE,EAAE,CAAA;QACR,IAAI,GAAG,SAAS,CAAA;IAClB,CAAC,CAAA;IAED,eAAe,CAAC,KAAK,CAAC,CAAA;IAEtB,MAAM,oBAAoB,GAAG,CAAC,KAAmB,EAAE,EAAE;QACnD,KAAK,EAAE,CAAA;QACP,MAAM,aAAa,GAAG,KAAK,CAAC,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QACtE,aAAa,CAAC,gBAAgB,CAAC,eAAe,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAA;QAE1E,IAAI,GAAG,GAAG,EAAE;YACV,MAAM,GAAG,KAAK,CAAA;YACd,KAAK,MAAM,IAAI,IAAI,0BAA0B,EAAE,CAAC;gBAC9C,aAAa,CAAC,mBAAmB,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,CAAA;gBAC5D,aAAa,CAAC,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;YACvD,CAAC;YACD,aAAa,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;YAClD,aAAa,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAA;YACzE,aAAa,CAAC,mBAAmB,CAAC,eAAe,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAA;QAC/E,CAAC,CAAA;IACH,CAAC,CAAA;IAED,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,EAAE;QACtC,IAAI,IAAI;YAAE,KAAK,CAAC,cAAc,EAAE,CAAA;IAClC,CAAC,CAAA;IAED,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACxD,CAAC,CAAA","sourcesContent":["import { onBeforeUnmount } from \"vue\"\n\n// Internal: radix-ui 1.8's deferred outside press (DismissableLayer's\n// `deferPointerDownOutside`), which Radix Popover and Dialog turn on and\n// Reka's dismissable layer does not have. Reka dismisses on the pointerdown\n// outside; Radix waits for the click that follows a primary-button press,\n// keeps the layer when something outside stopped that click (or the\n// pointerup / mouse / touch events before it) from reaching the document,\n// and ignores focus moving outside meanwhile. Other buttons are left to Reka,\n// which dismisses at once, as Radix does, and so are touches, which Reka\n// already reports on their click.\n\ntype OutsideEvent = CustomEvent<{ originalEvent: PointerEvent }>\n\nconst OUTSIDE_INTERACTION_EVENTS = [\"pointerup\", \"mousedown\", \"mouseup\", \"touchstart\", \"touchend\", \"click\"]\n\n/**\n * A layer's own dismiss affordance (a dialog overlay): pressing it dismisses\n * even when something stops the events, as Radix's dismissable surfaces.\n */\nexport const dismissableSurfaces = new Set<Element>()\n\nconst isOnDismissableSurface = (target: EventTarget | null) =>\n target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target))\n\n/**\n * Listeners for Reka's `pointerDownOutside` and `focusOutside`; `dismiss`\n * runs on the click that completes a deferred press. `reset` drops a pending\n * press (the layer closed some other way); unmounting does it too.\n */\nexport const useDeferredPointerDownOutside = (dismiss: (originalEvent: PointerEvent) => void) => {\n let stop: (() => void) | undefined\n\n const reset = () => {\n stop?.()\n stop = undefined\n }\n\n onBeforeUnmount(reset)\n\n const onPointerDownOutside = (event: OutsideEvent) => {\n reset()\n const originalEvent = event.detail.originalEvent\n if (originalEvent.button !== 0 || originalEvent.pointerType === \"touch\") return\n // Reka must not dismiss now\n event.preventDefault()\n\n const ownerDocument = (originalEvent.target as Node | null)?.ownerDocument ?? document\n const intercepted = new Map<string, boolean>()\n let active = true\n\n const finish = () => {\n if (!active) return\n const wasIntercepted = [...intercepted.values()].some(Boolean)\n reset()\n if (!wasIntercepted) dismiss(originalEvent)\n }\n const handleCapture = (evt: Event) => {\n if (!isOnDismissableSurface(evt.target)) intercepted.set(evt.type, true)\n // A click stopped on its way to the document still ends the press\n if (evt.type === \"click\") window.setTimeout(finish, 0)\n }\n const handleBubble = (evt: Event) => {\n intercepted.set(evt.type, false)\n }\n // Any later press replaces this one (Reka reports the outside ones again)\n const handlePointerDown = () => reset()\n const handlePointerCancel = (event: PointerEvent) => {\n if (event.pointerId === originalEvent.pointerId) reset()\n }\n\n for (const name of OUTSIDE_INTERACTION_EVENTS) {\n ownerDocument.addEventListener(name, handleCapture, true)\n ownerDocument.addEventListener(name, handleBubble)\n }\n // After the bubble listener, so a click that got here counts as not stopped\n ownerDocument.addEventListener(\"click\", finish)\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown, true)\n ownerDocument.addEventListener(\"pointercancel\", handlePointerCancel, true)\n\n stop = () => {\n active = false\n for (const name of OUTSIDE_INTERACTION_EVENTS) {\n ownerDocument.removeEventListener(name, handleCapture, true)\n ownerDocument.removeEventListener(name, handleBubble)\n }\n ownerDocument.removeEventListener(\"click\", finish)\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown, true)\n ownerDocument.removeEventListener(\"pointercancel\", handlePointerCancel, true)\n }\n }\n\n const onFocusOutside = (event: Event) => {\n if (stop) event.preventDefault()\n }\n\n return { onPointerDownOutside, onFocusOutside, reset }\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMoun
|
|
|
2
2
|
import { Presence, RovingFocusGroup, RovingFocusItem } from "reka-ui";
|
|
3
3
|
import { bubbleInputStyle, useIsFormControl, useSize } from "../Checkbox/bubbleInput.js";
|
|
4
4
|
import { CheckMd } from "../Icon/index.js";
|
|
5
|
+
import { hasContent } from "../../lib/slotContent.js";
|
|
5
6
|
import s from "@plexui/styles/components/RadioGroup/RadioGroup.module.css";
|
|
6
7
|
const RadioGroupContextKey = Symbol("PlexUIRadioGroup");
|
|
7
8
|
const useRadioGroupContext = () => {
|
|
@@ -50,6 +51,8 @@ const GroupElement = defineComponent({
|
|
|
50
51
|
setup(props, { attrs, slots }) {
|
|
51
52
|
return () => {
|
|
52
53
|
const { onMousedown, onMouseup: _onMouseup, onFocus, onBlur, ...restAttrs } = attrs;
|
|
54
|
+
// Reka's mouseup focus behavior is deliberately omitted.
|
|
55
|
+
void _onMouseup;
|
|
53
56
|
const caller = props.listeners;
|
|
54
57
|
const handlers = {
|
|
55
58
|
onMousedown: (event) => {
|
|
@@ -80,7 +83,7 @@ const RadioGroupComponent = defineComponent({
|
|
|
80
83
|
props: {
|
|
81
84
|
/** Initial selected value when uncontrolled */
|
|
82
85
|
defaultValue: String,
|
|
83
|
-
/** Controlled
|
|
86
|
+
/** Controlled selection, including `null` for none. Bind with `v-model:value`; leave undefined for an uncontrolled group. */
|
|
84
87
|
value: { type: String, default: undefined },
|
|
85
88
|
/** Name submitted with the owning form */
|
|
86
89
|
name: String,
|
|
@@ -92,10 +95,10 @@ const RadioGroupComponent = defineComponent({
|
|
|
92
95
|
required: { type: Boolean, default: false },
|
|
93
96
|
},
|
|
94
97
|
emits: {
|
|
95
|
-
/** The
|
|
96
|
-
"update:value": (
|
|
98
|
+
/** The selection changed (`v-model:value`). Resetting an initially empty form reports `null`. */
|
|
99
|
+
"update:value": (value) => value === null || typeof value === "string",
|
|
97
100
|
/** Same payload as `update:value`, named after React's `onChange` */
|
|
98
|
-
"change": (
|
|
101
|
+
"change": (value) => value === null || typeof value === "string",
|
|
99
102
|
},
|
|
100
103
|
setup(props, { attrs, slots, emit }) {
|
|
101
104
|
const groupRef = ref(null);
|
|
@@ -119,8 +122,7 @@ const RadioGroupComponent = defineComponent({
|
|
|
119
122
|
// React runs after the items' effects (the hidden inputs' clicks)
|
|
120
123
|
watch(uncontrolledValue, (nextValue) => {
|
|
121
124
|
void nextTick(() => {
|
|
122
|
-
|
|
123
|
-
reportChange(nextValue);
|
|
125
|
+
reportChange(nextValue);
|
|
124
126
|
});
|
|
125
127
|
}, { flush: "post" });
|
|
126
128
|
// React runs the items' hidden-input effects in tree order; Vue's post
|
|
@@ -156,8 +158,7 @@ const RadioGroupComponent = defineComponent({
|
|
|
156
158
|
if (!form)
|
|
157
159
|
return;
|
|
158
160
|
const reset = () => {
|
|
159
|
-
|
|
160
|
-
setValue(initialValue);
|
|
161
|
+
setValue(initialValue);
|
|
161
162
|
};
|
|
162
163
|
form.addEventListener("reset", reset);
|
|
163
164
|
onBeforeUnmount(() => form.removeEventListener("reset", reset));
|
|
@@ -281,6 +282,7 @@ const RadioGroupItemComponent = defineComponent({
|
|
|
281
282
|
useCheckedTracker(bubbleInput);
|
|
282
283
|
// Radix RadioGroupItem: an arrow key that moves focus onto a radio checks it
|
|
283
284
|
let isArrowKeyPressed = false;
|
|
285
|
+
let focusSelectionTimer;
|
|
284
286
|
const handleDocumentKeyDown = (event) => {
|
|
285
287
|
if (ARROW_KEYS.includes(event.key))
|
|
286
288
|
isArrowKeyPressed = true;
|
|
@@ -296,6 +298,8 @@ const RadioGroupItemComponent = defineComponent({
|
|
|
296
298
|
onBeforeUnmount(() => {
|
|
297
299
|
document.removeEventListener("keydown", handleDocumentKeyDown);
|
|
298
300
|
document.removeEventListener("keyup", handleDocumentKeyUp);
|
|
301
|
+
if (focusSelectionTimer !== undefined)
|
|
302
|
+
clearTimeout(focusSelectionTimer);
|
|
299
303
|
});
|
|
300
304
|
const userClick = shallowRef(null);
|
|
301
305
|
let prevChecked = checked.value;
|
|
@@ -342,9 +346,20 @@ const RadioGroupItemComponent = defineComponent({
|
|
|
342
346
|
event.preventDefault();
|
|
343
347
|
};
|
|
344
348
|
const handleFocus = (event) => {
|
|
345
|
-
|
|
346
|
-
if (
|
|
347
|
-
|
|
349
|
+
const radio = event.currentTarget;
|
|
350
|
+
if (!(radio instanceof HTMLButtonElement))
|
|
351
|
+
return;
|
|
352
|
+
if (focusSelectionTimer !== undefined)
|
|
353
|
+
clearTimeout(focusSelectionTimer);
|
|
354
|
+
// Reka moves focus in nextTick, which a browser can flush before the
|
|
355
|
+
// keydown reaches document. Check the arrow flag after that listener,
|
|
356
|
+
// like Reka's RadioGroupItem, without selecting a radio the user left.
|
|
357
|
+
focusSelectionTimer = setTimeout(() => {
|
|
358
|
+
focusSelectionTimer = undefined;
|
|
359
|
+
if (isArrowKeyPressed && !disabled.value && radio.isConnected && radio.ownerDocument.activeElement === radio) {
|
|
360
|
+
radio.click();
|
|
361
|
+
}
|
|
362
|
+
}, 0);
|
|
348
363
|
};
|
|
349
364
|
// Prevents text selection when double-clicking the label
|
|
350
365
|
const handleLabelMouseDown = (event) => {
|
|
@@ -368,9 +383,11 @@ const RadioGroupItemComponent = defineComponent({
|
|
|
368
383
|
// NOTE: Important that this is `flex` to prevent the `inline-flex` label from extra, unintentional whitespace.
|
|
369
384
|
const description = slots.description ? slots.description() : props.description;
|
|
370
385
|
const descriptionId = slots.description || props.description ? `${itemId}-description` : undefined;
|
|
386
|
+
const children = slots.default?.();
|
|
371
387
|
const label = h("label", {
|
|
372
388
|
"for": itemId,
|
|
373
389
|
"class": [s.RadioLabel, className],
|
|
390
|
+
"data-has-label": hasContent(children) ? "" : undefined,
|
|
374
391
|
"data-disabled": isDisabled ? "" : undefined,
|
|
375
392
|
"data-block": props.block ? "" : undefined,
|
|
376
393
|
"data-orientation": props.orientation,
|
|
@@ -429,7 +446,7 @@ const RadioGroupItemComponent = defineComponent({
|
|
|
429
446
|
})
|
|
430
447
|
: null,
|
|
431
448
|
]),
|
|
432
|
-
|
|
449
|
+
children,
|
|
433
450
|
]);
|
|
434
451
|
return h("div", { class: ["flex", props.block && "w-full"], ...restAttrs }, [
|
|
435
452
|
descriptionId
|