@leaflink/stash 53.4.6 → 53.4.8
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/AppSidebar.js +56 -52
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewToolbar.js +139 -125
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +1114 -1113
- package/dist/DatePicker.js.map +1 -1
- package/dist/Modal.js +105 -89
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +30 -26
- package/dist/Modals.js.map +1 -1
- package/dist/MoreActions.js +294 -288
- package/dist/MoreActions.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/RadioGroup.js +69 -62
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +27 -25
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +103 -101
- package/dist/Select.js.map +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
- package/dist/Thumbnail.js +42 -42
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailGroup.js +24 -22
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/Timeline.js +15 -13
- package/dist/Timeline.js.map +1 -1
- package/dist/Toast.vue.d.ts +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js.map → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js.map} +1 -1
- package/dist/components.css +1 -1
- package/dist/getContrastingTextColor.d.ts +8 -0
- package/dist/index-t9tXBnql.js +469 -0
- package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
- package/dist/templateRefNarrowing-CeANDylX.js +22 -0
- package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
- package/dist/useMediaQuery.d.ts +12 -10
- package/dist/useMediaQuery.js +7 -29
- package/dist/useMediaQuery.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/dist/useValidation.d.ts +11 -1
- package/dist/useValidation.js +240 -198
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/getContrastingTextColor.js +36 -24
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/package.json +1 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
- package/dist/index-DA70nQCT.js +0 -424
package/dist/MoreActions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreActions.js","sources":["../src/composables/useToggleAnimation/useToggleAnimation.ts","../src/components/MoreActions/constants.ts","../src/components/MoreActions/utils.ts","../src/components/MoreActions/useOverflowCalculator.ts","../src/components/MoreActions/createIntersectionObserver.ts","../src/components/MoreActions/useMoreButtonWidth.ts","../src/components/MoreActions/useVisibleElementsWidth.ts","../src/components/MoreActions/MoreActions.vue"],"sourcesContent":["import { useToggle } from '@vueuse/core';\nimport { onUnmounted, type Ref, ref } from 'vue';\n\nexport interface UseToggleAnimationOptions {\n /**\n * Duration of the animation in milliseconds\n * @default 300\n */\n duration?: number;\n /**\n * Whether to start with the element visible\n * @default false\n */\n initialVisible?: boolean;\n}\n\nexport interface UseToggleAnimationReturn {\n /**\n * Whether the element should be visible in the DOM\n */\n isVisible: Ref<boolean>;\n /**\n * Whether the element should show the \"show\" animation (fade-in)\n */\n shouldShow: Ref<boolean>;\n /**\n * Whether the element should show the \"hide\" animation (fade-out)\n */\n shouldHide: Ref<boolean>;\n /**\n * Function to toggle the visibility with animation\n */\n toggle: (visible: boolean) => void;\n /**\n * Function to show the element with animation\n */\n show: () => void;\n /**\n * Function to hide the element with animation\n */\n hide: () => void;\n /**\n * Function to immediately set visibility without animation\n */\n setVisible: (visible: boolean) => void;\n /**\n * Cleanup function to clear any pending timeouts\n */\n cleanup: () => void;\n}\n\n/**\n * Composable for managing toggle animations with proper timeout cleanup\n *\n * @param options Configuration options for the animation\n * @returns Object with visibility state and control functions\n *\n */\nexport function useToggleAnimation(options: UseToggleAnimationOptions = {}): UseToggleAnimationReturn {\n const { duration = 300, initialVisible = false } = options;\n\n const [isVisible, toggleIsVisible] = useToggle(initialVisible);\n const [shouldShow, toggleShouldShow] = useToggle(initialVisible);\n const [shouldHide, toggleShouldHide] = useToggle(false);\n const timeoutId = ref<ReturnType<typeof setTimeout> | null>(null);\n\n /**\n * Clear any existing timeout to prevent race conditions\n */\n function clearExistingTimeout(): void {\n if (timeoutId.value !== null) {\n clearTimeout(timeoutId.value);\n timeoutId.value = null;\n }\n }\n\n /**\n * Set visibility immediately without animation\n */\n function setVisible(visible: boolean): void {\n clearExistingTimeout();\n if (isVisible.value !== visible) {\n toggleIsVisible();\n }\n if (shouldShow.value !== visible) {\n toggleShouldShow();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n }\n\n /**\n * Toggle visibility with animation\n */\n function toggle(visible: boolean): void {\n clearExistingTimeout();\n\n if (visible) {\n // Show with fade-in\n if (!isVisible.value) {\n toggleIsVisible();\n }\n if (!shouldShow.value) {\n toggleShouldShow();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n } else {\n // Hide with fade-out, then remove from DOM after animation\n if (shouldShow.value) {\n toggleShouldShow();\n }\n if (!shouldHide.value) {\n toggleShouldHide();\n }\n\n timeoutId.value = setTimeout(() => {\n if (isVisible.value) {\n toggleIsVisible();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n timeoutId.value = null;\n }, duration);\n }\n }\n\n /**\n * Show the element with animation\n */\n function show(): void {\n toggle(true);\n }\n\n /**\n * Hide the element with animation\n */\n function hide(): void {\n toggle(false);\n }\n\n /**\n * Cleanup function to clear any pending timeouts\n */\n function cleanup(): void {\n clearExistingTimeout();\n }\n\n // Cleanup timeout on component unmount to prevent memory leaks\n onUnmounted(() => {\n cleanup();\n });\n\n return {\n isVisible,\n shouldShow,\n shouldHide,\n toggle,\n show,\n hide,\n setVisible,\n cleanup,\n };\n}\n","export const Z_INDEX = {\n TRACKER: -1,\n DROPDOWN: 1000,\n} as const;\n\nexport const ID_PREFIXES = {\n AUTO_ACTION: 'auto-action-',\n INDEX_BASED: 'index-',\n MORE_MENU: 'more-actions-menu-',\n} as const;\n\nexport const DATA_ATTRIBUTES = {\n ACTION_ID: 'data-action-id',\n PROCESSED: 'data-more-actions-processed',\n} as const;\n\nexport const FADE_ANIMATION_DURATION = 300;\n","import { DEBOUNCE } from '../../constants';\nimport { DATA_ATTRIBUTES, ID_PREFIXES } from './constants';\n\n// Map to track pending timeouts for elements to prevent memory leaks\nconst elementTimeouts = new WeakMap<HTMLElement, ReturnType<typeof setTimeout>>();\n\n/**\n * Adds data-action-id attributes to first-level children of the actions container\n * Ensures unique IDs by checking existing ones\n */\nexport function addActionIdsToFirstLevelChildren(actionsContainerEl: HTMLElement | null): void {\n if (!actionsContainerEl) {\n return;\n }\n\n // Get all direct children of the actions container\n const directChildren = Array.from(actionsContainerEl.children) as HTMLElement[];\n\n // Collect existing action IDs to avoid duplicates\n const existingIds = new Set<string>();\n directChildren.forEach((child) => {\n const existingId = child.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n if (existingId) {\n existingIds.add(existingId);\n }\n });\n\n // Find the next available index for auto-generated IDs\n let nextIndex = 0;\n while (existingIds.has(`auto-action-${nextIndex}`)) {\n nextIndex++;\n }\n\n directChildren.forEach((child) => {\n // Only add data-action-id if it doesn't already exist\n if (!child.hasAttribute(DATA_ATTRIBUTES.ACTION_ID)) {\n child.setAttribute(DATA_ATTRIBUTES.ACTION_ID, `${ID_PREFIXES.AUTO_ACTION}${nextIndex}`);\n nextIndex++;\n }\n });\n}\n\n/**\n * Creates a map of elements to their IDs\n */\nexport function createElementIdMap(directChildren: HTMLElement[]): Map<HTMLElement, string> {\n const elementIdMap = new Map<HTMLElement, string>();\n\n directChildren.forEach((child, index) => {\n const actionId = child.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n if (actionId) {\n elementIdMap.set(child, actionId);\n } else {\n // Use index as ID for elements without data-action-id\n elementIdMap.set(child, `${ID_PREFIXES.INDEX_BASED}${index}`);\n }\n });\n\n return elementIdMap;\n}\n\n/**\n * Cleans up overflow IDs for elements that no longer exist\n */\nexport function cleanupOverflowIds(overflowIds: Set<string>, currentElementIds: Set<string>): void {\n const idsToRemove: string[] = [];\n\n overflowIds.forEach((id) => {\n if (!currentElementIds.has(id)) {\n idsToRemove.push(id);\n }\n });\n\n idsToRemove.forEach((id) => {\n overflowIds.delete(id);\n });\n}\n\n/**\n * Applies visibility classes to elements based on overflow state\n */\nexport function applyElementVisibility(element: HTMLElement, elementId: string, overflowIds: Set<string>): void {\n // Clear any pending timeout for this element\n const existingTimeout = elementTimeouts.get(element);\n if (existingTimeout) {\n clearTimeout(existingTimeout);\n elementTimeouts.delete(element);\n }\n\n if (overflowIds.has(elementId)) {\n element.removeAttribute(DATA_ATTRIBUTES.PROCESSED);\n element.classList.add('invisible');\n } else {\n const timeout = setTimeout(() => {\n if (element.isConnected) {\n element.setAttribute(DATA_ATTRIBUTES.PROCESSED, 'true');\n }\n elementTimeouts.delete(element);\n }, DEBOUNCE.FAST);\n elementTimeouts.set(element, timeout);\n element.classList.remove('invisible');\n }\n}\n\n/**\n * Syncs more-actions content visibility based on overflow state\n * Shows more-actions items whose data-action-id is in overflowIds\n * Supports nested elements with data-action-id (e.g., Menu > MenuItem)\n */\nexport function syncMoreActionsVisibility(moreDropdownMenuEl: HTMLElement | null, overflowIds: Set<string>): void {\n if (!moreDropdownMenuEl) {\n return;\n }\n\n // Find all elements with data-action-id at any nesting level (for nested wrappers like Menu > MenuItem)\n const nestedItemsWithActionId = Array.from(\n moreDropdownMenuEl.querySelectorAll(`[${DATA_ATTRIBUTES.ACTION_ID}]`),\n ) as HTMLElement[];\n\n // Filter to only \"leaf\" elements - those that don't contain other elements with data-action-id\n // This prevents hiding wrapper elements that contain the actual actionable items\n const leafItems = nestedItemsWithActionId.filter((element) => {\n const nestedActionsInside = element.querySelectorAll(`[${DATA_ATTRIBUTES.ACTION_ID}]`);\n // If element has nested elements with data-action-id inside, it's a wrapper, not a leaf\n return nestedActionsInside.length === 0;\n });\n\n // Apply styles and visibility to leaf items only\n leafItems.forEach((element) => {\n const actionId = element.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n\n // Show more-actions item only if its action-id is in overflowIds (item is hidden in toolbar)\n const shouldShow = actionId && overflowIds.has(actionId);\n if (shouldShow) {\n element.classList.remove('hidden');\n } else {\n element.classList.add('hidden');\n }\n });\n}\n","import { useElementBounding } from '@vueuse/core';\nimport debounce from 'lodash-es/debounce';\nimport { nextTick, type Ref, ref, type ShallowRef } from 'vue';\n\nimport { DEBOUNCE } from '../../constants';\nimport { DATA_ATTRIBUTES } from './constants';\nimport { applyElementVisibility, createElementIdMap, syncMoreActionsVisibility } from './utils';\n\ninterface UseOverflowCalculatorOptions {\n actionsContainerRef: ShallowRef<HTMLElement | null>;\n overflowIds: Ref<Set<string>>;\n moreDropdownMenuRef: ShallowRef<HTMLElement | null>;\n trackerElementRef: ShallowRef<HTMLElement | null>;\n onOverflowChange?: () => void;\n}\n\nexport function useOverflowCalculator({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n onOverflowChange,\n}: UseOverflowCalculatorOptions) {\n const isProcessing = ref(false);\n const lastOverflowState = ref<string>(''); // Track last overflow state to prevent unnecessary updates\n const trackerBounding = useElementBounding(trackerElementRef);\n\n /**\n * Updates overflow state and applies visibility classes to elements\n */\n function updateOverflowState(\n newOverflowIds: Set<string>,\n directChildren: HTMLElement[],\n elementIdMap: Map<HTMLElement, string>,\n ): void {\n overflowIds.value.clear();\n newOverflowIds.forEach((id) => overflowIds.value.add(id));\n\n // Apply visibility classes\n directChildren.forEach((element) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n if (elementId) {\n applyElementVisibility(element, elementId, overflowIds.value);\n }\n });\n }\n\n function calculateOverflowInternal() {\n if (!actionsContainerRef.value || !trackerElementRef.value) {\n isProcessing.value = false;\n return;\n }\n\n const directChildren = Array.from(actionsContainerRef.value.children) as HTMLElement[];\n const elementIdMap = createElementIdMap(directChildren);\n\n // Create a new overflow set to compare with current state\n const newOverflowIds = new Set<string>();\n\n // Get current gap width from CSS computed styles of the actions container\n const computedStyle = window.getComputedStyle(actionsContainerRef.value);\n const gapValue = computedStyle.columnGap || computedStyle.gap;\n const gapWidth = gapValue ? parseFloat(gapValue) : 0;\n\n // Calculate which elements should be hidden based on their position relative to tracker\n directChildren.forEach((element, index) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n const elementRect = element.getBoundingClientRect();\n\n // Calculate the effective right edge including gap\n // If this is not the last element, add gap to the right edge\n const effectiveRightEdge = index < directChildren.length - 1 ? elementRect.right + gapWidth : elementRect.right;\n\n // If element's effective right edge extends beyond tracker's left edge, hide it\n if (effectiveRightEdge > trackerBounding.left.value) {\n if (elementId) {\n newOverflowIds.add(elementId);\n }\n }\n });\n\n // Check if overflow state has actually changed\n const currentOverflowState = Array.from(overflowIds.value).sort().join(',');\n const newOverflowState = Array.from(newOverflowIds).sort().join(',');\n\n if (currentOverflowState !== newOverflowState) {\n // Update overflow state and apply visibility\n updateOverflowState(newOverflowIds, directChildren, elementIdMap);\n\n // Sync more-actions content visibility\n syncMoreActionsVisibility(moreDropdownMenuRef.value, overflowIds.value);\n\n // Call callback if provided and state actually changed\n // Use nextTick to ensure CSS changes are applied before calculating visible elements width\n if (onOverflowChange && lastOverflowState.value !== newOverflowState) {\n lastOverflowState.value = newOverflowState;\n nextTick(() => {\n onOverflowChange();\n });\n }\n }\n\n isProcessing.value = false;\n }\n\n const debouncedCalculateOverflow = debounce(calculateOverflowInternal, DEBOUNCE.FAST);\n\n function calculateOverflow() {\n if (isProcessing.value || !actionsContainerRef.value || !trackerElementRef.value) {\n return;\n }\n\n isProcessing.value = true;\n debouncedCalculateOverflow();\n }\n\n function updateTrackerBounding() {\n trackerBounding.update();\n }\n\n function cleanup() {\n debouncedCalculateOverflow.cancel();\n isProcessing.value = false;\n }\n\n return {\n calculateOverflow,\n applyElementVisibility,\n updateOverflowState,\n updateTrackerBounding,\n cleanup,\n isProcessing,\n };\n}\n","import { useIntersectionObserver, useResizeObserver } from '@vueuse/core';\nimport debounce from 'lodash-es/debounce';\nimport { nextTick, onBeforeUnmount, onDeactivated, onMounted, onUpdated, type Ref, ref, type ShallowRef } from 'vue';\n\nimport { DEBOUNCE } from '../../constants';\nimport { DATA_ATTRIBUTES } from './constants';\nimport { useOverflowCalculator } from './useOverflowCalculator';\nimport {\n addActionIdsToFirstLevelChildren as addActionIds,\n cleanupOverflowIds,\n createElementIdMap,\n syncMoreActionsVisibility,\n} from './utils';\n\ninterface CreateIntersectionObserverOptions {\n actionsContainerRef: ShallowRef<HTMLElement | null>;\n overflowIds: Ref<Set<string>>;\n moreDropdownMenuRef: ShallowRef<HTMLElement | null>;\n trackerElementRef: ShallowRef<HTMLElement | null>;\n moreDropdownWidth: Ref<number>;\n calculateMoreButtonWidth: () => number;\n hasMoreActionsSlot: Ref<boolean>;\n onOverflowChange?: () => void;\n}\n\nexport function createIntersectionObserver({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n moreDropdownWidth,\n calculateMoreButtonWidth,\n hasMoreActionsSlot,\n onOverflowChange,\n}: CreateIntersectionObserverOptions) {\n const isInitializing = ref(false);\n\n const {\n calculateOverflow,\n applyElementVisibility,\n updateOverflowState,\n updateTrackerBounding,\n cleanup: cleanupCalculator,\n isProcessing,\n } = useOverflowCalculator({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n onOverflowChange,\n });\n\n let mutationObserver: MutationObserver | null = null;\n let stopResizeObserver: (() => void) | null = null;\n let stopIntersectionObserver: (() => void) | null = null;\n\n function clearOverflowState() {\n overflowIds.value.clear();\n moreDropdownWidth.value = 0;\n }\n\n /**\n * Cleanup all observers (ResizeObserver and IntersectionObserver)\n * to prevent memory leaks when re-creating them\n */\n function cleanupObservers() {\n if (stopResizeObserver) {\n stopResizeObserver();\n stopResizeObserver = null;\n }\n if (stopIntersectionObserver) {\n stopIntersectionObserver();\n stopIntersectionObserver = null;\n }\n }\n\n // Track DOM mutations - created once, outside of createObserver to prevent duplicates\n const handleMutation = debounce(\n () => {\n if (!actionsContainerRef.value || !hasMoreActionsSlot.value) {\n return;\n }\n\n // Add data-action-id to first-level children\n addActionIds(actionsContainerRef.value);\n\n // Cleanup old observers before re-initializing\n cleanupObservers();\n cleanupCalculator();\n debouncedInitObserve();\n },\n DEBOUNCE.FAST,\n { leading: false, trailing: true },\n );\n\n function createObserver() {\n if (!actionsContainerRef.value) {\n return;\n }\n\n // If there's no more-actions slot, don't set up overflow detection\n if (!hasMoreActionsSlot.value) {\n return;\n }\n\n // Get all direct children of the actions container\n const directChildren = Array.from(actionsContainerRef.value.children) as HTMLElement[];\n\n // Create a map of elements to their IDs (either data-action-id or index-based)\n const elementIdMap = createElementIdMap(directChildren);\n\n // Clean up overflowIds for elements that no longer exist\n const currentElementIds = new Set(elementIdMap.values());\n cleanupOverflowIds(overflowIds.value, currentElementIds);\n\n // to track container size changes\n const { stop: stopResize } = useResizeObserver(actionsContainerRef, () => {\n updateTrackerBounding();\n calculateOverflow();\n });\n stopResizeObserver = stopResize;\n\n const { stop: stopIntersection } = useIntersectionObserver(\n directChildren,\n (entries) => {\n if (isProcessing.value) {\n return;\n }\n\n let hasChanges = false;\n const newOverflowIds = new Set(overflowIds.value);\n\n entries.forEach((entry) => {\n const element = entry.target as HTMLElement;\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n // Check if element is fully visible\n if (entry.intersectionRatio === 1) {\n // show action, hide in dropdown\n if (elementId && newOverflowIds.has(elementId)) {\n newOverflowIds.delete(elementId);\n hasChanges = true;\n }\n } else {\n // hide action, show in dropdown (intersectionRatio < 1 means partially or not visible)\n if (elementId && !newOverflowIds.has(elementId)) {\n newOverflowIds.add(elementId);\n hasChanges = true;\n }\n }\n });\n\n // Only update if there are actual changes\n if (hasChanges) {\n const currentOverflowState = Array.from(overflowIds.value).sort().join(',');\n const newOverflowState = Array.from(newOverflowIds).sort().join(',');\n\n if (currentOverflowState !== newOverflowState) {\n // Update overflow state and apply visibility\n updateOverflowState(newOverflowIds, directChildren, elementIdMap);\n\n // Sync more-actions content visibility\n syncMoreActionsVisibility(moreDropdownMenuRef.value, overflowIds.value);\n\n // Call callback if provided and state actually changed\n // Use nextTick to ensure CSS changes are applied before calculating visible elements width\n if (onOverflowChange) {\n nextTick(() => {\n onOverflowChange();\n });\n }\n }\n }\n },\n {\n root: actionsContainerRef.value,\n },\n );\n stopIntersectionObserver = stopIntersection;\n\n // Apply initial visibility to all elements\n directChildren.forEach((element) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || '';\n applyElementVisibility(element, elementId, overflowIds.value);\n });\n\n // Initial calculation\n calculateOverflow();\n\n syncMoreActionsVisibility(moreDropdownMenuRef.value, overflowIds.value);\n }\n\n function initObserve() {\n if (!actionsContainerRef.value) {\n return;\n }\n\n // If there's no more-actions slot, don't initialize\n if (!hasMoreActionsSlot.value) {\n return;\n }\n\n // Add data-action-id to first-level children\n addActionIds(actionsContainerRef.value);\n\n createObserver();\n\n // Set initial dropdown width - only if not already set\n if (moreDropdownWidth.value === 0) {\n moreDropdownWidth.value = calculateMoreButtonWidth();\n }\n\n // Setup MutationObserver once to watch for DOM changes\n // Only create if it doesn't exist to prevent duplicates\n if (!mutationObserver && actionsContainerRef.value) {\n mutationObserver = new MutationObserver(handleMutation);\n mutationObserver.observe(actionsContainerRef.value, {\n childList: true, // Watch for added/removed children\n subtree: false, // Only watch direct children\n });\n }\n }\n\n const debouncedInitObserve = debounce(\n () => {\n if (!isInitializing.value) {\n isInitializing.value = true;\n initObserve();\n isInitializing.value = false;\n }\n },\n DEBOUNCE.FAST,\n { leading: true },\n );\n\n onMounted(() => {\n // If there's no more-actions slot, skip initialization\n if (!hasMoreActionsSlot.value) {\n return;\n }\n\n // Add data-action-id to first-level children\n addActionIds(actionsContainerRef.value);\n initObserve();\n });\n\n onUpdated(() => {\n // If there's no more-actions slot, skip initialization\n if (!hasMoreActionsSlot.value) {\n return;\n }\n\n // Add data-action-id to first-level children\n addActionIds(actionsContainerRef.value);\n // Clear overflowIds if no actions are present\n if (actionsContainerRef.value) {\n const directChildren = Array.from(actionsContainerRef.value.children) as HTMLElement[];\n if (directChildren.length === 0) {\n clearOverflowState();\n }\n }\n cleanupObservers();\n cleanupCalculator();\n debouncedInitObserve();\n });\n\n onDeactivated(() => {\n cleanupObservers();\n cleanupCalculator();\n handleMutation.cancel();\n debouncedInitObserve.cancel();\n if (mutationObserver) {\n mutationObserver.disconnect();\n mutationObserver = null;\n }\n });\n\n onBeforeUnmount(() => {\n cleanupObservers();\n cleanupCalculator();\n handleMutation.cancel();\n debouncedInitObserve.cancel();\n if (mutationObserver) {\n mutationObserver.disconnect();\n mutationObserver = null;\n }\n });\n}\n","import { type ComputedRef, nextTick, ref, type ShallowRef, watch } from 'vue';\n\nimport Dropdown from '../Dropdown/Dropdown.vue';\n\n// Updated interface with Ref suffix naming convention\ninterface UseMoreDropdownWidthOptions {\n moreDropdownRef: ShallowRef<InstanceType<typeof Dropdown> | null>;\n actionsContainerRef: ShallowRef<HTMLElement | null>;\n moreButtonAlign: 'separate' | 'together';\n hasOverflowActions: ComputedRef<boolean>;\n}\n\nexport function useMoreButtonWidth({\n moreDropdownRef,\n actionsContainerRef,\n moreButtonAlign,\n hasOverflowActions,\n}: UseMoreDropdownWidthOptions) {\n /**\n * Calculates the width of the More dropdown with gap consideration\n * When moreButtonAlign is 'separate', adds the gap between actions container and dropdown\n * When moreButtonAlign is 'together', returns only the dropdown width\n */\n const calculateMoreButtonWidth = (): number => {\n if (!moreDropdownRef.value?.$el) {\n return 0;\n }\n\n const dropdownWidth = moreDropdownRef.value.$el.getBoundingClientRect().width;\n\n // If moreButtonAlign is separate, add gap between actions container and dropdown\n if (moreButtonAlign === 'separate' && actionsContainerRef.value) {\n const computedStyle = window.getComputedStyle(actionsContainerRef.value);\n const gapWidth = parseFloat(computedStyle.gap) || 0;\n return dropdownWidth + gapWidth;\n }\n\n return dropdownWidth;\n };\n\n const moreButtonWidth = ref(0);\n\n watch(hasOverflowActions, (newValue) => {\n if (newValue && moreDropdownRef.value) {\n nextTick(() => {\n const calculatedWidth = calculateMoreButtonWidth();\n if (calculatedWidth > 0) {\n moreButtonWidth.value = calculatedWidth;\n }\n });\n }\n });\n\n return {\n calculateMoreButtonWidth,\n moreButtonWidth,\n };\n}\n","import { nextTick, type Ref, ref, type ShallowRef, watch } from 'vue';\n\nimport { DATA_ATTRIBUTES, FADE_ANIMATION_DURATION } from './constants';\n\ninterface UseVisibleElementsWidthOptions {\n actionsContainerRef: ShallowRef<HTMLElement | null>;\n overflowIds: Ref<Set<string>>;\n}\n\nexport function useVisibleElementsWidth({ actionsContainerRef, overflowIds }: UseVisibleElementsWidthOptions) {\n const visibleElementsWidth = ref(0);\n const isRecalculatingWidth = ref(false);\n const isRecalculatingWithDelay = ref(false);\n let widthCalculationTimeout: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Calculates the total width of currently visible elements\n * This is used for positioning the More button\n */\n const calculateVisibleElementsWidth = () => {\n if (!actionsContainerRef.value) {\n visibleElementsWidth.value = 0;\n return;\n }\n\n let totalWidth = 0;\n const directChildren = Array.from(actionsContainerRef.value.children) as HTMLElement[];\n\n directChildren.forEach((element, index) => {\n const elementId = element.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n\n // Check if element should be visible based on overflow state\n // Elements without data-action-id are always considered visible (never hidden by overflow logic)\n const shouldBeVisible = !elementId || !overflowIds.value.has(elementId);\n\n // Double-check with CSS classes as a fallback\n const isHiddenByCSS = element.classList.contains('invisible');\n\n // Element is considered visible if:\n // 1. It's not in overflowIds (should be visible) OR it has no data-action-id (always visible)\n // 2. AND it's not hidden by CSS classes\n if (shouldBeVisible && !isHiddenByCSS) {\n const rect = element.getBoundingClientRect();\n totalWidth += rect.width;\n\n // Add gap between elements\n if (index < directChildren.length - 1 && actionsContainerRef.value) {\n // Always get the most current gap width from CSS computed styles of the actions container\n const computedStyle = window.getComputedStyle(actionsContainerRef.value);\n const gapValue = computedStyle.columnGap || computedStyle.gap;\n const gapWidth = gapValue ? parseFloat(gapValue) : 0;\n totalWidth += gapWidth;\n }\n }\n });\n\n visibleElementsWidth.value = totalWidth;\n };\n\n /**\n * Calculates visible elements width with a delay to allow animations to complete\n * This ensures that width calculation happens after elements are actually hidden/shown\n */\n const calculateVisibleElementsWidthDelayed = () => {\n // Set recalculating state immediately to hide More button\n isRecalculatingWithDelay.value = true;\n\n // Clear any existing timeout\n if (widthCalculationTimeout) {\n clearTimeout(widthCalculationTimeout);\n }\n\n // Set a new timeout to calculate width after animation completes\n widthCalculationTimeout = setTimeout(() => {\n if (!isRecalculatingWidth.value) {\n isRecalculatingWidth.value = true;\n\n // Use double nextTick to ensure all DOM updates and CSS changes are applied\n nextTick(() => {\n nextTick(() => {\n calculateVisibleElementsWidth();\n isRecalculatingWidth.value = false;\n isRecalculatingWithDelay.value = false; // Show More button after calculation is complete\n });\n });\n }\n }, FADE_ANIMATION_DURATION + 100); // Add small buffer to ensure animation is complete\n };\n\n // Watch for changes in overflowIds to recalculate visible elements width with delay\n watch(overflowIds, () => {\n calculateVisibleElementsWidthDelayed();\n });\n\n /**\n * Cleanup function to clear any pending timeouts\n */\n const cleanup = () => {\n if (widthCalculationTimeout) {\n clearTimeout(widthCalculationTimeout);\n widthCalculationTimeout = null;\n }\n isRecalculatingWithDelay.value = false;\n };\n\n return {\n visibleElementsWidth,\n isRecalculatingWidth,\n isRecalculatingWithDelay,\n calculateVisibleElementsWidth,\n calculateVisibleElementsWidthDelayed,\n cleanup,\n };\n}\n","<script lang=\"ts\" setup>\n /**\n * MoreActions Component\n *\n * This component provides a responsive toolbar that automatically moves overflow items\n * into a \"More\" dropdown menu when space is limited.\n *\n * @example\n * <MoreActions>\n * <Button data-action-id=\"edit\">Edit</Button>\n * <Button data-action-id=\"delete\">Delete</Button>\n * <Button data-action-id=\"share\">Share</Button>\n *\n * <template #more-actions>\n * <DropdownItem data-action-id=\"edit\">Edit Item</DropdownItem>\n * <DropdownItem data-action-id=\"delete\">Delete Item</DropdownItem>\n * <DropdownItem data-action-id=\"share\">Share Item</DropdownItem>\n * </template>\n * </MoreActions>\n *\n * IMPORTANT:\n * - The #more-actions slot is REQUIRED. If not provided, the More dropdown will not be rendered.\n * - Each item in the default slot must have a corresponding item in the 'more-actions'\n * slot with the same data-action-id attribute.\n * - The component automatically shows/hides matching items based on available space:\n * - Items visible in toolbar → hidden in more-actions\n * - Items hidden in toolbar (overflow) → visible in more-actions\n */\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue';\n\n import { useToggleAnimation } from '../../composables/useToggleAnimation/useToggleAnimation';\n import { DEBOUNCE } from '../../constants';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import { FADE_ANIMATION_DURATION, ID_PREFIXES, Z_INDEX } from './constants';\n import { createIntersectionObserver } from './createIntersectionObserver';\n import { useMoreButtonWidth } from './useMoreButtonWidth';\n import { useVisibleElementsWidth } from './useVisibleElementsWidth';\n\n export interface MoreActionsProps {\n /**\n * CSS class or classes to be applied to the actions container\n */\n actionsContainerClass?: string | Record<string, boolean> | undefined;\n /**\n * HTML element tag to use for the actions container\n * Useful when you need to maintain valid HTML semantics\n * (e.g., use 'ul' when children are <li> elements)\n * @default 'div'\n */\n actionsContainerTag?: string;\n /**\n * Text to display on the more actions button\n */\n moreButtonText?: string;\n /**\n * Optional width for the more-actions container\n * Applies style=\"width: {width}\" to the stash-more-actions element\n */\n width?: string | number;\n /**\n * Rendering mode for dropdown items\n * - 'default': Button-style rendering (current behavior)\n * - 'custom': Custom rendering through slots\n */\n dropdownMode?: 'default' | 'custom';\n /**\n * Alignment of the More button\n * - 'separate': Button is aligned to the right edge of the actions container (default)\n * - 'together': Button is aligned immediately after the last visible action\n */\n moreButtonAlign?: 'separate' | 'together';\n }\n\n const props = withDefaults(defineProps<MoreActionsProps>(), {\n actionsContainerClass: undefined,\n actionsContainerTag: 'div',\n moreButtonText: () => t('ll.more'),\n dropdownMode: 'default',\n moreButtonAlign: 'separate',\n width: undefined,\n });\n\n // Check if more-actions slot is provided (REQUIRED for dropdown to render)\n const slots = useSlots();\n const hasMoreActionsSlot = computed(() => !!slots['more-actions']);\n\n // Refs for DOM elements\n const actionsContainerRef = useTemplateRef<HTMLElement>('actionsContainerRef');\n const moreDropdownRef = useTemplateRef('moreDropdownRef');\n const moreDropdownMenuRef = useTemplateRef('moreDropdownMenuRef');\n const trackerElementRef = useTemplateRef('trackerElementRef');\n\n // State management\n const overflowIds = ref<Set<string>>(new Set());\n const isMoreMenuOpen = ref(false);\n const moreMenuId = uniqueId(ID_PREFIXES.MORE_MENU);\n const showButtonDelayTimeout = ref<ReturnType<typeof setTimeout> | null>(null);\n const isDelayedShowReady = ref(false);\n\n const {\n isVisible: isMoreButtonVisible,\n shouldShow: shouldMoreButtonShow,\n toggle: toggleMoreButtonAnimation,\n } = useToggleAnimation({\n duration: FADE_ANIMATION_DURATION,\n initialVisible: false,\n });\n\n const hasOverflowActions = computed(() => overflowIds.value.size > 0);\n\n // Updated to use new Ref suffix naming convention\n const { calculateMoreButtonWidth, moreButtonWidth } = useMoreButtonWidth({\n moreDropdownRef,\n actionsContainerRef,\n moreButtonAlign: props.moreButtonAlign,\n hasOverflowActions,\n });\n\n // Updated to use new Ref suffix naming convention\n const {\n visibleElementsWidth,\n isRecalculatingWithDelay,\n calculateVisibleElementsWidthDelayed,\n cleanup: cleanupVisibleElementsWidth,\n } = useVisibleElementsWidth({\n actionsContainerRef,\n overflowIds,\n });\n\n const shouldShowMoreButton = computed(() => {\n return (\n hasMoreActionsSlot.value &&\n hasOverflowActions.value &&\n !isRecalculatingWithDelay.value &&\n isDelayedShowReady.value\n );\n });\n\n const isMoreMenuOpenString = computed(() => isMoreMenuOpen.value.toString());\n\n const actionsContainerWidth = computed(() => {\n if (!shouldShowMoreButton.value) {\n return '100%';\n }\n\n return `calc(100% - ${moreButtonWidth.value}px)`;\n });\n\n const moreButtonPosition = computed(() => {\n if (props.moreButtonAlign === 'together') {\n return { left: `${visibleElementsWidth.value}px`, right: 'auto' };\n } else {\n // Default separate alignment\n return { right: '0', left: 'auto' };\n }\n });\n\n createIntersectionObserver({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n moreDropdownWidth: moreButtonWidth,\n calculateMoreButtonWidth,\n hasMoreActionsSlot,\n onOverflowChange: calculateVisibleElementsWidthDelayed,\n });\n\n // Watch for when recalculation completes and overflow actions exist\n watch(\n () => hasMoreActionsSlot.value && hasOverflowActions.value && !isRecalculatingWithDelay.value,\n (isReady) => {\n // Clear any existing timeout\n if (showButtonDelayTimeout.value) {\n clearTimeout(showButtonDelayTimeout.value);\n showButtonDelayTimeout.value = null;\n }\n\n if (isReady) {\n // Add delay before showing the button\n showButtonDelayTimeout.value = setTimeout(() => {\n isDelayedShowReady.value = true;\n }, DEBOUNCE.FAST);\n } else {\n // Hide immediately when overflow actions are removed or slot is not available\n isDelayedShowReady.value = false;\n }\n },\n );\n\n // Watch for changes in shouldShowMoreButton to handle fade animations\n watch(shouldShowMoreButton, (newValue) => {\n toggleMoreButtonAnimation(newValue);\n });\n\n function handleDropdownToggle(event: boolean) {\n isMoreMenuOpen.value = event;\n }\n\n onBeforeUnmount(() => {\n cleanupVisibleElementsWidth();\n if (showButtonDelayTimeout.value) {\n clearTimeout(showButtonDelayTimeout.value);\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-more-actions relative overflow-x-hidden\"\n data-test=\"stash-more-actions\"\n :style=\"{ width: props.width }\"\n >\n <component\n :is=\"props.actionsContainerTag\"\n ref=\"actionsContainerRef\"\n data-test=\"stash-more-actions__container\"\n :style=\"{\n width: actionsContainerWidth,\n minWidth: moreButtonWidth ? `${moreButtonWidth}px` : undefined,\n }\"\n :class=\"['stash-more-actions__container flex items-center gap-2 overflow-x-hidden', props.actionsContainerClass]\"\n >\n <!-- Default slot for elements that can be hidden -->\n <slot></slot>\n </component>\n\n <!-- Tracker Element - to detect when action elements overlap with it, triggering overflow behavior -->\n <div\n ref=\"trackerElementRef\"\n class=\"stash-more-actions__tracker\"\n :style=\"{\n position: 'absolute',\n right: '0px',\n top: '0',\n visibility: 'hidden',\n width: moreButtonWidth + 'px',\n height: '100%',\n pointerEvents: 'none',\n zIndex: Z_INDEX.TRACKER,\n }\"\n ></div>\n\n <!-- Only render dropdown if more-actions slot is provided -->\n <Dropdown\n v-if=\"hasMoreActionsSlot\"\n ref=\"moreDropdownRef\"\n :class=\"[\n '!absolute top-0',\n shouldMoreButtonShow ? 'animate-fade-in' : 'animate-fade-out',\n { invisible: !isMoreButtonVisible },\n ]\"\n :style=\"moreButtonPosition\"\n @toggle=\"handleDropdownToggle\"\n >\n <template #toggle=\"{ toggle }\">\n <slot name=\"toggle\" :toggle=\"toggle\" :is-open=\"isMoreMenuOpen\">\n <Button\n class=\"button -border-gray-500 text-gray-500 flex w-full items-center justify-between -border\"\n secondary\n :aria-expanded=\"isMoreMenuOpenString\"\n @click=\"toggle\"\n >\n {{ props.moreButtonText }} <Icon class=\"-ml-1.5\" name=\"action-dots\" />\n </Button>\n </slot>\n </template>\n\n <template #default>\n <div\n :id=\"moreMenuId\"\n ref=\"moreDropdownMenuRef\"\n data-test=\"stash-more-actions__dropdown\"\n class=\"flex flex-col gap-1.5 p-1.5\"\n >\n <!-- More actions slot content (only overflow items will be shown) -->\n <slot name=\"more-actions\"></slot>\n </div>\n </template>\n </Dropdown>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n :global([data-action-id]) {\n flex-shrink: 0;\n }\n }\n\n :global(.stash-more-actions__container [data-action-id]:not([data-more-actions-processed])) {\n visibility: hidden;\n }\n</style>\n"],"names":["useToggleAnimation","options","duration","initialVisible","isVisible","toggleIsVisible","useToggle","shouldShow","toggleShouldShow","shouldHide","toggleShouldHide","timeoutId","ref","clearExistingTimeout","setVisible","visible","toggle","show","hide","cleanup","onUnmounted","Z_INDEX","ID_PREFIXES","DATA_ATTRIBUTES","FADE_ANIMATION_DURATION","elementTimeouts","addActionIdsToFirstLevelChildren","actionsContainerEl","directChildren","existingIds","child","existingId","nextIndex","createElementIdMap","elementIdMap","index","actionId","cleanupOverflowIds","overflowIds","currentElementIds","idsToRemove","id","applyElementVisibility","element","elementId","existingTimeout","timeout","DEBOUNCE","syncMoreActionsVisibility","moreDropdownMenuEl","useOverflowCalculator","actionsContainerRef","moreDropdownMenuRef","trackerElementRef","onOverflowChange","isProcessing","lastOverflowState","trackerBounding","useElementBounding","updateOverflowState","newOverflowIds","calculateOverflowInternal","computedStyle","gapValue","gapWidth","elementRect","currentOverflowState","newOverflowState","nextTick","debouncedCalculateOverflow","debounce","calculateOverflow","updateTrackerBounding","createIntersectionObserver","moreDropdownWidth","calculateMoreButtonWidth","hasMoreActionsSlot","isInitializing","cleanupCalculator","mutationObserver","stopResizeObserver","stopIntersectionObserver","clearOverflowState","cleanupObservers","handleMutation","addActionIds","debouncedInitObserve","createObserver","stopResize","useResizeObserver","stopIntersection","useIntersectionObserver","entries","hasChanges","entry","initObserve","onMounted","onUpdated","onDeactivated","onBeforeUnmount","useMoreButtonWidth","moreDropdownRef","moreButtonAlign","hasOverflowActions","_a","dropdownWidth","moreButtonWidth","watch","newValue","calculatedWidth","useVisibleElementsWidth","visibleElementsWidth","isRecalculatingWidth","isRecalculatingWithDelay","widthCalculationTimeout","calculateVisibleElementsWidth","totalWidth","shouldBeVisible","isHiddenByCSS","rect","calculateVisibleElementsWidthDelayed","props","__props","slots","useSlots","computed","useTemplateRef","isMoreMenuOpen","moreMenuId","uniqueId","showButtonDelayTimeout","isDelayedShowReady","isMoreButtonVisible","shouldMoreButtonShow","toggleMoreButtonAnimation","cleanupVisibleElementsWidth","shouldShowMoreButton","isMoreMenuOpenString","actionsContainerWidth","moreButtonPosition","isReady","handleDropdownToggle","event","_createElementBlock","_normalizeStyle","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_renderSlot","_ctx","_createElementVNode","Dropdown","_withCtx","_createVNode","Button","Icon"],"mappings":";;;;;;;;;;AA0DO,SAASA,GAAmBC,IAAqC,IAA8B;AACpG,QAAM,EAAE,UAAAC,IAAW,KAAK,gBAAAC,IAAiB,OAAUF,GAE7C,CAACG,GAAWC,CAAe,IAAIC,EAAUH,CAAc,GACvD,CAACI,GAAYC,CAAgB,IAAIF,EAAUH,CAAc,GACzD,CAACM,GAAYC,CAAgB,IAAIJ,EAAU,EAAK,GAChDK,IAAYC,EAA0C,IAAI;AAKhE,WAASC,IAA6B;AACpC,IAAIF,EAAU,UAAU,SACtB,aAAaA,EAAU,KAAK,GAC5BA,EAAU,QAAQ;AAAA,EAEtB;AAKA,WAASG,EAAWC,GAAwB;AAC1C,IAAAF,EAAA,GACIT,EAAU,UAAUW,KACtBV,EAAA,GAEEE,EAAW,UAAUQ,KACvBP,EAAA,GAEEC,EAAW,SACbC,EAAA;AAAA,EAEJ;AAKA,WAASM,EAAOD,G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
1
|
+
{"version":3,"file":"MoreActions.js","sources":["../src/composables/useToggleAnimation/useToggleAnimation.ts","../src/components/MoreActions/constants.ts","../src/components/MoreActions/utils.ts","../src/components/MoreActions/useOverflowCalculator.ts","../src/components/MoreActions/createIntersectionObserver.ts","../src/components/MoreActions/useMoreButtonWidth.ts","../src/components/MoreActions/useVisibleElementsWidth.ts","../src/components/MoreActions/MoreActions.vue"],"sourcesContent":["import { useToggle } from '@vueuse/core';\nimport { onUnmounted, type Ref, ref } from 'vue';\n\nexport interface UseToggleAnimationOptions {\n /**\n * Duration of the animation in milliseconds\n * @default 300\n */\n duration?: number;\n /**\n * Whether to start with the element visible\n * @default false\n */\n initialVisible?: boolean;\n}\n\nexport interface UseToggleAnimationReturn {\n /**\n * Whether the element should be visible in the DOM\n */\n isVisible: Ref<boolean>;\n /**\n * Whether the element should show the \"show\" animation (fade-in)\n */\n shouldShow: Ref<boolean>;\n /**\n * Whether the element should show the \"hide\" animation (fade-out)\n */\n shouldHide: Ref<boolean>;\n /**\n * Function to toggle the visibility with animation\n */\n toggle: (visible: boolean) => void;\n /**\n * Function to show the element with animation\n */\n show: () => void;\n /**\n * Function to hide the element with animation\n */\n hide: () => void;\n /**\n * Function to immediately set visibility without animation\n */\n setVisible: (visible: boolean) => void;\n /**\n * Cleanup function to clear any pending timeouts\n */\n cleanup: () => void;\n}\n\n/**\n * Composable for managing toggle animations with proper timeout cleanup\n *\n * @param options Configuration options for the animation\n * @returns Object with visibility state and control functions\n *\n */\nexport function useToggleAnimation(options: UseToggleAnimationOptions = {}): UseToggleAnimationReturn {\n const { duration = 300, initialVisible = false } = options;\n\n const [isVisible, toggleIsVisible] = useToggle(initialVisible);\n const [shouldShow, toggleShouldShow] = useToggle(initialVisible);\n const [shouldHide, toggleShouldHide] = useToggle(false);\n const timeoutId = ref<ReturnType<typeof setTimeout> | null>(null);\n\n /**\n * Clear any existing timeout to prevent race conditions\n */\n function clearExistingTimeout(): void {\n if (timeoutId.value !== null) {\n clearTimeout(timeoutId.value);\n timeoutId.value = null;\n }\n }\n\n /**\n * Set visibility immediately without animation\n */\n function setVisible(visible: boolean): void {\n clearExistingTimeout();\n if (isVisible.value !== visible) {\n toggleIsVisible();\n }\n if (shouldShow.value !== visible) {\n toggleShouldShow();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n }\n\n /**\n * Toggle visibility with animation\n */\n function toggle(visible: boolean): void {\n clearExistingTimeout();\n\n if (visible) {\n // Show with fade-in\n if (!isVisible.value) {\n toggleIsVisible();\n }\n if (!shouldShow.value) {\n toggleShouldShow();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n } else {\n // Hide with fade-out, then remove from DOM after animation\n if (shouldShow.value) {\n toggleShouldShow();\n }\n if (!shouldHide.value) {\n toggleShouldHide();\n }\n\n timeoutId.value = setTimeout(() => {\n if (isVisible.value) {\n toggleIsVisible();\n }\n if (shouldHide.value) {\n toggleShouldHide();\n }\n timeoutId.value = null;\n }, duration);\n }\n }\n\n /**\n * Show the element with animation\n */\n function show(): void {\n toggle(true);\n }\n\n /**\n * Hide the element with animation\n */\n function hide(): void {\n toggle(false);\n }\n\n /**\n * Cleanup function to clear any pending timeouts\n */\n function cleanup(): void {\n clearExistingTimeout();\n }\n\n // Cleanup timeout on component unmount to prevent memory leaks\n onUnmounted(() => {\n cleanup();\n });\n\n return {\n isVisible,\n shouldShow,\n shouldHide,\n toggle,\n show,\n hide,\n setVisible,\n cleanup,\n };\n}\n","export const Z_INDEX = {\n TRACKER: -1,\n DROPDOWN: 1000,\n} as const;\n\nexport const ID_PREFIXES = {\n AUTO_ACTION: 'auto-action-',\n INDEX_BASED: 'index-',\n MORE_MENU: 'more-actions-menu-',\n} as const;\n\nexport const DATA_ATTRIBUTES = {\n ACTION_ID: 'data-action-id',\n PROCESSED: 'data-more-actions-processed',\n} as const;\n\nexport const FADE_ANIMATION_DURATION = 300;\n","import { DEBOUNCE } from '../../constants';\nimport { DATA_ATTRIBUTES, ID_PREFIXES } from './constants';\n\n// Map to track pending timeouts for elements to prevent memory leaks\nconst elementTimeouts = new WeakMap<HTMLElement, ReturnType<typeof setTimeout>>();\n\n/**\n * Adds data-action-id attributes to first-level children of the actions container\n * Ensures unique IDs by checking existing ones\n */\nexport function addActionIdsToFirstLevelChildren(actionsContainerEl: HTMLElement | null): void {\n if (!actionsContainerEl) {\n return;\n }\n\n // Get all direct children of the actions container\n const directChildren = Array.from(actionsContainerEl.children) as HTMLElement[];\n\n // Collect existing action IDs to avoid duplicates\n const existingIds = new Set<string>();\n directChildren.forEach((child) => {\n const existingId = child.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n if (existingId) {\n existingIds.add(existingId);\n }\n });\n\n // Find the next available index for auto-generated IDs\n let nextIndex = 0;\n while (existingIds.has(`auto-action-${nextIndex}`)) {\n nextIndex++;\n }\n\n directChildren.forEach((child) => {\n // Only add data-action-id if it doesn't already exist\n if (!child.hasAttribute(DATA_ATTRIBUTES.ACTION_ID)) {\n child.setAttribute(DATA_ATTRIBUTES.ACTION_ID, `${ID_PREFIXES.AUTO_ACTION}${nextIndex}`);\n nextIndex++;\n }\n });\n}\n\n/**\n * Creates a map of elements to their IDs\n */\nexport function createElementIdMap(directChildren: HTMLElement[]): Map<HTMLElement, string> {\n const elementIdMap = new Map<HTMLElement, string>();\n\n directChildren.forEach((child, index) => {\n const actionId = child.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n if (actionId) {\n elementIdMap.set(child, actionId);\n } else {\n // Use index as ID for elements without data-action-id\n elementIdMap.set(child, `${ID_PREFIXES.INDEX_BASED}${index}`);\n }\n });\n\n return elementIdMap;\n}\n\n/**\n * Cleans up overflow IDs for elements that no longer exist\n */\nexport function cleanupOverflowIds(overflowIds: Set<string>, currentElementIds: Set<string>): void {\n const idsToRemove: string[] = [];\n\n overflowIds.forEach((id) => {\n if (!currentElementIds.has(id)) {\n idsToRemove.push(id);\n }\n });\n\n idsToRemove.forEach((id) => {\n overflowIds.delete(id);\n });\n}\n\n/**\n * Applies visibility classes to elements based on overflow state\n */\nexport function applyElementVisibility(element: HTMLElement, elementId: string, overflowIds: Set<string>): void {\n // Clear any pending timeout for this element\n const existingTimeout = elementTimeouts.get(element);\n if (existingTimeout) {\n clearTimeout(existingTimeout);\n elementTimeouts.delete(element);\n }\n\n if (overflowIds.has(elementId)) {\n element.removeAttribute(DATA_ATTRIBUTES.PROCESSED);\n element.classList.add('invisible');\n } else {\n const timeout = setTimeout(() => {\n if (element.isConnected) {\n element.setAttribute(DATA_ATTRIBUTES.PROCESSED, 'true');\n }\n elementTimeouts.delete(element);\n }, DEBOUNCE.FAST);\n elementTimeouts.set(element, timeout);\n element.classList.remove('invisible');\n }\n}\n\n/**\n * Syncs more-actions content visibility based on overflow state\n * Shows more-actions items whose data-action-id is in overflowIds\n * Supports nested elements with data-action-id (e.g., Menu > MenuItem)\n */\nexport function syncMoreActionsVisibility(moreDropdownMenuEl: HTMLElement | null, overflowIds: Set<string>): void {\n if (!moreDropdownMenuEl) {\n return;\n }\n\n // Find all elements with data-action-id at any nesting level (for nested wrappers like Menu > MenuItem)\n const nestedItemsWithActionId = Array.from(\n moreDropdownMenuEl.querySelectorAll(`[${DATA_ATTRIBUTES.ACTION_ID}]`),\n ) as HTMLElement[];\n\n // Filter to only \"leaf\" elements - those that don't contain other elements with data-action-id\n // This prevents hiding wrapper elements that contain the actual actionable items\n const leafItems = nestedItemsWithActionId.filter((element) => {\n const nestedActionsInside = element.querySelectorAll(`[${DATA_ATTRIBUTES.ACTION_ID}]`);\n // If element has nested elements with data-action-id inside, it's a wrapper, not a leaf\n return nestedActionsInside.length === 0;\n });\n\n // Apply styles and visibility to leaf items only\n leafItems.forEach((element) => {\n const actionId = element.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n\n // Show more-actions item only if its action-id is in overflowIds (item is hidden in toolbar)\n const shouldShow = actionId && overflowIds.has(actionId);\n if (shouldShow) {\n element.classList.remove('hidden');\n } else {\n element.classList.add('hidden');\n }\n });\n}\n","import { useElementBounding } from '@vueuse/core';\nimport debounce from 'lodash-es/debounce';\nimport { computed, nextTick, type Ref, ref } from 'vue';\n\nimport { DEBOUNCE } from '../../constants';\nimport { toElement } from '../../utils/templateRefNarrowing';\nimport { DATA_ATTRIBUTES } from './constants';\nimport { applyElementVisibility, createElementIdMap, syncMoreActionsVisibility } from './utils';\n\n// Accept Ref<unknown> for template refs so untyped useTemplateRef() can be passed\ninterface UseOverflowCalculatorOptions {\n actionsContainerRef: Ref<unknown>;\n overflowIds: Ref<Set<string>>;\n moreDropdownMenuRef: Ref<unknown>;\n trackerElementRef: Ref<unknown>;\n onOverflowChange?: () => void;\n}\n\nexport function useOverflowCalculator({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n onOverflowChange,\n}: UseOverflowCalculatorOptions) {\n const isProcessing = ref(false);\n const lastOverflowState = ref<string>(''); // Track last overflow state to prevent unnecessary updates\n const trackerElRef = computed(() => toElement(trackerElementRef.value));\n const trackerBounding = useElementBounding(trackerElRef);\n\n /**\n * Updates overflow state and applies visibility classes to elements\n */\n function updateOverflowState(\n newOverflowIds: Set<string>,\n directChildren: HTMLElement[],\n elementIdMap: Map<HTMLElement, string>,\n ): void {\n overflowIds.value.clear();\n newOverflowIds.forEach((id) => overflowIds.value.add(id));\n\n // Apply visibility classes\n directChildren.forEach((element) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n if (elementId) {\n applyElementVisibility(element, elementId, overflowIds.value);\n }\n });\n }\n\n function calculateOverflowInternal() {\n const container = toElement(actionsContainerRef.value);\n const tracker = toElement(trackerElementRef.value);\n if (!container || !tracker) {\n isProcessing.value = false;\n return;\n }\n\n const directChildren = Array.from(container.children).filter((el): el is HTMLElement => el instanceof HTMLElement);\n const elementIdMap = createElementIdMap(directChildren);\n\n // Create a new overflow set to compare with current state\n const newOverflowIds = new Set<string>();\n\n // Get current gap width from CSS computed styles of the actions container\n const computedStyle = window.getComputedStyle(container);\n const gapValue = computedStyle.columnGap || computedStyle.gap;\n const gapWidth = gapValue ? parseFloat(gapValue) : 0;\n\n // Calculate which elements should be hidden based on their position relative to tracker\n directChildren.forEach((element, index) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n const elementRect = element.getBoundingClientRect();\n\n // Calculate the effective right edge including gap\n // If this is not the last element, add gap to the right edge\n const effectiveRightEdge = index < directChildren.length - 1 ? elementRect.right + gapWidth : elementRect.right;\n\n // If element's effective right edge extends beyond tracker's left edge, hide it\n if (effectiveRightEdge > trackerBounding.left.value) {\n if (elementId) {\n newOverflowIds.add(elementId);\n }\n }\n });\n\n // Check if overflow state has actually changed\n const currentOverflowState = Array.from(overflowIds.value).sort().join(',');\n const newOverflowState = Array.from(newOverflowIds).sort().join(',');\n\n if (currentOverflowState !== newOverflowState) {\n // Update overflow state and apply visibility\n updateOverflowState(newOverflowIds, directChildren, elementIdMap);\n\n // Sync more-actions content visibility\n syncMoreActionsVisibility(toElement(moreDropdownMenuRef.value), overflowIds.value);\n\n // Call callback if provided and state actually changed\n // Use nextTick to ensure CSS changes are applied before calculating visible elements width\n if (onOverflowChange && lastOverflowState.value !== newOverflowState) {\n lastOverflowState.value = newOverflowState;\n nextTick(() => {\n onOverflowChange();\n });\n }\n }\n\n isProcessing.value = false;\n }\n\n const debouncedCalculateOverflow = debounce(calculateOverflowInternal, DEBOUNCE.FAST);\n\n function calculateOverflow() {\n if (isProcessing.value || !toElement(actionsContainerRef.value) || !toElement(trackerElementRef.value)) {\n return;\n }\n\n isProcessing.value = true;\n debouncedCalculateOverflow();\n }\n\n function updateTrackerBounding() {\n trackerBounding.update();\n }\n\n function cleanup() {\n debouncedCalculateOverflow.cancel();\n isProcessing.value = false;\n }\n\n return {\n calculateOverflow,\n applyElementVisibility,\n updateOverflowState,\n updateTrackerBounding,\n cleanup,\n isProcessing,\n };\n}\n","import { useIntersectionObserver, useResizeObserver } from '@vueuse/core';\nimport debounce from 'lodash-es/debounce';\nimport { computed, nextTick, onBeforeUnmount, onDeactivated, onMounted, onUpdated, type Ref, ref } from 'vue';\n\nimport { DEBOUNCE } from '../../constants';\nimport { toElement } from '../../utils/templateRefNarrowing';\nimport { DATA_ATTRIBUTES } from './constants';\nimport { useOverflowCalculator } from './useOverflowCalculator';\nimport {\n addActionIdsToFirstLevelChildren as addActionIds,\n cleanupOverflowIds,\n createElementIdMap,\n syncMoreActionsVisibility,\n} from './utils';\n\ninterface CreateIntersectionObserverOptions {\n actionsContainerRef: Ref<unknown>;\n overflowIds: Ref<Set<string>>;\n moreDropdownMenuRef: Ref<unknown>;\n trackerElementRef: Ref<unknown>;\n moreDropdownWidth: Ref<number>;\n calculateMoreButtonWidth: () => number;\n hasMoreActionsSlot: Ref<boolean>;\n onOverflowChange?: () => void;\n}\n\nexport function createIntersectionObserver({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n moreDropdownWidth,\n calculateMoreButtonWidth,\n hasMoreActionsSlot,\n onOverflowChange,\n}: CreateIntersectionObserverOptions) {\n const isInitializing = ref(false);\n\n const {\n calculateOverflow,\n applyElementVisibility,\n updateOverflowState,\n updateTrackerBounding,\n cleanup: cleanupCalculator,\n isProcessing,\n } = useOverflowCalculator({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n onOverflowChange,\n });\n\n let mutationObserver: MutationObserver | null = null;\n let stopResizeObserver: (() => void) | null = null;\n let stopIntersectionObserver: (() => void) | null = null;\n\n function clearOverflowState() {\n overflowIds.value.clear();\n moreDropdownWidth.value = 0;\n }\n\n /**\n * Cleanup all observers (ResizeObserver and IntersectionObserver)\n * to prevent memory leaks when re-creating them\n */\n function cleanupObservers() {\n if (stopResizeObserver) {\n stopResizeObserver();\n stopResizeObserver = null;\n }\n if (stopIntersectionObserver) {\n stopIntersectionObserver();\n stopIntersectionObserver = null;\n }\n }\n\n const actionsContainerEl = computed(() => toElement(actionsContainerRef.value));\n\n // Track DOM mutations - created once, outside of createObserver to prevent duplicates\n const handleMutation = debounce(\n () => {\n const container = toElement(actionsContainerRef.value);\n if (!container || !hasMoreActionsSlot.value) return;\n\n // Add data-action-id to first-level children\n addActionIds(container);\n\n // Cleanup old observers before re-initializing\n cleanupObservers();\n cleanupCalculator();\n debouncedInitObserve();\n },\n DEBOUNCE.FAST,\n { leading: false, trailing: true },\n );\n\n function createObserver() {\n const container = toElement(actionsContainerRef.value);\n if (!container) return;\n\n // If there's no more-actions slot, don't set up overflow detection\n if (!hasMoreActionsSlot.value) return;\n\n // Get all direct children of the actions container\n const directChildren = Array.from(container.children) as HTMLElement[];\n\n // Create a map of elements to their IDs (either data-action-id or index-based)\n const elementIdMap = createElementIdMap(directChildren);\n\n // Clean up overflowIds for elements that no longer exist\n const currentElementIds = new Set(elementIdMap.values());\n cleanupOverflowIds(overflowIds.value, currentElementIds);\n\n // to track container size changes\n const { stop: stopResize } = useResizeObserver(actionsContainerEl, () => {\n updateTrackerBounding();\n calculateOverflow();\n });\n stopResizeObserver = stopResize;\n\n const { stop: stopIntersection } = useIntersectionObserver(\n directChildren,\n (entries) => {\n if (isProcessing.value) {\n return;\n }\n\n let hasChanges = false;\n const newOverflowIds = new Set(overflowIds.value);\n\n entries.forEach((entry) => {\n const element = entry.target as HTMLElement;\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || undefined;\n\n // Check if element is fully visible\n if (entry.intersectionRatio === 1) {\n // show action, hide in dropdown\n if (elementId && newOverflowIds.has(elementId)) {\n newOverflowIds.delete(elementId);\n hasChanges = true;\n }\n } else {\n // hide action, show in dropdown (intersectionRatio < 1 means partially or not visible)\n if (elementId && !newOverflowIds.has(elementId)) {\n newOverflowIds.add(elementId);\n hasChanges = true;\n }\n }\n });\n\n // Only update if there are actual changes\n if (hasChanges) {\n const currentOverflowState = Array.from(overflowIds.value).sort().join(',');\n const newOverflowState = Array.from(newOverflowIds).sort().join(',');\n\n if (currentOverflowState !== newOverflowState) {\n // Update overflow state and apply visibility\n updateOverflowState(newOverflowIds, directChildren, elementIdMap);\n\n // Sync more-actions content visibility\n syncMoreActionsVisibility(toElement(moreDropdownMenuRef.value), overflowIds.value);\n\n // Call callback if provided and state actually changed\n // Use nextTick to ensure CSS changes are applied before calculating visible elements width\n if (onOverflowChange) {\n nextTick(() => {\n onOverflowChange();\n });\n }\n }\n }\n },\n { root: container },\n );\n stopIntersectionObserver = stopIntersection;\n\n // Apply initial visibility to all elements\n directChildren.forEach((element) => {\n const elementId = elementIdMap.get(element) || element.getAttribute(DATA_ATTRIBUTES.ACTION_ID) || '';\n applyElementVisibility(element, elementId, overflowIds.value);\n });\n\n // Initial calculation\n calculateOverflow();\n\n syncMoreActionsVisibility(toElement(moreDropdownMenuRef.value), overflowIds.value);\n }\n\n function initObserve() {\n const container = toElement(actionsContainerRef.value);\n if (!container) return;\n\n // If there's no more-actions slot, don't initialize\n if (!hasMoreActionsSlot.value) return;\n\n // Add data-action-id to first-level children\n addActionIds(container);\n\n createObserver();\n\n // Set initial dropdown width - only if not already set\n if (moreDropdownWidth.value === 0) {\n moreDropdownWidth.value = calculateMoreButtonWidth();\n }\n\n // Setup MutationObserver once to watch for DOM changes; only create if it doesn't exist to prevent duplicates\n if (!mutationObserver) {\n mutationObserver = new MutationObserver(handleMutation);\n mutationObserver.observe(container, {\n childList: true, // Watch for added/removed children\n subtree: false, // Only watch direct children\n });\n }\n }\n\n const debouncedInitObserve = debounce(\n () => {\n if (!isInitializing.value) {\n isInitializing.value = true;\n initObserve();\n isInitializing.value = false;\n }\n },\n DEBOUNCE.FAST,\n { leading: true },\n );\n\n onMounted(() => {\n // If there's no more-actions slot, skip initialization\n if (!hasMoreActionsSlot.value) return;\n\n // Add data-action-id to first-level children\n addActionIds(toElement(actionsContainerRef.value));\n initObserve();\n });\n\n onUpdated(() => {\n // If there's no more-actions slot, skip initialization\n if (!hasMoreActionsSlot.value) return;\n\n const container = toElement(actionsContainerRef.value);\n // Add data-action-id to first-level children\n addActionIds(container);\n // Clear overflowIds if no actions are present\n if (container) {\n const directChildren = Array.from(container.children) as HTMLElement[];\n if (directChildren.length === 0) clearOverflowState();\n }\n cleanupObservers();\n cleanupCalculator();\n debouncedInitObserve();\n });\n\n onDeactivated(() => {\n cleanupObservers();\n cleanupCalculator();\n handleMutation.cancel();\n debouncedInitObserve.cancel();\n if (mutationObserver) {\n mutationObserver.disconnect();\n mutationObserver = null;\n }\n });\n\n onBeforeUnmount(() => {\n cleanupObservers();\n cleanupCalculator();\n handleMutation.cancel();\n debouncedInitObserve.cancel();\n if (mutationObserver) {\n mutationObserver.disconnect();\n mutationObserver = null;\n }\n });\n}\n","import { type ComputedRef, nextTick, type Ref, ref, watch } from 'vue';\n\nimport { isComponentWithEl, toElement } from '../../utils/templateRefNarrowing';\n\ninterface UseMoreDropdownWidthOptions {\n moreDropdownRef: Ref<unknown>;\n actionsContainerRef: Ref<unknown>;\n moreButtonAlign: 'separate' | 'together';\n hasOverflowActions: ComputedRef<boolean>;\n}\n\nexport function useMoreButtonWidth({\n moreDropdownRef,\n actionsContainerRef,\n moreButtonAlign,\n hasOverflowActions,\n}: UseMoreDropdownWidthOptions) {\n /**\n * Calculates the width of the More dropdown with gap consideration\n * When moreButtonAlign is 'separate', adds the gap between actions container and dropdown\n * When moreButtonAlign is 'together', returns only the dropdown width\n */\n const calculateMoreButtonWidth = (): number => {\n const dropdown = moreDropdownRef.value;\n if (!isComponentWithEl(dropdown)) return 0;\n\n const dropdownWidth = dropdown.$el.getBoundingClientRect().width;\n\n // If moreButtonAlign is separate, add gap between actions container and dropdown\n if (moreButtonAlign === 'separate') {\n const container = toElement(actionsContainerRef.value);\n if (!container) return dropdownWidth;\n\n const computedStyle = window.getComputedStyle(container);\n const gapWidth = parseFloat(computedStyle.gap) || 0;\n return dropdownWidth + gapWidth;\n }\n\n return dropdownWidth;\n };\n\n const moreButtonWidth = ref(0);\n\n watch(hasOverflowActions, (newValue) => {\n if (newValue && moreDropdownRef.value) {\n nextTick(() => {\n const calculatedWidth = calculateMoreButtonWidth();\n if (calculatedWidth > 0) {\n moreButtonWidth.value = calculatedWidth;\n }\n });\n }\n });\n\n return {\n calculateMoreButtonWidth,\n moreButtonWidth,\n };\n}\n","import { nextTick, type Ref, ref, watch } from 'vue';\n\nimport { toElement } from '../../utils/templateRefNarrowing';\nimport { DATA_ATTRIBUTES, FADE_ANIMATION_DURATION } from './constants';\n\n/** Accept Ref<unknown> so untyped useTemplateRef() can be passed. */\ninterface UseVisibleElementsWidthOptions {\n actionsContainerRef: Ref<unknown>;\n overflowIds: Ref<Set<string>>;\n}\n\n/**\n * Computes the total width of currently visible MoreActions items from live DOM layout.\n * Use from mounted client components only; does not run on the server.\n */\nexport function useVisibleElementsWidth({ actionsContainerRef, overflowIds }: UseVisibleElementsWidthOptions) {\n const visibleElementsWidth = ref(0);\n const isRecalculatingWidth = ref(false);\n const isRecalculatingWithDelay = ref(false);\n let widthCalculationTimeout: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Calculates the total width of currently visible elements\n * This is used for positioning the More button\n */\n const calculateVisibleElementsWidth = () => {\n const container = toElement(actionsContainerRef.value);\n if (!container) {\n visibleElementsWidth.value = 0;\n return;\n }\n\n let totalWidth = 0;\n const directChildren = Array.from(container.children);\n\n directChildren.forEach((element, index) => {\n const elementId = element.getAttribute(DATA_ATTRIBUTES.ACTION_ID);\n\n // Check if element should be visible based on overflow state\n // Elements without data-action-id are always considered visible (never hidden by overflow logic)\n const shouldBeVisible = !elementId || !overflowIds.value.has(elementId);\n\n // Double-check with CSS classes as a fallback\n const isHiddenByCSS = element.classList.contains('invisible');\n\n // Element is considered visible if:\n // 1. It's not in overflowIds (should be visible) OR it has no data-action-id (always visible)\n // 2. AND it's not hidden by CSS classes\n if (shouldBeVisible && !isHiddenByCSS) {\n const rect = element.getBoundingClientRect();\n totalWidth += rect.width;\n\n // Add gap between elements\n if (index < directChildren.length - 1 && container) {\n // Always get the most current gap width from CSS computed styles of the actions container\n const computedStyle = window.getComputedStyle(container);\n const gapValue = computedStyle.columnGap || computedStyle.gap;\n const gapWidth = gapValue ? parseFloat(gapValue) : 0;\n totalWidth += gapWidth;\n }\n }\n });\n\n visibleElementsWidth.value = totalWidth;\n };\n\n /**\n * Calculates visible elements width with a delay to allow animations to complete\n * This ensures that width calculation happens after elements are actually hidden/shown\n */\n const calculateVisibleElementsWidthDelayed = () => {\n // Set recalculating state immediately to hide More button\n isRecalculatingWithDelay.value = true;\n\n // Clear any existing timeout\n if (widthCalculationTimeout) {\n clearTimeout(widthCalculationTimeout);\n }\n\n // Set a new timeout to calculate width after animation completes\n widthCalculationTimeout = setTimeout(() => {\n if (!isRecalculatingWidth.value) {\n isRecalculatingWidth.value = true;\n\n // Use double nextTick to ensure all DOM updates and CSS changes are applied\n nextTick(() => {\n nextTick(() => {\n calculateVisibleElementsWidth();\n isRecalculatingWidth.value = false;\n isRecalculatingWithDelay.value = false; // Show More button after calculation is complete\n });\n });\n }\n }, FADE_ANIMATION_DURATION + 100); // Add small buffer to ensure animation is complete\n };\n\n // Watch for changes in overflowIds to recalculate visible elements width with delay\n watch(overflowIds, () => {\n calculateVisibleElementsWidthDelayed();\n });\n\n /**\n * Cleanup function to clear any pending timeouts\n */\n const cleanup = () => {\n if (widthCalculationTimeout) {\n clearTimeout(widthCalculationTimeout);\n widthCalculationTimeout = null;\n }\n isRecalculatingWithDelay.value = false;\n };\n\n return {\n visibleElementsWidth,\n isRecalculatingWidth,\n isRecalculatingWithDelay,\n calculateVisibleElementsWidth,\n calculateVisibleElementsWidthDelayed,\n cleanup,\n };\n}\n","<script lang=\"ts\" setup>\n /**\n * MoreActions Component\n *\n * This component provides a responsive toolbar that automatically moves overflow items\n * into a \"More\" dropdown menu when space is limited.\n *\n * @example\n * <MoreActions>\n * <Button data-action-id=\"edit\">Edit</Button>\n * <Button data-action-id=\"delete\">Delete</Button>\n * <Button data-action-id=\"share\">Share</Button>\n *\n * <template #more-actions>\n * <DropdownItem data-action-id=\"edit\">Edit Item</DropdownItem>\n * <DropdownItem data-action-id=\"delete\">Delete Item</DropdownItem>\n * <DropdownItem data-action-id=\"share\">Share Item</DropdownItem>\n * </template>\n * </MoreActions>\n *\n * IMPORTANT:\n * - The #more-actions slot is REQUIRED. If not provided, the More dropdown will not be rendered.\n * - Each item in the default slot must have a corresponding item in the 'more-actions'\n * slot with the same data-action-id attribute.\n * - The component automatically shows/hides matching items based on available space:\n * - Items visible in toolbar → hidden in more-actions\n * - Items hidden in toolbar (overflow) → visible in more-actions\n */\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, ref, useSlots, useTemplateRef, watch } from 'vue';\n\n import { useToggleAnimation } from '../../composables/useToggleAnimation/useToggleAnimation';\n import { DEBOUNCE } from '../../constants';\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import { FADE_ANIMATION_DURATION, ID_PREFIXES, Z_INDEX } from './constants';\n import { createIntersectionObserver } from './createIntersectionObserver';\n import { useMoreButtonWidth } from './useMoreButtonWidth';\n import { useVisibleElementsWidth } from './useVisibleElementsWidth';\n\n export interface MoreActionsProps {\n /**\n * CSS class or classes to be applied to the actions container\n */\n actionsContainerClass?: string | Record<string, boolean> | undefined;\n /**\n * HTML element tag to use for the actions container\n * Useful when you need to maintain valid HTML semantics\n * (e.g., use 'ul' when children are <li> elements)\n * @default 'div'\n */\n actionsContainerTag?: string;\n /**\n * Text to display on the more actions button\n */\n moreButtonText?: string;\n /**\n * Optional width for the more-actions container\n * Applies style=\"width: {width}\" to the stash-more-actions element\n */\n width?: string | number;\n /**\n * Rendering mode for dropdown items\n * - 'default': Button-style rendering (current behavior)\n * - 'custom': Custom rendering through slots\n */\n dropdownMode?: 'default' | 'custom';\n /**\n * Alignment of the More button\n * - 'separate': Button is aligned to the right edge of the actions container (default)\n * - 'together': Button is aligned immediately after the last visible action\n */\n moreButtonAlign?: 'separate' | 'together';\n }\n\n const props = withDefaults(defineProps<MoreActionsProps>(), {\n actionsContainerClass: undefined,\n actionsContainerTag: 'div',\n moreButtonText: () => t('ll.more'),\n dropdownMode: 'default',\n moreButtonAlign: 'separate',\n width: undefined,\n });\n\n // Check if more-actions slot is provided (REQUIRED for dropdown to render)\n const slots = useSlots();\n const hasMoreActionsSlot = computed(() => !!slots['more-actions']);\n\n // Refs for DOM elements\n const actionsContainerRef = useTemplateRef('actionsContainerRef');\n const moreDropdownRef = useTemplateRef('moreDropdownRef');\n const moreDropdownMenuRef = useTemplateRef('moreDropdownMenuRef');\n const trackerElementRef = useTemplateRef('trackerElementRef');\n\n // State management\n const overflowIds = ref<Set<string>>(new Set());\n const isMoreMenuOpen = ref(false);\n const moreMenuId = uniqueId(ID_PREFIXES.MORE_MENU);\n const showButtonDelayTimeout = ref<ReturnType<typeof setTimeout> | null>(null);\n const isDelayedShowReady = ref(false);\n\n const {\n isVisible: isMoreButtonVisible,\n shouldShow: shouldMoreButtonShow,\n toggle: toggleMoreButtonAnimation,\n } = useToggleAnimation({\n duration: FADE_ANIMATION_DURATION,\n initialVisible: false,\n });\n\n const hasOverflowActions = computed(() => overflowIds.value.size > 0);\n\n // Updated to use new Ref suffix naming convention\n const { calculateMoreButtonWidth, moreButtonWidth } = useMoreButtonWidth({\n moreDropdownRef,\n actionsContainerRef,\n moreButtonAlign: props.moreButtonAlign,\n hasOverflowActions,\n });\n\n // Updated to use new Ref suffix naming convention\n const {\n visibleElementsWidth,\n isRecalculatingWithDelay,\n calculateVisibleElementsWidthDelayed,\n cleanup: cleanupVisibleElementsWidth,\n } = useVisibleElementsWidth({\n actionsContainerRef,\n overflowIds,\n });\n\n const shouldShowMoreButton = computed(() => {\n return (\n hasMoreActionsSlot.value &&\n hasOverflowActions.value &&\n !isRecalculatingWithDelay.value &&\n isDelayedShowReady.value\n );\n });\n\n const isMoreMenuOpenString = computed(() => isMoreMenuOpen.value.toString());\n\n const actionsContainerWidth = computed(() => {\n if (!shouldShowMoreButton.value) {\n return '100%';\n }\n\n return `calc(100% - ${moreButtonWidth.value}px)`;\n });\n\n const moreButtonPosition = computed(() => {\n if (props.moreButtonAlign === 'together') {\n return { left: `${visibleElementsWidth.value}px`, right: 'auto' };\n } else {\n // Default separate alignment\n return { right: '0', left: 'auto' };\n }\n });\n\n createIntersectionObserver({\n actionsContainerRef,\n overflowIds,\n moreDropdownMenuRef,\n trackerElementRef,\n moreDropdownWidth: moreButtonWidth,\n calculateMoreButtonWidth,\n hasMoreActionsSlot,\n onOverflowChange: calculateVisibleElementsWidthDelayed,\n });\n\n // Watch for when recalculation completes and overflow actions exist\n watch(\n () => hasMoreActionsSlot.value && hasOverflowActions.value && !isRecalculatingWithDelay.value,\n (isReady) => {\n // Clear any existing timeout\n if (showButtonDelayTimeout.value) {\n clearTimeout(showButtonDelayTimeout.value);\n showButtonDelayTimeout.value = null;\n }\n\n if (isReady) {\n // Add delay before showing the button\n showButtonDelayTimeout.value = setTimeout(() => {\n isDelayedShowReady.value = true;\n }, DEBOUNCE.FAST);\n } else {\n // Hide immediately when overflow actions are removed or slot is not available\n isDelayedShowReady.value = false;\n }\n },\n );\n\n // Watch for changes in shouldShowMoreButton to handle fade animations\n watch(shouldShowMoreButton, (newValue) => {\n toggleMoreButtonAnimation(newValue);\n });\n\n function handleDropdownToggle(event: boolean) {\n isMoreMenuOpen.value = event;\n }\n\n onBeforeUnmount(() => {\n cleanupVisibleElementsWidth();\n if (showButtonDelayTimeout.value) {\n clearTimeout(showButtonDelayTimeout.value);\n }\n });\n</script>\n\n<template>\n <div\n class=\"stash-more-actions relative overflow-x-hidden\"\n data-test=\"stash-more-actions\"\n :style=\"{ width: props.width }\"\n >\n <component\n :is=\"props.actionsContainerTag\"\n ref=\"actionsContainerRef\"\n data-test=\"stash-more-actions__container\"\n :style=\"{\n width: actionsContainerWidth,\n minWidth: moreButtonWidth ? `${moreButtonWidth}px` : undefined,\n }\"\n :class=\"['stash-more-actions__container flex items-center gap-2 overflow-x-hidden', props.actionsContainerClass]\"\n >\n <!-- Default slot for elements that can be hidden -->\n <slot></slot>\n </component>\n\n <!-- Tracker Element - to detect when action elements overlap with it, triggering overflow behavior -->\n <div\n ref=\"trackerElementRef\"\n class=\"stash-more-actions__tracker\"\n :style=\"{\n position: 'absolute',\n right: '0px',\n top: '0',\n visibility: 'hidden',\n width: moreButtonWidth + 'px',\n height: '100%',\n pointerEvents: 'none',\n zIndex: Z_INDEX.TRACKER,\n }\"\n ></div>\n\n <!-- Only render dropdown if more-actions slot is provided -->\n <Dropdown\n v-if=\"hasMoreActionsSlot\"\n ref=\"moreDropdownRef\"\n :class=\"[\n '!absolute top-0',\n shouldMoreButtonShow ? 'animate-fade-in' : 'animate-fade-out',\n { invisible: !isMoreButtonVisible },\n ]\"\n :style=\"moreButtonPosition\"\n @toggle=\"handleDropdownToggle\"\n >\n <template #toggle=\"{ toggle }\">\n <slot name=\"toggle\" :toggle=\"toggle\" :is-open=\"isMoreMenuOpen\">\n <Button\n class=\"button -border-gray-500 text-gray-500 flex w-full items-center justify-between -border\"\n secondary\n :aria-expanded=\"isMoreMenuOpenString\"\n @click=\"toggle\"\n >\n {{ props.moreButtonText }} <Icon class=\"-ml-1.5\" name=\"action-dots\" />\n </Button>\n </slot>\n </template>\n\n <template #default>\n <div\n :id=\"moreMenuId\"\n ref=\"moreDropdownMenuRef\"\n data-test=\"stash-more-actions__dropdown\"\n class=\"flex flex-col gap-1.5 p-1.5\"\n >\n <!-- More actions slot content (only overflow items will be shown) -->\n <slot name=\"more-actions\"></slot>\n </div>\n </template>\n </Dropdown>\n </div>\n</template>\n\n<style module>\n @layer utilities {\n :global([data-action-id]) {\n flex-shrink: 0;\n }\n }\n\n :global(.stash-more-actions__container [data-action-id]:not([data-more-actions-processed])) {\n visibility: hidden;\n }\n</style>\n"],"names":["useToggleAnimation","options","duration","initialVisible","isVisible","toggleIsVisible","useToggle","shouldShow","toggleShouldShow","shouldHide","toggleShouldHide","timeoutId","ref","clearExistingTimeout","setVisible","visible","toggle","show","hide","cleanup","onUnmounted","Z_INDEX","ID_PREFIXES","DATA_ATTRIBUTES","FADE_ANIMATION_DURATION","elementTimeouts","addActionIdsToFirstLevelChildren","actionsContainerEl","directChildren","existingIds","child","existingId","nextIndex","createElementIdMap","elementIdMap","index","actionId","cleanupOverflowIds","overflowIds","currentElementIds","idsToRemove","id","applyElementVisibility","element","elementId","existingTimeout","timeout","DEBOUNCE","syncMoreActionsVisibility","moreDropdownMenuEl","useOverflowCalculator","actionsContainerRef","moreDropdownMenuRef","trackerElementRef","onOverflowChange","isProcessing","lastOverflowState","trackerElRef","computed","toElement","trackerBounding","useElementBounding","updateOverflowState","newOverflowIds","calculateOverflowInternal","container","tracker","el","computedStyle","gapValue","gapWidth","elementRect","currentOverflowState","newOverflowState","nextTick","debouncedCalculateOverflow","debounce","calculateOverflow","updateTrackerBounding","createIntersectionObserver","moreDropdownWidth","calculateMoreButtonWidth","hasMoreActionsSlot","isInitializing","cleanupCalculator","mutationObserver","stopResizeObserver","stopIntersectionObserver","clearOverflowState","cleanupObservers","handleMutation","addActionIds","debouncedInitObserve","createObserver","stopResize","useResizeObserver","stopIntersection","useIntersectionObserver","entries","hasChanges","entry","initObserve","onMounted","onUpdated","onDeactivated","onBeforeUnmount","useMoreButtonWidth","moreDropdownRef","moreButtonAlign","hasOverflowActions","dropdown","isComponentWithEl","dropdownWidth","moreButtonWidth","watch","newValue","calculatedWidth","useVisibleElementsWidth","visibleElementsWidth","isRecalculatingWidth","isRecalculatingWithDelay","widthCalculationTimeout","calculateVisibleElementsWidth","totalWidth","shouldBeVisible","isHiddenByCSS","rect","calculateVisibleElementsWidthDelayed","props","__props","slots","useSlots","useTemplateRef","isMoreMenuOpen","moreMenuId","uniqueId","showButtonDelayTimeout","isDelayedShowReady","isMoreButtonVisible","shouldMoreButtonShow","toggleMoreButtonAnimation","cleanupVisibleElementsWidth","shouldShowMoreButton","isMoreMenuOpenString","actionsContainerWidth","moreButtonPosition","isReady","handleDropdownToggle","event","_createElementBlock","_normalizeStyle","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_renderSlot","_ctx","_createElementVNode","Dropdown","_withCtx","_createVNode","Button","Icon"],"mappings":";;;;;;;;;;;AA0DO,SAASA,GAAmBC,IAAqC,IAA8B;AACpG,QAAM,EAAE,UAAAC,IAAW,KAAK,gBAAAC,IAAiB,OAAUF,GAE7C,CAACG,GAAWC,CAAe,IAAIC,EAAUH,CAAc,GACvD,CAACI,GAAYC,CAAgB,IAAIF,EAAUH,CAAc,GACzD,CAACM,GAAYC,CAAgB,IAAIJ,EAAU,EAAK,GAChDK,IAAYC,EAA0C,IAAI;AAKhE,WAASC,IAA6B;AACpC,IAAIF,EAAU,UAAU,SACtB,aAAaA,EAAU,KAAK,GAC5BA,EAAU,QAAQ;AAAA,EAEtB;AAKA,WAASG,EAAWC,GAAwB;AAC1C,IAAAF,EAAA,GACIT,EAAU,UAAUW,KACtBV,EAAA,GAEEE,EAAW,UAAUQ,KACvBP,EAAA,GAEEC,EAAW,SACbC,EAAA;AAAA,EAEJ;AAKA,WAASM,EAAOD,GAAwB;AACtC,IAAAF,EAAA,GAEIE,KAEGX,EAAU,SACbC,EAAA,GAEGE,EAAW,SACdC,EAAA,GAEEC,EAAW,SACbC,EAAA,MAIEH,EAAW,SACbC,EAAA,GAEGC,EAAW,SACdC,EAAA,GAGFC,EAAU,QAAQ,WAAW,MAAM;AACjC,MAAIP,EAAU,SACZC,EAAA,GAEEI,EAAW,SACbC,EAAA,GAEFC,EAAU,QAAQ;AAAA,IACpB,GAAGT,CAAQ;AAAA,EAEf;AAKA,WAASe,IAAa;AACpB,IAAAD,EAAO,EAAI;AAAA,EACb;AAKA,WAASE,IAAa;AACpB,IAAAF,EAAO,EAAK;AAAA,EACd;AAKA,WAASG,IAAgB;AACvB,IAAAN,EAAA;AAAA,EACF;AAGA,SAAAO,GAAY,MAAM;AAChB,IAAAD,EAAA;AA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"./Menu.js";
|
|
7
7
|
import F from "./MenuItem.js";
|
|
8
8
|
import L from "./Tab.js";
|
|
9
|
-
import { _ as O } from "./Tabs.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as O } from "./Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js";
|
|
10
10
|
const R = {
|
|
11
11
|
class: "stash-page-navigation container",
|
|
12
12
|
"data-test": "stash-page-navigation"
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as w, inject as
|
|
1
|
+
import { defineComponent as w, inject as R, useCssModule as g, createElementBlock as _, openBlock as n, normalizeClass as v, unref as e, Fragment as C, renderList as I, createElementVNode as c, toDisplayString as $, provide as S, computed as f, ref as j, useTemplateRef as D, onMounted as q, onUnmounted as A, watchEffect as L, createBlock as M, mergeProps as N, withCtx as P, renderSlot as T, resolveDynamicComponent as U } from "vue";
|
|
2
2
|
import F from "lodash-es/uniqueId";
|
|
3
|
+
import { i as J, a as H } from "./templateRefNarrowing-CeANDylX.js";
|
|
3
4
|
import { R as k } from "./RadioGroup.keys-CqfiKkNz.js";
|
|
4
5
|
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
6
|
+
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-D2I8xDEW.js";
|
|
7
|
+
const Q = ["id", "name", "value", "checked", "disabled"], X = ["for"], Y = /* @__PURE__ */ w({
|
|
7
8
|
__name: "VariantButton",
|
|
8
9
|
setup(p) {
|
|
9
|
-
const d =
|
|
10
|
+
const d = R(k.key);
|
|
10
11
|
if (!d)
|
|
11
12
|
throw new Error("VariantButton must be used with a RadioGroup instance.");
|
|
12
13
|
const { name: o, disabled: a, fullWidth: m, modelValue: u, options: b, update: i } = d, l = g();
|
|
13
14
|
return (y, r) => (n(), _("div", {
|
|
14
15
|
class: v(["flex", e(l).root])
|
|
15
16
|
}, [
|
|
16
|
-
(n(!0), _(
|
|
17
|
+
(n(!0), _(C, null, I(e(b), (t) => (n(), _("div", {
|
|
17
18
|
key: `${e(o)}-${t.id}`,
|
|
18
19
|
class: v([{ "w-full": e(m) }])
|
|
19
20
|
}, [
|
|
@@ -27,28 +28,28 @@ const H = ["id", "name", "value", "checked", "disabled"], K = ["for"], Q = /* @_
|
|
|
27
28
|
disabled: e(a) || t.disabled,
|
|
28
29
|
onInput: r[0] || (r[0] = //@ts-ignore
|
|
29
30
|
(...h) => e(i) && e(i)(...h))
|
|
30
|
-
}, null, 40,
|
|
31
|
+
}, null, 40, Q),
|
|
31
32
|
c("label", {
|
|
32
33
|
for: `${e(o)}-${t.id}`
|
|
33
|
-
}, $(t.text), 9,
|
|
34
|
+
}, $(t.text), 9, X)
|
|
34
35
|
], 2))), 128))
|
|
35
36
|
], 2));
|
|
36
37
|
}
|
|
37
|
-
}),
|
|
38
|
-
root:
|
|
39
|
-
},
|
|
40
|
-
$style:
|
|
41
|
-
},
|
|
38
|
+
}), Z = "_root_1yqgv_3", ee = {
|
|
39
|
+
root: Z
|
|
40
|
+
}, te = {
|
|
41
|
+
$style: ee
|
|
42
|
+
}, ae = /* @__PURE__ */ B(Y, [["__cssModules", te]]), oe = ["id", "name", "value", "checked", "disabled"], se = ["for"], le = /* @__PURE__ */ w({
|
|
42
43
|
__name: "VariantChip",
|
|
43
44
|
setup(p) {
|
|
44
|
-
const d =
|
|
45
|
+
const d = R(k.key);
|
|
45
46
|
if (!d)
|
|
46
47
|
throw new Error("VariantChip must be used with a RadioGroup instance.");
|
|
47
48
|
const { name: o, disabled: a, fullWidth: m, modelValue: u, options: b, update: i } = d, l = g();
|
|
48
49
|
return (y, r) => (n(), _("div", {
|
|
49
50
|
class: v(["my-1.5 flex flex-wrap", e(l).root])
|
|
50
51
|
}, [
|
|
51
|
-
(n(!0), _(
|
|
52
|
+
(n(!0), _(C, null, I(e(b), (t) => (n(), _("div", {
|
|
52
53
|
key: `${e(o)}-${t.id}`,
|
|
53
54
|
class: v([{ "w-full": e(m) }])
|
|
54
55
|
}, [
|
|
@@ -62,28 +63,28 @@ const H = ["id", "name", "value", "checked", "disabled"], K = ["for"], Q = /* @_
|
|
|
62
63
|
disabled: e(a) || t.disabled,
|
|
63
64
|
onInput: r[0] || (r[0] = //@ts-ignore
|
|
64
65
|
(...h) => e(i) && e(i)(...h))
|
|
65
|
-
}, null, 40,
|
|
66
|
+
}, null, 40, oe),
|
|
66
67
|
c("label", {
|
|
67
68
|
for: `${e(o)}-${t.id}`
|
|
68
|
-
}, $(t.text), 9,
|
|
69
|
+
}, $(t.text), 9, se)
|
|
69
70
|
], 2))), 128))
|
|
70
71
|
], 2));
|
|
71
72
|
}
|
|
72
|
-
}),
|
|
73
|
-
root:
|
|
74
|
-
},
|
|
75
|
-
$style:
|
|
76
|
-
},
|
|
73
|
+
}), re = "_root_1vzbj_5", ne = {
|
|
74
|
+
root: re
|
|
75
|
+
}, ie = {
|
|
76
|
+
$style: ne
|
|
77
|
+
}, de = /* @__PURE__ */ B(le, [["__cssModules", ie]]), ue = ["id", "name", "value", "checked", "disabled"], ce = ["for"], _e = /* @__PURE__ */ w({
|
|
77
78
|
__name: "VariantRadio",
|
|
78
79
|
setup(p) {
|
|
79
|
-
const d =
|
|
80
|
+
const d = R(k.key);
|
|
80
81
|
if (!d)
|
|
81
82
|
throw new Error("VariantRadio must be used with a RadioGroup instance.");
|
|
82
83
|
const { name: o, disabled: a, fullWidth: m, modelValue: u, options: b, update: i } = d, l = g();
|
|
83
84
|
return (y, r) => (n(), _("div", {
|
|
84
85
|
class: v(["flex flex-wrap", e(l).root])
|
|
85
86
|
}, [
|
|
86
|
-
(n(!0), _(
|
|
87
|
+
(n(!0), _(C, null, I(e(b), (t) => (n(), _("div", {
|
|
87
88
|
key: `${e(o)}-${t.id}`,
|
|
88
89
|
class: v([{ "w-full": e(m) }])
|
|
89
90
|
}, [
|
|
@@ -96,28 +97,28 @@ const H = ["id", "name", "value", "checked", "disabled"], K = ["for"], Q = /* @_
|
|
|
96
97
|
disabled: e(a) || t.disabled,
|
|
97
98
|
onInput: r[0] || (r[0] = //@ts-ignore
|
|
98
99
|
(...h) => e(i) && e(i)(...h))
|
|
99
|
-
}, null, 40,
|
|
100
|
+
}, null, 40, ue),
|
|
100
101
|
c("label", {
|
|
101
102
|
for: `${e(o)}-${t.id}`
|
|
102
|
-
}, $(t.text), 9,
|
|
103
|
+
}, $(t.text), 9, ce)
|
|
103
104
|
], 2))), 128))
|
|
104
105
|
], 2));
|
|
105
106
|
}
|
|
106
|
-
}),
|
|
107
|
-
root:
|
|
108
|
-
},
|
|
109
|
-
$style:
|
|
110
|
-
},
|
|
107
|
+
}), pe = "_root_3kb5v_5", ve = {
|
|
108
|
+
root: pe
|
|
109
|
+
}, fe = {
|
|
110
|
+
$style: ve
|
|
111
|
+
}, me = /* @__PURE__ */ B(_e, [["__cssModules", fe]]), be = ["for"], he = ["id", "name", "value", "checked", "disabled"], $e = { class: "m-0 text-ice-900" }, ye = { class: "m-0 text-ice-700" }, xe = /* @__PURE__ */ w({
|
|
111
112
|
__name: "VariantTile",
|
|
112
113
|
setup(p) {
|
|
113
|
-
const d =
|
|
114
|
+
const d = R(k.key);
|
|
114
115
|
if (!d)
|
|
115
116
|
throw new Error("VariantTile must be used with a RadioGroup instance.");
|
|
116
117
|
const { name: o, disabled: a, fullWidth: m, modelValue: u, options: b, update: i } = d, l = g();
|
|
117
118
|
return (y, r) => (n(), _("div", {
|
|
118
119
|
class: v(["flex flex-wrap", e(l).root])
|
|
119
120
|
}, [
|
|
120
|
-
(n(!0), _(
|
|
121
|
+
(n(!0), _(C, null, I(e(b), (t) => (n(), _("label", {
|
|
121
122
|
key: `${e(o)}-${t.id}`,
|
|
122
123
|
class: v([e(l)["tile-container"], { "w-full": e(m) }]),
|
|
123
124
|
for: `${e(o)}-${t.id}`
|
|
@@ -141,7 +142,7 @@ const H = ["id", "name", "value", "checked", "disabled"], K = ["for"], Q = /* @_
|
|
|
141
142
|
disabled: e(a) || t.disabled,
|
|
142
143
|
onInput: r[0] || (r[0] = //@ts-ignore
|
|
143
144
|
(...h) => e(i) && e(i)(...h))
|
|
144
|
-
}, null, 40,
|
|
145
|
+
}, null, 40, he),
|
|
145
146
|
c("div", null, [
|
|
146
147
|
c("span", null, $(t.text), 1)
|
|
147
148
|
])
|
|
@@ -155,22 +156,22 @@ const H = ["id", "name", "value", "checked", "disabled"], K = ["for"], Q = /* @_
|
|
|
155
156
|
}
|
|
156
157
|
]])
|
|
157
158
|
}, [
|
|
158
|
-
c("p",
|
|
159
|
-
c("p",
|
|
159
|
+
c("p", $e, $(t.subTitle), 1),
|
|
160
|
+
c("p", ye, $(t.subText), 1)
|
|
160
161
|
], 2)
|
|
161
|
-
], 10,
|
|
162
|
+
], 10, be))), 128))
|
|
162
163
|
], 2));
|
|
163
164
|
}
|
|
164
|
-
}),
|
|
165
|
-
root:
|
|
165
|
+
}), we = "_root_x2xjj_5", ge = {
|
|
166
|
+
root: we,
|
|
166
167
|
"tile-container": "_tile-container_x2xjj_26",
|
|
167
168
|
"tile-header": "_tile-header_x2xjj_33",
|
|
168
169
|
"tile-body": "_tile-body_x2xjj_34"
|
|
169
|
-
},
|
|
170
|
-
$style:
|
|
171
|
-
},
|
|
170
|
+
}, ke = {
|
|
171
|
+
$style: ge
|
|
172
|
+
}, Be = /* @__PURE__ */ B(xe, [["__cssModules", ke]]);
|
|
172
173
|
var x = /* @__PURE__ */ ((p) => (p.Radio = "radio", p.Button = "button", p.Chip = "chip", p.Tile = "tile", p))(x || {});
|
|
173
|
-
const
|
|
174
|
+
const Ve = /* @__PURE__ */ w({
|
|
174
175
|
__name: "RadioGroup",
|
|
175
176
|
props: {
|
|
176
177
|
name: { default: void 0 },
|
|
@@ -196,10 +197,10 @@ const ke = /* @__PURE__ */ w({
|
|
|
196
197
|
emits: ["update:modelValue"],
|
|
197
198
|
setup(p, { emit: d }) {
|
|
198
199
|
const o = {
|
|
199
|
-
[x.Button]:
|
|
200
|
-
[x.Chip]:
|
|
201
|
-
[x.Radio]:
|
|
202
|
-
[x.Tile]:
|
|
200
|
+
[x.Button]: ae,
|
|
201
|
+
[x.Chip]: de,
|
|
202
|
+
[x.Radio]: me,
|
|
203
|
+
[x.Tile]: Be
|
|
203
204
|
}, a = p, m = d, u = g();
|
|
204
205
|
function b(s) {
|
|
205
206
|
m("update:modelValue", s.target.value);
|
|
@@ -221,29 +222,35 @@ const ke = /* @__PURE__ */ w({
|
|
|
221
222
|
"gap-6": a.variant === "radio" || a.variant === "tile" || a.variant === "chip" && l.value === "vertical",
|
|
222
223
|
"flex-col": l.value === "vertical"
|
|
223
224
|
})), r = j(null), t = D("radioGroup"), h = f(() => {
|
|
224
|
-
|
|
225
|
-
return (s
|
|
225
|
+
const s = t.value;
|
|
226
|
+
return J(s) ? s.$el.parentElement : null;
|
|
226
227
|
}), W = f(() => {
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
if (a.variant !== "button")
|
|
229
|
+
return [];
|
|
230
|
+
const s = H(t.value);
|
|
231
|
+
return s ? Array.from(s.querySelectorAll("[data-variant-button]")) : [];
|
|
229
232
|
});
|
|
230
|
-
function
|
|
231
|
-
return W.value.reduce((s,
|
|
232
|
-
const O =
|
|
233
|
+
function E() {
|
|
234
|
+
return W.value.reduce((s, V) => {
|
|
235
|
+
const O = V.getBoundingClientRect().width;
|
|
233
236
|
return s + O;
|
|
234
237
|
}, 0);
|
|
235
238
|
}
|
|
236
|
-
const
|
|
237
|
-
l.value =
|
|
239
|
+
const G = j(0), z = (s) => {
|
|
240
|
+
l.value = G.value > s.contentBoxSize[0].inlineSize ? "vertical" : a.orientation;
|
|
238
241
|
};
|
|
239
242
|
return q(() => {
|
|
240
|
-
a.variant === "button" && !a.fullWidth
|
|
243
|
+
if (a.variant === "button" && !a.fullWidth) {
|
|
244
|
+
G.value = E(), r.value = new ResizeObserver((V) => z(V[0]));
|
|
245
|
+
const s = h.value;
|
|
246
|
+
s && r.value.observe(s);
|
|
247
|
+
}
|
|
241
248
|
}), A(() => {
|
|
242
249
|
var s;
|
|
243
250
|
a.variant === "button" && r.value && ((s = r.value) == null || s.disconnect());
|
|
244
251
|
}), L(() => {
|
|
245
252
|
l.value = a.orientation;
|
|
246
|
-
}), (s,
|
|
253
|
+
}), (s, V) => (n(), M(K, N(a, {
|
|
247
254
|
ref: "radioGroup",
|
|
248
255
|
class: ["stash-radio-group", e(u)["stash-radio-group"]],
|
|
249
256
|
"data-test": "stash-radio-group",
|
|
@@ -267,14 +274,14 @@ const ke = /* @__PURE__ */ w({
|
|
|
267
274
|
_: 3
|
|
268
275
|
}, 16, ["class", "aria-errormessage", "error-id", "aria-invalid"]));
|
|
269
276
|
}
|
|
270
|
-
}),
|
|
277
|
+
}), Re = {
|
|
271
278
|
"stash-radio-group": "_stash-radio-group_184u1_3"
|
|
272
|
-
},
|
|
273
|
-
$style:
|
|
274
|
-
},
|
|
279
|
+
}, Ce = {
|
|
280
|
+
$style: Re
|
|
281
|
+
}, Ee = /* @__PURE__ */ B(Ve, [["__cssModules", Ce]]);
|
|
275
282
|
export {
|
|
276
283
|
k as RADIO_GROUP_INJECTION,
|
|
277
284
|
x as RadioGroupVariant,
|
|
278
|
-
|
|
285
|
+
Ee as default
|
|
279
286
|
};
|
|
280
287
|
//# sourceMappingURL=RadioGroup.js.map
|