@agile-team/mach-table 0.39.1 → 0.40.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 +7 -7
- package/dist/adapter.cjs +1 -1
- package/dist/adapter.d.cts +11 -3
- package/dist/adapter.d.ts +11 -3
- package/dist/adapter.js +1 -1
- package/dist/analysis.d.cts +2 -2
- package/dist/analysis.d.ts +2 -2
- package/dist/business.cjs +1 -1
- package/dist/business.js +1 -1
- package/dist/{api-ChEKWrvH.d.cts → colDef-BiwNRXwf.d.cts} +256 -256
- package/dist/{api-ChEKWrvH.d.ts → colDef-BiwNRXwf.d.ts} +256 -256
- package/dist/{configuration-CZm-aiTf.d.cts → configuration-D57x5Ovu.d.cts} +3 -3
- package/dist/{configuration-BPj5MIUw.d.ts → configuration-ZGE-MtGs.d.ts} +3 -3
- package/dist/import.cjs +1 -1
- package/dist/import.d.cts +1 -1
- package/dist/import.d.ts +1 -1
- package/dist/import.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +6 -6
- package/dist/multi-range.d.cts +1 -1
- package/dist/multi-range.d.ts +1 -1
- package/dist/ordering.d.cts +1 -1
- package/dist/ordering.d.ts +1 -1
- package/dist/preferences.cjs +1 -1
- package/dist/preferences.d.cts +1 -1
- package/dist/preferences.d.ts +1 -1
- package/dist/preferences.js +1 -1
- package/dist/server-side.cjs +1 -1
- package/dist/server-side.d.cts +1 -1
- package/dist/server-side.d.ts +1 -1
- package/dist/server-side.js +1 -1
- package/dist/{shared-BIBSfPcs.d.cts → shared-C9SPn-Hh.d.ts} +1 -1
- package/dist/{shared-Qnznvth3.d.ts → shared-TcluaEBe.d.cts} +1 -1
- package/dist/workbench.cjs +1 -1
- package/dist/workbench.d.cts +3 -3
- package/dist/workbench.d.ts +3 -3
- package/dist/workbench.js +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +2 -2
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +1 -1
- package/package.json +2 -2
|
@@ -60,261 +60,6 @@ interface RowNode<TData = any> {
|
|
|
60
60
|
treeLoadError?: unknown;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
interface ValueGetterParams<TData = any, TValue = any> {
|
|
64
|
-
data: TData | null;
|
|
65
|
-
node: RowNode<TData>;
|
|
66
|
-
colDef: ColDef<TData, TValue>;
|
|
67
|
-
column: Column<TData>;
|
|
68
|
-
api: GridApi<TData>;
|
|
69
|
-
}
|
|
70
|
-
interface ValueFormatterParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
71
|
-
value: TValue;
|
|
72
|
-
}
|
|
73
|
-
interface CellRendererParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
74
|
-
value: TValue;
|
|
75
|
-
formatted: string;
|
|
76
|
-
rowIndex: number;
|
|
77
|
-
rendererParams?: Record<string, any>;
|
|
78
|
-
}
|
|
79
|
-
interface CellClassParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
80
|
-
value: TValue;
|
|
81
|
-
rowIndex: number;
|
|
82
|
-
}
|
|
83
|
-
interface EditableParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
84
|
-
value: TValue;
|
|
85
|
-
rowIndex: number;
|
|
86
|
-
}
|
|
87
|
-
interface CellEditorParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
88
|
-
value: TValue;
|
|
89
|
-
rowIndex: number;
|
|
90
|
-
keyPress?: string | null;
|
|
91
|
-
}
|
|
92
|
-
interface ValueSetterParams<TData = any, TValue = any> {
|
|
93
|
-
oldValue: TValue;
|
|
94
|
-
newValue: TValue;
|
|
95
|
-
data: TData;
|
|
96
|
-
node: RowNode<TData>;
|
|
97
|
-
colDef: ColDef<TData, TValue>;
|
|
98
|
-
column: Column<TData>;
|
|
99
|
-
api: GridApi<TData>;
|
|
100
|
-
}
|
|
101
|
-
interface GetRowIdParams<TData = any> {
|
|
102
|
-
data: TData;
|
|
103
|
-
index: number;
|
|
104
|
-
api: GridApi<TData>;
|
|
105
|
-
}
|
|
106
|
-
interface GetRowHeightParams<TData = any> {
|
|
107
|
-
data: TData | null;
|
|
108
|
-
node: RowNode<TData>;
|
|
109
|
-
api: GridApi<TData>;
|
|
110
|
-
}
|
|
111
|
-
interface TooltipParams<TData = any> {
|
|
112
|
-
data: TData | null;
|
|
113
|
-
node: RowNode<TData>;
|
|
114
|
-
api: GridApi<TData>;
|
|
115
|
-
colId: string;
|
|
116
|
-
value: any;
|
|
117
|
-
formatted: string;
|
|
118
|
-
rowIndex: number;
|
|
119
|
-
}
|
|
120
|
-
interface ContextMenuParams<TData = any> {
|
|
121
|
-
data: TData | null;
|
|
122
|
-
node: RowNode<TData>;
|
|
123
|
-
api: GridApi<TData>;
|
|
124
|
-
colId: string;
|
|
125
|
-
value: any;
|
|
126
|
-
rowIndex: number;
|
|
127
|
-
}
|
|
128
|
-
interface ContextMenuItem {
|
|
129
|
-
label?: string;
|
|
130
|
-
action?: () => void;
|
|
131
|
-
danger?: boolean;
|
|
132
|
-
disabled?: boolean;
|
|
133
|
-
separator?: boolean;
|
|
134
|
-
}
|
|
135
|
-
interface HeaderComponentParams<TData = any> {
|
|
136
|
-
colDef: ColDef<TData>;
|
|
137
|
-
column: Column<TData>;
|
|
138
|
-
api: GridApi<TData>;
|
|
139
|
-
}
|
|
140
|
-
interface ICellRendererResult {
|
|
141
|
-
el: HTMLElement;
|
|
142
|
-
/** Reuses the mounted renderer for an update. Return false to request recreation. */
|
|
143
|
-
refresh?(params: CellRendererParams): boolean | void;
|
|
144
|
-
destroy?: () => void;
|
|
145
|
-
}
|
|
146
|
-
type CellRendererOutput = string | HTMLElement | ICellRendererResult | null | undefined;
|
|
147
|
-
interface ICellEditor<TValue = any> {
|
|
148
|
-
el: HTMLElement;
|
|
149
|
-
getValue(): TValue | null | undefined;
|
|
150
|
-
focus?(): void;
|
|
151
|
-
destroy?(): void;
|
|
152
|
-
isCancelBeforeStart?(): boolean;
|
|
153
|
-
isCancelAfterEnd?(value: TValue | null | undefined): boolean;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
type SortDirection = "asc" | "desc";
|
|
157
|
-
type PinnedDirection = "left" | "right";
|
|
158
|
-
type FilterType = "text" | "number" | "date" | "set";
|
|
159
|
-
type CellAlign = "left" | "center" | "right";
|
|
160
|
-
type ValueInputSource = "editor" | "clipboard" | "import";
|
|
161
|
-
type ValueOutputTarget = "clipboard" | "csv" | "xlsx";
|
|
162
|
-
interface ValueParserParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
163
|
-
value: unknown;
|
|
164
|
-
oldValue: TValue | undefined;
|
|
165
|
-
source: ValueInputSource;
|
|
166
|
-
}
|
|
167
|
-
interface ValueSerializerParams<TData = any, TValue = any> extends ValueFormatterParams<TData, TValue> {
|
|
168
|
-
target: ValueOutputTarget;
|
|
169
|
-
}
|
|
170
|
-
type TextFilterMatch = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
171
|
-
type NumberFilterMatch = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange" | "blank" | "notBlank";
|
|
172
|
-
type DateFilterMatch = "equals" | "notEquals" | "lessThan" | "greaterThan" | "inRange" | "blank" | "notBlank";
|
|
173
|
-
interface TextFilterCondition {
|
|
174
|
-
match: TextFilterMatch;
|
|
175
|
-
value?: string;
|
|
176
|
-
}
|
|
177
|
-
interface NumberFilterCondition {
|
|
178
|
-
match: NumberFilterMatch;
|
|
179
|
-
value?: number;
|
|
180
|
-
value2?: number;
|
|
181
|
-
}
|
|
182
|
-
interface DateFilterCondition {
|
|
183
|
-
match: DateFilterMatch;
|
|
184
|
-
value?: string;
|
|
185
|
-
value2?: string;
|
|
186
|
-
}
|
|
187
|
-
interface SetFilterCondition {
|
|
188
|
-
values: (string | number | null)[];
|
|
189
|
-
}
|
|
190
|
-
interface TextColumnFilter {
|
|
191
|
-
type: "text";
|
|
192
|
-
operator?: "and" | "or";
|
|
193
|
-
conditions: TextFilterCondition[];
|
|
194
|
-
}
|
|
195
|
-
interface NumberColumnFilter {
|
|
196
|
-
type: "number";
|
|
197
|
-
operator?: "and" | "or";
|
|
198
|
-
conditions: NumberFilterCondition[];
|
|
199
|
-
}
|
|
200
|
-
interface DateColumnFilter {
|
|
201
|
-
type: "date";
|
|
202
|
-
operator?: "and" | "or";
|
|
203
|
-
conditions: DateFilterCondition[];
|
|
204
|
-
}
|
|
205
|
-
interface SetColumnFilter {
|
|
206
|
-
type: "set";
|
|
207
|
-
values: (string | number | null)[];
|
|
208
|
-
}
|
|
209
|
-
type ColumnFilter = TextColumnFilter | NumberColumnFilter | DateColumnFilter | SetColumnFilter;
|
|
210
|
-
type FilterModel = Record<string, ColumnFilter>;
|
|
211
|
-
interface SortModelItem {
|
|
212
|
-
colId: string;
|
|
213
|
-
direction: SortDirection;
|
|
214
|
-
}
|
|
215
|
-
type SortModel = SortModelItem[];
|
|
216
|
-
interface SelectEditorOption {
|
|
217
|
-
label: string;
|
|
218
|
-
value: string | number;
|
|
219
|
-
disabled?: boolean;
|
|
220
|
-
}
|
|
221
|
-
interface SelectEditorParams {
|
|
222
|
-
/** Primitive options kept for concise same-label/same-value selects. */
|
|
223
|
-
values?: readonly (string | number)[];
|
|
224
|
-
/** Label/value options when the stored value differs from its display text. */
|
|
225
|
-
options?: readonly SelectEditorOption[];
|
|
226
|
-
}
|
|
227
|
-
interface SetFilterParams {
|
|
228
|
-
values?: (string | number | null)[];
|
|
229
|
-
maxValues?: number;
|
|
230
|
-
}
|
|
231
|
-
type CellEditorFactory = (params: CellEditorParams) => ICellEditor;
|
|
232
|
-
type CellRendererFn = (params: CellRendererParams) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
233
|
-
type CellClassRule = string | string[] | ((params: CellClassParams) => string | string[] | null | undefined);
|
|
234
|
-
type CellStyleRule = Partial<CSSStyleDeclaration> | ((params: CellClassParams<any, any>) => Partial<CSSStyleDeclaration> | null | undefined);
|
|
235
|
-
interface ColDef<TData = any, TValue = any> {
|
|
236
|
-
colId?: string;
|
|
237
|
-
field?: string;
|
|
238
|
-
headerName?: string;
|
|
239
|
-
align?: CellAlign;
|
|
240
|
-
headerAlign?: CellAlign;
|
|
241
|
-
headerClass?: string | string[];
|
|
242
|
-
headerTooltip?: string;
|
|
243
|
-
headerComponent?: (params: HeaderComponentParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
244
|
-
/** 未声明 width 时默认按内容测宽;false 保留默认宽度。maxWidth 可覆盖自动测宽的 360px 上限。 */
|
|
245
|
-
autoWidth?: boolean;
|
|
246
|
-
width?: number;
|
|
247
|
-
minWidth?: number;
|
|
248
|
-
maxWidth?: number;
|
|
249
|
-
flex?: number;
|
|
250
|
-
/** Excludes the column from `columnLayout: "fit"` scaling. */
|
|
251
|
-
suppressSizeToFit?: boolean;
|
|
252
|
-
/** Hides the per-column tools trigger while keeping the global column workbench available. */
|
|
253
|
-
suppressColumnMenu?: boolean;
|
|
254
|
-
hide?: boolean;
|
|
255
|
-
pinned?: PinnedDirection | boolean;
|
|
256
|
-
sortable?: boolean;
|
|
257
|
-
resizable?: boolean;
|
|
258
|
-
movable?: boolean;
|
|
259
|
-
filter?: boolean | FilterType;
|
|
260
|
-
filterParams?: SetFilterParams;
|
|
261
|
-
editable?: boolean | ((params: EditableParams<TData, TValue>) => boolean);
|
|
262
|
-
cellEditor?: "text" | "number" | "date" | "select" | CellEditorFactory | string;
|
|
263
|
-
cellEditorParams?: SelectEditorParams;
|
|
264
|
-
wrapText?: boolean;
|
|
265
|
-
checkboxSelection?: boolean;
|
|
266
|
-
rowGroup?: boolean;
|
|
267
|
-
aggFunc?: string;
|
|
268
|
-
cellStyle?: CellStyleRule;
|
|
269
|
-
selectable?: (params: CellClassParams<TData, TValue>) => boolean;
|
|
270
|
-
singleClickEdit?: boolean;
|
|
271
|
-
tooltipValueGetter?: (params: ValueFormatterParams<TData, TValue>) => string | null | undefined;
|
|
272
|
-
rowSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
273
|
-
autoRowSpan?: boolean;
|
|
274
|
-
colSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
275
|
-
autoHeight?: boolean;
|
|
276
|
-
validate?: (newValue: TValue, params: ValueSetterParams<TData, TValue>) => string | true | null | undefined | Promise<string | true | null | undefined>;
|
|
277
|
-
rowDrag?: boolean;
|
|
278
|
-
valueGetter?: (params: ValueGetterParams<TData, TValue>) => TValue;
|
|
279
|
-
valueSetter?: (params: ValueSetterParams<TData, TValue>) => boolean;
|
|
280
|
-
/** Synchronous user-input normalization. Not called by trusted transactions or undo replay. */
|
|
281
|
-
valueParser?: (params: ValueParserParams<TData, TValue>) => TValue;
|
|
282
|
-
/** Clipboard/file output; display formatting and sort/filter continue to use stored values. */
|
|
283
|
-
valueSerializer?: (params: ValueSerializerParams<TData, TValue>) => unknown;
|
|
284
|
-
valueFormatter?: (params: ValueFormatterParams<TData, TValue>) => any;
|
|
285
|
-
/** true 使用默认状态色;映射值为颜色,或 { label, color }。自定义 renderer 优先。 */
|
|
286
|
-
status?: ColumnStatus;
|
|
287
|
-
cellRenderer?: CellRendererFn | string;
|
|
288
|
-
cellRendererParams?: Record<string, any>;
|
|
289
|
-
cellClass?: CellClassRule;
|
|
290
|
-
comparator?: (valueA: any, valueB: any, nodeA: RowNode<TData>, nodeB: RowNode<TData>) => number;
|
|
291
|
-
/** Named column type(s), resolved left-to-right before this column definition. */
|
|
292
|
-
type?: string | readonly string[];
|
|
293
|
-
initialSort?: SortDirection;
|
|
294
|
-
onCellClick?: (event: CellClickEvent<TData, TValue>) => void;
|
|
295
|
-
onCellDoubleClick?: (event: CellDoubleClickEvent<TData, TValue>) => void;
|
|
296
|
-
}
|
|
297
|
-
interface ColDefGroup<TData = any> {
|
|
298
|
-
groupId?: string;
|
|
299
|
-
headerName?: string;
|
|
300
|
-
headerClass?: string | string[];
|
|
301
|
-
children: (ColDefGroup<TData> | ColDef<TData>)[];
|
|
302
|
-
}
|
|
303
|
-
type ColDefOrGroup<TData = any> = ColDefGroup<TData> | ColDef<TData>;
|
|
304
|
-
declare function isColDefGroup<TData = any>(def: ColDefOrGroup<TData>): def is ColDefGroup<TData>;
|
|
305
|
-
interface ColumnState {
|
|
306
|
-
colId: string;
|
|
307
|
-
hide?: boolean;
|
|
308
|
-
width?: number;
|
|
309
|
-
/** Active flex weight. A resize clears flex and turns width into a manual override. */
|
|
310
|
-
flex?: number | null;
|
|
311
|
-
/** Distinguishes responsive/definition width from an explicit user or API override. */
|
|
312
|
-
widthMode?: "auto" | "manual";
|
|
313
|
-
/** Measured content basis for responsive fit sizing; independent of the rendered width. */
|
|
314
|
-
contentWidth?: number;
|
|
315
|
-
pinned?: "left" | "right" | null;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
63
|
interface AdvancedFilterCondition {
|
|
319
64
|
kind: "condition";
|
|
320
65
|
colId: string;
|
|
@@ -1445,4 +1190,259 @@ interface GridApi<TData = any> {
|
|
|
1445
1190
|
isDestroyed(): boolean;
|
|
1446
1191
|
}
|
|
1447
1192
|
|
|
1448
|
-
|
|
1193
|
+
interface ValueGetterParams<TData = any, TValue = any> {
|
|
1194
|
+
data: TData | null;
|
|
1195
|
+
node: RowNode<TData>;
|
|
1196
|
+
colDef: ColDef<TData, TValue>;
|
|
1197
|
+
column: Column<TData>;
|
|
1198
|
+
api: GridApi<TData>;
|
|
1199
|
+
}
|
|
1200
|
+
interface ValueFormatterParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1201
|
+
value: TValue;
|
|
1202
|
+
}
|
|
1203
|
+
interface CellRendererParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1204
|
+
value: TValue;
|
|
1205
|
+
formatted: string;
|
|
1206
|
+
rowIndex: number;
|
|
1207
|
+
rendererParams?: Record<string, any>;
|
|
1208
|
+
}
|
|
1209
|
+
interface CellClassParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1210
|
+
value: TValue;
|
|
1211
|
+
rowIndex: number;
|
|
1212
|
+
}
|
|
1213
|
+
interface EditableParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1214
|
+
value: TValue;
|
|
1215
|
+
rowIndex: number;
|
|
1216
|
+
}
|
|
1217
|
+
interface CellEditorParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1218
|
+
value: TValue;
|
|
1219
|
+
rowIndex: number;
|
|
1220
|
+
keyPress?: string | null;
|
|
1221
|
+
}
|
|
1222
|
+
interface ValueSetterParams<TData = any, TValue = any> {
|
|
1223
|
+
oldValue: TValue;
|
|
1224
|
+
newValue: TValue;
|
|
1225
|
+
data: TData;
|
|
1226
|
+
node: RowNode<TData>;
|
|
1227
|
+
colDef: ColDef<TData, TValue>;
|
|
1228
|
+
column: Column<TData>;
|
|
1229
|
+
api: GridApi<TData>;
|
|
1230
|
+
}
|
|
1231
|
+
interface GetRowIdParams<TData = any> {
|
|
1232
|
+
data: TData;
|
|
1233
|
+
index: number;
|
|
1234
|
+
api: GridApi<TData>;
|
|
1235
|
+
}
|
|
1236
|
+
interface GetRowHeightParams<TData = any> {
|
|
1237
|
+
data: TData | null;
|
|
1238
|
+
node: RowNode<TData>;
|
|
1239
|
+
api: GridApi<TData>;
|
|
1240
|
+
}
|
|
1241
|
+
interface TooltipParams<TData = any> {
|
|
1242
|
+
data: TData | null;
|
|
1243
|
+
node: RowNode<TData>;
|
|
1244
|
+
api: GridApi<TData>;
|
|
1245
|
+
colId: string;
|
|
1246
|
+
value: any;
|
|
1247
|
+
formatted: string;
|
|
1248
|
+
rowIndex: number;
|
|
1249
|
+
}
|
|
1250
|
+
interface ContextMenuParams<TData = any> {
|
|
1251
|
+
data: TData | null;
|
|
1252
|
+
node: RowNode<TData>;
|
|
1253
|
+
api: GridApi<TData>;
|
|
1254
|
+
colId: string;
|
|
1255
|
+
value: any;
|
|
1256
|
+
rowIndex: number;
|
|
1257
|
+
}
|
|
1258
|
+
interface ContextMenuItem {
|
|
1259
|
+
label?: string;
|
|
1260
|
+
action?: () => void;
|
|
1261
|
+
danger?: boolean;
|
|
1262
|
+
disabled?: boolean;
|
|
1263
|
+
separator?: boolean;
|
|
1264
|
+
}
|
|
1265
|
+
interface HeaderComponentParams<TData = any> {
|
|
1266
|
+
colDef: ColDef<TData>;
|
|
1267
|
+
column: Column<TData>;
|
|
1268
|
+
api: GridApi<TData>;
|
|
1269
|
+
}
|
|
1270
|
+
interface ICellRendererResult {
|
|
1271
|
+
el: HTMLElement;
|
|
1272
|
+
/** Reuses the mounted renderer for an update. Return false to request recreation. */
|
|
1273
|
+
refresh?(params: CellRendererParams): boolean | void;
|
|
1274
|
+
destroy?: () => void;
|
|
1275
|
+
}
|
|
1276
|
+
type CellRendererOutput = string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1277
|
+
interface ICellEditor<TValue = any> {
|
|
1278
|
+
el: HTMLElement;
|
|
1279
|
+
getValue(): TValue | null | undefined;
|
|
1280
|
+
focus?(): void;
|
|
1281
|
+
destroy?(): void;
|
|
1282
|
+
isCancelBeforeStart?(): boolean;
|
|
1283
|
+
isCancelAfterEnd?(value: TValue | null | undefined): boolean;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
type SortDirection = "asc" | "desc";
|
|
1287
|
+
type PinnedDirection = "left" | "right";
|
|
1288
|
+
type FilterType = "text" | "number" | "date" | "set";
|
|
1289
|
+
type CellAlign = "left" | "center" | "right";
|
|
1290
|
+
type ValueInputSource = "editor" | "clipboard" | "import";
|
|
1291
|
+
type ValueOutputTarget = "clipboard" | "csv" | "xlsx";
|
|
1292
|
+
interface ValueParserParams<TData = any, TValue = any> extends ValueGetterParams<TData, TValue> {
|
|
1293
|
+
value: unknown;
|
|
1294
|
+
oldValue: TValue | undefined;
|
|
1295
|
+
source: ValueInputSource;
|
|
1296
|
+
}
|
|
1297
|
+
interface ValueSerializerParams<TData = any, TValue = any> extends ValueFormatterParams<TData, TValue> {
|
|
1298
|
+
target: ValueOutputTarget;
|
|
1299
|
+
}
|
|
1300
|
+
type TextFilterMatch = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "blank" | "notBlank";
|
|
1301
|
+
type NumberFilterMatch = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange" | "blank" | "notBlank";
|
|
1302
|
+
type DateFilterMatch = "equals" | "notEquals" | "lessThan" | "greaterThan" | "inRange" | "blank" | "notBlank";
|
|
1303
|
+
interface TextFilterCondition {
|
|
1304
|
+
match: TextFilterMatch;
|
|
1305
|
+
value?: string;
|
|
1306
|
+
}
|
|
1307
|
+
interface NumberFilterCondition {
|
|
1308
|
+
match: NumberFilterMatch;
|
|
1309
|
+
value?: number;
|
|
1310
|
+
value2?: number;
|
|
1311
|
+
}
|
|
1312
|
+
interface DateFilterCondition {
|
|
1313
|
+
match: DateFilterMatch;
|
|
1314
|
+
value?: string;
|
|
1315
|
+
value2?: string;
|
|
1316
|
+
}
|
|
1317
|
+
interface SetFilterCondition {
|
|
1318
|
+
values: (string | number | null)[];
|
|
1319
|
+
}
|
|
1320
|
+
interface TextColumnFilter {
|
|
1321
|
+
type: "text";
|
|
1322
|
+
operator?: "and" | "or";
|
|
1323
|
+
conditions: TextFilterCondition[];
|
|
1324
|
+
}
|
|
1325
|
+
interface NumberColumnFilter {
|
|
1326
|
+
type: "number";
|
|
1327
|
+
operator?: "and" | "or";
|
|
1328
|
+
conditions: NumberFilterCondition[];
|
|
1329
|
+
}
|
|
1330
|
+
interface DateColumnFilter {
|
|
1331
|
+
type: "date";
|
|
1332
|
+
operator?: "and" | "or";
|
|
1333
|
+
conditions: DateFilterCondition[];
|
|
1334
|
+
}
|
|
1335
|
+
interface SetColumnFilter {
|
|
1336
|
+
type: "set";
|
|
1337
|
+
values: (string | number | null)[];
|
|
1338
|
+
}
|
|
1339
|
+
type ColumnFilter = TextColumnFilter | NumberColumnFilter | DateColumnFilter | SetColumnFilter;
|
|
1340
|
+
type FilterModel = Record<string, ColumnFilter>;
|
|
1341
|
+
interface SortModelItem {
|
|
1342
|
+
colId: string;
|
|
1343
|
+
direction: SortDirection;
|
|
1344
|
+
}
|
|
1345
|
+
type SortModel = SortModelItem[];
|
|
1346
|
+
interface SelectEditorOption {
|
|
1347
|
+
label: string;
|
|
1348
|
+
value: string | number;
|
|
1349
|
+
disabled?: boolean;
|
|
1350
|
+
}
|
|
1351
|
+
interface SelectEditorParams {
|
|
1352
|
+
/** Primitive options kept for concise same-label/same-value selects. */
|
|
1353
|
+
values?: readonly (string | number)[];
|
|
1354
|
+
/** Label/value options when the stored value differs from its display text. */
|
|
1355
|
+
options?: readonly SelectEditorOption[];
|
|
1356
|
+
}
|
|
1357
|
+
interface SetFilterParams {
|
|
1358
|
+
values?: (string | number | null)[];
|
|
1359
|
+
maxValues?: number;
|
|
1360
|
+
}
|
|
1361
|
+
type CellEditorFactory = (params: CellEditorParams) => ICellEditor;
|
|
1362
|
+
type CellRendererFn = (params: CellRendererParams) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1363
|
+
type CellClassRule = string | string[] | ((params: CellClassParams) => string | string[] | null | undefined);
|
|
1364
|
+
type CellStyleRule = Partial<CSSStyleDeclaration> | ((params: CellClassParams<any, any>) => Partial<CSSStyleDeclaration> | null | undefined);
|
|
1365
|
+
interface ColDef<TData = any, TValue = any> {
|
|
1366
|
+
colId?: string;
|
|
1367
|
+
field?: string;
|
|
1368
|
+
headerName?: string;
|
|
1369
|
+
align?: CellAlign;
|
|
1370
|
+
headerAlign?: CellAlign;
|
|
1371
|
+
headerClass?: string | string[];
|
|
1372
|
+
headerTooltip?: string;
|
|
1373
|
+
headerComponent?: (params: HeaderComponentParams<TData>) => string | HTMLElement | ICellRendererResult | null | undefined;
|
|
1374
|
+
/** 未声明 width 时默认按内容测宽;false 保留默认宽度。maxWidth 可覆盖自动测宽的 360px 上限。 */
|
|
1375
|
+
autoWidth?: boolean;
|
|
1376
|
+
width?: number;
|
|
1377
|
+
minWidth?: number;
|
|
1378
|
+
maxWidth?: number;
|
|
1379
|
+
flex?: number;
|
|
1380
|
+
/** Excludes the column from `columnLayout: "fit"` scaling. */
|
|
1381
|
+
suppressSizeToFit?: boolean;
|
|
1382
|
+
/** Hides the per-column tools trigger while keeping the global column workbench available. */
|
|
1383
|
+
suppressColumnMenu?: boolean;
|
|
1384
|
+
hide?: boolean;
|
|
1385
|
+
pinned?: PinnedDirection | boolean;
|
|
1386
|
+
sortable?: boolean;
|
|
1387
|
+
resizable?: boolean;
|
|
1388
|
+
movable?: boolean;
|
|
1389
|
+
filter?: boolean | FilterType;
|
|
1390
|
+
filterParams?: SetFilterParams;
|
|
1391
|
+
editable?: boolean | ((params: EditableParams<TData, TValue>) => boolean);
|
|
1392
|
+
cellEditor?: "text" | "number" | "date" | "select" | CellEditorFactory | string;
|
|
1393
|
+
cellEditorParams?: SelectEditorParams;
|
|
1394
|
+
wrapText?: boolean;
|
|
1395
|
+
checkboxSelection?: boolean;
|
|
1396
|
+
rowGroup?: boolean;
|
|
1397
|
+
aggFunc?: string;
|
|
1398
|
+
cellStyle?: CellStyleRule;
|
|
1399
|
+
selectable?: (params: CellClassParams<TData, TValue>) => boolean;
|
|
1400
|
+
singleClickEdit?: boolean;
|
|
1401
|
+
tooltipValueGetter?: (params: ValueFormatterParams<TData, TValue>) => string | null | undefined;
|
|
1402
|
+
rowSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
1403
|
+
autoRowSpan?: boolean;
|
|
1404
|
+
colSpan?: (params: CellClassParams<TData, TValue>) => number;
|
|
1405
|
+
autoHeight?: boolean;
|
|
1406
|
+
validate?: (newValue: TValue, params: ValueSetterParams<TData, TValue>) => string | true | null | undefined | Promise<string | true | null | undefined>;
|
|
1407
|
+
rowDrag?: boolean;
|
|
1408
|
+
valueGetter?: (params: ValueGetterParams<TData, TValue>) => TValue;
|
|
1409
|
+
valueSetter?: (params: ValueSetterParams<TData, TValue>) => boolean;
|
|
1410
|
+
/** Synchronous user-input normalization. Not called by trusted transactions or undo replay. */
|
|
1411
|
+
valueParser?: (params: ValueParserParams<TData, TValue>) => TValue;
|
|
1412
|
+
/** Clipboard/file output; display formatting and sort/filter continue to use stored values. */
|
|
1413
|
+
valueSerializer?: (params: ValueSerializerParams<TData, TValue>) => unknown;
|
|
1414
|
+
valueFormatter?: (params: ValueFormatterParams<TData, TValue>) => any;
|
|
1415
|
+
/** true 使用默认状态色;映射值为颜色,或 { label, color }。自定义 renderer 优先。 */
|
|
1416
|
+
status?: ColumnStatus;
|
|
1417
|
+
cellRenderer?: CellRendererFn | string;
|
|
1418
|
+
cellRendererParams?: Record<string, any>;
|
|
1419
|
+
cellClass?: CellClassRule;
|
|
1420
|
+
comparator?: (valueA: any, valueB: any, nodeA: RowNode<TData>, nodeB: RowNode<TData>) => number;
|
|
1421
|
+
/** Named column type(s), resolved left-to-right before this column definition. */
|
|
1422
|
+
type?: string | readonly string[];
|
|
1423
|
+
initialSort?: SortDirection;
|
|
1424
|
+
onCellClick?: (event: CellClickEvent<TData, TValue>) => void;
|
|
1425
|
+
onCellDoubleClick?: (event: CellDoubleClickEvent<TData, TValue>) => void;
|
|
1426
|
+
}
|
|
1427
|
+
interface ColDefGroup<TData = any> {
|
|
1428
|
+
groupId?: string;
|
|
1429
|
+
headerName?: string;
|
|
1430
|
+
headerClass?: string | string[];
|
|
1431
|
+
children: (ColDefGroup<TData> | ColDef<TData>)[];
|
|
1432
|
+
}
|
|
1433
|
+
type ColDefOrGroup<TData = any> = ColDefGroup<TData> | ColDef<TData>;
|
|
1434
|
+
declare function isColDefGroup<TData = any>(def: ColDefOrGroup<TData>): def is ColDefGroup<TData>;
|
|
1435
|
+
interface ColumnState {
|
|
1436
|
+
colId: string;
|
|
1437
|
+
hide?: boolean;
|
|
1438
|
+
width?: number;
|
|
1439
|
+
/** Active flex weight. A resize clears flex and turns width into a manual override. */
|
|
1440
|
+
flex?: number | null;
|
|
1441
|
+
/** Distinguishes responsive/definition width from an explicit user or API override. */
|
|
1442
|
+
widthMode?: "auto" | "manual";
|
|
1443
|
+
/** Measured content basis for responsive fit sizing; independent of the rendered width. */
|
|
1444
|
+
contentWidth?: number;
|
|
1445
|
+
pinned?: "left" | "right" | null;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
export { type ContextMenuItem as $, type AdvancedFilterModel as A, type ApplyGridStateOptions as B, type ColDef as C, type CellAlign as D, type CellClassParams as E, type FilterType as F, type GridFeature as G, type CellClassRule as H, type ImportMatrixOptions as I, type CellClickEvent as J, type CellContextMenuEvent as K, type CellDoubleClickEvent as L, type CellEditingStartedEvent as M, type CellEditingStoppedEvent as N, type CellEditorFactory as O, type CellEditorParams as P, type CellRendererOutput as Q, type CellStyleRule as R, type SortModel as S, type CellValueChangedEvent as T, type ColDefOrGroup as U, type ColumnLayoutMode as V, type ColumnMovedEvent as W, type ColumnResizedEvent as X, type ColumnStatus as Y, type ColumnVisibilityChangedEvent as Z, type ColumnWorkbenchItem as _, type GridCellRange as a, type PaginationChangedEvent as a$, type ContextMenuParams as a0, type CsvExportParams as a1, DEFAULT_LOCALE as a2, type DatasourceMode as a3, type DateFilterCondition as a4, type DateFilterMatch as a5, type DetailRowRendererParams as a6, type DetailToggledEvent as a7, type DirtyStateChangedEvent as a8, type DomLayoutMode as a9, type GridHierarchyApi as aA, type GridIoApi as aB, type GridPaginationApi as aC, type GridPerformanceSnapshot as aD, type GridPersistenceOptions as aE, type GridReadyEvent as aF, type GridRowsApi as aG, type GridSelectionApi as aH, type GridSortingApi as aI, type GridStateApi as aJ, type GridStateSection as aK, type GridUpdateSchedulerSnapshot as aL, type GridViewApi as aM, type HeaderComponentParams as aN, type ICellEditor as aO, type ICellRendererResult as aP, type ImportCsvOptions as aQ, type InfiniteGetRowsParams as aR, LOCALE_EN as aS, type MachTableLocale as aT, type MachTableLocaleKey as aU, type MatrixExportParams as aV, type ModelUpdatedEvent as aW, type NumberFilterCondition as aX, type NumberFilterMatch as aY, type OverlayContent as aZ, type OverlayTemplate as a_, EVENT_TYPES as aa, type EditableIndicator as ab, type EditableParams as ac, type EventHandlers as ad, type FilterChangedEvent as ae, type GetRowHeightParams as af, type GridAsyncOptions as ag, type GridBatchSaveResult as ah, type GridCellChange as ai, type GridColumnsApi as aj, type GridDataProcessorColumn as ak, type GridDataProcessorRequest as al, type GridDataProcessorResult as am, type GridDataProcessorRow as an, type GridDatasource as ao, type GridDiagnosticError as ap, type GridDiagnostics as aq, type GridDiagnosticsApi as ar, type GridEditType as as, type GridEditingApi as at, type GridErrorCode as au, type GridErrorEvent as av, type GridEventBase as aw, type GridEventMap as ax, type GridFeatureContext as ay, type GridFilteringApi as az, type GridApi as b, type PaginationConfig as b0, type PinnedDirection as b1, type PrintOptions as b2, type RangeSelectionChangedEvent as b3, type RefreshCellsParams as b4, type RemoteBlockCacheSnapshot as b5, type ResolvedGridOptions as b6, type RowClickEvent as b7, type RowDragEndEvent as b8, type RowDragIntent as b9, type ThemeMode as bA, type TooltipParams as bB, type TreeChildrenLoadFailedEvent as bC, type TreeChildrenLoadedEvent as bD, type TreeDataLoadParams as bE, type ValueFormatterParams as bF, type ValueGetterParams as bG, type ValueInputSource as bH, type ValueOutputTarget as bI, type ValueParserParams as bJ, type ValueSerializerParams as bK, type ValueSetterParams as bL, type WatermarkConfig as bM, formatText as bN, formatTwo as bO, isColDefGroup as bP, matchLocaleKey as bQ, type RowDragPolicy as ba, type RowEditChange as bb, type RowEditValidationParams as bc, type RowEditValidationResult as bd, type RowEditingStartedEvent as be, type RowEditingStoppedEvent as bf, type RowNode as bg, type RowSelectionMode as bh, type RowStyleParams as bi, type RowStyleRule as bj, type RowTone as bk, type RowTransaction as bl, type SaveChangeIssue as bm, type SaveChangesResult as bn, type SelectEditorOption as bo, type SelectEditorParams as bp, type SelectionChangedEvent as bq, type SetFilterCondition as br, type SetFilterParams as bs, type SortChangedEvent as bt, type SortDirection as bu, type SortModelItem as bv, type StatusBarConfig as bw, type StatusBarPanel as bx, type TextFilterCondition as by, type TextFilterMatch as bz, type GridOptions as c, type GridDataProcessor as d, type GridComponents as e, type GridState as f, type GridStateStore as g, type FilterModel as h, type FieldPath as i, type SaveChangesHandler as j, type GridEventType as k, type ColumnFilter as l, type AdvancedFilterCondition as m, type AdvancedFilterNode as n, type AdvancedFilterGroup as o, type ColDefGroup as p, type GridStateInput as q, type GridSize as r, type CellRendererParams as s, type GridChange as t, type CellRendererFn as u, type FieldPathValue as v, type SaveChangeConflict as w, type ColumnState as x, type ActionPolicy as y, type ActionPolicyContext as z };
|