@scheels-softdev/kendoreact-generics 1.6.4 → 1.6.6
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.
- package/FilterCellDropdown.d.ts +1 -2
- package/GenericDropdown.d.ts +4 -3
- package/GenericDropdown.js +2 -3
- package/MultiSelectDropdown.d.ts +1 -2
- package/Toolbar.d.ts +2 -6
- package/Toolbar.js +2 -5
- package/commandCell/CommandCellCheckbox.d.ts +1 -2
- package/commandCell/CommandCellDate.d.ts +1 -2
- package/commandCell/CommandCellDropdown.d.ts +1 -2
- package/commandCell/CommandCellPrice.d.ts +1 -2
- package/commandCell/CommandCellSwitch.d.ts +1 -2
- package/package.json +1 -1
package/FilterCellDropdown.d.ts
CHANGED
@@ -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 {};
|
package/GenericDropdown.d.ts
CHANGED
@@ -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;
|
package/GenericDropdown.js
CHANGED
@@ -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
|
68
|
+
}, onChange: (e) => e.value && changeEvent(e), onBlur: (e) => e.nativeEvent.preventDefault(), value: dataList.find((item) => selectedId === item[idField || "id"]) }) })));
|
70
69
|
}
|
package/MultiSelectDropdown.d.ts
CHANGED
@@ -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,14 +1,10 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { State } from "@progress/kendo-data-query";
|
3
1
|
type CommonProps = {
|
4
2
|
id: number;
|
5
3
|
isEditing?: boolean;
|
6
4
|
};
|
7
|
-
export declare function ToolbarButton<T extends CommonProps>({ item, data, setData
|
5
|
+
export declare function ToolbarButton<T extends CommonProps>({ item, data, setData }: {
|
8
6
|
item: T;
|
9
7
|
data: T[];
|
10
8
|
setData: Function;
|
11
|
-
|
12
|
-
setDataState: Function;
|
13
|
-
}): JSX.Element;
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
14
10
|
export {};
|
package/Toolbar.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
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
|
-
setDataState(Object.assign(Object.assign({}, dataState), { sort: { field: "id", dir: "asc" } }));
|
6
|
-
}, disabled: data.find((x) => x.isEditing) ? true : false }, { children: "Add Another" })));
|
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: () => setData([Object.assign(Object.assign({}, item), { isEditing: true, id: 0 }), ...data]), disabled: data.find((x) => x.isEditing) ? true : false }, { children: "Add Another" })));
|
7
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,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;
|