@indico-data/design-system 1.0.44 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -12332,12 +12332,12 @@ const StyledSearchField = styled__default.default.div `
|
|
|
12332
12332
|
|
|
12333
12333
|
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
12334
12334
|
const SearchInput = (props) => {
|
|
12335
|
-
const { border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
12336
|
-
const
|
|
12337
|
-
return (React__default.default.createElement(StyledSearchField, { className: className, border: border, showSearchIcon: showSearchIcon, showClearInputIcon: showClearInputIcon, "data-cy": props['data-cy']
|
|
12338
|
-
showSearchIcon && (React__default.default.createElement("label", { htmlFor:
|
|
12335
|
+
const { id, border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
12336
|
+
const getId = id ? id : v4();
|
|
12337
|
+
return (React__default.default.createElement(StyledSearchField, { className: className, border: border, showSearchIcon: showSearchIcon, showClearInputIcon: showClearInputIcon, "data-cy": props['data-cy'] },
|
|
12338
|
+
showSearchIcon && (React__default.default.createElement("label", { htmlFor: getId },
|
|
12339
12339
|
React__default.default.createElement(Icon, { name: "fa-search", ariaLabel: "search" }))),
|
|
12340
|
-
React__default.default.createElement("input", Object.assign({ type: "search", id:
|
|
12340
|
+
React__default.default.createElement("input", Object.assign({ "data-testid": props['data-testid'], type: "search", id: getId, placeholder: placeholder, value: value, onChange: onChange, onKeyUp: onKeyUp }, inputProps)),
|
|
12341
12341
|
showClearInputIcon && (React__default.default.createElement(Icon, { name: "x-close", ariaLabel: "clear input", className: "clear-input", onClick: onClear }))));
|
|
12342
12342
|
};
|
|
12343
12343
|
SearchInput.defaultProps = {
|