@visactor/vtable 0.13.0-alpha.4 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/cjs/ListTable.js +4 -3
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +1 -0
  4. package/cjs/PivotChart.js +10 -7
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.js +6 -6
  7. package/cjs/PivotTable.js.map +1 -1
  8. package/cjs/body-helper/body-helper.d.ts +1 -1
  9. package/cjs/body-helper/body-helper.js +4 -1
  10. package/cjs/body-helper/body-helper.js.map +1 -1
  11. package/cjs/body-helper/style/CheckboxStyle.d.ts +7 -0
  12. package/cjs/body-helper/style/CheckboxStyle.js +24 -0
  13. package/cjs/body-helper/style/CheckboxStyle.js.map +1 -0
  14. package/cjs/components/axis/axis.d.ts +2 -2
  15. package/cjs/components/axis/axis.js +5 -4
  16. package/cjs/components/axis/axis.js.map +1 -1
  17. package/cjs/components/axis/linear-scale.d.ts +8 -5
  18. package/cjs/components/axis/linear-scale.js +19 -5
  19. package/cjs/components/axis/linear-scale.js.map +1 -1
  20. package/cjs/components/menu/dom/logic/MenuElementStyle.js +8 -3
  21. package/cjs/components/menu/dom/logic/MenuElementStyle.js.map +1 -1
  22. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +6 -5
  23. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  24. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +8 -3
  25. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  26. package/cjs/core/BaseTable.d.ts +2 -0
  27. package/cjs/core/BaseTable.js +27 -11
  28. package/cjs/core/BaseTable.js.map +1 -1
  29. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  30. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  31. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  32. package/cjs/core/style.js +8 -3
  33. package/cjs/core/style.js.map +1 -1
  34. package/cjs/dataset/dataset.js +2 -2
  35. package/cjs/dataset/dataset.js.map +1 -1
  36. package/cjs/event/event.js +5 -5
  37. package/cjs/event/event.js.map +1 -1
  38. package/cjs/event/listener/table-group.js +8 -0
  39. package/cjs/event/listener/table-group.js.map +1 -1
  40. package/cjs/event/listener/touch.js +2 -1
  41. package/cjs/event/listener/touch.js.map +1 -1
  42. package/cjs/event/scroll.js +1 -1
  43. package/cjs/event/scroll.js.map +1 -1
  44. package/cjs/index.d.ts +1 -1
  45. package/cjs/index.js +1 -1
  46. package/cjs/index.js.map +1 -1
  47. package/cjs/layout/chart-helper/get-axis-config.js +16 -16
  48. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  49. package/cjs/layout/chart-helper/get-axis-domain.js +11 -8
  50. package/cjs/layout/chart-helper/get-axis-domain.js.map +1 -1
  51. package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
  52. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  53. package/cjs/layout/pivot-header-layout.js +2 -2
  54. package/cjs/layout/pivot-header-layout.js.map +1 -1
  55. package/cjs/render/layout/text.js +1 -1
  56. package/cjs/render/layout/text.js.map +1 -1
  57. package/cjs/scenegraph/component/menu.js +2 -0
  58. package/cjs/scenegraph/component/menu.js.map +1 -1
  59. package/cjs/scenegraph/context/canvas.js +2 -2
  60. package/cjs/scenegraph/context/canvas.js.map +1 -1
  61. package/cjs/scenegraph/context/context.js +2 -2
  62. package/cjs/scenegraph/context/context.js.map +1 -1
  63. package/cjs/scenegraph/context/module.d.ts +1 -1
  64. package/cjs/scenegraph/context/module.js +2 -2
  65. package/cjs/scenegraph/context/module.js.map +1 -1
  66. package/cjs/scenegraph/graphic/chart.d.ts +2 -0
  67. package/cjs/scenegraph/graphic/chart.js +8 -2
  68. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  69. package/cjs/scenegraph/group-creater/cell-helper.js +8 -42
  70. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  71. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -0
  72. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  73. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +5 -0
  74. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +74 -0
  75. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -0
  76. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
  77. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  78. package/cjs/scenegraph/group-creater/progress/proxy.js +6 -4
  79. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  80. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +1 -1
  81. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  82. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -3
  83. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  84. package/cjs/scenegraph/refresh-node/update-chart.js +6 -3
  85. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  86. package/cjs/scenegraph/scenegraph.js +7 -5
  87. package/cjs/scenegraph/scenegraph.js.map +1 -1
  88. package/cjs/scenegraph/utils/text-measure.js +4 -4
  89. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  90. package/cjs/themes/ARCO.js +0 -8
  91. package/cjs/themes/ARCO.js.map +1 -1
  92. package/cjs/themes/BRIGHT.js +0 -8
  93. package/cjs/themes/BRIGHT.js.map +1 -1
  94. package/cjs/themes/DARK.js +0 -8
  95. package/cjs/themes/DARK.js.map +1 -1
  96. package/cjs/themes/DEFAULT.js +0 -8
  97. package/cjs/themes/DEFAULT.js.map +1 -1
  98. package/cjs/themes/theme.js +6 -2
  99. package/cjs/themes/theme.js.map +1 -1
  100. package/cjs/tools/global.d.ts +1 -2
  101. package/cjs/tools/global.js +4 -4
  102. package/cjs/tools/global.js.map +1 -1
  103. package/cjs/ts-types/base-table.d.ts +6 -0
  104. package/cjs/ts-types/base-table.js.map +1 -1
  105. package/cjs/ts-types/column/style.d.ts +2 -1
  106. package/cjs/ts-types/column/style.js.map +1 -1
  107. package/cjs/ts-types/column/type.d.ts +1 -1
  108. package/cjs/ts-types/column/type.js.map +1 -1
  109. package/cjs/ts-types/events.d.ts +4 -0
  110. package/cjs/ts-types/events.js.map +1 -1
  111. package/cjs/ts-types/list-table/define/checkbox-define.d.ts +9 -0
  112. package/cjs/ts-types/list-table/define/checkbox-define.js +6 -0
  113. package/cjs/ts-types/list-table/define/checkbox-define.js.map +1 -0
  114. package/cjs/ts-types/list-table/define/index.d.ts +4 -2
  115. package/cjs/ts-types/list-table/define/index.js.map +1 -1
  116. package/cjs/ts-types/pivot-table/indicator/checkbox-indicator.d.ts +9 -0
  117. package/cjs/ts-types/pivot-table/indicator/checkbox-indicator.js +6 -0
  118. package/cjs/ts-types/pivot-table/indicator/checkbox-indicator.js.map +1 -0
  119. package/cjs/ts-types/pivot-table/indicator/index.d.ts +2 -1
  120. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
  121. package/cjs/ts-types/theme.d.ts +6 -3
  122. package/cjs/ts-types/theme.js.map +1 -1
  123. package/cjs/ts-types/tooltip.d.ts +2 -1
  124. package/cjs/ts-types/tooltip.js.map +1 -1
  125. package/dist/vtable.js +759 -235
  126. package/dist/vtable.min.js +2 -2
  127. package/es/ListTable.js +5 -2
  128. package/es/ListTable.js.map +1 -1
  129. package/es/PivotChart.d.ts +1 -0
  130. package/es/PivotChart.js +11 -5
  131. package/es/PivotChart.js.map +1 -1
  132. package/es/PivotTable.js +7 -4
  133. package/es/PivotTable.js.map +1 -1
  134. package/es/body-helper/body-helper.d.ts +1 -1
  135. package/es/body-helper/body-helper.js +5 -0
  136. package/es/body-helper/body-helper.js.map +1 -1
  137. package/es/body-helper/style/CheckboxStyle.d.ts +7 -0
  138. package/es/body-helper/style/CheckboxStyle.js +16 -0
  139. package/es/body-helper/style/CheckboxStyle.js.map +1 -0
  140. package/es/components/axis/axis.d.ts +2 -2
  141. package/es/components/axis/axis.js +5 -4
  142. package/es/components/axis/axis.js.map +1 -1
  143. package/es/components/axis/linear-scale.d.ts +8 -5
  144. package/es/components/axis/linear-scale.js +15 -6
  145. package/es/components/axis/linear-scale.js.map +1 -1
  146. package/es/components/menu/dom/logic/MenuElementStyle.js +3 -0
  147. package/es/components/menu/dom/logic/MenuElementStyle.js.map +1 -1
  148. package/es/components/tooltip/logic/BubbleTooltipElement.js +6 -5
  149. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  150. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +3 -0
  151. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  152. package/es/core/BaseTable.d.ts +2 -0
  153. package/es/core/BaseTable.js +27 -10
  154. package/es/core/BaseTable.js.map +1 -1
  155. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  156. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  157. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  158. package/es/core/style.js +3 -0
  159. package/es/core/style.js.map +1 -1
  160. package/es/dataset/dataset.js +2 -2
  161. package/es/dataset/dataset.js.map +1 -1
  162. package/es/event/event.js +6 -4
  163. package/es/event/event.js.map +1 -1
  164. package/es/event/listener/table-group.js +8 -0
  165. package/es/event/listener/table-group.js.map +1 -1
  166. package/es/event/listener/touch.js +1 -1
  167. package/es/event/listener/touch.js.map +1 -1
  168. package/es/event/scroll.js +1 -1
  169. package/es/event/scroll.js.map +1 -1
  170. package/es/index.d.ts +1 -1
  171. package/es/index.js +1 -1
  172. package/es/index.js.map +1 -1
  173. package/es/layout/chart-helper/get-axis-config.js +16 -16
  174. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  175. package/es/layout/chart-helper/get-axis-domain.js +12 -9
  176. package/es/layout/chart-helper/get-axis-domain.js.map +1 -1
  177. package/es/layout/chart-helper/get-chart-spec.js +2 -2
  178. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  179. package/es/layout/pivot-header-layout.js +2 -2
  180. package/es/layout/pivot-header-layout.js.map +1 -1
  181. package/es/render/layout/text.js +1 -1
  182. package/es/render/layout/text.js.map +1 -1
  183. package/es/scenegraph/component/menu.js +2 -0
  184. package/es/scenegraph/component/menu.js.map +1 -1
  185. package/es/scenegraph/context/canvas.js +1 -3
  186. package/es/scenegraph/context/canvas.js.map +1 -1
  187. package/es/scenegraph/context/context.js +0 -2
  188. package/es/scenegraph/context/context.js.map +1 -1
  189. package/es/scenegraph/context/module.d.ts +1 -1
  190. package/es/scenegraph/context/module.js +1 -3
  191. package/es/scenegraph/context/module.js.map +1 -1
  192. package/es/scenegraph/graphic/chart.d.ts +2 -0
  193. package/es/scenegraph/graphic/chart.js +8 -2
  194. package/es/scenegraph/graphic/chart.js.map +1 -1
  195. package/es/scenegraph/group-creater/cell-helper.js +6 -42
  196. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  197. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -0
  198. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  199. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +5 -0
  200. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +72 -0
  201. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -0
  202. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
  203. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  204. package/es/scenegraph/group-creater/progress/proxy.js +6 -4
  205. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  206. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +1 -1
  207. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  208. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -3
  209. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  210. package/es/scenegraph/refresh-node/update-chart.js +6 -3
  211. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  212. package/es/scenegraph/scenegraph.js +8 -3
  213. package/es/scenegraph/scenegraph.js.map +1 -1
  214. package/es/scenegraph/utils/text-measure.js +4 -4
  215. package/es/scenegraph/utils/text-measure.js.map +1 -1
  216. package/es/themes/ARCO.js +0 -8
  217. package/es/themes/ARCO.js.map +1 -1
  218. package/es/themes/BRIGHT.js +0 -8
  219. package/es/themes/BRIGHT.js.map +1 -1
  220. package/es/themes/DARK.js +0 -8
  221. package/es/themes/DARK.js.map +1 -1
  222. package/es/themes/DEFAULT.js +0 -8
  223. package/es/themes/DEFAULT.js.map +1 -1
  224. package/es/themes/theme.js +7 -3
  225. package/es/themes/theme.js.map +1 -1
  226. package/es/tools/global.d.ts +1 -2
  227. package/es/tools/global.js +1 -3
  228. package/es/tools/global.js.map +1 -1
  229. package/es/ts-types/base-table.d.ts +6 -0
  230. package/es/ts-types/base-table.js.map +1 -1
  231. package/es/ts-types/column/style.d.ts +2 -1
  232. package/es/ts-types/column/style.js.map +1 -1
  233. package/es/ts-types/column/type.d.ts +1 -1
  234. package/es/ts-types/column/type.js.map +1 -1
  235. package/es/ts-types/events.d.ts +4 -0
  236. package/es/ts-types/events.js.map +1 -1
  237. package/es/ts-types/list-table/define/checkbox-define.d.ts +9 -0
  238. package/es/ts-types/list-table/define/checkbox-define.js +2 -0
  239. package/es/ts-types/list-table/define/checkbox-define.js.map +1 -0
  240. package/es/ts-types/list-table/define/index.d.ts +4 -2
  241. package/es/ts-types/list-table/define/index.js.map +1 -1
  242. package/es/ts-types/pivot-table/indicator/checkbox-indicator.d.ts +9 -0
  243. package/es/ts-types/pivot-table/indicator/checkbox-indicator.js +2 -0
  244. package/es/ts-types/pivot-table/indicator/checkbox-indicator.js.map +1 -0
  245. package/es/ts-types/pivot-table/indicator/index.d.ts +2 -1
  246. package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
  247. package/es/ts-types/theme.d.ts +6 -3
  248. package/es/ts-types/theme.js.map +1 -1
  249. package/es/ts-types/tooltip.d.ts +2 -1
  250. package/es/ts-types/tooltip.js.map +1 -1
  251. package/package.json +7 -4
