@visactor/vtable 1.3.2-alpha.0 → 1.3.2-alpha.2

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 (107) hide show
  1. package/cjs/PivotChart.d.ts +1 -0
  2. package/cjs/PivotChart.js +4 -0
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/components/axis/axis.js +3 -2
  5. package/cjs/components/axis/axis.js.map +1 -1
  6. package/cjs/components/empty-tip/empty-tip.js +2 -2
  7. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  8. package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
  9. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +4 -2
  11. package/cjs/core/BaseTable.js +54 -170
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/core/FouseInput.d.ts +1 -0
  14. package/cjs/core/FouseInput.js +5 -2
  15. package/cjs/core/FouseInput.js.map +1 -1
  16. package/cjs/core/utils/get-cell-position.d.ts +42 -0
  17. package/cjs/core/utils/get-cell-position.js +206 -0
  18. package/cjs/core/utils/get-cell-position.js.map +1 -0
  19. package/cjs/dataset/dataset.d.ts +0 -2
  20. package/cjs/dataset/dataset.js +7 -8
  21. package/cjs/dataset/dataset.js.map +1 -1
  22. package/cjs/event/event.js +2 -1
  23. package/cjs/event/event.js.map +1 -1
  24. package/cjs/event/listener/container-dom.js +1 -1
  25. package/cjs/event/listener/container-dom.js.map +1 -1
  26. package/cjs/event/util.js +2 -2
  27. package/cjs/event/util.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/pivot-header-layout.js +37 -57
  32. package/cjs/layout/pivot-header-layout.js.map +1 -1
  33. package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
  34. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  35. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  36. package/cjs/scenegraph/graphic/chart.js +34 -20
  37. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  38. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
  39. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  40. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  41. package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
  42. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  44. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  45. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
  46. package/cjs/scenegraph/refresh-node/update-chart.js +9 -2
  47. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  48. package/cjs/scenegraph/scenegraph.js +10 -4
  49. package/cjs/scenegraph/scenegraph.js.map +1 -1
  50. package/cjs/ts-types/base-table.d.ts +14 -1
  51. package/cjs/ts-types/base-table.js.map +1 -1
  52. package/cjs/vrender.js.map +1 -1
  53. package/dist/vtable.js +511 -443
  54. package/dist/vtable.min.js +2 -2
  55. package/es/PivotChart.d.ts +1 -0
  56. package/es/PivotChart.js +5 -2
  57. package/es/PivotChart.js.map +1 -1
  58. package/es/components/axis/axis.js +3 -1
  59. package/es/components/axis/axis.js.map +1 -1
  60. package/es/components/empty-tip/empty-tip.js +2 -2
  61. package/es/components/empty-tip/empty-tip.js.map +1 -1
  62. package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
  63. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  64. package/es/core/BaseTable.d.ts +4 -2
  65. package/es/core/BaseTable.js +55 -169
  66. package/es/core/BaseTable.js.map +1 -1
  67. package/es/core/FouseInput.d.ts +1 -0
  68. package/es/core/FouseInput.js +5 -2
  69. package/es/core/FouseInput.js.map +1 -1
  70. package/es/core/utils/get-cell-position.d.ts +42 -0
  71. package/es/core/utils/get-cell-position.js +194 -0
  72. package/es/core/utils/get-cell-position.js.map +1 -0
  73. package/es/dataset/dataset.d.ts +0 -2
  74. package/es/dataset/dataset.js +7 -8
  75. package/es/dataset/dataset.js.map +1 -1
  76. package/es/event/event.js +2 -1
  77. package/es/event/event.js.map +1 -1
  78. package/es/event/listener/container-dom.js +1 -1
  79. package/es/event/listener/container-dom.js.map +1 -1
  80. package/es/event/util.js +2 -2
  81. package/es/event/util.js.map +1 -1
  82. package/es/index.d.ts +1 -1
  83. package/es/index.js +1 -1
  84. package/es/index.js.map +1 -1
  85. package/es/layout/pivot-header-layout.js +36 -56
  86. package/es/layout/pivot-header-layout.js.map +1 -1
  87. package/es/scenegraph/debug-tool/debug-tool.js +4 -1
  88. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  89. package/es/scenegraph/graphic/chart.d.ts +1 -0
  90. package/es/scenegraph/graphic/chart.js +33 -21
  91. package/es/scenegraph/graphic/chart.js.map +1 -1
  92. package/es/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
  93. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  94. package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  95. package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
  96. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  97. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  98. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  99. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
  100. package/es/scenegraph/refresh-node/update-chart.js +6 -0
  101. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  102. package/es/scenegraph/scenegraph.js +10 -4
  103. package/es/scenegraph/scenegraph.js.map +1 -1
  104. package/es/ts-types/base-table.d.ts +14 -1
  105. package/es/ts-types/base-table.js.map +1 -1
  106. package/es/vrender.js.map +1 -1
  107. package/package.json +2 -2
