@visactor/vtable 0.19.2-alpha.1 → 0.19.2-alpha.3

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 (117) hide show
  1. package/cjs/ListTable.js +1 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +0 -1
  4. package/cjs/PivotChart.js +0 -4
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/body-helper/body-helper.js +1 -0
  7. package/cjs/body-helper/body-helper.js.map +1 -1
  8. package/cjs/core/BaseTable.d.ts +0 -3
  9. package/cjs/core/BaseTable.js +33 -42
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/event/event.js +1 -2
  12. package/cjs/event/event.js.map +1 -1
  13. package/cjs/event/listener/container-dom.js +1 -1
  14. package/cjs/event/listener/container-dom.js.map +1 -1
  15. package/cjs/event/listener/table-group.js +14 -4
  16. package/cjs/event/listener/table-group.js.map +1 -1
  17. package/cjs/event/sparkline-event.js +1 -1
  18. package/cjs/event/sparkline-event.js.map +1 -1
  19. package/cjs/event/util.js +2 -2
  20. package/cjs/event/util.js.map +1 -1
  21. package/cjs/index.d.ts +1 -1
  22. package/cjs/index.js +1 -1
  23. package/cjs/index.js.map +1 -1
  24. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
  25. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  26. package/cjs/scenegraph/graphic/chart.d.ts +0 -1
  27. package/cjs/scenegraph/graphic/chart.js +19 -33
  28. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  29. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  30. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  31. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  32. package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
  33. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  34. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
  35. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  36. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  37. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  38. package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
  39. package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
  40. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  41. package/cjs/scenegraph/scenegraph.js +25 -16
  42. package/cjs/scenegraph/scenegraph.js.map +1 -1
  43. package/cjs/scenegraph/style/frame-border.js +7 -4
  44. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  45. package/cjs/state/hover/is-cell-hover.js +1 -1
  46. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  47. package/cjs/state/state.js +2 -2
  48. package/cjs/state/state.js.map +1 -1
  49. package/cjs/themes/theme.js +3 -0
  50. package/cjs/themes/theme.js.map +1 -1
  51. package/cjs/ts-types/base-table.d.ts +1 -11
  52. package/cjs/ts-types/base-table.js.map +1 -1
  53. package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -1
  54. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  55. package/cjs/ts-types/theme.d.ts +1 -0
  56. package/cjs/ts-types/theme.js.map +1 -1
  57. package/cjs/vrender.js.map +1 -1
  58. package/dist/vtable.js +499 -532
  59. package/dist/vtable.min.js +2 -2
  60. package/es/ListTable.js +1 -1
  61. package/es/ListTable.js.map +1 -1
  62. package/es/PivotChart.d.ts +0 -1
  63. package/es/PivotChart.js +2 -5
  64. package/es/PivotChart.js.map +1 -1
  65. package/es/body-helper/body-helper.js +1 -0
  66. package/es/body-helper/body-helper.js.map +1 -1
  67. package/es/core/BaseTable.d.ts +0 -3
  68. package/es/core/BaseTable.js +32 -41
  69. package/es/core/BaseTable.js.map +1 -1
  70. package/es/event/event.js +1 -2
  71. package/es/event/event.js.map +1 -1
  72. package/es/event/listener/container-dom.js +1 -1
  73. package/es/event/listener/container-dom.js.map +1 -1
  74. package/es/event/listener/table-group.js +14 -4
  75. package/es/event/listener/table-group.js.map +1 -1
  76. package/es/event/sparkline-event.js +1 -1
  77. package/es/event/sparkline-event.js.map +1 -1
  78. package/es/event/util.js +2 -2
  79. package/es/event/util.js.map +1 -1
  80. package/es/index.d.ts +1 -1
  81. package/es/index.js +1 -1
  82. package/es/index.js.map +1 -1
  83. package/es/scenegraph/debug-tool/debug-tool.js +1 -4
  84. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  85. package/es/scenegraph/graphic/chart.d.ts +0 -1
  86. package/es/scenegraph/graphic/chart.js +20 -32
  87. package/es/scenegraph/graphic/chart.js.map +1 -1
  88. package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  89. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  90. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  91. package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
  92. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  93. package/es/scenegraph/graphic/contributions/group-contribution-render.js +4 -4
  94. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  95. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  96. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  97. package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
  98. package/es/scenegraph/refresh-node/update-chart.js +0 -6
  99. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  100. package/es/scenegraph/scenegraph.js +25 -16
  101. package/es/scenegraph/scenegraph.js.map +1 -1
  102. package/es/scenegraph/style/frame-border.js +7 -4
  103. package/es/scenegraph/style/frame-border.js.map +1 -1
  104. package/es/state/hover/is-cell-hover.js +1 -1
  105. package/es/state/hover/is-cell-hover.js.map +1 -1
  106. package/es/state/state.js +2 -2
  107. package/es/state/state.js.map +1 -1
  108. package/es/themes/theme.js +3 -0
  109. package/es/themes/theme.js.map +1 -1
  110. package/es/ts-types/base-table.d.ts +1 -11
  111. package/es/ts-types/base-table.js.map +1 -1
  112. package/es/ts-types/list-table/layout-map/api.d.ts +1 -1
  113. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  114. package/es/ts-types/theme.d.ts +1 -0
  115. package/es/ts-types/theme.js.map +1 -1
  116. package/es/vrender.js.map +1 -1
  117. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -4280,7 +4280,7 @@
4280
4280
  strokeBoundsBuffer: 0,
4281
4281
  keepDirIn3d: !0
4282
4282
  });
4283
- const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
4283
+ const DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
4284
4284
  width: 300,
4285
4285
  height: 300,
4286
4286
  ellipsis: !0,
@@ -4830,20 +4830,9 @@
4830
4830
  this._handler.setStyle(style);
4831
4831
  }
4832
4832
  create(params) {
4833
- var _a, _b;
4834
4833
  this._handler.createWindow(params);
4835
4834
  const windowWH = this._handler.getWH();
4836
- this._width = windowWH.width, this._height = windowWH.height, params.viewBox ? this.setViewBox(params.viewBox) : !1 !== params.canvasControled ? this.setViewBox({
4837
- x1: 0,
4838
- y1: 0,
4839
- x2: this._width,
4840
- y2: this._height
4841
- }) : this.setViewBox({
4842
- x1: 0,
4843
- y1: 0,
4844
- x2: null !== (_a = params.width) && void 0 !== _a ? _a : this._width,
4845
- y2: null !== (_b = params.height) && void 0 !== _b ? _b : this._height
4846
- }), this.title = this._handler.getTitle(), this.resizable = !0;
4835
+ this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
4847
4836
  }
