@visactor/vtable 1.11.3 → 1.11.5

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 (63) hide show
  1. package/cjs/ListTable-all.js +6 -5
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/PivotTable.js +14 -3
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.d.ts +2 -2
  6. package/cjs/core/BaseTable.js +13 -8
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/core/style-helper.js +6 -6
  9. package/cjs/core/style-helper.js.map +1 -1
  10. package/cjs/index.d.ts +1 -4
  11. package/cjs/index.js +2 -3
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/plugins/custom-cell-style.d.ts +6 -2
  14. package/cjs/plugins/custom-cell-style.js +8 -2
  15. package/cjs/plugins/custom-cell-style.js.map +1 -1
  16. package/cjs/plugins/invert-highlight.d.ts +0 -18
  17. package/cjs/plugins/invert-highlight.js +3 -52
  18. package/cjs/plugins/invert-highlight.js.map +1 -1
  19. package/cjs/plugins/list-tree-stick-cell.d.ts +3 -1
  20. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  21. package/cjs/plugins/list-tree-stick-cell.js.map +1 -1
  22. package/cjs/ts-types/base-table.d.ts +4 -4
  23. package/cjs/ts-types/base-table.js.map +1 -1
  24. package/cjs/vrender.js.map +1 -1
  25. package/dist/vtable.js +188 -517
  26. package/dist/vtable.min.js +2 -2
  27. package/es/ListTable-all.js +5 -3
  28. package/es/ListTable-all.js.map +1 -1
  29. package/es/PivotTable.js +14 -3
  30. package/es/PivotTable.js.map +1 -1
  31. package/es/core/BaseTable.d.ts +2 -2
  32. package/es/core/BaseTable.js +12 -9
  33. package/es/core/BaseTable.js.map +1 -1
  34. package/es/core/style-helper.js +7 -7
  35. package/es/core/style-helper.js.map +1 -1
  36. package/es/index.d.ts +1 -4
  37. package/es/index.js +1 -7
  38. package/es/index.js.map +1 -1
  39. package/es/plugins/custom-cell-style.d.ts +6 -2
  40. package/es/plugins/custom-cell-style.js +6 -0
  41. package/es/plugins/custom-cell-style.js.map +1 -1
  42. package/es/plugins/invert-highlight.d.ts +0 -18
  43. package/es/plugins/invert-highlight.js +0 -55
  44. package/es/plugins/invert-highlight.js.map +1 -1
  45. package/es/plugins/list-tree-stick-cell.d.ts +3 -1
  46. package/es/plugins/list-tree-stick-cell.js +4 -4
  47. package/es/plugins/list-tree-stick-cell.js.map +1 -1
  48. package/es/ts-types/base-table.d.ts +4 -4
  49. package/es/ts-types/base-table.js.map +1 -1
  50. package/es/vrender.js.map +1 -1
  51. package/package.json +3 -3
  52. package/cjs/plugins/carousel-animation.d.ts +0 -48
  53. package/cjs/plugins/carousel-animation.js +0 -71
  54. package/cjs/plugins/carousel-animation.js.map +0 -1
  55. package/cjs/plugins/header-highlight.d.ts +0 -21
  56. package/cjs/plugins/header-highlight.js +0 -108
  57. package/cjs/plugins/header-highlight.js.map +0 -1
  58. package/es/plugins/carousel-animation.d.ts +0 -48
  59. package/es/plugins/carousel-animation.js +0 -63
  60. package/es/plugins/carousel-animation.js.map +0 -1
  61. package/es/plugins/header-highlight.d.ts +0 -21
  62. package/es/plugins/header-highlight.js +0 -100
  63. package/es/plugins/header-highlight.js.map +0 -1
package/dist/vtable.js CHANGED
@@ -35957,94 +35957,6 @@
35957
35957
  });
35958
35958
  }
35959
35959
 