@@ -0,0 +1,5 @@
1
+ import type { IThemeSpec } from '@visactor/vrender';
2
+ import { Group } from '../../graphic/group';
3
+ import type { CheckboxColumnDefine } from '../../../ts-types';
4
+ import type { BaseTableAPI } from '../../../ts-types/base-table';
5
+ export declare function createCheckboxCellGroup(cellGroup: Group | null, columnGroup: Group, xOrigin: number, yOrigin: number, col: number, row: number, colWidth: number | 'auto', width: number, height: number, padding: number[], textAlign: CanvasTextAlign, textBaseline: CanvasTextBaseline, table: BaseTableAPI, cellTheme: IThemeSpec, define: CheckboxColumnDefine): Group;
@@ -0,0 +1,72 @@
1
+ import { Group } from "../../graphic/group";
2
+
3
+ import { isObject } from "@visactor/vutils";
4
+
5
+ import { CheckBox } from "@visactor/vrender-components";
6
+
7
+ import { getHierarchyOffset } from "../../utils/get-hierarchy-offset";
8
+
9
+ import { getOrApply } from "../../../tools/helper";
10
+
11
+ export function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, table, cellTheme, define) {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
13
+ cellGroup || ((cellGroup = new Group({
14
+ x: xOrigin,
15
+ y: yOrigin,
16
+ width: width,
17
+ height: height,
18
+ lineWidth: null !== (_b = null === (_a = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _a ? void 0 : _a.lineWidth) && void 0 !== _b ? _b : void 0,
19
+ fill: null !== (_d = null === (_c = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _c ? void 0 : _c.fill) && void 0 !== _d ? _d : void 0,
20
+ stroke: null !== (_f = null === (_e = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _e ? void 0 : _e.stroke) && void 0 !== _f ? _f : void 0,
21
+ strokeArrayWidth: null !== (_h = null === (_g = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _g ? void 0 : _g.strokeArrayWidth) && void 0 !== _h ? _h : void 0,
22
+ strokeArrayColor: null !== (_k = null === (_j = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _j ? void 0 : _j.strokeArrayColor) && void 0 !== _k ? _k : void 0,
23
+ cursor: null !== (_m = null === (_l = null == cellTheme ? void 0 : cellTheme.group) || void 0 === _l ? void 0 : _l.cursor) && void 0 !== _m ? _m : void 0,
24
+ lineCap: "square",
25
+ clip: !0
26
+ })).role = "cell", cellGroup.col = col, cellGroup.row = row, null == columnGroup || columnGroup.addChild(cellGroup));
27
+ const checkboxComponent = createCheckbox(col, row, colWidth, width, height, padding, cellTheme, define, table);
28
+ return checkboxComponent && cellGroup.appendChild(checkboxComponent), checkboxComponent.render(),
29
+ width -= padding[1] + padding[3], height -= padding[0] + padding[2], "center" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + (width - checkboxComponent.AABBBounds.width()) / 2) : "right" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + width - checkboxComponent.AABBBounds.width()) : checkboxComponent.setAttribute("x", padding[3]),
30
+ "middle" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + height - checkboxComponent.AABBBounds.height()) : checkboxComponent.setAttribute("y", padding[0]),
31
+ cellGroup;
32
+ }
33
+
34
+ function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
35
+ var _a, _b, _c;
36
+ const value = table.getCellValue(col, row), dataValue = table.getCellOriginValue(col, row);
37
+ let isChecked, isDisabled, text = value;
38
+ isObject(value) && (isChecked = value.checked, isDisabled = value.disable, text = value.text);
39
+ const hierarchyOffset = getHierarchyOffset(col, row, table), cellStyle = table._getCellStyle(col, row), autoWrapText = null !== (_a = cellStyle.autoWrapText) && void 0 !== _a ? _a : table.internalProps.autoWrapText, {lineClamp: lineClamp} = cellStyle, {checked: checked, disable: disable} = define, globalChecked = getOrApply(checked, {
40
+ col: col,
41
+ row: row,
42
+ table: table,
43
+ context: null,
44
+ value: value,
45
+ dataValue: dataValue
46
+ }), globalDisable = getOrApply(disable, {
47
+ col: col,
48
+ row: row,
49
+ table: table,
50
+ context: null,
51
+ value: value,
52
+ dataValue: dataValue
53
+ }), autoColWidth = "auto" === colWidth, autoRowHeight = "autoHeight" === table.heightMode, attribute = {
54
+ text: 1 !== text.length || autoWrapText ? text : text[0],
55
+ maxLineWidth: autoColWidth ? 1 / 0 : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
56
+ textBaseline: "top",
57
+ autoWrapText: autoWrapText,
58
+ lineClamp: lineClamp,
59
+ wordBreak: "break-word",
60
+ heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
61
+ pickable: !1,
62
+ dx: hierarchyOffset
63
+ }, testAttribute = cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute, checkbox = new CheckBox({
64
+ x: 0,
65
+ y: 0,
66
+ text: testAttribute,
67
+ checked: null !== (_b = null != isChecked ? isChecked : globalChecked) && void 0 !== _b && _b,
68
+ disabled: null !== (_c = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _c && _c
69
+ });
70
+ return checkbox.name = "checkbox", checkbox;
71
+ }
72
+ //# sourceMappingURL=checkbox-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["scenegraph/group-creater/cell-type/checkbox-cell.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,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AAA,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,aAAa,mCAAI,KAAK;QAC5C,QAAQ,EAAE,MAAA,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,aAAa,mCAAI,KAAK;KAC/C,CAAC,CAAC;IACH,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC","file":"checkbox-cell.js","sourcesContent":["import type { ILine, ISymbol, IThemeSpec } from '@visactor/vrender';\nimport { createLine, createSymbol } from '@visactor/vrender';\nimport { PointScale, LinearScale } from '@visactor/vscale';\nimport { isValid } from '../../../tools/util';\nimport { Group } from '../../graphic/group';\nimport type { CellInfo, CheckboxColumnDefine, CheckboxStyleOption, SparklineSpec } from '../../../ts-types';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { isObject } from '@visactor/vutils';\nimport { CheckBox } from '@visactor/vrender-components';\nimport { getHierarchyOffset } from '../../utils/get-hierarchy-offset';\nimport { getOrApply } from '../../../tools/helper';\n\nexport function createCheckboxCellGroup(\n cellGroup: Group | null,\n columnGroup: Group,\n xOrigin: number,\n yOrigin: number,\n col: number,\n row: number,\n colWidth: number | 'auto',\n width: number,\n height: number,\n padding: number[],\n textAlign: CanvasTextAlign,\n textBaseline: CanvasTextBaseline,\n table: BaseTableAPI,\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine\n) {\n // cell\n if (!cellGroup) {\n cellGroup = new Group({\n x: xOrigin,\n y: yOrigin,\n width,\n height,\n\n // 背景相关,cell背景由cellGroup绘制\n lineWidth: cellTheme?.group?.lineWidth ?? undefined,\n fill: cellTheme?.group?.fill ?? undefined,\n stroke: cellTheme?.group?.stroke ?? undefined,\n\n strokeArrayWidth: (cellTheme?.group as any)?.strokeArrayWidth ?? undefined,\n strokeArrayColor: (cellTheme?.group as any)?.strokeArrayColor ?? undefined,\n cursor: (cellTheme?.group as any)?.cursor ?? undefined,\n\n lineCap: 'square',\n\n clip: true\n } as any);\n cellGroup.role = 'cell';\n cellGroup.col = col;\n cellGroup.row = row;\n columnGroup?.addChild(cellGroup);\n }\n\n // chart\n const checkboxComponent = createCheckbox(col, row, colWidth, width, height, padding, cellTheme, define, table);\n if (checkboxComponent) {\n cellGroup.appendChild(checkboxComponent);\n }\n\n checkboxComponent.render();\n\n width -= padding[1] + padding[3];\n height -= padding[0] + padding[2];\n if (textAlign === 'center') {\n checkboxComponent.setAttribute('x', padding[3] + (width - checkboxComponent.AABBBounds.width()) / 2);\n } else if (textAlign === 'right') {\n checkboxComponent.setAttribute('x', padding[3] + width - checkboxComponent.AABBBounds.width());\n } else {\n checkboxComponent.setAttribute('x', padding[3]);\n }\n\n if (textBaseline === 'middle') {\n checkboxComponent.setAttribute('y', padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2);\n } else if (textBaseline === 'bottom') {\n checkboxComponent.setAttribute('y', padding[0] + height - checkboxComponent.AABBBounds.height());\n } else {\n checkboxComponent.setAttribute('y', padding[0]);\n }\n\n return cellGroup;\n}\n\nfunction createCheckbox(\n col: number,\n row: number,\n colWidth: number | 'auto',\n cellWidth: number,\n cellHeight: number,\n padding: number[],\n cellTheme: IThemeSpec,\n define: CheckboxColumnDefine,\n table: BaseTableAPI\n) {\n const value = table.getCellValue(col, row) as string | { text: string; checked: boolean; disable: boolean };\n const dataValue = table.getCellOriginValue(col, row);\n let isChecked;\n let isDisabled;\n let text = value as string;\n if (isObject(value)) {\n isChecked = value.checked;\n isDisabled = value.disable;\n text = value.text;\n }\n\n const hierarchyOffset = getHierarchyOffset(col, row, table);\n const cellStyle = table._getCellStyle(col, row) as CheckboxStyleOption; // to be fixed\n const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;\n const { lineClamp } = cellStyle;\n const { checked, disable } = define;\n\n const globalChecked = getOrApply(checked as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n const globalDisable = getOrApply(disable as any, {\n col,\n row,\n table,\n context: null,\n value,\n dataValue\n });\n\n const autoColWidth = colWidth === 'auto';\n const autoRowHeight = table.heightMode === 'autoHeight';\n\n const attribute = {\n text: text.length === 1 && !autoWrapText ? text[0] : text, // 单行(no-autoWrapText)为字符串,多行(autoWrapText)为字符串数组\n maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),\n // fill: true,\n // textAlign: 'left',\n textBaseline: 'top',\n autoWrapText,\n lineClamp,\n wordBreak: 'break-word',\n // widthLimit: autoColWidth ? -1 : colWidth - (padding[1] + padding[3]),\n heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),\n pickable: false,\n dx: hierarchyOffset\n };\n const testAttribute = cellTheme.text ? (Object.assign({}, cellTheme.text, attribute) as any) : attribute;\n\n const checkbox = new CheckBox({\n x: 0,\n y: 0,\n text: testAttribute,\n checked: isChecked ?? globalChecked ?? false,\n disabled: isDisabled ?? globalDisable ?? false\n });\n checkbox.name = 'checkbox';\n\n return checkbox;\n}\n"]}
@@ -31,7 +31,7 @@ import { computeRowsHeight } from "../../layout/compute-row-height";
31
31
  import { createColGroup } from "../column";
32
32
 
33
33
  export function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
34
- var _a, _b, _c, _d;
34
+ var _a, _b, _c, _d, _e, _f;
35
35
  return __awaiter(this, void 0, void 0, (function*() {
36
36
  const {table: table} = proxy, {leftBottomCornerGroup: leftBottomCornerGroup, rightTopCornerGroup: rightTopCornerGroup, rightBottomCornerGroup: rightBottomCornerGroup} = table.scenegraph;
37
37
  proxy.setParamsForRow(), proxy.setParamsForColumn(), computeColsWidth(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1)),
@@ -53,9 +53,9 @@ export function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, row
53
53
  createColGroup(rightFrozenGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), table.isPivotChart() ? "rowHeader" : "body", table)),
54
54
  table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart() && createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, "body", table),
55
55
  createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), "body", table),
