This commit is contained in:
Conor_Mack 2020-03-30 13:09:36 +01:00
parent 545ebd0cf2
commit c09544923d
7 changed files with 21 additions and 6 deletions

View File

@ -59,6 +59,7 @@
function changed(e) {
const val = e.target.checked
checked = val
handleOnClick()
if (_bb.isBound(_bb.props.checked)) {
_bb.setStateFromBinding(_bb.props.checked, val)
@ -67,7 +68,7 @@
function handleOnClick() {
let item = { _id, checked, label, value }
debugger
if (context === "checkboxgroup") {
let idx = selectedItems.getItemIdx($selectedItems, _id)
if (idx > -1) {

View File

@ -24,6 +24,7 @@
if (_bb.isBound(_bb.props.value)) {
_bb.setStateFromBinding(_bb.props.value, value)
}
debugger
_bb.call(onChange, value)
}, value)
_bb.setContext("BBMD:checkbox:selectedItemsStore", selectedItemsStore)

View File

@ -24,7 +24,7 @@
onMount(() => {
_bb.setContext("BBMD:input:context", "radiobuttongroup")
selectedItemsStore = createItemStore(() => {
value = $selectedItemsStore
value = $selectedItemsStore[0]
if (_bb.isBound(_bb.props.value)) {
_bb.setStateFromBinding(_bb.props.value, value)
}

View File

@ -9,6 +9,7 @@
let instance
export let _bb
export let onChange = value => {}
export let variant = "continuous" //or discrete
export let showTicks = false
export let min = 0

View File

@ -33,7 +33,22 @@
const page = {
props: {
_component: "testcomponents/rootComponent",
_children: [Checkbox],
_children: [
Textfield,
Checkboxgroup,
Radiobutton,
Radiobuttongroup,
Datatable,
CustomersIndexTable,
Icon,
List,
Select,
DatePicker,
IconButton,
Card,
Switch,
Slider,
],
},
}
_appPromise.then(initialise => {

View File

@ -84,7 +84,6 @@ export const props = {
Checkboxgroup: {
_component: "@budibase/materialdesign-components/Checkboxgroup",
label: "Whats your favourite?",
disabled: true,
alignEnd: true,
onChange: selectedItems => console.log(selectedItems),
_children: [
@ -117,7 +116,6 @@ export const props = {
_component: "@budibase/materialdesign-components/Radiobuttongroup",
label: "Preferred method of contact: ",
orientation: "column",
disabled: true,
alignEnd: true,
onChange: selected => console.log("Radiobutton Group", selected),
_children: [

View File

@ -18,7 +18,6 @@
let tfInstance = null
onMount(() => {
debugger
if (!!tf) tfInstance = new MDCTextField(tf)
return () => {
!!tfInstance && tf.tfInstance && tf.tfInstance.destroy()