From 7a376b5e49baf11eb09c1b58326441cb240f7cb7 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 13 May 2024 14:26:01 +0200 Subject: [PATCH] feat(SelectMenu): new component (#103) --- playground/app.vue | 1 + playground/components/FormElementsExample.vue | 2 +- playground/pages/input-menu.vue | 1 - playground/pages/select-menu.vue | 110 ++ playground/pages/select.vue | 3 +- src/runtime/components/InputMenu.vue | 7 +- src/runtime/components/RadioGroup.vue | 10 +- src/runtime/components/Select.vue | 7 +- src/runtime/components/SelectMenu.vue | 242 +++ src/runtime/components/Textarea.vue | 1 + src/runtime/types/index.d.ts | 1 + src/theme/index.ts | 1 + src/theme/input.ts | 8 +- src/theme/select-menu.ts | 12 + test/components/SelectMenu.spec.ts | 69 + .../__snapshots__/ButtonGroup.spec.ts.snap | 14 +- .../__snapshots__/CommandPalette.spec.ts.snap | 38 +- .../__snapshots__/Form.spec.ts.snap | 40 +- .../__snapshots__/Input.spec.ts.snap | 60 +- .../__snapshots__/InputMenu.spec.ts.snap | 78 +- .../__snapshots__/Select.spec.ts.snap | 70 +- .../__snapshots__/SelectMenu.spec.ts.snap | 1697 +++++++++++++++++ .../__snapshots__/Textarea.spec.ts.snap | 42 +- 23 files changed, 2318 insertions(+), 196 deletions(-) create mode 100644 playground/pages/select-menu.vue create mode 100644 src/runtime/components/SelectMenu.vue create mode 100644 src/theme/select-menu.ts create mode 100644 test/components/SelectMenu.spec.ts create mode 100644 test/components/__snapshots__/SelectMenu.spec.ts.snap diff --git a/playground/app.vue b/playground/app.vue index 3b86720f..c2b16a52 100644 --- a/playground/app.vue +++ b/playground/app.vue @@ -38,6 +38,7 @@ const components = [ 'popover', 'radio-group', 'select', + 'select-menu', 'separator', 'shortcuts', 'skeleton', diff --git a/playground/components/FormElementsExample.vue b/playground/components/FormElementsExample.vue index 6954927e..ea223584 100644 --- a/playground/components/FormElementsExample.vue +++ b/playground/components/FormElementsExample.vue @@ -54,7 +54,7 @@ function onSubmit(event: FormSubmitEvent) { - + diff --git a/playground/pages/input-menu.vue b/playground/pages/input-menu.vue index 7a302f01..0b51d402 100644 --- a/playground/pages/input-menu.vue +++ b/playground/pages/input-menu.vue @@ -62,7 +62,6 @@ const { data: users, pending } = await useFetch('https://jsonplaceholder.typicod :filter="false" icon="i-heroicons-user" placeholder="Search users..." - @update:open="searchTerm = ''" >