-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DropdownMenu/ContextMenu): handle
color
field in items (#2510)
Co-authored-by: Benjamin Canac <[email protected]>
- Loading branch information
1 parent
2d52834
commit f66c96e
Showing
16 changed files
with
214 additions
and
54 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
docs/app/components/content/examples/context-menu/ContextMenuColorItemsExample.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script setup lang="ts"> | ||
const items = [ | ||
[ | ||
{ | ||
label: 'View', | ||
icon: 'i-heroicons-eye' | ||
}, | ||
{ | ||
label: 'Copy', | ||
icon: 'i-heroicons-document-duplicate' | ||
}, | ||
{ | ||
label: 'Edit', | ||
icon: 'i-heroicons-pencil' | ||
} | ||
], | ||
[ | ||
{ | ||
label: 'Delete', | ||
color: 'error' as const, | ||
icon: 'i-heroicons-trash' | ||
} | ||
] | ||
] | ||
</script> | ||
|
||
<template> | ||
<UContextMenu :items="items" class="w-48"> | ||
<div class="flex items-center justify-center rounded-md border border-dashed border-[var(--ui-border-accented)] text-sm aspect-video w-72"> | ||
Right click here | ||
</div> | ||
</UContextMenu> | ||
</template> |
35 changes: 35 additions & 0 deletions
35
docs/app/components/content/examples/dropdown-menu/DropdownMenuColorItemsExample.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup lang="ts"> | ||
const items = [ | ||
[ | ||
{ | ||
label: 'View', | ||
icon: 'i-heroicons-eye' | ||
}, | ||
{ | ||
label: 'Copy', | ||
icon: 'i-heroicons-document-duplicate' | ||
}, | ||
{ | ||
label: 'Edit', | ||
icon: 'i-heroicons-pencil' | ||
} | ||
], | ||
[ | ||
{ | ||
label: 'Delete', | ||
color: 'error' as const, | ||
icon: 'i-heroicons-trash' | ||
} | ||
] | ||
] | ||
</script> | ||
|
||
<template> | ||
<UDropdownMenu :items="items" class="w-48"> | ||
<UButton label="Open" color="neutral" variant="outline" icon="i-heroicons-bars-3" /> | ||
|
||
<template #profile-trailing> | ||
<UIcon name="i-heroicons-check-badge" class="shrink-0 size-5 text-[var(--ui-primary)]" /> | ||
</template> | ||
</UDropdownMenu> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.