diff --git a/src/plugins/index.js b/src/plugins/index.js index 3f295b6c..2c8538ba 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -14,6 +14,8 @@ import viewDataviewEditor from "./web_view_dataview/FNAbviewdataviewEditor.js"; import viewDataviewProperties from "./web_view_dataview/FNAbviewdataview.js"; import viewDetailEditor from "./web_view_detail/FNAbviewdetailEditor.js"; import viewDetailProperties from "./web_view_detail/FNAbviewdetail.js"; +import viewFormEditor from "./web_view_form/FNAbviewformEditor.js"; +import viewFormProperties from "./web_view_form/FNAbviewform.js"; import viewGanttEditor from "./web_view_gantt/FNAbviewganttEditor.js"; import viewGanttProperties from "./web_view_gantt/FNAbviewgantt.js"; import viewGridEditor from "./web_view_grid/FNAbviewgridEditor.js"; @@ -51,6 +53,8 @@ const AllPlugins = [ viewDataviewProperties, viewDetailEditor, viewDetailProperties, + viewFormEditor, + viewFormProperties, viewGanttEditor, viewGanttProperties, viewGridEditor, diff --git a/src/rootPages/Designer/properties/views/ABViewForm.js b/src/plugins/web_view_form/FNAbviewform.js similarity index 85% rename from src/rootPages/Designer/properties/views/ABViewForm.js rename to src/plugins/web_view_form/FNAbviewform.js index c4a84812..aa44378a 100644 --- a/src/rootPages/Designer/properties/views/ABViewForm.js +++ b/src/plugins/web_view_form/FNAbviewform.js @@ -1,13 +1,28 @@ -/* - * ABViewForm - * A Property manager for our ABViewForm definitions - */ +import FNAbviewFormButtonProperties from "./properties/FNAbviewFormButton.js"; +import FNAbviewFormCheckboxProperties from "./properties/FNAbviewFormCheckbox.js"; +import FNAbviewFormConnectProperties from "./properties/FNAbviewFormConnect.js"; +import FNAbviewFormCustomProperties from "./properties/FNAbviewFormCustom.js"; +import FNAbviewFormDatepickerProperties from "./properties/FNAbviewFormDatepicker.js"; +import FNAbviewFormJsonProperties from "./properties/FNAbviewFormJson.js"; +import FNAbviewFormNumberProperties from "./properties/FNAbviewFormNumber.js"; +import FNAbviewFormSelectMultipleProperties from "./properties/FNAbviewFormSelectMultiple.js"; +import FNAbviewFormSelectSingleProperties from "./properties/FNAbviewFormSelectSingle.js"; +import FNAbviewFormTextboxProperties from "./properties/FNAbviewFormTextbox.js"; +import FNAbviewFormTreeProperties from "./properties/FNAbviewFormTree.js"; +import FNAbviewFormUrlProperties from "./properties/FNAbviewFormUrl.js"; + +export default function FNAbviewformProperties({ + AB, + ABViewPropertiesPlugin, + // ABUIPlugin, +}) { + const FABViewContainer = + require("../../rootPages/Designer/properties/views/ABViewContainer").default; + const FABViewRuleListFormRecordRules = + require("../../rootPages/Designer/properties/rules/ABViewRuleListFormRecordRules").default; + const FABViewRuleListFormSubmitRules = + require("../../rootPages/Designer/properties/rules/ABViewRuleListFormSubmitRules").default; -import FABViewContainer from "./ABViewContainer"; -import FABViewRuleListFormRecordRules from "../rules/ABViewRuleListFormRecordRules"; -import FABViewRuleListFormSubmitRules from "../rules/ABViewRuleListFormSubmitRules"; - -export default function (AB) { const ABViewContainer = FABViewContainer(AB); const uiConfig = AB.Config.uiSettings(); const L = ABViewContainer.L(); @@ -26,7 +41,16 @@ export default function (AB) { `${base}_popupSubmitRule` ); - class ABViewFormProperty extends ABViewContainer { + const ABAbviewformProperties = class ABAbviewformProperties extends ABViewPropertiesPlugin { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + // properties-view : will display in the properties panel of the ABDesigner + } + constructor(b = null, id = null) { b = b || base; id = Object.assign(id || {}, { @@ -333,29 +357,28 @@ export default function (AB) { // update properties when a field component is deleted view.views().forEach((v) => { - if (v instanceof this.AB.Class.ABViewFormItem) - v.once("destroyed", () => this.populate(view)); + if (v.isFormField) v.once("destroyed", () => this.populate(view)); }); SourceSelector.enable(); $$(ids.showLabel).setValue(view.settings.showLabel); $$(ids.labelPosition).setValue( - view.settings.labelPosition || + view.settings.labelPosition ?? ABViewFormPropertyComponentDefaults.labelPosition ); $$(ids.labelWidth).setValue( - view.settings.labelWidth || + view.settings.labelWidth ?? ABViewFormPropertyComponentDefaults.labelWidth ); $$(ids.height).setValue( - view.settings.height || ABViewFormPropertyComponentDefaults.height + view.settings.height ?? ABViewFormPropertyComponentDefaults.height ); $$(ids.clearOnLoad).setValue( - view.settings.clearOnLoad || + view.settings.clearOnLoad ?? ABViewFormPropertyComponentDefaults.clearOnLoad ); $$(ids.clearOnSave).setValue( - view.settings.clearOnSave || + view.settings.clearOnSave ?? ABViewFormPropertyComponentDefaults.clearOnSave ); @@ -405,10 +428,10 @@ export default function (AB) { vals.settings.dataviewID = $$(ids.datacollection).getValue(); vals.settings.showLabel = $$(ids.showLabel).getValue(); vals.settings.labelPosition = - $$(ids.labelPosition).getValue() || + $$(ids.labelPosition).getValue() ?? ABViewFormPropertyComponentDefaults.labelPosition; vals.settings.labelWidth = - $$(ids.labelWidth).getValue() || + $$(ids.labelWidth).getValue() ?? ABViewFormPropertyComponentDefaults.labelWidth; vals.settings.height = $$(ids.height).getValue(); vals.settings.clearOnLoad = $$(ids.clearOnLoad).getValue(); @@ -425,7 +448,7 @@ export default function (AB) { * NOTE: Must be overwritten by the Child Class */ ViewClass() { - return super._ViewClass("carousel"); + return super._ViewClass("form"); } // @@ -437,6 +460,9 @@ export default function (AB) { } check(e, fieldId) { + if (this._isBusy) return; + this._isBusy = true; + this.busy(); const ids = this.ids; let currView = this.CurrentView; let formView = currView.parentFormComponent(); @@ -447,6 +473,7 @@ export default function (AB) { $$(ids.fields).updateItem(fieldId, item); let doneFn = () => { + this._isBusy = false; formView .refreshDefaultButton(ids) .save() @@ -454,6 +481,7 @@ export default function (AB) { // refresh UI currView.emit("properties.updated", currView); this.onChange(); + this.ready(); }); // // trigger a save() @@ -462,14 +490,27 @@ export default function (AB) { // add a field to the form if (item.selected) { - let fieldView = currView.addFieldToForm(item); + // Check for duplication + let exists = formView + .fieldComponents() + .find((c) => c.settings.fieldId == fieldId); + if (exists) { + this._isBusy = false; + this.ready(); + return; + } + + let fieldView = formView.addFieldToForm(item); if (fieldView) { fieldView.save().then(() => { fieldView.once("destroyed", () => this.populate(currView)); - currView.viewInsert(fieldView).then(() => { + formView.viewInsert(fieldView).then(() => { doneFn(); }); }); + } else { + this._isBusy = false; + this.ready(); } } // remove field in the form @@ -482,9 +523,12 @@ export default function (AB) { // formView._views = remainingViews; fieldView.destroy(); - currView.viewRemove(fieldView).then(() => { + formView.viewRemove(fieldView).then(() => { doneFn(); }); + } else { + this._isBusy = false; + this.ready(); } } } @@ -599,8 +643,7 @@ export default function (AB) { refreshDefaultButton() { const ids = this.ids; - const ABViewFormButton = - this.AB.ClassManager.viewClass("button"); + const ABViewFormButton = this.AB.ClassManager.viewClass("button"); // If default button is not exists, then skip this let defaultButton = this.views( @@ -736,7 +779,21 @@ export default function (AB) { }) ); } - } - - return ABViewFormProperty; + }; + + return [ + ABAbviewformProperties, + FNAbviewFormButtonProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormCheckboxProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormConnectProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormCustomProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormDatepickerProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormJsonProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormNumberProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormSelectMultipleProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormSelectSingleProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormTextboxProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormTreeProperties({ AB, ABViewPropertiesPlugin }), + FNAbviewFormUrlProperties({ AB, ABViewForm: ABAbviewformProperties }), + ]; } diff --git a/src/plugins/web_view_form/FNAbviewformEditor.js b/src/plugins/web_view_form/FNAbviewformEditor.js new file mode 100644 index 00000000..357db6fa --- /dev/null +++ b/src/plugins/web_view_form/FNAbviewformEditor.js @@ -0,0 +1,66 @@ +import FNAbviewFormUrlEditor from "./editors/FNAbviewFormUrlEditor.js"; + +export default function FNAbviewformEditor({ AB, ABViewEditorPlugin }) { + + // TODO: In #jh/mcp_server branch, pass this value instead of using a hard reference + const FABViewContainer = + require("../../rootPages/Designer/editors/views/ABViewContainer").default; + + const ABViewContainer = FABViewContainer(AB); + // var L = UIClass.L(); + // var L = ABViewContainer.L(); + + const ABAbviewformEditor = class ABAbviewformEditor extends ABViewContainer { + static getPluginKey() { + return this.key; + } + + /** + * @method getPluginType + * return the plugin type for this editor. + * plugin types are how our ClassManager knows how to store + * the plugin. + * @return {string} plugin type + */ + static getPluginType() { + return "editor-view"; + // editor-view : will display in the editor panel of the ABDesigner + } + + static get key() { + return "form"; + } + + constructor(view, base = "interface_editor_viewform") { + // base: {string} unique base id reference + + super(view, base); + + // this.component = this.view.component(); + } + + ui() { + let _ui = super.ui(); + _ui.rows[0].cellHeight = 75; + return _ui; + } + + init(AB) { + this.AB = AB; + return super.init(AB); + } + + detatch() { + this.component?.detatch?.(); + } + + onShow() { + this.component?.onShow?.(); + } + }; + + return [ + ABAbviewformEditor, + FNAbviewFormUrlEditor({ ABViewForm: ABAbviewformEditor }), + ]; +} diff --git a/src/rootPages/Designer/editors/views/ABViewFormUrl.js b/src/plugins/web_view_form/editors/FNAbviewFormUrlEditor.js similarity index 84% rename from src/rootPages/Designer/editors/views/ABViewFormUrl.js rename to src/plugins/web_view_form/editors/FNAbviewFormUrlEditor.js index 89934f04..cec68af4 100644 --- a/src/rootPages/Designer/editors/views/ABViewFormUrl.js +++ b/src/plugins/web_view_form/editors/FNAbviewFormUrlEditor.js @@ -1,3 +1,4 @@ + /** * ABViewFormEditor * The widget that displays the UI Editor Component on the screen @@ -8,15 +9,20 @@ var myClass = null; // we will want to call this factory fn() repeatedly in our imports, // but we only want to define 1 Class reference. -import FABViewForm from "./ABViewForm"; +export default function FNAbviewFormUrlEditor({ ABViewForm }) { -export default function (AB) { if (!myClass) { - const ABViewForm = FABViewForm(AB); // var L = UIClass.L(); // var L = ABViewContainer.L(); myClass = class ABViewFormEditor extends ABViewForm { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "editor-view"; + } static get key() { return "form-url"; } diff --git a/src/rootPages/Designer/properties/views/ABViewFormButton.js b/src/plugins/web_view_form/properties/FNAbviewFormButton.js similarity index 96% rename from src/rootPages/Designer/properties/views/ABViewFormButton.js rename to src/plugins/web_view_form/properties/FNAbviewFormButton.js index 506bfb36..087d34b9 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormButton.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormButton.js @@ -3,15 +3,22 @@ * A Property manager for our ABViewButton definitions */ -import FABView from "./ABView"; - -export default function (AB) { +export default function FNAbviewFormButtonProperties({ + AB, + ABViewPropertiesPlugin, +}) { const BASE_ID = "properties_abview_button"; - const ABView = FABView(AB); - const L = ABView.L(); + const L = AB.Label(); + + class ABViewButtonProperty extends ABViewPropertiesPlugin { + static getPluginKey() { + return this.key; + } - class ABViewButtonProperty extends ABView { + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormCheckbox.js b/src/plugins/web_view_form/properties/FNAbviewFormCheckbox.js similarity index 52% rename from src/rootPages/Designer/properties/views/ABViewFormCheckbox.js rename to src/plugins/web_view_form/properties/FNAbviewFormCheckbox.js index cf6c42c7..0a07b5e7 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormCheckbox.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormCheckbox.js @@ -1,16 +1,26 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormCheckbox * A Property manager for our ABViewFormCheckbox definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormCheckboxProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_checkbox"; - const ABViewFormItem = FABViewFormItem(AB); - class ABViewFormCheckboxProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, {}); diff --git a/src/rootPages/Designer/properties/views/ABViewFormConnect.js b/src/plugins/web_view_form/properties/FNAbviewFormConnect.js similarity index 96% rename from src/rootPages/Designer/properties/views/ABViewFormConnect.js rename to src/plugins/web_view_form/properties/FNAbviewFormConnect.js index 05f5d319..d0c4b1d0 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormConnect.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormConnect.js @@ -1,25 +1,36 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; +import ABPopupSort from "../../../rootPages/Designer/ui_work_object_workspace_popupSortFields"; +import ABViewPropertyAddPage from "../../../rootPages/Designer/properties/views/viewProperties/ABViewPropertyAddPage"; +import ABViewPropertyEditPage from "../../../rootPages/Designer/properties/views/viewProperties/ABViewPropertyEditPage"; + /* * ABViewConnect * A Property manager for our ABViewConnect definitions */ -import FABViewFormItem from "./ABViewFormItem"; -import ABPopupSort from "../../ui_work_object_workspace_popupSortFields"; -import ABViewPropertyAddPage from "./viewProperties/ABViewPropertyAddPage"; -import ABViewPropertyEditPage from "./viewProperties/ABViewPropertyEditPage"; +export default function FNAbviewFormConnectProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_connect"; - const ABViewFormItem = FABViewFormItem(AB); const ABAddPage = ABViewPropertyAddPage(AB, BASE_ID); const ABEditPage = ABViewPropertyEditPage(AB, BASE_ID); - const L = ABViewFormItem.L(); + const L = AB.Label(); let FilterComponent = null; let SortComponent = null; class ABViewConnectProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here @@ -514,4 +525,3 @@ export default function (AB) { return ABViewConnectProperty; } - diff --git a/src/rootPages/Designer/properties/views/ABViewFormCustom.js b/src/plugins/web_view_form/properties/FNAbviewFormCustom.js similarity index 51% rename from src/rootPages/Designer/properties/views/ABViewFormCustom.js rename to src/plugins/web_view_form/properties/FNAbviewFormCustom.js index 3010f9f1..4e933fc0 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormCustom.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormCustom.js @@ -1,16 +1,26 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormCustom * A Property manager for our ABViewFormCustom definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormCustomProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_custom"; - const ABViewFormItem = FABViewFormItem(AB); - class ABViewFormCustomProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, {}); diff --git a/src/rootPages/Designer/properties/views/ABViewFormDatepicker.js b/src/plugins/web_view_form/properties/FNAbviewFormDatepicker.js similarity index 52% rename from src/rootPages/Designer/properties/views/ABViewFormDatepicker.js rename to src/plugins/web_view_form/properties/FNAbviewFormDatepicker.js index 8ebe056c..c3d666de 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormDatepicker.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormDatepicker.js @@ -1,16 +1,26 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormDatepicker * A Property manager for our ABViewFormDatepicker definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormDatepickerProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_datepicker"; - const ABViewFormItem = FABViewFormItem(AB); - class ABViewFormDatepickerProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, {}); diff --git a/src/rootPages/Designer/properties/views/ABViewFormItem.js b/src/plugins/web_view_form/properties/FNAbviewFormItem.js similarity index 94% rename from src/rootPages/Designer/properties/views/ABViewFormItem.js rename to src/plugins/web_view_form/properties/FNAbviewFormItem.js index f6acdc46..f1388fbb 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormItem.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormItem.js @@ -3,17 +3,17 @@ * A Property manager for our ABViewFormItem definitions */ -import FABView from "./ABView"; - -export default function (AB) { - const ABView = FABView(AB); - const L = ABView.L(); +export default function FNAbviewFormItemProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const L = AB.Label(); const DEFAULT_VALUES = { required: 0, disable: 0, }; - class ABViewFormItemProperty extends ABView { + class ABViewFormItemProperty extends ABViewPropertiesPlugin { constructor(BASE_ID, ids = {}) { super( BASE_ID, diff --git a/src/rootPages/Designer/properties/views/ABViewFormJson.js b/src/plugins/web_view_form/properties/FNAbviewFormJson.js similarity index 90% rename from src/rootPages/Designer/properties/views/ABViewFormJson.js rename to src/plugins/web_view_form/properties/FNAbviewFormJson.js index 8a7485c2..a10ddb0c 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormJson.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormJson.js @@ -1,17 +1,28 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormJson * A Property manager for our ABViewFormJson definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormJsonProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_json"; - const ABViewFormItem = FABViewFormItem(AB); - const L = ABViewFormItem.L(); + const L = AB.Label(); class ABViewFormJsonProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormNumber.js b/src/plugins/web_view_form/properties/FNAbviewFormNumber.js similarity index 84% rename from src/rootPages/Designer/properties/views/ABViewFormNumber.js rename to src/plugins/web_view_form/properties/FNAbviewFormNumber.js index 6a0175e1..da831146 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormNumber.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormNumber.js @@ -1,17 +1,28 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormNumber * A Property manager for our ABViewFormNumber definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormNumberProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_number"; - const ABViewFormItem = FABViewFormItem(AB); - const L = ABViewFormItem.L(); + const L = AB.Label(); class ABViewFormNumberProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormSelectMultiple.js b/src/plugins/web_view_form/properties/FNAbviewFormSelectMultiple.js similarity index 84% rename from src/rootPages/Designer/properties/views/ABViewFormSelectMultiple.js rename to src/plugins/web_view_form/properties/FNAbviewFormSelectMultiple.js index 17fab9bc..adc1e15d 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormSelectMultiple.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormSelectMultiple.js @@ -1,17 +1,28 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormSelectMultiple * A Property manager for our ABViewFormSelectMultiple definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormSelectMultipleProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_select_multiple"; - const ABViewFormItem = FABViewFormItem(AB); - const L = ABViewFormItem.L(); + const L = AB.Label(); class ABViewFormSelectMultipleProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormSelectSingle.js b/src/plugins/web_view_form/properties/FNAbviewFormSelectSingle.js similarity index 84% rename from src/rootPages/Designer/properties/views/ABViewFormSelectSingle.js rename to src/plugins/web_view_form/properties/FNAbviewFormSelectSingle.js index c45fe5aa..bd3a7f00 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormSelectSingle.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormSelectSingle.js @@ -1,17 +1,28 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormSelectSingle * A Property manager for our ABViewFormSelectSingle definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormSelectSingleProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_select_single"; - const ABViewFormItem = FABViewFormItem(AB); - const L = ABViewFormItem.L(); + const L = AB.Label(); class ABViewFormSelectSingleProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormTextbox.js b/src/plugins/web_view_form/properties/FNAbviewFormTextbox.js similarity index 85% rename from src/rootPages/Designer/properties/views/ABViewFormTextbox.js rename to src/plugins/web_view_form/properties/FNAbviewFormTextbox.js index 1ea0607c..5083da97 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormTextbox.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormTextbox.js @@ -1,17 +1,28 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormTextbox * A Property manager for our ABViewFormTextbox definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormTextboxProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_textbox"; - const ABViewFormItem = FABViewFormItem(AB); - const L = ABViewFormItem.L(); + const L = AB.Label(); class ABViewFormTextboxProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, { // Put our ids here diff --git a/src/rootPages/Designer/properties/views/ABViewFormTree.js b/src/plugins/web_view_form/properties/FNAbviewFormTree.js similarity index 51% rename from src/rootPages/Designer/properties/views/ABViewFormTree.js rename to src/plugins/web_view_form/properties/FNAbviewFormTree.js index a771a114..3017e28c 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormTree.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormTree.js @@ -1,16 +1,26 @@ +import FNAbviewformItem from "./FNAbviewFormItem.js"; + /* * ABViewFormTree * A Property manager for our ABViewFormTree definitions */ -import FABViewFormItem from "./ABViewFormItem"; +export default function FNAbviewFormTreeProperties({ + AB, + ABViewPropertiesPlugin, +}) { + const ABViewFormItem = FNAbviewformItem({ AB, ABViewPropertiesPlugin }); -export default function (AB) { const BASE_ID = "properties_abview_form_tree"; - const ABViewFormItem = FABViewFormItem(AB); - class ABViewFormTreeProperty extends ABViewFormItem { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(BASE_ID, {}); diff --git a/src/rootPages/Designer/properties/views/ABViewFormUrl.js b/src/plugins/web_view_form/properties/FNAbviewFormUrl.js similarity index 92% rename from src/rootPages/Designer/properties/views/ABViewFormUrl.js rename to src/plugins/web_view_form/properties/FNAbviewFormUrl.js index 07ba1ac7..0f476076 100644 --- a/src/rootPages/Designer/properties/views/ABViewFormUrl.js +++ b/src/plugins/web_view_form/properties/FNAbviewFormUrl.js @@ -1,19 +1,29 @@ +import FCommonKeyValue from "../../../rootPages/Designer/ui_common_key_value"; + /* * ABViewForm * A Property manager for our ABViewForm definitions */ -import FCommonKeyValue from "../../ui_common_key_value"; -import FABViewForm from "./ABViewForm"; -export default function (AB) { +export default function FNAbviewFormUrlProperties({ + AB, + ABViewForm, +}) { + const UIClassCommonKeyValue = FCommonKeyValue(AB); - const ABViewForm = FABViewForm(AB); const uiConfig = AB.Config.uiSettings(); - const L = ABViewForm.L(); + const L = AB.Label(); const base = "properties_abview_form_url"; class ABViewFormUrlProperty extends ABViewForm { + static getPluginKey() { + return this.key; + } + + static getPluginType() { + return "properties-view"; + } constructor() { super(base, { method: "", diff --git a/src/rootPages/Designer/editors/EditorManager.js b/src/rootPages/Designer/editors/EditorManager.js index 5d02be79..d6f74609 100644 --- a/src/rootPages/Designer/editors/EditorManager.js +++ b/src/rootPages/Designer/editors/EditorManager.js @@ -25,8 +25,7 @@ export default function (AB) { // require("./views/ABViewDataview"), // require("./views/ABViewDetail"), // require("./views/ABViewDocxBuilder"), - require("./views/ABViewForm"), - require("./views/ABViewFormUrl"), + // require("./views/ABViewFormUrl"), // require("./views/ABViewGantt"), // require("./views/ABViewKanban"), // require("./views/ABViewGrid"), diff --git a/src/rootPages/Designer/editors/views/ABViewForm.js b/src/rootPages/Designer/editors/views/ABViewForm.js deleted file mode 100644 index a9028e65..00000000 --- a/src/rootPages/Designer/editors/views/ABViewForm.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * ABViewFormEditor - * The widget that displays the UI Editor Component on the screen - * when designing the UI. - */ -var myClass = null; -// {singleton} -// we will want to call this factory fn() repeatedly in our imports, -// but we only want to define 1 Class reference. - -import FABViewContainer from "./ABViewContainer"; - -export default function (AB) { - if (!myClass) { - const ABViewContainer = FABViewContainer(AB); - // var L = UIClass.L(); - // var L = ABViewContainer.L(); - - myClass = class ABViewFormEditor extends ABViewContainer { - static get key() { - return "form"; - } - - constructor(view, base = "interface_editor_viewform") { - // base: {string} unique base id reference - - super(view, base); - - // this.component = this.view.component(); - } - - ui() { - let _ui = super.ui(); - _ui.rows[0].cellHeight = 75; - return _ui; - } - - init(AB) { - this.AB = AB; - return super.init(AB); - } - - detatch() { - this.component?.detatch?.(); - } - - onShow() { - this.component?.onShow?.(); - } - }; - } - - return myClass; -} diff --git a/src/rootPages/Designer/properties/PropertyManager.js b/src/rootPages/Designer/properties/PropertyManager.js index 27505aa0..27cf0588 100644 --- a/src/rootPages/Designer/properties/PropertyManager.js +++ b/src/rootPages/Designer/properties/PropertyManager.js @@ -90,19 +90,19 @@ export default function (AB) { require("./views/ABViewDetailText"), require("./views/ABViewDetailTree"), // require("./views/ABViewDocxBuilder"), - require("./views/ABViewForm"), - require("./views/ABViewFormButton"), - require("./views/ABViewFormCheckbox"), - require("./views/ABViewFormConnect"), - require("./views/ABViewFormCustom"), - require("./views/ABViewFormDatepicker"), - require("./views/ABViewFormJson"), - require("./views/ABViewFormNumber"), - require("./views/ABViewFormSelectMultiple"), - require("./views/ABViewFormSelectSingle"), - require("./views/ABViewFormTextbox"), - require("./views/ABViewFormTree"), - require("./views/ABViewFormUrl"), + // require("./views/ABViewForm"), + // require("./views/ABViewFormButton"), + // require("./views/ABViewFormCheckbox"), + // require("./views/ABViewFormConnect"), + // require("./views/ABViewFormCustom"), + // require("./views/ABViewFormDatepicker"), + // require("./views/ABViewFormJson"), + // require("./views/ABViewFormNumber"), + // require("./views/ABViewFormSelectMultiple"), + // require("./views/ABViewFormSelectSingle"), + // require("./views/ABViewFormTextbox"), + // require("./views/ABViewFormTree"), + // require("./views/ABViewFormUrl"), // require("./views/ABViewGantt"), // require("./views/ABViewGrid"), // require("./views/ABViewImage"),