1 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
2 | import _extends from "@babel/runtime/helpers/esm/extends";
|
3 | var _excluded = ["bsPrefix", "size", "hasValidation", "className", "as"];
|
4 | import classNames from 'classnames';
|
5 | import React from 'react';
|
6 | import createWithBsPrefix from './createWithBsPrefix';
|
7 | import { useBootstrapPrefix } from './ThemeProvider';
|
8 | var InputGroupAppend = createWithBsPrefix('input-group-append');
|
9 | var InputGroupPrepend = createWithBsPrefix('input-group-prepend');
|
10 | var InputGroupText = createWithBsPrefix('input-group-text', {
|
11 | Component: 'span'
|
12 | });
|
13 |
|
14 | var InputGroupCheckbox = function InputGroupCheckbox(props) {
|
15 | return React.createElement(InputGroupText, null, React.createElement("input", _extends({
|
16 | type: "checkbox"
|
17 | }, props)));
|
18 | };
|
19 |
|
20 | var InputGroupRadio = function InputGroupRadio(props) {
|
21 | return React.createElement(InputGroupText, null, React.createElement("input", _extends({
|
22 | type: "radio"
|
23 | }, props)));
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | var InputGroup = React.forwardRef(function (_ref, ref) {
|
35 | var bsPrefix = _ref.bsPrefix,
|
36 | size = _ref.size,
|
37 | hasValidation = _ref.hasValidation,
|
38 | className = _ref.className,
|
39 | _ref$as = _ref.as,
|
40 | Component = _ref$as === void 0 ? 'div' : _ref$as,
|
41 | props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
42 |
|
43 | bsPrefix = useBootstrapPrefix(bsPrefix, 'input-group');
|
44 | return React.createElement(Component, _extends({
|
45 | ref: ref
|
46 | }, props, {
|
47 | className: classNames(className, bsPrefix, size && bsPrefix + "-" + size, hasValidation && 'has-validation')
|
48 | }));
|
49 | });
|
50 | InputGroup.displayName = 'InputGroup';
|
51 | InputGroup.Text = InputGroupText;
|
52 | InputGroup.Radio = InputGroupRadio;
|
53 | InputGroup.Checkbox = InputGroupCheckbox;
|
54 | InputGroup.Append = InputGroupAppend;
|
55 | InputGroup.Prepend = InputGroupPrepend;
|
56 | export default InputGroup; |
\ | No newline at end of file |