@linzjs/step-ag-grid 29.12.0 → 29.14.0
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.css +26 -2
- package/dist/src/components/Grid.d.ts +37 -67
- package/dist/src/components/GridCell.d.ts +2 -19
- package/dist/src/components/GridCellFiller.d.ts +1 -1
- package/dist/src/components/GridCellMultiEditor.d.ts +1 -2
- package/dist/src/components/GridPopoverHook.d.ts +1 -1
- package/dist/src/components/GridRangeSelectContextMenu.d.ts +10 -0
- package/dist/src/components/gridFilter/GridFilterButtons.d.ts +1 -1
- package/dist/src/components/gridFilter/useGridFilter.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +2 -2
- 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/GridFormMultiSelectGrid.d.ts +1 -1
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +3 -2
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +1 -1
- 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/components/gridHook/useGridContextMenu.d.ts +13 -8
- package/dist/src/components/gridHook/useGridCopy.d.ts +15 -0
- package/dist/src/components/gridHook/useGridCopySettings.d.ts +11 -0
- package/dist/src/components/gridHook/useGridRangeSelection.d.ts +25 -0
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +1 -2
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +2 -2
- package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +2 -2
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +1 -2
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/types.d.ts +27 -0
- package/dist/src/contexts/GridContext.d.ts +13 -12
- package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
- package/dist/src/lui/timeoutHook.d.ts +0 -6
- package/dist/src/lui/tsUtils.d.ts +5 -0
- package/dist/src/utils/__tests__/random.ts +19 -0
- package/dist/src/utils/textValidator.d.ts +1 -1
- package/dist/src/utils/util.d.ts +1 -0
- package/dist/step-ag-grid.cjs +650 -242
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +651 -245
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +4 -2
- package/src/components/Grid.tsx +312 -221
- package/src/components/GridCell.tsx +1 -25
- package/src/components/GridCellFiller.tsx +1 -1
- package/src/components/GridCellMultiEditor.tsx +2 -2
- package/src/components/GridPopoverHook.tsx +1 -1
- package/src/components/GridRangeSelectContextMenu.tsx +73 -0
- package/src/components/gridFilter/GridFilterButtons.tsx +1 -1
- package/src/components/gridFilter/useGridFilter.ts +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +2 -4
- package/src/components/gridForm/GridFormEditBearing.tsx +1 -1
- package/src/components/gridForm/GridFormMessage.tsx +1 -1
- package/src/components/gridForm/GridFormMultiSelect.tsx +1 -1
- package/src/components/gridForm/GridFormMultiSelectGrid.tsx +1 -1
- package/src/components/gridForm/GridFormPopoverMenu.tsx +3 -2
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +1 -1
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +1 -1
- package/src/components/gridForm/GridFormTextArea.tsx +1 -1
- package/src/components/gridForm/GridFormTextInput.tsx +1 -1
- package/src/components/gridHook/useGridContextMenu.tsx +23 -10
- package/src/components/gridHook/useGridCopy.ts +279 -0
- package/src/components/gridHook/useGridCopySettings.ts +28 -0
- package/src/components/gridHook/useGridRangeSelection.ts +235 -0
- package/src/components/gridPopoverEdit/GridButton.tsx +2 -2
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +2 -2
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +2 -2
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +2 -2
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +5 -2
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +2 -2
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +2 -2
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +2 -2
- package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +2 -2
- package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +2 -2
- package/src/components/gridRender/GridRenderGenericCell.tsx +1 -2
- package/src/components/index.ts +1 -0
- package/src/components/types.ts +34 -0
- package/src/contexts/GridContext.tsx +57 -148
- package/src/contexts/GridContextProvider.tsx +16 -13
- package/src/contexts/GridPopoverContext.tsx +1 -1
- package/src/contexts/GridPopoverContextProvider.tsx +1 -1
- package/src/lui/timeoutHook.tsx +0 -19
- package/src/lui/tsUtils.ts +8 -0
- package/src/react-menu3/components/MenuButton.tsx +2 -2
- package/src/react-menu3/hooks/useItemState.ts +1 -1
- package/src/stories/grid/GridCopy.stories.tsx +175 -0
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +4 -4
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +3 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +4 -3
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +2 -2
- package/src/styles/ContextMenu.scss +61 -0
- package/src/styles/Grid.scss +26 -2
- package/src/utils/__tests__/random.ts +19 -0
- package/src/utils/bearing.ts +2 -2
- package/src/utils/textValidator.test.ts +1 -1
- package/src/utils/textValidator.ts +1 -1
- package/src/utils/util.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColDef, GridApi, IRowNode, ISizeColumnsToFitParams } from 'ag-grid-community';
|
|
2
2
|
import { CsvExportParams } from 'ag-grid-community';
|
|
3
|
-
import { ColDefT, GridBaseRow } from '../components';
|
|
3
|
+
import { ColDefT, GridBaseRow } from '../components/types';
|
|
4
4
|
export type GridFilterExternal<TData extends GridBaseRow> = (data: TData, rowNode: IRowNode) => boolean;
|
|
5
5
|
export interface AutoSizeColumnsProps {
|
|
6
6
|
skipHeader?: boolean;
|
|
@@ -10,8 +10,8 @@ export interface AutoSizeColumnsProps {
|
|
|
10
10
|
export type AutoSizeColumnsResult = {
|
|
11
11
|
width: number;
|
|
12
12
|
} | null;
|
|
13
|
-
export interface StartCellEditingProps {
|
|
14
|
-
rowId:
|
|
13
|
+
export interface StartCellEditingProps<TData extends GridBaseRow> {
|
|
14
|
+
rowId: TData['id'];
|
|
15
15
|
colId: string;
|
|
16
16
|
}
|
|
17
17
|
export interface GridContextType<TData extends GridBaseRow> {
|
|
@@ -26,21 +26,21 @@ export interface GridContextType<TData extends GridBaseRow> {
|
|
|
26
26
|
editingCells: () => boolean;
|
|
27
27
|
getSelectedRows: <T extends GridBaseRow>() => T[];
|
|
28
28
|
getFilteredSelectedRows: <T extends GridBaseRow>() => T[];
|
|
29
|
-
getSelectedRowIds: () =>
|
|
30
|
-
getFilteredSelectedRowIds: () =>
|
|
29
|
+
getSelectedRowIds: () => TData['id'][];
|
|
30
|
+
getFilteredSelectedRowIds: () => TData['id'][];
|
|
31
31
|
selectRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
32
32
|
selectRowsWithFlashDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
33
|
-
selectRowsById: (rowIds?:
|
|
34
|
-
selectRowsByIdWithFlash: (rowIds?:
|
|
35
|
-
flashRows: (rowIds?:
|
|
33
|
+
selectRowsById: (rowIds?: TData['id'][]) => void;
|
|
34
|
+
selectRowsByIdWithFlash: (rowIds?: TData['id'][]) => void;
|
|
35
|
+
flashRows: (rowIds?: TData['id'][]) => void;
|
|
36
36
|
flashRowsDiff: (updateFn: () => Promise<any>) => Promise<void>;
|
|
37
|
-
focusByRowById: (rowId:
|
|
38
|
-
ensureRowVisible: (id:
|
|
37
|
+
focusByRowById: (rowId: TData['id'], ifNoCellFocused?: boolean) => void;
|
|
38
|
+
ensureRowVisible: (id: TData['id'] | string) => boolean;
|
|
39
39
|
ensureSelectedRowIsVisible: () => void;
|
|
40
|
-
getFirstRowId: () =>
|
|
40
|
+
getFirstRowId: () => TData['id'];
|
|
41
41
|
autoSizeColumns: (props?: AutoSizeColumnsProps) => Promise<AutoSizeColumnsResult>;
|
|
42
42
|
sizeColumnsToFit: (paramsOrGridWidth?: ISizeColumnsToFitParams) => void;
|
|
43
|
-
startCellEditing: ({ rowId, colId }: StartCellEditingProps) => Promise<void>;
|
|
43
|
+
startCellEditing: ({ rowId, colId }: StartCellEditingProps<TData>) => Promise<void>;
|
|
44
44
|
resetFocusedCellAfterCellEditing: () => void;
|
|
45
45
|
updatingCells: (props: {
|
|
46
46
|
selectedRows: GridBaseRow[];
|
|
@@ -60,6 +60,7 @@ export interface GridContextType<TData extends GridBaseRow> {
|
|
|
60
60
|
onBulkEditingComplete: () => Promise<void> | void;
|
|
61
61
|
setOnBulkEditingComplete: (callback: (() => Promise<void> | void) | undefined) => void;
|
|
62
62
|
showNoRowsOverlay: () => void;
|
|
63
|
+
getCellValue: GridApi['getCellValue'];
|
|
63
64
|
}
|
|
64
65
|
export declare const GridContext: import("react").Context<GridContextType<any>>;
|
|
65
66
|
export declare const useGridContext: <TData extends GridBaseRow>() => GridContextType<TData>;
|
|
@@ -6,9 +6,3 @@
|
|
|
6
6
|
* but there's no way to enforce that, so it would lead to bugs.
|
|
7
7
|
*/
|
|
8
8
|
export declare const useTimeoutHook: () => (fn: () => void, waitTimeMs: number) => void;
|
|
9
|
-
interface IntervalHookProps {
|
|
10
|
-
timeoutMs: number;
|
|
11
|
-
callback: () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const useIntervalHook: ({ callback, timeoutMs }: IntervalHookProps) => void;
|
|
14
|
-
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type KeysOfType<TObject, TValue> = {
|
|
2
|
+
[K in keyof TObject]: TObject[K] extends TValue ? K : never;
|
|
3
|
+
}[keyof TObject];
|
|
4
|
+
export declare const typedKeys: <T extends object>(obj: T) => (keyof T)[];
|
|
5
|
+
export declare const typedEntries: <T extends object>(obj: T) => { [K in keyof T]-?: [K, T[K]]; }[keyof T][];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class SeededRandomForTests {
|
|
2
|
+
value: number;
|
|
3
|
+
constructor(seed: number) {
|
|
4
|
+
this.value = seed % 2147483647;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
next(maxInc?: number) {
|
|
8
|
+
this.value = (this.value * 16807) % 2147483647;
|
|
9
|
+
const result = (this.value - 1) / 2147483646;
|
|
10
|
+
if (maxInc == null) {
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
return ((result * (maxInc + 1)) | 0) % (maxInc + 1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fromArray<T>(arr: T[]): T {
|
|
17
|
+
return arr[this.next(arr.length - 1)];
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/src/utils/util.d.ts
CHANGED