diff --git a/next-ui/src/components/item/card/ItemCard.vue b/next-ui/src/components/item/card/ItemCard.vue index 9c8f1bd9..eeb53575 100644 --- a/next-ui/src/components/item/card/ItemCard.vue +++ b/next-ui/src/components/item/card/ItemCard.vue @@ -88,6 +88,7 @@ + + + + @@ -138,6 +149,7 @@ import type { ItemCardEmits, ItemCardLine, ItemCardProps, ItemCardTitle } from '@/types/ItemCard' import { vOnLongPress } from '@vueuse/components' import { usePrimaryInput } from '@/composables/device' +import { reactiveOmit, reactivePick } from '@vueuse/core' const { isTouchPrimary } = usePrimaryInput() @@ -153,8 +165,8 @@ const { preSelect = false, fabIcon, quickActionIcon, + quickActionProps = {}, menuIcon, - menuMouseEnter = () => {}, } = defineProps< ItemCardProps & { /** @@ -185,15 +197,18 @@ const { * Icon displayed in the bottom-left corner. */ quickActionIcon?: string + /** + * Props to pass to the menu icon element. + */ + quickActionProps?: Record /** * Icon displayed in the bottom-right corner. */ menuIcon?: string /** - * Callback function called when the mouse enters the menu button. - * @param event + * Props to pass to the menu icon element. */ - menuMouseEnter?: (event: Event) => void + menuProps?: object } >() @@ -222,6 +237,12 @@ const hideSelection = computed( const hideFab = computed(() => selected || isPreSelect.value || isTouchPrimary.value) const hideQuickAction = computed(() => selected || isPreSelect.value || isTouchPrimary.value) const hideMenu = computed(() => selected || isPreSelect.value || isTouchPrimary.value) + +// for the quick action button to work as a dialog activator +// when the dialog is shown, the overlay disappears, along with the activator +// we use an underlay with the same positioning, but a negative z-index, and we map the `id` to the underlay +const quickActionPropsOverlay = reactiveOmit(quickActionProps, 'id') +const quickActionPropsUnderlay = reactivePick(quickActionProps, 'id')