k-vtable 1.0.36 → 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 (225) hide show
  1. package/cjs/ListTable.d.ts +3 -1
  2. package/cjs/ListTable.js +35 -4
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotTable.js +12 -6
  5. package/cjs/PivotTable.js.map +1 -1
  6. package/cjs/body-helper/body-helper.d.ts +1 -0
  7. package/cjs/body-helper/body-helper.js +4 -3
  8. package/cjs/body-helper/body-helper.js.map +1 -1
  9. package/cjs/body-helper/style.js +2 -1
  10. package/cjs/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  11. package/cjs/core/BaseTable.d.ts +1 -0
  12. package/cjs/core/BaseTable.js +36 -28
  13. package/cjs/core/BaseTable.js.map +1 -1
  14. package/cjs/core/row-series-number-helper.d.ts +1 -0
  15. package/cjs/core/row-series-number-helper.js +3 -1
  16. package/cjs/core/row-series-number-helper.js.map +1 -1
  17. package/cjs/data/CachedDataSource.js +5 -3
  18. package/cjs/data/CachedDataSource.js.map +1 -1
  19. package/cjs/data/DataSource.js +1 -2
  20. package/cjs/dataset/DataStatistics.js +2 -1
  21. package/cjs/event/event.js +3 -1
  22. package/cjs/event/event.js.map +1 -1
  23. package/cjs/event/listener/table-group.js +52 -52
  24. package/cjs/event/listener/table-group.js.map +1 -1
  25. package/cjs/header-helper/header-helper.d.ts +1 -0
  26. package/cjs/header-helper/header-helper.js +4 -3
  27. package/cjs/header-helper/header-helper.js.map +1 -1
  28. package/cjs/header-helper/style.js +2 -1
  29. package/cjs/index.d.ts +1 -1
  30. package/cjs/index.js +1 -1
  31. package/cjs/index.js.map +1 -1
  32. package/cjs/layout/pivot-header-layout.d.ts +2 -2
  33. package/cjs/layout/simple-header-layout.js +7 -7
  34. package/cjs/layout/simple-header-layout.js.map +1 -1
  35. package/cjs/plugins/custom-cell-style.js +1 -1
  36. package/cjs/plugins/list-tree-stick-cell.js +29 -3
  37. package/cjs/plugins/list-tree-stick-cell.js.map +1 -1
  38. package/cjs/scenegraph/animation/appear.js +18 -3
  39. package/cjs/scenegraph/animation/appear.js.map +1 -1
  40. package/cjs/scenegraph/component/custom.js +5 -5
  41. package/cjs/scenegraph/component/custom.js.map +1 -1
  42. package/cjs/scenegraph/component/menu.js +4 -4
  43. package/cjs/scenegraph/component/menu.js.map +1 -1
  44. package/cjs/scenegraph/component/table-component.js +41 -50
  45. package/cjs/scenegraph/component/table-component.js.map +1 -1
  46. package/cjs/scenegraph/component/util.d.ts +1 -0
  47. package/cjs/scenegraph/component/util.js +9 -3
  48. package/cjs/scenegraph/component/util.js.map +1 -1
  49. package/cjs/scenegraph/graphic/chart.d.ts +6 -1
  50. package/cjs/scenegraph/graphic/chart.js +38 -4
  51. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  52. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  53. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  54. package/cjs/scenegraph/graphic/group.d.ts +3 -1
  55. package/cjs/scenegraph/graphic/group.js +21 -3
  56. package/cjs/scenegraph/graphic/group.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/cell-helper.js +4 -3
  58. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  60. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  62. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  63. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  64. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  66. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  67. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  68. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  69. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  70. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  71. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  72. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  73. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -6
  74. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  75. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +101 -12
  76. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  77. package/cjs/scenegraph/group-creater/column-helper.js +4 -3
  78. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  79. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  80. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  81. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  82. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  83. package/cjs/scenegraph/layout/frozen.js +7 -3
  84. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  85. package/cjs/scenegraph/layout/update-row.js +3 -3
  86. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  87. package/cjs/scenegraph/runtime-contributions.d.ts +2 -0
  88. package/cjs/scenegraph/runtime-contributions.js +28 -0
  89. package/cjs/scenegraph/runtime-contributions.js.map +1 -0
  90. package/cjs/scenegraph/scenegraph.d.ts +4 -1
  91. package/cjs/scenegraph/scenegraph.js +45 -19
  92. package/cjs/scenegraph/scenegraph.js.map +1 -1
  93. package/cjs/scenegraph/utils/padding.d.ts +5 -2
  94. package/cjs/scenegraph/utils/padding.js +16 -13
  95. package/cjs/scenegraph/utils/padding.js.map +1 -1
  96. package/cjs/scenegraph/utils/text-icon-layout.d.ts +4 -0
  97. package/cjs/scenegraph/utils/text-icon-layout.js +23 -6
  98. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  99. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  100. package/cjs/state/state.js +15 -15
  101. package/cjs/state/state.js.map +1 -1
  102. package/cjs/ts-types/base-table.d.ts +7 -1
  103. package/cjs/ts-types/base-table.js.map +1 -1
  104. package/cjs/ts-types/table-engine.d.ts +1 -1
  105. package/cjs/ts-types/table-engine.js.map +1 -1
  106. package/cjs/vrender-app.d.ts +20 -0
  107. package/cjs/vrender-app.js +141 -0
  108. package/cjs/vrender-app.js.map +1 -0
  109. package/cjs/vrender.d.ts +17 -1
  110. package/cjs/vrender.js +36 -15
  111. package/cjs/vrender.js.map +1 -1
  112. package/dist/vtable.js +106132 -96834
  113. package/dist/vtable.min.js +1 -1
  114. package/es/ListTable.d.ts +3 -1
  115. package/es/ListTable.js +34 -3
  116. package/es/ListTable.js.map +1 -1
  117. package/es/PivotTable.js +12 -6
  118. package/es/PivotTable.js.map +1 -1
  119. package/es/body-helper/body-helper.d.ts +1 -0
  120. package/es/body-helper/body-helper.js +4 -3
  121. package/es/body-helper/body-helper.js.map +1 -1
  122. package/es/body-helper/style.js +2 -1
  123. package/es/components/legend/discrete-legend/discrete-legend.d.ts +1 -1
  124. package/es/core/BaseTable.d.ts +1 -0
  125. package/es/core/BaseTable.js +38 -30
  126. package/es/core/BaseTable.js.map +1 -1
  127. package/es/core/row-series-number-helper.d.ts +1 -0
  128. package/es/core/row-series-number-helper.js +3 -1
  129. package/es/core/row-series-number-helper.js.map +1 -1
  130. package/es/data/CachedDataSource.js +5 -3
  131. package/es/data/CachedDataSource.js.map +1 -1
  132. package/es/data/DataSource.js +1 -2
  133. package/es/dataset/DataStatistics.js +2 -1
  134. package/es/event/event.js +3 -1
  135. package/es/event/event.js.map +1 -1
  136. package/es/event/listener/table-group.js +52 -52
  137. package/es/event/listener/table-group.js.map +1 -1
  138. package/es/header-helper/header-helper.d.ts +1 -0
  139. package/es/header-helper/header-helper.js +4 -3
  140. package/es/header-helper/header-helper.js.map +1 -1
  141. package/es/header-helper/style.js +2 -1
  142. package/es/index.d.ts +1 -1
  143. package/es/index.js +1 -1
  144. package/es/index.js.map +1 -1
  145. package/es/layout/pivot-header-layout.d.ts +2 -2
  146. package/es/layout/simple-header-layout.js +7 -7
  147. package/es/layout/simple-header-layout.js.map +1 -1
  148. package/es/plugins/custom-cell-style.js +1 -1
  149. package/es/plugins/list-tree-stick-cell.js +32 -2
  150. package/es/plugins/list-tree-stick-cell.js.map +1 -1
  151. package/es/scenegraph/animation/appear.js +18 -3
  152. package/es/scenegraph/animation/appear.js.map +1 -1
  153. package/es/scenegraph/component/custom.js +5 -5
  154. package/es/scenegraph/component/custom.js.map +1 -1
  155. package/es/scenegraph/component/menu.js +4 -4
  156. package/es/scenegraph/component/menu.js.map +1 -1
  157. package/es/scenegraph/component/table-component.js +41 -51
  158. package/es/scenegraph/component/table-component.js.map +1 -1
  159. package/es/scenegraph/component/util.d.ts +1 -0
  160. package/es/scenegraph/component/util.js +6 -0
  161. package/es/scenegraph/component/util.js.map +1 -1
  162. package/es/scenegraph/graphic/chart.d.ts +6 -1
  163. package/es/scenegraph/graphic/chart.js +39 -3
  164. package/es/scenegraph/graphic/chart.js.map +1 -1
  165. package/es/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
  166. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  167. package/es/scenegraph/graphic/group.d.ts +3 -1
  168. package/es/scenegraph/graphic/group.js +21 -3
  169. package/es/scenegraph/graphic/group.js.map +1 -1
  170. package/es/scenegraph/group-creater/cell-helper.js +4 -3
  171. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  172. package/es/scenegraph/group-creater/cell-type/button-cell.js +2 -2
  173. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  174. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  175. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  176. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
  177. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  178. package/es/scenegraph/group-creater/cell-type/image-cell.js +3 -3
  179. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  180. package/es/scenegraph/group-creater/cell-type/radio-cell.js +2 -2
  181. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  182. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -2
  183. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  184. package/es/scenegraph/group-creater/cell-type/switch-cell.js +2 -2
  185. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  186. package/es/scenegraph/group-creater/cell-type/text-cell.js +5 -5
  187. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  188. package/es/scenegraph/group-creater/cell-type/video-cell.js +99 -12
  189. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  190. package/es/scenegraph/group-creater/column-helper.js +4 -3
  191. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  192. package/es/scenegraph/layout/compute-col-width.js +1 -1
  193. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  194. package/es/scenegraph/layout/compute-row-height.js +1 -1
  195. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  196. package/es/scenegraph/layout/frozen.js +7 -3
  197. package/es/scenegraph/layout/frozen.js.map +1 -1
  198. package/es/scenegraph/layout/update-row.js +3 -3
  199. package/es/scenegraph/layout/update-row.js.map +1 -1
  200. package/es/scenegraph/runtime-contributions.d.ts +2 -0
  201. package/es/scenegraph/runtime-contributions.js +20 -0
  202. package/es/scenegraph/runtime-contributions.js.map +1 -0
  203. package/es/scenegraph/scenegraph.d.ts +4 -1
  204. package/es/scenegraph/scenegraph.js +47 -19
  205. package/es/scenegraph/scenegraph.js.map +1 -1
  206. package/es/scenegraph/utils/padding.d.ts +5 -2
  207. package/es/scenegraph/utils/padding.js +13 -9
  208. package/es/scenegraph/utils/padding.js.map +1 -1
  209. package/es/scenegraph/utils/text-icon-layout.d.ts +4 -0
  210. package/es/scenegraph/utils/text-icon-layout.js +18 -2
  211. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  212. package/es/scenegraph/utils/text-measure.js.map +1 -1
  213. package/es/state/state.js +15 -13
  214. package/es/state/state.js.map +1 -1
  215. package/es/ts-types/base-table.d.ts +7 -1
  216. package/es/ts-types/base-table.js.map +1 -1
  217. package/es/ts-types/table-engine.d.ts +1 -1
  218. package/es/ts-types/table-engine.js.map +1 -1
  219. package/es/vrender-app.d.ts +20 -0
  220. package/es/vrender-app.js +161 -0
  221. package/es/vrender-app.js.map +1 -0
  222. package/es/vrender.d.ts +17 -1
  223. package/es/vrender.js +27 -8
  224. package/es/vrender.js.map +1 -1
  225. package/package.json +11 -10
