mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-07 00:30:11 +00:00
feat: SchoolSelect component
This commit is contained in:
parent
d1fc6374b1
commit
6b07e2c629
3 changed files with 26 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
||||||
"prettier": "^2.8.3",
|
"prettier": "^2.8.3",
|
||||||
"prettier-plugin-svelte": "^2.9.0",
|
"prettier-plugin-svelte": "^2.9.0",
|
||||||
"prettier-plugin-tailwindcss": "^0.2.1",
|
"prettier-plugin-tailwindcss": "^0.2.1",
|
||||||
|
"simple-svelte-autocomplete": "^2.5.1",
|
||||||
"svelte": "^3.55.1",
|
"svelte": "^3.55.1",
|
||||||
"svelte-check": "^3.0.2",
|
"svelte-check": "^3.0.2",
|
||||||
"svelte-preprocess": "^5.0.0",
|
"svelte-preprocess": "^5.0.0",
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,9 @@ devDependencies:
|
||||||
prettier-plugin-tailwindcss:
|
prettier-plugin-tailwindcss:
|
||||||
specifier: ^0.2.1
|
specifier: ^0.2.1
|
||||||
version: 0.2.1(prettier@2.8.3)
|
version: 0.2.1(prettier@2.8.3)
|
||||||
|
simple-svelte-autocomplete:
|
||||||
|
specifier: ^2.5.1
|
||||||
|
version: 2.5.1
|
||||||
svelte:
|
svelte:
|
||||||
specifier: ^3.55.1
|
specifier: ^3.55.1
|
||||||
version: 3.55.1
|
version: 3.55.1
|
||||||
|
|
@ -2094,6 +2097,10 @@ packages:
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/simple-svelte-autocomplete@2.5.1:
|
||||||
|
resolution: {integrity: sha512-wC0RzbmWhMMAqJ3PK+4sBSAHZl+Y/Qz7KDk1Wp5Fnxj+PJvOXWCIAOi5FLQZGrIMl82YKvFErzEtOCmfNOMUJg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/sirv@2.0.2:
|
/sirv@2.0.2:
|
||||||
resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==}
|
resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
|
|
|
||||||
18
frontend/src/lib/components/select/SchoolSelect.svelte
Normal file
18
frontend/src/lib/components/select/SchoolSelect.svelte
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import AutoComplete from 'simple-svelte-autocomplete';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
// import schoollistString from '$lib/assets/schoollist.txt';
|
||||||
|
|
||||||
|
let schools: string[] = [];
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
schools = await fetch('/schoollist.txt')
|
||||||
|
.then((response) => response.text())
|
||||||
|
.then((text) => text.split(';'));
|
||||||
|
});
|
||||||
|
|
||||||
|
export let selectedSchool: string = '';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
Selected color: {selectedSchool}
|
||||||
|
<AutoComplete items={schools} bind:selectedItem={selectedSchool} />
|
||||||
Loading…
Reference in a new issue