forked from tsai/budibase
9 changed files with 84 additions and 39 deletions
@ -0,0 +1,5 @@ |
|||||
|
<script> |
||||
|
import FormFieldSelect from "./FormFieldSelect.svelte" |
||||
|
</script> |
||||
|
|
||||
|
<FormFieldSelect {...$$props} type="longform" /> |
||||
@ -1,29 +0,0 @@ |
|||||
<script> |
|
||||
import { getContext } from "svelte" |
|
||||
import { RichText } from "@budibase/bbui" |
|
||||
|
|
||||
const { styleable } = getContext("sdk") |
|
||||
const component = getContext("component") |
|
||||
|
|
||||
export let value = "" |
|
||||
|
|
||||
// Need to determine what options we want to expose. |
|
||||
let options = { |
|
||||
modules: { |
|
||||
toolbar: [ |
|
||||
[ |
|
||||
{ |
|
||||
header: [1, 2, 3, false], |
|
||||
}, |
|
||||
], |
|
||||
["bold", "italic", "underline", "strike"], |
|
||||
], |
|
||||
}, |
|
||||
placeholder: "Type something...", |
|
||||
theme: "snow", |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<div use:styleable={$component.styles}> |
|
||||
<RichText bind:value {options} /> |
|
||||
</div> |
|
||||
@ -0,0 +1,51 @@ |
|||||
|
<script> |
||||
|
import { RichText } from "@budibase/bbui" |
||||
|
import "@spectrum-css/checkbox/dist/index-vars.css" |
||||
|
import SpectrumField from "./SpectrumField.svelte" |
||||
|
|
||||
|
export let field |
||||
|
export let label |
||||
|
export let placeholder |
||||
|
|
||||
|
let fieldState |
||||
|
let fieldApi |
||||
|
|
||||
|
let value |
||||
|
$: fieldApi?.setValue(value) |
||||
|
|
||||
|
// Options for rich text component |
||||
|
const options = { |
||||
|
modules: { |
||||
|
toolbar: [ |
||||
|
[ |
||||
|
{ |
||||
|
header: [1, 2, 3, false], |
||||
|
}, |
||||
|
], |
||||
|
["bold", "italic", "underline", "strike"], |
||||
|
], |
||||
|
}, |
||||
|
placeholder: placeholder || "Type something...", |
||||
|
theme: "snow", |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<SpectrumField {label} {field} bind:fieldState bind:fieldApi> |
||||
|
{#if fieldState} |
||||
|
<div> |
||||
|
<RichText bind:value {options} /> |
||||
|
</div> |
||||
|
{/if} |
||||
|
</SpectrumField> |
||||
|
|
||||
|
<style> |
||||
|
div { |
||||
|
background-color: white; |
||||
|
} |
||||
|
div :global(.ql-snow.ql-toolbar:after, .ql-snow .ql-toolbar:after) { |
||||
|
display: none; |
||||
|
} |
||||
|
div :global(.ql-snow .ql-formats:after) { |
||||
|
display: none; |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue