@taocompany/magic-grid 0.1.6 → 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 +1321 -226
- 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 +191 -167
- package/dist/components/MagicGrid/MagicGrid.vue.d.ts.map +1 -1
- package/dist/components/MagicGrid/resolveMagicGridDefaults.d.ts +1 -1
- package/dist/components/MagicGrid/resolveMagicGridDefaults.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/hasStatusBarAggregationContent.d.ts +4 -0
- package/dist/components/StatusBar/hasStatusBarAggregationContent.d.ts.map +1 -0
- 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/columnModel.d.ts.map +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/cellRangeDragSelect.d.ts +1 -1
- package/dist/core/grid/cellRangeDragSelect.d.ts.map +1 -1
- package/dist/core/grid/grid.d.ts +15 -13
- package/dist/core/grid/grid.d.ts.map +1 -1
- package/dist/core/grid/gridColumnLayout.d.ts +10 -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 +14 -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 +3 -3
- 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/cellRangeSelection.d.ts +15 -23
- package/dist/core/types/cellRangeSelection.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 +6 -0
- package/dist/core/types/columnAvailability.d.ts.map +1 -0
- 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 +5 -4
- 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 +2 -2
- package/dist/core/types/rowGrouping.d.ts.map +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 +5 -5
- 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 +3746 -3652
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +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 +331 -244
- package/dist/types/magic-grid.d.ts.map +1 -1
- package/dist/types/{statusBar.d.ts → status-bar.d.ts} +7 -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
|
@@ -1,154 +1,212 @@
|
|
|
1
|
+
import { SummaryAgg, SummaryMethod, SummaryScope } from '../core/types/summary';
|
|
2
|
+
import { GridHorizontalAlign, GridVerticalAlign } from '../core/types/align';
|
|
3
|
+
import { IndexColumnOptions } from '../core/types/indexColumn';
|
|
4
|
+
import { SelectionColumnOptions } from '../core/types/selectionColumn';
|
|
5
|
+
import { SelectableFn } from '../core/selection/selectable';
|
|
6
|
+
import { ColumnComparatorFn } from '../core/types/columnSort';
|
|
7
|
+
import { SortModelItem } from '../core/types';
|
|
8
|
+
import { ColumnDataFilterType } from '../core/types/columnFilter';
|
|
9
|
+
import { FilterParams } from '../core/types/pipeline';
|
|
10
|
+
import { ColSpanFn, RowSpanFn, SpanRowsFunc } from '../core/types/cellSpan';
|
|
11
|
+
import { CellRendererFn } from '../core/types/cellRenderer';
|
|
12
|
+
import { CellEditorDef, CellEditorParams, CellEditType, CellEditorFn, CellEditBehavior } from '../core/types/cellEditor';
|
|
13
|
+
import { CellEditorMode } from '../core/types/cellEditorMode';
|
|
14
|
+
import { CellValidator, ValidationRules, InvalidEditValueMode, RowValidator } from '../core/types/validation';
|
|
15
|
+
import { SuppressCellCommentFn, CellCommentsDataSource, CellCommentTrigger } from '../core/types/cellComment';
|
|
16
|
+
import { CellDisabledFn, IsRowDisabledFn } from '../core/types/cellDisable';
|
|
17
|
+
import { CellStyle, CellStyleFn, RowStyle } from '../core/types/cellColor';
|
|
18
|
+
import { TooltipValueGetter, HeaderTooltipValueGetter, TooltipComponentType, TooltipShowMode } from '../core/types/overflowTooltip';
|
|
19
|
+
import { RowSelectionInput } from '../core/types/rowSelectionOptions';
|
|
20
|
+
import { FilterSetValueMode, FilterSetDateLayoutMode } from '../core/types/filterGridOptions';
|
|
21
|
+
import { AsyncRowMutationHandlers } from '../core/types/rowMutationAsync';
|
|
22
|
+
import { AutoSizeStrategy } from '../core/types/columnAutosize';
|
|
23
|
+
import { StatusBarHeightInput } from '../core/theme/gridSize';
|
|
24
|
+
import { RowDragCommitMode, RowDragCommitHandler } from '../core/types/rowDrag';
|
|
25
|
+
import { GetRowHeightFn } from '../core/types/rowHeight';
|
|
26
|
+
import { IsRowMasterFn, DetailRowHeightFn, GetDetailRowDataFn, DetailCellRendererFn } from '../core/types/rowExpansion';
|
|
27
|
+
import { GroupDisplayType, GroupKeyCreatorFn, GroupComparatorFn, GroupCellRendererFn } from '../core/types/rowGrouping';
|
|
28
|
+
import { TreeDragScope, SetDataPathFn, GetDataPathFn, TreeValueGetterFn, TreeDisplayType, HasTreeChildrenFn, LoadTreeChildrenFn } from '../core/types/treeTable';
|
|
29
|
+
import { ProcessCellForClipboardFn, ProcessCellFromClipboardFn, ProcessDataFromClipboardFn } from '../core/types/cellClipboard';
|
|
30
|
+
import { CellSelectionOptions } from '../core/types/cellRangeSelection';
|
|
31
|
+
import { OverlayType, OverlayComponentType } from '../core/types/emptyState';
|
|
32
|
+
import { StatusBarRangeAggregationPosition, StatusBarRangeAggregationPrecisionInput } from './status-bar';
|
|
33
|
+
import { GridApi } from '../core/api/gridApi';
|
|
1
34
|
/** 用户行数据:保持普通对象,禁止 reactive 深代理 */
|
|
2
35
|
export type RowData = Record<string, unknown>;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
36
|
+
/**
|
|
37
|
+
* 边框样式(默认 `border`)
|
|
38
|
+
* - `border`:表头 / 表体单元格全网格线
|
|
39
|
+
* - `none`:无单元格线;表头与表体保留底部分隔线
|
|
40
|
+
* - `linear`:表头 / 表体单元格仅底部分隔线
|
|
41
|
+
*/
|
|
42
|
+
export type GridBorder = 'border' | 'none' | 'linear';
|
|
43
|
+
/** 主题 preset:`light` 亮色(默认);`dark` 暗色语义 token */
|
|
44
|
+
export type GridTheme = 'light' | 'dark';
|
|
45
|
+
/** 尺寸 preset;rowHeight / headerHeight 未显式传入时由 size 推导 */
|
|
46
|
+
export type GridSize = 'mini' | 'small' | 'default' | 'large';
|
|
9
47
|
/** 圆角:false/0 无圆角;true 跟随 size;number 自定义 px。默认 false */
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
export type SummaryAgg
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
export type
|
|
35
|
-
export type
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
38
|
-
export type
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
42
|
-
export
|
|
48
|
+
export type GridRounded = number | boolean;
|
|
49
|
+
export type { TreeDragScope, SetDataPathParams, SetDataPathFn, GetDataPathFn, TreeValueGetterFn, TreeDisplayType, HasTreeChildrenFn, LoadTreeChildrenFn, } from '../core/types/treeTable';
|
|
50
|
+
export type { SummaryScope, SummaryAgg, SummaryAggBuiltin, SummaryAggFn, SummaryMethod, SummaryMethodParams, } from '../core/types/summary';
|
|
51
|
+
export type { GridHorizontalAlign, GridVerticalAlign } from '../core/types/align';
|
|
52
|
+
export type { IndexColumnOptions } from '../core/types/indexColumn';
|
|
53
|
+
export type { SelectionColumnOptions } from '../core/types/selectionColumn';
|
|
54
|
+
export type { SelectableParams, SelectableFn } from '../core/selection/selectable';
|
|
55
|
+
export type { IsRowDisabledParams, IsRowDisabledFn, CellDisabledParams, CellDisabledFn, } from '../core/types/cellDisable';
|
|
56
|
+
export type { CellStyle, CellStyleFn, CellStyleParams, RowStyle, RowStyleFn, RowStyleParams, } from '../core/types/cellColor';
|
|
57
|
+
export type { ColumnHiddenChangedEvent, ColumnHiddenChangedSource, } from '../core/types/columnVisibility';
|
|
58
|
+
export type { TooltipShowMode, TooltipValueGetter, TooltipValueGetterParams, HeaderTooltipValueGetter, HeaderTooltipValueGetterParams, TooltipComponentType, } from '../core/types/overflowTooltip';
|
|
59
|
+
export type { ColumnComparatorFn } from '../core/types/columnSort';
|
|
60
|
+
export type { SortModelItem } from '../core/types';
|
|
61
|
+
export type { ColumnDataFilterType } from '../core/types/columnFilter';
|
|
62
|
+
export type { FilterParams, ColumnFilter } from '../core/types/pipeline';
|
|
63
|
+
export type { ColSpanFn, RowSpanFn, SpanRowsFunc } from '../core/types/cellSpan';
|
|
64
|
+
export type { CellEditorDef, CellEditorParams, CellEditType, CellEditorFn, CellEditBehavior, } from '../core/types/cellEditor';
|
|
65
|
+
export type { CellEditorMode } from '../core/types/cellEditorMode';
|
|
66
|
+
export type { CellValidator, ValidationRules, InvalidEditValueMode, RowValidator, } from '../core/types/validation';
|
|
67
|
+
export type { SuppressCellCommentFn, CellCommentsDataSource, CellCommentTrigger, } from '../core/types/cellComment';
|
|
68
|
+
export type { RowSelectionInput } from '../core/types/rowSelectionOptions';
|
|
69
|
+
export type { FilterSetValueMode, FilterSetDateLayoutMode } from '../core/types/filterGridOptions';
|
|
70
|
+
export type { AsyncRowMutationHandlers } from '../core/types/rowMutationAsync';
|
|
71
|
+
export type { AutoSizeStrategy } from '../core/types/columnAutosize';
|
|
72
|
+
export type { StatusBarHeightInput } from '../core/theme/gridSize';
|
|
73
|
+
export type { RowDragCommitMode, RowDragCommitHandler } from '../core/types/rowDrag';
|
|
74
|
+
export type { GetRowHeightFn } from '../core/types/rowHeight';
|
|
75
|
+
export type { IsRowMasterFn, DetailRowHeightFn, GetDetailRowDataFn, DetailCellRendererFn, } from '../core/types/rowExpansion';
|
|
76
|
+
export type { GroupDisplayType, GroupKeyCreatorFn, GroupComparatorFn, GroupCellRendererFn, } from '../core/types/rowGrouping';
|
|
77
|
+
export type { ProcessCellForClipboardFn, ProcessCellFromClipboardFn, ProcessDataFromClipboardFn, } from '../core/types/cellClipboard';
|
|
78
|
+
export type { CellSelectionOptions } from '../core/types/cellRangeSelection';
|
|
79
|
+
export type { OverlayType, OverlayComponentType } from '../core/types/emptyState';
|
|
80
|
+
export type { StatusBarRangeAggregationPosition, StatusBarRangeAggregationPrecisionInput, } from './status-bar';
|
|
81
|
+
/** 列定义;`TData` 为行数据类型,用于 prop / 回调参数类型推导 */
|
|
82
|
+
export interface ColumnDef<TData extends RowData = RowData> {
|
|
43
83
|
/** 列唯一标识,缺省等于 prop */
|
|
44
84
|
key?: string;
|
|
45
85
|
/** 数据字段 */
|
|
46
|
-
prop?: string
|
|
86
|
+
prop?: Extract<keyof TData, string>;
|
|
47
87
|
/** 表头文案 */
|
|
48
88
|
label?: string;
|
|
89
|
+
/**
|
|
90
|
+
* 列是否有效;默认 true。
|
|
91
|
+
* 为 false 时该列不存在于表格中(不参与列模型与绘制);
|
|
92
|
+
* 与 hidden 不同——hidden 仍保留列,仅不渲染。
|
|
93
|
+
*/
|
|
94
|
+
available?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 是否隐藏该列(不渲染 header/body/footer · 不参与布局)。
|
|
97
|
+
* 默认 false(可见)。系统列忽略此配置。
|
|
98
|
+
*/
|
|
99
|
+
hidden?: boolean;
|
|
49
100
|
/** 尺寸 */
|
|
50
101
|
width?: number;
|
|
102
|
+
/** 列最小宽度(px) */
|
|
51
103
|
minWidth?: number;
|
|
104
|
+
/** 列最大宽度(px) */
|
|
52
105
|
maxWidth?: number;
|
|
106
|
+
/** flex 布局权重;与 width 互斥时 flex 参与剩余空间分配 */
|
|
53
107
|
flex?: number;
|
|
54
|
-
/** 行为(后续里程碑逐步实现) */
|
|
55
108
|
/** 是否允许表头排序;缺省继承 Grid `sortable`(默认 false) */
|
|
56
109
|
sortable?: boolean;
|
|
57
110
|
/**
|
|
58
111
|
* 自定义排序比较器;入参为两行的单元格原始值(经 valueGetter)。
|
|
59
|
-
* 须返回 asc 语义比较结果;desc 由
|
|
112
|
+
* 须返回 asc 语义比较结果;desc 由 Grid 统一取反。
|
|
60
113
|
*/
|
|
61
|
-
comparator?:
|
|
114
|
+
comparator?: ColumnComparatorFn;
|
|
62
115
|
/** 是否允许列筛选;缺省继承 Grid `filterable`(默认 false) */
|
|
63
116
|
filterable?: boolean;
|
|
64
117
|
/** 列筛选数据类型;默认 text */
|
|
65
|
-
filterType?:
|
|
118
|
+
filterType?: ColumnDataFilterType;
|
|
66
119
|
/** 列级 filter 参数(如 caseSensitive) */
|
|
67
|
-
filterParams?:
|
|
120
|
+
filterParams?: FilterParams;
|
|
121
|
+
/** 筛选用取值;缺省 formatter → valueGetter → prop */
|
|
68
122
|
/** 筛选用取值;缺省 formatter → valueGetter → prop */
|
|
69
|
-
filterFormatter?: (row:
|
|
70
|
-
|
|
123
|
+
filterFormatter?: (row: TData) => unknown;
|
|
124
|
+
/** 是否可编辑;可函数按行判断 */
|
|
125
|
+
editable?: boolean | ((row: TData) => boolean);
|
|
71
126
|
/** 是否允许拖拽调整列宽;缺省继承 Grid `resizable`(默认 true) */
|
|
72
127
|
resizable?: boolean;
|
|
73
128
|
/** 禁止 resize 把柄 dblclick / API auto-size;对标 AG Grid suppressAutoSize */
|
|
74
129
|
suppressAutoSize?: boolean;
|
|
75
130
|
/** 禁止参与 sizeColumnsToFit;对标 AG Grid suppressSizeToFit */
|
|
76
131
|
suppressSizeToFit?: boolean;
|
|
132
|
+
/** 列固定:left / right;null 或不传为不固定 */
|
|
77
133
|
fixed?: 'left' | 'right' | null;
|
|
78
134
|
/** 是否允许表头拖拽重排;默认继承 grid.columnMovable */
|
|
79
135
|
movable?: boolean;
|
|
80
|
-
/** 该列单元格作为行拖拽起点;默认 false
|
|
136
|
+
/** 该列单元格作为行拖拽起点;默认 false */
|
|
81
137
|
rowDrag?: boolean;
|
|
82
138
|
/**
|
|
83
|
-
*
|
|
139
|
+
* 在该列渲染 expand/collapse 控件;需 Grid `masterDetail: true`。
|
|
84
140
|
* 与 `showExpandColumn` 可并存(列级优先展示位置由列序决定)。
|
|
85
141
|
*/
|
|
86
142
|
rowExpand?: boolean;
|
|
87
143
|
/**
|
|
88
|
-
*
|
|
144
|
+
* 该列参与行分组;需 Grid `rowGrouping: true`。
|
|
89
145
|
* 与 `rowGroupIndex` 控制多级顺序。
|
|
90
146
|
*/
|
|
91
147
|
rowGroup?: boolean;
|
|
92
|
-
/**
|
|
148
|
+
/** 多级分组顺序(小者优先);缺省按列定义顺序 */
|
|
93
149
|
rowGroupIndex?: number;
|
|
94
|
-
/**
|
|
150
|
+
/** 分组 footer 行的聚合;缺省不在该列展示 group 汇总 */
|
|
95
151
|
groupAgg?: SummaryAgg;
|
|
96
152
|
/**
|
|
97
|
-
*
|
|
153
|
+
* 在该用户列渲染 groupHeader 单元格(chevron / 缩进 / 键值)。
|
|
98
154
|
* 与系统 auto group 列二选一;不可用于系统列。
|
|
99
155
|
*/
|
|
100
156
|
showGroupHeaderCell?: boolean;
|
|
101
157
|
/**
|
|
102
|
-
*
|
|
158
|
+
* 在该用户列渲染 groupFooter 标签(如「小计」)。
|
|
103
159
|
* 聚合数值仍由 `groupAgg` 列展示。
|
|
104
160
|
*/
|
|
105
161
|
showGroupFooterCell?: boolean;
|
|
106
|
-
/**
|
|
162
|
+
/** 覆盖 Grid `groupFooterLabel` 的本列小计文案 */
|
|
107
163
|
groupFooterLabel?: string;
|
|
108
|
-
/** 该列内容撑开行高(与其他 autoHeight 列取 max);默认 false
|
|
164
|
+
/** 该列内容撑开行高(与其他 autoHeight 列取 max);默认 false */
|
|
109
165
|
autoHeight?: boolean;
|
|
110
166
|
/**
|
|
111
|
-
*
|
|
167
|
+
* 横向合并列数(≥1);表体与表尾共用,用 `params.isSummaryRow` 分支。
|
|
112
168
|
* 需 Grid `enableCellSpan: true`。系统列忽略。
|
|
113
169
|
*/
|
|
114
|
-
colSpan?:
|
|
170
|
+
colSpan?: ColSpanFn;
|
|
115
171
|
/**
|
|
116
|
-
*
|
|
172
|
+
* 纵向合并行数(≥1);仅表体。与 `spanRows` 互斥(本字段优先)。
|
|
117
173
|
* 需 Grid `enableCellSpan: true`。系统列忽略。
|
|
118
174
|
*/
|
|
119
|
-
rowSpan?:
|
|
175
|
+
rowSpan?: RowSpanFn;
|
|
120
176
|
/**
|
|
121
|
-
*
|
|
177
|
+
* 相邻等值自动纵向合并;`true` 或自定义比较函数。
|
|
122
178
|
* 需 Grid `enableCellSpan: true`。同列若同时配 `rowSpan` 则本字段不生效。
|
|
123
179
|
*/
|
|
124
|
-
spanRows?: boolean |
|
|
125
|
-
|
|
126
|
-
|
|
180
|
+
spanRows?: boolean | SpanRowsFunc;
|
|
181
|
+
/** 读取单元格展示值(优先于 prop 直读) */
|
|
182
|
+
valueGetter?: (row: TData, value: unknown) => unknown;
|
|
183
|
+
/** 格式化展示文案(不影响原始值) */
|
|
184
|
+
formatter?: (row: TData, value: unknown) => string;
|
|
127
185
|
/** 自定义单元格渲染器(函数;Vue 组件通过 MagicGrid 槽位注册) */
|
|
128
|
-
cellRenderer?:
|
|
186
|
+
cellRenderer?: CellRendererFn;
|
|
129
187
|
/** 自定义单元格编辑器(函数、内置 text / number / checkbox、或命名引用) */
|
|
130
|
-
cellEditor?:
|
|
188
|
+
cellEditor?: CellEditorDef;
|
|
131
189
|
/** 编辑器呈现:overlay 进编辑态;inline 常驻格内。默认 overlay */
|
|
132
|
-
cellEditorMode?:
|
|
190
|
+
cellEditorMode?: CellEditorMode;
|
|
133
191
|
/** 提交前解析编辑值 */
|
|
134
|
-
valueParser?: (value: unknown, params:
|
|
135
|
-
/** 自定义写回逻辑,返回 false 拒绝提交;可 async
|
|
136
|
-
valueSetter?: (params:
|
|
192
|
+
valueParser?: (value: unknown, params: CellEditorParams) => unknown;
|
|
193
|
+
/** 自定义写回逻辑,返回 false 拒绝提交;可 async */
|
|
194
|
+
valueSetter?: (params: CellEditorParams & {
|
|
137
195
|
newValue: unknown;
|
|
138
196
|
signal: AbortSignal;
|
|
139
197
|
}) => boolean | Promise<boolean>;
|
|
140
198
|
/** 编辑触发策略,缺省继承 grid 级配置 */
|
|
141
|
-
editType?:
|
|
199
|
+
editType?: CellEditType;
|
|
142
200
|
/** 手写校验(优先级高于 validationRules) */
|
|
143
|
-
cellValidator?:
|
|
144
|
-
/**
|
|
145
|
-
suppressPaste?: boolean |
|
|
146
|
-
/**
|
|
201
|
+
cellValidator?: CellValidator;
|
|
202
|
+
/** 禁止粘贴;可函数按行判断 */
|
|
203
|
+
suppressPaste?: boolean | ((row: TData) => boolean);
|
|
204
|
+
/** 粘贴是否走 valueParser;默认 true */
|
|
147
205
|
useParserForClipboard?: boolean;
|
|
148
|
-
/**
|
|
206
|
+
/** 复制是否走 formatter;默认 true */
|
|
149
207
|
useFormatterForClipboard?: boolean;
|
|
150
208
|
/** async-validator 规则;通过 magic-grid/validation enrichColumnsWithValidation 编译 */
|
|
151
|
-
validationRules?:
|
|
209
|
+
validationRules?: ValidationRules;
|
|
152
210
|
/** 必填列标记(缺省由 validationRules.required 推导) */
|
|
153
211
|
validationRequired?: boolean;
|
|
154
212
|
/** 是否参与表尾汇总;缺省时:有 summaryAgg 则为 true,否则 false */
|
|
@@ -158,55 +216,54 @@ export interface ColumnDef {
|
|
|
158
216
|
/** 汇总格专用 formatter;缺省复用 formatter */
|
|
159
217
|
summaryFormatter?: (value: unknown) => string;
|
|
160
218
|
/** 表头水平对齐;默认 center */
|
|
161
|
-
headerAlign?:
|
|
219
|
+
headerAlign?: GridHorizontalAlign;
|
|
162
220
|
/** 表头垂直对齐;默认 center */
|
|
163
|
-
headerValign?:
|
|
221
|
+
headerValign?: GridVerticalAlign;
|
|
164
222
|
/** 表体水平对齐;默认 center */
|
|
165
|
-
align?:
|
|
223
|
+
align?: GridHorizontalAlign;
|
|
166
224
|
/** 表体垂直对齐;默认 center */
|
|
167
|
-
valign?:
|
|
225
|
+
valign?: GridVerticalAlign;
|
|
168
226
|
/** 表尾汇总水平对齐;默认 center */
|
|
169
|
-
footerAlign?:
|
|
227
|
+
footerAlign?: GridHorizontalAlign;
|
|
170
228
|
/** 表尾汇总垂直对齐;默认 center */
|
|
171
|
-
footerValign?:
|
|
229
|
+
footerValign?: GridVerticalAlign;
|
|
172
230
|
/**
|
|
173
|
-
*
|
|
231
|
+
* 抑制该列(或特定行)的批注新建/编辑/删除。
|
|
174
232
|
* 已有批注仍可查看。
|
|
175
233
|
*/
|
|
176
|
-
suppressCellComments?: boolean |
|
|
177
|
-
/**
|
|
234
|
+
suppressCellComments?: boolean | SuppressCellCommentFn<TData>;
|
|
235
|
+
/** 列级禁用:true 时该列全部数据行 disabled */
|
|
178
236
|
disabled?: boolean;
|
|
179
|
-
/**
|
|
180
|
-
cellDisabled?: boolean |
|
|
237
|
+
/** 格级禁用:按行判定;与 disabled / isRowDisabled 叠加 */
|
|
238
|
+
cellDisabled?: boolean | CellDisabledFn<TData>;
|
|
181
239
|
/**
|
|
182
|
-
*
|
|
240
|
+
* 列级静态背景 或 格级 cellStyle 回调(二选一 · 同 AG Grid cellStyle)。
|
|
183
241
|
* 仅作用于表体用户数据列;表头/表尾/索引列/系统列不参与。
|
|
184
242
|
*/
|
|
185
|
-
cellStyle?:
|
|
186
|
-
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
/** Phase 23 · 读 row.data[field] 作为 tooltip */
|
|
192
|
-
tooltipField?: string;
|
|
193
|
-
/** Phase 23 · 自定义 tooltip 文案 */
|
|
194
|
-
tooltipValueGetter?: import('../core/types/overflowTooltip').TooltipValueGetter;
|
|
195
|
-
/** Phase 23 · 表头静态 tooltip */
|
|
243
|
+
cellStyle?: CellStyle | CellStyleFn<TData>;
|
|
244
|
+
/** 读 row.data[field] 作为 tooltip */
|
|
245
|
+
tooltipField?: Extract<keyof TData, string>;
|
|
246
|
+
/** 自定义 tooltip 文案 */
|
|
247
|
+
tooltipValueGetter?: TooltipValueGetter<TData>;
|
|
248
|
+
/** 表头静态 tooltip */
|
|
196
249
|
headerTooltip?: string;
|
|
197
|
-
|
|
198
|
-
|
|
250
|
+
/** 表头动态 tooltip 文案 */
|
|
251
|
+
headerTooltipValueGetter?: HeaderTooltipValueGetter;
|
|
252
|
+
/** 抑制该列溢出 tooltip */
|
|
199
253
|
suppressTooltip?: boolean;
|
|
200
|
-
|
|
254
|
+
/** 自定义 tooltip 组件 */
|
|
255
|
+
tooltipComponent?: TooltipComponentType;
|
|
256
|
+
/** 自定义 tooltip 组件额外参数 */
|
|
201
257
|
tooltipComponentParams?: Record<string, unknown>;
|
|
202
258
|
}
|
|
203
|
-
|
|
259
|
+
/** MagicGrid 组件 props;`TData` 为行数据类型,用于列定义与回调参数推导 */
|
|
260
|
+
export interface MagicGridProps<TData extends RowData = RowData> {
|
|
204
261
|
/** 列定义 */
|
|
205
|
-
columns: ColumnDef[];
|
|
262
|
+
columns: ColumnDef<TData>[];
|
|
206
263
|
/** 行数据 */
|
|
207
|
-
data:
|
|
264
|
+
data: TData[];
|
|
208
265
|
/** Grid 实例级命名编辑器(colId 引用 cellEditor: 'name' 时解析;优先于全局注册表) */
|
|
209
|
-
cellEditorRegistry?: Record<string,
|
|
266
|
+
cellEditorRegistry?: Record<string, CellEditorFn>;
|
|
210
267
|
/** 行数据主键字段名(PK),用于行池复用与增量更新 */
|
|
211
268
|
rowKey?: string;
|
|
212
269
|
/** 斑马纹 */
|
|
@@ -217,24 +274,24 @@ export interface MagicGridProps {
|
|
|
217
274
|
* - none:无单元格线;表头与表体保留底部分隔线
|
|
218
275
|
* - linear:表头 / 表体单元格仅底部分隔线
|
|
219
276
|
*/
|
|
220
|
-
border?:
|
|
277
|
+
border?: GridBorder;
|
|
221
278
|
/**
|
|
222
279
|
* 主题 preset;默认 `light`(亮色)。
|
|
223
280
|
* `dark` 切换暗色语义 token(`--mg-color-*`)。
|
|
224
281
|
*/
|
|
225
|
-
theme?:
|
|
282
|
+
theme?: GridTheme;
|
|
226
283
|
/**
|
|
227
284
|
* 尺寸 preset;默认 `default`。
|
|
228
285
|
* rowHeight / headerHeight 未显式传入时,由 size 推导。
|
|
229
286
|
*/
|
|
230
|
-
size?:
|
|
287
|
+
size?: GridSize;
|
|
231
288
|
/**
|
|
232
289
|
* 容器圆角(px);默认 `false`(无圆角)
|
|
233
290
|
* - `false` / `0`:圆角为 0
|
|
234
291
|
* - `true`:使用当前 size preset 的圆角
|
|
235
292
|
* - `number`:自定义圆角像素值
|
|
236
293
|
*/
|
|
237
|
-
rounded?:
|
|
294
|
+
rounded?: GridRounded;
|
|
238
295
|
/** 固定行高(px);显式传入时覆盖 size preset */
|
|
239
296
|
rowHeight?: number;
|
|
240
297
|
/** 表头高度(px);显式传入时覆盖 size preset */
|
|
@@ -259,25 +316,25 @@ export interface MagicGridProps {
|
|
|
259
316
|
*/
|
|
260
317
|
summaryMethod?: SummaryMethod;
|
|
261
318
|
/** 表头水平对齐(全局默认);默认 center */
|
|
262
|
-
headerAlign?:
|
|
319
|
+
headerAlign?: GridHorizontalAlign;
|
|
263
320
|
/** 表头垂直对齐(全局默认);默认 center */
|
|
264
|
-
headerValign?:
|
|
321
|
+
headerValign?: GridVerticalAlign;
|
|
265
322
|
/** 表体水平对齐(全局默认);默认 center */
|
|
266
|
-
align?:
|
|
323
|
+
align?: GridHorizontalAlign;
|
|
267
324
|
/** 表体垂直对齐(全局默认);默认 center */
|
|
268
|
-
valign?:
|
|
325
|
+
valign?: GridVerticalAlign;
|
|
269
326
|
/** 表尾汇总水平对齐(全局默认);默认 center */
|
|
270
|
-
footerAlign?:
|
|
327
|
+
footerAlign?: GridHorizontalAlign;
|
|
271
328
|
/** 表尾汇总垂直对齐(全局默认);默认 center */
|
|
272
|
-
footerValign?:
|
|
329
|
+
footerValign?: GridVerticalAlign;
|
|
273
330
|
/** 是否允许键盘/鼠标将焦点导航到表头;默认 false */
|
|
274
331
|
navigateHeader?: boolean;
|
|
275
332
|
/** 是否允许键盘/鼠标将焦点导航到表尾汇总行;默认 false(需 showSummary: true) */
|
|
276
333
|
navigateFooter?: boolean;
|
|
277
334
|
/** 行虚拟化缓冲行数 */
|
|
278
335
|
rowBuffer?: number;
|
|
279
|
-
/** 行选择模式,false 禁用;对象形式支持 groupSelectsChildren
|
|
280
|
-
rowSelection?:
|
|
336
|
+
/** 行选择模式,false 禁用;对象形式支持 groupSelectsChildren */
|
|
337
|
+
rowSelection?: RowSelectionInput;
|
|
281
338
|
/** 行选择列配置;rowSelection !== false 时生效 */
|
|
282
339
|
selectionColumn?: SelectionColumnOptions;
|
|
283
340
|
/**
|
|
@@ -287,35 +344,35 @@ export interface MagicGridProps {
|
|
|
287
344
|
selectable?: SelectableFn;
|
|
288
345
|
/** 行选择列:数据刷新后是否保留选中行;默认 false */
|
|
289
346
|
reserveSelection?: boolean;
|
|
290
|
-
/**
|
|
347
|
+
/** Grid 级 quick filter 文本 */
|
|
291
348
|
quickFilterText?: string;
|
|
292
349
|
/**
|
|
293
350
|
* 是否允许列筛选;默认 `false`。
|
|
294
351
|
* 列级 `columns[].filterable` **优先于**本配置;系统列(索引 / 行选择等)恒为 false。
|
|
295
352
|
*/
|
|
296
353
|
filterable?: boolean;
|
|
297
|
-
/**
|
|
354
|
+
/** 表头下方 Floating Filter 行;默认 `false` */
|
|
298
355
|
floatingFilter?: boolean;
|
|
299
|
-
/**
|
|
300
|
-
filterSetValueMode?:
|
|
301
|
-
/**
|
|
302
|
-
filterSetDateLayoutMode?:
|
|
356
|
+
/** 值选择搜索时的勾选投影模式;默认 `current` */
|
|
357
|
+
filterSetValueMode?: FilterSetValueMode;
|
|
358
|
+
/** 日期列值选择展示方式;默认 `tree` */
|
|
359
|
+
filterSetDateLayoutMode?: FilterSetDateLayoutMode;
|
|
303
360
|
/** 编辑范围:cell 单格 / row 整行 */
|
|
304
|
-
|
|
361
|
+
editBehavior?: CellEditBehavior;
|
|
305
362
|
/** 进入编辑态的触发方式,默认 singleClick */
|
|
306
|
-
editType?:
|
|
363
|
+
editType?: CellEditType;
|
|
307
364
|
/** 校验失败后:block 保持编辑 / revert 退出并恢复旧值 */
|
|
308
|
-
invalidEditValueMode?:
|
|
365
|
+
invalidEditValueMode?: InvalidEditValueMode;
|
|
309
366
|
/** 行编辑跨字段校验 */
|
|
310
|
-
rowValidator?:
|
|
311
|
-
/**
|
|
312
|
-
asyncRowMutation?:
|
|
367
|
+
rowValidator?: RowValidator;
|
|
368
|
+
/** 异步行 CRUD 持久化钩子 */
|
|
369
|
+
asyncRowMutation?: AsyncRowMutationHandlers;
|
|
313
370
|
/** 容器高度 */
|
|
314
371
|
height?: string | number;
|
|
315
372
|
/** 容器宽度 */
|
|
316
373
|
width?: string | number;
|
|
317
374
|
/**
|
|
318
|
-
* 初始排序(Grid 挂载 / initGrid
|
|
375
|
+
* 初始排序(Grid 挂载 / initGrid 时应用一次);当前仅使用首项
|
|
319
376
|
*/
|
|
320
377
|
defaultSort?: SortModelItem[];
|
|
321
378
|
/**
|
|
@@ -331,7 +388,7 @@ export interface MagicGridProps {
|
|
|
331
388
|
*/
|
|
332
389
|
resizable?: boolean;
|
|
333
390
|
/**
|
|
334
|
-
*
|
|
391
|
+
* 默认 Shift 模式:拖拽列宽时相邻列反向补偿,总宽不变。
|
|
335
392
|
* 对标 AG Grid `colResizeDefault: 'shift'`。
|
|
336
393
|
*/
|
|
337
394
|
colResizeDefault?: 'shift';
|
|
@@ -340,227 +397,257 @@ export interface MagicGridProps {
|
|
|
340
397
|
/** auto-size 内容测量额外 padding(px);对标 AG Grid autoSizePadding */
|
|
341
398
|
autoSizePadding?: number;
|
|
342
399
|
/** 挂载 / 首屏 auto-size 策略;对标 AG Grid autoSizeStrategy */
|
|
343
|
-
autoSizeStrategy?:
|
|
344
|
-
/**
|
|
345
|
-
* true → 仅 mouseup
|
|
400
|
+
autoSizeStrategy?: AutoSizeStrategy;
|
|
401
|
+
/** 默认 false(drag 过程中 live move,对齐 AG Grid)。
|
|
402
|
+
* true → 仅 mouseup 提交列序。
|
|
346
403
|
*/
|
|
347
404
|
suppressMoveWhenColumnDragging?: boolean;
|
|
348
|
-
/**
|
|
405
|
+
/** 默认 false;true 关闭列移动 transition */
|
|
349
406
|
suppressColumnMoveAnimation?: boolean;
|
|
350
407
|
/**
|
|
351
|
-
*
|
|
408
|
+
* 默认 false。
|
|
352
409
|
* true → 允许 drag / API 跨 fixed lane 并更新列 `fixed`。
|
|
353
410
|
*/
|
|
354
411
|
allowCrossLaneColumnMove?: boolean;
|
|
355
|
-
/**
|
|
412
|
+
/** 默认 false;true → 未排序 sortable 列 hover 显示 faint 双三角 */
|
|
356
413
|
showUnsortedSortHintOnHover?: boolean;
|
|
357
414
|
/** 是否显示底部状态栏;默认 true */
|
|
358
415
|
showStatusBar?: boolean;
|
|
359
|
-
/**
|
|
416
|
+
/**
|
|
417
|
+
* 状态栏高度:`'auto'` 跟随 size preset(默认);number 为自定义 px。
|
|
418
|
+
*/
|
|
419
|
+
statusBarHeight?: StatusBarHeightInput;
|
|
420
|
+
/** 框选时在状态栏展示平均值/计数/求和;cellSelection 开时默认 true */
|
|
360
421
|
showStatusBarRangeAggregation?: boolean;
|
|
422
|
+
/** 框选聚合 panel 位置;默认 `right`(右栏内侧) */
|
|
423
|
+
statusBarRangeAggregationPosition?: StatusBarRangeAggregationPosition;
|
|
361
424
|
/**
|
|
362
|
-
*
|
|
425
|
+
* 平均值 / 求和展示小数位数。
|
|
363
426
|
* 传 number 时同时作用于两者;默认 2。
|
|
364
427
|
*/
|
|
365
|
-
statusBarRangeAggregationPrecision?:
|
|
428
|
+
statusBarRangeAggregationPrecision?: StatusBarRangeAggregationPrecisionInput;
|
|
366
429
|
/**
|
|
367
|
-
*
|
|
430
|
+
* 启用 managed 行拖拽:拖拽过程中实时改 source 顺序;默认 true。
|
|
368
431
|
* 设为 false 时仅 emit `rowDragEnd`,由业务自行改序。
|
|
369
432
|
* 对标 AG Grid `rowDragManaged`。
|
|
370
433
|
*/
|
|
371
434
|
rowDragManaged?: boolean;
|
|
372
435
|
/**
|
|
373
|
-
*
|
|
436
|
+
* managed 模式 commit 策略:`sync`(默认 live move)| `deferred`(mouseup 后 await onRowDragCommit)。
|
|
374
437
|
*/
|
|
375
|
-
rowDragCommitMode?:
|
|
438
|
+
rowDragCommitMode?: RowDragCommitMode;
|
|
376
439
|
/**
|
|
377
440
|
* deferred 模式:mouseup 后、apply 前调用;返回 false 则不写 source。
|
|
378
441
|
* MagicGrid 亦支持 `:on-row-drag-commit` prop(与 Grid option 等价)。
|
|
379
442
|
*/
|
|
380
|
-
onRowDragCommit?:
|
|
443
|
+
onRowDragCommit?: RowDragCommitHandler;
|
|
381
444
|
/**
|
|
382
|
-
*
|
|
445
|
+
* 行级动态高度(无 DOM);优先于默认 rowHeight,低于手动 setRowHeight。
|
|
383
446
|
* 对标 AG Grid `getRowHeight`。
|
|
384
447
|
*/
|
|
385
|
-
getRowHeight?:
|
|
386
|
-
/**
|
|
448
|
+
getRowHeight?: GetRowHeightFn;
|
|
449
|
+
/** 行高下限(px);未传时跟随 size preset / rowHeight */
|
|
387
450
|
rowHeightMin?: number;
|
|
388
|
-
/**
|
|
451
|
+
/** 行高上限(px);未传时无上限 */
|
|
389
452
|
rowHeightMax?: number;
|
|
390
453
|
/**
|
|
391
|
-
*
|
|
454
|
+
* 启用单元格合并。默认 `false`。
|
|
392
455
|
* `true` 时解析列级 `colSpan` / `rowSpan` / `spanRows`,且行定位改用 `style.top`。
|
|
393
456
|
* 对标 AG Grid `enableCellSpan`。
|
|
394
457
|
*/
|
|
395
458
|
enableCellSpan?: boolean;
|
|
396
459
|
/**
|
|
397
|
-
*
|
|
460
|
+
* 启用主从展开行。默认 `false`。
|
|
398
461
|
* 对标 AG Grid `masterDetail`。
|
|
399
462
|
*/
|
|
400
463
|
masterDetail?: boolean;
|
|
401
|
-
/**
|
|
402
|
-
isRowMaster?:
|
|
403
|
-
/**
|
|
464
|
+
/** 是否为主行(可展示 expand 控件);缺省全部 data 行可展开 */
|
|
465
|
+
isRowMaster?: IsRowMasterFn;
|
|
466
|
+
/** 默认展开层级:0 = 无;1 = 第一层;-1 = 全部 */
|
|
404
467
|
masterDefaultExpanded?: number;
|
|
405
|
-
/**
|
|
406
|
-
detailRowHeight?: number |
|
|
407
|
-
/**
|
|
468
|
+
/** 详情行固定高度(px);与 detailRowAutoHeight 并存时本字段优先 */
|
|
469
|
+
detailRowHeight?: number | DetailRowHeightFn;
|
|
470
|
+
/** 详情行按内容自动撑高 */
|
|
408
471
|
detailRowAutoHeight?: boolean;
|
|
409
472
|
/**
|
|
410
|
-
*
|
|
473
|
+
* false(默认):详情 overlay 不随 center 横滚。
|
|
411
474
|
* true:详情嵌入 center lane。
|
|
412
475
|
*/
|
|
413
476
|
embedFullWidthRows?: boolean;
|
|
414
|
-
/**
|
|
477
|
+
/** 最左展示专用展开列(fixed=left) */
|
|
415
478
|
showExpandColumn?: boolean;
|
|
416
|
-
/**
|
|
417
|
-
getDetailRowData?:
|
|
418
|
-
/**
|
|
419
|
-
detailCellRenderer?:
|
|
479
|
+
/** 异步提供详情区数据 */
|
|
480
|
+
getDetailRowData?: GetDetailRowDataFn;
|
|
481
|
+
/** 自定义详情行渲染器(与 `#detail-row` 插槽二选一) */
|
|
482
|
+
detailCellRenderer?: DetailCellRendererFn;
|
|
420
483
|
/**
|
|
421
|
-
*
|
|
484
|
+
* 启用行分组。默认 `false`。
|
|
422
485
|
* `true` 且存在 ≥1 个分组字段时生效。
|
|
423
486
|
*/
|
|
424
487
|
rowGrouping?: boolean;
|
|
425
|
-
/**
|
|
488
|
+
/** 默认展开分组层级:0 = 全折叠;1 = 第一层;-1 = 全部展开。默认 `-1` */
|
|
426
489
|
groupDefaultExpanded?: number;
|
|
427
|
-
/**
|
|
490
|
+
/** 是否展示 groupHeader 分组标题行。默认 `false` */
|
|
428
491
|
showGroupHeader?: boolean;
|
|
429
|
-
/**
|
|
492
|
+
/** 是否为每个已展开的分组展示 footer 汇总行。默认 `false` */
|
|
430
493
|
showGroupFooter?: boolean;
|
|
431
494
|
/**
|
|
432
|
-
*
|
|
495
|
+
* 分组展示模式。当前仅支持 `singleColumn`。
|
|
433
496
|
* 默认 `singleColumn`。
|
|
434
497
|
*/
|
|
435
|
-
groupDisplayType?:
|
|
436
|
-
/**
|
|
498
|
+
groupDisplayType?: GroupDisplayType;
|
|
499
|
+
/** 是否展示 auto group 系统列;默认 false */
|
|
437
500
|
showGroupColumn?: boolean;
|
|
438
|
-
/**
|
|
439
|
-
autoGroupColumnDef?: Partial<ColumnDef
|
|
440
|
-
/**
|
|
441
|
-
groupKeyCreator?:
|
|
501
|
+
/** 覆盖 auto group 列的 colDef */
|
|
502
|
+
autoGroupColumnDef?: Partial<ColumnDef<TData>>;
|
|
503
|
+
/** 分组键归一化(可选) */
|
|
504
|
+
groupKeyCreator?: GroupKeyCreatorFn;
|
|
442
505
|
/**
|
|
443
|
-
*
|
|
506
|
+
* 同级 group 节点排序。缺省按 groupKey 升序(blank 置末)。
|
|
444
507
|
* 自定义时全权负责(含 blank);不改变展示键。
|
|
445
508
|
*/
|
|
446
|
-
groupComparator?:
|
|
447
|
-
/**
|
|
509
|
+
groupComparator?: GroupComparatorFn;
|
|
510
|
+
/** groupFooter 首列展示标签 */
|
|
448
511
|
groupFooterLabel?: string;
|
|
449
|
-
/**
|
|
450
|
-
groupCellRenderer?:
|
|
512
|
+
/** 自定义分组单元格渲染器 */
|
|
513
|
+
groupCellRenderer?: GroupCellRendererFn;
|
|
451
514
|
/**
|
|
452
|
-
*
|
|
515
|
+
* 启用树形表格。默认 `false`。
|
|
453
516
|
* 与 `rowGrouping` 互斥。
|
|
454
517
|
*/
|
|
455
518
|
tree?: boolean;
|
|
456
|
-
/**
|
|
457
|
-
getDataPath?:
|
|
519
|
+
/** 树形路径回调;`tree: true` 时必填 */
|
|
520
|
+
getDataPath?: GetDataPathFn;
|
|
458
521
|
/**
|
|
459
|
-
*
|
|
522
|
+
* 树形 managed 行拖拽范围。默认 `siblings`(仅同 parent 兄弟换序);
|
|
460
523
|
* `hierarchy` 允许跨层级改父节点(需 `setDataPath` 写回路径)。
|
|
461
524
|
*/
|
|
462
|
-
treeDragScope?:
|
|
463
|
-
/**
|
|
464
|
-
setDataPath?:
|
|
465
|
-
/**
|
|
525
|
+
treeDragScope?: TreeDragScope;
|
|
526
|
+
/** hierarchy 模式下写回 dataPath;缺省时若 data.pathSegments 为数组则自动更新 */
|
|
527
|
+
setDataPath?: SetDataPathFn;
|
|
528
|
+
/** 是否展示 tree 系统列。默认 `true` */
|
|
466
529
|
showTreeColumn?: boolean;
|
|
467
|
-
/**
|
|
468
|
-
autoTreeColumnDef?: Partial<ColumnDef
|
|
469
|
-
/**
|
|
470
|
-
treeValueGetter?:
|
|
471
|
-
/**
|
|
472
|
-
treeDisplayType?:
|
|
473
|
-
/**
|
|
530
|
+
/** 覆盖 tree 系统列 colDef */
|
|
531
|
+
autoTreeColumnDef?: Partial<ColumnDef<TData>>;
|
|
532
|
+
/** 自定义 tree 列展示值 */
|
|
533
|
+
treeValueGetter?: TreeValueGetterFn;
|
|
534
|
+
/** 树节点展示列模式。当前仅支持 `singleColumn` */
|
|
535
|
+
treeDisplayType?: TreeDisplayType;
|
|
536
|
+
/** 启用树形懒加载 */
|
|
474
537
|
treeLazyLoad?: boolean;
|
|
475
|
-
/**
|
|
476
|
-
hasTreeChildren?:
|
|
477
|
-
/**
|
|
478
|
-
loadTreeChildren?:
|
|
479
|
-
/**
|
|
480
|
-
cellCommentsDataSource?:
|
|
481
|
-
/**
|
|
538
|
+
/** lazy 模式:节点是否可能有未加载子行 */
|
|
539
|
+
hasTreeChildren?: HasTreeChildrenFn;
|
|
540
|
+
/** lazy 模式:首次展开时拉取子数据 */
|
|
541
|
+
loadTreeChildren?: LoadTreeChildrenFn;
|
|
542
|
+
/** 单元格批注数据源;提供即启用 */
|
|
543
|
+
cellCommentsDataSource?: CellCommentsDataSource;
|
|
544
|
+
/** 全局抑制批注交互;API 仍可 bypass */
|
|
482
545
|
suppressCellComments?: boolean;
|
|
483
|
-
/**
|
|
484
|
-
cellCommentTrigger?:
|
|
485
|
-
/**
|
|
546
|
+
/** 查看已有批注的触发方式;默认 click(点角标 toggle) */
|
|
547
|
+
cellCommentTrigger?: CellCommentTrigger;
|
|
548
|
+
/** hover 模式展示延迟 ms;默认 180 */
|
|
486
549
|
cellCommentShowDelay?: number;
|
|
487
|
-
/**
|
|
550
|
+
/** 离开 cell/popup 后隐藏延迟 ms;默认 220 */
|
|
488
551
|
cellCommentHideDelay?: number;
|
|
489
|
-
/**
|
|
490
|
-
processCellForClipboard?:
|
|
491
|
-
/**
|
|
492
|
-
processCellFromClipboard?:
|
|
493
|
-
/**
|
|
494
|
-
processDataFromClipboard?:
|
|
495
|
-
/**
|
|
496
|
-
cellSelection?: boolean |
|
|
497
|
-
/**
|
|
498
|
-
* @deprecated 使用 `enableCellCopy` / `enableCellPaste`。未单独指定时二者均继承本值。
|
|
499
|
-
* cellSelection 开启时默认 true。
|
|
500
|
-
*/
|
|
501
|
-
enableCellClipboard?: boolean;
|
|
502
|
-
/** Phase 24 · 框选复制;cellSelection 开启时默认 true */
|
|
552
|
+
/** 复制单格时自定义导出值(最高优先级) */
|
|
553
|
+
processCellForClipboard?: ProcessCellForClipboardFn;
|
|
554
|
+
/** 粘贴单格时预处理 clipboard 字符串 */
|
|
555
|
+
processCellFromClipboard?: ProcessCellFromClipboardFn;
|
|
556
|
+
/** 整表粘贴前处理 TSV 矩阵;return null 取消粘贴 */
|
|
557
|
+
processDataFromClipboard?: ProcessDataFromClipboardFn;
|
|
558
|
+
/** 单元格框选;MagicGrid 默认 true(含 enableColumnSelection,handleMode 默认 off),Grid API 未传时为 false */
|
|
559
|
+
cellSelection?: boolean | CellSelectionOptions;
|
|
560
|
+
/** 框选复制;cellSelection 开启时默认 true */
|
|
503
561
|
enableCellCopy?: boolean;
|
|
504
|
-
/**
|
|
562
|
+
/** 框选粘贴;cellSelection 开启时默认 false */
|
|
505
563
|
enableCellPaste?: boolean;
|
|
506
|
-
/**
|
|
564
|
+
/** 选区涉及列的表头底色;默认 true */
|
|
507
565
|
enableHeaderHighlight?: boolean;
|
|
508
|
-
/**
|
|
566
|
+
/** 选区行跨度内索引列高亮;默认 true */
|
|
509
567
|
enableIndexColumnHighlight?: boolean;
|
|
510
|
-
/**
|
|
568
|
+
/** 是否启用溢出 tooltip;默认 true */
|
|
511
569
|
enableTooltips?: boolean;
|
|
512
|
-
/**
|
|
513
|
-
tooltipShowMode?:
|
|
570
|
+
/** 溢出 tooltip 显示策略;默认 whenTruncated */
|
|
571
|
+
tooltipShowMode?: TooltipShowMode;
|
|
572
|
+
/** 首次 hover 展示延迟 ms;默认 500 */
|
|
514
573
|
tooltipShowDelay?: number;
|
|
574
|
+
/** 格间切换展示延迟 ms;默认 200 */
|
|
515
575
|
tooltipSwitchShowDelay?: number;
|
|
576
|
+
/** 离开后隐藏延迟 ms;默认 3000 */
|
|
516
577
|
tooltipHideDelay?: number;
|
|
578
|
+
/** tooltip 内容是否可交互;默认 false */
|
|
517
579
|
tooltipInteraction?: boolean;
|
|
580
|
+
/** tooltip 是否跟随鼠标;默认 false */
|
|
518
581
|
tooltipMouseTrack?: boolean;
|
|
519
|
-
/**
|
|
582
|
+
/** 是否显示 loading overlay;undefined 为挂载后首次 setData 前自动 loading */
|
|
520
583
|
loading?: boolean;
|
|
521
|
-
/**
|
|
522
|
-
suppressOverlays?:
|
|
584
|
+
/** 逐项抑制内置 overlay */
|
|
585
|
+
suppressOverlays?: OverlayType[];
|
|
586
|
+
/** 抑制 loading overlay */
|
|
523
587
|
suppressLoadingOverlay?: boolean;
|
|
588
|
+
/** 抑制无数据 overlay */
|
|
524
589
|
suppressNoRowsOverlay?: boolean;
|
|
590
|
+
/** 抑制无匹配行 overlay(filter 后为空) */
|
|
525
591
|
suppressNoMatchingRowsOverlay?: boolean;
|
|
592
|
+
/** loading overlay 内置 HTML 模板 */
|
|
526
593
|
overlayLoadingTemplate?: string;
|
|
594
|
+
/** 无数据 overlay 内置 HTML 模板 */
|
|
527
595
|
overlayNoRowsTemplate?: string;
|
|
596
|
+
/** 无匹配行 overlay 内置 HTML 模板 */
|
|
528
597
|
overlayNoMatchingRowsTemplate?: string;
|
|
529
|
-
|
|
598
|
+
/** 自定义 loading overlay 组件 */
|
|
599
|
+
loadingOverlayComponent?: OverlayComponentType;
|
|
600
|
+
/** loading overlay 组件额外参数 */
|
|
530
601
|
loadingOverlayComponentParams?: Record<string, unknown>;
|
|
531
|
-
|
|
602
|
+
/** 自定义无数据 overlay 组件 */
|
|
603
|
+
noRowsOverlayComponent?: OverlayComponentType;
|
|
604
|
+
/** 无数据 overlay 组件额外参数 */
|
|
532
605
|
noRowsOverlayComponentParams?: Record<string, unknown>;
|
|
533
|
-
|
|
606
|
+
/** 自定义无匹配行 overlay 组件 */
|
|
607
|
+
noMatchingRowsOverlayComponent?: OverlayComponentType;
|
|
608
|
+
/** 无匹配行 overlay 组件额外参数 */
|
|
534
609
|
noMatchingRowsOverlayComponentParams?: Record<string, unknown>;
|
|
535
|
-
|
|
610
|
+
/** 通用 overlay 组件(按类型分发) */
|
|
611
|
+
overlayComponent?: OverlayComponentType;
|
|
612
|
+
/** 通用 overlay 组件额外参数 */
|
|
536
613
|
overlayComponentParams?: Record<string, unknown>;
|
|
537
|
-
/**
|
|
614
|
+
/** overlay 内容是否可交互(默认可穿透) */
|
|
538
615
|
overlayInteraction?: boolean;
|
|
539
616
|
/**
|
|
540
|
-
*
|
|
617
|
+
* 行级禁用:true 时该行全部数据列 disabled。
|
|
541
618
|
* 不影响 index / selection / expand / tree / group 系统列。
|
|
542
619
|
*/
|
|
543
|
-
isRowDisabled?: boolean |
|
|
620
|
+
isRowDisabled?: boolean | IsRowDisabledFn<TData>;
|
|
544
621
|
/**
|
|
545
|
-
*
|
|
622
|
+
* 行级样式:对象 = 全表同色;函数 = 按行。
|
|
546
623
|
* 作用于表体用户数据列与行选择列;表头/表尾/索引列不参与。
|
|
547
624
|
*/
|
|
548
|
-
rowStyle?:
|
|
625
|
+
rowStyle?: RowStyle<TData>;
|
|
549
626
|
}
|
|
550
|
-
/** `#loading` / `#no-rows` / `#no-matching-rows` 插槽 props
|
|
627
|
+
/** `#loading` / `#no-rows` / `#no-matching-rows` 插槽 props */
|
|
551
628
|
export interface OverlaySlotParams {
|
|
552
|
-
|
|
553
|
-
|
|
629
|
+
/** 当前 overlay 类型 */
|
|
630
|
+
overlayType: OverlayType;
|
|
631
|
+
/** GridApi 实例 */
|
|
632
|
+
api: GridApi;
|
|
633
|
+
/** 内置 overlay 默认文案(自定义组件可忽略) */
|
|
554
634
|
overlayText?: string;
|
|
555
635
|
}
|
|
556
|
-
/** `#detail-row` 插槽 props
|
|
557
|
-
export interface DetailRowSlotParams {
|
|
558
|
-
|
|
636
|
+
/** `#detail-row` 插槽 props */
|
|
637
|
+
export interface DetailRowSlotParams<TData extends RowData = RowData> {
|
|
638
|
+
/** 主行数据 */
|
|
639
|
+
row: TData;
|
|
640
|
+
/** 主行 rowId */
|
|
559
641
|
rowId: string;
|
|
642
|
+
/** 与 rowId 相同(兼容别名) */
|
|
560
643
|
masterRowId: string;
|
|
644
|
+
/** 详情区数据(`getDetailRowData` 返回值) */
|
|
561
645
|
detailRowData: unknown;
|
|
646
|
+
/** 详情数据是否加载中 */
|
|
562
647
|
loading: boolean;
|
|
648
|
+
/** 详情数据是否加载失败 */
|
|
563
649
|
loadFailed: boolean;
|
|
650
|
+
/** 加载失败时的错误对象 */
|
|
564
651
|
loadError?: unknown;
|
|
565
652
|
}
|
|
566
653
|
//# sourceMappingURL=magic-grid.d.ts.map
|