gm-datagrid 0.1.5 → 0.1.7
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 +148 -4
- package/dist/GMDatagrid.d.ts +5 -3
- package/dist/GMDatagridInner.d.ts +4 -2
- package/dist/cells/FilterCell.d.ts +58 -0
- package/dist/context/GridContext.d.ts +11 -1
- package/dist/core_engine-21HtFNxu.js +360 -0
- package/dist/gm-datagrid.js +4500 -2422
- package/dist/gm-datagrid.umd.cjs +44 -10
- package/dist/index.d.ts +1 -1
- package/dist/types/index.d.ts +61 -1
- package/package.json +2 -1
- package/dist/core_engine-Cnhrb_In.js +0 -360
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { GMDatagrid } from './GMDatagrid';
|
|
|
2
2
|
export { GMGridContainer } from './GMGridContainer';
|
|
3
3
|
export type { GMGridContainerRef } from './GMGridContainer';
|
|
4
4
|
export { useGMGrid } from './context/GridContext';
|
|
5
|
-
export type { GMDatagridProps, ColumnDef, Row, CellRange, CellCoord, FilterGroup, FilterCondition, SortKey, ApiContext, DensityMode, MuiChipColor, StatusMapEntry, CellRenderParams, } from './types';
|
|
5
|
+
export type { GMDatagridProps, GMDatagridRef, ColumnDef, Row, CellRange, CellCoord, FilterGroup, FilterCondition, SortKey, ApiContext, DensityMode, MuiChipColor, StatusMapEntry, CellRenderParams, } from './types';
|
|
6
6
|
export { ColumnDataTypesEnum } from './types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -75,7 +75,15 @@ export interface SortKey {
|
|
|
75
75
|
dir: 'asc' | 'desc';
|
|
76
76
|
}
|
|
77
77
|
export type FilterLogic = 'AND' | 'OR';
|
|
78
|
-
export type FilterOperator = 'contains' | 'notContains' | 'equals' | 'startsWith' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'isNull' | 'isNotNull';
|
|
78
|
+
export type FilterOperator = 'contains' | 'notContains' | 'equals' | 'notEquals' | 'startsWith' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'isNull' | 'isNotNull';
|
|
79
|
+
/** Operator options available for date / dateTime columns. */
|
|
80
|
+
export type DateFilterOp = 'equals' | 'notEquals' | 'gt' | 'gte' | 'lt' | 'lte' | 'isNull' | 'isNotNull';
|
|
81
|
+
/** Value used for date/dateTime filter cells — carries the operator alongside the date string. */
|
|
82
|
+
export interface DateFilterValue {
|
|
83
|
+
op: DateFilterOp;
|
|
84
|
+
/** ISO date string (YYYY-MM-DD) or datetime-local string; empty for isNull/isNotNull. */
|
|
85
|
+
value: string;
|
|
86
|
+
}
|
|
79
87
|
export interface FilterCondition {
|
|
80
88
|
field: string;
|
|
81
89
|
op: FilterOperator;
|
|
@@ -96,6 +104,16 @@ export interface ApiContext {
|
|
|
96
104
|
authToken?: string;
|
|
97
105
|
[key: string]: unknown;
|
|
98
106
|
}
|
|
107
|
+
export interface GMDatagridRef {
|
|
108
|
+
/** Returns a copy of all currently selected rows. */
|
|
109
|
+
getSelectedRows: () => Row[];
|
|
110
|
+
/** Clears the current selection. */
|
|
111
|
+
clearSelection: () => void;
|
|
112
|
+
/** Programmatically select rows by their `id` field. */
|
|
113
|
+
setSelectedIds: (ids: string[]) => void;
|
|
114
|
+
/** Re-fetch data (same as toolbar Refresh button). */
|
|
115
|
+
refresh: () => void;
|
|
116
|
+
}
|
|
99
117
|
export interface GMDatagridProps {
|
|
100
118
|
title: string;
|
|
101
119
|
columns: ColumnDef[];
|
|
@@ -125,4 +143,46 @@ export interface GMDatagridProps {
|
|
|
125
143
|
};
|
|
126
144
|
/** Triggered from toolbar or menu-action column. Parent handles the detail view. */
|
|
127
145
|
onRowDetail?: (row: Row) => void;
|
|
146
|
+
/** Enables row selection checkboxes. Default: false. */
|
|
147
|
+
checkboxSelection?: boolean;
|
|
148
|
+
/** Fired whenever the selection changes. Receives the full array of selected rows. */
|
|
149
|
+
onRowSelectionChange?: (rows: Row[]) => void;
|
|
150
|
+
/**
|
|
151
|
+
* Controls the active page and page size.
|
|
152
|
+
* Equivalent to MUI DataGrid v9 `paginationModel`.
|
|
153
|
+
* @default { page: 0, pageSize: 50 }
|
|
154
|
+
*/
|
|
155
|
+
paginationModel?: {
|
|
156
|
+
page: number;
|
|
157
|
+
pageSize: number;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Callback fired when page or pageSize changes.
|
|
161
|
+
* Equivalent to MUI DataGrid v9 `onPaginationModelChange`.
|
|
162
|
+
*/
|
|
163
|
+
onPaginationModelChange?: (model: {
|
|
164
|
+
page: number;
|
|
165
|
+
pageSize: number;
|
|
166
|
+
}) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Available page size options shown in the footer dropdown.
|
|
169
|
+
* Equivalent to MUI DataGrid v9 `pageSizeOptions`.
|
|
170
|
+
* @default [25, 50, 100]
|
|
171
|
+
*/
|
|
172
|
+
pageSizeOptions?: number[];
|
|
173
|
+
/**
|
|
174
|
+
* Total row count when data is paginated server-side.
|
|
175
|
+
* Equivalent to MUI DataGrid v9 `rowCount`.
|
|
176
|
+
* When provided together with `paginationMode="server"`, the grid uses this
|
|
177
|
+
* value instead of `engine.get_total_count()`.
|
|
178
|
+
*/
|
|
179
|
+
rowCount?: number;
|
|
180
|
+
/**
|
|
181
|
+
* `"client"` — engine paginates local rows in memory (default).
|
|
182
|
+
* `"server"` — parent owns pagination; grid fires `onPaginationModelChange`
|
|
183
|
+
* and renders `rowCount` as the total.
|
|
184
|
+
* Equivalent to MUI DataGrid v9 `paginationMode`.
|
|
185
|
+
* @default "client"
|
|
186
|
+
*/
|
|
187
|
+
paginationMode?: 'client' | 'server';
|
|
128
188
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-datagrid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Enterprise Excel-like data grid powered by a Rust/Wasm core engine and React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datagrid",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"react-dom": ">=18"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"match-sorter": "^8.3.0",
|
|
47
48
|
"moment": "^2.30.1",
|
|
48
49
|
"numeral": "^2.0.6"
|
|
49
50
|
},
|