@visactor/vtable 1.4.0-alpha.0 → 1.4.0

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 (251) hide show
  1. package/cjs/ListTable.js +38 -26
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +1 -3
  4. package/cjs/PivotChart.js +5 -15
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +1 -1
  7. package/cjs/PivotTable.js +40 -18
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/components/axis/axis.js +2 -3
  10. package/cjs/components/axis/axis.js.map +1 -1
  11. package/cjs/components/empty-tip/empty-tip.js +2 -2
  12. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
  14. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  15. package/cjs/components/react/react-custom-layout.d.ts +21 -0
  16. package/cjs/components/react/react-custom-layout.js +48 -0
  17. package/cjs/components/react/react-custom-layout.js.map +1 -0
  18. package/cjs/components/tooltip/TooltipHandler.js +1 -3
  19. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  20. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +7 -3
  21. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  22. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  23. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  24. package/cjs/core/BaseTable.d.ts +10 -28
  25. package/cjs/core/BaseTable.js +88 -75
  26. package/cjs/core/BaseTable.js.map +1 -1
  27. package/cjs/core/FouseInput.d.ts +0 -1
  28. package/cjs/core/FouseInput.js +2 -5
  29. package/cjs/core/FouseInput.js.map +1 -1
  30. package/cjs/core/style.js +1 -1
  31. package/cjs/core/style.js.map +1 -1
  32. package/cjs/data/DataSource.d.ts +6 -1
  33. package/cjs/data/DataSource.js +12 -2
  34. package/cjs/data/DataSource.js.map +1 -1
  35. package/cjs/dataset/dataset.d.ts +17 -2
  36. package/cjs/dataset/dataset.js +195 -79
  37. package/cjs/dataset/dataset.js.map +1 -1
  38. package/cjs/dataset/statistics-helper.d.ts +43 -3
  39. package/cjs/dataset/statistics-helper.js +61 -26
  40. package/cjs/dataset/statistics-helper.js.map +1 -1
  41. package/cjs/event/event.js +1 -2
  42. package/cjs/event/event.js.map +1 -1
  43. package/cjs/event/listener/container-dom.js +4 -3
  44. package/cjs/event/listener/container-dom.js.map +1 -1
  45. package/cjs/event/listener/table-group.js +7 -5
  46. package/cjs/event/listener/table-group.js.map +1 -1
  47. package/cjs/event/util.js +2 -2
  48. package/cjs/event/util.js.map +1 -1
  49. package/cjs/index.d.ts +3 -1
  50. package/cjs/index.js +13 -4
  51. package/cjs/index.js.map +1 -1
  52. package/cjs/layout/layout-helper.js.map +1 -1
  53. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  54. package/cjs/layout/pivot-header-layout.js +66 -39
  55. package/cjs/layout/pivot-header-layout.js.map +1 -1
  56. package/cjs/layout/row-height-map.js +1 -0
  57. package/cjs/layout/row-height-map.js.map +1 -1
  58. package/cjs/scenegraph/component/custom.js +6 -4
  59. package/cjs/scenegraph/component/custom.js.map +1 -1
  60. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
  61. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  62. package/cjs/scenegraph/graphic/chart.d.ts +0 -1
  63. package/cjs/scenegraph/graphic/chart.js +20 -34
  64. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  65. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  66. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  67. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  68. package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
  69. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  70. package/cjs/scenegraph/group-creater/cell-helper.js +6 -2
  71. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  72. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  73. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  74. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  75. package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
  76. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  77. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  78. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  79. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  80. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  81. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
  82. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  83. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  84. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  85. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  86. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  87. package/cjs/scenegraph/layout/compute-row-height.js +7 -4
  88. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  89. package/cjs/scenegraph/layout/frozen.js +12 -4
  90. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  91. package/cjs/scenegraph/layout/update-width.js +3 -0
  92. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  93. package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
  94. package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
  95. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  96. package/cjs/scenegraph/scenegraph.d.ts +2 -1
  97. package/cjs/scenegraph/scenegraph.js +18 -15
  98. package/cjs/scenegraph/scenegraph.js.map +1 -1
  99. package/cjs/state/cell-move/index.js +1 -1
  100. package/cjs/state/cell-move/index.js.map +1 -1
  101. package/cjs/state/sort/index.js +2 -2
  102. package/cjs/state/sort/index.js.map +1 -1
  103. package/cjs/themes/theme.js +6 -0
  104. package/cjs/themes/theme.js.map +1 -1
  105. package/cjs/ts-types/base-table.d.ts +20 -40
  106. package/cjs/ts-types/base-table.js.map +1 -1
  107. package/cjs/ts-types/customLayout.d.ts +1 -1
  108. package/cjs/ts-types/customLayout.js.map +1 -1
  109. package/cjs/ts-types/icon.d.ts +2 -0
  110. package/cjs/ts-types/icon.js.map +1 -1
  111. package/cjs/ts-types/new-data-set.d.ts +9 -1
  112. package/cjs/ts-types/new-data-set.js +1 -1
  113. package/cjs/ts-types/new-data-set.js.map +1 -1
  114. package/cjs/ts-types/pivot-table/corner.d.ts +12 -0
  115. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  116. package/cjs/ts-types/table-engine.d.ts +12 -0
  117. package/cjs/ts-types/table-engine.js.map +1 -1
  118. package/cjs/ts-types/theme.d.ts +2 -0
  119. package/cjs/ts-types/theme.js.map +1 -1
  120. package/cjs/ts-types/tooltip.d.ts +2 -0
  121. package/cjs/ts-types/tooltip.js.map +1 -1
  122. package/cjs/vrender.d.ts +4 -0
  123. package/cjs/vrender.js +39 -11
  124. package/cjs/vrender.js.map +1 -1
  125. package/dist/vtable.js +25679 -9801
  126. package/dist/vtable.min.js +2 -2
  127. package/es/ListTable.js +34 -23
  128. package/es/ListTable.js.map +1 -1
  129. package/es/PivotChart.d.ts +1 -3
  130. package/es/PivotChart.js +8 -17
  131. package/es/PivotChart.js.map +1 -1
  132. package/es/PivotTable.d.ts +1 -1
  133. package/es/PivotTable.js +41 -19
  134. package/es/PivotTable.js.map +1 -1
  135. package/es/components/axis/axis.js +1 -3
  136. package/es/components/axis/axis.js.map +1 -1
  137. package/es/components/empty-tip/empty-tip.js +2 -2
  138. package/es/components/empty-tip/empty-tip.js.map +1 -1
  139. package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
  140. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  141. package/es/components/react/react-custom-layout.d.ts +21 -0
  142. package/es/components/react/react-custom-layout.js +38 -0
  143. package/es/components/react/react-custom-layout.js.map +1 -0
  144. package/es/components/tooltip/TooltipHandler.js +1 -3
  145. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  146. package/es/components/tooltip/logic/BubbleTooltipElement.js +7 -3
  147. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  148. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  149. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  150. package/es/core/BaseTable.d.ts +10 -28
  151. package/es/core/BaseTable.js +90 -74
  152. package/es/core/BaseTable.js.map +1 -1
  153. package/es/core/FouseInput.d.ts +0 -1
  154. package/es/core/FouseInput.js +2 -5
  155. package/es/core/FouseInput.js.map +1 -1
  156. package/es/core/style.js +1 -1
  157. package/es/core/style.js.map +1 -1
  158. package/es/data/DataSource.d.ts +6 -1
  159. package/es/data/DataSource.js +12 -2
  160. package/es/data/DataSource.js.map +1 -1
  161. package/es/dataset/dataset.d.ts +17 -2
  162. package/es/dataset/dataset.js +195 -80
  163. package/es/dataset/dataset.js.map +1 -1
  164. package/es/dataset/statistics-helper.d.ts +43 -3
  165. package/es/dataset/statistics-helper.js +55 -23
  166. package/es/dataset/statistics-helper.js.map +1 -1
  167. package/es/event/event.js +1 -2
  168. package/es/event/event.js.map +1 -1
  169. package/es/event/listener/container-dom.js +4 -3
  170. package/es/event/listener/container-dom.js.map +1 -1
  171. package/es/event/listener/table-group.js +7 -5
  172. package/es/event/listener/table-group.js.map +1 -1
  173. package/es/event/util.js +2 -2
  174. package/es/event/util.js.map +1 -1
  175. package/es/index.d.ts +3 -1
  176. package/es/index.js +5 -1
  177. package/es/index.js.map +1 -1
  178. package/es/layout/layout-helper.js.map +1 -1
  179. package/es/layout/pivot-header-layout.d.ts +1 -0
  180. package/es/layout/pivot-header-layout.js +65 -37
  181. package/es/layout/pivot-header-layout.js.map +1 -1
  182. package/es/layout/row-height-map.js +1 -0
  183. package/es/layout/row-height-map.js.map +1 -1
  184. package/es/scenegraph/component/custom.js +7 -3
  185. package/es/scenegraph/component/custom.js.map +1 -1
  186. package/es/scenegraph/debug-tool/debug-tool.js +1 -4
  187. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  188. package/es/scenegraph/graphic/chart.d.ts +0 -1
  189. package/es/scenegraph/graphic/chart.js +21 -33
  190. package/es/scenegraph/graphic/chart.js.map +1 -1
  191. package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  192. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  193. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  194. package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
  195. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  196. package/es/scenegraph/group-creater/cell-helper.js +6 -2
  197. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  198. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  199. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  200. package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  201. package/es/scenegraph/group-creater/progress/proxy.js +10 -10
  202. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  203. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  204. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  205. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  206. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  207. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
  208. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  209. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  210. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  211. package/es/scenegraph/layout/compute-col-width.js +3 -3
  212. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  213. package/es/scenegraph/layout/compute-row-height.js +8 -5
  214. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  215. package/es/scenegraph/layout/frozen.js +12 -4
  216. package/es/scenegraph/layout/frozen.js.map +1 -1
  217. package/es/scenegraph/layout/update-width.js +3 -0
  218. package/es/scenegraph/layout/update-width.js.map +1 -1
  219. package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
  220. package/es/scenegraph/refresh-node/update-chart.js +0 -6
  221. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  222. package/es/scenegraph/scenegraph.d.ts +2 -1
  223. package/es/scenegraph/scenegraph.js +18 -15
  224. package/es/scenegraph/scenegraph.js.map +1 -1
  225. package/es/state/cell-move/index.js +1 -1
  226. package/es/state/cell-move/index.js.map +1 -1
  227. package/es/state/sort/index.js +2 -2
  228. package/es/state/sort/index.js.map +1 -1
  229. package/es/themes/theme.js +6 -0
  230. package/es/themes/theme.js.map +1 -1
  231. package/es/ts-types/base-table.d.ts +20 -40
  232. package/es/ts-types/base-table.js.map +1 -1
  233. package/es/ts-types/customLayout.d.ts +1 -1
  234. package/es/ts-types/customLayout.js.map +1 -1
  235. package/es/ts-types/icon.d.ts +2 -0
  236. package/es/ts-types/icon.js.map +1 -1
  237. package/es/ts-types/new-data-set.d.ts +9 -1
  238. package/es/ts-types/new-data-set.js +1 -1
  239. package/es/ts-types/new-data-set.js.map +1 -1
  240. package/es/ts-types/pivot-table/corner.d.ts +12 -0
  241. package/es/ts-types/pivot-table/corner.js.map +1 -1
  242. package/es/ts-types/table-engine.d.ts +12 -0
  243. package/es/ts-types/table-engine.js.map +1 -1
  244. package/es/ts-types/theme.d.ts +2 -0
  245. package/es/ts-types/theme.js.map +1 -1
  246. package/es/ts-types/tooltip.d.ts +2 -0
  247. package/es/ts-types/tooltip.js.map +1 -1
  248. package/es/vrender.d.ts +4 -0
  249. package/es/vrender.js +9 -3
  250. package/es/vrender.js.map +1 -1
  251. package/package.json +7 -7
