@visactor/vtable 1.22.2 → 1.22.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 (147) hide show
  1. package/cjs/ListTable.d.ts +3 -1
  2. package/cjs/ListTable.js +15 -8
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.js +10 -8
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +1 -0
  7. package/cjs/PivotTable.js +3 -0
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/body-helper/style/ButtonStyle.d.ts +10 -1
  10. package/cjs/body-helper/style/ButtonStyle.js.map +1 -1
  11. package/cjs/body-helper/style/CheckboxStyle.d.ts +14 -1
  12. package/cjs/body-helper/style/CheckboxStyle.js.map +1 -1
  13. package/cjs/body-helper/style/RadioStyle.d.ts +8 -1
  14. package/cjs/body-helper/style/RadioStyle.js.map +1 -1
  15. package/cjs/body-helper/style/SwitchStyle.d.ts +13 -1
  16. package/cjs/body-helper/style/SwitchStyle.js.map +1 -1
  17. package/cjs/core/BaseTable.js +2 -2
  18. package/cjs/core/BaseTable.js.map +1 -1
  19. package/cjs/core/record-helper.js.map +1 -1
  20. package/cjs/data/DataSource.js +1 -1
  21. package/cjs/data/DataSource.js.map +1 -1
  22. package/cjs/dataset/dataset.js +5 -1
  23. package/cjs/dataset/dataset.js.map +1 -1
  24. package/cjs/event/listener/touch.js +2 -1
  25. package/cjs/event/listener/touch.js.map +1 -1
  26. package/cjs/event/scroll.d.ts +2 -0
  27. package/cjs/event/scroll.js +12 -3
  28. package/cjs/event/scroll.js.map +1 -1
  29. package/cjs/index.d.ts +2 -1
  30. package/cjs/index.js +18 -4
  31. package/cjs/index.js.map +1 -1
  32. package/cjs/layout/chart-helper/get-axis-config.d.ts +1 -0
  33. package/cjs/layout/chart-helper/get-axis-config.js +11 -8
  34. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  35. package/cjs/layout/chart-helper/get-chart-spec.js +7 -7
  36. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  37. package/cjs/layout/index.js +2 -1
  38. package/cjs/layout/pivot-header-layout.d.ts +2 -1
  39. package/cjs/layout/pivot-header-layout.js +38 -4
  40. package/cjs/layout/pivot-header-layout.js.map +1 -1
  41. package/cjs/layout/pivot-layout.js +2 -0
  42. package/cjs/layout/row-height-map.js +1 -1
  43. package/cjs/layout/simple-header-layout.js +4 -4
  44. package/cjs/layout/simple-header-layout.js.map +1 -1
  45. package/cjs/layout/tree-helper.js +1 -1
  46. package/cjs/plugins/custom-cell-style.js +1 -2
  47. package/cjs/plugins/index.js +1 -1
  48. package/cjs/plugins/interface.js +1 -1
  49. package/cjs/plugins/invert-highlight.js +1 -1
  50. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  51. package/cjs/plugins/plugin-manager.js +1 -1
  52. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  53. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-helper.js +1 -1
  55. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/cjs/scenegraph/layout/compute-row-height.js +7 -3
  57. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  58. package/cjs/scenegraph/scenegraph.js +1 -1
  59. package/cjs/state/cell-move/adjust-header.d.ts +13 -0
  60. package/cjs/state/cell-move/adjust-header.js +50 -3
  61. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  62. package/cjs/state/cell-move/index.js +2 -1
  63. package/cjs/state/cell-move/index.js.map +1 -1
  64. package/cjs/ts-types/base-table.d.ts +7 -2
  65. package/cjs/ts-types/base-table.js.map +1 -1
  66. package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -1
  67. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  68. package/cjs/ts-types/new-data-set.d.ts +1 -0
  69. package/cjs/ts-types/new-data-set.js.map +1 -1
  70. package/cjs/ts-types/table-engine.d.ts +9 -2
  71. package/cjs/ts-types/table-engine.js.map +1 -1
  72. package/cjs/vrender.js.map +1 -1
  73. package/dist/vtable.js +297 -48
  74. package/dist/vtable.min.js +2 -2
  75. package/es/ListTable.d.ts +3 -1
  76. package/es/ListTable.js +17 -10
  77. package/es/ListTable.js.map +1 -1
  78. package/es/PivotChart.js +10 -8
  79. package/es/PivotChart.js.map +1 -1
  80. package/es/PivotTable.d.ts +1 -0
  81. package/es/PivotTable.js +3 -0
  82. package/es/PivotTable.js.map +1 -1
  83. package/es/body-helper/style/ButtonStyle.d.ts +10 -1
  84. package/es/body-helper/style/ButtonStyle.js.map +1 -1
  85. package/es/body-helper/style/CheckboxStyle.d.ts +14 -1
  86. package/es/body-helper/style/CheckboxStyle.js.map +1 -1
  87. package/es/body-helper/style/RadioStyle.d.ts +8 -1
  88. package/es/body-helper/style/RadioStyle.js.map +1 -1
  89. package/es/body-helper/style/SwitchStyle.d.ts +13 -1
  90. package/es/body-helper/style/SwitchStyle.js.map +1 -1
  91. package/es/core/BaseTable.js +2 -2
  92. package/es/core/BaseTable.js.map +1 -1
  93. package/es/core/record-helper.js.map +1 -1
  94. package/es/data/DataSource.js +1 -1
  95. package/es/data/DataSource.js.map +1 -1
  96. package/es/dataset/dataset.js +5 -1
  97. package/es/dataset/dataset.js.map +1 -1
  98. package/es/event/listener/touch.js +2 -2
  99. package/es/event/listener/touch.js.map +1 -1
  100. package/es/event/scroll.d.ts +2 -0
  101. package/es/event/scroll.js +9 -1
  102. package/es/event/scroll.js.map +1 -1
  103. package/es/index.d.ts +2 -1
  104. package/es/index.js +3 -1
  105. package/es/index.js.map +1 -1
  106. package/es/layout/chart-helper/get-axis-config.d.ts +1 -0
  107. package/es/layout/chart-helper/get-axis-config.js +11 -8
  108. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  109. package/es/layout/chart-helper/get-chart-spec.js +6 -7
  110. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  111. package/es/layout/index.js +2 -1
  112. package/es/layout/pivot-header-layout.d.ts +2 -1
  113. package/es/layout/pivot-header-layout.js +38 -4
  114. package/es/layout/pivot-header-layout.js.map +1 -1
  115. package/es/layout/pivot-layout.js +2 -0
  116. package/es/layout/row-height-map.js +1 -1
  117. package/es/layout/simple-header-layout.js +4 -4
  118. package/es/layout/simple-header-layout.js.map +1 -1
  119. package/es/layout/tree-helper.js +1 -1
  120. package/es/plugins/custom-cell-style.js +1 -2
  121. package/es/plugins/index.js +1 -1
  122. package/es/plugins/interface.js +1 -1
  123. package/es/plugins/invert-highlight.js +1 -1
  124. package/es/plugins/list-tree-stick-cell.js +1 -1
  125. package/es/plugins/plugin-manager.js +1 -1
  126. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +1 -1
  127. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  128. package/es/scenegraph/group-creater/cell-helper.js +2 -2
  129. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  130. package/es/scenegraph/layout/compute-row-height.js +7 -3
  131. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  132. package/es/scenegraph/scenegraph.js +1 -1
  133. package/es/state/cell-move/adjust-header.d.ts +13 -0
  134. package/es/state/cell-move/adjust-header.js +46 -2
  135. package/es/state/cell-move/adjust-header.js.map +1 -1
  136. package/es/state/cell-move/index.js +2 -1
  137. package/es/state/cell-move/index.js.map +1 -1
  138. package/es/ts-types/base-table.d.ts +7 -2
  139. package/es/ts-types/base-table.js.map +1 -1
  140. package/es/ts-types/list-table/define/basic-define.d.ts +1 -1
  141. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  142. package/es/ts-types/new-data-set.d.ts +1 -0
  143. package/es/ts-types/new-data-set.js.map +1 -1
  144. package/es/ts-types/table-engine.d.ts +9 -2
  145. package/es/ts-types/table-engine.js.map +1 -1
  146. package/es/vrender.js.map +1 -1
  147. package/package.json +4 -4
