sets everything up to be used with a longform type in the Form component

This commit is contained in:
kevmodrome 2020-11-13 11:31:00 +01:00
parent 201e37a2ba
commit 9799a405fd
No known key found for this signature in database
GPG Key ID: 828D8FE4D235B551
3 changed files with 51 additions and 51 deletions

View File

@ -188,25 +188,17 @@ export default {
], ],
}, },
}, },
{ // {
_component: "@budibase/standard-components/richtext", // _component: "@budibase/standard-components/richtext",
name: "Rich Text", // name: "Rich Text",
description: // description:
"A component that allows the user to enter long form text.", // "A component that allows the user to enter long form text.",
icon: "ri-edit-box-line", // icon: "ri-edit-box-line",
properties: { // properties: {
design: { ...all }, // design: { ...all },
settings: [ // settings: [],
{ label: "Label", key: "label", control: Input }, // },
{ // },
label: "Type",
key: "type",
control: OptionSelect,
options: ["text", "password"],
},
],
},
},
{ {
_component: "@budibase/standard-components/datepicker", _component: "@budibase/standard-components/datepicker",
name: "Date Picker", name: "Date Picker",

View File

@ -178,8 +178,6 @@
"name": "Rich Text", "name": "Rich Text",
"description": "A component that allows the user to enter long form text.", "description": "A component that allows the user to enter long form text.",
"props": { "props": {
"label": "string",
"type": "string",
"value": "string" "value": "string"
} }
}, },

View File

@ -1,34 +1,44 @@
<script> <script>
import { RichText } from '@budibase/bbui' import { RichText } from '@budibase/bbui'
export let _bb export let _bb
export let label = "" export let content = ""
export let value = ""
let options = { const updateValue = content => {
"modules": { if (_bb) {
"toolbar": [ _bb.setBinding("value", content)
[ }
{ }
"header": [
1, $: updateValue(content)
2,
3, // Need to determine what options we want to expose.
false
] let options = {
} "modules": {
], "toolbar": [
[ [
"bold", {
"italic", "header": [
"underline", 1,
"strike" 2,
3,
false
]
}
],
[
"bold",
"italic",
"underline",
"strike"
]
] ]
] },
}, "placeholder": "Type something...",
"placeholder": "Type something...", "theme": "snow"
"theme": "snow" }
} </script>
</script>
<RichText {options} /> <RichText bind:content {options} />