@@ -23,7 +23,7 @@ const defaultDimension = {
23
23
 
24
24
  export class PivotHeaderLayoutMap {
25
25
  constructor(table, dataset, columnDimensionTree, rowDimensionTree) {
26
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
26
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
27
27
  if (this.colIndex = 0, this._showHeader = !0, this.columnHeaderObjs = [], this.rowHeaderObjs = [],
28
28
  this._cornerHeaderCellFullPathIds = [], this._columnHeaderCellFullPathIds = [],
29
29
  this._rowHeaderCellFullPathIds = [], this._rowHeaderCellFullPathIds_FULL = [], this._cornerHeaderCellIds = [],
@@ -58,15 +58,15 @@ export class PivotHeaderLayoutMap {
58
58
  })), this.columnDimensionTree = columnDimensionTree, this.rowDimensionTree = rowDimensionTree,
59
59
  this.colDimensionKeys = this.columnDimensionTree.dimensionKeys.valueArr(), this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr(),
60
60
  this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys),
61
- this.resetRowHeaderLevelCount(), this._generateColHeaderIds(), this.colIndex = 0,
62
- this._generateRowHeaderIds(), this._table.isPivotChart() && (this.hasTwoIndicatorAxes = this._indicators.some((indicatorObject => {
61
+ this.resetRowHeaderLevelCount(), this._table.isPivotChart() && (this.hasTwoIndicatorAxes = this.indicatorsDefine.some((indicatorObject => {
63
62
  var _a, _b;
64
63
  if (indicatorObject.chartSpec && indicatorObject.chartSpec.series && indicatorObject.chartSpec.series.length > 1) {
65
64
  const axes = null !== (_b = null !== (_a = indicatorObject.chartSpec.axes) && void 0 !== _a ? _a : this._table.pivotChartAxes) && void 0 !== _b ? _b : [];
66
65
  if (!axes.length || axes.every((axis => axis.orient !== (this.indicatorsAsCol ? "top" : "right") || !1 !== axis.visible))) return !0;
67
66
  }
68
67
  return !1;
69
- }))), this.resetColumnHeaderLevelCount(), this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL),
68
+ }))), this.resetColumnHeaderLevelCount(), this._generateColHeaderIds(), this.colIndex = 0,
69
+ this._generateRowHeaderIds(), this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL),
70
70
  "tree" === table.options.rowHierarchyType && (null === (_o = this.extensionRows) || void 0 === _o ? void 0 : _o.length) >= 1 && (this.generateExtensionRowTree(),
71
71
  this.extensionRows.forEach((extensionRow => {
72
72
  const rowKeys = [];
@@ -75,9 +75,10 @@ export class PivotHeaderLayoutMap {
75
75
  })), this._extensionRowDimensionKeys.push(rowKeys), this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(rowKeys);
76
76
  }))), this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length),
