From c7d3a3200ea2b6866f11f07a9d226908f1f26f3c Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sat, 9 Sep 2023 17:39:13 +0200 Subject: [PATCH] stuff --- frontend/src/lib/components/Modal.svelte | 274 ++++++++++++++++++ frontend/src/lib/contexts/ModalContext.svelte | 32 ++ .../src/lib/contexts/SelectContext.svelte | 73 ++++- frontend/src/lib/css/colors.sass | 27 ++ frontend/src/lib/models/device.ts | 2 + frontend/src/routes/+layout.svelte | 7 +- frontend/src/routes/+page.svelte | 10 +- 7 files changed, 416 insertions(+), 9 deletions(-) create mode 100644 frontend/src/lib/components/Modal.svelte create mode 100644 frontend/src/lib/contexts/ModalContext.svelte create mode 100644 frontend/src/lib/css/colors.sass diff --git a/frontend/src/lib/components/Modal.svelte b/frontend/src/lib/components/Modal.svelte new file mode 100644 index 0000000..29d7b56 --- /dev/null +++ b/frontend/src/lib/components/Modal.svelte @@ -0,0 +1,274 @@ + + +{#if show} + + +{/if} + + \ No newline at end of file diff --git a/frontend/src/lib/contexts/ModalContext.svelte b/frontend/src/lib/contexts/ModalContext.svelte new file mode 100644 index 0000000..6c33a90 --- /dev/null +++ b/frontend/src/lib/contexts/ModalContext.svelte @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/lib/contexts/SelectContext.svelte b/frontend/src/lib/contexts/SelectContext.svelte index d831ef4..5c10476 100644 --- a/frontend/src/lib/contexts/SelectContext.svelte +++ b/frontend/src/lib/contexts/SelectContext.svelte @@ -8,6 +8,7 @@ export interface SelectContextData { toggleSelection(id: string): void toggleMultiSelection(ids: string[]): void + selectedMasks: Readable selectedList: Readable selectedMap: Readable<{[id:string]: boolean}> } @@ -20,8 +21,9 @@ - + + + \ No newline at end of file diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index c724401..a2c0d91 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -1,14 +1,12 @@
@@ -25,8 +23,8 @@ {/each}
{/each} - +
{JSON.stringify($selectedMasks, null, 4)}