@@ -1,6 +1,7 @@
1
1
  import type { BaseTable } from '../core';
2
2
  import type { Rect } from '../tools/Rect';
3
3
  export declare class FocusInput extends EventTarget {
4
+ private _container;
4
5
  private _table;
5
6
  private _input;
6
7
  constructor(table: BaseTable, parentElement: HTMLElement);
@@ -8,7 +8,7 @@ export class FocusInput extends EventTarget {
8
8
  div.classList.add("input-container");
9
9
  const input = this._input = document.createElement("input");
10
10
  div.appendChild(input), input.classList.add("table-focus-control"), input.dataset.vtable = "vtable",
11
- input.readOnly = !0, parentElement.appendChild(div);
11
+ input.readOnly = !0, parentElement.appendChild(div), this._container = div;
12
12
  }
13
13
  focus() {
14
14
  this._input.focus({
@@ -25,6 +25,9 @@ export class FocusInput extends EventTarget {
25
25
  get input() {
26
26
  return this._input;
27
27
  }
28
- release() {}
28
+ release() {
29
+ var _a;
30
+ null === (_a = this._container.parentElement) || void 0 === _a || _a.removeChild(this._container);
31
+ }
29
32
  }
30
33
  //# sourceMappingURL=FouseInput.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/FouseInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,OAAO,UAAW,SAAQ,WAAW;IAGzC,YAAY,KAAgB,EAAE,aAA0B;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;YACvB,OAAO;SACR;QACD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE1C,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QACxB,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;QACjC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,CA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AO;IAEP,CAAC;CACF","file":"FouseInput.js","sourcesContent":["import type { BaseTable } from '../core';\nimport type { Rect } from '../tools/Rect';\nimport { Env } from '../tools/env';\n\nexport class FocusInput extends EventTarget {\n private _table: BaseTable;\n private _input: HTMLInputElement;\n constructor(table: BaseTable, parentElement: HTMLElement) {\n super();\n this._table = table;\n if (Env.mode === 'node') {\n return;\n }\n const div = document.createElement('div'); //再加一层 C360插件逻辑中用的window.getSelection()来判断的滚动\n // div.style.position = 'fixed';//定位不能使用fixed 在父级transform非none的时候 都会有问题\n div.style.opacity = '0';\n div.dataset.vtable = 'vtable'; //这里不能变 C360取元素的依据\n div.style.pointerEvents = 'none';\n div.classList.add('input-container');\n const input = (this._input = document.createElement('input'));\n div.appendChild(input);\n input.classList.add('table-focus-control');\n input.dataset.vtable = 'vtable';\n input.readOnly = true;\n parentElement.appendChild(div);\n }\n\n focus(): void {\n this._input.focus({ preventScroll: true });\n }\n setFocusRect(rect: Rect, value: string): void {\n const input = this._input;\n input.value = value;\n // input.focus({ preventScroll: true });\n input.select();\n const top = rect.top - this._table.scrollTop;\n const left = rect.left - this._table.scrollLeft;\n input.style.top = `${top.toFixed()}px`;\n input.style.left = `${left.toFixed()}px`;\n input.style.width = `${rect.width.toFixed()}px`;\n input.style.height = `${rect.height.toFixed()}px`;\n }\n get input(): HTMLInputElement {\n return this._input;\n }\n release(): void {\n // document.removeChild(this._input);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/FouseInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,OAAO,UAAW,SAAQ,WAAW;IAIzC,YAAY,KAAgB,EAAE,aAA0B;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;YACvB,OAAO;SACR;QACD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,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AAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;QACzC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;QAChD,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;IACpD,CAAC;IACD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,OAAO;;QAEL,MAAA,IAAI,CAAC,UAAU,CAAC,aAAa,0CAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9D,CAAC;CACF","file":"FouseInput.js","sourcesContent":["import type { BaseTable } from '../core';\nimport type { Rect } from '../tools/Rect';\nimport { Env } from '../tools/env';\n\nexport class FocusInput extends EventTarget {\n private _container: HTMLDivElement;\n private _table: BaseTable;\n private _input: HTMLInputElement;\n constructor(table: BaseTable, parentElement: HTMLElement) {\n super();\n this._table = table;\n if (Env.mode === 'node') {\n return;\n }\n const div = document.createElement('div'); //再加一层 C360插件逻辑中用的window.getSelection()来判断的滚动\n // div.style.position = 'fixed';//定位不能使用fixed 在父级transform非none的时候 都会有问题\n div.style.opacity = '0';\n div.dataset.vtable = 'vtable'; //这里不能变 C360取元素的依据\n div.style.pointerEvents = 'none';\n div.classList.add('input-container');\n const input = (this._input = document.createElement('input'));\n div.appendChild(input);\n input.classList.add('table-focus-control');\n input.dataset.vtable = 'vtable';\n input.readOnly = true;\n parentElement.appendChild(div);\n this._container = div;\n }\n\n focus(): void {\n this._input.focus({ preventScroll: true });\n }\n setFocusRect(rect: Rect, value: string): void {\n const input = this._input;\n input.value = value;\n // input.focus({ preventScroll: true });\n input.select();\n const top = rect.top - this._table.scrollTop;\n const left = rect.left - this._table.scrollLeft;\n input.style.top = `${top.toFixed()}px`;\n input.style.left = `${left.toFixed()}px`;\n input.style.width = `${rect.width.toFixed()}px`;\n input.style.height = `${rect.height.toFixed()}px`;\n }\n get input(): HTMLInputElement {\n return this._input;\n }\n release(): void {\n // document.removeChild(this._input);\n this._container.parentElement?.removeChild(this._container);\n }\n}\n"]}
@@ -0,0 +1,42 @@
1
+ import type { CellAddressWithBound } from '../../ts-types';
2
+ import type { BaseTableAPI } from '../../ts-types/base-table';
3
+ export declare function getRowAt(absoluteY: number, _this: BaseTableAPI): {
4
+ top: number;
5
+ row: number;
6
+ bottom: number;
7
+ height: number;
8
+ };
9
+ export declare function getColAt(absoluteX: number, _this: BaseTableAPI): {
10
+ left: number;
11
+ col: number;
12
+ right: number;
13
+ width: number;
14
+ };
15
+ export declare function getCellAt(absoluteX: number, absoluteY: number, _this: BaseTableAPI): CellAddressWithBound;
16
+ export declare function getTargetColAt(absoluteX: number, _this: BaseTableAPI): {
17
+ col: number;
18
+ left: number;
19
+ right: number;
20
+ width: number;
21
+ } | null;
22
+ export declare function getTargetRowAt(absoluteY: number, _this: BaseTableAPI): {
23
+ row: number;
24
+ top: number;
25
+ bottom: number;
26
+ height: number;
27
+ } | null;
28
+ export declare function getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean, _this: BaseTableAPI): {
29
+ col: number;
30
+ left: number;
31
+ right: number;
32
+ width: number;
33
+ } | null;
34
+ export declare function getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean, _this: BaseTableAPI): {
35
+ row: number;
36
+ top: number;
37
+ bottom: number;
38
+ height: number;
39
+ } | null;
40
+ export declare function computeTargetRowByY(absoluteY: number, _this: BaseTableAPI): number;
41
+ export declare function computeTargetColByX(absoluteX: number, _this: BaseTableAPI): number;
42
+ export declare function getCellAtRelativePosition(x: number, y: number, _this: BaseTableAPI): CellAddressWithBound;
@@ -0,0 +1,194 @@
1
+ import { _getTargetFrozenColAt, _getTargetFrozenRowAt } from "../tableHelper";
2
+
3
+ export function getRowAt(absoluteY, _this) {
4
+ const frozen = _getTargetFrozenRowAt(_this, absoluteY);
5
+ if (frozen) return frozen;
6
+ let row = getTargetRowAt(absoluteY, _this);
7
+ return row || (row = {
8
+ top: -1,
9
+ row: -1,
10
+ bottom: -1,
11
+ height: -1
12
+ }), row;
13
+ }
14
+
15
+ export function getColAt(absoluteX, _this) {
16
+ const frozen = _getTargetFrozenColAt(_this, absoluteX);
17
+ if (frozen) return frozen;
18
+ let col = getTargetColAt(absoluteX, _this);
19
+ return col || (col = {
20
+ left: -1,
21
+ col: -1,
22
+ right: -1,
23
+ width: 1
24
+ }), col;
25
+ }
26
+
27
+ export function getCellAt(absoluteX, absoluteY, _this) {
28
+ const rowInfo = getRowAt(absoluteY, _this), {row: row, top: top, bottom: bottom, height: height} = rowInfo, colInfo = getColAt(absoluteX, _this), {col: col, left: left, right: right, width: width} = colInfo;
29
+ return {
30
+ row: row,
31
+ col: col,
32
+ rect: {
33
+ left: left,
34
+ right: right,
35
+ top: top,
36
+ bottom: bottom,
37
+ width: width,
38
+ height: height
39
+ }
40
+ };
41
+ }
42
+
43
+ export function getTargetColAt(absoluteX, _this) {
44
+ if (0 === absoluteX) return {
45
+ left: 0,
46
+ col: 0,
47
+ right: 0,
48
+ width: 0
49
+ };
50
+ const candCol = computeTargetColByX(absoluteX, _this), right = _this.getColsWidth(0, candCol);
51
+ return absoluteX >= right ? ((startCol, startRight) => {
52
+ let left = startRight - _this.getColWidth(startCol);
53
+ const {colCount: colCount} = _this.internalProps;
54
+ for (let col = startCol; col < colCount; col++) {
55
+ const width = _this.getColWidth(col), right = left + width;
56
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) return {
57
+ left: left,
58
+ col: col,
59
+ right: right,
60
+ width: width
61
+ };
62
+ left = right;
63
+ }
64
+ return null;
65
+ })(candCol, right) : ((startCol, startRight) => {
66
+ let right = startRight;
67
+ for (let col = startCol; col >= 0; col--) {
68
+ const width = _this.getColWidth(col), left = right - width;
69
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) return {
70
+ left: left,
71
+ col: col,
72
+ right: right,
73
+ width: width
74
+ };
75
+ right = left;
76
+ }
77
+ return null;
78
+ })(candCol, right);
79
+ }
80
+
81
+ export function getTargetRowAt(absoluteY, _this) {
82
+ if (0 === absoluteY) return {
83
+ top: 0,
84
+ row: 0,
85
+ bottom: 0,
86
+ height: 0
87
+ };
88
+ const candRow = computeTargetRowByY(absoluteY, _this), bottom = _this.getRowsHeight(0, candRow);
89
+ return absoluteY >= bottom ? ((startRow, startBottom) => {
90
+ let top = startBottom - _this.getRowHeight(startRow);
91
+ const {rowCount: rowCount} = _this.internalProps;
92
+ for (let row = startRow; row < rowCount; row++) {
93
+ const height = _this.getRowHeight(row), bottom = top + height;
94
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
95
+ top: top,
96
+ row: row,
97
+ bottom: bottom,
98
+ height: height
99
+ };
100
+ top = bottom;
101
+ }
102
+ return null;
103
+ })(candRow, bottom) : ((startRow, startBottom) => {
104
+ let bottom = startBottom;
105
+ for (let row = startRow; row >= 0; row--) {
106
+ const height = _this.getRowHeight(row), top = bottom - height;
107
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
108
+ top: top,
109
+ row: row,
110
+ bottom: bottom,
111
+ height: height
112
+ };
113
+ bottom = top;
114
+ }
115
+ return null;
116
+ })(candRow, bottom);
117
+ }
118
+
119
+ export function getTargetColAtConsiderRightFrozen(absoluteX, isConsider, _this) {
120
+ if (0 === absoluteX) return {
121
+ left: 0,
122
+ col: 0,
123
+ right: 0,
124
+ width: 0
125
+ };
126
+ if (isConsider && absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && absoluteX < _this.tableNoFrameWidth) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) return {
127
+ col: _this.colCount - i - 1,
128
+ left: void 0,
129
+ right: void 0,
130
+ width: void 0
131
+ };
132
+ return getTargetColAt(absoluteX, _this);
133
+ }
134
+
135
+ export function getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider, _this) {
136
+ if (0 === absoluteY) return {
137
+ top: 0,
138
+ row: 0,
139
+ bottom: 0,
140
+ height: 0
141
+ };
142
+ if (isConsider && absoluteY > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && absoluteY < _this.tableNoFrameHeight) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteY > _this.tableNoFrameHeight - _this.getRowsHeight(_this.rowCount - i - 1, _this.rowCount - 1)) return {
143
+ row: _this.rowCount - i - 1,
144
+ top: void 0,
145
+ bottom: void 0,
146
+ height: void 0
147
+ };
148
+ return getTargetRowAt(absoluteY, _this);
149
+ }
150
+
151
+ export function computeTargetRowByY(absoluteY, _this) {
152
+ let defaultRowHeight = _this.internalProps.defaultRowHeight;
153
+ return _this._rowRangeHeightsMap.get("$0$" + (_this.rowCount - 1)) && (defaultRowHeight = _this._rowRangeHeightsMap.get("$0$" + (_this.rowCount - 1)) / _this.rowCount),
154
+ Math.min(Math.ceil(absoluteY / defaultRowHeight), _this.rowCount - 1);
155
+ }
156
+
157
+ export function computeTargetColByX(absoluteX, _this) {
158
+ if (_this._colRangeWidthsMap.get("$0$" + (_this.colCount - 1))) {
159
+ let startCol = 0, endCol = _this.colCount - 1;
160
+ for (;endCol - startCol > 1; ) {
161
+ const midCol = Math.floor((startCol + endCol) / 2);
162
+ if (absoluteX < _this._colRangeWidthsMap.get(`$0$${midCol}`)) endCol = midCol; else {
163
+ if (!(absoluteX > _this._colRangeWidthsMap.get(`$0$${midCol}`))) return midCol;
164
+ startCol = midCol;
165
+ }
166
+ }
167
+ return endCol;
168
+ }
169
+ return Math.min(Math.ceil(absoluteX / _this.internalProps.defaultColWidth), _this.colCount - 1);
170
+ }
171
+
172
+ export function getCellAtRelativePosition(x, y, _this) {
173
+ x -= _this.tableX;
174
+ let bottomFrozen = !1;
175
+ (y -= _this.tableY) > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && (bottomFrozen = !0);
176
+ let rightFrozen = !1;
177
+ x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && (rightFrozen = !0);
178
+ const colInfo = getTargetColAtConsiderRightFrozen(rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this), rowInfo = getTargetRowAtConsiderBottomFrozen(bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
179
+ if (!colInfo || !rowInfo) return;
180
+ const {row: row, top: top, bottom: bottom, height: height} = rowInfo, {col: col, left: left, right: right, width: width} = colInfo;
181
+ return {
182
+ row: row,
183
+ col: col,
184
+ rect: {
185
+ left: left,
186
+ right: right,
187
+ top: top,
188
+ bottom: bottom,
189
+ width: width,
190
+ height: height
191
+ }
192
+ };
193
+ }
194
+ //# sourceMappingURL=get-cell-position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/utils/get-cell-position.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAO9E,MAAM,UAAU,QAAQ,CACtB,SAAiB,EACjB,KAAmB;IAEnB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvD,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IACD,IAAI,GAAG,GAAG,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG;YACJ,GAAG,EAAE,CAAC,CAAC;YACP,GAAG,EAAE,CAAC,CAAC;YACP,MAAM,EAAE,CAAC,CAAC;YACV,MAAM,EAAE,CAAC,CAAC;SACX,CAAC;KACH;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAMD,MAAM,UAAU,QAAQ,CACtB,SAAiB,EACjB,KAAmB;IAEnB,MAAM,M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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;IAChH,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC7C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,IAAI,GAAG;QACX,IAAI;QACJ,KAAK;QACL,GAAG;QACH,MAAM;QACN,KAAK;QACL,MAAM;KACP,CAAC;IACF,OAAO;QACL,GAAG;QACH,GAAG;QACH,IAAI;KACL,CAAC;AACJ,CAAC","file":"get-cell-position.js","sourcesContent":["import type { CellAddressWithBound } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { _getTargetFrozenColAt, _getTargetFrozenRowAt } from '../tableHelper';\n\n/**\n * 根据y值计算所在行\n * @param absoluteY\n * @returns\n */\nexport function getRowAt(\n absoluteY: number,\n _this: BaseTableAPI\n): { top: number; row: number; bottom: number; height: number } {\n const frozen = _getTargetFrozenRowAt(_this, absoluteY);\n if (frozen) {\n return frozen;\n }\n let row = getTargetRowAt(absoluteY, _this);\n if (!row) {\n row = {\n top: -1,\n row: -1,\n bottom: -1,\n height: -1\n };\n }\n return row;\n}\n/**\n * 根据x值计算所在列\n * @param absoluteX\n * @returns\n */\nexport function getColAt(\n absoluteX: number,\n _this: BaseTableAPI\n): { left: number; col: number; right: number; width: number } {\n const frozen = _getTargetFrozenColAt(_this, absoluteX);\n if (frozen) {\n return frozen;\n }\n let col = getTargetColAt(absoluteX, _this);\n if (!col) {\n col = {\n left: -1,\n col: -1,\n right: -1,\n width: 1\n };\n }\n return col;\n}\n/**\n * 根据坐标值获取行列位置,index和rect范围\n * @param absoluteX\n * @param absoluteY\n * @returns\n */\nexport function getCellAt(absoluteX: number, absoluteY: number, _this: BaseTableAPI): CellAddressWithBound {\n const rowInfo = getRowAt(absoluteY, _this);\n const { row, top, bottom, height } = rowInfo;\n const colInfo = getColAt(absoluteX, _this);\n const { col, left, right, width } = colInfo;\n const rect = {\n left,\n right,\n top,\n bottom,\n width,\n height\n };\n return {\n row,\n col,\n rect\n };\n}\n\n/**\n * 根据x获取该位置所处列值\n * @param table\n * @param absoluteX\n * @returns\n */\nexport function getTargetColAt(\n absoluteX: number,\n _this: BaseTableAPI\n): { col: number; left: number; right: number; width: number } | null {\n if (absoluteX === 0) {\n return { left: 0, col: 0, right: 0, width: 0 };\n }\n const findBefore = (\n startCol: number,\n startRight: number\n ): {\n left: number;\n col: number;\n right: number;\n width: number;\n } | null => {\n let right = startRight;\n for (let col = startCol; col >= 0; col--) {\n const width = _this.getColWidth(col);\n const left = right - width;\n if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {\n return {\n left,\n col,\n right,\n width\n };\n }\n right = left;\n }\n return null;\n };\n const findAfter = (\n startCol: number,\n startRight: number\n ): {\n left: number;\n col: number;\n right: number;\n width: number;\n } | null => {\n let left = startRight - _this.getColWidth(startCol);\n const { colCount } = _this.internalProps;\n for (let col = startCol; col < colCount; col++) {\n const width = _this.getColWidth(col);\n const right = left + width;\n if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {\n return {\n left,\n col,\n right,\n width\n };\n }\n left = right;\n }\n return null;\n };\n //计算这个位置处是第几行\n const candCol = computeTargetColByX(absoluteX, _this);\n const right = _this.getColsWidth(0, candCol);\n if (absoluteX >= right) {\n return findAfter(candCol, right);\n }\n return findBefore(candCol, right);\n}\n/**\n * 根据y获取该位置所处行值\n * @param table\n * @param absoluteX\n * @returns\n */\nexport function getTargetRowAt(\n absoluteY: number,\n _this: BaseTableAPI\n): { row: number; top: number; bottom: number; height: number } | null {\n if (absoluteY === 0) {\n return { top: 0, row: 0, bottom: 0, height: 0 };\n }\n\n const findBefore = (\n startRow: number,\n startBottom: number\n ): {\n top: number;\n row: number;\n bottom: number;\n height: number;\n } | null => {\n let bottom = startBottom;\n for (let row = startRow; row >= 0; row--) {\n const height = _this.getRowHeight(row);\n const top = bottom - height;\n if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {\n return {\n top,\n row,\n bottom,\n height\n };\n }\n bottom = top;\n }\n return null;\n };\n const findAfter = (\n startRow: number,\n startBottom: number\n ): {\n top: number;\n row: number;\n bottom: number;\n height: number;\n } | null => {\n let top = startBottom - _this.getRowHeight(startRow);\n const { rowCount } = _this.internalProps;\n for (let row = startRow; row < rowCount; row++) {\n const height = _this.getRowHeight(row);\n const bottom = top + height;\n if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {\n return {\n top,\n row,\n bottom,\n height\n };\n }\n top = bottom;\n }\n return null;\n };\n // const candRow = Math.min(\n // Math.ceil(absoluteY / this.internalProps.defaultRowHeight),\n // this.rowCount - 1\n // );\n //计算这个位置处是第几行\n const candRow = computeTargetRowByY(absoluteY, _this);\n const bottom = _this.getRowsHeight(0, candRow);\n if (absoluteY >= bottom) {\n return findAfter(candRow, bottom);\n }\n return findBefore(candRow, bottom);\n}\n\n/**\n * 根据x获取该位置所处列值\n * @param table\n * @param absoluteX\n * @returns\n */\nexport function getTargetColAtConsiderRightFrozen(\n absoluteX: number,\n isConsider: boolean,\n _this: BaseTableAPI\n): { col: number; left: number; right: number; width: number } | null {\n if (absoluteX === 0) {\n return { left: 0, col: 0, right: 0, width: 0 };\n }\n if (\n isConsider &&\n absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&\n absoluteX < _this.tableNoFrameWidth\n ) {\n for (let i = 0; i < _this.rightFrozenColCount; i++) {\n if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) {\n return {\n col: _this.colCount - i - 1,\n left: undefined,\n right: undefined,\n width: undefined\n };\n }\n }\n }\n return getTargetColAt(absoluteX, _this);\n}\n\n/**\n * 根据y获取该位置所处行值\n * @param table\n * @param absoluteX\n * @returns\n */\nexport function getTargetRowAtConsiderBottomFrozen(\n absoluteY: number,\n isConsider: boolean,\n _this: BaseTableAPI\n): { row: number; top: number; bottom: number; height: number } | null {\n if (absoluteY === 0) {\n return { top: 0, row: 0, bottom: 0, height: 0 };\n }\n if (\n isConsider &&\n absoluteY > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() &&\n absoluteY < _this.tableNoFrameHeight\n ) {\n for (let i = 0; i < _this.rightFrozenColCount; i++) {\n if (absoluteY > _this.tableNoFrameHeight - _this.getRowsHeight(_this.rowCount - i - 1, _this.rowCount - 1)) {\n return {\n row: _this.rowCount - i - 1,\n top: undefined,\n bottom: undefined,\n height: undefined\n };\n }\n }\n }\n return getTargetRowAt(absoluteY, _this);\n}\n\n/**\n * 根据y值(包括了scroll的)计算所在行\n * @param this\n * @param absoluteY 左边y值,包含了scroll滚动距离\n * @returns\n */\nexport function computeTargetRowByY(absoluteY: number, _this: BaseTableAPI): number {\n let defaultRowHeight = _this.internalProps.defaultRowHeight;\n\n //使用二分法计算出row\n if (_this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`)) {\n defaultRowHeight = _this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`) / _this.rowCount;\n // let startRow = 0;\n // let endRow = this.rowCount - 1;\n // while (endRow - startRow > 1) {\n // const midRow = Math.floor((startRow + endRow) / 2);\n // if (absoluteY < this._rowRangeHeightsMap.get(`$0$${midRow}`)) {\n // endRow = midRow;\n // } else if (absoluteY > this._rowRangeHeightsMap.get(`$0$${midRow}`)) {\n // startRow = midRow;\n // } else {\n // return midRow;\n // }\n // }\n // return endRow;\n }\n //否则使用defaultRowHeight大约计算一个row\n return Math.min(Math.ceil(absoluteY / defaultRowHeight), _this.rowCount - 1);\n}\n/**\n * 根据x值(包括了scroll的)计算所在列 主要借助colRangeWidthsMap缓存来提高计算效率\n * @param this\n * @param absoluteX 左边x值,包含了scroll滚动距离\n * @returns\n */\nexport function computeTargetColByX(absoluteX: number, _this: BaseTableAPI): number {\n //使用二分法计算出col\n if (_this._colRangeWidthsMap.get(`$0$${_this.colCount - 1}`)) {\n let startCol = 0;\n let endCol = _this.colCount - 1;\n while (endCol - startCol > 1) {\n const midCol = Math.floor((startCol + endCol) / 2);\n if (absoluteX < _this._colRangeWidthsMap.get(`$0$${midCol}`)) {\n endCol = midCol;\n } else if (absoluteX > _this._colRangeWidthsMap.get(`$0$${midCol}`)) {\n startCol = midCol;\n } else {\n return midCol;\n }\n }\n return endCol;\n }\n //否则使用defaultColWidth大约计算一个col\n return Math.min(Math.ceil(absoluteX / _this.internalProps.defaultColWidth), _this.colCount - 1);\n}\n\n// 获取屏幕坐标对应的单元格信息,考虑滚动\nexport function getCellAtRelativePosition(x: number, y: number, _this: BaseTableAPI): CellAddressWithBound {\n // table border and outer component\n x -= _this.tableX;\n y -= _this.tableY;\n\n // bottom frozen\n let bottomFrozen = false;\n if (y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight) {\n bottomFrozen = true;\n }\n // right frozen\n let rightFrozen = false;\n if (x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth) {\n rightFrozen = true;\n }\n\n const colInfo = getTargetColAtConsiderRightFrozen(rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this);\n const rowInfo = getTargetRowAtConsiderBottomFrozen(bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);\n if (!colInfo || !rowInfo) {\n return undefined;\n }\n const { row, top, bottom, height } = rowInfo;\n const { col, left, right, width } = colInfo;\n const rect = {\n left,\n right,\n top,\n bottom,\n width,\n height\n };\n return {\n row,\n col,\n rect\n };\n}\n"]}
@@ -41,9 +41,7 @@ export declare class Dataset {
41
41
  collectedValues: Record<string, Record<string, CollectedValue>>;
42
42
  cacheCollectedValues: Record<string, Record<string, CollectedValue>>;
43
43
  rows: string[];
44
- rowsHasValue: boolean[];
45
44
  columns: string[];
46
- columnsHasValue: boolean[];
47
45
  indicatorKeys: string[];
48
46
  customRowTree?: IHeaderTreeDefine[];
49
47
  customColTree?: IHeaderTreeDefine[];
@@ -43,8 +43,7 @@ export class Dataset {
43
43
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
44
44
  if (this.records = records, this.collectedValues = {}, this.cacheCollectedValues = {},
45
45
  this.totalRecordsTree = {}, this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {},
46
- this.colKeys = [], this.rowKeys = [], this.rowsHasValue = [], this.columnsHasValue = [],
47
- records) {
46
+ this.colKeys = [], this.rowKeys = [], records) {
48
47
  this.records = records;
49
48
  "undefined" != typeof window && window.performance.now();
50
49
  this.processRecords(), this.processCollectedValuesWithSumBy(), this.generateCollectedValuesSortRule(),
@@ -54,8 +53,8 @@ export class Dataset {
54
53
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
55
54
  this.sortKeys();
56
55
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
57
- this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k),
58
- this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t);
56
+ this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k),
57
+ this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t);
59
58
  "undefined" != typeof window && window.performance.now();
60
59
  (null === (_u = this.dataConfig) || void 0 === _u ? void 0 : _u.isPivotChart) && this.cacheDeminsionCollectedValues();
61
60
  }
