@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
@@ -20,6 +20,7 @@ class PivotHeaderLayoutMap {
20
20
  this._indicatorShowType = "column", this.rowDimensionKeys = [], this.colDimensionKeys = [],
21
21
  this.indicatorKeys = [], this.indicatorDimensionKey = global_1.IndicatorDimensionKeyPlaceholder,
22
22
  this._rowHeaderExtensionTree = {}, this._extensionRowDimensionKeys = [], this.fullRowDimensionKeys = [],
23
+ this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0,
23
24
  this.sharedVar = {
24
25
  seqId: 0
25
26
  }, this._table = table, "tree" === table.options.rowHierarchyType && (this.extensionRows = table.options.extensionRows),
@@ -91,10 +92,40 @@ class PivotHeaderLayoutMap {
91
92
  this._chartPaddingOuter = null !== (_g = (0, vutils_1.isArray)(bandAxisConfig.paddingOuter) ? bandAxisConfig.paddingOuter[0] : bandAxisConfig.paddingOuter) && void 0 !== _g ? _g : 0),
92
93
  this._chartItemSpanSize > 0 || (null === (_h = indicatorObject.chartSpec.series) || void 0 === _h || _h.find((seriesObject => (seriesObject.barWidth && "number" == typeof seriesObject.barWidth && (this._chartItemSpanSize = seriesObject.barWidth),
93
94
  this._chartItemSpanSize > 0))), !1);
94
- }))), this.setColumnWidths();
95
+ }))), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber), this.setColumnWidths();
96
+ }
97
+ handleRowSeriesNumber(rowSeriesNumber) {
98
+ var _a;
99
+ rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map((seriesNumber => {
100
+ var _a;
101
+ return {
102
+ id: "",
103
+ title: seriesNumber.title,
104
+ define: seriesNumber,
105
+ cellType: null !== (_a = seriesNumber.cellType) && void 0 !== _a ? _a : "text",
106
+ width: seriesNumber.width,
107
+ style: seriesNumber.style,
108
+ format: seriesNumber.format,
109
+ field: seriesNumber.field,
110
+ icon: seriesNumber.icon
111
+ };
112
+ })) : this.rowSeriesNumberColumn = [ {
113
+ id: "",
114
+ title: rowSeriesNumber.title,
115
+ define: rowSeriesNumber,
116
+ cellType: null !== (_a = rowSeriesNumber.cellType) && void 0 !== _a ? _a : "text",
117
+ style: rowSeriesNumber.style,
118
+ width: rowSeriesNumber.width,
119
+ format: rowSeriesNumber.format,
120
+ field: "",
121
+ icon: rowSeriesNumber.icon,
122
+ isChildNode: !1
123
+ } ], this.leftRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter((rowSeriesNumberItem => !0)),
124
+ this.rightRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter((rowSeriesNumberItem => !1)),
125
+ this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length, this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length);
95
126
  }
