@visactor/vtable 0.21.4-alpha.4 → 0.22.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 (209) hide show
  1. package/cjs/ListTable.d.ts +2 -4
  2. package/cjs/ListTable.js +37 -28
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -0
  5. package/cjs/PivotChart.js +1 -0
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +1 -0
  8. package/cjs/PivotTable.js +13 -4
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
  11. package/cjs/core/BaseTable.d.ts +14 -9
  12. package/cjs/core/BaseTable.js +44 -33
  13. package/cjs/core/BaseTable.js.map +1 -1
  14. package/cjs/core/row-series-number-helper.d.ts +8 -0
  15. package/cjs/core/row-series-number-helper.js +45 -0
  16. package/cjs/core/row-series-number-helper.js.map +1 -0
  17. package/cjs/core/style.js +2 -1
  18. package/cjs/core/tableHelper.js +1 -1
  19. package/cjs/core/tableHelper.js.map +1 -1
  20. package/cjs/data/CachedDataSource.d.ts +2 -2
  21. package/cjs/data/CachedDataSource.js +5 -5
  22. package/cjs/data/CachedDataSource.js.map +1 -1
  23. package/cjs/data/DataSource.d.ts +6 -2
  24. package/cjs/data/DataSource.js +113 -41
  25. package/cjs/data/DataSource.js.map +1 -1
  26. package/cjs/event/event.js.map +1 -1
  27. package/cjs/event/listener/table-group.js +2 -1
  28. package/cjs/event/listener/table-group.js.map +1 -1
  29. package/cjs/event/media-click.js +1 -2
  30. package/cjs/event/media-click.js.map +1 -1
  31. package/cjs/event/scroll.js +1 -0
  32. package/cjs/header-helper/header-helper.js.map +1 -1
  33. package/cjs/icons.js +14 -0
  34. package/cjs/icons.js.map +1 -1
  35. package/cjs/index.d.ts +1 -1
  36. package/cjs/index.js +1 -1
  37. package/cjs/index.js.map +1 -1
  38. package/cjs/layout/layout-helper.d.ts +1 -0
  39. package/cjs/layout/layout-helper.js +12 -2
  40. package/cjs/layout/layout-helper.js.map +1 -1
  41. package/cjs/layout/pivot-header-layout.d.ts +16 -5
  42. package/cjs/layout/pivot-header-layout.js +102 -46
  43. package/cjs/layout/pivot-header-layout.js.map +1 -1
  44. package/cjs/layout/simple-header-layout.d.ts +17 -4
  45. package/cjs/layout/simple-header-layout.js +170 -61
  46. package/cjs/layout/simple-header-layout.js.map +1 -1
  47. package/cjs/plugins/themes.js +1 -2
  48. package/cjs/scenegraph/component/cell-mover.js +1 -1
  49. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  50. package/cjs/scenegraph/component/custom.js +1 -1
  51. package/cjs/scenegraph/component/custom.js.map +1 -1
  52. package/cjs/scenegraph/component/menu.js.map +1 -1
  53. package/cjs/scenegraph/group-creater/cell-helper.d.ts +0 -1
  54. package/cjs/scenegraph/group-creater/cell-helper.js +28 -18
  55. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/column-helper.js +3 -4
  58. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +9 -2
  60. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/progress/proxy.js +1 -1
  62. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  63. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  64. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  65. package/cjs/scenegraph/layout/compute-row-height.js +2 -2
  66. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  67. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  68. package/cjs/scenegraph/layout/update-row.js +8 -2
  69. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  70. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  71. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  72. package/cjs/scenegraph/scenegraph.js +4 -3
  73. package/cjs/scenegraph/scenegraph.js.map +1 -1
  74. package/cjs/scenegraph/select/update-select-border.d.ts +1 -3
  75. package/cjs/scenegraph/select/update-select-border.js +4 -21
  76. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  77. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  78. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  79. package/cjs/state/cell-move/adjust-header.js +3 -4
  80. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  81. package/cjs/state/cell-move/index.js +15 -10
  82. package/cjs/state/cell-move/index.js.map +1 -1
  83. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  84. package/cjs/state/resize/update-resize-column.js.map +1 -1
  85. package/cjs/state/select/update-position.js +33 -6
  86. package/cjs/state/select/update-position.js.map +1 -1
  87. package/cjs/state/state.js +2 -1
  88. package/cjs/state/state.js.map +1 -1
  89. package/cjs/themes/component.js +1 -1
  90. package/cjs/ts-types/base-table.d.ts +15 -6
  91. package/cjs/ts-types/base-table.js.map +1 -1
  92. package/cjs/ts-types/icon.d.ts +4 -2
  93. package/cjs/ts-types/icon.js +3 -2
  94. package/cjs/ts-types/icon.js.map +1 -1
  95. package/cjs/ts-types/list-table/layout-map/api.d.ts +17 -3
  96. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  97. package/cjs/ts-types/new-data-set.d.ts +1 -2
  98. package/cjs/ts-types/new-data-set.js.map +1 -1
  99. package/cjs/ts-types/pivot-table/title.d.ts +5 -5
  100. package/cjs/ts-types/pivot-table/title.js.map +1 -1
  101. package/cjs/ts-types/table-engine.d.ts +30 -3
  102. package/cjs/ts-types/table-engine.js.map +1 -1
  103. package/cjs/vrender.js.map +1 -1
  104. package/dist/vtable.js +1042 -296
  105. package/dist/vtable.min.js +2 -2
  106. package/es/ListTable.d.ts +2 -4
  107. package/es/ListTable.js +37 -28
  108. package/es/ListTable.js.map +1 -1
  109. package/es/PivotChart.d.ts +1 -0
  110. package/es/PivotChart.js +1 -0
  111. package/es/PivotChart.js.map +1 -1
  112. package/es/PivotTable.d.ts +1 -0
  113. package/es/PivotTable.js +13 -4
  114. package/es/PivotTable.js.map +1 -1
  115. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  116. package/es/core/BaseTable.d.ts +14 -9
  117. package/es/core/BaseTable.js +46 -34
  118. package/es/core/BaseTable.js.map +1 -1
  119. package/es/core/row-series-number-helper.d.ts +8 -0
  120. package/es/core/row-series-number-helper.js +14 -0
  121. package/es/core/row-series-number-helper.js.map +1 -0
  122. package/es/core/style.js +2 -1
  123. package/es/core/tableHelper.js +1 -1
  124. package/es/core/tableHelper.js.map +1 -1
  125. package/es/data/CachedDataSource.d.ts +2 -2
  126. package/es/data/CachedDataSource.js +5 -5
  127. package/es/data/CachedDataSource.js.map +1 -1
  128. package/es/data/DataSource.d.ts +6 -2
  129. package/es/data/DataSource.js +113 -41
  130. package/es/data/DataSource.js.map +1 -1
  131. package/es/event/event.js.map +1 -1
  132. package/es/event/listener/table-group.js +3 -2
  133. package/es/event/listener/table-group.js.map +1 -1
  134. package/es/event/media-click.js +1 -2
  135. package/es/event/media-click.js.map +1 -1
  136. package/es/event/scroll.js +2 -1
  137. package/es/header-helper/header-helper.js.map +1 -1
  138. package/es/icons.js +14 -0
  139. package/es/icons.js.map +1 -1
  140. package/es/index.d.ts +1 -1
  141. package/es/index.js +1 -1
  142. package/es/index.js.map +1 -1
  143. package/es/layout/layout-helper.d.ts +1 -0
  144. package/es/layout/layout-helper.js +10 -0
  145. package/es/layout/layout-helper.js.map +1 -1
  146. package/es/layout/pivot-header-layout.d.ts +16 -5
  147. package/es/layout/pivot-header-layout.js +102 -46
  148. package/es/layout/pivot-header-layout.js.map +1 -1
  149. package/es/layout/simple-header-layout.d.ts +17 -4
  150. package/es/layout/simple-header-layout.js +170 -61
  151. package/es/layout/simple-header-layout.js.map +1 -1
  152. package/es/plugins/themes.js +1 -2
  153. package/es/scenegraph/component/cell-mover.js +1 -1
  154. package/es/scenegraph/component/cell-mover.js.map +1 -1
  155. package/es/scenegraph/component/custom.js +1 -1
  156. package/es/scenegraph/component/custom.js.map +1 -1
  157. package/es/scenegraph/component/menu.js.map +1 -1
  158. package/es/scenegraph/group-creater/cell-helper.d.ts +0 -1
  159. package/es/scenegraph/group-creater/cell-helper.js +26 -14
  160. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  161. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  162. package/es/scenegraph/group-creater/column-helper.js +5 -6
  163. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  164. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
  165. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  166. package/es/scenegraph/group-creater/progress/proxy.js +1 -1
  167. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  168. package/es/scenegraph/layout/compute-col-width.js +3 -3
  169. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  170. package/es/scenegraph/layout/compute-row-height.js +3 -3
  171. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  172. package/es/scenegraph/layout/update-height.js.map +1 -1
  173. package/es/scenegraph/layout/update-row.js +7 -2
  174. package/es/scenegraph/layout/update-row.js.map +1 -1
  175. package/es/scenegraph/layout/update-width.js.map +1 -1
  176. package/es/scenegraph/scenegraph.d.ts +1 -1
  177. package/es/scenegraph/scenegraph.js +4 -3
  178. package/es/scenegraph/scenegraph.js.map +1 -1
  179. package/es/scenegraph/select/update-select-border.d.ts +1 -3
  180. package/es/scenegraph/select/update-select-border.js +2 -18
  181. package/es/scenegraph/select/update-select-border.js.map +1 -1
  182. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  183. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  184. package/es/state/cell-move/adjust-header.js +3 -4
  185. package/es/state/cell-move/adjust-header.js.map +1 -1
  186. package/es/state/cell-move/index.js +14 -10
  187. package/es/state/cell-move/index.js.map +1 -1
  188. package/es/state/hover/is-cell-hover.js.map +1 -1
  189. package/es/state/resize/update-resize-column.js.map +1 -1
  190. package/es/state/select/update-position.js +33 -6
  191. package/es/state/select/update-position.js.map +1 -1
  192. package/es/state/state.js +2 -1
  193. package/es/state/state.js.map +1 -1
  194. package/es/themes/component.js +1 -1
  195. package/es/ts-types/base-table.d.ts +15 -6
  196. package/es/ts-types/base-table.js.map +1 -1
  197. package/es/ts-types/icon.d.ts +4 -2
  198. package/es/ts-types/icon.js +3 -2
  199. package/es/ts-types/icon.js.map +1 -1
  200. package/es/ts-types/list-table/layout-map/api.d.ts +17 -3
  201. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  202. package/es/ts-types/new-data-set.d.ts +1 -2
  203. package/es/ts-types/new-data-set.js.map +1 -1
  204. package/es/ts-types/pivot-table/title.d.ts +5 -5
  205. package/es/ts-types/pivot-table/title.js.map +1 -1
  206. package/es/ts-types/table-engine.d.ts +30 -3
  207. package/es/ts-types/table-engine.js.map +1 -1
  208. package/es/vrender.js.map +1 -1
  209. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  import type { ListTable } from '../ListTable';
