diff --git a/ABFactoryCore.js b/ABFactoryCore.js index 06bc771..cb3cbbd 100644 --- a/ABFactoryCore.js +++ b/ABFactoryCore.js @@ -35,9 +35,7 @@ const ABProcessLane = require("../platform/process/ABProcessLane"); const ABProcessTaskManager = require("./process/ABProcessTaskManager"); const ABStep = require("../platform/ABStep"); - const ABViewDetailItem = require("../platform/views/ABViewDetailItem"); -const ABViewFormItem = require("../platform/views/ABViewFormItem"); const ABMobileViewFormItem = require("../platform/mobile/ABMobileViewFormItem"); // const ABObjectWorkspaceViewGrid = require("../platform/workspaceViews/ABObjectWorkspaceViewGrid"); @@ -128,7 +126,6 @@ class ABFactory extends EventEmitter { ABProcessTaskManager, ABViewDetailItem, - ABViewFormItem, ABMobileViewFormItem, }; diff --git a/ABViewManagerCore.js b/ABViewManagerCore.js index 6712edc..27e4539 100644 --- a/ABViewManagerCore.js +++ b/ABViewManagerCore.js @@ -21,7 +21,7 @@ var AllViews = [ // require("../platform/views/ABViewCSVImporter"), require("../platform/views/ABViewDataFilter"), // require("../platform/views/ABViewDataSelect"), - require("../platform/views/ABViewDataview"), + // require("../platform/views/ABViewDataview"), require("../platform/views/ABViewDocxBuilder"), require("../platform/views/ABViewGrid"), // require("../platform/views/ABViewImage"), @@ -54,24 +54,6 @@ var AllViews = [ // require("../platform/views/ABViewDetailSelectivity"), require("../platform/views/ABViewDetailText"), require("../platform/views/ABViewDetailTree"), - - // - // Form Components - // - require("../platform/views/ABViewForm"), - require("../platform/views/ABViewFormButton"), - require("../platform/views/ABViewFormCheckbox"), - require("../platform/views/ABViewFormConnect"), - require("../platform/views/ABViewFormCustom"), - require("../platform/views/ABViewFormDatepicker"), - require("../platform/views/ABViewFormJson"), - require("../platform/views/ABViewFormNumber"), - require("../platform/views/ABViewFormReadonly"), - require("../platform/views/ABViewFormSelectMultiple"), - require("../platform/views/ABViewFormSelectSingle"), - require("../platform/views/ABViewFormTextbox"), - require("../platform/views/ABViewFormTree"), - require("../platform/views/ABViewFormURL"), ]; /* diff --git a/views/ABViewFormButtonCore.js b/views/ABViewFormButtonCore.js deleted file mode 100644 index 4bd0061..0000000 --- a/views/ABViewFormButtonCore.js +++ /dev/null @@ -1,125 +0,0 @@ -const ABView = require("../../platform/views/ABView"); - -const ABViewFormButtonPropertyComponentDefaults = { - includeSave: true, - saveLabel: "", - includeCancel: false, - cancelLabel: "", - includeReset: false, - resetLabel: "", - includeDelete: false, - deleteLabel: "", - afterCancel: null, - alignment: "right", - isDefault: false, // mark default button of form widget -}; - -const ABViewFormButtonDefaults = { - key: "button", - // {string} unique key for this view - - icon: "square", - // {string} fa-[icon] reference for this view - - labelKey: "ab.components.button", - // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormButtonCore extends ABView { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormButtonDefaults - ); - } - - static common() { - return ABViewFormButtonDefaults; - } - - static defaultValues() { - return ABViewFormButtonPropertyComponentDefaults; - } - - /// - /// Instance Methods - /// - - toObj() { - // labels are multilingual values: - let labels = []; - - if (this.settings.saveLabel) labels.push("saveLabel"); - - if (this.settings.cancelLabel) labels.push("cancelLabel"); - - if (this.settings.resetLabel) labels.push("resetLabel"); - - if (this.settings.deleteLabel) labels.push("deleteLabel"); - - this.unTranslate(this.settings, this.settings, labels); - - let result = super.toObj(); - - return result; - } - - /** - * @property datacollection - * return data source - * NOTE: this view doesn't track a DataCollection. - * @return {ABDataCollection} - */ - get datacollection() { - return null; - } - - fromValues(values) { - super.fromValues(values); - - // labels are multilingual values: - let labels = []; - - if (this.settings.saveLabel) labels.push("saveLabel"); - - if (this.settings.cancelLabel) labels.push("cancelLabel"); - - if (this.settings.resetLabel) labels.push("resetLabel"); - - if (this.settings.deleteLabel) labels.push("deleteLabel"); - - this.unTranslate(this.settings, this.settings, labels); - - this.settings.includeSave = JSON.parse( - (this.settings?.includeSave ?? true) && - ABViewFormButtonPropertyComponentDefaults.includeSave - ); - this.settings.includeCancel = JSON.parse( - this.settings.includeCancel || - ABViewFormButtonPropertyComponentDefaults.includeCancel - ); - this.settings.includeReset = JSON.parse( - this.settings.includeReset || - ABViewFormButtonPropertyComponentDefaults.includeReset - ); - this.settings.includeDelete = JSON.parse( - this.settings.includeDelete || - ABViewFormButtonPropertyComponentDefaults.includeDelete - ); - - this.settings.isDefault = JSON.parse( - this.settings.isDefault || - ABViewFormButtonPropertyComponentDefaults.isDefault - ); - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormCheckboxCore.js b/views/ABViewFormCheckboxCore.js deleted file mode 100644 index 4b47dea..0000000 --- a/views/ABViewFormCheckboxCore.js +++ /dev/null @@ -1,36 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormCheckboxPropertyComponentDefaults = {}; - -const ABViewFormCheckboxDefaults = { - key: "checkbox", // {string} unique key for this view - icon: "check-square-o", // {string} fa-[icon] reference for this view - labelKey: "ab.components.checkbox", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormCheckboxCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormCheckboxDefaults - ); - } - - static common() { - return ABViewFormCheckboxDefaults; - } - - static defaultValues() { - return ABViewFormCheckboxPropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormConnectCore.js b/views/ABViewFormConnectCore.js deleted file mode 100644 index 2b9c3f5..0000000 --- a/views/ABViewFormConnectCore.js +++ /dev/null @@ -1,71 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormConnectPropertyComponentDefaults = { - formView: "", // id of form to add new data - filterConditions: { - // array of filters to apply to the data table - glue: "and", - rules: [], - }, - sortFields: [], - // objectWorkspace: { - // filterConditions: { - // // array of filters to apply to the data table - // glue: "and", - // rules: [], - // }, - // }, - popupWidth: 700, - popupHeight: 450, -}; - -const ABViewFormConnectDefaults = { - key: "connect", // {string} unique key for this view - icon: "list-ul", // {string} fa-[icon] reference for this view - labelKey: "Connect", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormConnectCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormConnectDefaults - ); - } - - static common() { - return ABViewFormConnectDefaults; - } - - static defaultValues() { - return ABViewFormConnectPropertyComponentDefaults; - } - - /// - /// Instance Methods - /// - - /** - * @method fromValues() - * - * initialze this object with the given set of values. - * @param {obj} values - */ - fromValues(values) { - super.fromValues(values); - - this.settings.filterConditions = - this.settings.filterConditions || - ABViewFormConnectPropertyComponentDefaults.filterConditions; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormCore.js b/views/ABViewFormCore.js deleted file mode 100644 index be6dfd8..0000000 --- a/views/ABViewFormCore.js +++ /dev/null @@ -1,239 +0,0 @@ -const ABViewContainer = require("../../platform/views/ABViewContainer"); -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABRecordRule = require("../../rules/ABViewRuleListFormRecordRules"); -const ABSubmitRule = require("../../rules/ABViewRuleListFormSubmitRules"); - -const ABViewFormDefaults = { - key: "form", // unique key identifier for this ABViewForm - icon: "list-alt", // icon reference: (without 'fa-' ) - labelKey: "Form", // {string} the multilingual label key for the class label -}; - -const ABViewFormPropertyComponentDefaults = { - dataviewID: null, - showLabel: true, - labelPosition: "left", - labelWidth: 120, - height: 200, - clearOnLoad: false, - clearOnSave: false, - displayRules: [], - editForm: "none", // The url pointer of ABViewForm - - // [{ - // action: {string}, - // when: [ - // { - // fieldId: {UUID}, - // comparer: {string}, - // value: {string} - // } - // ], - // values: [ - // { - // fieldId: {UUID}, - // value: {object} - // } - // ] - // }] - recordRules: [], - - // [{ - // action: {string}, - // when: [ - // { - // fieldId: {UUID}, - // comparer: {string}, - // value: {string} - // } - // ], - // value: {string} - // }] - submitRules: [], -}; - -module.exports = class ABViewFormCore extends ABViewContainer { - constructor(values, application, parent, defaultValues) { - super(values, application, parent, defaultValues || ABViewFormDefaults); - this.isForm = true; - } - - static common() { - return ABViewFormDefaults; - } - - static defaultValues() { - return ABViewFormPropertyComponentDefaults; - } - - /// - /// Instance Methods - /// - - /** - * @method fromValues() - * - * initialze this object with the given set of values. - * @param {obj} values - */ - fromValues(values) { - super.fromValues(values); - - this.settings.labelPosition = - this.settings.labelPosition || - ABViewFormPropertyComponentDefaults.labelPosition; - - // convert from "0" => true/false - this.settings.showLabel = JSON.parse( - this.settings.showLabel != null - ? this.settings.showLabel - : ABViewFormPropertyComponentDefaults.showLabel - ); - this.settings.clearOnLoad = JSON.parse( - this.settings.clearOnLoad != null - ? this.settings.clearOnLoad - : ABViewFormPropertyComponentDefaults.clearOnLoad - ); - this.settings.clearOnSave = JSON.parse( - this.settings.clearOnSave != null - ? this.settings.clearOnSave - : ABViewFormPropertyComponentDefaults.clearOnSave - ); - - // convert from "0" => 0 - this.settings.labelWidth = parseInt( - this.settings.labelWidth == null - ? ABViewFormPropertyComponentDefaults.labelWidth - : this.settings.labelWidth - ); - this.settings.height = parseInt( - this.settings.height == null - ? ABViewFormPropertyComponentDefaults.height - : this.settings.height - ); - } - - // Use this function in kanban - objectLoad(object) { - this._currentObject = object; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - var viewsToAllow = ["label", "layout", "button", "text"], - allComponents = this.application.viewAll(); - - return allComponents.filter((c) => { - return viewsToAllow.indexOf(c.common().key) > -1; - }); - } - - /** - * @method fieldComponents() - * - * return an array of all the ABViewFormField children - * - * @param {fn} filter a filter fn to return a set of ABViewFormField that this fn - * returns true for. - * @return {array} array of ABViewFormField - */ - fieldComponents(filter) { - const flattenComponents = (views) => { - let components = []; - - views.forEach((v) => { - if (v == null) return; - - components.push(v); - - if (v._views?.length) { - components = components.concat(flattenComponents(v._views)); - } - }); - - return components; - }; - - if (this._views?.length) { - const allComponents = flattenComponents(this._views); - - if (filter == null) { - filter = (comp) => comp instanceof ABViewFormItem; - } - - return allComponents.filter(filter); - } else { - return []; - } - } - - addFieldToForm(field, yPosition) { - if (field == null) return; - - var fieldComponent = field.formComponent(); - if (fieldComponent == null) return; - - var newView = fieldComponent.newInstance(this.application, this); - if (newView == null) return; - - // set settings to component - newView.settings = newView.settings || {}; - newView.settings.fieldId = field.id; - // TODO : Default settings - - if (yPosition != null) newView.position.y = yPosition; - - // add a new component - this._views.push(newView); - - return newView; - } - - get RecordRule() { - let object = this.datacollection.datasource; - - if (this._recordRule == null) { - this._recordRule = new ABRecordRule(); - } - - this._recordRule.formLoad(this); - this._recordRule.fromSettings(this.settings.recordRules); - this._recordRule.objectLoad(object); - - return this._recordRule; - } - - doRecordRulesPre(rowData) { - return this.RecordRule.processPre({ data: rowData, form: this }); - } - - doRecordRules(rowData) { - // validate for record rules - if (rowData) { - let object = this.datacollection.datasource; - let ruleValidator = object.isValidData(rowData); - let isUpdatedDataValid = ruleValidator.pass(); - if (!isUpdatedDataValid) { - console.error("Updated data is invalid.", { rowData: rowData }); - return Promise.reject(new Error("Updated data is invalid.")); - } - } - - return this.RecordRule.process({ data: rowData, form: this }); - } - - doSubmitRules(rowData) { - var object = this.datacollection.datasource; - - var SubmitRules = new ABSubmitRule(); - SubmitRules.formLoad(this); - SubmitRules.fromSettings(this.settings.submitRules); - SubmitRules.objectLoad(object); - - return SubmitRules.process({ data: rowData, form: this }); - } -}; diff --git a/views/ABViewFormCustomCore.js b/views/ABViewFormCustomCore.js deleted file mode 100644 index d92430b..0000000 --- a/views/ABViewFormCustomCore.js +++ /dev/null @@ -1,39 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormCustomPropertyComponentDefaults = {}; - -const ABViewFormCustomDefaults = { - key: "fieldcustom", - // {string} unique key for this view - icon: "object-group", - // {string} fa-[icon] reference for this view - labelKey: "ab.components.custom", - // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormCustom extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormCustomDefaults - ); - } - - static common() { - return ABViewFormCustomDefaults; - } - - static defaultValues() { - return ABViewFormCustomPropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormDatepickerCore.js b/views/ABViewFormDatepickerCore.js deleted file mode 100644 index 7f0e79f..0000000 --- a/views/ABViewFormDatepickerCore.js +++ /dev/null @@ -1,42 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormDatepickerPropertyComponentDefaults = { - timepicker: false, -}; - -const ABViewFormDatepickerDefaults = { - key: "datepicker", // {string} unique key for this view - icon: "calendar", // {string} fa-[icon] reference for this view - labelKey: "ab.components.datepicker", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormDatepickerCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormDatepickerDefaults - ); - } - - static common() { - return ABViewFormDatepickerDefaults; - } - - static defaultValues() { - return ABViewFormDatepickerPropertyComponentDefaults; - } - - /// - /// Instance Methods - /// - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormItemCore.js b/views/ABViewFormItemCore.js deleted file mode 100644 index 1e34036..0000000 --- a/views/ABViewFormItemCore.js +++ /dev/null @@ -1,59 +0,0 @@ -const ABView = require("../../platform/views/ABView"); - -const ABViewFormFieldPropertyComponentDefaults = { - required: 0, - disable: 0, -}; - -module.exports = class ABViewFormComponentCore extends ABView { - // constructor(values, application, parent, defaultValues) { - // super(values, application, parent, defaultValues); - // } - - static defaultValues() { - return ABViewFormFieldPropertyComponentDefaults; - } - - /** - * @property datacollection - * return data source - * NOTE: this view doesn't track a DataCollection. - * @return {ABDataCollection} - */ - get datacollection() { - let form = this.parentFormComponent(); - if (form == null) return null; - - let datacollection = form.datacollection; - if (datacollection == null) return null; - - return datacollection; - } - - field() { - if (this.settings.objectId) { - let object = this.AB.objectByID(this.settings.objectId); - if (!object) return null; - - return object.fieldByID(this.settings.fieldId); - } else { - let form = this.parentFormComponent(); - if (form == null) return null; - - let object; - if (form._currentObject) { - object = form._currentObject; - } else { - let datacollection = form.datacollection; - if (datacollection == null) return null; - - object = datacollection.datasource; - } - - if (object == null) return null; - - let field = object.fieldByID(this.settings.fieldId); - return field; - } - } -}; diff --git a/views/ABViewFormJsonCore.js b/views/ABViewFormJsonCore.js deleted file mode 100644 index 1fa32b2..0000000 --- a/views/ABViewFormJsonCore.js +++ /dev/null @@ -1,38 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormJsonPropertyComponentDefaults = { - type: "string", // 'string', 'systemObject' or 'filter' -}; - -const ABViewFormJsonDefaults = { - key: "json", // {string} unique key for this view - icon: "brackets-curly", // {string} fa-[icon] reference for this view - labelKey: "ab.components.json", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormJsonCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormJsonDefaults - ); - } - - static common() { - return ABViewFormJsonDefaults; - } - - static defaultValues() { - return ABViewFormJsonPropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormNumberCore.js b/views/ABViewFormNumberCore.js deleted file mode 100644 index e889b59..0000000 --- a/views/ABViewFormNumberCore.js +++ /dev/null @@ -1,76 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormNumberPropertyComponentDefaults = { - isStepper: 0, -}; - -const ABViewFormNumberDefaults = { - key: "numberbox", // {string} unique key for this view - icon: "hashtag", // {string} fa-[icon] reference for this view - labelKey: "ab.components.number", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormNumberCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormNumberDefaults - ); - } - - static common() { - return ABViewFormNumberDefaults; - } - - static defaultValues() { - return ABViewFormNumberPropertyComponentDefaults; - } - - /// - /// Instance Methods - /// - - /** - * @method toObj() - * - * properly compile the current state of this ABViewFormText instance - * into the values needed for saving. - * - * @return {json} - */ - toObj() { - this.unTranslate(this, this, ["label", "formLabel"]); - - var obj = super.toObj(); - obj.views = []; // no subviews - return obj; - } - - /** - * @method fromValues() - * - * initialze this object with the given set of values. - * @param {obj} values - */ - fromValues(values) { - super.fromValues(values); - - // if this is being instantiated on a read from the Property UI, - this.settings.isStepper = - this.settings.isStepper || - ABViewFormNumberPropertyComponentDefaults.isStepper; - - // convert from "0" => 0 - this.settings.isStepper = parseInt(this.settings.isStepper); - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormReadonlyCore.js b/views/ABViewFormReadonlyCore.js deleted file mode 100644 index 84b21c7..0000000 --- a/views/ABViewFormReadonlyCore.js +++ /dev/null @@ -1,36 +0,0 @@ -const ABViewFormCustom = require("../../platform/views/ABViewFormCustom"); - -const ABViewFormReadonlyPropertyComponentDefaults = {}; - -const ABViewFormReadonlyDefaults = { - key: "fieldreadonly", // {string} unique key for this view - icon: "calculator", // {string} fa-[icon] reference for this view - labelKey: "ab.components.readonly", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormReadonly extends ABViewFormCustom { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormReadonlyDefaults - ); - } - - static common() { - return ABViewFormReadonlyDefaults; - } - - static defaultValues() { - return ABViewFormReadonlyPropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormSelectMultipleCore.js b/views/ABViewFormSelectMultipleCore.js deleted file mode 100644 index 55268a3..0000000 --- a/views/ABViewFormSelectMultipleCore.js +++ /dev/null @@ -1,38 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormSelectMultiplePropertyComponentDefaults = { - type: "multicombo", // 'richselect' or 'radio' -}; - -const ABSelectMultipleDefaults = { - key: "selectmultiple", // {string} unique key for this view - icon: "list-ul", // {string} fa-[icon] reference for this view - labelKey: "ab.components.selectmultiple", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormSelectMultipleCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABSelectMultipleDefaults - ); - } - - static common() { - return ABSelectMultipleDefaults; - } - - static defaultValues() { - return ABViewFormSelectMultiplePropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormSelectSingleCore.js b/views/ABViewFormSelectSingleCore.js deleted file mode 100644 index 75330a5..0000000 --- a/views/ABViewFormSelectSingleCore.js +++ /dev/null @@ -1,38 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormSelectSinglePropertyComponentDefaults = { - type: "richselect", // 'richselect' or 'radio' -}; - -const ABSelectSingleDefaults = { - key: "selectsingle", // {string} unique key for this view - icon: "list-ul", // {string} fa-[icon] reference for this view - labelKey: "ab.components.selectsingle", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormSelectSingleCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABSelectSingleDefaults - ); - } - - static common() { - return ABSelectSingleDefaults; - } - - static defaultValues() { - return ABViewFormSelectSinglePropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormTextboxCore.js b/views/ABViewFormTextboxCore.js deleted file mode 100644 index be04bd1..0000000 --- a/views/ABViewFormTextboxCore.js +++ /dev/null @@ -1,38 +0,0 @@ -const ABViewFormItem = require("../../platform/views/ABViewFormItem"); - -const ABViewFormTextboxPropertyComponentDefaults = { - type: "single", // 'single', 'multiple' or 'rich' -}; - -const ABViewFormTextboxDefaults = { - key: "textbox", // {string} unique key for this view - icon: "i-cursor", // {string} fa-[icon] reference for this view - labelKey: "ab.components.textbox", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormTextboxCore extends ABViewFormItem { - constructor(values, application, parent, defaultValues) { - super( - values, - application, - parent, - defaultValues || ABViewFormTextboxDefaults - ); - } - - static common() { - return ABViewFormTextboxDefaults; - } - - static defaultValues() { - return ABViewFormTextboxPropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -}; diff --git a/views/ABViewFormTreeCore.js b/views/ABViewFormTreeCore.js deleted file mode 100644 index 3a25183..0000000 --- a/views/ABViewFormTreeCore.js +++ /dev/null @@ -1,31 +0,0 @@ -const ABViewFormCustom = require("../../platform/views/ABViewFormCustom"); - -const ABViewFormTreePropertyComponentDefaults = {}; - -const ABTreeDefaults = { - key: "formtree", // {string} unique key for this view - icon: "sitemap", // {string} fa-[icon] reference for this view - labelKey: "ab.components.tree", // {string} the multilingual label key for the class label -}; - -module.exports = class ABViewFormTreeCore extends ABViewFormCustom { - constructor(values, application, parent, defaultValues) { - super(values, application, parent, defaultValues || ABTreeDefaults); - } - - static common() { - return ABTreeDefaults; - } - - static defaultValues() { - return ABViewFormTreePropertyComponentDefaults; - } - - /** - * @method componentList - * return the list of components available on this view to display in the editor. - */ - componentList() { - return []; - } -};