@visactor/vtable 1.5.2 → 1.5.3-alpha.1

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 (123) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +23 -191
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/core/BaseTable.d.ts +5 -3
  5. package/cjs/core/BaseTable.js +8 -79
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/core/group-helper.d.ts +6 -0
  8. package/cjs/core/group-helper.js +22 -0
  9. package/cjs/core/group-helper.js.map +1 -0
  10. package/cjs/core/record-helper.d.ts +6 -0
  11. package/cjs/core/record-helper.js +230 -0
  12. package/cjs/core/record-helper.js.map +1 -0
  13. package/cjs/core/style-helper.d.ts +3 -0
  14. package/cjs/core/style-helper.js +110 -0
  15. package/cjs/core/style-helper.js.map +1 -0
  16. package/cjs/core/tableHelper.d.ts +0 -2
  17. package/cjs/core/tableHelper.js +9 -18
  18. package/cjs/core/tableHelper.js.map +1 -1
  19. package/cjs/data/CachedDataSource.d.ts +10 -1
  20. package/cjs/data/CachedDataSource.js +78 -3
  21. package/cjs/data/CachedDataSource.js.map +1 -1
  22. package/cjs/dataset/statistics-helper.js +0 -1
  23. package/cjs/event/event.js +2 -1
  24. package/cjs/event/listener/table-group.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/cell-range/simple-cell-range.d.ts +4 -0
  29. package/cjs/layout/cell-range/simple-cell-range.js +106 -0
  30. package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
  31. package/cjs/layout/layout-helper.js +2 -2
  32. package/cjs/layout/layout-helper.js.map +1 -1
  33. package/cjs/layout/row-height-map.js +1 -0
  34. package/cjs/layout/simple-header-layout.d.ts +1 -2
  35. package/cjs/layout/simple-header-layout.js +2 -88
  36. package/cjs/layout/simple-header-layout.js.map +1 -1
  37. package/cjs/plugins/icons.js +1 -1
  38. package/cjs/plugins/themes.js +1 -1
  39. package/cjs/scenegraph/group-creater/cell-helper.js +11 -6
  40. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  41. package/cjs/scenegraph/group-creater/column-helper.js +7 -2
  42. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  43. package/cjs/scenegraph/scenegraph.js +1 -1
  44. package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
  45. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  46. package/cjs/scenegraph/utils/get-hierarchy-offset.js +6 -8
  47. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  48. package/cjs/themes/theme.d.ts +2 -0
  49. package/cjs/themes/theme.js +12 -4
  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 +9 -0
  53. package/cjs/ts-types/base-table.js.map +1 -1
  54. package/cjs/ts-types/new-data-set.d.ts +1 -0
  55. package/cjs/ts-types/new-data-set.js.map +1 -1
  56. package/cjs/ts-types/table-engine.d.ts +8 -0
  57. package/cjs/ts-types/table-engine.js.map +1 -1
  58. package/cjs/ts-types/theme.d.ts +1 -0
  59. package/cjs/ts-types/theme.js.map +1 -1
  60. package/cjs/vrender.js.map +1 -1
  61. package/dist/vtable.js +3137 -2870
  62. package/dist/vtable.min.js +2 -2
  63. package/es/ListTable.d.ts +1 -0
  64. package/es/ListTable.js +27 -189
  65. package/es/ListTable.js.map +1 -1
  66. package/es/core/BaseTable.d.ts +5 -3
  67. package/es/core/BaseTable.js +11 -83
  68. package/es/core/BaseTable.js.map +1 -1
  69. package/es/core/group-helper.d.ts +6 -0
  70. package/es/core/group-helper.js +14 -0
  71. package/es/core/group-helper.js.map +1 -0
  72. package/es/core/record-helper.d.ts +6 -0
  73. package/es/core/record-helper.js +220 -0
  74. package/es/core/record-helper.js.map +1 -0
  75. package/es/core/style-helper.d.ts +3 -0
  76. package/es/core/style-helper.js +86 -0
  77. package/es/core/style-helper.js.map +1 -0
  78. package/es/core/tableHelper.d.ts +0 -2
  79. package/es/core/tableHelper.js +6 -16
  80. package/es/core/tableHelper.js.map +1 -1
  81. package/es/data/CachedDataSource.d.ts +10 -1
  82. package/es/data/CachedDataSource.js +79 -0
  83. package/es/data/CachedDataSource.js.map +1 -1
  84. package/es/dataset/statistics-helper.js +1 -2
  85. package/es/event/event.js +2 -1
  86. package/es/event/listener/table-group.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/cell-range/simple-cell-range.d.ts +4 -0
  91. package/es/layout/cell-range/simple-cell-range.js +99 -0
  92. package/es/layout/cell-range/simple-cell-range.js.map +1 -0
  93. package/es/layout/layout-helper.js +2 -2
  94. package/es/layout/layout-helper.js.map +1 -1
  95. package/es/layout/row-height-map.js +2 -1
  96. package/es/layout/simple-header-layout.d.ts +1 -2
  97. package/es/layout/simple-header-layout.js +3 -87
  98. package/es/layout/simple-header-layout.js.map +1 -1
  99. package/es/plugins/icons.js +1 -1
  100. package/es/plugins/themes.js +1 -1
  101. package/es/scenegraph/group-creater/cell-helper.js +11 -6
  102. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  103. package/es/scenegraph/group-creater/column-helper.js +7 -2
  104. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  105. package/es/scenegraph/scenegraph.js +1 -1
  106. package/es/scenegraph/utils/get-cell-merge.js +1 -1
  107. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  108. package/es/scenegraph/utils/get-hierarchy-offset.js +7 -9
  109. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  110. package/es/themes/theme.d.ts +2 -0
  111. package/es/themes/theme.js +11 -4
  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 +9 -0
  115. package/es/ts-types/base-table.js.map +1 -1
  116. package/es/ts-types/new-data-set.d.ts +1 -0
  117. package/es/ts-types/new-data-set.js.map +1 -1
  118. package/es/ts-types/table-engine.d.ts +8 -0
  119. package/es/ts-types/table-engine.js.map +1 -1
  120. package/es/ts-types/theme.d.ts +1 -0
  121. package/es/ts-types/theme.js.map +1 -1
  122. package/es/vrender.js.map +1 -1
  123. package/package.json +3 -3
