@scheels-softdev/kendoreact-generics 2.1.6 → 2.1.7

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.
@@ -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;
@@ -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) => e.value && changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), value: selectedId
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
  }
@@ -7,4 +7,5 @@ export declare function CommandCellDDWithoutId<T>(props: {
7
7
  separator?: string;
8
8
  checkEditField?: boolean;
9
9
  isEditing?: boolean;
10
+ showClearButton?: boolean;
10
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -8,4 +8,5 @@ export declare function CommandCellDropdown<T>(props: {
8
8
  checkEditField?: boolean;
9
9
  isEditing?: boolean;
10
10
  idField?: keyof T;
11
+ showClearButton?: boolean;
11
12
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheels-softdev/kendoreact-generics",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",