(opts: TextOptions)
| 23 | return this._cursor; |
| 24 | } |
| 25 | constructor(opts: TextOptions) { |
| 26 | super({ |
| 27 | ...opts, |
| 28 | initialUserInput: opts.initialUserInput ?? opts.initialValue, |
| 29 | }); |
| 30 | |
| 31 | this.on('userInput', (input) => { |
| 32 | this._setValue(input); |
| 33 | }); |
| 34 | this.on('finalize', () => { |
| 35 | if (!this.value) { |
| 36 | this.value = opts.defaultValue; |
| 37 | } |
| 38 | if (this.value === undefined) { |
| 39 | this.value = ''; |
| 40 | } |
| 41 | }); |
| 42 | } |
| 43 | } |