-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ssciwr/add-abstract-dropdown-page
Add abstract dropdown page
- Loading branch information
Showing
14 changed files
with
180 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
// @ts-nocheck | ||
/** | ||
* @type {any[]} | ||
*/ | ||
// @ts-ignore | ||
export let data; | ||
export let heading; | ||
export let itemComponent; // = AbstractDropdownItem; | ||
</script> | ||
|
||
<div class="items-center space-x-4 rtl:space-x-reverse"> | ||
<h1 class="mb-2 text-2xl font-bold tracking-tight text-gray-700 dark:text-gray-400">{heading}</h1> | ||
{#each data as data_element} | ||
<svelte:component this={itemComponent} data={data_element} /> | ||
{/each} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script> | ||
import { Label, Select, Tooltip } from 'flowbite-svelte'; | ||
export let data; | ||
// have the data processing here to coerce the input into the format that the component expects | ||
// @ts-ignore | ||
data.items = data.items.map((item) => ({ name: item, value: item })); | ||
</script> | ||
|
||
<div> | ||
<div class="flex items-center space-x-2"> | ||
<Label for="select-lg" class="mb-2 text-lg text-gray-700 dark:text-gray-400">{data.name}</Label> | ||
<Tooltip>{data.about}</Tooltip> | ||
</div> | ||
<Select | ||
size="lg" | ||
class="mb-3 font-normal leading-tight text-gray-700 dark:text-gray-400" | ||
items={data.items} | ||
bind:value={data.selected} | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
import '../../app.css'; | ||
</script> | ||
|
||
<slot></slot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const prerender = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script> | ||
import AbstractContent from '$lib/components/AbstractContent.svelte'; | ||
import AbstractDataInput from '$lib/components/DataInput/AbstractDataInput.svelte'; | ||
import AbstractDropdownItem from '$lib/components/DataInput/AbstractDropdownItem.svelte'; | ||
const letteroptions = ['a', 'b', 'c', 'd']; | ||
const defaultOptions = ['gar nicht', 'ansatzweise', 'weitgehend', 'zuverlässig']; | ||
const data_to_display = [ | ||
{ | ||
name: 'standing up', | ||
items: letteroptions, | ||
about: | ||
'How well can the child stand up from sitting or crawling around and how readily is it able to do so', | ||
selected: false | ||
}, | ||
{ | ||
name: 'gripping a pen the right way', | ||
items: defaultOptions, | ||
about: 'How well can the child hold a pen or pencil and how coordinated can it use it', | ||
selected: false | ||
}, | ||
{ | ||
name: 'talking in full sentences', | ||
items: letteroptions, | ||
about: 'How well articulated is the child in its speech and how well can it express itself', | ||
selected: false | ||
} | ||
]; | ||
const heading = 'some initial dummy dropdown page'; | ||
</script> | ||
|
||
<AbstractContent showBottomNavbar={true} lastPage="/" nextPage="/nextdropdown" infoPage="/info"> | ||
<AbstractDataInput data={data_to_display} {heading} itemComponent={AbstractDropdownItem} /> | ||
</AbstractContent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
import '../../app.css'; | ||
</script> | ||
|
||
<slot></slot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const prerender = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script> | ||
import AbstractContent from '$lib/components/AbstractContent.svelte'; | ||
</script> | ||
|
||
<AbstractContent showBottomNavbar={true} lastPage="/" nextPage="/" infoPage="/info"> | ||
<h1>Info page</h1> | ||
</AbstractContent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
import '../../app.css'; | ||
</script> | ||
|
||
<slot></slot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const prerender = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script> | ||
import AbstractContent from '$lib/components/AbstractContent.svelte'; | ||
import AbstractDataInput from '$lib/components/DataInput/AbstractDataInput.svelte'; | ||
import AbstractDropdownItem from '$lib/components/DataInput/AbstractDropdownItem.svelte'; | ||
const defaultOptions = ['gar nicht', 'ansatzweise', 'weitgehend', 'zuverlässig']; | ||
const dropdownData = [ | ||
{ | ||
name: 'standing up', | ||
items: defaultOptions, | ||
about: | ||
'How well can the child stand up from sitting or crawling around and how readily is it able to do so', | ||
selected: false | ||
}, | ||
{ | ||
name: 'making a mess', | ||
items: defaultOptions, | ||
about: | ||
'This describes how efficiently the child can distribute toys in every single corner of every single room in the house', | ||
selected: false | ||
}, | ||
{ | ||
name: 'gripping a pen the right way', | ||
items: defaultOptions, | ||
about: 'How well can the child hold a pen or pencil and how coordinated can it use it', | ||
selected: false | ||
}, | ||
{ | ||
name: 'talking in full sentences', | ||
items: defaultOptions, | ||
about: 'How well articulated is the child in its speech and how well can it express itself', | ||
selected: false | ||
} | ||
]; | ||
const heading = 'the second data selection page'; | ||
</script> | ||
|
||
<AbstractContent showBottomNavbar={true} lastPage="/firstdropdown" nextPage="/" infoPage="/info"> | ||
<AbstractDataInput data={dropdownData} {heading} itemComponent={AbstractDropdownItem} /> | ||
</AbstractContent> |