4848
4837
  setWindowHandler(handler) {
4849
4838
  this._handler = handler;
@@ -4884,35 +4873,8 @@
4884
4873
  getContainer() {
4885
4874
  return this._handler.container;
4886
4875
  }
4887
- clearViewBox(color) {
4888
- this._handler.clearViewBox(color);
4889
- }
4890
- setViewBox(viewBox) {
4891
- this._handler.setViewBox(viewBox);
4892
- }
4893
- setViewBoxTransform(a, b, c, d, e, f) {
4894
- this._handler.setViewBoxTransform(a, b, c, d, e, f);
4895
- }
4896
- getViewBox() {
4897
- return this._handler.getViewBox();
4898
- }
4899
- getViewBoxTransform() {
4900
- return this._handler.getViewBoxTransform();
4901
- }
4902
- pointTransform(x, y) {
4903
- const vb = this._handler.getViewBox(),
4904
- nextP = {
4905
- x: x,
4906
- y: y
4907
- };
4908
- return this._handler.getViewBoxTransform().transformPoint({
4909
- x: x,
4910
- y: y
4911
- }, nextP), nextP.x -= vb.x1, nextP.y -= vb.y1, nextP;
4912
- }
4913
- hasSubView() {
4914
- const viewBox = this._handler.getViewBox();
4915
- return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
4876
+ clearViewBox(viewBox, color) {
4877
+ this._handler.clearViewBox(viewBox, color);
4916
4878
  }
4917
4879
  isVisible(bbox) {
4918
4880
  return this._handler.isVisible(bbox);
@@ -4998,16 +4960,8 @@
4998
4960
  const window = container.get(VWindow),
4999
4961
  bounds = graphic.AABBBounds,
5000
4962
  width = bounds.width(),
5001
- height = bounds.height(),
5002
- x1 = -bounds.x1,
5003
- y1 = -bounds.y1;
4963
+ height = bounds.height();
5004
4964
  window.create({
5005
- viewBox: {
5006
- x1: x1,
5007
- y1: y1,
5008
- x2: bounds.x2,
5009
- y2: bounds.y2
5010
- },
5011
4965
  width: width,
5012
4966
  height: height,
5013
4967
  canvas: canvas,
@@ -5016,10 +4970,14 @@
5016
4970
  offscreen: !0,
5017
4971
  title: ""
5018
4972
  });
5019
- const disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
4973
+ const x = -bounds.x1,
4974
+ y = -bounds.y1,
4975
+ disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
5020
4976
  stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
5021
- transMatrix: window.getViewBoxTransform(),
5022
- viewBox: window.getViewBox(),
4977
+ x: x,
4978
+ y: y,
4979
+ width: width,
4980
+ height: height,
5023
4981
  stage: stage,
5024
4982
  layer: stage.defaultLayer,
5025
4983
  renderService: stage.renderService,
@@ -5358,7 +5316,7 @@
5358
5316
  delete() {
5359
5317
  this.parent && this.parent.removeChild(this);
5360
5318
  }
5361
- removeAllChild(deep) {
5319
+ removeAllChild() {
5362
5320
  if (!this._idMap) return;
5363
5321
  let child = this._firstChild;
5364
5322
  for (; child;) {
@@ -5843,7 +5801,7 @@
5843
5801
  const mappers = this.mappingTable[e.type];
5844
5802
  let target;
5845
5803
  const cacheKey = `${e.canvasX}-${e.canvasY}`;
5846
- if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.viewX, e.viewY, e), e.pickParams || (this._prePointTargetCache = {
5804
+ if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = {
5847
5805
  [cacheKey]: target,
5848
5806
  stageRenderCount: null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1
5849
5807
  })), mappers) for (let i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn(`[EventManager]: Event mapping not defined for ${e.type}`);
@@ -5987,7 +5945,7 @@
5987
5945
  this.setCursor(this.manager.cursor, this.manager.cursorTarget);
5988
5946
  }, this.onPointerUp = nativeEvent => {
5989
5947
  if (this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
5990
- const outside = this.isEventOutsideOfTargetViewPort(nativeEvent) ? "outside" : "",
5948
+ const outside = this.isEventOutsideOfTargetElement(nativeEvent) ? "outside" : "",
5991
5949
  normalizedEvents = this.normalizeToPointerData(nativeEvent);
5992
5950
  for (let i = 0, j = normalizedEvents.length; i < j; i++) {
5993
5951
  const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);
@@ -6011,6 +5969,7 @@
6011
5969
  resolution: resolution,
6012
5970
  rootNode: rootNode,
6013
5971
  global: global,
5972
+ viewport: viewport,
6014
5973
  autoPreventDefault = !1,
6015
5974
  clickInterval: clickInterval,
6016
5975
  supportsTouchEvents = global.supportsTouchEvents,
@@ -6018,7 +5977,7 @@
6018
5977
  } = params;
6019
5978
  this.manager = new EventManager$1(rootNode, {
6020
5979
  clickInterval: clickInterval
6021
- }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
5980
+ }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
6022
5981
  default: "inherit",
6023
5982
  pointer: "pointer"
6024
5983
  }, this.resolution = resolution, this.setTargetElement(targetElement);
@@ -6060,7 +6019,15 @@
6060
6019
  this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("pointermove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("mousemove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
6061
6020
  }
6062
6021
  mapToViewportPoint(event) {
6063
- return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
6022
+ const viewport = this.viewport,
6023
+ {
6024
+ x: x,
6025
+ y: y
6026
+ } = event;
6027
+ return {
6028
+ x: x - viewport.x,
6029
+ y: y - viewport.y
6030
+ };
6064
6031
  }
6065
6032
  mapToCanvasPoint(nativeEvent) {
6066
6033
  var _a;
@@ -6117,17 +6084,6 @@
6117
6084
  transferMouseData(event, nativeEvent) {
6118
6085
  event.isTrusted = nativeEvent.isTrusted, event.srcElement = nativeEvent.srcElement, event.timeStamp = clock.now(), event.type = nativeEvent.type, event.altKey = nativeEvent.altKey, event.button = nativeEvent.button, event.buttons = nativeEvent.buttons, event.client.x = nativeEvent.clientX, event.client.y = nativeEvent.clientY, event.ctrlKey = nativeEvent.ctrlKey, event.shiftKey = nativeEvent.shiftKey, event.metaKey = nativeEvent.metaKey, event.movement.x = nativeEvent.movementX, event.movement.y = nativeEvent.movementY, event.page.x = nativeEvent.pageX, event.page.y = nativeEvent.pageY, event.relatedTarget = null;
6119
6086
  }
6120
- isEventOutsideOfTargetViewPort(nativeEvent) {
6121
- if (this.isEventOutsideOfTargetElement(nativeEvent)) return !0;
6122
- if (this.domElement.getViewBox) {
6123
- const p = this.mapToViewportPoint(this.mapToCanvasPoint(nativeEvent)),
6124
- b = this.domElement.getViewBox(),
6125
- w = b.width(),
6126
- h = b.height();
6127
- return !(p.x < w && p.y < h && p.x > 0 && p.y > 0);
6128
- }
6129
- return !1;
6130
- }
6131
6087
  isEventOutsideOfTargetElement(nativeEvent) {
6132
6088
  let target = nativeEvent.target;
6133
6089
  nativeEvent.composedPath && nativeEvent.composedPath().length > 0 && (target = nativeEvent.composedPath()[0]);
@@ -7286,8 +7242,7 @@
7286
7242
  }
7287
7243
  }
7288
7244
  tryUpdateGlobalAABBBounds() {
7289
- const b = this.AABBBounds;
7290
- return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
7245
+ return this._globalAABBBounds ? this._globalAABBBounds.setValue(this._AABBBounds.x1, this._AABBBounds.y1, this._AABBBounds.x2, this._AABBBounds.y2) : this._globalAABBBounds = this.AABBBounds.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
7291
7246
  }
7292
7247
  tryUpdateGlobalTransMatrix() {
7293
7248
  if (this._globalTransMatrix) {
@@ -8249,9 +8204,8 @@
8249
8204
  return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
8250
8205
  }
8251
8206
  removeAllChild() {
8252
- let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
8253
8207
  this.forEachChildren(child => {
8254
- application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
8208
+ application.graphicService.onRemove(child);
8255
8209
  }), super.removeAllChild(), this.addUpdateBoundTag();
8256
8210
  }
8257
8211
  setStage(stage, layer) {
@@ -8364,12 +8318,15 @@
8364
8318
  }
8365
8319
  render(params, userParams) {
8366
8320
  var _a;
8321
+ const stage = this.stage;
8367
8322
  this.layerHandler.render([this], {
8368
8323
  renderService: params.renderService,
8324
+ x: stage.x,
8325
+ y: stage.y,
8326
+ width: this.viewWidth,
8327
+ height: this.viewHeight,
8369
8328
  stage: this.stage,
8370
8329
  layer: this,
8371
- viewBox: params.viewBox,
8372
- transMatrix: params.transMatrix,
8373
8330
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
8374
8331
  updateBounds: params.updateBounds
8375
8332
  }, userParams), this.afterDrawCbs.forEach(c => c(this)), this.tryRenderSecondaryLayer(params, userParams);
@@ -8393,18 +8350,33 @@
8393
8350
  throw new Error("暂不支持");
8394
8351
  }
8395
8352
  prepare(dirtyBounds, params) {}
8353
+ combineTo(target, params) {
8354
+ var _a, _b, _c;
8355
+ this.offscreen && (this.layerHandler.drawTo(target, [this], Object.assign({
8356
+ background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
8357
+ renderService: params.renderService,
8358
+ x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
8359
+ y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
8360
+ width: this.viewWidth,
8361
+ height: this.viewHeight,
8362
+ stage: this.stage,
8363
+ layer: this
8364
+ }, params)), this.afterDrawCbs.forEach(c => c(this)));
8365
+ }
8396
8366
  release() {
8397
8367
  super.release(), this.layerHandler.release(), this.subLayers && this.subLayers.forEach(l => {
8398
8368
  application.layerService.releaseLayer(this.stage, l.layer);
8399
8369
  });
8400
8370
  }
8401
8371
  drawTo(target, params) {
8402
- var _a;
8372
+ var _a, _b, _c;
8403
8373
  this.layerHandler.drawTo(target, [this], Object.assign({
8404
8374
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
8405
8375
  renderService: params.renderService,
8406
- viewBox: params.viewBox,
8407
- transMatrix: params.transMatrix,
8376
+ x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
8377
+ y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
8378
+ width: this.viewWidth,
8379
+ height: this.viewHeight,
8408
8380
  stage: this.stage,
8409
8381
  layer: this
8410
8382
  }, params)), this.afterDrawCbs.forEach(c => c(this));
@@ -11008,24 +10980,6 @@
11008
10980
  getFrameCache() {
11009
10981
  return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
11010
10982
  }
11011
- combinedStyleToCharacter(config) {
11012
- const {
11013
- fill: fill,
11014
- stroke: stroke,
11015
- fontSize: fontSize,
11016
- fontFamily: fontFamily,
11017
- fontStyle: fontStyle,
11018
- fontWeight: fontWeight
11019
- } = this.attribute;
11020
- return Object.assign({
11021
- fill: fill,
11022
- stroke: stroke,
11023
- fontSize: fontSize,
11024
- fontFamily: fontFamily,
11025
- fontStyle: fontStyle,
11026
- fontWeight: fontWeight
11027
- }, config);
11028
- }
11029
10983
  doUpdateFrameCache() {
11030
10984
  var _a;
11031
10985
  const {
@@ -11044,7 +10998,7 @@
11044
10998
  } = this.attribute,
11045
10999
  paragraphs = [];
11046
11000
  for (let i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
11047
- const config = this.combinedStyleToCharacter(textConfig[i]),
11001
+ const config = textConfig[i],
11048
11002
  iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
11049
11003
  if (iconCache) paragraphs.push(iconCache);else {
11050
11004
  const icon = new RichTextIcon(config);
@@ -11054,7 +11008,7 @@
11054
11008
  }, icon.richtextId = config.id, paragraphs.push(icon);
11055
11009
  }
11056
11010
  } else {
11057
- const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
11011
+ const richTextConfig = textConfig[i];
11058
11012
  if (isNumber$2(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
11059
11013
  const textParts = richTextConfig.text.split("\n");
11060
11014
  for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
@@ -15581,10 +15535,10 @@
15581
15535
  render(group, params) {
15582
15536
  var _a;
15583
15537
  params.renderService.render(group, Object.assign(Object.assign({
15584
- context: this.context,
15585
- viewBox: params.stage.window.getViewBox(),
15586
- transMatrix: params.stage.window.getViewBoxTransform()
15538
+ context: this.context
15587
15539
  }, params), {
15540
+ x: 0,
15541
+ y: 0,
15588
15542
  clear: null !== (_a = params.background) && void 0 !== _a ? _a : "#ffffff"
15589
15543
  }));
15590
15544
  }
@@ -15599,12 +15553,11 @@
15599
15553
  const context = target.getContext(),
15600
15554
  targetDpr = target.dpr,
15601
15555
  {
15602
- viewBox: viewBox
15603
- } = params,
15604
- x = viewBox.x1,
15605
- y = viewBox.y1,
15606
- width = viewBox.width(),
15607
- height = viewBox.height();
15556
+ x = 0,
15557
+ y = 0,
15558
+ width = this.layer.viewWidth,
15559
+ height = this.layer.viewHeight
15560
+ } = params;
15608
15561
  context.nativeContext.save(), context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0), params.clear && context.clearRect(x, y, width, height), context.drawImage(this.canvas.nativeCanvas, 0, 0, this.canvas.width, this.canvas.height, x, y, width, height), context.nativeContext.restore();
15609
15562
  }
15610
15563
  merge(layerHandlers) {}
@@ -15760,22 +15713,32 @@
15760
15713
  const {
15761
15714
  context: context,
15762
15715
  stage: stage,
15763
- viewBox: viewBox,
15764
- transMatrix: transMatrix
15716
+ x = 0,
15717
+ y = 0,
15718
+ width: width,
15719
+ height: height
15765
15720
  } = drawContext;
15766
15721
  if (!context) return;
15767
- const dirtyBounds = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());
15722
+ if (drawContext.keepMatrix) {
15723
+ if (context.nativeContext && context.nativeContext.getTransform) {
15724
+ const t = context.nativeContext.getTransform();
15725
+ context.setTransformFromMatrix(t, !0, 1);
15726
+ }
15727
+ } else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
15728
+ const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
15768
15729
  if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
15769
15730
  const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
15770
15731
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
15771
15732
  }
15772
15733
  const d = context.dpr % 1;
15773
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(), context.setTransformForCurrent(!0), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
15734
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
15735
+ const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
15736
+ context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
15774
15737
  var _a, _b;
15775
15738
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
15776
15739
  }).forEach(group => {
15777
15740
  group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
15778
- }), context.restore(), context.draw(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1;
15741
+ }), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
15779
15742
  }
