ropav 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -51
- package/dist/_plugin-vue_export-helper.js +1 -11
- package/dist/accordion.css +112 -0
- package/dist/accordion.js +360 -0
- package/dist/accordion.js.map +1 -0
- package/dist/badge.css +169 -0
- package/dist/badge.js +103 -0
- package/dist/badge.js.map +1 -0
- package/dist/base.css +21 -0
- package/dist/bem.js +11 -0
- package/dist/bem.js.map +1 -0
- package/dist/button-group.css +50 -0
- package/dist/button-group.js +50 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.css +72 -42
- package/dist/button.js +43 -32
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -1
- package/dist/card.js.map +1 -1
- package/dist/checkbox.css +105 -102
- package/dist/checkbox.js +20 -7
- package/dist/checkbox.js.map +1 -1
- package/dist/collapse.css +32 -0
- package/dist/collapse.js +68 -0
- package/dist/collapse.js.map +1 -0
- package/dist/componentColors.js +22 -0
- package/dist/componentColors.js.map +1 -0
- package/dist/components/accordion/accordion-item.d.ts +40 -0
- package/dist/components/accordion/accordion.d.ts +23 -0
- package/dist/components/accordion/index.d.ts +4 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/accordion/types.d.ts +100 -0
- package/dist/components/accordion/useAccordion.d.ts +3 -0
- package/dist/components/badge/badge.d.ts +25 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/badge/types.d.ts +16 -0
- package/dist/components/badge/useBadgeColor.d.ts +8 -0
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/types.d.ts +2 -1
- package/dist/components/button/useButtonColor.d.ts +13 -0
- package/dist/components/button-group/button-group.d.ts +21 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/button-group/types.d.ts +10 -0
- package/dist/components/checkbox/types.d.ts +2 -1
- package/dist/components/checkbox/useCheckbox.d.ts +4 -0
- package/dist/components/collapse/collapse.d.ts +36 -0
- package/dist/components/collapse/index.d.ts +3 -0
- package/dist/components/collapse/index.js +3 -0
- package/dist/components/collapse/types.d.ts +76 -0
- package/dist/components/collapse/useCollapse.d.ts +2 -0
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +16 -0
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +26 -0
- package/dist/components/dropdown-menu/index.d.ts +3 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/dropdown-menu/types.d.ts +104 -0
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +32 -0
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +30 -0
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +28 -0
- package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +24 -0
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +51 -0
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +16 -0
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +25 -0
- package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +18 -0
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/useField.d.ts +16 -0
- package/dist/components/input/useInput.d.ts +8 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +2 -0
- package/dist/components/modal/modal.d.ts +42 -0
- package/dist/components/modal/types.d.ts +32 -0
- package/dist/components/modal/useModal.d.ts +29 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +2 -0
- package/dist/components/overlay/overlay.d.ts +19 -0
- package/dist/components/overlay/types.d.ts +12 -0
- package/dist/components/overlay/useOverlay.d.ts +7 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/popover/popover.d.ts +43 -0
- package/dist/components/popover/types.d.ts +40 -0
- package/dist/components/popover/usePopover.d.ts +20 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.js +2 -0
- package/dist/components/progress/progress.d.ts +27 -0
- package/dist/components/progress/types.d.ts +24 -0
- package/dist/components/progress/useProgress.d.ts +28 -0
- package/dist/components/radio/types.d.ts +2 -1
- package/dist/components/radio/useRadio.d.ts +4 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/slider.d.ts +35 -0
- package/dist/components/slider/types.d.ts +50 -0
- package/dist/components/slider/useSlider.d.ts +50 -0
- package/dist/components/switch/types.d.ts +2 -1
- package/dist/components/switch/useSwitch.d.ts +3 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/tabs-content.d.ts +24 -0
- package/dist/components/tabs/tabs-list.d.ts +26 -0
- package/dist/components/tabs/tabs-trigger.d.ts +29 -0
- package/dist/components/tabs/tabs.d.ts +31 -0
- package/dist/components/tabs/types.d.ts +160 -0
- package/dist/components/tabs/useTabs.d.ts +5 -0
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/textarea/types.d.ts +5 -0
- package/dist/components/textarea/useTextarea.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/tooltip.d.ts +27 -0
- package/dist/components/tooltip/types.d.ts +29 -0
- package/dist/components/tooltip/useTooltip.d.ts +17 -0
- package/dist/dropdown-menu.css +159 -0
- package/dist/dropdown-menu.js +903 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/field.css +8 -8
- package/dist/field.js +68 -50
- package/dist/field.js.map +1 -1
- package/dist/icon-button.css +82 -49
- package/dist/icon-button.js +15 -10
- package/dist/icon-button.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +17 -1
- package/dist/input.css +25 -25
- package/dist/input.js +57 -38
- package/dist/input.js.map +1 -1
- package/dist/modal.css +134 -0
- package/dist/modal.js +433 -0
- package/dist/modal.js.map +1 -0
- package/dist/overlay.css +28 -0
- package/dist/overlay.js +84 -0
- package/dist/overlay.js.map +1 -0
- package/dist/popover.css +75 -0
- package/dist/popover.js +367 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.css +125 -0
- package/dist/progress.js +178 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio.css +83 -83
- package/dist/radio.js +21 -14
- package/dist/radio.js.map +1 -1
- package/dist/select.css +3 -1
- package/dist/select.js +15 -37
- package/dist/select.js.map +1 -1
- package/dist/slider.css +438 -0
- package/dist/slider.js +413 -0
- package/dist/slider.js.map +1 -0
- package/dist/switch.css +77 -77
- package/dist/switch.js +17 -7
- package/dist/switch.js.map +1 -1
- package/dist/tabs.css +279 -0
- package/dist/tabs.js +515 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.css +33 -26
- package/dist/textarea.js +108 -16
- package/dist/textarea.js.map +1 -1
- package/dist/tooltip.css +136 -0
- package/dist/tooltip.js +385 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/useButtonColor.js +33 -0
- package/dist/useButtonColor.js.map +1 -0
- package/dist/useClickOutside.js +26 -0
- package/dist/useClickOutside.js.map +1 -0
- package/dist/useCollapse.js +94 -0
- package/dist/useCollapse.js.map +1 -0
- package/dist/useRequiredInject.js +11 -0
- package/dist/useRequiredInject.js.map +1 -0
- package/dist/x.js +14 -0
- package/dist/x.js.map +1 -0
- package/package.json +52 -4
- package/src/styles/_mixins.scss +17 -0
- package/src/styles/_utilities.scss +13 -0
- package/src/styles/base.scss +1 -0
- package/dist/_plugin-vue_export-helper.js.map +0 -1
- package/dist/loader-circle.js +0 -14
- package/dist/loader-circle.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../src/components/dropdown-menu/dropdown-menu-items.ts","../src/components/dropdown-menu/dropdown-menu-utils.ts","../src/components/dropdown-menu/useDropdownMenuDisclosure.ts","../src/components/dropdown-menu/useDropdownMenuDom.ts","../src/components/dropdown-menu/useDropdownMenuHoverIntent.ts","../src/components/dropdown-menu/useDropdownMenuInteractions.ts","../src/components/dropdown-menu/useDropdownMenuNavigation.ts","../src/components/dropdown-menu/useDropdownMenuRenderItems.ts","../src/components/dropdown-menu/useDropdownSubmenus.ts","../src/components/dropdown-menu/useDropdownMenu.ts","../src/components/dropdown-menu/dropdown-menu.vue","../src/components/dropdown-menu/dropdown-menu.vue"],"sourcesContent":["import { defineComponent, h, type PropType } from 'vue';\nimport type { DropdownMenuItemSlotProps, DropdownMenuRenderedItem } from './types';\n\nexport default defineComponent({\n name: 'RpDropdownMenuItems',\n props: {\n items: {\n type: Array as PropType<DropdownMenuRenderedItem[]>,\n required: true,\n },\n },\n setup(props, { slots }) {\n function renderItems(items: DropdownMenuRenderedItem[]) {\n return items.map((renderedItem) => {\n const children = [\n h(\n 'button',\n renderedItem.props,\n slots.item?.(renderedItem.slotProps as DropdownMenuItemSlotProps),\n ),\n ];\n\n if (renderedItem.hasSubmenu && renderedItem.submenuOpen) {\n children.push(\n h('div', renderedItem.submenuProps, renderItems(renderedItem.children)),\n );\n }\n\n return h(\n 'div',\n {\n key: renderedItem.key,\n class: 'rp-dropdown-menu__item-wrap',\n role: 'none',\n },\n children,\n );\n });\n }\n\n return () => renderItems(props.items);\n },\n});\n","import { bem } from '@/utils/bem';\nimport type {\n DropdownMenuFocusTarget,\n DropdownMenuItem,\n DropdownMenuItemPath,\n DropdownMenuOpenOptions,\n DropdownMenuPlacement,\n} from './types';\n\nexport const DEFAULT_PLACEMENT: DropdownMenuPlacement = 'bottom-start';\nexport const DEFAULT_FOCUS_TARGET: DropdownMenuFocusTarget = 'first';\n\nexport type ItemPath = DropdownMenuItemPath;\nexport type SubmenuFocusTarget = DropdownMenuFocusTarget | false;\n\nexport type PointerPoint = {\n x: number;\n y: number;\n};\n\nexport function getOpenFocusTarget(\n options: DropdownMenuOpenOptions | DropdownMenuFocusTarget | undefined,\n) {\n if (typeof options === 'string') return options;\n return options?.focus ?? DEFAULT_FOCUS_TARGET;\n}\n\nexport function getItemClass(\n item: DropdownMenuItem,\n focused: boolean,\n disabled: boolean,\n hasSubmenu: boolean,\n submenuOpen: boolean,\n) {\n return bem('rp-dropdown-menu__item', {\n focused,\n disabled,\n destructive: item.destructive,\n submenu: hasSubmenu,\n open: submenuOpen,\n });\n}\n\nexport function hasItemSubmenu(item: DropdownMenuItem) {\n return (item.children?.length ?? 0) > 0;\n}\n\nexport function hasNestedItems(items: DropdownMenuItem[]): boolean {\n return items.some((item) => hasItemSubmenu(item) || hasNestedItems(item.children ?? []));\n}\n\nexport function getPathKey(path: ItemPath) {\n return path.length === 0 ? 'root' : path.join('-');\n}\n\nexport function getParentPath(path: ItemPath) {\n return path.slice(0, -1);\n}\n\nexport function arePathsEqual(a: ItemPath, b: ItemPath) {\n return a.length === b.length && a.every((part, index) => part === b[index]);\n}\n\nexport function isPathPrefix(prefix: ItemPath, path: ItemPath) {\n return prefix.length <= path.length && prefix.every((part, index) => part === path[index]);\n}\n\nexport function normalizePath(indexOrPath: number | ItemPath): ItemPath {\n return Array.isArray(indexOrPath) ? indexOrPath : [indexOrPath];\n}\n\nexport function getEventPoint(event: MouseEvent): PointerPoint {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n}\n\nexport function hasMeasuredRect(rect: DOMRect) {\n return rect.width > 0 || rect.height > 0;\n}\n\nexport function isPointInRect(point: PointerPoint, rect: DOMRect, padding = 0) {\n return (\n point.x >= rect.left - padding &&\n point.x <= rect.right + padding &&\n point.y >= rect.top - padding &&\n point.y <= rect.bottom + padding\n );\n}\n\nexport function getEnabledIndexes(items: DropdownMenuItem[]) {\n return items.map((item, index) => (item.disabled ? -1 : index)).filter((index) => index >= 0);\n}\n\nexport function getNextEnabledIndex(items: DropdownMenuItem[], index: number, direction: 1 | -1) {\n const enabledIndexes = getEnabledIndexes(items);\n if (enabledIndexes.length === 0) return undefined;\n\n if (direction === 1) {\n return enabledIndexes.find((candidate) => candidate > index) ?? enabledIndexes[0];\n }\n\n for (let i = enabledIndexes.length - 1; i >= 0; i -= 1) {\n const candidate = enabledIndexes[i]!;\n if (candidate < index) return candidate;\n }\n\n return enabledIndexes[enabledIndexes.length - 1];\n}\n","import { watch, type Ref } from 'vue';\nimport { useClickOutside } from '@/composables/useClickOutside';\nimport type {\n DropdownMenuCloseOptions,\n DropdownMenuFocusTarget,\n DropdownMenuItem,\n DropdownMenuOpenOptions,\n DropdownMenuProps,\n} from './types';\nimport { DEFAULT_FOCUS_TARGET, getOpenFocusTarget, type ItemPath } from './dropdown-menu-utils';\n\ntype BooleanSource = Readonly<Ref<boolean>>;\n\ntype UseDropdownMenuDisclosureOptions = {\n props: Readonly<DropdownMenuProps>;\n emit: {\n openChange?: (open: boolean) => void;\n select?: (item: DropdownMenuItem) => void;\n };\n rootRef: Ref<HTMLElement | null>;\n uncontrolledOpen: Ref<boolean>;\n isDisabled: BooleanSource;\n isOpen: BooleanSource;\n isVisible: BooleanSource;\n focusedPath: Ref<ItemPath>;\n resetFocus: () => void;\n resetSubmenus: () => void;\n resetHoverIntent: () => void;\n focusItem: (target: DropdownMenuFocusTarget, menuPath?: ItemPath) => boolean;\n focusMenu: () => void;\n focusTrigger: () => void;\n};\n\nexport function useDropdownMenuDisclosure({\n props,\n emit,\n rootRef,\n uncontrolledOpen,\n isDisabled,\n isOpen,\n isVisible,\n focusedPath,\n resetFocus,\n resetSubmenus,\n resetHoverIntent,\n focusItem,\n focusMenu,\n focusTrigger,\n}: UseDropdownMenuDisclosureOptions) {\n function setOpen(nextOpen: boolean) {\n if (nextOpen && isDisabled.value) return;\n\n const previousOpen = isOpen.value;\n if (props.open === undefined) uncontrolledOpen.value = nextOpen;\n if (previousOpen !== nextOpen) emit.openChange?.(nextOpen);\n }\n\n function resetMenuFocus() {\n resetFocus();\n resetSubmenus();\n resetHoverIntent();\n }\n\n function open(options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) {\n if (isDisabled.value) return;\n\n setOpen(true);\n focusItem(getOpenFocusTarget(options));\n resetSubmenus();\n resetHoverIntent();\n focusMenu();\n }\n\n function close(options: DropdownMenuCloseOptions = {}) {\n setOpen(false);\n resetMenuFocus();\n if (options.focusTrigger) focusTrigger();\n }\n\n function toggle() {\n if (isVisible.value) {\n close({ focusTrigger: true });\n } else {\n open();\n }\n }\n\n watch(isDisabled, (disabled) => {\n if (disabled) close();\n });\n\n watch(isVisible, (visible) => {\n if (visible) {\n if (focusedPath.value.length === 0) focusItem(DEFAULT_FOCUS_TARGET);\n focusMenu();\n } else {\n resetMenuFocus();\n }\n });\n\n useClickOutside(rootRef, isVisible, () => close());\n\n return {\n open,\n close,\n toggle,\n resetMenuFocus,\n };\n}\n","import { computed, nextTick, watch, type Ref } from 'vue';\nimport type { DropdownMenuPlacement } from './types';\nimport {\n arePathsEqual,\n getParentPath,\n getPathKey,\n hasMeasuredRect,\n normalizePath,\n type ItemPath,\n} from './dropdown-menu-utils';\n\ntype StringSource = {\n readonly value: string;\n};\ntype PlacementSource = {\n readonly value: DropdownMenuPlacement;\n};\n\ntype UseDropdownMenuDomOptions = {\n menuId: StringSource;\n rootRef: Ref<HTMLElement | null>;\n menuRef: Ref<HTMLElement | null>;\n placement: PlacementSource;\n focusedPath: Ref<ItemPath>;\n};\n\nexport function useDropdownMenuDom({\n menuId,\n rootRef,\n menuRef,\n placement,\n focusedPath,\n}: UseDropdownMenuDomOptions) {\n const activeDescendantId = computed(() =>\n focusedPath.value.length === 0 ? undefined : getItemId(focusedPath.value),\n );\n\n function focusMenu() {\n nextTick(() => menuRef.value?.focus());\n }\n\n function focusTrigger() {\n nextTick(() => {\n const trigger = rootRef.value?.querySelector<HTMLElement>('[aria-haspopup=\"menu\"]');\n trigger?.focus();\n });\n }\n\n function getItemId(indexOrPath: number | ItemPath) {\n return `${menuId.value}-item-${getPathKey(normalizePath(indexOrPath))}`;\n }\n\n function getSubmenuId(path: ItemPath) {\n return `${menuId.value}-submenu-${getPathKey(path)}`;\n }\n\n function getItemElement(path: ItemPath) {\n return document.getElementById(getItemId(path));\n }\n\n function getSubmenuElement(path: ItemPath) {\n return document.getElementById(getSubmenuId(path));\n }\n\n function isSubmenuOpeningLeft(path: ItemPath) {\n const submenuRect = getSubmenuElement(path)?.getBoundingClientRect();\n const itemRect = getItemElement(path)?.getBoundingClientRect();\n\n if (submenuRect && itemRect && hasMeasuredRect(submenuRect) && hasMeasuredRect(itemRect)) {\n return submenuRect.right <= itemRect.left;\n }\n\n return placement.value.endsWith('end');\n }\n\n function getMenuActiveDescendant(menuPath: ItemPath) {\n return arePathsEqual(getParentPath(focusedPath.value), menuPath)\n ? getItemId(focusedPath.value)\n : undefined;\n }\n\n watch(focusedPath, (path) => {\n if (path.length === 0) return;\n\n const targetPath = [...path];\n nextTick(() => {\n if (!arePathsEqual(targetPath, focusedPath.value)) return;\n getItemElement(targetPath)?.scrollIntoView?.({ block: 'nearest' });\n });\n });\n\n return {\n activeDescendantId,\n focusMenu,\n focusTrigger,\n getItemId,\n getSubmenuId,\n getItemElement,\n getSubmenuElement,\n isSubmenuOpeningLeft,\n getMenuActiveDescendant,\n };\n}\n","import { onUnmounted, ref, type Ref } from 'vue';\nimport type { DropdownMenuItem } from './types';\nimport {\n arePathsEqual,\n getEventPoint,\n hasMeasuredRect,\n isPathPrefix,\n isPointInRect,\n type ItemPath,\n type PointerPoint,\n} from './dropdown-menu-utils';\n\nconst SAFE_TRIANGLE_PADDING = 2;\nconst SAFE_TRIANGLE_ORIGIN_OFFSET = 2;\nconst SAFE_TRIANGLE_TIMEOUT = 400;\n\nexport type SafeTriangle = [PointerPoint, PointerPoint, PointerPoint];\ntype GetSafeTriangleOptions = {\n itemRect: DOMRect | null;\n submenuRect: DOMRect;\n origin: PointerPoint;\n};\ntype PendingHover = {\n item: DropdownMenuItem;\n path: ItemPath;\n};\ntype HoverCommit = (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void;\n\ntype UseDropdownMenuHoverIntentOptions = {\n openSubmenuPath: Ref<ItemPath>;\n getItemElement: (path: ItemPath) => HTMLElement | null;\n getSubmenuElement: (path: ItemPath) => HTMLElement | null;\n};\n\nfunction getTriangleArea(a: PointerPoint, b: PointerPoint, c: PointerPoint) {\n return Math.abs((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y)) / 2);\n}\n\nfunction isPointInTriangle(point: PointerPoint, triangle: SafeTriangle) {\n const [a, b, c] = triangle;\n const area = getTriangleArea(a, b, c);\n const area1 = getTriangleArea(point, b, c);\n const area2 = getTriangleArea(a, point, c);\n const area3 = getTriangleArea(a, b, point);\n\n return Math.abs(area - (area1 + area2 + area3)) < 0.5;\n}\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction clampPointToRect(point: PointerPoint, rect: DOMRect): PointerPoint {\n return {\n x: clamp(point.x, rect.left, rect.right),\n y: clamp(point.y, rect.top, rect.bottom),\n };\n}\n\nexport function getDropdownMenuSafeTriangle({\n itemRect,\n submenuRect,\n origin,\n}: GetSafeTriangleOptions): SafeTriangle {\n const measuredItemRect = itemRect && hasMeasuredRect(itemRect) ? itemRect : null;\n const opensRight = !measuredItemRect || submenuRect.left >= measuredItemRect.right;\n const edgeX = opensRight ? submenuRect.left : submenuRect.right;\n const boundedOrigin = measuredItemRect ? clampPointToRect(origin, measuredItemRect) : origin;\n const expandedOrigin = {\n x:\n boundedOrigin.x +\n (opensRight ? -SAFE_TRIANGLE_ORIGIN_OFFSET : SAFE_TRIANGLE_ORIGIN_OFFSET),\n y: boundedOrigin.y,\n };\n\n return [\n expandedOrigin,\n {\n x: edgeX,\n y: submenuRect.top - SAFE_TRIANGLE_PADDING,\n },\n {\n x: edgeX,\n y: submenuRect.bottom + SAFE_TRIANGLE_PADDING,\n },\n ];\n}\n\nexport function useDropdownMenuHoverIntent({\n openSubmenuPath,\n getItemElement,\n getSubmenuElement,\n}: UseDropdownMenuHoverIntentOptions) {\n const safeTriangleOrigin = ref<PointerPoint | null>(null);\n let latestPointerPoint: PointerPoint | null = null;\n let pendingHover: PendingHover | null = null;\n let pendingHoverTimer: number | undefined;\n\n function clearPendingHover() {\n pendingHover = null;\n if (pendingHoverTimer !== undefined) {\n window.clearTimeout(pendingHoverTimer);\n pendingHoverTimer = undefined;\n }\n }\n\n function resetHoverIntent() {\n safeTriangleOrigin.value = null;\n latestPointerPoint = null;\n clearPendingHover();\n }\n\n function getFallbackTriangleOrigin(path: ItemPath): PointerPoint | null {\n const itemRect = getItemElement(path)?.getBoundingClientRect();\n if (!itemRect) return null;\n\n const submenuRect = getSubmenuElement(path)?.getBoundingClientRect();\n const opensRight = !submenuRect || submenuRect.left >= itemRect.right;\n return {\n x: opensRight ? itemRect.right : itemRect.left,\n y: itemRect.top + itemRect.height / 2,\n };\n }\n\n function trackSubmenuOpen(path: ItemPath, point?: PointerPoint) {\n safeTriangleOrigin.value = point ?? getFallbackTriangleOrigin(path);\n clearPendingHover();\n }\n\n function isPointInCurrentSubmenu(point: PointerPoint) {\n if (openSubmenuPath.value.length === 0) return false;\n\n const submenuRect = getSubmenuElement(openSubmenuPath.value)?.getBoundingClientRect();\n return submenuRect ? isPointInRect(point, submenuRect, SAFE_TRIANGLE_PADDING) : false;\n }\n\n function getSafeTriangle(path: ItemPath): SafeTriangle | null {\n const submenuRect = getSubmenuElement(path)?.getBoundingClientRect();\n const itemRect = getItemElement(path)?.getBoundingClientRect();\n const origin = safeTriangleOrigin.value ?? getFallbackTriangleOrigin(path);\n\n if (!submenuRect || !origin) return null;\n\n return getDropdownMenuSafeTriangle({\n itemRect: itemRect ?? null,\n submenuRect,\n origin,\n });\n }\n\n function updateSafeTriangleOrigin(point: PointerPoint) {\n if (openSubmenuPath.value.length === 0) return;\n\n const itemRect = getItemElement(openSubmenuPath.value)?.getBoundingClientRect();\n if (itemRect && isPointInRect(point, itemRect)) {\n safeTriangleOrigin.value = point;\n }\n }\n\n function shouldDelayHover(path: ItemPath, point: PointerPoint) {\n if (openSubmenuPath.value.length === 0) return false;\n if (arePathsEqual(path, openSubmenuPath.value)) return false;\n if (isPathPrefix(openSubmenuPath.value, path)) return false;\n if (isPointInCurrentSubmenu(point)) return true;\n\n const triangle = getSafeTriangle(openSubmenuPath.value);\n return triangle ? isPointInTriangle(point, triangle) : false;\n }\n\n function delayHoveredItem(item: DropdownMenuItem, path: ItemPath, commit: HoverCommit) {\n pendingHover = {\n item,\n path,\n };\n\n if (pendingHoverTimer !== undefined) window.clearTimeout(pendingHoverTimer);\n pendingHoverTimer = window.setTimeout(() => {\n if (!pendingHover) return;\n\n const nextHover = pendingHover;\n if (latestPointerPoint && isPointInCurrentSubmenu(latestPointerPoint)) {\n clearPendingHover();\n return;\n }\n\n commit(nextHover.item, nextHover.path);\n }, SAFE_TRIANGLE_TIMEOUT);\n }\n\n function handleItemHover(\n item: DropdownMenuItem,\n path: ItemPath,\n event: MouseEvent | undefined,\n commit: HoverCommit,\n ) {\n const point = event ? getEventPoint(event) : undefined;\n latestPointerPoint = point ?? latestPointerPoint;\n\n if (point && shouldDelayHover(path, point)) {\n delayHoveredItem(item, path, commit);\n return;\n }\n\n commit(item, path, point);\n }\n\n function handleMenuMousemove(event: MouseEvent, commit: HoverCommit) {\n const point = getEventPoint(event);\n latestPointerPoint = point;\n updateSafeTriangleOrigin(point);\n if (!pendingHover) return;\n\n if (shouldDelayHover(pendingHover.path, point)) return;\n\n const nextHover = pendingHover;\n commit(nextHover.item, nextHover.path, point);\n }\n\n onUnmounted(clearPendingHover);\n\n return {\n clearPendingHover,\n resetHoverIntent,\n trackSubmenuOpen,\n handleItemHover,\n handleMenuMousemove,\n };\n}\n","import type { Ref } from 'vue';\nimport type {\n DropdownMenuCloseOptions,\n DropdownMenuFocusTarget,\n DropdownMenuItem,\n DropdownMenuOpenOptions,\n DropdownMenuProps,\n} from './types';\nimport {\n arePathsEqual,\n DEFAULT_FOCUS_TARGET,\n getEventPoint,\n getParentPath,\n hasItemSubmenu,\n normalizePath,\n type ItemPath,\n type PointerPoint,\n type SubmenuFocusTarget,\n} from './dropdown-menu-utils';\n\ntype BooleanSource = Readonly<Ref<boolean>>;\n\ntype DisclosureControls = {\n open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;\n close: (options?: DropdownMenuCloseOptions) => void;\n toggle: () => void;\n};\n\ntype SubmenuControls = {\n closeSubmenusAfter: (menuPath: ItemPath) => void;\n openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget) => boolean;\n closeSubmenu: (path: ItemPath) => boolean;\n closeCurrentSubmenu: () => boolean;\n};\n\ntype HoverIntentControls = {\n clearPendingHover: () => void;\n resetHoverIntent: () => void;\n trackSubmenuOpen: (path: ItemPath, point?: PointerPoint) => void;\n handleItemHover: (\n item: DropdownMenuItem,\n path: ItemPath,\n event: MouseEvent | undefined,\n commit: (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void,\n ) => void;\n handleMenuMousemove: (\n event: MouseEvent,\n commit: (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void,\n ) => void;\n};\n\ntype UseDropdownMenuInteractionsOptions = {\n props: Readonly<DropdownMenuProps>;\n emit: {\n select?: (item: DropdownMenuItem) => void;\n };\n isDisabled: BooleanSource;\n focusedPath: Ref<ItemPath>;\n openSubmenuPath: Ref<ItemPath>;\n getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;\n focusItem: (target: DropdownMenuFocusTarget, menuPath?: ItemPath) => boolean;\n moveFocus: (direction: 1 | -1) => ItemPath | undefined;\n submenus: SubmenuControls;\n hoverIntent: HoverIntentControls;\n disclosure: DisclosureControls;\n isSubmenuOpeningLeft: (path: ItemPath) => boolean;\n};\n\nexport function useDropdownMenuInteractions({\n props,\n emit,\n isDisabled,\n focusedPath,\n openSubmenuPath,\n getItemAtPath,\n focusItem,\n moveFocus,\n submenus,\n hoverIntent,\n disclosure,\n isSubmenuOpeningLeft,\n}: UseDropdownMenuInteractionsOptions) {\n function activateItem(item: DropdownMenuItem, path: ItemPath, event?: MouseEvent) {\n if (item.disabled) return;\n\n if (hasItemSubmenu(item)) {\n openSubmenu(path, DEFAULT_FOCUS_TARGET, event ? getEventPoint(event) : undefined);\n return;\n }\n\n selectItem(item);\n }\n\n function selectItem(item: DropdownMenuItem) {\n if (item.disabled) return;\n\n emit.select?.(item);\n if (props.closeOnSelect !== false) {\n disclosure.close({ focusTrigger: true });\n }\n }\n\n function closeSubmenusAfter(menuPath: ItemPath) {\n submenus.closeSubmenusAfter(menuPath);\n hoverIntent.resetHoverIntent();\n }\n\n function openSubmenu(\n path: ItemPath,\n focus: SubmenuFocusTarget = DEFAULT_FOCUS_TARGET,\n point?: PointerPoint,\n ) {\n const opened = submenus.openSubmenu(path, focus);\n if (opened) hoverIntent.trackSubmenuOpen(path, point);\n return opened;\n }\n\n function closeSubmenu(path: ItemPath) {\n const closed = submenus.closeSubmenu(path);\n if (closed) hoverIntent.resetHoverIntent();\n return closed;\n }\n\n function closeCurrentSubmenu() {\n const closed = submenus.closeCurrentSubmenu();\n if (closed) hoverIntent.resetHoverIntent();\n return closed;\n }\n\n function commitHoveredItem(item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) {\n hoverIntent.clearPendingHover();\n focusedPath.value = [...path];\n\n if (hasItemSubmenu(item)) {\n openSubmenu(path, false, point);\n } else {\n closeSubmenusAfter(getParentPath(path));\n }\n }\n\n function focusHoveredItem(\n item: DropdownMenuItem,\n indexOrPath: number | ItemPath,\n event?: MouseEvent,\n ) {\n if (item.disabled) return;\n\n const path = normalizePath(indexOrPath);\n hoverIntent.handleItemHover(item, path, event, commitHoveredItem);\n }\n\n function selectFocusedItem() {\n const item = getItemAtPath(focusedPath.value);\n if (!item) return;\n activateItem(item, focusedPath.value);\n }\n\n function moveFocusedItem(direction: 1 | -1) {\n const menuPath = moveFocus(direction);\n if (menuPath) closeSubmenusAfter(menuPath);\n }\n\n function onTriggerClick() {\n disclosure.toggle();\n }\n\n function onTriggerKeydown(event: KeyboardEvent) {\n if (isDisabled.value) return;\n\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault();\n disclosure.open();\n break;\n case 'ArrowUp':\n event.preventDefault();\n disclosure.open({ focus: 'last' });\n break;\n case 'Escape':\n disclosure.close({ focusTrigger: true });\n break;\n }\n }\n\n function onMenuKeydown(event: KeyboardEvent) {\n hoverIntent.resetHoverIntent();\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n moveFocusedItem(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n moveFocusedItem(-1);\n break;\n case 'Home':\n event.preventDefault();\n focusItem('first', getParentPath(focusedPath.value));\n break;\n case 'End':\n event.preventDefault();\n focusItem('last', getParentPath(focusedPath.value));\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n onMenuHorizontalKeydown(event);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n selectFocusedItem();\n break;\n case 'Escape':\n event.preventDefault();\n if (!closeCurrentSubmenu()) disclosure.close({ focusTrigger: true });\n break;\n case 'Tab':\n disclosure.close();\n break;\n }\n }\n\n function onMenuHorizontalKeydown(event: KeyboardEvent) {\n const isRight = event.key === 'ArrowRight';\n const currentMenuPath = getParentPath(focusedPath.value);\n const closePath =\n focusedPath.value.length > 1\n ? currentMenuPath\n : arePathsEqual(focusedPath.value, openSubmenuPath.value)\n ? focusedPath.value\n : undefined;\n\n if (closePath && isRight === isSubmenuOpeningLeft(closePath)) {\n event.preventDefault();\n closeSubmenu(closePath);\n return;\n }\n\n const item = getItemAtPath(focusedPath.value);\n if (!item || item.disabled || !hasItemSubmenu(item)) return;\n\n const nextSubmenuOpensLeft = isSubmenuOpeningLeft(focusedPath.value);\n if (isRight === nextSubmenuOpensLeft) return;\n\n event.preventDefault();\n openSubmenu(focusedPath.value);\n }\n\n function onMenuMousemove(event: MouseEvent) {\n hoverIntent.handleMenuMousemove(event, commitHoveredItem);\n }\n\n function onMenuMouseleave() {\n hoverIntent.resetHoverIntent();\n }\n\n return {\n activateItem,\n selectItem,\n openSubmenu,\n closeSubmenu,\n focusHoveredItem,\n onTriggerClick,\n onTriggerKeydown,\n onMenuKeydown,\n onMenuMousemove,\n onMenuMouseleave,\n };\n}\n","import { computed, ref } from 'vue';\nimport type { DropdownMenuFocusTarget, DropdownMenuItem } from './types';\nimport {\n arePathsEqual,\n getEnabledIndexes,\n getNextEnabledIndex,\n getParentPath,\n normalizePath,\n type ItemPath,\n} from './dropdown-menu-utils';\n\ntype DropdownMenuItemsSource = {\n readonly value: DropdownMenuItem[];\n};\n\nexport function useDropdownMenuNavigation(items: DropdownMenuItemsSource) {\n const focusedPath = ref<ItemPath>([]);\n const focusedIndex = computed(() => focusedPath.value[0] ?? -1);\n\n function getItemsAtPath(path: ItemPath) {\n let currentItems = items.value;\n for (const index of path) {\n const item = currentItems[index];\n if (!item) return [];\n currentItems = item.children ?? [];\n }\n return currentItems;\n }\n\n function getItemAtPath(path: ItemPath) {\n if (path.length === 0) return undefined;\n const parentItems = getItemsAtPath(getParentPath(path));\n return parentItems[path[path.length - 1]];\n }\n\n function focusItem(target: DropdownMenuFocusTarget, menuPath: ItemPath = []) {\n const enabledIndexes = getEnabledIndexes(getItemsAtPath(menuPath));\n const index =\n target === 'last' ? enabledIndexes[enabledIndexes.length - 1] : enabledIndexes[0];\n\n if (index === undefined) {\n if (menuPath.length === 0) focusedPath.value = [];\n return false;\n }\n\n focusedPath.value = [...menuPath, index];\n return true;\n }\n\n function resetFocus() {\n focusedPath.value = [];\n }\n\n function isItemFocused(indexOrPath: number | ItemPath) {\n return arePathsEqual(normalizePath(indexOrPath), focusedPath.value);\n }\n\n function moveFocus(direction: 1 | -1) {\n const menuPath = getParentPath(focusedPath.value);\n const itemsAtPath = getItemsAtPath(menuPath);\n const currentIndex =\n focusedPath.value.length === 0\n ? direction === 1\n ? -1\n : itemsAtPath.length\n : focusedPath.value[focusedPath.value.length - 1]!;\n const nextIndex = getNextEnabledIndex(itemsAtPath, currentIndex, direction);\n\n if (nextIndex === undefined) {\n focusedPath.value = [];\n return undefined;\n }\n\n focusedPath.value = [...menuPath, nextIndex];\n return menuPath;\n }\n\n return {\n focusedPath,\n focusedIndex,\n getItemsAtPath,\n getItemAtPath,\n focusItem,\n resetFocus,\n isItemFocused,\n moveFocus,\n };\n}\n","import { computed } from 'vue';\nimport { bem } from '@/utils/bem';\nimport type {\n DropdownMenuCloseOptions,\n DropdownMenuFocusTarget,\n DropdownMenuItem,\n DropdownMenuItemProps,\n DropdownMenuItemSlotProps,\n DropdownMenuRenderedItem,\n DropdownMenuSubmenuProps,\n} from './types';\nimport {\n DEFAULT_FOCUS_TARGET,\n getItemClass,\n getPathKey,\n hasItemSubmenu,\n hasNestedItems,\n normalizePath,\n type ItemPath,\n} from './dropdown-menu-utils';\n\ntype DropdownMenuItemsSource = {\n readonly value: DropdownMenuItem[];\n};\n\ntype UseDropdownMenuRenderItemsOptions = {\n items: DropdownMenuItemsSource;\n getItemId: (path: ItemPath) => string;\n getSubmenuId: (path: ItemPath) => string;\n getMenuActiveDescendant: (path: ItemPath) => string | undefined;\n isItemFocused: (indexOrPath: number | ItemPath) => boolean;\n isSubmenuOpen: (path: ItemPath) => boolean;\n activateItem: (item: DropdownMenuItem, path: ItemPath, event?: MouseEvent) => void;\n focusHoveredItem: (\n item: DropdownMenuItem,\n indexOrPath: number | ItemPath,\n event?: MouseEvent,\n ) => void;\n selectItem: (item: DropdownMenuItem) => void;\n openSubmenu: (path: ItemPath, focus?: DropdownMenuFocusTarget) => void;\n closeSubmenu: (path: ItemPath) => void;\n close: (options?: DropdownMenuCloseOptions) => void;\n};\n\nexport function useDropdownMenuRenderItems({\n items,\n getItemId,\n getSubmenuId,\n getMenuActiveDescendant,\n isItemFocused,\n isSubmenuOpen,\n activateItem,\n focusHoveredItem,\n selectItem,\n openSubmenu,\n closeSubmenu,\n close,\n}: UseDropdownMenuRenderItemsOptions) {\n const renderedItems = computed<DropdownMenuRenderedItem[]>(() => getRenderedItems(items.value));\n\n function getRenderedItems(\n dropdownItems: DropdownMenuItem[],\n parentPath: ItemPath = [],\n ): DropdownMenuRenderedItem[] {\n return dropdownItems.map((item, index) => {\n const path = [...parentPath, index];\n const level = parentPath.length;\n const focused = isItemFocused(path);\n const disabled = Boolean(item.disabled);\n const hasSubmenu = hasItemSubmenu(item);\n const submenuOpen = hasSubmenu && isSubmenuOpen(path);\n\n return {\n item,\n index,\n key: `${getPathKey(path)}:${String(item.value)}`,\n path,\n level,\n focused,\n disabled,\n hasSubmenu,\n submenuOpen,\n props: getItemProps(item, path, focused, disabled),\n submenuProps: hasSubmenu ? getSubmenuProps(item, path) : undefined,\n slotProps: getItemSlotProps(item, path, focused, disabled),\n children: hasSubmenu ? getRenderedItems(item.children ?? [], path) : [],\n };\n });\n }\n\n function getItemProps(\n item: DropdownMenuItem,\n indexOrPath: number | ItemPath,\n focused = isItemFocused(indexOrPath),\n disabled = Boolean(item.disabled),\n ): DropdownMenuItemProps {\n const path = normalizePath(indexOrPath);\n const hasSubmenu = hasItemSubmenu(item);\n const submenuOpen = hasSubmenu && isSubmenuOpen(path);\n\n return {\n id: getItemId(path),\n type: 'button',\n role: 'menuitem',\n tabindex: -1,\n class: getItemClass(item, focused, disabled, hasSubmenu, submenuOpen),\n 'aria-controls': hasSubmenu ? getSubmenuId(path) : undefined,\n 'aria-expanded': hasSubmenu ? submenuOpen : undefined,\n 'aria-haspopup': hasSubmenu ? 'menu' : undefined,\n 'aria-disabled': disabled || undefined,\n 'data-disabled': disabled || undefined,\n 'data-focused': focused || undefined,\n 'data-submenu': hasSubmenu || undefined,\n onClick: (event) => activateItem(item, path, event),\n onMouseenter: (event) => focusHoveredItem(item, path, event),\n };\n }\n\n function getSubmenuProps(item: DropdownMenuItem, path: ItemPath): DropdownMenuSubmenuProps {\n return {\n id: getSubmenuId(path),\n role: 'menu',\n class: bem('rp-dropdown-menu__submenu', {\n open: isSubmenuOpen(path),\n 'has-submenu': hasNestedItems(item.children ?? []),\n }),\n 'aria-label': item.label,\n 'aria-activedescendant': getMenuActiveDescendant(path),\n };\n }\n\n function getItemSlotProps(\n item: DropdownMenuItem,\n indexOrPath: number | ItemPath,\n focused = isItemFocused(indexOrPath),\n disabled = Boolean(item.disabled),\n ): DropdownMenuItemSlotProps {\n const path = normalizePath(indexOrPath);\n const hasSubmenu = hasItemSubmenu(item);\n\n return {\n item,\n index: path[path.length - 1] ?? -1,\n path,\n level: path.length - 1,\n focused,\n disabled,\n hasSubmenu,\n isSubmenuOpen: hasSubmenu && isSubmenuOpen(path),\n select: () => selectItem(item),\n openSubmenu: (focus = DEFAULT_FOCUS_TARGET) => openSubmenu(path, focus),\n closeSubmenu: () => closeSubmenu(path),\n close,\n };\n }\n\n return {\n renderedItems,\n getItemProps,\n getItemSlotProps,\n };\n}\n","import { ref, type Ref } from 'vue';\nimport type { DropdownMenuItem } from './types';\nimport {\n DEFAULT_FOCUS_TARGET,\n getParentPath,\n hasItemSubmenu,\n isPathPrefix,\n type ItemPath,\n type SubmenuFocusTarget,\n} from './dropdown-menu-utils';\n\ntype UseDropdownSubmenusOptions = {\n focusedPath: Ref<ItemPath>;\n getItemAtPath: (path: ItemPath) => DropdownMenuItem | undefined;\n focusItem: (target: Exclude<SubmenuFocusTarget, false>, menuPath?: ItemPath) => boolean;\n};\n\nexport function useDropdownSubmenus({\n focusedPath,\n getItemAtPath,\n focusItem,\n}: UseDropdownSubmenusOptions) {\n const openSubmenuPath = ref<ItemPath>([]);\n\n function resetSubmenus() {\n openSubmenuPath.value = [];\n }\n\n function isSubmenuOpen(path: ItemPath) {\n return path.length > 0 && isPathPrefix(path, openSubmenuPath.value);\n }\n\n function closeSubmenusAfter(menuPath: ItemPath) {\n openSubmenuPath.value = [...menuPath];\n }\n\n function openSubmenu(path: ItemPath, focus: SubmenuFocusTarget = DEFAULT_FOCUS_TARGET) {\n const item = getItemAtPath(path);\n if (!item || item.disabled || !hasItemSubmenu(item)) return false;\n\n openSubmenuPath.value = [...path];\n if (focus && !focusItem(focus, path)) focusedPath.value = [...path];\n return true;\n }\n\n function closeSubmenu(path: ItemPath) {\n if (!isSubmenuOpen(path)) return false;\n\n openSubmenuPath.value = getParentPath(path);\n if (isPathPrefix(path, focusedPath.value) && focusedPath.value.length > path.length) {\n focusedPath.value = [...path];\n }\n return true;\n }\n\n function closeCurrentSubmenu() {\n const path =\n focusedPath.value.length > 1 ? getParentPath(focusedPath.value) : focusedPath.value;\n\n if (path.length === 0 || !isSubmenuOpen(path)) return false;\n\n return closeSubmenu(path);\n }\n\n return {\n openSubmenuPath,\n resetSubmenus,\n isSubmenuOpen,\n closeSubmenusAfter,\n openSubmenu,\n closeSubmenu,\n closeCurrentSubmenu,\n };\n}\n","import { computed, ref, useId } from 'vue';\nimport { bem } from '@/utils/bem';\nimport type {\n DropdownMenuContentProps,\n DropdownMenuItem,\n DropdownMenuProps,\n DropdownMenuSlotProps,\n DropdownMenuTriggerProps,\n} from './types';\nimport { DEFAULT_PLACEMENT, hasNestedItems } from './dropdown-menu-utils';\nimport { useDropdownMenuDisclosure } from './useDropdownMenuDisclosure';\nimport { useDropdownMenuDom } from './useDropdownMenuDom';\nimport { useDropdownMenuHoverIntent } from './useDropdownMenuHoverIntent';\nimport { useDropdownMenuInteractions } from './useDropdownMenuInteractions';\nimport { useDropdownMenuNavigation } from './useDropdownMenuNavigation';\nimport { useDropdownMenuRenderItems } from './useDropdownMenuRenderItems';\nimport { useDropdownSubmenus } from './useDropdownSubmenus';\n\nexport function useDropdownMenu(\n props: Readonly<DropdownMenuProps>,\n emit: {\n openChange?: (open: boolean) => void;\n select?: (item: DropdownMenuItem) => void;\n } = {},\n) {\n const rootRef = ref<HTMLElement | null>(null);\n const menuRef = ref<HTMLElement | null>(null);\n const uncontrolledOpen = ref(false);\n\n const generatedId = useId();\n const menuId = computed(() => props.id ?? `${generatedId}-menu`);\n const placement = computed(() => props.placement ?? DEFAULT_PLACEMENT);\n const visibleItems = computed(() => props.items ?? []);\n const isDisabled = computed(() => Boolean(props.disabled));\n const isOpen = computed(() => props.open ?? uncontrolledOpen.value);\n const isVisible = computed(() => isOpen.value && !isDisabled.value);\n const contentHasSubmenu = computed(() => hasNestedItems(visibleItems.value));\n const isEmpty = computed(() => visibleItems.value.length === 0);\n\n const {\n focusedPath,\n focusedIndex,\n getItemAtPath,\n focusItem,\n resetFocus,\n isItemFocused,\n moveFocus,\n } = useDropdownMenuNavigation(visibleItems);\n\n const submenus = useDropdownSubmenus({\n focusedPath,\n getItemAtPath,\n focusItem,\n });\n const { openSubmenuPath, isSubmenuOpen } = submenus;\n\n const {\n activeDescendantId,\n focusMenu,\n focusTrigger,\n getItemId,\n getSubmenuId,\n getItemElement,\n getSubmenuElement,\n isSubmenuOpeningLeft,\n getMenuActiveDescendant,\n } = useDropdownMenuDom({\n menuId,\n rootRef,\n menuRef,\n placement,\n focusedPath,\n });\n\n const hoverIntent = useDropdownMenuHoverIntent({\n openSubmenuPath,\n getItemElement,\n getSubmenuElement,\n });\n\n const disclosure = useDropdownMenuDisclosure({\n props,\n emit,\n rootRef,\n uncontrolledOpen,\n isDisabled,\n isOpen,\n isVisible,\n focusedPath,\n resetFocus,\n resetSubmenus: submenus.resetSubmenus,\n resetHoverIntent: hoverIntent.resetHoverIntent,\n focusItem,\n focusMenu,\n focusTrigger,\n });\n const { open, close, toggle } = disclosure;\n\n const {\n activateItem,\n selectItem,\n openSubmenu,\n closeSubmenu,\n focusHoveredItem,\n onTriggerClick,\n onTriggerKeydown,\n onMenuKeydown,\n onMenuMousemove,\n onMenuMouseleave,\n } = useDropdownMenuInteractions({\n props,\n emit,\n isDisabled,\n focusedPath,\n openSubmenuPath,\n getItemAtPath,\n focusItem,\n moveFocus,\n submenus,\n hoverIntent,\n disclosure,\n isSubmenuOpeningLeft,\n });\n\n const rootClass = computed(() =>\n bem('rp-dropdown-menu', {\n [`placement-${placement.value}`]: true,\n open: isVisible.value,\n disabled: isDisabled.value,\n }),\n );\n\n const contentClass = computed(() =>\n bem('rp-dropdown-menu__content', {\n 'has-submenu': contentHasSubmenu.value,\n }),\n );\n\n const triggerProps = computed<DropdownMenuTriggerProps>(() => ({\n 'aria-controls': isDisabled.value ? undefined : menuId.value,\n 'aria-expanded': isDisabled.value ? undefined : isVisible.value,\n 'aria-haspopup': 'menu',\n disabled: isDisabled.value || undefined,\n onClick: onTriggerClick,\n onKeydown: onTriggerKeydown,\n }));\n\n const contentProps = computed<DropdownMenuContentProps>(() => ({\n id: menuId.value,\n role: 'menu',\n tabindex: -1,\n 'aria-label': props.ariaLabel || undefined,\n 'aria-activedescendant': activeDescendantId.value,\n onKeydown: onMenuKeydown,\n onMousemove: onMenuMousemove,\n onMouseleave: onMenuMouseleave,\n }));\n\n const slotProps = computed<DropdownMenuSlotProps>(() => ({\n triggerProps: triggerProps.value,\n isOpen: isVisible.value,\n open,\n close,\n toggle,\n }));\n\n const { renderedItems, getItemProps, getItemSlotProps } = useDropdownMenuRenderItems({\n items: visibleItems,\n getItemId,\n getSubmenuId,\n getMenuActiveDescendant,\n isItemFocused,\n isSubmenuOpen,\n activateItem,\n focusHoveredItem,\n selectItem,\n openSubmenu,\n closeSubmenu,\n close,\n });\n\n return {\n rootRef,\n menuRef,\n menuId,\n isVisible,\n isEmpty,\n visibleItems,\n renderedItems,\n focusedIndex,\n focusedPath,\n activeDescendantId,\n rootClass,\n contentClass,\n triggerProps,\n contentProps,\n slotProps,\n open,\n close,\n toggle,\n selectItem,\n openSubmenu,\n closeSubmenu,\n onItemMouseenter: focusHoveredItem,\n onTriggerKeydown,\n onMenuKeydown,\n getItemProps,\n getItemSlotProps,\n };\n}\n","<template>\n <span ref=\"rootRef\" :class=\"rootClass\">\n <slot v-bind=\"slotProps\" />\n\n <Transition name=\"rp-dropdown-menu-content\">\n <div v-if=\"isVisible\" ref=\"menuRef\" :class=\"contentClass\" v-bind=\"contentProps\">\n <div v-if=\"isEmpty\" class=\"rp-dropdown-menu__empty\">\n <slot name=\"empty\">No actions</slot>\n </div>\n\n <DropdownMenuItems :items=\"renderedItems\">\n <template #item=\"itemSlotProps\">\n <slot name=\"item\" v-bind=\"itemSlotProps\">\n <span class=\"rp-dropdown-menu__label\">{{\n itemSlotProps.item.label\n }}</span>\n <kbd\n v-if=\"itemSlotProps.item.shortcut\"\n class=\"rp-dropdown-menu__shortcut\"\n >\n {{ itemSlotProps.item.shortcut }}\n </kbd>\n </slot>\n <span\n v-if=\"itemSlotProps.hasSubmenu\"\n class=\"rp-dropdown-menu__submenu-icon\"\n aria-hidden=\"true\"\n >\n <IconChevronRight />\n </span>\n </template>\n </DropdownMenuItems>\n </div>\n </Transition>\n </span>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport IconChevronRight from '~icons/lucide/chevron-right';\nimport DropdownMenuItems from './dropdown-menu-items';\nimport { useDropdownMenu } from './useDropdownMenu';\nimport type {\n DropdownMenuItem,\n DropdownMenuItemSlotProps,\n DropdownMenuProps,\n DropdownMenuSlotProps,\n} from './types';\n\ndefineOptions({ name: 'RpDropdownMenu' });\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n items: () => [],\n placement: 'bottom-start',\n open: undefined,\n disabled: false,\n closeOnSelect: true,\n});\n\nconst emit = defineEmits<{\n 'update:open': [value: boolean];\n select: [item: DropdownMenuItem];\n}>();\n\ndefineSlots<{\n default(props: DropdownMenuSlotProps): unknown;\n item?(props: DropdownMenuItemSlotProps): unknown;\n empty?(): unknown;\n}>();\n\nconst {\n rootRef,\n menuRef,\n isVisible,\n isEmpty,\n renderedItems,\n rootClass,\n contentClass,\n contentProps,\n slotProps,\n} = useDropdownMenu(props, {\n openChange: (open) => emit('update:open', open),\n select: (item) => emit('select', item),\n});\n\nvoid rootRef;\nvoid menuRef;\n</script>\n\n<style src=\"./dropdown-menu.scss\" lang=\"scss\"></style>\n","<template>\n <span ref=\"rootRef\" :class=\"rootClass\">\n <slot v-bind=\"slotProps\" />\n\n <Transition name=\"rp-dropdown-menu-content\">\n <div v-if=\"isVisible\" ref=\"menuRef\" :class=\"contentClass\" v-bind=\"contentProps\">\n <div v-if=\"isEmpty\" class=\"rp-dropdown-menu__empty\">\n <slot name=\"empty\">No actions</slot>\n </div>\n\n <DropdownMenuItems :items=\"renderedItems\">\n <template #item=\"itemSlotProps\">\n <slot name=\"item\" v-bind=\"itemSlotProps\">\n <span class=\"rp-dropdown-menu__label\">{{\n itemSlotProps.item.label\n }}</span>\n <kbd\n v-if=\"itemSlotProps.item.shortcut\"\n class=\"rp-dropdown-menu__shortcut\"\n >\n {{ itemSlotProps.item.shortcut }}\n </kbd>\n </slot>\n <span\n v-if=\"itemSlotProps.hasSubmenu\"\n class=\"rp-dropdown-menu__submenu-icon\"\n aria-hidden=\"true\"\n >\n <IconChevronRight />\n </span>\n </template>\n </DropdownMenuItems>\n </div>\n </Transition>\n </span>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport IconChevronRight from '~icons/lucide/chevron-right';\nimport DropdownMenuItems from './dropdown-menu-items';\nimport { useDropdownMenu } from './useDropdownMenu';\nimport type {\n DropdownMenuItem,\n DropdownMenuItemSlotProps,\n DropdownMenuProps,\n DropdownMenuSlotProps,\n} from './types';\n\ndefineOptions({ name: 'RpDropdownMenu' });\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n items: () => [],\n placement: 'bottom-start',\n open: undefined,\n disabled: false,\n closeOnSelect: true,\n});\n\nconst emit = defineEmits<{\n 'update:open': [value: boolean];\n select: [item: DropdownMenuItem];\n}>();\n\ndefineSlots<{\n default(props: DropdownMenuSlotProps): unknown;\n item?(props: DropdownMenuItemSlotProps): unknown;\n empty?(): unknown;\n}>();\n\nconst {\n rootRef,\n menuRef,\n isVisible,\n isEmpty,\n renderedItems,\n rootClass,\n contentClass,\n contentProps,\n slotProps,\n} = useDropdownMenu(props, {\n openChange: (open) => emit('update:open', open),\n select: (item) => emit('select', item),\n});\n\nvoid rootRef;\nvoid menuRef;\n</script>\n\n<style src=\"./dropdown-menu.scss\" lang=\"scss\"></style>\n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AY,GAAU,MAAA,YAAA,CAAY,CAAA,CAAA;;mBAC/D,MAAA,OAAA,SAAO;;;gBACR,SAAY,YAAA;;;;;;0DAGF,aAAO,MAAA,aAAA,EAAa,GAAA,EAAA,QAAA,QAAA,kBAAA;wBAE1B,QAAW,EAAA,GAAA,OAAS,aAAA,EAAA,SAAA;;;sDAElB,cAAa,KAAA,KAAA,CAAA,CAAA;kCAGP,cAAa,KAAA,gBAAA;;;uDAGhB,cAAa,KAAA,QAAA,CAAA,CAAA;;;wBAId,cAAa,kBAAA"}
|
package/dist/field.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.rp-field[data-v-
|
|
1
|
+
.rp-field[data-v-50e7f3a5] {
|
|
2
2
|
--_rp-field-danger: var(--rp-color-danger);
|
|
3
3
|
display: grid;
|
|
4
4
|
gap: var(--rp-spacing-1);
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
font-family: var(--rp-font-family);
|
|
7
7
|
color: var(--rp-color-text);
|
|
8
8
|
}
|
|
9
|
-
html.dark .rp-field[data-v-
|
|
9
|
+
html.dark .rp-field[data-v-50e7f3a5] {
|
|
10
10
|
--_rp-field-danger: var(--rp-color-danger-fg);
|
|
11
11
|
}
|
|
12
|
-
.rp-field__label[data-v-
|
|
12
|
+
.rp-field__label[data-v-50e7f3a5] {
|
|
13
13
|
display: inline-flex;
|
|
14
14
|
width: fit-content;
|
|
15
15
|
align-items: center;
|
|
@@ -19,22 +19,22 @@ html.dark .rp-field[data-v-b8c3dcbe] {
|
|
|
19
19
|
font-weight: var(--rp-font-weight-medium);
|
|
20
20
|
line-height: var(--rp-line-height-normal);
|
|
21
21
|
}
|
|
22
|
-
.rp-field__required[data-v-
|
|
22
|
+
.rp-field__required[data-v-50e7f3a5] {
|
|
23
23
|
color: var(--_rp-field-danger);
|
|
24
24
|
line-height: var(--rp-line-height-none);
|
|
25
25
|
}
|
|
26
|
-
.rp-field__control[data-v-
|
|
26
|
+
.rp-field__control[data-v-50e7f3a5] {
|
|
27
27
|
min-width: 0;
|
|
28
28
|
}
|
|
29
|
-
.rp-field__description[data-v-
|
|
29
|
+
.rp-field__description[data-v-50e7f3a5], .rp-field__message[data-v-50e7f3a5] {
|
|
30
30
|
margin: 0;
|
|
31
31
|
color: var(--rp-color-text-secondary);
|
|
32
32
|
font-size: var(--rp-font-size-sm);
|
|
33
33
|
line-height: var(--rp-line-height-normal);
|
|
34
34
|
}
|
|
35
|
-
.rp-field--invalid .rp-field__message[data-v-
|
|
35
|
+
.rp-field--invalid .rp-field__message[data-v-50e7f3a5] {
|
|
36
36
|
color: var(--_rp-field-danger);
|
|
37
37
|
}
|
|
38
|
-
.rp-field--disabled .rp-field__label[data-v-
|
|
38
|
+
.rp-field--disabled .rp-field__label[data-v-50e7f3a5], .rp-field--disabled .rp-field__description[data-v-50e7f3a5], .rp-field--disabled .rp-field__message[data-v-50e7f3a5] {
|
|
39
39
|
color: var(--rp-color-text-disabled);
|
|
40
40
|
}
|
package/dist/field.js
CHANGED
|
@@ -1,13 +1,57 @@
|
|
|
1
1
|
import './field.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t as bem } from "./bem.js";
|
|
3
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
4
|
+
import { child, computed, createIf, createSlot, defineVaporComponent, renderEffect, setClass, setInsertionState, setProp, setText, template, toDisplayString, unref, useId, useSlots } from "vue";
|
|
5
|
+
//#region src/components/field/useField.ts
|
|
6
|
+
function useField(props) {
|
|
7
|
+
const slots = useSlots();
|
|
8
|
+
const generatedId = useId();
|
|
9
|
+
const controlId = computed(() => props.id ?? `${generatedId}-control`);
|
|
10
|
+
const labelId = computed(() => `${controlId.value}-label`);
|
|
11
|
+
const descriptionId = computed(() => `${controlId.value}-description`);
|
|
12
|
+
const messageId = computed(() => `${controlId.value}-message`);
|
|
13
|
+
const isInvalid = computed(() => Boolean(props.invalid || props.error));
|
|
14
|
+
const messageText = computed(() => props.error || props.message);
|
|
15
|
+
const hasLabel = computed(() => Boolean(props.label || slots.label));
|
|
16
|
+
const hasDescription = computed(() => Boolean(props.description || slots.description));
|
|
17
|
+
const hasMessage = computed(() => Boolean(messageText.value || slots.message));
|
|
18
|
+
const controlLabelledby = computed(() => hasLabel.value ? labelId.value : void 0);
|
|
19
|
+
const controlDescribedby = computed(() => [hasDescription.value ? descriptionId.value : void 0, hasMessage.value ? messageId.value : void 0].filter(Boolean).join(" ") || void 0);
|
|
20
|
+
return {
|
|
21
|
+
controlId,
|
|
22
|
+
labelId,
|
|
23
|
+
descriptionId,
|
|
24
|
+
messageId,
|
|
25
|
+
isInvalid,
|
|
26
|
+
messageText,
|
|
27
|
+
hasLabel,
|
|
28
|
+
hasDescription,
|
|
29
|
+
hasMessage,
|
|
30
|
+
controlLabelledby,
|
|
31
|
+
controlDescribedby,
|
|
32
|
+
rootClass: computed(() => bem("rp-field", {
|
|
33
|
+
disabled: props.disabled,
|
|
34
|
+
required: props.required,
|
|
35
|
+
invalid: isInvalid.value
|
|
36
|
+
})),
|
|
37
|
+
controlProps: computed(() => ({
|
|
38
|
+
id: controlId.value,
|
|
39
|
+
disabled: props.disabled || void 0,
|
|
40
|
+
required: props.required || void 0,
|
|
41
|
+
invalid: isInvalid.value || void 0,
|
|
42
|
+
labelledby: controlLabelledby.value,
|
|
43
|
+
describedby: controlDescribedby.value
|
|
44
|
+
}))
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
4
48
|
//#region src/components/field/field.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
5
49
|
var t0 = template(" ");
|
|
6
|
-
var t1 = template("<span data-v-
|
|
7
|
-
var t2 = template("<label data-v-
|
|
8
|
-
var t3 = template("<p data-v-
|
|
9
|
-
var t4 = template("<p data-v-
|
|
10
|
-
var t5 = template("<div data-v-
|
|
50
|
+
var t1 = template("<span data-v-50e7f3a5 class=rp-field__required aria-hidden=true>*", 2);
|
|
51
|
+
var t2 = template("<label data-v-50e7f3a5 class=rp-field__label>");
|
|
52
|
+
var t3 = template("<p data-v-50e7f3a5 class=rp-field__description>");
|
|
53
|
+
var t4 = template("<p data-v-50e7f3a5 class=rp-field__message>");
|
|
54
|
+
var t5 = template("<div data-v-50e7f3a5><div data-v-50e7f3a5 class=rp-field__control></div>", 1);
|
|
11
55
|
//#endregion
|
|
12
56
|
//#region src/components/field/field.vue
|
|
13
57
|
var field_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -33,42 +77,16 @@ var field_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
|
|
|
33
77
|
}
|
|
34
78
|
},
|
|
35
79
|
setup(__props) {
|
|
36
|
-
const
|
|
37
|
-
const slots = useSlots();
|
|
38
|
-
const generatedId = useId();
|
|
39
|
-
const controlId = computed(() => props.id ?? `${generatedId}-control`);
|
|
40
|
-
const labelId = computed(() => `${controlId.value}-label`);
|
|
41
|
-
const descriptionId = computed(() => `${controlId.value}-description`);
|
|
42
|
-
const messageId = computed(() => `${controlId.value}-message`);
|
|
43
|
-
const isInvalid = computed(() => Boolean(props.invalid || props.error));
|
|
44
|
-
const messageText = computed(() => props.error || props.message);
|
|
45
|
-
const hasLabel = computed(() => Boolean(props.label || slots.label));
|
|
46
|
-
const hasDescription = computed(() => Boolean(props.description || slots.description));
|
|
47
|
-
const hasMessage = computed(() => Boolean(messageText.value || slots.message));
|
|
48
|
-
const controlLabelledby = computed(() => hasLabel.value ? labelId.value : void 0);
|
|
49
|
-
const controlDescribedby = computed(() => [hasDescription.value ? descriptionId.value : void 0, hasMessage.value ? messageId.value : void 0].filter(Boolean).join(" ") || void 0);
|
|
50
|
-
const rootClass = computed(() => bem("rp-field", {
|
|
51
|
-
disabled: props.disabled,
|
|
52
|
-
required: props.required,
|
|
53
|
-
invalid: isInvalid.value
|
|
54
|
-
}));
|
|
55
|
-
const controlProps = computed(() => ({
|
|
56
|
-
id: controlId.value,
|
|
57
|
-
disabled: props.disabled || void 0,
|
|
58
|
-
required: props.required || void 0,
|
|
59
|
-
invalid: isInvalid.value || void 0,
|
|
60
|
-
labelledby: controlLabelledby.value,
|
|
61
|
-
describedby: controlDescribedby.value
|
|
62
|
-
}));
|
|
80
|
+
const { controlId, labelId, descriptionId, messageId, isInvalid, messageText, hasLabel, hasDescription, hasMessage, controlLabelledby, controlDescribedby, rootClass, controlProps } = useField(__props);
|
|
63
81
|
const n23 = t5();
|
|
64
82
|
const n10 = child(n23, 1);
|
|
65
|
-
renderEffect(() => setClass(n23, rootClass
|
|
83
|
+
renderEffect(() => setClass(n23, unref(rootClass)));
|
|
66
84
|
setInsertionState(n23, 0, 0);
|
|
67
|
-
createIf(() => hasLabel
|
|
85
|
+
createIf(() => unref(hasLabel), () => {
|
|
68
86
|
const n8 = t2();
|
|
69
87
|
renderEffect(() => {
|
|
70
|
-
setProp(n8, "id", labelId
|
|
71
|
-
setProp(n8, "for", controlId
|
|
88
|
+
setProp(n8, "id", unref(labelId));
|
|
89
|
+
setProp(n8, "for", unref(controlId));
|
|
72
90
|
});
|
|
73
91
|
setInsertionState(n8, null, 0);
|
|
74
92
|
createSlot("label", null, () => {
|
|
@@ -84,18 +102,18 @@ var field_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
|
|
|
84
102
|
});
|
|
85
103
|
setInsertionState(n10, null, 0);
|
|
86
104
|
createSlot("default", {
|
|
87
|
-
id: () => controlId
|
|
105
|
+
id: () => unref(controlId),
|
|
88
106
|
disabled: () => __props.disabled || void 0,
|
|
89
107
|
required: () => __props.required || void 0,
|
|
90
|
-
invalid: () => isInvalid
|
|
91
|
-
labelledby: () => controlLabelledby
|
|
92
|
-
describedby: () => controlDescribedby
|
|
93
|
-
controlProps: () => controlProps
|
|
108
|
+
invalid: () => unref(isInvalid) || void 0,
|
|
109
|
+
labelledby: () => unref(controlLabelledby),
|
|
110
|
+
describedby: () => unref(controlDescribedby),
|
|
111
|
+
controlProps: () => unref(controlProps)
|
|
94
112
|
}, null, 1);
|
|
95
113
|
setInsertionState(n23, null, 2);
|
|
96
|
-
createIf(() => hasDescription
|
|
114
|
+
createIf(() => unref(hasDescription), () => {
|
|
97
115
|
const n16 = t3();
|
|
98
|
-
renderEffect(() => setProp(n16, "id", descriptionId
|
|
116
|
+
renderEffect(() => setProp(n16, "id", unref(descriptionId)));
|
|
99
117
|
setInsertionState(n16, null, 0);
|
|
100
118
|
createSlot("description", null, () => {
|
|
101
119
|
const n15 = t0();
|
|
@@ -105,23 +123,23 @@ var field_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__
|
|
|
105
123
|
return n16;
|
|
106
124
|
});
|
|
107
125
|
setInsertionState(n23, null, 3);
|
|
108
|
-
createIf(() => hasMessage
|
|
126
|
+
createIf(() => unref(hasMessage), () => {
|
|
109
127
|
const n22 = t4();
|
|
110
128
|
renderEffect(() => {
|
|
111
|
-
setProp(n22, "id", messageId
|
|
112
|
-
setProp(n22, "role", isInvalid
|
|
129
|
+
setProp(n22, "id", unref(messageId));
|
|
130
|
+
setProp(n22, "role", unref(isInvalid) ? "alert" : void 0);
|
|
113
131
|
});
|
|
114
132
|
setInsertionState(n22, null, 0);
|
|
115
133
|
createSlot("message", null, () => {
|
|
116
134
|
const n21 = t0();
|
|
117
|
-
renderEffect(() => setText(n21, toDisplayString(messageText
|
|
135
|
+
renderEffect(() => setText(n21, toDisplayString(unref(messageText))));
|
|
118
136
|
return n21;
|
|
119
137
|
}, 1);
|
|
120
138
|
return n22;
|
|
121
139
|
});
|
|
122
140
|
return n23;
|
|
123
141
|
}
|
|
124
|
-
}), [["__scopeId", "data-v-
|
|
142
|
+
}), [["__scopeId", "data-v-50e7f3a5"]]);
|
|
125
143
|
//#endregion
|
|
126
144
|
export { field_default as t };
|
|
127
145
|
|
package/dist/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":[],"sources":["../src/components/field/field.vue","../src/components/field/field.vue"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"field.js","names":[],"sources":["../src/components/field/useField.ts","../src/components/field/field.vue","../src/components/field/field.vue"],"sourcesContent":["import { computed, useId, useSlots } from 'vue';\nimport { bem } from '@/utils/bem';\nimport type { FieldControlProps, FieldProps } from './types';\n\nexport function useField(props: Readonly<FieldProps>) {\n const slots = useSlots();\n const generatedId = useId();\n\n const controlId = computed(() => props.id ?? `${generatedId}-control`);\n const labelId = computed(() => `${controlId.value}-label`);\n const descriptionId = computed(() => `${controlId.value}-description`);\n const messageId = computed(() => `${controlId.value}-message`);\n\n const isInvalid = computed(() => Boolean(props.invalid || props.error));\n const messageText = computed(() => props.error || props.message);\n\n const hasLabel = computed(() => Boolean(props.label || slots.label));\n const hasDescription = computed(() => Boolean(props.description || slots.description));\n const hasMessage = computed(() => Boolean(messageText.value || slots.message));\n\n const controlLabelledby = computed(() => (hasLabel.value ? labelId.value : undefined));\n const controlDescribedby = computed(\n () =>\n [\n hasDescription.value ? descriptionId.value : undefined,\n hasMessage.value ? messageId.value : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n );\n\n const rootClass = computed(() =>\n bem('rp-field', {\n disabled: props.disabled,\n required: props.required,\n invalid: isInvalid.value,\n }),\n );\n\n const controlProps = computed<FieldControlProps>(() => ({\n id: controlId.value,\n disabled: props.disabled || undefined,\n required: props.required || undefined,\n invalid: isInvalid.value || undefined,\n labelledby: controlLabelledby.value,\n describedby: controlDescribedby.value,\n }));\n\n return {\n controlId,\n labelId,\n descriptionId,\n messageId,\n isInvalid,\n messageText,\n hasLabel,\n hasDescription,\n hasMessage,\n controlLabelledby,\n controlDescribedby,\n rootClass,\n controlProps,\n };\n}\n","<template>\n <div :class=\"rootClass\">\n <label v-if=\"hasLabel\" :id=\"labelId\" class=\"rp-field__label\" :for=\"controlId\">\n <slot name=\"label\">{{ label }}</slot>\n <span v-if=\"required\" class=\"rp-field__required\" aria-hidden=\"true\">*</span>\n </label>\n\n <div class=\"rp-field__control\">\n <slot\n :id=\"controlId\"\n :disabled=\"disabled || undefined\"\n :required=\"required || undefined\"\n :invalid=\"isInvalid || undefined\"\n :labelledby=\"controlLabelledby\"\n :describedby=\"controlDescribedby\"\n :control-props=\"controlProps\"\n />\n </div>\n\n <p v-if=\"hasDescription\" :id=\"descriptionId\" class=\"rp-field__description\">\n <slot name=\"description\">{{ description }}</slot>\n </p>\n\n <p\n v-if=\"hasMessage\"\n :id=\"messageId\"\n class=\"rp-field__message\"\n :role=\"isInvalid ? 'alert' : undefined\"\n >\n <slot name=\"message\">{{ messageText }}</slot>\n </p>\n </div>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { useField } from './useField';\nimport type { FieldProps } from './types';\n\ndefineOptions({ name: 'RpField' });\n\nconst props = withDefaults(defineProps<FieldProps>(), {\n label: '',\n description: '',\n message: '',\n error: '',\n disabled: undefined,\n required: false,\n invalid: undefined,\n});\n\nconst {\n controlId,\n labelId,\n descriptionId,\n messageId,\n isInvalid,\n messageText,\n hasLabel,\n hasDescription,\n hasMessage,\n controlLabelledby,\n controlDescribedby,\n rootClass,\n controlProps,\n} = useField(props);\n</script>\n\n<style src=\"./field.scss\" lang=\"scss\" scoped></style>\n","<template>\n <div :class=\"rootClass\">\n <label v-if=\"hasLabel\" :id=\"labelId\" class=\"rp-field__label\" :for=\"controlId\">\n <slot name=\"label\">{{ label }}</slot>\n <span v-if=\"required\" class=\"rp-field__required\" aria-hidden=\"true\">*</span>\n </label>\n\n <div class=\"rp-field__control\">\n <slot\n :id=\"controlId\"\n :disabled=\"disabled || undefined\"\n :required=\"required || undefined\"\n :invalid=\"isInvalid || undefined\"\n :labelledby=\"controlLabelledby\"\n :describedby=\"controlDescribedby\"\n :control-props=\"controlProps\"\n />\n </div>\n\n <p v-if=\"hasDescription\" :id=\"descriptionId\" class=\"rp-field__description\">\n <slot name=\"description\">{{ description }}</slot>\n </p>\n\n <p\n v-if=\"hasMessage\"\n :id=\"messageId\"\n class=\"rp-field__message\"\n :role=\"isInvalid ? 'alert' : undefined\"\n >\n <slot name=\"message\">{{ messageText }}</slot>\n </p>\n </div>\n</template>\n\n<script lang=\"ts\" setup vapor>\nimport { useField } from './useField';\nimport type { FieldProps } from './types';\n\ndefineOptions({ name: 'RpField' });\n\nconst props = withDefaults(defineProps<FieldProps>(), {\n label: '',\n description: '',\n message: '',\n error: '',\n disabled: undefined,\n required: false,\n invalid: undefined,\n});\n\nconst {\n controlId,\n labelId,\n descriptionId,\n messageId,\n isInvalid,\n messageText,\n hasLabel,\n hasDescription,\n hasMessage,\n controlLabelledby,\n controlDescribedby,\n rootClass,\n controlProps,\n} = useField(props);\n</script>\n\n<style src=\"./field.scss\" lang=\"scss\" scoped></style>\n"],"mappings":";;;;AAIA,SAAgB,SAAS,OAA6B;CAClD,MAAM,QAAQ,SAAS;CACvB,MAAM,cAAc,MAAM;CAE1B,MAAM,YAAY,eAAe,MAAM,MAAM,GAAG,YAAY,SAAS;CACrE,MAAM,UAAU,eAAe,GAAG,UAAU,MAAM,OAAO;CACzD,MAAM,gBAAgB,eAAe,GAAG,UAAU,MAAM,aAAa;CACrE,MAAM,YAAY,eAAe,GAAG,UAAU,MAAM,SAAS;CAE7D,MAAM,YAAY,eAAe,QAAQ,MAAM,WAAW,MAAM,KAAK,CAAC;CACtE,MAAM,cAAc,eAAe,MAAM,SAAS,MAAM,OAAO;CAE/D,MAAM,WAAW,eAAe,QAAQ,MAAM,SAAS,MAAM,KAAK,CAAC;CACnE,MAAM,iBAAiB,eAAe,QAAQ,MAAM,eAAe,MAAM,WAAW,CAAC;CACrF,MAAM,aAAa,eAAe,QAAQ,YAAY,SAAS,MAAM,OAAO,CAAC;CAE7E,MAAM,oBAAoB,eAAgB,SAAS,QAAQ,QAAQ,QAAQ,KAAA,CAAU;CACrF,MAAM,qBAAqB,eAEnB,CACI,eAAe,QAAQ,cAAc,QAAQ,KAAA,GAC7C,WAAW,QAAQ,UAAU,QAAQ,KAAA,CACzC,CAAC,C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