From 1c54012a5bf29eabd85148e4e6e23b93de241adc Mon Sep 17 00:00:00 2001 From: Robert La Ferla Date: Tue, 16 Jan 2024 18:14:37 -0500 Subject: [PATCH 1/6] feat: Svelte drop down menu component --- src/components/DropDownMenu.svelte | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/components/DropDownMenu.svelte diff --git a/src/components/DropDownMenu.svelte b/src/components/DropDownMenu.svelte new file mode 100644 index 00000000..8d615ca7 --- /dev/null +++ b/src/components/DropDownMenu.svelte @@ -0,0 +1,19 @@ + + + + +
+ + From f1bc7e14f1648e2ddbcd02d8ff454517fc2c1b67 Mon Sep 17 00:00:00 2001 From: Robert La Ferla Date: Wed, 17 Jan 2024 10:06:06 -0500 Subject: [PATCH 2/6] feat: added placeholder support --- src/components/DropDownMenu.svelte | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/DropDownMenu.svelte b/src/components/DropDownMenu.svelte index 8d615ca7..fafd40d4 100644 --- a/src/components/DropDownMenu.svelte +++ b/src/components/DropDownMenu.svelte @@ -1,19 +1,23 @@
- + {#if placeholder} + + {/if} + {#each Object.keys(options) as option} - {/each} + {/each} From a32606ecd2bf3be54cafda2a9cfd753ae04f5207 Mon Sep 17 00:00:00 2001 From: Robert La Ferla Date: Wed, 17 Jan 2024 10:10:05 -0500 Subject: [PATCH 3/6] fix: hide placeholder when user selected an option --- src/components/DropDownMenu.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DropDownMenu.svelte b/src/components/DropDownMenu.svelte index fafd40d4..eab8dff9 100644 --- a/src/components/DropDownMenu.svelte +++ b/src/components/DropDownMenu.svelte @@ -9,10 +9,14 @@ export let required = false; - + +
- - {#if placeholder} - - {/if} - {#each Object.keys(options) as option} - - {/each} - + + + + + + + \ No newline at end of file From 1e2003c023994906ca369656ad893f78abcc52b7 Mon Sep 17 00:00:00 2001 From: Robert La Ferla Date: Wed, 17 Jan 2024 13:18:01 -0500 Subject: [PATCH 5/6] fix: removed test code --- src/components/DropDownMenu.svelte | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/DropDownMenu.svelte b/src/components/DropDownMenu.svelte index 0dc6ba48..94c249d7 100644 --- a/src/components/DropDownMenu.svelte +++ b/src/components/DropDownMenu.svelte @@ -8,11 +8,6 @@ export let onSelect = () => {}; export let required = false; export let disabled = false; - - function isDisabled() { - return disabled; - } - - - - + {#if placeholder !== ''} + + {/if} + {#each Object.entries(options) as [key, value]} - {/each} - - \ No newline at end of file + {/each} + + +