From d1d654ebac2d51e3841675faeb56480e440f622f Mon Sep 17 00:00:00 2001
From: Wolfgang Müller
Date: Tue, 5 Mar 2024 18:08:09 +0100
Subject: Initial commit

---
 frontend/src/lib/filter/TagFilterForm.svelte | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 frontend/src/lib/filter/TagFilterForm.svelte

(limited to 'frontend/src/lib/filter/TagFilterForm.svelte')

diff --git a/frontend/src/lib/filter/TagFilterForm.svelte b/frontend/src/lib/filter/TagFilterForm.svelte
new file mode 100644
index 0000000..be5996e
--- /dev/null
+++ b/frontend/src/lib/filter/TagFilterForm.svelte
@@ -0,0 +1,31 @@
+<script lang="ts">
+	import { page } from '$app/stores';
+	import { namespaceList } from '$gql/Queries';
+	import { TagFilterContext, getFilterContext } from '$lib/Filter';
+	import { getContextClient } from '@urql/svelte';
+	import FilterForm from './components/FilterForm.svelte';
+	import TagFilterGroup from './components/TagFilterGroup.svelte';
+
+	const client = getContextClient();
+
+	$: namespaceQuery = namespaceList(client);
+	$: namespaces = $namespaceQuery.data?.namespaces.edges;
+
+	const filter = getFilterContext<TagFilterContext>();
+	const apply = () => $filter.apply($page.url.searchParams);
+</script>
+
+<FilterForm on:submit={apply}>
+	<TagFilterGroup
+		slot="include"
+		type="include"
+		bind:controls={$filter.include.controls}
+		{namespaces}
+	/>
+	<TagFilterGroup
+		slot="exclude"
+		type="exclude"
+		bind:controls={$filter.exclude.controls}
+		{namespaces}
+	/>
+</FilterForm>
-- 
cgit v1.2.3-2-gb3c3

