| | |
| | | import { Input } from 'antd' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | |
| | | if (_value) { |
| | | try { |
| | | _value = window.decodeURIComponent(window.atob(_value)) |
| | | } catch { |
| | | } catch (e) { |
| | | _value = config.initval |
| | | } |
| | | } |
| | |
| | | this.inputRef.current.focus() |
| | | } else if (type === 'input') { |
| | | this.setState({value}) |
| | | this.props.onChange(value, true) |
| | | } |
| | | } |
| | | |
| | |
| | | if (encryption === 'true') { |
| | | try { |
| | | _val = window.btoa(window.encodeURIComponent(_val)) |
| | | } catch { |
| | | } catch (e) { |
| | | _val = val |
| | | } |
| | | } |
| | |
| | | const { value } = this.state |
| | | |
| | | return ( |
| | | <TextArea ref={this.inputRef} value={value} autoSize={{ minRows: 2, maxRows: config.maxRows || 6 }} onChange={this.onChange} disabled={config.readonly} /> |
| | | <TextArea ref={this.inputRef} placeholder={config.placeholder || ''} value={value} autoSize={{ minRows: 2, maxRows: config.maxRows || 6 }} onChange={this.onChange} disabled={config.readonly} /> |
| | | ) |
| | | } |
| | | } |