@scheels-softdev/kendoreact-generics 2.1.19 → 2.2.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.
@@ -77,5 +77,5 @@ idField, title, showClearButton, }) {
77
77
  skip: state.skip,
78
78
  }, suggest: true, onPageChange: pageChange, filterable: true, onFilterChange: onFilterChange, popupSettings: {
79
79
  height: "210px",
80
- }, onChange: (e) => changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), clearButton: showClearButton, value: findByIndex(selectedId, idField, dataList) || findByValue(selectedData, dataList) || null }) })));
80
+ }, onChange: (e) => changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), clearButton: showClearButton, value: !selectedId && !selectedData ? null : findByIndex(selectedId, idField, dataList) || findByValue(selectedData, dataList) || null }) })));
81
81
  }
package/README.md CHANGED
@@ -31,12 +31,14 @@ Note: This package has only been tested with typescript. if you're using javascr
31
31
 
32
32
  data: T[];
33
33
  selectedId: number;
34
+ selectedData?: T;
34
35
  changeEvent: Function;
35
36
  textFields: (keyof T)[];
36
37
  separator?: string;
37
38
  idField?: keyof T;
38
39
  disabled?: boolean;
39
40
  title?: string;
41
+ showClearButton?: boolean;
40
42
 
41
43
  #### data
42
44
 
@@ -48,7 +50,11 @@ Note: This package has only been tested with typescript. if you're using javascr
48
50
 
49
51
  #### selectedId
50
52
 
51
- - The id of the item selected. By default the dropdown will assume your item has an "id" property. if it doesn't, see optional parameters
53
+ - The id of the item selected. By default the dropdown will assume your item has an "id" property. if it doesn't have an Id but has a unique identifier, see optional keys (idField)
54
+
55
+ #### selectedData
56
+
57
+ - The item selected. the dropdown will compare this object to the list of objects you gave it for the data prop to try to find the right index
52
58
 
53
59
  #### textFields
54
60
 
@@ -74,6 +80,10 @@ Note: This package has only been tested with typescript. if you're using javascr
74
80
  - The label that appears in your multiselect when there aren't any options selected, or just above the multiselect when there are
75
81
  - For example, if we want to use it to send a letter to an employee, we would pass "Selected Employee" here
76
82
 
83
+ #### showClearButton (optional)
84
+
85
+ - A boolean indicating whether the clear button should show up or not
86
+
77
87
  ---
78
88
 
79
89
  ## MultiSelect Dropdown
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheels-softdev/kendoreact-generics",
3
- "version": "2.1.19",
3
+ "version": "2.2.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",