@visactor/vtable 1.26.8 → 1.26.9-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.
- package/cjs/body-helper/body-helper.js +1 -2
- package/cjs/components/index.js +2 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +17 -17
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/components/menu/dom/logic/menu-icon.d.ts +1 -0
- package/cjs/components/menu/dom/logic/menu-icon.js +41 -0
- package/cjs/components/menu/dom/logic/menu-icon.js.map +1 -0
- package/cjs/core/BaseTable.js +2 -2
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/tableHelper.js +1 -2
- package/cjs/data/DataSource.js +2 -1
- package/cjs/event/event.js +3 -3
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/sparkline-event.js +2 -1
- package/cjs/header-helper/header-helper.js +1 -2
- package/cjs/layout/pivot-header-layout.js +2 -1
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/plugins/custom-cell-style.d.ts +17 -2
- package/cjs/plugins/custom-cell-style.js +120 -30
- package/cjs/plugins/custom-cell-style.js.map +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +2 -0
- package/cjs/scenegraph/component/table-component.js +22 -6
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +3 -0
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +8 -1
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.d.ts +1 -0
- package/cjs/scenegraph/select/create-select-border.js +8 -3
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/select/delete-select-border.d.ts +2 -0
- package/cjs/scenegraph/select/delete-select-border.js +16 -5
- package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
- package/cjs/scenegraph/select/move-select-border.js +2 -2
- package/cjs/scenegraph/select/move-select-border.js.map +1 -1
- package/cjs/state/select/auto-merge-ranges.d.ts +9 -0
- package/cjs/state/select/auto-merge-ranges.js +164 -0
- package/cjs/state/select/auto-merge-ranges.js.map +1 -0
- package/cjs/state/select/update-position.js +7 -3
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +3 -1
- package/cjs/state/state.js +18 -9
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme-define.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/menu.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -1
- package/cjs/ts-types/theme.js.map +1 -1
- package/dist/vtable.js +2410 -104
- package/dist/vtable.min.js +5 -1
- package/es/body-helper/body-helper.js +1 -2
- package/es/components/index.js +2 -1
- package/es/components/menu/dom/logic/MenuElement.js +16 -17
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/components/menu/dom/logic/menu-icon.d.ts +1 -0
- package/es/components/menu/dom/logic/menu-icon.js +29 -0
- package/es/components/menu/dom/logic/menu-icon.js.map +1 -0
- package/es/core/BaseTable.js +2 -2
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/tableHelper.js +1 -2
- package/es/data/DataSource.js +2 -1
- package/es/event/event.js +4 -2
- package/es/event/event.js.map +1 -1
- package/es/event/sparkline-event.js +2 -1
- package/es/header-helper/header-helper.js +1 -2
- package/es/layout/pivot-header-layout.js +2 -1
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/plugins/custom-cell-style.d.ts +17 -2
- package/es/plugins/custom-cell-style.js +120 -28
- package/es/plugins/custom-cell-style.js.map +1 -1
- package/es/scenegraph/component/table-component.d.ts +2 -0
- package/es/scenegraph/component/table-component.js +21 -6
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +3 -0
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +9 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.d.ts +1 -0
- package/es/scenegraph/select/create-select-border.js +5 -1
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/select/delete-select-border.d.ts +2 -0
- package/es/scenegraph/select/delete-select-border.js +9 -0
- package/es/scenegraph/select/delete-select-border.js.map +1 -1
- package/es/scenegraph/select/move-select-border.js +2 -2
- package/es/scenegraph/select/move-select-border.js.map +1 -1
- package/es/state/select/auto-merge-ranges.d.ts +9 -0
- package/es/state/select/auto-merge-ranges.js +155 -0
- package/es/state/select/auto-merge-ranges.js.map +1 -0
- package/es/state/select/update-position.js +7 -1
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +3 -1
- package/es/state/state.js +19 -8
- package/es/state/state.js.map +1 -1
- package/es/themes/theme-define.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/menu.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -1
- package/es/ts-types/theme.js.map +1 -1
- package/package.json +9 -4
|
@@ -11,17 +11,32 @@ export declare class CustomCellStylePlugin {
|
|
|
11
11
|
customCellStyleArrangement: CustomCellStyleArrangement[];
|
|
12
12
|
private _customCellStyleArrangementIndex;
|
|
13
13
|
private _customCellStyleArrangementTombstoneCount;
|
|
14
|
+
private _customCellStyleOverlays;
|
|
15
|
+
private _customCellStyleIdsCache?;
|
|
14
16
|
constructor(table: BaseTableAPI, customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]);
|
|
15
17
|
private _getCustomCellStyleArrangementKey;
|
|
16
18
|
private _rebuildCustomCellStyleArrangementIndex;
|
|
17
19
|
private _compactCustomCellStyleArrangementIfNeeded;
|
|
18
20
|
clearCustomCellStyleArrangement(): void;
|
|
19
21
|
addCustomCellStyleArrangement(cellPosition: {
|
|
20
|
-
col
|
|
21
|
-
row
|
|
22
|
+
col?: number;
|
|
23
|
+
row?: number;
|
|
24
|
+
range?: CellRange;
|
|
25
|
+
}, customStyleId: string | undefined | null): void;
|
|
26
|
+
setCustomCellStyleOverlay(sourceId: string, cellPosition: {
|
|
27
|
+
col?: number;
|
|
28
|
+
row?: number;
|
|
29
|
+
range?: CellRange;
|
|
22
30
|
}, customStyleId: string | undefined | null): void;
|
|
31
|
+
clearCustomCellStyleOverlay(sourceId: string): void;
|
|
23
32
|
getCustomCellStyle(col: number, row: number): any;
|
|
24
33
|
getCustomCellStyleIds(col: number, row: number): string[];
|
|
34
|
+
private _collectCustomCellStyleIds;
|
|
35
|
+
refreshCustomCellStyleRange(cellPosition: {
|
|
36
|
+
col?: number;
|
|
37
|
+
row?: number;
|
|
38
|
+
range?: CellRange;
|
|
39
|
+
}, forceFastUpdate?: boolean): void;
|
|
25
40
|
getCustomCellStyleOption(customStyleId: string): CustomCellStyle;
|
|
26
41
|
registerCustomCellStyle(customStyleId: string, customStyle: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption) | undefined | null): void;
|
|
27
42
|
arrangeCustomCellStyle(cellPos: {
|
|
@@ -8,7 +8,7 @@ export class CustomCellStylePlugin {
|
|
|
8
8
|
constructor(table, customCellStyle, customCellStyleArrangement) {
|
|
9
9
|
this.table = table, this.customCellStyle = customCellStyle, this.customCellStyleArrangement = customCellStyleArrangement,
|
|
10
10
|
this._customCellStyleArrangementIndex = new Map, this._customCellStyleArrangementTombstoneCount = 0,
|
|
11
|
-
this._rebuildCustomCellStyleArrangementIndex();
|
|
11
|
+
this._customCellStyleOverlays = new Map, this._rebuildCustomCellStyleArrangementIndex();
|
|
12
12
|
}
|
|
13
13
|
_getCustomCellStyleArrangementKey(cellPos) {
|
|
14
14
|
if (cellPos.range) {
|
|
@@ -20,11 +20,12 @@ export class CustomCellStylePlugin {
|
|
|
20
20
|
_rebuildCustomCellStyleArrangementIndex() {
|
|
21
21
|
this._customCellStyleArrangementIndex.clear(), this._customCellStyleArrangementTombstoneCount = 0;
|
|
22
22
|
for (let i = 0; i < this.customCellStyleArrangement.length; i++) {
|
|
23
|
-
|
|
23
|
+
const arrangement = this.customCellStyleArrangement[i];
|
|
24
|
+
if (!isValid(arrangement.customStyleId)) {
|
|
24
25
|
this._customCellStyleArrangementTombstoneCount++;
|
|
25
26
|
continue;
|
|
26
27
|
}
|
|
27
|
-
const key = this._getCustomCellStyleArrangementKey(
|
|
28
|
+
const key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);
|
|
28
29
|
key && this._customCellStyleArrangementIndex.set(key, i);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -37,7 +38,7 @@ export class CustomCellStylePlugin {
|
|
|
37
38
|
this.customCellStyleArrangement.push(...compacted), this._rebuildCustomCellStyleArrangementIndex()) : this._customCellStyleArrangementTombstoneCount = 0;
|
|
38
39
|
}
|
|
39
40
|
clearCustomCellStyleArrangement() {
|
|
40
|
-
this.customCellStyleArrangement = [];
|
|
41
|
+
this.customCellStyleArrangement = [], this._rebuildCustomCellStyleArrangementIndex();
|
|
41
42
|
}
|
|
42
43
|
addCustomCellStyleArrangement(cellPosition, customStyleId) {
|
|
43
44
|
this.customCellStyleArrangement.push({
|
|
@@ -45,6 +46,41 @@ export class CustomCellStylePlugin {
|
|
|
45
46
|
customStyleId: customStyleId
|
|
46
47
|
});
|
|
47
48
|
}
|
|
49
|
+
setCustomCellStyleOverlay(sourceId, cellPosition, customStyleId) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const positionKey = this._getCustomCellStyleArrangementKey(cellPosition);
|
|
52
|
+
if (!positionKey) return;
|
|
53
|
+
let overlay = this._customCellStyleOverlays.get(sourceId);
|
|
54
|
+
overlay || (overlay = {
|
|
55
|
+
positions: new Map,
|
|
56
|
+
cells: new Map
|
|
57
|
+
}, this._customCellStyleOverlays.set(sourceId, overlay));
|
|
58
|
+
const previousCellKeys = null !== (_a = overlay.positions.get(positionKey)) && void 0 !== _a ? _a : [];
|
|
59
|
+
if (!customStyleId) return previousCellKeys.forEach((cellKey => {
|
|
60
|
+
const cellStyles = null == overlay ? void 0 : overlay.cells.get(cellKey);
|
|
61
|
+
null == cellStyles || cellStyles.delete(positionKey), 0 === (null == cellStyles ? void 0 : cellStyles.size) && (null == overlay || overlay.cells.delete(cellKey));
|
|
62
|
+
})), overlay.positions.delete(positionKey), void (0 === overlay.positions.size && this._customCellStyleOverlays.delete(sourceId));
|
|
63
|
+
const range = null !== (_b = cellPosition.range) && void 0 !== _b ? _b : {
|
|
64
|
+
start: {
|
|
65
|
+
col: cellPosition.col,
|
|
66
|
+
row: cellPosition.row
|
|
67
|
+
},
|
|
68
|
+
end: {
|
|
69
|
+
col: cellPosition.col,
|
|
70
|
+
row: cellPosition.row
|
|
71
|
+
}
|
|
72
|
+
}, cellKeys = [];
|
|
73
|
+
for (let col = range.start.col; col <= range.end.col; col++) for (let row = range.start.row; row <= range.end.row; row++) {
|
|
74
|
+
const cellKey = `${col}:${row}`;
|
|
75
|
+
cellKeys.push(cellKey);
|
|
76
|
+
let cellStyles = overlay.cells.get(cellKey);
|
|
77
|
+
cellStyles || (cellStyles = new Map, overlay.cells.set(cellKey, cellStyles)), cellStyles.set(positionKey, customStyleId);
|
|
78
|
+
}
|
|
79
|
+
overlay.positions.set(positionKey, cellKeys);
|
|
80
|
+
}
|
|
81
|
+
clearCustomCellStyleOverlay(sourceId) {
|
|
82
|
+
this._customCellStyleOverlays.delete(sourceId);
|
|
83
|
+
}
|
|
48
84
|
getCustomCellStyle(col, row) {
|
|
49
85
|
const customStyleIds = this.getCustomCellStyleIds(col, row);
|
|
50
86
|
if (customStyleIds.length) {
|
|
@@ -67,12 +103,51 @@ export class CustomCellStylePlugin {
|
|
|
67
103
|
}
|
|
68
104
|
}
|
|
69
105
|
getCustomCellStyleIds(col, row) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
var _a, _b;
|
|
107
|
+
const range = this.table.getCellRange(col, row), rangeKey = `${range.start.col}:${range.start.row}:${range.end.col}:${range.end.row}`, cachedStyleIds = null === (_a = this._customCellStyleIdsCache) || void 0 === _a ? void 0 : _a.get(rangeKey);
|
|
108
|
+
if (cachedStyleIds) return cachedStyleIds;
|
|
109
|
+
const customStyleIds = this._collectCustomCellStyleIds(range);
|
|
110
|
+
return null === (_b = this._customCellStyleIdsCache) || void 0 === _b || _b.set(rangeKey, customStyleIds),
|
|
111
|
+
customStyleIds;
|
|
112
|
+
}
|
|
113
|
+
_collectCustomCellStyleIds(range) {
|
|
114
|
+
const customStyleIds = [], seenArrangements = new Set, seenOverlayPositions = new Set;
|
|
115
|
+
for (let c = range.start.col; c <= range.end.col; c++) for (let r = range.start.row; r <= range.end.row; r++) {
|
|
116
|
+
this.customCellStyleArrangement.forEach(((style, index) => {
|
|
117
|
+
!seenArrangements.has(index) && isValid(style.customStyleId) && (style.cellPosition.range ? style.cellPosition.range.start.col <= c && style.cellPosition.range.end.col >= c && style.cellPosition.range.start.row <= r && style.cellPosition.range.end.row >= r && (seenArrangements.add(index),
|
|
118
|
+
customStyleIds.push(style.customStyleId)) : style.cellPosition.col === c && style.cellPosition.row === r && (seenArrangements.add(index),
|
|
119
|
+
customStyleIds.push(style.customStyleId)));
|
|
120
|
+
}));
|
|
121
|
+
for (const [sourceId, overlay] of this._customCellStyleOverlays) {
|
|
122
|
+
const overlayStyles = overlay.cells.get(`${c}:${r}`);
|
|
123
|
+
if (overlayStyles) for (const [positionKey, customStyleId] of overlayStyles) {
|
|
124
|
+
const overlayPositionKey = `${sourceId}:${positionKey}`;
|
|
125
|
+
seenOverlayPositions.has(overlayPositionKey) || (seenOverlayPositions.add(overlayPositionKey),
|
|
126
|
+
customStyleIds.push(customStyleId));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
74
130
|
return customStyleIds;
|
|
75
131
|
}
|
|
132
|
+
refreshCustomCellStyleRange(cellPosition, forceFastUpdate = !1) {
|
|
133
|
+
var _a;
|
|
134
|
+
const range = null !== (_a = cellPosition.range) && void 0 !== _a ? _a : {
|
|
135
|
+
start: {
|
|
136
|
+
col: cellPosition.col,
|
|
137
|
+
row: cellPosition.row
|
|
138
|
+
},
|
|
139
|
+
end: {
|
|
140
|
+
col: cellPosition.col,
|
|
141
|
+
row: cellPosition.row
|
|
142
|
+
}
|
|
143
|
+
}, previousCache = this._customCellStyleIdsCache;
|
|
144
|
+
this._customCellStyleIdsCache = new Map;
|
|
145
|
+
try {
|
|
146
|
+
for (let col = Math.max(0, range.start.col); col <= Math.min(this.table.colCount - 1, range.end.col); col++) for (let row = Math.max(0, range.start.row); row <= Math.min(this.table.rowCount - 1, range.end.row); row++) this.table.scenegraph.updateCellContent(col, row, forceFastUpdate);
|
|
147
|
+
} finally {
|
|
148
|
+
this._customCellStyleIdsCache = previousCache;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
76
151
|
getCustomCellStyleOption(customStyleId) {
|
|
77
152
|
return this.customCellStyle.find((style => style.id === customStyleId));
|
|
78
153
|
}
|
|
@@ -92,14 +167,9 @@ export class CustomCellStylePlugin {
|
|
|
92
167
|
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
93
168
|
var _a, _b;
|
|
94
169
|
const inputKey = this._getCustomCellStyleArrangementKey(cellPos);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
item && isValid(item.customStyleId) && itemKey === inputKey || (index = this.customCellStyleArrangement.findIndex((style => !!isValid(style.customStyleId) && this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey)),
|
|
99
|
-
-1 !== index ? this._customCellStyleArrangementIndex.set(inputKey, index) : this._customCellStyleArrangementIndex.delete(inputKey));
|
|
100
|
-
}
|
|
101
|
-
if (-1 !== index || inputKey || (index = this.customCellStyleArrangement.findIndex((style => !!isValid(style.customStyleId) && (style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row)))),
|
|
102
|
-
-1 === index && !customStyleId) return;
|
|
170
|
+
this._rebuildCustomCellStyleArrangementIndex();
|
|
171
|
+
const index = inputKey && null !== (_a = this._customCellStyleArrangementIndex.get(inputKey)) && void 0 !== _a ? _a : -1;
|
|
172
|
+
if (-1 === index && !customStyleId) return;
|
|
103
173
|
if (-1 === index && customStyleId) {
|
|
104
174
|
this.customCellStyleArrangement.push({
|
|
105
175
|
cellPosition: {
|
|
@@ -113,12 +183,8 @@ export class CustomCellStylePlugin {
|
|
|
113
183
|
pushedKey && this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);
|
|
114
184
|
} else {
|
|
115
185
|
if (this.customCellStyleArrangement[index].customStyleId === customStyleId) return;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
isValid(this.customCellStyleArrangement[index].customStyleId) && this._customCellStyleArrangementTombstoneCount++,
|
|
119
|
-
this.customCellStyleArrangement[index].customStyleId = null, existedKey && this._customCellStyleArrangementIndex.delete(existedKey),
|
|
120
|
-
this._compactCustomCellStyleArrangementIfNeeded();
|
|
121
|
-
}
|
|
186
|
+
customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : (this.customCellStyleArrangement[index].customStyleId = null,
|
|
187
|
+
this._rebuildCustomCellStyleArrangementIndex(), this._compactCustomCellStyleArrangementIfNeeded());
|
|
122
188
|
}
|
|
123
189
|
const style = customStyleId ? null === (_b = this.getCustomCellStyleOption(customStyleId)) || void 0 === _b ? void 0 : _b.style : void 0;
|
|
124
190
|
if (style) {
|
|
@@ -135,12 +201,38 @@ export class CustomCellStylePlugin {
|
|
|
135
201
|
this.table.scenegraph.updateNextFrame();
|
|
136
202
|
}
|
|
137
203
|
updateCustomCell(customCellStyle, customCellStyleArrangement) {
|
|
138
|
-
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
204
|
+
const positionsToRefresh = new Map;
|
|
205
|
+
this.customCellStyleArrangement.forEach((arrangement => {
|
|
206
|
+
const key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);
|
|
207
|
+
key && positionsToRefresh.set(key, arrangement.cellPosition);
|
|
208
|
+
})), this.customCellStyle.length = 0;
|
|
209
|
+
const styleIndexes = new Map;
|
|
210
|
+
customCellStyle.forEach((cellStyle => {
|
|
211
|
+
const index = styleIndexes.get(cellStyle.id), nextCellStyle = {
|
|
212
|
+
id: cellStyle.id,
|
|
213
|
+
style: cellStyle.style
|
|
214
|
+
};
|
|
215
|
+
void 0 === index ? (styleIndexes.set(cellStyle.id, this.customCellStyle.length),
|
|
216
|
+
this.customCellStyle.push(nextCellStyle)) : this.customCellStyle[index] = nextCellStyle;
|
|
217
|
+
})), this.customCellStyleArrangement.length = 0;
|
|
218
|
+
const arrangementIndexes = new Map;
|
|
219
|
+
customCellStyleArrangement.forEach((arrangement => {
|
|
220
|
+
const nextArrangement = {
|
|
221
|
+
cellPosition: {
|
|
222
|
+
col: arrangement.cellPosition.col,
|
|
223
|
+
row: arrangement.cellPosition.row,
|
|
224
|
+
range: arrangement.cellPosition.range
|
|
225
|
+
},
|
|
226
|
+
customStyleId: arrangement.customStyleId
|
|
227
|
+
}, key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);
|
|
228
|
+
if (key) {
|
|
229
|
+
const index = arrangementIndexes.get(key);
|
|
230
|
+
void 0 === index ? (arrangementIndexes.set(key, this.customCellStyleArrangement.length),
|
|
231
|
+
this.customCellStyleArrangement.push(nextArrangement)) : this.customCellStyleArrangement[index] = nextArrangement,
|
|
232
|
+
positionsToRefresh.set(key, arrangement.cellPosition);
|
|
233
|
+
} else this.customCellStyleArrangement.push(nextArrangement);
|
|
234
|
+
})), this._rebuildCustomCellStyleArrangementIndex(), positionsToRefresh.forEach((position => this.refreshCustomCellStyleRange(position))),
|
|
235
|
+
this.table.scenegraph.updateNextFrame();
|
|
144
236
|
}
|
|
145
237
|
hasCustomCellStyle(customStyleId) {
|
|
146
238
|
return this.customCellStyle.some((style => style.id === customStyleId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EACL,aAAa,EAKd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAU1C,MAAM,OAAO,qBAAqB;IAOhC,YACE,KAAmB,EACnB,eAAkC,EAClC,0BAAwD;QAExD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;QAC7D,IAAI,CAAC,gCAAgC,GAAG,IAAI,GAAG,EAAE,CAAC;QAClD,IAAI,CAAC,yCAAyC,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,uCAAuC,EAAE,CAAC;IACjD,CAAC;IAEO,iCAAiC,CAAC,OAA0D;QAClG,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;YACrC,OAAO,SAAS,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;SAChE;QACD,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,O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I,CAAC,uBAAuB,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;QACH,0BAA0B,CAAC,OAAO,CAAC,CAAC,SAAqC,EAAE,EAAE;YAC3E,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,aAAqB;QACtC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;IACxE,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,UAAiB,EAAE,eAAkC;IAC9E,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAEhC,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;QACjC,MAAM,KAAK,GAAI,eAAuB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;YACjB,UAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;SACxC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC","file":"custom-cell-style.js","sourcesContent":["import { isFunction, isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\nimport type { StylePropertyFunctionArg } from '../ts-types/style-define';\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n private _customCellStyleArrangementIndex: Map<string, number>;\n private _customCellStyleArrangementTombstoneCount: number;\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n this._customCellStyleArrangementIndex = new Map();\n this._customCellStyleArrangementTombstoneCount = 0;\n this._rebuildCustomCellStyleArrangementIndex();\n }\n\n private _getCustomCellStyleArrangementKey(cellPos: { col?: number; row?: number; range?: CellRange }) {\n if (cellPos.range) {\n const { start, end } = cellPos.range;\n return `range:${start.col},${start.row},${end.col},${end.row}`;\n }\n if (cellPos.col === undefined || cellPos.row === undefined) {\n return undefined;\n }\n return `cell:${cellPos.col},${cellPos.row}`;\n }\n\n private _rebuildCustomCellStyleArrangementIndex() {\n this._customCellStyleArrangementIndex.clear();\n this._customCellStyleArrangementTombstoneCount = 0;\n for (let i = 0; i < this.customCellStyleArrangement.length; i++) {\n if (!isValid((this.customCellStyleArrangement[i] as any).customStyleId)) {\n this._customCellStyleArrangementTombstoneCount++;\n continue;\n }\n const key = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[i].cellPosition);\n if (key) {\n this._customCellStyleArrangementIndex.set(key, i);\n }\n }\n }\n\n private _compactCustomCellStyleArrangementIfNeeded() {\n const length = this.customCellStyleArrangement.length;\n if (this._customCellStyleArrangementTombstoneCount < 2048) {\n return;\n }\n if (this._customCellStyleArrangementTombstoneCount * 4 < length) {\n return;\n }\n const compacted = this.customCellStyleArrangement.filter(style => isValid((style as any).customStyleId));\n if (compacted.length === this.customCellStyleArrangement.length) {\n this._customCellStyleArrangementTombstoneCount = 0;\n return;\n }\n this.customCellStyleArrangement.length = 0;\n this.customCellStyleArrangement.push(...compacted);\n this._rebuildCustomCellStyleArrangementIndex();\n }\n\n clearCustomCellStyleArrangement() {\n this.customCellStyleArrangement = [];\n }\n\n addCustomCellStyleArrangement(\n cellPosition: {\n col: number;\n row: number;\n },\n customStyleId: string | undefined | null\n ) {\n this.customCellStyleArrangement.push({\n cellPosition,\n customStyleId\n });\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (isFunction(styleOption?.style)) {\n const style = styleOption.style({\n col,\n row,\n table: this.table,\n value: this.table.getCellValue(col, row),\n dataValue: this.table.getCellOriginValue(col, row),\n cellHeaderPaths: this.table.getCellHeaderPaths(col, row)\n });\n styles.push(style);\n } else if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n if (!styles.length) {\n return undefined;\n }\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n // let customStyleId;\n const customStyleIds: string[] = [];\n\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach(style => {\n if (!isValid(style.customStyleId)) {\n return;\n }\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId as string);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n // customStyleId = style.customStyleId;\n customStyleIds.push(style.customStyleId as string);\n }\n });\n }\n }\n\n return customStyleIds;\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(\n customStyleId: string,\n customStyle: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption) | undefined | null\n ) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null,\n forceFastUpdate?: boolean\n ) {\n const inputKey = this._getCustomCellStyleArrangementKey(cellPos);\n let index = inputKey ? this._customCellStyleArrangementIndex.get(inputKey) ?? -1 : -1;\n if (inputKey && index !== -1) {\n const item = this.customCellStyleArrangement[index];\n const itemKey = item ? this._getCustomCellStyleArrangementKey(item.cellPosition) : undefined;\n if (!item || !isValid((item as any).customStyleId) || itemKey !== inputKey) {\n index = this.customCellStyleArrangement.findIndex(style => {\n if (!isValid((style as any).customStyleId)) {\n return false;\n }\n return this._getCustomCellStyleArrangementKey(style.cellPosition) === inputKey;\n });\n if (index !== -1) {\n this._customCellStyleArrangementIndex.set(inputKey, index);\n } else {\n this._customCellStyleArrangementIndex.delete(inputKey);\n }\n }\n }\n if (index === -1 && !inputKey) {\n index = this.customCellStyleArrangement.findIndex(style => {\n if (!isValid((style as any).customStyleId)) {\n return false;\n }\n if (style.cellPosition.range && cellPos.range) {\n return (\n style.cellPosition.range.start.col === cellPos.range.start.col &&\n style.cellPosition.range.start.row === cellPos.range.start.row &&\n style.cellPosition.range.end.col === cellPos.range.end.col &&\n style.cellPosition.range.end.row === cellPos.range.end.row\n );\n }\n return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;\n });\n }\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n const pushedIndex = this.customCellStyleArrangement.length - 1;\n const pushedKey = this._getCustomCellStyleArrangementKey(\n this.customCellStyleArrangement[pushedIndex].cellPosition\n );\n if (pushedKey) {\n this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);\n }\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n const existedKey = this._getCustomCellStyleArrangementKey(this.customCellStyleArrangement[index].cellPosition);\n if (isValid((this.customCellStyleArrangement[index] as any).customStyleId)) {\n this._customCellStyleArrangementTombstoneCount++;\n }\n (this.customCellStyleArrangement[index] as any).customStyleId = null;\n if (existedKey) {\n this._customCellStyleArrangementIndex.delete(existedKey);\n }\n this._compactCustomCellStyleArrangementIfNeeded();\n }\n\n const style = customStyleId ? this.getCustomCellStyleOption(customStyleId)?.style : undefined;\n // let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n this.customCellStyle.length = 0;\n this.customCellStyleArrangement.length = 0;\n this._customCellStyleArrangementIndex.clear();\n this._customCellStyleArrangementTombstoneCount = 0;\n customCellStyle.forEach((cellStyle: CustomCellStyle) => {\n this.registerCustomCellStyle(cellStyle.id, cellStyle.style);\n });\n customCellStyleArrangement.forEach((cellStyle: CustomCellStyleArrangement) => {\n this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);\n });\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugins/custom-cell-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,k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;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AAC5E,CAAC,CAAC","file":"custom-cell-style.js","sourcesContent":["import { isFunction, isValid, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport {\n cellStyleKeys,\n type CellRange,\n type ColumnStyleOption,\n type CustomCellStyle,\n type CustomCellStyleArrangement\n} from '../ts-types';\nimport type { Style } from '../body-helper/style';\nimport { Factory } from '../core/factory';\nimport type { StylePropertyFunctionArg } from '../ts-types/style-define';\nexport interface ICustomCellStylePlugin {\n new (\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ): CustomCellStylePlugin;\n}\n\ntype CustomCellStyleOverlay = {\n positions: Map<string, string[]>;\n cells: Map<string, Map<string, string>>;\n};\n\nexport class CustomCellStylePlugin {\n table: BaseTableAPI;\n customCellStyle: CustomCellStyle[];\n customCellStyleArrangement: CustomCellStyleArrangement[];\n private _customCellStyleArrangementIndex: Map<string, number>;\n private _customCellStyleArrangementTombstoneCount: number;\n private _customCellStyleOverlays: Map<string, CustomCellStyleOverlay>;\n private _customCellStyleIdsCache?: Map<string, string[]>;\n\n constructor(\n table: BaseTableAPI,\n customCellStyle: CustomCellStyle[],\n customCellStyleArrangement: CustomCellStyleArrangement[]\n ) {\n this.table = table;\n this.customCellStyle = customCellStyle;\n this.customCellStyleArrangement = customCellStyleArrangement;\n this._customCellStyleArrangementIndex = new Map();\n this._customCellStyleArrangementTombstoneCount = 0;\n this._customCellStyleOverlays = new Map();\n this._rebuildCustomCellStyleArrangementIndex();\n }\n\n private _getCustomCellStyleArrangementKey(cellPos: { col?: number; row?: number; range?: CellRange }) {\n if (cellPos.range) {\n const { start, end } = cellPos.range;\n return `range:${start.col},${start.row},${end.col},${end.row}`;\n }\n if (cellPos.col === undefined || cellPos.row === undefined) {\n return undefined;\n }\n return `cell:${cellPos.col},${cellPos.row}`;\n }\n\n private _rebuildCustomCellStyleArrangementIndex() {\n this._customCellStyleArrangementIndex.clear();\n this._customCellStyleArrangementTombstoneCount = 0;\n for (let i = 0; i < this.customCellStyleArrangement.length; i++) {\n const arrangement = this.customCellStyleArrangement[i];\n if (!isValid((arrangement as any).customStyleId)) {\n this._customCellStyleArrangementTombstoneCount++;\n continue;\n }\n const key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);\n if (key) {\n this._customCellStyleArrangementIndex.set(key, i);\n }\n }\n }\n\n private _compactCustomCellStyleArrangementIfNeeded() {\n const length = this.customCellStyleArrangement.length;\n if (this._customCellStyleArrangementTombstoneCount < 2048) {\n return;\n }\n if (this._customCellStyleArrangementTombstoneCount * 4 < length) {\n return;\n }\n const compacted = this.customCellStyleArrangement.filter(style => isValid((style as any).customStyleId));\n if (compacted.length === this.customCellStyleArrangement.length) {\n this._customCellStyleArrangementTombstoneCount = 0;\n return;\n }\n this.customCellStyleArrangement.length = 0;\n this.customCellStyleArrangement.push(...compacted);\n this._rebuildCustomCellStyleArrangementIndex();\n }\n\n clearCustomCellStyleArrangement() {\n this.customCellStyleArrangement = [];\n this._rebuildCustomCellStyleArrangementIndex();\n }\n\n addCustomCellStyleArrangement(\n cellPosition: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null\n ) {\n this.customCellStyleArrangement.push({\n cellPosition,\n customStyleId\n });\n }\n\n setCustomCellStyleOverlay(\n sourceId: string,\n cellPosition: { col?: number; row?: number; range?: CellRange },\n customStyleId: string | undefined | null\n ) {\n const positionKey = this._getCustomCellStyleArrangementKey(cellPosition);\n if (!positionKey) {\n return;\n }\n let overlay = this._customCellStyleOverlays.get(sourceId);\n if (!overlay) {\n overlay = {\n positions: new Map(),\n cells: new Map()\n };\n this._customCellStyleOverlays.set(sourceId, overlay);\n }\n const previousCellKeys = overlay.positions.get(positionKey) ?? [];\n if (!customStyleId) {\n previousCellKeys.forEach(cellKey => {\n const cellStyles = overlay?.cells.get(cellKey);\n cellStyles?.delete(positionKey);\n if (cellStyles?.size === 0) {\n overlay?.cells.delete(cellKey);\n }\n });\n overlay.positions.delete(positionKey);\n if (overlay.positions.size === 0) {\n this._customCellStyleOverlays.delete(sourceId);\n }\n return;\n }\n\n const range = cellPosition.range ?? {\n start: { col: cellPosition.col as number, row: cellPosition.row as number },\n end: { col: cellPosition.col as number, row: cellPosition.row as number }\n };\n const cellKeys: string[] = [];\n for (let col = range.start.col; col <= range.end.col; col++) {\n for (let row = range.start.row; row <= range.end.row; row++) {\n const cellKey = `${col}:${row}`;\n cellKeys.push(cellKey);\n let cellStyles = overlay.cells.get(cellKey);\n if (!cellStyles) {\n cellStyles = new Map();\n overlay.cells.set(cellKey, cellStyles);\n }\n cellStyles.set(positionKey, customStyleId);\n }\n }\n overlay.positions.set(positionKey, cellKeys);\n }\n\n clearCustomCellStyleOverlay(sourceId: string) {\n this._customCellStyleOverlays.delete(sourceId);\n }\n\n getCustomCellStyle(col: number, row: number) {\n const customStyleIds = this.getCustomCellStyleIds(col, row);\n if (customStyleIds.length) {\n const styles: ColumnStyleOption[] = [];\n\n customStyleIds.forEach(customStyleId => {\n const styleOption = this.getCustomCellStyleOption(customStyleId);\n if (isFunction(styleOption?.style)) {\n const style = styleOption.style({\n col,\n row,\n table: this.table,\n value: this.table.getCellValue(col, row),\n dataValue: this.table.getCellOriginValue(col, row),\n cellHeaderPaths: this.table.getCellHeaderPaths(col, row)\n });\n styles.push(style);\n } else if (styleOption?.style) {\n styles.push(styleOption.style);\n }\n });\n\n if (!styles.length) {\n return undefined;\n }\n return merge({}, ...styles);\n // const styleOption = this.getCustomCellStyleOption(customStyleId);\n // return styleOption?.style;\n }\n return undefined;\n }\n\n getCustomCellStyleIds(col: number, row: number) {\n const range = this.table.getCellRange(col, row);\n const rangeKey = `${range.start.col}:${range.start.row}:${range.end.col}:${range.end.row}`;\n const cachedStyleIds = this._customCellStyleIdsCache?.get(rangeKey);\n if (cachedStyleIds) {\n return cachedStyleIds;\n }\n\n const customStyleIds = this._collectCustomCellStyleIds(range);\n this._customCellStyleIdsCache?.set(rangeKey, customStyleIds);\n return customStyleIds;\n }\n\n private _collectCustomCellStyleIds(range: CellRange) {\n const customStyleIds: string[] = [];\n const seenArrangements = new Set<number>();\n const seenOverlayPositions = new Set<string>();\n\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n // eslint-disable-next-line no-loop-func\n this.customCellStyleArrangement.forEach((style, index) => {\n if (seenArrangements.has(index) || !isValid(style.customStyleId)) {\n return;\n }\n if (style.cellPosition.range) {\n if (\n style.cellPosition.range.start.col <= c &&\n style.cellPosition.range.end.col >= c &&\n style.cellPosition.range.start.row <= r &&\n style.cellPosition.range.end.row >= r\n ) {\n seenArrangements.add(index);\n customStyleIds.push(style.customStyleId as string);\n }\n } else if (style.cellPosition.col === c && style.cellPosition.row === r) {\n seenArrangements.add(index);\n customStyleIds.push(style.customStyleId as string);\n }\n });\n for (const [sourceId, overlay] of this._customCellStyleOverlays) {\n const overlayStyles = overlay.cells.get(`${c}:${r}`);\n if (overlayStyles) {\n for (const [positionKey, customStyleId] of overlayStyles) {\n const overlayPositionKey = `${sourceId}:${positionKey}`;\n if (!seenOverlayPositions.has(overlayPositionKey)) {\n seenOverlayPositions.add(overlayPositionKey);\n customStyleIds.push(customStyleId);\n }\n }\n }\n }\n }\n }\n\n return customStyleIds;\n }\n\n refreshCustomCellStyleRange(\n cellPosition: { col?: number; row?: number; range?: CellRange },\n forceFastUpdate: boolean = false\n ) {\n const range = cellPosition.range ?? {\n start: { col: cellPosition.col as number, row: cellPosition.row as number },\n end: { col: cellPosition.col as number, row: cellPosition.row as number }\n };\n const previousCache = this._customCellStyleIdsCache;\n this._customCellStyleIdsCache = new Map();\n try {\n for (let col = Math.max(0, range.start.col); col <= Math.min(this.table.colCount - 1, range.end.col); col++) {\n for (let row = Math.max(0, range.start.row); row <= Math.min(this.table.rowCount - 1, range.end.row); row++) {\n this.table.scenegraph.updateCellContent(col, row, forceFastUpdate);\n }\n }\n } finally {\n this._customCellStyleIdsCache = previousCache;\n }\n }\n\n getCustomCellStyleOption(customStyleId: string) {\n return this.customCellStyle.find(style => style.id === customStyleId);\n }\n\n registerCustomCellStyle(\n customStyleId: string,\n customStyle: ColumnStyleOption | ((styleArg: StylePropertyFunctionArg) => ColumnStyleOption) | undefined | null\n ) {\n const index = this.customCellStyle.findIndex(style => style.id === customStyleId);\n if (index === -1) {\n this.customCellStyle.push({\n id: customStyleId,\n style: customStyle\n });\n } else {\n this.customCellStyle[index] = {\n id: customStyleId,\n style: customStyle\n };\n }\n\n this.customCellStyleArrangement.forEach(cellStyle => {\n const cellPos = cellStyle.cellPosition;\n if (cellStyle.customStyleId === customStyleId) {\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);\n }\n }\n });\n this.table.scenegraph.updateNextFrame();\n }\n\n arrangeCustomCellStyle(\n cellPos: {\n col?: number;\n row?: number;\n range?: CellRange;\n },\n customStyleId: string | undefined | null,\n forceFastUpdate?: boolean\n ) {\n const inputKey = this._getCustomCellStyleArrangementKey(cellPos);\n this._rebuildCustomCellStyleArrangementIndex();\n const index = inputKey ? this._customCellStyleArrangementIndex.get(inputKey) ?? -1 : -1;\n\n if (index === -1 && !customStyleId) {\n // do nothing\n return;\n } else if (index === -1 && customStyleId) {\n // add new style\n this.customCellStyleArrangement.push({\n cellPosition: {\n col: cellPos.col,\n row: cellPos.row,\n range: cellPos.range\n },\n customStyleId: customStyleId\n });\n const pushedIndex = this.customCellStyleArrangement.length - 1;\n const pushedKey = this._getCustomCellStyleArrangementKey(\n this.customCellStyleArrangement[pushedIndex].cellPosition\n );\n if (pushedKey) {\n this._customCellStyleArrangementIndex.set(pushedKey, pushedIndex);\n }\n } else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {\n // same style\n return;\n } else if (customStyleId) {\n // update style\n this.customCellStyleArrangement[index].customStyleId = customStyleId;\n } else {\n // delete useless style\n (this.customCellStyleArrangement[index] as any).customStyleId = null;\n this._rebuildCustomCellStyleArrangementIndex();\n this._compactCustomCellStyleArrangementIfNeeded();\n }\n\n const style = customStyleId ? this.getCustomCellStyleOption(customStyleId)?.style : undefined;\n // let forceFastUpdate;\n if (style) {\n forceFastUpdate = true;\n for (const key in style) {\n if (cellStyleKeys.indexOf(key) === -1) {\n forceFastUpdate = false;\n break;\n }\n }\n }\n\n // update cell group\n if (cellPos.range) {\n for (\n let col = Math.max(0, cellPos.range.start.col);\n col <= Math.min(this.table.colCount - 1, cellPos.range.end.col);\n col++\n ) {\n for (\n let row = Math.max(0, cellPos.range.start.row);\n row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row);\n row++\n ) {\n const range = this.table.getCellRange(col, row);\n for (let c = range.start.col; c <= range.end.col; c++) {\n for (let r = range.start.row; r <= range.end.row; r++) {\n this.table.scenegraph.updateCellContent(c, r, forceFastUpdate);\n }\n }\n // this.table.scenegraph.updateCellContent(col, row);\n }\n }\n } else {\n this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row, forceFastUpdate);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateCustomCell(customCellStyle: CustomCellStyle[], customCellStyleArrangement: CustomCellStyleArrangement[]) {\n const positionsToRefresh = new Map<string, CustomCellStyleArrangement['cellPosition']>();\n this.customCellStyleArrangement.forEach(arrangement => {\n const key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);\n if (key) {\n positionsToRefresh.set(key, arrangement.cellPosition);\n }\n });\n\n this.customCellStyle.length = 0;\n const styleIndexes = new Map<string, number>();\n customCellStyle.forEach(cellStyle => {\n const index = styleIndexes.get(cellStyle.id);\n const nextCellStyle = {\n id: cellStyle.id,\n style: cellStyle.style\n };\n if (index === undefined) {\n styleIndexes.set(cellStyle.id, this.customCellStyle.length);\n this.customCellStyle.push(nextCellStyle);\n } else {\n this.customCellStyle[index] = nextCellStyle;\n }\n });\n\n this.customCellStyleArrangement.length = 0;\n const arrangementIndexes = new Map<string, number>();\n customCellStyleArrangement.forEach(arrangement => {\n const nextArrangement = {\n cellPosition: {\n col: arrangement.cellPosition.col,\n row: arrangement.cellPosition.row,\n range: arrangement.cellPosition.range\n },\n customStyleId: arrangement.customStyleId\n };\n const key = this._getCustomCellStyleArrangementKey(arrangement.cellPosition);\n if (key) {\n const index = arrangementIndexes.get(key);\n if (index === undefined) {\n arrangementIndexes.set(key, this.customCellStyleArrangement.length);\n this.customCellStyleArrangement.push(nextArrangement);\n } else {\n this.customCellStyleArrangement[index] = nextArrangement;\n }\n positionsToRefresh.set(key, arrangement.cellPosition);\n } else {\n this.customCellStyleArrangement.push(nextArrangement);\n }\n });\n this._rebuildCustomCellStyleArrangementIndex();\n\n positionsToRefresh.forEach(position => this.refreshCustomCellStyleRange(position));\n this.table.scenegraph.updateNextFrame();\n }\n\n hasCustomCellStyle(customStyleId: string) {\n return this.customCellStyle.some(style => style.id === customStyleId);\n }\n}\n\nexport function mergeStyle(cacheStyle: Style, customCellStyle: ColumnStyleOption): Style {\n cacheStyle = cacheStyle.clone();\n\n for (const key in customCellStyle) {\n const value = (customCellStyle as any)[key];\n if (isValid(value)) {\n (cacheStyle as any)[`_${key}`] = value;\n }\n }\n\n return cacheStyle;\n}\n\nexport const registerCustomCellStylePlugin = () => {\n Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);\n};\n\n// export type ICustomCellStylePlugin = typeof CustomCellStylePlugin;\n"]}
|
|
@@ -45,6 +45,8 @@ export declare class TableComponent {
|
|
|
45
45
|
updateMoveCol(backX: number, lineX: number, backY: number, lineY: number): void;
|
|
46
46
|
setFrozenColumnShadow(col: number, isRightFrozen?: boolean): void;
|
|
47
47
|
setRightFrozenColumnShadow(col: number): void;
|
|
48
|
+
private isFrozenColumnShadowVisible;
|
|
49
|
+
updateFrozenColumnShadowVisibility(): void;
|
|
48
50
|
hideFrozenColumnShadow(): void;
|
|
49
51
|
showFrozenColumnShadow(): void;
|
|
50
52
|
hideVerticalScrollBar(): void;
|
|
@@ -259,7 +259,7 @@ export class TableComponent {
|
|
|
259
259
|
}), this.vScrollBar.render(), this.vScrollBar.hideAll();
|
|
260
260
|
}
|
|
261
261
|
updateScrollBar() {
|
|
262
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
263
263
|
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos, oldFrozenHorizontalBarPos = this.table.stateManager.scroll.frozenHorizontalBarPos, oldRightFrozenHorizontalBarPos = this.table.stateManager.scroll.rightFrozenHorizontalBarPos, theme = this.table.theme, width = null === (_a = theme.scrollStyle) || void 0 === _a ? void 0 : _a.width, visible1 = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.visible, horizontalVisible = null !== (_d = null === (_c = theme.scrollStyle) || void 0 === _c ? void 0 : _c.horizontalVisible) && void 0 !== _d ? _d : visible1, verticalVisible = null !== (_f = null === (_e = theme.scrollStyle) || void 0 === _e ? void 0 : _e.verticalVisible) && void 0 !== _f ? _f : visible1, tableWidth = Math.ceil(this.table.tableNoFrameWidth), tableHeight = Math.ceil(this.table.tableNoFrameHeight), totalHeight = this.table.getAllRowsHeight(), totalWidth = this.table.getAllColsWidth(), frozenRowsHeight = this.table.getFrozenRowsHeight(), frozenColsWidth = this.table.getFrozenColsWidth(), frozenColsContentWidth = null !== (_j = null === (_h = (_g = this.table).getFrozenColsContentWidth) || void 0 === _h ? void 0 : _h.call(_g)) && void 0 !== _j ? _j : frozenColsWidth, bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.table.getRightFrozenColsWidth(), rightFrozenColsContentWidth = null !== (_m = null === (_l = (_k = this.table).getRightFrozenColsContentWidth) || void 0 === _l ? void 0 : _l.call(_k)) && void 0 !== _m ? _m : rightFrozenColsWidth, hoverOn = this.table.theme.scrollStyle.hoverOn, sizeTolerance = (null === (_o = this.table.options.customConfig) || void 0 === _o ? void 0 : _o._disableColumnAndRowSizeRound) ? 1 : 0, bodyScrollRange = getBodyHorizontalScrollRange(this.table), y = Math.min(tableHeight, totalHeight);
|
|
264
264
|
let attrY = 0;
|
|
265
265
|
attrY = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) + this.table.tableY : y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
@@ -353,7 +353,8 @@ export class TableComponent {
|
|
|
353
353
|
});
|
|
354
354
|
this.table.stateManager.setScrollLeft(oldHorizontalBarPos), this.table.stateManager.setFrozenColsScrollLeft(oldFrozenHorizontalBarPos, !1),
|
|
355
355
|
this.table.stateManager.setRightFrozenColsScrollLeft(oldRightFrozenHorizontalBarPos, !1),
|
|
356
|
-
this.table.stateManager.setScrollTop(oldVerticalBarPos)
|
|
356
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos), "overflow" === (null === (_s = null === (_r = this.table.theme.frozenColumnLine) || void 0 === _r ? void 0 : _r.shadow) || void 0 === _s ? void 0 : _s.visible) && (this.setFrozenColumnShadow(this.table.frozenColCount - 1),
|
|
357
|
+
this.setRightFrozenColumnShadow(this.table.colCount - this.table.rightFrozenColCount));
|
|
357
358
|
}
|
|
358
359
|
hideResizeCol() {
|
|
359
360
|
this.columnResizeLine.setAttribute("visible", !1), this.columnResizeBgLine.setAttribute("visible", !1),
|
|
@@ -479,9 +480,9 @@ export class TableComponent {
|
|
|
479
480
|
this.cellMover.update(backX, lineX, backY, lineY);
|
|
480
481
|
}
|
|
481
482
|
setFrozenColumnShadow(col, isRightFrozen) {
|
|
482
|
-
var _a, _b, _c
|
|
483
|
+
var _a, _b, _c;
|
|
483
484
|
const colX = !isRightFrozen && col === this.table.frozenColCount - 1 && (null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0) > 0 ? this.table.getFrozenColsWidth() : getColX(col, this.table, isRightFrozen);
|
|
484
|
-
col < 0 ||
|
|
485
|
+
col < 0 || !this.isFrozenColumnShadowVisible(!1) ? this.frozenShadowLine.setAttributes({
|
|
485
486
|
visible: !1,
|
|
486
487
|
x: colX,
|
|
487
488
|
height: this.table.getDrawRange().height
|
|
@@ -492,9 +493,9 @@ export class TableComponent {
|
|
|
492
493
|
});
|
|
493
494
|
}
|
|
494
495
|
setRightFrozenColumnShadow(col) {
|
|
495
|
-
var _a, _b, _c
|
|
496
|
+
var _a, _b, _c;
|
|
496
497
|
const colX = this.table.options.scrollRightFrozenCols && (null !== (_c = null === (_b = (_a = this.table).getRightFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0) > 0 ? this.table.tableNoFrameWidth - this.table.getRightFrozenColsWidth() : getColX(col, this.table, !0);
|
|
497
|
-
col >= this.table.colCount ||
|
|
498
|
+
col >= this.table.colCount || !this.isFrozenColumnShadowVisible(!0) ? this.rightFrozenShadowLine.setAttributes({
|
|
498
499
|
visible: !1,
|
|
499
500
|
x: colX - this.rightFrozenShadowLine.attribute.width,
|
|
500
501
|
height: this.table.getDrawRange().height
|
|
@@ -504,6 +505,20 @@ export class TableComponent {
|
|
|
504
505
|
height: this.table.getDrawRange().height
|
|
505
506
|
});
|
|
506
507
|
}
|
|
508
|
+
isFrozenColumnShadowVisible(right) {
|
|
509
|
+
var _a, _b, _c;
|
|
510
|
+
const visible = null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible;
|
|
511
|
+
if ("overflow" !== visible) return "always" === visible;
|
|
512
|
+
const frozenCount = right ? this.table.rightFrozenColCount : this.table.frozenColCount, sizeTolerance = (null === (_c = this.table.options.customConfig) || void 0 === _c ? void 0 : _c._disableColumnAndRowSizeRound) ? 1 : 0, scrollRange = Math.max(0, Math.ceil(getBodyHorizontalScrollRange(this.table) - sizeTolerance));
|
|
513
|
+
return frozenCount > 0 && scrollRange > 0 && (right ? this.table.scrollLeft < scrollRange : this.table.scrollLeft > 0);
|
|
514
|
+
}
|
|
515
|
+
updateFrozenColumnShadowVisibility() {
|
|
516
|
+
var _a, _b;
|
|
517
|
+
if ("overflow" !== (null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible)) return;
|
|
518
|
+
const leftVisible = this.isFrozenColumnShadowVisible(!1), rightVisible = this.isFrozenColumnShadowVisible(!0);
|
|
519
|
+
this.frozenShadowLine.attribute.visible !== leftVisible && this.frozenShadowLine.setAttribute("visible", leftVisible),
|
|
520
|
+
this.rightFrozenShadowLine.attribute.visible !== rightVisible && this.rightFrozenShadowLine.setAttribute("visible", rightVisible);
|
|
521
|
+
}
|
|
507
522
|
hideFrozenColumnShadow() {
|
|
508
523
|
var _a, _b, _c, _d, _e;
|
|
509
524
|
const visible1 = null === (_b = null === (_a = this.table.theme.frozenColumnLine) || void 0 === _a ? void 0 : _a.shadow) || void 0 === _b ? void 0 : _b.visible;
|