From a2d70b4e31c4724ed194cd01829131105ab450b0 Mon Sep 17 00:00:00 2001 From: AlexthePear Date: Wed, 28 Feb 2024 00:29:31 -0800 Subject: [PATCH 01/25] testing --- db.kv | Bin 0 -> 4096 bytes db.kv-shm | Bin 0 -> 32768 bytes db.kv-wal | Bin 0 -> 111272 bytes src/lib/components/form_editor.svelte | 4 ++ src/routes/forms/demoformeditor/+page.svelte | 8 +++ .../forms/demoformeditor/demo_form_editor.ts | 59 ++++++++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 db.kv create mode 100644 db.kv-shm create mode 100644 db.kv-wal create mode 100644 src/routes/forms/demoformeditor/+page.svelte create mode 100644 src/routes/forms/demoformeditor/demo_form_editor.ts diff --git a/db.kv b/db.kv new file mode 100644 index 0000000000000000000000000000000000000000..9a472209435d88229f65ab7a0ca30d67df87a462 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WY9}{#S79dK(-m98b?E5 nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!nC=3ArNJIx= literal 0 HcmV?d00001 diff --git a/db.kv-shm b/db.kv-shm new file mode 100644 index 0000000000000000000000000000000000000000..a1eba0a55acd8aa71b2ef395503aec95fc307e4d GIT binary patch literal 32768 zcmeI)OD+Ua6b9f!wQlX%XcWd~NbJZyj7-dJ!8$}(1Pd?{TOi?FNhduO6LP*k`BS$Z zxmEQo;Pfx2G0Q^4iFSlcz1j9cK>?){CF|F9NnCs^*?-mws+h2b1w7O z+dAJJi`gza$S!4v*->^m`~6LMZ1;Y<&Mkxh0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAVA6%3VZ=-Cn=f$ literal 0 HcmV?d00001 diff --git a/db.kv-wal b/db.kv-wal new file mode 100644 index 0000000000000000000000000000000000000000..a90e8b25563fc93b9d111478aa3ddd4fab2f7e25 GIT binary patch literal 111272 zcmeI*eQX=$0mtz>C(T%OcNj^#5Qf({$PKMRlH3|OhZFx8~-6q{DnGA8VqS;MarJD<6tLF z6gEXo((fsWedl|5p3mKrDo>x^UE;y68AX5hvx;(w;!kIv89Mjkd#B%i>9S|vyk#aA zm5bEo<%O3X>woCfgV!Cn_2zt8Xt`o($|-A>+&U0YuGciVZa{wb`rFJ+{`=0xjC`%_ zuW7#B+ko{b+^pv;snz}it-J35TE>_A~sd#VRtsd#>4)55Zp1QJD#iJEb z5$RH;P>^M8ndxq+c*{pVfh!z$GG7pj4((Sv?`manOfoc4xK7zw43u%Q6UAIE?PU)O zw=yXfZzplRbUv4^6kIWxpB5$IF5HbgV$-S6u40D3A$v<-R8I6>ehOjnAy6xP2ADb6^>o1o~TJqOs88e%5>g6HZk2h2X)if?vaDC z{VZNblMTRcS1lV4Rxb~9hqrH6tHs)3{i`P}Prlz=n%{S{oQLL5<{E0F*)?4twTAh> zw!Fb=x7r=vxl^r<)CxA0zk9A3dS$097R&}(inrjy`frj(0UK?l`BGlCq=WM0_&lbQJ;8W^4Smk390CX+fB*srAbsoDuHM` zWeeLebwjweZbyaClV&38zsp*V<5PBtFX zW2T*Ovmz5uS@Fn#oAQL`#+I~en6S7h* zIfCbY{Mv8FPCx$yIfB(b-RvI$1Q0*~0R#|0009ILKmdUYC{WK4_`?EPas&sSc=1c4 z-+1an|AUU8q6A42T)>mWp%Fj;0R#|0009ILKmdW&7r4LY&gvIy1Nn2s(o}6AzdwNA zFmD{&XYaK~cHNQq<_&vBV|MEHubcalV~P2(@1I+Gok;J|itx%Z4d4|cJ>KC;E;lLM z(MYE&hu#k>+Z5$Q;6$KrmK?zak3h&PtR+XV^Q}K$e(f*rf4bH$5IUrU4v{2S{Z_~k z5I_I{1Q0*~0R#|0009Ixq=4R`-Z>jsX@|?2$PwH>{_4Sjf4%ZLIf4y&MN%mQ5I_I{ z1Q0*~0R#|0009K*0`(k0znp2w5q#}n`LX;ze!Z&}Fc>%`a|8pYcqRcC4FU)tfB*sr zAbeAJRUtbe1|nWJeEwR77pcax6aCj^7qd!dvJ0DqI8ix zkKp~cc4W1`ZQD`n7YJSB=LoJLNwBKzpPeIs00IagfB*srAbw=;DZP!`ZQ2s5;59M$B|Io8@x3QmlBtW}$R(5c51ecjnBWfC{ zxS6zV(@eySq!9_Zc`sWmxwm;2U5=pgBQdiz6foqYfM{&<1z&DYN72>N#fPs&*)1Q0*~ z0R#|0009ILXc4GR^i~5ixA&?&YM>$q9DC`^@w6vAFJCOA^R5zz$3@I^qPA|vGBMqD zlQBJ$$k@6iM=e`+RwOJ}%#TOk7E8+IsZ>n2qIOERQ%PITgvi`fQ z3 zb1%Mk`t27U85$3M=ihd%Um*DCe2yUa$Iux$%Y*;|2q1s}0tg_000IagfWYbrEO$r# z74@=3JJiFopY+nLr00qpL5F`r8~p;WBz}0^Pk*)dEIESJyUf`$0tg_000IagfB*sr zAbOD={FG^9gc_gFqUkN?dUjP6A literal 0 HcmV?d00001 diff --git a/src/lib/components/form_editor.svelte b/src/lib/components/form_editor.svelte index 1cd4e0c..69bd87a 100644 --- a/src/lib/components/form_editor.svelte +++ b/src/lib/components/form_editor.svelte @@ -90,6 +90,10 @@ /> --> + {#each data.questions.data as question} + + {/each} + diff --git a/src/routes/forms/demoformeditor/+page.svelte b/src/routes/forms/demoformeditor/+page.svelte new file mode 100644 index 0000000..729c9f1 --- /dev/null +++ b/src/routes/forms/demoformeditor/+page.svelte @@ -0,0 +1,8 @@ + + + + diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts new file mode 100644 index 0000000..bc1e0be --- /dev/null +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -0,0 +1,59 @@ +import type { Form } from '$lib/form'; +import { QuestionType } from '$lib/form'; + +export const demoForm: Form = { + id: 'demo_form_id', + questions: { + data: [ + { + type: QuestionType.BOOLEAN, + name: 'Age Check', + content: 'Are you over 18 years old?', + required: false, + value: true, + style: 'checkbox' + }, + { + type: QuestionType.TEXT, + name: 'FRQ', + content: 'How do you feel about this form?', + required: false, + value: 'Sample Text' + }, + { + type: QuestionType.SINGLE_TEXT_SELECT, + name: 'multiple choice', + content: 'please pick one', + required: false, + allowCustomChoice: false, + choices: ['choice 1', 'choice 2', 'choice 3', 'choice 4'] + }, + { + type: QuestionType.COLOR, + name: 'Color Question', + content: 'Pick a color', + required: false, + value: '#000000' + }, + { + type: QuestionType.NUMBER, + name: 'Number Question', + content: 'Pick a number', + required: false, + min: 0, + max: 100, + placeholder: 'select a number' + }, + { + type: QuestionType.TEXTAREA, + name: 'Text Area Question', + content: 'text area?', + required: false, + minLength: 0, + maxLength: 1_000, + placeholder: 'write here', + value: '' + } + ] + } +}; From bd7db6208effedeffa10fdd30094fcdd406f6d0b Mon Sep 17 00:00:00 2001 From: AlexthePear Date: Wed, 20 Mar 2024 23:23:09 -0700 Subject: [PATCH 02/25] Implemented Demo_form_editor to display editor components. --- .../question_input_editor.svelte | 43 ++++++++++++++-- .../question_input/question_input.svelte | 4 +- .../boolean_question_input_editor.svelte | 51 +++++++++++++++++++ src/lib/{store => db}/index.ts | 0 src/lib/{store => db}/kv/index.ts | 0 src/lib/{store => db}/kv/kv.ts | 0 src/lib/{store => db}/store.ts | 0 src/lib/stores/drafts/drafts.ts | 6 +++ src/routes/demo/demo_form.ts | 1 + src/routes/forms/demoformeditor/+page.svelte | 7 ++- .../forms/demoformeditor/demo_form_editor.ts | 6 ++- 11 files changed, 107 insertions(+), 11 deletions(-) rename src/lib/{store => db}/index.ts (100%) rename src/lib/{store => db}/kv/index.ts (100%) rename src/lib/{store => db}/kv/kv.ts (100%) rename src/lib/{store => db}/store.ts (100%) create mode 100644 src/lib/stores/drafts/drafts.ts diff --git a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte index f40e9bf..4ea9e04 100644 --- a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte +++ b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte @@ -1,11 +1,46 @@ + + +
+ {#if $$props.type === QuestionType.BOOLEAN} + + + {/if} +
diff --git a/src/lib/components/question_input/question_input.svelte b/src/lib/components/question_input/question_input.svelte index e5bf2bd..c89e435 100644 --- a/src/lib/components/question_input/question_input.svelte +++ b/src/lib/components/question_input/question_input.svelte @@ -6,7 +6,7 @@ import DateQuestionInput from '$lib/components/questions/date/date_question_input.svelte'; import DatetimeQuestionInput from '$lib/components/questions/datetime/datetime_question_input.svelte'; import NumberQuestionInput from '$lib/components/questions/number/number_question_input.svelte'; - import SingleTextSelectQuestionInput from '$lib/components/questions/radio_group/radio_group_question_input.svelte'; + import RadioGroupQuestionInput from '$lib/components/questions/radio_group/radio_group_question_input.svelte'; import TextQuestionInput from '$lib/components/questions/text/text_question_input.svelte'; import TextareaQuestionInput from '$lib/components/questions/textarea/textarea_question_input.svelte'; import TimeQuestionInput from '$lib/components/questions/time/time_question_input.svelte'; @@ -19,7 +19,7 @@ {:else if $$props.type === QuestionType.TEXT} {:else if $$props.type === QuestionType.RADIO_GROUP} - + {:else if $$props.type === QuestionType.NUMBER} {:else if $$props.type === QuestionType.COLOR} diff --git a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte index e69de29..ad20c4b 100644 --- a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte +++ b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte @@ -0,0 +1,51 @@ + + + + + + +
+ Sample + +
diff --git a/src/lib/store/index.ts b/src/lib/db/index.ts similarity index 100% rename from src/lib/store/index.ts rename to src/lib/db/index.ts diff --git a/src/lib/store/kv/index.ts b/src/lib/db/kv/index.ts similarity index 100% rename from src/lib/store/kv/index.ts rename to src/lib/db/kv/index.ts diff --git a/src/lib/store/kv/kv.ts b/src/lib/db/kv/kv.ts similarity index 100% rename from src/lib/store/kv/kv.ts rename to src/lib/db/kv/kv.ts diff --git a/src/lib/store/store.ts b/src/lib/db/store.ts similarity index 100% rename from src/lib/store/store.ts rename to src/lib/db/store.ts diff --git a/src/lib/stores/drafts/drafts.ts b/src/lib/stores/drafts/drafts.ts new file mode 100644 index 0000000..931a733 --- /dev/null +++ b/src/lib/stores/drafts/drafts.ts @@ -0,0 +1,6 @@ +import { writable } from 'svelte/store'; +import type { Form } from '$lib/form'; + +export const drafts = writable>(new Map()); + +// TODO: Dream about the solution diff --git a/src/routes/demo/demo_form.ts b/src/routes/demo/demo_form.ts index f9ad39e..938031d 100644 --- a/src/routes/demo/demo_form.ts +++ b/src/routes/demo/demo_form.ts @@ -1,6 +1,7 @@ import type { Form } from '$lib/form'; import { QuestionType } from '$lib/form'; +// TODO: Add more questions to cover all question types. export const demoForm: Form = { id: 'demo_form_id', discordChannelID: '', diff --git a/src/routes/forms/demoformeditor/+page.svelte b/src/routes/forms/demoformeditor/+page.svelte index 729c9f1..0384a8a 100644 --- a/src/routes/forms/demoformeditor/+page.svelte +++ b/src/routes/forms/demoformeditor/+page.svelte @@ -1,8 +1,7 @@ - - + diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts index bc1e0be..938031d 100644 --- a/src/routes/forms/demoformeditor/demo_form_editor.ts +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -1,8 +1,12 @@ import type { Form } from '$lib/form'; import { QuestionType } from '$lib/form'; +// TODO: Add more questions to cover all question types. export const demoForm: Form = { id: 'demo_form_id', + discordChannelID: '', + startDate: '', + endDate: null, questions: { data: [ { @@ -21,7 +25,7 @@ export const demoForm: Form = { value: 'Sample Text' }, { - type: QuestionType.SINGLE_TEXT_SELECT, + type: QuestionType.RADIO_GROUP, name: 'multiple choice', content: 'please pick one', required: false, From a602b35d073c79326772dfa54c0ef5aa814cbf7e Mon Sep 17 00:00:00 2001 From: AlexthePear Date: Tue, 26 Mar 2024 00:41:36 -0700 Subject: [PATCH 03/25] Testing reactivity --- .../components/form_editor/form_editor.svelte | 14 ++++++++++---- .../question_input_editor.svelte | 6 +++++- .../question_list_editor/add_item.svelte | 3 ++- .../boolean/boolean_question_input.svelte | 2 +- .../boolean_question_input_editor.svelte | 18 +++++------------- .../select/select_question_input.svelte | 2 +- .../select/select_question_input_editor.svelte | 12 +++--------- .../questions/text/text_question_input.svelte | 2 +- src/lib/resources/store.ts | 2 +- 9 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/lib/components/form_editor/form_editor.svelte b/src/lib/components/form_editor/form_editor.svelte index 96eb30d..0339cf2 100644 --- a/src/lib/components/form_editor/form_editor.svelte +++ b/src/lib/components/form_editor/form_editor.svelte @@ -1,6 +1,6 @@
@@ -65,9 +72,8 @@ bind:value={value.questions.shuffled} /> - - - + + diff --git a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte index 47717ce..6b70a9b 100644 --- a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte +++ b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte @@ -37,6 +37,8 @@ />
Sample - +
+ +
diff --git a/src/lib/components/questions/color/color_question_input_editor.svelte b/src/lib/components/questions/color/color_question_input_editor.svelte index ee8e899..6970891 100644 --- a/src/lib/components/questions/color/color_question_input_editor.svelte +++ b/src/lib/components/questions/color/color_question_input_editor.svelte @@ -13,6 +13,8 @@
Sample - +
+ +
From 1159116a1647da604bd7ccdb45c100d4e848e4be Mon Sep 17 00:00:00 2001 From: AlexthePear Date: Mon, 1 Apr 2024 03:23:33 -0700 Subject: [PATCH 09/25] Added NumberQuestionInputEditor to render on demoFormEditor --- .../question_input_editor.svelte | 4 ++-- .../number/number_question_input_editor.svelte | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte index 9c99f9b..57d6123 100644 --- a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte +++ b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte @@ -27,12 +27,12 @@ https://github.com/acmcsufoss/form/pull/new/question-input-editor --> {:else if $$props.type === QuestionType.COLOR} + {:else if $$props.type === QuestionType.NUMBER} + {:else if $$props.type === QuestionType.DATETIME} {:else if $$props.type === QuestionType.TIME} - + --> {:else if $$props.type === QuestionType.SELECT} - --> + {/if} diff --git a/src/lib/components/questions/base/base_editor.svelte b/src/lib/components/questions/base/base_editor.svelte index 2dfc654..2bd59ab 100644 --- a/src/lib/components/questions/base/base_editor.svelte +++ b/src/lib/components/questions/base/base_editor.svelte @@ -1,6 +1,9 @@ - - - + +
+ Question Title + +
+ +
+ Internal Question + +
+ +
+ Question Required + +
+ + diff --git a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte index 6b70a9b..bddae47 100644 --- a/src/lib/components/questions/boolean/boolean_question_input_editor.svelte +++ b/src/lib/components/questions/boolean/boolean_question_input_editor.svelte @@ -6,7 +6,7 @@ import SelectQuestionInput from '../select/select_question_input.svelte'; import { drafts } from '$lib/stores/drafts/drafts'; import BaseEditor from '../base/base_editor.svelte'; - export var data = $$props as BooleanQuestion; + export let data: BooleanQuestion; /* type: QuestionType.BOOLEAN, name: 'internal name', @@ -26,7 +26,7 @@ - + /> --> +
+ Choose a Style + +
Sample
diff --git a/src/lib/components/questions/select/select_question_input_editor.svelte b/src/lib/components/questions/select/select_question_input_editor.svelte index e3563a4..40cb71c 100644 --- a/src/lib/components/questions/select/select_question_input_editor.svelte +++ b/src/lib/components/questions/select/select_question_input_editor.svelte @@ -38,12 +38,13 @@ -
- -
+ {#each data.options as option (option.content)} -

{option.content}

+
{/each} diff --git a/src/lib/components/questions/timezone/timezone_question_input.svelte b/src/lib/components/questions/timezone/timezone_question_input.svelte index 4364850..1d341d6 100644 --- a/src/lib/components/questions/timezone/timezone_question_input.svelte +++ b/src/lib/components/questions/timezone/timezone_question_input.svelte @@ -10,9 +10,11 @@ } - - +
+ {data.content} + +
diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts index 938031d..73ad96e 100644 --- a/src/routes/forms/demoformeditor/demo_form_editor.ts +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -57,6 +57,12 @@ export const demoForm: Form = { maxLength: 1_000, placeholder: 'write here', value: '' + }, + { + type: QuestionType.SELECT, + name: 'Select Question', + content: 'Pick an option', + options: [{ value: 'text', content: 'test' }] } ] } From 00c6ebefc77866f1f8ab64aaa0db37b97c7e71a7 Mon Sep 17 00:00:00 2001 From: AlexthePear Date: Tue, 9 Apr 2024 00:28:54 -0700 Subject: [PATCH 11/25] Fixed Timezone --- src/lib/form/form.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/form/form.ts b/src/lib/form/form.ts index 335c672..419fe3f 100644 --- a/src/lib/form/form.ts +++ b/src/lib/form/form.ts @@ -592,9 +592,9 @@ export interface TimezoneQuestion extends QuestionBase { type: QuestionType.TIMEZONE; /** - * default is the default value for the timezone question. + * value is the timezone. */ - default?: TimezoneQuestionValue['value']; + value?: TimezoneQuestionValue['value']; } /** From 6e52537a7ac5dd560f7c5d144b48ba915b4966ad Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:20:26 -0700 Subject: [PATCH 12/25] added fieldset to color --- .../questions/color/color_question_input_editor.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/questions/color/color_question_input_editor.svelte b/src/lib/components/questions/color/color_question_input_editor.svelte index 6970891..72d29fb 100644 --- a/src/lib/components/questions/color/color_question_input_editor.svelte +++ b/src/lib/components/questions/color/color_question_input_editor.svelte @@ -10,7 +10,11 @@ - + +
+ Default Color + +
Sample
From 71648c0d77dba50f6b8f153620ea6129a712208f Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:07:23 -0700 Subject: [PATCH 13/25] TextQuestion --- .../text/text_question_input_editor.svelte | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/lib/components/questions/text/text_question_input_editor.svelte b/src/lib/components/questions/text/text_question_input_editor.svelte index e69de29..da38b2c 100644 --- a/src/lib/components/questions/text/text_question_input_editor.svelte +++ b/src/lib/components/questions/text/text_question_input_editor.svelte @@ -0,0 +1,52 @@ + + + + +
+ Min Length + +
+
+ Max Length + +
+
+ Default Value + +
+
+ Placeholder + +
+
+ Regex Pattern + +
+
+ Choices (COMMING SOON) +
+
+ Sample +
+ +
+
+
From 26bdc86da8118f8beefc64724dcd2db1aa874f57 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:14:48 -0700 Subject: [PATCH 14/25] created textarea w/ fieldset --- .../textarea_question_input_editor.svelte | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/lib/components/questions/textarea/textarea_question_input_editor.svelte b/src/lib/components/questions/textarea/textarea_question_input_editor.svelte index e69de29..cbbc718 100644 --- a/src/lib/components/questions/textarea/textarea_question_input_editor.svelte +++ b/src/lib/components/questions/textarea/textarea_question_input_editor.svelte @@ -0,0 +1,32 @@ + + + +
+ Min Length + +
+
+ Max Length + +
+
+ Default Value + +
+
+ Placeholder + +
+
+ Sample +
+ +
+
+
From 34b4d6b62e60840a0ea59fc558f830c3c7c92d41 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:55:26 -0700 Subject: [PATCH 15/25] added regular date question --- src/routes/forms/demoformeditor/demo_form_editor.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts index 73ad96e..19fe57b 100644 --- a/src/routes/forms/demoformeditor/demo_form_editor.ts +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -63,6 +63,15 @@ export const demoForm: Form = { name: 'Select Question', content: 'Pick an option', options: [{ value: 'text', content: 'test' }] + }, + { + type: QuestionType.DATE, + name: 'justDate', + content: 'Pick a date (jk you can only pick today)', + required: false, + value: '2024-04-10', + min: '2024-04-10', + max: '2024-04-10' } ] } From 935563a5f6f0d2df242b2511980777239a88d69e Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:55:36 -0700 Subject: [PATCH 16/25] created date question --- .../date/date_question_input_editor.svelte | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/lib/components/questions/date/date_question_input_editor.svelte b/src/lib/components/questions/date/date_question_input_editor.svelte index e69de29..8160bb2 100644 --- a/src/lib/components/questions/date/date_question_input_editor.svelte +++ b/src/lib/components/questions/date/date_question_input_editor.svelte @@ -0,0 +1,35 @@ + + + +
+ Min Date + +
+
+ Max Date + +
+
+ Default Date + +
+
+ Sample +
+ +
+
+
From 86a8bab202648b232d5487cb0ad588467032f4e6 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:08:55 -0700 Subject: [PATCH 17/25] created datetime editor --- .../datetime_question_input_editor.svelte | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/lib/components/questions/datetime/datetime_question_input_editor.svelte b/src/lib/components/questions/datetime/datetime_question_input_editor.svelte index e69de29..fffe168 100644 --- a/src/lib/components/questions/datetime/datetime_question_input_editor.svelte +++ b/src/lib/components/questions/datetime/datetime_question_input_editor.svelte @@ -0,0 +1,35 @@ + + + +
+ Min Date/Time + +
+
+ Max Date/Time + +
+
+ Default Date/Time + +
+
+ Sample +
+ +
+
+
From a1a72006efc26f979d01d68e974617dab2b3ece4 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:09:10 -0700 Subject: [PATCH 18/25] added datetime to demo questions --- src/routes/forms/demoformeditor/demo_form_editor.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts index 19fe57b..190f5d1 100644 --- a/src/routes/forms/demoformeditor/demo_form_editor.ts +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -72,6 +72,15 @@ export const demoForm: Form = { value: '2024-04-10', min: '2024-04-10', max: '2024-04-10' + }, + { + type: QuestionType.DATETIME, + name: 'justDate', + content: 'Pick a date (jk you can only pick today)', + required: false, + value: '2024-04-10T11:11:11', + min: '2024-04-10T11:11:11', + max: '2024-04-10T11:11:11' } ] } From de0194e2b1bcb7bd6136d68934005e8e0670d29e Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:17:46 -0700 Subject: [PATCH 19/25] added sample time question --- src/routes/forms/demoformeditor/demo_form_editor.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routes/forms/demoformeditor/demo_form_editor.ts b/src/routes/forms/demoformeditor/demo_form_editor.ts index 190f5d1..fe2503c 100644 --- a/src/routes/forms/demoformeditor/demo_form_editor.ts +++ b/src/routes/forms/demoformeditor/demo_form_editor.ts @@ -81,6 +81,15 @@ export const demoForm: Form = { value: '2024-04-10T11:11:11', min: '2024-04-10T11:11:11', max: '2024-04-10T11:11:11' + }, + { + type: QuestionType.TIME, + name: 'just time', + content: 'just time', + required: false, + value: '11:11:11', + min: '11:11:11', + max: '11:11:11' } ] } From b523f151fd90ef24ae563a1f17f210d950908a69 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:18:01 -0700 Subject: [PATCH 20/25] more uncommented questions --- .../question_input_editor.svelte | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte index df24303..cdcddce 100644 --- a/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte +++ b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte @@ -29,20 +29,24 @@ https://github.com/acmcsufoss/form/pull/new/question-input-editor --> {:else if $$props.type === QuestionType.NUMBER} - + + {:else if $$props.type === QuestionType.SELECT} {/if} From 281e6297f945216a1256c58fedb1f46649aba65a Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:18:14 -0700 Subject: [PATCH 21/25] created time question input editor --- .../time/time_question_input_editor.svelte | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/lib/components/questions/time/time_question_input_editor.svelte b/src/lib/components/questions/time/time_question_input_editor.svelte index e69de29..726a8da 100644 --- a/src/lib/components/questions/time/time_question_input_editor.svelte +++ b/src/lib/components/questions/time/time_question_input_editor.svelte @@ -0,0 +1,28 @@ + + + +
+ Min Time + +
+
+ Max Time + +
+
+ Default Time + +
+
+ Sample +
+ +
+
+
From 72ad8263498647d8d6db971895146c60cc45cac9 Mon Sep 17 00:00:00 2001 From: keillor <69380836+keillor@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:29:59 -0700 Subject: [PATCH 22/25] fixed number input editor --- .../number_question_input_editor.svelte | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/components/questions/number/number_question_input_editor.svelte b/src/lib/components/questions/number/number_question_input_editor.svelte index 341fb0d..9bb232a 100644 --- a/src/lib/components/questions/number/number_question_input_editor.svelte +++ b/src/lib/components/questions/number/number_question_input_editor.svelte @@ -6,11 +6,26 @@ - - - - - +
+ Min + +
+
+ Max + +
+
+ Step by + +
+
+ Default Value + +
+
+ Placeholder + +
Sample From 8b00d82471ec1bdd0ccb957b696c0e7159a91403 Mon Sep 17 00:00:00 2001 From: Alexander Peras <128564378+AlexthePear@users.noreply.github.com> Date: Thu, 11 Apr 2024 21:25:19 -0700 Subject: [PATCH 23/25] WIP --- .../number_question_input_editor.svelte | 29 +++++++++++++++---- .../select_question_input_editor.svelte | 6 ++-- .../timezone_question_input_editor.svelte | 18 ++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/lib/components/questions/number/number_question_input_editor.svelte b/src/lib/components/questions/number/number_question_input_editor.svelte index 341fb0d..33a3389 100644 --- a/src/lib/components/questions/number/number_question_input_editor.svelte +++ b/src/lib/components/questions/number/number_question_input_editor.svelte @@ -6,11 +6,30 @@ - - - - - + +
+ min + +
+
+ max + +
+ +
+ step + +
+ +
+ Defualt value + +
+
+ placeholder + +
+
Sample diff --git a/src/lib/components/questions/select/select_question_input_editor.svelte b/src/lib/components/questions/select/select_question_input_editor.svelte index 40cb71c..d14b040 100644 --- a/src/lib/components/questions/select/select_question_input_editor.svelte +++ b/src/lib/components/questions/select/select_question_input_editor.svelte @@ -46,5 +46,7 @@ bind:value={option.content} />
{/each} - - +
+ Sample + +
diff --git a/src/lib/components/questions/timezone/timezone_question_input_editor.svelte b/src/lib/components/questions/timezone/timezone_question_input_editor.svelte index e69de29..2c542c3 100644 --- a/src/lib/components/questions/timezone/timezone_question_input_editor.svelte +++ b/src/lib/components/questions/timezone/timezone_question_input_editor.svelte @@ -0,0 +1,18 @@ + + + +
+ Defualt Timezone ID + +
+
+ Time + +
+
From e46e8f42625aedbcfbfe607a3ef3db934b7ea041 Mon Sep 17 00:00:00 2001 From: Alexander Peras <128564378+AlexthePear@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:23:45 -0700 Subject: [PATCH 24/25] Fixed error with timezone_question_input still using data.defualt instead of data.value --- .../questions/timezone/timezone_question_input.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/questions/timezone/timezone_question_input.svelte b/src/lib/components/questions/timezone/timezone_question_input.svelte index 1d341d6..077e22d 100644 --- a/src/lib/components/questions/timezone/timezone_question_input.svelte +++ b/src/lib/components/questions/timezone/timezone_question_input.svelte @@ -12,7 +12,7 @@
{data.content} - {#each TIMEZONES as choice} {/each} From 6d26cdb66e60196e6cca8a1ab09e8e02ed85ea27 Mon Sep 17 00:00:00 2001 From: Ethan Davidson <31261035+EthanThatOneKid@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:17:55 -0700 Subject: [PATCH 25/25] make list input reactive --- .../form_editor/question_list_editor/add_item.svelte | 3 ++- src/lib/components/list_input/list_input.svelte | 4 ++-- src/lib/components/question_input/question_input.svelte | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/components/form_editor/question_list_editor/add_item.svelte b/src/lib/components/form_editor/question_list_editor/add_item.svelte index 25065c6..2ef8229 100644 --- a/src/lib/components/form_editor/question_list_editor/add_item.svelte +++ b/src/lib/components/form_editor/question_list_editor/add_item.svelte @@ -8,8 +8,9 @@ function add(e: MouseEvent) { e.preventDefault(); + const data = { type }; // TODO: Add a helper function to create a blank question object for each type. - addAction({ type }); + addAction(data); } // function makeDefault(type: QuestionType): Question { diff --git a/src/lib/components/list_input/list_input.svelte b/src/lib/components/list_input/list_input.svelte index c65a1f7..b21cd32 100644 --- a/src/lib/components/list_input/list_input.svelte +++ b/src/lib/components/list_input/list_input.svelte @@ -5,11 +5,11 @@ export let value: ItemProps[] = []; function deleteItem(i: number): void { - value.splice(i, 1); + value = value.filter((_, index) => index !== i); } function addItem(item: ItemProps): void { - value.push(item); + value = [...value, item]; } // TODO: Make sortable items. diff --git a/src/lib/components/question_input/question_input.svelte b/src/lib/components/question_input/question_input.svelte index c89e435..e5bf2bd 100644 --- a/src/lib/components/question_input/question_input.svelte +++ b/src/lib/components/question_input/question_input.svelte @@ -6,7 +6,7 @@ import DateQuestionInput from '$lib/components/questions/date/date_question_input.svelte'; import DatetimeQuestionInput from '$lib/components/questions/datetime/datetime_question_input.svelte'; import NumberQuestionInput from '$lib/components/questions/number/number_question_input.svelte'; - import RadioGroupQuestionInput from '$lib/components/questions/radio_group/radio_group_question_input.svelte'; + import SingleTextSelectQuestionInput from '$lib/components/questions/radio_group/radio_group_question_input.svelte'; import TextQuestionInput from '$lib/components/questions/text/text_question_input.svelte'; import TextareaQuestionInput from '$lib/components/questions/textarea/textarea_question_input.svelte'; import TimeQuestionInput from '$lib/components/questions/time/time_question_input.svelte'; @@ -19,7 +19,7 @@ {:else if $$props.type === QuestionType.TEXT} {:else if $$props.type === QuestionType.RADIO_GROUP} - + {:else if $$props.type === QuestionType.NUMBER} {:else if $$props.type === QuestionType.COLOR}