UNPKG

rjsf-antd

Version:

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

20 lines 976 B
import React from 'react'; import { Input } from 'antd'; var PasswordWidget = function (_a) { var id = _a.id, required = _a.required, readonly = _a.readonly, disabled = _a.disabled, value = _a.value, onFocus = _a.onFocus, onBlur = _a.onBlur, onChange = _a.onChange, options = _a.options, autofocus = _a.autofocus; 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.createElement(Input, { autoFocus: autofocus, required: required, disabled: disabled || readonly, type: "password", value: value, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange })); }; export default PasswordWidget; //# sourceMappingURL=PasswordWidget.js.map