From 2d278d9ab8145e512f8ce55aff7d69e4435f141a Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 2 Feb 2024 13:30:40 -0600 Subject: [PATCH] feat(web): search filter form (#6651) * refactor: search history box * filter box component * start adding forms * styling * combo box * styling * media types * album option * update * Updated * refactor: search history box * filter box component * start adding forms * styling * combo box * styling * media types * album option * update * Updated * Version v1.94.0 * Add people * add select even for combobox * Remove unused data * remove unused code * remove unused code --- .../components/elements/buttons/button.svelte | 3 + .../shared-components/change-date.svelte | 2 +- .../shared-components/combobox.svelte | 43 ++-- .../search-bar/search-bar.svelte | 90 +++----- .../search-bar/search-filter-box.svelte | 198 ++++++++++++++++++ .../search-bar/search-history-box.svelte | 62 ++++++ 6 files changed, 323 insertions(+), 75 deletions(-) create mode 100644 web/src/lib/components/shared-components/search-bar/search-filter-box.svelte create mode 100644 web/src/lib/components/shared-components/search-bar/search-history-box.svelte diff --git a/web/src/lib/components/elements/buttons/button.svelte b/web/src/lib/components/elements/buttons/button.svelte index b057d2da9a..6ef2f76bb4 100644 --- a/web/src/lib/components/elements/buttons/button.svelte +++ b/web/src/lib/components/elements/buttons/button.svelte @@ -4,6 +4,7 @@ | 'primary' | 'secondary' | 'transparent-primary' + | 'text-primary' | 'light-red' | 'red' | 'green' @@ -36,6 +37,8 @@ 'bg-gray-500 dark:bg-gray-200 text-white dark:text-immich-dark-gray enabled:hover:bg-gray-500/90 enabled:dark:hover:bg-gray-200/90', 'transparent-primary': 'text-gray-500 dark:text-immich-dark-primary enabled:hover:bg-gray-100 enabled:dark:hover:bg-gray-700', + 'text-primary': + 'text-immich-primary dark:text-immich-dark-primary enabled:dark:hover:bg-immich-dark-primary/10 enabled:hover:bg-immich-primary/10', 'light-red': 'bg-[#F9DEDC] text-[#410E0B] enabled:hover:bg-red-50', red: 'bg-red-500 text-white enabled:hover:bg-red-400', green: 'bg-green-500 text-gray-800 enabled:hover:bg-green-400/90', diff --git a/web/src/lib/components/shared-components/change-date.svelte b/web/src/lib/components/shared-components/change-date.svelte index 9edddc08c3..bf80fee5a1 100644 --- a/web/src/lib/components/shared-components/change-date.svelte +++ b/web/src/lib/components/shared-components/change-date.svelte @@ -85,7 +85,7 @@
- +
-
@@ -68,10 +78,11 @@
{#each filteredOptions as option (option.label)} -
-
- {/if} - - {#each $savedSearchTerms as savedSearchTerm, index (index)} -
-
- -
- -
-
-
- {/each} - + {#if showFilter} + {/if} diff --git a/web/src/lib/components/shared-components/search-bar/search-filter-box.svelte b/web/src/lib/components/shared-components/search-bar/search-filter-box.svelte new file mode 100644 index 0000000000..fe695979f2 --- /dev/null +++ b/web/src/lib/components/shared-components/search-bar/search-filter-box.svelte @@ -0,0 +1,198 @@ + + +
+

FILTERS

+
+ +
+
+ + +
+ +
+ +
+

MEDIA TYPE

+ +
+ + + + + +
+
+ + +
+

DISPLAY OPTIONS

+ +
+ + + + + +
+
+
+ +
+ + +
+
+
+

PEOPLE

+
+ +
+ +
+
+
+ +
+ +
+

PLACE

+ +
+
+

Country

+ +
+ +
+

State

+ +
+ +
+

City

+ +
+
+
+ +
+ +
+

CAMERA

+ +
+
+

Make

+ +
+ +
+

Model

+ +
+
+
+ +
+ + +
+
+ + +
+ +
+ + +
+
+ +
+ + +
+
+
diff --git a/web/src/lib/components/shared-components/search-bar/search-history-box.svelte b/web/src/lib/components/shared-components/search-bar/search-history-box.svelte new file mode 100644 index 0000000000..cb22513019 --- /dev/null +++ b/web/src/lib/components/shared-components/search-bar/search-history-box.svelte @@ -0,0 +1,62 @@ + + +
+
+

+ Smart search is enabled by default, to search for metadata use the syntax m:your-search-term +

+
+ + {#if $savedSearchTerms.length > 0} +
+

RECENT SEARCHES

+
+ +
+
+ {/if} + + {#each $savedSearchTerms as savedSearchTerm, i (i)} +
+
+ +
+ +
+
+
+ {/each} +