Tidyup
This commit is contained in:
parent
545ebd0cf2
commit
c09544923d
|
@ -59,6 +59,7 @@
|
||||||
function changed(e) {
|
function changed(e) {
|
||||||
const val = e.target.checked
|
const val = e.target.checked
|
||||||
checked = val
|
checked = val
|
||||||
|
|
||||||
handleOnClick()
|
handleOnClick()
|
||||||
if (_bb.isBound(_bb.props.checked)) {
|
if (_bb.isBound(_bb.props.checked)) {
|
||||||
_bb.setStateFromBinding(_bb.props.checked, val)
|
_bb.setStateFromBinding(_bb.props.checked, val)
|
||||||
|
@ -67,7 +68,7 @@
|
||||||
|
|
||||||
function handleOnClick() {
|
function handleOnClick() {
|
||||||
let item = { _id, checked, label, value }
|
let item = { _id, checked, label, value }
|
||||||
|
debugger
|
||||||
if (context === "checkboxgroup") {
|
if (context === "checkboxgroup") {
|
||||||
let idx = selectedItems.getItemIdx($selectedItems, _id)
|
let idx = selectedItems.getItemIdx($selectedItems, _id)
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
if (_bb.isBound(_bb.props.value)) {
|
if (_bb.isBound(_bb.props.value)) {
|
||||||
_bb.setStateFromBinding(_bb.props.value, value)
|
_bb.setStateFromBinding(_bb.props.value, value)
|
||||||
}
|
}
|
||||||
|
debugger
|
||||||
_bb.call(onChange, value)
|
_bb.call(onChange, value)
|
||||||
}, value)
|
}, value)
|
||||||
_bb.setContext("BBMD:checkbox:selectedItemsStore", selectedItemsStore)
|
_bb.setContext("BBMD:checkbox:selectedItemsStore", selectedItemsStore)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
_bb.setContext("BBMD:input:context", "radiobuttongroup")
|
_bb.setContext("BBMD:input:context", "radiobuttongroup")
|
||||||
selectedItemsStore = createItemStore(() => {
|
selectedItemsStore = createItemStore(() => {
|
||||||
value = $selectedItemsStore
|
value = $selectedItemsStore[0]
|
||||||
if (_bb.isBound(_bb.props.value)) {
|
if (_bb.isBound(_bb.props.value)) {
|
||||||
_bb.setStateFromBinding(_bb.props.value, value)
|
_bb.setStateFromBinding(_bb.props.value, value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
let instance
|
let instance
|
||||||
|
|
||||||
export let _bb
|
export let _bb
|
||||||
|
export let onChange = value => {}
|
||||||
export let variant = "continuous" //or discrete
|
export let variant = "continuous" //or discrete
|
||||||
export let showTicks = false
|
export let showTicks = false
|
||||||
export let min = 0
|
export let min = 0
|
||||||
|
|
|
@ -33,7 +33,22 @@
|
||||||
const page = {
|
const page = {
|
||||||
props: {
|
props: {
|
||||||
_component: "testcomponents/rootComponent",
|
_component: "testcomponents/rootComponent",
|
||||||
_children: [Checkbox],
|
_children: [
|
||||||
|
Textfield,
|
||||||
|
Checkboxgroup,
|
||||||
|
Radiobutton,
|
||||||
|
Radiobuttongroup,
|
||||||
|
Datatable,
|
||||||
|
CustomersIndexTable,
|
||||||
|
Icon,
|
||||||
|
List,
|
||||||
|
Select,
|
||||||
|
DatePicker,
|
||||||
|
IconButton,
|
||||||
|
Card,
|
||||||
|
Switch,
|
||||||
|
Slider,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_appPromise.then(initialise => {
|
_appPromise.then(initialise => {
|
||||||
|
|
|
@ -84,7 +84,6 @@ export const props = {
|
||||||
Checkboxgroup: {
|
Checkboxgroup: {
|
||||||
_component: "@budibase/materialdesign-components/Checkboxgroup",
|
_component: "@budibase/materialdesign-components/Checkboxgroup",
|
||||||
label: "Whats your favourite?",
|
label: "Whats your favourite?",
|
||||||
disabled: true,
|
|
||||||
alignEnd: true,
|
alignEnd: true,
|
||||||
onChange: selectedItems => console.log(selectedItems),
|
onChange: selectedItems => console.log(selectedItems),
|
||||||
_children: [
|
_children: [
|
||||||
|
@ -117,7 +116,6 @@ export const props = {
|
||||||
_component: "@budibase/materialdesign-components/Radiobuttongroup",
|
_component: "@budibase/materialdesign-components/Radiobuttongroup",
|
||||||
label: "Preferred method of contact: ",
|
label: "Preferred method of contact: ",
|
||||||
orientation: "column",
|
orientation: "column",
|
||||||
disabled: true,
|
|
||||||
alignEnd: true,
|
alignEnd: true,
|
||||||
onChange: selected => console.log("Radiobutton Group", selected),
|
onChange: selected => console.log("Radiobutton Group", selected),
|
||||||
_children: [
|
_children: [
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
let tfInstance = null
|
let tfInstance = null
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
debugger
|
|
||||||
if (!!tf) tfInstance = new MDCTextField(tf)
|
if (!!tf) tfInstance = new MDCTextField(tf)
|
||||||
return () => {
|
return () => {
|
||||||
!!tfInstance && tf.tfInstance && tf.tfInstance.destroy()
|
!!tfInstance && tf.tfInstance && tf.tfInstance.destroy()
|
||||||
|
|
Loading…
Reference in New Issue