@visactor/vtable 1.5.3-alpha.1 → 1.5.3

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 (147) hide show
  1. package/cjs/ListTable.d.ts +1 -2
  2. package/cjs/ListTable.js +194 -26
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotTable.d.ts +1 -1
  5. package/cjs/PivotTable.js +3 -3
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/core/BaseTable.d.ts +3 -5
  8. package/cjs/core/BaseTable.js +79 -8
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/tableHelper.d.ts +2 -0
  11. package/cjs/core/tableHelper.js +18 -9
  12. package/cjs/core/tableHelper.js.map +1 -1
  13. package/cjs/data/CachedDataSource.d.ts +1 -10
  14. package/cjs/data/CachedDataSource.js +3 -78
  15. package/cjs/data/CachedDataSource.js.map +1 -1
  16. package/cjs/dataset/statistics-helper.js +1 -0
  17. package/cjs/edit/edit-manager.d.ts +1 -1
  18. package/cjs/edit/edit-manager.js +4 -5
  19. package/cjs/edit/edit-manager.js.map +1 -1
  20. package/cjs/event/listener/container-dom.js +6 -5
  21. package/cjs/event/listener/container-dom.js.map +1 -1
  22. package/cjs/event/listener/table-group.js.map +1 -1
  23. package/cjs/event/scroll.js +6 -4
  24. package/cjs/event/scroll.js.map +1 -1
  25. package/cjs/index.d.ts +1 -1
  26. package/cjs/index.js +1 -1
  27. package/cjs/index.js.map +1 -1
  28. package/cjs/layout/layout-helper.js +2 -2
  29. package/cjs/layout/layout-helper.js.map +1 -1
  30. package/cjs/layout/row-height-map.js +0 -1
  31. package/cjs/layout/simple-header-layout.d.ts +2 -1
  32. package/cjs/layout/simple-header-layout.js +88 -2
  33. package/cjs/layout/simple-header-layout.js.map +1 -1
  34. package/cjs/plugins/icons.js +1 -1
  35. package/cjs/plugins/themes.js +1 -1
  36. package/cjs/scenegraph/group-creater/cell-helper.js +6 -11
  37. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  38. package/cjs/scenegraph/group-creater/column-helper.js +2 -7
  39. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  40. package/cjs/scenegraph/scenegraph.js +1 -1
  41. package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
  42. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  43. package/cjs/scenegraph/utils/get-hierarchy-offset.js +8 -6
  44. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  45. package/cjs/state/select/is-cell-select-highlight.d.ts +1 -0
  46. package/cjs/state/select/is-cell-select-highlight.js +8 -2
  47. package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
  48. package/cjs/themes/theme.d.ts +0 -2
  49. package/cjs/themes/theme.js +4 -12
  50. package/cjs/themes/theme.js.map +1 -1
  51. package/cjs/tools/helper.js.map +1 -1
  52. package/cjs/ts-types/base-table.d.ts +0 -9
  53. package/cjs/ts-types/base-table.js.map +1 -1
  54. package/cjs/ts-types/new-data-set.d.ts +0 -1
  55. package/cjs/ts-types/new-data-set.js.map +1 -1
  56. package/cjs/ts-types/table-engine.d.ts +1 -9
  57. package/cjs/ts-types/table-engine.js.map +1 -1
  58. package/cjs/ts-types/theme.d.ts +0 -1
  59. package/cjs/ts-types/theme.js.map +1 -1
  60. package/cjs/vrender.js.map +1 -1
  61. package/dist/vtable.js +2901 -3149
  62. package/dist/vtable.min.js +2 -2
  63. package/es/ListTable.d.ts +1 -2
  64. package/es/ListTable.js +192 -30
  65. package/es/ListTable.js.map +1 -1
  66. package/es/PivotTable.d.ts +1 -1
  67. package/es/PivotTable.js +3 -3
  68. package/es/PivotTable.js.map +1 -1
  69. package/es/core/BaseTable.d.ts +3 -5
  70. package/es/core/BaseTable.js +83 -11
  71. package/es/core/BaseTable.js.map +1 -1
  72. package/es/core/tableHelper.d.ts +2 -0
  73. package/es/core/tableHelper.js +16 -6
  74. package/es/core/tableHelper.js.map +1 -1
  75. package/es/data/CachedDataSource.d.ts +1 -10
  76. package/es/data/CachedDataSource.js +0 -79
  77. package/es/data/CachedDataSource.js.map +1 -1
  78. package/es/dataset/statistics-helper.js +2 -1
  79. package/es/edit/edit-manager.d.ts +1 -1
  80. package/es/edit/edit-manager.js +5 -4
  81. package/es/edit/edit-manager.js.map +1 -1
  82. package/es/event/listener/container-dom.js +7 -4
  83. package/es/event/listener/container-dom.js.map +1 -1
  84. package/es/event/listener/table-group.js.map +1 -1
  85. package/es/event/scroll.js +6 -4
  86. package/es/event/scroll.js.map +1 -1
  87. package/es/index.d.ts +1 -1
  88. package/es/index.js +1 -1
  89. package/es/index.js.map +1 -1
  90. package/es/layout/layout-helper.js +2 -2
  91. package/es/layout/layout-helper.js.map +1 -1
  92. package/es/layout/row-height-map.js +1 -2
  93. package/es/layout/simple-header-layout.d.ts +2 -1
  94. package/es/layout/simple-header-layout.js +87 -3
  95. package/es/layout/simple-header-layout.js.map +1 -1
  96. package/es/plugins/icons.js +1 -1
  97. package/es/plugins/themes.js +1 -1
  98. package/es/scenegraph/group-creater/cell-helper.js +6 -11
  99. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  100. package/es/scenegraph/group-creater/column-helper.js +2 -7
  101. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  102. package/es/scenegraph/scenegraph.js +1 -1
  103. package/es/scenegraph/utils/get-cell-merge.js +1 -1
  104. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  105. package/es/scenegraph/utils/get-hierarchy-offset.js +9 -7
  106. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  107. package/es/state/select/is-cell-select-highlight.d.ts +1 -0
  108. package/es/state/select/is-cell-select-highlight.js +5 -0
  109. package/es/state/select/is-cell-select-highlight.js.map +1 -1
  110. package/es/themes/theme.d.ts +0 -2
  111. package/es/themes/theme.js +4 -11
  112. package/es/themes/theme.js.map +1 -1
  113. package/es/tools/helper.js.map +1 -1
  114. package/es/ts-types/base-table.d.ts +0 -9
  115. package/es/ts-types/base-table.js.map +1 -1
  116. package/es/ts-types/new-data-set.d.ts +0 -1
  117. package/es/ts-types/new-data-set.js.map +1 -1
  118. package/es/ts-types/table-engine.d.ts +1 -9
  119. package/es/ts-types/table-engine.js.map +1 -1
  120. package/es/ts-types/theme.d.ts +0 -1
  121. package/es/ts-types/theme.js.map +1 -1
  122. package/es/vrender.js.map +1 -1
  123. package/package.json +5 -5
  124. package/cjs/core/group-helper.d.ts +0 -6
  125. package/cjs/core/group-helper.js +0 -22
  126. package/cjs/core/group-helper.js.map +0 -1
  127. package/cjs/core/record-helper.d.ts +0 -6
  128. package/cjs/core/record-helper.js +0 -230
  129. package/cjs/core/record-helper.js.map +0 -1
  130. package/cjs/core/style-helper.d.ts +0 -3
  131. package/cjs/core/style-helper.js +0 -110
  132. package/cjs/core/style-helper.js.map +0 -1
  133. package/cjs/layout/cell-range/simple-cell-range.d.ts +0 -4
  134. package/cjs/layout/cell-range/simple-cell-range.js +0 -106
  135. package/cjs/layout/cell-range/simple-cell-range.js.map +0 -1
  136. package/es/core/group-helper.d.ts +0 -6
  137. package/es/core/group-helper.js +0 -14
  138. package/es/core/group-helper.js.map +0 -1
  139. package/es/core/record-helper.d.ts +0 -6
  140. package/es/core/record-helper.js +0 -220
  141. package/es/core/record-helper.js.map +0 -1
  142. package/es/core/style-helper.d.ts +0 -3
  143. package/es/core/style-helper.js +0 -86
  144. package/es/core/style-helper.js.map +0 -1
  145. package/es/layout/cell-range/simple-cell-range.d.ts +0 -4
  146. package/es/layout/cell-range/simple-cell-range.js +0 -99
  147. package/es/layout/cell-range/simple-cell-range.js.map +0 -1