15780
15743
  doRegister() {
15781
15744
  throw new Error("暂不支持");
@@ -15894,25 +15857,29 @@
15894
15857
  clearScreen(renderService, context, drawContext) {
15895
15858
  var _a, _b;
15896
15859
  const {
15897
- clear: clear,
15898
- viewBox: viewBox
15899
- } = drawContext,
15900
- width = viewBox.width(),
15901
- height = viewBox.height();
15860
+ clear: clear
15861
+ } = drawContext;
15902
15862
  if (clear) {
15903
- context.clearRect(0, 0, width, height);
15863
+ const canvas = context.getCanvas(),
15864
+ {
15865
+ width = canvas.width,
15866
+ height = canvas.height
15867
+ } = drawContext,
15868
+ x = 0,
15869
+ y = 0;
15870
+ context.clearRect(x, y, width, height);
15904
15871
  const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
15905
15872
  if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
15906
15873
  const res = stage.resources.get(clear);
15907
- res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
15874
+ res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
15908
15875
  } else context.fillStyle = createColor(context, clear, {
15909
15876
  AABBBounds: {
15910
- x1: 0,
15911
- y1: 0,
15912
- x2: 0 + width,
15913
- y2: 0 + height
15877
+ x1: x,
15878
+ y1: y,
15879
+ x2: x + width,
15880
+ y2: y + height
15914
15881
  }
15915
- }, 0, 0), context.fillRect(0, 0, width, height);
15882
+ }, 0, 0), context.fillRect(x, y, width, height);
15916
15883
  }
15917
15884
  }
15918
15885
  afterDraw(renderService, drawParams) {}
@@ -16169,16 +16136,25 @@
16169
16136
  this.currentRenderService = renderService;
16170
16137
  const {
16171
16138
  context: context,
16172
- viewBox: viewBox
16139
+ x = 0,
16140
+ y = 0
16173
16141
  } = drawContext;
16174
- context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(viewBox.x1, viewBox.y1, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
16175
- var _a, _b;
16176
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
16177
- }).forEach(group => {
16178
- this.renderGroup(group, drawContext);
16179
- }), this.hooks.completeDraw.tap("top-draw", () => {
16180
- context.restore(), context.restore(), context.draw(), context.inuse = !1, this.rendering = !1;
16181
- }));
16142
+ if (context) {
16143
+ if (drawContext.keepMatrix) {
16144
+ if (context.nativeContext && context.nativeContext.getTransform) {
16145
+ const t = context.nativeContext.getTransform();
16146
+ context.setTransformFromMatrix(t, !0, 1);
16147
+ }
16148
+ } else context.inuse = !0, context.clearMatrix();
16149
+ context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
16150
+ var _a, _b;
16151
+ return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
16152
+ }).forEach(group => {
16153
+ this.renderGroup(group, drawContext);
16154
+ }), this.hooks.completeDraw.tap("top-draw", () => {
16155
+ context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
16156
+ });
16157
+ }
16182
16158
  });
16183
16159
  }
16184
16160
  _increaseRender(group, drawContext) {
@@ -16348,10 +16324,12 @@
16348
16324
  if (!layer || !group.layer.subLayers) return;
16349
16325
  const subLayer = group.layer.subLayers.get(group._uid);
16350
16326
  subLayer && subLayer.drawContribution && subLayer.drawContribution.draw(stage.renderService, Object.assign({
16327
+ x: stage.x,
16328
+ y: stage.y,
16329
+ width: layer.viewWidth,
16330
+ height: layer.viewHeight,
16351
16331
  stage: stage,
16352
16332
  layer: layer,
16353
- viewBox: stage.window.getViewBox(),
16354
- transMatrix: stage.window.getViewBoxTransform(),
16355
16333
  clear: "transparent",
16356
16334
  renderService: stage.renderService,
16357
16335
  updateBounds: !1,
@@ -16369,8 +16347,6 @@
16369
16347
  activate(context) {
16370
16348
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
16371
16349
  stage && stage === this.pluginService.stage && this.drawHTML(context.stage.renderService);
16372
- }), application.graphicService.hooks.onRemove.tap(this.key, graphic => {
16373
- this.removeDom(graphic);
16374
16350
  }), application.graphicService.hooks.onRelease.tap(this.key, graphic => {
16375
16351
  this.removeDom(graphic);
16376
16352
  });
@@ -16415,29 +16391,28 @@
16415
16391
  } = html;
16416
16392
  graphic.bindDom || (graphic.bindDom = new Map());
16417
16393
  const lastDom = graphic.bindDom.get(dom);
16418
- let wrapGroup, nativeContainer;
16419
- if (!lastDom || container && container !== lastDom.container) {
16420
- let nativeDom;
16421
- graphic.bindDom.forEach(_ref => {
16422
- let {
16423
- wrapGroup: wrapGroup
16424
- } = _ref;
16425
- application.global.removeDom(wrapGroup);
16426
- }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
16427
- const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
16428
- nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
16429
- tagName: "div",
16430
- width: width,
16431
- height: height,
16432
- style: style,
16433
- parent: nativeContainer
16434
- }), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
16435
- dom: nativeDom,
16436
- container: container,
16394
+ if (lastDom && (!container || container === lastDom.container)) return;
16395
+ let nativeDom, nativeContainer;
16396
+ graphic.bindDom.forEach(_ref => {
16397
+ let {
16437
16398
  wrapGroup: wrapGroup
16438
- }));
16439
- } else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
16440
- wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
16399
+ } = _ref;
16400
+ application.global.removeDom(wrapGroup);
16401
+ }), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
16402
+ const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
16403
+ nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
16404
+ const wrapGroup = application.global.createDom({
16405
+ tagName: "div",
16406
+ width: width,
16407
+ height: height,
16408
+ style: style,
16409
+ parent: nativeContainer
16410
+ });
16411
+ wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
16412
+ dom: nativeDom,
16413
+ container: container,
16414
+ wrapGroup: wrapGroup
16415
+ })), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
16441
16416
  let left = 0,
16442
16417
  top = 0;
16443
16418
  const b = graphic.globalAABBBounds;
@@ -16905,24 +16880,22 @@
16905
16880
  };
16906
16881
  class Stage extends Group$2 {
16907
16882
  set viewBox(b) {
16908
- this.window.setViewBox(b);
16883
+ this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);
16909
16884
  }
16910
16885
  get viewBox() {
16911
- return this.window.getViewBox();
16886
+ return this._viewBox;
16912
16887
  }
16913
16888
  get x() {
16914
- return this.window.getViewBox().x1;
16889
+ return this._viewBox.x1;
16915
16890
  }
16916
16891
  set x(x) {
16917
- const b = this.window.getViewBox();
16918
- b.translate(x - b.x1, 0), this.window.setViewBox(b);
16892
+ this._viewBox.translate(x - this._viewBox.x1, 0);
16919
16893
  }
16920
16894
  get y() {
16921
- return this.window.getViewBox().y1;
16895
+ return this._viewBox.y1;
16922
16896
  }
16923
16897
  set y(y) {
16924
- const b = this.window.getViewBox();
16925
- b.translate(0, y - b.y1), this.window.setViewBox(b);
16898
+ this._viewBox.translate(0, y - this._viewBox.y1);
16926
16899
  }
16927
16900
  get width() {
16928
16901
  return this.window.width;
@@ -16931,13 +16904,13 @@
16931
16904
  this.resize(w, this.height);
16932
16905
  }
16933
16906
  get viewWidth() {
16934
- return this.window.getViewBox().width();
16907
+ return this._viewBox.width();
16935
16908
  }
16936
16909
  set viewWidth(w) {
16937
16910
  this.resizeView(w, this.viewHeight);
16938
16911
  }
16939
16912
  get viewHeight() {
16940
- return this.window.getViewBox().height();
16913
+ return this._viewBox.height();
16941
16914
  }
16942
16915
  set viewHeight(h) {
16943
16916
  this.resizeView(this.viewWidth, h);
@@ -16971,13 +16944,7 @@
16971
16944
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16972
16945
  var _a;
16973
16946
  super({}), this._onVisibleChange = visible => {
16974
- if (!(this._skipRender < 0)) if (visible) {
16975
- if (this.dirtyBounds) {
16976
- const b = this.window.getViewBox();
16977
- this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.height());
16978
- }
16979
- this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
16980
- } else this._skipRender = 1;
16947
+ this._skipRender < 0 || (visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()), this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1);
16981
16948
  }, this.beforeRender = stage => {
16982
16949
  this._beforeRender && this._beforeRender(stage);
16983
16950
  }, this.afterRender = stage => {
@@ -16988,24 +16955,17 @@
16988
16955
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.pluginService.active(this, params), this.window.create({
16989
16956
  width: params.width,
16990
16957
  height: params.height,
16991
- viewBox: params.viewBox,
16992
16958
  container: params.container,
16993
16959
  dpr: params.dpr || this.global.devicePixelRatio,
16994
16960
  canvasControled: !1 !== params.canvasControled,
16995
16961
  title: params.title || "",
16996
16962
  canvas: params.canvas
16997
- }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
16963
+ }), this._viewBox = new AABBBounds(), params.viewBox ? this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : this._viewBox.setValue(0, 0, this.width, this.height), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
16998
16964
  main: !0
16999
16965
  })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$2(this._background) && this._background.includes("/") && this.setAttributes({
17000
16966
  background: this._background
17001
16967
  });
17002
16968
  }
17003
- pauseRender() {
17004
- this._skipRender = -1;
17005
- }
17006
- resumeRender() {
17007
- this._skipRender = 0;
17008
- }
17009
16969
  tryInitEventSystem() {
17010
16970
  this.global.supportEvent && !this._eventSystem && (this._eventSystem = new EventSystem(Object.assign({
17011
16971
  targetElement: this.window,
@@ -17013,7 +16973,22 @@
17013
16973
  rootNode: this,
17014
16974
  global: this.global,
17015
16975
  supportsPointerEvents: this.params.supportsPointerEvents,
17016
- supportsTouchEvents: this.params.supportsTouchEvents
16976
+ supportsTouchEvents: this.params.supportsTouchEvents,
16977
+ viewport: {
16978
+ viewBox: this._viewBox,
16979
+ get x() {
16980
+ return this.viewBox.x1;
16981
+ },
16982
+ get y() {
16983
+ return this.viewBox.y1;
16984
+ },
16985
+ get width() {
16986
+ return this.viewBox.width();
16987
+ },
16988
+ get height() {
16989
+ return this.viewBox.height();
16990
+ }
16991
+ }
17017
16992
  }, this.params.event)));
17018
16993
  }
17019
16994
  preventRender(prevent) {
@@ -17160,7 +17135,7 @@
17160
17135
  return this.pluginService.findPluginsByName(name);
17161
17136
  }