35960
- function isSameRange$1(range1, range2) {
35961
- if (!range1 && !range2) {
35962
- return true;
35963
- }
35964
- if (!range1 || !range2) {
35965
- return false;
35966
- }
35967
- return (range1.start.col === range2.start.col &&
35968
- range1.start.row === range2.start.row &&
35969
- range1.end.col === range2.end.col &&
35970
- range1.end.row === range2.end.row);
35971
- }
35972
-
35973
- class InvertHighlightPlugin {
35974
- table;
35975
- range;
35976
- _fill;
35977
- _opacity;
35978
- constructor(table, options) {
35979
- this.table = table;
35980
- this._fill = options?.fill ?? '#000';
35981
- this._opacity = options?.opacity ?? 0.5;
35982
- }
35983
- setInvertHighlightRange(range) {
35984
- if (isSameRange$1(this.range, range)) {
35985
- return;
35986
- }
35987
- this.range = range;
35988
- if (!range) {
35989
- this.deleteAllCellGroupShadow();
35990
- }
35991
- else {
35992
- this.updateCellGroupShadow();
35993
- }
35994
- this.table.scenegraph.updateNextFrame();
35995
- }
35996
- deleteAllCellGroupShadow() {
35997
- if (!this.table.isPivotTable()) {
35998
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup);
35999
- this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup);
36000
- }
36001
- this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup);
36002
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup);
36003
- this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup);
36004
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup);
36005
- }
36006
- updateCellGroupShadow() {
36007
- if (!this.table.isPivotTable()) {
36008
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup, this.range);
36009
- this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup, this.range);
36010
- }
36011
- this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup, this.range);
36012
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup, this.range);
36013
- this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup), this.range;
36014
- this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup, this.range);
36015
- }
36016
- updateCellGroupShadowInContainer(container, range) {
36017
- container.forEachChildrenSkipChild((column) => {
36018
- if (column.role === 'column') {
36019
- column.forEachChildrenSkipChild((cell) => {
36020
- if (cell.role !== 'cell') {
36021
- return;
36022
- }
36023
- cell.attachShadow(cell.shadowRoot);
36024
- const shadowGroup = cell.shadowRoot;
36025
- if (!range) {
36026
- shadowGroup.removeAllChild();
36027
- }
36028
- else if (cellInRange(range, cell.col, cell.row)) {
36029
- shadowGroup.removeAllChild();
36030
- }
36031
- else if (!shadowGroup.firstChild) {
36032
- const shadowRect = createRect({
36033
- x: 0,
36034
- y: 0,
36035
- width: cell.attribute.width,
36036
- height: cell.attribute.height,
36037
- fill: this._fill,
36038
- opacity: this._opacity
36039
- });
36040
- shadowRect.name = 'shadow-rect';
36041
- shadowGroup.appendChild(shadowRect);
36042
- }
36043
- });
36044
- }
36045
- });
36046
- }
36047
- }
36048
35960
  function onBeforeAttributeUpdateForInvertHighlight(val, attribute) {
36049
35961
  const graphic = this;
36050
35962
  if (graphic.shadowRoot && graphic.shadowRoot.childrenCount && (isValid$1(val.width) || isValid$1(val.height))) {
@@ -55485,159 +55397,6 @@
55485
55397
  }
55486
55398
  }
55487
55399
 
