ia-table 0.12.9 → 0.13.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.d.ts +3514 -15
- package/dist/index.js +10966 -10433
- package/package.json +8 -5
- package/dist/components/IATable/types/api.d.ts +0 -285
- package/dist/components/IATable/types/cache.d.ts +0 -65
- package/dist/components/IATable/types/columns.d.ts +0 -204
- package/dist/components/IATable/types/common.d.ts +0 -62
- package/dist/components/IATable/types/index.d.ts +0 -7
- package/dist/components/IATable/types/reducer.d.ts +0 -3
- package/dist/components/IATable/types/svg.d.ts +0 -5
- package/dist/components/IATable/types/table.d.ts +0 -205
- package/dist/locale-patch-applied.txt +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ia-table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"moment": "^2.0.0",
|
|
7
|
-
"prop-types": "^15.8.0",
|
|
8
7
|
"xlsx": "^0.18.0",
|
|
9
8
|
"zustand": "^4.0.0"
|
|
10
9
|
},
|
|
@@ -24,14 +23,15 @@
|
|
|
24
23
|
],
|
|
25
24
|
"scripts": {
|
|
26
25
|
"start": "vite",
|
|
27
|
-
"build": "vite build",
|
|
28
|
-
"build:lib": "vite build --config vite.lib.config.
|
|
26
|
+
"build": "tsc -b && vite build",
|
|
27
|
+
"build:lib": "tsc -b && vite build --config vite.lib.config.ts && npx tsx scripts/fix-moment-locale.ts",
|
|
29
28
|
"preview": "vite preview",
|
|
30
29
|
"test": "vitest",
|
|
31
30
|
"prepublishOnly": "npm run build:lib",
|
|
32
31
|
"storybook": "storybook dev -p 6006",
|
|
33
32
|
"build:storybook": "storybook build",
|
|
34
|
-
"fix-moment-locale": "
|
|
33
|
+
"fix-moment-locale": "npx tsx scripts/fix-moment-locale.ts",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
35
|
"lint": "eslint .",
|
|
36
36
|
"lint:fix": "eslint . --fix",
|
|
37
37
|
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/preset-react": "^7.27.1",
|
|
60
60
|
"@eslint/js": "^9.39.2",
|
|
61
|
+
"jiti": "^2.4.0",
|
|
61
62
|
"@storybook/addon-actions": "^9.0.8",
|
|
62
63
|
"@storybook/addon-docs": "^9.0.18",
|
|
63
64
|
"@storybook/addon-onboarding": "^9.0.18",
|
|
@@ -87,10 +88,12 @@
|
|
|
87
88
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
88
89
|
"sass": "^1.89.2",
|
|
89
90
|
"storybook": "^9.0.18",
|
|
91
|
+
"tsx": "^4.19.0",
|
|
90
92
|
"typescript": "^4.7.4",
|
|
91
93
|
"typescript-eslint": "^8.51.0",
|
|
92
94
|
"vite": "^6.3.5",
|
|
93
95
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
96
|
+
"vite-plugin-dts": "^4.5.0",
|
|
94
97
|
"vite-plugin-svgr": "^4.3.0",
|
|
95
98
|
"vitest": "^3.2.4",
|
|
96
99
|
"web-vitals": "^2.1.4",
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
// SmartGrid API Type Definitions
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
SmartGridInfiniteCache,
|
|
5
|
-
SmartGridInfiniteRowModel,
|
|
6
|
-
} from "./cache";
|
|
7
|
-
import { SmartGridColumnDefinition } from "./columns";
|
|
8
|
-
import {
|
|
9
|
-
SmartGridFilterModel,
|
|
10
|
-
SmartGridRowNode,
|
|
11
|
-
SmartGridSortDirection,
|
|
12
|
-
SmartGridSortModel,
|
|
13
|
-
SmartGridUpdateData,
|
|
14
|
-
} from "./common";
|
|
15
|
-
import { SmartGridStateContext } from "./reducer";
|
|
16
|
-
|
|
17
|
-
export type SmartGridModelType = "normal" | "serverSide" | "infinite";
|
|
18
|
-
|
|
19
|
-
export type SmartGridPinnedType = "left" | "right" | null;
|
|
20
|
-
|
|
21
|
-
export type SmartGridFloatingType = "top" | "bottom" | null;
|
|
22
|
-
|
|
23
|
-
export interface SmartGridRowData {
|
|
24
|
-
[key: string]: unknown;
|
|
25
|
-
id?: string | number;
|
|
26
|
-
isChildRow?: boolean;
|
|
27
|
-
isChildGroup?: boolean;
|
|
28
|
-
childIndex?: number;
|
|
29
|
-
groupingLevel?: number;
|
|
30
|
-
level?: number;
|
|
31
|
-
parentRowIndex?: number;
|
|
32
|
-
parentRowData?: SmartGridRowData;
|
|
33
|
-
__parentPath?: string;
|
|
34
|
-
_rowHeight?: number;
|
|
35
|
-
_isPinnedTop?: boolean;
|
|
36
|
-
_isPinnedBottom?: boolean;
|
|
37
|
-
__isAggregationRow?: boolean;
|
|
38
|
-
subTotalAggreRow?: boolean;
|
|
39
|
-
grandTotalAggreRow?: boolean;
|
|
40
|
-
isGrandTotalRow?: boolean;
|
|
41
|
-
__parentId?: string | number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface SmartGridColumnState {
|
|
45
|
-
colId: string;
|
|
46
|
-
hide: boolean;
|
|
47
|
-
width: number;
|
|
48
|
-
sort: SmartGridSortDirection | null;
|
|
49
|
-
filter: SmartGridFilterModel | null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface SmartGridPaginationModel {
|
|
53
|
-
currentPage: number;
|
|
54
|
-
pageSize: number;
|
|
55
|
-
totalPages: number;
|
|
56
|
-
totalRecords: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface SmartGridDisplayedRowNode extends SmartGridRowNode {
|
|
60
|
-
rowIndex: number;
|
|
61
|
-
absoluteRowIndex: number;
|
|
62
|
-
originalData: SmartGridRowData;
|
|
63
|
-
rowHeight?: number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface SmartGridCacheState {
|
|
67
|
-
blockCount: number;
|
|
68
|
-
cache?: SmartGridInfiniteCache;
|
|
69
|
-
lastRowKnown: boolean;
|
|
70
|
-
rowCount: number;
|
|
71
|
-
status: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface SmartGridTableModel {
|
|
75
|
-
getData: () => SmartGridRowData[];
|
|
76
|
-
modelRef?: {
|
|
77
|
-
current?: SmartGridInfiniteRowModel;
|
|
78
|
-
};
|
|
79
|
-
infiniteCache: SmartGridInfiniteCache | null;
|
|
80
|
-
getColumnDefs: () => SmartGridColumnDefinition[];
|
|
81
|
-
getSortModel: () => SmartGridSortModel[];
|
|
82
|
-
getFilterModel: () => SmartGridFilterModel;
|
|
83
|
-
getType: () => SmartGridModelType;
|
|
84
|
-
getRowsToDisplay: () => number;
|
|
85
|
-
forEachNode: (
|
|
86
|
-
callback: (node: SmartGridRowNode, index: number) => void
|
|
87
|
-
) => void;
|
|
88
|
-
getRowNode: (id: string | number) => SmartGridRowNode | null;
|
|
89
|
-
getSelectedRows: () => SmartGridRowData[];
|
|
90
|
-
getPaginationModel: () => SmartGridPaginationModel;
|
|
91
|
-
getColumnState: () => SmartGridColumnState[];
|
|
92
|
-
rowsToDisplay: SmartGridRowData[];
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface SmartGridDisplayedColumn {
|
|
96
|
-
colDef: SmartGridColumnDefinition;
|
|
97
|
-
colId: string;
|
|
98
|
-
getColId: () => string;
|
|
99
|
-
isVisible: () => boolean;
|
|
100
|
-
isPinned: () => SmartGridPinnedType;
|
|
101
|
-
label: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface SmartGridSelectedCell {
|
|
105
|
-
colIndex: number;
|
|
106
|
-
column: SmartGridColumnDefinition;
|
|
107
|
-
data: SmartGridRowData;
|
|
108
|
-
field: string;
|
|
109
|
-
rowId: string | number;
|
|
110
|
-
rowIndex: number;
|
|
111
|
-
value: unknown;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface SmartGridFocusedCell extends SmartGridSelectedCell {
|
|
115
|
-
floating: SmartGridFloatingType;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface SmartGridRefreshOptions {
|
|
119
|
-
purge?: boolean;
|
|
120
|
-
resetPage?: boolean;
|
|
121
|
-
userInitiated?: boolean;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface SmartGridNotification {
|
|
125
|
-
message: string;
|
|
126
|
-
type?: "success" | "error" | "warning" | "info";
|
|
127
|
-
duration?: number;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface SmartGridParamsNode {
|
|
131
|
-
rowIndex: number;
|
|
132
|
-
data: SmartGridRowData;
|
|
133
|
-
api: SmartGridAPI;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface SmartGridDisplayedRowAtIndex {
|
|
137
|
-
data: SmartGridRowData;
|
|
138
|
-
rowIndex: number;
|
|
139
|
-
node: SmartGridParamsNode;
|
|
140
|
-
api: SmartGridAPI;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface SmartGridCachedBlockData {
|
|
144
|
-
[blockId: string]: SmartGridRowData[];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface SmartGridCellValueChangedParams {
|
|
148
|
-
colDef: SmartGridColumnDefinition;
|
|
149
|
-
column: SmartGridColumnDefinition;
|
|
150
|
-
data: SmartGridRowData;
|
|
151
|
-
newValue: unknown;
|
|
152
|
-
node: {
|
|
153
|
-
data: SmartGridRowData;
|
|
154
|
-
id: string | number;
|
|
155
|
-
level: number;
|
|
156
|
-
parent?: SmartGridUpdateData;
|
|
157
|
-
rowIndex: number;
|
|
158
|
-
};
|
|
159
|
-
value: unknown;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface SmartGridCheckConfiguration {
|
|
163
|
-
checkedRows?: string[];
|
|
164
|
-
unCheckedRows?: string[];
|
|
165
|
-
checkAll?: boolean;
|
|
166
|
-
searchColumns?: {
|
|
167
|
-
[key: string]: SmartGridFilterModel[];
|
|
168
|
-
};
|
|
169
|
-
unCheckAll?: boolean;
|
|
170
|
-
}
|
|
171
|
-
export interface SmartGridOptions {
|
|
172
|
-
[key: string]: unknown;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface SmartGridGetRowDataParams {
|
|
176
|
-
data: SmartGridRowData;
|
|
177
|
-
rowIndex: number;
|
|
178
|
-
node: SmartGridParamsNode;
|
|
179
|
-
api: SmartGridAPI;
|
|
180
|
-
}
|
|
181
|
-
export interface SmartGridDisptach {
|
|
182
|
-
type: string;
|
|
183
|
-
payload?: unknown;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export type SmartGridUpdateDataReturnType = {
|
|
187
|
-
success: boolean;
|
|
188
|
-
totalRows: number;
|
|
189
|
-
blocksUpdated: number;
|
|
190
|
-
errors: string[];
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export interface SmartGridAPI {
|
|
194
|
-
getInfiniteRowModel: () => SmartGridInfiniteRowModel | null;
|
|
195
|
-
getInfiniteCache: () => SmartGridInfiniteCache | null;
|
|
196
|
-
getModel: () => SmartGridTableModel;
|
|
197
|
-
onCellValueChanged: (params: SmartGridCellValueChangedParams) => void;
|
|
198
|
-
getPrevAction: () => string;
|
|
199
|
-
setPrevAction: (value: string) => void;
|
|
200
|
-
getCheckConfiguration: () => SmartGridCheckConfiguration[];
|
|
201
|
-
setCheckConfiguration: (config: SmartGridCheckConfiguration[]) => void;
|
|
202
|
-
addToCheckConfiguration: (item: SmartGridCheckConfiguration) => void;
|
|
203
|
-
getIsSelectAllRecords: () => boolean;
|
|
204
|
-
setIsSelectAllRecords: (value: boolean) => void;
|
|
205
|
-
getSelectedRows: () => SmartGridRowData[];
|
|
206
|
-
setSelectedRows: (rowIds: (string | number)[]) => void;
|
|
207
|
-
clearSelection: () => void;
|
|
208
|
-
selectAll: () => void;
|
|
209
|
-
refreshCells: () => void;
|
|
210
|
-
getCache: () => SmartGridInfiniteCache | null;
|
|
211
|
-
getCacheState: () => SmartGridCacheState | null;
|
|
212
|
-
getInfiniteCacheInstance: () => SmartGridInfiniteCache | undefined;
|
|
213
|
-
refreshServerSideStore: (options?: SmartGridRefreshOptions) => void;
|
|
214
|
-
getCachedBlockData: () => SmartGridCachedBlockData;
|
|
215
|
-
logCacheSummary: () => void | null;
|
|
216
|
-
getCachedRowById: (id: string | number) => SmartGridRowData | null;
|
|
217
|
-
getRowNode: (key: string | number) => Partial<SmartGridRowNode>;
|
|
218
|
-
setVisibleRange: (startRow: number, endRow: number) => void;
|
|
219
|
-
refreshCache: (options?: SmartGridRefreshOptions) => boolean;
|
|
220
|
-
deselectAll: () => void;
|
|
221
|
-
getRenderedNodes: () => SmartGridDisplayedRowNode[];
|
|
222
|
-
gridOptionsWrapper: {
|
|
223
|
-
gridOptions: SmartGridOptions;
|
|
224
|
-
};
|
|
225
|
-
getDisplayedRowAtIndex: (
|
|
226
|
-
index: number,
|
|
227
|
-
wholeData?: SmartGridRowData[],
|
|
228
|
-
api?: Partial<SmartGridAPI>
|
|
229
|
-
) => SmartGridDisplayedRowAtIndex | null;
|
|
230
|
-
getTableWidth: () => number;
|
|
231
|
-
sizeColumnsToFit: () => void;
|
|
232
|
-
setRowData: (newData: SmartGridRowData[]) => boolean | void;
|
|
233
|
-
forEachNode: (
|
|
234
|
-
callback: (node: SmartGridRowNode, index: number) => void
|
|
235
|
-
) => void;
|
|
236
|
-
getColumnDefs: () => SmartGridColumnDefinition[];
|
|
237
|
-
getAllColumns: () => SmartGridColumnDefinition[];
|
|
238
|
-
setColumnDefs: (newColumns: SmartGridColumnDefinition) => void;
|
|
239
|
-
addEventListener: (event: string, listener: Function) => void;
|
|
240
|
-
removeEventListener: (event: string, listener: Function) => void;
|
|
241
|
-
getPinnedTopRow: () => SmartGridRowData[] | null;
|
|
242
|
-
setPinnedTopRowData: (rows: SmartGridRowData[]) => void;
|
|
243
|
-
getPinnedBottomRow: () => SmartGridRowData[] | null;
|
|
244
|
-
setPinnedBottomRowData: (rows: SmartGridRowData[]) => void;
|
|
245
|
-
getRowData: (
|
|
246
|
-
params: SmartGridGetRowDataParams,
|
|
247
|
-
columnName: string
|
|
248
|
-
) => string | number | boolean;
|
|
249
|
-
tableId: string;
|
|
250
|
-
getFocusedCell: () => SmartGridFocusedCell | null;
|
|
251
|
-
getSelectedCells: () => SmartGridSelectedCell[];
|
|
252
|
-
getAllDisplayedColumns: () => SmartGridDisplayedColumn[];
|
|
253
|
-
getDisplayedRowCount: () => number;
|
|
254
|
-
setFocusedCell: (
|
|
255
|
-
rowIndex: number,
|
|
256
|
-
colKey: SmartGridColumnDefinition | string | number,
|
|
257
|
-
floating?: SmartGridFloatingType
|
|
258
|
-
) => boolean;
|
|
259
|
-
ensureColumnVisible: (
|
|
260
|
-
colKey: SmartGridColumnDefinition | string | number
|
|
261
|
-
) => boolean;
|
|
262
|
-
getColumnByField: (fieldName: string) => SmartGridColumnDefinition | null;
|
|
263
|
-
getTableInstance: () =>
|
|
264
|
-
| {
|
|
265
|
-
current?: HTMLElement;
|
|
266
|
-
}
|
|
267
|
-
| undefined;
|
|
268
|
-
getFilterModel: () => SmartGridFilterModel;
|
|
269
|
-
setFilterModel: (field: string, rules: SmartGridFilterModel) => void;
|
|
270
|
-
getTableDispatcher: () => (action: SmartGridDisptach) => void;
|
|
271
|
-
getTableStateContext: () => SmartGridStateContext;
|
|
272
|
-
showNotification: (notification: SmartGridNotification) => void;
|
|
273
|
-
hideNotification: () => void;
|
|
274
|
-
applySearch: () => void;
|
|
275
|
-
getCurrentPageData: () => SmartGridRowData[];
|
|
276
|
-
getWholeTableData: () => SmartGridRowData[];
|
|
277
|
-
flashCells: () => void;
|
|
278
|
-
redrawRows: () => void;
|
|
279
|
-
refreshClientSideRowModel: () => void;
|
|
280
|
-
resetRecentSearchChanges: () => void;
|
|
281
|
-
onFilterChanged: () => void;
|
|
282
|
-
updateSmartGridTableData: (
|
|
283
|
-
wholeData: SmartGridRowData[]
|
|
284
|
-
) => SmartGridUpdateDataReturnType;
|
|
285
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { SmartGridRowData } from "./api";
|
|
2
|
-
|
|
3
|
-
export type SmartGridCacheAnalytics = {
|
|
4
|
-
blockEvictions: number;
|
|
5
|
-
blockLoadTimestamps: number[];
|
|
6
|
-
blockLoads: number;
|
|
7
|
-
bytesLoaded: number;
|
|
8
|
-
cachePurges: number;
|
|
9
|
-
cacheRefreshes: number;
|
|
10
|
-
hits: number;
|
|
11
|
-
lastBlockLoadTime: number;
|
|
12
|
-
misses: number;
|
|
13
|
-
startTime: number;
|
|
14
|
-
totalBlockLoadTime: number;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type SmartGridCacheBlockParams = Record<string, unknown>;
|
|
18
|
-
|
|
19
|
-
export type SmartGridCacheBlock = {
|
|
20
|
-
endRow: number;
|
|
21
|
-
id: number;
|
|
22
|
-
infiniteCache: SmartGridInfiniteCache;
|
|
23
|
-
lastAccessed: number;
|
|
24
|
-
loadStartedAt: number;
|
|
25
|
-
params: SmartGridCacheBlockParams;
|
|
26
|
-
parent: SmartGridInfiniteCache | null;
|
|
27
|
-
parentCache: SmartGridInfiniteCache | null;
|
|
28
|
-
rowNodes: {
|
|
29
|
-
data: SmartGridRowData;
|
|
30
|
-
id: number;
|
|
31
|
-
rowIndex: number;
|
|
32
|
-
}[];
|
|
33
|
-
rows: unknown;
|
|
34
|
-
startRow: number;
|
|
35
|
-
state: string;
|
|
36
|
-
version: number;
|
|
37
|
-
_inactiveForPageTransition: boolean;
|
|
38
|
-
_processingInProgress: boolean;
|
|
39
|
-
_targetPage: number;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export interface SmartGridInfiniteCache {
|
|
43
|
-
analytics: SmartGridCacheAnalytics;
|
|
44
|
-
blockCount: number;
|
|
45
|
-
blocks: Record<number, SmartGridCacheBlock>;
|
|
46
|
-
eventListeners: Record<"cacheUpdated", Function[]>;
|
|
47
|
-
lastRequestedPage: number;
|
|
48
|
-
lastRowIndexKnown: boolean;
|
|
49
|
-
params: SmartGridInfiniteCacheParams;
|
|
50
|
-
rowCount: number;
|
|
51
|
-
_currentRequestedPage: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface SmartGridInfiniteRowModel {
|
|
55
|
-
infiniteCache?: SmartGridInfiniteCache;
|
|
56
|
-
setViewportRange?: (startRow: number, endRow: number) => void;
|
|
57
|
-
logCacheSummary?: () => void;
|
|
58
|
-
[key: string]: unknown;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SmartGridInfiniteCacheParams {
|
|
62
|
-
datasource: {
|
|
63
|
-
getWholeData: () => SmartGridRowData[];
|
|
64
|
-
};
|
|
65
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from "react";
|
|
2
|
-
import { SmartGridAPI, SmartGridRowData } from "./api";
|
|
3
|
-
import {
|
|
4
|
-
SmartGridNewSortModel,
|
|
5
|
-
SmartGridSortModel,
|
|
6
|
-
SmartGridUpdateData,
|
|
7
|
-
} from "./common";
|
|
8
|
-
|
|
9
|
-
export interface SmartGridValueFormatterParams {
|
|
10
|
-
value: unknown;
|
|
11
|
-
data: SmartGridRowData;
|
|
12
|
-
colDef: SmartGridColumnDefinition;
|
|
13
|
-
}
|
|
14
|
-
export interface SmartGridValueGetterParams {
|
|
15
|
-
data: SmartGridRowData;
|
|
16
|
-
node: {
|
|
17
|
-
data: SmartGridRowData;
|
|
18
|
-
};
|
|
19
|
-
colDef: SmartGridColumnDefinition;
|
|
20
|
-
column: SmartGridColumnDefinition;
|
|
21
|
-
api: SmartGridAPI;
|
|
22
|
-
columnApi?: unknown;
|
|
23
|
-
getValue: (field: string) => unknown;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type SmartGridCellRenderer = {
|
|
27
|
-
value: unknown;
|
|
28
|
-
data: SmartGridRowData;
|
|
29
|
-
rowIndex: number;
|
|
30
|
-
colIndex: number;
|
|
31
|
-
column: SmartGridColumnDefinition;
|
|
32
|
-
colDef: SmartGridColumnDefinition;
|
|
33
|
-
node: {
|
|
34
|
-
data: SmartGridRowData;
|
|
35
|
-
rowIndex: number;
|
|
36
|
-
id: string | number;
|
|
37
|
-
parent: SmartGridUpdateData & {
|
|
38
|
-
id: string | number;
|
|
39
|
-
level: number;
|
|
40
|
-
setExpanded: () => void;
|
|
41
|
-
};
|
|
42
|
-
setDataValue: (colId: string, newValue: unknown) => void;
|
|
43
|
-
childrenMapped: Record<string, string>;
|
|
44
|
-
allLeafChildren: Record<string, string>;
|
|
45
|
-
group: boolean;
|
|
46
|
-
level: number;
|
|
47
|
-
childIndex: number;
|
|
48
|
-
isSelected: () => boolean;
|
|
49
|
-
isExpandable: () => boolean;
|
|
50
|
-
isExpanded: () => boolean;
|
|
51
|
-
};
|
|
52
|
-
api: SmartGridAPI;
|
|
53
|
-
eGridCell: React.HTMLAttributes<HTMLDivElement>;
|
|
54
|
-
wholeData: SmartGridRowData[];
|
|
55
|
-
actions: Record<string, unknown>;
|
|
56
|
-
setDataValue: (colId: string, newValue: unknown) => void;
|
|
57
|
-
};
|
|
58
|
-
export type SmartGridCellRendererParams = Record<string, unknown>;
|
|
59
|
-
|
|
60
|
-
export type SmartGridHeaderStyleParams = {
|
|
61
|
-
column: SmartGridColumnDefinition;
|
|
62
|
-
displayName: string;
|
|
63
|
-
enableSorting: boolean;
|
|
64
|
-
sortState: SmartGridNewSortModel;
|
|
65
|
-
onSort: (field: string, direction: string) => void;
|
|
66
|
-
isSearchable: boolean;
|
|
67
|
-
showSortIcon: boolean;
|
|
68
|
-
toggleSearchModal: (e: React.MouseEvent<HTMLElement>) => void;
|
|
69
|
-
hasFilters: boolean;
|
|
70
|
-
isExpandable: boolean;
|
|
71
|
-
onToggle: (field: string, isExpandable: boolean) => void;
|
|
72
|
-
api: SmartGridAPI;
|
|
73
|
-
availableWidth: number;
|
|
74
|
-
wrapHeaderText: boolean;
|
|
75
|
-
menuButtonRef: React.RefObject<HTMLElement>;
|
|
76
|
-
menuToggle: (e: React.MouseEvent<HTMLElement>) => void;
|
|
77
|
-
toggleAdvancedSeach: (value: boolean) => void;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export type SmartGridTooltipGetterParams = {
|
|
81
|
-
api: SmartGridAPI;
|
|
82
|
-
colDef: SmartGridColumnDefinition;
|
|
83
|
-
column: SmartGridColumnDefinition;
|
|
84
|
-
data: SmartGridRowData;
|
|
85
|
-
location: string;
|
|
86
|
-
node: {
|
|
87
|
-
data: SmartGridRowData;
|
|
88
|
-
id: string;
|
|
89
|
-
level: number;
|
|
90
|
-
parent: SmartGridUpdateData;
|
|
91
|
-
rowIndex: number;
|
|
92
|
-
};
|
|
93
|
-
rowIndex: number;
|
|
94
|
-
value: unknown;
|
|
95
|
-
};
|
|
96
|
-
export interface SmartGridColumnDefinition {
|
|
97
|
-
field: string;
|
|
98
|
-
headerName?: string;
|
|
99
|
-
column_name?: string;
|
|
100
|
-
label?: string;
|
|
101
|
-
width?: number;
|
|
102
|
-
minWidth?: number;
|
|
103
|
-
maxWidth?: number;
|
|
104
|
-
hide?: boolean;
|
|
105
|
-
hidden?: boolean;
|
|
106
|
-
pinned?: "left" | "right" | boolean | null;
|
|
107
|
-
is_frozen?: boolean;
|
|
108
|
-
children?: SmartGridColumnDefinition[];
|
|
109
|
-
parent_id?: string | number;
|
|
110
|
-
type?: string;
|
|
111
|
-
cellDataType?: string;
|
|
112
|
-
valueFormatter?: (params: SmartGridValueFormatterParams) => string;
|
|
113
|
-
valueGetter?: (params: SmartGridValueGetterParams) => unknown;
|
|
114
|
-
leftTotalWidth?: number;
|
|
115
|
-
originalWidth?: number;
|
|
116
|
-
isAutoWidth?: boolean;
|
|
117
|
-
filterable?: boolean;
|
|
118
|
-
isSortable?: boolean;
|
|
119
|
-
is_sortable?: boolean;
|
|
120
|
-
resizable?: boolean;
|
|
121
|
-
align?: "left" | "center" | "right";
|
|
122
|
-
cellRenderer?: string | ((params: SmartGridCellRenderer) => JSX.Element);
|
|
123
|
-
cellRendererParams?: SmartGridCellRendererParams;
|
|
124
|
-
cellClassName?: string;
|
|
125
|
-
cellStyle?: {
|
|
126
|
-
textAlign?: "left" | "center" | "right";
|
|
127
|
-
[key: string]: unknown;
|
|
128
|
-
};
|
|
129
|
-
autoHeight?: boolean;
|
|
130
|
-
wrapHeaderText?: boolean;
|
|
131
|
-
editable?: boolean;
|
|
132
|
-
is_editable?: boolean;
|
|
133
|
-
is_disabled?: boolean;
|
|
134
|
-
is_searchable?: boolean;
|
|
135
|
-
isSearchable?: boolean;
|
|
136
|
-
advanceSearchEnabled?: boolean;
|
|
137
|
-
sortable?: boolean;
|
|
138
|
-
rowGroup?: boolean;
|
|
139
|
-
enableRowGroup?: boolean;
|
|
140
|
-
rowGroupIndex?: number;
|
|
141
|
-
aggFunc?: string;
|
|
142
|
-
columnGroupShow?: "open" | "closed";
|
|
143
|
-
originalIndex?: number;
|
|
144
|
-
parentColumns?: string[];
|
|
145
|
-
hasChildren?: boolean;
|
|
146
|
-
hasAnyFrozenChildren?: boolean;
|
|
147
|
-
hasAnyRightPinnedChildren?: boolean;
|
|
148
|
-
isChildWithoutParent?: boolean;
|
|
149
|
-
colorClass?: string;
|
|
150
|
-
isLeaf?: boolean;
|
|
151
|
-
isStandalone?: boolean;
|
|
152
|
-
isWithEmptyHeaderName?: boolean;
|
|
153
|
-
isParentWithChildEmptyHeaderName?: boolean;
|
|
154
|
-
path?: string[];
|
|
155
|
-
parentField?: string | null;
|
|
156
|
-
originalFields?: string[];
|
|
157
|
-
colId?: string;
|
|
158
|
-
colSpan?: number;
|
|
159
|
-
rowSpan?: number;
|
|
160
|
-
comparator?: (
|
|
161
|
-
valueA: unknown,
|
|
162
|
-
valueB: unknown,
|
|
163
|
-
nodeA: unknown,
|
|
164
|
-
nodeB: unknown,
|
|
165
|
-
sortModel: SmartGridSortModel
|
|
166
|
-
) => number;
|
|
167
|
-
headerTooltip?: string;
|
|
168
|
-
filter?: string | boolean;
|
|
169
|
-
filterParams?: {
|
|
170
|
-
filterOptions?: string[];
|
|
171
|
-
textCustomComparator?: (
|
|
172
|
-
filter: string,
|
|
173
|
-
value: unknown,
|
|
174
|
-
filterText: string
|
|
175
|
-
) => boolean;
|
|
176
|
-
numberCustomComparator?: (filter: number, value: unknown) => boolean;
|
|
177
|
-
dateCustomComparator?: (
|
|
178
|
-
filterLocalDateAtMidnight: Date,
|
|
179
|
-
cellValue: string
|
|
180
|
-
) => number;
|
|
181
|
-
comparator?: (filterValue: unknown, cellValue: unknown) => boolean;
|
|
182
|
-
[key: string]: unknown;
|
|
183
|
-
};
|
|
184
|
-
order_of_display?: number;
|
|
185
|
-
is_hidden?: boolean;
|
|
186
|
-
formatter?: string | null;
|
|
187
|
-
accessor?: string;
|
|
188
|
-
id?: string;
|
|
189
|
-
required?: boolean;
|
|
190
|
-
sub_headers?: SmartGridColumnDefinition[];
|
|
191
|
-
extra?: {
|
|
192
|
-
width?: number;
|
|
193
|
-
is_grouping_key?: boolean;
|
|
194
|
-
is_disabled?: boolean;
|
|
195
|
-
isDisabled?: boolean;
|
|
196
|
-
columnGroupShow?: "open" | "closed";
|
|
197
|
-
[key: string]: unknown;
|
|
198
|
-
};
|
|
199
|
-
headerComponent?: React.FC<SmartGridHeaderStyleParams>;
|
|
200
|
-
headerStyle?: (params: SmartGridHeaderStyleParams) => CSSProperties;
|
|
201
|
-
tooltipValueGetter?: (params: SmartGridTooltipGetterParams) => string;
|
|
202
|
-
cellRendererLazyType?: string;
|
|
203
|
-
[key: string]: unknown;
|
|
204
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { SmartGridRowData } from "./api";
|
|
2
|
-
|
|
3
|
-
export type SmartGridSortDirection = "asc" | "desc" | "none";
|
|
4
|
-
|
|
5
|
-
export type SmartGridUpdateData = {
|
|
6
|
-
data: SmartGridRowData;
|
|
7
|
-
setData: (data: SmartGridRowData) => void;
|
|
8
|
-
setDataValue: (field: string, value: unknown, callback?: () => void) => void;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export interface SmartGridRowNode extends SmartGridUpdateData {
|
|
12
|
-
id: string | number;
|
|
13
|
-
childIndex?: number;
|
|
14
|
-
selected: boolean;
|
|
15
|
-
rowIndex?: number;
|
|
16
|
-
absoluteRowIndex?: number;
|
|
17
|
-
originalData?: SmartGridRowData;
|
|
18
|
-
rowHeight?: number;
|
|
19
|
-
setSelected: (selected: boolean, clearSelection?: boolean) => void;
|
|
20
|
-
isGroup?: () => boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface SmartGridOldSortModel {
|
|
24
|
-
colId: string;
|
|
25
|
-
sort: SmartGridSortDirection;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface SmartGridNewSortModel {
|
|
29
|
-
column: string;
|
|
30
|
-
order: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type SmartGridSortModel =
|
|
34
|
-
| SmartGridOldSortModel
|
|
35
|
-
| SmartGridNewSortModel
|
|
36
|
-
| null;
|
|
37
|
-
|
|
38
|
-
export type SmartGridStringFilter = {
|
|
39
|
-
column: string;
|
|
40
|
-
pattern: string;
|
|
41
|
-
search_type: string;
|
|
42
|
-
operator?: string;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type SmartGridRangeFilter = {
|
|
46
|
-
column: string;
|
|
47
|
-
min_val: number;
|
|
48
|
-
max_val: number;
|
|
49
|
-
search_type: string;
|
|
50
|
-
operator?: string;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export interface SmartGridFilterModel {
|
|
54
|
-
pattern: string;
|
|
55
|
-
search_type: string;
|
|
56
|
-
column?: string;
|
|
57
|
-
field?: string;
|
|
58
|
-
min_val?: number;
|
|
59
|
-
max_val?: number;
|
|
60
|
-
type?: string;
|
|
61
|
-
operator?: string;
|
|
62
|
-
}
|