2
- import type { CellAddress, CellRange, CellLocation, IListTableCellHeaderPaths, LayoutObjectId } from '../ts-types';
2
+ import type { CellAddress, CellRange, CellLocation, IListTableCellHeaderPaths, LayoutObjectId, IRowSeriesNumber } from '../ts-types';
3
3
  import type { ColumnsDefine } from '../ts-types/list-table/define';
4
- import type { ColumnData, HeaderData, LayoutMapAPI, WidthData } from '../ts-types/list-table/layout-map/api';
4
+ import type { ColumnData, HeaderData, LayoutMapAPI, SeriesNumberColumnData, WidthData } from '../ts-types/list-table/layout-map/api';
5
5
  import type { Aggregator } from '../dataset/statistics-helper';
6
6
  import { DimensionTree } from './tree-helper';
7
7
  export declare class SimpleHeaderLayoutMap implements LayoutMapAPI {
@@ -10,6 +10,11 @@ export declare class SimpleHeaderLayoutMap implements LayoutMapAPI {
10
10
  private _headerObjectMap;
11
11
  private _headerCellIds;
12
12
  private _columns;
13
+ rowSeriesNumberColumn: SeriesNumberColumnData[];
14
+ leftRowSeriesNumberColumn: SeriesNumberColumnData[];
15
+ rightRowSeriesNumberColumn: SeriesNumberColumnData[];
16
+ leftRowSeriesNumberColumnCount: number;
17
+ rightRowSeriesNumberColumnCount: number;
13
18
  columnTree: DimensionTree;
14
19
  readonly bodyRowSpanCount: number;
15
20
  hierarchyIndent?: number;
@@ -20,12 +25,19 @@ export declare class SimpleHeaderLayoutMap implements LayoutMapAPI {
20
25
  _hasAggregation: boolean;
21
26
  _hasAggregationOnTopCount: number;
22
27
  _hasAggregationOnBottomCount: number;
28
+ rowHierarchyType?: 'grid' | 'tree';
23
29
  private _cellRangeMap;
24
30
  constructor(table: ListTable, columns: ColumnsDefine, showHeader: boolean, hierarchyIndent: number);
31
+ handleRowSeriesNumber(rowSeriesNumber: IRowSeriesNumber): void;
25
32
  get transpose(): boolean;
26
33
  set transpose(_transpose: boolean);
27
34
  get showHeader(): boolean;
28
35
  set showHeader(_showHeader: boolean);
36
+ isSeriesNumberInHeader(col: number, row: number): boolean;
37
+ isSeriesNumberInBody(col: number, row: number): boolean;
38
+ isSeriesNumber(col: number, row: number): boolean;
39
+ getSeriesNumberHeader(col: number, row: number): SeriesNumberColumnData;
40
+ getSeriesNumberBody(col: number, row: number): SeriesNumberColumnData;
29
41
  isHeader(col: number, row: number): boolean;
30
42
  isAggregation(col: number, row: number): boolean;
31
43
  isTopAggregation(col: number, row: number): boolean;
@@ -73,11 +85,11 @@ export declare class SimpleHeaderLayoutMap implements LayoutMapAPI {
73
85
  get columnWidths(): WidthData[];
74
86
  getColumnWidthDefined(col: number): WidthData;
75
87
  getCellId(col: number, row: number): LayoutObjectId;
76
- getHeader(col: number, row: number): HeaderData;
88
+ getHeader(col: number, row: number): HeaderData | SeriesNumberColumnData;
77
89
  getHeaderField(col: number, row: number): import("../ts-types").FieldDef;
78
90
  getHeaderCellAdressById(id: number): CellAddress | undefined;
79
91
  getHeaderCellAddressByField(field: string): CellAddress | undefined;
80
- getBody(col: number, _row: number): ColumnData;
92
+ getBody(col: number, _row: number): ColumnData | SeriesNumberColumnData;
81
93
  getBodyLayoutRangeById(id: LayoutObjectId): CellRange;
82
94
  getCellRange(col: number, row: number): CellRange;
83
95
  private getCellRangeTranspose;
@@ -128,4 +140,5 @@ export declare class SimpleHeaderLayoutMap implements LayoutMapAPI {
128
140
  col: number;
129
141
  columnDefine: ColumnData;
130
142
  }[];
143
+ _getColumnDefine(col: number, row: number): ColumnData | SeriesNumberColumnData;
131
144
  }
@@ -8,16 +8,51 @@ const vutils_1 = require("@visactor/vutils"), global_1 = require("../tools/globa
8
8
 
9
9
  class SimpleHeaderLayoutMap {
10
10
  constructor(table, columns, showHeader, hierarchyIndent) {
11
- this.seqId = 0, this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0,
12
- this._recordsCount = 0, this._hasAggregation = !1, this._hasAggregationOnTopCount = 0,
13
- this._hasAggregationOnBottomCount = 0, this._cellRangeMap = new Map, this._showHeader = showHeader,
14
- this._table = table, this._columns = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20,
11
+ this.seqId = 0, this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0,
12
+ this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0, this._recordsCount = 0,
13
+ this._hasAggregation = !1, this._hasAggregationOnTopCount = 0, this._hasAggregationOnBottomCount = 0,
14
+ this._cellRangeMap = new Map, this._showHeader = showHeader, this._table = table,
15
+ this._columns = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20,
15
16
  this.columnTree = new tree_helper_1.DimensionTree(columns, {
16
17
  seqId: 0
17
18
  }), this._headerObjects = this._addHeaders(0, columns, []), this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
18
- o)), {}), this._hasAggregation = (0, layout_helper_1.checkHasAggregation)(this),
19
- this._hasAggregationOnBottomCount = (0, layout_helper_1.checkHasAggregationOnBottom)(this),
20
- this._hasAggregationOnTopCount = (0, layout_helper_1.checkHasAggregationOnTop)(this);
19
+ o)), {}), this.rowHierarchyType = (0, layout_helper_1.checkHasTreeDefine)(this) ? "tree" : "grid",
20
+ this._hasAggregation = (0, layout_helper_1.checkHasAggregation)(this), this._hasAggregationOnBottomCount = (0,
21
+ layout_helper_1.checkHasAggregationOnBottom)(this), this._hasAggregationOnTopCount = (0,
22
+ layout_helper_1.checkHasAggregationOnTop)(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
23
+ }
24
+ handleRowSeriesNumber(rowSeriesNumber) {
25
+ var _a;
26
+ rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map((seriesNumber => {
27
+ var _a;
28
+ return {
29
+ id: this.seqId++,
30
+ title: seriesNumber.title,
31
+ define: seriesNumber,
32
+ cellType: null !== (_a = seriesNumber.cellType) && void 0 !== _a ? _a : "text",
33
+ style: seriesNumber.style,
34
+ width: seriesNumber.width,
35
+ format: seriesNumber.format,
36
+ field: seriesNumber.field,
37
+ icon: seriesNumber.icon,
38
+ headerIcon: seriesNumber.headerIcon,
39
+ isChildNode: !1
40
+ };
41
+ })) : this.rowSeriesNumberColumn = [ {
42
+ id: this.seqId++,
43
+ title: rowSeriesNumber.title,
44
+ define: rowSeriesNumber,
45
+ cellType: null !== (_a = rowSeriesNumber.cellType) && void 0 !== _a ? _a : "text",
46
+ style: rowSeriesNumber.style,
47
+ width: rowSeriesNumber.width,
48
+ format: rowSeriesNumber.format,
49
+ field: "",
50
+ icon: rowSeriesNumber.icon,
51
+ headerIcon: rowSeriesNumber.headerIcon,
52
+ isChildNode: !1
53
+ } ], this.leftRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter((rowSeriesNumberItem => !0)),
54
+ this.rightRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter((rowSeriesNumberItem => !1)),
55
+ this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length, this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length);
21
56
  }