55488
- class CustomCellStylePlugin {
55489
- table;
55490
- customCellStyle;
55491
- customCellStyleArrangement;
55492
- constructor(table, customCellStyle, customCellStyleArrangement) {
55493
- this.table = table;
55494
- this.customCellStyle = customCellStyle;
55495
- this.customCellStyleArrangement = customCellStyleArrangement;
55496
- }
55497
- getCustomCellStyle(col, row) {
55498
- const customStyleIds = this.getCustomCellStyleIds(col, row);
55499
- if (customStyleIds.length) {
55500
- const styles = [];
55501
- customStyleIds.forEach(customStyleId => {
55502
- const styleOption = this.getCustomCellStyleOption(customStyleId);
55503
- if (styleOption?.style) {
55504
- styles.push(styleOption.style);
55505
- }
55506
- });
55507
- return merge({}, ...styles);
55508
- }
55509
- return undefined;
55510
- }
55511
- getCustomCellStyleIds(col, row) {
55512
- const customStyleIds = [];
55513
- const range = this.table.getCellRange(col, row);
55514
- for (let c = range.start.col; c <= range.end.col; c++) {
55515
- for (let r = range.start.row; r <= range.end.row; r++) {
55516
- this.customCellStyleArrangement.forEach(style => {
55517
- if (style.cellPosition.range) {
55518
- if (style.cellPosition.range.start.col <= c &&
55519
- style.cellPosition.range.end.col >= c &&
55520
- style.cellPosition.range.start.row <= r &&
55521
- style.cellPosition.range.end.row >= r) {
55522
- customStyleIds.push(style.customStyleId);
55523
- }
55524
- }
55525
- else if (style.cellPosition.col === c && style.cellPosition.row === r) {
55526
- customStyleIds.push(style.customStyleId);
55527
- }
55528
- });
55529
- }
55530
- }
55531
- return customStyleIds;
55532
- }
55533
- getCustomCellStyleOption(customStyleId) {
55534
- return this.customCellStyle.find(style => style.id === customStyleId);
55535
- }
55536
- registerCustomCellStyle(customStyleId, customStyle) {
55537
- const index = this.customCellStyle.findIndex(style => style.id === customStyleId);
55538
- if (index === -1) {
55539
- this.customCellStyle.push({
55540
- id: customStyleId,
55541
- style: customStyle
55542
- });
55543
- }
55544
- else {
55545
- this.customCellStyle[index] = {
55546
- id: customStyleId,
55547
- style: customStyle
55548
- };
55549
- }
55550
- this.customCellStyleArrangement.forEach(cellStyle => {
55551
- const cellPos = cellStyle.cellPosition;
55552
- if (cellStyle.customStyleId === customStyleId) {
55553
- if (cellPos.range) {
55554
- for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) {
55555
- for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
55556
- this.table.scenegraph.updateCellContent(col, row);
55557
- }
55558
- }
55559
- }
55560
- else {
55561
- this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
55562
- }
55563
- }
55564
- });
55565
- this.table.scenegraph.updateNextFrame();
55566
- }
55567
- arrangeCustomCellStyle(cellPos, customStyleId) {
55568
- const index = this.customCellStyleArrangement.findIndex(style => {
55569
- if (style.cellPosition.range && cellPos.range) {
55570
- return (style.cellPosition.range.start.col === cellPos.range.start.col &&
55571
- style.cellPosition.range.start.row === cellPos.range.start.row &&
55572
- style.cellPosition.range.end.col === cellPos.range.end.col &&
55573
- style.cellPosition.range.end.row === cellPos.range.end.row);
55574
- }
55575
- return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;
55576
- });
55577
- if (index === -1 && !customStyleId) {
55578
- return;
55579
- }
55580
- else if (index === -1 && customStyleId) {
55581
- this.customCellStyleArrangement.push({
55582
- cellPosition: {
55583
- col: cellPos.col,
55584
- row: cellPos.row,
55585
- range: cellPos.range
55586
- },
55587
- customStyleId: customStyleId
55588
- });
55589
- }
55590
- else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {
55591
- return;
55592
- }
55593
- else if (customStyleId) {
55594
- this.customCellStyleArrangement[index].customStyleId = customStyleId;
55595
- }
55596
- else {
55597
- this.customCellStyleArrangement.splice(index, 1);
55598
- }
55599
- if (cellPos.range) {
55600
- for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) {
55601
- for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
55602
- const range = this.table.getCellRange(col, row);
55603
- for (let c = range.start.col; c <= range.end.col; c++) {
55604
- for (let r = range.start.row; r <= range.end.row; r++) {
55605
- this.table.scenegraph.updateCellContent(c, r);
55606
- }
55607
- }
55608
- }
55609
- }
55610
- }
55611
- else {
55612
- this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
55613
- }
55614
- this.table.scenegraph.updateNextFrame();
55615
- }
55616
- updateCustomCell(customCellStyle, customCellStyleArrangement) {
55617
- this.customCellStyle.length = 0;
55618
- this.customCellStyleArrangement.length = 0;
55619
- customCellStyle.forEach((cellStyle) => {
55620
- this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
55621
- });
55622
- customCellStyleArrangement.forEach((cellStyle) => {
55623
- this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
55624
- });
55625
- }
55626
- hasCustomCellStyle(customStyleId) {
55627
- return this.customCellStyle.some(style => style.id === customStyleId);
55628
- }
55629
- }
55630
- function mergeStyle(cacheStyle, customCellStyle) {
55631
- cacheStyle = cacheStyle.clone();
55632
- for (const key in customCellStyle) {
55633
- const value = customCellStyle[key];
55634
- if (value) {
55635
- cacheStyle[`_${key}`] = value;
55636
- }
55637
- }
55638
- return cacheStyle;
55639
- }
55640
-
55641
55400
  class DimensionTree {
55642
55401
  sharedVar;
55643
55402
  sizeIncludeParent = false;
@@ -57387,9 +57146,165 @@
57387
57146
  return (isHorizontal && isThisXAxis) || (!isHorizontal && !isThisXAxis);
57388
57147
  }
57389
57148
 