96
127
  _generateColHeaderIds() {
97
- var _a, _b;
128
+ var _a, _b, _c, _d, _e, _f;
98
129
  if ((null === (_a = this.columnDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && (this.columnHeaderObjs = this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, [])),
99
130
  this.columnHeaderTitle) {
100
131
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
@@ -104,19 +135,19 @@ class PivotHeaderLayoutMap {
104
135
  id: id,
105
136
  title: "string" == typeof this.columnHeaderTitle.title ? this.columnHeaderTitle.title : this.columnsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
106
137
  field: void 0,
107
- headerType: null !== (_b = this.columnHeaderTitle.headerType) && void 0 !== _b ? _b : "text",
108
- style: this.columnHeaderTitle.headerStyle,
138
+ headerType: null !== (_c = null === (_b = this.columnHeaderTitle) || void 0 === _b ? void 0 : _b.headerType) && void 0 !== _c ? _c : "text",
139
+ style: null === (_d = this.columnHeaderTitle) || void 0 === _d ? void 0 : _d.headerStyle,
109
140
  define: {
110
141
  id: id,
111
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
112
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
142
+ disableHeaderHover: !!(null === (_e = this.columnHeaderTitle) || void 0 === _e ? void 0 : _e.disableHeaderHover),
143
+ disableHeaderSelect: !!(null === (_f = this.columnHeaderTitle) || void 0 === _f ? void 0 : _f.disableHeaderSelect)
113
144
  }
114
145
  };
115
146
  this.columnHeaderObjs.push(cell), this._headerObjects[id] = cell;
116
147
  }
117
148
  }
118
149
  _generateRowHeaderIds() {
119
- var _a, _b, _c, _d;
150
+ var _a, _b, _c, _d, _e, _f, _g, _h;
120
151
  if ((null === (_a = this.rowDimensionTree.tree.children) || void 0 === _a ? void 0 : _a.length) >= 1 && (this.rowHeaderObjs = "tree" === this.rowHierarchyType ? this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, !0, this.rowsDefine) : this._addHeaders(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [])),
121
152
  this.rowHeaderTitle) {
122
153
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
@@ -126,12 +157,12 @@ class PivotHeaderLayoutMap {
126
157
  id: id,
127
158
  title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
128
159
  field: void 0,
129
- headerType: null !== (_d = this.rowHeaderTitle.headerType) && void 0 !== _d ? _d : "text",
130
- style: this.rowHeaderTitle.headerStyle,
160
+ headerType: null !== (_e = null === (_d = this.rowHeaderTitle) || void 0 === _d ? void 0 : _d.headerType) && void 0 !== _e ? _e : "text",
161
+ style: null === (_f = this.rowHeaderTitle) || void 0 === _f ? void 0 : _f.headerStyle,
131
162
  define: {
132
163
  id: id,
133
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
134
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
164
+ disableHeaderHover: !!(null === (_g = this.rowHeaderTitle) || void 0 === _g ? void 0 : _g.disableHeaderHover),
165
+ disableHeaderSelect: !!(null === (_h = this.rowHeaderTitle) || void 0 === _h ? void 0 : _h.disableHeaderSelect)
135
166
  }
136
167
  };
137
168
  this.rowHeaderObjs.push(cell), this._headerObjects[id] = cell;
@@ -244,12 +275,13 @@ class PivotHeaderLayoutMap {
244
275
  setColumnWidths() {
245
276
  var _a, _b, _c;
246
277
  const returnWidths = new Array(this.colCount).fill(void 0);
247
- if (this.showHeader && this.showRowHeader) if (this.rowHeaderTitle && (returnWidths[0] = {}),
278
+ if (this.leftRowSeriesNumberColumnCount && (returnWidths[0] = this.leftRowSeriesNumberColumn[0]),
279
+ this.showHeader && this.showRowHeader) if (this.rowHeaderTitle && (returnWidths[0 + this.leftRowSeriesNumberColumnCount] = {}),
248
280
  "tree" === this.rowHierarchyType) {
249
281
  const mainDimensionFirstRowKey = this.rowDimensionKeys[0];
250
282
  if (mainDimensionFirstRowKey) {
251
283
  const dimension = null === (_a = this.rowsDefine) || void 0 === _a ? void 0 : _a.find((dimension => "string" != typeof dimension && dimension.dimensionKey === mainDimensionFirstRowKey));
252
- dimension && (returnWidths[0 + (this.rowHeaderTitle ? 1 : 0)] = {
284
+ dimension && (returnWidths[0 + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
253
285
  width: dimension.width,
254
286
  minWidth: dimension.minWidth,
255
287
  maxWidth: dimension.maxWidth
@@ -260,7 +292,7 @@ class PivotHeaderLayoutMap {
260
292
  const curDimensionFirstRowKey = extensionRowDimensionKeys[0];
261
293
  if (curDimensionFirstRowKey) {
262
294
  const dimension = null === (_a = this.extensionRows[index].rows) || void 0 === _a ? void 0 : _a.find((dimension => "string" != typeof dimension && dimension.dimensionKey === curDimensionFirstRowKey));
263
- dimension && (returnWidths[index + 1 + (this.rowHeaderTitle ? 1 : 0)] = {
295
+ dimension && (returnWidths[index + 1 + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
264
296
  width: dimension.width,
265
297
  minWidth: dimension.minWidth,
266
298
  maxWidth: dimension.maxWidth
@@ -270,7 +302,7 @@ class PivotHeaderLayoutMap {
270
302
  } else this.rowDimensionKeys.forEach(((objKey, index) => {
271
303
  var _a;
272
304
  const dimension = null === (_a = this.rowsDefine) || void 0 === _a ? void 0 : _a.find((dimension => "string" != typeof dimension && dimension.dimensionKey === objKey));
273
- dimension && (returnWidths[index + (this.rowHeaderTitle ? 1 : 0)] = {
305
+ dimension && (returnWidths[index + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
274
306
  width: dimension.width,
275
307
  minWidth: dimension.minWidth,
276
308
  maxWidth: dimension.maxWidth
@@ -338,19 +370,19 @@ class PivotHeaderLayoutMap {
338
370
  return this.isCornerHeader(col, row) ? "cornerHeader" : this.isColumnHeader(col, row) ? "columnHeader" : this.isRowHeader(col, row) ? "rowHeader" : "body";
339
371
  }
340
372
  isHeader(col, row) {
341
- return col >= 0 && col < this.rowHeaderLevelCount || (row >= 0 && row < this.columnHeaderLevelCount || (col >= this.colCount - this.rightHeaderColCount || row >= this.rowCount - this.bottomHeaderRowCount));
373
+ return col >= this.leftRowSeriesNumberColumnCount && col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount || (row >= 0 && row < this.columnHeaderLevelCount || (col >= this.colCount - this.rightHeaderColCount || row >= this.rowCount - this.bottomHeaderRowCount));
342
374
  }
343
375
  isCornerHeader(col, row) {
344
- return col >= 0 && col < this.rowHeaderLevelCount && row >= 0 && row < this.columnHeaderLevelCount;
376
+ return col >= 0 && col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount && row >= 0 && row < this.columnHeaderLevelCount;
345
377
  }
346
378
  isColumnHeader(col, row) {
347
379
  return col >= this.rowHeaderLevelCount && row >= 0 && row < this.columnHeaderLevelCount;
348
380
  }
349
381
  isRowHeader(col, row) {
350
- return col >= 0 && col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount;
382
+ return col >= this.leftRowSeriesNumberColumnCount && col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount && row >= this.columnHeaderLevelCount;
351
383
  }
352
384
  isFrozen(col, row) {
353
- return this.isFrozenColumn(col) || this.isRightFrozenColumn(col) || this.isBottomFrozenRow(row) || this.isFrozenRow(row);
385
+ return this.isFrozenColumn(col) || this.isRightFrozenColumn(col) || this.isBottomFrozenRow(row) || this.isFrozenRow(row) || this.isSeriesNumberInBody(col, row) || this.isSeriesNumberInHeader(col, row);
354
386
  }
355
387
  isFrozenColumn(col, row) {
356
388
  if ((0, vutils_1.isValid)(row)) {
@@ -480,7 +512,7 @@ class PivotHeaderLayoutMap {
480
512
  this._rowHeaderLevelCount = count;
481
513
  }
482
514
  get colCount() {
483
- return this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightHeaderColCount;
515
+ return this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightHeaderColCount + this.leftRowSeriesNumberColumnCount;
484
516
  }
485
517
  get rowCount() {
486
518
  var _a, _b, _c, _d;
@@ -518,15 +550,17 @@ class PivotHeaderLayoutMap {
518
550
  getCellId(col, row) {
519
551
  var _a, _b;
520
552
  if (row >= 0 && col >= 0) {
521
- if (this.isCornerHeader(col, row)) return this._cornerHeaderCellIds[row][col];
522
- if (this.isColumnHeader(col, row)) return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount];
523
- if (this.isRowHeader(col, row)) return null === (_a = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _a ? void 0 : _a[col];
553
+ if (this.isSeriesNumber(col, row)) return "";
554
+ if (this.isCornerHeader(col, row)) return this._cornerHeaderCellIds[row][col - this.leftRowSeriesNumberColumnCount];
555
+ if (this.isColumnHeader(col, row)) return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
556
+ if (this.isRowHeader(col, row)) return null === (_a = this._rowHeaderCellIds[row - this.columnHeaderLevelCount]) || void 0 === _a ? void 0 : _a[col - this.leftRowSeriesNumberColumnCount];
524
557
  if (this.isRightFrozenColumn(col, row)) return this._rowHeaderCellIds[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];
525
- if (this.isBottomFrozenRow(col, row)) return null === (_b = this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]) || void 0 === _b ? void 0 : _b[col - this.rowHeaderLevelCount];
558
+ if (this.isBottomFrozenRow(col, row)) return null === (_b = this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]) || void 0 === _b ? void 0 : _b[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
526
559
  }
527
560
  }
528
561
  getHeader(col, row) {
529
562
  var _a;
563
+ if (this.isSeriesNumberInHeader(col, row)) return this.getSeriesNumberHeader(col, row);
530
564
  const id = this.getCellId(col, row);
531
565
  return null !== (_a = this._headerObjectMap[id]) && void 0 !== _a ? _a : {
532
566
  id: void 0,
@@ -569,6 +603,7 @@ class PivotHeaderLayoutMap {
569
603
  }
570
604
  getBody(_col, _row) {
571
605
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
606
+ if (this.isSeriesNumber(_col, _row)) return this.getSeriesNumberBody(_col, _row);
572
607
  const paths = this.getCellHeaderPaths(_col, _row);
573
608
  if (this.indicatorsAsCol) {
574
609
  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;
@@ -644,7 +679,7 @@ class PivotHeaderLayoutMap {
644
679
  for (let c = col - 1; c >= 0 && id === this.getCellId(c, row); c--) result.start.col = c;
645
680
  for (let c = col + 1; c < (null !== (_a = this.colCount) && void 0 !== _a ? _a : 0) && id === this.getCellId(c, row); c++) result.end.col = c;
646
681
  for (let r = row - 1; r >= 0 && id === this.getCellId(col, r); r--) result.start.row = r;
647
- for (let r = row + 1; r < (null !== (_b = this.rowCount) && void 0 !== _b ? _b : 0) && id === this.getCellId(col, r); r++) result.end.row = r;
682
+ for (let r = row + 1; r < (null !== (_b = this.rowCount) && void 0 !== _b ? _b : 0) && !(id !== this.getCellId(col, r) || this.isSeriesNumberInHeader(col, row) && r >= this.columnHeaderLevelCount); r++) result.end.row = r;
648
683
  }
649
684
  return (result.end.col - result.start.col > 100 || result.end.row - result.start.row > 100) && this._largeCellRangeCache.push(result),
650
685
  result;
@@ -663,7 +698,7 @@ class PivotHeaderLayoutMap {
663
698
  return this._table.isPivotChart() ? this.rightFrozenColCount : 0;
664
699
  }
665
700
  getBodyIndexByCol(col) {
666
- return col < this.rowHeaderLevelCount || col >= this.colCount - this.rightHeaderColCount ? -1 : col - this.rowHeaderLevelCount;
701
+ return col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount || col >= this.colCount - this.rightHeaderColCount ? -1 : col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount;
667
702
  }
668
703
  getRecordStartRowByRecordIndex(index) {
669
704
  return this.columnHeaderLevelCount + index;
@@ -697,7 +732,7 @@ class PivotHeaderLayoutMap {
697
732
  rowPath = rowPath.concat(findedRowPath), findTree = this._rowHeaderExtensionTree[row_pathIds[level]],
698
733
  level++;
699
734
  }
700
- } else rowPath = this.rowDimensionTree.getTreePath(recordRow, this.showHeader && this.showRowHeader ? col - (this.rowHeaderTitle ? 1 : 0) : this.rowDimensionTree.totalLevel);
735
+ } else rowPath = this.rowDimensionTree.getTreePath(recordRow, this.showHeader && this.showRowHeader ? col - (this.rowHeaderTitle ? 1 : 0) - this.leftRowSeriesNumberColumnCount : this.rowDimensionTree.totalLevel);
701
736
  const p = {
702
737
  colHeaderPaths: colPath,
703
738
  rowHeaderPaths: rowPath,
@@ -762,7 +797,7 @@ class PivotHeaderLayoutMap {
762
797
  return this.isColumnIndicatorHeader(col, row) || this.isRowIndicatorHeader(col, row);
763
798
  }
764
799
  toggleHierarchyState(col, row) {
765
- var _a, _b;
800
+ var _a, _b, _c, _d, _e, _f;
766
801
  const oldRowHeaderCellIds = this._rowHeaderCellIds_FULL.slice(0), oldRowHeaderCellPositons = oldRowHeaderCellIds.map(((id, row) => ({
767
802
  col: col,
768
803
  row: row + this.columnHeaderLevelCount
@@ -777,23 +812,23 @@ class PivotHeaderLayoutMap {
777
812
  id: id,
778
813
  title: "string" == typeof this.rowHeaderTitle.title ? this.rowHeaderTitle.title : this.rowsDefine.reduce(((title, value) => "string" == typeof value ? title : title + (title ? `/${value.title}` : `${value.title}`)), ""),
779
814
  field: void 0,
780
- headerType: null !== (_a = this.rowHeaderTitle.headerType) && void 0 !== _a ? _a : "text",
781
- style: this.rowHeaderTitle.headerStyle,
815
+ headerType: null !== (_b = null === (_a = this.rowHeaderTitle) || void 0 === _a ? void 0 : _a.headerType) && void 0 !== _b ? _b : "text",
816
+ style: null === (_c = this.rowHeaderTitle) || void 0 === _c ? void 0 : _c.headerStyle,
782
817
  define: {
783
818
  field: "",
784
819
  headerType: "text",
785
820
  cellType: "text",
786
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
787
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
821
+ disableHeaderHover: !!(null === (_d = this.rowHeaderTitle) || void 0 === _d ? void 0 : _d.disableHeaderHover),
822
+ disableHeaderSelect: !!(null === (_e = this.rowHeaderTitle) || void 0 === _e ? void 0 : _e.disableHeaderSelect)
788
823
  }
789
824
  };
790
825
  this.rowHeaderObjs.push(cell), this._headerObjects[id] = cell;
791
826
  }
792
827
  this._rowHeaderCellIds_FULL = (0, util_1.transpose)(this._rowHeaderCellIds_FULL),
793
- "tree" === this.rowHierarchyType && (null === (_b = this.extensionRows) || void 0 === _b ? void 0 : _b.length) >= 1 && this.generateExtensionRowTree(),
828
+ "tree" === this.rowHierarchyType && (null === (_f = this.extensionRows) || void 0 === _f ? void 0 : _f.length) >= 1 && this.generateExtensionRowTree(),
794
829
  this.colIndex = 0, this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e,
795
830
  o)), {}), this._CellHeaderPathMap = new Map, this._largeCellRangeCache.length = 0;
796
- const diffCell = (0, diff_cell_1.diffCellAddress)(col, row, oldRowHeaderCellIds.map((oldCellId => oldCellId[col])), this._rowHeaderCellIds_FULL.map((newCellId => newCellId[col])), oldRowHeaderCellPositons, this);
831
+ 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);
797
832
  return this._rowHeaderCellIds = this._rowHeaderCellIds_FULL.slice(), diffCell;
798
833
  }
799
834
  isHeaderForColWidth(col, row) {
@@ -813,13 +848,13 @@ class PivotHeaderLayoutMap {
813
848
  let col = 0;
814
849
  return "grid" === this.rowHierarchyType && (col = this.rowDimensionKeys.indexOf(highlightDimension.dimensionKey)),
815
850
  -1 === col ? void 0 : {
816
- col: this.rowHeaderTitle ? col + 1 : col,
851
+ col: (this.rowHeaderTitle ? col + 1 : col) + this.leftRowSeriesNumberColumnCount,
817
852
  row: 0
818
853
  };
819
854
  }
820
855
  const row = this.colDimensionKeys.indexOf(highlightDimension.dimensionKey);
821
856
  return -1 === row ? void 0 : {
822
- col: 0,
857
+ col: 0 + this.leftRowSeriesNumberColumnCount,
823
858
  row: this.columnHeaderTitle ? row + 1 : row
824
859
  };
825
860
  }
@@ -845,14 +880,14 @@ class PivotHeaderLayoutMap {
845
880
  if (rowDimension) {
846
881
  row = this.columnHeaderLevelCount;
847
882
  const {startInTotal: startInTotal, level: level} = rowDimension;
848
- return row += startInTotal, col = "grid" === this.rowHierarchyType ? this.rowHeaderTitle ? level + 1 : level : 0,
883
+ return row += startInTotal, col = "grid" === this.rowHierarchyType ? (this.rowHeaderTitle ? level + 1 : level) + this.leftRowSeriesNumberColumnCount : 0 + this.leftRowSeriesNumberColumnCount,
849
884
  {
850
885
  col: col,
851
886
  row: row
852
887
  };
853
888
  }
854
889
  if (colDimension) {
855
- col = this.rowHeaderLevelCount;
890
+ col = this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount;
856
891
  const {startInTotal: startInTotal, level: level} = colDimension;
857
892
  return col += startInTotal, row = this.columnHeaderTitle ? level + 1 : level, {
858
893
  col: col,
@@ -878,7 +913,7 @@ class PivotHeaderLayoutMap {
878
913
  indicatorKey: path.indicatorKey
879
914
  });
880
915
  })) : this.isCornerHeader(col, row) && ("row" === (null === (_a = null == this ? void 0 : this.cornerSetting) || void 0 === _a ? void 0 : _a.titleOnDimension) ? pivotInfo.push({
881
- dimensionKey: this.rowDimensionKeys[this.rowHeaderTitle ? col - 1 : col],
916
+ dimensionKey: this.rowDimensionKeys[(this.rowHeaderTitle ? col - 1 : col) - this.leftRowSeriesNumberColumnCount],
882
917
  isPivotCorner: !0
883
918
  }) : pivotInfo.push({
884
919
  dimensionKey: this.colDimensionKeys[this.columnHeaderTitle ? row - 1 : row],
@@ -901,7 +936,10 @@ class PivotHeaderLayoutMap {
901
936
  };
902
937
  }
903
938
  canMoveHeaderPosition(source, target) {
939
+ if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) return !1;
904
940
  if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) return !1;
941
+ this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row) && (source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1,
942
+ target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1);
905
943
  const sourceCellRange = this.getCellRange(source.col, source.row);
906
944
  if (this.isColumnHeader(source.col, source.row)) {
907
945
  return this.getParentCellId(source.col, sourceCellRange.start.row) === this.getParentCellId(target.col, sourceCellRange.start.row);
@@ -932,12 +970,13 @@ class PivotHeaderLayoutMap {
932
970
  if (targetIndex = target.col >= source.col ? targetCellRange.end.col - sourceSize + 1 : targetCellRange.start.col,
933
971
  targetIndex === sourceCellRange.start.col) return null;
934
972
  for (let row = 0; row < this._columnHeaderCellIds.length; row++) {
935
- const sourceIds = this._columnHeaderCellIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount, sourceSize);
936
- sourceIds.unshift(targetIndex - this.rowHeaderLevelCount, 0), Array.prototype.splice.apply(this._columnHeaderCellIds[row], sourceIds);
973
+ const sourceIds = this._columnHeaderCellIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, sourceSize);
974
+ sourceIds.unshift(targetIndex - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, 0),
975
+ Array.prototype.splice.apply(this._columnHeaderCellIds[row], sourceIds);
937
976
  }
938
- const sourceColumns = this._columnWidths.splice(sourceCellRange.start.col, sourceSize);
939
- return sourceColumns.unshift(targetIndex, 0), Array.prototype.splice.apply(this._columnWidths, sourceColumns),
940
- this.columnDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(source.col, source.row).colHeaderPaths.length - 1, sourceCellRange.start.col - this.rowHeaderLevelCount, targetCellRange.start.col - this.rowHeaderLevelCount),
977
+ const sourceColumns = this._columnWidths.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
978
+ return sourceColumns.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0),
979
+ Array.prototype.splice.apply(this._columnWidths, sourceColumns), this.columnDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(source.col, source.row).colHeaderPaths.length - 1, sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, targetCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount),
941
980
  this.columnDimensionTree.reset(this.columnDimensionTree.tree.children, !0), this._CellHeaderPathMap = new Map,
942
981
  this._largeCellRangeCache.length = 0, {
943
982
  sourceIndex: sourceCellRange.start.col,
@@ -1015,7 +1054,7 @@ class PivotHeaderLayoutMap {
1015
1054
  const dimension = rowArr[j];
1016
1055
  if (!(0, vutils_1.isValid)(rowDimension.indicatorKey) && dimension.dimensionKey === rowDimension.dimensionKey && dimension.value === rowDimension.value || (0,
1017
1056
  vutils_1.isValid)(rowDimension.indicatorKey) && dimension.indicatorKey === rowDimension.indicatorKey && (!rowDimension.value || dimension.value === rowDimension.value)) {
1018
- rowArr = dimension.children, (!needLowestLevel || rowArr && !rowArr.some((row => "axis" === row.dimensionKey))) && needLowestLevel || (rowDimensionFinded = dimension);
1057
+ rowArr = dimension.children, needLowestLevel && !rowArr ? rowDimensionFinded = dimension : needLowestLevel || (rowDimensionFinded = dimension);
1019
1058
  break;
1020
1059
  }
1021
1060
  }
@@ -1024,7 +1063,7 @@ class PivotHeaderLayoutMap {
1024
1063
  if (rowDimensionFinded || forceBody) {
1025
1064
  row = this.columnHeaderLevelCount;
1026
1065
  const {startInTotal: startInTotal, level: level} = null !== (_a = rowDimensionFinded) && void 0 !== _a ? _a : defaultDimension;
1027
- row += null != startInTotal ? startInTotal : 0, defaultCol = "grid" === this.rowHierarchyType ? this.rowHeaderTitle ? level + 1 : level : 0;
1066
+ row += null != startInTotal ? startInTotal : 0, defaultCol = "grid" === this.rowHierarchyType ? (this.rowHeaderTitle ? level + 1 : level) + this.leftRowSeriesNumberColumnCount : 0;
1028
1067
  }
1029
1068
  if (colDimensionFinded || forceBody) {
1030
1069
  col = this.rowHeaderLevelCount;
@@ -1326,6 +1365,23 @@ class PivotHeaderLayoutMap {
1326
1365
  this._headerObjectMap = this._headerObjects.reduce(((o, e) => (o[e.id] = e, o)), {}),
1327
1366
  this.setPagination(this.pagination);
1328
1367
  }
1368
+ isSeriesNumberInHeader(col, row) {
1369
+ 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;
1370
+ }
1371
+ isSeriesNumberInBody(col, row) {
1372
+ return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount && row >= this.headerLevelCount || this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row >= this.headerLevelCount;
1373
+ }
1374
+ isSeriesNumber(col, row) {
1375
+ return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount || this.rightRowSeriesNumberColumnCount > 0 && row >= 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount;
1376
+ }
1377
+ getSeriesNumberHeader(col, row) {
1378
+ return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount && row < this.headerLevelCount ? Object.assign({}, this.leftRowSeriesNumberColumn[col], {
1379
+ style: this._table.internalProps.rowSeriesNumber.headerStyle
1380
+ }) : this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row < this.headerLevelCount && row < this.headerLevelCount ? this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)] : void 0;
1381
+ }
1382
+ getSeriesNumberBody(col, row) {
1383
+ return this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount && row >= this.headerLevelCount ? this.leftRowSeriesNumberColumn[col] : this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount && row >= this.headerLevelCount ? this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)] : void 0;
1384
+ }
1329
1385
  }
1330
1386
 
1331
1387
  function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {