From d115a36daa2f63e0ddb9ffecca040871e79ff1da Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Sat, 9 Sep 2023 15:49:34 +0200 Subject: [PATCH 1/5] Add block shortcut --- .../components/open/forms/OpenFormField.vue | 69 +++++++++++-------- .../forms/components/FormFieldsEditor.vue | 13 +++- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/resources/js/components/open/forms/OpenFormField.vue b/resources/js/components/open/forms/OpenFormField.vue index 262b9adcd..2a4534f3f 100644 --- a/resources/js/components/open/forms/OpenFormField.vue +++ b/resources/js/components/open/forms/OpenFormField.vue @@ -6,8 +6,18 @@
-
-
+ +
- - diff --git a/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue new file mode 100644 index 000000000..ef530b096 --- /dev/null +++ b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue @@ -0,0 +1,374 @@ + + + diff --git a/resources/js/store/modules/open/working_form.js b/resources/js/store/modules/open/working_form.js index 9154ecc6c..045b2e948 100644 --- a/resources/js/store/modules/open/working_form.js +++ b/resources/js/store/modules/open/working_form.js @@ -7,7 +7,7 @@ export const state = { // Field being edited selectedFieldIndex: null, showEditFieldSidebar: null, - showAddFieldModal: null + showAddFieldSidebar: null } // mutations @@ -25,25 +25,25 @@ export const mutations = { } state.selectedFieldIndex = index state.showEditFieldSidebar = true - state.showAddFieldModal = false + state.showAddFieldSidebar = false }, closeEditFieldSidebar (state) { state.selectedFieldIndex = null state.showEditFieldSidebar = false - state.showAddFieldModal = false + state.showAddFieldSidebar = false }, - openAddFieldModal (state, index) { + openAddFieldSidebar (state, index) { // If field is passed, compute index if (index !== null && typeof index === 'object') { index = state.content.properties.findIndex(prop => prop.id === index.id) } state.selectedFieldIndex = index - state.showAddFieldModal = true + state.showAddFieldSidebar = true state.showEditFieldSidebar = false }, - closeAddFieldModal (state) { + closeAddFieldSidebar (state) { state.selectedFieldIndex = null - state.showAddFieldModal = false + state.showAddFieldSidebar = false state.showEditFieldSidebar = false }, } From 12b77399e80cc0f7e566a635b265c9e3ea6525a3 Mon Sep 17 00:00:00 2001 From: Forms Dev Date: Wed, 13 Sep 2023 16:36:02 +0530 Subject: [PATCH 4/5] add block sidebar UI changes --- .../form-components/AddFormBlockSidebar.vue | 314 ++++++------------ 1 file changed, 101 insertions(+), 213 deletions(-) diff --git a/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue index ef530b096..5585e60ee 100644 --- a/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue +++ b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue @@ -19,227 +19,32 @@

Input Blocks

-
- - -
-
- - - -
-

Text Input

-
- -
-
- - - -
-

Date Input

-
- -
-
- - - -
-

URL Input

-
- -
-
- - - -
-

Phone Input

-
- - -
-
- - - -
-

Email Input

-
- - -
-
- - - -
-

Checkbox Input

-
- - -
-
- - - -
-

Select Input

-
- - -
-
- - - -
-

Multi-select Input

-
- - -
-
- - - -
-

Number Input

-
- - -
+
-
- - - +
+
-

File Input

+

{{ block.title }}

- - -
-
- - - -
-

Signature Input

-
-

Layout Blocks

-
- - -
+
-
- - - +
+
-

Text Block

+

{{ block.title }}

- -
-
- - - -
-

Page-break Block

-
- -
-
- - - -
-

Divider block

-
- -
-
- - - -
-

Image Block

-
- -
-
- - - -
-

Code Block

-
-
@@ -250,15 +55,98 @@ import {mapState} from 'vuex' import Form from 'vform' import clonedeep from 'clone-deep' -import VButton from '../../../../common/Button.vue' export default { name: 'AddFormBlockSidebar', - components: {VButton}, + components: {}, props: {}, data() { return { - blockForm: null + blockForm: null, + inputBlocks: [ + { + name: 'text', + title: 'Text Input', + icon: '', + }, + { + name: 'date', + title: 'Date Input', + icon: '', + }, + { + name: 'url', + title: 'URL Input', + icon: '', + }, + { + name: 'phone_number', + title: 'Phone Input', + icon: '', + }, + { + name: 'email', + title: 'Email Input', + icon: '', + }, + { + name: 'checkbox', + title: 'Checkbox Input', + icon: '', + }, + { + name: 'select', + title: 'Select Input', + icon: '', + }, + { + name: 'multi_select', + title: 'Multi-select Input', + icon: '', + }, + { + name: 'number', + title: 'Number Input', + icon: '', + }, + { + name: 'files', + title: 'File Input', + icon: '', + }, + { + name: 'signature', + title: 'Signature Input', + icon: '', + } + ], + layoutBlocks: [ + { + name: 'nf-text', + title: 'Text Block', + icon: '', + }, + { + name: 'nf-page-break', + title: 'Page-break Block', + icon: '', + }, + { + name: 'nf-divider', + title: 'Divider Block', + icon: '', + }, + { + name: 'nf-image', + title: 'Image Block', + icon: '', + }, + { + name: 'nf-code', + title: 'Code Block', + icon: '', + } + ] } }, From 64aae01f98cac1e3cb23471e07cdb69695e59eee Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 18 Sep 2023 15:27:26 +0200 Subject: [PATCH 5/5] Clean spacing add form block sidebar --- .../components/form-components/AddFormBlockSidebar.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue index 5585e60ee..e05fcdbd2 100644 --- a/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue +++ b/resources/js/components/open/forms/components/form-components/AddFormBlockSidebar.vue @@ -1,7 +1,7 @@