@linzjs/step-ag-grid 22.2.4 → 22.2.5
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/dist/src/components/gridForm/GridFormDropDown.d.ts +7 -6
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +1 -1
- package/dist/step-ag-grid.cjs.js +7 -2
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +7 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +14 -8
- package/src/components/gridPopoverEdit/GridButton.tsx +3 -3
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +2 -6
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +3 -3
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
3
|
import { CellEditorCommon } from "../GridCell";
|
|
4
|
-
export interface GridPopoutEditDropDownSelectedItem<TData> {
|
|
4
|
+
export interface GridPopoutEditDropDownSelectedItem<TData extends GridBaseRow, TValue> {
|
|
5
5
|
selectedRows: TData[];
|
|
6
|
-
|
|
6
|
+
selectedRowIds: TData["id"][];
|
|
7
|
+
value: TValue;
|
|
7
8
|
subComponentValue?: any;
|
|
8
9
|
}
|
|
9
10
|
interface FinalSelectOption {
|
|
@@ -22,16 +23,16 @@ export declare const MenuHeaderItem: (title: string) => {
|
|
|
22
23
|
value: string;
|
|
23
24
|
};
|
|
24
25
|
export type SelectOption = null | string | FinalSelectOption;
|
|
25
|
-
export interface GridFormDropDownProps<TData extends GridBaseRow> extends CellEditorCommon {
|
|
26
|
+
export interface GridFormDropDownProps<TData extends GridBaseRow, TValue> extends CellEditorCommon {
|
|
26
27
|
className?: "GridPopoverEditDropDown-containerSmall" | "GridPopoverEditDropDown-containerMedium" | "GridPopoverEditDropDown-containerLarge" | "GridPopoverEditDropDown-containerUnlimited" | "GridPopoverEditDropDown-containerAutoWidth" | string | undefined;
|
|
27
28
|
filtered?: "local" | "reload";
|
|
28
29
|
filterDefaultValue?: string;
|
|
29
30
|
filterPlaceholder?: string;
|
|
30
31
|
filterHelpText?: string;
|
|
31
32
|
noOptionsMessage?: string;
|
|
32
|
-
onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData>) => Promise<void>;
|
|
33
|
-
onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData>) => Promise<void>;
|
|
33
|
+
onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
|
|
34
|
+
onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
|
|
34
35
|
options: SelectOption[] | ((selectedRows: TData[], filter?: string) => Promise<SelectOption[] | undefined> | SelectOption[] | undefined) | undefined;
|
|
35
36
|
}
|
|
36
|
-
export declare const GridFormDropDown: <TData extends GridBaseRow>(props: GridFormDropDownProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const GridFormDropDown: <TData extends GridBaseRow, TValue>(props: GridFormDropDownProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -2,11 +2,11 @@ import { ICellEditorParams } from "ag-grid-community";
|
|
|
2
2
|
import { ColDefT } from "../GridCell";
|
|
3
3
|
import { GenericCellColDef } from "../gridRender";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
|
-
export interface GridButtonProps<TData> {
|
|
5
|
+
export interface GridButtonProps<TData extends GridBaseRow> {
|
|
6
6
|
visible?: (cellEditorParams: ICellEditorParams) => boolean;
|
|
7
7
|
onClick?: (props: {
|
|
8
8
|
selectedRows: TData[];
|
|
9
|
-
selectedRowIds:
|
|
9
|
+
selectedRowIds: TData["id"][];
|
|
10
10
|
}) => void;
|
|
11
11
|
}
|
|
12
12
|
export declare const GridButton: <TData extends GridBaseRow>(colDef: GenericCellColDef<TData, boolean>, editor: GridButtonProps<TData>) => ColDefT<TData>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CellEditorCommon, ColDefT } from "../GridCell";
|
|
2
2
|
import { GenericCellColDef } from "../gridRender";
|
|
3
3
|
import { GridBaseRow } from "../Grid";
|
|
4
|
-
export interface GridEditBooleanEditorProps<TData> extends CellEditorCommon {
|
|
4
|
+
export interface GridEditBooleanEditorProps<TData extends GridBaseRow> extends CellEditorCommon {
|
|
5
5
|
onClick: (props: {
|
|
6
6
|
selectedRows: TData[];
|
|
7
|
-
selectedRowIds:
|
|
7
|
+
selectedRowIds: TData["id"][];
|
|
8
8
|
checked: boolean;
|
|
9
9
|
}) => Promise<boolean>;
|
|
10
10
|
}
|
|
@@ -2,4 +2,4 @@ import { GridBaseRow } from "../Grid";
|
|
|
2
2
|
import { ColDefT, GenericCellEditorProps } from "../GridCell";
|
|
3
3
|
import { GridFormDropDownProps } from "../gridForm/GridFormDropDown";
|
|
4
4
|
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
|
-
export declare const GridPopoverEditDropDown: <TData extends GridBaseRow, TValue = any>(colDef: GenericCellColDef<TData, TValue>, props: GenericCellEditorProps<GridFormDropDownProps<TData>>) => ColDefT<TData, TValue>;
|
|
5
|
+
export declare const GridPopoverEditDropDown: <TData extends GridBaseRow, TValue = any>(colDef: GenericCellColDef<TData, TValue>, props: GenericCellEditorProps<GridFormDropDownProps<TData, TValue>>) => ColDefT<TData, TValue>;
|
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -3587,7 +3587,12 @@ const GridFormDropDown = (props) => {
|
|
|
3587
3587
|
(subComponentValue !== undefined && subComponentInitialValue.current !== JSON.stringify(subComponentValue));
|
|
3588
3588
|
if (hasChanged) {
|
|
3589
3589
|
if (props.onSelectedItem) {
|
|
3590
|
-
await props.onSelectedItem({
|
|
3590
|
+
await props.onSelectedItem({
|
|
3591
|
+
selectedRows,
|
|
3592
|
+
selectedRowIds: selectedRows.map((row) => row.id),
|
|
3593
|
+
value,
|
|
3594
|
+
subComponentValue,
|
|
3595
|
+
});
|
|
3591
3596
|
}
|
|
3592
3597
|
else {
|
|
3593
3598
|
selectedRows.forEach((row) => (row[field] = value));
|
|
@@ -3653,7 +3658,7 @@ const GridFormDropDown = (props) => {
|
|
|
3653
3658
|
if (selectedItem === null) {
|
|
3654
3659
|
if (props.onSelectFilter) {
|
|
3655
3660
|
const { onSelectFilter } = props;
|
|
3656
|
-
await onSelectFilter({ selectedRows, value: filter });
|
|
3661
|
+
await onSelectFilter({ selectedRows, selectedRowIds: selectedRows.map((row) => row.id), value: filter });
|
|
3657
3662
|
return true;
|
|
3658
3663
|
}
|
|
3659
3664
|
else {
|