1 | import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2 | import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3 | var _excluded = ["className", "isInvalid", "isValid", "size"];
|
4 |
|
5 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
6 |
|
7 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
8 |
|
9 | import cx from 'classnames';
|
10 | import { isSizeLarge, isSizeSmall } from './size';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export default function propsWithBsClassName(_ref) {
|
17 | var className = _ref.className,
|
18 | isInvalid = _ref.isInvalid,
|
19 | isValid = _ref.isValid,
|
20 | size = _ref.size,
|
21 | props = _objectWithoutProperties(_ref, _excluded);
|
22 |
|
23 | return _objectSpread(_objectSpread({}, props), {}, {
|
24 | className: cx('form-control', 'rbt-input', {
|
25 | 'form-control-lg': isSizeLarge(size),
|
26 | 'form-control-sm': isSizeSmall(size),
|
27 | 'is-invalid': isInvalid,
|
28 | 'is-valid': isValid
|
29 | }, className)
|
30 | });
|
31 | } |
\ | No newline at end of file |