k-vtable 1.0.37 → 1.0.38

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 (171) hide show
  1. package/cjs/ListTable.d.ts +2 -1
  2. package/cjs/ListTable.js +31 -10
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/body-helper/body-helper.d.ts +1 -0
  5. package/cjs/body-helper/body-helper.js +4 -3
  6. package/cjs/body-helper/body-helper.js.map +1 -1
  7. package/cjs/body-helper/style.js +2 -1
  8. package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  9. package/cjs/core/BaseTable.d.ts +1 -0
  10. package/cjs/core/BaseTable.js +28 -22
  11. package/cjs/core/BaseTable.js.map +1 -1
  12. package/cjs/core/row-series-number-helper.d.ts +1 -0
  13. package/cjs/core/row-series-number-helper.js +3 -1
  14. package/cjs/core/row-series-number-helper.js.map +1 -1
  15. package/cjs/data/CachedDataSource.js +5 -3
  16. package/cjs/data/CachedDataSource.js.map +1 -1
  17. package/cjs/data/DataSource.js +1 -2
  18. package/cjs/dataset/DataStatistics.js +2 -1
  19. package/cjs/header-helper/header-helper.d.ts +1 -0
  20. package/cjs/header-helper/header-helper.js +4 -3
  21. package/cjs/header-helper/header-helper.js.map +1 -1
  22. package/cjs/header-helper/style.js +2 -1
  23. package/cjs/index.d.ts +1 -1
  24. package/cjs/index.js +1 -1
  25. package/cjs/index.js.map +1 -1
  26. package/cjs/plugins/custom-cell-style.js +1 -1
  27. package/cjs/scenegraph/animation/appear.js +18 -3
  28. package/cjs/scenegraph/animation/appear.js.map +1 -1
  29. package/cjs/scenegraph/component/custom.js +3 -3
  30. package/cjs/scenegraph/component/custom.js.map +1 -1
  31. package/cjs/scenegraph/component/menu.js +4 -4
  32. package/cjs/scenegraph/component/menu.js.map +1 -1
  33. package/cjs/scenegraph/graphic/chart.d.ts +6 -1
  34. package/cjs/scenegraph/graphic/chart.js +38 -4
  35. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  36. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  37. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  38. package/cjs/scenegraph/graphic/group.d.ts +3 -1
  39. package/cjs/scenegraph/graphic/group.js +21 -3
  40. package/cjs/scenegraph/graphic/group.js.map +1 -1
  41. package/cjs/scenegraph/group-creater/cell-helper.js +4 -3
  42. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  44. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  46. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  47. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  48. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  49. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  50. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  51. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  52. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  53. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  54. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  55. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  56. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -6
  58. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +101 -12
  60. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/column-helper.js +4 -3
  62. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  63. package/cjs/scenegraph/layout/update-row.js +3 -3
  64. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  65. package/cjs/scenegraph/runtime-contributions.d.ts +2 -0
  66. package/cjs/scenegraph/runtime-contributions.js +28 -0
  67. package/cjs/scenegraph/runtime-contributions.js.map +1 -0
  68. package/cjs/scenegraph/scenegraph.d.ts +4 -1
  69. package/cjs/scenegraph/scenegraph.js +40 -16
  70. package/cjs/scenegraph/scenegraph.js.map +1 -1
  71. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -0
  72. package/cjs/scenegraph/utils/text-icon-layout.js +23 -6
  73. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  74. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  75. package/cjs/ts-types/base-table.d.ts +7 -1
  76. package/cjs/ts-types/base-table.js.map +1 -1
  77. package/cjs/ts-types/table-engine.d.ts +1 -1
  78. package/cjs/ts-types/table-engine.js.map +1 -1
  79. package/cjs/vrender-app.d.ts +20 -0
  80. package/cjs/vrender-app.js +141 -0
  81. package/cjs/vrender-app.js.map +1 -0
  82. package/cjs/vrender.d.ts +17 -1
  83. package/cjs/vrender.js +36 -15
  84. package/cjs/vrender.js.map +1 -1
  85. package/dist/vtable.js +106132 -96965
  86. package/dist/vtable.min.js +1 -1
  87. package/es/ListTable.d.ts +2 -1
  88. package/es/ListTable.js +30 -9
  89. package/es/ListTable.js.map +1 -1
  90. package/es/body-helper/body-helper.d.ts +1 -0
  91. package/es/body-helper/body-helper.js +4 -3
  92. package/es/body-helper/body-helper.js.map +1 -1
  93. package/es/body-helper/style.js +2 -1
  94. package/es/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  95. package/es/core/BaseTable.d.ts +1 -0
  96. package/es/core/BaseTable.js +30 -24
  97. package/es/core/BaseTable.js.map +1 -1
  98. package/es/core/row-series-number-helper.d.ts +1 -0
  99. package/es/core/row-series-number-helper.js +3 -1
  100. package/es/core/row-series-number-helper.js.map +1 -1
  101. package/es/data/CachedDataSource.js +5 -3
  102. package/es/data/CachedDataSource.js.map +1 -1
  103. package/es/data/DataSource.js +1 -2
  104. package/es/dataset/DataStatistics.js +2 -1
  105. package/es/header-helper/header-helper.d.ts +1 -0
  106. package/es/header-helper/header-helper.js +4 -3
  107. package/es/header-helper/header-helper.js.map +1 -1
  108. package/es/header-helper/style.js +2 -1
  109. package/es/index.d.ts +1 -1
  110. package/es/index.js +1 -1
  111. package/es/index.js.map +1 -1
  112. package/es/plugins/custom-cell-style.js +1 -1
  113. package/es/scenegraph/animation/appear.js +18 -3
  114. package/es/scenegraph/animation/appear.js.map +1 -1
  115. package/es/scenegraph/component/custom.js +3 -3
  116. package/es/scenegraph/component/custom.js.map +1 -1
  117. package/es/scenegraph/component/menu.js +4 -4
  118. package/es/scenegraph/component/menu.js.map +1 -1
  119. package/es/scenegraph/graphic/chart.d.ts +6 -1
  120. package/es/scenegraph/graphic/chart.js +39 -3
  121. package/es/scenegraph/graphic/chart.js.map +1 -1
  122. package/es/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  123. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  124. package/es/scenegraph/graphic/group.d.ts +3 -1
  125. package/es/scenegraph/graphic/group.js +21 -3
  126. package/es/scenegraph/graphic/group.js.map +1 -1
  127. package/es/scenegraph/group-creater/cell-helper.js +4 -3
  128. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  129. package/es/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  130. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  131. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  132. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  133. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  134. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  135. package/es/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  136. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  137. package/es/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  138. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  139. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  140. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  141. package/es/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  142. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  143. package/es/scenegraph/group-creater/cell-type/text-cell.js +5 -5
  144. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  145. package/es/scenegraph/group-creater/cell-type/video-cell.js +99 -12
  146. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  147. package/es/scenegraph/group-creater/column-helper.js +4 -3
  148. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  149. package/es/scenegraph/layout/update-row.js +3 -3
  150. package/es/scenegraph/layout/update-row.js.map +1 -1
  151. package/es/scenegraph/runtime-contributions.d.ts +2 -0
  152. package/es/scenegraph/runtime-contributions.js +20 -0
  153. package/es/scenegraph/runtime-contributions.js.map +1 -0
  154. package/es/scenegraph/scenegraph.d.ts +4 -1
  155. package/es/scenegraph/scenegraph.js +42 -16
  156. package/es/scenegraph/scenegraph.js.map +1 -1
  157. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -0
  158. package/es/scenegraph/utils/text-icon-layout.js +18 -2
  159. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  160. package/es/scenegraph/utils/text-measure.js.map +1 -1
  161. package/es/ts-types/base-table.d.ts +7 -1
  162. package/es/ts-types/base-table.js.map +1 -1
  163. package/es/ts-types/table-engine.d.ts +1 -1
  164. package/es/ts-types/table-engine.js.map +1 -1
  165. package/es/vrender-app.d.ts +20 -0
  166. package/es/vrender-app.js +161 -0
  167. package/es/vrender-app.js.map +1 -0
  168. package/es/vrender.d.ts +17 -1
  169. package/es/vrender.js +27 -8
  170. package/es/vrender.js.map +1 -1
  171. package/package.json +11 -10