77
77
  "column" === this.cornerSetting.titleOnDimension) {
78
- const colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
79
- this.cornerHeaderObjs = this._addCornerHeaders(this.columnHeaderTitle ? [ "" ].concat(colDimensionKeys) : colDimensionKeys, this.columnsDefine);
80
- } else if ("row" === this.cornerSetting.titleOnDimension) if ("tree" === this.rowHierarchyType && (null === (_p = this.extensionRows) || void 0 === _p ? void 0 : _p.length) >= 1) {
78
+ let colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
79
+ !this.dataset || 0 !== (null !== (_q = null === (_p = this.dataset.records) || void 0 === _p ? void 0 : _p.length) && void 0 !== _q ? _q : 0) || this.dataset.customColTree || this.dataset.customRowTree || (colDimensionKeys = this.columnsDefine.map((define => "string" == typeof define ? define : define.dimensionKey)),
80
+ this.indicatorsAsCol && colDimensionKeys.push(this.indicatorDimensionKey)), this.cornerHeaderObjs = this._addCornerHeaders(this.columnHeaderTitle ? [ "" ].concat(colDimensionKeys) : colDimensionKeys, this.columnsDefine);
81
+ } else if ("row" === this.cornerSetting.titleOnDimension) if ("tree" === this.rowHierarchyType && (null === (_r = this.extensionRows) || void 0 === _r ? void 0 : _r.length) >= 1) {
81
82
  const rowTreeFirstKey = [];
82
83
  rowTreeFirstKey.push(this.rowDimensionKeys[0]), this._extensionRowDimensionKeys.forEach((extensionRowKeys => {
83
84
  rowTreeFirstKey.push(extensionRowKeys[0]);
@@ -85,8 +86,9 @@ export class PivotHeaderLayoutMap {
85
86
  const extensionRowDimensions = this.extensionRows.reduce(((dimensions, cur) => dimensions.concat(cur.rows)), []);
86
87
  this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [ "" ].concat(rowTreeFirstKey) : rowTreeFirstKey, this.rowsDefine.concat(extensionRowDimensions));
87
88
  } else {
88
- const rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
89
- this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [ "" ].concat(rowDimensionKeys) : rowDimensionKeys, this.rowsDefine);
89
+ let rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
90
+ !this.dataset || 0 !== (null !== (_t = null === (_s = this.dataset.records) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) || this.dataset.customColTree || this.dataset.customRowTree || (rowDimensionKeys = this.rowsDefine.map((define => "string" == typeof define ? define : define.dimensionKey)),
91
+ this.indicatorsAsCol || rowDimensionKeys.push(this.indicatorDimensionKey)), this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [ "" ].concat(rowDimensionKeys) : rowDimensionKeys, this.rowsDefine);
90
92
  } else this.cornerHeaderObjs = this._addCornerHeaders(null, void 0);
91
93
  this.colIndex = 0, this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
92
94
  o)), {}), this.indicatorsAsCol && !this.hideIndicatorName ? this._indicatorShowType = "column" : this.indicatorsAsCol || this.hideIndicatorName ? this._indicatorShowType = "none" : this._indicatorShowType = "row",
