@linzjs/step-ag-grid 2.5.0 → 3.0.1
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/index.js +361 -282
- package/dist/index.js.map +1 -1
- package/dist/src/components/GridCell.d.ts +4 -7
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +8 -3
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -1
- package/dist/src/contexts/GridPopoverContext.d.ts +10 -6
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +3 -1
- package/dist/src/lui/TextInputFormatted.d.ts +0 -1
- package/dist/step-ag-grid.esm.js +362 -283
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridCell.tsx +9 -33
- package/src/components/GridPopoverHook.tsx +4 -8
- package/src/components/GridSubComponentTextArea.tsx +0 -6
- package/src/components/gridForm/GridFormDropDown.tsx +35 -37
- package/src/components/gridForm/GridFormEditBearing.tsx +12 -8
- package/src/components/gridForm/GridFormMessage.tsx +8 -6
- package/src/components/gridForm/GridFormMultiSelect.tsx +56 -48
- package/src/components/gridForm/GridFormPopoverMenu.tsx +112 -29
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +2 -1
- package/src/components/gridForm/GridFormTextArea.tsx +11 -9
- package/src/components/gridForm/GridFormTextInput.tsx +13 -16
- package/src/contexts/GridPopoverContext.tsx +18 -9
- package/src/contexts/GridPopoverContextProvider.tsx +24 -27
- package/src/lui/TextAreaInput.tsx +13 -1
- package/src/lui/TextInputFormatted.tsx +3 -2
- package/src/react-menu3/components/MenuList.tsx +42 -10
- package/src/react-menu3/contexts/SettingsContext.ts +1 -1
- package/src/stories/grid/FormTest.tsx +17 -15
- package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +3 -1
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +0 -1
- package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +3 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +15 -5
|
@@ -10,6 +10,7 @@ export interface GenericCellEditorProps<E> {
|
|
|
10
10
|
export declare const GridCellRenderer: (props: ICellRendererParams) => JSX.Element;
|
|
11
11
|
export interface ColDefT<RowType extends GridBaseRow> extends ColDef {
|
|
12
12
|
_?: RowType;
|
|
13
|
+
editor?: (editorProps: any) => JSX.Element;
|
|
13
14
|
}
|
|
14
15
|
export declare const GridCell: <RowType extends GridBaseRow, Props extends CellEditorCommon>(props: GenericCellColDef<RowType>, custom?: {
|
|
15
16
|
multiEdit?: boolean | undefined;
|
|
@@ -19,10 +20,6 @@ export declare const GridCell: <RowType extends GridBaseRow, Props extends CellE
|
|
|
19
20
|
export interface CellEditorCommon {
|
|
20
21
|
className?: string | undefined;
|
|
21
22
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
field: string | undefined;
|
|
26
|
-
selectedRows: RowType[];
|
|
27
|
-
}
|
|
28
|
-
export declare const GenericCellEditorComponent: (editor: (props: any) => JSX.Element) => import("react").ForwardRefExoticComponent<ICellEditorParams & import("react").RefAttributes<unknown>>;
|
|
23
|
+
export declare const GenericCellEditorComponentWrapper: (custom?: {
|
|
24
|
+
editor?: ((props: any) => JSX.Element) | undefined;
|
|
25
|
+
} | undefined) => import("react").ForwardRefExoticComponent<ICellEditorParams & import("react").RefAttributes<unknown>>;
|
|
@@ -32,5 +32,5 @@ export interface GridFormPopoutDropDownProps<RowType extends GridBaseRow, ValueT
|
|
|
32
32
|
options: SelectOption<ValueType>[] | ((selectedRows: RowType[], filter?: string) => Promise<SelectOption<ValueType>[]> | SelectOption<ValueType>[]);
|
|
33
33
|
optionsRequestCancel?: () => void;
|
|
34
34
|
}
|
|
35
|
-
export declare const GridFormDropDown: <RowType extends GridBaseRow, ValueType>(
|
|
35
|
+
export declare const GridFormDropDown: <RowType extends GridBaseRow, ValueType>(props: GridFormPopoutDropDownProps<RowType, ValueType>) => JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -7,4 +7,4 @@ export interface GridFormEditBearingProps<RowType extends GridBaseRow> extends C
|
|
|
7
7
|
range?: (value: number | null) => string | null;
|
|
8
8
|
onSave?: (selectedRows: RowType[], value: number | null) => Promise<boolean>;
|
|
9
9
|
}
|
|
10
|
-
export declare const GridFormEditBearing: <RowType extends GridBaseRow>(
|
|
10
|
+
export declare const GridFormEditBearing: <RowType extends GridBaseRow>(props: GridFormEditBearingProps<RowType>) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
|
-
import { CellEditorCommon
|
|
3
|
+
import { CellEditorCommon } from "../GridCell";
|
|
4
4
|
export interface GridFormMessageProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
5
|
-
message: (
|
|
5
|
+
message: (selectedRows: RowType[]) => Promise<string | JSX.Element> | string | JSX.Element;
|
|
6
6
|
}
|
|
7
|
-
export declare const GridFormMessage: <RowType extends GridBaseRow>(
|
|
7
|
+
export declare const GridFormMessage: <RowType extends GridBaseRow>(props: GridFormMessageProps<RowType>) => JSX.Element;
|
|
@@ -9,7 +9,7 @@ interface MultiFinalSelectOption<ValueType> {
|
|
|
9
9
|
}
|
|
10
10
|
export declare type MultiSelectOption<ValueType> = ValueType | MultiFinalSelectOption<ValueType>;
|
|
11
11
|
export interface SelectedOptionResult<ValueType> extends MultiFinalSelectOption<ValueType> {
|
|
12
|
-
subValue
|
|
12
|
+
subValue?: any;
|
|
13
13
|
}
|
|
14
14
|
export interface GridFormMultiSelectProps<RowType extends GridBaseRow, ValueType> extends CellEditorCommon {
|
|
15
15
|
className?: "GridMultiSelect-containerSmall" | "GridMultiSelect-containerMedium" | "GridMultiSelect-containerLarge" | "GridMultiSelect-containerUnlimited" | string | undefined;
|
|
@@ -17,7 +17,7 @@ export interface GridFormMultiSelectProps<RowType extends GridBaseRow, ValueType
|
|
|
17
17
|
filterPlaceholder?: string;
|
|
18
18
|
onSave?: (selectedRows: RowType[], selectedOptions: SelectedOptionResult<ValueType>[]) => Promise<boolean>;
|
|
19
19
|
options: MultiSelectOption<ValueType>[] | ((selectedRows: RowType[]) => Promise<MultiSelectOption<ValueType>[]> | MultiSelectOption<ValueType>[]);
|
|
20
|
-
initialSelectedValues?: (selectedRows: RowType[]) => any[] | Record<string, any>;
|
|
20
|
+
initialSelectedValues?: (selectedRows: RowType[]) => any[] | Record<string, null | any>;
|
|
21
21
|
}
|
|
22
22
|
export declare const GridFormMultiSelect: <RowType extends GridBaseRow, ValueType>(props: GridFormMultiSelectProps<RowType, ValueType>) => JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -3,6 +3,7 @@ import { GridBaseRow } from "../Grid";
|
|
|
3
3
|
import { CellEditorCommon } from "../GridCell";
|
|
4
4
|
export interface GridFormPopoutMenuProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
5
5
|
options: (selectedRows: RowType[]) => Promise<MenuOption<RowType>[]>;
|
|
6
|
+
defaultAction?: (selectedRows: RowType[], menuOption: SelectedMenuOptionResult<RowType>) => Promise<void>;
|
|
6
7
|
}
|
|
7
8
|
/** Menu configuration types **/
|
|
8
9
|
export declare const PopoutMenuSeparator: Readonly<{
|
|
@@ -11,16 +12,20 @@ export declare const PopoutMenuSeparator: Readonly<{
|
|
|
11
12
|
interface MenuSeparatorType {
|
|
12
13
|
__isMenuSeparator__: boolean;
|
|
13
14
|
}
|
|
14
|
-
export interface MenuOption<RowType> {
|
|
15
|
+
export interface SelectedMenuOptionResult<RowType extends GridBaseRow> extends MenuOption<RowType> {
|
|
16
|
+
subValue: any;
|
|
17
|
+
}
|
|
18
|
+
export interface MenuOption<RowType extends GridBaseRow> {
|
|
15
19
|
label: JSX.Element | string | MenuSeparatorType;
|
|
16
|
-
action?: (selectedRows: RowType[]) => Promise<
|
|
20
|
+
action?: (selectedRows: RowType[], menuOption: SelectedMenuOptionResult<RowType>) => Promise<void>;
|
|
17
21
|
disabled?: string | boolean;
|
|
18
22
|
supportsMultiEdit: boolean;
|
|
19
23
|
hidden?: boolean;
|
|
24
|
+
subComponent?: (props: any) => JSX.Element;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* NOTE: If the popout menu doesn't appear on single click when also selecting row it's because
|
|
23
28
|
* you need a useMemo around your columnDefs
|
|
24
29
|
*/
|
|
25
|
-
export declare const GridFormPopoverMenu: <RowType extends GridBaseRow>(
|
|
30
|
+
export declare const GridFormPopoverMenu: <RowType extends GridBaseRow>(props: GridFormPopoutMenuProps<RowType>) => JSX.Element;
|
|
26
31
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { KeyboardEvent } from "react";
|
|
2
1
|
import "../../styles/GridFormSubComponentTextInput.scss";
|
|
2
|
+
import { KeyboardEvent } from "react";
|
|
3
3
|
export interface GridFormSubComponentTextInput {
|
|
4
4
|
setValue: (value: string) => void;
|
|
5
5
|
keyDown: (key: string, event: KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -9,4 +9,4 @@ export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends Cell
|
|
|
9
9
|
validate?: (value: string) => string | null;
|
|
10
10
|
onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
|
|
11
11
|
}
|
|
12
|
-
export declare const GridFormTextArea: <RowType extends GridBaseRow>(
|
|
12
|
+
export declare const GridFormTextArea: <RowType extends GridBaseRow>(props: GridFormTextAreaProps<RowType>) => JSX.Element;
|
|
@@ -10,4 +10,4 @@ export interface GridFormTextInputProps<RowType extends GridBaseRow> extends Cel
|
|
|
10
10
|
validate?: (value: string, data: RowType) => string | null;
|
|
11
11
|
onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
|
|
12
12
|
}
|
|
13
|
-
export declare const GridFormTextInput: <RowType extends GridBaseRow>(
|
|
13
|
+
export declare const GridFormTextInput: <RowType extends GridBaseRow>(props: GridFormTextInputProps<RowType>) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { GridBaseRow } from "../components/Grid";
|
|
3
3
|
export interface PropsType {
|
|
4
4
|
value: any;
|
|
5
5
|
data: any;
|
|
@@ -7,11 +7,15 @@ export interface PropsType {
|
|
|
7
7
|
selectedRows: any[];
|
|
8
8
|
updateValue: (saveFn: (selectedRows: any[]) => Promise<boolean>) => Promise<boolean>;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export interface GridPopoverContextType<RowType extends GridBaseRow> {
|
|
11
11
|
anchorRef: RefObject<Element>;
|
|
12
12
|
saving: boolean;
|
|
13
13
|
setSaving: (saving: boolean) => void;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
field: keyof RowType;
|
|
15
|
+
value: any;
|
|
16
|
+
data: RowType;
|
|
17
|
+
selectedRows: RowType[];
|
|
18
|
+
updateValue: (saveFn: (selectedRows: any[]) => Promise<boolean>) => Promise<boolean>;
|
|
19
|
+
}
|
|
20
|
+
export declare const GridPopoverContext: import("react").Context<GridPopoverContextType<any>>;
|
|
21
|
+
export declare const useGridPopoverContext: <RowType extends GridBaseRow>() => GridPopoverContextType<RowType>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { ICellEditorParams } from "ag-grid-community";
|
|
2
3
|
interface GridPopoverContextProps {
|
|
4
|
+
props: ICellEditorParams;
|
|
3
5
|
children: ReactNode;
|
|
4
6
|
}
|
|
5
|
-
export declare const GridPopoverContextProvider: (props: GridPopoverContextProps) => JSX.Element;
|
|
7
|
+
export declare const GridPopoverContextProvider: ({ props, children }: GridPopoverContextProps) => JSX.Element;
|
|
6
8
|
export {};
|