@scheels-softdev/kendoreact-generics 1.6.5 → 1.6.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.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GridFilterCellProps } from "@progress/kendo-react-grid";
3
2
  interface DropdownFilterCellProps<T> extends GridFilterCellProps {
4
3
  defaultItem?: any;
@@ -6,5 +5,5 @@ interface DropdownFilterCellProps<T> extends GridFilterCellProps {
6
5
  descriptionKeys: (keyof T)[];
7
6
  separator?: string;
8
7
  }
9
- export declare function FilterCellDropdown<T>(props: DropdownFilterCellProps<T>): JSX.Element;
8
+ export declare function FilterCellDropdown<T>(props: DropdownFilterCellProps<T>): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,14 +1,15 @@
1
- /// <reference types="react" />
2
1
  export declare function GenericDropdown<T>({ data, // array of data objects
3
2
  selectedId, // id of the selected data object
4
3
  changeEvent, // function to call when the selected value changes
5
4
  textFields, // array of field names to use for text values
6
5
  separator, // optional separator to use for concatenating text values
7
- disabled, }: {
6
+ disabled, // boolean to disable the dropdown
7
+ idField, }: {
8
8
  data: T[];
9
9
  selectedId: number;
10
10
  changeEvent: Function;
11
11
  textFields: (keyof T)[];
12
12
  separator?: string;
13
+ idField?: keyof T;
13
14
  disabled?: boolean;
14
- }): JSX.Element;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -15,8 +15,7 @@ changeEvent, // function to call when the selected value changes
15
15
  textFields, // array of field names to use for text values
16
16
  separator, // optional separator to use for concatenating text values
17
17
  disabled, // boolean to disable the dropdown
18
- }) {
19
- //redux state
18
+ idField, }) {
20
19
  //local state
21
20
  const pageSize = 8;
22
21
  const [dataList, setDataList] = useState(data.map((x) => {
@@ -66,5 +65,5 @@ disabled, // boolean to disable the dropdown
66
65
  skip: state.skip,
67
66
  }, onPageChange: pageChange, filterable: true, onFilterChange: onFilterChange, popupSettings: {
68
67
  height: "210px",
69
- }, onChange: (e) => e.value && changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), value: dataList.find((item) => selectedId === item.id) }) })));
68
+ }, onChange: (e) => e.value && changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), value: dataList.find((item) => selectedId === item[idField || "id"]) }) })));
70
69
  }
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  export declare function MultiSelectDropdown<T>({ data, selectedData, field, selectEvent, title, }: {
3
2
  data: T[];
4
3
  selectedData: T[];
5
4
  field: keyof T;
6
5
  selectEvent: Function;
7
6
  title: string;
8
- }): JSX.Element;
7
+ }): import("react/jsx-runtime").JSX.Element;
package/Toolbar.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type CommonProps = {
3
2
  id: number;
4
3
  isEditing?: boolean;
@@ -7,5 +6,5 @@ export declare function ToolbarButton<T extends CommonProps>({ item, data, setDa
7
6
  item: T;
8
7
  data: T[];
9
8
  setData: Function;
10
- }): JSX.Element;
9
+ }): import("react/jsx-runtime").JSX.Element;
11
10
  export {};
package/Toolbar.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export function ToolbarButton({ item, data, setData }) {
3
- return (_jsx("button", Object.assign({ title: "Add new", className: "k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary", onClick: () => {
4
- setData([Object.assign(Object.assign({}, item), { isEditing: true, id: 0 }), ...data]);
5
- }, disabled: data.find((x) => x.isEditing) ? true : false }, { children: "Add Another" })));
3
+ return (_jsx("button", Object.assign({ title: "Add new", className: "k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary", onClick: () => setData([Object.assign(Object.assign({}, item), { isEditing: true, id: 0 }), ...data]), disabled: data.find((x) => x.isEditing) ? true : false }, { children: "Add Another" })));
6
4
  }
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  export declare function CommandCellCheckBox({ checked, functionToRunOnCheck, functionToRunOnUncheck, }: {
3
2
  checked: boolean;
4
3
  functionToRunOnCheck: Function;
5
4
  functionToRunOnUncheck: Function;
6
- }): JSX.Element;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { CommonProps, GridChangeEvent } from "../PropTypes";
3
2
  export declare function CommandCellDate<T extends CommonProps>({ dataItem, chgFn: changeFunction, field, }: {
4
3
  dataItem: T;
5
4
  chgFn: (e: GridChangeEvent) => void;
6
5
  field: keyof T;
7
- }): JSX.Element;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ComboBoxChangeEvent } from "@progress/kendo-react-dropdowns";
3
2
  import { CommonProps } from "../PropTypes";
4
3
  export declare function CommandCellDropdown<T extends CommonProps>(props: {
@@ -9,4 +8,4 @@ export declare function CommandCellDropdown<T extends CommonProps>(props: {
9
8
  separator?: string;
10
9
  checkEditField?: boolean;
11
10
  isEditing?: boolean;
12
- }): JSX.Element;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function CommandCellPrice({ cost }: {
3
2
  cost: number;
4
- }): JSX.Element;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { GridCellProps } from "@progress/kendo-react-grid";
3
2
  export declare function CommandCellSwitch({ props, changeFunction }: {
4
3
  props: GridCellProps;
5
4
  changeFunction: Function;
6
- }): JSX.Element;
5
+ }): 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": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",