UNPKG

@guardian/threads

Version:
22 lines 993 B
import { __extends } from "tslib"; import React from 'react'; import AutosizeInput from 'react-input-autosize'; import { InputChip } from './abstract/InputChip'; import styles from '../InputSupper.module.css'; export var getTextChipTestId = function (index) { return "text-chip-" + index; }; var TextChip = /** @class */ (function (_super) { __extends(TextChip, _super); function TextChip() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.onChange = function (e) { _this.props.onUpdate(_this.props.index, e.target.value); }; return _this; } TextChip.prototype.render = function () { return (React.createElement(AutosizeInput, { inputRef: this.setTextInputRef, type: "text", inputClassName: styles.inlineInputChip, value: this.props.value, onChange: this.onChange, onKeyDown: this.onKeyDown })); }; return TextChip; }(InputChip)); export { TextChip }; //# sourceMappingURL=TextChip.js.map