57149
+ class CustomCellStylePlugin {
57150
+ table;
57151
+ customCellStyle;
57152
+ customCellStyleArrangement;
57153
+ constructor(table, customCellStyle, customCellStyleArrangement) {
57154
+ this.table = table;
57155
+ this.customCellStyle = customCellStyle;
57156
+ this.customCellStyleArrangement = customCellStyleArrangement;
57157
+ }
57158
+ getCustomCellStyle(col, row) {
57159
+ const customStyleIds = this.getCustomCellStyleIds(col, row);
57160
+ if (customStyleIds.length) {
57161
+ const styles = [];
57162
+ customStyleIds.forEach(customStyleId => {
57163
+ const styleOption = this.getCustomCellStyleOption(customStyleId);
57164
+ if (styleOption?.style) {
57165
+ styles.push(styleOption.style);
57166
+ }
57167
+ });
57168
+ return merge({}, ...styles);
57169
+ }
57170
+ return undefined;
57171
+ }
57172
+ getCustomCellStyleIds(col, row) {
57173
+ const customStyleIds = [];
57174
+ const range = this.table.getCellRange(col, row);
57175
+ for (let c = range.start.col; c <= range.end.col; c++) {
57176
+ for (let r = range.start.row; r <= range.end.row; r++) {
57177
+ this.customCellStyleArrangement.forEach(style => {
57178
+ if (style.cellPosition.range) {
57179
+ if (style.cellPosition.range.start.col <= c &&
57180
+ style.cellPosition.range.end.col >= c &&
57181
+ style.cellPosition.range.start.row <= r &&
57182
+ style.cellPosition.range.end.row >= r) {
57183
+ customStyleIds.push(style.customStyleId);
57184
+ }
57185
+ }
57186
+ else if (style.cellPosition.col === c && style.cellPosition.row === r) {
57187
+ customStyleIds.push(style.customStyleId);
57188
+ }
57189
+ });
57190
+ }
57191
+ }
57192
+ return customStyleIds;
57193
+ }
57194
+ getCustomCellStyleOption(customStyleId) {
57195
+ return this.customCellStyle.find(style => style.id === customStyleId);
57196
+ }
57197
+ registerCustomCellStyle(customStyleId, customStyle) {
57198
+ const index = this.customCellStyle.findIndex(style => style.id === customStyleId);
57199
+ if (index === -1) {
57200
+ this.customCellStyle.push({
57201
+ id: customStyleId,
57202
+ style: customStyle
57203
+ });
57204
+ }
57205
+ else {
57206
+ this.customCellStyle[index] = {
57207
+ id: customStyleId,
57208
+ style: customStyle
57209
+ };
57210
+ }
57211
+ this.customCellStyleArrangement.forEach(cellStyle => {
57212
+ const cellPos = cellStyle.cellPosition;
57213
+ if (cellStyle.customStyleId === customStyleId) {
57214
+ if (cellPos.range) {
57215
+ for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) {
57216
+ for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
57217
+ this.table.scenegraph.updateCellContent(col, row);
57218
+ }
57219
+ }
57220
+ }
57221
+ else {
57222
+ this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
57223
+ }
57224
+ }
57225
+ });
57226
+ this.table.scenegraph.updateNextFrame();
57227
+ }
57228
+ arrangeCustomCellStyle(cellPos, customStyleId) {
57229
+ const index = this.customCellStyleArrangement.findIndex(style => {
57230
+ if (style.cellPosition.range && cellPos.range) {
57231
+ return (style.cellPosition.range.start.col === cellPos.range.start.col &&
57232
+ style.cellPosition.range.start.row === cellPos.range.start.row &&
57233
+ style.cellPosition.range.end.col === cellPos.range.end.col &&
57234
+ style.cellPosition.range.end.row === cellPos.range.end.row);
57235
+ }
57236
+ return style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row;
57237
+ });
57238
+ if (index === -1 && !customStyleId) {
57239
+ return;
57240
+ }
57241
+ else if (index === -1 && customStyleId) {
57242
+ this.customCellStyleArrangement.push({
57243
+ cellPosition: {
57244
+ col: cellPos.col,
57245
+ row: cellPos.row,
57246
+ range: cellPos.range
57247
+ },
57248
+ customStyleId: customStyleId
57249
+ });
57250
+ }
57251
+ else if (this.customCellStyleArrangement[index].customStyleId === customStyleId) {
57252
+ return;
57253
+ }
57254
+ else if (customStyleId) {
57255
+ this.customCellStyleArrangement[index].customStyleId = customStyleId;
57256
+ }
57257
+ else {
57258
+ this.customCellStyleArrangement.splice(index, 1);
57259
+ }
57260
+ if (cellPos.range) {
57261
+ for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) {
57262
+ for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) {
57263
+ const range = this.table.getCellRange(col, row);
57264
+ for (let c = range.start.col; c <= range.end.col; c++) {
57265
+ for (let r = range.start.row; r <= range.end.row; r++) {
57266
+ this.table.scenegraph.updateCellContent(c, r);
57267
+ }
57268
+ }
57269
+ }
57270
+ }
57271
+ }
57272
+ else {
57273
+ this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
57274
+ }
57275
+ this.table.scenegraph.updateNextFrame();
57276
+ }
57277
+ updateCustomCell(customCellStyle, customCellStyleArrangement) {
57278
+ this.customCellStyle.length = 0;
57279
+ this.customCellStyleArrangement.length = 0;
57280
+ customCellStyle.forEach((cellStyle) => {
57281
+ this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
57282
+ });
57283
+ customCellStyleArrangement.forEach((cellStyle) => {
57284
+ this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
57285
+ });
57286
+ }
57287
+ hasCustomCellStyle(customStyleId) {
57288
+ return this.customCellStyle.some(style => style.id === customStyleId);
57289
+ }
57290
+ }
57291
+ function mergeStyle(cacheStyle, customCellStyle) {
57292
+ cacheStyle = cacheStyle.clone();
57293
+ for (const key in customCellStyle) {
57294
+ const value = customCellStyle[key];
57295
+ if (value) {
57296
+ cacheStyle[`_${key}`] = value;
57297
+ }
57298
+ }
57299
+ return cacheStyle;
57300
+ }
57301
+ const registerCustomCellStylePlugin = () => {
57302
+ Factory.registerComponent('customCellStylePlugin', CustomCellStylePlugin);
57303
+ };
57304
+
57390
57305
  const EMPTY_STYLE = {};
