| 36831 | }) |
| 36832 | } |
| 36833 | } |
| 36834 | class JsonSchema_array extends Re.PureComponent { |
| 36835 | static defaultProps = ss |
| 36836 | constructor(s, o) { |
| 36837 | ;(super(s, o), (this.state = { value: valueOrEmptyList(s.value), schema: s.schema })) |
| 36838 | } |
| 36839 | UNSAFE_componentWillReceiveProps(s) { |
| 36840 | const o = valueOrEmptyList(s.value) |
| 36841 | ;(o !== this.state.value && this.setState({ value: o }), |
| 36842 | s.schema !== this.state.schema && this.setState({ schema: s.schema })) |
| 36843 | } |
| 36844 | onChange = () => { |
| 36845 | this.props.onChange(this.state.value) |
| 36846 | } |
| 36847 | onItemChange = (s, o) => { |
| 36848 | this.setState(({ value: i }) => ({ value: i.set(o, s) }), this.onChange) |
| 36849 | } |
| 36850 | removeItem = (s) => { |
| 36851 | this.setState(({ value: o }) => ({ value: o.delete(s) }), this.onChange) |
| 36852 | } |
| 36853 | addItem = () => { |
| 36854 | const { fn: s } = this.props |
| 36855 | let o = valueOrEmptyList(this.state.value) |
| 36856 | this.setState( |
| 36857 | () => ({ |
| 36858 | value: o.push( |
| 36859 | s.getSampleSchema(this.state.schema.get('items'), !1, { includeWriteOnly: !0 }) |
| 36860 | ), |
| 36861 | }), |
| 36862 | this.onChange |
| 36863 | ) |
| 36864 | } |
| 36865 | onEnumChange = (s) => { |
| 36866 | this.setState(() => ({ value: s }), this.onChange) |
| 36867 | } |
| 36868 | render() { |
| 36869 | let { |
| 36870 | getComponent: s, |
| 36871 | required: o, |
| 36872 | schema: i, |
| 36873 | errors: a, |
| 36874 | fn: u, |
| 36875 | disabled: _, |
| 36876 | } = this.props |
| 36877 | a = a.toJS ? a.toJS() : Array.isArray(a) ? a : [] |
| 36878 | const w = a.filter((s) => 'string' == typeof s), |
| 36879 | x = a.filter((s) => void 0 !== s.needRemove).map((s) => s.error), |
| 36880 | C = this.state.value, |
| 36881 | j = !!(C && C.count && C.count() > 0), |
| 36882 | L = i.getIn(['items', 'enum']), |
| 36883 | B = i.get('items'), |
| 36884 | $ = u.getSchemaObjectType(B), |
| 36885 | U = u.getSchemaObjectTypeLabel(B), |
| 36886 | V = i.getIn(['items', 'format']), |
| 36887 | z = i.get('items') |
| 36888 | let Y, |
| 36889 | Z = !1, |
| 36890 | ee = 'file' === $ || ('string' === $ && 'binary' === V) |
nothing calls this directly
no test coverage detected