@scheels-softdev/kendoreact-generics 3.0.6 → 3.0.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.
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Select from "react-select";
3
3
  export function GenericDropdown({ data, selectedId, selectedData, onChange, textField, idField, style, isLoading, title, maxMenuHeight, menuStyle, }) {
4
+ var _a, _b;
4
5
  const options = data.map((item) => ({
5
6
  value: item,
6
7
  label: item[textField].toString(),
7
8
  }));
8
9
  const selectedOption = selectedId
9
- ? options.find((option) => option.value.id === (selectedId === null || selectedId === void 0 ? void 0 : selectedId.toString()))
10
- : options.find((option) => option.value === selectedData);
10
+ ? (_a = options.find((option) => option.value.id === (selectedId === null || selectedId === void 0 ? void 0 : selectedId.toString()))) !== null && _a !== void 0 ? _a : null
11
+ : (_b = options.find((option) => option.value === selectedData)) !== null && _b !== void 0 ? _b : null;
11
12
  const handleChange = (selectedOption) => {
12
13
  if (selectedOption) {
13
14
  const selectedItem = idField ? data.find((item) => item[idField].toString() === selectedOption.value.id) : selectedOption.value;
@@ -19,6 +20,6 @@ export function GenericDropdown({ data, selectedId, selectedData, onChange, text
19
20
  };
20
21
  return (_jsx(Select, { options: options, onChange: handleChange, value: selectedOption, isLoading: isLoading, isDisabled: isLoading, maxMenuHeight: maxMenuHeight, styles: {
21
22
  control: (base) => (Object.assign(Object.assign(Object.assign({}, base), { zIndex: 100, minHeight: "45px", maxHeight: "45px" }), style)),
22
- menuPortal: (base) => (Object.assign(Object.assign(Object.assign({}, base), { zIndex: 100 }), menuStyle)),
23
+ menu: (base) => (Object.assign(Object.assign({}, base), { zIndex: 100 })),
23
24
  }, placeholder: title || "Select an option" }));
24
25
  }
@@ -1,7 +1,12 @@
1
- import { GridCellProps } from "@progress/kendo-react-grid";
2
- export declare function CommandCellSwitch({ props, changeFunction, }: {
1
+ export declare function CommandCellSwitch<T extends {
2
+ isEditing: boolean;
3
+ [key: string]: any;
4
+ }>({ props, changeFunction, }: {
3
5
  /** The GridCellProps object containing cell-related properties. */
4
- props: GridCellProps;
6
+ props: {
7
+ dataItem: T;
8
+ field?: keyof T;
9
+ };
5
10
  /** The function to call when the switch value changes. */
6
11
  changeFunction: Function;
7
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": "3.0.6",
3
+ "version": "3.0.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -16,7 +16,6 @@
16
16
  "@progress/kendo-data-query": "latest",
17
17
  "@progress/kendo-react-dateinputs": "latest",
18
18
  "@progress/kendo-react-dropdowns": "latest",
19
- "@progress/kendo-react-grid": "latest",
20
19
  "@progress/kendo-react-indicators": "^5.14.1",
21
20
  "@progress/kendo-react-inputs": "latest",
22
21
  "@scheels-softdev/frontend-utility-functions": "^1.3.7",
@@ -37,7 +36,6 @@
37
36
  "devDependencies": {
38
37
  "@progress/kendo-react-dateinputs": "latest",
39
38
  "@progress/kendo-react-dropdowns": "latest",
40
- "@progress/kendo-react-grid": "latest",
41
39
  "@progress/kendo-react-inputs": "latest",
42
40
  "@types/moment": "^2.13.0",
43
41
  "@types/react": "^18.0.28",