@visactor/vtable 1.17.3-alpha.7 → 1.17.3-alpha.8

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 (67) hide show
  1. package/cjs/PivotTable.d.ts +5 -0
  2. package/cjs/PivotTable.js +13 -0
  3. package/cjs/PivotTable.js.map +1 -1
  4. package/cjs/core/BaseTable.js +15 -14
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/dataset/dataset.js +6 -4
  7. package/cjs/dataset/dataset.js.map +1 -1
  8. package/cjs/index.d.ts +1 -1
  9. package/cjs/index.js +1 -1
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/layout/pivot-header-layout.js +5 -3
  12. package/cjs/layout/pivot-header-layout.js.map +1 -1
  13. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  14. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  15. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  16. package/cjs/scenegraph/group-creater/progress/proxy.js +1 -2
  17. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  18. package/cjs/scenegraph/layout/frozen.js +5 -5
  19. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  20. package/cjs/scenegraph/select/create-select-border.js +13 -2
  21. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  22. package/cjs/state/state.js +79 -47
  23. package/cjs/state/state.js.map +1 -1
  24. package/cjs/ts-types/base-table.d.ts +1 -1
  25. package/cjs/ts-types/base-table.js.map +1 -1
  26. package/cjs/ts-types/common.d.ts +3 -1
  27. package/cjs/ts-types/common.js.map +1 -1
  28. package/cjs/ts-types/events.d.ts +3 -1
  29. package/cjs/ts-types/events.js.map +1 -1
  30. package/cjs/ts-types/table-engine.d.ts +1 -0
  31. package/cjs/ts-types/table-engine.js.map +1 -1
  32. package/cjs/vrender.js.map +1 -1
  33. package/dist/vtable.js +195 -67
  34. package/dist/vtable.min.js +1 -1
  35. package/es/PivotTable.d.ts +5 -0
  36. package/es/PivotTable.js +13 -0
  37. package/es/PivotTable.js.map +1 -1
  38. package/es/core/BaseTable.js +15 -14
  39. package/es/core/BaseTable.js.map +1 -1
  40. package/es/dataset/dataset.js +6 -4
  41. package/es/dataset/dataset.js.map +1 -1
  42. package/es/index.d.ts +1 -1
  43. package/es/index.js +1 -1
  44. package/es/index.js.map +1 -1
  45. package/es/layout/pivot-header-layout.js +5 -3
  46. package/es/layout/pivot-header-layout.js.map +1 -1
  47. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  48. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +4 -4
  49. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  50. package/es/scenegraph/group-creater/progress/proxy.js +1 -2
  51. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  52. package/es/scenegraph/layout/frozen.js +5 -5
  53. package/es/scenegraph/layout/frozen.js.map +1 -1
  54. package/es/scenegraph/select/create-select-border.js +13 -2
  55. package/es/scenegraph/select/create-select-border.js.map +1 -1
  56. package/es/state/state.js +79 -47
  57. package/es/state/state.js.map +1 -1
  58. package/es/ts-types/base-table.d.ts +1 -1
  59. package/es/ts-types/base-table.js.map +1 -1
  60. package/es/ts-types/common.d.ts +3 -1
  61. package/es/ts-types/common.js.map +1 -1
  62. package/es/ts-types/events.d.ts +3 -1
  63. package/es/ts-types/events.js.map +1 -1
  64. package/es/ts-types/table-engine.d.ts +1 -0
  65. package/es/ts-types/table-engine.js.map +1 -1
  66. package/es/vrender.js.map +1 -1
  67. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -42702,12 +42702,14 @@
42702
42702
  const isWidthNumber = !Array.isArray(strokeArrayWidth);
42703
42703
  const isStrokeTrue = !Array.isArray(stroke);
42704
42704
  const isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
42705
+ context.stroke();
42705
42706
  context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
42706
42707
  const { lineDash = groupAttribute.lineDash } = group.attribute;
42707
42708
  let isDash = false;
42708
42709
  if (lineDash.length && lineDash.some((dash) => Array.isArray(dash))) {
42709
42710
  isDash = true;
42710
42711
  }
