(props)
| 13 | static displayName = "Check Box" |
| 14 | |
| 15 | constructor(props) { |
| 16 | super(props) |
| 17 | |
| 18 | // const {layout, ...newAttrs} = this.state.attrs // Removes the layout attribute |
| 19 | |
| 20 | let newAttrs = removeKeyFromObject("layout", this.state.attrs) |
| 21 | |
| 22 | this.minSize = {width: 50, height: 30} |
| 23 | |
| 24 | this.state = { |
| 25 | ...this.state, |
| 26 | size: { width: 120, height: 30 }, |
| 27 | widgetName: "Check box", |
| 28 | attrs: { |
| 29 | ...newAttrs, |
| 30 | styling: { |
| 31 | ...newAttrs.styling, |
| 32 | foregroundColor: { |
| 33 | label: "Foreground Color", |
| 34 | tool: Tools.COLOR_PICKER, // the tool to display, can be either HTML ELement or a constant string |
| 35 | value: "#000", |
| 36 | onChange: (value) => { |
| 37 | this.setWidgetInnerStyle("color", value) |
| 38 | this.setAttrValue("styling.foregroundColor", value) |
| 39 | } |
| 40 | } |
| 41 | }, |
| 42 | checkLabel: { |
| 43 | label: "Check Label", |
| 44 | tool: Tools.INPUT, // the tool to display, can be either HTML ELement or a constant string |
| 45 | toolProps: {placeholder: "Button label", maxLength: 100}, |
| 46 | value: "Checkbox", |
| 47 | onChange: (value) => this.setAttrValue("checkLabel", value) |
| 48 | }, |
| 49 | defaultChecked: { |
| 50 | label: "Checked", |
| 51 | tool: Tools.CHECK_BUTTON, // the tool to display, can be either HTML ELement or a constant string |
| 52 | value: true, |
| 53 | onChange: (value) => this.setAttrValue("defaultChecked", value) |
| 54 | } |
| 55 | |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | componentDidMount(){ |
| 61 | super.componentDidMount() |
nothing calls this directly
no test coverage detected