@scheels-softdev/kendoreact-generics 2.8.11 → 2.8.12

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.
@@ -22,7 +22,7 @@ type GenericDDProps<T> = {
22
22
  /** The currently selected data object. (optional)*/
23
23
  selectedData?: T;
24
24
  /** Callback function triggered when the selected value changes*/
25
- onChange: Function;
25
+ onChange: (e: ComboBoxChangeEvent) => void;
26
26
  /** The field names used to extract text values for display */
27
27
  textField: keyof T;
28
28
  /** The separator to use when concatenating multiple text values. (optional)*/
@@ -32,6 +32,7 @@ export function GenericDropdown({ data, selectedId, selectedData, onChange, text
32
32
  //trigger functions
33
33
  useEffect(() => {
34
34
  var _a, _b;
35
+ console.log(selectedData, selectedId);
35
36
  setSelectedObject(selectedId
36
37
  ? (_a = data.find((item) => selectedId === item[idField || "id"])) !== null && _a !== void 0 ? _a : null
37
38
  : (_b = data.find((x) => Guard.Ensure.EqualObjects(Object.assign(Object.assign({}, x), selectedData), Object.assign({}, (x !== null && x !== void 0 ? x : {}))))) !== null && _b !== void 0 ? _b : null);
@@ -74,5 +75,5 @@ export function GenericDropdown({ data, selectedId, selectedData, onChange, text
74
75
  skip: state.skip,
75
76
  }, suggest: suggest, onPageChange: pageChange, filterable: true, onFilterChange: onFilterChange, popupSettings: {
76
77
  height: "210px",
77
- }, onChange: (e) => handleDropdownChange(e, onChange(e), {}, idField === null || idField === void 0 ? void 0 : idField.toString()), onBlur: (e) => e.nativeEvent.preventDefault(), clearButton: !hideClearButton, value: selectedObject }) })));
78
+ }, onChange: (e) => handleDropdownChange(e, () => onChange(e.value), {}, idField === null || idField === void 0 ? void 0 : idField.toString()), onBlur: (e) => e.nativeEvent.preventDefault(), clearButton: !hideClearButton, value: selectedObject }) })));
78
79
  }
@@ -2,9 +2,9 @@ export declare function CommandCellCheckBox({ checked, onCheck, onUncheck, disab
2
2
  /** Boolean value indicating whether the checkbox is checked (`true`) or unchecked (`false`). */
3
3
  checked: boolean;
4
4
  /** Callback function to be called when the checkbox is checked. */
5
- onCheck: Function;
5
+ onCheck: () => void;
6
6
  /** Callback function to be called when the checkbox is unchecked. */
7
- onUncheck: Function;
7
+ onUncheck: () => void;
8
8
  /** Boolean value indicating whether the checkbox is disabled. */
9
9
  disabled?: boolean;
10
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { ComboBoxChangeEvent } from "@progress/kendo-react-dropdowns";
2
1
  export declare function CommandCellDropdown<T>(props: {
3
2
  /** The data array for the dropdown options. */
4
3
  data: T[];
@@ -7,7 +6,7 @@ export declare function CommandCellDropdown<T>(props: {
7
6
  /** The field names to use for text values in the dropdown. */
8
7
  textField: keyof T;
9
8
  /** Callback function to be called when the selected value changes. */
10
- onChange: (e: ComboBoxChangeEvent) => void;
9
+ onChange: () => void;
11
10
  /** Optional separator to use for concatenating text values. */
12
11
  separator?: string;
13
12
  /** Determines if the edit field should be checked. */
package/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { CommandCellCheckBox } from "./commandCell/CommandCellCheckbox";
2
2
  export { CommandCellDate } from "./commandCell/CommandCellDate";
3
3
  export { CommandCellDropdown } from "./commandCell/CommandCellDropdown";
4
- export { CommandCellDDWithoutId } from "./commandCell/CommandCellDDWithoutId";
5
4
  export { CommandCellPrice } from "./commandCell/CommandCellPrice";
6
5
  export { CommandCellSwitch } from "./commandCell/CommandCellSwitch";
7
6
  export { FilterCellDropdown } from "./FilterCellDropdown";
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  export { CommandCellCheckBox } from "./commandCell/CommandCellCheckbox";
2
2
  export { CommandCellDate } from "./commandCell/CommandCellDate";
3
3
  export { CommandCellDropdown } from "./commandCell/CommandCellDropdown";
4
- export { CommandCellDDWithoutId } from "./commandCell/CommandCellDDWithoutId";
5
4
  export { CommandCellPrice } from "./commandCell/CommandCellPrice";
6
5
  export { CommandCellSwitch } from "./commandCell/CommandCellSwitch";
7
6
  export { FilterCellDropdown } from "./FilterCellDropdown";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scheels-softdev/kendoreact-generics",
3
- "version": "2.8.11",
3
+ "version": "2.8.12",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -1,19 +0,0 @@
1
- import { ComboBoxChangeEvent } from "@progress/kendo-react-dropdowns";
2
- export declare function CommandCellDDWithoutId<T>(props: {
3
- /** The data array for the dropdown options. */
4
- data: T[];
5
- /** The currently selected data item. */
6
- selectedData: T;
7
- /** The field names to use for text values in the dropdown. */
8
- textField: keyof T;
9
- /** Callback function to be called when the selected value changes. */
10
- onChange: (e: ComboBoxChangeEvent) => void;
11
- /** Optional separator to use for concatenating text values. */
12
- separator?: string;
13
- /** Determines if the edit field should be checked. */
14
- checkEditField?: boolean;
15
- /** Determines if the cell is in an editing state. */
16
- isEditing?: boolean;
17
- /** Determines if the clear button should be displayed in the dropdown. */
18
- showClearButton?: boolean;
19
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { GenericDropdown } from "../GenericDropdown";
3
- export function CommandCellDDWithoutId(props) {
4
- // Function implementation...
5
- return (_jsx("td", { children: props.checkEditField && !props.isEditing ? (_jsx(_Fragment, {}) //TODO remove this from Marketing display
6
- ) : (
7
- // If "props.checkEditField" is false or "props.isEditing" is true, render the GenericDropdownWithSearch component with the "props" passed to it
8
- _jsx(GenericDropdown, Object.assign({}, props))) }));
9
- }