(props)
| 11 | static displayName = "Spin Box" |
| 12 | |
| 13 | constructor(props) { |
| 14 | super(props) |
| 15 | |
| 16 | this.state = { |
| 17 | ...this.state, |
| 18 | size: { width: 70, height: 'fit' }, |
| 19 | widgetName: "Spin box", |
| 20 | attrs: { |
| 21 | ...this.state.attrs, |
| 22 | spinProps: { |
| 23 | label: "Properties", |
| 24 | display: "horizontal", |
| 25 | min: { |
| 26 | label: "Min", |
| 27 | tool: Tools.NUMBER_INPUT, // the tool to display, can be either HTML ELement or a constant string |
| 28 | toolProps: { placeholder: "min" }, |
| 29 | value: 0, |
| 30 | onChange: (value) => this.setAttrValue("spinProps.min", value) |
| 31 | }, |
| 32 | max: { |
| 33 | label: "Max", |
| 34 | tool: Tools.NUMBER_INPUT, |
| 35 | toolProps: { placeholder: "max"}, |
| 36 | value: 100, |
| 37 | onChange: (value) => this.setAttrValue("spinProps.max", value) |
| 38 | }, |
| 39 | step: { |
| 40 | label: "Step", |
| 41 | tool: Tools.NUMBER_INPUT, |
| 42 | toolProps: { placeholder: "max", stringMode: true, step: "0.1"}, |
| 43 | value: 1, |
| 44 | onChange: (value) => this.setAttrValue("spinProps.step", value) |
| 45 | }, |
| 46 | default: { |
| 47 | label: "Default", |
| 48 | tool: Tools.NUMBER_INPUT, |
| 49 | toolProps: { placeholder: "max", stringMode: true, step: "0.1"}, |
| 50 | value: 0, |
| 51 | onChange: (value) => this.setAttrValue("spinProps.default", value) |
| 52 | } |
| 53 | }, |
| 54 | |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | componentDidMount(){ |
| 60 | super.componentDidMount() |
nothing calls this directly
no outgoing calls
no test coverage detected