From 7be1ecaf960ae938bb8cbfc9360e84d160d9a9df Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 16 Oct 2024 01:33:06 +0530 Subject: [PATCH] feat: Add new ComboBox component (#10267) --- .../combobox/ComboBox.story.vue | 30 ++++ .../components-next/combobox/ComboBox.vue | 163 ++++++++++++++++++ .../dashboard/i18n/locale/en/components.json | 5 + 3 files changed, 198 insertions(+) create mode 100644 app/javascript/dashboard/components-next/combobox/ComboBox.story.vue create mode 100644 app/javascript/dashboard/components-next/combobox/ComboBox.vue diff --git a/app/javascript/dashboard/components-next/combobox/ComboBox.story.vue b/app/javascript/dashboard/components-next/combobox/ComboBox.story.vue new file mode 100644 index 000000000..caf26ad43 --- /dev/null +++ b/app/javascript/dashboard/components-next/combobox/ComboBox.story.vue @@ -0,0 +1,30 @@ + + + + + + + + Selected value: {{ selectedValue }} + + + + + + + + + + diff --git a/app/javascript/dashboard/components-next/combobox/ComboBox.vue b/app/javascript/dashboard/components-next/combobox/ComboBox.vue new file mode 100644 index 000000000..27d442c4f --- /dev/null +++ b/app/javascript/dashboard/components-next/combobox/ComboBox.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + {{ option.label }} + + + + + {{ emptyState || t('COMBOBOX.EMPTY_STATE') }} + + + + + diff --git a/app/javascript/dashboard/i18n/locale/en/components.json b/app/javascript/dashboard/i18n/locale/en/components.json index 42e6c41af..43f962735 100644 --- a/app/javascript/dashboard/i18n/locale/en/components.json +++ b/app/javascript/dashboard/i18n/locale/en/components.json @@ -3,6 +3,11 @@ "SHOWING": "Showing {startItem} - {endItem} of {totalItems} items", "CURRENT_PAGE_INFO": "{currentPage} of {totalPages} pages" }, + "COMBOBOX": { + "PLACEHOLDER": "Select an option...", + "EMPTY_STATE": "No results found.", + "SEARCH_PLACEHOLDER": "Search..." + }, "DIALOG": { "BUTTONS": { "CANCEL": "Cancel",
Selected value: {{ selectedValue }}