@scheels-softdev/kendoreact-generics 2.2.10 → 2.3.0
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 +22 -11
- package/GenericDropdown.js +11 -11
- package/package.json +1 -1
package/GenericDropdown.d.ts
CHANGED
@@ -3,29 +3,40 @@ import { CSSProperties } from "react";
|
|
3
3
|
* JSX Component for displaying items in a virtualized combobox
|
4
4
|
* @template T - The type of the data objects in the dropdown.
|
5
5
|
* @param {object} props - The component props.
|
6
|
-
* @prop {T[]} data - Array of data objects.
|
7
|
-
* @prop {number} [selectedId] - ID of the selected data object.
|
8
|
-
* @prop {T} [selectedData] - The selected data object. Use this instead of selectedId if there is no identity key in the object.
|
9
|
-
* @prop {Function} onChange - Function to call when the selected value changes.
|
10
|
-
* @prop {(keyof T)[]} textFields - Array of field names to use for text values.
|
11
|
-
* @prop {string} [separator] - Optional separator to use for concatenating text values.
|
12
|
-
* @prop {boolean} [disabled] - Boolean to disable the dropdown.
|
13
|
-
* @prop {keyof T} [idField] - The field name to use as the identity key. If the id field to look at isn't 'id', what is it?
|
14
|
-
* @prop {string} [title] - The label of the dropdown.
|
15
|
-
* @prop {boolean} [hideClearButton] - Set to true if you want to hide the clear button.
|
16
|
-
* @prop {CSSProperties} [style] - The CSS properties you want to use.
|
6
|
+
* @prop {T[]} data - Array of data objects.
|
7
|
+
* @prop {number} [selectedId] - ID of the selected data object.
|
8
|
+
* @prop {T} [selectedData] - The selected data object. Use this instead of selectedId if there is no identity key in the object.
|
9
|
+
* @prop {Function} onChange - Function to call when the selected value changes.
|
10
|
+
* @prop {(keyof T)[]} textFields - Array of field names to use for text values.
|
11
|
+
* @prop {string} [separator] - Optional separator to use for concatenating text values.
|
12
|
+
* @prop {boolean} [disabled] - Boolean to disable the dropdown.
|
13
|
+
* @prop {keyof T} [idField] - The field name to use as the identity key. If the id field to look at isn't 'id', what is it?
|
14
|
+
* @prop {string} [title] - The label of the dropdown.
|
15
|
+
* @prop {boolean} [hideClearButton] - Set to true if you want to hide the clear button.
|
16
|
+
* @prop {CSSProperties} [style] - The CSS properties you want to use.
|
17
17
|
* @returns {JSX.Element}
|
18
18
|
*/
|
19
19
|
export declare function GenericDropdown<T>({ data, selectedId, selectedData, onChange, textFields, separator, disabled, idField, title, hideClearButton, style, }: {
|
20
|
+
/** The data to populate the dropdown options*/
|
20
21
|
data: T[];
|
22
|
+
/** The ID of the currently selected item.*/
|
21
23
|
selectedId?: number;
|
24
|
+
/** The currently selected data object. */
|
22
25
|
selectedData?: T;
|
26
|
+
/** Callback function triggered when the selected value changes*/
|
23
27
|
onChange: Function;
|
28
|
+
/** The field names used to extract text values for display */
|
24
29
|
textFields: (keyof T)[];
|
30
|
+
/** The separator to use when concatenating multiple text values. */
|
25
31
|
separator?: string;
|
32
|
+
/** Determines whether the dropdown is disabled. */
|
26
33
|
idField?: keyof T;
|
34
|
+
/** The field name used as the identity key */
|
27
35
|
disabled?: boolean;
|
36
|
+
/** The label displayed for the dropdown */
|
28
37
|
title?: string;
|
38
|
+
/** The Determines whether the clear button is hidden from the dropdown. */
|
29
39
|
hideClearButton?: boolean;
|
40
|
+
/** Custom CSS properties for the component. */
|
30
41
|
style?: CSSProperties;
|
31
42
|
}): import("react/jsx-runtime").JSX.Element;
|
package/GenericDropdown.js
CHANGED
@@ -10,17 +10,17 @@ import { getTextValue } from "./Utility";
|
|
10
10
|
* JSX Component for displaying items in a virtualized combobox
|
11
11
|
* @template T - The type of the data objects in the dropdown.
|
12
12
|
* @param {object} props - The component props.
|
13
|
-
* @prop {T[]} data - Array of data objects.
|
14
|
-
* @prop {number} [selectedId] - ID of the selected data object.
|
15
|
-
* @prop {T} [selectedData] - The selected data object. Use this instead of selectedId if there is no identity key in the object.
|
16
|
-
* @prop {Function} onChange - Function to call when the selected value changes.
|
17
|
-
* @prop {(keyof T)[]} textFields - Array of field names to use for text values.
|
18
|
-
* @prop {string} [separator] - Optional separator to use for concatenating text values.
|
19
|
-
* @prop {boolean} [disabled] - Boolean to disable the dropdown.
|
20
|
-
* @prop {keyof T} [idField] - The field name to use as the identity key. If the id field to look at isn't 'id', what is it?
|
21
|
-
* @prop {string} [title] - The label of the dropdown.
|
22
|
-
* @prop {boolean} [hideClearButton] - Set to true if you want to hide the clear button.
|
23
|
-
* @prop {CSSProperties} [style] - The CSS properties you want to use.
|
13
|
+
* @prop {T[]} data - Array of data objects.
|
14
|
+
* @prop {number} [selectedId] - ID of the selected data object.
|
15
|
+
* @prop {T} [selectedData] - The selected data object. Use this instead of selectedId if there is no identity key in the object.
|
16
|
+
* @prop {Function} onChange - Function to call when the selected value changes.
|
17
|
+
* @prop {(keyof T)[]} textFields - Array of field names to use for text values.
|
18
|
+
* @prop {string} [separator] - Optional separator to use for concatenating text values.
|
19
|
+
* @prop {boolean} [disabled] - Boolean to disable the dropdown.
|
20
|
+
* @prop {keyof T} [idField] - The field name to use as the identity key. If the id field to look at isn't 'id', what is it?
|
21
|
+
* @prop {string} [title] - The label of the dropdown.
|
22
|
+
* @prop {boolean} [hideClearButton] - Set to true if you want to hide the clear button.
|
23
|
+
* @prop {CSSProperties} [style] - The CSS properties you want to use.
|
24
24
|
* @returns {JSX.Element}
|
25
25
|
*/
|
26
26
|
export function GenericDropdown({ data, selectedId, selectedData, onChange, textFields, separator, disabled, idField, title, hideClearButton, style, }) {
|