22
57
  get transpose() {
23
58
  return this._transpose;
@@ -31,8 +66,55 @@ class SimpleHeaderLayoutMap {
31
66
  set showHeader(_showHeader) {
32
67
  this._showHeader = _showHeader;
33
68
  }
69
+ isSeriesNumberInHeader(col, row) {
70
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount) {
71
+ if (this.transpose) return !1;
72
+ if (row < this.headerLevelCount) return !0;
73
+ }
74
+ if (this.rightRowSeriesNumberColumnCount > 0 && row >= 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
75
+ if (this.transpose) return !1;
76
+ if (row < this.headerLevelCount) return !0;
77
+ }
78
+ return !1;
79
+ }
80
+ isSeriesNumberInBody(col, row) {
81
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
82
+ if (this.transpose) return !0;
83
+ if (row >= this.headerLevelCount) return !0;
84
+ }
85
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
86
+ if (this.transpose) return !0;
87
+ if (row >= this.headerLevelCount) return !0;
88
+ }
89
+ return !1;
90
+ }
91
+ isSeriesNumber(col, row) {
92
+ return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount || this.rightRowSeriesNumberColumnCount > 0 && row >= 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount;
93
+ }
94
+ getSeriesNumberHeader(col, row) {
95
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
96
+ if (this.transpose) return;
97
+ if (row < this.headerLevelCount) return Object.assign({}, this.leftRowSeriesNumberColumn[col], {
98
+ style: this._table.internalProps.rowSeriesNumber.headerStyle
99
+ });
100
+ }
101
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row < this.headerLevelCount) {
102
+ if (this.transpose) return;
103
+ if (row < this.headerLevelCount) return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
104
+ }
105
+ }
106
+ getSeriesNumberBody(col, row) {
107
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
108
+ if (this.transpose) return this.leftRowSeriesNumberColumn[col];
109
+ if (row >= this.headerLevelCount) return this.leftRowSeriesNumberColumn[col];
110
+ }
111
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
112
+ if (this.transpose) return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
113
+ if (row >= this.headerLevelCount) return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
114
+ }
115
+ }
34
116
  isHeader(col, row) {
35
- return !!(this.transpose && col >= 0 && col < this.headerLevelCount) || !this.transpose && row >= 0 && row < this.headerLevelCount;
117
+ return !!(this.transpose && col >= this.leftRowSeriesNumberColumnCount && col < this.headerLevelCount + this.leftRowSeriesNumberColumnCount) || !this.transpose && row >= 0 && row < this.headerLevelCount;
36
118
  }