42712
+ context.beginPath();
42711
42713
  context.moveTo(x, y);
42712
42714
  const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]);
42713
42715
  const strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]);
@@ -42820,6 +42822,7 @@
42820
42822
  else if (i === 3) {
42821
42823
  context.moveTo(x, y);
42822
42824
  }
42825
+ context.closePath();
42823
42826
  if (!isSplitDraw && !isDash) {
42824
42827
  if (!isWidthNumber && widthInfo.width) {
42825
42828
  context.lineWidth = widthInfo.width;
@@ -42828,7 +42831,7 @@
42828
42831
  }
42829
42832
  context.lineDashOffset = 0;
42830
42833
  context.setLineDash([]);
42831
- context.closePath();
42834
+ context.beginPath();
42832
42835
  }
42833
42836
 
42834
42837
  let loadingImage;
@@ -45067,9 +45070,6 @@
45067
45070
  if (this.table.options.maintainedDataCount) {
45068
45071
  this.rowLimit = this.table.options.maintainedDataCount;
45069
45072
  }
45070
- if (this.table.options.maintainedColumnCount) {
45071
- this.colLimit = this.table.options.maintainedColumnCount;
45072
- }
45073
45073
  }
45074
45074
  get bodyLeftCol() {
45075
45075
  return this.table.frozenColCount;
@@ -46112,7 +46112,8 @@
46112
46112
  y: firstCellBound.y1 - scene.tableGroup.attribute.y,
46113
46113
  width: 0,
46114
46114
  height: 0,
46115
- visible: true
46115
+ visible: true,
46116
+ cornerRadius: getCornerRadius(selectRangeType, scene.table.theme.frameStyle?.cornerRadius, start_Col, start_Row, end_Col, end_Row, scene.table)
46116
46117
  });
46117
46118
  let fillhandle;
46118
46119
  if (isHasFillHandleRect) {
@@ -46169,6 +46170,40 @@
46169
46170
  ? scene.bottomFrozenGroup
46170
46171
  : scene.rightBottomCornerGroup);
46171
46172
  }
46173
+ function getCornerRadius(selectRangeType, cornerRadius, start_Col, start_Row, end_Col, end_Row, table) {
46174
+ if (!cornerRadius) {
46175
+ return undefined;
46176
+ }
46177
+ const cornerRadiusArray = Array.isArray(cornerRadius)
46178
+ ? cornerRadius
46179
+ : [cornerRadius, cornerRadius, cornerRadius, cornerRadius];
46180
+ const tableStartCol = 0;
46181
+ const tableStartRow = 0;
46182
+ const tableEndCol = table.colCount - 1;
46183
+ const tableEndRow = table.rowCount - 1;
46184
+ const result = [0, 0, 0, 0];
46185
+ let changed = false;
46186
+ if (start_Col === tableStartCol && start_Row === tableStartRow) {
46187
+ result[0] = cornerRadiusArray[0];
46188
+ changed = true;
46189
+ }
46190
+ else if (end_Col === tableEndCol && end_Row === tableEndRow) {
46191
+ result[2] = cornerRadiusArray[2];
46192
+ changed = true;
46193
+ }
46194
+ else if (start_Col === tableStartCol && end_Row === tableEndRow) {
46195
+ result[3] = cornerRadiusArray[3];
46196
+ changed = true;
46197
+ }
46198
+ else if (end_Col === tableEndCol && start_Row === tableStartRow) {
46199
+ result[1] = cornerRadiusArray[1];
46200
+ changed = true;
46201
+ }
46202
+ if (changed) {
46203
+ return result;
46204
+ }
46205
+ return undefined;
46206
+ }
46172
46207
 
46173
46208
  function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
46174
46209
  scene.selectingRangeComponents.forEach((rangeComponent, key) => {
@@ -46879,7 +46914,10 @@
46879
46914
  }
46880
46915
  scene.hasFrozen = true;
46881
46916
  scene.frozenColCount = scene.table.frozenColCount;
46882
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
46917
+ scene.frozenRowCount =
46918
+ scene.colHeaderGroup.firstChild?.childrenCount ??
46919
+ scene.cornerHeaderGroup.firstChild?.childrenCount ??
46920
+ scene.table.frozenRowCount;
46883
46921
  }