package/es/state/state.js CHANGED
@@ -30,6 +30,8 @@ import { endMoveCol, startMoveCol, updateMoveCol } from "./cell-move";
30
30
 
31
31
  import { getIconAndPositionFromTarget } from "../scenegraph/utils/icon";
32
32
 
33
+ import { getBodyHorizontalScrollRange } from "../scenegraph/component/util";
34
+
33
35
  import { debounce } from "../tools/debounce";
34
36
 
35
37
  import { updateResizeColumn } from "./resize/update-resize-column";
@@ -537,8 +539,8 @@ export class StateManager {
537
539
  }), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
538
540
  }
539
541
  updateHorizontalScrollBar(xRatio) {
540
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
541
- const totalWidth = this.table.getAllColsWidth(), oldHorizontalBarPos = this.scroll.horizontalBarPos, frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0, rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0, scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset);
542
+ var _a, _b, _c, _d;
543
+ const oldHorizontalBarPos = this.scroll.horizontalBarPos, scrollRange = getBodyHorizontalScrollRange(this.table);
542
544
  let horizontalBarPos = Math.ceil(xRatio * scrollRange);
543
545
  isValid(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
544
546
  const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
@@ -546,8 +548,8 @@ export class StateManager {
546
548
  event: void 0,
547
549
  scrollTop: this.scroll.verticalBarPos,
548
550
  scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
549
- scrollHeight: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
550
- scrollWidth: null === (_h = this.table.theme.scrollStyle) || void 0 === _h ? void 0 : _h.width,
551
+ scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
552
+ scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
551
553
  viewHeight: this.table.tableNoFrameHeight,
552
554
  viewWidth: this.table.tableNoFrameWidth,
553
555
  scrollDirection: "horizontal",
@@ -562,8 +564,8 @@ export class StateManager {
562
564
  event: void 0,
563
565
  scrollTop: this.scroll.verticalBarPos,
564
566
  scrollLeft: this.scroll.horizontalBarPos,
565
- scrollHeight: null === (_j = this.table.theme.scrollStyle) || void 0 === _j ? void 0 : _j.width,
566
- scrollWidth: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
567
+ scrollHeight: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
568
+ scrollWidth: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
567
569
  viewHeight: this.table.tableNoFrameHeight,
568
570
  viewWidth: this.table.tableNoFrameWidth,
569
571
  scrollDirection: "horizontal",
@@ -616,13 +618,13 @@ export class StateManager {
616
618
  }), oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
617
619
  }
618
620
  setScrollLeft(left, event, triggerEvent = !0) {
619
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
621
+ var _a, _b, _c, _d, _e, _f, _g;
620
622
  if (!this.table || !this.table.scenegraph) return;
621
623
  this.table.scrollLeft;
622
- const totalWidth = this.table.getAllColsWidth(), frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0, rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0, scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset), sizeTolerance = (null === (_g = this.table.options.customConfig) || void 0 === _g ? void 0 : _g._disableColumnAndRowSizeRound) ? 1 : 0;
624
+ const scrollRange = getBodyHorizontalScrollRange(this.table), sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
623
625
  left = Math.max(0, Math.min(left, scrollRange - sizeTolerance)), left = Math.ceil(left);
624
626
  const oldHorizontalBarPos = this.scroll.horizontalBarPos, xRatio = scrollRange ? left / scrollRange : 0;
625
- if ((oldHorizontalBarPos !== left || !0 === (null === (_j = null === (_h = this.table.options) || void 0 === _h ? void 0 : _h.customConfig) || void 0 === _j ? void 0 : _j.scrollEventAlwaysTrigger)) && triggerEvent) {
627
+ if ((oldHorizontalBarPos !== left || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
626
628
  let horizontalBarPos = left;
627
629
  isValid(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
628
630
  const dx = horizontalBarPos - oldHorizontalBarPos;
@@ -630,8 +632,8 @@ export class StateManager {
630
632
  event: null == event ? void 0 : event.nativeEvent,
631
633
  scrollTop: this.scroll.verticalBarPos,
632
634
  scrollLeft: horizontalBarPos,
633
- scrollHeight: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
634
- scrollWidth: null === (_l = this.table.theme.scrollStyle) || void 0 === _l ? void 0 : _l.width,
635
+ scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
636
+ scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
635
637
  viewHeight: this.table.tableNoFrameHeight,
636
638
  viewWidth: this.table.tableNoFrameWidth,
637
639
  scrollDirection: "horizontal",
@@ -650,8 +652,8 @@ export class StateManager {
650
652
  event: null == event ? void 0 : event.nativeEvent,
651
653
  scrollTop: this.scroll.verticalBarPos,
652
654
  scrollLeft: this.scroll.horizontalBarPos,
653
- scrollHeight: null === (_m = this.table.theme.scrollStyle) || void 0 === _m ? void 0 : _m.width,
654
- scrollWidth: null === (_o = this.table.theme.scrollStyle) || void 0 === _o ? void 0 : _o.width,
655
+ scrollHeight: null === (_f = this.table.theme.scrollStyle) || void 0 === _f ? void 0 : _f.width,
656
+ scrollWidth: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
655
657
  viewHeight: this.table.tableNoFrameHeight,
656
658
  viewWidth: this.table.tableNoFrameWidth,
657
659
  scrollDirection: "horizontal",