From 45e2d87f28a3683232816435e424ab8a1c533fc2 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Thu, 10 Oct 2024 09:15:15 -0400 Subject: [PATCH 01/13] Saving progress 1 Dropdown Table Style ok --- src/components/accordions.js | 2 +- .../inspector/collection-data-source.vue | 1 - .../inspector/collection-designer-mode.vue | 68 +++++++++++++++ src/components/inspector/index.js | 2 + src/components/renderer/form-record-list.vue | 3 +- src/components/vue-form-builder.vue | 23 ++++- src/form-builder-controls.js | 14 ++- src/form-control-common-properties.js | 86 +++++++++++++++++++ 8 files changed, 191 insertions(+), 8 deletions(-) create mode 100644 src/components/inspector/collection-designer-mode.vue diff --git a/src/components/accordions.js b/src/components/accordions.js index 800c1992a..0c3003931 100644 --- a/src/components/accordions.js +++ b/src/components/accordions.js @@ -58,7 +58,7 @@ export default [ }, { name: 'Design', - fields: ['color', 'bgcolor', 'variant', 'toggle', 'height', 'width'], + fields: ['color', 'bgcolor', 'variant', 'toggle', 'height', 'width', 'designerMode'], open: false, }, { diff --git a/src/components/inspector/collection-data-source.vue b/src/components/inspector/collection-data-source.vue index bc08411fd..f71176063 100644 --- a/src/components/inspector/collection-data-source.vue +++ b/src/components/inspector/collection-data-source.vue @@ -73,7 +73,6 @@ "variableStore", "dataSelectionOptions", "singleField" - ]; export default { components: { diff --git a/src/components/inspector/collection-designer-mode.vue b/src/components/inspector/collection-designer-mode.vue new file mode 100644 index 000000000..fc198b6b0 --- /dev/null +++ b/src/components/inspector/collection-designer-mode.vue @@ -0,0 +1,68 @@ + + diff --git a/src/components/inspector/index.js b/src/components/inspector/index.js index b393c8bf3..afe5c2922 100644 --- a/src/components/inspector/index.js +++ b/src/components/inspector/index.js @@ -2,7 +2,9 @@ export { default as CollectionSelectList } from "./collection-select-list.vue"; export { default as CollectionRecordsList } from "./collection-records-list.vue"; export { default as collectionDataSource } from "./collection-data-source.vue"; export { default as CollectionDisplayMode } from "./collection-display-mode.vue"; +export { default as CollectionDesignerMode } from "./collection-designer-mode.vue"; export { default as ColorSelect } from "./color-select.vue"; +export { default as ColorSelectRecord } from "./color-select.vue"; export { default as ColumnSetup } from "./column-setup.vue"; export { default as ContainerColumns } from "./container-columns.vue"; export { default as DataMapping } from "./data-mapping.vue"; diff --git a/src/components/renderer/form-record-list.vue b/src/components/renderer/form-record-list.vue index 2b230880a..6c2592b0a 100644 --- a/src/components/renderer/form-record-list.vue +++ b/src/components/renderer/form-record-list.vue @@ -241,7 +241,8 @@ export default { "formWatchers", "_perPage", "source", - "paginationOption" + "paginationOption", + "designerMode" ], data() { return { diff --git a/src/components/vue-form-builder.vue b/src/components/vue-form-builder.vue index d931eae4c..3614eff24 100644 --- a/src/components/vue-form-builder.vue +++ b/src/components/vue-form-builder.vue @@ -330,7 +330,7 @@ v-model="accordion.open" > { this.updateProgress(progress, nonce); }); + this.$root.$on("style-mode", (mode) => { + this.styleMode = mode; + }); this.setGroupOrder(defaultGroupOrder); }, methods: { - shouldShow(item) { + shouldShow(item, accordion) { const sourceOptions = this.inspection.config[item.field]?.sourceOptions; if (sourceOptions === 'Variable') { @@ -794,6 +799,18 @@ export default { this.enableOption = false; } + if(this.styleMode === "Modern") { + this.enableDesignOption = false; + } else { + this.enableDesignOption = true; + } + + if(accordion.name === "Design") { + if(item.type === "ColorSelectRecord" && !this.enableDesignOption) { + return false; + } + } + return !(item.if === "hideControl" && this.enableOption === false); }, isCurrentPageEmpty(currentPage) { diff --git a/src/form-builder-controls.js b/src/form-builder-controls.js index 509a3af38..3c2b8e07c 100755 --- a/src/form-builder-controls.js +++ b/src/form-builder-controls.js @@ -29,6 +29,8 @@ import LinkButton from "./components/renderer/link-button.vue"; import { bgcolorProperty, colorProperty, + bgcolorPropertyRecord, + colorPropertyRecord, keyNameProperty, javascriptReservedKeywords, labelProperty, @@ -555,8 +557,16 @@ export default [ }, if: 'hideControl' }, - colorProperty, - bgcolorProperty, + { + type: 'collectionDesignerMode', + field: 'designerMode', + config: { + label: 'Table Style', + helper: '' + } + }, + colorPropertyRecord, + bgcolorPropertyRecord, ], }, }, diff --git a/src/form-control-common-properties.js b/src/form-control-common-properties.js index 50a7463e3..d76455341 100644 --- a/src/form-control-common-properties.js +++ b/src/form-control-common-properties.js @@ -44,6 +44,49 @@ export const bgcolorProperty = { }, }; +export const bgcolorPropertyRecord = { + type: 'ColorSelectRecord', + field: 'bgcolor', + config: { + label: 'Background Color', + helper: 'Set the element\'s background color', + options: [ + { + value: 'alert alert-primary', + content: 'primary', + }, + { + value: 'alert alert-secondary', + content: 'secondary', + }, + { + value: 'alert alert-success', + content: 'success', + }, + { + value: 'alert alert-danger', + content: 'danger', + }, + { + value: 'alert alert-warning', + content: 'warning', + }, + { + value: 'alert alert-info', + content: 'info', + }, + { + value: 'alert alert-light', + content: 'light', + }, + { + value: 'alert alert-dark', + content: 'dark', + }, + ], + }, +}; + export const colorProperty = { type: 'ColorSelect', field: 'color', @@ -87,6 +130,49 @@ export const colorProperty = { }, }; +export const colorPropertyRecord = { + type: 'ColorSelectRecord', + field: 'color', + config: { + label: 'Text Color', + helper: 'Set the element\'s text color', + options: [ + { + value: 'text-primary', + content: 'primary', + }, + { + value: 'text-secondary', + content: 'secondary', + }, + { + value: 'text-success', + content: 'success', + }, + { + value: 'text-danger', + content: 'danger', + }, + { + value: 'text-warning', + content: 'warning', + }, + { + value: 'text-info', + content: 'info', + }, + { + value: 'text-light', + content: 'light', + }, + { + value: 'text-dark', + content: 'dark', + }, + ], + }, +}; + // Ref https://mathiasbynens.be/notes/javascript-identifiers export const javascriptReservedKeywords = 'null,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,const,enum,export,extends,import,super,true,false'; From 1679dccdfc28cc9551ea6e98238aed5f814e3f45 Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Fri, 11 Oct 2024 16:01:11 -0400 Subject: [PATCH 02/13] Saving progress 2, row highlight, b-table with border new icons --- src/assets/Shape.svg | 3 + src/assets/pencil-square.svg | 3 + src/components/accordions.js | 2 +- src/components/index.js | 1 + .../inspector/collection-designer-mode.vue | 2 +- .../inspector/color-select-modern.vue | 202 ++++++++++++++++++ src/components/inspector/index.js | 1 + src/components/renderer/form-record-list.vue | 106 ++++++++- src/components/vue-form-builder.vue | 3 + src/form-builder-controls.js | 2 + src/form-control-common-properties.js | 27 +++ src/mixins/HasColorProperty.js | 1 + 12 files changed, 343 insertions(+), 10 deletions(-) create mode 100644 src/assets/Shape.svg create mode 100644 src/assets/pencil-square.svg create mode 100644 src/components/inspector/color-select-modern.vue diff --git a/src/assets/Shape.svg b/src/assets/Shape.svg new file mode 100644 index 000000000..7a1fa990e --- /dev/null +++ b/src/assets/Shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/pencil-square.svg b/src/assets/pencil-square.svg new file mode 100644 index 000000000..6f33e3e3b --- /dev/null +++ b/src/assets/pencil-square.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/accordions.js b/src/components/accordions.js index 0c3003931..2339e07be 100644 --- a/src/components/accordions.js +++ b/src/components/accordions.js @@ -58,7 +58,7 @@ export default [ }, { name: 'Design', - fields: ['color', 'bgcolor', 'variant', 'toggle', 'height', 'width', 'designerMode'], + fields: ['color', 'bgcolor', 'variant', 'toggle', 'height', 'width', 'designerMode', 'bgcolormodern'], open: false, }, { diff --git a/src/components/index.js b/src/components/index.js index 8f9d3fd0e..6138371fb 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -57,6 +57,7 @@ const rendererComponents = { }; export {default as globalProperties, formTypes} from "../global-properties"; export { + bgcolorModern, bgcolorProperty, colorProperty, javascriptReservedKeywords, diff --git a/src/components/inspector/collection-designer-mode.vue b/src/components/inspector/collection-designer-mode.vue index fc198b6b0..008281d20 100644 --- a/src/components/inspector/collection-designer-mode.vue +++ b/src/components/inspector/collection-designer-mode.vue @@ -10,7 +10,7 @@ />
-

Aqui diseno Modern

+
diff --git a/src/components/inspector/color-select-modern.vue b/src/components/inspector/color-select-modern.vue new file mode 100644 index 000000000..c397c3001 --- /dev/null +++ b/src/components/inspector/color-select-modern.vue @@ -0,0 +1,202 @@ + + + + + + + diff --git a/src/components/inspector/index.js b/src/components/inspector/index.js index afe5c2922..e06839e08 100644 --- a/src/components/inspector/index.js +++ b/src/components/inspector/index.js @@ -5,6 +5,7 @@ export { default as CollectionDisplayMode } from "./collection-display-mode.vue" export { default as CollectionDesignerMode } from "./collection-designer-mode.vue"; export { default as ColorSelect } from "./color-select.vue"; export { default as ColorSelectRecord } from "./color-select.vue"; +export { default as ColorSelectModern } from "./color-select-modern.vue"; export { default as ColumnSetup } from "./column-setup.vue"; export { default as ContainerColumns } from "./container-columns.vue"; export { default as DataMapping } from "./data-mapping.vue"; diff --git a/src/components/renderer/form-record-list.vue b/src/components/renderer/form-record-list.vue index 6c2592b0a..472cc85b2 100644 --- a/src/components/renderer/form-record-list.vue +++ b/src/components/renderer/form-record-list.vue @@ -21,6 +21,7 @@