17162
17137
  tryUpdateAABBBounds() {
17163
- const viewBox = this.window.getViewBox();
17138
+ const viewBox = this._viewBox;
17164
17139
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
17165
17140
  }
17166
17141
  combineLayer(ILayer1, ILayer2) {
@@ -17187,12 +17162,12 @@
17187
17162
  this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
17188
17163
  }
17189
17164
  clearViewBox(color) {
17190
- this.window.clearViewBox(color);
17165
+ this.window.clearViewBox(this._viewBox, color);
17191
17166
  }
17192
17167
  render(layers, params) {
17193
17168
  this.ticker.start(), this.timeline.resume();
17194
17169
  const state = this.state;
17195
- this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
17170
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
17196
17171
  }
17197
17172
  combineLayersToWindow() {}
17198
17173
  renderNextFrame(layers, force) {
@@ -17205,7 +17180,7 @@
17205
17180
  _doRenderInThisFrame() {
17206
17181
  this.timeline.resume(), this.ticker.start();
17207
17182
  const state = this.state;
17208
- this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
17183
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear()), this.state = state, this._skipRender && this._skipRender++;
17209
17184
  }
17210
17185
  renderLayerList(layerList, params) {
17211
17186
  const list = [];
@@ -17217,17 +17192,14 @@
17217
17192
  layer.renderCount > this.renderCount || (layer.renderCount = this.renderCount + 1, layer.render({
17218
17193
  renderService: this.renderService,
17219
17194
  background: layer === this.defaultLayer ? this.background : void 0,
17220
- updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
17221
- viewBox: this.window.getViewBox(),
17222
- transMatrix: this.window.getViewBoxTransform()
17195
+ updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
17223
17196
  }, Object.assign({
17224
- renderStyle: this.renderStyle
17197
+ renderStyle: this.renderStyle,
17198
+ keepMatrix: this.params.renderKeepMatrix
17225
17199
  }, params)));
17226
17200
  }), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
17227
17201
  renderService: this.renderService,
17228
- updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
17229
- viewBox: this.window.getViewBox(),
17230
- transMatrix: this.window.getViewBoxTransform()
17202
+ updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
17231
17203
  }, Object.assign({
17232
17204
  renderStyle: this.renderStyle
17233
17205
  }, params));
@@ -17238,9 +17210,9 @@
17238
17210
  }
17239
17211
  resize(w, h) {
17240
17212
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
17241
- this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
17213
+ this.window.resize(w, h), this.forEachChildren(c => {
17242
17214
  c.resize(w, h);
17243
- }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
17215
+ }), this._subView || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
17244
17216
  }
17245
17217
  resizeView(w, h) {
17246
17218
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
@@ -17294,41 +17266,47 @@
17294
17266
  getLayer(name) {
17295
17267
  return this.children.filter(layer => layer.name === name)[0];
17296
17268
  }
17297
- renderTo(window) {
17269
+ renderTo(window, params) {
17298
17270
  this.forEachChildren((layer, i) => {
17299
- layer.drawTo(window, {
17271
+ layer.drawTo(window, Object.assign(Object.assign({}, params), {
17300
17272
  renderService: this.renderService,
17301
- viewBox: window.getViewBox(),
17302
- transMatrix: window.getViewBoxTransform(),
17303
17273
  background: layer === this.defaultLayer ? this.background : void 0,
17304
17274
  clear: 0 === i,
17305
17275
  updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
17306
- });
17276
+ }));
17307
17277
  });
17308
17278
  }
17309
17279
  renderToNewWindow() {
17280
+ let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
17310
17281
  let viewBox = arguments.length > 1 ? arguments[1] : undefined;
17311
- const window = container.get(VWindow),
17312
- x1 = viewBox ? -viewBox.x1 : 0,
17313
- y1 = viewBox ? -viewBox.y1 : 0,
17314
- x2 = viewBox ? viewBox.x2 : this.viewWidth,
17315
- y2 = viewBox ? viewBox.y2 : this.viewHeight,
17316
- width = viewBox ? viewBox.width() : this.viewWidth,
17317
- height = viewBox ? viewBox.height() : this.viewHeight;
17318
- return window.create({
17319
- viewBox: {
17320
- x1: x1,
17321
- y1: y1,
17322
- x2: x2,
17323
- y2: y2
17324
- },
17325
- width: width,
17326
- height: height,
17282
+ const window = container.get(VWindow);
17283
+ if (fullImage) window.create({
17284
+ width: this.viewWidth,
17285
+ height: this.viewHeight,
17327
17286
  dpr: this.window.dpr,
17328
17287
  canvasControled: !0,
17329
17288
  offscreen: !0,
17330
17289
  title: ""
17331
- }), this.renderTo(window), window;
17290
+ });else {
17291
+ const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x),
17292
+ height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
17293
+ window.create({
17294
+ width: width,
17295
+ height: height,
17296
+ dpr: this.window.dpr,
17297
+ canvasControled: !0,
17298
+ offscreen: !0,
17299
+ title: ""
17300
+ });
17301
+ }
17302
+ const x = viewBox ? -viewBox.x1 : 0,
17303
+ y = viewBox ? -viewBox.y1 : 0;
17304
+ return this.renderTo(window, {
17305
+ x: x,
17306
+ y: y,
17307
+ width: viewBox ? viewBox.x2 : window.width,
17308
+ height: viewBox ? viewBox.y2 : window.height
17309
+ }), window;
17332
17310
  }
17333
17311
  toCanvas() {
17334
17312
  let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
@@ -17542,7 +17520,7 @@
17542
17520
  };
17543
17521
  let BaseWindowHandlerContribution = class {
17544
17522
  constructor() {
17545
- this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
17523
+ this._uid = Generator.GenAutoIncrementId();
17546
17524
  }
17547
17525
  onChange(cb) {
17548
17526
  this._onChangeCb = cb;
@@ -17563,18 +17541,6 @@
17563
17541
  left: 0
17564
17542
  };
17565
17543
  }
17566
- setViewBox(vb) {
17567
- this.viewBox.setValue(vb.x1, vb.y1, vb.x2, vb.y2);
17568
- }
17569
- getViewBox() {
17570
- return this.viewBox;
17571
- }
17572
- setViewBoxTransform(a, b, c, d, e, f) {
17573
- this.modelMatrix.setValue(a, b, c, d, e, f);
17574
- }
17575
- getViewBoxTransform() {
17576
- return this.modelMatrix;
17577
- }
17578
17544
  };
17579
17545
  BaseWindowHandlerContribution = __decorate$K([injectable(), __metadata$x("design:paramtypes", [])], BaseWindowHandlerContribution);
17580
17546
 
@@ -17606,14 +17572,23 @@
17606
17572
  group: null
17607
17573
  };
17608
17574
  params.pickerService = this;
17609
- const w = params.bounds.width(),
17610
- h = params.bounds.height();
17611
- if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
17612
- this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
17613
- const parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
17575
+ let offsetX = 0,
17576
+ offsetY = 0;
17577
+ if (params && params.bounds) {
17578
+ if (!params.bounds.contains(point.x, point.y)) return result;
17579
+ offsetX = params.bounds.x1, offsetY = params.bounds.y1;
17580
+ }
17581
+ if (this.pickContext) if (params.keepMatrix) {
17582
+ if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
17583
+ const t = this.pickContext.nativeContext.getTransform();
17584
+ this.pickContext.setTransformFromMatrix(t, !0, 1);
17585
+ }
17586
+ } else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
17587
+ params.pickContext = this.pickContext;
17588
+ const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
17614
17589
  let group;
17615
17590
  for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
17616
- if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
17591
+ if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
17617
17592
  let g = result.graphic;
17618
17593
  for (; g.parent;) g = g.parent;
17619
17594
  g.shadowHost && (result.params = {
@@ -18667,6 +18642,7 @@
18667
18642
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
18668
18643
  };
18669
18644
  const outP = [0, 0, 0],
18645
+ initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
18670
18646
  addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) => {
18671
18647
  if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
18672
18648
  const step = pi / 3 * (endAngle > startAngle ? 1 : -1);
@@ -18797,7 +18773,7 @@
18797
18773
  }), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
18798
18774
  const context = canvas.nativeCanvas.getContext("2d");
18799
18775
  if (!context) throw new Error("发生错误,获取2d上下文失败");
18800
- this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
18776
+ this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
18801
18777
  }
18802
18778
  reset() {
18803
18779
  this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
@@ -19159,10 +19135,7 @@
19159
19135
  clearMatrix() {
19160
19136
  let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
19161
19137
  let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
19162
- this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
19163
- }
19164
- setClearMatrix(a, b, c, d, e, f) {
19165
- this._clearMatrix.setValue(a, b, c, d, e, f);
19138
+ this.setTransformFromMatrix(initMatrix, setTransform, dpr);
19166
19139
  }
19167
19140
  onlyTranslate() {
19168
19141
  let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
@@ -19393,7 +19366,7 @@
19393
19366
  return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
19394
19367
  }
19395
19368
  constructor() {
19396
- super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
19369
+ super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global;
19397
19370
  }
19398
19371
  getTitle() {
19399
19372
  return this.canvas.id.toString();
@@ -19522,9 +19495,8 @@
19522
19495
  bottom: 0
19523
19496
  };
19524
19497
  }
19525
- clearViewBox(color) {
19526
- const vb = this.viewBox,
19527
- context = this.getContext(),
19498
+ clearViewBox(vb, color) {
19499
+ const context = this.getContext(),
19528
19500
  dpr = this.getDpr();
19529
19501
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
19530
19502
  }
@@ -19894,7 +19866,7 @@
19894
19866
  getBoundingClientRect() {
19895
19867
  return null;
19896
19868
  }
19897
- clearViewBox(color) {}
19869
+ clearViewBox(vb, color) {}
19898
19870
  };
19899
19871
  NodeWindowHandlerContribution.env = "node", NodeWindowHandlerContribution = __decorate$v([injectable(), __param$n(0, inject(VGlobal)), __metadata$n("design:paramtypes", [Object])], NodeWindowHandlerContribution);
19900
19872
  const nodeWindowModule = new ContainerModule(bind => {
@@ -24012,6 +23984,9 @@
24012
23984
  get borderLineDash() {
24013
23985
  return frameStyle.borderLineDash;
24014
23986
  },
23987
+ get innerBorder() {
23988
+ return frameStyle.innerBorder;
23989
+ },
24015
23990
  get shadowBlur() {
24016
23991
  return frameStyle.shadowBlur;
24017
23992
  },
@@ -25400,7 +25375,7 @@
25400
25375
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, Segment.defaultAttributes, attributes)), this.name = "segment";
25401
25376
  }