46884
46922
  function resetFrozen(scene) {
46885
46923
  if (scene.frozenColCount > scene.table.frozenColCount) {
@@ -46905,7 +46943,10 @@
46905
46943
  updateReactComponentContainer(scene);
46906
46944
  scene.recreateAllSelectRangeComponents();
46907
46945
  scene.frozenColCount = scene.table.frozenColCount;
46908
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
46946
+ scene.frozenRowCount =
46947
+ scene.colHeaderGroup.firstChild?.childrenCount ??
46948
+ scene.cornerHeaderGroup.firstChild?.childrenCount ??
46949
+ scene.table.frozenRowCount;
46909
46950
  scene.proxy.colStart = scene.bodyGroup.firstChild?.col ?? scene.table.frozenColCount;
46910
46951
  scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
46911
46952
  scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
@@ -52365,25 +52406,33 @@
52365
52406
  updateVerticalScrollBar(yRatio) {
52366
52407
  const totalHeight = this.table.getAllRowsHeight();
52367
52408
  const oldVerticalBarPos = this.scroll.verticalBarPos;
52368
- this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
52369
- if (!isValid$3(this.scroll.verticalBarPos) || isNaN(this.scroll.verticalBarPos)) {
52370
- this.scroll.verticalBarPos = 0;
52409
+ let verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
52410
+ if (!isValid$3(verticalBarPos) || isNaN(verticalBarPos)) {
52411
+ verticalBarPos = 0;
52371
52412
  }
52372
- this.table.scenegraph.setY(-this.scroll.verticalBarPos, yRatio === 1);
52373
- this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY;
52374
- this.table.scenegraph.proxy.deltaY = 0;
52375
- this.updateHoverPos(-1, -1);
52376
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52413
+ const dy = verticalBarPos - this.table.scenegraph.proxy.deltaY - oldVerticalBarPos;
52414
+ const canScroll = this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52377
52415
  event: undefined,
52378
- scrollTop: this.scroll.verticalBarPos,
52416
+ scrollTop: verticalBarPos - this.table.scenegraph.proxy.deltaY,
52379
52417
  scrollLeft: this.scroll.horizontalBarPos,
52380
52418
  scrollHeight: this.table.theme.scrollStyle?.width,
52381
52419
  scrollWidth: this.table.theme.scrollStyle?.width,
52382
52420
  viewHeight: this.table.tableNoFrameHeight,
52383
52421
  viewWidth: this.table.tableNoFrameWidth,
52384
52422
  scrollDirection: 'vertical',
52385
- scrollRatioY: yRatio
52423
+ scrollRatioY: yRatio,
52424
+ dy
52386
52425
  });
52426
+ if (canScroll.some(value => value === false)) {
52427
+ const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
52428
+ this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
52429
+ return;
52430
+ }
52431
+ this.scroll.verticalBarPos = verticalBarPos;
52432
+ this.table.scenegraph.setY(-this.scroll.verticalBarPos, yRatio === 1);
52433
+ this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY;
52434
+ this.table.scenegraph.proxy.deltaY = 0;
52435
+ this.updateHoverPos(-1, -1);
52387
52436
  if (oldVerticalBarPos !== this.scroll.verticalBarPos) {
52388
52437
  this.checkVerticalScrollBarEnd();
52389
52438
  }
@@ -52391,25 +52440,33 @@
52391
52440
  updateHorizontalScrollBar(xRatio) {
52392
52441
  const totalWidth = this.table.getAllColsWidth();
52393
52442
  const oldHorizontalBarPos = this.scroll.horizontalBarPos;
52394
- this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
52395
- if (!isValid$3(this.scroll.horizontalBarPos) || isNaN(this.scroll.horizontalBarPos)) {
52396
- this.scroll.horizontalBarPos = 0;
52443
+ let horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
52444
+ if (!isValid$3(horizontalBarPos) || isNaN(horizontalBarPos)) {
52445
+ horizontalBarPos = 0;
52397
52446
  }
52398
- this.table.scenegraph.setX(-this.scroll.horizontalBarPos, xRatio === 1);
52399
- this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX;
52400
- this.table.scenegraph.proxy.deltaX = 0;
52401
- this.updateHoverPos(-1, -1);
52402
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52447
+ const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
52448
+ const canScroll = this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52403
52449
  event: undefined,
52404
52450
  scrollTop: this.scroll.verticalBarPos,
52405
- scrollLeft: this.scroll.horizontalBarPos,
52451
+ scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
52406
52452
  scrollHeight: this.table.theme.scrollStyle?.width,
52407
52453
  scrollWidth: this.table.theme.scrollStyle?.width,
52408
52454
  viewHeight: this.table.tableNoFrameHeight,
52409
52455
  viewWidth: this.table.tableNoFrameWidth,
52410
52456
  scrollDirection: 'horizontal',
52411
- scrollRatioX: xRatio
52457
+ scrollRatioX: xRatio,
52458
+ dx: dx
52412
52459
  });
52460
+ if (canScroll.some(value => value === false)) {
52461
+ const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
52462
+ this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
52463
+ return;
52464
+ }
52465
+ this.scroll.horizontalBarPos = horizontalBarPos;
52466
+ this.table.scenegraph.setX(-this.scroll.horizontalBarPos, xRatio === 1);
52467
+ this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX;
52468
+ this.table.scenegraph.proxy.deltaX = 0;
52469
+ this.updateHoverPos(-1, -1);
52413
52470
  if (oldHorizontalBarPos !== this.scroll.horizontalBarPos) {
52414
52471
  this.checkHorizontalScrollBarEnd();
52415
52472
  }
@@ -52419,29 +52476,43 @@
52419
52476
  const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
52420
52477
  top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance));
