From c2d260ed15313bd5c1605450e103f70f0c7011ca Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Sep 2021 15:30:53 +0530 Subject: [PATCH] feat(gui): add form view options Signed-off-by: Pranav C --- .../editableCell/jsonEditableCell.vue | 6 +- .../project/spreadsheet/views/formView.vue | 251 +++++++++--------- 2 files changed, 134 insertions(+), 123 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/editableCell/jsonEditableCell.vue b/packages/nc-gui/components/project/spreadsheet/components/editableCell/jsonEditableCell.vue index 502dd4f69f..d6793107d6 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editableCell/jsonEditableCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editableCell/jsonEditableCell.vue @@ -1,5 +1,5 @@ diff --git a/packages/nc-gui/components/project/spreadsheet/views/formView.vue b/packages/nc-gui/components/project/spreadsheet/views/formView.vue index 1be356ccec..8087fbf315 100644 --- a/packages/nc-gui/components/project/spreadsheet/views/formView.vue +++ b/packages/nc-gui/components/project/spreadsheet/views/formView.vue @@ -7,11 +7,11 @@ Fields add all - remove all + remove all
- - - - -
-
+ + - - - - -
-
- - +
- - -
- Drag and drop field here to add +
+ Drag and drop field here to add +
@@ -272,6 +233,43 @@ Submit
+ +
+ + + + + + + +
+ After form is submitted: +
+ + + + + + + + + + + + +
@@ -298,7 +296,8 @@ export default { localState: {}, moved: false, addNewColMenu: false, - addNewColModal: false + addNewColModal: false, + activeRow: null // hiddenColumns: [] }), computed: { @@ -342,6 +341,12 @@ export default { // this.hiddenColumns = this.meta.columns.filter(c => this.availableColumns.find(c1 => c.cn === c1.cn && c._cn === c1._cn)) }, methods: { + isActiveRow(col) { + return this.activeRow === col.alias + }, + onClickOutside(col) { + this.activeRow = this.activeRow === col.alias ? null : this.activeRow + }, handleMouseUp(col) { if (!this.moved) { this.columns = [...this.columns, col] @@ -362,7 +367,8 @@ export default { // }, {}) // if (this.isNew) { - const data = await this.api.insert(this.localState) + //const data = + await this.api.insert(this.localState) this.localState = {} // { ...this.localState, ...data } // save hasmany and manytomany relations from local state @@ -406,6 +412,11 @@ export default { .nc-field-wrapper { + &.active-row { + border-radius: 4px; + border: 1px solid var(--v-backgroundColor-darken1); + } + position: relative; .nc-field-remove-icon {