56
- bodyGroup.firstChild ? (proxy.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : proxy.totalRow,
56
+ bodyGroup.firstChild || colHeaderGroup.firstChild ? (proxy.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : proxy.totalRow,
57
57
  proxy.rowEnd = proxy.currentRow, proxy.rowUpdatePos = proxy.rowEnd, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2),
58
- proxy.currentCol = null !== (_d = null === (_c = bodyGroup.lastChild) || void 0 === _c ? void 0 : _c.col) && void 0 !== _d ? _d : proxy.totalCol,
58
+ proxy.currentCol = null !== (_f = null !== (_d = null === (_c = bodyGroup.lastChild) || void 0 === _c ? void 0 : _c.col) && void 0 !== _d ? _d : null === (_e = colHeaderGroup.lastChild) || void 0 === _e ? void 0 : _e.col) && void 0 !== _f ? _f : proxy.totalCol,
59
59
  proxy.colEnd = proxy.currentCol, proxy.colUpdatePos = proxy.colEnd, proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
60
60
  yield proxy.progress()) : (proxy.currentRow = proxy.totalRow, proxy.rowEnd = proxy.currentRow,
61
61
  proxy.rowUpdatePos = proxy.rowEnd, proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2),
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/create-group-for-first-screen.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,MAAM,UAAgB,yBAAyB,CAC7C,iBAAwB,EACxB,cAAqB,EACrB,cAAqB,EACrB,gBAAuB,EACvB,iBAAwB,EACxB,SAAgB,EAChB,OAAe,EACf,OAAe,EACf,KAAiB;;;QAEjB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;QACxB,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;QAGhG,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAG3B,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;QAGpF,iBAAiB,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;QAErF,IAAI,KAAK,CAAC,mBAAmB,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,mBAAmB,EAAE;YAEnF,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,GAAG,K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AAC,CAAC;SACvF;aAAM;YACL,KAAK,CAAC,UAAU,GAAG,MAAA,MAAC,SAAS,CAAC,UAAoB,0CAAE,SAAS,mCAAI,KAAK,CAAC,QAAQ,CAAC;YAChF,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC;YAChC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;YAClC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAEtF,KAAK,CAAC,UAAU,GAAG,MAAA,MAAC,SAAS,CAAC,SAAmB,0CAAE,GAAG,mCAAI,KAAK,CAAC,QAAQ,CAAC;YACzE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC;YAChC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;YAClC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAGtF,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;SACxB;;CACF","file":"create-group-for-first-screen.js","sourcesContent":["import type { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { createColGroup } from '../column';\nimport type { SceneProxy } from './proxy';\n\nexport async function createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n proxy: SceneProxy\n) {\n const { table } = proxy;\n const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = table.scenegraph;\n\n // compute parameters\n proxy.setParamsForRow();\n proxy.setParamsForColumn();\n\n // compute colums width in first screen\n computeColsWidth(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1));\n\n // compute rows height in first screen\n computeRowsHeight(table, 0, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1));\n\n if (table.rightFrozenColCount > 0 && table.colCount - 1 > proxy.firstScreenColLimit) {\n // compute right frozen row height\n computeColsWidth(table, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1);\n }\n if (table.bottomFrozenRowCount > 0 && table.rowCount - 1 > proxy.firstScreenRowLimit) {\n // compute bottom frozen row height\n computeColsWidth(table, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1);\n }\n\n // update colHeaderGroup rowHeaderGroup bodyGroup position\n table.scenegraph.colHeaderGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rowHeaderGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bottomFrozenGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rightFrozenGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bodyGroup.setAttributes({\n x: table.getFrozenColsWidth(),\n y: table.getFrozenRowsHeight()\n });\n\n // create cornerHeaderGroup\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n table.isListTable() ? 'columnHeader' : 'cornerHeader', // CellType\n table\n );\n\n // create colHeaderGroup\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n\n // create rowHeaderGroup\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', // isHeader\n table\n );\n\n if (table.bottomFrozenRowCount > 0) {\n if (!table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isListTable() ? 'body' : 'rowHeader', // isHeader\n table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.rightFrozenColCount > 0) {\n if (!table.isPivotChart()) {\n // create right top frozen Group\n createColGroup(\n rightTopCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n }\n // create rightFrozenGroup\n createColGroup(\n rightFrozenGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart()) {\n // create right bottom frozen Group\n createColGroup(\n rightBottomCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n\n // create bodyGroup\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n 'body', // isHeader\n table\n );\n\n // update progress information\n if (!bodyGroup.firstChild) {\n // 无数据\n proxy.currentRow = proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n } else {\n proxy.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = (bodyGroup.lastChild as Group)?.col ?? proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n\n // 开始异步任务\n await proxy.progress();\n }\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/progress/create-group-for-first-screen.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC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CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAEtF,KAAK,CAAC,UAAU;gBACd,MAAA,MAAA,MAAC,SAAS,CAAC,SAAmB,0CAAE,GAAG,mCAAI,MAAC,cAAc,CAAC,SAAmB,0CAAE,GAAG,mCAAI,KAAK,CAAC,QAAQ,CAAC;YACpG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC;YAChC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;YAClC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAGtF,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;SACxB;;CACF","file":"create-group-for-first-screen.js","sourcesContent":["import type { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { createColGroup } from '../column';\nimport type { SceneProxy } from './proxy';\n\nexport async function createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n proxy: SceneProxy\n) {\n const { table } = proxy;\n const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = table.scenegraph;\n\n // compute parameters\n proxy.setParamsForRow();\n proxy.setParamsForColumn();\n\n // compute colums width in first screen\n computeColsWidth(table, 0, Math.min(proxy.firstScreenColLimit, table.colCount - 1));\n\n // compute rows height in first screen\n computeRowsHeight(table, 0, Math.min(proxy.firstScreenRowLimit, table.rowCount - 1));\n\n if (table.rightFrozenColCount > 0 && table.colCount - 1 > proxy.firstScreenColLimit) {\n // compute right frozen row height\n computeColsWidth(table, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1);\n }\n if (table.bottomFrozenRowCount > 0 && table.rowCount - 1 > proxy.firstScreenRowLimit) {\n // compute bottom frozen row height\n computeColsWidth(table, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1);\n }\n\n // update colHeaderGroup rowHeaderGroup bodyGroup position\n table.scenegraph.colHeaderGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rowHeaderGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bottomFrozenGroup.setAttribute('x', table.getFrozenColsWidth());\n table.scenegraph.rightFrozenGroup.setAttribute('y', table.getFrozenRowsHeight());\n table.scenegraph.bodyGroup.setAttributes({\n x: table.getFrozenColsWidth(),\n y: table.getFrozenRowsHeight()\n });\n\n // create cornerHeaderGroup\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n table.isListTable() ? 'columnHeader' : 'cornerHeader', // CellType\n table\n );\n\n // create colHeaderGroup\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n\n // create rowHeaderGroup\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', // isHeader\n table\n );\n\n if (table.bottomFrozenRowCount > 0) {\n if (!table.isPivotChart()) {\n // create left bottom frozen\n createColGroup(\n leftBottomCornerGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.frozenColCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isListTable() ? 'body' : 'rowHeader', // isHeader\n table\n );\n }\n // create bottomFrozenGroup\n createColGroup(\n bottomFrozenGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.rightFrozenColCount > 0) {\n if (!table.isPivotChart()) {\n // create right top frozen Group\n createColGroup(\n rightTopCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n 0, // rowStart\n table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n table\n );\n }\n // create rightFrozenGroup\n createColGroup(\n rightFrozenGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n table.isPivotChart() ? 'rowHeader' : 'body', // isHeader\n table\n );\n }\n\n if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0 && !table.isPivotChart()) {\n // create right bottom frozen Group\n createColGroup(\n rightBottomCornerGroup,\n xOrigin,\n yOrigin,\n table.colCount - 1 - table.rightFrozenColCount + 1, // colStart\n table.colCount - 1, // colEnd\n table.rowCount - 1 - table.bottomFrozenRowCount + 1, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table\n );\n }\n\n // create bodyGroup\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.frozenColCount, // colStart\n Math.min(proxy.firstScreenColLimit, table.colCount - 1 - table.rightFrozenColCount), // colEnd\n table.columnHeaderLevelCount, // rowStart\n Math.min(proxy.firstScreenRowLimit, table.rowCount - 1 - table.bottomFrozenRowCount), // rowEnd\n 'body', // isHeader\n table\n );\n\n // update progress information\n if (!bodyGroup.firstChild && !colHeaderGroup.firstChild) {\n // 无数据\n proxy.currentRow = proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol = proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n } else {\n proxy.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? proxy.totalRow;\n proxy.rowEnd = proxy.currentRow;\n proxy.rowUpdatePos = proxy.rowEnd;\n proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);\n\n proxy.currentCol =\n (bodyGroup.lastChild as Group)?.col ?? (colHeaderGroup.lastChild as Group)?.col ?? proxy.totalCol;\n proxy.colEnd = proxy.currentCol;\n proxy.colUpdatePos = proxy.colEnd;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n\n // 开始异步任务\n await proxy.progress();\n }\n}\n"]}
@@ -52,7 +52,7 @@ import { sortHorizontal } from "./update-position/sort-horizontal";
52
52
 
53
53
  export class SceneProxy {
54
54
  constructor(table) {
55
- this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0,
55
+ this.isRelease = !1, this.mode = "column", this.rowLimit = 1e3, this.currentRow = 0,
56
56
  this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0,
57
57
  this.deltaY = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.cellCache = new Map,
58
58
  this.table = table, this.table.isPivotChart() ? (this.rowLimit = 100, this.colLimit = 100) : "autoHeight" === this.table.heightMode ? this.rowLimit = 100 : "autoWidth" === this.table.widthMode && (this.colLimit = 100),
@@ -72,7 +72,7 @@ export class SceneProxy {
72
72
  this.xLimitLeft = totalBodyWidth / 2, this.xLimitRight = totalWidth - totalBodyWidth / 2;
73
73
  const widthLimit = 5 * this.table.tableNoFrameWidth;
74
74
  this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth),
75
- this.firstScreenColLimit = this.bodyLeftCol + Math.ceil(widthLimit / defaultColWidth),
75
+ this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth)),
76
76
  this.colUpdatePos = this.bodyRightCol;
77
77
  }