@@ -1,4 +1,6 @@
1
- import { createStage, container, vglobal, registerForVrender } from "./../vrender";
1
+ import { setPoptipTheme, registerForVrender } from "./../vrender";
2
+
3
+ import { createStageFromVRenderApp } from "../vrender-app";
2
4
 
3
5
  import { InternalIconName } from "../ts-types";
4
6
 
@@ -16,8 +18,6 @@ import { getQuadProps } from "./utils/padding";
16
18
 
17
19
  import { createFrameBorder, updateCornerRadius, updateFrameBorder, updateFrameBorderSize } from "./style/frame-border";
18
20
 
19
- import splitModule from "./graphic/contributions";
20
-
21
21
  import { getProp } from "./utils/get-prop";
22
22
 
23
23
  import { dealWithIcon } from "./utils/text-icon-layout";
@@ -54,9 +54,7 @@ import { initSceneGraph } from "./group-creater/init-scenegraph";
54
54
 
55
55
  import { updateContainerChildrenX, updateContainerChildrenY } from "./utils/update-container";
56
56
 
57
- import { setPoptipTheme } from "./../vrender";
58
-
59
- import textMeasureModule from "./utils/text-measure";
57
+ import { installVTableRuntimeContributions } from "./runtime-contributions";
60
58
 