52421
52478
  top = Math.ceil(top);
52422
- if (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) {
52423
- this.updateHoverPos(-1, -1);
52424
- }
52425
52479
  const oldVerticalBarPos = this.scroll.verticalBarPos;
52426
- this.scroll.verticalBarPos = top;
52427
- if (!isValid$3(this.scroll.verticalBarPos) || isNaN(this.scroll.verticalBarPos)) {
52428
- this.scroll.verticalBarPos = 0;
52429
- }
52430
- this.table.scenegraph.setY(-top);
52431
52480
  const yRatio = top / (totalHeight - this.table.scenegraph.height);
52432
- this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
52433
- if (oldVerticalBarPos !== top && triggerEvent) {
52434
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52481
+ if ((oldVerticalBarPos !== top || this.table.options?.customConfig?.scrollEventAlwaysTrigger === true) &&
52482
+ triggerEvent) {
52483
+ let verticalBarPos = top;
52484
+ if (!isValid$3(verticalBarPos) || isNaN(verticalBarPos)) {
52485
+ verticalBarPos = 0;
52486
+ }
52487
+ const dy = verticalBarPos - oldVerticalBarPos;
52488
+ const canScroll = this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52435
52489
  event: event?.nativeEvent,
52436
- scrollTop: this.scroll.verticalBarPos,
52490
+ scrollTop: verticalBarPos,
52437
52491
  scrollLeft: this.scroll.horizontalBarPos,
52438
52492
  scrollHeight: this.table.theme.scrollStyle?.width,
52439
52493
  scrollWidth: this.table.theme.scrollStyle?.width,
52440
52494
  viewHeight: this.table.tableNoFrameHeight,
52441
52495
  viewWidth: this.table.tableNoFrameWidth,
52442
52496
  scrollDirection: 'vertical',
52443
- scrollRatioY: yRatio
52497
+ scrollRatioY: yRatio,
52498
+ dy
52444
52499
  });
