From f75fc4f86431ce4114cb890be5e7cf2a6747ecc0 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Sat, 23 Jul 2022 23:53:13 +0200 Subject: [PATCH] chore(Dropdown): support shortcuts --- src/runtime/components/elements/Dropdown.vue | 9 +++++++++ src/runtime/presets/default.ts | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/elements/Dropdown.vue b/src/runtime/components/elements/Dropdown.vue index 791d81c9..f8d3a725 100644 --- a/src/runtime/components/elements/Dropdown.vue +++ b/src/runtime/components/elements/Dropdown.vue @@ -25,6 +25,10 @@ {{ item.label }} + + + {{ shortcut }} + @@ -63,6 +67,7 @@ const props = defineProps({ icon?: string avatar?: Partial click?: Function + shortcuts?: string[] }[][]>, default: () => [] }, @@ -122,6 +127,10 @@ const props = defineProps({ itemAvatarClass: { type: String, default: () => $ui.dropdown.item.avatar + }, + itemShortcutsClass: { + type: String, + default: () => $ui.dropdown.item.shortcuts } }) diff --git a/src/runtime/presets/default.ts b/src/runtime/presets/default.ts index bbc2358b..b85dc42c 100644 --- a/src/runtime/presets/default.ts +++ b/src/runtime/presets/default.ts @@ -313,7 +313,8 @@ export default (variantColors: string[]) => { inactive: 'u-text-gray-700', disabled: 'cursor-not-allowed opacity-50', icon: 'h-5 w-5 u-text-gray-400 group-hover:u-text-gray-500 flex-shrink-0', - avatar: '-m-0.5 group-hover:u-bg-gray-200 flex-shrink-0' + avatar: '-m-0.5 group-hover:u-bg-gray-200 flex-shrink-0', + shortcuts: 'flex-shrink-0 text-xs font-semibold u-text-gray-500 ml-auto' } }