@@ -0,0 +1,6 @@
1
+ import type { GroupByOption } from '../ts-types';
2
+ export declare function getGroupByDataConfig(groupByOption: GroupByOption): {
3
+ groupByRules: string[];
4
+ } | {
5
+ groupByRules?: undefined;
6
+ };
@@ -0,0 +1,14 @@
1
+ import { isArray, isString } from "@visactor/vutils";
2
+
3
+ export function getGroupByDataConfig(groupByOption) {
4
+ if (isString(groupByOption)) return {
5
+ groupByRules: [ groupByOption ]
6
+ };
7
+ if (isArray(groupByOption)) {
8
+ return {
9
+ groupByRules: groupByOption.map((item => isString(item) ? item : item.key))
10
+ };
11
+ }
12
+ return {};
13
+ }
14
+ //# sourceMappingURL=group-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/group-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,UAAU,oBAAoB,CAAC,aAA4B;IAE/D,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE;QAC3B,OAAO,EAAE,YAAY,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;KAC1C;IACD,IAAI,OAAO,CAAC,aAAa,CAAC,EAAE;QAC1B,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC5C,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAClB,OAAO,IAAI,CAAC;aACb;YACD,OAAO,IAAI,CAAC,GAAG,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,YAAY,EAAE,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","file":"group-helper.js","sourcesContent":["import { isArray, isString } from '@visactor/vutils';\nimport type { GroupByOption } from '../ts-types';\n\nexport function getGroupByDataConfig(groupByOption: GroupByOption) {\n // no sort temply\n if (isString(groupByOption)) {\n return { groupByRules: [groupByOption] };\n }\n if (isArray(groupByOption)) {\n const groupByRules = groupByOption.map(item => {\n if (isString(item)) {\n return item;\n }\n return item.key;\n });\n return { groupByRules };\n }\n\n return {};\n}\n"]}
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,220 @@
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
@@ -0,0 +1 @@
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,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E,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"]}
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,86 @@
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
@@ -0,0 +1 @@
1
+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;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"]}
@@ -4,7 +4,6 @@ import { DataSource } from '../data';
4
4
  import { Rect } from '../tools/Rect';