57391
57306
  function getCellStyle(col, row, table) {
57392
- const customCellStyle = table.customCellStylePlugin.getCustomCellStyle(col, row);
57307
+ const customCellStyle = table.customCellStylePlugin?.getCustomCellStyle(col, row);
57393
57308
  const { layoutMap } = table.internalProps;
57394
57309
  const isHeader = layoutMap.isHeader(col, row);
57395
57310
  if (isHeader) {
@@ -57644,7 +57559,7 @@
57644
57559
  return TABLE_EVENT_TYPE;
57645
57560
  }
57646
57561
  options;
57647
- version = "1.11.3";
57562
+ version = "1.11.5";
57648
57563
  pagination;
57649
57564
  id = `VTable${Date.now()}`;
57650
57565
  headerStyleCache;
@@ -57845,7 +57760,10 @@
57845
57760
  this.bodyBottomStyleCache = new Map();
57846
57761
  internalProps.stick = { changedCells: new Map() };
57847
57762
  internalProps.customMergeCell = options.customMergeCell;
57848
- this.customCellStylePlugin = new CustomCellStylePlugin(this, options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
57763
+ const CustomCellStylePlugin = Factory.getComponent('customCellStylePlugin');
57764
+ if (CustomCellStylePlugin) {
57765
+ this.customCellStylePlugin = new CustomCellStylePlugin(this, options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
57766
+ }
57849
57767
  }
57850
57768
  throttleInvalidate = throttle2(this.render.bind(this), 200);
57851
57769
  getContainer() {
@@ -59064,7 +58982,7 @@
59064
58982
  this.clearColWidthCache();
59065
58983
  this.clearRowHeightCache();
59066
58984
  internalProps.customMergeCell = options.customMergeCell;
59067
- this.customCellStylePlugin.updateCustomCell(options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
58985
+ this.customCellStylePlugin?.updateCustomCell(options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
59068
58986
  }
59069
58987
  renderWithRecreateCells() {
59070
58988
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
@@ -60198,13 +60116,13 @@
60198
60116
  changeRecordOrder(source, target) {
60199
60117
  }
60200
60118
  hasCustomCellStyle(customStyleId) {
60201
- return this.customCellStylePlugin.hasCustomCellStyle(customStyleId);
60119
+ return this.customCellStylePlugin?.hasCustomCellStyle(customStyleId);
60202
60120
  }
60203
60121
  registerCustomCellStyle(customStyleId, customStyle) {
60204
- this.customCellStylePlugin.registerCustomCellStyle(customStyleId, customStyle);
60122
+ this.customCellStylePlugin?.registerCustomCellStyle(customStyleId, customStyle);
60205
60123
  }
60206
60124
  arrangeCustomCellStyle(cellPos, customStyleId) {
60207
- this.customCellStylePlugin.arrangeCustomCellStyle(cellPos, customStyleId);
60125
+ this.customCellStylePlugin?.arrangeCustomCellStyle(cellPos, customStyleId);
60208
60126
  }
60209
60127
  isSeriesNumber(col, row) {
60210
60128
  return this.internalProps.layoutMap.isSeriesNumber(col, row);
@@ -69138,6 +69056,7 @@
69138
69056
  registerTitle();
69139
69057
  registerTooltip();
69140
69058
  registerListTreeStickCellPlugin();
69059
+ registerCustomCellStylePlugin();
69141
69060
  registerChartCell();
69142
69061
  registerCheckboxCell();
69143
69062
  registerImageCell();
@@ -74755,10 +74674,27 @@
74755
74674
  const dimensions = item.dimensions;
74756
74675
  const width = item.width;
74757
74676
  const cell = this.getCellAddressByHeaderPaths(dimensions);
74758
- if (cell.col >= this.rowHeaderLevelCount) {
74759
- const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount - 1);
74677
+ if (cell && cell.col >= this.rowHeaderLevelCount) {
74678
+ const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount);
74760
74679
  if (cellPath.colHeaderPaths.length === dimensions.length) {
74761
- if (cell && !this.internalProps._widthResizedColMap.has(cell.col)) {
74680
+ let match = true;
74681
+ for (let i = 0; i < dimensions.length; i++) {
74682
+ const dimension = dimensions[i];
74683
+ const finded = cellPath.colHeaderPaths.findIndex((colPath, index) => {
74684
+ if (colPath.indicatorKey === dimension.indicatorKey) {
74685
+ return true;
74686
+ }
74687
+ if (colPath.dimensionKey === dimension.dimensionKey && colPath.value === dimension.value) {
74688
+ return true;
74689
+ }
74690
+ return false;
74691
+ });
74692
+ if (finded < 0) {
74693
+ match = false;
74694
+ break;
74695
+ }
74696
+ }
74697
+ if (match && !this.internalProps._widthResizedColMap.has(cell.col)) {
74762
74698
  this._setColWidth(cell.col, width);
74763
74699
  this.internalProps._widthResizedColMap.add(cell.col);
74764
74700
  }
@@ -77071,269 +77007,8 @@
77071
77007
  return new Radio(params ? params.attribute : {});
77072
77008
  }
77073
77009
 
77074
- class CarouselAnimationPlugin {
77075
- table;
77076
- rowCount;
77077
- colCount;
77078
- animationDuration;
77079
- animationDelay;
77080
- animationEasing;
77081
- replaceScrollAction;
77082
- playing;
77083
- row;
77084
- col;
77085
- willUpdateRow = false;
77086
- willUpdateCol = false;
77087
- customDistRowFunction;
77088
- customDistColFunction;
77089
- constructor(table, options) {
77090
- this.table = table;
77091
- this.rowCount = options?.rowCount ?? undefined;
77092
- this.colCount = options?.colCount ?? undefined;
77093
- this.animationDuration = options?.animationDuration ?? 500;
77094
- this.animationDelay = options?.animationDelay ?? 1000;
77095
- this.animationEasing = options?.animationEasing ?? 'linear';
77096
- this.replaceScrollAction = options?.replaceScrollAction ?? false;
77097
- this.customDistColFunction = options.customDistColFunction;
77098
- this.customDistRowFunction = options.customDistRowFunction;
77099
- this.reset();
77100
- this.init();
77101
- }
77102
- init() {
77103
- if (this.replaceScrollAction) {
77104
- this.table.disableScroll();
77105
- this.table.scenegraph.stage.addEventListener('wheel', this.onScrollEnd.bind(this));
77106
- }
77107
- }
77108
- reset() {
77109
- this.playing = false;
77110
- this.row = this.table.frozenRowCount;
77111
- this.col = this.table.frozenColCount;
77112
- }
77113
- onScrollEnd(e) {
77114
- if (this.rowCount) {
77115
- if (e.deltaY > 0) {
77116
- this.row += this.rowCount;
77117
- this.row = Math.min(this.row, this.table.rowCount - this.table.frozenRowCount);
77118
- }
77119
- else if (e.deltaY < 0) {
77120
- this.row -= this.rowCount;
77121
- this.row = Math.max(this.row, this.table.frozenRowCount);
77122
- }
77123
- this.table.scrollToRow(this.row, { duration: this.animationDuration, easing: this.animationEasing });
77124
- }
77125
- else if (this.colCount) {
77126
- if (e.deltaX > 0) {
77127
- this.col += this.colCount;
77128
- this.col = Math.min(this.col, this.table.colCount - this.table.frozenColCount);
77129
- }
77130
- else if (e.deltaX < 0) {
77131
- this.col -= this.colCount;
77132
- this.col = Math.max(this.col, this.table.frozenColCount);
77133
- }
77134
- this.table.scrollToCol(this.col, { duration: this.animationDuration, easing: this.animationEasing });
77135
- }
77136
- }
77137
- play() {
77138
- this.playing = true;
77139
- if (this.rowCount && !this.willUpdateRow) {
77140
- this.updateRow();
77141
- }
77142
- else if (this.colCount && !this.willUpdateCol) {
77143
- this.updateCol();
77144
- }
77145
- }
77146
- pause() {
77147
- this.playing = false;
77148
- }
77149
- updateRow() {
77150
- if (!this.playing || this.table.isReleased) {
77151
- return;
77152
- }
77153
- let animation = true;
77154
- const customRow = this.customDistRowFunction && this.customDistRowFunction(this.row, this.table);
77155
- if (customRow) {
77156
- this.row = customRow.distRow;
77157
- animation = customRow.animation ?? true;
77158
- }
77159
- else if (this.table.scenegraph.proxy.screenTopRow !== this.row) {
77160
- this.row = this.table.frozenRowCount;
77161
- animation = false;
77162
- }
77163
- else {
77164
- this.row += this.rowCount;
77165
- }
77166
- this.table.scrollToRow(this.row, animation ? { duration: this.animationDuration, easing: this.animationEasing } : undefined);
77167
- this.willUpdateRow = true;
77168
- setTimeout(() => {
77169
- this.willUpdateRow = false;
77170
- this.updateRow();
77171
- }, this.animationDuration + this.animationDelay);
77172
- }
77173
- updateCol() {
77174
- if (!this.playing || this.table.isReleased) {
77175
- return;
77176
- }
77177
- let animation = true;
77178
- const customCol = this.customDistColFunction && this.customDistColFunction(this.col, this.table);
77179
- if (customCol) {
77180
- this.col = customCol.distCol;
77181
- animation = customCol.animation ?? true;
77182
- }
77183
- else if (this.table.scenegraph.proxy.screenLeftCol !== this.col) {
77184
- this.col = this.table.frozenColCount;
77185
- animation = false;
77186
- }
77187
- else {
77188
- this.col += this.colCount;
77189
- }
77190
- this.table.scrollToCol(this.col, animation ? { duration: this.animationDuration, easing: this.animationEasing } : undefined);
77191
- this.willUpdateCol = true;
77192
- setTimeout(() => {
77193
- this.willUpdateCol = false;
77194
- this.updateCol();
77195
- }, this.animationDuration + this.animationDelay);
77196
- }
77197
- }
77198
-
77199
- class HeaderHighlightPlugin {
77200
- table;
77201
- options;
77202
- colHeaderRange;
77203
- rowHeaderRange;
77204
- constructor(table, options) {
77205
- this.table = table;
77206
- this.options = options;
77207
- this.registerStyle();
77208
- this.bindEvent();
77209
- }
77210
- registerStyle() {
77211
- this.table.registerCustomCellStyle('col-highlight', {
77212
- bgColor: this.options?.colHighlightBGColor ?? '#82b2f5',
77213
- color: this.options?.colHighlightColor ?? '#FFF'
77214
- });
77215
- this.table.registerCustomCellStyle('row-highlight', {
77216
- bgColor: this.options?.rowHighlightBGColor ?? '#82b2f5',
77217
- color: this.options?.rowHighlightColor ?? '#FFF'
77218
- });
77219
- }
77220
- bindEvent() {
77221
- this.table.on('selected_cell', e => {
77222
- this.updateHighlight();
77223
- });
77224
- this.table.on('selected_clear', () => {
77225
- this.clearHighlight();
77226
- });
77227
- this.table.on('mousemove_table', () => {
77228
- if (this.table.stateManager.select.selecting) {
77229
- this.updateHighlight();
77230
- }
77231
- });
77232
- }
77233
- clearHighlight() {
77234
- this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
77235
- this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
77236
- this.colHeaderRange = undefined;
77237
- this.rowHeaderRange = undefined;
77238
- }
77239
- updateHighlight() {
77240
- if (this.options?.colHighlight === false && this.options?.rowHighlight === false) {
77241
- return;
77242
- }
77243
- const selectRanges = this.table.getSelectedCellRanges();
77244
- if (selectRanges.length === 0) {
77245
- this.clearHighlight();
77246
- return;
77247
- }
77248
- const selectRange = selectRanges[0];
77249
- const rowSelectRange = [selectRange.start.row, selectRange.end.row];
77250
- rowSelectRange.sort((a, b) => a - b);
77251
- const colSelectRange = [selectRange.start.col, selectRange.end.col];
77252
- colSelectRange.sort((a, b) => a - b);
77253
- let colHeaderRange;
77254
- let rowHeaderRange;
77255
- if (this.table.isPivotTable()) {
77256
- colHeaderRange = {
77257
- start: {
77258
- col: colSelectRange[0],
77259
- row: 0
77260
- },
77261
- end: {
77262
- col: colSelectRange[1],
77263
- row: this.table.columnHeaderLevelCount - 1
77264
- }
77265
- };
77266
- rowHeaderRange = {
77267
- start: {
77268
- col: 0,
77269
- row: rowSelectRange[0]
77270
- },
77271
- end: {
77272
- col: this.table.rowHeaderLevelCount - 1,
77273
- row: rowSelectRange[1]
77274
- }
77275
- };
77276
- }
77277
- else if (this.table.internalProps.transpose) {
77278
- rowHeaderRange = {
77279
- start: {
77280
- col: 0,
77281
- row: rowSelectRange[0]
77282
- },
77283
- end: {
77284
- col: this.table.rowHeaderLevelCount - 1,
77285
- row: rowSelectRange[1]
77286
- }
77287
- };
77288
- }
77289
- else {
77290
- colHeaderRange = {
77291
- start: {
77292
- col: colSelectRange[0],
77293
- row: 0
77294
- },
77295
- end: {
77296
- col: colSelectRange[1],
77297
- row: this.table.columnHeaderLevelCount - 1
77298
- }
77299
- };
77300
- if (this.table.internalProps.rowSeriesNumber) {
77301
- rowHeaderRange = {
77302
- start: {
77303
- col: 0,
77304
- row: rowSelectRange[0]
77305
- },
77306
- end: {
77307
- col: 0,
77308
- row: rowSelectRange[1]
77309
- }
77310
- };
77311
- }
77312
- }
77313
- if (this.options?.colHighlight !== false && !isSameRange(this.colHeaderRange, colHeaderRange)) {
77314
- this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
77315
- colHeaderRange && this.table.arrangeCustomCellStyle({ range: colHeaderRange }, 'col-highlight');
77316
- this.colHeaderRange = colHeaderRange;
77317
- }
77318
- if (this.options?.rowHighlight !== false && !isSameRange(this.rowHeaderRange, rowHeaderRange)) {
77319
- this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
77320
- rowHeaderRange && this.table.arrangeCustomCellStyle({ range: rowHeaderRange }, 'row-highlight');
77321
- this.rowHeaderRange = rowHeaderRange;
77322
- }
77323
- }
77324
- }
77325
- function isSameRange(a, b) {
77326
- if (a === undefined && b === undefined) {
77327
- return true;
77328
- }
77329
- if (a === undefined || b === undefined) {
77330
- return false;
77331
- }
77332
- return (a.start.col === b.start.col && a.start.row === b.start.row && a.end.col === b.end.col && a.end.row === b.end.row);
77333
- }
77334
-
77335
77010
  registerForVrender();
77336
- const version = "1.11.3";
77011
+ const version = "1.11.5";
77337
77012
  function getIcons() {
77338
77013
  return get$2();
77339
77014
  }
@@ -77341,12 +77016,9 @@
77341
77016
  clearAll();
77342
77017
  }
77343
77018
 
77344
- exports.CarouselAnimationPlugin = CarouselAnimationPlugin;
77345
77019
  exports.CustomLayout = index;
77346
77020
  exports.DataStatistics = DataStatistics;
77347
77021
  exports.EventTarget = EventTarget$1;
77348
- exports.HeaderHighlightPlugin = HeaderHighlightPlugin;
77349
- exports.InvertHighlightPlugin = InvertHighlightPlugin;
77350
77022
  exports.ListTable = ListTableAll;
77351
77023
  exports.ListTableSimple = ListTableSimple;
77352
77024
  exports.PIVOT_CHART_EVENT_TYPE = PIVOT_CHART_EVENT_TYPE;
@@ -77379,7 +77051,6 @@
77379
77051
  exports.getTargetCell = getTargetCell;
77380
77052
  exports.graphicUtil = graphicUtil;
77381
77053
  exports.jsx = jsx;
77382
- exports.onBeforeAttributeUpdateForInvertHighlight = onBeforeAttributeUpdateForInvertHighlight;
77383
77054
  exports.register = register$1;
77384
77055
  exports.registerAxis = registerAxis;
77385
77056
  exports.registerChartCell = registerChartCell;