@visactor/vtable 0.26.0-alpha.1 → 1.0.0-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 (185) hide show
  1. package/cjs/ListTable.js +13 -16
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +22 -6
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +20 -9
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/core/BaseTable.d.ts +4 -1
  8. package/cjs/core/BaseTable.js +73 -28
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  11. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  12. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  13. package/cjs/dataset/dataset.d.ts +0 -1
  14. package/cjs/dataset/dataset.js +2 -32
  15. package/cjs/dataset/dataset.js.map +1 -1
  16. package/cjs/edit/edit-manager.js +8 -7
  17. package/cjs/edit/edit-manager.js.map +1 -1
  18. package/cjs/event/listener/scroll-bar.js +6 -2
  19. package/cjs/event/listener/scroll-bar.js.map +1 -1
  20. package/cjs/event/listener/table-group.js +39 -22
  21. package/cjs/event/listener/table-group.js.map +1 -1
  22. package/cjs/event/util.d.ts +2 -0
  23. package/cjs/event/util.js +18 -4
  24. package/cjs/event/util.js.map +1 -1
  25. package/cjs/header-helper/header-helper.d.ts +1 -0
  26. package/cjs/header-helper/header-helper.js +8 -0
  27. package/cjs/header-helper/header-helper.js.map +1 -1
  28. package/cjs/index.d.ts +1 -1
  29. package/cjs/index.js +1 -1
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/layout-helper.d.ts +2 -3
  32. package/cjs/layout/layout-helper.js +42 -16
  33. package/cjs/layout/layout-helper.js.map +1 -1
  34. package/cjs/layout/pivot-header-layout.d.ts +5 -0
  35. package/cjs/layout/pivot-header-layout.js +91 -49
  36. package/cjs/layout/pivot-header-layout.js.map +1 -1
  37. package/cjs/layout/tree-helper.js.map +1 -1
  38. package/cjs/scenegraph/component/table-component.js +26 -22
  39. package/cjs/scenegraph/component/table-component.js.map +1 -1
  40. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +8 -7
  41. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  42. package/cjs/scenegraph/graphic/group.d.ts +1 -1
  43. package/cjs/scenegraph/graphic/group.js.map +1 -1
  44. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +24 -18
  45. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  46. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  47. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  48. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +18 -16
  49. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  50. package/cjs/scenegraph/group-creater/column-helper.js +1 -1
  51. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  52. package/cjs/scenegraph/group-creater/progress/proxy.js +4 -2
  53. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  54. package/cjs/scenegraph/layout/compute-col-width.js +2 -1
  55. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  56. package/cjs/scenegraph/layout/update-height.js +2 -2
  57. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  58. package/cjs/scenegraph/scenegraph.js +10 -3
  59. package/cjs/scenegraph/scenegraph.js.map +1 -1
  60. package/cjs/scenegraph/utils/text-icon-layout.js +4 -4
  61. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  62. package/cjs/scenegraph/utils/text-measure.js +3 -1
  63. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  64. package/cjs/state/cell-move/index.js +2 -1
  65. package/cjs/state/cell-move/index.js.map +1 -1
  66. package/cjs/state/checkbox/checkbox.d.ts +1 -0
  67. package/cjs/state/checkbox/checkbox.js +12 -2
  68. package/cjs/state/checkbox/checkbox.js.map +1 -1
  69. package/cjs/state/radio/radio.d.ts +1 -0
  70. package/cjs/state/radio/radio.js +13 -2
  71. package/cjs/state/radio/radio.js.map +1 -1
  72. package/cjs/state/state.d.ts +1 -0
  73. package/cjs/state/state.js +5 -1
  74. package/cjs/state/state.js.map +1 -1
  75. package/cjs/themes/theme.js +3 -0
  76. package/cjs/themes/theme.js.map +1 -1
  77. package/cjs/tools/get-data-path/create-dataset.js +5 -3
  78. package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
  79. package/cjs/tools/helper.js +2 -2
  80. package/cjs/tools/helper.js.map +1 -1
  81. package/cjs/ts-types/base-table.d.ts +10 -0
  82. package/cjs/ts-types/base-table.js.map +1 -1
  83. package/cjs/ts-types/common.d.ts +6 -0
  84. package/cjs/ts-types/common.js.map +1 -1
  85. package/cjs/ts-types/events.d.ts +4 -1
  86. package/cjs/ts-types/events.js.map +1 -1
  87. package/cjs/ts-types/table-engine.d.ts +2 -0
  88. package/cjs/ts-types/table-engine.js.map +1 -1
  89. package/cjs/ts-types/theme.d.ts +1 -0
  90. package/cjs/ts-types/theme.js.map +1 -1
  91. package/cjs/vrender.js.map +1 -1
  92. package/dist/vtable.js +570 -200
  93. package/dist/vtable.min.js +2 -2
  94. package/es/ListTable.js +8 -12
  95. package/es/ListTable.js.map +1 -1
  96. package/es/PivotChart.js +15 -5
  97. package/es/PivotChart.js.map +1 -1
  98. package/es/PivotTable.js +17 -10
  99. package/es/PivotTable.js.map +1 -1
  100. package/es/core/BaseTable.d.ts +4 -1
  101. package/es/core/BaseTable.js +74 -28
  102. package/es/core/BaseTable.js.map +1 -1
  103. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  104. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  105. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  106. package/es/dataset/dataset.d.ts +0 -1
  107. package/es/dataset/dataset.js +2 -32
  108. package/es/dataset/dataset.js.map +1 -1
  109. package/es/edit/edit-manager.js +8 -7
  110. package/es/edit/edit-manager.js.map +1 -1
  111. package/es/event/listener/scroll-bar.js +6 -2
  112. package/es/event/listener/scroll-bar.js.map +1 -1
  113. package/es/event/listener/table-group.js +40 -21
  114. package/es/event/listener/table-group.js.map +1 -1
  115. package/es/event/util.d.ts +2 -0
  116. package/es/event/util.js +12 -0
  117. package/es/event/util.js.map +1 -1
  118. package/es/header-helper/header-helper.d.ts +1 -0
  119. package/es/header-helper/header-helper.js +8 -0
  120. package/es/header-helper/header-helper.js.map +1 -1
  121. package/es/index.d.ts +1 -1
  122. package/es/index.js +1 -1
  123. package/es/index.js.map +1 -1
  124. package/es/layout/layout-helper.d.ts +2 -3
  125. package/es/layout/layout-helper.js +39 -15
  126. package/es/layout/layout-helper.js.map +1 -1
  127. package/es/layout/pivot-header-layout.d.ts +5 -0
  128. package/es/layout/pivot-header-layout.js +92 -48
  129. package/es/layout/pivot-header-layout.js.map +1 -1
  130. package/es/layout/tree-helper.js.map +1 -1
  131. package/es/scenegraph/component/table-component.js +27 -21
  132. package/es/scenegraph/component/table-component.js.map +1 -1
  133. package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -7
  134. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  135. package/es/scenegraph/graphic/group.d.ts +1 -1
  136. package/es/scenegraph/graphic/group.js.map +1 -1
  137. package/es/scenegraph/group-creater/cell-type/image-cell.js +21 -17
  138. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  139. package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  140. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  141. package/es/scenegraph/group-creater/cell-type/video-cell.js +18 -15
  142. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  143. package/es/scenegraph/group-creater/column-helper.js +1 -1
  144. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  145. package/es/scenegraph/group-creater/progress/proxy.js +4 -2
  146. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  147. package/es/scenegraph/layout/compute-col-width.js +2 -1
  148. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  149. package/es/scenegraph/layout/update-height.js +2 -2
  150. package/es/scenegraph/layout/update-height.js.map +1 -1
  151. package/es/scenegraph/scenegraph.js +10 -3
  152. package/es/scenegraph/scenegraph.js.map +1 -1
  153. package/es/scenegraph/utils/text-icon-layout.js +4 -4
  154. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  155. package/es/scenegraph/utils/text-measure.js +3 -1
  156. package/es/scenegraph/utils/text-measure.js.map +1 -1
  157. package/es/state/cell-move/index.js +2 -1
  158. package/es/state/cell-move/index.js.map +1 -1
  159. package/es/state/checkbox/checkbox.d.ts +1 -0
  160. package/es/state/checkbox/checkbox.js +10 -0
  161. package/es/state/checkbox/checkbox.js.map +1 -1
  162. package/es/state/radio/radio.d.ts +1 -0
  163. package/es/state/radio/radio.js +10 -0
  164. package/es/state/radio/radio.js.map +1 -1
  165. package/es/state/state.d.ts +1 -0
  166. package/es/state/state.js +7 -3
  167. package/es/state/state.js.map +1 -1
  168. package/es/themes/theme.js +3 -0
  169. package/es/themes/theme.js.map +1 -1
  170. package/es/tools/get-data-path/create-dataset.js +6 -2
  171. package/es/tools/get-data-path/create-dataset.js.map +1 -1
  172. package/es/tools/helper.js +2 -2
  173. package/es/tools/helper.js.map +1 -1
  174. package/es/ts-types/base-table.d.ts +10 -0
  175. package/es/ts-types/base-table.js.map +1 -1
  176. package/es/ts-types/common.d.ts +6 -0
  177. package/es/ts-types/common.js.map +1 -1
  178. package/es/ts-types/events.d.ts +4 -1
  179. package/es/ts-types/events.js.map +1 -1
  180. package/es/ts-types/table-engine.d.ts +2 -0
  181. package/es/ts-types/table-engine.js.map +1 -1
  182. package/es/ts-types/theme.d.ts +1 -0
  183. package/es/ts-types/theme.js.map +1 -1
  184. package/es/vrender.js.map +1 -1
  185. package/package.json +3 -3
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8F1D,4FA9FO,qBAAW,OA8FP;AA7Fb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAqDlC,sBAAK;AApDP,6CAA+B;AAqD7B,oBAAI;AApDN,6CAA+B;AA4E7B,oBAAI;AA3EN,+CAAiC;AACjC,qDAAuC;AA+ErC,4BAAQ;AA9EV,iDAAmC;AAwEjC,wBAAM;AAvER,yEAA2D;AAiFzD,wCAAc;AA3DhB,2CAAwC;AA2BtC,0FA3BO,qBAAS,OA2BP;AA1BX,6CAA0C;AA4BxC,2FA5BO,uBAAU,OA4BP;AA3BZ,6CAA0C;AA8BxC,2FA9BO,uBAAU,OA8BP;AA5BZ,8DAAgD;AAwD9C,oCAAY;AAtDd,wEAAoE;AAuDlE,2FAvDO,wBAAU,OAuDP;AAtDZ,gGAAqF;AAuDnF,4FAvDO,iCAAW,OAuDP;AAtDb,kEAA+F;AAyD7F,mGAzDO,iCAAkB,OAyDP;AADlB,yGAxD2B,uCAAwB,OAwD3B;AAnD1B,uDAAwD;AAA/C,gHAAA,eAAe,OAAA;AACxB,+CAA6B;AAEhB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAqDxC,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AArBC,4BAAQ;AAuBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AA1BC,kCAAW;AA2Bb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"0.26.0-alpha.1\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8F1D,4FA9FO,qBAAW,OA8FP;AA7Fb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAqDlC,sBAAK;AApDP,6CAA+B;AAqD7B,oBAAI;AApDN,6CAA+B;AA4E7B,oBAAI;AA3EN,+CAAiC;AACjC,qDAAuC;AA+ErC,4BAAQ;AA9EV,iDAAmC;AAwEjC,wBAAM;AAvER,yEAA2D;AAiFzD,wCAAc;AA3DhB,2CAAwC;AA2BtC,0FA3BO,qBAAS,OA2BP;AA1BX,6CAA0C;AA4BxC,2FA5BO,uBAAU,OA4BP;AA3BZ,6CAA0C;AA8BxC,2FA9BO,uBAAU,OA8BP;AA5BZ,8DAAgD;AAwD9C,oCAAY;AAtDd,wEAAoE;AAuDlE,2FAvDO,wBAAU,OAuDP;AAtDZ,gGAAqF;AAuDnF,4FAvDO,iCAAW,OAuDP;AAtDb,kEAA+F;AAyD7F,mGAzDO,iCAAkB,OAyDP;AADlB,yGAxD2B,uCAAwB,OAwD3B;AAnD1B,uDAAwD;AAA/C,gHAAA,eAAe,OAAA;AACxB,+CAA6B;AAEhB,QAAA,OAAO,GAAG,eAAe,CAAC;AAqDvC,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AArBC,4BAAQ;AAuBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AA1BC,kCAAW;AA2Bb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"1.0.0-alpha.3\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { PivotTable } from '../PivotTable';
2
- import type { PivotTableConstructorOptions } from '../ts-types';
2
+ import type { PivotTableConstructorOptions, IHeaderTreeDefine, IIndicator } from '../ts-types';
3
3
  import type { SimpleHeaderLayoutMap } from './simple-header-layout';