25402
25377
  render() {
25403
- this.removeAllChild(!0), this._reset();
25378
+ this.removeAllChild(), this._reset();
25404
25379
  const {
25405
25380
  startSymbol: startSymbol,
25406
25381
  endSymbol: endSymbol,
@@ -25669,7 +25644,7 @@
25669
25644
  return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
25670
25645
  }
25671
25646
  render() {
25672
- this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator$1.group({
25647
+ this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator$1.group({
25673
25648
  x: 0,
25674
25649
  y: 0,
25675
25650
  pickable: !1
@@ -26657,7 +26632,7 @@
26657
26632
  this.attribute.disableTriggerEvent || (this.preHandler && (this.preHandler.addEventListener("pointerenter", this._onHover), this.preHandler.addEventListener("pointerleave", this._onUnHover), this.preHandler.addEventListener("pointerdown", this._onClick)), this.nextHandler && (this.nextHandler.addEventListener("pointerenter", this._onHover), this.nextHandler.addEventListener("pointerleave", this._onUnHover), this.nextHandler.addEventListener("pointerdown", this._onClick)));
26658
26633
  }
26659
26634
  _reset() {
26660
- this.removeAllChild(!0), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
26635
+ this.removeAllChild(), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
26661
26636
  }
26662
26637
  }
26663
26638
  Pager.defaultAttributes = {
@@ -26694,7 +26669,7 @@
26694
26669
  super(...arguments), this.name = "legend", this._title = null;
26695
26670
  }
26696
26671
  render() {
26697
- this.removeAllChild(!0);
26672
+ this.removeAllChild();
26698
26673
  const {
26699
26674
  interactive = !0,
26700
26675
  title: title,
@@ -28393,7 +28368,7 @@
28393
28368
  }
28394
28369
  render() {
28395
28370
  var _a, _b;
28396
- this.removeAllChild(!0);
28371
+ this.removeAllChild();
28397
28372
  const {
28398
28373
  layout = "horizontal",
28399
28374
  railWidth: railWidth,
@@ -29185,7 +29160,7 @@
29185
29160
  }, this.addEventListener("click", this.handleClick);
29186
29161
  }
29187
29162
  render() {
29188
- this.removeAllChild(!0), this.renderBox(), this.renderIcon(), this.renderText(), this.layout();
29163
+ this.removeAllChild(), this.renderBox(), this.renderIcon(), this.renderText(), this.layout();
29189
29164
  }
29190
29165
  renderBox() {
29191
29166
  this._box = new Rect$2(merge({}, this.attribute.box));
@@ -32631,7 +32606,7 @@
32631
32606
  super(params);
32632
32607
  this.numberType = CHART_NUMBER_TYPE;
32633
32608
  if (!params.chartInstance) {
32634
- params.chartInstance = this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
32609
+ params.chartInstance = this.chartInstance = new params.ClassType(params.spec, {
32635
32610
  renderCanvas: params.canvas,
32636
32611
  mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
32637
32612
  modeParams: this.attribute.modeParams,
@@ -32641,9 +32616,8 @@
32641
32616
  interactive: false,
32642
32617
  animation: false,
32643
32618
  autoFit: false
32644
- }));
32619
+ });
32645
32620
  this.chartInstance.renderSync();
32646
- this.chartInstance.getStage().enableDirtyBounds();
32647
32621
  }
32648
32622
  else {
32649
32623
  this.chartInstance = params.chartInstance;
@@ -32660,52 +32634,34 @@
32660
32634
  y1: y1 - table.scrollTop,
32661
32635
  y2: y2 - table.scrollTop
32662
32636
  });
32663
- this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
32637
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
32664
32638
  renderCanvas: this.attribute.canvas,
32665
32639
  mode: 'desktop-browser',
32666
32640
  canvasControled: false,
32667
32641
  viewBox: {
32668
- x1: 0,
32669
- x2: x2 - x1,
32670
- y1: 0,
32671
- y2: y2 - y1
32642
+ x1: x1 - table.scrollLeft,
32643
+ x2: x2 - table.scrollLeft,
32644
+ y1: y1 - table.scrollTop,
32645
+ y2: y2 - table.scrollTop
32672
32646
  },
32673
32647
  dpr: table.internalProps.pixelRatio,
32674
32648
  animation: false,
32675
32649
  interactive: true,
32676
32650
  autoFit: false,
32677
- beforeRender: (chartStage) => {
32678
- const stage = this.stage;
32679
- const ctx = chartStage.window.getContext();
32680
- const stageMatrix = stage.window.getViewBoxTransform();
32681
- const viewBox = stage.window.getViewBox();
32651
+ beforeRender: (stage) => {
32652
+ const ctx = stage.window.getContext();
32682
32653
  ctx.inuse = true;
32683
32654
  ctx.clearMatrix();
32684
- ctx.setTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f, true);
32685
- ctx.translate(viewBox.x1, viewBox.y1);
32686
32655
  ctx.setTransformForCurrent(true);
32687
32656
  ctx.beginPath();
32688
32657
  ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
32689
32658
  ctx.clip();
32690
- ctx.clearMatrix();
32691
- if (!chartStage.needRender) {
32692
- chartStage.pauseRender();
32693
- table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
32694
- table.scenegraph.updateNextFrame();
32695
- }
32696
32659
  },
32697
32660
  afterRender(stage) {
32698
32661
  const ctx = stage.window.getContext();
32699
32662
  ctx.inuse = false;
32700
- stage.needRender = false;
32701
- chartStage.resumeRender();
32702
32663
  }
32703
- }));
32704
- const chartStage = this.activeChartInstance.getStage();
32705
- const matrix = this.globalTransMatrix.clone();
32706
- const stageMatrix = this.stage.window.getViewBoxTransform();
32707
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
32708
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
32664
+ });
32709
32665
  this.activeChartInstance.renderSync();
32710
32666
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
32711
32667
  this.activeChartInstance.on('click', (params) => {
@@ -32741,12 +32697,11 @@
32741
32697
  const cellGroup = this.parent;
32742
32698
  const padding = this.attribute.cellPadding;
32743
32699
  const table = this.stage.table;
32744
- const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
32745
32700
  return {
32746
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
32747
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
32748
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
32749
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
32701
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
32702
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
32703
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
32704
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
32750
32705
  };
32751
32706
  }
32752
32707
  }
@@ -32777,10 +32732,6 @@
32777
32732
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
32778
32733
  bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
32779
32734
  }
32780
- bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
32781
- bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
32782
- bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
32783
- bodyBound.y2 = bodyBound.y2 + (table.options.viewBox?.y1 ?? 0);
32784
32735
  return bodyBound;
32785
32736
  }
32786
32737
 
@@ -32838,8 +32789,7 @@
32838
32789
  data: table.getCellValue(col, row),
32839
32790
  cellPadding: padding,
32840
32791
  dpr: table.internalProps.pixelRatio,
32841
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
32842
- tableChartOption: table.options.chartOption
32792
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
32843
32793
  });
32844
32794
  cellGroup.appendChild(chartGroup);
32845
32795
  table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
@@ -38976,10 +38926,18 @@
38976
38926
  rectAttributes.y = borderTop / 2;
38977
38927
  rectAttributes.pickable = false;
38978
38928
  if (isTableGroup) {
38979
- rectAttributes.x = group.attribute.x - borderLeft / 2;
38980
- rectAttributes.y = group.attribute.y - borderTop / 2;
38981
- rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;
38982
- rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;
38929
+ if (frameTheme.innerBorder) {
38930
+ rectAttributes.x = group.attribute.x + borderLeft / 2;
38931
+ rectAttributes.y = group.attribute.y + borderTop / 2;
38932
+ rectAttributes.width = group.attribute.width - borderLeft / 2 - borderRight / 2;
38933
+ rectAttributes.height = group.attribute.height - borderTop / 2 - borderBottom / 2;
38934
+ }
38935
+ else {
38936
+ rectAttributes.x = group.attribute.x - borderLeft / 2;
38937
+ rectAttributes.y = group.attribute.y - borderTop / 2;
38938
+ rectAttributes.width = group.attribute.width + borderLeft / 2 + borderRight / 2;
38939
+ rectAttributes.height = group.attribute.height + borderTop / 2 + borderBottom / 2;
38940
+ }
38983
38941
  let shadowRect;
38984
38942
  let borderRect;
38985
38943
  if (hasShadow) {
@@ -39009,7 +38967,12 @@
39009
38967
  borderRect = createRect(rectAttributes);
39010
38968
  borderRect.name = 'table-border-rect';
39011
38969
  }
39012
- group.parent.insertBefore(borderRect, group);
38970
+ if (frameTheme.innerBorder && !hasShadow) {
38971
+ group.parent.insertAfter(borderRect, group);
38972
+ }
38973
+ else {
38974
+ group.parent.insertBefore(borderRect, group);
38975
+ }
39013
38976
  group.border = borderRect;
39014
38977
  }