52500
+ if (canScroll.some(value => value === false)) {
52501
+ const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
52502
+ this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
52503
+ return;
52504
+ }
52505
+ }
52506
+ if (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) {
52507
+ this.updateHoverPos(-1, -1);
52508
+ }
52509
+ this.scroll.verticalBarPos = top;
52510
+ if (!isValid$3(this.scroll.verticalBarPos) || isNaN(this.scroll.verticalBarPos)) {
52511
+ this.scroll.verticalBarPos = 0;
52512
+ }
52513
+ this.table.scenegraph.setY(-top);
52514
+ this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
52515
+ if (oldVerticalBarPos !== top && triggerEvent) {
52445
52516
  this.checkVerticalScrollBarEnd();
52446
52517
  }
52447
52518
  }
@@ -52452,29 +52523,43 @@
52452
52523
  const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
52453
52524
  left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance));
52454
52525
  left = Math.ceil(left);
52455
- if (left !== this.scroll.horizontalBarPos) {
52456
- this.updateHoverPos(-1, -1);
52457
- }
52458
52526
  const oldHorizontalBarPos = this.scroll.horizontalBarPos;
52459
- this.scroll.horizontalBarPos = left;
52460
- if (!isValid$3(this.scroll.horizontalBarPos) || isNaN(this.scroll.horizontalBarPos)) {
52461
- this.scroll.horizontalBarPos = 0;
52462
- }
52463
- this.table.scenegraph.setX(-left);
52464
52527
  const xRatio = left / (totalWidth - this.table.scenegraph.width);
52465
- this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
52466
- if (oldHorizontalBarPos !== left && triggerEvent) {
52467
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52528
+ if ((oldHorizontalBarPos !== left || this.table.options?.customConfig?.scrollEventAlwaysTrigger === true) &&
52529
+ triggerEvent) {
52530
+ let horizontalBarPos = left;
52531
+ if (!isValid$3(horizontalBarPos) || isNaN(horizontalBarPos)) {
52532
+ horizontalBarPos = 0;
52533
+ }
52534
+ const dx = horizontalBarPos - oldHorizontalBarPos;
52535
+ const canScroll = this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
52468
52536
  event: event?.nativeEvent,
52469
52537
  scrollTop: this.scroll.verticalBarPos,
52470
- scrollLeft: this.scroll.horizontalBarPos,
52538
+ scrollLeft: horizontalBarPos,
52471
52539
  scrollHeight: this.table.theme.scrollStyle?.width,
52472
52540
  scrollWidth: this.table.theme.scrollStyle?.width,
52473
52541
  viewHeight: this.table.tableNoFrameHeight,
52474
52542
  viewWidth: this.table.tableNoFrameWidth,
52475
52543
  scrollDirection: 'horizontal',
52476
- scrollRatioX: xRatio
52544
+ scrollRatioX: xRatio,
52545
+ dx
52477
52546
  });
52547
+ if (canScroll.some(value => value === false)) {
52548
+ const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
52549
+ this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
52550
+ return;
52551
+ }
52552
+ }
52553
+ if (left !== this.scroll.horizontalBarPos) {
52554
+ this.updateHoverPos(-1, -1);
52555
+ }
52556
+ this.scroll.horizontalBarPos = left;
52557
+ if (!isValid$3(this.scroll.horizontalBarPos) || isNaN(this.scroll.horizontalBarPos)) {
52558
+ this.scroll.horizontalBarPos = 0;
52559
+ }
52560
+ this.table.scenegraph.setX(-left);
52561
+ this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
52562
+ if (oldHorizontalBarPos !== left && triggerEvent) {
52478
52563
  this.checkHorizontalScrollBarEnd();
52479
52564
  }
52480
52565
  }
@@ -60202,7 +60287,7 @@
60202
60287
  return TABLE_EVENT_TYPE;
60203
60288
  }
60204
60289
  options;
60205
- version = "1.17.3-alpha.7";
60290
+ version = "1.17.3-alpha.8";
60206
60291
  pagination;
60207
60292
  id = `VTable${Date.now()}`;
60208
60293
  headerStyleCache;
@@ -60814,10 +60899,7 @@
60814
60899
  const { canvas } = this.internalProps;
60815
60900
  widthP = (canvas.parentElement?.offsetWidth ?? 1) - (this.options.tableSizeAntiJitter ? 1 : 0);