@@ -135,44 +137,58 @@ export class PivotHeaderLayoutMap {
135
137
  this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length, this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length);
136
138
  }
137
139
  _generateColHeaderIds() {
138
- var _a, _b, _c, _d, _e, _f;
139
- if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && this._addHeaders(this._columnHeaderCellFullPathIds, 0, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs),
140
- this.columnHeaderTitle) {
140
+ var _a, _b, _c, _d, _e, _f, _g, _h;
141
+ if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1) {
142
+ let startRow = 0;
143
+ if (this.dataset && 0 === (null !== (_c = null === (_b = this.dataset.records) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) && !this.dataset.customColTree && !this.dataset.customRowTree && this.indicatorsAsCol && this.columnDimensionTree.totalLevel < this.columnHeaderLevelCount) {
144
+ startRow = this.columnHeaderLevelCount - this.columnDimensionTree.totalLevel;
145
+ for (let i = 0; i < startRow; i++) this._columnHeaderCellFullPathIds.unshift([]);
146
+ }
147
+ this._addHeaders(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
148
+ }
149
+ if (this.columnHeaderTitle) {
141
150
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
142
- const id = ++this.sharedVar.seqId, firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
151
+ const id = ++this.sharedVar.seqId, firstRowIds = Array(this.colCount - this.rowHeaderLevelCount - this.rightFrozenColCount).fill(id);
143
152
  this._columnHeaderCellFullPathIds.unshift(firstRowIds);
144
153
  const cell = {
145
154
  id: id,
146
155
  title: "string" == typeof this.columnHeaderTitle.title ? this.columnHeaderTitle.title : this.columnsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
147
156
  field: void 0,
148
- headerType: null !== (_c = null === (_b = this.columnHeaderTitle) || void 0 === _b ? void 0 : _b.headerType) && void 0 !== _c ? _c : "text",
149
- style: null === (_d = this.columnHeaderTitle) || void 0 === _d ? void 0 : _d.headerStyle,
157
+ headerType: null !== (_e = null === (_d = this.columnHeaderTitle) || void 0 === _d ? void 0 : _d.headerType) && void 0 !== _e ? _e : "text",
158
+ style: null === (_f = this.columnHeaderTitle) || void 0 === _f ? void 0 : _f.headerStyle,
150
159
  define: {
151
160
  id: id,
152
- disableHeaderHover: !!(null === (_e = this.columnHeaderTitle) || void 0 === _e ? void 0 : _e.disableHeaderHover),
153
- disableHeaderSelect: !!(null === (_f = this.columnHeaderTitle) || void 0 === _f ? void 0 : _f.disableHeaderSelect)
161
+ disableHeaderHover: !!(null === (_g = this.columnHeaderTitle) || void 0 === _g ? void 0 : _g.disableHeaderHover),
162
+ disableHeaderSelect: !!(null === (_h = this.columnHeaderTitle) || void 0 === _h ? void 0 : _h.disableHeaderSelect)
154
163
  }
155
164
  };
156
165
  this.columnHeaderObjs.push(cell), this._headerObjects[id] = cell;
157
166
  }
158
167
  }
159
168
  _generateRowHeaderIds() {
160
- var _a, _b, _c, _d, _e, _f, _g, _h;
161
- if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && ("tree" === this.rowHierarchyType ? this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs) : this._addHeaders(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs)),
162
- this.rowHeaderTitle) {
169
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
170
+ if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1) if ("tree" === this.rowHierarchyType) this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs); else {
171
+ let startRow = 0;
172
+ if (this.dataset && 0 === (null !== (_c = null === (_b = this.dataset.records) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : 0) && !this.dataset.customColTree && !this.dataset.customRowTree && !this.indicatorsAsCol && this.rowDimensionTree.totalLevel < this.rowHeaderLevelCount) {
173
+ startRow = this.rowHeaderLevelCount - this.rowDimensionTree.totalLevel;
174
+ for (let i = 0; i < startRow; i++) this._rowHeaderCellFullPathIds_FULL.unshift([]);
175
+ }
176
+ this._addHeaders(this._rowHeaderCellFullPathIds_FULL, startRow, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs);
177
+ }
178
+ if (this.rowHeaderTitle) {
163
179
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
164
- const id = ++this.sharedVar.seqId, firstColIds = Array(null !== (_c = null === (_b = this._rowHeaderCellFullPathIds_FULL[0]) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : this.rowDimensionTree.tree.size).fill(id);
180
+ const id = ++this.sharedVar.seqId, firstColIds = Array(null !== (_e = null === (_d = this._rowHeaderCellFullPathIds_FULL[0]) || void 0 === _d ? void 0 : _d.length) && void 0 !== _e ? _e : this.rowDimensionTree.tree.size).fill(id);
165
181
  this._rowHeaderCellFullPathIds_FULL.unshift(firstColIds);
166
182
  const cell = {
167
183
  id: id,
168
184
  title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
169
185
  field: void 0,
170
- headerType: null !== (_e = null === (_d = this.rowHeaderTitle) || void 0 === _d ? void 0 : _d.headerType) && void 0 !== _e ? _e : "text",
171
- style: null === (_f = this.rowHeaderTitle) || void 0 === _f ? void 0 : _f.headerStyle,
186
+ headerType: null !== (_g = null === (_f = this.rowHeaderTitle) || void 0 === _f ? void 0 : _f.headerType) && void 0 !== _g ? _g : "text",
187
+ style: null === (_h = this.rowHeaderTitle) || void 0 === _h ? void 0 : _h.headerStyle,
172
188
  define: {
173
189
  id: id,
174
- disableHeaderHover: !!(null === (_g = this.rowHeaderTitle) || void 0 === _g ? void 0 : _g.disableHeaderHover),
175
- disableHeaderSelect: !!(null === (_h = this.rowHeaderTitle) || void 0 === _h ? void 0 : _h.disableHeaderSelect)
190
+ disableHeaderHover: !!(null === (_j = this.rowHeaderTitle) || void 0 === _j ? void 0 : _j.disableHeaderHover),
191
+ disableHeaderSelect: !!(null === (_k = this.rowHeaderTitle) || void 0 === _k ? void 0 : _k.disableHeaderSelect)
176
192
  }
177
193
  };
178
194
  this.rowHeaderObjs.push(cell), this._headerObjects[id] = cell;
@@ -223,6 +239,7 @@ export class PivotHeaderLayoutMap {
223
239
  dimensionKey: dimensionKey,
224
240
  id: id,
225
241
  value: dimensionKey,
242
+ headerEditor: this.cornerSetting.headerEditor,
226
243
  disableHeaderHover: !!this.cornerSetting.disableHeaderHover,
227
244
  disableHeaderSelect: !!this.cornerSetting.disableHeaderSelect
228
245
  },
@@ -487,17 +504,19 @@ export class PivotHeaderLayoutMap {
487
504
  return this.columnHeaderLevelCount;
488
505
  }
489
506
  resetColumnHeaderLevelCount() {
490
- var _a, _b, _c, _d;
507
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
491
508
  if (this.showHeader && this.showColumnHeader) {
492
509
  if (this._table.isPivotChart() && this.indicatorsAsCol && !(null === (_b = null === (_a = this.dataset) || void 0 === _a ? void 0 : _a.colKeys) || void 0 === _b ? void 0 : _b.length) && 0 === (null === (_d = null === (_c = this.columnDimensionTree) || void 0 === _c ? void 0 : _c.tree) || void 0 === _d ? void 0 : _d.level) && !this.hasTwoIndicatorAxes) return void (this.columnHeaderLevelCount = 0);
493
510
  let count = this.indicatorsAsCol && this.hideIndicatorName && this.colDimensionKeys[this.colDimensionKeys.length - 1] === this.indicatorDimensionKey ? this.columnDimensionTree.totalLevel - 1 : this.columnDimensionTree.totalLevel;
494
511
  return this.columnHeaderTitle && (count += 1), this._table.isPivotChart() && this.indicatorsAsCol && !this.hasTwoIndicatorAxes && checkHasCartesianChart(this.indicatorsDefine) && (count -= 1),
512
+ 0 !== count || !this.dataset || this.dataset.customColTree || this.dataset.customRowTree ? !this.dataset || 0 !== (null !== (_j = null === (_h = this.dataset.records) || void 0 === _h ? void 0 : _h.length) && void 0 !== _j ? _j : 0) || this.dataset.customColTree || this.dataset.customRowTree || "column" === this.cornerSetting.titleOnDimension && (count = null !== (_k = this.columnsDefine.length) && void 0 !== _k ? _k : 0,
513
+ !this.hideIndicatorName && this.indicatorsAsCol && count++) : "row" === this.cornerSetting.titleOnDimension ? count = 1 : 0 === (null !== (_f = null === (_e = this.dataset.records) || void 0 === _e ? void 0 : _e.length) && void 0 !== _f ? _f : 0) && "column" === this.cornerSetting.titleOnDimension && (count = null !== (_g = this.columnsDefine.length) && void 0 !== _g ? _g : 0),
495
514
  void (this.columnHeaderLevelCount = count);
496
515
  }
497
516
  this.columnHeaderLevelCount = this.indicatorsAsCol ? this.hideIndicatorName ? 0 : 1 : 0;
498
517
  }
499
518
  resetRowHeaderLevelCount() {
500
- var _a, _b;
519
+ var _a, _b, _c, _d, _e, _f, _g;
501
520
  if (this.showHeader && this.showRowHeader) {
502
521
  if ("tree" === this.rowHierarchyType) {
503
522
  const extensionRowCount = null !== (_b = null === (_a = this.extensionRows) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
@@ -506,7 +525,9 @@ export class PivotHeaderLayoutMap {
506
525
  const rowLevelCount = this.rowDimensionTree.totalLevel;
507
526
  let count = rowLevelCount;
508
527
  return this.indicatorsAsCol || this.hideIndicatorName && this.rowDimensionKeys[this.rowDimensionKeys.length - 1] === this.indicatorDimensionKey && (count = rowLevelCount - 1),
509
- this.rowHeaderTitle && (count += 1), void (this.rowHeaderLevelCount = count);
528
+ this.rowHeaderTitle && (count += 1), 0 !== count || !this.dataset || this.dataset.customColTree || this.dataset.customRowTree ? !this.dataset || 0 !== (null !== (_g = null === (_f = this.dataset.records) || void 0 === _f ? void 0 : _f.length) && void 0 !== _g ? _g : 0) || this.dataset.customColTree || this.dataset.customRowTree || "row" === this.cornerSetting.titleOnDimension && (count = this.rowsDefine.length,
529
+ this.hideIndicatorName || this.indicatorsAsCol || count++) : "column" === this.cornerSetting.titleOnDimension ? count = 1 : 0 === (null !== (_d = null === (_c = this.dataset.records) || void 0 === _c ? void 0 : _c.length) && void 0 !== _d ? _d : 0) && "row" === this.cornerSetting.titleOnDimension && (count = null !== (_e = this.rowsDefine.length) && void 0 !== _e ? _e : 0),
530
+ void (this.rowHeaderLevelCount = count);
510
531
  }
511
532
  this.rowHeaderLevelCount = this.indicatorsAsCol || this.hideIndicatorName ? 0 : 1;
512
533
  }
@@ -560,14 +581,14 @@ export class PivotHeaderLayoutMap {
560
581
  return this._indicators;
561
582
  }
562
583
  getCellId(col, row) {
563
- var _a, _b;
584
+ var _a, _b, _c, _d, _e;
564
585
  if (row >= 0 && col >= 0) {
565
586
  if (this.isSeriesNumber(col, row)) return "";
566
- if (this.isCornerHeader(col, row)) return this._cornerHeaderCellIds[row][col - this.leftRowSeriesNumberColumnCount];
567
- if (this.isColumnHeader(col, row)) return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
568
- if (this.isRowHeader(col, row)) return null === (_a = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _a ? void 0 : _a[col - this.leftRowSeriesNumberColumnCount];
569
- if (this.isRightFrozenColumn(col, row)) return this._rowHeaderCellIds[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];
570
- if (this.isBottomFrozenRow(col, row)) return null === (_b = this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]) || void 0 === _b ? void 0 : _b[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
587
+ if (this.isCornerHeader(col, row)) return null === (_a = this._cornerHeaderCellIds[row]) || void 0 === _a ? void 0 : _a[col - this.leftRowSeriesNumberColumnCount];
588
+ if (this.isColumnHeader(col, row)) return null === (_b = this._columnHeaderCellIds[row]) || void 0 === _b ? void 0 : _b[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
589
+ if (this.isRowHeader(col, row)) return null === (_c = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _c ? void 0 : _c[col - this.leftRowSeriesNumberColumnCount];
590
+ if (this.isRightFrozenColumn(col, row)) return null === (_d = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _d ? void 0 : _d[this.rowHeaderLevelCount - 1];
591
+ if (this.isBottomFrozenRow(col, row)) return null === (_e = this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]) || void 0 === _e ? void 0 : _e[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
571
592
  }
572
593
  }
573
594
  getHeader(col, row) {
@@ -1167,7 +1188,8 @@ export class PivotHeaderLayoutMap {
1167
1188
  }
1168
1189
  setPagination(pagination) {
1169
1190
  var _a, _b, _c, _d, _e, _f, _g;
1170
- if (this.clearCellRangeMap(), this.pagination = pagination, "grid" === this.rowHierarchyType && isValid(null === (_a = this.pagination) || void 0 === _a ? void 0 : _a.perPageCount) && isValid(null === (_b = this.pagination) || void 0 === _b ? void 0 : _b.currentPage)) {
1191
+ if (this.clearCellRangeMap(), this._table.internalProps.useOneRowHeightFillAll = !1,
1192
+ this.pagination = pagination, "grid" === this.rowHierarchyType && isValid(null === (_a = this.pagination) || void 0 === _a ? void 0 : _a.perPageCount) && isValid(null === (_b = this.pagination) || void 0 === _b ? void 0 : _b.currentPage)) {
1171
1193
  !1 === this.indicatorsAsCol && (this.pagination.perPageCount = Math.ceil(this.pagination.perPageCount / this.indicatorKeys.length) * this.indicatorKeys.length);
1172
1194
  const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
1173
1195
  this.currentPageStartIndex = perPageCount * (currentPage || 0), this.currentPageEndIndex = this.currentPageStartIndex + perPageCount,
@@ -1392,8 +1414,8 @@ export class PivotHeaderLayoutMap {
1392
1414
  const dataset = this.dataset;
1393
1415
  this.rowTree = dataset.rowHeaderTree, this.columnTree = dataset.colHeaderTree, this.columnDimensionTree = new DimensionTree(null !== (_a = this.columnTree) && void 0 !== _a ? _a : [], this.sharedVar),
1394
1416
  this.rowDimensionTree = new DimensionTree(null !== (_b = this.rowTree) && void 0 !== _b ? _b : [], this.sharedVar, this.rowHierarchyType, "tree" === this.rowHierarchyType ? this.rowExpandLevel : void 0),
1395
- this._generateColHeaderIds(), this.colIndex = 0, this._generateRowHeaderIds(), this.resetColumnHeaderLevelCount(),
1396
- this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL),
1417
+ this.resetColumnHeaderLevelCount(), this._generateColHeaderIds(), this.colIndex = 0,
1418
+ this._generateRowHeaderIds(), this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL),
1397
1419
  this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e, o)), {}),
1398
1420
  this._CellHeaderPathMap = new Map, this._largeCellRangeCache.length = 0, this.generateCellIdsConsiderHideHeader(),
1399
1421
  this.setPagination(this.pagination);
@@ -1420,6 +1442,12 @@ export class PivotHeaderLayoutMap {
1420
1442
  const id = this.getCellId(col, row);
1421
1443
  this._headerObjectMap[id].title = value;
1422
1444
  }
1445
+ changeCornerTitle(col, row, value) {
1446
+ if (this.isCornerHeader(col, row)) {
1447
+ const id = this.getCellId(col, row);
1448
+ this._headerObjectMap[id].title = value;
1449
+ }
1450
+ }
1423
1451
  generateCellIdsConsiderHideHeader() {
1424
1452
  if (this._columnHeaderCellIds = this._columnHeaderCellFullPathIds.slice(), !this.showColumnHeader) if (this.indicatorsAsCol && !this.hideIndicatorName) {
1425
1453
  const indicatorIndex = this.colDimensionKeys.indexOf(IndicatorDimensionKeyPlaceholder), indicatorIds = this._columnHeaderCellIds.splice(indicatorIndex, 1);