From cd2a4fd63dc69161fc71ff3105337b4184b43160 Mon Sep 17 00:00:00 2001 From: Aditya Hegde Date: Fri, 5 Jan 2024 10:24:43 +0530 Subject: [PATCH] Adding support for sections in searchable filters (#3778) * Adding support for sections in searchable filters * Remove console log --- .../src/components/menu/core/MenuItemData.ts | 12 ++ .../SeachableFilterButton.svelte | 6 +- .../SearchableFilterChip.svelte | 18 +-- .../SearchableFilterDropdown.svelte | 148 +++++++++--------- .../SearchableFilterSelectableItem.ts | 44 ++++++ .../dashboards/filters/FilterButton.svelte | 44 +++--- .../grouped-searchable-filter/+page.svelte | 86 ++++++++++ 7 files changed, 257 insertions(+), 101 deletions(-) create mode 100644 web-common/src/components/menu/core/MenuItemData.ts create mode 100644 web-local/src/routes/dev/grouped-searchable-filter/+page.svelte diff --git a/web-common/src/components/menu/core/MenuItemData.ts b/web-common/src/components/menu/core/MenuItemData.ts new file mode 100644 index 00000000000..2c2bfc822aa --- /dev/null +++ b/web-common/src/components/menu/core/MenuItemData.ts @@ -0,0 +1,12 @@ +export interface MenuItemGroupData { + name: string; + showDivider: boolean; + items: MenuItemData[]; +} + +export interface MenuItemData { + name: string; + label: string; + selected: boolean; + index: number; +} diff --git a/web-common/src/components/searchable-filter-menu/SeachableFilterButton.svelte b/web-common/src/components/searchable-filter-menu/SeachableFilterButton.svelte index 36e3ba5857d..a21d30bc4d5 100644 --- a/web-common/src/components/searchable-filter-menu/SeachableFilterButton.svelte +++ b/web-common/src/components/searchable-filter-menu/SeachableFilterButton.svelte @@ -78,6 +78,7 @@ props as needed. diff --git a/web-common/src/components/searchable-filter-menu/SearchableFilterChip.svelte b/web-common/src/components/searchable-filter-menu/SearchableFilterChip.svelte index fe8c3a0b38e..f8d5becf73b 100644 --- a/web-common/src/components/searchable-filter-menu/SearchableFilterChip.svelte +++ b/web-common/src/components/searchable-filter-menu/SearchableFilterChip.svelte @@ -58,8 +58,8 @@ props as needed. -
+
@@ -100,6 +100,8 @@ props as needed.
diff --git a/web-common/src/components/searchable-filter-menu/SearchableFilterDropdown.svelte b/web-common/src/components/searchable-filter-menu/SearchableFilterDropdown.svelte index 3232a623420..28ef8c274e8 100644 --- a/web-common/src/components/searchable-filter-menu/SearchableFilterDropdown.svelte +++ b/web-common/src/components/searchable-filter-menu/SearchableFilterDropdown.svelte @@ -1,63 +1,55 @@