@scheels-softdev/kendoreact-generics 2.6.0 → 2.6.1

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.
@@ -3,7 +3,7 @@ interface DropdownFilterCellProps<T> extends GridFilterCellProps {
3
3
  /** The data to populate the dropdown options */
4
4
  data: T[];
5
5
  /** The field names used to extract text values for display */
6
- textFields: (keyof T)[];
6
+ textField: keyof T;
7
7
  /** The separator to use when concatenating multiple text values */
8
8
  separator?: string;
9
9
  }
@@ -28,5 +28,5 @@ export function FilterCellDropdown(props) {
28
28
  });
29
29
  };
30
30
  // Render a div containing a GenericDropdownWithSearch component and a Clear button
31
- return (_jsxs("div", Object.assign({ className: "k-filtercell", "data-testid": "dropdownFilter" }, { children: [_jsx(GenericDropdown, { data: props.data, onChange: onChange, selectedId: props.value, textFields: [...props.textFields], separator: props.separator }), _jsx(Button, { title: "Clear", disabled: !hasValue(props.value), onClick: onClearButtonClick, icon: "filter-clear" })] })));
31
+ return (_jsxs("div", Object.assign({ className: "k-filtercell", "data-testid": "dropdownFilter" }, { children: [_jsx(GenericDropdown, { data: props.data, onChange: onChange, selectedId: props.value, textField: props.textField, separator: props.separator }), _jsx(Button, { title: "Clear", disabled: !hasValue(props.value), onClick: onClearButtonClick, icon: "filter-clear" })] })));
32
32
  }
@@ -14,7 +14,7 @@ type GenericDDProps<T> = {
14
14
  /** Callback function triggered when the selected value changes*/
15
15
  onChange: Function;
16
16
  /** The field names used to extract text values for display */
17
- textFields: (keyof T)[];
17
+ textField: keyof T;
18
18
  /** The separator to use when concatenating multiple text values. (optional)*/
19
19
  separator?: string;
20
20
  /** Determines whether the dropdown is disabled. (optional)*/
@@ -29,5 +29,5 @@ type GenericDDProps<T> = {
29
29
  style?: CSSProperties;
30
30
  isLoading?: boolean;
31
31
  };
32
- export declare function GenericDropdown<T>({ data, selectedId, selectedData, onChange, textFields, separator, disabled, idField, title, hideClearButton, style, isLoading, }: GenericDDProps<T>): import("react/jsx-runtime").JSX.Element;
32
+ export declare function GenericDropdown<T>({ data, selectedId, selectedData, onChange, textField, disabled, idField, title, hideClearButton, style, isLoading, }: GenericDDProps<T>): import("react/jsx-runtime").JSX.Element;
33
33
  export {};
@@ -1,31 +1,29 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ComboBox } from "@progress/kendo-react-dropdowns";
3
3
  import { filterBy } from "@progress/kendo-data-query";
4
- import { useEffect, useRef, useState } from "react";
5
- import { getTextValue } from "./Utility";
4
+ import { useRef, useState } from "react";
6
5
  import { Skeleton } from "@progress/kendo-react-indicators";