78
78
  setParamsForRow() {
@@ -85,7 +85,7 @@ export class SceneProxy {
85
85
  this.yLimitTop = totalBodyHeight / 2, this.yLimitBottom = totalHeight - totalBodyHeight / 2;
86
86
  const heightLimit = 5 * this.table.tableNoFrameHeight;
87
87
  this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight),
88
- this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight),
88
+ this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight)),
89
89
  this.rowUpdatePos = this.bodyBottomRow;
90
90
  }
91
91
  createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin) {
@@ -158,7 +158,9 @@ export class SceneProxy {
158
158
  const lastColumnGroup = this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group ? this.table.scenegraph.bottomFrozenGroup.lastChild : this.table.scenegraph.bottomFrozenGroup.lastChild._prev, xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width, yOrigin = lastColumnGroup.attribute.y;
159
159
  createColGroup(this.table.scenegraph.bottomFrozenGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, this.table.rowCount - this.table.bottomFrozenRowCount, this.table.rowCount - 1, "columnHeader", this.table);
160
160
  }
161
- const lastColumnGroup = this.table.scenegraph.bodyGroup.lastChild instanceof Group ? this.table.scenegraph.bodyGroup.lastChild : this.table.scenegraph.bodyGroup.lastChild._prev, xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width, yOrigin = lastColumnGroup.attribute.y;
161
+ let lastColumnGroup = this.table.scenegraph.bodyGroup.lastChild && (this.table.scenegraph.bodyGroup.lastChild instanceof Group ? this.table.scenegraph.bodyGroup.lastChild : this.table.scenegraph.bodyGroup.lastChild._prev);
162
+ lastColumnGroup || (lastColumnGroup = this.table.scenegraph.colHeaderGroup.lastChild && (this.table.scenegraph.colHeaderGroup.lastChild instanceof Group ? this.table.scenegraph.colHeaderGroup.lastChild : this.table.scenegraph.colHeaderGroup.lastChild._prev));
163
+ const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width, yOrigin = lastColumnGroup.attribute.y;
162
164
  createColGroup(this.table.scenegraph.bodyGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, this.rowStart, this.rowEnd, "body", this.table),
163
165
  this.currentCol = endCol, this.colEnd = endCol, this.colUpdatePos = this.colEnd,
164
166
  this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2), this.table.scenegraph.updateContainer(),
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC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,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;YAErE,IAAI,SAAS,CAAC,GAAG,KAAK,GAAG,IAAI,SAAS,CAAC,GAAG,EAAE;gBAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;aACpC;YACD,OAAO,SAAS,CAAC;SAClB;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAErE,IAAI,SAAS,CAAC,GAAG,KAAK,GAAG,IAAI,SAAS,CAAC,GAAG,EAAE;YAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\nimport { createGroupForFirstScreen } from './create-group-for-first-screen';\nimport { dynamicSetX, updateColContent } from './update-position/dynamic-set-x';\nimport { dynamicSetY, updateRowContent } from './update-position/dynamic-set-y';\nimport { updateAutoRow } from './update-position/update-auto-row';\nimport { sortVertical } from './update-position/sort-vertical';\nimport { sortHorizontal } from './update-position/sort-horizontal';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n isRelease: boolean = false;\n mode: 'column' | 'row' | 'pivot' = 'column';\n isProgressing: boolean;\n\n rowLimit = 200;\n currentRow = 0; // 目前渐进生成的row number\n totalRow: number; // 渐进完成最后一行的row number\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n rowStart = 0; // 当前维护的部分第一行的row number\n rowEnd = 0; // 当前维护的部分最后一行的row number\n referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行\n bodyTopRow: number; // table body部分的第一行row number\n bodyBottomRow: number; // table body部分的最后一行row number\n screenRowCount: number; // 预计屏幕范围内显示的row count\n firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number\n taskRowCount: number; // 一次任务生成/更新的row count\n rowUpdatePos: number; // 异步任务目前更新到的行的row number\n rowUpdateDirection: 'up' | 'down'; // 当前行更新的方向\n screenTopRow: number = 0; // 当前屏幕范围内显示的第一行的row number\n deltaY: number = 0;\n\n colLimit = 100;\n // bodyLeftCol: number; // table body部分的第一列col number\n bodyRightCol: number; // table body部分的最后一列col number\n totalCol: number; // 渐进完成最后一列的col number\n colStart: number; // 当前维护的部分第一列的col number\n colEnd: number; // 当前维护的部分最后一列的col number\n taskColCount: number; // 一次任务生成/更新的col count\n xLimitLeft: number; // x > xLimitLeft动态更新,否则直接修改xy\n xLimitRight: number; // x < xLimitRight动态更新,否则直接修改xy\n screenColCount: number; // 预计屏幕范围内显示的col count\n firstScreenColLimit: number; // 首屏同步加载部分最后一列的col number\n colUpdatePos: number; // 异步任务目前更新到的列的col number\n currentCol: number; // 目前渐进生成的col number\n referenceCol: number; // 当前维护的部分中间一列的col number,认为referenceCol对应当前屏幕显示范围的第一列\n screenLeftCol: number = 0; // 当前屏幕范围内显示的第一列的col number\n colUpdateDirection: 'left' | 'right'; // 当前列更新方向\n deltaX: number = 0;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n\n if (this.table.isPivotChart()) {\n this.rowLimit = 100;\n this.colLimit = 100;\n } else if (this.table.heightMode === 'autoHeight') {\n this.rowLimit = 100;\n } else if (this.table.widthMode === 'autoWidth') {\n this.colLimit = 100;\n }\n\n if (this.table.internalProps.transpose) {\n this.mode = 'row';\n } else if (this.table.isPivotTable()) {\n this.mode = 'pivot';\n }\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n get bodyLeftCol(): number {\n return this.table.frozenColCount;\n }\n\n setParamsForColumn() {\n // this.bodyLeftCol = this.table.frozenColCount;\n this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // compute the column info about progress creation\n const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);\n this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col\n this.colStart = this.bodyLeftCol;\n const defaultColWidth = this.table.defaultColWidth;\n this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;\n\n // 确定动态更新限制\n const totalBodyWidth = defaultColWidth * totalActualBodyColCount;\n const totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);\n this.xLimitLeft = totalBodyWidth / 2;\n this.xLimitRight = totalWidth - totalBodyWidth / 2;\n\n // 确定首屏高度范围\n const widthLimit = this.table.tableNoFrameWidth * 5;\n this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);\n this.firstScreenColLimit = this.bodyLeftCol + Math.ceil(widthLimit / defaultColWidth);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.colUpdatePos = this.bodyRightCol;\n }\n\n setParamsForRow() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;\n // this.bodyLeftCol = 0;\n // this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number\n ) {\n await createGroupForFirstScreen(\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n rightFrozenGroup,\n bottomFrozenGroup,\n bodyGroup,\n xOrigin,\n yOrigin,\n this\n );\n }\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n if (this.isProgressing) {\n return;\n }\n this.isProgressing = true;\n return new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n this.isProgressing = false;\n if (this.isRelease) {\n return;\n }\n if (this.colUpdatePos < this.colEnd) {\n await this.updateColCellGroupsAsync();\n await this.progress();\n } else if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n await this.updateRowCellGroupsAsync();\n await this.progress();\n } else if (this.currentCol < this.totalCol) {\n await this.createCol();\n await this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n await this.createRow();\n await this.progress();\n }\n resolve();\n }, 16);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n // console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n async createCol() {\n if (!this.taskColCount) {\n return;\n }\n // console.log('createCol', this.currentCol, this.currentCol + this.taskColCount);\n this.createColGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n // compute rows height\n computeRowsHeight(this.table, this.currentRow + 1, endRow, false);\n\n if (this.table.frozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = 0; col < this.table.frozenColCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);\n }\n }\n\n if (this.table.rightFrozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = this.table.colCount - this.table.rightFrozenColCount; col < this.table.colCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);\n }\n }\n\n // create body row cellGroup\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n const cellLocation = 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n createColGroup(onceCount: number) {\n // compute rows height\n const endCol = Math.min(this.totalCol, this.currentCol + onceCount);\n computeColsWidth(this.table, this.currentCol + 1, endCol);\n\n // update last merge cell\n for (let row = 0; row < this.table.rowCount; row++) {\n const cellGroup = this.highPerformanceGetCell(this.currentCol, row);\n if (isNumber(cellGroup.mergeCol) && cellGroup.mergeCol > this.currentCol) {\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n }\n }\n\n // create column\n if (this.table.columnHeaderLevelCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create colHeaderGroup\n createColGroup(\n this.table.scenegraph.colHeaderGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n if (this.table.bottomFrozenRowCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group\n ? this.table.scenegraph.bottomFrozenGroup.lastChild\n : this.table.scenegraph.bottomFrozenGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bottomFrozenGroup\n createColGroup(\n this.table.scenegraph.bottomFrozenGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.table.rowCount - this.table.bottomFrozenRowCount, // rowStart\n this.table.rowCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bodyGroup.lastChild instanceof Group\n ? this.table.scenegraph.bodyGroup.lastChild\n : this.table.scenegraph.bodyGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bodyGroup\n createColGroup(\n this.table.scenegraph.bodyGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.rowStart, // rowStart\n this.rowEnd, // rowEnd\n 'body', // isHeader\n this.table\n );\n\n this.currentCol = endCol;\n this.colEnd = endCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);\n console.log('async', this.referenceCol, this.colStart, this.colEnd);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async setX(x: number) {\n if (x < this.xLimitLeft && this.colStart === this.bodyLeftCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else if (x > this.xLimitRight && this.colEnd === this.bodyRightCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else {\n // 执行动态更新节点\n this.dynamicSetX(x);\n }\n }\n\n async dynamicSetY(y: number) {\n dynamicSetY(y, this);\n }\n async dynamicSetX(x: number) {\n dynamicSetX(x, this);\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async updateRowCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n // console.log('updateCellGroups', this.rowUpdatePos, distRow);\n if (this.table.heightMode === 'autoHeight') {\n computeRowsHeight(this.table, this.rowUpdatePos, distRow, false);\n }\n\n updateRowContent(this.rowUpdatePos, distRow, this);\n\n if (this.table.heightMode === 'autoHeight') {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n async updateColCellGroupsAsync() {\n this.updateColGroups(this.taskRowCount);\n }\n\n updateColGroups(count: number) {\n const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);\n // console.log('updateCellGroups', this.colUpdatePos, distCol);\n // for (let col = this.colUpdatePos; col <= distCol; col++) {\n // const colGroup = this.table.scenegraph.getColGroup(col);\n // if (colGroup) {\n // // colGroup.forEachChildren((cellGroup: Group) => {\n // // this.updateCellGroupContent(cellGroup);\n // // });\n // // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // // const cellGroup = this.highPerformanceGetCell(colGroup.col, row);\n // // this.updateCellGroupContent(cellGroup);\n // // }\n // let cellGroup = colGroup.firstChild;\n // while (cellGroup) {\n // // this.updateCellGroupContent(cellGroup as Group);\n // // cellGroup = cellGroup._next;\n // const newCellGroup = this.updateCellGroupContent(cellGroup as Group);\n // cellGroup = newCellGroup._next;\n // }\n // colGroup.needUpdate = false;\n // }\n // }\n computeColsWidth(this.table, this.colUpdatePos, distCol);\n updateColContent(this.colUpdatePos, distCol, this);\n this.colUpdatePos = distCol + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return cellGroup;\n }\n\n const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n return newCellGroup || cellGroup;\n }\n\n async sortCellVertical() {\n await sortVertical(this);\n }\n\n async sortCellHorizontal() {\n await sortHorizontal(this);\n }\n\n highPerformanceGetCell(\n col: number,\n row: number,\n // rowStart: number = this.rowStart,\n // rowEnd: number = this.rowEnd,\n getShadow?: boolean\n ) {\n // if (row < rowStart || row > rowEnd) {\n // return emptyGroup;\n // }\n // if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {\n // return emptyGroup;\n // }\n\n if (\n row >= this.table.columnHeaderLevelCount && // not column header\n row < this.table.rowCount - this.table.bottomFrozenRowCount && // not bottom frozen\n (row < this.rowStart || row > this.rowEnd) // not in proxy row range\n ) {\n return emptyGroup;\n }\n\n if (\n col >= this.table.frozenColCount && // not row header\n col < this.table.colCount - this.table.rightFrozenColCount && // not right frozen\n (col < this.colStart || col > this.colEnd) // not in proxy col range\n ) {\n return emptyGroup;\n }\n\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {\n cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n\n release() {\n this.isRelease = true;\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,OAAO,UAAU;IA4CrB,YAAY,KAAmB;QA1C/B,cAAS,GAAY,KAAK,CAAC;QAC3B,SAAI,GAA+B,QAAQ,CAAC;QAG5C,aAAQ,GAAG,IAAI,CAAC;QAChB,eAAU,GAAG,CAAC,CAAC;QAIf,aAAQ,GAA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AC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;aACpC;YACD,OAAO,SAAS,CAAC;SAClB;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAErE,IAAI,SAAS,CAAC,GAAG,KAAK,GAAG,IAAI,SAAS,CAAC,GAAG,EAAE;YAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import { isNumber } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\nimport { createGroupForFirstScreen } from './create-group-for-first-screen';\nimport { dynamicSetX, updateColContent } from './update-position/dynamic-set-x';\nimport { dynamicSetY, updateRowContent } from './update-position/dynamic-set-y';\nimport { updateAutoRow } from './update-position/update-auto-row';\nimport { sortVertical } from './update-position/sort-vertical';\nimport { sortHorizontal } from './update-position/sort-horizontal';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n isRelease: boolean = false;\n mode: 'column' | 'row' | 'pivot' = 'column';\n isProgressing: boolean;\n\n rowLimit = 1000;\n currentRow = 0; // 目前渐进生成的row number\n totalRow: number; // 渐进完成最后一行的row number\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n rowStart = 0; // 当前维护的部分第一行的row number\n rowEnd = 0; // 当前维护的部分最后一行的row number\n referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行\n bodyTopRow: number; // table body部分的第一行row number\n bodyBottomRow: number; // table body部分的最后一行row number\n screenRowCount: number; // 预计屏幕范围内显示的row count\n firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number\n taskRowCount: number; // 一次任务生成/更新的row count\n rowUpdatePos: number; // 异步任务目前更新到的行的row number\n rowUpdateDirection: 'up' | 'down'; // 当前行更新的方向\n screenTopRow: number = 0; // 当前屏幕范围内显示的第一行的row number\n deltaY: number = 0;\n\n colLimit = 100;\n // bodyLeftCol: number; // table body部分的第一列col number\n bodyRightCol: number; // table body部分的最后一列col number\n totalCol: number; // 渐进完成最后一列的col number\n colStart: number; // 当前维护的部分第一列的col number\n colEnd: number; // 当前维护的部分最后一列的col number\n taskColCount: number; // 一次任务生成/更新的col count\n xLimitLeft: number; // x > xLimitLeft动态更新,否则直接修改xy\n xLimitRight: number; // x < xLimitRight动态更新,否则直接修改xy\n screenColCount: number; // 预计屏幕范围内显示的col count\n firstScreenColLimit: number; // 首屏同步加载部分最后一列的col number\n colUpdatePos: number; // 异步任务目前更新到的列的col number\n currentCol: number; // 目前渐进生成的col number\n referenceCol: number; // 当前维护的部分中间一列的col number,认为referenceCol对应当前屏幕显示范围的第一列\n screenLeftCol: number = 0; // 当前屏幕范围内显示的第一列的col number\n colUpdateDirection: 'left' | 'right'; // 当前列更新方向\n deltaX: number = 0;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n\n if (this.table.isPivotChart()) {\n this.rowLimit = 100;\n this.colLimit = 100;\n } else if (this.table.heightMode === 'autoHeight') {\n this.rowLimit = 100;\n } else if (this.table.widthMode === 'autoWidth') {\n this.colLimit = 100;\n }\n\n if (this.table.internalProps.transpose) {\n this.mode = 'row';\n } else if (this.table.isPivotTable()) {\n this.mode = 'pivot';\n }\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n get bodyLeftCol(): number {\n return this.table.frozenColCount;\n }\n\n setParamsForColumn() {\n // this.bodyLeftCol = this.table.frozenColCount;\n this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // compute the column info about progress creation\n const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);\n this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col\n this.colStart = this.bodyLeftCol;\n const defaultColWidth = this.table.defaultColWidth;\n this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;\n\n // 确定动态更新限制\n const totalBodyWidth = defaultColWidth * totalActualBodyColCount;\n const totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);\n this.xLimitLeft = totalBodyWidth / 2;\n this.xLimitRight = totalWidth - totalBodyWidth / 2;\n\n // 确定首屏高度范围\n const widthLimit = this.table.tableNoFrameWidth * 5;\n this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);\n this.firstScreenColLimit = this.bodyLeftCol + Math.min(this.colLimit, Math.ceil(widthLimit / defaultColWidth));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.colUpdatePos = this.bodyRightCol;\n }\n\n setParamsForRow() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;\n // this.bodyLeftCol = 0;\n // this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.min(this.rowLimit, Math.ceil(heightLimit / defaultRowHeight));\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n rightFrozenGroup: Group,\n bottomFrozenGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number\n ) {\n await createGroupForFirstScreen(\n cornerHeaderGroup,\n colHeaderGroup,\n rowHeaderGroup,\n rightFrozenGroup,\n bottomFrozenGroup,\n bodyGroup,\n xOrigin,\n yOrigin,\n this\n );\n }\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n if (this.isProgressing) {\n return;\n }\n this.isProgressing = true;\n return new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n this.isProgressing = false;\n if (this.isRelease) {\n return;\n }\n if (this.colUpdatePos < this.colEnd) {\n await this.updateColCellGroupsAsync();\n await this.progress();\n } else if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n await this.updateRowCellGroupsAsync();\n await this.progress();\n } else if (this.currentCol < this.totalCol) {\n await this.createCol();\n await this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n await this.createRow();\n await this.progress();\n }\n resolve();\n }, 16);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n // console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n async createCol() {\n if (!this.taskColCount) {\n return;\n }\n // console.log('createCol', this.currentCol, this.currentCol + this.taskColCount);\n this.createColGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n // compute rows height\n computeRowsHeight(this.table, this.currentRow + 1, endRow, false);\n\n if (this.table.frozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = 0; col < this.table.frozenColCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);\n }\n }\n\n if (this.table.rightFrozenColCount) {\n // create row header row cellGroup\n let maxHeight = 0;\n for (let col = this.table.colCount - this.table.rightFrozenColCount; col < this.table.colCount; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellLocation = this.table.isListTable() ? 'body' : 'rowHeader';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);\n }\n }\n\n // create body row cellGroup\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n if (!colGroup) {\n continue;\n }\n const cellLocation = 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellLocation\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n createColGroup(onceCount: number) {\n // compute rows height\n const endCol = Math.min(this.totalCol, this.currentCol + onceCount);\n computeColsWidth(this.table, this.currentCol + 1, endCol);\n\n // update last merge cell\n for (let row = 0; row < this.table.rowCount; row++) {\n const cellGroup = this.highPerformanceGetCell(this.currentCol, row);\n if (isNumber(cellGroup.mergeCol) && cellGroup.mergeCol > this.currentCol) {\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n }\n }\n\n // create column\n if (this.table.columnHeaderLevelCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create colHeaderGroup\n createColGroup(\n this.table.scenegraph.colHeaderGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n if (this.table.bottomFrozenRowCount) {\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group\n ? this.table.scenegraph.bottomFrozenGroup.lastChild\n : this.table.scenegraph.bottomFrozenGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bottomFrozenGroup\n createColGroup(\n this.table.scenegraph.bottomFrozenGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.table.rowCount - this.table.bottomFrozenRowCount, // rowStart\n this.table.rowCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n }\n // create colGroup\n let lastColumnGroup =\n this.table.scenegraph.bodyGroup.lastChild &&\n ((this.table.scenegraph.bodyGroup.lastChild instanceof Group\n ? this.table.scenegraph.bodyGroup.lastChild\n : this.table.scenegraph.bodyGroup.lastChild._prev) as Group);\n if (!lastColumnGroup) {\n lastColumnGroup =\n this.table.scenegraph.colHeaderGroup.lastChild &&\n ((this.table.scenegraph.colHeaderGroup.lastChild instanceof Group\n ? this.table.scenegraph.colHeaderGroup.lastChild\n : this.table.scenegraph.colHeaderGroup.lastChild._prev) as Group);\n }\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bodyGroup\n createColGroup(\n this.table.scenegraph.bodyGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.rowStart, // rowStart\n this.rowEnd, // rowEnd\n 'body', // isHeader\n this.table\n );\n\n this.currentCol = endCol;\n this.colEnd = endCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);\n console.log('async', this.referenceCol, this.colStart, this.colEnd);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async setX(x: number) {\n if (x < this.xLimitLeft && this.colStart === this.bodyLeftCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else if (x > this.xLimitRight && this.colEnd === this.bodyRightCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else {\n // 执行动态更新节点\n this.dynamicSetX(x);\n }\n }\n\n async dynamicSetY(y: number) {\n dynamicSetY(y, this);\n }\n async dynamicSetX(x: number) {\n dynamicSetX(x, this);\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async updateRowCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n // console.log('updateCellGroups', this.rowUpdatePos, distRow);\n if (this.table.heightMode === 'autoHeight') {\n computeRowsHeight(this.table, this.rowUpdatePos, distRow, false);\n }\n\n updateRowContent(this.rowUpdatePos, distRow, this);\n\n if (this.table.heightMode === 'autoHeight') {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n async updateColCellGroupsAsync() {\n this.updateColGroups(this.taskRowCount);\n }\n\n updateColGroups(count: number) {\n const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);\n // console.log('updateCellGroups', this.colUpdatePos, distCol);\n // for (let col = this.colUpdatePos; col <= distCol; col++) {\n // const colGroup = this.table.scenegraph.getColGroup(col);\n // if (colGroup) {\n // // colGroup.forEachChildren((cellGroup: Group) => {\n // // this.updateCellGroupContent(cellGroup);\n // // });\n // // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // // const cellGroup = this.highPerformanceGetCell(colGroup.col, row);\n // // this.updateCellGroupContent(cellGroup);\n // // }\n // let cellGroup = colGroup.firstChild;\n // while (cellGroup) {\n // // this.updateCellGroupContent(cellGroup as Group);\n // // cellGroup = cellGroup._next;\n // const newCellGroup = this.updateCellGroupContent(cellGroup as Group);\n // cellGroup = newCellGroup._next;\n // }\n // colGroup.needUpdate = false;\n // }\n // }\n computeColsWidth(this.table, this.colUpdatePos, distCol);\n updateColContent(this.colUpdatePos, distCol, this);\n this.colUpdatePos = distCol + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return cellGroup;\n }\n\n const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n return newCellGroup || cellGroup;\n }\n\n async sortCellVertical() {\n await sortVertical(this);\n }\n\n async sortCellHorizontal() {\n await sortHorizontal(this);\n }\n\n highPerformanceGetCell(\n col: number,\n row: number,\n // rowStart: number = this.rowStart,\n // rowEnd: number = this.rowEnd,\n getShadow?: boolean\n ) {\n // if (row < rowStart || row > rowEnd) {\n // return emptyGroup;\n // }\n // if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {\n // return emptyGroup;\n // }\n\n if (\n row >= this.table.columnHeaderLevelCount && // not column header\n row < this.table.rowCount - this.table.bottomFrozenRowCount && // not bottom frozen\n (row < this.rowStart || row > this.rowEnd) // not in proxy row range\n ) {\n return emptyGroup;\n }\n\n if (\n col >= this.table.frozenColCount && // not row header\n col < this.table.colCount - this.table.rightFrozenColCount && // not right frozen\n (col < this.colStart || col > this.colEnd) // not in proxy col range\n ) {\n return emptyGroup;\n }\n\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {\n cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n // cellGroup.row && this.cellCache.set(col, cellGroup);\n if (cellGroup.col === col && cellGroup.row) {\n this.cellCache.set(col, cellGroup);\n }\n return cellGroup;\n }\n\n release() {\n this.isRelease = true;\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
@@ -55,7 +55,7 @@ function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
55
55
  proxy.colEnd = "left" === direction ? proxy.colEnd + count : proxy.colEnd - count,
