1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.TextInputGroupMain = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const React = tslib_1.__importStar(require("react"));
|
6 | const text_input_group_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/TextInputGroup/text-input-group"));
|
7 | const react_styles_1 = require("@patternfly/react-styles");
|
8 | const TextInputGroup_1 = require("./TextInputGroup");
|
9 | const TextInputGroupMain = (_a) => {
|
10 | var { children, className, icon, type = 'text', hint, onChange = () => undefined, onFocus, onBlur, 'aria-label': ariaLabel = 'Type to filter', value: inputValue, placeholder: inputPlaceHolder } = _a, props = tslib_1.__rest(_a, ["children", "className", "icon", "type", "hint", "onChange", "onFocus", "onBlur", 'aria-label', "value", "placeholder"]);
|
11 | const { isDisabled } = React.useContext(TextInputGroup_1.TextInputGroupContext);
|
12 | const handleChange = (event) => {
|
13 | onChange(event.currentTarget.value, event);
|
14 | };
|
15 | return (React.createElement("div", Object.assign({ className: react_styles_1.css(text_input_group_1.default.textInputGroupMain, icon && text_input_group_1.default.modifiers.icon, className) }, props),
|
16 | children,
|
17 | React.createElement("span", { className: react_styles_1.css(text_input_group_1.default.textInputGroupText) },
|
18 | hint && (React.createElement("input", { className: react_styles_1.css(text_input_group_1.default.textInputGroupTextInput, text_input_group_1.default.modifiers.hint), type: "text", disabled: true, "aria-hidden": "true", value: hint })),
|
19 | icon && React.createElement("span", { className: react_styles_1.css(text_input_group_1.default.textInputGroupIcon) }, icon),
|
20 | React.createElement("input", { type: type, className: react_styles_1.css(text_input_group_1.default.textInputGroupTextInput), "aria-label": ariaLabel, disabled: isDisabled, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, value: inputValue || '', placeholder: inputPlaceHolder }))));
|
21 | };
|
22 | exports.TextInputGroupMain = TextInputGroupMain;
|
23 | exports.TextInputGroupMain.displayName = 'TextInputGroupMain';
|
24 |
|
\ | No newline at end of file |