@@ -159,7 +158,7 @@ export class Dataset {
159
158
  let isToTalRecord = !1;
160
159
  for (let l = 0, len1 = this.rows.length; l < len1; l++) {
161
160
  const rowAttr = this.rows[l];
162
- if (rowAttr in record) this.rowsHasValue[l] = !0, rowKey.push(record[rowAttr]); else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
161
+ if (rowAttr in record) rowKey.push(record[rowAttr]); else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
163
162
  if ((null === (_d = null === (_c = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) && 0 === l && !this.rows.find((rk => rk in record))) {
164
163
  rowKey.push(this.rowGrandTotalLabel), isToTalRecord = !0;
165
164
  break;
@@ -172,7 +171,7 @@ export class Dataset {
172
171
  }
173
172
  for (let n = 0, len2 = this.columns.length; n < len2; n++) {
174
173
  const colAttr = this.columns[n];
175
- if (colAttr in record) this.columnsHasValue[n] = !0, colKey.push(record[colAttr]); else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
174
+ if (colAttr in record) colKey.push(record[colAttr]); else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
176
175
  if ((null === (_o = null === (_m = null === (_l = this.dataConfig) || void 0 === _l ? void 0 : _l.totals) || void 0 === _m ? void 0 : _m.column) || void 0 === _o ? void 0 : _o.showGrandTotals) && 0 === n && !this.columns.find((ck => ck in record))) {
177
176
  colKey.push(this.colGrandTotalLabel), isToTalRecord = !0;
178
177
  break;
@@ -222,8 +221,8 @@ export class Dataset {
222
221
  }
223
222
  updateSortRules(sortRules) {
224
223
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
225
- this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k)),
226
- this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t));
224
+ this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k)),
225
+ this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t));
227
226
  }
228
227
  updateFilterRules(filterRules, isResetTree = !1) {
229
228
  var _a;