@@ -994,6 +994,25 @@ class PivotHeaderLayoutMap {
994
994
  }
995
995
  })), headerPaths;
996
996
  }
997
+ getCellRowHeaderFullPaths(col) {
998
+ const headerPaths = [];
999
+ if ("grid" === this.rowHierarchyType) {
1000
+ for (let i = 0; i <= Math.min(this.rowsDefine.length - 1, col); i++) {
1001
+ const rowDefine = this.rowsDefine[i];
1002
+ "string" == typeof rowDefine ? headerPaths.push({
1003
+ dimensionKey: rowDefine
1004
+ }) : headerPaths.push({
1005
+ dimensionKey: rowDefine.dimensionKey
1006
+ });
1007
+ }
1008
+ col >= this.rowsDefine.length && !1 === this.indicatorsAsCol && this.indicatorsDefine.length > 0 && ("string" == typeof this.indicatorsDefine[0] ? headerPaths.push({
1009
+ indicatorKey: this.indicatorsDefine[0]
1010
+ }) : headerPaths.push({
1011
+ indicatorKey: this.indicatorsDefine[0].indicatorKey
1012
+ }));
1013
+ }
1014
+ return headerPaths;
1015
+ }
997
1016
  getIndicatorInfoByIndicatorKey(indicatorKey) {
998
1017
  var _a;
999
1018
  return null === (_a = this.indicatorsDefine) || void 0 === _a ? void 0 : _a.find((indicator => "string" != typeof indicator && (!!indicatorKey && indicator.indicatorKey === indicatorKey)));
@@ -1441,17 +1460,31 @@ class PivotHeaderLayoutMap {
1441
1460
  if (rowDimensionFinded || forceBody) {
1442
1461
  row = this.columnHeaderLevelCount;
1443
1462
  const {startInTotal: startInTotal, afterSpanLevel: afterSpanLevel} = null !== (_g = rowDimensionFinded) && void 0 !== _g ? _g : defaultDimension;
1444
- row += null != startInTotal ? startInTotal : 0, defaultCol = "grid" === this.rowHierarchyType ? (this.rowHeaderTitle ? afterSpanLevel + 1 : afterSpanLevel) + this.leftRowSeriesNumberColumnCount : 0;
1463
+ if (row += null != startInTotal ? startInTotal : 0, "grid" === this.rowHierarchyType) {
1464
+ if (rowHeaderPaths.every(((path, index) => this.rowDimensionKeys[index] === path.dimensionKey))) {
1465
+ const col = rowHeaderPaths.length - 1;
1466
+ defaultCol = (this.rowHeaderTitle ? col + 1 : col) + this.leftRowSeriesNumberColumnCount;
1467
+ } else defaultCol = (this.rowHeaderTitle ? afterSpanLevel + 1 : afterSpanLevel) + this.leftRowSeriesNumberColumnCount;
1468
+ } else defaultCol = 0;
1445
1469
  }
1446
1470
  if (colDimensionFinded || forceBody) {
1447
1471
  col = this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount;
1448
1472
  const {startInTotal: startInTotal, afterSpanLevel: afterSpanLevel} = null !== (_h = colDimensionFinded) && void 0 !== _h ? _h : defaultDimension;
1449
1473
  col += null != startInTotal ? startInTotal : 0, defaultRow = this.columnHeaderTitle ? afterSpanLevel + 1 : afterSpanLevel;
1450
1474
  }
1451
- return (0, vutils_1.isValid)(col) || (0, vutils_1.isValid)(row) ? {
1475
+ if ((0, vutils_1.isValid)(col) || (0, vutils_1.isValid)(row)) return {
1452
1476
  col: null != col ? col : defaultCol,
1453
1477
  row: null != row ? row : defaultRow
1454
- } : void 0;
1478
+ };
1479
+ if (rowHeaderPaths.length > 0) {
1480
+ if (rowHeaderPaths.every(((path, index) => this.rowDimensionKeys[index] === path.dimensionKey))) {
1481
+ const col = rowHeaderPaths.length - 1;
1482
+ return {
1483
+ col: (this.rowHeaderTitle ? col + 1 : col) + this.leftRowSeriesNumberColumnCount,
1484
+ row: void 0
1485
+ };
1486
+ }
1487
+ }
1455
1488
  }
1456
1489
  }
1457
1490
  setChartInstance(_col, _row, chartInstance) {
@@ -1676,6 +1709,7 @@ class PivotHeaderLayoutMap {
1676
1709
  getIndicatorKeyInChartSpec(_col, _row) {
1677
1710
  const chartSpec = this.getRawChartSpec(_col, _row), indicatorKeys = [];
1678
1711
  if (chartSpec) {
1712
+ if ("boxPlot" === chartSpec.type) return [ chartSpec.maxField ];
1679
1713
  if (chartSpec.series || chartSpec.xField || chartSpec.yField) return !1 === this.indicatorsAsCol ? chartSpec.series ? chartSpec.series.forEach((chartSeries => {
1680
1714
  const yField = chartSeries.yField;
1681
1715
  indicatorKeys.push(yField);
@@ -1940,5 +1974,5 @@ function bandSpace(count, paddingInner, paddingOuter) {
1940
1974
  count ? space > 0 ? space : 1 : 0;
1941
1975
  }
1942
1976
 
1977
+ exports.PivotHeaderLayoutMap = PivotHeaderLayoutMap;
1943
1978
  //# sourceMappingURL=pivot-header-layout.js.map
1944
- exports.PivotHeaderLayoutMap = PivotHeaderLayoutMap;