@linzjs/step-ag-grid 2.1.2 → 2.1.3
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 +2 -2
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/src/components/Grid.d.ts +1 -0
- package/dist/src/components/GridCell.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormMessage.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormPopoutMenu.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/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +1 -1
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +1 -1
- package/dist/src/contexts/GridContext.d.ts +1 -1
- package/dist/src/index.d.ts +28 -28
- package/dist/step-ag-grid.esm.js +16 -11
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +3 -2
- package/src/components/Grid.tsx +5 -4
- package/src/components/GridCell.tsx +7 -7
- package/src/components/GridPopoverHook.tsx +3 -3
- package/src/components/PostSortRowsHook.ts +8 -2
- package/src/components/gridForm/GridFormDropDown.tsx +2 -2
- package/src/components/gridForm/GridFormEditBearing.tsx +2 -2
- package/src/components/gridForm/GridFormMessage.tsx +1 -1
- package/src/components/gridForm/GridFormMultiSelect.tsx +3 -3
- package/src/components/gridForm/GridFormPopoutMenu.tsx +3 -3
- package/src/components/gridForm/GridFormTextArea.tsx +1 -1
- package/src/components/gridForm/GridFormTextInput.tsx +1 -1
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +1 -3
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +2 -4
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +1 -3
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +1 -1
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +1 -1
- package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +1 -1
- package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +1 -1
- package/src/components/gridRender/GridRenderGenericCell.tsx +2 -2
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +1 -1
- package/src/contexts/GridContext.tsx +1 -1
- package/src/contexts/GridContextProvider.tsx +2 -2
- package/src/contexts/GridPopoverContextProvider.tsx +2 -2
- package/src/index.ts +28 -28
- package/src/react-menu3/components/ControlledMenu.tsx +1 -1
- package/src/stories/components/FormTest.tsx +4 -4
- package/src/stories/components/GridPopoutBearing.stories.tsx +6 -6
- package/src/stories/components/GridPopoutEditDropDown.stories.tsx +7 -7
- package/src/stories/components/GridPopoutEditGeneric.stories.tsx +4 -4
- package/src/stories/components/GridPopoutEditGenericTextArea.stories.tsx +7 -7
- package/src/stories/components/GridPopoutEditMultiSelect.stories.tsx +9 -9
- package/src/stories/components/GridReadOnly.stories.tsx +7 -7
- package/src/stories/components/ReactMenu.stories.tsx +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@linzjs/step-ag-grid",
|
|
3
3
|
"repository": "github:linz/step-ag-grid.git",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"aggrid",
|
|
8
8
|
"ag-grid",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"react-component"
|
|
14
14
|
],
|
|
15
15
|
"main": "dist/index.js",
|
|
16
|
-
"typings": "dist/index.d.ts",
|
|
16
|
+
"typings": "dist/src/index.d.ts",
|
|
17
17
|
"module": "dist/step-ag-grid.esm.js",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"babel-jest": "^29.2.2",
|
|
106
106
|
"babel-preset-react-app": "^10.0.1",
|
|
107
107
|
"chromatic": "^6.11.4",
|
|
108
|
+
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
108
109
|
"eslint": "^8.26.0",
|
|
109
110
|
"eslint-config-prettier": "^8.5.0",
|
|
110
111
|
"eslint-config-react-app": "^7.0.1",
|
package/src/components/Grid.tsx
CHANGED
|
@@ -5,11 +5,11 @@ import { CellClickedEvent, ColDef } from "ag-grid-community";
|
|
|
5
5
|
import { CellEvent, GridReadyEvent, SelectionChangedEvent } from "ag-grid-community/dist/lib/events";
|
|
6
6
|
import { GridOptions } from "ag-grid-community/dist/lib/entities/gridOptions";
|
|
7
7
|
import { difference, last, xorBy } from "lodash-es";
|
|
8
|
-
import { GridContext } from "
|
|
8
|
+
import { GridContext } from "../contexts/GridContext";
|
|
9
9
|
import { usePostSortRowsHook } from "./PostSortRowsHook";
|
|
10
|
-
import { isNotEmpty } from "
|
|
10
|
+
import { isNotEmpty } from "../utils/util";
|
|
11
11
|
import { GridHeaderSelect } from "./gridHeader/GridHeaderSelect";
|
|
12
|
-
import { GridUpdatingContext } from "
|
|
12
|
+
import { GridUpdatingContext } from "../contexts/GridUpdatingContext";
|
|
13
13
|
|
|
14
14
|
export interface GridBaseRow {
|
|
15
15
|
id: string | number;
|
|
@@ -28,6 +28,7 @@ export interface GridProps {
|
|
|
28
28
|
columnDefs: GridOptions["columnDefs"];
|
|
29
29
|
rowData: GridOptions["rowData"];
|
|
30
30
|
noRowsOverlayText?: string;
|
|
31
|
+
postSortRows?: GridOptions["postSortRows"];
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -264,7 +265,7 @@ export const Grid = (params: GridProps): JSX.Element => {
|
|
|
264
265
|
noRowsOverlayComponent={noRowsOverlayComponent}
|
|
265
266
|
onGridReady={onGridReady}
|
|
266
267
|
onSortChanged={ensureSelectedRowIsVisible}
|
|
267
|
-
postSortRows={postSortRows}
|
|
268
|
+
postSortRows={params.postSortRows ?? postSortRows}
|
|
268
269
|
onSelectionChanged={synchroniseExternalStateToGridSelection}
|
|
269
270
|
/>
|
|
270
271
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, useContext } from "react";
|
|
2
2
|
import { GridBaseRow } from "./Grid";
|
|
3
|
-
import { GridUpdatingContext } from "
|
|
3
|
+
import { GridUpdatingContext } from "../contexts/GridUpdatingContext";
|
|
4
4
|
import { GenericMultiEditCellClass } from "./GenericCellClass";
|
|
5
5
|
import {
|
|
6
6
|
GenericCellColDef,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./gridRender/GridRenderGenericCell";
|
|
10
10
|
import { ColDef, ICellEditorParams, ICellRendererParams } from "ag-grid-community";
|
|
11
11
|
import { GridLoadableCell } from "./GridLoadableCell";
|
|
12
|
-
import { GridIcon } from "
|
|
12
|
+
import { GridIcon } from "../components/GridIcon";
|
|
13
13
|
import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
|
|
14
|
-
import { GridPopoverContext } from "
|
|
15
|
-
import { GridPopoverContextProvider } from "
|
|
14
|
+
import { GridPopoverContext } from "../contexts/GridPopoverContext";
|
|
15
|
+
import { GridPopoverContextProvider } from "../contexts/GridPopoverContextProvider";
|
|
16
16
|
|
|
17
17
|
export interface GenericCellEditorProps<E> {
|
|
18
18
|
multiEdit?: boolean;
|
|
@@ -49,9 +49,9 @@ export interface ColDefT<RowType extends GridBaseRow> extends ColDef {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/*
|
|
52
|
-
*
|
|
52
|
+
* All cells should use this
|
|
53
53
|
*/
|
|
54
|
-
export const GridCell = <RowType extends GridBaseRow, Props>(
|
|
54
|
+
export const GridCell = <RowType extends GridBaseRow, Props extends CellEditorCommon>(
|
|
55
55
|
props: GenericCellColDef<RowType>,
|
|
56
56
|
custom?: {
|
|
57
57
|
multiEdit?: boolean;
|
|
@@ -120,7 +120,7 @@ const GenericCellEditorComponent3 = (props: ICellEditorParams & { editor: (props
|
|
|
120
120
|
|
|
121
121
|
return (
|
|
122
122
|
<>
|
|
123
|
-
|
|
123
|
+
{<colDef.cellRenderer {...props} />}
|
|
124
124
|
{props?.editor && <props.editor {...cellEditorParams} {...propsRef.current} />}
|
|
125
125
|
</>
|
|
126
126
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { GridContext } from "
|
|
2
|
+
import { GridContext } from "../contexts/GridContext";
|
|
3
3
|
import { GridBaseRow } from "./Grid";
|
|
4
|
-
import { ControlledMenu } from "
|
|
5
|
-
import { GridPopoverContext } from "
|
|
4
|
+
import { ControlledMenu } from "../react-menu3";
|
|
5
|
+
import { GridPopoverContext } from "../contexts/GridPopoverContext";
|
|
6
6
|
|
|
7
7
|
export interface GridPopoverHookProps<RowType> {
|
|
8
8
|
className: string | undefined;
|
|
@@ -53,8 +53,13 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
53
53
|
|
|
54
54
|
const hasNewRows = () => nodes.some((row) => previousRowSortIndex[row.data.id] == null);
|
|
55
55
|
|
|
56
|
-
const sortIsStale = () =>
|
|
57
|
-
|
|
56
|
+
const sortIsStale = () => {
|
|
57
|
+
// If there are new rows we want to them to be at the bottom of the grid, so we treat it as sort not stale
|
|
58
|
+
if (hasNewRows()) return false;
|
|
59
|
+
|
|
60
|
+
// Otherwise check if the stored sort index matches the new sort index
|
|
61
|
+
return nodes.some((node, index) => previousRowSortIndex[node.data.id] != index);
|
|
62
|
+
};
|
|
58
63
|
|
|
59
64
|
const sortNodesByPreviousSort = () =>
|
|
60
65
|
nodes.sort(
|
|
@@ -115,6 +120,7 @@ export const usePostSortRowsHook = ({ setStaleGrid }: PostSortRowsHookProps) =>
|
|
|
115
120
|
if (!sortWasStale.current) {
|
|
116
121
|
// backup sort state, so we can restore it when sort is clicked on a stale column
|
|
117
122
|
previousColSort.current = copyCurrentSortSettings();
|
|
123
|
+
backupSortOrder();
|
|
118
124
|
sortWasStale.current = true;
|
|
119
125
|
setStaleGrid(true);
|
|
120
126
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../../styles/GridFormDropDown.scss";
|
|
2
2
|
|
|
3
|
-
import { MenuItem, MenuDivider, FocusableItem, MenuHeader } from "
|
|
3
|
+
import { MenuItem, MenuDivider, FocusableItem, MenuHeader } from "../../react-menu3";
|
|
4
4
|
import { useCallback, useContext, useEffect, useRef, useState, KeyboardEvent } from "react";
|
|
5
5
|
import { GridBaseRow } from "../Grid";
|
|
6
6
|
import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
|
|
7
|
-
import { GridContext } from "
|
|
7
|
+
import { GridContext } from "../../contexts/GridContext";
|
|
8
8
|
import { delay } from "lodash-es";
|
|
9
9
|
import debounce from "debounce-promise";
|
|
10
10
|
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
@@ -3,9 +3,9 @@ import "../../styles/GridFormEditBearing.scss";
|
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
5
|
import { TextInputFormatted } from "../../lui/TextInputFormatted";
|
|
6
|
-
import { bearingNumberParser, bearingStringValidator, convertDDToDMS } from "
|
|
6
|
+
import { bearingNumberParser, bearingStringValidator, convertDDToDMS } from "../../utils/bearing";
|
|
7
7
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
8
|
-
import { CellEditorCommon, CellParams } from "
|
|
8
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
9
9
|
|
|
10
10
|
export interface GridFormEditBearingProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
11
11
|
placeHolder?: string;
|
|
@@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
5
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
6
|
-
import { CellEditorCommon, CellParams } from "
|
|
6
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
7
7
|
|
|
8
8
|
export interface GridFormMessageProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
9
9
|
message: (cellParams: CellParams<RowType>) => Promise<string | JSX.Element> | string | JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "../../styles/GridFormMultiSelect.scss";
|
|
2
2
|
|
|
3
|
-
import { MenuItem, MenuDivider, FocusableItem } from "
|
|
3
|
+
import { MenuItem, MenuDivider, FocusableItem } from "../../react-menu3";
|
|
4
4
|
import { useCallback, useEffect, useRef, useState, KeyboardEvent } from "react";
|
|
5
5
|
import { GridBaseRow } from "../Grid";
|
|
6
6
|
import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
|
|
7
7
|
import { delay, fromPairs } from "lodash-es";
|
|
8
8
|
import { LuiCheckboxInput } from "@linzjs/lui";
|
|
9
9
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
10
|
-
import { MenuSeparatorString } from "
|
|
11
|
-
import { CellEditorCommon, CellParams } from "
|
|
10
|
+
import { MenuSeparatorString } from "./GridFormDropDown";
|
|
11
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
12
12
|
import { ClickEvent } from "../../react-menu3/types";
|
|
13
13
|
|
|
14
14
|
interface MultiFinalSelectOption<ValueType> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GridBaseRow } from "../Grid";
|
|
2
2
|
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { GridContext } from "
|
|
3
|
+
import { GridContext } from "../../contexts/GridContext";
|
|
4
4
|
import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
|
|
5
|
-
import { MenuDivider, MenuItem } from "
|
|
5
|
+
import { MenuDivider, MenuItem } from "../../react-menu3";
|
|
6
6
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
7
|
-
import { CellEditorCommon, CellParams } from "
|
|
7
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
8
8
|
|
|
9
9
|
export interface GridFormPopoutMenuProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
10
10
|
options: (selectedRows: RowType[]) => Promise<MenuOption<RowType>[]>;
|
|
@@ -2,7 +2,7 @@ import { useCallback, useState } from "react";
|
|
|
2
2
|
import { TextAreaInput } from "../../lui/TextAreaInput";
|
|
3
3
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
|
-
import { CellEditorCommon, CellParams } from "
|
|
5
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
6
6
|
|
|
7
7
|
export interface GridFormTextAreaProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
8
8
|
placeholder?: string;
|
|
@@ -2,7 +2,7 @@ import { useCallback, useState } from "react";
|
|
|
2
2
|
import { TextInputFormatted } from "../../lui/TextInputFormatted";
|
|
3
3
|
import { useGridPopoverHook } from "../GridPopoverHook";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
|
-
import { CellEditorCommon, CellParams } from "
|
|
5
|
+
import { CellEditorCommon, CellParams } from "../GridCell";
|
|
6
6
|
|
|
7
7
|
export interface GridFormTextInputProps<RowType extends GridBaseRow> extends CellEditorCommon {
|
|
8
8
|
placeholder?: string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { GenericMultiEditCellClass } from "../GenericCellClass";
|
|
2
1
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
3
2
|
import { GridBaseRow } from "../Grid";
|
|
4
3
|
import { GridFormMultiSelect, GridFormMultiSelectProps } from "../gridForm/GridFormMultiSelect";
|
|
5
|
-
import { GenericCellColDef } from "
|
|
4
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
6
5
|
|
|
7
6
|
export const GridPopoutEditMultiSelect = <RowType extends GridBaseRow, ValueType>(
|
|
8
7
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -12,7 +11,6 @@ export const GridPopoutEditMultiSelect = <RowType extends GridBaseRow, ValueType
|
|
|
12
11
|
{
|
|
13
12
|
initialWidth: 65,
|
|
14
13
|
maxWidth: 150,
|
|
15
|
-
cellClass: props.multiEdit ? GenericMultiEditCellClass : undefined,
|
|
16
14
|
...colDef,
|
|
17
15
|
},
|
|
18
16
|
{
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bearingCorrectionValueFormatter, bearingValueFormatter } from "@utils/bearing";
|
|
1
|
+
import { bearingCorrectionValueFormatter, bearingValueFormatter } from "../../utils/bearing";
|
|
3
2
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
4
3
|
import { GridFormEditBearing, GridFormEditBearingProps } from "../gridForm/GridFormEditBearing";
|
|
5
4
|
import { GridBaseRow } from "../Grid";
|
|
6
|
-
import { GenericCellColDef } from "
|
|
5
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
7
6
|
|
|
8
7
|
export const GridPopoverEditBearingLike = <RowType extends GridBaseRow>(
|
|
9
8
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -14,7 +13,6 @@ export const GridPopoverEditBearingLike = <RowType extends GridBaseRow>(
|
|
|
14
13
|
initialWidth: 65,
|
|
15
14
|
maxWidth: 150,
|
|
16
15
|
valueFormatter: bearingValueFormatter,
|
|
17
|
-
cellClass: props.multiEdit ? GenericMultiEditCellClass : undefined,
|
|
18
16
|
...colDef,
|
|
19
17
|
},
|
|
20
18
|
{
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { GenericMultiEditCellClass } from "../GenericCellClass";
|
|
2
1
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
3
2
|
import { GridBaseRow } from "../Grid";
|
|
4
3
|
import { GridFormDropDown, GridFormPopoutDropDownProps } from "../gridForm/GridFormDropDown";
|
|
5
|
-
import { GenericCellColDef } from "
|
|
4
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
6
5
|
|
|
7
6
|
export const GridPopoverEditDropDown = <RowType extends GridBaseRow, ValueType>(
|
|
8
7
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -12,7 +11,6 @@ export const GridPopoverEditDropDown = <RowType extends GridBaseRow, ValueType>(
|
|
|
12
11
|
{
|
|
13
12
|
initialWidth: 65,
|
|
14
13
|
maxWidth: 150,
|
|
15
|
-
cellClass: props.multiEdit ? GenericMultiEditCellClass : undefined,
|
|
16
14
|
...colDef,
|
|
17
15
|
},
|
|
18
16
|
{
|
|
@@ -5,7 +5,7 @@ import { GridBaseRow } from "../Grid";
|
|
|
5
5
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
6
6
|
import { GridFormPopoutMenu, GridFormPopoutMenuProps } from "../gridForm/GridFormPopoutMenu";
|
|
7
7
|
import { GridRenderPopoutMenuCell } from "../gridRender/GridRenderPopoutMenuCell";
|
|
8
|
-
import { GenericCellColDef } from "
|
|
8
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Popout burger menu
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
2
2
|
import { GridFormMessage, GridFormMessageProps } from "../gridForm/GridFormMessage";
|
|
3
3
|
import { GridBaseRow } from "../Grid";
|
|
4
|
-
import { GenericCellColDef } from "
|
|
4
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
5
|
|
|
6
6
|
export const GridPopoverMessage = <RowType extends GridBaseRow>(
|
|
7
7
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
3
|
import { GridFormTextArea, GridFormTextAreaProps } from "../gridForm/GridFormTextArea";
|
|
4
|
-
import { GenericCellColDef } from "
|
|
4
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
5
|
|
|
6
6
|
export const GridPopoverTextArea = <RowType extends GridBaseRow>(
|
|
7
7
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
2
2
|
import { GridBaseRow } from "../Grid";
|
|
3
3
|
import { GridFormTextInput, GridFormTextInputProps } from "../gridForm/GridFormTextInput";
|
|
4
|
-
import { GenericCellColDef } from "
|
|
4
|
+
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
5
5
|
|
|
6
6
|
export const GridPopoverTextInput = <RowType extends GridBaseRow>(
|
|
7
7
|
colDef: GenericCellColDef<RowType>,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../../styles/GridRenderGenericCell.scss";
|
|
2
2
|
|
|
3
3
|
import { useContext } from "react";
|
|
4
|
-
import { GridUpdatingContext } from "
|
|
4
|
+
import { GridUpdatingContext } from "../../contexts/GridUpdatingContext";
|
|
5
5
|
import { GridLoadableCell } from "../GridLoadableCell";
|
|
6
6
|
import { GridIcon } from "../GridIcon";
|
|
7
7
|
import { ColDef, ICellRendererParams } from "ag-grid-community";
|
|
8
8
|
import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
|
|
9
9
|
import { GridBaseRow } from "../Grid";
|
|
10
|
-
import { ColDefT } from "
|
|
10
|
+
import { ColDefT } from "../GridCell";
|
|
11
11
|
|
|
12
12
|
export interface RowICellRendererParams<RowType extends GridBaseRow> extends ICellRendererParams {
|
|
13
13
|
data: RowType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { ColDef, ICellRendererParams } from "ag-grid-community";
|
|
3
|
-
import { GridUpdatingContext } from "
|
|
3
|
+
import { GridUpdatingContext } from "../../contexts/GridUpdatingContext";
|
|
4
4
|
import { GridLoadableCell } from "../GridLoadableCell";
|
|
5
5
|
import { LuiIcon } from "@linzjs/lui";
|
|
6
6
|
import { Column } from "ag-grid-community/dist/lib/entities/column";
|
|
@@ -2,9 +2,9 @@ import { ReactElement, ReactNode, useContext, useRef } from "react";
|
|
|
2
2
|
import { GridApi, RowNode } from "ag-grid-community";
|
|
3
3
|
import { GridContext } from "./GridContext";
|
|
4
4
|
import { delay, difference, isEmpty, last, sortBy } from "lodash-es";
|
|
5
|
-
import { isNotEmpty } from "
|
|
5
|
+
import { isNotEmpty } from "../utils/util";
|
|
6
6
|
import { GridUpdatingContext } from "./GridUpdatingContext";
|
|
7
|
-
import { GridBaseRow } from "
|
|
7
|
+
import { GridBaseRow } from "../components/Grid";
|
|
8
8
|
|
|
9
9
|
interface GridContextProps {
|
|
10
10
|
children: ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactNode, RefObject, useCallback, useContext, useRef, useState } from "react";
|
|
2
2
|
import { GridPopoverContext, PropsType } from "./GridPopoverContext";
|
|
3
3
|
import { ICellEditorParams } from "ag-grid-community";
|
|
4
|
-
import { GridContext } from "
|
|
4
|
+
import { GridContext } from "./GridContext";
|
|
5
5
|
import { sortBy } from "lodash-es";
|
|
6
|
-
import { GridBaseRow } from "
|
|
6
|
+
import { GridBaseRow } from "../components/Grid";
|
|
7
7
|
|
|
8
8
|
interface GridPopoverContextProps {
|
|
9
9
|
children: ReactNode;
|
package/src/index.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./react-menu3/index";
|
|
2
2
|
export * from "./react-menu3/types";
|
|
3
3
|
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "
|
|
7
|
-
export * from "
|
|
4
|
+
export * from "./contexts/GridUpdatingContext";
|
|
5
|
+
export * from "./contexts/GridUpdatingContextProvider";
|
|
6
|
+
export * from "./contexts/GridContext";
|
|
7
|
+
export * from "./contexts/GridContextProvider";
|
|
8
8
|
|
|
9
|
-
export type { GridBaseRow } from "
|
|
10
|
-
export { Grid } from "
|
|
11
|
-
export * from "
|
|
12
|
-
export { GridIcon } from "
|
|
13
|
-
export { ComponentLoadingWrapper } from "
|
|
14
|
-
export { GenericMultiEditCellClass } from "
|
|
15
|
-
export { GridLoadableCell } from "
|
|
16
|
-
export { useGridPopoverHook } from "
|
|
17
|
-
export { usePostSortRowsHook } from "
|
|
9
|
+
export type { GridBaseRow } from "./components/Grid";
|
|
10
|
+
export { Grid } from "./components/Grid";
|
|
11
|
+
export * from "./components/GridCell";
|
|
12
|
+
export { GridIcon } from "./components/GridIcon";
|
|
13
|
+
export { ComponentLoadingWrapper } from "./components/ComponentLoadingWrapper";
|
|
14
|
+
export { GenericMultiEditCellClass } from "./components/GenericCellClass";
|
|
15
|
+
export { GridLoadableCell } from "./components/GridLoadableCell";
|
|
16
|
+
export { useGridPopoverHook } from "./components/GridPopoverHook";
|
|
17
|
+
export { usePostSortRowsHook } from "./components/PostSortRowsHook";
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
export { GridRenderPopoutMenuCell } from "
|
|
19
|
+
export * from "./components/gridRender/GridRenderGenericCell";
|
|
20
|
+
export { GridRenderPopoutMenuCell } from "./components/gridRender/GridRenderPopoutMenuCell";
|
|
21
21
|
|
|
22
|
-
export { GridPopoutEditMultiSelect } from "
|
|
23
|
-
export { GridPopoverMenu } from "
|
|
24
|
-
export { GridPopoverEditBearing } from "
|
|
25
|
-
export { GridPopoverEditBearingCorrection } from "
|
|
26
|
-
export { GridPopoverEditDropDown } from "
|
|
27
|
-
export { GridPopoverMessage } from "
|
|
28
|
-
export { GridPopoverTextArea } from "
|
|
29
|
-
export { GridPopoverTextInput } from "
|
|
22
|
+
export { GridPopoutEditMultiSelect } from "./components/gridPopoverEdit/GridPopoutEditMultiSelect";
|
|
23
|
+
export { GridPopoverMenu } from "./components/gridPopoverEdit/GridPopoverMenu";
|
|
24
|
+
export { GridPopoverEditBearing } from "./components/gridPopoverEdit/GridPopoverEditBearing";
|
|
25
|
+
export { GridPopoverEditBearingCorrection } from "./components/gridPopoverEdit/GridPopoverEditBearing";
|
|
26
|
+
export { GridPopoverEditDropDown } from "./components/gridPopoverEdit/GridPopoverEditDropDown";
|
|
27
|
+
export { GridPopoverMessage } from "./components/gridPopoverEdit/GridPopoverMessage";
|
|
28
|
+
export { GridPopoverTextArea } from "./components/gridPopoverEdit/GridPopoverTextArea";
|
|
29
|
+
export { GridPopoverTextInput } from "./components/gridPopoverEdit/GridPopoverTextInput";
|
|
30
30
|
|
|
31
|
-
export { GridHeaderSelect } from "
|
|
31
|
+
export { GridHeaderSelect } from "./components/gridHeader/GridHeaderSelect";
|
|
32
32
|
|
|
33
33
|
export { TextAreaInput } from "./lui/TextAreaInput";
|
|
34
34
|
export { TextInputFormatted } from "./lui/TextInputFormatted";
|
|
35
|
-
export { GridSubComponentTextArea } from "
|
|
35
|
+
export { GridSubComponentTextArea } from "./components/GridSubComponentTextArea";
|
|
36
36
|
|
|
37
|
-
export * from "
|
|
38
|
-
export * from "
|
|
37
|
+
export * from "./utils/bearing";
|
|
38
|
+
export * from "./utils/util";
|
|
@@ -13,7 +13,7 @@ import { createPortal } from "react-dom";
|
|
|
13
13
|
import { MenuList } from "./MenuList";
|
|
14
14
|
import { useBEM } from "../hooks";
|
|
15
15
|
import { menuContainerClass, mergeProps, safeCall, isMenuOpen, getTransition, CloseReason, Keys } from "../utils";
|
|
16
|
-
import { hasParentClass } from "
|
|
16
|
+
import { hasParentClass } from "../../utils/util";
|
|
17
17
|
import { ControlledMenuProps, PortalFieldType, RadioChangeEvent } from "../types";
|
|
18
18
|
import { ItemSettingsContext } from "../contexts/ItemSettingsContext";
|
|
19
19
|
import { SettingsContext } from "../contexts/SettingsContext";
|
|
@@ -2,10 +2,10 @@ import "./FormTest.scss";
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { LuiTextInput } from "@linzjs/lui";
|
|
5
|
-
import { wait } from "
|
|
6
|
-
import { CellEditorCommon, CellParams } from "
|
|
7
|
-
import { useGridPopoverHook } from "
|
|
8
|
-
import { GridBaseRow } from "
|
|
5
|
+
import { wait } from "../../utils/util";
|
|
6
|
+
import { CellEditorCommon, CellParams } from "../../components/GridCell";
|
|
7
|
+
import { useGridPopoverHook } from "../../components/GridPopoverHook";
|
|
8
|
+
import { GridBaseRow } from "../../components/Grid";
|
|
9
9
|
|
|
10
10
|
export interface IFormTestRow {
|
|
11
11
|
id: number;
|
|
@@ -5,15 +5,15 @@ import "../../styles/GridTheme.scss";
|
|
|
5
5
|
|
|
6
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
7
|
import { useMemo, useState } from "react";
|
|
8
|
-
import { GridUpdatingContextProvider } from "
|
|
9
|
-
import { GridContextProvider } from "
|
|
10
|
-
import { Grid, GridProps } from "
|
|
11
|
-
import { ColDefT, GridCell } from "
|
|
8
|
+
import { GridUpdatingContextProvider } from "../../contexts/GridUpdatingContextProvider";
|
|
9
|
+
import { GridContextProvider } from "../../contexts/GridContextProvider";
|
|
10
|
+
import { Grid, GridProps } from "../../components/Grid";
|
|
11
|
+
import { ColDefT, GridCell } from "../../components/GridCell";
|
|
12
12
|
import {
|
|
13
13
|
GridPopoverEditBearing,
|
|
14
14
|
GridPopoverEditBearingCorrection,
|
|
15
|
-
} from "
|
|
16
|
-
import { wait } from "
|
|
15
|
+
} from "../../components/gridPopoverEdit/GridPopoverEditBearing";
|
|
16
|
+
import { wait } from "../../utils/util";
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
title: "Components / Grids",
|
|
@@ -4,14 +4,14 @@ import "../../styles/index.scss";
|
|
|
4
4
|
import "../../styles/GridTheme.scss";
|
|
5
5
|
|
|
6
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { GridUpdatingContextProvider } from "
|
|
8
|
-
import { GridContextProvider } from "
|
|
9
|
-
import { Grid, GridProps } from "
|
|
7
|
+
import { GridUpdatingContextProvider } from "../../contexts/GridUpdatingContextProvider";
|
|
8
|
+
import { GridContextProvider } from "../../contexts/GridContextProvider";
|
|
9
|
+
import { Grid, GridProps } from "../../components/Grid";
|
|
10
10
|
import { useCallback, useMemo, useState } from "react";
|
|
11
|
-
import { MenuHeaderItem, MenuSeparator, MenuSeparatorString } from "
|
|
12
|
-
import { wait } from "
|
|
13
|
-
import { ColDefT, GridCell } from "
|
|
14
|
-
import { GridPopoverEditDropDown } from "
|
|
11
|
+
import { MenuHeaderItem, MenuSeparator, MenuSeparatorString } from "../../components/gridForm/GridFormDropDown";
|
|
12
|
+
import { wait } from "../../utils/util";
|
|
13
|
+
import { ColDefT, GridCell } from "../../components/GridCell";
|
|
14
|
+
import { GridPopoverEditDropDown } from "../../components/gridPopoverEdit/GridPopoverEditDropDown";
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: "Components / Grids",
|
|
@@ -4,11 +4,11 @@ import "../../styles/index.scss";
|
|
|
4
4
|
import "../../styles/GridTheme.scss";
|
|
5
5
|
|
|
6
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { GridUpdatingContextProvider } from "
|
|
8
|
-
import { GridContextProvider } from "
|
|
9
|
-
import { Grid, GridProps } from "
|
|
7
|
+
import { GridUpdatingContextProvider } from "../../contexts/GridUpdatingContextProvider";
|
|
8
|
+
import { GridContextProvider } from "../../contexts/GridContextProvider";
|
|
9
|
+
import { Grid, GridProps } from "../../components/Grid";
|
|
10
10
|
import { useMemo, useState } from "react";
|
|
11
|
-
import { ColDefT, GridCell } from "
|
|
11
|
+
import { ColDefT, GridCell } from "../../components/GridCell";
|
|
12
12
|
import { FormTest, IFormTestRow } from "./FormTest";
|
|
13
13
|
|
|
14
14
|
export default {
|
|
@@ -4,15 +4,15 @@ import "../../styles/index.scss";
|
|
|
4
4
|
import "../../styles/GridTheme.scss";
|
|
5
5
|
|
|
6
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { GridUpdatingContextProvider } from "
|
|
8
|
-
import { GridContextProvider } from "
|
|
9
|
-
import { Grid, GridProps } from "
|
|
7
|
+
import { GridUpdatingContextProvider } from "../../contexts/GridUpdatingContextProvider";
|
|
8
|
+
import { GridContextProvider } from "../../contexts/GridContextProvider";
|
|
9
|
+
import { Grid, GridProps } from "../../components/Grid";
|
|
10
10
|
import { useMemo, useState } from "react";
|
|
11
|
-
import { ColDefT, GridCell } from "
|
|
11
|
+
import { ColDefT, GridCell } from "../../components/GridCell";
|
|
12
12
|
import { IFormTestRow } from "./FormTest";
|
|
13
|
-
import { isFloat, wait } from "
|
|
14
|
-
import { GridPopoverTextArea } from "
|
|
15
|
-
import { GridPopoverTextInput } from "
|
|
13
|
+
import { isFloat, wait } from "../../utils/util";
|
|
14
|
+
import { GridPopoverTextArea } from "../../components/gridPopoverEdit/GridPopoverTextArea";
|
|
15
|
+
import { GridPopoverTextInput } from "../../components/gridPopoverEdit/GridPopoverTextInput";
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
title: "Components / Grids",
|
|
@@ -4,16 +4,16 @@ import "../../styles/index.scss";
|
|
|
4
4
|
import "../../styles/GridTheme.scss";
|
|
5
5
|
|
|
6
6
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { GridUpdatingContextProvider } from "
|
|
8
|
-
import { GridContextProvider } from "
|
|
9
|
-
import { Grid, GridProps } from "
|
|
7
|
+
import { GridUpdatingContextProvider } from "../../contexts/GridUpdatingContextProvider";
|
|
8
|
+
import { GridContextProvider } from "../../contexts/GridContextProvider";
|
|
9
|
+
import { Grid, GridProps } from "../../components/Grid";
|
|
10
10
|
import { useMemo, useState } from "react";
|
|
11
|
-
import { MenuSeparator } from "
|
|
12
|
-
import { wait } from "
|
|
13
|
-
import { MultiSelectResult } from "
|
|
14
|
-
import { GridSubComponentTextArea } from "
|
|
15
|
-
import { ColDefT, GridCell } from "
|
|
16
|
-
import { GridPopoutEditMultiSelect } from "
|
|
11
|
+
import { MenuSeparator } from "../../components/gridForm/GridFormDropDown";
|
|
12
|
+
import { wait } from "../../utils/util";
|
|
13
|
+
import { MultiSelectResult } from "../../components/gridForm/GridFormMultiSelect";
|
|
14
|
+
import { GridSubComponentTextArea } from "../../components/GridSubComponentTextArea";
|
|
15
|
+
import { ColDefT, GridCell } from "../../components/GridCell";
|
|
16
|
+
import { GridPopoutEditMultiSelect } from "../../components/gridPopoverEdit/GridPopoutEditMultiSelect";
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
19
|
title: "Components / Grids",
|