@@ -1,6 +0,0 @@
1
- import type { ListTable } from '../ListTable';
2
- export declare function sortRecords(table: ListTable): void;
3
- export declare function listTableAddRecord(record: any, recordIndex: number, table: ListTable): void;
4
- export declare function listTableAddRecords(records: any[], recordIndex: number, table: ListTable): void;
5
- export declare function listTableDeleteRecords(recordIndexs: number[], table: ListTable): void;
6
- export declare function listTableUpdateRecords(records: any[], recordIndexs: number[], table: ListTable): void;
@@ -1,220 +0,0 @@
1
- import { defaultOrderFn } from "../tools/util";
2
-
3
- export function sortRecords(table) {
4
- var _a;
5
- if (table.sortState) {
6
- let order, field;
7
- if (Array.isArray(table.sortState) ? 0 !== table.sortState.length && ({order: order, field: field} = null === (_a = table.sortState) || void 0 === _a ? void 0 : _a[0]) : ({order: order, field: field} = table.sortState),
8
- order && field && "normal" !== order) {
9
- const sortFunc = table._getSortFuncFromHeaderOption(void 0, field), hd = table.internalProps.layoutMap.headerObjects.find((col => col && col.field === field));
10
- table.dataSource.sort(hd.field, order, null != sortFunc ? sortFunc : defaultOrderFn);
11
- }
12
- }
13
- }
14
-
15
- export function listTableAddRecord(record, recordIndex, table) {
16
- var _a, _b;
17
- if (table.options.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [ record ]),
18
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(),
19
- table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.addRecordForSorted(record),
20
- sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
21
- (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
22
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
23
- table.dataSource.addRecord(record, recordIndex);
24
- const oldRowCount = table.rowCount;
25
- if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(),
26
- void table.scenegraph.createSceneGraph();
27
- const newRowCount = table.transpose ? table.colCount : table.rowCount;
28
- if (table.pagination) {
29
- const {perPageCount: perPageCount, currentPage: currentPage} = table.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
30
- if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(),
31
- table.scenegraph.createSceneGraph(); else {
32
- const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
33
- if (oldRowCount - headerCount === table.pagination.perPageCount) {
34
- const updateRows = [];
35
- for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
36
- col: row,
37
- row: 0
38
- }) : updateRows.push({
39
- col: 0,
40
- row: row
41
- });
42
- table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
43
- } else {
44
- const addRows = [];
45
- for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) table.transpose ? addRows.push({
46
- col: row,
47
- row: 0
48
- }) : addRows.push({
49
- col: 0,
50
- row: row
51
- });
52
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
53
- }
54
- }
55
- } else {
56
- const addRows = [];
57
- for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) table.transpose ? addRows.push({
58
- col: row,
59
- row: 0
60
- }) : addRows.push({
61
- col: 0,
62
- row: row
63
- });
64
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
65
- }
66
- }
67
- }
68
-
69
- export function listTableAddRecords(records, recordIndex, table) {
70
- var _a, _b;
71
- if (table.options.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records),
72
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(),
73
- table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.addRecordsForSorted(records),
74
- sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
75
- void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
76
- const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
77
- table.dataSource.addRecords(records, recordIndex);
78
- const oldRowCount = table.transpose ? table.colCount : table.rowCount;
79
- if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(),
80
- void table.scenegraph.createSceneGraph();
81
- const newRowCount = table.transpose ? table.colCount : table.rowCount;
82
- if (table.pagination) {
83
- const {perPageCount: perPageCount, currentPage: currentPage} = table.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
84
- if (recordIndex < endIndex) if (recordIndex < endIndex - perPageCount) table.scenegraph.clearCells(),
85
- table.scenegraph.createSceneGraph(); else {
86
- const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;
87
- if (oldRowCount - headerCount === table.pagination.perPageCount) {
88
- const updateRows = [];
89
- for (let row = rowNum; row < newRowCount; row++) table.transpose ? updateRows.push({
90
- col: row,
91
- row: 0
92
- }) : updateRows.push({
93
- col: 0,
94
- row: row
95
- });
96
- table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
97
- } else {
98
- const addRows = [];
99
- for (let row = rowNum; row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1)); row++) table.transpose ? addRows.push({
100
- col: row,
101
- row: 0
102
- }) : addRows.push({
103
- col: 0,
104
- row: row
105
- });
106
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
107
- }
108
- }
109
- } else {
110
- const addRows = [];
111
- for (let row = recordIndex + headerCount; row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1); row++) table.transpose ? addRows.push({
112
- col: row,
113
- row: 0
114
- }) : addRows.push({
115
- col: 0,
116
- row: row
117
- });
118
- table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);
119
- }
120
- }
121
- }
122
-
123
- export function listTableDeleteRecords(recordIndexs, table) {
124
- var _a, _b;
125
- if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.options.groupBy) null === (_b = (_a = table.dataSource).deleteRecordsForGroup) || void 0 === _b || _b.call(_a, recordIndexs),
126
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(),
127
- table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs),
128
- sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
129
- const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
130
- if (0 === deletedRecordIndexs.length) return;
131
- const oldRowCount = table.transpose ? table.colCount : table.rowCount;
132
- table.refreshRowColCount();
133
- const newRowCount = table.transpose ? table.colCount : table.rowCount, recordIndexsMinToMax = deletedRecordIndexs.sort(((a, b) => a - b)), minRecordIndex = recordIndexsMinToMax[0];
134
- if (table.pagination) {
135
- const {perPageCount: perPageCount, currentPage: currentPage} = table.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount;
136
- if (minRecordIndex < endIndex) if (minRecordIndex < endIndex - perPageCount) table.scenegraph.clearCells(),
137
- table.scenegraph.createSceneGraph(); else {
138
- const updateRows = [], delRows = [];
139
- for (let row = minRecordIndex - (endIndex - perPageCount) + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount); row < newRowCount; row++) table.transpose ? updateRows.push({
140
- col: row,
141
- row: 0
142
- }) : updateRows.push({
143
- col: 0,
144
- row: row
145
- });
146
- if (newRowCount < oldRowCount) for (let row = newRowCount; row < oldRowCount; row++) table.transpose ? delRows.push({
147
- col: row,
148
- row: 0
149
- }) : delRows.push({
150
- col: 0,
151
- row: row
152
- });
153
- table.transpose ? table.scenegraph.updateCol(delRows, [], updateRows) : table.scenegraph.updateRow(delRows, [], updateRows);
154
- }
155
- } else {
156
- const delRows = [];
157
- for (let index = 0; index < recordIndexsMinToMax.length; index++) {
158
- const rowNum = recordIndexsMinToMax[index] + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);
159
- table.transpose ? delRows.push({
160
- col: rowNum,
161
- row: 0
162
- }) : delRows.push({
163
- col: 0,
164
- row: rowNum
165
- });
166
- }
167
- table.transpose ? table.scenegraph.updateCol(delRows, [], []) : table.scenegraph.updateRow(delRows, [], []);
168
- }
169
- }
170
- }
171
-
172
- export function listTableUpdateRecords(records, recordIndexs, table) {
173
- var _a, _b;
174
- if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.options.groupBy) null === (_b = (_a = table.dataSource).updateRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndexs),
175
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(),
176
- table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.updateRecordsForSorted(records, recordIndexs),
177
- sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
178
- const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);
179
- if (0 === updateRecordIndexs.length) return;
180
- const recordIndexsMinToMax = updateRecordIndexs.sort(((a, b) => a - b));
181
- if (table.pagination) {
182
- const {perPageCount: perPageCount, currentPage: currentPage} = table.pagination, endIndex = perPageCount * (currentPage || 0) + perPageCount, updateRows = [];
183
- for (let index = 0; index < recordIndexsMinToMax.length; index++) {
184
- const recordIndex = recordIndexsMinToMax[index];
185
- if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {
186
- const rowNum = recordIndex - (endIndex - perPageCount) + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);
187
- updateRows.push(rowNum);
188
- }
189
- }
190
- if (updateRows.length >= 1) {
191
- const updateRowCells = [];
192
- for (let index = 0; index < updateRows.length; index++) {
193
- const updateRow = updateRows[index];
194
- table.transpose ? updateRowCells.push({
195
- col: updateRow,
196
- row: 0
197
- }) : updateRowCells.push({
198
- col: 0,
199
- row: updateRow
200
- });
201
- }
202
- table.transpose ? table.scenegraph.updateCol([], [], updateRowCells) : table.scenegraph.updateRow([], [], updateRowCells);
203
- }
204
- } else {
205
- const updateRows = [];
206
- for (let index = 0; index < recordIndexsMinToMax.length; index++) {
207
- const rowNum = recordIndexsMinToMax[index] + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);
208
- table.transpose ? updateRows.push({
209
- col: rowNum,
210
- row: 0
211
- }) : updateRows.push({
212
- col: 0,
213
- row: rowNum
214
- });
215
- }
216
- table.transpose ? table.scenegraph.updateCol([], [], updateRows) : table.scenegraph.updateRow([], [], updateRows);
217
- }
218
- }
219
- }
220
- //# sourceMappingURL=record-helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/record-helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,UAAU,WAAW,CAAC,KAAgB;;IAC1C,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,IAAI,KAAU,CAAC;QACf,IAAI,KAAU,CAAC;QACf,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAChC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAA,KAAK,CAAC,SAAS,0CAAG,CAAC,CAAC,CAAC,CAAC;aAC3C;SACF;aAAM;YACL,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,SAAsB,CAAC,CAAC;SACnD;QAED,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,QAAQ,EAAE;YACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAEtE,MAAM,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;YAGtG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC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AAE,CAAC;gBACtB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAChE,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;oBAChD,MAAM,MAAM,GAAG,WAAW,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1G,IAAI,KAAK,CAAC,SAAS,EAAE;wBACnB,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;qBAC1C;yBAAM;wBACL,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;qBAC1C;iBACF;gBACD,KAAK,CAAC,SAAS;oBACb,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC;oBAChD,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;aACpD;SACF;KAEF;AACH,CAAC","file":"record-helper.js","sourcesContent":["/* eslint-disable max-depth */\nimport type { ListTable } from '../ListTable';\nimport type { CachedDataSource } from '../data';\nimport { defaultOrderFn } from '../tools/util';\nimport type { SortState } from '../ts-types';\n\nexport function sortRecords(table: ListTable) {\n if (table.sortState) {\n let order: any;\n let field: any;\n if (Array.isArray(table.sortState)) {\n if (table.sortState.length !== 0) {\n ({ order, field } = table.sortState?.[0]);\n }\n } else {\n ({ order, field } = table.sortState as SortState);\n }\n // 根据sort规则进行排序\n if (order && field && order !== 'normal') {\n const sortFunc = table._getSortFuncFromHeaderOption(undefined, field);\n // 如果sort传入的信息不能生成正确的sortFunc,直接更新表格,避免首次加载无法正常显示内容\n const hd = table.internalProps.layoutMap.headerObjects.find((col: any) => col && col.field === field);\n\n // hd?.define?.sort && //如果这里也判断 那想要利用sortState来排序 但不显示排序图标就实现不了\n table.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);\n }\n }\n}\n\n/**\n * 添加数据 单条数据\n * @param record 数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecord(record: any, recordIndex: number, table: ListTable) {\n if (table.options.groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.([record]);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordForSorted(record);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecord(record, recordIndex);\n const oldRowCount = table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 添加数据 支持多条数据\n * @param records 多条数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecords(records: any[], recordIndex: number, table: ListTable) {\n if (table.options.groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.(records);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordsForSorted(records);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n } else if (recordIndex < 0) {\n recordIndex = 0;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecords(records, recordIndex);\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (\n let row = rowNum;\n row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1));\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (\n let row = recordIndex + headerCount;\n row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1);\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 删除数据 支持多条数据\n * @param recordIndexs 要删除数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableDeleteRecords(recordIndexs: number[], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if (table.options.groupBy) {\n (table.dataSource as CachedDataSource).deleteRecordsForGroup?.(recordIndexs);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.deleteRecordsForSorted(recordIndexs);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);\n if (deletedRecordIndexs.length === 0) {\n return;\n }\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n const recordIndexsMinToMax = deletedRecordIndexs.sort((a, b) => a - b);\n const minRecordIndex = recordIndexsMinToMax[0];\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (minRecordIndex < endIndex) {\n //删除当前页或者前面的数据才需要更新 如果是删除的是当前页后面的数据不需要更新场景树\n if (minRecordIndex < endIndex - perPageCount) {\n // 如果删除包含当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是仅删除当前页数据\n const minRowNum =\n minRecordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);\n //如果当页数据是满的 则更新影响的部分行\n const updateRows = [];\n const delRows = [];\n\n for (let row = minRowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n if (newRowCount < oldRowCount) {\n //如果如果删除后不满 需要有删除数据\n for (let row = newRowCount; row < oldRowCount; row++) {\n if (table.transpose) {\n delRows.push({ col: row, row: 0 });\n } else {\n delRows.push({ col: 0, row });\n }\n }\n }\n table.transpose\n ? table.scenegraph.updateCol(delRows, [], updateRows)\n : table.scenegraph.updateRow(delRows, [], updateRows);\n }\n }\n } else {\n const delRows = [];\n\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);\n if (table.transpose) {\n delRows.push({ col: rowNum, row: 0 });\n } else {\n delRows.push({ col: 0, row: rowNum });\n }\n }\n table.transpose ? table.scenegraph.updateCol(delRows, [], []) : table.scenegraph.updateRow(delRows, [], []);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\n\n/**\n * 修改数据 支持多条数据\n * @param records 修改数据条目\n * @param recordIndexs 对应修改数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableUpdateRecords(records: any[], recordIndexs: number[], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if (table.options.groupBy) {\n (table.dataSource as CachedDataSource).updateRecordsForGroup?.(records, recordIndexs);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.updateRecordsForSorted(records, recordIndexs);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);\n if (updateRecordIndexs.length === 0) {\n return;\n }\n\n const recordIndexsMinToMax = updateRecordIndexs.sort((a, b) => a - b);\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n const updateRows = [];\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {\n const rowNum =\n recordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);\n updateRows.push(rowNum);\n }\n }\n if (updateRows.length >= 1) {\n const updateRowCells = [];\n for (let index = 0; index < updateRows.length; index++) {\n const updateRow = updateRows[index];\n if (table.transpose) {\n updateRowCells.push({ col: updateRow, row: 0 });\n } else {\n updateRowCells.push({ col: 0, row: updateRow });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRowCells)\n : table.scenegraph.updateRow([], [], updateRowCells);\n }\n } else {\n const updateRows = [];\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount);\n if (table.transpose) {\n updateRows.push({ col: rowNum, row: 0 });\n } else {\n updateRows.push({ col: 0, row: rowNum });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import type { BaseTableAPI } from '../ts-types/base-table';
2
- import type { FullExtendStyle } from '../ts-types';
3
- export declare function getCellStyle(col: number, row: number, table: BaseTableAPI): FullExtendStyle;
@@ -1,86 +0,0 @@
1
- import { mergeStyle } from "../plugins/custom-cell-style";
2
-
3
- import { isLeftOrRightAxis, isTopOrBottomAxis } from "../layout/chart-helper/get-axis-config";
4
-
5
- import { isFunction } from "@visactor/vutils";
6
-
7
- import * as headerStyleContents from "../header-helper/style";
8
-
9
- import * as columnStyleContents from "../body-helper/style";
10
-
11
- const EMPTY_STYLE = {};
12
-
13
- export function getCellStyle(col, row, table) {
14
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15
- const customCellStyle = table.customCellStylePlugin.getCustomCellStyle(col, row), {layoutMap: layoutMap} = table.internalProps;
16
- if (layoutMap.isHeader(col, row)) {
17
- let cacheKey;
18
- if (!table.isPivotTable() || table.isBottomFrozenRow(row) || table.isRightFrozenColumn(col)) cacheKey = `${col}-${row}`; else {
19
- const define = table.getHeaderDefine(col, row), isCorner = table.isCornerHeader(col, row);
20
- cacheKey = (null == define ? void 0 : define.dimensionKey) ? isCorner ? `dim-cor-${define.dimensionKey}` : `dim-${define.dimensionKey}` : (null == define ? void 0 : define.indicatorKey) ? `ind-${define.indicatorKey}` : `${col}-${row}`;
21
- }
22
- let cacheStyle = table.headerStyleCache.get(cacheKey);
23
- if (cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
24
- const hd = layoutMap.getHeader(col, row);
25
- let paddingForAxis;
26
- if (table.isPivotChart() && isTopOrBottomAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
27
- paddingForAxis = null !== (_b = null === (_a = layoutMap.getBody(col, table.rowHeaderLevelCount).style) || void 0 === _a ? void 0 : _a.padding) && void 0 !== _b ? _b : table.theme.bodyStyle.padding;
28
- } else if (table.isPivotChart() && isLeftOrRightAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
29
- paddingForAxis = null !== (_d = null === (_c = layoutMap.getBody(table.columnHeaderLevelCount, row).style) || void 0 === _c ? void 0 : _c.padding) && void 0 !== _d ? _d : table.theme.bodyStyle.padding;
30
- }
31
- if ((!hd || hd.isEmpty) && (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightBottomCorner(col, row) || layoutMap.isCornerHeader(col, row) || layoutMap.isRightTopCorner(col, row))) return EMPTY_STYLE;
32
- const styleClass = table.internalProps.headerHelper.getStyleClass((null == hd ? void 0 : hd.headerType) || "text");
33
- if (layoutMap.isBottomFrozenRow(col, row) && table.theme.bottomFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
34
- padding: paddingForAxis
35
- } : {}, table.theme.bottomFrozenStyle, {
36
- col: col,
37
- row: row,
38
- table: table,
39
- value: table.getCellValue(col, row),
40
- dataValue: table.getCellOriginValue(col, row),
41
- cellHeaderPaths: table.getCellHeaderPaths(col, row)
42
- }, styleClass, table.options.autoWrapText, table.theme); else if (layoutMap.isRightFrozenColumn(col, row) && table.theme.rightFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
43
- padding: paddingForAxis
44
- } : {}, table.theme.rightFrozenStyle, {
45
- col: col,
46
- row: row,
47
- table: table,
48
- value: table.getCellValue(col, row),
49
- dataValue: table.getCellOriginValue(col, row),
50
- cellHeaderPaths: table.getCellHeaderPaths(col, row)
51
- }, styleClass, table.options.autoWrapText, table.theme); else {
52
- const style = (null == hd ? void 0 : hd.style) || {};
53
- paddingForAxis && (style.padding = paddingForAxis), cacheStyle = headerStyleContents.of(style, layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row) ? table.theme.headerStyle : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row) ? table.theme.rowHeaderStyle : table.theme.cornerHeaderStyle, {
54
- col: col,
55
- row: row,
56
- table: table,
57
- value: table.getCellValue(col, row),
58
- dataValue: table.getCellOriginValue(col, row),
59
- cellHeaderPaths: table.getCellHeaderPaths(col, row)
60
- }, styleClass, table.options.autoWrapText, table.theme);
61
- }
62
- return table.headerStyleCache.set(cacheKey, cacheStyle), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
63
- }
64
- let bgColorFunc, cacheKey;
65
- (null === (_f = null === (_e = table.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.mappingRules) && !table.isHeader(col, row) && (null === (_j = null === (_h = null === (_g = table.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.mappingRules) || void 0 === _j || _j.forEach(((mappingRule, i) => {
66
- mappingRule.bgColor && table.internalProps.layoutMap.getIndicatorKey(col, row) === mappingRule.bgColor.indicatorKey && (bgColorFunc = mappingRule.bgColor.mapping);
67
- })));
68
- const cellType = table.getCellType(col, row), rawRecord = table.getCellOriginRecord(col, row);
69
- let cacheStyle;
70
- if (cacheKey = (null == rawRecord ? void 0 : rawRecord.vTableMerge) ? "merge-title" : table.isSeriesNumberInBody(col, row) ? `${col}-series-` + cellType : table.isListTable() && !table.transpose || table.isPivotTable() && table.internalProps.layoutMap.indicatorsAsCol ? col + cellType : row + cellType,
71
- cacheStyle = (null == rawRecord ? void 0 : rawRecord.vTableMerge) ? table.bodyMergeTitleCache.get(cacheKey) : layoutMap.isBottomFrozenRow(row) ? table.bodyBottomStyleCache.get(cacheKey) : table.bodyStyleCache.get(cacheKey),
72
- cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
73
- const column = layoutMap.getBody(col, row), styleClass = table.internalProps.bodyHelper.getStyleClass(table.getCellType(col, row)), style = null == column ? void 0 : column.style;
74
- return cacheStyle = columnStyleContents.of(style, (null == rawRecord ? void 0 : rawRecord.vTableMerge) && table.theme.groupTitleStyle ? table.theme.groupTitleStyle : layoutMap.isBottomFrozenRow(row) && table.theme.bottomFrozenStyle ? table.theme.bottomFrozenStyle : layoutMap.isRightFrozenColumn(col) && table.theme.rightFrozenStyle ? table.theme.rightFrozenStyle : table.theme.bodyStyle, {
75
- col: col,
76
- row: row,
77
- table: table,
78
- value: table.getCellValue(col, row),
79
- dataValue: table.getCellOriginValue(col, row),
80
- cellHeaderPaths: table.getCellHeaderPaths(col, row)
81
- }, styleClass, table.options.autoWrapText, table.theme), bgColorFunc && (cacheStyle = mergeStyle(cacheStyle, {
82
- bgColor: bgColorFunc
83
- })), isFunction(style) || (layoutMap.isBottomFrozenRow(row) ? table.bodyBottomStyleCache.set(cacheKey, cacheStyle) : table.bodyStyleCache.set(cacheKey, cacheStyle)),
84
- customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
85
- }
86
- //# sourceMappingURL=style-helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/style-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,mBAAmB,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,mBAAmB,MAAM,sBAAsB,CAAC;AAI5D,MAAM,WAAW,GAAG,EAAE,CAAC;AAQvB,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,KAAmB;;IACxE,MAAM,eAAe,GAAG,KAAK,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACjF,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,QAAQ,EAAE;QAEZ,IAAI,QAAQ,CAAC;QACb,IAAI,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAE5F,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,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AkB,CAAC,GAAG,EAAE,GAAG,CAAC;KACpD,EACD,UAAU,EACV,KAAK,CAAC,OAAO,CAAC,YAAY,EAC1B,KAAK,CAAC,KAAK,CACZ,CAAC;IACF,IAAI,WAAW,EAAE;QACf,UAAU,GAAG,UAAU,CAAC,UAAiB,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;KACtE;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACtB,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE;YACpC,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SACtD;aAAM;YACL,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SAChD;KACF;IACD,IAAI,eAAe,EAAE;QACnB,OAAO,UAAU,CAAC,UAAiB,EAAE,eAAe,CAAC,CAAC;KACvD;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","file":"style-helper.js","sourcesContent":["import { mergeStyle } from '../plugins/custom-cell-style';\nimport type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout';\nimport { isLeftOrRightAxis, isTopOrBottomAxis } from '../layout/chart-helper/get-axis-config';\nimport { isFunction } from '@visactor/vutils';\nimport * as headerStyleContents from '../header-helper/style';\nimport * as columnStyleContents from '../body-helper/style';\nimport type { BaseTableAPI, HeaderData, PivotTableProtected } from '../ts-types/base-table';\nimport type { ColorPropertyDefine, FullExtendStyle, MappingRule } from '../ts-types';\n\nconst EMPTY_STYLE = {};\n\n/**\n * 获取单元格的样式 内部逻辑使用 获取到的样式并不是计算后的\n * @param col\n * @param row\n * @returns\n */\nexport function getCellStyle(col: number, row: number, table: BaseTableAPI): FullExtendStyle {\n const customCellStyle = table.customCellStylePlugin.getCustomCellStyle(col, row);\n const { layoutMap } = table.internalProps;\n const isHeader = layoutMap.isHeader(col, row);\n if (isHeader) {\n // const cacheKey = `${col}-${row}`;\n let cacheKey;\n if (table.isPivotTable() && !table.isBottomFrozenRow(row) && !table.isRightFrozenColumn(col)) {\n // use dimensionKey&indicatorKey to cache style object in pivot table\n const define = table.getHeaderDefine(col, row) as any;\n const isCorner = table.isCornerHeader(col, row);\n cacheKey = define?.dimensionKey\n ? isCorner\n ? `dim-cor-${define.dimensionKey}`\n : `dim-${define.dimensionKey}`\n : define?.indicatorKey\n ? `ind-${define.indicatorKey}`\n : `${col}-${row}`;\n } else {\n cacheKey = `${col}-${row}`;\n }\n let cacheStyle = table.headerStyleCache.get(cacheKey);\n if (cacheStyle) {\n if (customCellStyle) {\n return mergeStyle(cacheStyle, customCellStyle);\n }\n return cacheStyle;\n }\n const hd = layoutMap.getHeader(col, row);\n\n let paddingForAxis;\n if (\n table.isPivotChart() &&\n isTopOrBottomAxis(col, row, layoutMap as PivotHeaderLayoutMap) &&\n layoutMap.isAxisCell(col, row)\n ) {\n // get chart padding for axis cell\n const chartColumn = layoutMap.getBody(col, table.rowHeaderLevelCount);\n const padding = (chartColumn.style as any)?.padding ?? table.theme.bodyStyle.padding;\n paddingForAxis = padding;\n } else if (\n table.isPivotChart() &&\n isLeftOrRightAxis(col, row, layoutMap as PivotHeaderLayoutMap) &&\n layoutMap.isAxisCell(col, row)\n ) {\n // get chart padding for axis cell\n const chartColumn = layoutMap.getBody(table.columnHeaderLevelCount, row);\n const padding = (chartColumn.style as any)?.padding ?? table.theme.bodyStyle.padding;\n paddingForAxis = padding;\n }\n\n if (\n (!hd || (hd as HeaderData).isEmpty) &&\n (layoutMap.isLeftBottomCorner(col, row) ||\n layoutMap.isRightBottomCorner(col, row) ||\n layoutMap.isCornerHeader(col, row) ||\n layoutMap.isRightTopCorner(col, row))\n ) {\n return EMPTY_STYLE;\n }\n\n const styleClass = table.internalProps.headerHelper.getStyleClass((hd as HeaderData)?.headerType || 'text');\n if (layoutMap.isBottomFrozenRow(col, row) && table.theme.bottomFrozenStyle) {\n cacheStyle = <FullExtendStyle>headerStyleContents.of(\n paddingForAxis ? { padding: paddingForAxis } : {},\n table.theme.bottomFrozenStyle,\n {\n col,\n row,\n table: table as BaseTableAPI,\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.getCellHeaderPaths(col, row)\n },\n styleClass,\n table.options.autoWrapText,\n table.theme\n );\n } else if (layoutMap.isRightFrozenColumn(col, row) && table.theme.rightFrozenStyle) {\n cacheStyle = <FullExtendStyle>headerStyleContents.of(\n paddingForAxis ? { padding: paddingForAxis } : {},\n table.theme.rightFrozenStyle,\n {\n col,\n row,\n table: table as BaseTableAPI,\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.getCellHeaderPaths(col, row)\n },\n styleClass,\n table.options.autoWrapText,\n table.theme\n );\n } else {\n // let defaultStyle;\n // if (layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)) {\n // defaultStyle = table.theme.headerStyle;\n // } else if (table.internalProps.transpose && layoutMap.isRowHeader(col, row)) {\n // defaultStyle = table.theme.headerStyle;\n // } else if (layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)) {\n // defaultStyle = table.theme.rowHeaderStyle;\n // } else {\n // defaultStyle = table.theme.cornerHeaderStyle;\n // }\n // const styleClass = hd.headerType.StyleClass; //BaseHeader文件\n // const { style } = hd;\n const style = hd?.style || {};\n if (paddingForAxis) {\n (style as any).padding = paddingForAxis;\n }\n cacheStyle = <FullExtendStyle>headerStyleContents.of(\n style,\n // defaultStyle,\n layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)\n ? table.theme.headerStyle\n : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)\n ? table.theme.rowHeaderStyle\n : table.theme.cornerHeaderStyle,\n {\n col,\n row,\n table: table as BaseTableAPI,\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.getCellHeaderPaths(col, row)\n },\n styleClass,\n table.options.autoWrapText,\n table.theme\n );\n }\n table.headerStyleCache.set(cacheKey, cacheStyle);\n if (customCellStyle) {\n return mergeStyle(cacheStyle, customCellStyle);\n }\n return cacheStyle;\n }\n\n let bgColorFunc: ColorPropertyDefine;\n // 判断是否有mapping 遍历dataset中mappingRules\n if ((table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules && !table.isHeader(col, row)) {\n (table.internalProps as PivotTableProtected)?.dataConfig?.mappingRules?.forEach(\n (mappingRule: MappingRule, i: number) => {\n if (\n mappingRule.bgColor &&\n (table.internalProps.layoutMap as PivotHeaderLayoutMap).getIndicatorKey(col, row) ===\n mappingRule.bgColor.indicatorKey\n ) {\n bgColorFunc = mappingRule.bgColor.mapping;\n }\n }\n );\n // // 判断是否有mapping 遍历dataset中mappingRules 但这里还需要根据fieldName来判断\n // if (bgColorFunc && typeof bgColorFunc === 'function') {\n // const cellValue = table.getCellOriginValue(col, row);\n // bgColor = bgColorFunc(this, cellValue);\n // }\n }\n\n let cacheKey;\n const cellType = table.getCellType(col, row);\n const rawRecord = table.getCellOriginRecord(col, row);\n\n //如果是主体部分,获取相应的style\n if (rawRecord?.vTableMerge) {\n cacheKey = 'merge-title';\n } else if (table.isSeriesNumberInBody(col, row)) {\n // 如果是行序号\n cacheKey = `${col}-series-` + cellType;\n } else if (\n (table.isListTable() && !(table as any).transpose) ||\n (table.isPivotTable() && (table.internalProps.layoutMap as PivotHeaderLayoutMap).indicatorsAsCol)\n ) {\n cacheKey = col + cellType;\n } else {\n cacheKey = row + cellType;\n }\n let cacheStyle;\n\n if (rawRecord?.vTableMerge) {\n cacheStyle = table.bodyMergeTitleCache.get(cacheKey);\n } else if (layoutMap.isBottomFrozenRow(row)) {\n cacheStyle = table.bodyBottomStyleCache.get(cacheKey);\n } else {\n cacheStyle = table.bodyStyleCache.get(cacheKey);\n }\n if (cacheStyle) {\n if (customCellStyle) {\n return mergeStyle(cacheStyle, customCellStyle);\n }\n return cacheStyle;\n }\n const column = layoutMap.getBody(col, row);\n // const styleClass = column?.cellType?.StyleClass; //BaseColumn文件\n const styleClass = table.internalProps.bodyHelper.getStyleClass(table.getCellType(col, row));\n const style = column?.style;\n cacheStyle = <FullExtendStyle>columnStyleContents.of(\n style,\n rawRecord?.vTableMerge && table.theme.groupTitleStyle\n ? table.theme.groupTitleStyle\n : layoutMap.isBottomFrozenRow(row) && table.theme.bottomFrozenStyle\n ? table.theme.bottomFrozenStyle\n : layoutMap.isRightFrozenColumn(col) && table.theme.rightFrozenStyle\n ? table.theme.rightFrozenStyle\n : table.theme.bodyStyle,\n {\n col,\n row,\n table: table,\n value: table.getCellValue(col, row),\n dataValue: table.getCellOriginValue(col, row),\n cellHeaderPaths: table.getCellHeaderPaths(col, row)\n },\n styleClass,\n table.options.autoWrapText,\n table.theme\n );\n if (bgColorFunc) {\n cacheStyle = mergeStyle(cacheStyle as any, { bgColor: bgColorFunc });\n }\n if (!isFunction(style)) {\n if (layoutMap.isBottomFrozenRow(row)) {\n table.bodyBottomStyleCache.set(cacheKey, cacheStyle);\n } else {\n table.bodyStyleCache.set(cacheKey, cacheStyle);\n }\n }\n if (customCellStyle) {\n return mergeStyle(cacheStyle as any, customCellStyle);\n }\n return cacheStyle;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { CellRange } from '../../ts-types';
2
- import type { SimpleHeaderLayoutMap } from '../simple-header-layout';
3
- export declare function getCellRange(col: number, row: number, layout: SimpleHeaderLayoutMap): CellRange;
4
- export declare function getCellRangeTranspose(col: number, row: number, layout: SimpleHeaderLayoutMap): CellRange;
@@ -1,99 +0,0 @@
1
- export function getCellRange(col, row, layout) {
2
- var _a, _b, _c;
3
- if (-1 === col || -1 === row) return {
4
- start: {
5
- col: col,
6
- row: row
7
- },
8
- end: {
9
- col: col,
10
- row: row
11
- }
12
- };
13
- if (layout._cellRangeMap.has(`$${col}$${row}`)) return layout._cellRangeMap.get(`$${col}$${row}`);
14
- let cellRange = {
15
- start: {
16
- col: col,
17
- row: row
18
- },
19
- end: {
20
- col: col,
21
- row: row
22
- }
23
- };
24
- if (layout.transpose) cellRange = getCellRangeTranspose(col, row, layout); else if (layout.headerLevelCount <= row) {
25
- if (layout.headerLevelCount <= row && (null === (_b = null === (_a = layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
26
- const value = layout._table.getCellValue(col, row);
27
- for (let r = row - 1; r >= layout.headerLevelCount; r--) {
28
- const last_Value = layout._table.getCellValue(col, r);
29
- if ("boolean" == typeof layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell) {
30
- if (value !== last_Value) break;
31
- } else if (!layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell(value, last_Value)) break;
32
- cellRange.start.row = r;
33
- }
34
- for (let r = row + 1; r < layout.rowCount; r++) {
35
- const next_Value = layout._table.getCellValue(col, r);
36
- if ("boolean" == typeof layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell) {
37
- if (value !== next_Value) break;
38
- } else if (!layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell(value, next_Value)) break;
39
- cellRange.end.row = r;
40
- }
41
- }
42
- getTreeTitleMerge(col, row, cellRange, layout);
43
- } else {
44
- const id = layout.getCellId(col, row);
45
- for (let c = col - 1; c >= 0 && id === layout.getCellId(c, row); c--) cellRange.start.col = c;
46
- for (let c = col + 1; c < (null !== (_c = layout.colCount) && void 0 !== _c ? _c : 0) && id === layout.getCellId(c, row); c++) cellRange.end.col = c;
47
- for (let r = row - 1; r >= 0 && id === layout.getCellId(col, r); r--) cellRange.start.row = r;
48
- for (let r = row + 1; r < layout.headerLevelCount && id === layout.getCellId(col, r); r++) cellRange.end.row = r;
49
- }
50
- return layout._cellRangeMap.set(`$${col}$${row}`, cellRange), cellRange;
51
- }
52
-
53
- function getTreeTitleMerge(col, row, cellRange, layout) {
54
- if ("tree" !== layout.rowHierarchyType) return;
55
- const cellRecord = layout._table.getCellRawRecord(col, row);
56
- (null == cellRecord ? void 0 : cellRecord.vTableMerge) && (cellRange.start.col = layout.rowHeaderLevelCount,
57
- cellRange.end.col = layout.colCount - 1, cellRange.start.row = cellRange.end.row = row);
58
- }
59
-
60
- export function getCellRangeTranspose(col, row, layout) {
61
- var _a, _b, _c, _d;
62
- const result = {
63
- start: {
64
- col: col,
65
- row: row
66
- },
67
- end: {
68
- col: col,
69
- row: row
70
- }
71
- };
72
- if (layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount <= col || -1 === col && -1 === row) {
73
- if (layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount <= col && (null === (_b = null === (_a = layout.columnObjects[row]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
74
- const value = layout._table.getCellValue(col, row);
75
- for (let c = col - 1; c >= layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount; c--) {
76
- const last_Value = layout._table.getCellValue(c, row);
77
- if ("boolean" == typeof layout.columnObjects[row].define.mergeCell) {
78
- if (value !== last_Value) break;
79
- } else if (!layout.columnObjects[row].define.mergeCell(value, last_Value)) break;
80
- result.start.col = c;
81
- }
82
- for (let c = col + 1; c < (null !== (_c = layout.colCount) && void 0 !== _c ? _c : 0); c++) {
83
- const next_Value = layout._table.getCellValue(c, row);
84
- if ("boolean" == typeof layout.columnObjects[row].define.mergeCell) {
85
- if (value !== next_Value) break;
86
- } else if (!layout.columnObjects[row].define.mergeCell(value, next_Value)) break;
87
- result.end.col = c;
88
- }
89
- }
90
- return result;
91
- }
92
- const id = layout.getCellId(col, row);
93
- for (let r = row - 1; r >= 0 && id === layout.getCellId(col, r); r--) result.start.row = r;
94
- for (let r = row + 1; r < (null !== (_d = layout.rowCount) && void 0 !== _d ? _d : 0) && id === layout.getCellId(col, r); r++) result.end.row = r;
95
- for (let c = col - 1; c >= 0 && id === layout.getCellId(c, row); c--) result.start.col = c;
96
- for (let c = col + 1; c < layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount && id === layout.getCellId(c, row); c++) result.end.col = c;
97
- return result;
98
- }
99
- //# sourceMappingURL=simple-cell-range.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/layout/cell-range/simple-cell-range.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,MAA6B;;IAClF,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;QAC5B,OAAO;YACL,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YACnB,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;SAClB,CAAC;KACH;IACD,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC,EAAE;QAC9C,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;KACnD;IACD,IAAI,SAAS,GAAc,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IACtE,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,SAAS,GAAG,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;KACrD;SAAM;QAEL,IAAI,MAAM,CAAC,gBAAgB,IAAI,GAAG,EAAE;YAElC,IACE,MAAM,CAAC,gBAAgB,IAAI,GAAG;iBAC9B,MAAC,MAAA,MAAM,CAAC,aAAa,CAAC,GAAG,GAAG,MAAM,CAAC,8BAA8B,CAAC,0CAAE,MAA2B,0CAAE,SAAS,CAAA,EAC1G;gBACA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACnD,KAAK,IAAI,CAAC,GAAG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;AAChB,CAAC","file":"simple-cell-range.js","sourcesContent":["import type { CellRange, TextColumnDefine } from '../../ts-types';\nimport type { SimpleHeaderLayoutMap } from '../simple-header-layout';\n\nexport function getCellRange(col: number, row: number, layout: SimpleHeaderLayoutMap): CellRange {\n if (col === -1 || row === -1) {\n return {\n start: { col, row },\n end: { col, row }\n };\n }\n if (layout._cellRangeMap.has(`$${col}$${row}`)) {\n return layout._cellRangeMap.get(`$${col}$${row}`);\n }\n let cellRange: CellRange = { start: { col, row }, end: { col, row } };\n if (layout.transpose) {\n cellRange = getCellRangeTranspose(col, row, layout);\n } else {\n // hover相关的单元格位置是-1,-1,getCellRange计算有误,先进行判断\n if (layout.headerLevelCount <= row) {\n //如果是body部分 设置了需要合并单元格 这里判断上下是否内容相同 相同的话 将cellRange范围扩大\n if (\n layout.headerLevelCount <= row &&\n (layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount]?.define as TextColumnDefine)?.mergeCell\n ) {\n const value = layout._table.getCellValue(col, row);\n for (let r = row - 1; r >= layout.headerLevelCount; r--) {\n const last_Value = layout._table.getCellValue(col, r);\n if (typeof layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell === 'boolean') {\n if (value !== last_Value) {\n break;\n }\n } else {\n if (\n !(layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell as Function)(\n value,\n last_Value\n )\n ) {\n break;\n }\n }\n cellRange.start.row = r;\n }\n for (let r = row + 1; r < layout.rowCount; r++) {\n const next_Value = layout._table.getCellValue(col, r);\n if (typeof layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell === 'boolean') {\n if (value !== next_Value) {\n break;\n }\n } else {\n if (\n !(layout.columnObjects[col - layout.leftRowSeriesNumberColumnCount].define.mergeCell as Function)(\n value,\n next_Value\n )\n ) {\n break;\n }\n }\n cellRange.end.row = r;\n }\n }\n getTreeTitleMerge(col, row, cellRange, layout);\n // return cellRange;\n } else {\n //in header\n const id = layout.getCellId(col, row);\n for (let c = col - 1; c >= 0; c--) {\n if (id !== layout.getCellId(c, row)) {\n break;\n }\n cellRange.start.col = c;\n }\n for (let c = col + 1; c < (layout.colCount ?? 0); c++) {\n if (id !== layout.getCellId(c, row)) {\n break;\n }\n cellRange.end.col = c;\n }\n for (let r = row - 1; r >= 0; r--) {\n if (id !== layout.getCellId(col, r)) {\n break;\n }\n cellRange.start.row = r;\n }\n for (let r = row + 1; r < layout.headerLevelCount; r++) {\n if (id !== layout.getCellId(col, r)) {\n break;\n }\n cellRange.end.row = r;\n }\n // return cellRange;\n }\n }\n layout._cellRangeMap.set(`$${col}$${row}`, cellRange);\n return cellRange;\n}\n\nfunction getTreeTitleMerge(col: number, row: number, cellRange: CellRange, layout: SimpleHeaderLayoutMap) {\n if (layout.rowHierarchyType !== 'tree') {\n return;\n }\n\n const cellRecord = layout._table.getCellRawRecord(col, row);\n if (cellRecord?.vTableMerge) {\n // const vTableMergeName = cellRecord.vtableMergeName;\n cellRange.start.col = layout.rowHeaderLevelCount;\n cellRange.end.col = layout.colCount - 1;\n cellRange.start.row = cellRange.end.row = row;\n }\n}\n\nexport function getCellRangeTranspose(col: number, row: number, layout: SimpleHeaderLayoutMap): CellRange {\n const result: CellRange = { start: { col, row }, end: { col, row } };\n // hover相关的单元格位置是-1,-1,getCellRange计算有误,先进行判断\n if (layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount <= col || (col === -1 && row === -1)) {\n //如果是body部分 设置了需要合并单元格 这里判断左右是否内容相同 相同的话 将cellRange范围扩大\n if (\n layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount <= col &&\n layout.columnObjects[row]?.define?.mergeCell\n ) {\n const value = layout._table.getCellValue(col, row);\n for (let c = col - 1; c >= layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount; c--) {\n const last_Value = layout._table.getCellValue(c, row);\n if (typeof layout.columnObjects[row].define.mergeCell === 'boolean') {\n if (value !== last_Value) {\n break;\n }\n } else {\n if (!(layout.columnObjects[row].define.mergeCell as Function)(value, last_Value)) {\n break;\n }\n }\n result.start.col = c;\n }\n for (let c = col + 1; c < (layout.colCount ?? 0); c++) {\n const next_Value = layout._table.getCellValue(c, row);\n if (typeof layout.columnObjects[row].define.mergeCell === 'boolean') {\n if (value !== next_Value) {\n break;\n }\n } else {\n if (!(layout.columnObjects[row].define.mergeCell as Function)(value, next_Value)) {\n break;\n }\n }\n result.end.col = c;\n }\n }\n return result;\n }\n //in header\n const id = layout.getCellId(col, row);\n for (let r = row - 1; r >= 0; r--) {\n if (id !== layout.getCellId(col, r)) {\n break;\n }\n result.start.row = r;\n }\n for (let r = row + 1; r < (layout.rowCount ?? 0); r++) {\n if (id !== layout.getCellId(col, r)) {\n break;\n }\n result.end.row = r;\n }\n for (let c = col - 1; c >= 0; c--) {\n if (id !== layout.getCellId(c, row)) {\n break;\n }\n result.start.col = c;\n }\n for (let c = col + 1; c < layout.headerLevelCount + layout.leftRowSeriesNumberColumnCount; c++) {\n if (id !== layout.getCellId(c, row)) {\n break;\n }\n result.end.col = c;\n }\n return result;\n}\n"]}