@scheels-softdev/kendoreact-generics 2.1.6 → 2.1.8
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
CHANGED
@@ -5,7 +5,7 @@ changeEvent, // function to call when the selected value changes
|
|
5
5
|
textFields, // array of field names to use for text values
|
6
6
|
separator, // optional separator to use for concatenating text values
|
7
7
|
disabled, // boolean to disable the dropdown
|
8
|
-
idField, title, }: {
|
8
|
+
idField, title, showClearButton, }: {
|
9
9
|
data: T[];
|
10
10
|
selectedId?: number;
|
11
11
|
selectedData?: T;
|
@@ -15,4 +15,5 @@ idField, title, }: {
|
|
15
15
|
idField?: keyof T;
|
16
16
|
disabled?: boolean;
|
17
17
|
title?: string;
|
18
|
+
showClearButton?: boolean;
|
18
19
|
}): import("react/jsx-runtime").JSX.Element;
|
package/GenericDropdown.js
CHANGED
@@ -11,7 +11,7 @@ changeEvent, // function to call when the selected value changes
|
|
11
11
|
textFields, // array of field names to use for text values
|
12
12
|
separator, // optional separator to use for concatenating text values
|
13
13
|
disabled, // boolean to disable the dropdown
|
14
|
-
idField, title, }) {
|
14
|
+
idField, title, showClearButton, }) {
|
15
15
|
if (selectedId !== undefined && selectedData !== undefined) {
|
16
16
|
throw new Error("You cannot provide both selectedData and selectedId to GenericDropdown.");
|
17
17
|
}
|
@@ -68,9 +68,7 @@ idField, title, }) {
|
|
68
68
|
skip: state.skip,
|
69
69
|
}, suggest: true, onPageChange: pageChange, filterable: true, onFilterChange: onFilterChange, popupSettings: {
|
70
70
|
height: "210px",
|
71
|
-
}, onChange: (e) =>
|
71
|
+
}, onChange: (e) => changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), clearButton: showClearButton, value: selectedId
|
72
72
|
? dataList.find((item) => selectedId === item[idField || "id"])
|
73
|
-
: dataList.find((x) => {
|
74
|
-
return JSON.stringify(Object.assign(Object.assign({}, x), selectedData)) === JSON.stringify(Object.assign({}, x));
|
75
|
-
}) }) })));
|
73
|
+
: dataList.find((x) => JSON.stringify(Object.assign(Object.assign({}, x), selectedData)) === JSON.stringify(Object.assign({}, x))) }) })));
|
76
74
|
}
|