61
59
  import { getIconByXY, hideClickIcon, hideHoverIcon, resetResidentHoverIcon, residentHoverIcon, setIconHoverStyle, setIconNormalStyle, showClickIcon, showHoverIcon, updateFrozenIcon, updateHierarchyIcon, updateSortIcon } from "./icon/icon-update";
62
60
 
@@ -82,22 +80,25 @@ import { getCellEventArgsSet } from "../event/util";
82
80
 
83
81
  import { clearAndReleaseBrushingChartInstance, getBrushingChartInstance, getBrushingChartInstanceCellPos } from "./graphic/active-cell-chart-list";
84
82
 
85
- registerForVrender(), container.load(splitModule), container.load(textMeasureModule);
83
+ registerForVrender(), installVTableRuntimeContributions();
86
84
 
87
85
  export class Scenegraph {
88
86
  constructor(table) {
87
+ var _a, _b;
89
88
  let width, height;
90
- this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0,
91
- this.mergeMap = new Map, this.brushingChartInstance = void 0, this.brushingChartInstanceCellPos = {
89
+ this.stageOwned = !0, this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1,
90
+ this.clear = !0, this.mergeMap = new Map, this.brushingChartInstance = void 0, this.brushingChartInstanceCellPos = {
92
91
  col: -1,
93
92
  row: -1
94
93
  }, this.chartInstanceListColumnByColumnDirection = {}, this.chartInstanceListRowByRowDirection = {},
95
94
  this.delayRunDimensionHoverTimerForColumnDirection = [], this.delayRunDimensionHoverTimerForRowDirection = [],
96
95
  this.delayRunDimensionHoverTimerForViewRange = [], this.disabledTooltipToAllChartInstances = !1,
97
- setPoptipTheme(this.table.theme.textPopTipStyle), "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams),
98
- width = table.canvasWidth, height = table.canvasHeight) : table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"),
99
- width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : (vglobal.setEnv("browser"),
100
- width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
96
+ setPoptipTheme(this.table.theme.textPopTipStyle);
97
+ const mode = null !== (_a = table.options.mode) && void 0 !== _a ? _a : "node" === Env.mode ? "node" : "browser";
98
+ "node" === mode ? (width = table.canvasWidth, height = table.canvasHeight) : table.options.canvas && table.options.viewBox ? (width = table.options.viewBox.x2 - table.options.viewBox.x1,
99
+ height = table.options.viewBox.y2 - table.options.viewBox.y1) : (width = table.canvas.width,
100
+ height = table.canvas.height);
101
+ const {stage: stage, releaseAppRef: releaseAppRef, stageOwned: stageOwned} = createStageFromVRenderApp(Object.assign({
101
102
  canvas: table.canvas,
102
103
  width: width,
103
104
  height: height,
@@ -112,8 +113,19 @@ export class Scenegraph {
112
113
  this.table.options.afterRender && this.table.options.afterRender(stage), this.table.fireListeners("after_render", null);
113
114
  },
114
115
  canvasControled: !table.options.canvas,
115
- viewBox: table.options.viewBox
116
- }, table.options.renderOption)), this.stage.defaultLayer.setTheme({
116
+ viewBox: table.options.viewBox,
117
+ context: {
118
+ appName: "vtable"
119
+ }
120
+ }, table.options.renderOption), {
121
+ mode: mode,
122
+ scope: null !== (_b = table.options.vRenderAppScope) && void 0 !== _b ? _b : "vtable",
123
+ app: table.options.vRenderApp,
124
+ stage: table.options.stage,
125
+ envParams: table.options.modeParams
126
+ });
127
+ this.stage = stage, this.stageOwned = stageOwned, this.releaseVRenderAppRef = releaseAppRef,
128
+ this.stage.defaultLayer.setTheme({
117
129
  group: {
118
130
  boundsPadding: 0,
119
131
  strokeBoundsBuffer: 0,
@@ -296,6 +308,20 @@ export class Scenegraph {
296
308
  delete this.tableGroup.border), null === (_u = this.proxy) || void 0 === _u || _u.release(),
297
309
  null === (_v = this.table.reactCustomLayout) || void 0 === _v || _v.clearCache();
298
310
  }
311
+ releaseStage() {
312
+ var _a, _b, _c;
313
+ const releaseAppRef = this.releaseVRenderAppRef;
314
+ this.releaseVRenderAppRef = void 0;
315
+ try {
316
+ if (this.stageOwned) null === (_a = this.stage) || void 0 === _a || _a.release(); else {
317
+ const tableGroup = this.tableGroup, tableGroupParent = null == tableGroup ? void 0 : tableGroup.parent;
318
+ null === (_b = null == tableGroupParent ? void 0 : tableGroupParent.removeChild) || void 0 === _b || _b.call(tableGroupParent, tableGroup),
319
+ null === (_c = null == tableGroup ? void 0 : tableGroup.release) || void 0 === _c || _c.call(tableGroup, !0);
320
+ }
321
+ } finally {
322
+ null == releaseAppRef || releaseAppRef();
323
+ }
324
+ }
299
325
  updateStageBackground() {
300
326
  this.stage.background = this.table.theme.underlayBackgroundColor, this.stage.renderNextFrame();
301
327
  }
@@ -1154,7 +1180,7 @@ export class Scenegraph {
1154
1180
  return col < this.table.rowHeaderLevelCount ? this.table.getColsWidth(0, col - 1) : col < this.table.colCount - this.table.rightFrozenColCount ? this.table.getColsWidth(this.table.rowHeaderLevelCount, col - 1) : col < this.table.colCount ? this.table.getColsWidth(this.table.colCount - this.table.bottomFrozenRowCount, col - 1) : 0;
1155
1181
  }
1156
1182
  getCellGroupY(row) {
1157
- return row < this.table.frozenRowCount ? this.table.getRowsHeight(0, row - 1) : row < this.table.rowCount - this.table.bottomFrozenRowCount ? this.table.getRowsHeight(this.table.columnHeaderLevelCount, row - 1) : row < this.table.rowCount ? this.table.getRowsHeight(this.table.rowCount - this.table.bottomFrozenRowCount, row - 1) : 0;
1183
+ return row < this.table.frozenRowCount ? this.table.getRowsHeight(0, row - 1) : row < this.table.rowCount - this.table.bottomFrozenRowCount ? this.table.getRowsHeight(this.table.frozenRowCount, row - 1) : row < this.table.rowCount ? this.table.getRowsHeight(this.table.rowCount - this.table.bottomFrozenRowCount, row - 1) : 0;
1158
1184
  }
1159
1185
  getCellGroupX(col) {
1160
1186
  return col < this.table.rowHeaderLevelCount ? this.table.getColsWidth(0, col - 1) : col < this.table.colCount - this.table.rightFrozenColCount ? this.table.getColsWidth(this.table.rowHeaderLevelCount, col - 1) : col < this.table.colCount ? this.table.getColsWidth(this.table.colCount - this.table.rightFrozenColCount, col - 1) : 0;