7
- export function GenericDropdown({ data, selectedId, selectedData, onChange, textFields, separator, disabled, idField, title, hideClearButton, style, isLoading, }) {
6
+ export function GenericDropdown({ data, selectedId, selectedData, onChange, textField, disabled, idField, title, hideClearButton, style, isLoading, }) {
8
7
  if (selectedId !== undefined && selectedData !== undefined) {
9
8
  throw new Error("You cannot provide both selectedData and selectedId to GenericDropdown.");
10
9
  }
11
10
  //local state
12
11
  const pageSize = 8;
13
- const [dataList, setDataList] = useState([]);
14
12
  const [state, setState] = useState({
15
13
  skip: 0,
16
- total: dataList.length,
17
- subsetData: dataList.slice(0, pageSize),
14
+ total: data.length,
15
+ subsetData: data.slice(0, pageSize),
18
16
  });
19
17
  //external function variables
20
- let filteredData = useRef(dataList.slice());
18
+ let filteredData = useRef(data.slice());
21
19
  //function creation
22
20
  // function to handle filter changes
23
21
  const onFilterChange = (event) => {
24
22
  var _a;
25
23
  if ((_a = event.filter.value) === null || _a === void 0 ? void 0 : _a.length)
26
- filteredData.current = filterBy(dataList.slice(), event.filter);
24
+ filteredData.current = filterBy(data.slice(), event.filter);
27
25
  else
28
- filteredData.current = dataList;
26
+ filteredData.current = data;
29
27
  const newData = filteredData.current.slice(0, pageSize);
30
28
  setState({
31
29
  subsetData: newData,
@@ -38,36 +36,18 @@ export function GenericDropdown({ data, selectedId, selectedData, onChange, text
38
36
  console.log("page change data: ", event.page, filteredData.current);
39
37
  const skip = event.page.skip;
40
38
  const take = event.page.take;
41
- const newSubsetData = filteredData.current.length ? filteredData.current.slice(skip, skip + take) : dataList.slice(skip, skip + take);
39
+ const newSubsetData = filteredData.current.length ? filteredData.current.slice(skip, skip + take) : data.slice(skip, skip + take);
42
40
  setState(Object.assign(Object.assign({}, state), { subsetData: newSubsetData, skip: skip }));
43
41
  };
44
- //change event listeners
45
- useEffect(() => {
46
- dataList;
47
- });
48
- useEffect(() => {
49
- if (data.length) {
50
- setDataList(data.map((x) => {
51
- return Object.assign(Object.assign({}, x), { textValue: getTextValue(x, textFields.map((x) => x.toString()), separator) });
52
- }));
53
- setState(Object.assign(Object.assign({}, state), { total: data.length, subsetData: data.map((x) => {
54
- return Object.assign(Object.assign({}, x), { textValue: getTextValue(x, textFields.map((x) => x.toString()), separator) });
55
- }) }));
56
- }
57
- }, [data, textFields, separator]);
58
42
  const findByIndex = (id, idKey) => {
59
- console.log(id, data, idField);
60
- const item = dataList.find((item) => id === item[idKey || "id"]);
61
- console.log(item);
43
+ const item = data.find((item) => id === item[idKey || "id"]);
62
44
  return item;
63
45
  };
64
46
  const findByValue = (item) => {
65
- console.log(item, data);
66
- const returnVal = dataList.find((x) => JSON.stringify(Object.assign(Object.assign({}, x), selectedData)) === JSON.stringify(Object.assign({}, x)));
67
- console.log(returnVal);
47
+ const returnVal = data.find((x) => JSON.stringify(Object.assign(Object.assign({}, x), selectedData)) === JSON.stringify(Object.assign({}, x)));
68
48
  return returnVal;
69
49
  };
70
- return (_jsx("div", Object.assign({ "data-testid": "dropdown" }, { children: dataList.length && !isLoading ? (_jsx(ComboBox, { style: style, label: title, disabled: disabled, data: state.subsetData, textField: "textValue", virtual: {
50
+ return (_jsx("div", Object.assign({ "data-testid": "dropdown" }, { children: data.length && !isLoading ? (_jsx(ComboBox, { style: style, label: title, disabled: disabled, data: state.subsetData, textField: textField.toString(), virtual: {
71
51
  // enable virtualization for large datasets
72
52
  total: state.total,
73
53
  pageSize: pageSize,
@@ -1,16 +1,14 @@
1
- export declare function MultiSelectDropdown<T>({ data, selectedData, textFields, selectEvent, title, separator, limit, }: {
1
+ export declare function MultiSelectDropdown<T>({ data, selectedData, textField, onSelect, title, limit, }: {
2
2
  /** The data array for the dropdown options. */
3
3
  data: T[];
4
4
  /** The array of selected data items. */
5
5
  selectedData: T[];
6
6
  /** The field names to use for text values in the dropdown. */
7
- textFields: (keyof T)[];
7
+ textField: keyof T;
8
8
  /** The function to call when an item is selected or deselected. */
9
- selectEvent: Function;
9
+ onSelect: Function;
10
10
  /** The optional title of the dropdown. */
11
11
  title?: string;
12
- /** The optional separator to use for concatenating text values. */
13
- separator?: string;
14
12
  /** The optional limit of the maximum number of selected items. */
15
13
  limit?: number;
16
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,25 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
2
+ import { useRef, useState } from "react";
3
3
  import { filterBy } from "@progress/kendo-data-query";
4
4
  import { MultiSelect } from "@progress/kendo-react-dropdowns";
5
- import { getTextValue } from "./Utility";
6
- export function MultiSelectDropdown({ data, selectedData, textFields, selectEvent, title, separator, limit, }) {
5
+ export function MultiSelectDropdown({ data, selectedData, textField, onSelect, title, limit, }) {
7
6
  //local state
8
7
  const pageSize = 8;
9
- const [dataList, setDataList] = useState(data.map((x) => {
10
- return Object.assign(Object.assign({}, x), { textValue: getTextValue(x, textFields.map((x) => x.toString()), separator) });
11
- }));
12
8
  const [state, setState] = useState({
13
9
  skip: 0,
14
- total: dataList.length,
15
- subsetData: dataList.slice(0, pageSize),
10
+ total: data.length,
11
+ subsetData: data.slice(0, pageSize),
16
12
  });
17
13
  //external function variables
18
- const filteredData = useRef(dataList.slice());
14
+ const filteredData = useRef(data.slice());
19
15
  //function creation
20
16
  // function to handle filter changes
21
17
  const onFilterChange = (event) => {
22
18
  var _a;
23
19
  if ((_a = event.filter.value) === null || _a === void 0 ? void 0 : _a.length)
24
- filteredData.current = filterBy(dataList.slice(), event.filter);
20
+ filteredData.current = filterBy(data.slice(), event.filter);
25
21
  else
26
- filteredData.current = dataList;
22
+ filteredData.current = data;
27
23
  const newData = filteredData.current.slice(0, pageSize);
28
24
  setState({
29
25
  subsetData: newData,
@@ -38,17 +34,11 @@ export function MultiSelectDropdown({ data, selectedData, textFields, selectEven
38
34
  const newSubsetData = filteredData.current.slice(skip, skip + take);
39
35
  setState(Object.assign(Object.assign({}, state), { subsetData: newSubsetData, skip: skip }));
40
36
  };
41
- //change event listeners
42
- useEffect(() => {
43
- setDataList(data.map((x) => {
44
- return Object.assign(Object.assign({}, x), { textValue: getTextValue(x, textFields.map((x) => x.toString()), separator) });
45
- }));
46
- }, [data, textFields, separator]);
47
- return (_jsx("div", Object.assign({ "data-testid": "multiselect", style: { width: "100%" } }, { children: _jsx(MultiSelect, { label: title, data: state.subsetData, textField: "textValue", style: { width: "100%" }, virtual: {
37
+ return (_jsx("div", Object.assign({ "data-testid": "multiselect", style: { width: "100%" } }, { children: _jsx(MultiSelect, { label: title, data: state.subsetData, textField: textField.toString(), style: { width: "100%" }, virtual: {
48
38
  total: state.total,
49
39
  pageSize: pageSize,
50
40
  skip: state.skip,
51
41
  }, onPageChange: pageChange, filterable: true, onFilterChange: onFilterChange, popupSettings: {
52
42
  height: "210px",
53
- }, onChange: (e) => selectEvent(limit && e.value.length ? e.value.slice(0, limit) : e.value), autoClose: false, value: selectedData }) })));
43
+ }, onChange: (e) => onSelect(limit && e.value.length ? e.value.slice(0, limit) : e.value), autoClose: false, value: selectedData }) })));
54
44
  }
package/README.md CHANGED
@@ -36,56 +36,59 @@ Note: This package has only been tested with typescript. if you're using javascr
36
36
  selectedId: number;
37
37
  selectedData?: T;
38
38
  onChange: event: (ComboBoxChangeEvent) => void;
39
- textFields: (keyof T)[];
40
- separator?: string;
41
- idField?: keyof T;
39
+ textField: keyof T;
42
40
  disabled?: boolean;
41
+ idField?: keyof T;
43
42
  title?: string;
44
- showClearButton?: boolean;
43
+ hideClearButton?: boolean;
44
+ style?: React.CSSProperties;
45
+ isLoading?: boolean;
45
46
 
46
47
  #### data
47
48
 
48
49
  - Array of T. the Definition of what T is matters for the "textFields" prop
49
50
 
50
- #### onChange
51
-
52
- - Event passed is a ComboBoxChangeEvent (from kendo-react-dropdowns)
53
-
54
- #### selectedId
51
+ #### selectedId OR selectedData
55
52
 
56
- - 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)
53
+ - selectedId is the unique identifier 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
+ - selectedData is a reference to the full selected object.
55
+ - Only one of these 2 is needed. it will just use selectedId if both are provided
57
56
 
58
- #### selectedData
57
+ #### onChange
59
58
 
60
- - 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
59
+ - Event passed is a ComboBoxChangeEvent (from kendo-react-dropdowns)
61
60
 
62
- #### textFields
61
+ #### textField
63
62
 
64
- - This is defined as (keyof T)[].
65
- - For example, if my dropdown is fed a list of employee objects with a firstName, lastName, and id key, I would pass ["firstName","lastName"] to see "John Williams", or ["firstName","lastName","id"] to see "John Doe 19382032141"
63
+ - The field of each object to actually display
64
+ - For example, if my dropdown is fed a list of employee objects with a firstName, lastName, and id key, I would pass "firstName" to see "John" or "lastName" to see "Doe".
65
+ If you need to include multiple fields of the object, see https://www.npmjs.com/package/@scheels-softdev/frontend-utility-functions?activeTab=readme
66
66
 
67
- #### separator (optional)
67
+ #### disabled (optional)
68
68
 
69
- - This defines what your text fields are separated by. by default, it is assumed you only want a space between them. Use this prop if you want to change this
70
- - For example, if we want our employee's names separated by a comma, we would pass ", " here
69
+ - If you want to conditionally disable the dropdown you can do that here
71
70
 
72
71
  #### idField (optional)
73
72
 
74
73
  - IdField is a keyof T, much like textFields. while textFields determines what's displayed in the dropdown, idField overrides what field of each object the dropdown looks at to compare against the selectedId prop
75
74
  - For example, if our employee's id field is employeeId instead of just id, we would pass "employeeId" here
76
75
 
77
- #### disabled (optional)
78
-
79
- - If you want to conditionally disable the dropdown you can do that here
80
-
81
76
  #### title (optional)
82
77
 
83
78
  - The label that appears in your multiselect when there aren't any options selected, or just above the multiselect when there are
84
79
  - For example, if we want to use it to send a letter to an employee, we would pass "Selected Employee" here
85
80
 
86
- #### showClearButton (optional)
81
+ #### hideClearButton (optional)
82
+
83
+ - A boolean indicating whether the clear button should be hidden. by default it will be shown
84
+
85
+ #### style (optional)
87
86
 
88
- - A boolean indicating whether the clear button should show up or not
87
+ - An override to the default styling that ships with kendo
88
+
89
+ #### isLoading (optional)
90
+
91
+ - A boolean indicating whether your data is still loading or not
89
92
 
90
93
  ---
91
94
 
@@ -95,10 +98,9 @@ Note: This package has only been tested with typescript. if you're using javascr
95
98
 
96
99
  data: T[];
97
100
  selectedData: T[];
98
- textFields: (keyof T)[];
99
- selectEvent: Function;
101
+ textField: keyof T;
102
+ onSelect: Function;
100
103
  title?: string;
101
- separator?: string;
102
104
  limit?: number;
103
105
 
104
106
  #### data
@@ -109,12 +111,13 @@ Note: This package has only been tested with typescript. if you're using javascr
109
111
 
110
112
  - 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
111
113
 
112
- #### textFields
114
+ #### textField
113
115
 
114
- - This is defined as (keyof T)[].
115
- - For example, if my dropdown is fed a list of employee objects with a firstName, lastName, and id key, I would pass ["firstName","lastName"] to see "John Williams", or ["firstName","lastName","id"] to see "John Doe 19382032141"
116
+ - The field of each object to actually display
117
+ - For example, if my dropdown is fed a list of employee objects with a firstName, lastName, and id key, I would pass "firstName" to see "John" or "lastName" to see "Doe".
118
+ If you need to include multiple fields of the object, see https://www.npmjs.com/package/@scheels-softdev/frontend-utility-functions?activeTab=readme
116
119
 
117
- #### selectEvent
120
+ #### onSelect
118
121
 
119
122
  - "Event" you're given should just be your new array of selected Items
120
123
 
@@ -123,11 +126,6 @@ Note: This package has only been tested with typescript. if you're using javascr
123
126
  - The label that appears in your multiselect when there aren't any options selected, or just above the multiselect when there are
124
127
  - For example, if we want to use it to send work anniversary letters to multiple employees, we would pass "Selected Employees" here
125
128
 
126
- #### separator (optional)
127
-
128
- - This defines what your text fields are separated by. by default, it is assumed you only want a space between them. Use this prop if you want to change this
129
- - For example, if we want our employee's names separated by a comma, we would pass ", " here
130
-
131
129
  #### limit (optional)
132
130
 
133
131
  - The upper limit of how many items the user can select at once.
@@ -141,7 +139,7 @@ Note: This package has only been tested with typescript. if you're using javascr
141
139
 
142
140
  {...GridFilterCellProps} (from @progress/kendo-react-grid)
143
141
  data: T[];
144
- textFields: (keyof T)[];
142
+ textField: keyof T;
145
143
  separator?: string;
146
144
 
147
145
  #### {...FilterCellProps}
@@ -152,10 +150,11 @@ Note: This package has only been tested with typescript. if you're using javascr
152
150
 
153
151
  - Array of T. What you want to display in the dropdown. the Definition of what T is matters for the "textFields" prop
154
152
 
155
- #### textFields
153
+ #### textField
156
154
 
157
- - This is defined as (keyof T)[].
158
- - For example, if my dropdown is fed a list of employee Statuses, I could feed it a "StatusName" field (assuming my Status objects have that key) and it could display something like "Active", "Terminated", or "On Leave"
155
+ - The field of each object to actually display
156
+ - For example, if my dropdown is fed a list of employee objects with a firstName, lastName, and id key, I would pass "firstName" to see "John" or "lastName" to see "Doe".
157
+ If you need to include multiple fields of the object, see https://www.npmjs.com/package/@scheels-softdev/frontend-utility-functions?activeTab=readme
159
158
 
160
159
  #### separator (optional)
161
160
 
@@ -164,172 +163,6 @@ Note: This package has only been tested with typescript. if you're using javascr
164
163
 
165
164
  ---
166
165
 
167
- ## Command Cell Dropdown
168
-
169
- ### Props
170
-
171
- data: T[];
172
- selectedId: number;
173
- textFields: (keyof T)[];
174
- onChange: (e: ComboBoxChangeEvent) => void;
175
- separator?: string;
176
- checkEditField?: boolean;
177
- isEditing?: boolean;
178
-
179
- #### data
180
-
181
- - Array of T. What you want to display in the dropdown. the Definition of what T is matters for the "textFields" prop
182
-
183
- #### selectedId
184
-
185
- - all of the default props that are passed from kendo grid when trying to override the filter cell
186
-
187
- #### textFields
188
-
189
- - This is defined as (keyof T)[].
190
- - For example, if my dropdown is fed a list of employee Statuses, I could feed it a "StatusName" field (assuming my Status objects have that key) and it could display something like "Active", "Terminated", or "On Leave"
191
-
192
- #### onChange
193
-
194
- - Pass what you want the event to do. the event you will be passed is a ComboBoxChangeEvent. The relevant information you're likely to need is stored in e.target.value
195
-
196
- #### separator (optional)
197
-
198
- - This defines what your text fields are separated by. by default, it is assumed you only want a space between them. Use this prop if you want to change this
199
- - For example, if some of our associates only know the status IDs for Active, Terminated, or On Leave and we want to display them side by side, we might want to add a "dash" seporator. to do this we would pass " - " here
200
-
201
- #### checkEditField (optional)
202
-
203
- - This is for optional conditional rendering. If this is true, it will only render a dropdown if isEditing is true. if this is false, it will always render a dropdown
204
-
205
- #### isEditing (optional)
206
-
207
- - This goes along with the checkEditField prop. If both are true, it will render a dropdown. Otherwise, only text containing the selected value will be displayed
208
-
209
- ---
210
-
211
- ## Command Cell Date
212
-
213
- ### Props
214
-
215
- dataItem: T;
216
- chgFn: (e: GridChangeEvent) => void;
217
- field: keyof T;
218
-
219
- #### dataItem
220
-
221
- - an object containing a date. if used per Telerik(Kendo)'s documentation, the value will come from props.dataItem
222
-
223
- #### field
224
-
225
- - which key in your dataItem object is a date?
226
-
227
- #### chgFn
228
-
229
- - A handler function for a gridchangeevent.
230
-
231
- ---
232
-
233
- ## Command Cell Checkbox
234
-
235
- ### Props
236
-
237
- checked: boolean;
238
- onCheck: Function;
239
- onUncheck: Function;
240
-
241
- #### checked
242
-
243
- - boolean value for whether or not the checkbox should display a checkmark
244
-
245
- #### onCheck
246
-
247
- - what function do you want to run when checking the checkbox. I highly recommend a function that actually changes your value passed into `checked` to true.
248
-
249
- #### onUncheck
250
-
251
- - what function do you want to run when unchecking the checkbox. I highly recommend a function that actually changes your value passed into `checked` to false.
252
-
253
- ---
254
-
255
- ## Command Cell Switch
256
-
257
- ### Props
258
-
259
- props: GridCellProps
260
- changeFunction: Function
261
-
262
- ### props
263
-
264
- - this component will assume you have an isEditing key in your object, otherwise it will just generate a string (in the current version)
265
-
266
- ### changeFunction
267
-
268
- - what function do you want to run on change? I highly recommend a function that actually toggles the value of the field you're trying to change.
269
-
270
- ---
271
-
272
- ## CommandCellPrice
273
-
274
- ### Props
275
-
276
- cost: number
277
-
278
- ### cost
279
-
280
- - the number you want formatted to USD. support for other currencies or for thousandths will come eventually with optional props, but those don't exist yet
281
-
282
- ---
283
-
284
- ## Command Cell Dropdown Without ID
285
-
286
- ### Props
287
-
288
- data: T[]
289
- selectedData: T
290
- textFields: (keyof T)[]
291
- onChange: (e: ComboBoxChangeEvent) => void
292
- separator?: string
293
- checkEditField?: boolean
294
- isEditing?: boolean
295
- showClearButton?: boolean
296
-
297
- #### data
298
-
299
- - Array of T. What you want to display in the dropdown. The definition of what T is matters for the "textFields" prop.
300
-
301
- #### selectedData
302
-
303
- - 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.
304
-
305
- #### textFields
306
-
307
- - This is defined as (keyof T)[].
308
- - For example, if my dropdown is fed a list of employee objects with a `firstName`, `lastName`, and `id` key, I would pass `["firstName","lastName"]` to see "John Williams", or `["firstName","lastName","id"]` to see "John Doe 19382032141".
309
-
310
- #### onChange
311
-
312
- - Pass what you want the event to do. The event you will be passed is a ComboBoxChangeEvent. The relevant information you're likely to need is stored in `e.target.value`.
313
-
314
- #### separator (optional)
315
-
316
- - This defines what your text fields are separated by. By default, it is assumed you only want a space between them. Use this prop if you want to change this.
317
- - For example, if some of our associates only know the status IDs for Active, Terminated, or On Leave and we want to display them side by side, we might want to add a "dash" separator. To do this, we would pass " - " here.
318
-
319
- #### checkEditField (optional)
320
-
321
- - This is for optional conditional rendering. If this is true, it will only render a dropdown if `isEditing` is true. If this is false, it will always render a dropdown.
322
-
323
- #### isEditing (optional)
324
-
325
- - This goes along with the `checkEditField` prop. If both are true, it will render a dropdown. Otherwise, only text containing the selected value will be displayed.
326
-
327
- #### showClearButton (optional)
328
-
329
- - A boolean indicating whether the clear button should show up or not.
330
-
331
- ---
332
-
333
166
  ## ToolbarButton
334
167
 
335
168
  ### Props
@@ -5,7 +5,7 @@ export declare function CommandCellDDWithoutId<T>(props: {
5
5
  /** The currently selected data item. */
6
6
  selectedData: T;
7
7
  /** The field names to use for text values in the dropdown. */
8
- textFields: (keyof T)[];
8
+ textField: keyof T;
9
9
  /** Callback function to be called when the selected value changes. */
10
10
  onChange: (e: ComboBoxChangeEvent) => void;
11
11
  /** Optional separator to use for concatenating text values. */
@@ -1,8 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { GenericDropdown } from "../GenericDropdown";
3
3
  export function CommandCellDDWithoutId(props) {
4
4
  // Function implementation...
5
- return (_jsx("td", { children: props.checkEditField && !props.isEditing ? (props.textFields.map((x) => props.data.find((y) => y === props.selectedData)[x]).join(props.separator || " ")) : (
5
+ return (_jsx("td", { children: props.checkEditField && !props.isEditing ? (_jsx(_Fragment, {}) //TODO remove this from Marketing display
6
+ ) : (
6
7
  // If "props.checkEditField" is false or "props.isEditing" is true, render the GenericDropdownWithSearch component with the "props" passed to it
7
8
  _jsx(GenericDropdown, Object.assign({}, props))) }));
8
9
  }
@@ -5,7 +5,7 @@ export declare function CommandCellDropdown<T>(props: {
5
5
  /** The ID of the currently selected item. */
6
6
  selectedId: number;
7
7
  /** The field names to use for text values in the dropdown. */
8
- textFields: (keyof T)[];
8
+ textField: keyof T;
9
9
  /** Callback function to be called when the selected value changes. */
10
10
  onChange: (e: ComboBoxChangeEvent) => void;
11
11
  /** Optional separator to use for concatenating text values. */
@@ -1,11 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { GenericDropdown } from "../GenericDropdown";
3
3
  // This exports a function component called "CommandCellDropdown"
4
4
  // It takes in various props that are used to render a dropdown in a table cell
5
5
  export function CommandCellDropdown(props) {
6
- return (_jsx("td", { children: props.checkEditField && !props.isEditing && props.data.length ? (props.textFields
7
- .map((x) => props.data.find((y) => y[props.idField ? props.idField : "id"] === props.selectedId)[x])
8
- .join(props.separator || " ")) : (
6
+ return (_jsx("td", { children: props.checkEditField && !props.isEditing && props.data.length ? (_jsx(_Fragment, {}) //TODO remove this from Marketing display
7
+ ) : (
9
8
  // If "props.checkEditField" is false or "props.isEditing" is true, render the GenericDropdownWithSearch component with the "props" passed to it
10
9
  _jsx(GenericDropdown, Object.assign({}, props))) }));
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheels-softdev/kendoreact-generics",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",