@indico-data/design-system 1.0.43 → 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.esm.js
CHANGED
|
@@ -12324,12 +12324,12 @@ const StyledSearchField = styled.div `
|
|
|
12324
12324
|
|
|
12325
12325
|
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
12326
12326
|
const SearchInput = (props) => {
|
|
12327
|
-
const { border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
12328
|
-
const
|
|
12329
|
-
return (React.createElement(StyledSearchField, { className: className, border: border, showSearchIcon: showSearchIcon, showClearInputIcon: showClearInputIcon, "data-cy": props['data-cy']
|
|
12330
|
-
showSearchIcon && (React.createElement("label", { htmlFor:
|
|
12327
|
+
const { id, border, showSearchIcon, showClearInputIcon, className, inputProps, onChange, onClear, onKeyUp, placeholder, value, } = props;
|
|
12328
|
+
const getId = id ? id : v4();
|
|
12329
|
+
return (React.createElement(StyledSearchField, { className: className, border: border, showSearchIcon: showSearchIcon, showClearInputIcon: showClearInputIcon, "data-cy": props['data-cy'] },
|
|
12330
|
+
showSearchIcon && (React.createElement("label", { htmlFor: getId },
|
|
12331
12331
|
React.createElement(Icon, { name: "fa-search", ariaLabel: "search" }))),
|
|
12332
|
-
React.createElement("input", Object.assign({ type: "search", id:
|
|
12332
|
+
React.createElement("input", Object.assign({ "data-testid": props['data-testid'], type: "search", id: getId, placeholder: placeholder, value: value, onChange: onChange, onKeyUp: onKeyUp }, inputProps)),
|
|
12333
12333
|
showClearInputIcon && (React.createElement(Icon, { name: "x-close", ariaLabel: "clear input", className: "clear-input", onClick: onClear }))));
|
|
12334
12334
|
};
|
|
12335
12335
|
SearchInput.defaultProps = {
|