@toolbox-web/grid-react 0.10.0 → 0.11.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/README.md +17 -9
- package/chunks/data-grid-GKyKxE6c.js +799 -0
- package/features/export.d.ts +50 -7
- package/features/export.d.ts.map +1 -1
- package/features/export.js +65 -5
- package/features/filtering.d.ts +62 -7
- package/features/filtering.d.ts.map +1 -1
- package/features/filtering.js +81 -5
- package/features/print.d.ts +34 -7
- package/features/print.d.ts.map +1 -1
- package/features/print.js +27 -3
- package/features/selection.d.ts +47 -7
- package/features/selection.d.ts.map +1 -1
- package/features/selection.js +48 -3
- package/features/undo-redo.d.ts +51 -9
- package/features/undo-redo.d.ts.map +1 -1
- package/features/undo-redo.js +42 -5
- package/index.d.ts +10 -2
- package/index.d.ts.map +1 -1
- package/index.js +127 -904
- package/lib/data-grid.d.ts +10 -4
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/grid-type-registry.d.ts +32 -8
- package/lib/grid-type-registry.d.ts.map +1 -1
- package/lib/react-column-config.d.ts +59 -29
- package/lib/react-column-config.d.ts.map +1 -1
- package/lib/react-grid-adapter.d.ts +8 -3
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/lib/use-grid.d.ts +37 -0
- package/lib/use-grid.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/data-grid.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { BaseGridPlugin,
|
|
2
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { BaseGridPlugin, DataGridElement } from '@toolbox-web/grid';
|
|
2
|
+
import { ReactNode, RefObject } from 'react';
|
|
3
3
|
import { ColumnShorthand } from './column-shorthand';
|
|
4
4
|
import { EventProps } from './event-props';
|
|
5
5
|
import { AllFeatureProps } from './feature-props';
|
|
6
|
-
import {
|
|
6
|
+
import { ColumnConfig, GridConfig } from './react-column-config';
|
|
7
|
+
/**
|
|
8
|
+
* Context for sharing the grid element ref with child components.
|
|
9
|
+
* Used by feature-specific hooks like useGridSelection, useGridExport.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const GridElementContext: import('react').Context<RefObject<DataGridElement<any> | null> | null>;
|
|
7
13
|
/**
|
|
8
14
|
* Props for the DataGrid component.
|
|
9
15
|
*
|
|
@@ -33,7 +39,7 @@ export interface DataGridProps<TRow = unknown> extends AllFeatureProps<TRow>, Ev
|
|
|
33
39
|
* }}
|
|
34
40
|
* ```
|
|
35
41
|
*/
|
|
36
|
-
gridConfig?:
|
|
42
|
+
gridConfig?: GridConfig<TRow>;
|
|
37
43
|
/**
|
|
38
44
|
* Column definitions. Supports shorthand syntax for quick definitions.
|
|
39
45
|
*
|
package/lib/data-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAUL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,iBAAiB,CAAC;AAK1E,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAiC9F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,wEAAgE,CAAC;AAqFhG;;;;;;;;;;GAUG;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scf,CAAC,IAAI,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { CellRenderContext, ColumnEditorContext
|
|
1
|
+
import { TypeDefault as BaseTypeDefault, CellRenderContext, ColumnEditorContext } from '@toolbox-web/grid';
|
|
2
2
|
import { FC, ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Type default configuration for React applications.
|
|
5
|
+
*
|
|
6
|
+
* Defines default renderer, editor, and editorParams for a data type
|
|
7
|
+
* using React function components.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import type { TypeDefault } from '@toolbox-web/grid-react';
|
|
12
|
+
*
|
|
13
|
+
* const countryDefault: TypeDefault<Employee, string> = {
|
|
14
|
+
* renderer: (ctx) => <CountryFlag code={ctx.value} />,
|
|
15
|
+
* editor: (ctx) => (
|
|
16
|
+
* <CountrySelect value={ctx.value} onSelect={ctx.commit} />
|
|
17
|
+
* ),
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
6
20
|
*/
|
|
7
|
-
export interface
|
|
21
|
+
export interface TypeDefault<TRow = unknown, TValue = unknown> {
|
|
8
22
|
/** React component/function for rendering cells of this type */
|
|
9
23
|
renderer?: (ctx: CellRenderContext<TRow, TValue>) => ReactNode;
|
|
10
24
|
/** React component/function for editing cells of this type */
|
|
@@ -12,10 +26,15 @@ export interface ReactTypeDefault<TRow = unknown, TValue = unknown> {
|
|
|
12
26
|
/** Default editorParams for this type */
|
|
13
27
|
editorParams?: Record<string, unknown>;
|
|
14
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use `TypeDefault` instead.
|
|
31
|
+
* @see {@link TypeDefault}
|
|
32
|
+
*/
|
|
33
|
+
export type ReactTypeDefault<TRow = unknown, TValue = unknown> = TypeDefault<TRow, TValue>;
|
|
15
34
|
/**
|
|
16
35
|
* Type defaults registry - a map of type names to their defaults.
|
|
17
36
|
*/
|
|
18
|
-
export type TypeDefaultsMap = Record<string,
|
|
37
|
+
export type TypeDefaultsMap = Record<string, TypeDefault>;
|
|
19
38
|
/**
|
|
20
39
|
* Props for the GridTypeProvider component.
|
|
21
40
|
*/
|
|
@@ -103,16 +122,21 @@ export declare function useGridTypeDefaults(): TypeDefaultsMap | null;
|
|
|
103
122
|
* }
|
|
104
123
|
* ```
|
|
105
124
|
*/
|
|
106
|
-
export declare function useTypeDefault<TRow = unknown, TValue = unknown>(type: string):
|
|
125
|
+
export declare function useTypeDefault<TRow = unknown, TValue = unknown>(type: string): TypeDefault<TRow, TValue> | undefined;
|
|
107
126
|
/**
|
|
108
|
-
* Creates a
|
|
127
|
+
* Creates a BaseTypeDefault that the grid can use from a React type default.
|
|
109
128
|
*
|
|
110
129
|
* This converts React render functions into grid-compatible renderer/editor functions.
|
|
111
130
|
* Used internally by ReactGridAdapter.
|
|
112
131
|
*
|
|
113
132
|
* @internal
|
|
114
133
|
*/
|
|
115
|
-
export declare function
|
|
134
|
+
export declare function typeDefaultToBaseTypeDefault<TRow = unknown>(typeDefault: TypeDefault<TRow>, renderReactNode: (node: ReactNode) => HTMLElement): BaseTypeDefault<TRow>;
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated Use `typeDefaultToBaseTypeDefault` instead.
|
|
137
|
+
* @see {@link typeDefaultToBaseTypeDefault}
|
|
138
|
+
*/
|
|
139
|
+
export declare const reactTypeDefaultToGridTypeDefault: typeof typeDefaultToBaseTypeDefault;
|
|
116
140
|
/**
|
|
117
141
|
* Internal context for passing the type defaults to the adapter.
|
|
118
142
|
* Used by DataGrid to communicate with ReactGridAdapter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-type-registry.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/grid-type-registry.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"grid-type-registry.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/grid-type-registry.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAA6B,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IAC3D,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,SAAS,CAAC;IAC/D,8DAA8D;IAC9D,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,SAAS,CAAC;IAC/D,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAG3F;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAO1D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAEtD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,GAAG,IAAI,CAE5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,SAAS,CAGpH;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,GAAG,OAAO,EACzD,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,EAC9B,eAAe,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,WAAW,GAChD,eAAe,CAAC,IAAI,CAAC,CAuBvB;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,qCAA+B,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,iDAAkB,CAAC"}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnConfig as BaseColumnConfig, GridConfig as BaseGridConfig, CellRenderContext, ColumnEditorContext } from '@toolbox-web/grid';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Column configuration for React applications.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* that return ReactNode (JSX).
|
|
6
|
+
* Extends the base ColumnConfig with `renderer` and `editor` properties
|
|
7
|
+
* that accept React render functions returning JSX.
|
|
9
8
|
*
|
|
10
9
|
* @example
|
|
11
10
|
* ```tsx
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* };
|
|
11
|
+
* import type { GridConfig, ColumnConfig } from '@toolbox-web/grid-react';
|
|
12
|
+
*
|
|
13
|
+
* const columns: ColumnConfig<Employee>[] = [
|
|
14
|
+
* { field: 'name', header: 'Name' },
|
|
15
|
+
* {
|
|
16
|
+
* field: 'status',
|
|
17
|
+
* header: 'Status',
|
|
18
|
+
* renderer: (ctx) => <StatusBadge value={ctx.value} />,
|
|
19
|
+
* editor: (ctx) => (
|
|
20
|
+
* <StatusSelect
|
|
21
|
+
* value={ctx.value}
|
|
22
|
+
* onCommit={ctx.commit}
|
|
23
|
+
* onCancel={ctx.cancel}
|
|
24
|
+
* />
|
|
25
|
+
* ),
|
|
26
|
+
* },
|
|
27
|
+
* ];
|
|
30
28
|
* ```
|
|
31
29
|
*/
|
|
32
|
-
export interface
|
|
30
|
+
export interface ColumnConfig<TRow = unknown> extends Omit<BaseColumnConfig<TRow>, 'renderer' | 'viewRenderer' | 'editor'> {
|
|
33
31
|
/**
|
|
34
32
|
* React component renderer for cell display.
|
|
35
33
|
* Receives cell context and returns a React node (JSX).
|
|
@@ -46,11 +44,38 @@ export interface ReactColumnConfig<TRow = unknown> extends Omit<ColumnConfig<TRo
|
|
|
46
44
|
editor?: (ctx: ColumnEditorContext<TRow>) => ReactNode;
|
|
47
45
|
}
|
|
48
46
|
/**
|
|
49
|
-
*
|
|
47
|
+
* @deprecated Use `ColumnConfig` instead.
|
|
48
|
+
* @see {@link ColumnConfig}
|
|
50
49
|
*/
|
|
51
|
-
export type
|
|
52
|
-
|
|
50
|
+
export type ReactColumnConfig<TRow = unknown> = ColumnConfig<TRow>;
|
|
51
|
+
/**
|
|
52
|
+
* Grid configuration for React applications.
|
|
53
|
+
*
|
|
54
|
+
* Uses React-augmented ColumnConfig that accepts JSX render functions.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* import type { GridConfig } from '@toolbox-web/grid-react';
|
|
59
|
+
*
|
|
60
|
+
* const config: GridConfig<Employee> = {
|
|
61
|
+
* columns: [
|
|
62
|
+
* { field: 'name', header: 'Name' },
|
|
63
|
+
* {
|
|
64
|
+
* field: 'status',
|
|
65
|
+
* renderer: (ctx) => <StatusBadge value={ctx.value} />,
|
|
66
|
+
* },
|
|
67
|
+
* ],
|
|
68
|
+
* };
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export type GridConfig<TRow = unknown> = Omit<BaseGridConfig<TRow>, 'columns'> & {
|
|
72
|
+
columns?: ColumnConfig<TRow>[];
|
|
53
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Use `GridConfig` instead.
|
|
76
|
+
* @see {@link GridConfig}
|
|
77
|
+
*/
|
|
78
|
+
export type ReactGridConfig<TRow = unknown> = GridConfig<TRow>;
|
|
54
79
|
/**
|
|
55
80
|
* Wraps a React renderer function into a DOM-returning viewRenderer.
|
|
56
81
|
* Used internally by DataGrid to process reactRenderer properties.
|
|
@@ -62,10 +87,15 @@ export declare function wrapReactRenderer<TRow>(renderFn: (ctx: CellRenderContex
|
|
|
62
87
|
*/
|
|
63
88
|
export declare function wrapReactEditor<TRow>(editorFn: (ctx: ColumnEditorContext<TRow>) => ReactNode): (ctx: ColumnEditorContext<TRow>) => HTMLElement;
|
|
64
89
|
/**
|
|
65
|
-
* Processes a
|
|
90
|
+
* Processes a GridConfig, converting React renderer/editor functions
|
|
66
91
|
* to DOM-returning functions that the grid core understands.
|
|
67
92
|
*
|
|
68
93
|
* @internal Used by DataGrid component
|
|
69
94
|
*/
|
|
70
|
-
export declare function
|
|
95
|
+
export declare function processGridConfig<TRow>(config: GridConfig<TRow> | undefined): BaseGridConfig<TRow> | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Use `processGridConfig` instead.
|
|
98
|
+
* @see {@link processGridConfig}
|
|
99
|
+
*/
|
|
100
|
+
export declare const processReactGridConfig: typeof processGridConfig;
|
|
71
101
|
//# sourceMappingURL=react-column-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CACxD,gBAAgB,CAAC,IAAI,CAAC,EACtB,UAAU,GAAG,cAAc,GAAG,QAAQ,CACvC;IACC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,GAAG,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAInE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,GAAG;IAC/E,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,GAAG,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAM/D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EACpC,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,GACpD,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,WAAW,CAiC/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAClC,QAAQ,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,GACtD,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,WAAW,CAcjD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,SAAS,CAyB9G;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,0BAAoB,CAAC"}
|
|
@@ -37,10 +37,10 @@ export declare function getRegisteredFields(): string[];
|
|
|
37
37
|
*
|
|
38
38
|
* ```tsx
|
|
39
39
|
* import { GridElement } from '@toolbox-web/grid';
|
|
40
|
-
* import {
|
|
40
|
+
* import { GridAdapter } from '@toolbox-web/grid-react';
|
|
41
41
|
*
|
|
42
42
|
* // One-time registration
|
|
43
|
-
* GridElement.registerAdapter(new
|
|
43
|
+
* GridElement.registerAdapter(new GridAdapter());
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* ## Declarative usage with DataGrid:
|
|
@@ -56,7 +56,7 @@ export declare function getRegisteredFields(): string[];
|
|
|
56
56
|
* </DataGrid>
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
export declare class
|
|
59
|
+
export declare class GridAdapter implements FrameworkAdapter {
|
|
60
60
|
private mountedViews;
|
|
61
61
|
private typeDefaults;
|
|
62
62
|
/**
|
|
@@ -153,4 +153,9 @@ export declare class ReactGridAdapter implements FrameworkAdapter {
|
|
|
153
153
|
*/
|
|
154
154
|
unmount(container: HTMLElement): void;
|
|
155
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated Use `GridAdapter` instead. This alias will be removed in a future version.
|
|
158
|
+
* @see {@link GridAdapter}
|
|
159
|
+
*/
|
|
160
|
+
export declare const ReactGridAdapter: typeof GridAdapter;
|
|
156
161
|
//# sourceMappingURL=react-grid-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiB9E;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAaN;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,CAAC,GAAG,SAAS,CAYvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,CAAC,GAAG,SAAS,CAYzE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,
|
|
1
|
+
{"version":3,"file":"react-grid-adapter.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-grid-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiB9E;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAaN;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,GAChE,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,CAAC,GAAG,SAAS,CAYvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GACnB,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,SAAS,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AE,WAAW,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,SAAS;IAqC5G;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS;IA8B3E;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAkB1B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAkBxB;;;OAGG;IACH,OAAO,IAAI,IAAI;IAWf;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;CAYtC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,oBAAc,CAAC"}
|
package/lib/use-grid.d.ts
CHANGED
|
@@ -2,31 +2,61 @@ import { ColumnConfig, DataGridElement, GridConfig } from '@toolbox-web/grid';
|
|
|
2
2
|
import { DataGridRef } from './data-grid';
|
|
3
3
|
/**
|
|
4
4
|
* Selection convenience methods returned from useGrid.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated These methods are deprecated and will be removed in a future version.
|
|
7
|
+
* Use `useGridSelection()` from `@toolbox-web/grid-react/features/selection` instead.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Old (deprecated)
|
|
12
|
+
* const { selectAll, clearSelection } = useGrid();
|
|
13
|
+
*
|
|
14
|
+
* // New (recommended)
|
|
15
|
+
* import { useGridSelection } from '@toolbox-web/grid-react/features/selection';
|
|
16
|
+
* const { selectAll, clearSelection, getSelectedRows } = useGridSelection();
|
|
17
|
+
* ```
|
|
5
18
|
*/
|
|
6
19
|
export interface SelectionMethods<TRow = unknown> {
|
|
7
20
|
/**
|
|
8
21
|
* Select all rows in the grid.
|
|
9
22
|
* Requires SelectionPlugin with mode: 'row'.
|
|
23
|
+
* @deprecated Use `useGridSelection()` from `@toolbox-web/grid-react/features/selection` instead.
|
|
10
24
|
*/
|
|
11
25
|
selectAll: () => void;
|
|
12
26
|
/**
|
|
13
27
|
* Clear all selection.
|
|
14
28
|
* Works with any SelectionPlugin mode.
|
|
29
|
+
* @deprecated Use `useGridSelection()` from `@toolbox-web/grid-react/features/selection` instead.
|
|
15
30
|
*/
|
|
16
31
|
clearSelection: () => void;
|
|
17
32
|
/**
|
|
18
33
|
* Get selected row indices.
|
|
19
34
|
* Returns Set of selected row indices.
|
|
35
|
+
* @deprecated Use `useGridSelection()` from `@toolbox-web/grid-react/features/selection` instead.
|
|
20
36
|
*/
|
|
21
37
|
getSelectedIndices: () => Set<number>;
|
|
22
38
|
/**
|
|
23
39
|
* Get selected rows data.
|
|
24
40
|
* Returns array of selected row objects.
|
|
41
|
+
* @deprecated Use `useGridSelection()` from `@toolbox-web/grid-react/features/selection` instead.
|
|
25
42
|
*/
|
|
26
43
|
getSelectedRows: () => TRow[];
|
|
27
44
|
}
|
|
28
45
|
/**
|
|
29
46
|
* Export convenience methods returned from useGrid.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated These methods are deprecated and will be removed in a future version.
|
|
49
|
+
* Use `useGridExport()` from `@toolbox-web/grid-react/features/export` instead.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* // Old (deprecated)
|
|
54
|
+
* const { exportToCsv, exportToJson } = useGrid();
|
|
55
|
+
*
|
|
56
|
+
* // New (recommended)
|
|
57
|
+
* import { useGridExport } from '@toolbox-web/grid-react/features/export';
|
|
58
|
+
* const { exportToCsv, exportToExcel, exportToJson } = useGridExport();
|
|
59
|
+
* ```
|
|
30
60
|
*/
|
|
31
61
|
export interface ExportMethods {
|
|
32
62
|
/**
|
|
@@ -34,6 +64,7 @@ export interface ExportMethods {
|
|
|
34
64
|
* Requires ExportPlugin to be loaded.
|
|
35
65
|
*
|
|
36
66
|
* @param filename - Optional filename (defaults to 'export.csv')
|
|
67
|
+
* @deprecated Use `useGridExport()` from `@toolbox-web/grid-react/features/export` instead.
|
|
37
68
|
*/
|
|
38
69
|
exportToCsv: (filename?: string) => void;
|
|
39
70
|
/**
|
|
@@ -41,11 +72,17 @@ export interface ExportMethods {
|
|
|
41
72
|
* Requires ExportPlugin to be loaded.
|
|
42
73
|
*
|
|
43
74
|
* @param filename - Optional filename (defaults to 'export.json')
|
|
75
|
+
* @deprecated Use `useGridExport()` from `@toolbox-web/grid-react/features/export` instead.
|
|
44
76
|
*/
|
|
45
77
|
exportToJson: (filename?: string) => void;
|
|
46
78
|
}
|
|
47
79
|
/**
|
|
48
80
|
* Return type for useGrid hook.
|
|
81
|
+
*
|
|
82
|
+
* Note: Selection and export convenience methods are deprecated.
|
|
83
|
+
* Use feature-specific hooks instead:
|
|
84
|
+
* - `useGridSelection()` from `@toolbox-web/grid-react/features/selection`
|
|
85
|
+
* - `useGridExport()` from `@toolbox-web/grid-react/features/export`
|
|
49
86
|
*/
|
|
50
87
|
export interface UseGridReturn<TRow = unknown> extends SelectionMethods<TRow>, ExportMethods {
|
|
51
88
|
/** Ref to attach to the DataGrid component (returns DataGridRef handle) */
|
package/lib/use-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/use-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"use-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/use-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;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