@scheels-softdev/kendoreact-generics 3.0.3 → 3.0.4
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/GenericDropdown.d.ts +2 -1
- package/GenericDropdown.js +2 -2
- package/package.json +1 -1
package/GenericDropdown.d.ts
CHANGED
@@ -9,6 +9,7 @@ type GenericDDProps<T> = {
|
|
9
9
|
style?: React.CSSProperties;
|
10
10
|
isLoading?: boolean;
|
11
11
|
title?: string;
|
12
|
+
maxMenuHeight?: number;
|
12
13
|
};
|
13
|
-
export declare function GenericDropdown<T extends Record<string, any>>({ data, selectedId, selectedData, onChange, textField, idField, style, isLoading, title, }: GenericDDProps<T>): import("react/jsx-runtime").JSX.Element;
|
14
|
+
export declare function GenericDropdown<T extends Record<string, any>>({ data, selectedId, selectedData, onChange, textField, idField, style, isLoading, title, maxMenuHeight, }: GenericDDProps<T>): import("react/jsx-runtime").JSX.Element;
|
14
15
|
export {};
|
package/GenericDropdown.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import Select from "react-select";
|
3
|
-
export function GenericDropdown({ data, selectedId, selectedData, onChange, textField, idField, style, isLoading, title, }) {
|
3
|
+
export function GenericDropdown({ data, selectedId, selectedData, onChange, textField, idField, style, isLoading, title, maxMenuHeight, }) {
|
4
4
|
const options = data.map((item) => ({
|
5
5
|
value: item,
|
6
6
|
label: item[textField].toString(),
|
@@ -17,5 +17,5 @@ export function GenericDropdown({ data, selectedId, selectedData, onChange, text
|
|
17
17
|
onChange(null);
|
18
18
|
}
|
19
19
|
};
|
20
|
-
return (_jsx(Select, { options: options, onChange: handleChange, value: selectedOption, isLoading: isLoading, isDisabled: isLoading, styles: { control: (base) => (Object.assign(Object.assign(Object.assign({}, base), { minHeight: "45px", maxHeight: "45px" }), style)) }, placeholder: title || "Select an option" }));
|
20
|
+
return (_jsx(Select, { options: options, onChange: handleChange, value: selectedOption, isLoading: isLoading, isDisabled: isLoading, maxMenuHeight: 300 || maxMenuHeight, styles: { control: (base) => (Object.assign(Object.assign(Object.assign({}, base), { zIndex: 100, minHeight: "45px", maxHeight: "45px" }), style)) }, placeholder: title || "Select an option" }));
|
21
21
|
}
|