37
119
  isAggregation(col, row) {
38
120
  if (this.hasAggregation) {
@@ -118,10 +200,10 @@ class SimpleHeaderLayoutMap {
118
200
  return this.isHeader(col, row) ? this.transpose ? "rowHeader" : "columnHeader" : "body";
119
201
  }
120
202
  isRowHeader(col, row) {
121
- return !!(this.transpose && col >= 0 && col <= this.headerLevelCount - 1);
203
+ return !!(this.transpose && col >= this.leftRowSeriesNumberColumnCount && col < this.headerLevelCount + this.leftRowSeriesNumberColumnCount);
122
204
  }
123
205
  isColumnHeader(col, row) {
124
- return !this.transpose && row >= 0 && row <= this.headerLevelCount - 1;
206
+ return !this.transpose && row >= 0 && row <= this.headerLevelCount - 1 && col >= this.leftRowSeriesNumberColumnCount && col < this.colCount - this.rightRowSeriesNumberColumnCount;
125
207
  }
126
208
  isFrozenColumn(col, row) {
127
209
  if ((0, vutils_1.isValid)(row)) {
@@ -248,7 +330,7 @@ class SimpleHeaderLayoutMap {
248
330
  return this._table.internalProps.rightFrozenColCount ? this.colCount - this.frozenColCount >= this._table.internalProps.rightFrozenColCount ? this._table.internalProps.rightFrozenColCount : Math.max(0, this.colCount - this.frozenColCount) : 0;
249
331
  }
250
332
  get colCount() {
251
- return this.transpose ? this.headerLevelCount + this.recordsCount : this._columns.length;
333
+ return this.transpose ? this.headerLevelCount + this.recordsCount + this.leftRowSeriesNumberColumnCount + this.rightRowSeriesNumberColumnCount : this._columns.length + this.leftRowSeriesNumberColumnCount + this.rightRowSeriesNumberColumnCount;
252
334
  }
253
335
  get rowCount() {
254
336
  return this.transpose ? this._columns.length : this.headerLevelCount + this.recordsCount;
@@ -276,43 +358,47 @@ class SimpleHeaderLayoutMap {
276
358
  }
277
359
  getColumnWidthDefined(col) {
278
360
  var _a;
279
- if (this.transpose) {
280
- let maxWidth, minWidth, width = 0;
281
- if (col >= this.rowHeaderLevelCount) {
282
- let isAuto;
283
- return this.columnObjects.forEach(((obj, index) => {
284
- "number" == typeof obj.width ? width = Math.max(obj.width, width) : "auto" === obj.width && (isAuto = !0),
285
- "number" == typeof obj.minWidth && (minWidth = Math.max(obj.minWidth, minWidth)),
286
- "number" == typeof obj.maxWidth && (maxWidth = Math.max(obj.maxWidth, maxWidth));
287
- })), width = width > 0 ? width : isAuto ? "auto" : void 0, {
288
- width: width,
289
- minWidth: minWidth,
290
- maxWidth: maxWidth
291
- };
292
- }
293
- if (this.isRowHeader(col, 0)) {
294
- const defaultWidth = Array.isArray(this._table.defaultHeaderColWidth) ? null !== (_a = this._table.defaultHeaderColWidth[col]) && void 0 !== _a ? _a : this._table.defaultColWidth : this._table.defaultHeaderColWidth;
295
- return "auto" === defaultWidth ? {
296
- width: "auto"
297
- } : {
298
- width: defaultWidth
299
- };
361
+ if (col >= 0) {
362
+ if (col < this.leftRowSeriesNumberColumnCount) return this.leftRowSeriesNumberColumn[col];
363
+ if (this.transpose) {
364
+ let maxWidth, minWidth, width = 0;
365
+ if (col >= this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount) {
366
+ let isAuto;
367
+ return this.columnObjects.forEach(((obj, index) => {
368
+ "number" == typeof obj.width ? width = Math.max(obj.width, width) : "auto" === obj.width && (isAuto = !0),
369
+ "number" == typeof obj.minWidth && (minWidth = Math.max(obj.minWidth, minWidth)),
370
+ "number" == typeof obj.maxWidth && (maxWidth = Math.max(obj.maxWidth, maxWidth));
371
+ })), width = width > 0 ? width : isAuto ? "auto" : void 0, {
372
+ width: width,
373
+ minWidth: minWidth,
374
+ maxWidth: maxWidth
375
+ };
376
+ }
377
+ if (this.isRowHeader(col, 0)) {
378
+ const defaultWidth = Array.isArray(this._table.defaultHeaderColWidth) ? null !== (_a = this._table.defaultHeaderColWidth[col]) && void 0 !== _a ? _a : this._table.defaultColWidth : this._table.defaultHeaderColWidth;
379
+ return "auto" === defaultWidth ? {
380
+ width: "auto"
381
+ } : {
382
+ width: defaultWidth
383
+ };
384
+ }
300
385
  }
386
+ return this._columns[col - this.leftRowSeriesNumberColumnCount];
301
387
  }
302
- return this._columns[col];
303
388
  }
304
389
  getCellId(col, row) {
305
390
  var _a, _b, _c, _d;
306
- return this.transpose ? this.headerLevelCount <= col ? null === (_a = this._columns[row]) || void 0 === _a ? void 0 : _a.id : null === (_b = this._headerCellIds[col]) || void 0 === _b ? void 0 : _b[row] : this.headerLevelCount <= row ? null === (_c = this._columns[col]) || void 0 === _c ? void 0 : _c.id : null === (_d = this._headerCellIds[row]) || void 0 === _d ? void 0 : _d[col];
391
+ return this.transpose ? col >= this.headerLevelCount + this.leftRowSeriesNumberColumnCount ? null === (_a = this._columns[row]) || void 0 === _a ? void 0 : _a.id : this.isSeriesNumber(col, row) ? row + "_series_number" : null === (_b = this._headerCellIds[col - this.leftRowSeriesNumberColumnCount]) || void 0 === _b ? void 0 : _b[row] : this.isSeriesNumber(col, row) ? this.rowSeriesNumberColumn[col].id : this.headerLevelCount <= row ? null === (_c = this._columns[col - this.leftRowSeriesNumberColumnCount]) || void 0 === _c ? void 0 : _c.id : null === (_d = this._headerCellIds[row]) || void 0 === _d ? void 0 : _d[col - this.leftRowSeriesNumberColumnCount];
307
392
  }
308
393
  getHeader(col, row) {
394
+ if (this.isSeriesNumberInHeader(col, row)) return this.getSeriesNumberHeader(col, row);
309
395
  const id = this.getCellId(col, row);
310
396
  return this._headerObjectMap[id];
311
397
  }
312
398
  getHeaderField(col, row) {
313
399
  var _a;
314
400
  const id = this.getCellId(col, row);
315
- return (null === (_a = this._headerObjectMap[id]) || void 0 === _a ? void 0 : _a.field) || (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col] && this._columns[col].field);
401
+ return (null === (_a = this._headerObjectMap[id]) || void 0 === _a ? void 0 : _a.field) || (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col - this.leftRowSeriesNumberColumnCount] && this._columns[col - this.leftRowSeriesNumberColumnCount].field);
316
402
  }
317
403
  getHeaderCellAdressById(id) {
318
404
  for (let i = 0; i < this._headerCellIds.length; i++) {
@@ -321,7 +407,7 @@ class SimpleHeaderLayoutMap {
321
407
  col: i,
322
408
  row: j
323
409
  } : {
324
- col: j,
410
+ col: j + this.leftRowSeriesNumberColumnCount,
325
411
  row: i
326
412
  };
327
413
  }
@@ -331,7 +417,7 @@ class SimpleHeaderLayoutMap {
331
417
  return this.getHeaderCellAdressById(hd.id);
332
418
  }
333
419
  getBody(col, _row) {
334
- return this.transpose ? this._columns[_row] : this._columns[col];
420
+ return this.isSeriesNumber(col, _row) ? this.getSeriesNumberBody(col, _row) : this.transpose ? this._columns[_row] : this._columns[col - this.leftRowSeriesNumberColumnCount];
335
421
  }
336
422
  getBodyLayoutRangeById(id) {
337
423
  var _a, _b;
@@ -346,7 +432,7 @@ class SimpleHeaderLayoutMap {
346
432
  row: row
347
433
  }
348
434
  };
349
- } else for (let col = 0; col < (null !== (_b = this.colCount) && void 0 !== _b ? _b : 0); col++) if (id === this._columns[col].id) return {
435
+ } else for (let col = 0; col < (null !== (_b = this.colCount) && void 0 !== _b ? _b : 0); col++) if (id === this._columns[col - this.leftRowSeriesNumberColumnCount].id) return {
350
436
  start: {
351
437
  col: col,
352
438
  row: 0
@@ -382,20 +468,20 @@ class SimpleHeaderLayoutMap {
382
468
  }
383
469
  };
384
470
  if (this.transpose) cellRange = this.getCellRangeTranspose(col, row); else if (this.headerLevelCount <= row) {
385
- if (this.headerLevelCount <= row && (null === (_b = null === (_a = this.columnObjects[col]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
471
+ if (this.headerLevelCount <= row && (null === (_b = null === (_a = this.columnObjects[col - this.leftRowSeriesNumberColumnCount]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
386
472
  const value = this._table.getCellValue(col, row);
387
473
  for (let r = row - 1; r >= this.headerLevelCount; r--) {
388
474
  const last_Value = this._table.getCellValue(col, r);
389
- if ("boolean" == typeof this.columnObjects[col].define.mergeCell) {
475
+ if ("boolean" == typeof this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell) {
390
476
  if (value !== last_Value) break;
391
- } else if (!this.columnObjects[col].define.mergeCell(value, last_Value)) break;
477
+ } else if (!this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell(value, last_Value)) break;
392
478
  cellRange.start.row = r;
393
479
  }
394
480
  for (let r = row + 1; r < this.rowCount; r++) {
395
481
  const next_Value = this._table.getCellValue(col, r);
396
- if ("boolean" == typeof this.columnObjects[col].define.mergeCell) {
482
+ if ("boolean" == typeof this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell) {
397
483
  if (value !== next_Value) break;
398
- } else if (!this.columnObjects[col].define.mergeCell(value, next_Value)) break;
484
+ } else if (!this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell(value, next_Value)) break;
399
485
  cellRange.end.row = r;
400
486
  }
401
487
  }
@@ -420,10 +506,10 @@ class SimpleHeaderLayoutMap {
420
506
  row: row
421
507
  }
422
508
  };
423
- if (this.headerLevelCount <= col || -1 === col && -1 === row) {
424
- if (this.headerLevelCount <= col && (null === (_b = null === (_a = this.columnObjects[row]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
509
+ if (this.headerLevelCount + this.leftRowSeriesNumberColumnCount <= col || -1 === col && -1 === row) {
510
+ if (this.headerLevelCount + this.leftRowSeriesNumberColumnCount <= col && (null === (_b = null === (_a = this.columnObjects[row]) || void 0 === _a ? void 0 : _a.define) || void 0 === _b ? void 0 : _b.mergeCell)) {
425
511
  const value = this._table.getCellValue(col, row);
426
- for (let c = col - 1; c >= this.headerLevelCount; c--) {
512
+ for (let c = col - 1; c >= this.headerLevelCount + this.leftRowSeriesNumberColumnCount; c--) {
427
513
  const last_Value = this._table.getCellValue(c, row);
428
514
  if ("boolean" == typeof this.columnObjects[row].define.mergeCell) {
429
515
  if (value !== last_Value) break;
@@ -444,7 +530,7 @@ class SimpleHeaderLayoutMap {
444
530
  for (let r = row - 1; r >= 0 && id === this.getCellId(col, r); r--) result.start.row = r;
445
531
  for (let r = row + 1; r < (null !== (_d = this.rowCount) && void 0 !== _d ? _d : 0) && id === this.getCellId(col, r); r++) result.end.row = r;
446
532
  for (let c = col - 1; c >= 0 && id === this.getCellId(c, row); c--) result.start.col = c;
447
- for (let c = col + 1; c < this.headerLevelCount && id === this.getCellId(c, row); c++) result.end.col = c;
533
+ for (let c = col + 1; c < this.headerLevelCount + this.leftRowSeriesNumberColumnCount && id === this.getCellId(c, row); c++) result.end.col = c;
448
534
  return result;
449
535
  }
450
536
  isCellRangeEqual(col, row, targetCol, targetRow) {
@@ -494,7 +580,8 @@ class SimpleHeaderLayoutMap {
494
580
  define: colDef,
495
581
  columnWidthComputeMode: colDef.columnWidthComputeMode,
496
582
  disableColumnResize: null == colDef ? void 0 : colDef.disableColumnResize,
497
- aggregation: this._getAggregationForColumn(colDef, col)
583
+ aggregation: this._getAggregationForColumn(colDef, col),
584
+ isChildNode: row >= 1
498
585
  });
499
586
  for (let r = row + 1; r < this._headerCellIds.length; r++) this._headerCellIds[r][col] = id;
500
587
  }
@@ -524,11 +611,12 @@ class SimpleHeaderLayoutMap {
524
611
  return newRow;
525
612
  }
526
613
  getCellHeaderPaths(col, row) {
614
+ if (this.isSeriesNumber(col, row)) return;
527
615
  let colPath = [], rowPath = [];
528
616
  return this.transpose ? rowPath = [ {
529
617
  field: this._columns[row].field
530
618
  } ] : colPath = [ {
531
- field: this._columns[col].field
619
+ field: this._columns[col - this.leftRowSeriesNumberColumnCount].field
532
620
  } ], {
533
621
  colHeaderPaths: colPath,
534
622
  rowHeaderPaths: rowPath,
@@ -536,10 +624,20 @@ class SimpleHeaderLayoutMap {
536
624
  };
537
625
  }
538
626
  getParentCellId(col, row) {
539
- if (0 !== row) return this.isColumnHeader(col, row) ? this.getCellId(col, row - 1) : this.isRowHeader(col, row) ? this.getCellId(col - 1, row) : void 0;
627
+ if (0 !== row) {
628
+ if (this.isColumnHeader(col, row)) return this.getCellId(col, row - 1);
629
+ if (this.isRowHeader(col, row)) {
630
+ if (this.isSeriesNumberInBody(col - 1, row)) return;
631
+ return this.getCellId(col - 1, row);
632
+ }
633
+ }
540
634
  }
541
635
  canMoveHeaderPosition(source, target) {
542
- if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
636
+ if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) return !1;
637
+ if (!this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) return !0;
638
+ if (this.transpose && this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) && (this._getColumnDefine(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode && this._getColumnDefine(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode ? (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1,
639
+ target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1) : (source.col = source.col + this.leftRowSeriesNumberColumnCount,
640
+ target.col = target.col + this.leftRowSeriesNumberColumnCount)), source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
543
641
  if ("disabled" === this._table.internalProps.frozenColDragHeaderMode && (this._table.isFrozenColumn(target.col) || this._table.isRightFrozenColumn(target.col))) return !1;
544
642
  const sourceCellRange = this.getCellRange(source.col, source.row);
545
643
  if (this.isColumnHeader(source.col, source.row)) {
@@ -552,7 +650,7 @@ class SimpleHeaderLayoutMap {
552
650
  }
553
651
  moveHeaderPosition(source, target) {
554
652
  if (this.canMoveHeaderPosition(source, target)) {
555
- const sourceCellRange = this.getCellRange(source.col, source.row);
653
+ let sourceCellRange = this.getCellRange(source.col, source.row);
556
654
  if (this.isColumnHeader(source.col, source.row)) {
557
655
  const sourceSize = sourceCellRange.end.col - sourceCellRange.start.col + 1;
558
656
  let targetIndex;
@@ -560,12 +658,12 @@ class SimpleHeaderLayoutMap {
560
658
  if (targetIndex = target.col >= source.col ? targetCellRange.end.col - sourceSize + 1 : targetCellRange.start.col,
561
659
  targetIndex === sourceCellRange.start.col) return null;
562
660
  for (let row = 0; row < this._headerCellIds.length; row++) {
563
- const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col, sourceSize);
564
- sourceIds.unshift(targetIndex, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
661
+ const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
662
+ sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0), Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
565
663
  }
566
- const sourceColumns = this._columns.splice(sourceCellRange.start.col, sourceSize);
567
- return sourceColumns.unshift(targetIndex, 0), Array.prototype.splice.apply(this._columns, sourceColumns),
568
- this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col, targetIndex),
664
+ const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
665
+ return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0),
666
+ Array.prototype.splice.apply(this._columns, sourceColumns), this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount),
569
667
  this.columnTree.reset(this.columnTree.tree.children, !0), this._cellRangeMap = new Map,
570
668
  {
571
669
  sourceIndex: sourceCellRange.start.col,
@@ -575,7 +673,8 @@ class SimpleHeaderLayoutMap {
575
673
  moveType: "column"
576
674
  };
577
675
  }
578
- if (this.isRowHeader(source.col, source.row)) {
676
+ if (this.isRowHeader(source.col, source.row) || this.isSeriesNumberInBody(source.col, source.row) && this.transpose) {
677
+ this.isSeriesNumberInBody(source.col, source.row) && (sourceCellRange = this.getCellRange(source.col + this.leftRowSeriesNumberColumnCount, source.row));
579
678
  const sourceSize = sourceCellRange.end.row - sourceCellRange.start.row + 1;
580
679
  let targetIndex;
581
680
  const targetCellRange = this.getCellRange(sourceCellRange.start.col, target.row);
@@ -587,7 +686,7 @@ class SimpleHeaderLayoutMap {
587
686
  }
588
687
  const sourceColumns = this._columns.splice(sourceCellRange.start.row, sourceSize);
589
688
  return sourceColumns.unshift(targetIndex, 0), Array.prototype.splice.apply(this._columns, sourceColumns),
590
- this.columnTree.movePosition(sourceCellRange.start.col, sourceCellRange.start.row, targetIndex),
689
+ this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceCellRange.start.row, targetIndex + (target.row > source.row ? sourceCellRange.end.row - sourceCellRange.start.row : 0)),
591
690
  this.columnTree.reset(this.columnTree.tree.children, !0), this._cellRangeMap = new Map,
592
691
  {
593
692
  sourceIndex: sourceCellRange.start.row,
@@ -597,6 +696,13 @@ class SimpleHeaderLayoutMap {
597
696
  moveType: "row"
598
697
  };
599
698
  }
699
+ if (this.isSeriesNumberInBody(source.col, source.row)) return {
700
+ sourceIndex: source.row,
701
+ targetIndex: target.row,
702
+ sourceSize: 1,
703
+ targetSize: 1,
704
+ moveType: "row"
705
+ };
600
706
  }
601
707
  return null;
602
708
  }
@@ -613,11 +719,11 @@ class SimpleHeaderLayoutMap {
613
719
  };
614
720
  }
615
721
  setChartInstance(_col, _row, chartInstance) {
616
- const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
722
+ const columnObj = this.transpose ? this._columns[_row] : this._columns[_col - this.leftRowSeriesNumberColumnCount];
617
723
  "function" != typeof columnObj.chartSpec && (columnObj.chartInstance = chartInstance);
618
724
  }
619
725
  getChartInstance(_col, _row) {
620
- return (this.transpose ? this._columns[_row] : this._columns[_col]).chartInstance;
726
+ return (this.transpose ? this._columns[_row] : this._columns[_col - this.leftRowSeriesNumberColumnCount]).chartInstance;
621
727
  }
622
728
  checkHasChart() {
623
729
  return (0, get_chart_spec_1.checkHasChart)(this);
@@ -677,6 +783,9 @@ class SimpleHeaderLayoutMap {
677
783
  columnDefine: cur
678
784
  }), pre)), []);
679
785
  }
786
+ _getColumnDefine(col, row) {
787
+ if (col >= 0) return col < this.leftRowSeriesNumberColumnCount ? this.leftRowSeriesNumberColumn[col] : this.transpose ? this._columns[row] : this._columns[col - this.leftRowSeriesNumberColumnCount];
788
+ }
680
789
  }
681
790
 
682
791
  exports.SimpleHeaderLayoutMap = SimpleHeaderLayoutMap;