60816
60901
  heightP = (canvas.parentElement?.offsetHeight ?? 1) - (this.options.tableSizeAntiJitter ? 1 : 0);
60817
- if (this?.scenegraph?.stage) {
60818
- this.scenegraph.stage.resize(widthP, heightP);
60819
- }
60820
- else {
60902
+ if (!this?.scenegraph?.stage) {
60821
60903
  canvas.style.width = '';
60822
60904
  canvas.style.height = '';
60823
60905
  canvas.width = widthP;
@@ -60825,6 +60907,21 @@
60825
60907
  canvas.style.width = `${widthP}px`;
60826
60908
  canvas.style.height = `${heightP}px`;
60827
60909
  }
60910
+ else if (this.options?.viewBox && !this.options?.canvas) {
60911
+ this.scenegraph.stage.resize(widthP, heightP);
60912
+ }
60913
+ if (this.options?.viewBox) {
60914
+ widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
60915
+ heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
60916
+ }
60917
+ if (this?.scenegraph?.stage) {
60918
+ if (this.options.viewBox) {
60919
+ this.scenegraph.stage.setViewBox(this.options.viewBox, false);
60920
+ }
60921
+ else {
60922
+ this.scenegraph.stage.resize(widthP, heightP);
60923
+ }
60924
+ }
60828
60925
  }
60829
60926
  else if (Env.mode === 'node') {
60830
60927
  widthP = this.canvasWidth - 1;
@@ -60852,8 +60949,8 @@
60852
60949
  }
60853
60950
  }
60854
60951
  updateViewBox(newViewBox) {
60855
- const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
60856
- const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
60952
+ const oldWidth = (this.options?.viewBox?.x2 ?? 0) - (this.options?.viewBox?.x1 ?? 0);
60953
+ const oldHeight = (this.options?.viewBox?.y2 ?? 0) - (this.options?.viewBox?.y1 ?? 0);
60857
60954
  const newWidth = newViewBox.x2 - newViewBox.x1;
60858
60955
  const newHeight = newViewBox.y2 - newViewBox.y1;
60859
60956
  this.options.viewBox = newViewBox;
@@ -75201,7 +75298,7 @@
75201
75298
  let tree;
75202
75299
  if (typeof extensionRow.rowTree === 'function') {
75203
75300
  const fullCellIds = this.findFullCellIds(row_ids);
75204
- tree = extensionRow.rowTree(fullCellIds.map(id => {
75301
+ tree = extensionRow.rowTree(fullCellIds.map((id) => {
75205
75302
  return { dimensionKey: this._headerObjects[id].field, value: this._headerObjects[id].title };
75206
75303
  }));
75207
75304
  }
@@ -76092,6 +76189,7 @@
76092
76189
  colHeaderPath.indicatorKey = colHeader.indicatorKey;
76093
76190
  colHeaderPath.value = colHeader.value ?? this.getIndicatorInfoByIndicatorKey(colHeader.indicatorKey)?.title ?? '';
76094
76191
  colHeaderPath.virtual = colHeader.virtual;
76192
+ colHeaderPath.role = colHeader.role;
76095
76193
  headerPaths.colHeaderPaths.push(colHeaderPath);
76096
76194
  });
76097
76195
  headerPathsWidthNode.rowHeaderPaths?.forEach((rowHeader) => {
@@ -76102,6 +76200,7 @@
76102
76200
  rowHeaderPath.value =
76103
76201
  rowHeader.value ?? this.getIndicatorInfoByIndicatorKey(rowHeader.indicatorKey)?.title ?? '';
76104
76202
  rowHeaderPath.virtual = rowHeader.virtual;
76203
+ rowHeaderPath.role = rowHeader.role;
76105
76204
  headerPaths.rowHeaderPaths.push(rowHeaderPath);
76106
76205
  }
76107
76206
  });
@@ -76983,7 +77082,7 @@
76983
77082
  if (isCol) {
76984
77083
  continue;
76985
77084
  }
76986
- for (let k = 0; k < rowArr?.length ?? 0; k++) {
77085
+ for (let k = 0; k < (rowArr?.length ?? 0); k++) {
76987
77086
  const dimension = rowArr[k];
76988
77087
  if ((isValid$3(highlightDimension.dimensionKey) &&
76989
77088
  dimension.dimensionKey === highlightDimension.dimensionKey &&
@@ -79167,7 +79266,8 @@
79167
79266
  value: indicator.title
79168
79267
  };
79169
79268
  })
79170
- : []
79269
+ : [],
79270
+ role: 'sub-total'
79171
79271
  };
79172
79272
  curChild.push(totalChild);
79173
79273
  curChild = totalChild.children ?? [];
@@ -79215,7 +79315,8 @@
79215
79315
  indicatorKey: indicator.indicatorKey,
79216
79316
  value: indicator.title
79217
79317
  };
