| 59108 | ) |
| 59109 | : null |
| 59110 | } |
| 59111 | class ExamplesSelect extends Re.PureComponent { |
| 59112 | static defaultProps = { |
| 59113 | examples: (0, ze.Map)({}), |
| 59114 | onSelect: (...s) => |
| 59115 | console.log('DEBUG: ExamplesSelect was not given an onSelect callback', ...s), |
| 59116 | currentExampleKey: null, |
| 59117 | showLabels: !0, |
| 59118 | } |
| 59119 | _onSelect = (s, { isSyntheticChange: o = !1 } = {}) => { |
| 59120 | 'function' == typeof this.props.onSelect && |
| 59121 | this.props.onSelect(s, { isSyntheticChange: o }) |
| 59122 | } |
| 59123 | _onDomSelect = (s) => { |
| 59124 | if ('function' == typeof this.props.onSelect) { |
| 59125 | const o = s.target.selectedOptions[0].getAttribute('value') |
| 59126 | this._onSelect(o, { isSyntheticChange: !1 }) |
| 59127 | } |
| 59128 | } |
| 59129 | getCurrentExample = () => { |
| 59130 | const { examples: s, currentExampleKey: o } = this.props, |
| 59131 | i = s.get(o), |
| 59132 | a = s.keySeq().first(), |
| 59133 | u = s.get(a) |
| 59134 | return i || u || (0, ze.Map)({}) |
| 59135 | } |
| 59136 | componentDidMount() { |
| 59137 | const { onSelect: s, examples: o } = this.props |
| 59138 | if ('function' == typeof s) { |
| 59139 | const s = o.first(), |
| 59140 | i = o.keyOf(s) |
| 59141 | this._onSelect(i, { isSyntheticChange: !0 }) |
| 59142 | } |
| 59143 | } |
| 59144 | UNSAFE_componentWillReceiveProps(s) { |
| 59145 | const { currentExampleKey: o, examples: i } = s |
| 59146 | if (i !== this.props.examples && !i.has(o)) { |
| 59147 | const s = i.first(), |
| 59148 | o = i.keyOf(s) |
| 59149 | this._onSelect(o, { isSyntheticChange: !0 }) |
| 59150 | } |
| 59151 | } |
| 59152 | render() { |
| 59153 | const { |
| 59154 | examples: s, |
| 59155 | currentExampleKey: o, |
| 59156 | isValueModified: i, |
| 59157 | isModifiedValueAvailable: a, |
| 59158 | showLabels: u, |
| 59159 | } = this.props |
| 59160 | return Re.createElement( |
| 59161 | 'div', |
| 59162 | { className: 'examples-select' }, |
| 59163 | u |
| 59164 | ? Re.createElement( |
| 59165 | 'span', |
| 59166 | { className: 'examples-select__section-label' }, |
| 59167 | 'Examples: ' |