diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ad24951 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.insertSpaces": true, + "editor.tabSize": 2, + "files.eol": "\n", + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + } +} diff --git a/src/lib/components/form/form.svelte b/src/lib/components/form/form.svelte index ab61be4..cf1889d 100644 --- a/src/lib/components/form/form.svelte +++ b/src/lib/components/form/form.svelte @@ -1,11 +1,11 @@ - -
-
-

Form editor

-

Edit a form!

-
-
-

Form ID: {data.id}

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/lib/components/form/question_input/question_input.svelte b/src/lib/components/form/question_input/question_input.svelte deleted file mode 100644 index 17e49d9..0000000 --- a/src/lib/components/form/question_input/question_input.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - -
- {#if data.type === QuestionType.BOOLEAN} - - {:else if data.type === QuestionType.TEXT} - - {:else if data.type === QuestionType.RADIO_GROUP} - - {:else if data.type === QuestionType.NUMBER} - - {:else if data.type === QuestionType.COLOR} - - {:else if data.type === QuestionType.TEXTAREA} - - {:else if data.type === QuestionType.DATE} - - {:else if data.type === QuestionType.AVAILABILITY} - - {:else if data.type === QuestionType.DATETIME} - - {:else if data.type === QuestionType.TIME} - - {:else if data.type === QuestionType.SELECT} - - {:else if data.type === QuestionType.TIMEZONE} - - {/if} -
- - diff --git a/src/lib/components/form/question_input_editor/question_base_input.svelte b/src/lib/components/form/question_input_editor/question_base_input.svelte deleted file mode 100644 index 62dcc8f..0000000 --- a/src/lib/components/form/question_input_editor/question_base_input.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - diff --git a/src/lib/components/form_editor/form_editor.svelte b/src/lib/components/form_editor/form_editor.svelte new file mode 100644 index 0000000..96eb30d --- /dev/null +++ b/src/lib/components/form_editor/form_editor.svelte @@ -0,0 +1,82 @@ + + +
+
+

Form editor

+

Edit a form!

+
+
+

Form ID: {value.id}

+
+
+ + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/components/form_editor/question_input_editor/question_base_input.svelte b/src/lib/components/form_editor/question_input_editor/question_base_input.svelte new file mode 100644 index 0000000..18b2f93 --- /dev/null +++ b/src/lib/components/form_editor/question_input_editor/question_base_input.svelte @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/src/lib/components/form/question_input_editor/question_input_editor.svelte b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte similarity index 54% rename from src/lib/components/form/question_input_editor/question_input_editor.svelte rename to src/lib/components/form_editor/question_input_editor/question_input_editor.svelte index 7de09ab..f40e9bf 100644 --- a/src/lib/components/form/question_input_editor/question_input_editor.svelte +++ b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte @@ -5,11 +5,7 @@ // export let value: Question; - + + + diff --git a/src/lib/components/form/question_list_editor/add_item.svelte b/src/lib/components/form_editor/question_list_editor/add_item.svelte similarity index 93% rename from src/lib/components/form/question_list_editor/add_item.svelte rename to src/lib/components/form_editor/question_list_editor/add_item.svelte index 4e4a77f..b52fea6 100644 --- a/src/lib/components/form/question_list_editor/add_item.svelte +++ b/src/lib/components/form_editor/question_list_editor/add_item.svelte @@ -10,6 +10,10 @@ // TODO: Add a helper function to create a blank question object for each type. addAction({ type }); } + + // function makeDefault(type: QuestionType): Question { + // switch... + // }