56
56
  updateColContent(syncLeftCol, syncRightCol, proxy), checkFirstColMerge(distStartCol, proxy),
57
57
  updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
58
- const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol), deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
58
+ const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol) || proxy.table.scenegraph.getColGroup(screenLeftCol, !0), deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
59
59
  proxy.table.scenegraph.proxy.deltaX += deltaX, proxy.currentCol = "left" === direction ? proxy.currentCol + count : proxy.currentCol - count,
60
60
  proxy.totalCol = "left" === direction ? proxy.totalCol + count : proxy.totalCol - count,
61
61
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2),
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAA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CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;QAC1F,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;QAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/progress/update-position/dynamic-set-x.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEzE,MAAM,UAAgB,WAAW,CAAC,CAAS,EAAE,KAAiB;;QAC5D,MAAM,UAAU,GAAI,KAAK,CAAC,KAAsB,CAAC,cAAc,CAC7D,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAC1D,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC;QACrC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;QACpC,KA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G,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE;QAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;YAC7B,sBAAsB,CACpB,QAAQ,EACR,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,EAElE,KAAK,KAAK,CAAC;gBACT,CAAC,CAAC,aAAa;gBACf,CAAC,CAAE,QAAQ,CAAC,KAAe,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAE,QAAQ,CAAC,KAAe,CAAC,GAAG,CAAC,CACnG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC","file":"dynamic-set-x.js","sourcesContent":["import type { BaseTableAPI } from '../../../../ts-types/base-table';\nimport type { Group } from '../../../graphic/group';\nimport { computeColsWidth } from '../../../layout/compute-col-width';\nimport type { SceneProxy } from '../proxy';\nimport { updateAutoColumn } from './update-auto-column';\nimport { checkFirstColMerge, getFirstChild, getLastChild } from './util';\n\nexport async function dynamicSetX(x: number, proxy: SceneProxy) {\n const screenLeft = (proxy.table as BaseTableAPI).getTargetColAt(\n x + proxy.table.scenegraph.rowHeaderGroup.attribute.width\n );\n if (!screenLeft) {\n return;\n }\n const screenLeftCol = screenLeft.col;\n const screenLeftX = screenLeft.left;\n proxy.screenLeftCol = screenLeftCol;\n const deltaCol = proxy.screenLeftCol - proxy.referenceCol;\n\n if (deltaCol > 0) {\n // 向右滚动,左部column group移到右部\n moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else if (deltaCol < 0) {\n // 向左滚动,右部cell group移到左部\n moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n } else {\n // 不改变row,更新body group范围\n proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);\n }\n\n proxy.table.scenegraph.updateNextFrame();\n}\n\nasync function moveColumn(\n count: number,\n direction: 'left' | 'right',\n screenLeftCol: number,\n screenLeftX: number,\n proxy: SceneProxy\n) {\n // 限制count范围\n if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {\n count = proxy.bodyRightCol - proxy.colEnd;\n } else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {\n count = proxy.colStart - proxy.bodyLeftCol;\n }\n\n if (count <= 0) {\n return;\n }\n\n // 两种更新模式\n // 1. count < colEnd - colStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= colEnd - colStart:整体移动到目标位置\n if (count < proxy.colEnd - proxy.colStart) {\n // 计算更新区域\n const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;\n const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;\n const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n updatePartColPosition(startCol, endCol, direction, proxy);\n\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n direction\n );\n\n const colGroup =\n proxy.table.scenegraph.getColGroup(screenLeftCol) || proxy.table.scenegraph.getColGroup(screenLeftCol, true);\n const deltaX =\n screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);\n proxy.table.scenegraph.proxy.deltaX += deltaX;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = distStartCol;\n proxy.colUpdateDirection = direction;\n\n proxy.table.scenegraph.updateNextFrame();\n\n // 开始异步任务\n // await proxy.progress();\n } else {\n const distStartCol = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;\n const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;\n\n // update column width\n computeColsWidth(proxy.table, distStartCol, distEndCol);\n const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);\n\n // 更新同步范围\n updateAllColPosition(distStartColY, count, direction, proxy);\n const syncLeftCol = distStartCol;\n const syncRightCol = distEndCol;\n\n proxy.colStart = distStartCol;\n proxy.colEnd = distEndCol;\n updateColContent(syncLeftCol, syncRightCol, proxy);\n checkFirstColMerge(distStartCol, proxy);\n\n updateAutoColumn(\n syncLeftCol, // colStart\n syncRightCol, // colEnd\n proxy.table,\n distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left' // 跳转到右侧时,从右向左对齐\n );\n proxy.table.scenegraph.proxy.deltaX = 0;\n\n proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;\n proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;\n proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);\n proxy.colUpdatePos = proxy.colStart;\n proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';\n\n proxy.table.scenegraph.updateNextFrame();\n // await proxy.progress();\n }\n}\n\nfunction updateColGroupPosition(colGroup: Group, newCol: number, x: number) {\n // 更新位置&col\n colGroup.col = newCol;\n colGroup.forEachChildren((cellGroup: Group) => {\n cellGroup.col = newCol;\n cellGroup.needUpdate = true;\n });\n colGroup.setAttribute('x', x);\n colGroup.needUpdate = true;\n}\n\nfunction updateColGroupContent(colGroup: Group, proxy: SceneProxy) {\n if (!colGroup) {\n return;\n }\n // colGroup.forEachChildren((cellGroup: Group) => {\n // proxy.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = proxy.highPerformanceGetCell(colGroup.col, row);\n // proxy.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n const newCellGroup = proxy.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));\n}\n\nfunction updatePartColPosition(startCol: number, endCol: number, direction: 'left' | 'right', proxy: SceneProxy) {\n for (let col = startCol; col <= endCol; col++) {\n if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);\n }\n if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {\n updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);\n }\n }\n}\n\nfunction updateColPosition(containerGroup: Group, direction: 'left' | 'right', proxy: SceneProxy) {\n if (direction === 'left') {\n const colGroup = getFirstChild(containerGroup);\n const lastChild = getLastChild(containerGroup);\n updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));\n containerGroup.appendChild(colGroup);\n if (containerGroup.border) {\n containerGroup.appendChild(containerGroup.border);\n }\n } else {\n const colGroup = getLastChild(containerGroup);\n const firstChild = getFirstChild(containerGroup);\n updateColGroupPosition(\n colGroup,\n firstChild.col - 1,\n firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1)\n );\n containerGroup.insertBefore(colGroup, containerGroup.firstChild);\n }\n}\n\nexport function updateColContent(syncLeftCol: number, syncRightCol: number, proxy: SceneProxy) {\n for (let col = syncLeftCol; col <= syncRightCol; col++) {\n const colGroup = proxy.table.scenegraph.getColGroup(col);\n colGroup && updateColGroupContent(colGroup, proxy);\n\n const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);\n colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);\n\n const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);\n bottomColGroup && updateColGroupContent(bottomColGroup, proxy);\n }\n}\n\nfunction updateAllColPosition(distStartColY: number, count: number, direction: 'left' | 'right', proxy: SceneProxy) {\n proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup: Group, index: number) => {\n if (colGroup.type === 'group') {\n updateColGroupPosition(\n colGroup,\n direction === 'left' ? colGroup.col + count : colGroup.col - count,\n // (bodyGroup.lastChild as Group).attribute.x + (bodyGroup.lastChild as Group).attribute.width\n index === 0 // row === proxy.rowStart\n ? distStartColY\n : (colGroup._prev as Group).attribute.x + proxy.table.getColWidth((colGroup._prev as Group).col)\n );\n }\n });\n}\n"]}
@@ -86,15 +86,15 @@ function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
86
86
  function updatePartRowPosition(startRow, endRow, direction, proxy) {
87
87
  for (let col = 0; col < proxy.table.frozenColCount; col++) {
88
88
  const colGroup = proxy.table.scenegraph.getColGroup(col);
89
- if (colGroup) for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
89
+ for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
90
90
  }
91
91
  for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
92
92
  const colGroup = proxy.table.scenegraph.getColGroup(col);
93
- if (colGroup) for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
93
+ for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
94
94
  }
95
95
  for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
96
96
  const colGroup = proxy.table.scenegraph.getColGroup(col);
97
- if (colGroup) for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
97
+ for (let row = startRow; row <= endRow; row++) updateCellGroupPosition(colGroup, direction, proxy);
98
98
  }
99
99
  }
100
100