@visactor/vtable 1.11.4 → 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 +1 -1
  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 +169 -515
  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 +1 -1
  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 +4 -4
  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.4";
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,7 +74674,7 @@
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) {
74677
+ if (cell && cell.col >= this.rowHeaderLevelCount) {
74759
74678
  const cellPath = this.getCellHeaderPaths(cell.col, this.columnHeaderLevelCount);
74760
74679
  if (cellPath.colHeaderPaths.length === dimensions.length) {
74761
74680
  let match = true;
@@ -77088,269 +77007,8 @@
77088
77007
  return new Radio(params ? params.attribute : {});
77089
77008
  }
77090
77009
 
77091
- class CarouselAnimationPlugin {
77092
- table;
77093
- rowCount;
77094
- colCount;
77095
- animationDuration;
77096
- animationDelay;
77097
- animationEasing;
77098
- replaceScrollAction;
77099
- playing;
77100
- row;
77101
- col;
77102
- willUpdateRow = false;
77103
- willUpdateCol = false;
77104
- customDistRowFunction;
77105
- customDistColFunction;
77106
- constructor(table, options) {
77107
- this.table = table;
77108
- this.rowCount = options?.rowCount ?? undefined;
77109
- this.colCount = options?.colCount ?? undefined;
77110
- this.animationDuration = options?.animationDuration ?? 500;
77111
- this.animationDelay = options?.animationDelay ?? 1000;
77112
- this.animationEasing = options?.animationEasing ?? 'linear';
77113
- this.replaceScrollAction = options?.replaceScrollAction ?? false;
77114
- this.customDistColFunction = options.customDistColFunction;
77115
- this.customDistRowFunction = options.customDistRowFunction;
77116
- this.reset();
77117
- this.init();
77118
- }
77119
- init() {
77120
- if (this.replaceScrollAction) {
77121
- this.table.disableScroll();
77122
- this.table.scenegraph.stage.addEventListener('wheel', this.onScrollEnd.bind(this));
77123
- }
77124
- }
77125
- reset() {
77126
- this.playing = false;
77127
- this.row = this.table.frozenRowCount;
77128
- this.col = this.table.frozenColCount;
77129
- }
77130
- onScrollEnd(e) {
77131
- if (this.rowCount) {
77132
- if (e.deltaY > 0) {
77133
- this.row += this.rowCount;
77134
- this.row = Math.min(this.row, this.table.rowCount - this.table.frozenRowCount);
77135
- }
77136
- else if (e.deltaY < 0) {
77137
- this.row -= this.rowCount;
77138
- this.row = Math.max(this.row, this.table.frozenRowCount);
77139
- }
77140
- this.table.scrollToRow(this.row, { duration: this.animationDuration, easing: this.animationEasing });
77141
- }
77142
- else if (this.colCount) {
77143
- if (e.deltaX > 0) {
77144
- this.col += this.colCount;
77145
- this.col = Math.min(this.col, this.table.colCount - this.table.frozenColCount);
77146
- }
77147
- else if (e.deltaX < 0) {
77148
- this.col -= this.colCount;
77149
- this.col = Math.max(this.col, this.table.frozenColCount);
77150
- }
77151
- this.table.scrollToCol(this.col, { duration: this.animationDuration, easing: this.animationEasing });
77152
- }
77153
- }
77154
- play() {
77155
- this.playing = true;
77156
- if (this.rowCount && !this.willUpdateRow) {
77157
- this.updateRow();
77158
- }
77159
- else if (this.colCount && !this.willUpdateCol) {
77160
- this.updateCol();
77161
- }
77162
- }
77163
- pause() {
77164
- this.playing = false;
77165
- }
77166
- updateRow() {
77167
- if (!this.playing || this.table.isReleased) {
77168
- return;
77169
- }
77170
- let animation = true;
77171
- const customRow = this.customDistRowFunction && this.customDistRowFunction(this.row, this.table);
77172
- if (customRow) {
77173
- this.row = customRow.distRow;
77174
- animation = customRow.animation ?? true;
77175
- }
77176
- else if (this.table.scenegraph.proxy.screenTopRow !== this.row) {
77177
- this.row = this.table.frozenRowCount;
77178
- animation = false;
77179
- }
77180
- else {
77181
- this.row += this.rowCount;
77182
- }
77183
- this.table.scrollToRow(this.row, animation ? { duration: this.animationDuration, easing: this.animationEasing } : undefined);
77184
- this.willUpdateRow = true;
77185
- setTimeout(() => {
77186
- this.willUpdateRow = false;
77187
- this.updateRow();
77188
- }, this.animationDuration + this.animationDelay);
77189
- }
77190
- updateCol() {
77191
- if (!this.playing || this.table.isReleased) {
77192
- return;
77193
- }
77194
- let animation = true;
77195
- const customCol = this.customDistColFunction && this.customDistColFunction(this.col, this.table);
77196
- if (customCol) {
77197
- this.col = customCol.distCol;
77198
- animation = customCol.animation ?? true;
77199
- }
77200
- else if (this.table.scenegraph.proxy.screenLeftCol !== this.col) {
77201
- this.col = this.table.frozenColCount;
77202
- animation = false;
77203
- }
77204
- else {
77205
- this.col += this.colCount;
77206
- }
77207
- this.table.scrollToCol(this.col, animation ? { duration: this.animationDuration, easing: this.animationEasing } : undefined);
77208
- this.willUpdateCol = true;
77209
- setTimeout(() => {
77210
- this.willUpdateCol = false;
77211
- this.updateCol();
77212
- }, this.animationDuration + this.animationDelay);
77213
- }
77214
- }
77215
-
77216
- class HeaderHighlightPlugin {
77217
- table;
77218
- options;
77219
- colHeaderRange;
77220
- rowHeaderRange;
77221
- constructor(table, options) {
77222
- this.table = table;
77223
- this.options = options;
77224
- this.registerStyle();
77225
- this.bindEvent();
77226
- }
77227
- registerStyle() {
77228
- this.table.registerCustomCellStyle('col-highlight', {
77229
- bgColor: this.options?.colHighlightBGColor ?? '#82b2f5',
77230
- color: this.options?.colHighlightColor ?? '#FFF'
77231
- });
77232
- this.table.registerCustomCellStyle('row-highlight', {
77233
- bgColor: this.options?.rowHighlightBGColor ?? '#82b2f5',
77234
- color: this.options?.rowHighlightColor ?? '#FFF'
77235
- });
77236
- }
77237
- bindEvent() {
77238
- this.table.on('selected_cell', e => {
77239
- this.updateHighlight();
77240
- });
77241
- this.table.on('selected_clear', () => {
77242
- this.clearHighlight();
77243
- });
77244
- this.table.on('mousemove_table', () => {
77245
- if (this.table.stateManager.select.selecting) {
77246
- this.updateHighlight();
77247
- }
77248
- });
77249
- }
77250
- clearHighlight() {
77251
- this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
77252
- this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
77253
- this.colHeaderRange = undefined;
77254
- this.rowHeaderRange = undefined;
77255
- }
77256
- updateHighlight() {
77257
- if (this.options?.colHighlight === false && this.options?.rowHighlight === false) {
77258
- return;
77259
- }
77260
- const selectRanges = this.table.getSelectedCellRanges();
77261
- if (selectRanges.length === 0) {
77262
- this.clearHighlight();
77263
- return;
77264
- }
77265
- const selectRange = selectRanges[0];
77266
- const rowSelectRange = [selectRange.start.row, selectRange.end.row];
77267
- rowSelectRange.sort((a, b) => a - b);
77268
- const colSelectRange = [selectRange.start.col, selectRange.end.col];
77269
- colSelectRange.sort((a, b) => a - b);
77270
- let colHeaderRange;
77271
- let rowHeaderRange;
77272
- if (this.table.isPivotTable()) {
77273
- colHeaderRange = {
77274
- start: {
77275
- col: colSelectRange[0],
77276
- row: 0
77277
- },
77278
- end: {
77279
- col: colSelectRange[1],
77280
- row: this.table.columnHeaderLevelCount - 1
77281
- }
77282
- };
77283
- rowHeaderRange = {
77284
- start: {
77285
- col: 0,
77286
- row: rowSelectRange[0]
77287
- },
77288
- end: {
77289
- col: this.table.rowHeaderLevelCount - 1,
77290
- row: rowSelectRange[1]
77291
- }
77292
- };
77293
- }
77294
- else if (this.table.internalProps.transpose) {
77295
- rowHeaderRange = {
77296
- start: {
77297
- col: 0,
77298
- row: rowSelectRange[0]
77299
- },
77300
- end: {
77301
- col: this.table.rowHeaderLevelCount - 1,
77302
- row: rowSelectRange[1]
77303
- }
77304
- };
77305
- }
77306
- else {
77307
- colHeaderRange = {
77308
- start: {
77309
- col: colSelectRange[0],
77310
- row: 0
77311
- },
77312
- end: {
77313
- col: colSelectRange[1],
77314
- row: this.table.columnHeaderLevelCount - 1
77315
- }
77316
- };
77317
- if (this.table.internalProps.rowSeriesNumber) {
77318
- rowHeaderRange = {
77319
- start: {
77320
- col: 0,
77321
- row: rowSelectRange[0]
77322
- },
77323
- end: {
77324
- col: 0,
77325
- row: rowSelectRange[1]
77326
- }
77327
- };
77328
- }
77329
- }
77330
- if (this.options?.colHighlight !== false && !isSameRange(this.colHeaderRange, colHeaderRange)) {
77331
- this.colHeaderRange && this.table.arrangeCustomCellStyle({ range: this.colHeaderRange }, undefined);
77332
- colHeaderRange && this.table.arrangeCustomCellStyle({ range: colHeaderRange }, 'col-highlight');
77333
- this.colHeaderRange = colHeaderRange;
77334
- }
77335
- if (this.options?.rowHighlight !== false && !isSameRange(this.rowHeaderRange, rowHeaderRange)) {
77336
- this.rowHeaderRange && this.table.arrangeCustomCellStyle({ range: this.rowHeaderRange }, undefined);
77337
- rowHeaderRange && this.table.arrangeCustomCellStyle({ range: rowHeaderRange }, 'row-highlight');
77338
- this.rowHeaderRange = rowHeaderRange;
77339
- }
77340
- }
77341
- }
77342
- function isSameRange(a, b) {
77343
- if (a === undefined && b === undefined) {
77344
- return true;
77345
- }
77346
- if (a === undefined || b === undefined) {
77347
- return false;
77348
- }
77349
- 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);
77350
- }
77351
-
77352
77010
  registerForVrender();
77353
- const version = "1.11.4";
77011
+ const version = "1.11.5";
77354
77012
  function getIcons() {
77355
77013
  return get$2();
77356
77014
  }
@@ -77358,12 +77016,9 @@
77358
77016
  clearAll();
77359
77017
  }
77360
77018
 
77361
- exports.CarouselAnimationPlugin = CarouselAnimationPlugin;
77362
77019
  exports.CustomLayout = index;
77363
77020
  exports.DataStatistics = DataStatistics;
77364
77021
  exports.EventTarget = EventTarget$1;
77365
- exports.HeaderHighlightPlugin = HeaderHighlightPlugin;
77366
- exports.InvertHighlightPlugin = InvertHighlightPlugin;
77367
77022
  exports.ListTable = ListTableAll;
77368
77023
  exports.ListTableSimple = ListTableSimple;
77369
77024
  exports.PIVOT_CHART_EVENT_TYPE = PIVOT_CHART_EVENT_TYPE;
@@ -77396,7 +77051,6 @@
77396
77051
  exports.getTargetCell = getTargetCell;
77397
77052
  exports.graphicUtil = graphicUtil;
77398
77053
  exports.jsx = jsx;
77399
- exports.onBeforeAttributeUpdateForInvertHighlight = onBeforeAttributeUpdateForInvertHighlight;
77400
77054
  exports.register = register$1;
77401
77055
  exports.registerAxis = registerAxis;
77402
77056
  exports.registerChartCell = registerChartCell;