4
4
  import { DimensionTree } from './tree-helper';
5
5
  export declare function checkHasAggregation(layoutMap: SimpleHeaderLayoutMap): boolean;
@@ -10,8 +10,7 @@ export declare function parseColKeyRowKeyForPivotTable(table: PivotTable, option
10
10
  rowKeys: string[];
11
11
  columnKeys: string[];
12
12
  indicatorKeys: string[];
13
- isNeedResetColumnDimensionTree: boolean;
14
- isNeedResetRowDimensionTree: boolean;
15
13
  columnDimensionTree: DimensionTree;
16
14
  rowDimensionTree: DimensionTree;
17
15
  };
16
+ export declare function supplementIndicatorNodesForCustomTree(customTree: IHeaderTreeDefine[], indicators: (string | IIndicator)[]): IHeaderTreeDefine[];
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.parseColKeyRowKeyForPivotTable = exports.checkHasTreeDefine = exports.checkHasAggregationOnBottom = exports.checkHasAggregationOnTop = exports.checkHasAggregation = void 0;
5
+ }), exports.supplementIndicatorNodesForCustomTree = exports.parseColKeyRowKeyForPivotTable = exports.checkHasTreeDefine = exports.checkHasAggregationOnBottom = exports.checkHasAggregationOnTop = exports.checkHasAggregation = void 0;
6
6
 
7
- const global_1 = require("../tools/global"), ts_types_1 = require("../ts-types"), tree_helper_1 = require("./tree-helper");
7
+ const ts_types_1 = require("../ts-types"), tree_helper_1 = require("./tree-helper");
8
8
 
