@scvzerng/element-ui-ag-grid-vue2 0.0.8

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.
Files changed (76) hide show
  1. package/README.md +5 -0
  2. package/dist/ElementPlusAgGrid.es.js +34344 -0
  3. package/dist/ElementPlusAgGrid.umd.js +58 -0
  4. package/dist/favicon.ico +0 -0
  5. package/dist/style.css +1 -0
  6. package/dist/types/Grid.vue.d.ts +14849 -0
  7. package/dist/types/GridDataCache.d.ts +52 -0
  8. package/dist/types/GridDataSource.d.ts +39 -0
  9. package/dist/types/GridEmptyDataOverlay.vue.d.ts +2 -0
  10. package/dist/types/GridLoadingOverlay.vue.d.ts +2 -0
  11. package/dist/types/PageGetRowsParams.d.ts +32 -0
  12. package/dist/types/ag-grid/options/ag-grid-menu-options.d.ts +9 -0
  13. package/dist/types/ag-grid/options/ag-grid-options-clean.d.ts +2 -0
  14. package/dist/types/ag-grid/options/ag-grid-options.d.ts +11 -0
  15. package/dist/types/ag-grid-vue/components/AgGridVue.vue.d.ts +1333 -0
  16. package/dist/types/ag-grid-vue/components/VueComponentFactory.d.ts +16 -0
  17. package/dist/types/ag-grid-vue/components/VueFrameworkComponentWrapper.d.ts +15 -0
  18. package/dist/types/ag-grid-vue/components/VueFrameworkOverrides.d.ts +7 -0
  19. package/dist/types/ag-grid-vue/components/utils.d.ts +2105 -0
  20. package/dist/types/ag-grid-vue/main.d.ts +2 -0
  21. package/dist/types/clientSideRowModel/abstractClientSideNodeManager.d.ts +50 -0
  22. package/dist/types/clientSideRowModel/changedRowNodes.d.ts +12 -0
  23. package/dist/types/clientSideRowModel/clientSideNodeManager.d.ts +5 -0
  24. package/dist/types/clientSideRowModel/clientSideRowModel.d.ts +129 -0
  25. package/dist/types/clientSideRowModel/clientSideRowModelApi.d.ts +12 -0
  26. package/dist/types/clientSideRowModel/clientSideRowModelModule.d.ts +9 -0
  27. package/dist/types/clientSideRowModel/filterStage.d.ts +14 -0
  28. package/dist/types/clientSideRowModel/sortStage.d.ts +10 -0
  29. package/dist/types/context-menu/index.d.ts +8 -0
  30. package/dist/types/helper/vModel.d.ts +12 -0
  31. package/dist/types/index.d.ts +25 -0
  32. package/dist/types/model/row/ActualRow.d.ts +77 -0
  33. package/dist/types/model/row/CellValue.d.ts +37 -0
  34. package/dist/types/model/row/EditableRow.d.ts +52 -0
  35. package/dist/types/model/row/GridRow.d.ts +30 -0
  36. package/dist/types/model/row/ProjectionRow.d.ts +43 -0
  37. package/dist/types/model/row/SpanInfo.d.ts +25 -0
  38. package/dist/types/render/CellHolder.d.ts +15 -0
  39. package/dist/types/render/CellRenderer.vue.d.ts +16 -0
  40. package/dist/types/render/FooterCellRender.vue.d.ts +15 -0
  41. package/dist/types/render/HeaderRenderer.vue.d.ts +15 -0
  42. package/dist/types/render/VNodeRender.d.ts +11 -0
  43. package/dist/types/render/types/ICellRendererParamsExt.d.ts +13 -0
  44. package/dist/types/renders.d.ts +35 -0
  45. package/dist/types/search/DrawerSearch.vue.d.ts +45 -0
  46. package/dist/types/search/PopoverSearch.vue.d.ts +45 -0
  47. package/dist/types/search/Search.vue.d.ts +85 -0
  48. package/dist/types/search/SearchItem.vue.d.ts +22 -0
  49. package/dist/types/search/Searchable.d.ts +38 -0
  50. package/dist/types/search/index.d.ts +4 -0
  51. package/dist/types/search/use-search.d.ts +26 -0
  52. package/dist/types/selection/baseSelectionService.d.ts +45 -0
  53. package/dist/types/selection/checkboxSelectionComponent.d.ts +24 -0
  54. package/dist/types/selection/rowRangeSelectionContext.d.ts +54 -0
  55. package/dist/types/selection/rowSelectionApi.d.ts +18 -0
  56. package/dist/types/selection/rowSelectionModule.d.ts +9 -0
  57. package/dist/types/selection/selectAllFeature.d.ts +28 -0
  58. package/dist/types/selection/selectionColService.d.ts +38 -0
  59. package/dist/types/selection/selectionService.d.ts +73 -0
  60. package/dist/types/selection/utils.d.ts +12 -0
  61. package/dist/types/tokens.d.ts +22 -0
  62. package/dist/types/toolbar/GridToolbar.vue.d.ts +18 -0
  63. package/dist/types/toolbar/features/RefreshButton.vue.d.ts +2 -0
  64. package/dist/types/toolbar/features/SearchButton.vue.d.ts +15 -0
  65. package/dist/types/toolbar/features/SettingButton.vue.d.ts +2 -0
  66. package/dist/types/toolbar/features/use-columns-setting.d.ts +14 -0
  67. package/dist/types/use-footer.d.ts +14 -0
  68. package/dist/types/use-grid-scroll.d.ts +10 -0
  69. package/dist/types/use-grid-state.d.ts +9 -0
  70. package/dist/types/use-grid.d.ts +672 -0
  71. package/dist/types/use-proxy.d.ts +8 -0
  72. package/dist/types/use-sort.d.ts +4 -0
  73. package/dist/types/use-theme.d.ts +3 -0
  74. package/dist/types/utils/GridUtils.d.ts +4 -0
  75. package/dist/types/version.d.ts +1 -0
  76. package/package.json +62 -0
@@ -0,0 +1,2 @@
1
+ import AgGridVue from './components/AgGridVue.vue';
2
+ export { AgGridVue };
@@ -0,0 +1,50 @@
1
+ import { BeanStub, RowNode, IClientSideNodeManager, ClientSideNodeManagerUpdateRowDataResult } from 'ag-grid-community';
2
+ import type { GetRowIdFunc, RowDataTransaction, IChangedRowNodes, RefreshModelParams } from 'ag-grid-community';
3
+ /**
4
+ * This is the type of any row in allLeafChildren and childrenAfterGroup of the ClientSideNodeManager rootNode.
5
+ * ClientSideNodeManager is allowed to update the sourceRowIndex property of the nodes.
6
+ */
7
+ interface ClientSideNodeManagerRowNode<TData> extends RowNode<TData> {
8
+ sourceRowIndex: number;
9
+ }
10
+ /**
11
+ * This is the type of the root RowNode of the ClientSideNodeManager
12
+ * ClientSideNodeManager is allowed to update the allLeafChildren and childrenAfterGroup properties of the root node.
13
+ */
14
+ interface ClientSideNodeManagerRootNode<TData> extends RowNode<TData> {
15
+ sibling: ClientSideNodeManagerRootNode<TData>;
16
+ allLeafChildren: ClientSideNodeManagerRowNode<TData>[] | null;
17
+ childrenAfterGroup: ClientSideNodeManagerRowNode<TData>[] | null;
18
+ }
19
+ export declare namespace AbstractClientSideNodeManager {
20
+ type RowNode<TData> = ClientSideNodeManagerRowNode<TData>;
21
+ type RootNode<TData> = ClientSideNodeManagerRootNode<TData>;
22
+ }
23
+ export declare abstract class AbstractClientSideNodeManager<TData = any> extends BeanStub implements IClientSideNodeManager<TData> {
24
+ private nextId;
25
+ protected allNodesMap: {
26
+ [id: string]: RowNode<TData>;
27
+ };
28
+ rootNode: AbstractClientSideNodeManager.RootNode<TData> | null;
29
+ getRowNode(id: string): RowNode | undefined;
30
+ extractRowData(): TData[] | null | undefined;
31
+ activate(rootNode: ClientSideNodeManagerRootNode<TData>): void;
32
+ deactivate(): void;
33
+ destroy(): void;
34
+ setNewRowData(rowData: TData[]): void;
35
+ private updateRootSiblingArrays;
36
+ protected loadNewRowData(rowData: TData[]): void;
37
+ setImmutableRowData(params: RefreshModelParams<TData>, rowData: TData[]): void;
38
+ /** Called when a node needs to be deleted */
39
+ protected rowNodeDeleted(node: RowNode<TData>): void;
40
+ updateRowData(rowDataTran: RowDataTransaction<TData>, changedRowNodes: IChangedRowNodes<TData>): ClientSideNodeManagerUpdateRowDataResult<TData>;
41
+ protected executeAdd(rowDataTran: RowDataTransaction, result: ClientSideNodeManagerUpdateRowDataResult<TData>): void;
42
+ protected executeRemove(getRowIdFunc: GetRowIdFunc<TData> | undefined, rowDataTran: RowDataTransaction, { changedRowNodes, rowNodeTransaction }: ClientSideNodeManagerUpdateRowDataResult<TData>, nodesToUnselect: RowNode<TData>[]): void;
43
+ protected executeUpdate(getRowIdFunc: GetRowIdFunc<TData> | undefined, rowDataTran: RowDataTransaction, { changedRowNodes, rowNodeTransaction }: ClientSideNodeManagerUpdateRowDataResult<TData>, nodesToUnselect: RowNode<TData>[]): void;
44
+ protected dispatchRowDataUpdateStartedEvent(rowData?: TData[] | null): void;
45
+ protected deselectNodes(nodesToUnselect: RowNode<TData>[]): void;
46
+ private sanitizeAddIndex;
47
+ protected createRowNode(data: TData, sourceRowIndex: number): RowNode<TData>;
48
+ protected lookupRowNode(getRowIdFunc: ((data: any) => string) | undefined, data: TData): RowNode<TData> | null;
49
+ }
50
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { RowNode, IRowNode } from 'ag-grid-community';
2
+ export declare class ChangedRowNodes<TData = any> {
3
+ readonly removals: Set<RowNode<TData>>;
4
+ readonly updates: Set<RowNode<TData>>;
5
+ readonly adds: Set<RowNode<TData>>;
6
+ /** Marks a row as removed. Order of operations is: remove, update, add */
7
+ remove(node: IRowNode<TData>): void;
8
+ /** Marks a row as updated. Order of operations is: remove, update, add */
9
+ update(node: IRowNode<TData>): void;
10
+ /** Marks a row as added. Order of operation is: remove, update, add */
11
+ add(node: IRowNode<TData>): void;
12
+ }
@@ -0,0 +1,5 @@
1
+ import type { NamedBean } from 'ag-grid-community';
2
+ import { AbstractClientSideNodeManager } from './abstractClientSideNodeManager';
3
+ export declare class ClientSideNodeManager<TData> extends AbstractClientSideNodeManager<TData> implements NamedBean {
4
+ beanName: "csrmNodeSvc";
5
+ }
@@ -0,0 +1,129 @@
1
+ import { BeanStub, RowNode, IClientSideRowModel, RefreshModelParams, ChangedPath } from 'ag-grid-community';
2
+ import type { NamedBean, BeanCollection, RowBounds, RowModelType, RowDataTransaction, RowNodeTransaction } from 'ag-grid-community';
3
+ export declare class ClientSideRowModel extends BeanStub implements IClientSideRowModel, NamedBean {
4
+ beanName: "rowModel";
5
+ private colModel;
6
+ private valueCache?;
7
+ private filterStage?;
8
+ private sortStage?;
9
+ private flattenStage?;
10
+ private groupStage?;
11
+ private aggStage?;
12
+ private pivotStage?;
13
+ private filterAggStage?;
14
+ wireBeans(beans: BeanCollection): void;
15
+ rootNode: RowNode | null;
16
+ private rowsToDisplay;
17
+ private nodeManager;
18
+ private rowDataTransactionBatch;
19
+ /** Keep track if row data was updated. Important with suppressModelUpdateAfterUpdateTransaction and refreshModel api is called */
20
+ private rowDataUpdatedPending;
21
+ private applyAsyncTransactionsTimeout;
22
+ /** Has the start method been called */
23
+ private started;
24
+ /**
25
+ * This is to prevent refresh model being called when it's already being called.
26
+ * E.g. the group stage can trigger initial state filter model to be applied. This fires onFilterChanged,
27
+ * which then triggers the listener here that calls refresh model again but at the filter stage
28
+ * (which is about to be run by the original call).
29
+ */
30
+ private isRefreshingModel;
31
+ private rowNodesCountReady;
32
+ private rowCountReady;
33
+ private orderedStages;
34
+ postConstruct(): void;
35
+ private getNewNodeManager;
36
+ private addPropertyListeners;
37
+ start(): void;
38
+ private setInitialData;
39
+ ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean;
40
+ private onPropChange;
41
+ private setRowTopAndRowIndex;
42
+ private clearRowTopAndRowIndex;
43
+ isLastRowIndexKnown(): boolean;
44
+ getRowCount(): number;
45
+ /**
46
+ * Returns the number of rows with level === 1
47
+ */
48
+ getTopLevelRowCount(): number;
49
+ /**
50
+ * Get the row display index by the top level index
51
+ * top level index is the index of rows with level === 1
52
+ */
53
+ getTopLevelRowDisplayedIndex(topLevelIndex: number): number;
54
+ /**
55
+ * The opposite of `getTopLevelRowDisplayedIndex`
56
+ */
57
+ getTopLevelIndexFromDisplayedIndex(displayedIndex: number): number;
58
+ getRowBounds(index: number): RowBounds | null;
59
+ onRowGroupOpened(): void;
60
+ private onFilterChanged;
61
+ private onSortChanged;
62
+ getType(): RowModelType;
63
+ private onValueChanged;
64
+ private createChangePath;
65
+ private isSuppressModelUpdateAfterUpdateTransaction;
66
+ refreshModel(params: RefreshModelParams): void;
67
+ isEmpty(): boolean;
68
+ isRowsToRender(): boolean;
69
+ getNodesInRangeForSelection(firstInRange: RowNode, lastInRange: RowNode): RowNode[];
70
+ getTopLevelNodes(): RowNode[] | null;
71
+ getRow(index: number): RowNode;
72
+ isRowPresent(rowNode: RowNode): boolean;
73
+ getRowIndexAtPixel(pixelToMatch: number): number;
74
+ private isRowInPixel;
75
+ forEachLeafNode(callback: (node: RowNode, index: number) => void): void;
76
+ forEachNode(callback: (node: RowNode, index: number) => void, includeFooterNodes?: boolean): void;
77
+ forEachDisplayedNode(callback: (rowNode: RowNode<any>, index: number) => void): void;
78
+ forEachNodeAfterFilter(callback: (node: RowNode, index: number) => void, includeFooterNodes?: boolean): void;
79
+ forEachNodeAfterFilterAndSort(callback: (node: RowNode, index: number) => void, includeFooterNodes?: boolean): void;
80
+ forEachPivotNode(callback: (node: RowNode, index: number) => void, includeFooterNodes?: boolean, afterSort?: boolean): void;
81
+ /**
82
+ * Iterate through each node and all of its children
83
+ * @param callback the function to execute for each node
84
+ * @param includeFooterNodes whether to also iterate over footer nodes
85
+ * @param nodes the nodes to start iterating over
86
+ * @param getChildren a function to determine the recursion strategy
87
+ * @param startIndex the index to start from
88
+ * @returns the index ended at
89
+ */
90
+ private depthFirstSearchRowNodes;
91
+ doAggregate(changedPath?: ChangedPath): void;
92
+ private doFilterAggregates;
93
+ private doSort;
94
+ private doRowGrouping;
95
+ private doFilter;
96
+ private doPivot;
97
+ getRowNode(id: string): RowNode | undefined;
98
+ batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void;
99
+ flushAsyncTransactions(): void;
100
+ private executeBatchUpdateRowData;
101
+ /**
102
+ * Used to apply transaction changes.
103
+ * Called by gridApi & rowDragFeature
104
+ */
105
+ updateRowData(rowDataTran: RowDataTransaction): RowNodeTransaction | null;
106
+ /**
107
+ * Common to:
108
+ * - executeBatchUpdateRowData (batch transactions)
109
+ * - updateRowData (single transaction)
110
+ * - setImmutableRowData (generated transaction)
111
+ *
112
+ * @param rowNodeTrans - the transactions to apply
113
+ * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex
114
+ */
115
+ private commitTransactions;
116
+ private doRowsToDisplay;
117
+ onRowHeightChanged(): void;
118
+ resetRowHeights(): void;
119
+ private resetRowHeightsForAllRowNodes;
120
+ private onGridStylesChanges;
121
+ private onGridReady;
122
+ isRowDataLoaded(): boolean;
123
+ destroy(): void;
124
+ private onRowHeightChanged_debounced;
125
+ /**
126
+ * @deprecated v33.1
127
+ */
128
+ onRowHeightChangedDebounced(): void;
129
+ }
@@ -0,0 +1,12 @@
1
+ import type { BeanCollection, ClientSideRowModelStep, IRowNode, RowDataTransaction, RowNodeTransaction } from 'ag-grid-community';
2
+ export declare function onGroupExpandedOrCollapsed(beans: BeanCollection): void;
3
+ export declare function refreshClientSideRowModel(beans: BeanCollection, step?: ClientSideRowModelStep): void;
4
+ export declare function isRowDataEmpty(beans: BeanCollection): boolean;
5
+ export declare function forEachLeafNode<TData = any>(beans: BeanCollection, callback: (rowNode: IRowNode<TData>) => void): void;
6
+ export declare function forEachNodeAfterFilter<TData = any>(beans: BeanCollection, callback: (rowNode: IRowNode<TData>, index: number) => void): void;
7
+ export declare function forEachNodeAfterFilterAndSort<TData = any>(beans: BeanCollection, callback: (rowNode: IRowNode<TData>, index: number) => void): void;
8
+ export declare function resetRowHeights(beans: BeanCollection): void;
9
+ export declare function applyTransaction<TData = any>(beans: BeanCollection, rowDataTransaction: RowDataTransaction<TData>): RowNodeTransaction<TData> | null | undefined;
10
+ export declare function applyTransactionAsync<TData = any>(beans: BeanCollection, rowDataTransaction: RowDataTransaction<TData>, callback?: (res: RowNodeTransaction<TData>) => void): void;
11
+ export declare function flushAsyncTransactions(beans: BeanCollection): void;
12
+ export declare function getBestCostNodeSelection<TData = any>(beans: BeanCollection): IRowNode<TData>[] | undefined;
@@ -0,0 +1,9 @@
1
+ import type { _ClientSideRowModelGridApi, _ModuleWithApi, _ModuleWithoutApi } from 'ag-grid-community';
2
+ /**
3
+ * @feature Client-Side Row Model
4
+ */
5
+ export declare const ClientSideRowModelModule: _ModuleWithoutApi;
6
+ /**
7
+ * @feature Client-Side Row Model
8
+ */
9
+ export declare const ClientSideRowModelApiModule: _ModuleWithApi<_ClientSideRowModelGridApi<any>>;
@@ -0,0 +1,14 @@
1
+ import type { NamedBean, BeanCollection, GridOptions, RowNode, IRowNodeStage, StageExecuteParams, ClientSideRowModelStage } from 'ag-grid-community';
2
+ import { BeanStub } from 'ag-grid-community';
3
+ export declare function updateRowNodeAfterFilter(rowNode: RowNode): void;
4
+ export declare class FilterStage extends BeanStub implements IRowNodeStage, NamedBean {
5
+ beanName: "filterStage";
6
+ refreshProps: Set<keyof GridOptions<any>>;
7
+ step: ClientSideRowModelStage;
8
+ private filterManager?;
9
+ wireBeans(beans: BeanCollection): void;
10
+ execute(params: StageExecuteParams): void;
11
+ private filter;
12
+ private filterNodes;
13
+ private doingTreeDataFiltering;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { BeanStub } from 'ag-grid-community';
2
+ import type { NamedBean, GridOptions, RowNode, ClientSideRowModelStage, IRowNodeStage, StageExecuteParams } from 'ag-grid-community';
3
+ export declare function updateRowNodeAfterSort(rowNode: RowNode): void;
4
+ export declare class SortStage extends BeanStub implements NamedBean, IRowNodeStage {
5
+ beanName: "sortStage";
6
+ refreshProps: Set<keyof GridOptions<any>>;
7
+ step: ClientSideRowModelStage;
8
+ execute(params: StageExecuteParams): void;
9
+ private sort;
10
+ }
@@ -0,0 +1,8 @@
1
+ import type { IMenuActionParams, MenuItemDef } from 'ag-grid-community';
2
+ /**
3
+ * 显示上下文菜单
4
+ * @param event - 鼠标事件对象,用于获取菜单显示位置
5
+ * @param options - 菜单项定义数组,包含菜单项的配置信息
6
+ * @param agEvent - 菜单操作参数对象,传递给菜单项处理函数
7
+ */
8
+ export declare const showContextMenu: (event: MouseEvent, options: MenuItemDef[], agEvent: IMenuActionParams) => void;
@@ -0,0 +1,12 @@
1
+ import { UnwrapNestedRefs } from "vue";
2
+ /**
3
+ * vue2 翻译jsx片段时在非组件上下文中会生成this.$set 尝试设置属性导致报错 此时使用此方法绕过生成
4
+ * @param hostObject
5
+ * @param path
6
+ */
7
+ export declare const vModel: <T>(hostObject: UnwrapNestedRefs<T>, path: string) => {
8
+ model: {
9
+ value: any;
10
+ callback: (newValue: any) => void;
11
+ };
12
+ };
@@ -0,0 +1,25 @@
1
+ import type { PluginObject } from 'vue';
2
+ import type { ColDef, ColGroupDef, ICellRendererParams } from 'ag-grid-community';
3
+ import type { RestrictedAgGridOptions } from './ag-grid/options/ag-grid-options';
4
+ import 'ag-grid-community/styles/ag-grid.css';
5
+ import 'ag-grid-community/styles/ag-theme-alpine.css';
6
+ import "@scvzerng/vue2-context-menu/lib/vue2-context-menu.css";
7
+ export * from './GridDataSource';
8
+ export * from './tokens';
9
+ export * from './utils/GridUtils';
10
+ export { default as Grid } from './Grid.vue';
11
+ export * from './renders';
12
+ export * from "./helper/vModel";
13
+ export * from "./search";
14
+ export type Options<TData = any> = RestrictedAgGridOptions<TData>;
15
+ export type Column<T = any> = ColDef<T> | ColGroupDef<T>;
16
+ export type ContextMenuItem<TData> = {
17
+ name: string;
18
+ icon?: string;
19
+ subMenu?: ContextMenuItem<TData>[];
20
+ checked?: boolean;
21
+ disabled?: boolean;
22
+ action?: (params: ICellRendererParams<TData>) => void;
23
+ };
24
+ export type RowIdMapper<T> = (data: T) => string;
25
+ export declare const VueGridPlugin: PluginObject<any>;
@@ -0,0 +1,77 @@
1
+ import { CellValue } from './CellValue';
2
+ import { Column, GridApi, IRowNode } from 'ag-grid-community';
3
+ import { RowSpans } from './SpanInfo';
4
+ import { ProjectionRow } from './ProjectionRow';
5
+ import { GridRow } from './GridRow';
6
+ import { EditableRow } from './EditableRow';
7
+ import { RowIdMapper } from '../../index';
8
+ import { GridDataCache } from '../../GridDataCache';
9
+ /**
10
+ * 实际行
11
+ */
12
+ export declare class ActualRow<T> implements GridRow<T> {
13
+ /**
14
+ * 唯一编号
15
+ */
16
+ id: string;
17
+ /**
18
+ * 数据
19
+ */
20
+ data: T;
21
+ /**
22
+ * 可以进行路径访问的单元格映射
23
+ */
24
+ pathCells: Map<string, CellValue | CellValue[]>;
25
+ /**
26
+ * 签名
27
+ */
28
+ signature: string;
29
+ /**
30
+ * 每行的最后一个单元格
31
+ */
32
+ leafCells: CellValue[];
33
+ /**
34
+ * 合并行信息
35
+ */
36
+ spanCache: RowSpans;
37
+ gridApi: GridApi<GridRow<T>>;
38
+ idMapper: RowIdMapper<T>;
39
+ dataCache: GridDataCache<T>;
40
+ /**
41
+ * 当前数据在列表中的索引
42
+ */
43
+ index?: number;
44
+ constructor(data: T, gridApi: GridApi<GridRow<T>>, idMapper: RowIdMapper<T>, dataCache: GridDataCache<T>, index?: number);
45
+ delete(): void;
46
+ redraw(): void;
47
+ getDataIndex(): number;
48
+ getRowSpans(): RowSpans;
49
+ getSignature(): string;
50
+ startEditing(redraw?: boolean): EditableRow<T>;
51
+ /**
52
+ * 设置数据当前在集合的位置
53
+ * 在设置表格数据时每次自行更新不可外部手动调用
54
+ * @param index
55
+ */
56
+ __setIndex(index: number): void;
57
+ /**
58
+ * 更新数据
59
+ * @param id
60
+ * @param data
61
+ */
62
+ update(id: string, data: T): void;
63
+ isTransient(): this is EditableRow<T>;
64
+ getId(): string;
65
+ isEditing(): this is EditableRow<T>;
66
+ getData(): T;
67
+ buildSpan(): void;
68
+ /**
69
+ * 把嵌套的数组结构扁平化以便表格渲染对应的行数
70
+ */
71
+ flat(): ProjectionRow<T>[];
72
+ private getLeafCells;
73
+ getCell(column: Column, nestingIndexes: number[]): CellValue | undefined;
74
+ getValue(column: Column, nestingIndexes: number[]): any;
75
+ setData(data: T): void;
76
+ match(rowNode: IRowNode<GridRow<T>>): boolean;
77
+ }
@@ -0,0 +1,37 @@
1
+ import { Column } from 'ag-grid-community';
2
+ export declare class CellValue {
3
+ id: string;
4
+ /**
5
+ * 值从哪个字段提取的
6
+ */
7
+ field: string;
8
+ /**
9
+ * 属性值
10
+ */
11
+ value: any;
12
+ index?: number;
13
+ /**
14
+ * 复杂标的值对象,只有在提取的值不是一个单元格可渲染的简单值时才会存在 否则应该为空
15
+ */
16
+ properties: Map<string, CellValue | CellValue[]>;
17
+ parent?: CellValue;
18
+ /**
19
+ * 合并单元格行数
20
+ */
21
+ spanRow: number;
22
+ path: string;
23
+ constructor(id: string, field: string, value: any, index?: number, parent?: CellValue);
24
+ getRoot(): CellValue | undefined;
25
+ pretreatmentValue(field: string, parent: CellValue, column: Column): CellValue | CellValue[];
26
+ /**
27
+ * 只要子路径包含数组元素就需要合并行
28
+ * @private
29
+ */
30
+ private isNeedSpan;
31
+ get(field: string): CellValue | CellValue[] | undefined;
32
+ calcSpan(): number;
33
+ private setRowSpan;
34
+ getPath(): string;
35
+ getReadPath(): string;
36
+ isArrayElement(): boolean;
37
+ }
@@ -0,0 +1,52 @@
1
+ import { ActualRow } from './ActualRow';
2
+ import { UnwrapNestedRefs } from 'vue';
3
+ import { GridRow } from './GridRow';
4
+ import { Column, IRowNode } from 'ag-grid-community';
5
+ import { RowIdMapper } from '../../index';
6
+ import { ProjectionRow } from './ProjectionRow';
7
+ import { RowSpans } from './SpanInfo';
8
+ /**
9
+ * 可编辑行
10
+ */
11
+ export declare class EditableRow<T = any> implements GridRow<T> {
12
+ private actualRow;
13
+ private draft?;
14
+ private transient;
15
+ private readonly idMapper;
16
+ constructor(actualRow: ActualRow<T>, idMapper: RowIdMapper<T>, transient?: boolean);
17
+ delete(): void;
18
+ redraw(): void;
19
+ getDataIndex(): number;
20
+ getSignature(): string;
21
+ getValue(column: Column, nestingIndexes: number[]): string | boolean | number;
22
+ getData(): T;
23
+ isTransient(): this is EditableRow<T>;
24
+ getCell(column: Column, nestingIndexes: number[]): import("./CellValue").CellValue | undefined;
25
+ __setIndex(index: number): void;
26
+ /**
27
+ * 结束编辑
28
+ */
29
+ stopEditing(redraw?: boolean): ActualRow<T>;
30
+ /**
31
+ * 编辑中
32
+ */
33
+ isEditing(): this is EditableRow<T>;
34
+ /**
35
+ * 获取编辑草稿信息
36
+ */
37
+ getDraft(): UnwrapNestedRefs<T> | undefined;
38
+ getId(): string;
39
+ flat(): ProjectionRow<T>[];
40
+ /**
41
+ * 持久化数据 让数据从瞬态转为持久态
42
+ *
43
+ * 不改变当前的编辑状态
44
+ *
45
+ * @param persistentCallback
46
+ */
47
+ persistent(persistentCallback: (row: T) => Promise<T>): Promise<this>;
48
+ getRowSpans(): RowSpans;
49
+ setData(data: T): void;
50
+ buildSpan(): void;
51
+ match(rowNode: IRowNode<GridRow<T>>): boolean;
52
+ }
@@ -0,0 +1,30 @@
1
+ import { Column, IRowNode } from 'ag-grid-community';
2
+ import { ActualRow } from './ActualRow';
3
+ import { EditableRow } from './EditableRow';
4
+ import { CellValue } from './CellValue';
5
+ import { RowSpans } from './SpanInfo';
6
+ export interface GridRow<T> {
7
+ getValue(column: Column, nestingIndexes?: number[]): string | boolean | number;
8
+ isEditing(): this is EditableRow<T>;
9
+ getData(): T;
10
+ getId(): string;
11
+ isTransient(): this is EditableRow<T>;
12
+ getCell(column: Column, nestingIndexes?: number[]): CellValue | undefined;
13
+ getSignature(): string;
14
+ getRowSpans(): RowSpans;
15
+ setData(data: T): void;
16
+ /**
17
+ * 构建行span信息
18
+ */
19
+ buildSpan(): void;
20
+ /**
21
+ * 是否匹配
22
+ * @param rowNode
23
+ */
24
+ match(rowNode: IRowNode<GridRow<T>>): boolean;
25
+ getDataIndex(): number;
26
+ redraw(): void;
27
+ delete(): void;
28
+ }
29
+ export declare const isGridRow: <T>(row: any) => row is GridRow<T>;
30
+ export declare const isActualRow: <T extends object>(row: any) => row is ActualRow<T>;
@@ -0,0 +1,43 @@
1
+ import { Column, IRowNode } from 'ag-grid-community';
2
+ import { ActualRow } from './ActualRow';
3
+ import { GridRow } from './GridRow';
4
+ import { EditableRow } from './EditableRow';
5
+ import { RowSpans } from './SpanInfo';
6
+ /**
7
+ * 投影行
8
+ *
9
+ * 行合并时分裂的投影行
10
+ */
11
+ export declare class ProjectionRow<T> implements GridRow<T> {
12
+ /**
13
+ * 引用数据
14
+ *
15
+ * 如果发现该行存在引用数据 说明该行为虚拟行无实际意义 需要取引用数据
16
+ */
17
+ actualRow: ActualRow<T> | EditableRow<T>;
18
+ /**
19
+ * 投影行ID
20
+ */
21
+ id: string;
22
+ constructor(id: string, actualRow: ActualRow<T> | EditableRow<T>);
23
+ delete(): void;
24
+ redraw(): void;
25
+ getDataIndex(): number;
26
+ getRowSpans(): RowSpans;
27
+ isEditing(): this is EditableRow<T>;
28
+ getValue(column: Column): string | boolean | number;
29
+ getRowSpan(column: Column): number;
30
+ getData(): T;
31
+ isColumnValueChanged(value: any, column: Column): boolean;
32
+ getNestingIndexes(): number[];
33
+ /**
34
+ * 获取该行节点的签名 当前面变化时所有可视单元格需要重新渲染
35
+ */
36
+ getSignature(): string;
37
+ getId(): string;
38
+ getCell(column: Column): import("./CellValue").CellValue | undefined;
39
+ isTransient(): this is EditableRow<T>;
40
+ setData(data: T): void;
41
+ buildSpan(): void;
42
+ match(rowNode: IRowNode<GridRow<T>>): boolean;
43
+ }
@@ -0,0 +1,25 @@
1
+ import { Column } from 'ag-grid-community';
2
+ import { CellValue } from './CellValue';
3
+ /**
4
+ * 存储每行数据的行span信息
5
+ */
6
+ export declare class RowSpans {
7
+ private cellSpanCache;
8
+ private static SPLITTER;
9
+ get(rowId: string, column: Column): number;
10
+ set(rowId: string, column: Column, span: number): void;
11
+ private getKey;
12
+ constructor(cells: CellValue[], columns: Column[]);
13
+ /**
14
+ * 递归计算每个叶子节点路径上的span信息
15
+ *
16
+ * 对于同属于一个父节点的节点只会在第一个节点时保存 其余节点全部忽略,
17
+ * 因为在展开行时对于ag-grid 只有在合并单元格的第一个单元格返回合并信息 剩余的单元格不能返回合并信息必须返回0所以只记录第一个节点的合并信息
18
+ * @param id 叶子节点单元格的ID 即展开行后的行ID
19
+ * @param cell 当前节点
20
+ * @param columns 列配置
21
+ * @private
22
+ */
23
+ private calcSpanInfo;
24
+ private processDeep;
25
+ }
@@ -0,0 +1,15 @@
1
+ import { CreateElement, RenderContext, VNode } from 'vue';
2
+ import { ICellRendererParams } from 'ag-grid-community';
3
+ declare const _default: {
4
+ functional: boolean;
5
+ props: {
6
+ params: {
7
+ type: ObjectConstructor;
8
+ required: boolean;
9
+ };
10
+ };
11
+ render(createElement: CreateElement, context: RenderContext<{
12
+ params: ICellRendererParams;
13
+ }>): VNode | VNode[];
14
+ };
15
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { ICustomCellRendererParams } from './types/ICellRendererParamsExt';
2
+ import { GridRow } from '../model/row/GridRow';
3
+ type __VLS_Props = {
4
+ params: ICustomCellRendererParams<GridRow<any>, any>;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
+ export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -0,0 +1,15 @@
1
+ import { ICellRendererParams } from 'ag-grid-community';
2
+ type __VLS_Props = {
3
+ params: ICellRendererParams;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -0,0 +1,15 @@
1
+ import type { IHeaderParams } from 'ag-grid-community';
2
+ type __VLS_Props = {
3
+ params: IHeaderParams;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -0,0 +1,11 @@
1
+ import { CreateElement, RenderContext, VNode } from 'vue';
2
+ import { ICustomCellRendererParams } from './types/ICellRendererParamsExt';
3
+ declare const _default: {
4
+ functional: boolean;
5
+ name: string;
6
+ props: string[];
7
+ render(createElement: CreateElement, context: RenderContext<{
8
+ params: ICustomCellRendererParams<any, any>;
9
+ }>): VNode | VNode[];
10
+ };
11
+ export default _default;