@linzjs/step-ag-grid 1.1.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/README.md +4 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +89342 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/ComponentLoadingWrapper.d.ts +9 -0
- package/dist/src/components/GenericCellClass.d.ts +2 -0
- package/dist/src/components/Grid.d.ts +24 -0
- package/dist/src/components/GridCell.d.ts +31 -0
- package/dist/src/components/GridIcon.d.ts +6 -0
- package/dist/src/components/GridLoadableCell.d.ts +6 -0
- package/dist/src/components/GridPopoutHook.d.ts +7 -0
- package/dist/src/components/GridSubComponentTextArea.d.ts +5 -0
- package/dist/src/components/PostSortRowsHook.d.ts +11 -0
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +26 -0
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +9 -0
- package/dist/src/components/gridForm/GridFormMessage.d.ts +8 -0
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +26 -0
- package/dist/src/components/gridForm/GridFormPopoutMenu.d.ts +24 -0
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +11 -0
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +11 -0
- package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +8 -0
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +4 -0
- package/dist/src/components/gridPopoverEdit/GridPopoutMenu.d.ts +10 -0
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -0
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +4 -0
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +4 -0
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +15 -0
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +3 -0
- package/dist/src/contexts/GridContext.d.ts +25 -0
- package/dist/src/contexts/GridContextProvider.d.ts +11 -0
- package/dist/src/contexts/UpdatingContext.d.ts +6 -0
- package/dist/src/contexts/UpdatingContextProvider.d.ts +7 -0
- package/dist/src/lui/TextAreaInput.d.ts +11 -0
- package/dist/src/lui/TextInputFormatted.d.ts +14 -0
- package/dist/src/setupTests.d.ts +1 -0
- package/dist/src/stories/components/FormTest.d.ts +12 -0
- package/dist/src/stories/components/GridPopoutBearing.stories.d.ts +9 -0
- package/dist/src/stories/components/GridPopoutEditDropDown.stories.d.ts +9 -0
- package/dist/src/stories/components/GridPopoutEditGeneric.stories.d.ts +9 -0
- package/dist/src/stories/components/GridPopoutEditGenericTextArea.stories.d.ts +9 -0
- package/dist/src/stories/components/GridPopoutEditMultiSelect.stories.d.ts +9 -0
- package/dist/src/stories/components/GridReadOnly.stories.d.ts +9 -0
- package/dist/src/utils/bearing.d.ts +5 -0
- package/dist/src/utils/util.d.ts +4 -0
- package/dist/step-ag-grid.esm.js +89297 -0
- package/dist/step-ag-grid.esm.js.map +1 -0
- package/package.json +126 -0
- package/src/components/ComponentLoadingWrapper.tsx +31 -0
- package/src/components/GenericCellClass.tsx +15 -0
- package/src/components/Grid.scss +38 -0
- package/src/components/Grid.tsx +262 -0
- package/src/components/GridCell.tsx +101 -0
- package/src/components/GridIcon.tsx +12 -0
- package/src/components/GridLoadableCell.tsx +22 -0
- package/src/components/GridPopoutHook.tsx +118 -0
- package/src/components/GridSubComponentTextArea.tsx +26 -0
- package/src/components/GridTheme.scss +94 -0
- package/src/components/PostSortRowsHook.ts +131 -0
- package/src/components/gridForm/GridFormDropDown.tsx +192 -0
- package/src/components/gridForm/GridFormEditBearing.scss +3 -0
- package/src/components/gridForm/GridFormEditBearing.tsx +62 -0
- package/src/components/gridForm/GridFormMessage.tsx +34 -0
- package/src/components/gridForm/GridFormMultiSelect.tsx +180 -0
- package/src/components/gridForm/GridFormPopoutMenu.tsx +90 -0
- package/src/components/gridForm/GridFormTextArea.tsx +61 -0
- package/src/components/gridForm/GridFormTextInput.tsx +66 -0
- package/src/components/gridHeader/GridHeaderSelect.tsx +54 -0
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +22 -0
- package/src/components/gridPopoverEdit/GridPopoutMenu.scss +9 -0
- package/src/components/gridPopoverEdit/GridPopoutMenu.tsx +35 -0
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +24 -0
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +22 -0
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +22 -0
- package/src/components/gridRender/GridRenderGenericCell.scss +15 -0
- package/src/components/gridRender/GridRenderGenericCell.tsx +49 -0
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +22 -0
- package/src/contexts/GridContext.tsx +82 -0
- package/src/contexts/GridContextProvider.tsx +292 -0
- package/src/contexts/UpdatingContext.tsx +16 -0
- package/src/contexts/UpdatingContextProvider.tsx +43 -0
- package/src/lui/TextAreaInput.tsx +50 -0
- package/src/lui/TextInputFormatted.scss +11 -0
- package/src/lui/TextInputFormatted.tsx +60 -0
- package/src/lui-overrides.scss +163 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/stories/components/FormTest.scss +10 -0
- package/src/stories/components/FormTest.tsx +51 -0
- package/src/stories/components/GridPopoutBearing.stories.tsx +100 -0
- package/src/stories/components/GridPopoutEditDropDown.stories.tsx +174 -0
- package/src/stories/components/GridPopoutEditGeneric.stories.tsx +76 -0
- package/src/stories/components/GridPopoutEditGenericTextArea.stories.tsx +106 -0
- package/src/stories/components/GridPopoutEditMultiSelect.stories.tsx +111 -0
- package/src/stories/components/GridReadOnly.stories.tsx +151 -0
- package/src/utils/bearing.ts +72 -0
- package/src/utils/util.ts +26 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* If loading is true this returns a loading spinner, otherwise it returns its children.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ComponentLoadingWrapper: (props: {
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
saving?: boolean;
|
|
8
|
+
children: JSX.Element | undefined;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Grid.scss";
|
|
3
|
+
import "./GridTheme.scss";
|
|
4
|
+
import { GridOptions } from "ag-grid-community/dist/lib/entities/gridOptions";
|
|
5
|
+
export interface GridBaseRow {
|
|
6
|
+
id: string | number;
|
|
7
|
+
}
|
|
8
|
+
export interface GridProps {
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
quickFilter?: boolean;
|
|
11
|
+
quickFilterPlaceholder?: string;
|
|
12
|
+
quickFilterValue?: string;
|
|
13
|
+
externalSelectedItems: any[];
|
|
14
|
+
setExternalSelectedItems: (items: any[]) => void;
|
|
15
|
+
onGridReady?: GridOptions["onGridReady"];
|
|
16
|
+
defaultColDef: GridOptions["defaultColDef"];
|
|
17
|
+
columnDefs: GridOptions["columnDefs"];
|
|
18
|
+
rowData: GridOptions["rowData"];
|
|
19
|
+
noRowsOverlayText?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Wrapper for AgGrid to add commonly used functionality.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Grid: (params: GridProps) => JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridBaseRow } from "./Grid";
|
|
3
|
+
import { GenericCellRendererParams } from "./gridRender/GridRenderGenericCell";
|
|
4
|
+
import { ColDef, ICellEditorParams } from "ag-grid-community";
|
|
5
|
+
export interface GridFormProps<RowType extends GridBaseRow> {
|
|
6
|
+
cellEditorParams: ICellEditorParams;
|
|
7
|
+
updateValue: (saveFn: (selectedRows: RowType[]) => Promise<boolean>) => Promise<boolean>;
|
|
8
|
+
saving: boolean;
|
|
9
|
+
value: any;
|
|
10
|
+
field: string | undefined;
|
|
11
|
+
selectedRows: RowType[];
|
|
12
|
+
formProps: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface GenericCellEditorParams<RowType extends GridBaseRow> {
|
|
15
|
+
multiEdit?: boolean;
|
|
16
|
+
form?: (props: GridFormProps<RowType>) => JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export interface GenericCellEditorColDef<RowType extends GridBaseRow, FormProps extends GenericCellEditorParams<RowType>> extends ColDef {
|
|
19
|
+
cellEditorParams?: FormProps;
|
|
20
|
+
cellRendererParams?: GenericCellRendererParams;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* For editing a text area.
|
|
24
|
+
*/
|
|
25
|
+
export declare const GridCell: <RowType extends GridBaseRow, FormProps extends GenericCellEditorParams<RowType>>(props: GenericCellEditorColDef<RowType, FormProps>) => ColDef;
|
|
26
|
+
interface GenericCellEditorICellEditorParams<RowType extends GridBaseRow, FormProps extends Record<string, any>> extends ICellEditorParams {
|
|
27
|
+
data: RowType;
|
|
28
|
+
colDef: GenericCellEditorColDef<RowType, FormProps>;
|
|
29
|
+
}
|
|
30
|
+
export declare const GenericCellEditorComponent: <RowType extends GridBaseRow, FormProps extends Record<string, any>>(props: GenericCellEditorICellEditorParams<RowType, FormProps>) => JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridFormProps } from "./GridCell";
|
|
3
|
+
import { GridBaseRow } from "./Grid";
|
|
4
|
+
export declare const useGridPopoutHook: <RowType extends GridBaseRow>(props: GridFormProps<RowType>, save?: ((selectedRows: any[]) => Promise<boolean>) | undefined) => {
|
|
5
|
+
popoutWrapper: (children: JSX.Element) => JSX.Element;
|
|
6
|
+
triggerSave: (reason?: string) => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PostSortRowsParams } from "ag-grid-community/dist/lib/entities/iCallbackParams";
|
|
2
|
+
interface PostSortRowsHookProps {
|
|
3
|
+
setStaleGrid: (stale: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Retains last sort order from via <AgGrid postRowSort>.
|
|
7
|
+
* Then applies this sort until next sort column change.
|
|
8
|
+
* Handles stale sort, when you edit a row but don't want to re-sort.
|
|
9
|
+
*/
|
|
10
|
+
export declare const usePostSortRowsHook: ({ setStaleGrid }: PostSortRowsHookProps) => ({ api, columnApi, nodes }: PostSortRowsParams) => void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@szhsin/react-menu/dist/index.css";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
5
|
+
export interface GridPopoutEditDropDownSelectedItem<RowType, ValueType> {
|
|
6
|
+
selectedRows: RowType[];
|
|
7
|
+
value: ValueType;
|
|
8
|
+
}
|
|
9
|
+
interface FinalSelectOption<ValueType> {
|
|
10
|
+
value: ValueType;
|
|
11
|
+
label?: JSX.Element | string;
|
|
12
|
+
}
|
|
13
|
+
export declare const MenuSeparatorString = "_____MENU_SEPARATOR_____";
|
|
14
|
+
export declare const MenuSeparator: Readonly<{
|
|
15
|
+
value: "_____MENU_SEPARATOR_____";
|
|
16
|
+
}>;
|
|
17
|
+
export declare type SelectOption<ValueType> = ValueType | FinalSelectOption<ValueType>;
|
|
18
|
+
export interface GridFormPopoutDropDownProps<RowType extends GridBaseRow, ValueType> extends GenericCellEditorParams<RowType> {
|
|
19
|
+
filtered?: "local" | "reload";
|
|
20
|
+
filterPlaceholder?: string;
|
|
21
|
+
onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<RowType, ValueType>) => Promise<void>;
|
|
22
|
+
options: SelectOption<ValueType>[] | ((selectedRows: RowType[], filter?: string) => Promise<SelectOption<ValueType>[]> | SelectOption<ValueType>[]);
|
|
23
|
+
optionsRequestCancel?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const GridFormDropDown: <RowType extends GridBaseRow, ValueType>(props: GridFormProps<RowType>) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./GridFormEditBearing.scss";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
5
|
+
export interface GridFormEditBearingProps<RowType extends GridBaseRow> extends GenericCellEditorParams<RowType> {
|
|
6
|
+
placeHolder: string;
|
|
7
|
+
onSave?: (selectedRows: RowType[], value: number | null) => Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export declare const GridFormEditBearing: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
3
|
+
import { ICellEditorParams } from "ag-grid-community";
|
|
4
|
+
import { GridBaseRow } from "../Grid";
|
|
5
|
+
export interface GridFormMessageProps<RowType extends GridBaseRow> extends GenericCellEditorParams<RowType> {
|
|
6
|
+
message: (selectedRows: RowType[], cellEditorParams: ICellEditorParams) => Promise<string | JSX.Element> | string | JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare const GridFormMessage: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@szhsin/react-menu/dist/index.css";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
5
|
+
interface FinalSelectOption<ValueType> {
|
|
6
|
+
value: ValueType;
|
|
7
|
+
label?: JSX.Element | string;
|
|
8
|
+
subComponent?: (props: any, ref: any) => any;
|
|
9
|
+
}
|
|
10
|
+
export declare const MenuSeparatorString = "_____MENU_SEPARATOR_____";
|
|
11
|
+
export declare const MenuSeparator: Readonly<{
|
|
12
|
+
value: "_____MENU_SEPARATOR_____";
|
|
13
|
+
}>;
|
|
14
|
+
export declare type SelectOption<ValueType> = ValueType | FinalSelectOption<ValueType>;
|
|
15
|
+
export interface MultiSelectResult<RowType> {
|
|
16
|
+
selectedRows: RowType[];
|
|
17
|
+
values: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
export interface GridFormMultiSelectProps<RowType extends GridBaseRow, ValueType> extends GenericCellEditorParams<RowType> {
|
|
20
|
+
filtered?: boolean;
|
|
21
|
+
filterPlaceholder?: string;
|
|
22
|
+
onSave?: (props: MultiSelectResult<RowType>) => Promise<boolean>;
|
|
23
|
+
options: SelectOption<ValueType>[] | ((selectedRows: RowType[]) => Promise<SelectOption<ValueType>[]> | SelectOption<ValueType>[]);
|
|
24
|
+
}
|
|
25
|
+
export declare const GridFormMultiSelect: <RowType extends GridBaseRow, ValueType>(props: GridFormProps<RowType>) => JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridBaseRow } from "../Grid";
|
|
3
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
4
|
+
export interface GridFormPopoutMenuProps<RowType extends GridBaseRow> extends GenericCellEditorParams<RowType> {
|
|
5
|
+
options: (selectedRows: RowType[]) => Promise<MenuOption<RowType>[]>;
|
|
6
|
+
}
|
|
7
|
+
/** Menu configuration types **/
|
|
8
|
+
export declare const MenuSeparator: Readonly<{
|
|
9
|
+
__isMenuSeparator__: true;
|
|
10
|
+
}>;
|
|
11
|
+
interface MenuSeparatorType {
|
|
12
|
+
__isMenuSeparator__: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuOption<RowType> {
|
|
15
|
+
label: JSX.Element | string | MenuSeparatorType;
|
|
16
|
+
action: (selectedRows: RowType[]) => Promise<boolean>;
|
|
17
|
+
multiEdit: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* NOTE: If the popout menu doesn't appear on single click when also selecting row it's because
|
|
21
|
+
* you need a useMemo around your columnDefs
|
|
22
|
+
*/
|
|
23
|
+
export declare const GridFormPopoutMenu: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends GenericCellEditorParams<RowType> {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
maxlength?: number;
|
|
8
|
+
width?: string | number;
|
|
9
|
+
onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
export declare const GridFormTextArea: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GenericCellEditorParams, GridFormProps } from "../GridCell";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
export interface GridFormTextInputProps<RowType extends GridBaseRow> extends GenericCellEditorParams<RowType> {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
maxlength?: number;
|
|
8
|
+
width?: string | number;
|
|
9
|
+
onSave?: (selectedRows: RowType[], value: string) => Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
export declare const GridFormTextInput: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IHeaderParams } from "ag-grid-community";
|
|
3
|
+
/**
|
|
4
|
+
* AgGrid's existing select header doesn't work the way we want.
|
|
5
|
+
* If you have partial select then clicking the header checkbox will select all,
|
|
6
|
+
* but we want to deselect all on partial select.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GridHeaderSelect: ({ api }: IHeaderParams) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
2
|
+
import { GridBaseRow } from "../Grid";
|
|
3
|
+
import { GridFormMultiSelectProps } from "../gridForm/GridFormMultiSelect";
|
|
4
|
+
export declare const GridPopoutEditMultiSelect: <RowType extends GridBaseRow, ValueType>(colDef: GenericCellColDef<RowType, GridFormMultiSelectProps<RowType, ValueType>>) => import("ag-grid-community").ColDef;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./GridPopoutMenu.scss";
|
|
2
|
+
import "@szhsin/react-menu/dist/index.css";
|
|
3
|
+
import { ColDef } from "ag-grid-community";
|
|
4
|
+
import { GridBaseRow } from "../Grid";
|
|
5
|
+
import { GridFormPopoutMenuProps } from "../gridForm/GridFormPopoutMenu";
|
|
6
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
7
|
+
/**
|
|
8
|
+
* Popout burger menu
|
|
9
|
+
*/
|
|
10
|
+
export declare const GridPopoutMenu: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType, GridFormPopoutMenuProps<RowType>>) => ColDef;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
2
|
+
import { GridFormEditBearingProps } from "../gridForm/GridFormEditBearing";
|
|
3
|
+
import { GridBaseRow } from "../Grid";
|
|
4
|
+
export declare const GridPopoverEditBearing: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType, GridFormEditBearingProps<RowType>>) => import("ag-grid-community").ColDef;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
2
|
+
import { GridBaseRow } from "../Grid";
|
|
3
|
+
import { GridFormPopoutDropDownProps } from "../gridForm/GridFormDropDown";
|
|
4
|
+
export declare const GridPopoverEditDropDown: <RowType extends GridBaseRow, ValueType>(colDef: GenericCellColDef<RowType, GridFormPopoutDropDownProps<RowType, ValueType>>) => import("ag-grid-community").ColDef;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GridFormMessageProps } from "../gridForm/GridFormMessage";
|
|
2
|
+
import { GridBaseRow } from "../Grid";
|
|
3
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
4
|
+
export declare const GridPopoverMessage: <RowType extends GridBaseRow>(colDef: GenericCellColDef<RowType, GridFormMessageProps<RowType>>) => import("ag-grid-community").ColDef;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./GridRenderGenericCell.scss";
|
|
3
|
+
import { ColDef, ICellRendererParams } from "ag-grid-community";
|
|
4
|
+
import { GenericCellEditorParams } from "../GridCell";
|
|
5
|
+
import { GridBaseRow } from "../Grid";
|
|
6
|
+
export interface GenericCellColDef<RowType extends GridBaseRow, FormProps extends Record<string, any>> extends ColDef {
|
|
7
|
+
cellRendererParams?: GenericCellRendererParams;
|
|
8
|
+
cellEditorParams?: GenericCellEditorParams<RowType> & FormProps;
|
|
9
|
+
}
|
|
10
|
+
export interface GenericCellRendererParams {
|
|
11
|
+
singleClickEdit?: boolean;
|
|
12
|
+
warning?: (props: ICellRendererParams) => string | boolean | undefined;
|
|
13
|
+
info?: (props: ICellRendererParams) => string | boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const GridRendererGenericCell: (props: ICellRendererParams) => JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridApi } from "ag-grid-community";
|
|
3
|
+
import { GridBaseRow } from "../components/Grid";
|
|
4
|
+
export interface GridContextType {
|
|
5
|
+
gridReady: () => boolean;
|
|
6
|
+
setGridApi: (gridApi: GridApi | undefined) => void;
|
|
7
|
+
setQuickFilter: (quickFilter: string) => void;
|
|
8
|
+
editingCells: () => boolean;
|
|
9
|
+
getSelectedRows: <T extends unknown>() => T[];
|
|
10
|
+
getSelectedRowIds: () => number[];
|
|
11
|
+
selectRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
12
|
+
selectRowsWithFlashDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
13
|
+
selectRowsById: (rowIds?: number[]) => void;
|
|
14
|
+
selectRowsByIdWithFlash: (rowIds?: number[]) => void;
|
|
15
|
+
flashRows: (rowIds?: number[]) => void;
|
|
16
|
+
flashRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
17
|
+
ensureRowVisible: (id: number) => void;
|
|
18
|
+
ensureSelectedRowIsVisible: () => void;
|
|
19
|
+
stopEditing: () => void;
|
|
20
|
+
updatingCells: (props: {
|
|
21
|
+
selectedRows: GridBaseRow[];
|
|
22
|
+
field?: string;
|
|
23
|
+
}, fnUpdate: (selectedRows: any[]) => Promise<boolean>, setSaving?: (saving: boolean) => void) => Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export declare const GridContext: import("react").Context<GridContextType>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
interface GridContextProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Context for AgGrid operations.
|
|
7
|
+
* Make sure you wrap AgGrid in this.
|
|
8
|
+
* Also, make sure the provider is created in a separate component, otherwise it won't be found.
|
|
9
|
+
*/
|
|
10
|
+
export declare const GridContextProvider: (props: GridContextProps) => ReactElement;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type UpdatingContextType = {
|
|
3
|
+
checkUpdating: (fields: string | string[], id: number | string) => boolean;
|
|
4
|
+
modifyUpdating: (field: string, ids: (number | string)[], fn: () => void | Promise<void>) => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare const UpdatingContext: import("react").Context<UpdatingContextType>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface UpdatingContextProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare type UpdatingContextStatus = Record<string, (number | string)[] | undefined>;
|
|
6
|
+
export declare const UpdatingContextProvider: (props: UpdatingContextProviderProps) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeEventHandler, InputHTMLAttributes } from "react";
|
|
2
|
+
export declare const useGenerateOrDefaultId: (idFromProps?: string) => string;
|
|
3
|
+
export interface LuiTextAreaInputProps {
|
|
4
|
+
label?: JSX.Element | string;
|
|
5
|
+
mandatory?: boolean;
|
|
6
|
+
inputProps?: InputHTMLAttributes<HTMLTextAreaElement>;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
8
|
+
value: string;
|
|
9
|
+
error?: string | boolean | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextAreaInput: (props: LuiTextAreaInputProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./TextInputFormatted.scss";
|
|
2
|
+
import { ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes } from "react";
|
|
3
|
+
export interface LuiTextInputProps {
|
|
4
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
5
|
+
inputProps?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
6
|
+
error?: string | boolean | null;
|
|
7
|
+
warning?: string | boolean | null;
|
|
8
|
+
className?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
icon?: JSX.Element;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
formatted: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const TextInputFormatted: (props: LuiTextInputProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./FormTest.scss";
|
|
3
|
+
import { GridFormProps } from "../../components/GridCell";
|
|
4
|
+
import { GridBaseRow } from "../../components/Grid";
|
|
5
|
+
export interface IFormTestRow {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
nameType: string;
|
|
9
|
+
numba: string;
|
|
10
|
+
plan: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormTest: <RowType extends GridBaseRow>(props: GridFormProps<RowType>) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Bearings: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const EditDropdown: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const EditGeneric: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const EditGenericTextArea: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const EditMultiSelect: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "@linzjs/lui/dist/scss/base.scss";
|
|
3
|
+
import "@linzjs/lui/dist/fonts";
|
|
4
|
+
import "../../lui-overrides.scss";
|
|
5
|
+
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
6
|
+
import { GridProps } from "../../components/Grid";
|
|
7
|
+
declare const _default: ComponentMeta<(params: GridProps) => JSX.Element>;
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const ReadOnly: ComponentStory<(params: GridProps) => JSX.Element>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
|
|
2
|
+
export declare const bearingValueFormatter: (params: ValueFormatterParams) => string;
|
|
3
|
+
export declare const bearingNumberParser: (value: string) => number | null;
|
|
4
|
+
export declare const bearingStringValidator: (value: string) => string | null;
|
|
5
|
+
export declare const convertDDToDMS: (dd: number | null, showPositiveSymbol?: boolean, addTrailingZeros?: boolean) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isNotEmpty: (obj: Set<any> | Map<any, any> | Record<any, any> | any[] | undefined) => boolean;
|
|
2
|
+
export declare const wait: (timeoutMs: number) => Promise<(string | null)[]>;
|
|
3
|
+
export declare const isFloat: (value: string) => boolean;
|
|
4
|
+
export declare const hasParentClass: (className: string, child: Node) => boolean;
|