9
9
  function checkHasAggregation(layoutMap) {
10
10
  const columnObjects = layoutMap.columnObjects;
@@ -46,15 +46,15 @@ function checkHasTreeDefine(layoutMap) {
46
46
  }
47
47
 
48
48
  function parseColKeyRowKeyForPivotTable(table, options) {
49
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
50
- let columnDimensionTree, rowDimensionTree, isNeedResetColumnDimensionTree = !0, isNeedResetRowDimensionTree = !0;
51
- options.columnTree && (columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_a = table.internalProps.columnTree) && void 0 !== _a ? _a : [], table.layoutNodeId),
52
- isNeedResetColumnDimensionTree = !1 !== table.options.indicatorsAsCol && !columnDimensionTree.dimensionKeys.contain(global_1.IndicatorDimensionKeyPlaceholder) && (null === (_b = options.indicators) || void 0 === _b ? void 0 : _b.length) >= 1),
53
- options.rowTree && (rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_c = table.internalProps.rowTree) && void 0 !== _c ? _c : [], table.layoutNodeId, table.options.rowHierarchyType, "tree" === table.options.rowHierarchyType ? null !== (_d = table.options.rowExpandLevel) && void 0 !== _d ? _d : 1 : void 0),
54
- isNeedResetRowDimensionTree = !1 === table.options.indicatorsAsCol && !rowDimensionTree.dimensionKeys.contain(global_1.IndicatorDimensionKeyPlaceholder) && (null === (_e = options.indicators) || void 0 === _e ? void 0 : _e.length) >= 1);
55
- const rowKeys = (null === (_f = null == rowDimensionTree ? void 0 : rowDimensionTree.dimensionKeys) || void 0 === _f ? void 0 : _f.count) ? rowDimensionTree.dimensionKeys.valueArr() : null !== (_h = null === (_g = options.rows) || void 0 === _g ? void 0 : _g.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
56
- keys)), [])) && void 0 !== _h ? _h : [], columnKeys = (null === (_j = null == columnDimensionTree ? void 0 : columnDimensionTree.dimensionKeys) || void 0 === _j ? void 0 : _j.count) ? columnDimensionTree.dimensionKeys.valueArr() : null !== (_l = null === (_k = options.columns) || void 0 === _k ? void 0 : _k.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
57
- keys)), [])) && void 0 !== _l ? _l : [], indicatorKeys = null !== (_o = null === (_m = options.indicators) || void 0 === _m ? void 0 : _m.reduce(((keys, indicatorObj) => {
49
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
50
+ let columnDimensionTree, rowDimensionTree;
51
+ options.columnTree && (!1 !== table.options.indicatorsAsCol && !1 !== table.options.supplementIndicatorNodes && (table.internalProps.columnTree = supplementIndicatorNodesForCustomTree(table.internalProps.columnTree, options.indicators)),
52
+ columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_a = table.internalProps.columnTree) && void 0 !== _a ? _a : [], table.layoutNodeId)),
53
+ options.rowTree && (!1 === table.options.indicatorsAsCol && !1 !== table.options.supplementIndicatorNodes && (table.internalProps.rowTree = supplementIndicatorNodesForCustomTree(table.internalProps.rowTree, options.indicators)),
54
+ rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_b = table.internalProps.rowTree) && void 0 !== _b ? _b : [], table.layoutNodeId, table.options.rowHierarchyType, "tree" === table.options.rowHierarchyType ? null !== (_c = table.options.rowExpandLevel) && void 0 !== _c ? _c : 1 : void 0));
55
+ const rowKeys = (null === (_d = null == rowDimensionTree ? void 0 : rowDimensionTree.dimensionKeys) || void 0 === _d ? void 0 : _d.count) ? rowDimensionTree.dimensionKeys.valueArr() : null !== (_f = null === (_e = options.rows) || void 0 === _e ? void 0 : _e.reduce(((keys, rowObj) => ("string" == typeof rowObj ? keys.push(rowObj) : keys.push(rowObj.dimensionKey),
56
+ keys)), [])) && void 0 !== _f ? _f : [], columnKeys = (null === (_g = null == columnDimensionTree ? void 0 : columnDimensionTree.dimensionKeys) || void 0 === _g ? void 0 : _g.count) ? columnDimensionTree.dimensionKeys.valueArr() : null !== (_j = null === (_h = options.columns) || void 0 === _h ? void 0 : _h.reduce(((keys, columnObj) => ("string" == typeof columnObj ? keys.push(columnObj) : keys.push(columnObj.dimensionKey),
57
+ keys)), [])) && void 0 !== _j ? _j : [], indicatorKeys = null !== (_l = null === (_k = options.indicators) || void 0 === _k ? void 0 : _k.reduce(((keys, indicatorObj) => {
58
58
  var _a, _b;
59
59
  return "string" == typeof indicatorObj ? keys.push(indicatorObj) : (keys.push(indicatorObj.indicatorKey),
60
60
  indicatorObj.chartSpec && ((null === (_a = table.internalProps.dataConfig) || void 0 === _a ? void 0 : _a.aggregationRules) ? null === (_b = table.internalProps.dataConfig) || void 0 === _b || _b.aggregationRules.push({
@@ -72,8 +72,8 @@ function parseColKeyRowKeyForPivotTable(table, options) {
72
72
  aggregationType: ts_types_1.AggregationType.NONE
73
73
  } ]
74
74
  })), keys;
75
- }), [])) && void 0 !== _o ? _o : [];
76
- return "tree" === options.rowHierarchyType && (null !== (_q = null === (_p = options.extensionRows) || void 0 === _p ? void 0 : _p.length) && void 0 !== _q ? _q : 0) >= 1 && (null === (_r = options.extensionRows) || void 0 === _r || _r.forEach((extensionRow => {
75
+ }), [])) && void 0 !== _l ? _l : [];
76
+ return "tree" === options.rowHierarchyType && (null !== (_o = null === (_m = options.extensionRows) || void 0 === _m ? void 0 : _m.length) && void 0 !== _o ? _o : 0) >= 1 && (null === (_p = options.extensionRows) || void 0 === _p || _p.forEach((extensionRow => {
77
77
  const extension_rowKeys = [];
78
78
  extensionRow.rows.forEach((row => {
79
79
  "string" == typeof row ? extension_rowKeys.push(row) : extension_rowKeys.push(row.dimensionKey);
@@ -82,14 +82,40 @@ function parseColKeyRowKeyForPivotTable(table, options) {
82
82
  rowKeys: rowKeys,
83
83
  columnKeys: columnKeys,
84
84
  indicatorKeys: indicatorKeys,
85
- isNeedResetColumnDimensionTree: isNeedResetColumnDimensionTree,
86
- isNeedResetRowDimensionTree: isNeedResetRowDimensionTree,
87
85
  columnDimensionTree: columnDimensionTree,
88
86
  rowDimensionTree: rowDimensionTree
89
87
  };
90
88
  }
91
89
 
90
+ function supplementIndicatorNodesForCustomTree(customTree, indicators) {
91
+ const checkNode = (nodes, isHasIndicator) => {
92
+ nodes.forEach((node => {
93
+ var _a;
94
+ node.indicatorKey || isHasIndicator || (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) && node.children ? node.children && Array.isArray(node.children) && checkNode(node.children, isHasIndicator || !!node.indicatorKey) : node.children = null == indicators ? void 0 : indicators.map((indicator => {
95
+ var _a;
96
+ return "string" == typeof indicator ? {
97
+ indicatorKey: indicator,
98
+ value: indicator
99
+ } : {
100
+ indicatorKey: indicator.indicatorKey,
101
+ value: null !== (_a = indicator.title) && void 0 !== _a ? _a : indicator.indicatorKey
102
+ };
103
+ }));
104
+ }));
105
+ };
106
+ return (null == customTree ? void 0 : customTree.length) ? checkNode(customTree, !1) : customTree = null == indicators ? void 0 : indicators.map((indicator => {
107
+ var _a;
108
+ return "string" == typeof indicator ? {
109
+ indicatorKey: indicator,
110
+ value: indicator
111
+ } : {
112
+ indicatorKey: indicator.indicatorKey,
113
+ value: null !== (_a = indicator.title) && void 0 !== _a ? _a : indicator.indicatorKey
114
+ };
115
+ })), customTree;
116
+ }
117
+
92
118
  exports.checkHasAggregation = checkHasAggregation, exports.checkHasAggregationOnTop = checkHasAggregationOnTop,
93
119
  exports.checkHasAggregationOnBottom = checkHasAggregationOnBottom, exports.checkHasTreeDefine = checkHasTreeDefine,
94
- exports.parseColKeyRowKeyForPivotTable = parseColKeyRowKeyForPivotTable;
120
+ exports.parseColKeyRowKeyForPivotTable = parseColKeyRowKeyForPivotTable, exports.supplementIndicatorNodesForCustomTree = supplementIndicatorNodesForCustomTree;
95
121
  //# sourceMappingURL=layout-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/layout/layout-helper.ts"],"names":[],"mappings":";;;AACA,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OAAO,GAAG,KAAK,QAAQ,EAAE;oBAC3B,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBAC7B;qBAAM;oBACL,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;iBAC1C;YACH,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;KACJ;IACD,OAAO;QACL,OAAO;QACP,UAAU;QACV,aAAa;QACb,8BAA8B;QAC9B,2BAA2B;QAC3B,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAnHD,wEAmHC","file":"layout-helper.js","sourcesContent":["import type { PivotTable } from '../PivotTable';\nimport { IndicatorDimensionKeyPlaceholder } from '../tools/global';\nimport { AggregationType } from '../ts-types';\nimport type { PivotTableConstructorOptions, Aggregation } from '../ts-types';\nimport type { ColumnData } from '../ts-types/list-table/layout-map/api';\nimport type { IChartColumnIndicator } from '../ts-types/pivot-table/indicator/chart-indicator';\nimport type { SimpleHeaderLayoutMap } from './simple-header-layout';\nimport type { ITreeLayoutHeadNode } from './tree-helper';\nimport { DimensionTree } from './tree-helper';\n\nexport function checkHasAggregation(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n return true;\n }\n }\n return false;\n}\n\nexport function checkHasAggregationOnTop(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n let count = 0;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n if (Array.isArray((column as ColumnData)?.aggregation)) {\n count = Math.max(\n count,\n ((column as ColumnData).aggregation as Array<Aggregation>).filter(item => item.showOnTop === true).length\n );\n } else if (((column as ColumnData).aggregation as Aggregation).showOnTop === true) {\n count = Math.max(count, 1);\n }\n }\n }\n return count;\n}\n\nexport function checkHasAggregationOnBottom(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n let count = 0;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n if (Array.isArray((column as ColumnData)?.aggregation)) {\n count = Math.max(\n count,\n ((column as ColumnData).aggregation as Array<Aggregation>).filter(item => item.showOnTop === false).length\n );\n } else if (((column as ColumnData).aggregation as Aggregation).showOnTop === false) {\n count = Math.max(count, 1);\n }\n }\n }\n return count;\n}\n\nexport function checkHasTreeDefine(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.define?.tree) {\n return true;\n }\n }\n return false;\n}\n\nexport function parseColKeyRowKeyForPivotTable(table: PivotTable, options: PivotTableConstructorOptions) {\n let columnDimensionTree;\n let rowDimensionTree;\n let isNeedResetColumnDimensionTree = true;\n let isNeedResetRowDimensionTree = true;\n if (options.columnTree) {\n columnDimensionTree = new DimensionTree(\n (table.internalProps.columnTree as ITreeLayoutHeadNode[]) ?? [],\n table.layoutNodeId\n );\n if (\n table.options.indicatorsAsCol !== false &&\n !columnDimensionTree.dimensionKeys.contain(IndicatorDimensionKeyPlaceholder) &&\n options.indicators?.length >= 1\n ) {\n isNeedResetColumnDimensionTree = true;\n } else {\n isNeedResetColumnDimensionTree = false;\n }\n }\n if (options.rowTree) {\n rowDimensionTree = new DimensionTree(\n (table.internalProps.rowTree as ITreeLayoutHeadNode[]) ?? [],\n table.layoutNodeId,\n table.options.rowHierarchyType,\n table.options.rowHierarchyType === 'tree' ? table.options.rowExpandLevel ?? 1 : undefined\n );\n if (\n table.options.indicatorsAsCol === false &&\n !rowDimensionTree.dimensionKeys.contain(IndicatorDimensionKeyPlaceholder) &&\n options.indicators?.length >= 1\n ) {\n isNeedResetRowDimensionTree = true;\n } else {\n isNeedResetRowDimensionTree = false;\n }\n }\n const rowKeys = rowDimensionTree?.dimensionKeys?.count\n ? rowDimensionTree.dimensionKeys.valueArr()\n : options.rows?.reduce((keys: string[], rowObj) => {\n if (typeof rowObj === 'string') {\n keys.push(rowObj);\n } else {\n keys.push(rowObj.dimensionKey);\n }\n return keys;\n }, []) ?? [];\n const columnKeys = columnDimensionTree?.dimensionKeys?.count\n ? columnDimensionTree.dimensionKeys.valueArr()\n : options.columns?.reduce((keys: string[], columnObj) => {\n if (typeof columnObj === 'string') {\n keys.push(columnObj);\n } else {\n keys.push(columnObj.dimensionKey);\n }\n return keys;\n }, []) ?? [];\n const indicatorKeys =\n options.indicators?.reduce((keys: string[], indicatorObj) => {\n if (typeof indicatorObj === 'string') {\n keys.push(indicatorObj);\n } else {\n keys.push(indicatorObj.indicatorKey);\n if ((indicatorObj as IChartColumnIndicator).chartSpec) {\n if (table.internalProps.dataConfig?.aggregationRules) {\n table.internalProps.dataConfig?.aggregationRules.push({\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n });\n } else if (table.internalProps.dataConfig) {\n table.internalProps.dataConfig.aggregationRules = [\n {\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n }\n ];\n } else {\n table.internalProps.dataConfig = {\n aggregationRules: [\n {\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n }\n ]\n };\n }\n }\n }\n return keys;\n }, []) ?? [];\n if (options.rowHierarchyType === 'tree' && (options.extensionRows?.length ?? 0) >= 1) {\n options.extensionRows?.forEach(extensionRow => {\n const extension_rowKeys: string[] = [];\n extensionRow.rows.forEach(row => {\n if (typeof row === 'string') {\n extension_rowKeys.push(row);\n } else {\n extension_rowKeys.push(row.dimensionKey);\n }\n });\n rowKeys.push(...extension_rowKeys);\n });\n }\n return {\n rowKeys,\n columnKeys,\n indicatorKeys,\n isNeedResetColumnDimensionTree,\n isNeedResetRowDimensionTree,\n columnDimensionTree,\n rowDimensionTree\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/layout/layout-helper.ts"],"names":[],"mappings":";;;AAEA,0CAA8C;AAM9C,+CAA8C;AAE9C,SAAgB,mBAAmB,CAAC,SAAgC;IAClE,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;IAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,IAAK,MAAqB,aAArB,MAAM,uBAAN,MAAM,CAAiB,WAAW,EAAE;YACvC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AATD,kDASC;AAED,SAAgB,wBAAwB,CAAC,SAAgC;IACvE,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;IAC9C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,IAAK,MAAqB,aAArB,MAAM,uBAAN,MAAM,CAAiB,WAAW,EAAE;YACvC,IAAI,KAAK,CAAC,OAAO,CAAE,MAAqB,aAArB,MAAM,uBAAN,MAAM,CAAiB,WAAW,CAAC,EAAE;gBACtD,KAAK,GAAG,IAAI,CAAC,GAAG,CACd,KAAK,EACH,MAAqB,CAAC,WAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,MAAM,CAC1G,CAAC;aACH;iBAAM,IAAM,MAAqB,CAAC,WAA2B,CAAC,SAAS,KAAK,IAAI,EAAE;gBACjF,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,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACjE;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EAAE;QACtB,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;KAC9B;SAAM;QACL,UAAU,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,CAAC,CAAC,SAA8B,EAA2C,EAAE;;YACvG,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;gBACjC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;aACtD;YACD,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,MAAA,SAAS,CAAC,KAAK,mCAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QACpG,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAjCD,sFAiCC","file":"layout-helper.js","sourcesContent":["import type { PivotTable } from '../PivotTable';\nimport { IndicatorDimensionKeyPlaceholder } from '../tools/global';\nimport { AggregationType } from '../ts-types';\nimport type { PivotTableConstructorOptions, Aggregation, IHeaderTreeDefine, IIndicator } from '../ts-types';\nimport type { ColumnData } from '../ts-types/list-table/layout-map/api';\nimport type { IChartColumnIndicator } from '../ts-types/pivot-table/indicator/chart-indicator';\nimport type { SimpleHeaderLayoutMap } from './simple-header-layout';\nimport type { ITreeLayoutHeadNode } from './tree-helper';\nimport { DimensionTree } from './tree-helper';\n\nexport function checkHasAggregation(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n return true;\n }\n }\n return false;\n}\n\nexport function checkHasAggregationOnTop(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n let count = 0;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n if (Array.isArray((column as ColumnData)?.aggregation)) {\n count = Math.max(\n count,\n ((column as ColumnData).aggregation as Array<Aggregation>).filter(item => item.showOnTop === true).length\n );\n } else if (((column as ColumnData).aggregation as Aggregation).showOnTop === true) {\n count = Math.max(count, 1);\n }\n }\n }\n return count;\n}\n\nexport function checkHasAggregationOnBottom(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n let count = 0;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.aggregation) {\n if (Array.isArray((column as ColumnData)?.aggregation)) {\n count = Math.max(\n count,\n ((column as ColumnData).aggregation as Array<Aggregation>).filter(item => item.showOnTop === false).length\n );\n } else if (((column as ColumnData).aggregation as Aggregation).showOnTop === false) {\n count = Math.max(count, 1);\n }\n }\n }\n return count;\n}\n\nexport function checkHasTreeDefine(layoutMap: SimpleHeaderLayoutMap) {\n const columnObjects = layoutMap.columnObjects;\n for (let i = 0; i < columnObjects.length; i++) {\n const column = columnObjects[i];\n if ((column as ColumnData)?.define?.tree) {\n return true;\n }\n }\n return false;\n}\n\nexport function parseColKeyRowKeyForPivotTable(table: PivotTable, options: PivotTableConstructorOptions) {\n let columnDimensionTree;\n let rowDimensionTree;\n // let isNeedResetColumnDimensionTree = true;\n // let isNeedResetRowDimensionTree = true;\n if (options.columnTree) {\n if (table.options.indicatorsAsCol !== false && table.options.supplementIndicatorNodes !== false) {\n table.internalProps.columnTree = supplementIndicatorNodesForCustomTree(\n table.internalProps.columnTree,\n options.indicators\n );\n }\n columnDimensionTree = new DimensionTree(\n (table.internalProps.columnTree as ITreeLayoutHeadNode[]) ?? [],\n table.layoutNodeId\n );\n\n // if (\n // table.options.supplementIndicatorNodes !== false &&\n // table.options.indicatorsAsCol !== false &&\n // !columnDimensionTree.dimensionKeys.contain(IndicatorDimensionKeyPlaceholder) &&\n // options.indicators?.length >= 1\n // ) {\n // isNeedResetColumnDimensionTree = true;\n // } else {\n // isNeedResetColumnDimensionTree = false;\n // }\n // } else {\n // if (options.indicatorsAsCol !== false) {\n // table.internalProps.columnTree = supplementIndicatorNodesForCustomTree([], options.indicators);\n // }\n }\n if (options.rowTree) {\n if (table.options.indicatorsAsCol === false && table.options.supplementIndicatorNodes !== false) {\n table.internalProps.rowTree = supplementIndicatorNodesForCustomTree(\n table.internalProps.rowTree,\n options.indicators\n );\n }\n rowDimensionTree = new DimensionTree(\n (table.internalProps.rowTree as ITreeLayoutHeadNode[]) ?? [],\n table.layoutNodeId,\n table.options.rowHierarchyType,\n table.options.rowHierarchyType === 'tree' ? table.options.rowExpandLevel ?? 1 : undefined\n );\n // if (\n // table.options.supplementIndicatorNodes !== false &&\n // table.options.indicatorsAsCol === false &&\n // !rowDimensionTree.dimensionKeys.contain(IndicatorDimensionKeyPlaceholder) &&\n // options.indicators?.length >= 1\n // ) {\n // isNeedResetRowDimensionTree = true;\n // } else {\n // isNeedResetRowDimensionTree = false;\n // }\n // } else {\n // if (options.indicatorsAsCol === false) {\n // table.internalProps.rowTree = supplementIndicatorNodesForCustomTree([], options.indicators);\n // }\n }\n const rowKeys = rowDimensionTree?.dimensionKeys?.count\n ? rowDimensionTree.dimensionKeys.valueArr()\n : options.rows?.reduce((keys: string[], rowObj) => {\n if (typeof rowObj === 'string') {\n keys.push(rowObj);\n } else {\n keys.push(rowObj.dimensionKey);\n }\n return keys;\n }, []) ?? [];\n const columnKeys = columnDimensionTree?.dimensionKeys?.count\n ? columnDimensionTree.dimensionKeys.valueArr()\n : options.columns?.reduce((keys: string[], columnObj) => {\n if (typeof columnObj === 'string') {\n keys.push(columnObj);\n } else {\n keys.push(columnObj.dimensionKey);\n }\n return keys;\n }, []) ?? [];\n const indicatorKeys =\n options.indicators?.reduce((keys: string[], indicatorObj) => {\n if (typeof indicatorObj === 'string') {\n keys.push(indicatorObj);\n } else {\n keys.push(indicatorObj.indicatorKey);\n if ((indicatorObj as IChartColumnIndicator).chartSpec) {\n if (table.internalProps.dataConfig?.aggregationRules) {\n table.internalProps.dataConfig?.aggregationRules.push({\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n });\n } else if (table.internalProps.dataConfig) {\n table.internalProps.dataConfig.aggregationRules = [\n {\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n }\n ];\n } else {\n table.internalProps.dataConfig = {\n aggregationRules: [\n {\n field: indicatorObj.indicatorKey,\n indicatorKey: indicatorObj.indicatorKey,\n aggregationType: AggregationType.NONE\n }\n ]\n };\n }\n }\n }\n return keys;\n }, []) ?? [];\n if (options.rowHierarchyType === 'tree' && (options.extensionRows?.length ?? 0) >= 1) {\n options.extensionRows?.forEach(extensionRow => {\n const extension_rowKeys: string[] = [];\n extensionRow.rows.forEach(row => {\n if (typeof row === 'string') {\n extension_rowKeys.push(row);\n } else {\n extension_rowKeys.push(row.dimensionKey);\n }\n });\n rowKeys.push(...extension_rowKeys);\n });\n }\n return {\n rowKeys,\n columnKeys,\n indicatorKeys,\n // isNeedResetColumnDimensionTree,\n // isNeedResetRowDimensionTree,\n columnDimensionTree,\n rowDimensionTree\n };\n}\n\nexport function supplementIndicatorNodesForCustomTree(\n customTree: IHeaderTreeDefine[],\n indicators: (string | IIndicator)[]\n) {\n const checkNode = (nodes: IHeaderTreeDefine[], isHasIndicator: boolean) => {\n nodes.forEach((node: IHeaderTreeDefine) => {\n if (\n !node.indicatorKey &&\n !isHasIndicator &&\n (!(node.children as IHeaderTreeDefine[])?.length || !node.children)\n ) {\n node.children = indicators?.map((indicator: IIndicator | string): { indicatorKey: string; value: string } => {\n if (typeof indicator === 'string') {\n return { indicatorKey: indicator, value: indicator };\n }\n return { indicatorKey: indicator.indicatorKey, value: indicator.title ?? indicator.indicatorKey };\n });\n } else if (node.children && Array.isArray(node.children)) {\n checkNode(node.children, isHasIndicator || !!node.indicatorKey);\n }\n });\n };\n if (customTree?.length) {\n checkNode(customTree, false);\n } else {\n customTree = indicators?.map((indicator: IIndicator | string): { indicatorKey: string; value: string } => {\n if (typeof indicator === 'string') {\n return { indicatorKey: indicator, value: indicator };\n }\n return { indicatorKey: indicator.indicatorKey, value: indicator.title ?? indicator.indicatorKey };\n });\n }\n return customTree;\n}\n"]}
@@ -18,6 +18,10 @@ export declare class PivotHeaderLayoutMap implements LayoutMapAPI {
18
18
  cornerHeaderObjs: HeaderData[];
19
19
  columnHeaderObjs: HeaderData[];
20
20
  rowHeaderObjs: HeaderData[];
21
+ private _cornerHeaderCellFullPathIds;
22
+ private _columnHeaderCellFullPathIds;
23
+ private _rowHeaderCellFullPathIds;
24
+ private _rowHeaderCellFullPathIds_FULL;
21
25
  private _cornerHeaderCellIds;
22
26
  private _columnHeaderCellIds;
23
27
  private _rowHeaderCellIds;
@@ -227,4 +231,5 @@ export declare class PivotHeaderLayoutMap implements LayoutMapAPI {
227
231
  getSeriesNumberHeader(col: number, row: number): SeriesNumberColumnData;
228
232
  getSeriesNumberBody(col: number, row: number): SeriesNumberColumnData;
229
233
  changeTreeNodeTitle(col: number, row: number, value: string): void;
234
+ generateCellIdsConsiderHideHeader(): void;
230
235
  }
@@ -13,15 +13,17 @@ class PivotHeaderLayoutMap {
13
13
  constructor(table, dataset, columnDimensionTree, rowDimensionTree) {
14
14
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
15
15
  if (this.colIndex = 0, this._showHeader = !0, this.columnHeaderObjs = [], this.rowHeaderObjs = [],
16
- this._cornerHeaderCellIds = [], this._columnHeaderCellIds = [], this._rowHeaderCellIds = [],
17
- this._rowHeaderCellIds_FULL = [], this._columnWidths = [], this.columnPaths = [],
18
- this._headerObjects = [], this._headerObjectMap = {}, this._indicators = [], this.indicatorsAsCol = !0,
19
- this.hideIndicatorName = !1, this._showRowHeader = !0, this._showColumnHeader = !0,
20
- this._indicatorShowType = "column", this.rowHierarchyTextStartAlignment = !1, this.rowDimensionKeys = [],
21
- this.colDimensionKeys = [], this.indicatorKeys = [], this.indicatorDimensionKey = global_1.IndicatorDimensionKeyPlaceholder,
22
- this._rowHeaderExtensionTree = {}, this._extensionRowDimensionKeys = [], this.fullRowDimensionKeys = [],
23
- this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0,
24
- this.sharedVar = table.layoutNodeId, this._table = table, "tree" === table.options.rowHierarchyType && (this.extensionRows = table.options.extensionRows),
16
+ this._cornerHeaderCellFullPathIds = [], this._columnHeaderCellFullPathIds = [],
17
+ this._rowHeaderCellFullPathIds = [], this._rowHeaderCellFullPathIds_FULL = [], this._cornerHeaderCellIds = [],
18
+ this._columnHeaderCellIds = [], this._rowHeaderCellIds = [], this._rowHeaderCellIds_FULL = [],
19
+ this._columnWidths = [], this.columnPaths = [], this._headerObjects = [], this._headerObjectMap = {},
20
+ this._indicators = [], this.indicatorsAsCol = !0, this.hideIndicatorName = !1, this._showRowHeader = !0,
21
+ this._showColumnHeader = !0, this._indicatorShowType = "column", this.rowHierarchyTextStartAlignment = !1,
22
+ this.rowDimensionKeys = [], this.colDimensionKeys = [], this.indicatorKeys = [],
23
+ this.indicatorDimensionKey = global_1.IndicatorDimensionKeyPlaceholder, this._rowHeaderExtensionTree = {},
24
+ this._extensionRowDimensionKeys = [], this.fullRowDimensionKeys = [], this.leftRowSeriesNumberColumnCount = 0,
25
+ this.rightRowSeriesNumberColumnCount = 0, this.sharedVar = table.layoutNodeId, this._table = table,
26
+ "tree" === table.options.rowHierarchyType && (this.extensionRows = table.options.extensionRows),
25
27
  this.dataset = dataset, this._largeCellRangeCache = [], this._CellHeaderPathMap = new Map,
26
28
  this.rowTree = table.internalProps.rowTree, this.columnTree = table.internalProps.columnTree,
27
29
  this.rowsDefine = null !== (_a = table.internalProps.rows) && void 0 !== _a ? _a : [],
@@ -52,8 +54,8 @@ class PivotHeaderLayoutMap {
52
54
  if (!axes.length || axes.every((axis => axis.orient !== (this.indicatorsAsCol ? "top" : "right") || !1 !== axis.visible))) return !0;
53
55
  }
54
56
  return !1;
55
- }))), this.resetColumnHeaderLevelCount(), this._rowHeaderCellIds_FULL = (0, util_1.transpose)(this._rowHeaderCellIds_FULL),
56
- "tree" === table.options.rowHierarchyType && (null === (_o = this.extensionRows) || void 0 === _o ? void 0 : _o.length) >= 1 && (this.generateExtensionRowTree(),
57
+ }))), this.resetColumnHeaderLevelCount(), this._rowHeaderCellFullPathIds_FULL = (0,
58
+ util_1.transpose)(this._rowHeaderCellFullPathIds_FULL), "tree" === table.options.rowHierarchyType && (null === (_o = this.extensionRows) || void 0 === _o ? void 0 : _o.length) >= 1 && (this.generateExtensionRowTree(),
57
59
  this.extensionRows.forEach((extensionRow => {
58
60
  const rowKeys = [];
59
61
  extensionRow.rows.forEach((row => {
@@ -76,8 +78,9 @@ class PivotHeaderLayoutMap {
76
78
  } else this.cornerHeaderObjs = this._addCornerHeaders(null, void 0);
77
79
  this.colIndex = 0, this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
78
80
  o)), {}), this.indicatorsAsCol && !this.hideIndicatorName ? this._indicatorShowType = "column" : this.indicatorsAsCol || this.hideIndicatorName ? this._indicatorShowType = "none" : this._indicatorShowType = "row",
79
- this.setPagination(table.options.pagination), this._table.isPivotChart() && (this._chartItemSpanSize = 0,
80
- this._chartItemBandSize = 0, this._indicators.find((indicatorObject => {
81
+ this.generateCellIdsConsiderHideHeader(), this.setPagination(table.options.pagination),
82
+ this._table.isPivotChart() && (this._chartItemSpanSize = 0, this._chartItemBandSize = 0,
83
+ this._indicators.find((indicatorObject => {
81
84
  var _a, _b, _c, _d, _e, _f, _g, _h;
82
85
  (null === (_a = null == indicatorObject ? void 0 : indicatorObject.style) || void 0 === _a ? void 0 : _a.padding) && (this._chartPadding = indicatorObject.style.padding),
83
86
  (null === (_b = indicatorObject.chartSpec) || void 0 === _b ? void 0 : _b.barWidth) && "number" == typeof indicatorObject.chartSpec.barWidth && (this._chartItemSpanSize = null === (_c = indicatorObject.chartSpec) || void 0 === _c ? void 0 : _c.barWidth);
@@ -121,11 +124,11 @@ class PivotHeaderLayoutMap {
121
124
  }
122
125
  _generateColHeaderIds() {
123
126
  var _a, _b, _c, _d, _e, _f;
124
- if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs),
127
+ 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),
125
128
  this.columnHeaderTitle) {
126
129
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
127
130
  const id = ++this.sharedVar.seqId, firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
128
- this._columnHeaderCellIds.unshift(firstRowIds);
131
+ this._columnHeaderCellFullPathIds.unshift(firstRowIds);
129
132
  const cell = {
130
133
  id: id,
131
134
  title: "string" == typeof this.columnHeaderTitle.title ? this.columnHeaderTitle.title : this.columnsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
@@ -143,11 +146,11 @@ class PivotHeaderLayoutMap {
143
146
  }
144
147
  _generateRowHeaderIds() {
145
148
  var _a, _b, _c, _d, _e, _f, _g, _h;
146
- if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && ("tree" === this.rowHierarchyType ? this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs) : this._addHeaders(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs)),
149
+ 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)),
147
150
  this.rowHeaderTitle) {
148
151
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
149
- const id = ++this.sharedVar.seqId, firstColIds = Array(null !== (_c = null === (_b = this._rowHeaderCellIds_FULL[0]) || void 0 === _b ? void 0 : _b.length) && void 0 !== _c ? _c : this.rowDimensionTree.tree.size).fill(id);
150
- this._rowHeaderCellIds_FULL.unshift(firstColIds);
152
+ 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);
153
+ this._rowHeaderCellFullPathIds_FULL.unshift(firstColIds);
151
154
  const cell = {
152
155
  id: id,
153
156
  title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
@@ -216,10 +219,10 @@ class PivotHeaderLayoutMap {
216
219
  description: null == dimensionInfo ? void 0 : dimensionInfo.cornerDescription
217
220
  };
218
221
  if (results[id] = cell, this._headerObjects[id] = cell, "column" === this.cornerSetting.titleOnDimension) {
219
- this._cornerHeaderCellIds[key] || (this._cornerHeaderCellIds[key] = []);
220
- for (let r = 0; r < this.rowHeaderLevelCount; r++) this._cornerHeaderCellIds[key][r] = id;
221
- } else if ("row" === this.cornerSetting.titleOnDimension) for (let r = 0; r < this.columnHeaderLevelCount; r++) this._cornerHeaderCellIds[r] || (this._cornerHeaderCellIds[r] = []),
222
- this._cornerHeaderCellIds[r][key] = id;
222
+ this._cornerHeaderCellFullPathIds[key] || (this._cornerHeaderCellFullPathIds[key] = []);
223
+ for (let r = 0; r < this.rowHeaderLevelCount; r++) this._cornerHeaderCellFullPathIds[key][r] = id;
224
+ } else if ("row" === this.cornerSetting.titleOnDimension) for (let r = 0; r < this.columnHeaderLevelCount; r++) this._cornerHeaderCellFullPathIds[r] || (this._cornerHeaderCellFullPathIds[r] = []),
225
+ this._cornerHeaderCellFullPathIds[r][key] = id;
223
226
  })); else {
224
227
  const id = ++this.sharedVar.seqId, cell = {
225
228
  id: id,
@@ -236,15 +239,15 @@ class PivotHeaderLayoutMap {
236
239
  }
237
240
  };
238
241
  results[id] = cell, this._headerObjects[id] = cell;
239
- for (let r = 0; r < this.columnHeaderLevelCount; r++) for (let j = 0; j < this.rowHeaderLevelCount; j++) this._cornerHeaderCellIds[r] || (this._cornerHeaderCellIds[r] = []),
240
- this._cornerHeaderCellIds[r][j] = id;
242
+ for (let r = 0; r < this.columnHeaderLevelCount; r++) for (let j = 0; j < this.rowHeaderLevelCount; j++) this._cornerHeaderCellFullPathIds[r] || (this._cornerHeaderCellFullPathIds[r] = []),
243
+ this._cornerHeaderCellFullPathIds[r][j] = id;
241
244
  }
242
245
  return results;
243
246
  }
244
247
  generateExtensionRowTree() {
245
248
  this.extensionRows.forEach(((extensionRow, indexP) => {
246
- const old_rowHeaderCellIds = this._rowHeaderCellIds_FULL;
247
- this._rowHeaderCellIds_FULL = [], old_rowHeaderCellIds.forEach(((row_ids, index) => {
249
+ const old_rowHeaderCellIds = this._rowHeaderCellFullPathIds_FULL;
250
+ this._rowHeaderCellFullPathIds_FULL = [], old_rowHeaderCellIds.forEach(((row_ids, index) => {
248
251
  const key = row_ids[row_ids.length - 1];
249
252
  let tree, rowExtensionDimensionTree;
250
253
  if (this.colIndex = 0, "function" == typeof extensionRow.rowTree) {
@@ -259,7 +262,7 @@ class PivotHeaderLayoutMap {
259
262
  this._rowHeaderExtensionTree[key] = rowExtensionDimensionTree);
260
263
  const extensionRowTreeHeaderIds = [];
261
264
  this._addHeadersForTreeMode(extensionRowTreeHeaderIds, 0, rowExtensionDimensionTree.tree.children, [], rowExtensionDimensionTree.totalLevel, !0, extensionRow.rows, this.rowHeaderObjs);
262
- for (let i = 0; i < extensionRowTreeHeaderIds[0].length; i++) this._rowHeaderCellIds_FULL.push(row_ids.concat(extensionRowTreeHeaderIds[0][i]));
265
+ for (let i = 0; i < extensionRowTreeHeaderIds[0].length; i++) this._rowHeaderCellFullPathIds_FULL.push(row_ids.concat(extensionRowTreeHeaderIds[0][i]));
263
266
  }));
264
267
  }));
265
268
  }
@@ -476,7 +479,7 @@ class PivotHeaderLayoutMap {
476
479
  get_chart_spec_1.checkHasCartesianChart)(this.indicatorsDefine) && (count -= 1),
477
480
  void (this.columnHeaderLevelCount = count);
478
481
  }
479
- this.columnHeaderLevelCount = 0;
482
+ this.columnHeaderLevelCount = this.indicatorsAsCol ? this.hideIndicatorName ? 0 : 1 : 0;
480
483
  }
481
484
  resetRowHeaderLevelCount() {
482
485
  var _a, _b;
@@ -600,7 +603,7 @@ class PivotHeaderLayoutMap {
600
603
  const paths = this.getCellHeaderPaths(_col, _row);
601
604
  if (this.indicatorsAsCol) {
602
605
  const indicatorKey = null === (_b = null === (_a = paths.colHeaderPaths) || void 0 === _a ? void 0 : _a.find((colPath => colPath.indicatorKey))) || void 0 === _b ? void 0 : _b.indicatorKey;
603
- return null !== (_e = null !== (_d = null === (_c = this._indicators) || void 0 === _c ? void 0 : _c.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _d ? _d : this._indicators[0]) && void 0 !== _e ? _e : {
606
+ return (0, vutils_1.isValid)(indicatorKey) && null !== (_e = null !== (_d = null === (_c = this._indicators) || void 0 === _c ? void 0 : _c.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _d ? _d : this._indicators[0]) && void 0 !== _e ? _e : {
604
607
  id: "",
605
608
  field: void 0,
606
609
  indicatorKey: void 0,
@@ -609,7 +612,7 @@ class PivotHeaderLayoutMap {
609
612
  };
610
613
  }
611
614
  const indicatorKey = null === (_g = null === (_f = paths.rowHeaderPaths) || void 0 === _f ? void 0 : _f.find((rowPath => rowPath.indicatorKey))) || void 0 === _g ? void 0 : _g.indicatorKey;
612
- return null !== (_k = null !== (_j = null === (_h = this._indicators) || void 0 === _h ? void 0 : _h.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _j ? _j : this._indicators[0]) && void 0 !== _k ? _k : {
615
+ return (0, vutils_1.isValid)(indicatorKey) && null !== (_k = null !== (_j = null === (_h = this._indicators) || void 0 === _h ? void 0 : _h.find((indicator => indicator.indicatorKey === indicatorKey))) && void 0 !== _j ? _j : this._indicators[0]) && void 0 !== _k ? _k : {
613
616
  id: "",
614
617
  field: void 0,
615
618
  indicatorKey: void 0,
@@ -711,7 +714,7 @@ class PivotHeaderLayoutMap {
711
714
  let colPath = [], rowPath = [];
712
715
  if (row >= 0 && recordCol >= 0 && (colPath = this.columnDimensionTree.getTreePath(recordCol, this.showHeader && this.showColumnHeader ? row - (this.columnHeaderTitle ? 1 : 0) : this.columnDimensionTree.totalLevel)),
713
716
  col >= 0 && recordRow >= 0) if ("tree" === this.rowHierarchyType) {
714
- const row_pathIds = this._rowHeaderCellIds[recordRow];
717
+ const row_pathIds = this._rowHeaderCellFullPathIds[recordRow];
715
718
  let findTree = this.rowDimensionTree, level = 0;
716
719
  for (;findTree; ) {
717
720
  const pathIds = [];
@@ -791,18 +794,18 @@ class PivotHeaderLayoutMap {
791
794
  }
792
795
  toggleHierarchyState(col, row) {
793
796
  var _a, _b, _c, _d, _e, _f;
794
- const oldRowHeaderCellIds = this._rowHeaderCellIds_FULL.slice(0), oldRowHeaderCellPositons = oldRowHeaderCellIds.map(((id, row) => ({
797
+ const oldRowHeaderCellIds = this._rowHeaderCellFullPathIds_FULL.slice(0), oldRowHeaderCellPositons = oldRowHeaderCellIds.map(((id, row) => ({
795
798
  col: col,
796
799
  row: row + this.columnHeaderLevelCount
797
800
  }))), hd = this.getHeader(col, row);
798
801
  if (hd.define.hierarchyState = hd.define.hierarchyState === ts_types_1.HierarchyState.collapse ? ts_types_1.HierarchyState.expand : ts_types_1.HierarchyState.collapse,
799
- this.rowDimensionTree.reset(this.rowDimensionTree.tree.children, !0), this._rowHeaderCellIds_FULL = [],
802
+ this.rowDimensionTree.reset(this.rowDimensionTree.tree.children, !0), this._rowHeaderCellFullPathIds_FULL = [],
800
803
  this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr(), this.fullRowDimensionKeys = [],
801
804
  this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys),
802
- this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs),
805
+ this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine, this.rowHeaderObjs),
803
806
  this.rowHeaderTitle) {
804
807
  const id = ++this.sharedVar.seqId, firstColIds = Array(this.rowCount - this.columnHeaderLevelCount).fill(id);
805
- this._rowHeaderCellIds_FULL.unshift(firstColIds);
808
+ this._rowHeaderCellFullPathIds_FULL.unshift(firstColIds);
806
809
  const cell = {
807
810
  id: id,
808
811
  title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
@@ -819,12 +822,13 @@ class PivotHeaderLayoutMap {
819
822
  };
820
823
  this.rowHeaderObjs.push(cell), this._headerObjects[id] = cell;
821
824
  }
822
- this._rowHeaderCellIds_FULL = (0, util_1.transpose)(this._rowHeaderCellIds_FULL),
825
+ this._rowHeaderCellFullPathIds_FULL = (0, util_1.transpose)(this._rowHeaderCellFullPathIds_FULL),
823
826
  "tree" === this.rowHierarchyType && (null === (_f = this.extensionRows) || void 0 === _f ? void 0 : _f.length) >= 1 && this.generateExtensionRowTree(),
824
827
  this.colIndex = 0, this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
825
828
  o)), {}), this._CellHeaderPathMap = new Map, this._largeCellRangeCache.length = 0;
826
- const diffCell = (0, diff_cell_1.diffCellAddress)(col, row, oldRowHeaderCellIds.map((oldCellId => oldCellId[col - this.leftRowSeriesNumberColumnCount])), this._rowHeaderCellIds_FULL.map((newCellId => newCellId[col - this.leftRowSeriesNumberColumnCount])), oldRowHeaderCellPositons, this);
827
- return this._rowHeaderCellIds = this._rowHeaderCellIds_FULL.slice(), diffCell;
829
+ const diffCell = (0, diff_cell_1.diffCellAddress)(col, row, oldRowHeaderCellIds.map((oldCellId => oldCellId[col - this.leftRowSeriesNumberColumnCount])), this._rowHeaderCellFullPathIds_FULL.map((newCellId => newCellId[col - this.leftRowSeriesNumberColumnCount])), oldRowHeaderCellPositons, this);
830
+ return this.generateCellIdsConsiderHideHeader(), this.setPagination(this.pagination),
831
+ diffCell;
828
832
  }
829
833
  isHeaderForColWidth(col, row) {
830
834
  return this.isHeader(col, row);
@@ -964,10 +968,10 @@ class PivotHeaderLayoutMap {
964
968
  const targetCellRange = this.getCellRange(target.col, sourceCellRange.start.row);
965
969
  if (targetIndex = target.col >= source.col ? targetCellRange.end.col - sourceSize + 1 : targetCellRange.start.col,
966
970
  targetIndex === sourceCellRange.start.col) return null;
967
- for (let row = 0; row < this._columnHeaderCellIds.length; row++) {
968
- const sourceIds = this._columnHeaderCellIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, sourceSize);
971
+ for (let row = 0; row < this._columnHeaderCellFullPathIds.length; row++) {
972
+ const sourceIds = this._columnHeaderCellFullPathIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, sourceSize);
969
973
  sourceIds.unshift(targetIndex - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, 0),
970
- Array.prototype.splice.apply(this._columnHeaderCellIds[row], sourceIds);
974
+ Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[row], sourceIds);
971
975
  }
972
976
  const sourceColumns = this._columnWidths.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
973
977
  return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0),
@@ -988,8 +992,12 @@ class PivotHeaderLayoutMap {
988
992
  targetIndex === sourceCellRange.start.row - this.columnHeaderLevelCount) return null;
989
993
  const sourceIds = this._rowHeaderCellIds.splice(sourceCellRange.start.row - this.columnHeaderLevelCount, sourceSize);
990
994
  sourceIds.unshift(targetIndex - this.currentPageStartIndex, 0), Array.prototype.splice.apply(this._rowHeaderCellIds, sourceIds);
995
+ const sourceIds0 = this._rowHeaderCellFullPathIds.splice(sourceCellRange.start.row - this.columnHeaderLevelCount, sourceSize);
996
+ sourceIds0.unshift(targetIndex - this.currentPageStartIndex, 0), Array.prototype.splice.apply(this._rowHeaderCellFullPathIds, sourceIds0);
991
997
  const sourceIds_FULL = this._rowHeaderCellIds_FULL.splice(sourceCellRange.start.row - this.columnHeaderLevelCount + this.currentPageStartIndex, sourceSize);
992
- return sourceIds_FULL.unshift(targetIndex, 0), Array.prototype.splice.apply(this._rowHeaderCellIds_FULL, sourceIds_FULL),
998
+ sourceIds_FULL.unshift(targetIndex, 0), Array.prototype.splice.apply(this._rowHeaderCellIds_FULL, sourceIds_FULL);
999
+ const sourceIds_FULL0 = this._rowHeaderCellFullPathIds_FULL.splice(sourceCellRange.start.row - this.columnHeaderLevelCount + this.currentPageStartIndex, sourceSize);
1000
+ return sourceIds_FULL0.unshift(targetIndex, 0), Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL, sourceIds_FULL0),
993
1001
  this.rowDimensionTree.movePosition(sourceRowHeaderPaths.length - 1, sourceCellRange.start.row - this.columnHeaderLevelCount, targetIndex + (target.row > source.row ? sourceRowHeaderNode.size - 1 : 0)),
994
1002
  this.rowDimensionTree.reset(this.rowDimensionTree.tree.children, !0), this._CellHeaderPathMap = new Map,
995
1003
  this._largeCellRangeCache.length = 0, {
@@ -1140,17 +1148,19 @@ class PivotHeaderLayoutMap {
1140
1148
  return (0, get_chart_spec_1.getChartDataId)(col, row, this);
1141
1149
  }
1142
1150
  setPagination(pagination) {
1143
- var _a, _b, _c, _d, _e;
1151
+ var _a, _b, _c, _d, _e, _f, _g;
1144
1152
  if (this.clearCellRangeMap(), this.pagination = pagination, "grid" === this.rowHierarchyType && (0,
1145
1153
  vutils_1.isValid)(null === (_a = this.pagination) || void 0 === _a ? void 0 : _a.perPageCount) && (0,
1146
1154
  vutils_1.isValid)(null === (_b = this.pagination) || void 0 === _b ? void 0 : _b.currentPage)) {
1147
1155
  !1 === this.indicatorsAsCol && (this.pagination.perPageCount = Math.ceil(this.pagination.perPageCount / this.indicatorKeys.length) * this.indicatorKeys.length);
1148
1156
  const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
1149
1157
  this.currentPageStartIndex = perPageCount * (currentPage || 0), this.currentPageEndIndex = this.currentPageStartIndex + perPageCount,
1150
- this._rowHeaderCellIds = null === (_c = this._rowHeaderCellIds_FULL) || void 0 === _c ? void 0 : _c.slice(this.currentPageStartIndex, this.currentPageEndIndex);
1158
+ this._rowHeaderCellIds = null === (_c = this._rowHeaderCellIds_FULL) || void 0 === _c ? void 0 : _c.slice(this.currentPageStartIndex, this.currentPageEndIndex),
1159
+ this._rowHeaderCellFullPathIds = null === (_d = this._rowHeaderCellFullPathIds_FULL) || void 0 === _d ? void 0 : _d.slice(this.currentPageStartIndex, this.currentPageEndIndex);
1151
1160
  } else this.currentPageStartIndex = 0, this.currentPageEndIndex = this._rowHeaderCellIds_FULL.length,
1152
- this._rowHeaderCellIds = null === (_d = this._rowHeaderCellIds_FULL) || void 0 === _d ? void 0 : _d.slice(this.currentPageStartIndex, this.currentPageEndIndex);
1153
- this.pagination && (this.pagination.totalCount = null === (_e = this._rowHeaderCellIds_FULL) || void 0 === _e ? void 0 : _e.length);
1161
+ this._rowHeaderCellIds = null === (_e = this._rowHeaderCellIds_FULL) || void 0 === _e ? void 0 : _e.slice(this.currentPageStartIndex, this.currentPageEndIndex),
1162
+ this._rowHeaderCellFullPathIds = null === (_f = this._rowHeaderCellFullPathIds_FULL) || void 0 === _f ? void 0 : _f.slice(this.currentPageStartIndex, this.currentPageEndIndex);
1163
+ this.pagination && (this.pagination.totalCount = null === (_g = this._rowHeaderCellIds_FULL) || void 0 === _g ? void 0 : _g.length);
1154
1164
  }
1155
1165
  release() {
1156
1166
  var _a;
@@ -1365,14 +1375,14 @@ class PivotHeaderLayoutMap {
1365
1375
  }
1366
1376
  resetHeaderTree() {
1367
1377
  var _a, _b;
1368
- this._rowHeaderCellIds_FULL = [], this._columnHeaderCellIds = [];
1378
+ this._rowHeaderCellFullPathIds_FULL = [], this._columnHeaderCellIds = [];
1369
1379
  const dataset = this.dataset;
1370
1380
  this.rowTree = dataset.rowHeaderTree, this.columnTree = dataset.colHeaderTree, this.columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_a = this.columnTree) && void 0 !== _a ? _a : [], this.sharedVar),
1371
1381
  this.rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_b = this.rowTree) && void 0 !== _b ? _b : [], this.sharedVar, this.rowHierarchyType, "tree" === this.rowHierarchyType ? this.rowExpandLevel : void 0),
1372
1382
  this._generateColHeaderIds(), this.colIndex = 0, this._generateRowHeaderIds(), this.resetColumnHeaderLevelCount(),
1373
- this._rowHeaderCellIds_FULL = (0, util_1.transpose)(this._rowHeaderCellIds_FULL),
1383
+ this._rowHeaderCellFullPathIds_FULL = (0, util_1.transpose)(this._rowHeaderCellFullPathIds_FULL),
1374
1384
  this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e, o)), {}),
1375
- this.setPagination(this.pagination);
1385
+ this.generateCellIdsConsiderHideHeader(), this.setPagination(this.pagination);
1376
1386
  }
1377
1387
  isSeriesNumberInHeader(col, row) {
1378
1388
  return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount && row < this.headerLevelCount || this.rightRowSeriesNumberColumnCount > 0 && row >= 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row < this.headerLevelCount;
@@ -1396,6 +1406,38 @@ class PivotHeaderLayoutMap {
1396
1406
  const id = this.getCellId(col, row);
1397
1407
  this._headerObjectMap[id].title = value;
1398
1408
  }
1409
+ generateCellIdsConsiderHideHeader() {
1410
+ if (this._columnHeaderCellIds = this._columnHeaderCellFullPathIds.slice(), !this.showColumnHeader) if (this.indicatorsAsCol && !this.hideIndicatorName) {
1411
+ const indicatorIndex = this.colDimensionKeys.indexOf(global_1.IndicatorDimensionKeyPlaceholder), indicatorIds = this._columnHeaderCellIds.splice(indicatorIndex, 1);
1412
+ this._columnHeaderCellIds.splice(0, this._columnHeaderCellIds.length), this._columnHeaderCellIds.push(indicatorIds[0]);
1413
+ } else this._columnHeaderCellIds.splice(0, this._columnHeaderCellIds.length);
1414
+ if (this._rowHeaderCellIds_FULL = this._rowHeaderCellFullPathIds_FULL.slice(), !this.showRowHeader) if (this.indicatorsAsCol || this.hideIndicatorName) this._rowHeaderCellIds_FULL.forEach(((cellIds, index) => {
1415
+ const _cellIds = cellIds.slice();
1416
+ _cellIds.splice(0, _cellIds.length), this._rowHeaderCellIds_FULL[index] = _cellIds;
1417
+ })); else {
1418
+ const indicatorIndex = this.rowDimensionKeys.indexOf(global_1.IndicatorDimensionKeyPlaceholder);
1419
+ this._rowHeaderCellIds_FULL.forEach(((cellIds, index) => {
1420
+ const _cellIds = cellIds.slice(), indicator = _cellIds.splice(indicatorIndex, 1);
1421
+ _cellIds.splice(0, _cellIds.length), _cellIds.push(indicator[0]), this._rowHeaderCellIds_FULL[index] = _cellIds;
1422
+ }));
1423
+ }
1424
+ if (this._rowHeaderCellIds = this._rowHeaderCellIds_FULL.slice(), this._cornerHeaderCellIds = this._cornerHeaderCellFullPathIds.slice(),
1425
+ 0 === this.rowHeaderLevelCount || 0 === this.columnHeaderLevelCount) this._cornerHeaderCellIds = []; else if ("row" !== this.cornerSetting.titleOnDimension || this.showRowHeader) {
1426
+ if ("column" === this.cornerSetting.titleOnDimension && !this.showColumnHeader) if (this.indicatorsAsCol && !this.hideIndicatorName) {
1427
+ const indicatorIndex = this.colDimensionKeys.indexOf(global_1.IndicatorDimensionKeyPlaceholder), indicatorIds = this._cornerHeaderCellIds.splice(indicatorIndex, 1);
1428
+ this._cornerHeaderCellIds.splice(0, this._cornerHeaderCellIds.length), this._cornerHeaderCellIds.push(indicatorIds[0]);
1429
+ } else this._cornerHeaderCellIds.splice(0, this._cornerHeaderCellIds.length);
1430
+ } else if (this.indicatorsAsCol || this.hideIndicatorName) this._cornerHeaderCellIds.forEach(((cellIds, index) => {
1431
+ const _cellIds = cellIds.slice();
1432
+ _cellIds.splice(0, _cellIds.length), this._cornerHeaderCellIds[index] = _cellIds;
1433
+ })); else {
1434
+ const indicatorIndex = this.rowDimensionKeys.indexOf(global_1.IndicatorDimensionKeyPlaceholder);
1435
+ this._cornerHeaderCellIds.forEach(((cellIds, index) => {
1436
+ const _cellIds = cellIds.slice(), indicator = _cellIds.splice(indicatorIndex, 1);
1437
+ _cellIds.splice(0, _cellIds.length), _cellIds.push(indicator[0]), this._cornerHeaderCellIds[index] = _cellIds;
1438
+ }));
1439
+ }
1440
+ }
1399
1441
  }
1400
1442
 
1401
1443
  function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {