mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(ContextMenu): remove arrow prop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { tv } from 'tailwind-variants'
|
||||
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuArrowProps, ContextMenuTriggerProps, ContextMenuItemProps } from 'radix-vue'
|
||||
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuTriggerProps, ContextMenuItemProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/context-menu'
|
||||
@@ -32,7 +32,6 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type'>, Pick<ContextMe
|
||||
export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'>, Pick<ContextMenuTriggerProps, 'disabled'> {
|
||||
items?: T[] | T[][]
|
||||
content?: Omit<ContextMenuContentProps, 'asChild' | 'forceMount'>
|
||||
arrow?: boolean | Omit<ContextMenuArrowProps, 'asChild'>
|
||||
portal?: boolean
|
||||
class?: any
|
||||
ui?: Partial<typeof contextMenu.slots>
|
||||
@@ -53,7 +52,7 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
|
||||
|
||||
<script setup lang="ts" generic="T extends ContextMenuItem">
|
||||
import { computed, toRef } from 'vue'
|
||||
import { ContextMenuRoot, ContextMenuTrigger, ContextMenuArrow, useForwardPropsEmits } from 'radix-vue'
|
||||
import { ContextMenuRoot, ContextMenuTrigger, useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { UContextMenuContent } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
@@ -67,7 +66,6 @@ const slots = defineSlots<ContextMenuSlots<T>>()
|
||||
|
||||
const rootProps = useForwardPropsEmits(reactivePick(props, 'modal'), emits)
|
||||
const contentProps = toRef(() => props.content as ContextMenuContentProps)
|
||||
const arrowProps = toRef(() => props.arrow as ContextMenuArrowProps)
|
||||
const proxySlots = omit(slots, ['default']) as Record<string, ContextMenuSlots<T>[string]>
|
||||
|
||||
const ui = computed(() => tv({ extend: contextMenu, slots: props.ui })())
|
||||
@@ -83,8 +81,6 @@ const ui = computed(() => tv({ extend: contextMenu, slots: props.ui })())
|
||||
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
||||
<slot :name="name" v-bind="slotData" />
|
||||
</template>
|
||||
|
||||
<ContextMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow()" />
|
||||
</UContextMenuContent>
|
||||
</ContextMenuRoot>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export default {
|
||||
slots: {
|
||||
content: 'min-w-32 bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 divide-y divide-gray-200 dark:divide-gray-800 overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]',
|
||||
arrow: 'fill-gray-200 dark:fill-gray-800',
|
||||
group: 'p-1 isolate',
|
||||
label: 'w-full flex items-center gap-1.5 p-1.5 text-sm font-medium select-none',
|
||||
separator: '-mx-1 my-1 h-px bg-gray-200 dark:bg-gray-800',
|
||||
|
||||
Reference in New Issue
Block a user