39015
38978
  else {
@@ -39189,65 +39152,48 @@
39189
39152
  if (viewBox.y2 <= viewBox.y1) {
39190
39153
  viewBox.y2 = viewBox.y1 + 1;
39191
39154
  }
39192
- chartInstance.updateViewBox({
39193
- x1: 0,
39194
- x2: viewBox.x2 - viewBox.x1,
39195
- y1: 0,
39196
- y2: viewBox.y2 - viewBox.y1
39197
- }, false, false);
39198
- const chartStage = chartInstance.getStage();
39199
- const matrix = chart.globalTransMatrix.clone();
39200
- const stageMatrix = chart.stage.window.getViewBoxTransform();
39201
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
39202
- chartStage.window.setViewBoxTransform &&
39203
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
39204
- const { table } = chart.getRootNode();
39205
- let updateSpec = false;
39206
- if (table.options.specFormat) {
39207
- const formatResult = table.options.specFormat(chart.attribute.spec);
39208
- if (formatResult.needFormatSpec && formatResult.spec) {
39209
- const spec = formatResult.spec;
39210
- chartInstance.updateSpecSync(spec);
39211
- updateSpec = true;
39212
- }
39213
- }
39214
- if (!updateSpec) {
39215
- axes?.forEach((axis, index) => {
39216
- if (axis.type === 'band') {
39217
- chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
39218
- }
39219
- else {
39220
- chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
39221
- }
39222
- });
39223
- table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
39224
- if (typeof dataId === 'string') {
39225
- chartInstance.updateDataSync(dataId, data ?? []);
39155
+ axes?.forEach((axis, index) => {
39156
+ if (axis.type === 'band') {
39157
+ chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
39226
39158
  }
39227
39159
  else {
39228
- const dataBatch = [];
39229
- for (const dataIdStr in dataId) {
39230
- const dataIdAndField = dataId[dataIdStr];
39231
- const series = spec.series.find((item) => item?.data?.id === dataIdStr);
39232
- dataBatch.push({
39233
- id: dataIdStr,
39234
- values: dataIdAndField
39235
- ? data?.filter((item) => {
39236
- return item.hasOwnProperty(dataIdAndField);
39237
- }) ?? []
39238
- : data ?? [],
39239
- fields: series?.data?.fields
39240
- });
39241
- if (!chartInstance.updateFullDataSync) {
39242
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
39243
- ? data?.filter((item) => {
39244
- return item.hasOwnProperty(dataIdAndField);
39245
- }) ?? []
39246
- : data ?? []);
39247
- }
39160
+ chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
39161
+ }
39162
+ });
39163
+ chartInstance.updateViewBox({
39164
+ x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
39165
+ x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
39166
+ y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
39167
+ y2: viewBox.y2 - chart.getRootNode().table.scrollTop
39168
+ }, false, false);
39169
+ const table = chart.getRootNode().table;
39170
+ table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
39171
+ if (typeof dataId === 'string') {
39172
+ chartInstance.updateDataSync(dataId, data ?? []);
39173
+ }
39174
+ else {
39175
+ const dataBatch = [];
39176
+ for (const dataIdStr in dataId) {
39177
+ const dataIdAndField = dataId[dataIdStr];
39178
+ const series = spec.series.find((item) => item?.data?.id === dataIdStr);
39179
+ dataBatch.push({
39180
+ id: dataIdStr,
39181
+ values: dataIdAndField
39182
+ ? data?.filter((item) => {
39183
+ return item.hasOwnProperty(dataIdAndField);
39184
+ }) ?? []
39185
+ : data ?? [],
39186
+ fields: series?.data?.fields
39187
+ });
39188
+ if (!chartInstance.updateFullDataSync) {
39189
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
39190
+ ? data?.filter((item) => {
39191
+ return item.hasOwnProperty(dataIdAndField);
39192
+ }) ?? []
39193
+ : data ?? []);
39248
39194
  }
39249
- chartInstance.updateFullDataSync?.(dataBatch);
39250
39195
  }
39196
+ chartInstance.updateFullDataSync?.(dataBatch);
39251
39197
  }
39252
39198
  const sg = chartInstance.getStage();
39253
39199
  cacheStageCanvas(sg, chart);
@@ -39304,7 +39250,7 @@
39304
39250
  }
39305
39251
 
39306
39252
  const ChartRender = Symbol.for('ChartRender');
39307
- let DefaultCanvasChartRender = class DefaultCanvasChartRender extends BaseRender {
39253
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender {
39308
39254
  type;
39309
39255
  numberType = CHART_NUMBER_TYPE;
39310
39256
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -39312,7 +39258,6 @@
39312
39258
  const { dataId, data, spec } = chart.attribute;
39313
39259
  chart.getViewBox();
39314
39260
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
39315
- const { table } = chart.getRootNode();
39316
39261
  const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
39317
39262
  if (!active && cacheCanvas) {
39318
39263
  if (isArray$1(cacheCanvas)) {
@@ -39326,27 +39271,6 @@
39326
39271
  }
39327
39272
  }
39328
39273
  else if (activeChartInstance) {
39329
- if (table.options.specFormat) {
39330
- const formatResult = table.options.specFormat(chart.attribute.spec);
39331
- if (formatResult.needFormatSpec && formatResult.spec) {
39332
- const spec = formatResult.spec;
39333
- activeChartInstance.updateSpecSync(spec);
39334
- return;
39335
- }
39336
- }
39337
- const viewBox = chart.getViewBox();
39338
- activeChartInstance.updateViewBox({
39339
- x1: 0,
39340
- x2: viewBox.x2 - viewBox.x1,
39341
- y1: 0,
39342
- y2: viewBox.y2 - viewBox.y1
39343
- }, false, false);
39344
- const chartStage = activeChartInstance.getStage();
39345
- chartStage.needRender = true;
39346
- const matrix = chart.globalTransMatrix.clone();
39347
- const stageMatrix = chart.stage.window.getViewBoxTransform();
39348
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
39349
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
39350
39274
  if (typeof dataId === 'string') {
39351
39275
  activeChartInstance.updateDataSync(dataId, data ?? []);
39352
39276
  }
@@ -39376,13 +39300,13 @@
39376
39300
  }
39377
39301
  }
39378
39302
  else {
39379
- if (table.internalProps.renderChartAsync) {
39303
+ if (chart.getRootNode().table.internalProps.renderChartAsync) {
39380
39304
  if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
39381
39305
  chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
39382
39306
  chartRenderQueueList.push(chart);
39383
39307
  }
39384
39308
  if (!IsHandlingChartQueue()) {
39385
- startRenderChartQueue(table);
39309
+ startRenderChartQueue(chart.getRootNode().table);
39386
39310
  }
39387
39311
  }
39388
39312
  else {
@@ -39391,7 +39315,31 @@
39391
39315
  }
39392
39316
  }
39393
39317
  draw(chart, renderService, drawContext, params) {
39394
- this._draw(chart, {}, false, drawContext, params);
39318
+ const { context } = drawContext;
39319
+ if (!context) {
39320
+ return;
39321
+ }
39322
+ const { clip } = chart.attribute;
39323
+ if (clip) {
39324
+ context.save();
39325
+ }
39326
+ else {
39327
+ context.highPerformanceSave();
39328
+ }
39329
+ context.transformFromMatrix(chart.transMatrix, true);
39330
+ context.beginPath();
39331
+ if (params.skipDraw) {
39332
+ this.drawShape(chart, context, 0, 0, drawContext, params, () => false, () => false);
39333
+ }
39334
+ else {
39335
+ this.drawShape(chart, context, 0, 0, drawContext);
39336
+ }
39337
+ if (clip) {
39338
+ context.restore();
39339
+ }
39340
+ else {
39341
+ context.highPerformanceRestore();
39342
+ }
39395
39343
  }
39396
39344
  };
39397
39345
  DefaultCanvasChartRender = __decorate([
@@ -39494,10 +39442,20 @@
39494
39442
  hoverMode = 'cellBgColor';
39495
39443
  }
39496
39444
  else if (highlightScope === HighlightScope.column && cellPos.col === col) {
39497
- hoverMode = 'inlineColumnBgColor';
39445
+ if (cellPos.col === col && cellPos.row === row) {
39446
+ hoverMode = 'cellBgColor';
39447
+ }
39448
+ else {
39449
+ hoverMode = 'inlineColumnBgColor';
39450
+ }
39498
39451
  }
39499
39452
  else if (highlightScope === HighlightScope.row && cellPos.row === row) {
39500
- hoverMode = 'inlineRowBgColor';
39453
+ if (cellPos.col === col && cellPos.row === row) {
39454
+ hoverMode = 'cellBgColor';
39455
+ }
39456
+ else {
39457
+ hoverMode = 'inlineRowBgColor';
39458
+ }
39501
39459
  }
39502
39460
  else if (highlightScope === HighlightScope.cross) {
39503
39461
  if (cellPos.col === col && cellPos.row === row) {
@@ -39625,10 +39583,13 @@
39625
39583
  context.moveTo(x, y);
39626
39584
  context.lineTo(x + width, y);
39627
39585
  }
39628
- if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[0])) {
39629
- if (strokeArrayColor) {
39586
+ if (isSplitDraw || isDash) {
39587
+ if (strokeArrayColor && strokeArrayColor[0]) {
39630
39588
  context.strokeStyle = strokeArrayColor[0];
39631
39589
  }
39590
+ else {
39591
+ context.strokeStyle = 'transparent';
39592
+ }
39632
39593
  if (!isWidthNumber) {
39633
39594
  context.lineWidth = strokeArrayWidth[0];
39634
39595
  }
@@ -39651,10 +39612,13 @@
39651
39612
  context.moveTo(x + width, y);
39652
39613
  context.lineTo(x + width, y + height);
39653
39614
  }
39654
- if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[1])) {
39655
- if (strokeArrayColor) {
39615
+ if (isSplitDraw || isDash) {
39616
+ if (strokeArrayColor && strokeArrayColor[1]) {
39656
39617
  context.strokeStyle = strokeArrayColor[1];
39657
39618
  }
39619
+ else {
39620
+ context.strokeStyle = 'transparent';
39621
+ }
39658
39622
  if (!isWidthNumber) {
39659
39623
  context.lineWidth = strokeArrayWidth[1];
39660
39624
  }
@@ -39677,10 +39641,13 @@
39677
39641
  context.moveTo(x, y + height);
39678
39642
  context.lineTo(x + width, y + height);
39679
39643
  }
39680
- if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[2])) {
39681
- if (strokeArrayColor) {
39644
+ if (isSplitDraw || isDash) {
39645
+ if (strokeArrayColor && strokeArrayColor[2]) {
39682
39646
  context.strokeStyle = strokeArrayColor[2];
39683
39647
  }
39648
+ else {
39649
+ context.strokeStyle = 'transparent';
39650
+ }
39684
39651
  if (!isWidthNumber) {
39685
39652
  context.lineWidth = strokeArrayWidth[2];
39686
39653
  }
@@ -39703,10 +39670,13 @@
39703
39670
  context.moveTo(x, y);
39704
39671
  context.lineTo(x, y + height);
39705
39672
  }
39706
- if ((isSplitDraw || isDash) && (!strokeArrayColor || strokeArrayColor[3])) {
39707
- if (strokeArrayColor) {
39673
+ if (isSplitDraw || isDash) {
39674
+ if (strokeArrayColor && strokeArrayColor[3]) {
39708
39675
  context.strokeStyle = strokeArrayColor[3];
39709
39676
  }
39677
+ else {
39678
+ context.strokeStyle = 'transparent';
39679
+ }
39710
39680
  if (!isWidthNumber) {
39711
39681
  context.lineWidth = strokeArrayWidth[3];
39712
39682
  }
@@ -43267,15 +43237,6 @@
43267
43237
  });
43268
43238
  }
43269
43239
  }
43270
- function clearCellChartCacheImage(col, row, scenegraph) {
43271
- const cellGroup = scenegraph.getCell(col, row);
43272
- cellGroup.children.forEach((node) => {
43273
- if (node.type === 'chart') {
43274
- node.cacheCanvas = null;
43275
- node.addUpdateBoundTag();
43276
- }
43277
- });
43278
- }
43279
43240
  function updateChartData(scenegraph) {
43280
43241
  const table = scenegraph.table;
43281
43242
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -44220,12 +44181,7 @@
44220
44181
  setPoptipTheme(this.table.theme.textPopTipStyle);
44221
44182
  let width;
44222
44183
  let height;
44223
- if (table.options.canvas && table.options.viewBox) {
44224
- vglobal.setEnv('browser');
44225
- width = table.options.viewBox.x2 - table.options.viewBox.x1;
44226
- height = table.options.viewBox.y2 - table.options.viewBox.y1;
44227
- }
44228
- else if (Env.mode === 'node') {
44184
+ if (Env.mode === 'node') {
44229
44185
  vglobal.setEnv('node', table.options.modeParams);
44230
44186
  width = table.canvasWidth;
44231
44187
  height = table.canvasHeight;
@@ -44243,15 +44199,9 @@
44243
44199
  background: table.theme.underlayBackgroundColor,
44244
44200
  dpr: table.internalProps.pixelRatio,
44245
44201
  enableLayout: true,
44246
- beforeRender: (stage) => {
44247
- this.table.options.beforeRender && this.table.options.beforeRender(stage);
44248
- },
44249
- afterRender: (stage) => {
44250
- this.table.options.afterRender && this.table.options.afterRender(stage);
44202
+ afterRender: () => {
44251
44203
  this.table.fireListeners('after_render', null);
44252
- },
44253
- canvasControled: !table.options.canvas,
44254
- viewBox: table.options.viewBox
44204
+ }
44255
44205
  });
44256
44206
  this.stage.defaultLayer.setTheme({
44257
44207
  group: {
@@ -44737,26 +44687,52 @@
44737
44687
  Math.max(this.leftBottomCornerGroup.attribute.height, this.bottomFrozenGroup.attribute.height, this.rightBottomCornerGroup.attribute.height, 0))
44738
44688
  });
44739
44689
  if (this.tableGroup.border && this.tableGroup.border.type === 'rect') {
44740
- this.tableGroup.border.setAttributes({
44741
- x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
44742
- y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
44743
- width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
44744
- height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
44745
- });
44690
+ if (this.table.theme.frameStyle?.innerBorder) {
44691
+ this.tableGroup.border.setAttributes({
44692
+ x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
44693
+ y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
44694
+ width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
44695
+ height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
44696
+ });
44697
+ }
44698
+ else {
44699
+ this.tableGroup.border.setAttributes({
44700
+ x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
44701
+ y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
44702
+ width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
44703
+ height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
44704
+ });
44705
+ }
44746
44706
  }
44747
44707
  else if (this.tableGroup.border && this.tableGroup.border.type === 'group') {
44748
- this.tableGroup.border.setAttributes({
44749
- x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
44750
- y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
44751
- width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
44752
- height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
44753
- });
44754
- this.tableGroup.border.firstChild?.setAttributes({
44755
- x: this.tableGroup.border.attribute.lineWidth / 2,
44756
- y: this.tableGroup.border.attribute.lineWidth / 2,
44757
- width: this.tableGroup.attribute.width,
44758
- height: this.tableGroup.attribute.height
44759
- });
44708
+ if (this.table.theme.frameStyle?.innerBorder) {
44709
+ this.tableGroup.border.setAttributes({
44710
+ x: this.table.tableX + this.tableGroup.border.attribute.lineWidth / 2,
44711
+ y: this.table.tableY + this.tableGroup.border.attribute.lineWidth / 2,
44712
+ width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
44713
+ height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
44714
+ });
44715
+ this.tableGroup.border.firstChild?.setAttributes({
44716
+ x: 0,
44717
+ y: 0,
44718
+ width: this.tableGroup.attribute.width - this.tableGroup.border.attribute.lineWidth,
44719
+ height: this.tableGroup.attribute.height - this.tableGroup.border.attribute.lineWidth
44720
+ });
44721
+ }
44722
+ else {
44723
+ this.tableGroup.border.setAttributes({
44724
+ x: this.table.tableX - this.tableGroup.border.attribute.lineWidth / 2,
44725
+ y: this.table.tableY - this.tableGroup.border.attribute.lineWidth / 2,
44726
+ width: this.tableGroup.attribute.width + this.tableGroup.border.attribute.lineWidth,
44727
+ height: this.tableGroup.attribute.height + this.tableGroup.border.attribute.lineWidth
44728
+ });
44729
+ this.tableGroup.border.firstChild?.setAttributes({
44730
+ x: this.tableGroup.border.attribute.lineWidth / 2,
44731
+ y: this.tableGroup.border.attribute.lineWidth / 2,
44732
+ width: this.tableGroup.attribute.width,
44733
+ height: this.tableGroup.attribute.height
44734
+ });
44735
+ }
44760
44736
  }
44761
44737
  if (this.table.bottomFrozenRowCount > 0) {
44762
44738
  this.bottomFrozenGroup.setAttribute('y', this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height);
@@ -45130,7 +45106,11 @@
45130
45106
  this.updateTableSize();
45131
45107
  const isListTableWithFrozen = !this.isPivot;
45132
45108
  createFrameBorder(this.bodyGroup, this.table.theme.bodyStyle.frameStyle, this.bodyGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
45133
- createFrameBorder(this.rowHeaderGroup, this.isPivot ? this.table.theme.rowHeaderStyle.frameStyle : this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
45109
+ createFrameBorder(this.rowHeaderGroup, this.isPivot
45110
+ ? this.table.theme.rowHeaderStyle.frameStyle
45111
+ : this.table.internalProps.transpose
45112
+ ? this.table.theme.headerStyle.frameStyle
45113
+ : this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
45134
45114
  createFrameBorder(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
45135
45115
  createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
45136
45116
  createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, undefined);
@@ -46836,7 +46816,15 @@
46836
46816
  this.menu.dropDownMenuHighlight = cells;
46837
46817
  for (let i = 0; i < cells.length; i++) {
46838
46818
  const { col, row } = cells[i];
46839
- this.table.scenegraph.updateCellContent(col, row);
46819
+ const range = this.table.getCellRange(col, row);
46820
+ if (!range) {
46821
+ continue;
46822
+ }
46823
+ for (let col = range.start.col; col <= range.end.col; col++) {
46824
+ for (let row = range.start.row; row <= range.end.row; row++) {
46825
+ this.table.scenegraph.updateCellContent(col, row);
46826
+ }
46827
+ }
46840
46828
  }
46841
46829
  }
46842
46830
  dropDownMenuIsHighlight(colNow, rowNow, index) {
@@ -47267,7 +47255,7 @@
47267
47255
  else {
47268
47256
  const layoutMap = table.internalProps.layoutMap;
47269
47257
  hasSparkLine = layoutMap.columnObjects.some(column => {
47270
- return column.cellType === 'sparkline';
47258
+ return column.cellType === 'sparkline' || typeof column.cellType === 'function';
47271
47259
  });
47272
47260
  }
47273
47261
  if (!hasSparkLine) {
@@ -47289,8 +47277,8 @@
47289
47277
  function getCellEventArgsSet(e) {
47290
47278
  const tableEvent = {
47291
47279
  abstractPos: {
47292
- x: e.viewport.x,
47293
- y: e.viewport.y
47280
+ x: e.x,
47281
+ y: e.y
47294
47282
  }
47295
47283
  };
47296
47284
  const targetCell = getTargetCell(e.target);
@@ -47383,10 +47371,10 @@
47383
47371
  }
47384
47372
  const cellGoup = e.path.find(node => node.role === 'cell');
47385
47373
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
47386
- if (cellGoup?.role === 'cell' &&
47387
- table.stateManager.hover.cellPos.col !== -1 &&
47374
+ if (table.stateManager.hover.cellPos.col !== -1 &&
47388
47375
  table.stateManager.hover.cellPos.row !== -1 &&
47389
- (cellGoup.col !== table.stateManager.hover.cellPos.col || cellGoup.row !== table.stateManager.hover.cellPos.row)) {
47376
+ (cellGoup?.col !== table.stateManager.hover.cellPos.col ||
47377
+ cellGoup?.row !== table.stateManager.hover.cellPos.row)) {
47390
47378
  table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
47391
47379
  col: table.stateManager.hover.cellPos.col,
47392
47380
  row: table.stateManager.hover.cellPos.row,
@@ -47488,6 +47476,21 @@
47488
47476
  stateManager.updateInteractionState(InteractionState.default);
47489
47477
  stateManager.updateCursor();
47490
47478
  }
47479
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
47480
+ if (table.stateManager.hover.cellPos.col !== -1 && table.stateManager.hover.cellPos.row !== -1) {
47481
+ table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
47482
+ col: table.stateManager.hover.cellPos.col,
47483
+ row: table.stateManager.hover.cellPos.row,
47484
+ cellRange: table.getCellRangeRelativeRect({
47485
+ col: table.stateManager.hover.cellPos.col,
47486
+ row: table.stateManager.hover.cellPos.row
47487
+ }),
47488
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
47489
+ event: e.nativeEvent,
47490
+ target: undefined
47491
+ });
47492
+ }
47493
+ }
47491
47494
  eventManager.dealTableHover();
47492
47495
  const target = e.target;
47493
47496
  if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
@@ -47817,15 +47820,15 @@
47817
47820
  };
47818
47821
  if (table.isHeader(col, row)) {
47819
47822
  table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked);
47820
- const define = table.getBodyColumnDefine(col, row);
47821
- if (define.cellType === 'checkbox') {
47823
+ const cellType = table.getCellType(col, row);
47824
+ if (cellType === 'checkbox') {
47822
47825
  table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
47823
47826
  }
47824
47827
  }
47825
47828
  else {
47826
47829
  table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked);
47827
- const define = table.getBodyColumnDefine(col, row);
47828
- if (define.headerType === 'checkbox') {
47830
+ const cellType = table.getCellType(col, row);
47831
+ if (cellType === 'checkbox') {
47829
47832
  const oldHeaderCheckedState = table.stateManager.headerCheckedState[cellInfo.field];
47830
47833
  const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(cellInfo.field);
47831
47834
  if (oldHeaderCheckedState !== newHeaderCheckedState) {
@@ -48237,14 +48240,12 @@
48237
48240
  e.preventDefault();
48238
48241
  }
48239
48242
  });
48240
- if (!table.options.canvas) {
48241
- handler.on(table.getContainer(), 'resize', e => {
48242
- if (e.width === 0 && e.height === 0) {
48243
- return;
48244
- }
48245
- table.resize();
48246
- });
48247
- }
48243
+ handler.on(table.getContainer(), 'resize', e => {
48244
+ if (e.width === 0 && e.height === 0) {
48245
+ return;
48246
+ }
48247
+ table.resize();
48248
+ });
48248
48249
  }
48249
48250
 
48250
48251
  function bindTouchListener(eventManager) {
@@ -48500,7 +48501,7 @@
48500
48501
  isDraging = false;
48501
48502
  constructor(table) {
48502
48503
  this.table = table;
48503
- if (Env.mode === 'node' || table.options.disableInteraction) {
48504
+ if (Env.mode === 'node') {
48504
48505
  return;
48505
48506
  }
48506
48507
  this.bindOuterEvent();
@@ -49004,6 +49005,7 @@
49004
49005
  case 'checkbox':
49005
49006
  return CheckboxStyle$1;
49006
49007
  }
49008
+ return TextStyle;
49007
49009
  }
49008
49010
  getCellIconFromRecordValue(icon, col, row) {
49009
49011
  if (Array.isArray(icon)) {
@@ -51812,7 +51814,7 @@
51812
51814
  return TABLE_EVENT_TYPE;
51813
51815
  }
51814
51816
  options;
51815
- version = "0.19.2-alpha.1";
51817
+ version = "0.19.2-alpha.3";
51816
51818
  pagination;
51817
51819
  id = `VTable${Date.now()}`;
51818
51820
  headerStyleCache;
@@ -51823,7 +51825,7 @@
51823
51825
  _chartEventMap = {};
51824
51826
  constructor(container, options = {}) {
51825
51827
  super();
51826
- if (!container && options.mode !== 'node' && !options.canvas) {
51828
+ if (!container && options.mode !== 'node') {
51827
51829
  throw new Error("vtable's container is undefined");
51828
51830
  }
51829
51831
  const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, keyboardOptions, eventOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
@@ -51859,14 +51861,7 @@
51859
51861
  if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
51860
51862
  this.showFrozenIcon = false;
51861
51863
  }
51862
- if (this.options.canvas) {
51863
- internalProps.element = this.options.canvas.parentElement;
51864
- internalProps.element.style.position = 'relative';
51865
- internalProps.focusControl = new FocusInput(this, internalProps.element);
51866
- internalProps.canvas = this.options.canvas;
51867
- internalProps.context = internalProps.canvas.getContext('2d');
51868
- }
51869
- else if (Env.mode !== 'node') {
51864
+ if (Env.mode !== 'node') {
51870
51865
  internalProps.element = createRootElement(this.padding);
51871
51866
  internalProps.focusControl = new FocusInput(this, internalProps.element);
51872
51867
  internalProps.canvas = document.createElement('canvas');
@@ -52202,21 +52197,7 @@
52202
52197
  const { padding } = this;
52203
52198
  let widthP = 0;
52204
52199
  let heightP = 0;
52205
- this.tableX = 0;
52206
- this.tableY = 0;
52207
- if (this.options.canvas && this.options.viewBox) {
52208
- widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
52209
- heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
52210
- if (this?.scenegraph?.stage) {
52211
- if (this.options.viewBox) {
52212
- this.scenegraph.stage.setViewBox(this.options.viewBox, false);
52213
- }
52214
- else {
52215
- this.scenegraph.stage.resize(widthP, heightP);
52216
- }
52217
- }
52218
- }
52219
- else if (Env.mode === 'browser') {
52200
+ if (Env.mode === 'browser') {
52220
52201
  const element = this.getElement();
52221
52202
  const width1 = element.parentElement?.offsetWidth ?? 1 - 1;
52222
52203
  const height1 = element.parentElement?.offsetHeight ?? 1 - 1;
@@ -52246,36 +52227,22 @@
52246
52227
  if (this.internalProps.theme?.frameStyle) {
52247
52228
  const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
52248
52229
  const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
52249
- this.tableX += (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
52250
- this.tableY += (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
52251
- this.tableNoFrameWidth =
52252
- width - ((lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0)) - ((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
52253
- this.tableNoFrameHeight =
52254
- height - ((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0)) - ((lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0));
52255
- }
52256
- else {
52257
- this.tableX += 0;
52258
- this.tableY += 0;
52259
- this.tableNoFrameWidth = width;
52260
- this.tableNoFrameHeight = height;
52261
- }
52262
- }
52263
- updateViewBox(newViewBox) {
52264
- const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
52265
- const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
52266
- const newWidth = newViewBox.x2 - newViewBox.x1;
52267
- const newHeight = newViewBox.y2 - newViewBox.y1;
52268
- this.options.viewBox = newViewBox;
52269
- if (oldWidth !== newWidth || oldHeight !== newHeight) {
52270
- this.resize();
52271
- }
52272
- else {
52273
- this.scenegraph.stage.setViewBox(this.options.viewBox, true);
52230
+ if (this.theme.frameStyle?.innerBorder) {
52231
+ this.tableX = 0;
52232
+ this.tableY = 0;
52233
+ this.tableNoFrameWidth = width - (shadowWidths[1] ?? 0);
52234
+ this.tableNoFrameHeight = height - (shadowWidths[2] ?? 0);
52235
+ }
52236
+ else {
52237
+ this.tableX = (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
52238
+ this.tableY = (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
52239
+ this.tableNoFrameWidth =
52240
+ width - ((lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0)) - ((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
52241
+ this.tableNoFrameHeight =
52242
+ height - ((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0)) - ((lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0));
52243
+ }
52274
52244
  }
52275
52245
  }
52276
- setViewBoxTransform(a, b, c, d, e, f) {
52277
- this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
52278
- }
52279
52246
  get rowHierarchyType() {
52280
52247
  return 'grid';
52281
52248
  }
@@ -52770,8 +52737,6 @@
52770
52737
  const visibleRect = this.getVisibleRect();
52771
52738
  rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
52772
52739
  rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
52773
- rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
52774
- rect.offsetTop(this.options.viewBox?.y1 ?? 0);
52775
52740
  return rect;
52776
52741
  }
52777
52742
  getVisibleRect() {
@@ -52926,7 +52891,7 @@
52926
52891
  this.scenegraph.stage.release();
52927
52892
  this.scenegraph.proxy.release();
52928
52893
  const { parentElement } = internalProps.element;
52929
- if (parentElement && !this.options.canvas) {
52894
+ if (parentElement) {
52930
52895
  parentElement.removeChild(internalProps.element);
52931
52896
  }
52932
52897
  this.isReleased = true;
@@ -53099,8 +53064,8 @@
53099
53064
  const currentHeight = rect.height;
53100
53065
  const originHeight = this.canvas.offsetHeight || currentHeight;
53101
53066
  const heightRatio = currentHeight / originHeight;
53102
- const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0) - (this.options.viewBox?.x1 ?? 0);
53103
- const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0) - (this.options.viewBox?.y1 ?? 0);
53067
+ const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
53068
+ const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
53104
53069
  return { x, y, inTable };
53105
53070
  }
53106
53071
  getTheme() {
@@ -53404,7 +53369,7 @@
53404
53369
  return customMerge.range;
53405
53370
  }
53406
53371
  }
53407
- return this.internalProps.layoutMap.getCellRange(col, row);
53372
+ return this.internalProps.layoutMap?.getCellRange(col, row);
53408
53373
  }
53409
53374
  hasCustomMerge() {
53410
53375
  return !!this.internalProps.customMergeCell;
@@ -53497,7 +53462,7 @@
53497
53462
  field: this.getHeaderField(col, row),
53498
53463
  cellHeaderPaths: this.internalProps.layoutMap.getCellHeaderPaths(col, row),
53499
53464
  title: colDef?.title,
53500
- cellType: colDef?.cellType ? (typeof colDef.cellType === 'string' ? colDef.cellType : 'progressbar') : 'text',
53465
+ cellType: this.getCellType(col, row),
53501
53466
  originData: this.getCellOriginRecord(col, row),
53502
53467
  cellRange: this.getCellRangeRelativeRect({ col, row }),
53503
53468
  value: this.getCellValue(col, row),
@@ -53584,15 +53549,24 @@
53584
53549
  }, styleClass, this.options.autoWrapText);
53585
53550
  }
53586
53551
  else {
53552
+ let defaultStyle;
53553
+ if (layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)) {
53554
+ defaultStyle = this.theme.headerStyle;
53555
+ }
53556
+ else if (this.internalProps.transpose && layoutMap.isRowHeader(col, row)) {
53557
+ defaultStyle = this.theme.headerStyle;
53558
+ }
53559
+ else if (layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)) {
53560
+ defaultStyle = this.theme.rowHeaderStyle;
53561
+ }
53562
+ else {
53563
+ defaultStyle = this.theme.cornerHeaderStyle;
53564
+ }
53587
53565
  const style = hd?.style || {};
53588
53566
  if (paddingForAxis) {
53589
53567
  style.padding = paddingForAxis;
53590
53568
  }
53591
- cacheStyle = of$1(style, layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row)
53592
- ? this.theme.headerStyle
53593
- : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row)
53594
- ? this.theme.rowHeaderStyle
53595
- : this.theme.cornerHeaderStyle, {
53569
+ cacheStyle = of$1(style, defaultStyle, {
53596
53570
  col,
53597
53571
  row,
53598
53572
  table: this,
@@ -53605,12 +53579,13 @@
53605
53579
  return cacheStyle;
53606
53580
  }
53607
53581
  let cacheKey;
53582
+ const cellType = this.getCellType(col, row);
53608
53583
  if ((this.isListTable() && !this.transpose) ||
53609
53584
  (this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol)) {
53610
- cacheKey = col;
53585
+ cacheKey = col + cellType;
53611
53586
  }
53612
53587
  else {
53613
- cacheKey = row;
53588
+ cacheKey = row + cellType;
53614
53589
  }
53615
53590
  let cacheStyle;
53616
53591
  if (layoutMap.isBottomFrozenRow(row)) {
@@ -53623,7 +53598,7 @@
53623
53598
  return cacheStyle;
53624
53599
  }
53625
53600
  const column = layoutMap.getBody(col, row);
53626
- const styleClass = this.internalProps.bodyHelper.getStyleClass(column.cellType);
53601
+ const styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row));
53627
53602
  const style = column?.style;
53628
53603
  cacheStyle = of$2(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle
53629
53604
  ? this.theme.bottomFrozenStyle
@@ -56665,7 +56640,7 @@
56665
56640
  getCellCheckboxState(col, row) {
56666
56641
  const define = this.getBodyColumnDefine(col, row);
56667
56642
  const field = define?.field;
56668
- const cellType = define?.cellType;
56643
+ const cellType = this.getCellType(col, row);
56669
56644
  if (isValid$1(field) && cellType === 'checkbox') {
56670
56645
  const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
56671
56646
  return this.stateManager.checkedState[dataIndex][field];
@@ -62583,14 +62558,6 @@
62583
62558
  updateChartData(this.scenegraph);
62584
62559
  this.render();
62585
62560
  }
62586
- clearChartCacheImage(col, row) {
62587
- if (isNumber$2(col) && isNumber$2(row)) {
62588
- clearCellChartCacheImage(col, row, this.scenegraph);
62589
- }
62590
- else {
62591
- clearChartCacheImage(this.scenegraph);
62592
- }
62593
- }
62594
62561
  getLegendSelected() {
62595
62562
  return this.internalProps.legends.legendComponent._getSelectedLegends().map((d) => d.label);
62596
62563
  }
@@ -63287,7 +63254,7 @@
63287
63254
  }
63288
63255
 
63289
63256
  registerForVrender();
63290
- const version = "0.19.2-alpha.1";
63257
+ const version = "0.19.2-alpha.3";
63291
63258
  function getIcons() {
63292
63259
  return get$1();
63293
63260
  }