| 87 | const activeValue = this.state.activeValue; |
| 88 | const configurableProps = ['label', 'value', 'children', 'disabled']; |
| 89 | const formatOptions = (options: any) => { |
| 90 | options.forEach(option => { |
| 91 | if (option.__IS__FLAT__OPTIONS) return; |
| 92 | configurableProps.forEach(prop => { |
| 93 | const value = option[this.parent().props.props[prop] || prop]; |
| 94 | if (value) option[prop] = value; |
| 95 | }); |
| 96 | if (Array.isArray(option.children)) { |
| 97 | formatOptions(option.children); |
| 98 | } |
| 99 | }); |
| 100 | }; |
| 101 | const loadActiveOptions = (options: any, activeOptions: any = []): [] => { |
| 102 | const level = activeOptions.length; |
| 103 | activeOptions[level] = options; |