1 line
12 KiB
JSON
1 line
12 KiB
JSON
|
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { composeRef } from \"rc-util/es/ref\";\nimport { warning } from \"rc-util/es/warning\";\nvar Input = function Input(props, ref) {\n var _inputNode2;\n var prefixCls = props.prefixCls,\n id = props.id,\n inputElement = props.inputElement,\n disabled = props.disabled,\n tabIndex = props.tabIndex,\n autoFocus = props.autoFocus,\n autoComplete = props.autoComplete,\n editable = props.editable,\n activeDescendantId = props.activeDescendantId,\n value = props.value,\n maxLength = props.maxLength,\n _onKeyDown = props.onKeyDown,\n _onMouseDown = props.onMouseDown,\n _onChange = props.onChange,\n onPaste = props.onPaste,\n _onCompositionStart = props.onCompositionStart,\n _onCompositionEnd = props.onCompositionEnd,\n open = props.open,\n attrs = props.attrs;\n var inputNode = inputElement || /*#__PURE__*/React.createElement(\"input\", null);\n var _inputNode = inputNode,\n originRef = _inputNode.ref,\n originProps = _inputNode.props;\n var onOriginKeyDown = originProps.onKeyDown,\n onOriginChange = originProps.onChange,\n onOriginMouseDown = originProps.onMouseDown,\n onOriginCompositionStart = originProps.onCompositionStart,\n onOriginCompositionEnd = originProps.onCompositionEnd,\n style = originProps.style;\n warning(!('maxLength' in inputNode.props), \"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled.\");\n inputNode = /*#__PURE__*/React.cloneElement(inputNode, _objectSpread(_objectSpread(_objectSpread({\n type: 'search'\n }, originProps), {}, {\n // Override over origin props\n id: id,\n ref: composeRef(ref, originRef),\n disabled: disabled,\n tabIndex: tabIndex,\n autoComplete: autoComplete || 'off',\n autoFocus: autoFocus,\n className: classNames(\"\".concat(prefixCls, \"-selection-search-input\"), (_inputNode2 = inputNode) === null || _inputNode2 === void 0 || (_inputNode2 = _inputNode2.props) === null || _inputNode2 === void 0 ? void 0 : _inputNode2.className),\n role: 'combobox',\n 'aria-expanded': open || false,\n 'aria-haspopup': 'listbox',\n 'aria-owns': \"\".concat(id, \"_list\"),\n 'aria-autocomplete': 'list',\n 'aria-controls': \"\".concat(id, \"_list\"),\n 'aria-activedescendant': open ? activeDescendantId : undefined\n }, attrs), {}, {\n value: editable ? value : '',\n maxLength: maxLength,\n readOnly: !editable,\n unselectable: !editable ? 'on' : null,\n style: _objectSpread(_objectSpread({}, style), {}, {\n opacity: editable ? null : 0\n }),\n onKeyDown: function onKeyDown(event) {\n _onKeyDown(event);\n if (onOriginKeyDown) {\n onOriginKeyDown(event);\n }\n },\n onMouseDown: function onMouseDown(event) {\n _onMouseDown(event);\n if (onOriginMouseDown) {\n onOriginMouseDown(event);\n }\n },\n onChange: function onChange(event) {\n _onChange(event);\n if (onOriginChange) {\n onOriginChange(event);\n }\n },\n onCompositionStart: function onCompositionStart(event) {\n _onCompositionStart(event);\n if (onOriginCompositionStart) {\n onOriginCompositionStart(event);\n }\n },\n onCompositionEnd: function onCompositionEnd(event) {\n _onCompositionEnd(event);\n if (onOriginCompositionEnd) {\n onOriginCompositionEnd(event);\n }\n },\n onPaste: onPaste\n }));\n return inputNode;\n};\nvar RefInput = /*#__PURE__*/React.forwardRef(Input);\nif (process.env.NODE_ENV !== 'production') {\n RefInput.displayName = 'Input';\n}\nexport default RefInput;","map":{"version":3,"names":["_objectSpread","React","classNames","composeRef","warning","Input","props","ref","_inputNode2","prefixCls","id","inputElement","disabled","tabIndex","autoFocus","autoComplete","editable","activeDescendantId","value","maxLength","_onKeyD
|