diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index e2c4044fb6..ae39ce3ee2 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -321,17 +321,44 @@ export default { name: "Form", description: "A component that generates a form from your data.", icon: "ri-file-edit-fill", - properties: { - design: { ...all }, - settings: [{ label: "Model", key: "model", control: ModelSelect }], - }, - _component: "@budibase/standard-components/dataform", - template: { - component: "@budibase/materialdesign-components/Form", - description: "Form for saving a record", - name: "@budibase/materialdesign-components/recordForm", - }, - children: [], + commonProps: {}, + children: [ + { + _component: "@budibase/standard-components/dataform", + name: "Form Basic", + icon: "ri-file-edit-fill", + properties: { + design: { ...all }, + settings: [ + { + label: "Model", + key: "model", + control: ModelSelect, + }, + ], + }, + template: { + component: "@budibase/materialdesign-components/Form", + description: "Form for saving a record", + name: "@budibase/materialdesign-components/recordForm", + }, + }, + { + _component: "@budibase/standard-components/dataformwide", + name: "Form Wide", + icon: "ri-file-edit-fill", + properties: { + design: { ...all }, + settings: [ + { + label: "Model", + key: "model", + control: ModelSelect, + }, + ], + }, + }, + ], }, { name: "Chart", diff --git a/packages/standard-components/components.json b/packages/standard-components/components.json index c4c0246672..8df7756499 100644 --- a/packages/standard-components/components.json +++ b/packages/standard-components/components.json @@ -209,6 +209,13 @@ "model": "models" } }, + "dataformwide": { + "description": "an HTML table that fetches data from a model or view and displays it.", + "data": true, + "props": { + "model": "models" + } + }, "datalist": { "description": "A configurable data list that attaches to your backend models.", "data": true, diff --git a/packages/standard-components/src/DataForm.svelte b/packages/standard-components/src/DataForm.svelte index 1510110ba9..389ce0ecd2 100644 --- a/packages/standard-components/src/DataForm.svelte +++ b/packages/standard-components/src/DataForm.svelte @@ -4,6 +4,12 @@ export let _bb export let model + const TYPE_MAP = { + string: "text", + boolean: "checkbox", + number: "number", + } + let username let password let newModel = { @@ -59,15 +65,23 @@