79218
- }) ?? []
79318
+ }) ?? [],
79319
+ role: 'grand-total'
79219
79320
  };
79220
79321
  if (showGrandTotalsOnTop) {
79221
79322
  result.unshift(node);
@@ -79355,7 +79456,7 @@
79355
79456
  }
79356
79457
  getFieldMatchColDimensionPaths(record) {
79357
79458
  const fieldMatchDimensionPaths = [];
79358
- for (let i = 0; i < this.customColTreeDimensionPaths?.length ?? 0; i++) {
79459
+ for (let i = 0; i < (this.customColTreeDimensionPaths?.length ?? 0); i++) {
79359
79460
  const dimensionPath = this.customColTreeDimensionPaths[i];
79360
79461
  let isMatch = true;
79361
79462
  for (let j = 0; j < dimensionPath.length; j++) {
@@ -79374,7 +79475,7 @@
79374
79475
  }
79375
79476
  getFieldMatchRowDimensionPaths(record) {
79376
79477
  const fieldMatchDimensionPaths = [];
79377
- for (let i = 0; i < this.customRowTreeDimensionPaths?.length ?? 0; i++) {
79478
+ for (let i = 0; i < (this.customRowTreeDimensionPaths?.length ?? 0); i++) {
79378
79479
  const dimensionPath = this.customRowTreeDimensionPaths[i];
79379
79480
  let isMatch = true;
79380
79481
  for (let j = 0; j < dimensionPath.length; j++) {
@@ -81003,6 +81104,33 @@
81003
81104
  getFilteredRecords() {
81004
81105
  return this.dataset?.filterRules;
81005
81106
  }
81107
+ getCellPivotRole(col, row) {
81108
+ const path = this.getCellHeaderPaths(col, row);
81109
+ const { cellLocation, colHeaderPaths, rowHeaderPaths } = path;
81110
+ let colRole = colHeaderPaths.length ? 'normal' : undefined;
81111
+ let rowRole = rowHeaderPaths.length ? 'normal' : undefined;
81112
+ colHeaderPaths.forEach((path) => {
81113
+ if (path.role === 'sub-total') {
81114
+ colRole = 'sub-total';
81115
+ }
81116
+ else if (path.role === 'grand-total') {
81117
+ colRole = 'grand-total';
81118
+ }
81119
+ });
81120
+ rowHeaderPaths.forEach((path) => {
81121
+ if (path.role === 'sub-total') {
81122
+ rowRole = 'sub-total';
81123
+ }
81124
+ else if (path.role === 'grand-total') {
81125
+ rowRole = 'grand-total';
81126
+ }
81127
+ });
81128
+ return {
81129
+ colRole,
81130
+ rowRole,
81131
+ cellLocation
81132
+ };
81133
+ }
81006
81134
  setLoadingHierarchyState(col, row) {
81007
81135
  this.scenegraph.setLoadingHierarchyState(col, row);
81008
81136
  }
@@ -82749,7 +82877,7 @@
82749
82877
  }
82750
82878
 
82751
82879
  registerForVrender();
82752
- const version = "1.17.3-alpha.7";
82880
+ const version = "1.17.3-alpha.8";
82753
82881
  function getIcons() {
82754
82882
  return get$2();
82755
82883
  }