-
Notifications
You must be signed in to change notification settings - Fork 3
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 #19 from acmcsufoss/kj
created editors (text,textarea,date,datetime,time), fixed editors (number,color)
- Loading branch information
Showing
9 changed files
with
224 additions
and
8 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
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,35 @@ | ||
<script lang="ts"> | ||
import type { DateQuestion } from '$lib/form'; | ||
import BaseEditor from '../base/base_editor.svelte'; | ||
import DateQuestionInput from './date_question_input.svelte'; | ||
export let data = $$props as DateQuestion; | ||
/* type: QuestionType.DATE, | ||
name: 'justDate', | ||
content: 'Pick a date (jk you can only pick today)', | ||
required: false, | ||
value: new Date().toISOString(), | ||
min: new Date().toISOString(), | ||
max: new Date().toISOString() */ | ||
</script> | ||
|
||
<BaseEditor bind:data> | ||
<fieldset> | ||
<legend>Min Date</legend> | ||
<input type="date" bind:value={data.min} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Max Date</legend> | ||
<input type="date" bind:value={data.max} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Default Date</legend> | ||
<input type="date" bind:value={data.value} /> | ||
</fieldset> | ||
<details> | ||
<summary>Sample</summary> | ||
<div class="question"> | ||
<DateQuestionInput bind:data /> | ||
</div> | ||
</details> | ||
</BaseEditor> |
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,35 @@ | ||
<script lang="ts"> | ||
import type { DateQuestion, DatetimeQuestion } from '$lib/form'; | ||
import BaseEditor from '../base/base_editor.svelte'; | ||
import DatetimeQuestionInput from './datetime_question_input.svelte'; | ||
export let data = $$props as DatetimeQuestion; | ||
/* type: QuestionType.DATE, | ||
name: 'justDate', | ||
content: 'Pick a date (jk you can only pick today)', | ||
required: false, | ||
value: new Date().toISOString(), | ||
min: new Date().toISOString(), | ||
max: new Date().toISOString() */ | ||
</script> | ||
|
||
<BaseEditor bind:data> | ||
<fieldset> | ||
<legend>Min Date/Time</legend> | ||
<input type="datetime-local" bind:value={data.min} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Max Date/Time</legend> | ||
<input type="datetime-local" bind:value={data.max} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Default Date/Time</legend> | ||
<input type="datetime-local" bind:value={data.value} /> | ||
</fieldset> | ||
<details> | ||
<summary>Sample</summary> | ||
<div class="question"> | ||
<DatetimeQuestionInput bind:data /> | ||
</div> | ||
</details> | ||
</BaseEditor> |
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,52 @@ | ||
<script lang="ts"> | ||
import BaseEditor from '../base/base_editor.svelte'; | ||
import type { QuestionType, TextQuestion } from '$lib/form'; | ||
import TextQuestionInput from './text_question_input.svelte'; | ||
export var data = $$props as TextQuestion; | ||
/*var data: TextQuestion = { | ||
type: QuestionType.TEXT, //NA | ||
required: false, //base | ||
name: '', //base | ||
content: '', // base | ||
minLength: 0, | ||
maxLength: 100, | ||
value: '', // | ||
placeholder: '', | ||
pattern: '', | ||
choices: ['sample', 'default', 'should appear'] | ||
};*/ | ||
</script> | ||
|
||
<BaseEditor bind:data> | ||
<!-- Copied from BaseEditor --> | ||
<fieldset> | ||
<legend>Min Length</legend> | ||
<input type="number" bind:value={data.minLength} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Max Length</legend> | ||
<input type="number" bind:value={data.maxLength} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Default Value</legend> | ||
<input type="text" bind:value={data.value} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Placeholder</legend> | ||
<input type="text" bind:value={data.placeholder} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Regex Pattern</legend> | ||
<input type="text" bind:value={data.pattern} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Choices (COMMING SOON)</legend> | ||
</fieldset> | ||
<details> | ||
<summary>Sample</summary> | ||
<div class="question"> | ||
<TextQuestionInput bind:data /> | ||
</div> | ||
</details> | ||
</BaseEditor> |
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,32 @@ | ||
<script lang="ts"> | ||
import type { TextareaQuestion } from '$lib/form'; | ||
import BaseEditor from '../base/base_editor.svelte'; | ||
import TextareaQuestionInput from './textarea_question_input.svelte'; | ||
export var data = $$props as TextareaQuestion; | ||
</script> | ||
|
||
<BaseEditor bind:data> | ||
<fieldset> | ||
<legend>Min Length</legend> | ||
<input type="number" bind:value={data.minLength} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Max Length</legend> | ||
<input type="number" bind:value={data.maxLength} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Default Value</legend> | ||
<input type="text" bind:value={data.value} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Placeholder</legend> | ||
<input type="text" bind:value={data.placeholder} /> | ||
</fieldset> | ||
<details> | ||
<summary>Sample</summary> | ||
<div class="question"> | ||
<TextareaQuestionInput bind:data /> | ||
</div> | ||
</details> | ||
</BaseEditor> |
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,28 @@ | ||
<script lang="ts"> | ||
import type { TimeQuestion } from '$lib/form'; | ||
import BaseEditor from '../base/base_editor.svelte'; | ||
import TimeQuestionInput from './time_question_input.svelte'; | ||
export let data = $$props as TimeQuestion; | ||
</script> | ||
|
||
<BaseEditor bind:data> | ||
<fieldset> | ||
<legend>Min Time</legend> | ||
<input type="time" bind:value={data.min} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Max Time</legend> | ||
<input type="time" bind:value={data.max} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend>Default Time</legend> | ||
<input type="time" bind:value={data.value} /> | ||
</fieldset> | ||
<details> | ||
<summary>Sample</summary> | ||
<div class="question"> | ||
<TimeQuestionInput bind:data /> | ||
</div> | ||
</details> | ||
</BaseEditor> |
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