UNPKG

rjsf-antd

Version:

Ant Design theme, fields and widgets for react-jsonschema-form

24 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = tslib_1.__importDefault(require("react")); var antd_1 = require("antd"); var TextArea = antd_1.Input.TextArea; var TextareaWidget = function (_a) { var id = _a.id, placeholder = _a.placeholder, value = _a.value, required = _a.required, disabled = _a.disabled, autofocus = _a.autofocus, readonly = _a.readonly, onBlur = _a.onBlur, onFocus = _a.onFocus, onChange = _a.onChange, options = _a.options; var _onChange = function (_a) { var value = _a.target.value; return onChange(value === '' ? options.emptyValue : value); }; var _onBlur = function (_a) { var value = _a.target.value; return onBlur(id, value); }; var _onFocus = function (_a) { var value = _a.target.value; return onFocus(id, value); }; return (react_1.default.createElement(TextArea, { placeholder: placeholder, disabled: disabled || readonly, value: value, required: required, autoFocus: autofocus, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus })); }; exports.default = TextareaWidget; //# sourceMappingURL=TextareaWidget.js.map