5
5
  import type { FullExtendStyle, ListTableAPI } from '../ts-types';
6
6
  import type { BaseTableAPI } from '../ts-types/base-table';
7
- import type { ListTable } from '../ListTable';
8
7
  export declare function createRootElement(padding: any): HTMLElement;
9
8
  export declare function updateRootElementPadding(element: HTMLElement, padding: any): void;
10
9
  export declare function _dealWithUpdateDataSource(table: BaseTableAPI, fn: (table: BaseTableAPI) => void): void;
@@ -38,6 +37,5 @@ export declare function getStyleTheme(headerStyle: FullExtendStyle, table: BaseT
38
37
  };
39
38
  hasFunctionPros: boolean;
40
39
  };
41
- export declare function sortRecords(table: ListTable): void;
42
40
  export declare function getCellCornerRadius(col: number, row: number, table: BaseTableAPI): number[] | 0;
43
41
  export declare function parseMarkLineGetExtendRange(markLine: any): number | 'sum' | 'max';
@@ -8,8 +8,6 @@ import { Rect } from "../tools/Rect";
8
8
 
9
9
  import * as calc from "../tools/calc";
10
10
 
11
- import { defaultOrderFn } from "../tools/util";
12
-
13
11
  export function createRootElement(padding) {
14
12
  var _a, _b;
15
13
  const element = document.createElement("div");
@@ -39,13 +37,17 @@ export function _dealWithUpdateDataSource(table, fn) {
39
37
 
40
38
  export function _setRecords(table, records = []) {
41
39
  _dealWithUpdateDataSource(table, (() => {
42
- var _a, _b;
43
40
  table.internalProps.records = records;
44
- const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.internalProps.layoutMap.rowHierarchyType, null !== (_a = table.options.hierarchyExpandLevel) && void 0 !== _a ? _a : (null === (_b = table._hasHierarchyTreeHeader) || void 0 === _b ? void 0 : _b.call(table)) ? 1 : void 0);
41
+ const newDataSource = table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.internalProps.layoutMap.rowHierarchyType, getHierarchyExpandLevel(table));
45
42
  table.addReleaseObj(newDataSource);
46
43
  }));
47
44
  }
48
45
 
46
+ function getHierarchyExpandLevel(table) {
47
+ var _a;
48
+ return table.options.hierarchyExpandLevel ? table.options.hierarchyExpandLevel : table.options.groupBy ? 1 / 0 : (null === (_a = table._hasHierarchyTreeHeader) || void 0 === _a ? void 0 : _a.call(table)) ? 1 : void 0;
49
+ }
50
+
49
51
  export function _setDataSource(table, dataSource) {
50
52
  _dealWithUpdateDataSource(table, (() => {
51
53
  if (dataSource) if (dataSource instanceof DataSource) table.internalProps.dataSource = dataSource; else {
@@ -166,18 +168,6 @@ export function getStyleTheme(headerStyle, table, col, row, getProp, needGetThem
166
168
  };
167
169
  }
168
170
 
169
- export function sortRecords(table) {
170
- var _a;
171
- if (table.sortState) {
172
- let order, field;
173
- 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),
174
- order && field && "normal" !== order) {
175
- const sortFunc = table._getSortFuncFromHeaderOption(void 0, field), hd = table.internalProps.layoutMap.headerObjects.find((col => col && col.field === field));
176
- table.dataSource.sort(hd.field, order, null != sortFunc ? sortFunc : defaultOrderFn);
177
- }
178
- }
179
- }
180
-
181
171
  export function getCellCornerRadius(col, row, table) {
182
172
  const tableCornerRadius = table.theme.frameStyle.cornerRadius;
183
173
  if (tableCornerRadius) {