@festo-ui/react 9.0.0-dev.696 → 9.0.0-dev.703
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/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export { default as Tooltip } from "./lib/components/popovers/tooltip/Tooltip";
|
|
|
37
37
|
export type { TooltipProps } from "./lib/components/popovers/tooltip/Tooltip";
|
|
38
38
|
export { default as Progress } from "./lib/components/progress/Progress";
|
|
39
39
|
export { default as SearchInput } from "./lib/components/search-input/SearchInput";
|
|
40
|
+
export type { SearchInputProps } from "./lib/components/search-input/SearchInput";
|
|
40
41
|
export { default as SearchSuggestion } from "./lib/components/search-input/SearchSuggestion";
|
|
41
42
|
export { default as Snackbar } from "./lib/components/snackbar/Snackbar";
|
|
42
43
|
export { default as SnackbarProvider, addSnackbar, } from "./lib/components/snackbar/SnackbarProvider";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./SearchInput.scss";
|
|
2
2
|
import SearchSuggestion from "./SearchSuggestion";
|
|
3
|
-
interface SearchInputProps {
|
|
3
|
+
export interface SearchInputProps {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
label?: string;
|
|
6
6
|
defaultValue?: string;
|
|
@@ -9,6 +9,7 @@ interface SearchInputProps {
|
|
|
9
9
|
onChange?: (value: string) => void;
|
|
10
10
|
onKeyboardNavigate?: (value: string) => void;
|
|
11
11
|
onSearch?: (value: string) => void;
|
|
12
|
+
className?: string;
|
|
12
13
|
}
|
|
13
|
-
declare function SearchInput({ defaultValue, disabled, label, value, suggestions, onChange, onSearch, onKeyboardNavigate, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SearchInput({ defaultValue, disabled, label, value, suggestions, onChange, onSearch, onKeyboardNavigate, className, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default SearchInput;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
2
3
|
import useSearchInput from "./useSearchInput.js";
|
|
3
4
|
import useOnClickOutside from "../../helper/useOnClickOutside.js";
|
|
4
5
|
import ClearButton from "./ClearButton.js";
|
|
@@ -12,7 +13,8 @@ function SearchInput(_ref) {
|
|
|
12
13
|
suggestions,
|
|
13
14
|
onChange,
|
|
14
15
|
onSearch,
|
|
15
|
-
onKeyboardNavigate
|
|
16
|
+
onKeyboardNavigate,
|
|
17
|
+
className
|
|
16
18
|
} = _ref;
|
|
17
19
|
const inputRef = useRef(null);
|
|
18
20
|
const containerRef = useRef(null);
|
|
@@ -30,7 +32,7 @@ function SearchInput(_ref) {
|
|
|
30
32
|
} = useSearchInput(inputRef, cappedSuggestions, value, defaultValue, onChange, onSearch, onKeyboardNavigate);
|
|
31
33
|
useOnClickOutside(containerRef, handleOutsideClick);
|
|
32
34
|
return /*#__PURE__*/_jsxs("div", {
|
|
33
|
-
className: "fwe-search-input",
|
|
35
|
+
className: classNames("fwe-search-input", className),
|
|
34
36
|
ref: containerRef,
|
|
35
37
|
children: [/*#__PURE__*/_jsx("input", {
|
|
36
38
|
ref: inputRef,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
9
|
var _useSearchInput = _interopRequireDefault(require("./useSearchInput.js"));
|
|
9
10
|
var _useOnClickOutside = _interopRequireDefault(require("../../helper/useOnClickOutside.js"));
|
|
10
11
|
var _ClearButton = _interopRequireDefault(require("./ClearButton.js"));
|
|
@@ -19,7 +20,8 @@ function SearchInput(_ref) {
|
|
|
19
20
|
suggestions,
|
|
20
21
|
onChange,
|
|
21
22
|
onSearch,
|
|
22
|
-
onKeyboardNavigate
|
|
23
|
+
onKeyboardNavigate,
|
|
24
|
+
className
|
|
23
25
|
} = _ref;
|
|
24
26
|
const inputRef = (0, _react.useRef)(null);
|
|
25
27
|
const containerRef = (0, _react.useRef)(null);
|
|
@@ -37,7 +39,7 @@ function SearchInput(_ref) {
|
|
|
37
39
|
} = (0, _useSearchInput.default)(inputRef, cappedSuggestions, value, defaultValue, onChange, onSearch, onKeyboardNavigate);
|
|
38
40
|
(0, _useOnClickOutside.default)(containerRef, handleOutsideClick);
|
|
39
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
|
-
className: "fwe-search-input",
|
|
42
|
+
className: (0, _classnames.default)("fwe-search-input", className),
|
|
41
43
|
ref: containerRef,
|
|
42
44
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
43
45
|
ref: inputRef,
|
package/package.json
CHANGED