UNPKG

react-widgets-up

Version:

An à la carte set of polished, extensible, and accessible inputs built for React

27 lines 1.25 kB
const _excluded = ["disabled", "readOnly"]; function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } import * as React from 'react'; const MultiselectInput = /*#__PURE__*/React.forwardRef((_ref, ref) => { let { disabled, readOnly } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded); let size = Math.max(String(props.value || props.placeholder || '').length, 1) + 1; return /*#__PURE__*/React.createElement("input", _extends({ spellCheck: "false", autoCapitalize: "off" }, props, { size: size, ref: ref, autoComplete: "off", className: "rw-multiselect-input", "aria-disabled": disabled, "aria-readonly": readOnly, disabled: disabled, readOnly: readOnly })); }); MultiselectInput.displayName = 'MultiselectInput'; export default MultiselectInput;