@taocompany/magic-grid 0.2.0 → 0.3.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 +586 -19
- package/dist/components/ColumnSettings/ColumnFilterPanelEmbed.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnFilterPanelEmbed.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsButton.vue.d.ts +6 -5
- package/dist/components/ColumnSettings/ColumnSettingsButton.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsClearFiltersBar.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsClearFiltersBar.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsGroupedLists.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsGroupedLists.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsList.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsList.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsMenu.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsMenu.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsMenuIcon.vue.d.ts +3 -2
- package/dist/components/ColumnSettings/ColumnSettingsMenuIcon.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsMenuItem.vue.d.ts +2 -1
- package/dist/components/ColumnSettings/ColumnSettingsMenuItem.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsPanel.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsPanel.vue.d.ts.map +1 -1
- package/dist/components/ColumnSettings/ColumnSettingsRow.vue.d.ts +4 -3
- package/dist/components/ColumnSettings/ColumnSettingsRow.vue.d.ts.map +1 -1
- package/dist/components/MagicGrid/MagicGrid.vue.d.ts +166 -155
- package/dist/components/MagicGrid/MagicGrid.vue.d.ts.map +1 -1
- package/dist/components/MagicGrid/useStatusBarContext.d.ts +3 -3
- package/dist/components/StatusBar/StatusBarDefaultPanels.vue.d.ts +3 -2
- package/dist/components/StatusBar/StatusBarDefaultPanels.vue.d.ts.map +1 -1
- package/dist/components/StatusBar/StatusBarRangeAggregationPanels.vue.d.ts +3 -2
- package/dist/components/StatusBar/StatusBarRangeAggregationPanels.vue.d.ts.map +1 -1
- package/dist/components/StatusBar/resolveStatusBarRangeAggregationPrecision.d.ts +1 -1
- package/dist/components/StatusBar/resolveStatusBarRangeAggregationPrecision.d.ts.map +1 -1
- package/dist/components/cellEditor/index.d.ts +1 -1
- package/dist/components/cellEditor/index.d.ts.map +1 -1
- package/dist/components/cellEditor/{useMagicGridCellEditor.d.ts → useCellEditor.d.ts} +4 -4
- package/dist/components/cellEditor/useCellEditor.d.ts.map +1 -0
- package/dist/core/api/gridApi.d.ts +35 -23
- package/dist/core/api/gridApi.d.ts.map +1 -1
- package/dist/core/cellComment/cellCommentService.d.ts +2 -2
- package/dist/core/column/columnModel.d.ts +1 -1
- package/dist/core/column/createExpandColumnDef.d.ts +1 -1
- package/dist/core/column/createGroupColumnDef.d.ts +1 -1
- package/dist/core/column/createIndexColumnDef.d.ts +1 -1
- package/dist/core/column/createSelectionColumnDef.d.ts +1 -1
- package/dist/core/column/prepareGridColumnDefs.d.ts +1 -1
- package/dist/core/column/resolveColumnAlign.d.ts +3 -3
- package/dist/core/column/resolveColumnAlign.d.ts.map +1 -1
- package/dist/core/editing/cellDisablePipeline.d.ts +1 -1
- package/dist/core/editing/cellEditPipeline.d.ts +5 -5
- package/dist/core/editing/cellEditPipeline.d.ts.map +1 -1
- package/dist/core/editing/gridValidation.d.ts +2 -2
- package/dist/core/grid/cellEditing/types.d.ts +4 -3
- package/dist/core/grid/cellEditing/types.d.ts.map +1 -1
- package/dist/core/grid/grid.d.ts +14 -12
- package/dist/core/grid/grid.d.ts.map +1 -1
- package/dist/core/grid/gridColumnLayout.d.ts +8 -5
- package/dist/core/grid/gridColumnLayout.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/focusController.d.ts +2 -2
- package/dist/core/grid/gridInteraction/focusController.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/indexSelectionDragSession.d.ts +2 -1
- package/dist/core/grid/gridInteraction/indexSelectionDragSession.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/rowDragSession.d.ts +3 -2
- package/dist/core/grid/gridInteraction/rowDragSession.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/types.d.ts +18 -13
- package/dist/core/grid/gridInteraction/types.d.ts.map +1 -1
- package/dist/core/grid/gridOptions.d.ts +6 -5
- package/dist/core/grid/gridOptions.d.ts.map +1 -1
- package/dist/core/grid/gridRowMutation.d.ts +5 -4
- package/dist/core/renderer/cellRangeVisualController.d.ts +2 -1
- package/dist/core/renderer/cellRangeVisualController.d.ts.map +1 -1
- package/dist/core/renderer/rowRenderer.d.ts +19 -12
- package/dist/core/renderer/rowRenderer.d.ts.map +1 -1
- package/dist/core/row/cellComp.d.ts +2 -1
- package/dist/core/row/cellComp.d.ts.map +1 -1
- package/dist/core/row/rowComp.d.ts +10 -5
- package/dist/core/row/rowComp.d.ts.map +1 -1
- package/dist/core/rowModel/clientSideRowModel.d.ts +1 -1
- package/dist/core/rowModel/createRowNodes.d.ts +1 -1
- package/dist/core/rowModel/rowDataExport.d.ts +1 -1
- package/dist/core/selection/cellClipboardService.d.ts +2 -1
- package/dist/core/selection/cellClipboardService.d.ts.map +1 -1
- package/dist/core/selection/selectable.d.ts +1 -1
- package/dist/core/styling/cellStylePipeline.d.ts +1 -1
- package/dist/core/theme/gridSize.d.ts +10 -10
- package/dist/core/theme/gridSize.d.ts.map +1 -1
- package/dist/core/theme/gridTheme.d.ts +7 -7
- package/dist/core/theme/gridTheme.d.ts.map +1 -1
- package/dist/core/theme/index.d.ts +2 -2
- package/dist/core/theme/index.d.ts.map +1 -1
- package/dist/core/transaction/applyTransaction.d.ts +1 -1
- package/dist/core/treeTable/treeLazyLoadService.d.ts +1 -1
- package/dist/core/types/align.d.ts +16 -20
- package/dist/core/types/align.d.ts.map +1 -1
- package/dist/core/types/businessRowId.d.ts +3 -2
- package/dist/core/types/businessRowId.d.ts.map +1 -1
- package/dist/core/types/cellClipboard.d.ts +3 -2
- package/dist/core/types/cellClipboard.d.ts.map +1 -1
- package/dist/core/types/cellColor.d.ts +1 -1
- package/dist/core/types/cellComment.d.ts +3 -2
- package/dist/core/types/cellComment.d.ts.map +1 -1
- package/dist/core/types/cellDisable.d.ts +1 -1
- package/dist/core/types/cellEditor.d.ts +4 -3
- package/dist/core/types/cellEditor.d.ts.map +1 -1
- package/dist/core/types/cellRenderer.d.ts +1 -1
- package/dist/core/types/cellSpan.d.ts +1 -1
- package/dist/core/types/column.d.ts +47 -32
- package/dist/core/types/column.d.ts.map +1 -1
- package/dist/core/types/columnAvailability.d.ts +1 -1
- package/dist/core/types/columnFilter.d.ts +1 -1
- package/dist/core/types/columnMove.d.ts +1 -1
- package/dist/core/types/columnResize.d.ts +1 -1
- package/dist/core/types/columnSettingsPanel.d.ts +2 -2
- package/dist/core/types/columnSettingsPanel.d.ts.map +1 -1
- package/dist/core/types/columnSort.d.ts +1 -1
- package/dist/core/types/columnVisibility.d.ts +1 -1
- package/dist/core/types/events.d.ts +8 -6
- package/dist/core/types/events.d.ts.map +1 -1
- package/dist/core/types/gridOptions.d.ts +9 -6
- package/dist/core/types/gridOptions.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +2 -2
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/indexColumn.d.ts +14 -14
- package/dist/core/types/indexColumn.d.ts.map +1 -1
- package/dist/core/types/overflowTooltip.d.ts +1 -1
- package/dist/core/types/pipeline.d.ts +1 -1
- package/dist/core/types/rowComp.d.ts +10 -5
- package/dist/core/types/rowComp.d.ts.map +1 -1
- package/dist/core/types/rowDrag.d.ts +1 -1
- package/dist/core/types/rowExpansion.d.ts +1 -1
- package/dist/core/types/rowGrouping.d.ts +1 -1
- package/dist/core/types/rowHeight.d.ts +1 -1
- package/dist/core/types/rowMutation.d.ts +1 -1
- package/dist/core/types/rowMutationAsync.d.ts +1 -1
- package/dist/core/types/rowNode.d.ts +1 -1
- package/dist/core/types/selectionColumn.d.ts +14 -14
- package/dist/core/types/selectionColumn.d.ts.map +1 -1
- package/dist/core/types/summary.d.ts +1 -1
- package/dist/core/types/transaction.d.ts +1 -1
- package/dist/core/types/treeTable.d.ts +1 -1
- package/dist/core/types/validation.d.ts +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +220 -220
- package/dist/index.es.js.map +1 -1
- package/dist/types/core.cjs.js +0 -0
- package/dist/types/core.d.ts +3038 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.es.js +0 -0
- package/dist/types/magic-grid-expose.d.ts +13 -2
- package/dist/types/magic-grid-expose.d.ts.map +1 -1
- package/dist/types/magic-grid.d.ts +318 -238
- package/dist/types/magic-grid.d.ts.map +1 -1
- package/dist/types/{statusBar.d.ts → status-bar.d.ts} +5 -1
- package/dist/types/status-bar.d.ts.map +1 -0
- package/dist/types/validation.cjs.js +0 -0
- package/dist/types/validation.d.ts +9 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/types/validation.es.js +0 -0
- package/dist/validation/asyncValidatorAdapter.d.ts +5 -6
- package/dist/validation/asyncValidatorAdapter.d.ts.map +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/{validation-DWDC_zL7.js → validation-BHqm5Flb.js} +33 -33
- package/dist/validation-BHqm5Flb.js.map +1 -0
- package/dist/validation-CD6lt5wS.cjs.map +1 -1
- package/dist/validation.cjs.js +1 -1
- package/dist/validation.es.js +1 -1
- package/package.json +13 -2
- package/dist/components/cellEditor/useMagicGridCellEditor.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/statusBar.d.ts.map +0 -1
- package/dist/validation-DWDC_zL7.js.map +0 -1
|
@@ -0,0 +1,3038 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Rule } from 'async-validator';
|
|
3
|
+
|
|
4
|
+
export declare interface AddRowItem {
|
|
5
|
+
/** 行数据;新增临时行时 rowKey 字段应省略或为 null */
|
|
6
|
+
data: RowData;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** 带插入位置的新增行 payload(applyTransaction / addRows 共用) */
|
|
10
|
+
export declare interface AddRowPayload {
|
|
11
|
+
data: RowData;
|
|
12
|
+
index?: number;
|
|
13
|
+
indexMode?: RowIndexMode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface AddRowsOptions {
|
|
17
|
+
rows: AddRowItem[];
|
|
18
|
+
/** 插入起始下标;省略 = 末尾 */
|
|
19
|
+
index?: number;
|
|
20
|
+
/** 下标基准,默认 'source' */
|
|
21
|
+
indexMode?: RowIndexMode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface AsyncRowMutationAddParams {
|
|
25
|
+
rows: ReadonlyArray<{
|
|
26
|
+
data: RowData;
|
|
27
|
+
}>;
|
|
28
|
+
index?: number;
|
|
29
|
+
indexMode?: RowIndexMode;
|
|
30
|
+
signal: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare interface AsyncRowMutationAddResult {
|
|
34
|
+
rows?: ReadonlyArray<AsyncRowMutationAddResultRow | void>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare interface AsyncRowMutationAddResultRow {
|
|
38
|
+
/** 写入 data[rowKey];提供则创建持久化行(非 transient) */
|
|
39
|
+
businessId?: string | number;
|
|
40
|
+
/** 合并进 data(如服务端 enrich 字段) */
|
|
41
|
+
data?: RowData;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** 异步行变更持久化钩子(GridOptions.asyncRowMutation) */
|
|
45
|
+
export declare interface AsyncRowMutationHandlers {
|
|
46
|
+
/** 新增:await 服务端成功后 apply 本地;reject 则不写入 */
|
|
47
|
+
add?: (params: AsyncRowMutationAddParams) => Promise<AsyncRowMutationAddResult | void>;
|
|
48
|
+
/** 更新:await 服务端成功后 apply 本地;reject 则不写入 */
|
|
49
|
+
update?: (params: AsyncRowMutationUpdateParams) => Promise<void>;
|
|
50
|
+
/** 删除:await 服务端成功后 apply 本地;reject 则不删除 */
|
|
51
|
+
remove?: (params: AsyncRowMutationRemoveParams) => Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare interface AsyncRowMutationRemoveParams {
|
|
55
|
+
rowIds: readonly string[];
|
|
56
|
+
rows: ReadonlyArray<{
|
|
57
|
+
rowId: string;
|
|
58
|
+
data: RowData;
|
|
59
|
+
}>;
|
|
60
|
+
signal: AbortSignal;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export declare interface AsyncRowMutationUpdateParams {
|
|
64
|
+
rows: ReadonlyArray<{
|
|
65
|
+
rowId: string;
|
|
66
|
+
data: RowData;
|
|
67
|
+
}>;
|
|
68
|
+
signal: AbortSignal;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare type AutoSizeStrategy = SizeColumnsToFitGridStrategy | SizeColumnsToFitProvidedWidthStrategy | SizeColumnsToContentStrategy;
|
|
72
|
+
|
|
73
|
+
export declare interface BodyScrollEvent {
|
|
74
|
+
scrollTop: number;
|
|
75
|
+
scrollLeft: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** 内置编辑器标识 */
|
|
79
|
+
export declare type BuiltInCellEditor = 'text' | 'number' | 'checkbox';
|
|
80
|
+
|
|
81
|
+
/** 对外 API / 事件 rowId:与用户 data[rowKey] 同型;临时行无业务主键时为 null */
|
|
82
|
+
export declare type BusinessRowId = RowId | null;
|
|
83
|
+
|
|
84
|
+
export declare interface CellClickedEvent {
|
|
85
|
+
rowId: BusinessRowId;
|
|
86
|
+
colId: string;
|
|
87
|
+
rowIndex: number;
|
|
88
|
+
rowNode: RowNode;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** 单元格批注载荷 */
|
|
92
|
+
export declare interface CellComment<TMetadata = unknown> {
|
|
93
|
+
/** 批注正文(纯文本) */
|
|
94
|
+
text: string;
|
|
95
|
+
/** true → 内置 UI 只读;API 仍可覆盖 */
|
|
96
|
+
readOnly?: boolean;
|
|
97
|
+
author?: string;
|
|
98
|
+
createdAt?: string;
|
|
99
|
+
updatedAt?: string;
|
|
100
|
+
metadata?: TMetadata;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export declare interface CellCommentChangedEvent<TMetadata = unknown> {
|
|
104
|
+
rowId: BusinessRowId;
|
|
105
|
+
colId: string;
|
|
106
|
+
/** null 表示已删除 */
|
|
107
|
+
comment: CellComment<TMetadata> | null;
|
|
108
|
+
source: CellCommentSource;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare interface CellCommentParams<TData = RowData> {
|
|
112
|
+
rowId: BusinessRowId;
|
|
113
|
+
colId: string;
|
|
114
|
+
data: TData;
|
|
115
|
+
column: Column;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** 批注持久化数据源;提供即启用批注能力 */
|
|
119
|
+
export declare interface CellCommentsDataSource<TData = RowData, TMetadata = unknown> {
|
|
120
|
+
getComment: (params: CellCommentParams<TData>) => CellComment<TMetadata> | undefined | null;
|
|
121
|
+
setComment: (params: SetCellCommentParams<TData, TMetadata>) => void | Promise<void>;
|
|
122
|
+
init?: (ctx: CellCommentsDataSourceInitContext) => void;
|
|
123
|
+
destroy?: () => void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare interface CellCommentsDataSourceInitContext {
|
|
127
|
+
api: GridApi;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export declare type CellCommentSource = 'ui' | 'api';
|
|
131
|
+
|
|
132
|
+
export declare type CellCommentTrigger = 'hover' | 'click';
|
|
133
|
+
|
|
134
|
+
export declare interface CellCommitFinishedEvent {
|
|
135
|
+
rowId: BusinessRowId;
|
|
136
|
+
colId: string;
|
|
137
|
+
rowIndex: number;
|
|
138
|
+
committed: boolean;
|
|
139
|
+
aborted?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export declare interface CellCommitStartedEvent {
|
|
143
|
+
rowId: BusinessRowId;
|
|
144
|
+
colId: string;
|
|
145
|
+
rowIndex: number;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export declare type CellDisabledFn<TData = RowData> = (params: CellDisabledParams<TData>) => boolean;
|
|
149
|
+
|
|
150
|
+
/** 格级禁用判定参数 */
|
|
151
|
+
export declare interface CellDisabledParams<TData = RowData> {
|
|
152
|
+
data: TData;
|
|
153
|
+
rowId: BusinessRowId;
|
|
154
|
+
colId: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** 编辑范围:单格编辑 vs 整行编辑 */
|
|
158
|
+
export declare type CellEditBehavior = 'cell' | 'row';
|
|
159
|
+
|
|
160
|
+
export declare interface CellEditingStartedEvent {
|
|
161
|
+
rowId: BusinessRowId;
|
|
162
|
+
colId: string;
|
|
163
|
+
rowIndex: number;
|
|
164
|
+
value: unknown;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare interface CellEditingStoppedEvent {
|
|
168
|
+
rowId: BusinessRowId;
|
|
169
|
+
colId: string;
|
|
170
|
+
rowIndex: number;
|
|
171
|
+
committed: boolean;
|
|
172
|
+
oldValue: unknown;
|
|
173
|
+
newValue: unknown;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare interface CellEditorContext {
|
|
177
|
+
/** 绑定到第三方组件 @keydown */
|
|
178
|
+
onKeydown: (event: Event | KeyboardEvent) => void;
|
|
179
|
+
/** 绑定到 @change;或 commitOnChange 时内部已处理 */
|
|
180
|
+
onChange: () => void;
|
|
181
|
+
commit: () => void;
|
|
182
|
+
cancel: () => void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** 列级编辑器配置:函数、内置名、或命名引用 */
|
|
186
|
+
export declare type CellEditorDef = CellEditorFn | CellEditorRef;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 自定义单元格编辑器
|
|
190
|
+
* - 返回 HTMLElement:由内核写入 mount 容器
|
|
191
|
+
* - 返回 void:表示已在 ctx.mountEl 内自行挂载(如 Vue 编辑器)
|
|
192
|
+
*/
|
|
193
|
+
export declare type CellEditorFn = (params: CellEditorParams, ctx: CellEditorMountContext) => HTMLElement | void | null | undefined;
|
|
194
|
+
|
|
195
|
+
/** 内核键盘策略(由 Vue Composable 注册) */
|
|
196
|
+
export declare interface CellEditorKeyboardPolicy {
|
|
197
|
+
/** 为 true 时内核捕获阶段不处理 Enter,交由编辑器组件确认后再提交 */
|
|
198
|
+
deferEnterCommit?: boolean;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** 单元格编辑器呈现模式:overlay 进入编辑态;inline 常驻格内 */
|
|
202
|
+
export declare type CellEditorMode = 'overlay' | 'inline';
|
|
203
|
+
|
|
204
|
+
/** 编辑器挂载上下文(内核提供 mount 容器) */
|
|
205
|
+
export declare interface CellEditorMountContext {
|
|
206
|
+
mountEl: HTMLElement;
|
|
207
|
+
clear(): void;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export declare interface CellEditorOptions<T> {
|
|
211
|
+
/** 交互策略,决定键盘与提交默认行为 */
|
|
212
|
+
strategy?: CellEditorStrategy;
|
|
213
|
+
/** 读取当前 draft 值 */
|
|
214
|
+
getValue: () => T;
|
|
215
|
+
/** 提交前序列化为字符串 */
|
|
216
|
+
formatValue?: (value: T) => string;
|
|
217
|
+
/** 进入编辑后 focus / 打开面板 */
|
|
218
|
+
onStart?: () => void | Promise<void>;
|
|
219
|
+
/** 值变更时自动提交(overlay 默认 true) */
|
|
220
|
+
commitOnChange?: boolean;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** 自定义单元格编辑器入参(对称 CellRendererParams) */
|
|
224
|
+
export declare interface CellEditorParams {
|
|
225
|
+
rowId: BusinessRowId;
|
|
226
|
+
rowIndex: number;
|
|
227
|
+
colId: string;
|
|
228
|
+
value: unknown;
|
|
229
|
+
data: RowData;
|
|
230
|
+
formattedValue: string;
|
|
231
|
+
/** 提交(true) 或 取消(false);块 5 起返回 Promise */
|
|
232
|
+
stopEditing: (commit?: boolean) => Promise<void>;
|
|
233
|
+
/** 中断进行中的 async 提交,保持编辑态 */
|
|
234
|
+
cancelCommit: () => void;
|
|
235
|
+
/** 当前编辑会话阶段 */
|
|
236
|
+
getEditPhase: () => EditSessionPhase;
|
|
237
|
+
/** Vue / 复合组件编辑器注册自定义取值(优先于 DOM 扫描) */
|
|
238
|
+
setGetValue?: (getValue: () => string) => void;
|
|
239
|
+
/** 注册键盘策略(如 deferEnterCommit、commitOnChange) */
|
|
240
|
+
setKeyboardPolicy?: (policy: CellEditorKeyboardPolicy) => void;
|
|
241
|
+
/** 是否执行编辑器 onStart(focus / 打开 overlay)。
|
|
242
|
+
* 行编辑时仅 focusColId 对应列为 true;省略时视为 true(单格编辑)。
|
|
243
|
+
*/
|
|
244
|
+
autoFocus?: boolean;
|
|
245
|
+
/** 对当前 draft 值执行校验(可 async);不触发 commit */
|
|
246
|
+
validate: (options?: {
|
|
247
|
+
signal?: AbortSignal;
|
|
248
|
+
}) => Promise< CellValidationOutcome>;
|
|
249
|
+
/** inline 模式:提交当前值(块 3 注入;走完整 commit 管线) */
|
|
250
|
+
commit?: (rawValue?: string) => Promise<void>;
|
|
251
|
+
/** 是否为常驻 inline 编辑器(块 2+ 注入) */
|
|
252
|
+
inline?: boolean;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** 命名编辑器引用(内置名或 registerCellEditor 注册名) */
|
|
256
|
+
export declare type CellEditorRef = BuiltInCellEditor | (string & {});
|
|
257
|
+
|
|
258
|
+
/** 编辑器交互策略 */
|
|
259
|
+
export declare type CellEditorStrategy = 'input' | 'overlay';
|
|
260
|
+
|
|
261
|
+
/** 进入编辑态的触发方式(单击 / 双击) */
|
|
262
|
+
export declare type CellEditType = 'singleClick' | 'doubleClick';
|
|
263
|
+
|
|
264
|
+
export declare interface CellFocusedEvent {
|
|
265
|
+
rowId: BusinessRowId;
|
|
266
|
+
colId: string;
|
|
267
|
+
rowIndex: number;
|
|
268
|
+
rowNode: RowNode;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** CellSelectionOptions 层 handle 模式;默认 off */
|
|
272
|
+
export declare type CellHandleMode = 'off' | 'fill' | 'range';
|
|
273
|
+
|
|
274
|
+
export declare interface CellPosition {
|
|
275
|
+
rowIndex: number;
|
|
276
|
+
colId: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** 矩形选区(行列边界均为 display index + displayed colId) */
|
|
280
|
+
export declare interface CellRange {
|
|
281
|
+
startRowIndex: number;
|
|
282
|
+
endRowIndex: number;
|
|
283
|
+
startColId: string;
|
|
284
|
+
endColId: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 自定义单元格渲染器
|
|
289
|
+
* - 返回 string / HTMLElement:由内核写入 mount 容器
|
|
290
|
+
* - 返回 void:表示已在 ctx.mountEl 内自行挂载(如 Vue 渲染器)
|
|
291
|
+
*/
|
|
292
|
+
export declare type CellRendererFn = (params: CellRendererParams, ctx: CellRendererMountContext) => string | HTMLElement | void | null | undefined;
|
|
293
|
+
|
|
294
|
+
/** 渲染器挂载上下文(内核提供 mount 容器) */
|
|
295
|
+
export declare interface CellRendererMountContext {
|
|
296
|
+
mountEl: HTMLElement;
|
|
297
|
+
clear(): void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** 自定义单元格渲染器入参 */
|
|
301
|
+
export declare interface CellRendererParams {
|
|
302
|
+
rowId: BusinessRowId;
|
|
303
|
+
rowIndex: number;
|
|
304
|
+
colId: string;
|
|
305
|
+
value: unknown;
|
|
306
|
+
data: RowData;
|
|
307
|
+
formattedValue: string;
|
|
308
|
+
/** true 表示当前为表尾汇总格 */
|
|
309
|
+
isSummaryRow?: boolean;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** 选区聚合结果;无有效选区时由 API 层返回 null */
|
|
313
|
+
export declare interface CellSelectionAggregation {
|
|
314
|
+
/** 非空单元格个数(含非数值) */
|
|
315
|
+
count: number;
|
|
316
|
+
/** 可解析为数值的单元格个数 */
|
|
317
|
+
numericCount: number;
|
|
318
|
+
/** 数值之和;numericCount === 0 时为 null */
|
|
319
|
+
sum: number | null;
|
|
320
|
+
/** 数值平均值;numericCount === 0 时为 null */
|
|
321
|
+
average: number | null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare interface CellSelectionChangedEvent {
|
|
325
|
+
ranges: CellRange[];
|
|
326
|
+
source: CellSelectionSource;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export declare interface CellSelectionDeleteEndEvent {
|
|
330
|
+
ranges: CellRange[];
|
|
331
|
+
changedCellCount: number;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare interface CellSelectionDeleteStartEvent {
|
|
335
|
+
ranges: CellRange[];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export declare interface CellSelectionOptions {
|
|
339
|
+
/** true → 仅允许单个 range */
|
|
340
|
+
suppressMultiRanges?: boolean;
|
|
341
|
+
/** 点击表头选中整列;core 默认 false,MagicGrid 组件层默认 true */
|
|
342
|
+
enableColumnSelection?: boolean;
|
|
343
|
+
/** Fill 或 Range Handle;默认 off */
|
|
344
|
+
handleMode?: CellHandleMode;
|
|
345
|
+
/** handleMode 为 fill 时生效;默认 xy */
|
|
346
|
+
direction?: FillHandleDirection;
|
|
347
|
+
/** 默认 'copy' 始终复制源边值;'auto' 数字递增、非数字复制 */
|
|
348
|
+
fillStrategy?: FillStrategy;
|
|
349
|
+
/** 默认 'default':反拖缩小不处理;'clear' 置空缩出初始选区的格 */
|
|
350
|
+
fillReverseStrategy?: FillReverseStrategy;
|
|
351
|
+
setFillValue?: (params: FillOperationParams) => unknown;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export declare type CellSelectionSource = 'ui' | 'api';
|
|
355
|
+
|
|
356
|
+
/** 运行时 span 查询结果(只读) */
|
|
357
|
+
export declare interface CellSpanInfo {
|
|
358
|
+
colId: string;
|
|
359
|
+
firstRowId: string;
|
|
360
|
+
lastRowId: string;
|
|
361
|
+
rowSpan: number;
|
|
362
|
+
colSpan: number;
|
|
363
|
+
/** 被本 span 覆盖的 rowId(含 head) */
|
|
364
|
+
rowIds: readonly string[];
|
|
365
|
+
/** 被本 span 覆盖的 colId(含 head) */
|
|
366
|
+
colIds: readonly string[];
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** colSpan / rowSpan 回调入参(表体与表尾共用) */
|
|
370
|
+
export declare interface CellSpanParams {
|
|
371
|
+
rowId: string;
|
|
372
|
+
rowIndex: number;
|
|
373
|
+
data: RowData | null;
|
|
374
|
+
colId: string;
|
|
375
|
+
/** 表尾汇总行时为 true;此时 data 为 null,rowIndex 用 SUMMARY_ROW_INDEX */
|
|
376
|
+
isSummaryRow: boolean;
|
|
377
|
+
/** 当前列原始值(表体);表尾为汇总结果值 */
|
|
378
|
+
value: unknown;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export declare interface CellSpanPosition {
|
|
382
|
+
rowId: string;
|
|
383
|
+
colId: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export declare type CellSpanRowKey = string | typeof SUMMARY_ROW_ID;
|
|
387
|
+
|
|
388
|
+
/** 单元格 / 行 inline 样式(v1 仅开放 color 相关字段) */
|
|
389
|
+
export declare interface CellStyle {
|
|
390
|
+
backgroundColor?: string;
|
|
391
|
+
color?: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export declare type CellStyleFn<TData = RowData> = (params: CellStyleParams<TData>) => CellStyle | null | undefined;
|
|
395
|
+
|
|
396
|
+
export declare interface CellStyleParams<TData = RowData> {
|
|
397
|
+
data: TData;
|
|
398
|
+
rowId: BusinessRowId;
|
|
399
|
+
colId: string;
|
|
400
|
+
rowIndex: number;
|
|
401
|
+
column: Pick<Column, 'colId' | 'prop'>;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export declare interface CellValidationFailedEvent {
|
|
405
|
+
rowId: BusinessRowId;
|
|
406
|
+
colId: string;
|
|
407
|
+
rowIndex: number;
|
|
408
|
+
errors: string[];
|
|
409
|
+
mode: InvalidEditValueMode;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export declare interface CellValidationFailure {
|
|
413
|
+
valid: false;
|
|
414
|
+
errors: string[];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export declare type CellValidationOutcome = CellValidationResult | CellValidationFailure;
|
|
418
|
+
|
|
419
|
+
export declare interface CellValidationResult {
|
|
420
|
+
valid: true;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export declare type CellValidator = (params: CellEditorParams & {
|
|
424
|
+
parsedValue: unknown;
|
|
425
|
+
signal: AbortSignal;
|
|
426
|
+
}) => ValidationErrors | Promise<ValidationErrors>;
|
|
427
|
+
|
|
428
|
+
export declare interface CellValueChangedEvent {
|
|
429
|
+
rowId: BusinessRowId;
|
|
430
|
+
colId: string;
|
|
431
|
+
oldValue: unknown;
|
|
432
|
+
newValue: unknown;
|
|
433
|
+
rowNode: RowNode;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export declare interface ClearCellValidationOptions {
|
|
437
|
+
/** 待清除校验反馈的单元格列表 */
|
|
438
|
+
cells: GridCellPosition[];
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export declare interface ClearRowValidationOptions {
|
|
442
|
+
/** 待清除校验反馈的行 id 列表 */
|
|
443
|
+
rowIds: RowId[];
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare interface ClearValidationOptions {
|
|
447
|
+
/** 指定行 id;省略则清除全表校验反馈 */
|
|
448
|
+
rowIds?: RowId[];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** 横向合并列数(≥1);缺省视为 1 */
|
|
452
|
+
export declare type ColSpanFn = (params: CellSpanParams) => number;
|
|
453
|
+
|
|
454
|
+
/** 列运行时模型(由 ColumnDef 解析而来) */
|
|
455
|
+
export declare interface Column {
|
|
456
|
+
/** 列唯一标识 */
|
|
457
|
+
readonly colId: string;
|
|
458
|
+
/** 数据字段 */
|
|
459
|
+
readonly prop?: string;
|
|
460
|
+
/** 表头文案 */
|
|
461
|
+
readonly label?: string;
|
|
462
|
+
/** 当前宽度(px) */
|
|
463
|
+
readonly width: number;
|
|
464
|
+
/** 列定义初始宽度(px);缺省同 width */
|
|
465
|
+
readonly initialWidth?: number;
|
|
466
|
+
/** 最小宽度(px) */
|
|
467
|
+
readonly minWidth: number;
|
|
468
|
+
/** 最大宽度(px),缺省无上限 */
|
|
469
|
+
readonly maxWidth?: number;
|
|
470
|
+
/** flex 权重;仅 center 列生效 · 手动 resize 后清除 */
|
|
471
|
+
readonly flex: number | null;
|
|
472
|
+
/** 禁止参与 sizeColumnsToFit 比例分配 */
|
|
473
|
+
readonly suppressSizeToFit: boolean;
|
|
474
|
+
/** 相对表格左缘的累计偏移(px);中心列相对中心滚动原点;右固定列另见 rightOffset */
|
|
475
|
+
readonly left: number;
|
|
476
|
+
/** 固定侧;缺省 null 表示中心可滚动列 */
|
|
477
|
+
readonly fixed: 'left' | 'right' | null;
|
|
478
|
+
/** 右固定列:距视口右缘的偏移(px);仅 fixed === 'right' 时有值 */
|
|
479
|
+
readonly rightOffset?: number;
|
|
480
|
+
/** 是否允许表头 click 排序;默认 false */
|
|
481
|
+
readonly sortable: boolean;
|
|
482
|
+
/** 是否允许列筛选;默认 false */
|
|
483
|
+
readonly filterable: boolean;
|
|
484
|
+
/** 列筛选数据类型;默认 text */
|
|
485
|
+
readonly filterType: ColumnDataFilterType;
|
|
486
|
+
/** 已解析的列级 filter 参数 */
|
|
487
|
+
readonly filterParams: ResolvedFilterParams;
|
|
488
|
+
/** 筛选用取值;缺省 formatter → valueGetter → prop */
|
|
489
|
+
readonly filterFormatter?: ColumnFilterFormatter;
|
|
490
|
+
/** 自定义排序比较器;缺省使用默认 compareValues */
|
|
491
|
+
readonly comparator?: ColumnComparatorFn;
|
|
492
|
+
/** 是否允许表头拖拽重排;由 Grid columnMovable + 列 movable 解析 */
|
|
493
|
+
readonly movable: boolean;
|
|
494
|
+
/** 是否允许拖拽调整列宽;由 Grid resizable + 列 resizable 解析 */
|
|
495
|
+
readonly resizable: boolean;
|
|
496
|
+
/** 是否禁止 dblclick / API auto-size(对标 suppressAutoSize) */
|
|
497
|
+
readonly suppressAutoSize?: boolean;
|
|
498
|
+
/** 值读取器(来自 ColumnDef) */
|
|
499
|
+
readonly valueGetter?: (row: RowData, value: unknown) => unknown;
|
|
500
|
+
/** 值格式化(来自 ColumnDef) */
|
|
501
|
+
readonly formatter?: (row: RowData, value: unknown) => string;
|
|
502
|
+
/** 是否可编辑 */
|
|
503
|
+
readonly editable?: boolean | ((row: RowData) => boolean);
|
|
504
|
+
/** 自定义单元格渲染器 */
|
|
505
|
+
readonly cellRenderer?: CellRendererFn;
|
|
506
|
+
/** 单元格编辑器(函数、内置名、或命名引用) */
|
|
507
|
+
readonly cellEditor?: CellEditorDef;
|
|
508
|
+
/** 编辑器呈现:overlay 进编辑态;inline 常驻格内。默认 overlay */
|
|
509
|
+
readonly cellEditorMode?: CellEditorMode;
|
|
510
|
+
/** 提交前解析编辑值 */
|
|
511
|
+
readonly valueParser?: (value: unknown, params: CellEditorParams) => unknown;
|
|
512
|
+
/** 自定义写回逻辑,返回 false 拒绝提交;可 async(块 5) */
|
|
513
|
+
readonly valueSetter?: (params: CellEditorParams & {
|
|
514
|
+
newValue: unknown;
|
|
515
|
+
signal: AbortSignal;
|
|
516
|
+
}) => boolean | Promise<boolean>;
|
|
517
|
+
/** 编辑触发策略 */
|
|
518
|
+
readonly editType?: CellEditType;
|
|
519
|
+
/** 提交前校验(可 async);返回错误消息数组表示拒绝 */
|
|
520
|
+
readonly cellValidator?: CellValidator;
|
|
521
|
+
/** Phase 24 块 12 · 禁止粘贴;默认 false */
|
|
522
|
+
readonly suppressPaste?: boolean | SuppressPasteFn;
|
|
523
|
+
/** Phase 24 块 12 · 粘贴是否走 valueParser;默认 true */
|
|
524
|
+
readonly useParserForClipboard?: boolean;
|
|
525
|
+
/** Phase 24 块 13 · 复制是否走 formatter;默认 true */
|
|
526
|
+
readonly useFormatterForClipboard?: boolean;
|
|
527
|
+
/** 必填列(表头始终标红) */
|
|
528
|
+
readonly validationRequired?: boolean;
|
|
529
|
+
/** 是否参与表尾汇总;缺省时:有 summaryAgg 则为 true */
|
|
530
|
+
readonly summary?: boolean;
|
|
531
|
+
/** 表尾汇总聚合:内置名或自定义函数 */
|
|
532
|
+
readonly summaryAgg?: SummaryAgg;
|
|
533
|
+
/** 汇总格专用 formatter;缺省复用 formatter */
|
|
534
|
+
readonly summaryFormatter?: (value: unknown) => string;
|
|
535
|
+
/** 表头水平对齐(已解析) */
|
|
536
|
+
readonly headerAlign: GridHorizontalAlign;
|
|
537
|
+
/** 表头垂直对齐(已解析) */
|
|
538
|
+
readonly headerValign: GridVerticalAlign;
|
|
539
|
+
/** 表体水平对齐(已解析) */
|
|
540
|
+
readonly align: GridHorizontalAlign;
|
|
541
|
+
/** 表体垂直对齐(已解析) */
|
|
542
|
+
readonly valign: GridVerticalAlign;
|
|
543
|
+
/** 表尾汇总水平对齐(已解析) */
|
|
544
|
+
readonly footerAlign: GridHorizontalAlign;
|
|
545
|
+
/** 表尾汇总垂直对齐(已解析) */
|
|
546
|
+
readonly footerValign: GridVerticalAlign;
|
|
547
|
+
/** 该列内容撑开行高(Phase 15) */
|
|
548
|
+
readonly autoHeight: boolean;
|
|
549
|
+
/** 该列作为行 drag 起点(Phase 15) */
|
|
550
|
+
readonly rowDrag: boolean;
|
|
551
|
+
/** Phase 16 · 横向合并;系统列为 undefined */
|
|
552
|
+
readonly colSpan?: ColSpanFn;
|
|
553
|
+
/** Phase 16 · 纵向合并回调;系统列为 undefined */
|
|
554
|
+
readonly rowSpan?: RowSpanFn;
|
|
555
|
+
/** Phase 16 · 等值自动纵向合并;系统列为 undefined */
|
|
556
|
+
readonly spanRows?: boolean | SpanRowsFunc;
|
|
557
|
+
/** Phase 17 · 在该列渲染 expand/collapse 控件;系统列为 false */
|
|
558
|
+
readonly rowExpand: boolean;
|
|
559
|
+
/** Phase 18 · 该列参与行分组;系统列为 false */
|
|
560
|
+
readonly rowGroup: boolean;
|
|
561
|
+
/** Phase 18 · 多级分组顺序;未参与分组时为 undefined */
|
|
562
|
+
readonly rowGroupIndex?: number;
|
|
563
|
+
/** Phase 18 · 分组 footer 聚合;系统列为 undefined */
|
|
564
|
+
readonly groupAgg?: SummaryAgg;
|
|
565
|
+
/** Phase 18 · 用户列渲染 groupHeader 单元格 */
|
|
566
|
+
readonly showGroupHeaderCell: boolean;
|
|
567
|
+
/** Phase 18 · 用户列渲染 groupFooter 标签 */
|
|
568
|
+
readonly showGroupFooterCell: boolean;
|
|
569
|
+
/** Phase 18 · 本列小计文案;缺省继承 Grid groupFooterLabel */
|
|
570
|
+
readonly groupFooterLabel?: string;
|
|
571
|
+
/** Phase 20 · 抑制批注新建/编辑/删除;已有批注仍可查看 */
|
|
572
|
+
readonly suppressCellComments?: boolean | SuppressCellCommentFn;
|
|
573
|
+
/** Phase 21 · 列级禁用:true 时该列全部数据行 disabled */
|
|
574
|
+
readonly disabled?: boolean;
|
|
575
|
+
/** Phase 21 · 格级禁用:按行判定 */
|
|
576
|
+
readonly cellDisabled?: boolean | CellDisabledFn;
|
|
577
|
+
/** Phase 26 · 列级静态背景 或 格级 cellStyle 回调 */
|
|
578
|
+
readonly cellStyle?: CellStyle | CellStyleFn;
|
|
579
|
+
/** Phase 22 · 是否隐藏(不渲染 · 不参与布局);默认 false */
|
|
580
|
+
readonly hidden: boolean;
|
|
581
|
+
/** Phase 27 · 列 def 声明序(setColumns 解析 index);用于重置列顺序 */
|
|
582
|
+
readonly defOrder: number;
|
|
583
|
+
/** Phase 23 · tooltip 字段 */
|
|
584
|
+
readonly tooltipField?: string;
|
|
585
|
+
readonly tooltipValueGetter?: TooltipValueGetter;
|
|
586
|
+
readonly headerTooltip?: string;
|
|
587
|
+
readonly headerTooltipValueGetter?: HeaderTooltipValueGetter;
|
|
588
|
+
/** Phase 23 · 是否抑制溢出 tooltip;系统列默认 true */
|
|
589
|
+
readonly suppressTooltip: boolean;
|
|
590
|
+
readonly tooltipComponent?: TooltipComponentType;
|
|
591
|
+
readonly tooltipComponentParams?: Record<string, unknown>;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/** 列级自定义排序比较器;返回 asc 语义(desc 由 SortStage 统一取反) */
|
|
595
|
+
export declare type ColumnComparatorFn = (valueA: unknown, valueB: unknown, direction: SortDirection, rowA: RowData, rowB: RowData) => number;
|
|
596
|
+
|
|
597
|
+
/** 列级筛选数据类型(决定菜单面板与 FilterStage 比较策略) */
|
|
598
|
+
export declare type ColumnDataFilterType = 'text' | 'number' | 'date';
|
|
599
|
+
|
|
600
|
+
/** 列定义;`TData` 为行数据类型,用于 prop / 回调参数类型推导 */
|
|
601
|
+
export declare interface ColumnDef<TData extends RowData = RowData> {
|
|
602
|
+
/** 列唯一标识,缺省等于 prop */
|
|
603
|
+
key?: string;
|
|
604
|
+
/** 数据字段 */
|
|
605
|
+
prop?: Extract<keyof TData, string>;
|
|
606
|
+
/** 表头文案 */
|
|
607
|
+
label?: string;
|
|
608
|
+
/**
|
|
609
|
+
* 列是否有效;默认 true。
|
|
610
|
+
* 为 false 时该列不存在于表格中(不参与列模型与绘制);
|
|
611
|
+
* 与 hidden 不同——hidden 仍保留列,仅不渲染。
|
|
612
|
+
*/
|
|
613
|
+
available?: boolean;
|
|
614
|
+
/**
|
|
615
|
+
* 是否隐藏该列(不渲染 header/body/footer · 不参与布局)。
|
|
616
|
+
* 默认 false(可见)。系统列忽略此配置。
|
|
617
|
+
*/
|
|
618
|
+
hidden?: boolean;
|
|
619
|
+
/** 尺寸 */
|
|
620
|
+
width?: number;
|
|
621
|
+
/** 列最小宽度(px) */
|
|
622
|
+
minWidth?: number;
|
|
623
|
+
/** 列最大宽度(px) */
|
|
624
|
+
maxWidth?: number;
|
|
625
|
+
/** flex 布局权重;与 width 互斥时 flex 参与剩余空间分配 */
|
|
626
|
+
flex?: number;
|
|
627
|
+
/** 是否允许表头排序;缺省继承 Grid `sortable`(默认 false) */
|
|
628
|
+
sortable?: boolean;
|
|
629
|
+
/**
|
|
630
|
+
* 自定义排序比较器;入参为两行的单元格原始值(经 valueGetter)。
|
|
631
|
+
* 须返回 asc 语义比较结果;desc 由 Grid 统一取反。
|
|
632
|
+
*/
|
|
633
|
+
comparator?: ColumnComparatorFn;
|
|
634
|
+
/** 是否允许列筛选;缺省继承 Grid `filterable`(默认 false) */
|
|
635
|
+
filterable?: boolean;
|
|
636
|
+
/** 列筛选数据类型;默认 text */
|
|
637
|
+
filterType?: ColumnDataFilterType;
|
|
638
|
+
/** 列级 filter 参数(如 caseSensitive) */
|
|
639
|
+
filterParams?: FilterParams;
|
|
640
|
+
/** 筛选用取值;缺省 formatter → valueGetter → prop */
|
|
641
|
+
/** 筛选用取值;缺省 formatter → valueGetter → prop */
|
|
642
|
+
filterFormatter?: (row: TData) => unknown;
|
|
643
|
+
/** 是否可编辑;可函数按行判断 */
|
|
644
|
+
editable?: boolean | ((row: TData) => boolean);
|
|
645
|
+
/** 是否允许拖拽调整列宽;缺省继承 Grid `resizable`(默认 true) */
|
|
646
|
+
resizable?: boolean;
|
|
647
|
+
/** 禁止 resize 把柄 dblclick / API auto-size;对标 AG Grid suppressAutoSize */
|
|
648
|
+
suppressAutoSize?: boolean;
|
|
649
|
+
/** 禁止参与 sizeColumnsToFit;对标 AG Grid suppressSizeToFit */
|
|
650
|
+
suppressSizeToFit?: boolean;
|
|
651
|
+
/** 列固定:left / right;null 或不传为不固定 */
|
|
652
|
+
fixed?: 'left' | 'right' | null;
|
|
653
|
+
/** 是否允许表头拖拽重排;默认继承 grid.columnMovable */
|
|
654
|
+
movable?: boolean;
|
|
655
|
+
/** 该列单元格作为行拖拽起点;默认 false */
|
|
656
|
+
rowDrag?: boolean;
|
|
657
|
+
/**
|
|
658
|
+
* 在该列渲染 expand/collapse 控件;需 Grid `masterDetail: true`。
|
|
659
|
+
* 与 `showExpandColumn` 可并存(列级优先展示位置由列序决定)。
|
|
660
|
+
*/
|
|
661
|
+
rowExpand?: boolean;
|
|
662
|
+
/**
|
|
663
|
+
* 该列参与行分组;需 Grid `rowGrouping: true`。
|
|
664
|
+
* 与 `rowGroupIndex` 控制多级顺序。
|
|
665
|
+
*/
|
|
666
|
+
rowGroup?: boolean;
|
|
667
|
+
/** 多级分组顺序(小者优先);缺省按列定义顺序 */
|
|
668
|
+
rowGroupIndex?: number;
|
|
669
|
+
/** 分组 footer 行的聚合;缺省不在该列展示 group 汇总 */
|
|
670
|
+
groupAgg?: SummaryAgg;
|
|
671
|
+
/**
|
|
672
|
+
* 在该用户列渲染 groupHeader 单元格(chevron / 缩进 / 键值)。
|
|
673
|
+
* 与系统 auto group 列二选一;不可用于系统列。
|
|
674
|
+
*/
|
|
675
|
+
showGroupHeaderCell?: boolean;
|
|
676
|
+
/**
|
|
677
|
+
* 在该用户列渲染 groupFooter 标签(如「小计」)。
|
|
678
|
+
* 聚合数值仍由 `groupAgg` 列展示。
|
|
679
|
+
*/
|
|
680
|
+
showGroupFooterCell?: boolean;
|
|
681
|
+
/** 覆盖 Grid `groupFooterLabel` 的本列小计文案 */
|
|
682
|
+
groupFooterLabel?: string;
|
|
683
|
+
/** 该列内容撑开行高(与其他 autoHeight 列取 max);默认 false */
|
|
684
|
+
autoHeight?: boolean;
|
|
685
|
+
/**
|
|
686
|
+
* 横向合并列数(≥1);表体与表尾共用,用 `params.isSummaryRow` 分支。
|
|
687
|
+
* 需 Grid `enableCellSpan: true`。系统列忽略。
|
|
688
|
+
*/
|
|
689
|
+
colSpan?: ColSpanFn;
|
|
690
|
+
/**
|
|
691
|
+
* 纵向合并行数(≥1);仅表体。与 `spanRows` 互斥(本字段优先)。
|
|
692
|
+
* 需 Grid `enableCellSpan: true`。系统列忽略。
|
|
693
|
+
*/
|
|
694
|
+
rowSpan?: RowSpanFn;
|
|
695
|
+
/**
|
|
696
|
+
* 相邻等值自动纵向合并;`true` 或自定义比较函数。
|
|
697
|
+
* 需 Grid `enableCellSpan: true`。同列若同时配 `rowSpan` 则本字段不生效。
|
|
698
|
+
*/
|
|
699
|
+
spanRows?: boolean | SpanRowsFunc;
|
|
700
|
+
/** 读取单元格展示值(优先于 prop 直读) */
|
|
701
|
+
valueGetter?: (row: TData, value: unknown) => unknown;
|
|
702
|
+
/** 格式化展示文案(不影响原始值) */
|
|
703
|
+
formatter?: (row: TData, value: unknown) => string;
|
|
704
|
+
/** 自定义单元格渲染器(函数;Vue 组件通过 MagicGrid 槽位注册) */
|
|
705
|
+
cellRenderer?: CellRendererFn;
|
|
706
|
+
/** 自定义单元格编辑器(函数、内置 text / number / checkbox、或命名引用) */
|
|
707
|
+
cellEditor?: CellEditorDef;
|
|
708
|
+
/** 编辑器呈现:overlay 进编辑态;inline 常驻格内。默认 overlay */
|
|
709
|
+
cellEditorMode?: CellEditorMode;
|
|
710
|
+
/** 提交前解析编辑值 */
|
|
711
|
+
valueParser?: (value: unknown, params: CellEditorParams) => unknown;
|
|
712
|
+
/** 自定义写回逻辑,返回 false 拒绝提交;可 async */
|
|
713
|
+
valueSetter?: (params: CellEditorParams & {
|
|
714
|
+
newValue: unknown;
|
|
715
|
+
signal: AbortSignal;
|
|
716
|
+
}) => boolean | Promise<boolean>;
|
|
717
|
+
/** 编辑触发策略,缺省继承 grid 级配置 */
|
|
718
|
+
editType?: CellEditType;
|
|
719
|
+
/** 手写校验(优先级高于 validationRules) */
|
|
720
|
+
cellValidator?: CellValidator;
|
|
721
|
+
/** 禁止粘贴;可函数按行判断 */
|
|
722
|
+
suppressPaste?: boolean | ((row: TData) => boolean);
|
|
723
|
+
/** 粘贴是否走 valueParser;默认 true */
|
|
724
|
+
useParserForClipboard?: boolean;
|
|
725
|
+
/** 复制是否走 formatter;默认 true */
|
|
726
|
+
useFormatterForClipboard?: boolean;
|
|
727
|
+
/** async-validator 规则;通过 magic-grid/validation enrichColumnsWithValidation 编译 */
|
|
728
|
+
validationRules?: ValidationRules;
|
|
729
|
+
/** 必填列标记(缺省由 validationRules.required 推导) */
|
|
730
|
+
validationRequired?: boolean;
|
|
731
|
+
/** 是否参与表尾汇总;缺省时:有 summaryAgg 则为 true,否则 false */
|
|
732
|
+
summary?: boolean;
|
|
733
|
+
/** 表尾汇总聚合:内置 sum / avg / min / max / count 或自定义函数 */
|
|
734
|
+
summaryAgg?: SummaryAgg;
|
|
735
|
+
/** 汇总格专用 formatter;缺省复用 formatter */
|
|
736
|
+
summaryFormatter?: (value: unknown) => string;
|
|
737
|
+
/** 表头水平对齐;默认 center */
|
|
738
|
+
headerAlign?: GridHorizontalAlign;
|
|
739
|
+
/** 表头垂直对齐;默认 center */
|
|
740
|
+
headerValign?: GridVerticalAlign;
|
|
741
|
+
/** 表体水平对齐;默认 center */
|
|
742
|
+
align?: GridHorizontalAlign;
|
|
743
|
+
/** 表体垂直对齐;默认 center */
|
|
744
|
+
valign?: GridVerticalAlign;
|
|
745
|
+
/** 表尾汇总水平对齐;默认 center */
|
|
746
|
+
footerAlign?: GridHorizontalAlign;
|
|
747
|
+
/** 表尾汇总垂直对齐;默认 center */
|
|
748
|
+
footerValign?: GridVerticalAlign;
|
|
749
|
+
/**
|
|
750
|
+
* 抑制该列(或特定行)的批注新建/编辑/删除。
|
|
751
|
+
* 已有批注仍可查看。
|
|
752
|
+
*/
|
|
753
|
+
suppressCellComments?: boolean | SuppressCellCommentFn<TData>;
|
|
754
|
+
/** 列级禁用:true 时该列全部数据行 disabled */
|
|
755
|
+
disabled?: boolean;
|
|
756
|
+
/** 格级禁用:按行判定;与 disabled / isRowDisabled 叠加 */
|
|
757
|
+
cellDisabled?: boolean | CellDisabledFn<TData>;
|
|
758
|
+
/**
|
|
759
|
+
* 列级静态背景 或 格级 cellStyle 回调(二选一 · 同 AG Grid cellStyle)。
|
|
760
|
+
* 仅作用于表体用户数据列;表头/表尾/索引列/系统列不参与。
|
|
761
|
+
*/
|
|
762
|
+
cellStyle?: CellStyle | CellStyleFn<TData>;
|
|
763
|
+
/** 读 row.data[field] 作为 tooltip */
|
|
764
|
+
tooltipField?: Extract<keyof TData, string>;
|
|
765
|
+
/** 自定义 tooltip 文案 */
|
|
766
|
+
tooltipValueGetter?: TooltipValueGetter<TData>;
|
|
767
|
+
/** 表头静态 tooltip */
|
|
768
|
+
headerTooltip?: string;
|
|
769
|
+
/** 表头动态 tooltip 文案 */
|
|
770
|
+
headerTooltipValueGetter?: HeaderTooltipValueGetter;
|
|
771
|
+
/** 抑制该列溢出 tooltip */
|
|
772
|
+
suppressTooltip?: boolean;
|
|
773
|
+
/** 自定义 tooltip 组件 */
|
|
774
|
+
tooltipComponent?: TooltipComponentType;
|
|
775
|
+
/** 自定义 tooltip 组件额外参数 */
|
|
776
|
+
tooltipComponentParams?: Record<string, unknown>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export declare interface ColumnFilter {
|
|
780
|
+
type: FilterType;
|
|
781
|
+
filter?: string;
|
|
782
|
+
/** date inRange 第二端点(ISO 文本) */
|
|
783
|
+
filterTo?: string;
|
|
784
|
+
/** 多条件组合逻辑;缺省 AND */
|
|
785
|
+
operator?: ColumnFilterLogic;
|
|
786
|
+
/** 多条件算子列表;存在时优先于顶层 type/filter */
|
|
787
|
+
conditions?: ColumnFilterOperatorCondition[];
|
|
788
|
+
/** 值选择:选中 key;缺省表示全选(不约束) */
|
|
789
|
+
setValues?: string[];
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export declare type ColumnFilterFormatter = (row: RowData) => unknown;
|
|
793
|
+
|
|
794
|
+
/** 多条件过滤器之间的组合逻辑 */
|
|
795
|
+
export declare type ColumnFilterLogic = 'AND' | 'OR';
|
|
796
|
+
|
|
797
|
+
/** 单列过滤器中的一个算子条件 */
|
|
798
|
+
export declare interface ColumnFilterOperatorCondition {
|
|
799
|
+
type: FilterType;
|
|
800
|
+
filter?: string;
|
|
801
|
+
filterTo?: string;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export declare interface ColumnFilterValueOption {
|
|
805
|
+
key: string;
|
|
806
|
+
label: string;
|
|
807
|
+
blank?: boolean;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/** 事件 payload */
|
|
811
|
+
export declare interface ColumnHiddenChangedEvent {
|
|
812
|
+
colIds: readonly string[];
|
|
813
|
+
hidden: boolean;
|
|
814
|
+
source: 'api' | 'columnDefs' | 'menu';
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export declare type ColumnHiddenChangedSource = ColumnHiddenChangedEvent['source'];
|
|
818
|
+
|
|
819
|
+
export declare interface ColumnMovedEvent {
|
|
820
|
+
/** 移动后的完整 colId 顺序(含系统列) */
|
|
821
|
+
columnOrder: string[];
|
|
822
|
+
fromColId: string;
|
|
823
|
+
toIndex: number;
|
|
824
|
+
/** false:drag 中 live move;true:mouseup 最终提交 */
|
|
825
|
+
finished: boolean;
|
|
826
|
+
/** Phase 11.1 块 5 · 跨 lane 时移动列的新 fixed;lane 内移动时省略 */
|
|
827
|
+
toFixed?: 'left' | 'right' | null;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export declare interface ColumnPinnedEvent {
|
|
831
|
+
colId: string;
|
|
832
|
+
fixed: ColumnPinOption;
|
|
833
|
+
/** 改 pin 前 fixed;首 pin 时为 null */
|
|
834
|
+
fromFixed: ColumnPinOption;
|
|
835
|
+
source: ColumnPinSource;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export declare type ColumnPinOption = 'left' | 'right' | null;
|
|
839
|
+
|
|
840
|
+
export declare type ColumnPinSource = 'menu' | 'api';
|
|
841
|
+
|
|
842
|
+
export declare interface ColumnResizedColumnSnapshot {
|
|
843
|
+
colId: string;
|
|
844
|
+
width: number;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/** 对标 AG Grid ColumnResizedEvent(Phase 14 块 5) */
|
|
848
|
+
export declare interface ColumnResizedEvent {
|
|
849
|
+
columns: ColumnResizedColumnSnapshot[];
|
|
850
|
+
/** 仅当 columns.length === 1 时便捷引用 */
|
|
851
|
+
column: ColumnResizedColumnSnapshot | null;
|
|
852
|
+
finished: boolean;
|
|
853
|
+
/** flex 被动调整的列;无 flex 变化时为 null */
|
|
854
|
+
flexColumns: ColumnResizedColumnSnapshot[] | null;
|
|
855
|
+
source: ColumnResizeSource;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export declare type ColumnResizeSource = 'uiColumnResized' | 'api' | 'autosizeColumns' | 'flex' | 'sizeColumnsToFit';
|
|
859
|
+
|
|
860
|
+
export declare type ColumnSettingsMenuIconName = 'sliders-vertical' | 'list-restart' | 'sort' | 'filter' | 'width' | 'order' | 'pin' | 'all';
|
|
861
|
+
|
|
862
|
+
/** Phase 27 · 表格设置「重置」作用域 */
|
|
863
|
+
export declare type ColumnSettingsResetScope = 'sort' | 'filter' | 'width' | 'order' | 'pin' | 'all';
|
|
864
|
+
|
|
865
|
+
export declare interface CustomColumnFilter {
|
|
866
|
+
predicate: (value: unknown, row: RowData) => boolean;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/** 日期列 v1:用户输入纯文本 ISO(如 2026-08-07) */
|
|
870
|
+
export declare type DateFilterType = 'equals' | 'notEqual' | 'lessThan' | 'greaterThan' | 'inRange' | 'blank' | 'notBlank';
|
|
871
|
+
|
|
872
|
+
/** 框选聚合平均值 / 求和默认小数位数 */
|
|
873
|
+
export declare const DEFAULT_STATUS_BAR_RANGE_AGGREGATION_PRECISION = 2;
|
|
874
|
+
|
|
875
|
+
export declare const DEFAULT_SUMMARY_SCOPE: SummaryScope;
|
|
876
|
+
|
|
877
|
+
export declare type DetailCellRendererFn = (params: DetailRowRendererParams, ctx: DetailRowRendererMountContext) => string | HTMLElement | void | null | undefined;
|
|
878
|
+
|
|
879
|
+
export declare type DetailRowHeightFn = (params: DetailRowHeightParams) => number;
|
|
880
|
+
|
|
881
|
+
export declare interface DetailRowHeightParams {
|
|
882
|
+
rowId: BusinessRowId;
|
|
883
|
+
data: RowData;
|
|
884
|
+
masterRowId: BusinessRowId;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export declare interface DetailRowRendererMountContext {
|
|
888
|
+
mountEl: HTMLElement;
|
|
889
|
+
clear(): void;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/** 详情行渲染入参(插槽 / detailCellRenderer) */
|
|
893
|
+
export declare interface DetailRowRendererParams {
|
|
894
|
+
/** detail 行 id */
|
|
895
|
+
rowId: BusinessRowId;
|
|
896
|
+
masterRowId: BusinessRowId;
|
|
897
|
+
data: RowData;
|
|
898
|
+
detailRowData: unknown;
|
|
899
|
+
loading: boolean;
|
|
900
|
+
/** getDetailRowData 失败时为 true */
|
|
901
|
+
loadFailed: boolean;
|
|
902
|
+
loadError?: unknown;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/** `#detail-row` 插槽 props */
|
|
906
|
+
export declare interface DetailRowSlotParams<TData extends RowData = RowData> {
|
|
907
|
+
/** 主行数据 */
|
|
908
|
+
row: TData;
|
|
909
|
+
/** 主行 rowId */
|
|
910
|
+
rowId: string;
|
|
911
|
+
/** 与 rowId 相同(兼容别名) */
|
|
912
|
+
masterRowId: string;
|
|
913
|
+
/** 详情区数据(`getDetailRowData` 返回值) */
|
|
914
|
+
detailRowData: unknown;
|
|
915
|
+
/** 详情数据是否加载中 */
|
|
916
|
+
loading: boolean;
|
|
917
|
+
/** 详情数据是否加载失败 */
|
|
918
|
+
loadFailed: boolean;
|
|
919
|
+
/** 加载失败时的错误对象 */
|
|
920
|
+
loadError?: unknown;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export declare interface EditCommitAbortedEvent {
|
|
924
|
+
rowId?: BusinessRowId;
|
|
925
|
+
colId?: string;
|
|
926
|
+
rowIndex?: number;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export declare interface EditingCellPosition {
|
|
930
|
+
rowId: BusinessRowId;
|
|
931
|
+
rowIndex: number;
|
|
932
|
+
colId: string;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** 编辑会话阶段 */
|
|
936
|
+
export declare type EditSessionPhase = 'idle' | 'editing' | 'committing' | 'cancelling';
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* `ensureIndexVisible` 滚动对齐方式。
|
|
940
|
+
*
|
|
941
|
+
* - `'top'` — 目标行贴近视口顶部
|
|
942
|
+
* - `'bottom'` — 目标行贴近视口底部
|
|
943
|
+
* - `'middle'` — 目标行尽量居中(默认)
|
|
944
|
+
*/
|
|
945
|
+
export declare type EnsureIndexVisiblePosition = 'top' | 'bottom' | 'middle';
|
|
946
|
+
|
|
947
|
+
export declare type FillHandleDirection = 'x' | 'y' | 'xy';
|
|
948
|
+
|
|
949
|
+
export declare interface FillOperationParams {
|
|
950
|
+
rowNode: RowNode;
|
|
951
|
+
column: Column;
|
|
952
|
+
/** 填充源方向上的基准格值 */
|
|
953
|
+
baseValue: unknown;
|
|
954
|
+
/** 当前目标格相对扩展步长 */
|
|
955
|
+
step: number;
|
|
956
|
+
direction: 'x' | 'y';
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/** Fill 反拖默认策略:不置空 */
|
|
960
|
+
export declare type FillReverseStrategy = 'default' | 'clear';
|
|
961
|
+
|
|
962
|
+
/** Fill 默认策略:数字递增、非数字复制 */
|
|
963
|
+
export declare type FillStrategy = 'auto' | 'copy';
|
|
964
|
+
|
|
965
|
+
export declare interface FilterChangedEvent {
|
|
966
|
+
filterModel: FilterModel;
|
|
967
|
+
/** Phase 12 · Grid 级 quick filter 文本;缺省 `''` */
|
|
968
|
+
quickFilterText: string;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export declare type FilterCondition = ColumnFilter | CustomColumnFilter;
|
|
972
|
+
|
|
973
|
+
export declare type FilterModel = Record<string, FilterCondition>;
|
|
974
|
+
|
|
975
|
+
export declare interface FilterParams {
|
|
976
|
+
/** 文本比较是否区分大小写;默认 true */
|
|
977
|
+
caseSensitive?: boolean;
|
|
978
|
+
/** 数字/日期解析 locale(可选) */
|
|
979
|
+
locale?: string;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/** 日期列值选择展示方式 */
|
|
983
|
+
export declare type FilterSetDateLayoutMode = 'list' | 'tree';
|
|
984
|
+
|
|
985
|
+
/** 值选择筛选模式:reserve 保留完整勾选 / current 搜索时仅当前结果 */
|
|
986
|
+
export declare type FilterSetValueMode = 'reserve' | 'current';
|
|
987
|
+
|
|
988
|
+
export declare type FilterType = TextFilterType | NumberFilterType | DateFilterType;
|
|
989
|
+
|
|
990
|
+
export declare interface GetDataOptions {
|
|
991
|
+
/** true = source 顺序(默认);false = 当前 display 顺序 */
|
|
992
|
+
sourceOrder?: boolean;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/** 对标 AG Grid getDataPath */
|
|
996
|
+
export declare type GetDataPathFn = (params: GetDataPathParams) => string[];
|
|
997
|
+
|
|
998
|
+
export declare interface GetDataPathParams {
|
|
999
|
+
data: RowData;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export declare type GetDetailRowDataFn = (params: GetDetailRowDataParams) => void | Promise<void>;
|
|
1003
|
+
|
|
1004
|
+
export declare interface GetDetailRowDataParams {
|
|
1005
|
+
rowId: BusinessRowId;
|
|
1006
|
+
data: RowData;
|
|
1007
|
+
successCallback: (detailRowData: unknown) => void;
|
|
1008
|
+
failCallback?: (error?: unknown) => void;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/** 行级动态高度(无 DOM 测量);返回 null/undefined 表示回退默认行高 */
|
|
1012
|
+
export declare type GetRowHeightFn = (params: GetRowHeightParams) => number | null | undefined;
|
|
1013
|
+
|
|
1014
|
+
export declare interface GetRowHeightParams {
|
|
1015
|
+
rowId: BusinessRowId;
|
|
1016
|
+
data: RowData;
|
|
1017
|
+
rowIndex: number;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/** Grid 验收阈值 */
|
|
1021
|
+
export declare interface GridAcceptanceThresholds {
|
|
1022
|
+
maxDomRows: number;
|
|
1023
|
+
maxSetDataMs: number;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Magic Grid 完整命令式 API(对照 AG Grid GridApi 子集)。
|
|
1028
|
+
*
|
|
1029
|
+
* 按职责分组:数据 / 排序筛选 / 视口 / 编辑 / 校验 / 行选 / 索引定位 / 生命周期。
|
|
1030
|
+
*/
|
|
1031
|
+
export declare interface GridApi extends RowMutationGridApi {
|
|
1032
|
+
/**
|
|
1033
|
+
* 全量替换表格数据(等价于清空后重新加载)。
|
|
1034
|
+
*
|
|
1035
|
+
* - 触发完整重绘与视口高度重算。
|
|
1036
|
+
* - `reserveSelection: false`(默认)时清空选区;为 `true` 时保留仍存在的 rowId。
|
|
1037
|
+
* - 始终清除索引定位与校验视觉反馈。
|
|
1038
|
+
*/
|
|
1039
|
+
setData(rows: RowData[]): void;
|
|
1040
|
+
/**
|
|
1041
|
+
* 增量事务:add / update / remove。
|
|
1042
|
+
*
|
|
1043
|
+
* - `update` / `remove` 项可通过 `data[rowKey]` 或字符串 rowId 定位行。
|
|
1044
|
+
* - 与 `addRows` / `removeRows` 共用同一刷新管线;大量连续操作建议包在 `beginUpdate` / `endUpdate` 中。
|
|
1045
|
+
* - 配置 `asyncRowMutation` 时 await 对应钩子成功后再写入本地。
|
|
1046
|
+
*
|
|
1047
|
+
* @returns 本次事务影响的 RowNode 快照
|
|
1048
|
+
*/
|
|
1049
|
+
applyTransaction(tx: RowTransaction): Promise<RowNodeTransaction>;
|
|
1050
|
+
/** 设置排序模型并重算 `rowsToDisplay`。触发 `sortChanged`。 */
|
|
1051
|
+
setSortModel(model: SortModelItem[]): void;
|
|
1052
|
+
/** 读取当前排序模型(v1 至多 1 项) */
|
|
1053
|
+
getSortModel(): SortModelItem[];
|
|
1054
|
+
/** 设置筛选模型并重算 `rowsToDisplay`。触发 `filterChanged`。 */
|
|
1055
|
+
setFilterModel(model: FilterModel): void;
|
|
1056
|
+
/** 读取当前筛选模型。 */
|
|
1057
|
+
getFilterModel(): FilterModel;
|
|
1058
|
+
/** 读取单列筛选条件;未设置时 `null`。 */
|
|
1059
|
+
getColumnFilter(colId: string): FilterCondition | null;
|
|
1060
|
+
/** 单列是否有有效筛选条件(含 blank/notBlank · custom predicate)。 */
|
|
1061
|
+
isColumnFilterActive(colId: string): boolean;
|
|
1062
|
+
/** 任一列 filter 或 quick filter 是否 active。 */
|
|
1063
|
+
isAnyFilterActive(): boolean;
|
|
1064
|
+
/** 设置 Grid 级 quick filter 文本;触发 `filterChanged`(块 5 接入过滤语义)。 */
|
|
1065
|
+
setQuickFilterText(text: string): void;
|
|
1066
|
+
/** 读取当前 quick filter 文本。 */
|
|
1067
|
+
getQuickFilterText(): string;
|
|
1068
|
+
/**
|
|
1069
|
+
* 清除全部筛选:列 filterModel + quickFilterText。
|
|
1070
|
+
* 单次 filter 管线;无 active filter 时为 no-op。
|
|
1071
|
+
*/
|
|
1072
|
+
clearAllFilters(): void;
|
|
1073
|
+
/**
|
|
1074
|
+
* 设置或清除单列筛选条件;`condition === null` 移除该 colId。
|
|
1075
|
+
* 触发 `filterChanged`。
|
|
1076
|
+
*/
|
|
1077
|
+
setColumnFilter(colId: string, condition: FilterCondition | null): void;
|
|
1078
|
+
/**
|
|
1079
|
+
* 编程式移动列;`toIndex` 为全局 columns 下标(含系统列占位)。
|
|
1080
|
+
* 非法 move(跨 lane / 系统列)为 no-op;完整逻辑见 Phase 11 块 2。
|
|
1081
|
+
*/
|
|
1082
|
+
moveColumn(colId: string, toIndex: number): void;
|
|
1083
|
+
/** Phase 27 · 各 lane 内用户列恢复 defOrder;无变化时为 no-op */
|
|
1084
|
+
resetColumnOrder(): boolean;
|
|
1085
|
+
/** Phase 27 · 用户列恢复 defWidth / defFlex;无变化时为 no-op */
|
|
1086
|
+
resetColumnWidths(): boolean;
|
|
1087
|
+
/**
|
|
1088
|
+
* 运行时改列 fixed(left / right / null)。
|
|
1089
|
+
* 非法 colId 或系统列 no-op;与 `allowCrossLaneColumnMove` 无关。
|
|
1090
|
+
*/
|
|
1091
|
+
setColumnFixed(colId: string, fixed: 'left' | 'right' | null): boolean;
|
|
1092
|
+
/** Phase 22 · 批量设置列 hidden;触发 `columnHiddenChanged` */
|
|
1093
|
+
setColumnsHidden(colIds: readonly string[], hidden: boolean): boolean;
|
|
1094
|
+
/** Phase 22 · 列是否 hidden;未知 colId 返回 `undefined` */
|
|
1095
|
+
isColumnHidden(colId: string): boolean | undefined;
|
|
1096
|
+
/** Phase 22 · 当前 UI 展示的列 id(左→右) */
|
|
1097
|
+
getDisplayedColumnIds(): readonly string[];
|
|
1098
|
+
/** Phase 27 · 全量列(含 hidden · 含系统列) */
|
|
1099
|
+
getColumns(): readonly Column[];
|
|
1100
|
+
/** Phase 12 · 列 distinct 值(set filter 勾选列表) */
|
|
1101
|
+
getColumnDistinctFilterValues(colId: string): readonly ColumnFilterValueOption[];
|
|
1102
|
+
/** Phase 27 · 当前 UI 展示的列(不含 hidden) */
|
|
1103
|
+
getDisplayedColumns(): readonly Column[];
|
|
1104
|
+
/**
|
|
1105
|
+
* 批量设置列宽(Phase 14)。
|
|
1106
|
+
* 触发 `columnResized`;`finished: false` 用于拖拽过程,`true` 为最终提交。
|
|
1107
|
+
*/
|
|
1108
|
+
setColumnWidths(payloads: readonly {
|
|
1109
|
+
colId: string;
|
|
1110
|
+
width: number;
|
|
1111
|
+
}[], finished?: boolean, source?: ColumnResizeSource): void;
|
|
1112
|
+
/** 设置单列宽度(Phase 14) */
|
|
1113
|
+
setColumnWidth(colId: string, width: number, finished?: boolean, source?: ColumnResizeSource): void;
|
|
1114
|
+
/** 读取列当前像素宽度(Phase 14) */
|
|
1115
|
+
getColumnWidth(colId: string): number;
|
|
1116
|
+
/** 按当前可见单元格内容自动调整列宽(Phase 14+ · 对标 autoSizeColumn) */
|
|
1117
|
+
autoSizeColumn(colId: string, skipHeader?: boolean): void;
|
|
1118
|
+
/** 批量 auto-size(Phase 14+ · 对标 autoSizeColumns) */
|
|
1119
|
+
autoSizeColumns(colIds: readonly string[], skipHeader?: boolean): void;
|
|
1120
|
+
/** 将列宽按比例分配至视口(或指定宽度);对标 sizeColumnsToFit */
|
|
1121
|
+
sizeColumnsToFit(params?: SizeColumnsToFitParams): void;
|
|
1122
|
+
/**
|
|
1123
|
+
* 设置单行高度并 pinned(Phase 15)。
|
|
1124
|
+
*
|
|
1125
|
+
* - 高度会 clamp 至 `rowHeightMin` / `rowHeightMax`。
|
|
1126
|
+
* - `finished: false` 用于 resize 拖拽过程;`true`(默认)为最终提交。
|
|
1127
|
+
* - 触发 `rowHeightChanged`(`source: 'api'`)。
|
|
1128
|
+
*/
|
|
1129
|
+
setRowHeight(rowId: RowId, height: number, finished?: boolean): void;
|
|
1130
|
+
/** 批量设置行高(Phase 15);语义同 {@link setRowHeight} */
|
|
1131
|
+
setRowHeights(changes: readonly {
|
|
1132
|
+
rowId: RowId;
|
|
1133
|
+
height: number;
|
|
1134
|
+
}[], finished?: boolean): void;
|
|
1135
|
+
/** 读取行当前有效高度(px);行不存在时 `null` */
|
|
1136
|
+
getRowHeight(rowId: RowId): number | null;
|
|
1137
|
+
/**
|
|
1138
|
+
* 清除 pinned 并重算行高(getRowHeight / autoHeight / 默认行高)。
|
|
1139
|
+
*
|
|
1140
|
+
* - 省略 `rowIds` 时重置全部 display 行。
|
|
1141
|
+
* - 触发 `rowHeightChanged`(`source: 'api'` · `finished: true`)。
|
|
1142
|
+
*/
|
|
1143
|
+
resetRowHeights(rowIds?: readonly RowId[]): void;
|
|
1144
|
+
/**
|
|
1145
|
+
* 热更新默认行高与 clamp 边界(Phase 15 · MagicGrid `rowHeight` prop)。
|
|
1146
|
+
*
|
|
1147
|
+
* 不销毁 Grid;pinned / getRowHeight / autoHeight 行保持既有规则。
|
|
1148
|
+
*/
|
|
1149
|
+
updateDimensions(params: UpdateRowDimensionsParams): void;
|
|
1150
|
+
/**
|
|
1151
|
+
* 刷新指定行或列的单元格 DOM(不重跑全表 setData)。
|
|
1152
|
+
*
|
|
1153
|
+
* @param params.rowIds 限定行;省略则刷新当前虚拟窗口内可见行
|
|
1154
|
+
* @param params.colIds 限定列 colId
|
|
1155
|
+
* @param params.force 强制重绘,即使值未变
|
|
1156
|
+
* @returns 实际刷新的行数
|
|
1157
|
+
*/
|
|
1158
|
+
refreshCells(params?: RefreshCellsParams): number;
|
|
1159
|
+
/**
|
|
1160
|
+
* Phase 16 · 强制重建单元格合并 cache 并刷新可见行 / 表尾。
|
|
1161
|
+
*
|
|
1162
|
+
* 用于外部改写行数据后未走 `setData` / `applyTransaction`,
|
|
1163
|
+
* 或 `spanRows` 自定义比较所依赖的外部状态变化。
|
|
1164
|
+
* 需 Grid `enableCellSpan: true` 才有可见效果。
|
|
1165
|
+
*/
|
|
1166
|
+
refreshCellSpans(): void;
|
|
1167
|
+
/**
|
|
1168
|
+
* Phase 16 · 只读查询 `(rowId, colId)` 所属 span。
|
|
1169
|
+
*
|
|
1170
|
+
* - 无合并 / 未开启 `enableCellSpan` / 位置无效 → `null`
|
|
1171
|
+
* - `rowId` 接受业务主键或内核 id(number / string)
|
|
1172
|
+
*/
|
|
1173
|
+
getCellSpan(rowId: RowId, colId: string): CellSpanInfo | null;
|
|
1174
|
+
/**
|
|
1175
|
+
* 滚动使指定**行下标**(`rowsToDisplay` 中的 index)进入视口。
|
|
1176
|
+
*
|
|
1177
|
+
* @param index 0-based 行下标,非 rowId
|
|
1178
|
+
* @param position 对齐方式,默认 `'middle'`
|
|
1179
|
+
*/
|
|
1180
|
+
ensureIndexVisible(index: number, position?: EnsureIndexVisiblePosition): void;
|
|
1181
|
+
/**
|
|
1182
|
+
* 按 rowId 获取行节点快照。
|
|
1183
|
+
*
|
|
1184
|
+
* @param id 业务主键或内核 id(number / string);不存在时返回 `undefined`
|
|
1185
|
+
*/
|
|
1186
|
+
getRowNode(id: RowId): RowNode | undefined;
|
|
1187
|
+
/**
|
|
1188
|
+
* 读取当前渲染与滚动指标(验收 / 调试用途)。
|
|
1189
|
+
*
|
|
1190
|
+
* 含视口行数、scrollTop、首末可见行下标、最近一次 setData 耗时等。
|
|
1191
|
+
*/
|
|
1192
|
+
getMetrics(): GridMetrics;
|
|
1193
|
+
/**
|
|
1194
|
+
* 开启批量更新:多次 `applyTransaction` / `addRows` 合并为一次重绘。
|
|
1195
|
+
*
|
|
1196
|
+
* 须与 {@link endUpdate} 配对调用。
|
|
1197
|
+
*/
|
|
1198
|
+
beginUpdate(): void;
|
|
1199
|
+
/** 结束批量更新并 flush 累积的事务。 */
|
|
1200
|
+
endUpdate(): void;
|
|
1201
|
+
/**
|
|
1202
|
+
* 编程式滚动视口。
|
|
1203
|
+
*
|
|
1204
|
+
* @param scrollTop 垂直滚动位置(px)
|
|
1205
|
+
* @param scrollLeft 水平滚动位置(px);省略则保持当前值
|
|
1206
|
+
*/
|
|
1207
|
+
scrollTo(scrollTop: number, scrollLeft?: number): void;
|
|
1208
|
+
/**
|
|
1209
|
+
* 编程式进入单元格编辑。
|
|
1210
|
+
*
|
|
1211
|
+
* @param params.rowIndex `rowsToDisplay` 中的 0-based 行下标
|
|
1212
|
+
* @param params.colKey 列 `colId` 或 `prop`
|
|
1213
|
+
*
|
|
1214
|
+
* 列不可编辑或该行正在行编辑模式时无效果。
|
|
1215
|
+
*/
|
|
1216
|
+
startEditingCell(params: {
|
|
1217
|
+
rowIndex: number;
|
|
1218
|
+
colKey: string;
|
|
1219
|
+
}): void;
|
|
1220
|
+
/**
|
|
1221
|
+
* 结束当前编辑会话。
|
|
1222
|
+
*
|
|
1223
|
+
* @param cancel `true` 丢弃修改并退出;`false`(默认)尝试提交。
|
|
1224
|
+
* @returns 异步提交完成时 resolve;无编辑态时立即 resolve
|
|
1225
|
+
*/
|
|
1226
|
+
stopEditing(cancel?: boolean): Promise<void>;
|
|
1227
|
+
/** 是否存在任意单元格 / 行处于编辑态。 */
|
|
1228
|
+
isEditing(): boolean;
|
|
1229
|
+
/** 是否正在异步提交(commit 管线进行中)。提交期间 Tab 导航等行为受限。 */
|
|
1230
|
+
isCommitting(): boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* 中断进行中的异步提交,保持编辑态与编辑器焦点。
|
|
1233
|
+
*
|
|
1234
|
+
* 触发 `editCommitAborted` 事件。
|
|
1235
|
+
*/
|
|
1236
|
+
cancelCommit(): void;
|
|
1237
|
+
/**
|
|
1238
|
+
* 当前编辑会话阶段。
|
|
1239
|
+
*
|
|
1240
|
+
* - `'idle'` — 无编辑
|
|
1241
|
+
* - `'editing'` — 编辑中
|
|
1242
|
+
* - `'committing'` — 异步提交中
|
|
1243
|
+
* - `'cancelling'` — 取消中
|
|
1244
|
+
*/
|
|
1245
|
+
getEditSessionPhase(): EditSessionPhase;
|
|
1246
|
+
/** 当前主编辑单元格;无编辑时 `null`。rowId 为业务类型(与 data[rowKey] 一致,临时行为 null)。 */
|
|
1247
|
+
getEditingCell(): {
|
|
1248
|
+
rowId: BusinessRowId;
|
|
1249
|
+
colId: string;
|
|
1250
|
+
} | null;
|
|
1251
|
+
/** 行编辑模式下所有正在编辑的单元格位置列表。 */
|
|
1252
|
+
getEditingCells(): EditingCellPosition[];
|
|
1253
|
+
/**
|
|
1254
|
+
* 向当前 Grid 实例注册命名单元格编辑器。
|
|
1255
|
+
*
|
|
1256
|
+
* 列定义 `cellEditor: 'myEditor'` 时优先解析实例级注册,再回退全局注册表。
|
|
1257
|
+
*/
|
|
1258
|
+
registerCellEditor(name: string, editor: CellEditorFn): void;
|
|
1259
|
+
/** 注销实例级编辑器;成功返回 `true`。 */
|
|
1260
|
+
unregisterCellEditor(name: string): boolean;
|
|
1261
|
+
/**
|
|
1262
|
+
* 校验全表或指定行的持久化数据。
|
|
1263
|
+
*
|
|
1264
|
+
* 扫描可编辑列的 `cellValidator` 与 Grid 级 `rowValidator`;
|
|
1265
|
+
* 默认更新 invalid 视觉反馈(`showFeedback: false` 可仅返回结果)。
|
|
1266
|
+
*/
|
|
1267
|
+
validate(options?: ValidateGridOptions): Promise<GridValidationResult>;
|
|
1268
|
+
/** 校验指定行列表(语义同 {@link validate} 的 `rowIds` 分支)。 */
|
|
1269
|
+
validateRows(options: ValidateRowsOptions): Promise<GridValidationResult>;
|
|
1270
|
+
/**
|
|
1271
|
+
* 校验指定单元格列表(不跑 rowValidator)。
|
|
1272
|
+
*
|
|
1273
|
+
* `cells[].rowId` 接受 number / string。
|
|
1274
|
+
*/
|
|
1275
|
+
validateCells(options: ValidateCellsOptions): Promise<GridValidationResult>;
|
|
1276
|
+
/** 清除全表或指定行的校验视觉反馈。 */
|
|
1277
|
+
clearValidation(options?: ClearValidationOptions): void;
|
|
1278
|
+
/** 清除指定行的校验视觉反馈。 */
|
|
1279
|
+
clearRowValidation(options: ClearRowValidationOptions): void;
|
|
1280
|
+
/** 清除指定单元格的校验视觉反馈。 */
|
|
1281
|
+
clearCellValidation(options: ClearCellValidationOptions): void;
|
|
1282
|
+
/**
|
|
1283
|
+
* 切换或设置行的 checkbox 选中状态(行选择列 / `SelectionService`)。
|
|
1284
|
+
*
|
|
1285
|
+
* @param rowIds 单个或批量 rowId(number / string)
|
|
1286
|
+
* @param selected 省略时 **toggle**;`true` 选中;`false` 取消选中
|
|
1287
|
+
* @param force `true` 时忽略 `isRowSelectable`:
|
|
1288
|
+
* - 选中:可操作 disabled 行;
|
|
1289
|
+
* - 取消:可强制取消 disabled 已选行;
|
|
1290
|
+
* - 已选中 + `selected: true` 时不重复 toggle
|
|
1291
|
+
*
|
|
1292
|
+
* 变更时 emit `selectionChanged`。disabled 行默认不可通过本 API 取消选中(须 force)。
|
|
1293
|
+
*/
|
|
1294
|
+
toggleRowSelection(rowIds: RowIdInput, selected?: boolean, force?: boolean): void;
|
|
1295
|
+
/**
|
|
1296
|
+
* 表头全选 checkbox 操作(`rowSelection: 'multiple'` 时有效)。
|
|
1297
|
+
*
|
|
1298
|
+
* @param selected 省略时 **toggle**;
|
|
1299
|
+
* `true` 选中当前可见且可选的行;
|
|
1300
|
+
* `false` 取消可见可选行(**保留** disabled 已选行)
|
|
1301
|
+
*/
|
|
1302
|
+
toggleAllSelection(selected?: boolean): void;
|
|
1303
|
+
/**
|
|
1304
|
+
* 设置索引列辅助定位(`IndexFocusService`),不触发鼠标拖拉。
|
|
1305
|
+
*
|
|
1306
|
+
* @param rowIds 单个或批量 rowId;传空数组 `[]` 清除定位
|
|
1307
|
+
*
|
|
1308
|
+
* - `focusMode: 'single'` 时仅保留首个有效 id。
|
|
1309
|
+
* - 变更时 emit `indexFocusChanged`。
|
|
1310
|
+
* - 若开启 `syncToSelectionColumn` 且模式兼容,会单向同步到行选择列(跳过不可选行)。
|
|
1311
|
+
*
|
|
1312
|
+
* 须启用 `showIndexColumn`;未启用时为 no-op。
|
|
1313
|
+
*/
|
|
1314
|
+
setIndexFocus(rowIds: RowIdInput): void;
|
|
1315
|
+
/** 展开主行;非 master 或未启用 `masterDetail` 时返回 `false`。 */
|
|
1316
|
+
expandRow(rowId: RowId): boolean;
|
|
1317
|
+
/** 折叠主行;未展开或未启用时返回 `false`。 */
|
|
1318
|
+
collapseRow(rowId: RowId): boolean;
|
|
1319
|
+
/** 主行是否已展开。 */
|
|
1320
|
+
isRowExpanded(rowId: RowId): boolean;
|
|
1321
|
+
/** 展开当前 display 中全部可展开 master 行。 */
|
|
1322
|
+
expandAll(): void;
|
|
1323
|
+
/** 折叠全部已展开主行 / 分组(取决于启用的能力)。 */
|
|
1324
|
+
collapseAll(): void;
|
|
1325
|
+
/** 设置分组列顺序;需 `rowGrouping: true`。触发 `rowGroupChanged`。 */
|
|
1326
|
+
setRowGroupColumns(colIds: readonly string[]): void;
|
|
1327
|
+
/** 当前分组列 colId 列表。 */
|
|
1328
|
+
getRowGroupColumns(): readonly string[];
|
|
1329
|
+
/** 展开分组节点;未启用 rowGrouping 或 groupId 无效时返回 `false`。 */
|
|
1330
|
+
expandGroup(groupId: string): boolean;
|
|
1331
|
+
/** 折叠分组节点。 */
|
|
1332
|
+
collapseGroup(groupId: string): boolean;
|
|
1333
|
+
/** 分组是否已展开。 */
|
|
1334
|
+
isGroupExpanded(groupId: string): boolean;
|
|
1335
|
+
/** 展开 tree 节点;未启用 tree 时返回 `false`。 */
|
|
1336
|
+
expandNode(rowId: RowId): boolean;
|
|
1337
|
+
/** 折叠 tree 节点。 */
|
|
1338
|
+
collapseNode(rowId: RowId): boolean;
|
|
1339
|
+
/** tree 节点是否已展开。 */
|
|
1340
|
+
isNodeExpanded(rowId: RowId): boolean;
|
|
1341
|
+
/** 查询行的 dataPath;未启用 tree 时返回 `undefined`。 */
|
|
1342
|
+
getDataPath(rowId: RowId): string[] | undefined;
|
|
1343
|
+
/** 读取批注;无则 `undefined`。 */
|
|
1344
|
+
getCellComment(rowId: RowId, colId: string): CellComment | undefined;
|
|
1345
|
+
/** 设置或删除批注(`comment=null/undefined`);`source` 记为 `api`。 */
|
|
1346
|
+
setCellComment(rowId: RowId, colId: string, comment: CellComment | null | undefined): Promise<void>;
|
|
1347
|
+
/** 刷新可见 cell 批注角标;popup 不强制重建。 */
|
|
1348
|
+
refreshCellComments(params?: RefreshCellCommentsParams): void;
|
|
1349
|
+
/** 读取当前 cell range 列表(0..n)。 */
|
|
1350
|
+
getCellRanges(): CellRange[];
|
|
1351
|
+
/** Phase 24.1 · 当前框选聚合统计;无选区或未开框选时返回 null。 */
|
|
1352
|
+
getCellSelectionAggregation(): CellSelectionAggregation | null;
|
|
1353
|
+
/** 清除全部 cell range。 */
|
|
1354
|
+
clearCellSelection(): void;
|
|
1355
|
+
/** 追加一个 cell range(非法参数忽略)。 */
|
|
1356
|
+
addCellRange(params: CellRange): void;
|
|
1357
|
+
/** 复制当前选区到系统剪贴板(TSV)。 */
|
|
1358
|
+
copySelectedRangeToClipboard(): void;
|
|
1359
|
+
/** 从系统剪贴板粘贴到选区起点。 */
|
|
1360
|
+
pasteFromClipboard(): Promise<void>;
|
|
1361
|
+
/** 等价 `setGridOption('loading', true)`。 */
|
|
1362
|
+
showLoadingOverlay(): void;
|
|
1363
|
+
/** 强制显示 noRows overlay,直至 `hideOverlay()`。 */
|
|
1364
|
+
showNoRowsOverlay(): void;
|
|
1365
|
+
/**
|
|
1366
|
+
* 隐藏当前 overlay。
|
|
1367
|
+
* noMatchingRows 仅随 filter/数据恢复自动隐藏;loading=true 时无效。
|
|
1368
|
+
*/
|
|
1369
|
+
hideOverlay(): void;
|
|
1370
|
+
/** 是否有 overlay 正在显示。 */
|
|
1371
|
+
isOverlayShowing(): boolean;
|
|
1372
|
+
/** 当前 overlay 类型;无 overlay 时返回 `null`。 */
|
|
1373
|
+
getOverlayType(): OverlayType | null;
|
|
1374
|
+
/** Phase 21 · 重算可见单元格 disabled 投影(class · inline 控件 · aria) */
|
|
1375
|
+
refreshDisabledState(params?: RefreshDisabledStateParams): void;
|
|
1376
|
+
/** Phase 26 · 重算可见单元格 backgroundColor / color 投影 */
|
|
1377
|
+
refreshCellStyles(params?: RefreshCellStylesParams): void;
|
|
1378
|
+
/**
|
|
1379
|
+
* 销毁 Grid 实例:解绑监听、取消编辑、清理 DOM。
|
|
1380
|
+
*
|
|
1381
|
+
* 组件 `onUnmounted` 时自动调用;手动调用后不可再使用 API。
|
|
1382
|
+
*/
|
|
1383
|
+
destroy(): void;
|
|
1384
|
+
/**
|
|
1385
|
+
* 订阅 Grid 事件。
|
|
1386
|
+
*
|
|
1387
|
+
* @returns 取消订阅函数
|
|
1388
|
+
*
|
|
1389
|
+
* @example
|
|
1390
|
+
* ```ts
|
|
1391
|
+
* const off = api.on('selectionChanged', ({ selectedRowIds }) => { ... })
|
|
1392
|
+
* off()
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1395
|
+
on<T extends GridEventType>(type: T, handler: GridEventHandler<T>): () => void;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* 边框样式(默认 `border`)
|
|
1400
|
+
* - `border`:表头 / 表体单元格全网格线
|
|
1401
|
+
* - `none`:无单元格线;表头与表体保留底部分隔线
|
|
1402
|
+
* - `linear`:表头 / 表体单元格仅底部分隔线
|
|
1403
|
+
*/
|
|
1404
|
+
export declare type GridBorder = 'border' | 'none' | 'linear';
|
|
1405
|
+
|
|
1406
|
+
/** 单元格位置(rowId + colId) */
|
|
1407
|
+
export declare interface GridCellPosition {
|
|
1408
|
+
rowId: RowId;
|
|
1409
|
+
colId: string;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
export declare type GridEventHandler<T extends GridEventType> = (event: GridEventMap[T]) => void;
|
|
1413
|
+
|
|
1414
|
+
export declare interface GridEventMap {
|
|
1415
|
+
bodyScroll: BodyScrollEvent;
|
|
1416
|
+
sortChanged: SortChangedEvent;
|
|
1417
|
+
filterChanged: FilterChangedEvent;
|
|
1418
|
+
columnMoved: ColumnMovedEvent;
|
|
1419
|
+
columnResized: ColumnResizedEvent;
|
|
1420
|
+
columnPinned: ColumnPinnedEvent;
|
|
1421
|
+
columnHiddenChanged: ColumnHiddenChangedEvent;
|
|
1422
|
+
cellClicked: CellClickedEvent;
|
|
1423
|
+
rowClicked: RowClickedEvent;
|
|
1424
|
+
rowDoubleClicked: RowDoubleClickedEvent;
|
|
1425
|
+
cellFocused: CellFocusedEvent;
|
|
1426
|
+
selectionChanged: SelectionChangedEvent;
|
|
1427
|
+
indexFocusChanged: IndexFocusChangedEvent;
|
|
1428
|
+
cellValueChanged: CellValueChangedEvent;
|
|
1429
|
+
cellEditingStarted: CellEditingStartedEvent;
|
|
1430
|
+
cellEditingStopped: CellEditingStoppedEvent;
|
|
1431
|
+
rowEditingStarted: RowEditingStartedEvent;
|
|
1432
|
+
rowEditingStopped: RowEditingStoppedEvent;
|
|
1433
|
+
rowValueChanged: RowValueChangedEvent;
|
|
1434
|
+
cellCommitStarted: CellCommitStartedEvent;
|
|
1435
|
+
cellCommitFinished: CellCommitFinishedEvent;
|
|
1436
|
+
editCommitAborted: EditCommitAbortedEvent;
|
|
1437
|
+
rowCommitStarted: RowCommitStartedEvent;
|
|
1438
|
+
rowCommitFinished: RowCommitFinishedEvent;
|
|
1439
|
+
cellValidationFailed: CellValidationFailedEvent;
|
|
1440
|
+
rowValidationFailed: RowValidationFailedEvent;
|
|
1441
|
+
rowsAdded: RowsAddedEvent;
|
|
1442
|
+
rowsRemoved: RowsRemovedEvent;
|
|
1443
|
+
rowIdPromoted: RowIdPromotedEvent;
|
|
1444
|
+
rowMoved: RowMovedEvent;
|
|
1445
|
+
rowDragEnd: RowDragEndEvent;
|
|
1446
|
+
rowDragCommitStarted: RowDragCommitStartedEvent;
|
|
1447
|
+
rowDragCommitFinished: RowDragCommitFinishedEvent;
|
|
1448
|
+
rowHeightChanged: RowHeightChangedEvent;
|
|
1449
|
+
rowExpanded: RowExpansionChangedEvent;
|
|
1450
|
+
rowCollapsed: RowExpansionChangedEvent;
|
|
1451
|
+
rowGroupOpened: RowGroupOpenedEvent;
|
|
1452
|
+
rowGroupChanged: RowGroupChangedEvent;
|
|
1453
|
+
treeNodeOpened: TreeNodeOpenedEvent;
|
|
1454
|
+
treeChildrenLoading: TreeChildrenLoadingEvent;
|
|
1455
|
+
treeChildrenLoaded: TreeChildrenLoadedEvent;
|
|
1456
|
+
treeChildrenLoadFailed: TreeChildrenLoadFailedEvent;
|
|
1457
|
+
cellCommentChanged: CellCommentChangedEvent;
|
|
1458
|
+
cellSelectionChanged: CellSelectionChangedEvent;
|
|
1459
|
+
cellSelectionDeleteStart: CellSelectionDeleteStartEvent;
|
|
1460
|
+
cellSelectionDeleteEnd: CellSelectionDeleteEndEvent;
|
|
1461
|
+
overlayShown: OverlayShownEvent;
|
|
1462
|
+
overlayHidden: OverlayHiddenEvent;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export declare type GridEventType = 'bodyScroll' | 'sortChanged' | 'filterChanged' | 'columnMoved' | 'columnResized' | 'columnPinned' | 'cellClicked' | 'rowClicked' | 'rowDoubleClicked' | 'cellFocused' | 'selectionChanged' | 'indexFocusChanged' | 'cellValueChanged' | 'cellEditingStarted' | 'cellEditingStopped' | 'rowEditingStarted' | 'rowEditingStopped' | 'rowValueChanged' | 'cellCommitStarted' | 'cellCommitFinished' | 'editCommitAborted' | 'rowCommitStarted' | 'rowCommitFinished' | 'cellValidationFailed' | 'rowValidationFailed' | 'rowsAdded' | 'rowsRemoved' | 'rowIdPromoted' | 'rowMoved' | 'rowDragEnd' | 'rowDragCommitStarted' | 'rowDragCommitFinished' | 'rowHeightChanged' | 'rowExpanded' | 'rowCollapsed' | 'rowGroupOpened' | 'rowGroupChanged' | 'treeNodeOpened' | 'treeChildrenLoading' | 'treeChildrenLoaded' | 'treeChildrenLoadFailed' | 'cellCommentChanged' | 'cellSelectionChanged' | 'cellSelectionDeleteStart' | 'cellSelectionDeleteEnd' | 'columnHiddenChanged' | 'overlayShown' | 'overlayHidden';
|
|
1466
|
+
|
|
1467
|
+
/** 水平对齐;默认 center */
|
|
1468
|
+
export declare type GridHorizontalAlign = 'left' | 'center' | 'right';
|
|
1469
|
+
|
|
1470
|
+
/** Grid 运行时性能指标(Playground / 验收用) */
|
|
1471
|
+
export declare interface GridMetrics {
|
|
1472
|
+
/** 数据总行数(过滤后显示行数) */
|
|
1473
|
+
rowCount: number;
|
|
1474
|
+
/** 源数据总行数(过滤前) */
|
|
1475
|
+
sourceRowCount: number;
|
|
1476
|
+
/** 列数 */
|
|
1477
|
+
columnCount: number;
|
|
1478
|
+
/** 活跃行 DOM 数(行池) */
|
|
1479
|
+
activeDomRowCount: number;
|
|
1480
|
+
/** 表体单元格 DOM 数 */
|
|
1481
|
+
domCellCount: number;
|
|
1482
|
+
/** 当前 scrollTop(px) */
|
|
1483
|
+
scrollTop: number;
|
|
1484
|
+
/** 当前 scrollLeft(px) */
|
|
1485
|
+
scrollLeft: number;
|
|
1486
|
+
/** 内容区总高度(px) */
|
|
1487
|
+
totalHeight: number;
|
|
1488
|
+
/** 内容区总宽度(px) */
|
|
1489
|
+
totalWidth: number;
|
|
1490
|
+
/** 渲染窗口首行索引 */
|
|
1491
|
+
renderedFirstRow: number;
|
|
1492
|
+
/** 渲染窗口末行索引 */
|
|
1493
|
+
renderedLastRow: number;
|
|
1494
|
+
/** 渲染窗口首列索引 */
|
|
1495
|
+
renderedFirstCol: number;
|
|
1496
|
+
/** 渲染窗口末列索引 */
|
|
1497
|
+
renderedLastCol: number;
|
|
1498
|
+
/** 最近一次 setData 耗时(ms) */
|
|
1499
|
+
lastSetDataMs: number;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/** 圆角:false/0 无圆角;true 跟随 size;number 自定义 px。默认 false */
|
|
1503
|
+
export declare type GridRounded = number | boolean;
|
|
1504
|
+
|
|
1505
|
+
/** 尺寸 preset;rowHeight / headerHeight 未显式传入时由 size 推导 */
|
|
1506
|
+
export declare type GridSize = 'mini' | 'small' | 'default' | 'large';
|
|
1507
|
+
|
|
1508
|
+
/** 主题 preset:`light` 亮色(默认);`dark` 暗色语义 token */
|
|
1509
|
+
export declare type GridTheme = 'light' | 'dark';
|
|
1510
|
+
|
|
1511
|
+
export declare interface GridValidationCellError {
|
|
1512
|
+
rowId: BusinessRowId;
|
|
1513
|
+
rowIndex: number;
|
|
1514
|
+
colId: string;
|
|
1515
|
+
errors: string[];
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
export declare interface GridValidationResult {
|
|
1519
|
+
valid: boolean;
|
|
1520
|
+
cellErrors: GridValidationCellError[];
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/** 垂直对齐;默认 center */
|
|
1524
|
+
export declare type GridVerticalAlign = 'top' | 'center' | 'bottom';
|
|
1525
|
+
|
|
1526
|
+
/** 分组 aggregate 单元格结果(与 SummaryCellResult 同形) */
|
|
1527
|
+
export declare interface GroupAggCellResult {
|
|
1528
|
+
value: unknown;
|
|
1529
|
+
formattedValue: string;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
export declare type GroupAggValuesMap = Record<string, GroupAggCellResult>;
|
|
1533
|
+
|
|
1534
|
+
export declare type GroupCellRendererFn = (params: GroupCellRendererParams, ctx: GroupCellRendererMountContext) => string | HTMLElement | void | null | undefined;
|
|
1535
|
+
|
|
1536
|
+
export declare interface GroupCellRendererMountContext {
|
|
1537
|
+
mountEl: HTMLElement;
|
|
1538
|
+
clear(): void;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/** 分组单元格渲染入参(auto group 列 / groupCellRenderer) */
|
|
1542
|
+
export declare interface GroupCellRendererParams {
|
|
1543
|
+
rowKind: 'groupHeader' | 'groupFooter';
|
|
1544
|
+
groupId: string;
|
|
1545
|
+
groupField: string;
|
|
1546
|
+
groupKey: string;
|
|
1547
|
+
groupLevel: number;
|
|
1548
|
+
groupLeafCount: number;
|
|
1549
|
+
expanded: boolean;
|
|
1550
|
+
aggValues?: GroupAggValuesMap;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/** 同级 group 顺序比较器;缺省按 groupKey localeCompare(blank 置末) */
|
|
1554
|
+
export declare type GroupComparatorFn = (params: GroupComparatorParams) => number;
|
|
1555
|
+
|
|
1556
|
+
/** 同级 group 节点排序入参(对标 AG initialGroupOrderComparator) */
|
|
1557
|
+
export declare interface GroupComparatorParams {
|
|
1558
|
+
valueA: string;
|
|
1559
|
+
valueB: string;
|
|
1560
|
+
colId: string;
|
|
1561
|
+
field: string;
|
|
1562
|
+
level: number;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
export declare type GroupDisplayType = 'singleColumn' | 'multipleColumns';
|
|
1566
|
+
|
|
1567
|
+
export declare type GroupKeyCreatorFn = (params: GroupKeyCreatorParams) => string;
|
|
1568
|
+
|
|
1569
|
+
/** 分组键归一化入参 */
|
|
1570
|
+
export declare interface GroupKeyCreatorParams {
|
|
1571
|
+
field: string;
|
|
1572
|
+
colId: string;
|
|
1573
|
+
value: unknown;
|
|
1574
|
+
data: RowData;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
export declare type HasTreeChildrenFn = (params: HasTreeChildrenParams) => boolean;
|
|
1578
|
+
|
|
1579
|
+
export declare interface HasTreeChildrenParams {
|
|
1580
|
+
data: RowData;
|
|
1581
|
+
dataPath: string[];
|
|
1582
|
+
treeLevel: number;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
export declare type HeaderTooltipValueGetter = (params: HeaderTooltipValueGetterParams) => string | null | undefined;
|
|
1586
|
+
|
|
1587
|
+
export declare interface HeaderTooltipValueGetterParams {
|
|
1588
|
+
colId: string;
|
|
1589
|
+
column: Column;
|
|
1590
|
+
headerLabel: string;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* CellSpanService 窄接口(块 5 实现)。
|
|
1595
|
+
* 块 0 仅定义契约,供后续渲染 / 焦点 / API 依赖。
|
|
1596
|
+
*/
|
|
1597
|
+
export declare interface ICellSpanService {
|
|
1598
|
+
readonly active: boolean;
|
|
1599
|
+
refresh(): void;
|
|
1600
|
+
getColSpan(rowId: CellSpanRowKey, colId: string): number;
|
|
1601
|
+
getCellSpan(rowId: string, colId: string): CellSpanInfo | null;
|
|
1602
|
+
/** 该格是否被其它 head 覆盖(不应渲染) */
|
|
1603
|
+
isCovered(rowId: string, colId: string): boolean;
|
|
1604
|
+
/** 导航/编辑:将被盖位置映射到 head */
|
|
1605
|
+
normalizePosition(rowId: string, colId: string): CellSpanPosition;
|
|
1606
|
+
/** 渲染用:解析纵向 span(rowSpan 优先于 spanRows) */
|
|
1607
|
+
resolveVerticalSpan(rowNode: RowNode, column: Column): RowSpanHeadInfo;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
/** 索引列配置 */
|
|
1611
|
+
export declare interface IndexColumnOptions {
|
|
1612
|
+
/** 表头文案;默认空字符串 */
|
|
1613
|
+
label?: string;
|
|
1614
|
+
/** 列宽 px;默认 40;小于 40 时钳制为 40 */
|
|
1615
|
+
width?: number;
|
|
1616
|
+
/** 起始序号(1-based 展示 = rowIndex + start);默认 1 */
|
|
1617
|
+
start?: number;
|
|
1618
|
+
/**
|
|
1619
|
+
* 辅助定位模式:single / multiple(multiple 支持 Ctrl/Shift/拖拉范围)
|
|
1620
|
+
* 默认 multiple(Excel 行号式交互)
|
|
1621
|
+
*/
|
|
1622
|
+
focusMode?: 'single' | 'multiple';
|
|
1623
|
+
/**
|
|
1624
|
+
* 索引列定位是否单向同步到行选择列(业务选中);core 默认 false,MagicGrid 组件层默认 true。
|
|
1625
|
+
* 仅当 indexColumn.focusMode 与 rowSelection 同为 single 或同为 multiple 时生效。
|
|
1626
|
+
* 仅用户在索引列上操作(点击/拖选/再次点击取消)时同步;点击其他区域清除索引定位不同步行选择列。
|
|
1627
|
+
*/
|
|
1628
|
+
syncToSelectionColumn?: boolean;
|
|
1629
|
+
/** 表头水平对齐;默认 center */
|
|
1630
|
+
headerAlign?: GridHorizontalAlign;
|
|
1631
|
+
/** 表头垂直对齐;默认 center */
|
|
1632
|
+
headerValign?: GridVerticalAlign;
|
|
1633
|
+
/** 表体水平对齐;默认 center */
|
|
1634
|
+
align?: GridHorizontalAlign;
|
|
1635
|
+
/** 表体垂直对齐;默认 center */
|
|
1636
|
+
valign?: GridVerticalAlign;
|
|
1637
|
+
/** footer 水平对齐;默认 center */
|
|
1638
|
+
footerAlign?: GridHorizontalAlign;
|
|
1639
|
+
/** footer 垂直对齐;默认 center */
|
|
1640
|
+
footerValign?: GridVerticalAlign;
|
|
1641
|
+
/**
|
|
1642
|
+
* 自定义序号展示;入参为 rowsToDisplay 下标。
|
|
1643
|
+
* 缺省:(rowIndex) => String(rowIndex + start)
|
|
1644
|
+
*/
|
|
1645
|
+
index?: (rowIndex: number) => number | string;
|
|
1646
|
+
/**
|
|
1647
|
+
* 在索引列 cell 内显示行拖拽把柄;默认 false。
|
|
1648
|
+
* 需配合 Grid `rowDragManaged` 或监听 `rowDragEnd` 自行改序。
|
|
1649
|
+
*/
|
|
1650
|
+
showRowDragHandle?: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* 索引列底边可拖拽调整行高;默认 false。
|
|
1653
|
+
* 对标 AG Grid Row Numbers `enableRowResizer`。
|
|
1654
|
+
*/
|
|
1655
|
+
enableRowResizer?: boolean;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
export declare interface IndexFocusChangedEvent {
|
|
1659
|
+
focusedRowIds: BusinessRowId[];
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
export declare type InvalidEditValueMode = 'block' | 'revert' | 'keep';
|
|
1663
|
+
|
|
1664
|
+
/** 自定义 overlay 组件协议(对标 AG IOverlayComp) */
|
|
1665
|
+
export declare interface IOverlayComp {
|
|
1666
|
+
getGui(): HTMLElement;
|
|
1667
|
+
init?(params: IOverlayParams): void;
|
|
1668
|
+
refresh?(params: IOverlayParams): boolean;
|
|
1669
|
+
destroy?(): void;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
export declare interface IOverlayParams {
|
|
1673
|
+
overlayType: OverlayType;
|
|
1674
|
+
api: GridApi;
|
|
1675
|
+
/** 无数据 / 无匹配 / 加载文案(默认中文 · 可被 template/组件覆盖) */
|
|
1676
|
+
overlayText?: string;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
export declare type IsRowDisabledFn<TData = RowData> = (params: IsRowDisabledParams<TData>) => boolean;
|
|
1680
|
+
|
|
1681
|
+
/** 行级禁用判定参数 */
|
|
1682
|
+
export declare interface IsRowDisabledParams<TData = RowData> {
|
|
1683
|
+
data: TData;
|
|
1684
|
+
rowId: BusinessRowId;
|
|
1685
|
+
/** display 行索引(可选 · 便于 UI 规则) */
|
|
1686
|
+
rowIndex?: number;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
export declare type IsRowMasterFn = (params: IsRowMasterParams) => boolean;
|
|
1690
|
+
|
|
1691
|
+
/** 是否为主行(可展示 expand 控件) */
|
|
1692
|
+
export declare interface IsRowMasterParams {
|
|
1693
|
+
rowId: BusinessRowId;
|
|
1694
|
+
data: RowData;
|
|
1695
|
+
rowIndex: number;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
/** 自定义 tooltip 组件协议(对标 AG ITooltipComp · 块 9 挂载) */
|
|
1699
|
+
export declare interface ITooltipComp {
|
|
1700
|
+
getGui(): HTMLElement;
|
|
1701
|
+
init?(params: ITooltipParams): void;
|
|
1702
|
+
refresh?(params: ITooltipParams): boolean;
|
|
1703
|
+
destroy?(): void;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
export declare interface ITooltipParams {
|
|
1707
|
+
location: TooltipLocation;
|
|
1708
|
+
value: unknown;
|
|
1709
|
+
valueFormatted: string | null;
|
|
1710
|
+
colId?: string;
|
|
1711
|
+
rowId?: string;
|
|
1712
|
+
data?: Record<string, unknown>;
|
|
1713
|
+
hideTooltipCallback: () => void;
|
|
1714
|
+
api: GridApi;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
export declare type LoadTreeChildrenFn = (params: LoadTreeChildrenParams) => Promise<RowData[] | void> | RowData[] | void;
|
|
1718
|
+
|
|
1719
|
+
export declare interface LoadTreeChildrenParams {
|
|
1720
|
+
parentRowId: BusinessRowId;
|
|
1721
|
+
parentData: RowData;
|
|
1722
|
+
dataPath: string[];
|
|
1723
|
+
treeLevel: number;
|
|
1724
|
+
signal: AbortSignal;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/** MagicGrid 组件实例暴露的方法(通过 ref 调用) */
|
|
1728
|
+
export declare interface MagicGridExpose {
|
|
1729
|
+
/** GridApi 响应式引用;挂载后可用 */
|
|
1730
|
+
api: Ref<GridApi | undefined>;
|
|
1731
|
+
/** 读取 Grid 运行时性能指标 */
|
|
1732
|
+
getMetrics: () => GridMetrics | undefined;
|
|
1733
|
+
/** 滚动到指定 scrollTop / scrollLeft(px) */
|
|
1734
|
+
scrollTo: (scrollTop: number, scrollLeft?: number) => void;
|
|
1735
|
+
/** 设置排序模型并重算 rowsToDisplay */
|
|
1736
|
+
setSortModel: (model: SortModelItem[]) => void;
|
|
1737
|
+
/** 读取当前排序模型 */
|
|
1738
|
+
getSortModel: () => SortModelItem[];
|
|
1739
|
+
/** 设置筛选模型并重算 rowsToDisplay */
|
|
1740
|
+
setFilterModel: (model: FilterModel) => void;
|
|
1741
|
+
/** 导出当前表格业务数据;等价于 `api.getData()` */
|
|
1742
|
+
getData: (options?: GetDataOptions) => RowData[];
|
|
1743
|
+
/** 批量增删改行;返回本次事务影响的 RowNode 快照 */
|
|
1744
|
+
applyTransaction: (transaction: RowTransaction) => Promise<RowNodeTransaction | undefined>;
|
|
1745
|
+
/** 开启批量更新(合并多次 DOM 刷新) */
|
|
1746
|
+
beginUpdate: () => void;
|
|
1747
|
+
/** 结束批量更新并刷新 */
|
|
1748
|
+
endUpdate: () => void;
|
|
1749
|
+
/** 滚动使指定 display 行可见 */
|
|
1750
|
+
ensureIndexVisible: (index: number, position?: 'top' | 'bottom' | 'middle') => void;
|
|
1751
|
+
/** 立即刷新待处理的动画帧任务 */
|
|
1752
|
+
flushFrames: () => void;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
/** MagicGrid 组件 props;`TData` 为行数据类型,用于列定义与回调参数推导 */
|
|
1756
|
+
export declare interface MagicGridProps<TData extends RowData = RowData> {
|
|
1757
|
+
/** 列定义 */
|
|
1758
|
+
columns: ColumnDef<TData>[];
|
|
1759
|
+
/** 行数据 */
|
|
1760
|
+
data: TData[];
|
|
1761
|
+
/** Grid 实例级命名编辑器(colId 引用 cellEditor: 'name' 时解析;优先于全局注册表) */
|
|
1762
|
+
cellEditorRegistry?: Record<string, CellEditorFn>;
|
|
1763
|
+
/** 行数据主键字段名(PK),用于行池复用与增量更新 */
|
|
1764
|
+
rowKey?: string;
|
|
1765
|
+
/** 斑马纹 */
|
|
1766
|
+
stripe?: boolean;
|
|
1767
|
+
/**
|
|
1768
|
+
* 边框样式(默认 `border`)
|
|
1769
|
+
* - border:表头 / 表体单元格全网格线(1px)
|
|
1770
|
+
* - none:无单元格线;表头与表体保留底部分隔线
|
|
1771
|
+
* - linear:表头 / 表体单元格仅底部分隔线
|
|
1772
|
+
*/
|
|
1773
|
+
border?: GridBorder;
|
|
1774
|
+
/**
|
|
1775
|
+
* 主题 preset;默认 `light`(亮色)。
|
|
1776
|
+
* `dark` 切换暗色语义 token(`--mg-color-*`)。
|
|
1777
|
+
*/
|
|
1778
|
+
theme?: GridTheme;
|
|
1779
|
+
/**
|
|
1780
|
+
* 尺寸 preset;默认 `default`。
|
|
1781
|
+
* rowHeight / headerHeight 未显式传入时,由 size 推导。
|
|
1782
|
+
*/
|
|
1783
|
+
size?: GridSize;
|
|
1784
|
+
/**
|
|
1785
|
+
* 容器圆角(px);默认 `false`(无圆角)
|
|
1786
|
+
* - `false` / `0`:圆角为 0
|
|
1787
|
+
* - `true`:使用当前 size preset 的圆角
|
|
1788
|
+
* - `number`:自定义圆角像素值
|
|
1789
|
+
*/
|
|
1790
|
+
rounded?: GridRounded;
|
|
1791
|
+
/** 固定行高(px);显式传入时覆盖 size preset */
|
|
1792
|
+
rowHeight?: number;
|
|
1793
|
+
/** 表头高度(px);显式传入时覆盖 size preset */
|
|
1794
|
+
headerHeight?: number;
|
|
1795
|
+
/** 是否显示最左侧索引列;默认 false */
|
|
1796
|
+
showIndexColumn?: boolean;
|
|
1797
|
+
/** 索引列配置;showIndexColumn=true 时生效;MagicGrid 层 syncToSelectionColumn 默认 true */
|
|
1798
|
+
indexColumn?: IndexColumnOptions;
|
|
1799
|
+
/** 是否展示表尾汇总行;默认 false */
|
|
1800
|
+
showSummary?: boolean;
|
|
1801
|
+
/**
|
|
1802
|
+
* 汇总计算范围;默认 `displayed`(rowsToDisplay,尊重 filter / sort)
|
|
1803
|
+
* - displayed:当前可见行集
|
|
1804
|
+
* - all:sourceRows 全量(忽略 filter)
|
|
1805
|
+
*/
|
|
1806
|
+
summaryScope?: SummaryScope;
|
|
1807
|
+
/** 汇总行高度(px);未传时跟随 rowHeight / size preset */
|
|
1808
|
+
summaryRowHeight?: number;
|
|
1809
|
+
/**
|
|
1810
|
+
* 全局汇总方法(优先级高于列级 summaryAgg)
|
|
1811
|
+
* 返回 colId → 展示值;首列缺省可显示「合计」
|
|
1812
|
+
*/
|
|
1813
|
+
summaryMethod?: SummaryMethod;
|
|
1814
|
+
/** 表头水平对齐(全局默认);默认 center */
|
|
1815
|
+
headerAlign?: GridHorizontalAlign;
|
|
1816
|
+
/** 表头垂直对齐(全局默认);默认 center */
|
|
1817
|
+
headerValign?: GridVerticalAlign;
|
|
1818
|
+
/** 表体水平对齐(全局默认);默认 center */
|
|
1819
|
+
align?: GridHorizontalAlign;
|
|
1820
|
+
/** 表体垂直对齐(全局默认);默认 center */
|
|
1821
|
+
valign?: GridVerticalAlign;
|
|
1822
|
+
/** 表尾汇总水平对齐(全局默认);默认 center */
|
|
1823
|
+
footerAlign?: GridHorizontalAlign;
|
|
1824
|
+
/** 表尾汇总垂直对齐(全局默认);默认 center */
|
|
1825
|
+
footerValign?: GridVerticalAlign;
|
|
1826
|
+
/** 是否允许键盘/鼠标将焦点导航到表头;默认 false */
|
|
1827
|
+
navigateHeader?: boolean;
|
|
1828
|
+
/** 是否允许键盘/鼠标将焦点导航到表尾汇总行;默认 false(需 showSummary: true) */
|
|
1829
|
+
navigateFooter?: boolean;
|
|
1830
|
+
/** 行虚拟化缓冲行数 */
|
|
1831
|
+
rowBuffer?: number;
|
|
1832
|
+
/** 行选择模式,false 禁用;对象形式支持 groupSelectsChildren */
|
|
1833
|
+
rowSelection?: RowSelectionInput;
|
|
1834
|
+
/** 行选择列配置;rowSelection !== false 时生效 */
|
|
1835
|
+
selectionColumn?: SelectionColumnOptions;
|
|
1836
|
+
/**
|
|
1837
|
+
* 行选择列:行 checkbox 是否可勾选;函数入参含 `data` / `rowId` / `rowIndex`。
|
|
1838
|
+
* 省略时全部可选。
|
|
1839
|
+
*/
|
|
1840
|
+
selectable?: SelectableFn;
|
|
1841
|
+
/** 行选择列:数据刷新后是否保留选中行;默认 false */
|
|
1842
|
+
reserveSelection?: boolean;
|
|
1843
|
+
/** Grid 级 quick filter 文本 */
|
|
1844
|
+
quickFilterText?: string;
|
|
1845
|
+
/**
|
|
1846
|
+
* 是否允许列筛选;默认 `false`。
|
|
1847
|
+
* 列级 `columns[].filterable` **优先于**本配置;系统列(索引 / 行选择等)恒为 false。
|
|
1848
|
+
*/
|
|
1849
|
+
filterable?: boolean;
|
|
1850
|
+
/** 表头下方 Floating Filter 行;默认 `false` */
|
|
1851
|
+
floatingFilter?: boolean;
|
|
1852
|
+
/** 值选择搜索时的勾选投影模式;默认 `current` */
|
|
1853
|
+
filterSetValueMode?: FilterSetValueMode;
|
|
1854
|
+
/** 日期列值选择展示方式;默认 `tree` */
|
|
1855
|
+
filterSetDateLayoutMode?: FilterSetDateLayoutMode;
|
|
1856
|
+
/** 编辑范围:cell 单格 / row 整行 */
|
|
1857
|
+
editBehavior?: CellEditBehavior;
|
|
1858
|
+
/** 进入编辑态的触发方式,默认 singleClick */
|
|
1859
|
+
editType?: CellEditType;
|
|
1860
|
+
/** 校验失败后:block 保持编辑 / revert 退出并恢复旧值 */
|
|
1861
|
+
invalidEditValueMode?: InvalidEditValueMode;
|
|
1862
|
+
/** 行编辑跨字段校验 */
|
|
1863
|
+
rowValidator?: RowValidator;
|
|
1864
|
+
/** 异步行 CRUD 持久化钩子 */
|
|
1865
|
+
asyncRowMutation?: AsyncRowMutationHandlers;
|
|
1866
|
+
/** 容器高度 */
|
|
1867
|
+
height?: string | number;
|
|
1868
|
+
/** 容器宽度 */
|
|
1869
|
+
width?: string | number;
|
|
1870
|
+
/**
|
|
1871
|
+
* 初始排序(Grid 挂载 / initGrid 时应用一次);当前仅使用首项
|
|
1872
|
+
*/
|
|
1873
|
+
defaultSort?: SortModelItem[];
|
|
1874
|
+
/**
|
|
1875
|
+
* 是否允许用户点击表头排序;默认 `false`。
|
|
1876
|
+
* 列级 `columns[].sortable` **优先于**本配置;系统列(索引 / 行选择)恒为 false。
|
|
1877
|
+
*/
|
|
1878
|
+
sortable?: boolean;
|
|
1879
|
+
/** 是否允许用户列表头拖拽重排;默认 true(对齐 AG Grid;`:column-movable="false"` 关闭) */
|
|
1880
|
+
columnMovable?: boolean;
|
|
1881
|
+
/**
|
|
1882
|
+
* 是否允许用户拖拽调整列宽;默认 `true`(对齐 AG Grid `defaultColDef.resizable`)。
|
|
1883
|
+
* 列级 `columns[].resizable` **优先于**本配置;系统列(索引 / 行选择)恒为 false。
|
|
1884
|
+
*/
|
|
1885
|
+
resizable?: boolean;
|
|
1886
|
+
/**
|
|
1887
|
+
* 默认 Shift 模式:拖拽列宽时相邻列反向补偿,总宽不变。
|
|
1888
|
+
* 对标 AG Grid `colResizeDefault: 'shift'`。
|
|
1889
|
+
*/
|
|
1890
|
+
colResizeDefault?: 'shift';
|
|
1891
|
+
/** 双击 resize 把柄 auto-size 时跳过表头宽度;对标 AG Grid skipHeaderOnAutoSize */
|
|
1892
|
+
skipHeaderOnAutoSize?: boolean;
|
|
1893
|
+
/** auto-size 内容测量额外 padding(px);对标 AG Grid autoSizePadding */
|
|
1894
|
+
autoSizePadding?: number;
|
|
1895
|
+
/** 挂载 / 首屏 auto-size 策略;对标 AG Grid autoSizeStrategy */
|
|
1896
|
+
autoSizeStrategy?: AutoSizeStrategy;
|
|
1897
|
+
/** 默认 false(drag 过程中 live move,对齐 AG Grid)。
|
|
1898
|
+
* true → 仅 mouseup 提交列序。
|
|
1899
|
+
*/
|
|
1900
|
+
suppressMoveWhenColumnDragging?: boolean;
|
|
1901
|
+
/** 默认 false;true 关闭列移动 transition */
|
|
1902
|
+
suppressColumnMoveAnimation?: boolean;
|
|
1903
|
+
/**
|
|
1904
|
+
* 默认 false。
|
|
1905
|
+
* true → 允许 drag / API 跨 fixed lane 并更新列 `fixed`。
|
|
1906
|
+
*/
|
|
1907
|
+
allowCrossLaneColumnMove?: boolean;
|
|
1908
|
+
/** 默认 false;true → 未排序 sortable 列 hover 显示 faint 双三角 */
|
|
1909
|
+
showUnsortedSortHintOnHover?: boolean;
|
|
1910
|
+
/** 是否显示底部状态栏;默认 true */
|
|
1911
|
+
showStatusBar?: boolean;
|
|
1912
|
+
/**
|
|
1913
|
+
* 状态栏高度:`'auto'` 跟随 size preset(默认);number 为自定义 px。
|
|
1914
|
+
*/
|
|
1915
|
+
statusBarHeight?: StatusBarHeightInput;
|
|
1916
|
+
/** 框选时在状态栏展示平均值/计数/求和;cellSelection 开时默认 true */
|
|
1917
|
+
showStatusBarRangeAggregation?: boolean;
|
|
1918
|
+
/** 框选聚合 panel 位置;默认 `right`(右栏内侧) */
|
|
1919
|
+
statusBarRangeAggregationPosition?: StatusBarRangeAggregationPosition;
|
|
1920
|
+
/**
|
|
1921
|
+
* 平均值 / 求和展示小数位数。
|
|
1922
|
+
* 传 number 时同时作用于两者;默认 2。
|
|
1923
|
+
*/
|
|
1924
|
+
statusBarRangeAggregationPrecision?: StatusBarRangeAggregationPrecisionInput;
|
|
1925
|
+
/**
|
|
1926
|
+
* 启用 managed 行拖拽:拖拽过程中实时改 source 顺序;默认 true。
|
|
1927
|
+
* 设为 false 时仅 emit `rowDragEnd`,由业务自行改序。
|
|
1928
|
+
* 对标 AG Grid `rowDragManaged`。
|
|
1929
|
+
*/
|
|
1930
|
+
rowDragManaged?: boolean;
|
|
1931
|
+
/**
|
|
1932
|
+
* managed 模式 commit 策略:`sync`(默认 live move)| `deferred`(mouseup 后 await onRowDragCommit)。
|
|
1933
|
+
*/
|
|
1934
|
+
rowDragCommitMode?: RowDragCommitMode;
|
|
1935
|
+
/**
|
|
1936
|
+
* deferred 模式:mouseup 后、apply 前调用;返回 false 则不写 source。
|
|
1937
|
+
* MagicGrid 亦支持 `:on-row-drag-commit` prop(与 Grid option 等价)。
|
|
1938
|
+
*/
|
|
1939
|
+
onRowDragCommit?: RowDragCommitHandler;
|
|
1940
|
+
/**
|
|
1941
|
+
* 行级动态高度(无 DOM);优先于默认 rowHeight,低于手动 setRowHeight。
|
|
1942
|
+
* 对标 AG Grid `getRowHeight`。
|
|
1943
|
+
*/
|
|
1944
|
+
getRowHeight?: GetRowHeightFn;
|
|
1945
|
+
/** 行高下限(px);未传时跟随 size preset / rowHeight */
|
|
1946
|
+
rowHeightMin?: number;
|
|
1947
|
+
/** 行高上限(px);未传时无上限 */
|
|
1948
|
+
rowHeightMax?: number;
|
|
1949
|
+
/**
|
|
1950
|
+
* 启用单元格合并。默认 `false`。
|
|
1951
|
+
* `true` 时解析列级 `colSpan` / `rowSpan` / `spanRows`,且行定位改用 `style.top`。
|
|
1952
|
+
* 对标 AG Grid `enableCellSpan`。
|
|
1953
|
+
*/
|
|
1954
|
+
enableCellSpan?: boolean;
|
|
1955
|
+
/**
|
|
1956
|
+
* 启用主从展开行。默认 `false`。
|
|
1957
|
+
* 对标 AG Grid `masterDetail`。
|
|
1958
|
+
*/
|
|
1959
|
+
masterDetail?: boolean;
|
|
1960
|
+
/** 是否为主行(可展示 expand 控件);缺省全部 data 行可展开 */
|
|
1961
|
+
isRowMaster?: IsRowMasterFn;
|
|
1962
|
+
/** 默认展开层级:0 = 无;1 = 第一层;-1 = 全部 */
|
|
1963
|
+
masterDefaultExpanded?: number;
|
|
1964
|
+
/** 详情行固定高度(px);与 detailRowAutoHeight 并存时本字段优先 */
|
|
1965
|
+
detailRowHeight?: number | DetailRowHeightFn;
|
|
1966
|
+
/** 详情行按内容自动撑高 */
|
|
1967
|
+
detailRowAutoHeight?: boolean;
|
|
1968
|
+
/**
|
|
1969
|
+
* false(默认):详情 overlay 不随 center 横滚。
|
|
1970
|
+
* true:详情嵌入 center lane。
|
|
1971
|
+
*/
|
|
1972
|
+
embedFullWidthRows?: boolean;
|
|
1973
|
+
/** 最左展示专用展开列(fixed=left) */
|
|
1974
|
+
showExpandColumn?: boolean;
|
|
1975
|
+
/** 异步提供详情区数据 */
|
|
1976
|
+
getDetailRowData?: GetDetailRowDataFn;
|
|
1977
|
+
/** 自定义详情行渲染器(与 `#detail-row` 插槽二选一) */
|
|
1978
|
+
detailCellRenderer?: DetailCellRendererFn;
|
|
1979
|
+
/**
|
|
1980
|
+
* 启用行分组。默认 `false`。
|
|
1981
|
+
* `true` 且存在 ≥1 个分组字段时生效。
|
|
1982
|
+
*/
|
|
1983
|
+
rowGrouping?: boolean;
|
|
1984
|
+
/** 默认展开分组层级:0 = 全折叠;1 = 第一层;-1 = 全部展开。默认 `-1` */
|
|
1985
|
+
groupDefaultExpanded?: number;
|
|
1986
|
+
/** 是否展示 groupHeader 分组标题行。默认 `false` */
|
|
1987
|
+
showGroupHeader?: boolean;
|
|
1988
|
+
/** 是否为每个已展开的分组展示 footer 汇总行。默认 `false` */
|
|
1989
|
+
showGroupFooter?: boolean;
|
|
1990
|
+
/**
|
|
1991
|
+
* 分组展示模式。当前仅支持 `singleColumn`。
|
|
1992
|
+
* 默认 `singleColumn`。
|
|
1993
|
+
*/
|
|
1994
|
+
groupDisplayType?: GroupDisplayType;
|
|
1995
|
+
/** 是否展示 auto group 系统列;默认 false */
|
|
1996
|
+
showGroupColumn?: boolean;
|
|
1997
|
+
/** 覆盖 auto group 列的 colDef */
|
|
1998
|
+
autoGroupColumnDef?: Partial<ColumnDef<TData>>;
|
|
1999
|
+
/** 分组键归一化(可选) */
|
|
2000
|
+
groupKeyCreator?: GroupKeyCreatorFn;
|
|
2001
|
+
/**
|
|
2002
|
+
* 同级 group 节点排序。缺省按 groupKey 升序(blank 置末)。
|
|
2003
|
+
* 自定义时全权负责(含 blank);不改变展示键。
|
|
2004
|
+
*/
|
|
2005
|
+
groupComparator?: GroupComparatorFn;
|
|
2006
|
+
/** groupFooter 首列展示标签 */
|
|
2007
|
+
groupFooterLabel?: string;
|
|
2008
|
+
/** 自定义分组单元格渲染器 */
|
|
2009
|
+
groupCellRenderer?: GroupCellRendererFn;
|
|
2010
|
+
/**
|
|
2011
|
+
* 启用树形表格。默认 `false`。
|
|
2012
|
+
* 与 `rowGrouping` 互斥。
|
|
2013
|
+
*/
|
|
2014
|
+
tree?: boolean;
|
|
2015
|
+
/** 树形路径回调;`tree: true` 时必填 */
|
|
2016
|
+
getDataPath?: GetDataPathFn;
|
|
2017
|
+
/**
|
|
2018
|
+
* 树形 managed 行拖拽范围。默认 `siblings`(仅同 parent 兄弟换序);
|
|
2019
|
+
* `hierarchy` 允许跨层级改父节点(需 `setDataPath` 写回路径)。
|
|
2020
|
+
*/
|
|
2021
|
+
treeDragScope?: TreeDragScope;
|
|
2022
|
+
/** hierarchy 模式下写回 dataPath;缺省时若 data.pathSegments 为数组则自动更新 */
|
|
2023
|
+
setDataPath?: SetDataPathFn;
|
|
2024
|
+
/** 是否展示 tree 系统列。默认 `true` */
|
|
2025
|
+
showTreeColumn?: boolean;
|
|
2026
|
+
/** 覆盖 tree 系统列 colDef */
|
|
2027
|
+
autoTreeColumnDef?: Partial<ColumnDef<TData>>;
|
|
2028
|
+
/** 自定义 tree 列展示值 */
|
|
2029
|
+
treeValueGetter?: TreeValueGetterFn;
|
|
2030
|
+
/** 树节点展示列模式。当前仅支持 `singleColumn` */
|
|
2031
|
+
treeDisplayType?: TreeDisplayType;
|
|
2032
|
+
/** 启用树形懒加载 */
|
|
2033
|
+
treeLazyLoad?: boolean;
|
|
2034
|
+
/** lazy 模式:节点是否可能有未加载子行 */
|
|
2035
|
+
hasTreeChildren?: HasTreeChildrenFn;
|
|
2036
|
+
/** lazy 模式:首次展开时拉取子数据 */
|
|
2037
|
+
loadTreeChildren?: LoadTreeChildrenFn;
|
|
2038
|
+
/** 单元格批注数据源;提供即启用 */
|
|
2039
|
+
cellCommentsDataSource?: CellCommentsDataSource;
|
|
2040
|
+
/** 全局抑制批注交互;API 仍可 bypass */
|
|
2041
|
+
suppressCellComments?: boolean;
|
|
2042
|
+
/** 查看已有批注的触发方式;默认 click(点角标 toggle) */
|
|
2043
|
+
cellCommentTrigger?: CellCommentTrigger;
|
|
2044
|
+
/** hover 模式展示延迟 ms;默认 180 */
|
|
2045
|
+
cellCommentShowDelay?: number;
|
|
2046
|
+
/** 离开 cell/popup 后隐藏延迟 ms;默认 220 */
|
|
2047
|
+
cellCommentHideDelay?: number;
|
|
2048
|
+
/** 复制单格时自定义导出值(最高优先级) */
|
|
2049
|
+
processCellForClipboard?: ProcessCellForClipboardFn;
|
|
2050
|
+
/** 粘贴单格时预处理 clipboard 字符串 */
|
|
2051
|
+
processCellFromClipboard?: ProcessCellFromClipboardFn;
|
|
2052
|
+
/** 整表粘贴前处理 TSV 矩阵;return null 取消粘贴 */
|
|
2053
|
+
processDataFromClipboard?: ProcessDataFromClipboardFn;
|
|
2054
|
+
/** 单元格框选;MagicGrid 默认 true(含 enableColumnSelection,handleMode 默认 off),Grid API 未传时为 false */
|
|
2055
|
+
cellSelection?: boolean | CellSelectionOptions;
|
|
2056
|
+
/** 框选复制;cellSelection 开启时默认 true */
|
|
2057
|
+
enableCellCopy?: boolean;
|
|
2058
|
+
/** 框选粘贴;cellSelection 开启时默认 false */
|
|
2059
|
+
enableCellPaste?: boolean;
|
|
2060
|
+
/** 选区涉及列的表头底色;默认 true */
|
|
2061
|
+
enableHeaderHighlight?: boolean;
|
|
2062
|
+
/** 选区行跨度内索引列高亮;默认 true */
|
|
2063
|
+
enableIndexColumnHighlight?: boolean;
|
|
2064
|
+
/** 是否启用溢出 tooltip;默认 true */
|
|
2065
|
+
enableTooltips?: boolean;
|
|
2066
|
+
/** 溢出 tooltip 显示策略;默认 whenTruncated */
|
|
2067
|
+
tooltipShowMode?: TooltipShowMode;
|
|
2068
|
+
/** 首次 hover 展示延迟 ms;默认 500 */
|
|
2069
|
+
tooltipShowDelay?: number;
|
|
2070
|
+
/** 格间切换展示延迟 ms;默认 200 */
|
|
2071
|
+
tooltipSwitchShowDelay?: number;
|
|
2072
|
+
/** 离开后隐藏延迟 ms;默认 3000 */
|
|
2073
|
+
tooltipHideDelay?: number;
|
|
2074
|
+
/** tooltip 内容是否可交互;默认 false */
|
|
2075
|
+
tooltipInteraction?: boolean;
|
|
2076
|
+
/** tooltip 是否跟随鼠标;默认 false */
|
|
2077
|
+
tooltipMouseTrack?: boolean;
|
|
2078
|
+
/** 是否显示 loading overlay;undefined 为挂载后首次 setData 前自动 loading */
|
|
2079
|
+
loading?: boolean;
|
|
2080
|
+
/** 逐项抑制内置 overlay */
|
|
2081
|
+
suppressOverlays?: OverlayType[];
|
|
2082
|
+
/** 抑制 loading overlay */
|
|
2083
|
+
suppressLoadingOverlay?: boolean;
|
|
2084
|
+
/** 抑制无数据 overlay */
|
|
2085
|
+
suppressNoRowsOverlay?: boolean;
|
|
2086
|
+
/** 抑制无匹配行 overlay(filter 后为空) */
|
|
2087
|
+
suppressNoMatchingRowsOverlay?: boolean;
|
|
2088
|
+
/** loading overlay 内置 HTML 模板 */
|
|
2089
|
+
overlayLoadingTemplate?: string;
|
|
2090
|
+
/** 无数据 overlay 内置 HTML 模板 */
|
|
2091
|
+
overlayNoRowsTemplate?: string;
|
|
2092
|
+
/** 无匹配行 overlay 内置 HTML 模板 */
|
|
2093
|
+
overlayNoMatchingRowsTemplate?: string;
|
|
2094
|
+
/** 自定义 loading overlay 组件 */
|
|
2095
|
+
loadingOverlayComponent?: OverlayComponentType;
|
|
2096
|
+
/** loading overlay 组件额外参数 */
|
|
2097
|
+
loadingOverlayComponentParams?: Record<string, unknown>;
|
|
2098
|
+
/** 自定义无数据 overlay 组件 */
|
|
2099
|
+
noRowsOverlayComponent?: OverlayComponentType;
|
|
2100
|
+
/** 无数据 overlay 组件额外参数 */
|
|
2101
|
+
noRowsOverlayComponentParams?: Record<string, unknown>;
|
|
2102
|
+
/** 自定义无匹配行 overlay 组件 */
|
|
2103
|
+
noMatchingRowsOverlayComponent?: OverlayComponentType;
|
|
2104
|
+
/** 无匹配行 overlay 组件额外参数 */
|
|
2105
|
+
noMatchingRowsOverlayComponentParams?: Record<string, unknown>;
|
|
2106
|
+
/** 通用 overlay 组件(按类型分发) */
|
|
2107
|
+
overlayComponent?: OverlayComponentType;
|
|
2108
|
+
/** 通用 overlay 组件额外参数 */
|
|
2109
|
+
overlayComponentParams?: Record<string, unknown>;
|
|
2110
|
+
/** overlay 内容是否可交互(默认可穿透) */
|
|
2111
|
+
overlayInteraction?: boolean;
|
|
2112
|
+
/**
|
|
2113
|
+
* 行级禁用:true 时该行全部数据列 disabled。
|
|
2114
|
+
* 不影响 index / selection / expand / tree / group 系统列。
|
|
2115
|
+
*/
|
|
2116
|
+
isRowDisabled?: boolean | IsRowDisabledFn<TData>;
|
|
2117
|
+
/**
|
|
2118
|
+
* 行级样式:对象 = 全表同色;函数 = 按行。
|
|
2119
|
+
* 作用于表体用户数据列与行选择列;表头/表尾/索引列不参与。
|
|
2120
|
+
*/
|
|
2121
|
+
rowStyle?: RowStyle<TData>;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
/** magic-grid 扩展:validationRules.validator 可为 async */
|
|
2125
|
+
export declare interface MagicValidationRule {
|
|
2126
|
+
validator?: (rule: unknown, value: unknown, callback: (error?: string | Error) => void, source: unknown, options: unknown) => void | Promise<void>;
|
|
2127
|
+
message?: string;
|
|
2128
|
+
required?: boolean;
|
|
2129
|
+
min?: number;
|
|
2130
|
+
max?: number;
|
|
2131
|
+
type?: string;
|
|
2132
|
+
[key: string]: unknown;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
export declare interface MoveRowOptions {
|
|
2136
|
+
/** 内部 rowId */
|
|
2137
|
+
rowId: string;
|
|
2138
|
+
/** 目标下标 */
|
|
2139
|
+
toIndex: number;
|
|
2140
|
+
/** 下标基准,默认 `source` */
|
|
2141
|
+
indexMode?: RowIndexMode;
|
|
2142
|
+
/** live drag 中间态为 false;mouseup 收尾为 true(默认 true) */
|
|
2143
|
+
finished?: boolean;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
/** 数字列算子集 */
|
|
2147
|
+
export declare type NumberFilterType = 'equals' | 'notEqual' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'blank' | 'notBlank';
|
|
2148
|
+
|
|
2149
|
+
/** 自定义 overlay 工厂(对标 tooltipComponentHost · 块 7 挂载) */
|
|
2150
|
+
export declare type OverlayComponentFactory = (params: IOverlayParams, mountEl: HTMLElement) => IOverlayComp | void;
|
|
2151
|
+
|
|
2152
|
+
export declare type OverlayComponentType = OverlayComponentFactory;
|
|
2153
|
+
|
|
2154
|
+
export declare interface OverlayHiddenEvent {
|
|
2155
|
+
overlayType: OverlayType;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
export declare interface OverlayShownEvent {
|
|
2159
|
+
overlayType: OverlayType;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
/** `#loading` / `#no-rows` / `#no-matching-rows` 插槽 props */
|
|
2163
|
+
export declare interface OverlaySlotParams {
|
|
2164
|
+
/** 当前 overlay 类型 */
|
|
2165
|
+
overlayType: OverlayType;
|
|
2166
|
+
/** GridApi 实例 */
|
|
2167
|
+
api: GridApi;
|
|
2168
|
+
/** 内置 overlay 默认文案(自定义组件可忽略) */
|
|
2169
|
+
overlayText?: string;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
/** 内置 overlay 类型(v1) */
|
|
2173
|
+
export declare type OverlayType = 'loading' | 'noRows' | 'noMatchingRows';
|
|
2174
|
+
|
|
2175
|
+
/** 复制/粘贴 processCell* 回调共享参数 */
|
|
2176
|
+
export declare interface ProcessCellClipboardParamsBase {
|
|
2177
|
+
rowIndex: number;
|
|
2178
|
+
colId: string;
|
|
2179
|
+
rowNode: RowNode;
|
|
2180
|
+
column: Column;
|
|
2181
|
+
/** 复制:formatter/raw 候选值;粘贴:clipboard 字符串 */
|
|
2182
|
+
value: unknown;
|
|
2183
|
+
/** 辅助:对任意 raw 值套列 formatter */
|
|
2184
|
+
formatValue: (value: unknown) => string;
|
|
2185
|
+
/** 辅助:对 clipboard 字符串走 valueParser(拒绝时返回 CELL_EDIT_REJECTED) */
|
|
2186
|
+
parseValue: (text: string) => unknown;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
export declare type ProcessCellForClipboardFn = (params: ProcessCellForClipboardParams) => unknown;
|
|
2190
|
+
|
|
2191
|
+
export declare type ProcessCellForClipboardParams = ProcessCellClipboardParamsBase;
|
|
2192
|
+
|
|
2193
|
+
export declare type ProcessCellFromClipboardFn = (params: ProcessCellFromClipboardParams) => unknown;
|
|
2194
|
+
|
|
2195
|
+
export declare type ProcessCellFromClipboardParams = ProcessCellClipboardParamsBase & {
|
|
2196
|
+
oldValue: unknown;
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
export declare type ProcessDataFromClipboardFn = (params: ProcessDataFromClipboardParams) => string[][] | null;
|
|
2200
|
+
|
|
2201
|
+
export declare interface ProcessDataFromClipboardParams {
|
|
2202
|
+
data: string[][];
|
|
2203
|
+
anchor: CellPosition;
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
export declare interface PromoteRowIdOptions {
|
|
2207
|
+
/** 当前 RowNode.id(通常为 __mg_tmp_*) */
|
|
2208
|
+
rowId: RowId;
|
|
2209
|
+
/** 正式业务主键,写入 data[rowKey] 并更新 RowNode.id */
|
|
2210
|
+
businessId: string | number;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
export declare type PromoteRowIdResult = {
|
|
2214
|
+
ok: true;
|
|
2215
|
+
rowId: BusinessRowId;
|
|
2216
|
+
} | {
|
|
2217
|
+
ok: false;
|
|
2218
|
+
reason: string;
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
export declare interface RefreshCellCommentsParams {
|
|
2222
|
+
rowIds?: readonly BusinessRowId[];
|
|
2223
|
+
colIds?: readonly string[];
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
/** refreshCells 定向刷新参数 */
|
|
2227
|
+
export declare interface RefreshCellsParams {
|
|
2228
|
+
rowIds?: string[];
|
|
2229
|
+
colIds?: string[];
|
|
2230
|
+
/** 忽略单元格值缓存,强制重绘 */
|
|
2231
|
+
force?: boolean;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
export declare interface RefreshCellStylesParams {
|
|
2235
|
+
rowIds?: readonly BusinessRowId[];
|
|
2236
|
+
colIds?: readonly string[];
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
export declare interface RefreshDisabledStateParams {
|
|
2240
|
+
rowIds?: readonly BusinessRowId[];
|
|
2241
|
+
colIds?: readonly string[];
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
export declare interface RemoveRowsOptions {
|
|
2245
|
+
/** 内部 rowId 或业务 rowKey 值(number / string) */
|
|
2246
|
+
rowIds?: RowId[];
|
|
2247
|
+
/** 批量下标 */
|
|
2248
|
+
indexes?: number[];
|
|
2249
|
+
indexMode?: RowIndexMode;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
/** 列模型上已解析的 filterParams */
|
|
2253
|
+
export declare interface ResolvedFilterParams {
|
|
2254
|
+
readonly caseSensitive: boolean;
|
|
2255
|
+
readonly locale?: string;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
/** 归一化后的框选聚合小数位数(average / sum 分别指定) */
|
|
2259
|
+
export declare interface ResolvedStatusBarRangeAggregationPrecision {
|
|
2260
|
+
/** 平均值展示小数位数 */
|
|
2261
|
+
average: number;
|
|
2262
|
+
/** 求和展示小数位数 */
|
|
2263
|
+
sum: number;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/** 表体数据行单击(不含分组头/详情行/表尾汇总) */
|
|
2267
|
+
export declare interface RowClickedEvent {
|
|
2268
|
+
rowId: BusinessRowId;
|
|
2269
|
+
rowIndex: number;
|
|
2270
|
+
rowNode: RowNode;
|
|
2271
|
+
/** 触发点击的列 colId */
|
|
2272
|
+
colId: string;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
export declare interface RowCommitFinishedEvent {
|
|
2276
|
+
rowId: BusinessRowId;
|
|
2277
|
+
rowIndex: number;
|
|
2278
|
+
committed: boolean;
|
|
2279
|
+
aborted?: boolean;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
export declare interface RowCommitStartedEvent {
|
|
2283
|
+
rowId: BusinessRowId;
|
|
2284
|
+
rowIndex: number;
|
|
2285
|
+
editableColIds: string[];
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
/** 用户行数据:保持普通对象,禁止 reactive 深代理 */
|
|
2289
|
+
export declare type RowData = Record<string, unknown>;
|
|
2290
|
+
|
|
2291
|
+
/** 表体数据行双击(不含分组头/详情行/表尾汇总) */
|
|
2292
|
+
export declare interface RowDoubleClickedEvent {
|
|
2293
|
+
rowId: BusinessRowId;
|
|
2294
|
+
rowIndex: number;
|
|
2295
|
+
rowNode: RowNode;
|
|
2296
|
+
/** 触发双击的列 colId */
|
|
2297
|
+
colId: string;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/** deferred row drag · 传给 onRowDragCommit 的上下文 */
|
|
2301
|
+
export declare interface RowDragCommitContext {
|
|
2302
|
+
signal: AbortSignal;
|
|
2303
|
+
commitId: number;
|
|
2304
|
+
rowIds: readonly string[];
|
|
2305
|
+
leaderRowId: string;
|
|
2306
|
+
moves: readonly RowMoveItem[];
|
|
2307
|
+
displayIndex: number;
|
|
2308
|
+
parentRowId?: string | null;
|
|
2309
|
+
siblingIndex?: number;
|
|
2310
|
+
treeLevel?: number;
|
|
2311
|
+
nestUnderRowId?: string | null;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
/** deferred row drag · commit 结束(成功时随后 emit rowMoved + rowDragEnd) */
|
|
2315
|
+
export declare interface RowDragCommitFinishedEvent {
|
|
2316
|
+
commitId: number;
|
|
2317
|
+
rowId: BusinessRowId;
|
|
2318
|
+
leaderRowId: BusinessRowId;
|
|
2319
|
+
committed: boolean;
|
|
2320
|
+
aborted?: boolean;
|
|
2321
|
+
reason?: string;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
export declare type RowDragCommitHandler = (context: RowDragCommitContext) => Promise<RowDragCommitHandlerResult> | RowDragCommitHandlerResult;
|
|
2325
|
+
|
|
2326
|
+
export declare type RowDragCommitHandlerResult = boolean | void | {
|
|
2327
|
+
ok: boolean;
|
|
2328
|
+
reason?: string;
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
/** managed 行拖拽 commit 策略 */
|
|
2332
|
+
export declare type RowDragCommitMode = 'sync' | 'deferred';
|
|
2333
|
+
|
|
2334
|
+
/** deferred row drag · commit 开始 */
|
|
2335
|
+
export declare interface RowDragCommitStartedEvent {
|
|
2336
|
+
rowId: BusinessRowId;
|
|
2337
|
+
rowIds: readonly BusinessRowId[];
|
|
2338
|
+
leaderRowId: BusinessRowId;
|
|
2339
|
+
displayIndex: number;
|
|
2340
|
+
parentRowId?: BusinessRowId | null;
|
|
2341
|
+
siblingIndex?: number;
|
|
2342
|
+
treeLevel?: number;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
/** 对标 Phase 15 rowDragEnd 事件 */
|
|
2346
|
+
export declare interface RowDragEndEvent {
|
|
2347
|
+
rowId: BusinessRowId;
|
|
2348
|
+
/** 多行 drag 时包含全部 rowId;单行时可省略 */
|
|
2349
|
+
rowIds?: readonly BusinessRowId[];
|
|
2350
|
+
/** drop 时指针所在的 display 插入位(0…rowCount);-1 表示无效区域 */
|
|
2351
|
+
displayIndex: number;
|
|
2352
|
+
finished: boolean;
|
|
2353
|
+
/**
|
|
2354
|
+
* Phase 19 · 树形 drop 后 leader 行的新父节点 rowId;根层为 `null`。
|
|
2355
|
+
* 仅树形且 drop 有效时提供。
|
|
2356
|
+
*/
|
|
2357
|
+
parentRowId?: BusinessRowId | null;
|
|
2358
|
+
/**
|
|
2359
|
+
* Phase 19 · 树形 drop 后在 `parentRowId` 下同级兄弟中的序号(0-based)。
|
|
2360
|
+
* 仅树形且 drop 有效时提供。
|
|
2361
|
+
*/
|
|
2362
|
+
siblingIndex?: number;
|
|
2363
|
+
/** Phase 19 · 树形 drop 后 leader 行的 treeLevel(根层 0);仅树形且 drop 有效时提供 */
|
|
2364
|
+
treeLevel?: number;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
export declare interface RowEditChange {
|
|
2368
|
+
colId: string;
|
|
2369
|
+
oldValue: unknown;
|
|
2370
|
+
newValue: unknown;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
export declare interface RowEditingStartedEvent {
|
|
2374
|
+
rowId: BusinessRowId;
|
|
2375
|
+
rowIndex: number;
|
|
2376
|
+
editableColIds: string[];
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
export declare interface RowEditingStoppedEvent {
|
|
2380
|
+
rowId: BusinessRowId;
|
|
2381
|
+
rowIndex: number;
|
|
2382
|
+
committed: boolean;
|
|
2383
|
+
changes?: RowEditChange[];
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
/** 对标 Phase 17 rowExpanded / rowCollapsed 事件 */
|
|
2387
|
+
export declare interface RowExpansionChangedEvent {
|
|
2388
|
+
rowId: BusinessRowId;
|
|
2389
|
+
expanded: boolean;
|
|
2390
|
+
source: RowExpansionSource;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
export declare type RowExpansionSource = 'api' | 'ui';
|
|
2394
|
+
|
|
2395
|
+
/** 分组列变更事件 */
|
|
2396
|
+
export declare interface RowGroupChangedEvent {
|
|
2397
|
+
columns: string[];
|
|
2398
|
+
source: RowGroupingSource;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
export declare type RowGroupingSource = 'api' | 'ui';
|
|
2402
|
+
|
|
2403
|
+
/** 对标 Phase 18 rowGroupOpened 事件 */
|
|
2404
|
+
export declare interface RowGroupOpenedEvent {
|
|
2405
|
+
groupId: string;
|
|
2406
|
+
expanded: boolean;
|
|
2407
|
+
field: string;
|
|
2408
|
+
key: string;
|
|
2409
|
+
level: number;
|
|
2410
|
+
source: RowGroupingSource;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
/** 对标 Phase 15 rowHeightChanged 事件 */
|
|
2414
|
+
export declare interface RowHeightChangedEvent {
|
|
2415
|
+
rows: RowHeightChangeItem[];
|
|
2416
|
+
finished: boolean;
|
|
2417
|
+
source: RowHeightChangeSource;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
export declare interface RowHeightChangeItem {
|
|
2421
|
+
rowId: string;
|
|
2422
|
+
rowHeight: number;
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
export declare type RowHeightChangeSource = 'api' | 'uiRowResized' | 'autoHeight' | 'dimensions';
|
|
2426
|
+
|
|
2427
|
+
/** 行主键 API 入参:与 data[rowKey] 一致,可为 number / string;内核统一规范为 string */
|
|
2428
|
+
export declare type RowId = string | number;
|
|
2429
|
+
|
|
2430
|
+
/** 单个 rowId 或 rowId 数组(toggleRowSelection / setIndexFocus 等) */
|
|
2431
|
+
export declare type RowIdInput = RowId | readonly RowId[];
|
|
2432
|
+
|
|
2433
|
+
export declare interface RowIdPromotedEvent {
|
|
2434
|
+
oldRowId: BusinessRowId;
|
|
2435
|
+
newRowId: BusinessRowId;
|
|
2436
|
+
data: RowData;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
/** 行插入/删除下标基准:source = 存储顺序;display = 当前可见顺序(含 sort/filter) */
|
|
2440
|
+
export declare type RowIndexMode = 'source' | 'display';
|
|
2441
|
+
|
|
2442
|
+
export declare type RowKind = 'data' | 'detail' | 'groupHeader' | 'groupFooter';
|
|
2443
|
+
|
|
2444
|
+
/** 对标 Phase 15 rowMoved 事件 */
|
|
2445
|
+
export declare interface RowMovedEvent {
|
|
2446
|
+
rowId: BusinessRowId;
|
|
2447
|
+
fromIndex: number;
|
|
2448
|
+
toIndex: number;
|
|
2449
|
+
source: RowMoveSource;
|
|
2450
|
+
/** live drag 中间态为 false;mouseup 收尾为 true(默认 true) */
|
|
2451
|
+
finished?: boolean;
|
|
2452
|
+
/** UI drag 时指针所在的 display 插入位;非 drag 或未提供时省略 */
|
|
2453
|
+
displayIndex?: number;
|
|
2454
|
+
/** 树形 drop 后新父节点 rowId;根层为 null;非树形时省略 */
|
|
2455
|
+
parentRowId?: BusinessRowId | null;
|
|
2456
|
+
/** 树形 drop 后在 parentRowId 下同级兄弟序号(0-based);非树形时省略 */
|
|
2457
|
+
siblingIndex?: number;
|
|
2458
|
+
/** 树形 drop 后 treeLevel(根层 0);非树形时省略 */
|
|
2459
|
+
treeLevel?: number;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
export declare interface RowMoveItem {
|
|
2463
|
+
rowId: string;
|
|
2464
|
+
fromIndex: number;
|
|
2465
|
+
toIndex: number;
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
export declare interface RowMoveResult {
|
|
2469
|
+
moved: boolean;
|
|
2470
|
+
fromIndex?: number;
|
|
2471
|
+
toIndex?: number;
|
|
2472
|
+
reason?: string;
|
|
2473
|
+
moves?: readonly RowMoveItem[];
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
export declare type RowMoveSource = 'api' | 'uiRowDrag';
|
|
2477
|
+
|
|
2478
|
+
/**
|
|
2479
|
+
* Phase 6 行 CRUD API 面。
|
|
2480
|
+
*
|
|
2481
|
+
* 负责增删行、导出用户数据、临时行 ID 提升;与 `applyTransaction` 共享同一事务管线。
|
|
2482
|
+
*
|
|
2483
|
+
* @see docs/10-phase6-row-crud.md
|
|
2484
|
+
*/
|
|
2485
|
+
export declare interface RowMutationGridApi {
|
|
2486
|
+
/**
|
|
2487
|
+
* 在指定位置插入一行或多行。
|
|
2488
|
+
*
|
|
2489
|
+
* - 省略 `data[rowKey]` 或值为 `null` 时生成**临时行**(`RowNode.id = __mg_tmp_*`);
|
|
2490
|
+
* `getData()` 导出时对应字段为 `null`。
|
|
2491
|
+
* - 带有效 `rowKey` 的新增行视为持久化行,须保证主键唯一。
|
|
2492
|
+
* - 配置 `asyncRowMutation.add` 时 await 服务端成功后再写入本地。
|
|
2493
|
+
*
|
|
2494
|
+
* @returns 本次变更涉及的 RowNode 快照(add / remove / update)
|
|
2495
|
+
*/
|
|
2496
|
+
addRows(options: AddRowsOptions): Promise<RowNodeTransaction>;
|
|
2497
|
+
/**
|
|
2498
|
+
* 按 rowId 和/或行下标删除行。
|
|
2499
|
+
*
|
|
2500
|
+
* - `rowIds`:内核 id 或业务主键值(number / string 均可)。
|
|
2501
|
+
* - `indexes`:配合 `indexMode` 使用 `'source'`(存储顺序)或 `'display'`(排序/filter 后可见顺序)。
|
|
2502
|
+
* - 删除正在编辑的行会先取消编辑;选区 / 索引定位 / 校验反馈会同步清理。
|
|
2503
|
+
* - 配置 `asyncRowMutation.remove` 时 await 服务端成功后再删除本地。
|
|
2504
|
+
*
|
|
2505
|
+
* @returns 本次删除的 RowNode 快照
|
|
2506
|
+
*/
|
|
2507
|
+
removeRows(options: RemoveRowsOptions): Promise<RowNodeTransaction>;
|
|
2508
|
+
/**
|
|
2509
|
+
* 导出当前表格数据为业务层 `RowData[]`。
|
|
2510
|
+
*
|
|
2511
|
+
* - 默认 `sourceOrder: true`,按 source 存储顺序返回。
|
|
2512
|
+
* - 临时行的 `data[rowKey]` 固定为 `null`(不暴露 `__mg_tmp_*`)。
|
|
2513
|
+
*
|
|
2514
|
+
* @param options.sourceOrder `false` 时按当前 display 顺序(含 sort/filter 结果)
|
|
2515
|
+
*/
|
|
2516
|
+
getData(options?: GetDataOptions): RowData[];
|
|
2517
|
+
/**
|
|
2518
|
+
* 将临时行的内部 id 提升为正式业务主键。
|
|
2519
|
+
*
|
|
2520
|
+
* - `rowId`:当前 `RowNode.id`(通常为 `__mg_tmp_*`)。
|
|
2521
|
+
* - `businessId`:写入 `data[rowKey]` 并更新 `RowNode.id` 的值(number / string)。
|
|
2522
|
+
* - 目标 id 已存在或行正在编辑时返回 `{ ok: false, reason }`。
|
|
2523
|
+
*
|
|
2524
|
+
* 成功时 emit `rowIdPromoted` 事件。
|
|
2525
|
+
*/
|
|
2526
|
+
promoteRowId(options: PromoteRowIdOptions): PromoteRowIdResult;
|
|
2527
|
+
/**
|
|
2528
|
+
* 编程式移动行(Phase 15)。
|
|
2529
|
+
*
|
|
2530
|
+
* - `indexMode: 'source'`(默认)按 source 存储顺序移动。
|
|
2531
|
+
* - `indexMode: 'display'` 按当前 display 顺序移动;sort 激活时拒绝。
|
|
2532
|
+
* - managed UI drag 成功时 emit `rowMoved`(`source: 'uiRowDrag'`);API 调用为 `'api'`。
|
|
2533
|
+
*/
|
|
2534
|
+
moveRow(rowId: RowId, toIndex: number, indexMode?: RowIndexMode): RowMoveResult;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
export declare interface RowMutationRemovedSnapshot {
|
|
2538
|
+
rowId: BusinessRowId;
|
|
2539
|
+
data: RowData;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
/** 行变更事件中的行快照 */
|
|
2543
|
+
export declare interface RowMutationRowSnapshot {
|
|
2544
|
+
rowId: BusinessRowId;
|
|
2545
|
+
rowIndex: number;
|
|
2546
|
+
data: RowData;
|
|
2547
|
+
isTransient: boolean;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
/** 行节点:数据层与渲染层的统一单元 */
|
|
2551
|
+
export declare interface RowNode {
|
|
2552
|
+
/** 池化复用键(必须稳定) */
|
|
2553
|
+
id: string;
|
|
2554
|
+
/** 用户数据(普通对象,禁止 reactive 深代理) */
|
|
2555
|
+
data: RowData;
|
|
2556
|
+
/** true = 尚未分配业务 rowKey;getData 导出时 rowKey 为 null */
|
|
2557
|
+
isTransient?: boolean;
|
|
2558
|
+
/** 由 positionRows 累计计算(不变量) */
|
|
2559
|
+
rowTop: number;
|
|
2560
|
+
/** 固定行高或实测行高 */
|
|
2561
|
+
rowHeight: number;
|
|
2562
|
+
/** 行高是否为估算值(v1 固定行高时为 false) */
|
|
2563
|
+
estimated: boolean;
|
|
2564
|
+
/** 在 rowsToDisplay 中的下标 */
|
|
2565
|
+
rowIndex: number;
|
|
2566
|
+
/** Phase 17 · 行种类;缺省 `data` */
|
|
2567
|
+
rowKind?: RowKind;
|
|
2568
|
+
/** Phase 17 · detail 行:指向主行 id */
|
|
2569
|
+
masterRowId?: string;
|
|
2570
|
+
/** Phase 17 · master 行:getDetailRowData 结果缓存(内核字段) */
|
|
2571
|
+
__detailRowData?: unknown;
|
|
2572
|
+
/** Phase 17 · master 行:详情加载态 */
|
|
2573
|
+
__detailLoading?: boolean;
|
|
2574
|
+
/** Phase 17 · master 行:详情加载失败原因 */
|
|
2575
|
+
__detailLoadError?: unknown;
|
|
2576
|
+
/** 用户/API 手动锁定行高后,autoHeight 不再覆盖(Phase 15) */
|
|
2577
|
+
rowHeightPinned?: boolean;
|
|
2578
|
+
/** autoHeight 各列实测高度缓存(Phase 15 · 内核字段) */
|
|
2579
|
+
__autoHeights?: Record<string, number>;
|
|
2580
|
+
/** 排序阶段产物(后续 M5 启用) */
|
|
2581
|
+
childrenAfterSort?: RowNode[];
|
|
2582
|
+
/** Phase 18 · 是否为分组树节点(非用户 leaf 数据) */
|
|
2583
|
+
group?: boolean;
|
|
2584
|
+
/** Phase 18 · 分组字段 colId */
|
|
2585
|
+
groupField?: string;
|
|
2586
|
+
/** Phase 18 · 分组键展示值 */
|
|
2587
|
+
groupKey?: string;
|
|
2588
|
+
/** Phase 18 · 分组层级 0..n-1 */
|
|
2589
|
+
groupLevel?: number;
|
|
2590
|
+
/** Phase 18 · 稳定分组 id */
|
|
2591
|
+
groupId?: string;
|
|
2592
|
+
/** Phase 18 · 从根到本 group 的路径键(drag 守卫) */
|
|
2593
|
+
groupPathKey?: string;
|
|
2594
|
+
/** Phase 18 · leaf 行:所属 group 路径键 */
|
|
2595
|
+
leafGroupPathKey?: string;
|
|
2596
|
+
/** Phase 18 · group 阶段子节点 */
|
|
2597
|
+
childrenAfterGroup?: RowNode[];
|
|
2598
|
+
/** Phase 18 · filter 阶段后子节点 */
|
|
2599
|
+
childrenAfterFilter?: RowNode[];
|
|
2600
|
+
/** Phase 18 · 本组可见 leaf 数(filter 后) */
|
|
2601
|
+
groupLeafCount?: number;
|
|
2602
|
+
/** Phase 18 · aggregate 阶段产物 */
|
|
2603
|
+
__groupAggValues?: GroupAggValuesMap;
|
|
2604
|
+
/** Phase 18 · display 合成行:指向源 group 节点 id */
|
|
2605
|
+
sourceGroupId?: string;
|
|
2606
|
+
/** Phase 19 · getDataPath 返回值 */
|
|
2607
|
+
dataPath?: string[];
|
|
2608
|
+
/** Phase 19 · 树深度:根 = 0 */
|
|
2609
|
+
treeLevel?: number;
|
|
2610
|
+
/** Phase 19 · 父节点 rowId;根节点 undefined */
|
|
2611
|
+
parentRowId?: string;
|
|
2612
|
+
/** Phase 19 · treeBuild 后子节点 */
|
|
2613
|
+
childrenAfterTree?: RowNode[];
|
|
2614
|
+
/** Phase 19 · 是否叶节点(无更长路径前缀的其他行) */
|
|
2615
|
+
treeLeaf?: boolean;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
/** 应用事务后的节点级 diff */
|
|
2619
|
+
export declare interface RowNodeTransaction {
|
|
2620
|
+
add: RowNode[];
|
|
2621
|
+
remove: RowNode[];
|
|
2622
|
+
update: RowNode[];
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
export declare interface RowsAddedEvent {
|
|
2626
|
+
rows: RowMutationRowSnapshot[];
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
/** 行选择配置(Phase 19 · groupSelectsChildren) */
|
|
2630
|
+
export declare interface RowSelectionConfig {
|
|
2631
|
+
mode: RowSelectionMode;
|
|
2632
|
+
/**
|
|
2633
|
+
* tree 模式下选中父节点是否级联选中子孙。默认 `true`。
|
|
2634
|
+
* 对标 AG Grid rowSelection.groupSelectsChildren。
|
|
2635
|
+
*/
|
|
2636
|
+
groupSelectsChildren?: boolean;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
export declare type RowSelectionInput = RowSelectionMode | false | RowSelectionConfig;
|
|
2640
|
+
|
|
2641
|
+
export declare type RowSelectionMode = 'single' | 'multiple';
|
|
2642
|
+
|
|
2643
|
+
/** 纵向合并行数(≥1);缺省视为 1;仅表体 */
|
|
2644
|
+
export declare type RowSpanFn = (params: CellSpanParams) => number;
|
|
2645
|
+
|
|
2646
|
+
/** 纵向 span 解析结果(head / 覆盖态) */
|
|
2647
|
+
export declare interface RowSpanHeadInfo {
|
|
2648
|
+
head: RowNode;
|
|
2649
|
+
rowSpan: number;
|
|
2650
|
+
/** true = 当前格被上方 head 覆盖,不应渲染 */
|
|
2651
|
+
covered: boolean;
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
export declare interface RowsRemovedEvent {
|
|
2655
|
+
rows: RowMutationRemovedSnapshot[];
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
/** Grid 级:对象 = 全表每行同一样式;函数 = 按行 */
|
|
2659
|
+
export declare type RowStyle<TData = RowData> = CellStyle | RowStyleFn<TData>;
|
|
2660
|
+
|
|
2661
|
+
export declare type RowStyleFn<TData = RowData> = (params: RowStyleParams<TData>) => CellStyle | null | undefined;
|
|
2662
|
+
|
|
2663
|
+
export declare interface RowStyleParams<TData = RowData> {
|
|
2664
|
+
data: TData;
|
|
2665
|
+
rowId: BusinessRowId;
|
|
2666
|
+
rowIndex: number;
|
|
2667
|
+
/** display 行 kind · 合成行 fn 不应被调用(管线内 guard) */
|
|
2668
|
+
rowKind?: RowKind;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
/** 用户侧事务输入 */
|
|
2672
|
+
export declare interface RowTransaction {
|
|
2673
|
+
add?: RowTransactionAddItem[];
|
|
2674
|
+
remove?: RowData[] | string[];
|
|
2675
|
+
update?: RowData[];
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
export declare type RowTransactionAddItem = RowData | AddRowPayload;
|
|
2679
|
+
|
|
2680
|
+
export declare interface RowValidationFailedEvent {
|
|
2681
|
+
rowId: BusinessRowId;
|
|
2682
|
+
rowIndex: number;
|
|
2683
|
+
failedColId: string;
|
|
2684
|
+
cellErrors?: Array<{
|
|
2685
|
+
colId: string;
|
|
2686
|
+
errors: string[];
|
|
2687
|
+
}>;
|
|
2688
|
+
rowErrors?: string[];
|
|
2689
|
+
mode: InvalidEditValueMode;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
/** rowValidator 结构化返回:指定错误应标红的列 */
|
|
2693
|
+
export declare interface RowValidationResult {
|
|
2694
|
+
errors: string[];
|
|
2695
|
+
colIds?: string[];
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
export declare type RowValidator = (params: RowValidatorParams) => ValidationErrors | RowValidationResult | Promise<ValidationErrors | RowValidationResult>;
|
|
2699
|
+
|
|
2700
|
+
export declare interface RowValidatorParams {
|
|
2701
|
+
rowId: BusinessRowId;
|
|
2702
|
+
rowIndex: number;
|
|
2703
|
+
data: RowData;
|
|
2704
|
+
draftValues: ReadonlyMap<string, unknown>;
|
|
2705
|
+
signal: AbortSignal;
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
export declare interface RowValueChangedEvent {
|
|
2709
|
+
rowId: BusinessRowId;
|
|
2710
|
+
rowIndex: number;
|
|
2711
|
+
rowNode: RowNode;
|
|
2712
|
+
data: RowNode['data'];
|
|
2713
|
+
changes: RowEditChange[];
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
/** 行选择列行级可选判定;省略时全部可选 */
|
|
2717
|
+
export declare type SelectableFn = (params: SelectableParams) => boolean;
|
|
2718
|
+
|
|
2719
|
+
/** 判定行 checkbox 是否可勾选时传入的上下文 */
|
|
2720
|
+
export declare interface SelectableParams {
|
|
2721
|
+
/** 当前行数据(RowData 快照) */
|
|
2722
|
+
data: RowData;
|
|
2723
|
+
rowId: BusinessRowId;
|
|
2724
|
+
rowIndex: number;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
export declare interface SelectionChangedEvent {
|
|
2728
|
+
selectedRowIds: BusinessRowId[];
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
/** 行选择列配置 */
|
|
2732
|
+
export declare interface SelectionColumnOptions {
|
|
2733
|
+
/** 列宽 px;默认 40;小于 40 时钳制为 40 */
|
|
2734
|
+
width?: number;
|
|
2735
|
+
/** 表头全选 checkbox 的 aria-label;默认「全选」 */
|
|
2736
|
+
selectAllLabel?: string;
|
|
2737
|
+
/** 行 checkbox 的 aria-label 工厂 */
|
|
2738
|
+
rowLabel?: (rowIndex: number) => string;
|
|
2739
|
+
/** 表头水平对齐;默认 center */
|
|
2740
|
+
headerAlign?: GridHorizontalAlign;
|
|
2741
|
+
/** 表头垂直对齐;默认 center */
|
|
2742
|
+
headerValign?: GridVerticalAlign;
|
|
2743
|
+
/** 表体水平对齐;默认 center */
|
|
2744
|
+
align?: GridHorizontalAlign;
|
|
2745
|
+
/** 表体垂直对齐;默认 center */
|
|
2746
|
+
valign?: GridVerticalAlign;
|
|
2747
|
+
/** footer 水平对齐;默认 center */
|
|
2748
|
+
footerAlign?: GridHorizontalAlign;
|
|
2749
|
+
/** footer 垂直对齐;默认 center */
|
|
2750
|
+
footerValign?: GridVerticalAlign;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
export declare interface SetCellCommentParams<TData = RowData, TMetadata = unknown> extends CellCommentParams<TData> {
|
|
2754
|
+
/** undefined → 删除批注 */
|
|
2755
|
+
comment: CellComment<TMetadata> | undefined;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
/** hierarchy 模式下 managed drag 将新路径写回 row.data */
|
|
2759
|
+
export declare type SetDataPathFn = (params: SetDataPathParams) => void;
|
|
2760
|
+
|
|
2761
|
+
export declare interface SetDataPathParams {
|
|
2762
|
+
data: RowData;
|
|
2763
|
+
dataPath: string[];
|
|
2764
|
+
treeLevel: number;
|
|
2765
|
+
previousPath: readonly string[];
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
export declare interface SetRowHeightChange {
|
|
2769
|
+
rowId: string;
|
|
2770
|
+
height: number;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
export declare interface SizeColumnsToContentColumnLimit {
|
|
2774
|
+
colId: string;
|
|
2775
|
+
minWidth?: number;
|
|
2776
|
+
maxWidth?: number;
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
export declare interface SizeColumnsToContentStrategy {
|
|
2780
|
+
type: 'fitCellContents';
|
|
2781
|
+
skipHeader?: boolean;
|
|
2782
|
+
colIds?: readonly string[];
|
|
2783
|
+
defaultMinWidth?: number;
|
|
2784
|
+
defaultMaxWidth?: number;
|
|
2785
|
+
columnLimits?: SizeColumnsToContentColumnLimit[];
|
|
2786
|
+
/** auto-size 后按比例放大以填满视口 */
|
|
2787
|
+
scaleUpToFitGridWidth?: boolean;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
export declare interface SizeColumnsToFitColumnLimit {
|
|
2791
|
+
colId: string;
|
|
2792
|
+
minWidth?: number;
|
|
2793
|
+
maxWidth?: number;
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
export declare interface SizeColumnsToFitGridStrategy {
|
|
2797
|
+
type: 'fitGridWidth';
|
|
2798
|
+
defaultMinWidth?: number;
|
|
2799
|
+
defaultMaxWidth?: number;
|
|
2800
|
+
columnLimits?: SizeColumnsToFitColumnLimit[];
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
/** 对标 AG Grid ISizeColumnsToFitParams */
|
|
2804
|
+
export declare interface SizeColumnsToFitParams {
|
|
2805
|
+
/** 显式目标宽度(px);缺省为视口宽度 */
|
|
2806
|
+
gridWidth?: number;
|
|
2807
|
+
defaultMinWidth?: number;
|
|
2808
|
+
defaultMaxWidth?: number;
|
|
2809
|
+
columnLimits?: SizeColumnsToFitColumnLimit[];
|
|
2810
|
+
/** 仅调整指定列;缺省为全部非 suppressSizeToFit 用户列 */
|
|
2811
|
+
colIds?: readonly string[];
|
|
2812
|
+
/** 仅放大列宽以填满视口,不缩小 */
|
|
2813
|
+
onlyScaleUp?: boolean;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
export declare interface SizeColumnsToFitProvidedWidthStrategy {
|
|
2817
|
+
type: 'fitProvidedWidth';
|
|
2818
|
+
width: number;
|
|
2819
|
+
defaultMinWidth?: number;
|
|
2820
|
+
defaultMaxWidth?: number;
|
|
2821
|
+
columnLimits?: SizeColumnsToFitColumnLimit[];
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
export declare interface SortChangedEvent {
|
|
2825
|
+
sortModel: SortModelItem[];
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
export declare type SortDirection = 'asc' | 'desc';
|
|
2829
|
+
|
|
2830
|
+
export declare interface SortModelItem {
|
|
2831
|
+
colId: string;
|
|
2832
|
+
sort: SortDirection;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
/**
|
|
2836
|
+
* 相邻两行是否应合并进同一纵向 span。
|
|
2837
|
+
* 返回 true 表示合并。
|
|
2838
|
+
*/
|
|
2839
|
+
export declare type SpanRowsFunc = (params: SpanRowsParams) => boolean;
|
|
2840
|
+
|
|
2841
|
+
/** spanRows 自定义比较入参 */
|
|
2842
|
+
export declare interface SpanRowsParams {
|
|
2843
|
+
nodeA: {
|
|
2844
|
+
rowId: string;
|
|
2845
|
+
data: RowData;
|
|
2846
|
+
rowIndex: number;
|
|
2847
|
+
};
|
|
2848
|
+
nodeB: {
|
|
2849
|
+
rowId: string;
|
|
2850
|
+
data: RowData;
|
|
2851
|
+
rowIndex: number;
|
|
2852
|
+
};
|
|
2853
|
+
valueA: unknown;
|
|
2854
|
+
valueB: unknown;
|
|
2855
|
+
colId: string;
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
/** 传给 #status-bar 等插槽的 scoped context */
|
|
2859
|
+
export declare interface StatusBarContext {
|
|
2860
|
+
/** GridApi 实例(与 expose 一致) */
|
|
2861
|
+
api: GridApi | undefined;
|
|
2862
|
+
/** 源数据总行数(过滤前) */
|
|
2863
|
+
totalRowCount: number;
|
|
2864
|
+
/** 当前展示行数(rowsToDisplay · 同 getMetrics().rowCount) */
|
|
2865
|
+
displayedRowCount: number;
|
|
2866
|
+
/** 是否处于过滤态 */
|
|
2867
|
+
isFiltered: boolean;
|
|
2868
|
+
/** 当前选中行数;rowSelection=false 时为 0 */
|
|
2869
|
+
selectedRowCount: number;
|
|
2870
|
+
/** 是否启用行选择 */
|
|
2871
|
+
rowSelectionEnabled: boolean;
|
|
2872
|
+
/** cellSelection 是否启用 */
|
|
2873
|
+
cellSelectionEnabled: boolean;
|
|
2874
|
+
/** 当前选区聚合;无选区或未启用时为 null */
|
|
2875
|
+
cellSelectionAggregation: CellSelectionAggregation | null;
|
|
2876
|
+
/** 平均值 / 求和展示小数位数(已归一) */
|
|
2877
|
+
statusBarRangeAggregationPrecision: ResolvedStatusBarRangeAggregationPrecision;
|
|
2878
|
+
/** 最近一次 metrics(Playground / 高级自定义用) */
|
|
2879
|
+
metrics: GridMetrics | undefined;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
/** 状态栏高度:`'auto'` 跟随 size preset;number 为自定义 px */
|
|
2883
|
+
export declare type StatusBarHeightInput = 'auto' | number;
|
|
2884
|
+
|
|
2885
|
+
/** 框选聚合 panel 在状态栏中的位置;默认 `right` */
|
|
2886
|
+
export declare type StatusBarRangeAggregationPosition = 'left' | 'right';
|
|
2887
|
+
|
|
2888
|
+
/** 简写 number 同时作用于平均值 / 求和;对象可分别指定 */
|
|
2889
|
+
export declare type StatusBarRangeAggregationPrecisionInput = number | {
|
|
2890
|
+
average?: number;
|
|
2891
|
+
sum?: number;
|
|
2892
|
+
};
|
|
2893
|
+
|
|
2894
|
+
/** 表尾汇总行稳定 rowId(CellRendererParams / 池化键) */
|
|
2895
|
+
export declare const SUMMARY_ROW_ID = "__mg_summary__";
|
|
2896
|
+
|
|
2897
|
+
/** 表尾汇总行 rowIndex 占位(非 rowsToDisplay 下标) */
|
|
2898
|
+
export declare const SUMMARY_ROW_INDEX = -1;
|
|
2899
|
+
|
|
2900
|
+
export declare type SummaryAgg = SummaryAggBuiltin | SummaryAggFn;
|
|
2901
|
+
|
|
2902
|
+
/** 内置列级聚合函数名 */
|
|
2903
|
+
export declare type SummaryAggBuiltin = 'sum' | 'avg' | 'min' | 'max' | 'count';
|
|
2904
|
+
|
|
2905
|
+
/** 列级自定义聚合 */
|
|
2906
|
+
export declare type SummaryAggFn = (rows: readonly RowNode[], column: Column) => unknown;
|
|
2907
|
+
|
|
2908
|
+
/** 全局汇总方法:返回 colId → 展示值(优先级高于列级 summaryAgg) */
|
|
2909
|
+
export declare type SummaryMethod = (params: SummaryMethodParams) => Record<string, string | number | null | undefined>;
|
|
2910
|
+
|
|
2911
|
+
/** 全局汇总方法入参 */
|
|
2912
|
+
export declare interface SummaryMethodParams {
|
|
2913
|
+
columns: readonly Column[];
|
|
2914
|
+
/** 按 summaryScope 选取的 RowData 快照 */
|
|
2915
|
+
data: RowData[];
|
|
2916
|
+
rows: readonly RowNode[];
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
/** 汇总计算范围 */
|
|
2920
|
+
export declare type SummaryScope = 'displayed' | 'all';
|
|
2921
|
+
|
|
2922
|
+
export declare type SuppressCellCommentFn<TData = RowData> = (params: SuppressCellCommentParams<TData>) => boolean;
|
|
2923
|
+
|
|
2924
|
+
export declare interface SuppressCellCommentParams<TData = RowData> {
|
|
2925
|
+
data: TData;
|
|
2926
|
+
rowId: BusinessRowId;
|
|
2927
|
+
colId: string;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
export declare type SuppressPasteFn = (row: RowData) => boolean;
|
|
2931
|
+
|
|
2932
|
+
/** 文本列默认算子集 */
|
|
2933
|
+
export declare type TextFilterType = 'contains' | 'notContains' | 'equals' | 'notEqual' | 'startsWith' | 'endsWith' | 'blank' | 'notBlank';
|
|
2934
|
+
|
|
2935
|
+
/** 自定义 tooltip 工厂(对标 CellRendererFn · 块 9) */
|
|
2936
|
+
export declare type TooltipComponentFactory = (params: ITooltipParams, mountEl: HTMLElement) => ITooltipComp | void;
|
|
2937
|
+
|
|
2938
|
+
export declare type TooltipComponentType = TooltipComponentFactory;
|
|
2939
|
+
|
|
2940
|
+
export declare type TooltipLocation = 'cell' | 'header' | 'footer' | 'statusBar';
|
|
2941
|
+
|
|
2942
|
+
export declare type TooltipShowMode = 'whenTruncated' | 'always' | 'never';
|
|
2943
|
+
|
|
2944
|
+
export declare type TooltipValueGetter<TData = RowData> = (params: TooltipValueGetterParams<TData>) => string | null | undefined;
|
|
2945
|
+
|
|
2946
|
+
export declare interface TooltipValueGetterParams<TData = RowData> {
|
|
2947
|
+
rowId: string;
|
|
2948
|
+
colId: string;
|
|
2949
|
+
data: TData | undefined;
|
|
2950
|
+
value: unknown;
|
|
2951
|
+
valueFormatted: string;
|
|
2952
|
+
column: Column;
|
|
2953
|
+
location: TooltipLocation;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
export declare interface TreeChildrenLoadedEvent {
|
|
2957
|
+
parentRowId: BusinessRowId;
|
|
2958
|
+
children: RowData[];
|
|
2959
|
+
childCount: number;
|
|
2960
|
+
source: TreeTableSource;
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
export declare interface TreeChildrenLoadFailedEvent {
|
|
2964
|
+
parentRowId: BusinessRowId;
|
|
2965
|
+
reason?: string;
|
|
2966
|
+
aborted?: boolean;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
export declare interface TreeChildrenLoadingEvent {
|
|
2970
|
+
parentRowId: BusinessRowId;
|
|
2971
|
+
dataPath: string[];
|
|
2972
|
+
treeLevel: number;
|
|
2973
|
+
source: TreeTableSource;
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
export declare type TreeDisplayType = 'singleColumn';
|
|
2977
|
+
|
|
2978
|
+
/** 树形行拖拽范围:默认仅同级;hierarchy 允许跨父级改挂 */
|
|
2979
|
+
export declare type TreeDragScope = 'siblings' | 'hierarchy';
|
|
2980
|
+
|
|
2981
|
+
export declare interface TreeNodeOpenedEvent {
|
|
2982
|
+
rowId: BusinessRowId;
|
|
2983
|
+
expanded: boolean;
|
|
2984
|
+
level: number;
|
|
2985
|
+
dataPath: string[];
|
|
2986
|
+
source: TreeTableSource;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
export declare type TreeTableSource = 'api' | 'ui';
|
|
2990
|
+
|
|
2991
|
+
export declare type TreeValueGetterFn = (params: TreeValueGetterParams) => string;
|
|
2992
|
+
|
|
2993
|
+
export declare interface TreeValueGetterParams {
|
|
2994
|
+
data: RowData;
|
|
2995
|
+
dataPath: string[];
|
|
2996
|
+
treeLevel: number;
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
/** Grid 默认行高热更新参数(MagicGrid `rowHeight` prop 等) */
|
|
3000
|
+
export declare interface UpdateRowDimensionsParams {
|
|
3001
|
+
rowHeight?: number;
|
|
3002
|
+
rowHeightMin?: number;
|
|
3003
|
+
rowHeightMax?: number;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
export declare interface ValidateCellsOptions {
|
|
3007
|
+
/** 待校验的单元格列表 */
|
|
3008
|
+
cells: GridCellPosition[];
|
|
3009
|
+
signal?: AbortSignal;
|
|
3010
|
+
/** 是否更新 invalid 视觉反馈,默认 true */
|
|
3011
|
+
showFeedback?: boolean;
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
export declare interface ValidateGridOptions {
|
|
3015
|
+
/** 指定行 id;省略则校验全表 */
|
|
3016
|
+
rowIds?: RowId[];
|
|
3017
|
+
signal?: AbortSignal;
|
|
3018
|
+
/** 是否更新 invalid 视觉反馈,默认 true */
|
|
3019
|
+
showFeedback?: boolean;
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
export declare interface ValidateRowsOptions {
|
|
3023
|
+
/** 待校验的行 id 列表 */
|
|
3024
|
+
rowIds: RowId[];
|
|
3025
|
+
signal?: AbortSignal;
|
|
3026
|
+
/** 是否更新 invalid 视觉反馈,默认 true */
|
|
3027
|
+
showFeedback?: boolean;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
/** 校验错误:null/undefined 表示通过;字符串数组表示失败 */
|
|
3031
|
+
export declare type ValidationErrors = string[] | null | undefined;
|
|
3032
|
+
|
|
3033
|
+
/** async-validator 规则 */
|
|
3034
|
+
export declare type ValidationRule = Rule;
|
|
3035
|
+
|
|
3036
|
+
export declare type ValidationRules = ValidationRule | MagicValidationRule | (ValidationRule | MagicValidationRule)[];
|
|
3037
|
+
|
|
3038
|
+
export { }
|