@visactor/vtable 1.6.0-alpha.4 → 1.6.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 (341) hide show
  1. package/cjs/ListTable-all.js +5 -5
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/ListTable.d.ts +3 -0
  4. package/cjs/ListTable.js +42 -285
  5. package/cjs/ListTable.js.map +1 -1
  6. package/cjs/PivotChart.d.ts +1 -0
  7. package/cjs/PivotChart.js +4 -0
  8. package/cjs/PivotChart.js.map +1 -1
  9. package/cjs/PivotTable.js +1 -1
  10. package/cjs/PivotTable.js.map +1 -1
  11. package/cjs/components/axis/axis.js +3 -2
  12. package/cjs/components/axis/axis.js.map +1 -1
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
  14. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  15. package/cjs/components/title/title.js +3 -1
  16. package/cjs/components/title/title.js.map +1 -1
  17. package/cjs/core/BaseTable.d.ts +8 -5
  18. package/cjs/core/BaseTable.js +57 -111
  19. package/cjs/core/BaseTable.js.map +1 -1
  20. package/cjs/core/FouseInput.d.ts +1 -0
  21. package/cjs/core/FouseInput.js +5 -2
  22. package/cjs/core/FouseInput.js.map +1 -1
  23. package/cjs/core/group-helper.d.ts +6 -0
  24. package/cjs/core/group-helper.js +22 -0
  25. package/cjs/core/group-helper.js.map +1 -0
  26. package/cjs/core/record-helper.d.ts +8 -0
  27. package/cjs/core/record-helper.js +337 -0
  28. package/cjs/core/record-helper.js.map +1 -0
  29. package/cjs/core/style-helper.d.ts +3 -0
  30. package/cjs/core/style-helper.js +110 -0
  31. package/cjs/core/style-helper.js.map +1 -0
  32. package/cjs/core/style.js +1 -1
  33. package/cjs/core/style.js.map +1 -1
  34. package/cjs/core/tableHelper.d.ts +3 -5
  35. package/cjs/core/tableHelper.js +18 -23
  36. package/cjs/core/tableHelper.js.map +1 -1
  37. package/cjs/core/utils/get-cell-position.d.ts +5 -25
  38. package/cjs/core/utils/get-cell-position.js.map +1 -1
  39. package/cjs/data/CachedDataSource.d.ts +10 -1
  40. package/cjs/data/CachedDataSource.js +102 -3
  41. package/cjs/data/CachedDataSource.js.map +1 -1
  42. package/cjs/dataset/dataset-pivot-table.js +0 -1
  43. package/cjs/dataset/dataset-pivot-table.js.map +1 -1
  44. package/cjs/dataset/dataset.js +0 -1
  45. package/cjs/edit/edit-manager.js +2 -1
  46. package/cjs/event/event.js +5 -2
  47. package/cjs/event/event.js.map +1 -1
  48. package/cjs/event/listener/container-dom.js +2 -2
  49. package/cjs/event/listener/container-dom.js.map +1 -1
  50. package/cjs/event/listener/table-group.js +4 -6
  51. package/cjs/event/listener/table-group.js.map +1 -1
  52. package/cjs/event/util.js +2 -2
  53. package/cjs/event/util.js.map +1 -1
  54. package/cjs/index.d.ts +5 -3
  55. package/cjs/index.js +25 -2
  56. package/cjs/index.js.map +1 -1
  57. package/cjs/layout/cell-range/simple-cell-range.d.ts +4 -0
  58. package/cjs/layout/cell-range/simple-cell-range.js +106 -0
  59. package/cjs/layout/cell-range/simple-cell-range.js.map +1 -0
  60. package/cjs/layout/layout-helper.js +2 -2
  61. package/cjs/layout/layout-helper.js.map +1 -1
  62. package/cjs/layout/pivot-header-layout.js +20 -19
  63. package/cjs/layout/pivot-header-layout.js.map +1 -1
  64. package/cjs/layout/row-height-map.js +1 -0
  65. package/cjs/layout/simple-header-layout.d.ts +1 -2
  66. package/cjs/layout/simple-header-layout.js +6 -90
  67. package/cjs/layout/simple-header-layout.js.map +1 -1
  68. package/cjs/plugins/icons.js +1 -1
  69. package/cjs/plugins/list-tree-stick-cell.d.ts +16 -0
  70. package/cjs/plugins/list-tree-stick-cell.js +178 -0
  71. package/cjs/plugins/list-tree-stick-cell.js.map +1 -0
  72. package/cjs/plugins/themes.js +1 -1
  73. package/cjs/scenegraph/component/custom.js +1 -1
  74. package/cjs/scenegraph/component/custom.js.map +1 -1
  75. package/cjs/scenegraph/component/table-component.js +14 -18
  76. package/cjs/scenegraph/component/table-component.js.map +1 -1
  77. package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
  78. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  79. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  80. package/cjs/scenegraph/graphic/chart.js +34 -20
  81. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  82. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +56 -16
  83. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  84. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  85. package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
  86. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  87. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
  88. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  89. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  90. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +48 -7
  91. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  92. package/cjs/scenegraph/graphic/group.js +1 -1
  93. package/cjs/scenegraph/graphic/group.js.map +1 -1
  94. package/cjs/scenegraph/group-creater/cell-helper.d.ts +2 -1
  95. package/cjs/scenegraph/group-creater/cell-helper.js +29 -10
  96. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  97. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  98. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  99. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  100. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  101. package/cjs/scenegraph/group-creater/column-helper.js +9 -2
  102. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  103. package/cjs/scenegraph/group-creater/init-scenegraph.js +2 -2
  104. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  105. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  106. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  107. package/cjs/scenegraph/layout/compute-row-height.js +2 -2
  108. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  109. package/cjs/scenegraph/layout/update-height.js +3 -1
  110. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  111. package/cjs/scenegraph/layout/update-width.js +5 -3
  112. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  113. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
  114. package/cjs/scenegraph/refresh-node/update-chart.js +84 -32
  115. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  116. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  117. package/cjs/scenegraph/scenegraph.js +67 -46
  118. package/cjs/scenegraph/scenegraph.js.map +1 -1
  119. package/cjs/scenegraph/stick-text/index.js +5 -6
  120. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  121. package/cjs/scenegraph/style/frame-border.d.ts +1 -1
  122. package/cjs/scenegraph/style/frame-border.js +27 -12
  123. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  124. package/cjs/scenegraph/utils/cell-border-stroke-width.js +14 -9
  125. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  126. package/cjs/scenegraph/utils/get-cell-merge.js +1 -1
  127. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  128. package/cjs/scenegraph/utils/get-hierarchy-offset.js +6 -8
  129. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  130. package/cjs/scenegraph/utils/text-icon-layout.js +6 -4
  131. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  132. package/cjs/state/resize/update-resize-row.js +1 -1
  133. package/cjs/state/resize/update-resize-row.js.map +1 -1
  134. package/cjs/state/state.d.ts +2 -2
  135. package/cjs/state/state.js +5 -5
  136. package/cjs/state/state.js.map +1 -1
  137. package/cjs/themes/theme.d.ts +2 -0
  138. package/cjs/themes/theme.js +13 -10
  139. package/cjs/themes/theme.js.map +1 -1
  140. package/cjs/tools/helper.d.ts +1 -1
  141. package/cjs/tools/helper.js +3 -3
  142. package/cjs/tools/helper.js.map +1 -1
  143. package/cjs/tools/style.d.ts +1 -2
  144. package/cjs/tools/style.js +3 -9
  145. package/cjs/tools/style.js.map +1 -1
  146. package/cjs/ts-types/base-table.d.ts +21 -3
  147. package/cjs/ts-types/base-table.js.map +1 -1
  148. package/cjs/ts-types/column/style.d.ts +2 -2
  149. package/cjs/ts-types/column/style.js.map +1 -1
  150. package/cjs/ts-types/component/index.d.ts +1 -0
  151. package/cjs/ts-types/component/index.js +21 -0
  152. package/cjs/ts-types/component/index.js.map +1 -0
  153. package/cjs/ts-types/index.d.ts +1 -0
  154. package/cjs/ts-types/index.js +1 -1
  155. package/cjs/ts-types/index.js.map +1 -1
  156. package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -0
  157. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  158. package/cjs/ts-types/new-data-set.d.ts +1 -0
  159. package/cjs/ts-types/new-data-set.js.map +1 -1
  160. package/cjs/ts-types/pivot-table/corner.d.ts +1 -0
  161. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  162. package/cjs/ts-types/table-engine.d.ts +11 -46
  163. package/cjs/ts-types/table-engine.js.map +1 -1
  164. package/cjs/ts-types/theme.d.ts +2 -3
  165. package/cjs/ts-types/theme.js.map +1 -1
  166. package/cjs/vrender.js +2 -1
  167. package/cjs/vrender.js.map +1 -1
  168. package/dist/vtable.js +36370 -32652
  169. package/dist/vtable.min.js +2 -2
  170. package/es/ListTable-all.js +5 -3
  171. package/es/ListTable-all.js.map +1 -1
  172. package/es/ListTable.d.ts +3 -0
  173. package/es/ListTable.js +45 -287
  174. package/es/ListTable.js.map +1 -1
  175. package/es/PivotChart.d.ts +1 -0
  176. package/es/PivotChart.js +5 -2
  177. package/es/PivotChart.js.map +1 -1
  178. package/es/PivotTable.js +1 -1
  179. package/es/PivotTable.js.map +1 -1
  180. package/es/components/axis/axis.js +3 -1
  181. package/es/components/axis/axis.js.map +1 -1
  182. package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
  183. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  184. package/es/components/title/title.js +3 -1
  185. package/es/components/title/title.js.map +1 -1
  186. package/es/core/BaseTable.d.ts +8 -5
  187. package/es/core/BaseTable.js +61 -115
  188. package/es/core/BaseTable.js.map +1 -1
  189. package/es/core/FouseInput.d.ts +1 -0
  190. package/es/core/FouseInput.js +5 -2
  191. package/es/core/FouseInput.js.map +1 -1
  192. package/es/core/group-helper.d.ts +6 -0
  193. package/es/core/group-helper.js +14 -0
  194. package/es/core/group-helper.js.map +1 -0
  195. package/es/core/record-helper.d.ts +8 -0
  196. package/es/core/record-helper.js +332 -0
  197. package/es/core/record-helper.js.map +1 -0
  198. package/es/core/style-helper.d.ts +3 -0
  199. package/es/core/style-helper.js +86 -0
  200. package/es/core/style-helper.js.map +1 -0
  201. package/es/core/style.js +1 -1
  202. package/es/core/style.js.map +1 -1
  203. package/es/core/tableHelper.d.ts +3 -5
  204. package/es/core/tableHelper.js +15 -22
  205. package/es/core/tableHelper.js.map +1 -1
  206. package/es/core/utils/get-cell-position.d.ts +5 -25
  207. package/es/core/utils/get-cell-position.js.map +1 -1
  208. package/es/data/CachedDataSource.d.ts +10 -1
  209. package/es/data/CachedDataSource.js +103 -0
  210. package/es/data/CachedDataSource.js.map +1 -1
  211. package/es/dataset/dataset-pivot-table.js +0 -1
  212. package/es/dataset/dataset-pivot-table.js.map +1 -1
  213. package/es/dataset/dataset.js +1 -2
  214. package/es/edit/edit-manager.js +2 -1
  215. package/es/event/event.js +5 -2
  216. package/es/event/event.js.map +1 -1
  217. package/es/event/listener/container-dom.js +2 -2
  218. package/es/event/listener/container-dom.js.map +1 -1
  219. package/es/event/listener/table-group.js +4 -6
  220. package/es/event/listener/table-group.js.map +1 -1
  221. package/es/event/util.js +2 -2
  222. package/es/event/util.js.map +1 -1
  223. package/es/index.d.ts +5 -3
  224. package/es/index.js +5 -1
  225. package/es/index.js.map +1 -1
  226. package/es/layout/cell-range/simple-cell-range.d.ts +4 -0
  227. package/es/layout/cell-range/simple-cell-range.js +99 -0
  228. package/es/layout/cell-range/simple-cell-range.js.map +1 -0
  229. package/es/layout/layout-helper.js +2 -2
  230. package/es/layout/layout-helper.js.map +1 -1
  231. package/es/layout/pivot-header-layout.js +20 -19
  232. package/es/layout/pivot-header-layout.js.map +1 -1
  233. package/es/layout/row-height-map.js +2 -1
  234. package/es/layout/simple-header-layout.d.ts +1 -2
  235. package/es/layout/simple-header-layout.js +7 -89
  236. package/es/layout/simple-header-layout.js.map +1 -1
  237. package/es/plugins/icons.js +1 -1
  238. package/es/plugins/list-tree-stick-cell.d.ts +16 -0
  239. package/es/plugins/list-tree-stick-cell.js +176 -0
  240. package/es/plugins/list-tree-stick-cell.js.map +1 -0
  241. package/es/plugins/themes.js +1 -1
  242. package/es/scenegraph/component/custom.js +1 -1
  243. package/es/scenegraph/component/custom.js.map +1 -1
  244. package/es/scenegraph/component/table-component.js +14 -18
  245. package/es/scenegraph/component/table-component.js.map +1 -1
  246. package/es/scenegraph/debug-tool/debug-tool.js +4 -1
  247. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  248. package/es/scenegraph/graphic/chart.d.ts +1 -0
  249. package/es/scenegraph/graphic/chart.js +33 -21
  250. package/es/scenegraph/graphic/chart.js.map +1 -1
  251. package/es/scenegraph/graphic/contributions/chart-render-helper.js +57 -15
  252. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  253. package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  254. package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
  255. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  256. package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -3
  257. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  258. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +1 -0
  259. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +49 -5
  260. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -1
  261. package/es/scenegraph/graphic/group.js +1 -1
  262. package/es/scenegraph/graphic/group.js.map +1 -1
  263. package/es/scenegraph/group-creater/cell-helper.d.ts +2 -1
  264. package/es/scenegraph/group-creater/cell-helper.js +23 -8
  265. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  266. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  267. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  268. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +9 -1
  269. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  270. package/es/scenegraph/group-creater/column-helper.js +8 -2
  271. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  272. package/es/scenegraph/group-creater/init-scenegraph.js +2 -2
  273. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  274. package/es/scenegraph/layout/compute-col-width.js +1 -3
  275. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  276. package/es/scenegraph/layout/compute-row-height.js +2 -2
  277. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  278. package/es/scenegraph/layout/update-height.js +3 -1
  279. package/es/scenegraph/layout/update-height.js.map +1 -1
  280. package/es/scenegraph/layout/update-width.js +5 -3
  281. package/es/scenegraph/layout/update-width.js.map +1 -1
  282. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
  283. package/es/scenegraph/refresh-node/update-chart.js +81 -29
  284. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  285. package/es/scenegraph/scenegraph.d.ts +1 -1
  286. package/es/scenegraph/scenegraph.js +67 -46
  287. package/es/scenegraph/scenegraph.js.map +1 -1
  288. package/es/scenegraph/stick-text/index.js +5 -6
  289. package/es/scenegraph/stick-text/index.js.map +1 -1
  290. package/es/scenegraph/style/frame-border.d.ts +1 -1
  291. package/es/scenegraph/style/frame-border.js +27 -10
  292. package/es/scenegraph/style/frame-border.js.map +1 -1
  293. package/es/scenegraph/utils/cell-border-stroke-width.js +9 -6
  294. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  295. package/es/scenegraph/utils/get-cell-merge.js +1 -1
  296. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  297. package/es/scenegraph/utils/get-hierarchy-offset.js +7 -9
  298. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  299. package/es/scenegraph/utils/text-icon-layout.js +6 -4
  300. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  301. package/es/state/resize/update-resize-row.js +1 -1
  302. package/es/state/resize/update-resize-row.js.map +1 -1
  303. package/es/state/state.d.ts +2 -2
  304. package/es/state/state.js +5 -5
  305. package/es/state/state.js.map +1 -1
  306. package/es/themes/theme.d.ts +2 -0
  307. package/es/themes/theme.js +13 -10
  308. package/es/themes/theme.js.map +1 -1
  309. package/es/tools/helper.d.ts +1 -1
  310. package/es/tools/helper.js +1 -1
  311. package/es/tools/helper.js.map +1 -1
  312. package/es/tools/style.d.ts +1 -2
  313. package/es/tools/style.js +2 -7
  314. package/es/tools/style.js.map +1 -1
  315. package/es/ts-types/base-table.d.ts +21 -3
  316. package/es/ts-types/base-table.js.map +1 -1
  317. package/es/ts-types/column/style.d.ts +2 -2
  318. package/es/ts-types/column/style.js.map +1 -1
  319. package/es/ts-types/component/index.d.ts +1 -0
  320. package/es/ts-types/component/index.js +2 -0
  321. package/es/ts-types/component/index.js.map +1 -0
  322. package/es/ts-types/index.d.ts +1 -0
  323. package/es/ts-types/index.js +2 -0
  324. package/es/ts-types/index.js.map +1 -1
  325. package/es/ts-types/list-table/layout-map/api.d.ts +1 -0
  326. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  327. package/es/ts-types/new-data-set.d.ts +1 -0
  328. package/es/ts-types/new-data-set.js.map +1 -1
  329. package/es/ts-types/pivot-table/corner.d.ts +1 -0
  330. package/es/ts-types/pivot-table/corner.js.map +1 -1
  331. package/es/ts-types/table-engine.d.ts +11 -46
  332. package/es/ts-types/table-engine.js.map +1 -1
  333. package/es/ts-types/theme.d.ts +2 -3
  334. package/es/ts-types/theme.js.map +1 -1
  335. package/es/vrender.js +3 -2
  336. package/es/vrender.js.map +1 -1
  337. package/package.json +8 -8
  338. package/cjs/scenegraph/component/menu.d.ts +0 -41
  339. package/cjs/scenegraph/utils/text-measure.d.ts +0 -33
  340. package/es/scenegraph/component/menu.d.ts +0 -41
  341. package/es/scenegraph/utils/text-measure.d.ts +0 -33
@@ -1,7 +1,5 @@
1
1
  import * as columnStyleContents from "../body-helper/style";
2
2
 
3
- import * as headerStyleContents from "../header-helper/style";
4
-
5
3
  import { importStyle } from "./style";
6
4
 
7
5
  import * as style from "../tools/style";
@@ -36,7 +34,7 @@ import { BodyHelper } from "../body-helper/body-helper";
36
34
 
37
35
  import { HeaderHelper } from "../header-helper/header-helper";
38
36
 
39
- import { AABBBounds, isNumber, isBoolean, isFunction, isValid, cloneDeep } from "@visactor/vutils";
37
+ import { AABBBounds, isNumber, isBoolean, isValid, cloneDeep } from "@visactor/vutils";
40
38
 
41
39
  import { measureTextBounds, textMeasure } from "../scenegraph/utils/text-measure";
42
40
 
@@ -52,13 +50,11 @@ import { defaultPixelRatio } from "../tools/pixel-ratio";
52
50
 
53
51
  import { setBatchRenderChartCount } from "../scenegraph/graphic/contributions/chart-render-helper";
54
52
 
55
- import { isLeftOrRightAxis, isTopOrBottomAxis } from "../layout/chart-helper/get-axis-config";
56
-
57
53
  import { NumberRangeMap } from "../layout/row-height-map";
58
54
 
59
55
  import { RowSeriesNumberHelper } from "./row-series-number-helper";
60
56
 
61
- import { CustomCellStylePlugin, mergeStyle } from "../plugins/custom-cell-style";
57
+ import { CustomCellStylePlugin } from "../plugins/custom-cell-style";
62
58
 
63
59
  import { hideCellSelectBorder, restoreCellSelectBorder } from "../scenegraph/select/update-select-border";
64
60
 
@@ -70,21 +66,21 @@ import { Factory } from "./factory";
70
66
 
71
67
  import { getCellAt, getCellAtRelativePosition, getColAt, getRowAt, getTargetColAt, getTargetColAtConsiderRightFrozen, getTargetRowAt, getTargetRowAtConsiderBottomFrozen } from "./utils/get-cell-position";
72
68
 
69
+ import { getCellStyle } from "./style-helper";
70
+
73
71
  const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
74
72
 
75
73
  importStyle();
76
74
 
77
- const EMPTY_STYLE = {};
78
-
79
75
  export class BaseTable extends EventTarget {
80
76
  static get EVENT_TYPE() {
81
77
  return TABLE_EVENT_TYPE;
82
78
  }
83
79
  constructor(container, options = {}) {
84
80
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
85
- if (super(), this.showFrozenIcon = !0, this.version = "1.6.0-alpha.4", this.id = `VTable${Date.now()}`,
81
+ if (super(), this.showFrozenIcon = !0, this.version = "1.6.0", this.id = `VTable${Date.now()}`,
86
82
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
87
- !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
83
+ !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
88
84
  const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
89
85
  this.container = container, this.options = options, this._widthMode = widthMode,
90
86
  this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
@@ -97,12 +93,14 @@ export class BaseTable extends EventTarget {
97
93
  }, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding,
98
94
  this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top),
99
95
  padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left),
100
- padding.right && (this.padding.right = padding.right))), isValid(canvasHeight) && isValid(canvasWidth) && (this.canvasSizeSeted = !0),
101
- this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth,
102
- this.canvasHeight = canvasHeight, this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
96
+ padding.right && (this.padding.right = padding.right))), this.tableNoFrameWidth = 0,
97
+ this.tableNoFrameHeight = 0, this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight,
98
+ this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
103
99
  const internalProps = this.internalProps = {};
104
100
  if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
105
- "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
101
+ this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
102
+ internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element),
103
+ internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
106
104
  internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
107
105
  internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
108
106
  (null === (_b = options.customConfig) || void 0 === _b ? void 0 : _b.createReactContainer) && (internalProps.bodyDomContainer = document.createElement("div"),
@@ -160,7 +158,7 @@ export class BaseTable extends EventTarget {
160
158
  confine: !0
161
159
  }, options.tooltip), "html" === internalProps.tooltip.renderMode) {
162
160
  const TooltipHandler = Factory.getComponent("tooltipHandler");
163
- internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine);
161
+ TooltipHandler && (internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine));
164
162
  }
165
163
  if (internalProps.menu = Object.assign({
166
164
  renderMode: "html"
@@ -170,8 +168,8 @@ export class BaseTable extends EventTarget {
170
168
  const MenuHandler = Factory.getComponent("menuHandler");
171
169
  internalProps.menuHandler = new MenuHandler(this);
172
170
  }
173
- this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyBottomStyleCache = new Map,
174
- internalProps.stick = {
171
+ this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyMergeTitleCache = new Map,
172
+ this.bodyBottomStyleCache = new Map, internalProps.stick = {
175
173
  changedCells: new Map
176
174
  }, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []);
177
175
  }
@@ -184,9 +182,6 @@ export class BaseTable extends EventTarget {
184
182
  get canvas() {
185
183
  return this.internalProps.canvas;
186
184
  }
187
- setCanvasSize(canvasWidth, canvasHeight) {
188
- this.canvasWidth = canvasWidth, this.canvasHeight = canvasHeight, this.resize();
189
- }
190
185
  resize() {
191
186
  var _a;
192
187
  this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
@@ -387,13 +382,14 @@ export class BaseTable extends EventTarget {
387
382
  }
388
383
  }
389
384
  _updateSize() {
390
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
385
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
391
386
  const {padding: padding} = this;
392
387
  let widthP = 0, heightP = 0;
393
- if ("browser" === Env.mode) {
388
+ if (this.tableX = 0, this.tableY = 0, this.options.canvas && this.options.viewBox) widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
389
+ heightP = this.options.viewBox.y2 - this.options.viewBox.y1, (null === (_a = null == this ? void 0 : this.scenegraph) || void 0 === _a ? void 0 : _a.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP)); else if ("browser" === Env.mode) {
394
390
  const element = this.getElement();
395
391
  let widthWithoutPadding = 0, heightWithoutPadding = 0;
396
- if (this.canvasSizeSeted) widthWithoutPadding = this.canvasWidth, heightWithoutPadding = this.canvasHeight; else if (element.parentElement) {
392
+ if (element.parentElement) {
397
393
  const computedStyle = element.parentElement.style || window.getComputedStyle(element.parentElement);
398
394
  widthWithoutPadding = element.parentElement.offsetWidth - parseInt(computedStyle.paddingLeft || "0px", 10) - parseInt(computedStyle.paddingRight || "0px", 10),
399
395
  heightWithoutPadding = element.parentElement.offsetHeight - parseInt(computedStyle.paddingTop || "0px", 10) - parseInt(computedStyle.paddingBottom || "0px", 20);
@@ -402,25 +398,33 @@ export class BaseTable extends EventTarget {
402
398
  element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
403
399
  element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
404
400
  const {canvas: canvas} = this.internalProps;
405
- widthP = null !== (_b = null === (_a = canvas.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 0,
406
- heightP = null !== (_d = null === (_c = canvas.parentElement) || void 0 === _c ? void 0 : _c.offsetHeight) && void 0 !== _d ? _d : 0,
407
- (null === (_e = null == this ? void 0 : this.scenegraph) || void 0 === _e ? void 0 : _e.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
401
+ widthP = null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 0,
402
+ heightP = null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 0,
403
+ (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
408
404
  canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
409
405
  canvas.style.height = `${heightP}px`), this.internalProps.bodyDomContainer && (this.internalProps.bodyDomContainer.style.width = `${widthP}px`,
410
406
  this.internalProps.bodyDomContainer.style.height = `${heightP}px`), this.internalProps.headerDomContainer && (this.internalProps.headerDomContainer.style.width = `${widthP}px`,
411
407
  this.internalProps.headerDomContainer.style.height = `${heightP}px`);
412
408
  } else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
413
- const width = Math.floor(widthP - style.getVerticalScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getHorizontalScrollBarSize(this.getTheme().scrollStyle));
414
- if (null === (_f = this.internalProps.theme) || void 0 === _f ? void 0 : _f.frameStyle) {
415
- const lineWidths = toBoxArray(null !== (_h = null === (_g = this.internalProps.theme.frameStyle) || void 0 === _g ? void 0 : _g.borderLineWidth) && void 0 !== _h ? _h : [ null ]), shadowWidths = toBoxArray(null !== (_k = null === (_j = this.internalProps.theme.frameStyle) || void 0 === _j ? void 0 : _j.shadowBlur) && void 0 !== _k ? _k : [ 0 ]);
416
- (null === (_l = this.theme.frameStyle) || void 0 === _l ? void 0 : _l.innerBorder) ? (this.tableX = 0,
417
- this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_m = shadowWidths[1]) && void 0 !== _m ? _m : 0),
418
- this.tableNoFrameHeight = height - (null !== (_o = shadowWidths[2]) && void 0 !== _o ? _o : 0)) : (this.tableX = (null !== (_p = lineWidths[3]) && void 0 !== _p ? _p : 0) + (null !== (_q = shadowWidths[3]) && void 0 !== _q ? _q : 0),
419
- this.tableY = (null !== (_r = lineWidths[0]) && void 0 !== _r ? _r : 0) + (null !== (_s = shadowWidths[0]) && void 0 !== _s ? _s : 0),
420
- this.tableNoFrameWidth = width - ((null !== (_t = lineWidths[1]) && void 0 !== _t ? _t : 0) + (null !== (_u = shadowWidths[1]) && void 0 !== _u ? _u : 0)) - ((null !== (_v = lineWidths[3]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[3]) && void 0 !== _w ? _w : 0)),
421
- this.tableNoFrameHeight = height - ((null !== (_x = lineWidths[0]) && void 0 !== _x ? _x : 0) + (null !== (_y = shadowWidths[0]) && void 0 !== _y ? _y : 0)) - ((null !== (_z = lineWidths[2]) && void 0 !== _z ? _z : 0) + (null !== (_0 = shadowWidths[2]) && void 0 !== _0 ? _0 : 0)));
409
+ const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
410
+ if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
411
+ const lineWidths = toBoxArray(null !== (_j = null === (_h = this.internalProps.theme.frameStyle) || void 0 === _h ? void 0 : _h.borderLineWidth) && void 0 !== _j ? _j : [ null ]), shadowWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.shadowBlur) && void 0 !== _l ? _l : [ 0 ]);
412
+ (null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0,
413
+ this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_o = shadowWidths[1]) && void 0 !== _o ? _o : 0),
414
+ this.tableNoFrameHeight = height - (null !== (_p = shadowWidths[2]) && void 0 !== _p ? _p : 0)) : (this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
415
+ this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
416
+ this.tableNoFrameWidth = width - ((null !== (_u = lineWidths[1]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[1]) && void 0 !== _v ? _v : 0)) - ((null !== (_w = lineWidths[3]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[3]) && void 0 !== _x ? _x : 0)),
417
+ this.tableNoFrameHeight = height - ((null !== (_y = lineWidths[0]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[0]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[2]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0)));
422
418
  }
423
419
  }
420
+ updateViewBox(newViewBox) {
421
+ var _a, _b, _c, _d, _e, _f, _g, _h;
422
+ const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0, oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0, newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
423
+ this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
424
+ }
425
+ setViewBoxTransform(a, b, c, d, e, f) {
426
+ this.internalProps.modifiedViewBoxTransform = !0, this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
427
+ }
424
428
  get rowHierarchyType() {
425
429
  return "grid";
426
430
  }
@@ -688,8 +692,11 @@ export class BaseTable extends EventTarget {
688
692
  }));
689
693
  }
690
694
  _toRelativeRect(absoluteRect, relativeX = !0, relativeY = !0) {
695
+ var _a, _b, _c, _d;
691
696
  const rect = absoluteRect.copy(), visibleRect = this.getVisibleRect();
692
697
  return rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0)), rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0)),
698
+ rect.offsetLeft(null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
699
+ rect.offsetTop(null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
693
700
  rect;
694
701
  }
695
702
  getVisibleRect() {
@@ -794,9 +801,11 @@ export class BaseTable extends EventTarget {
794
801
  internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
795
802
  var _a;
796
803
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
797
- })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
804
+ })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
805
+ internalProps.focusControl.release();
798
806
  const {parentElement: parentElement} = internalProps.element;
799
- parentElement && parentElement.removeChild(internalProps.element), null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
807
+ parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
808
+ null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
800
809
  this.isReleased = !0, this.scenegraph = null, this.internalProps = null;
801
810
  }
802
811
  fireListeners(type, event) {
@@ -818,7 +827,7 @@ export class BaseTable extends EventTarget {
818
827
  this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight,
819
828
  this.customRender = customRender;
820
829
  const internalProps = this.internalProps;
821
- if ("node" !== Env.mode && updateRootElementPadding(internalProps.element, this.padding),
830
+ if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding),
822
831
  this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal",
823
832
  internalProps.frozenColCount = frozenColCount, internalProps.defaultRowHeight = defaultRowHeight,
824
833
  internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
@@ -914,6 +923,7 @@ export class BaseTable extends EventTarget {
914
923
  return new Rect(this.tableX, this.tableY, width, height);
915
924
  }
916
925
  _getMouseAbstractPoint(evt, isAddScroll = !0) {
926
+ var _a, _b, _c, _d;
917
927
  let e;
918
928
  if (!evt) return {
919
929
  inTable: !1,
@@ -924,12 +934,15 @@ export class BaseTable extends EventTarget {
924
934
  const clientX = e.clientX || e.pageX + window.scrollX, clientY = e.clientY || e.pageY + window.scrollY, rect = this.internalProps.canvas.getBoundingClientRect();
925
935
  let inTable = !0;
926
936
  rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
927
- const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight);
928
- return {
929
- x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0),
930
- y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0),
937
+ const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight), point = {
938
+ x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0) - (null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
939
+ y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0) - (null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
931
940
  inTable: inTable
932
941
  };
942
+ if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
943
+ this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point);
944
+ }
945
+ return point;
933
946
  }
934
947
  getTheme() {
935
948
  return this.internalProps.theme;
@@ -1027,7 +1040,8 @@ export class BaseTable extends EventTarget {
1027
1040
  return null == body ? void 0 : body.define;
1028
1041
  }
1029
1042
  getBodyColumnType(col, row) {
1030
- const cellType = this.internalProps.layoutMap.getBody(col, row).cellType;
1043
+ var _a, _b;
1044
+ const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
1031
1045
  return getProp("cellType", {
1032
1046
  cellType: cellType
1033
1047
  }, col, row, this);
@@ -1213,80 +1227,11 @@ export class BaseTable extends EventTarget {
1213
1227
  return null === (_a = this.internalProps.dataSource) || void 0 === _a ? void 0 : _a.hasField(index, field);
1214
1228
  }
1215
1229
  _getCellStyle(col, row) {
1216
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1217
- const customCellStyle = this.customCellStylePlugin.getCustomCellStyle(col, row), {layoutMap: layoutMap} = this.internalProps;
1218
- if (layoutMap.isHeader(col, row)) {
1219
- let cacheKey;
1220
- if (!this.isPivotTable() || this.isBottomFrozenRow(row) || this.isRightFrozenColumn(col)) cacheKey = `${col}-${row}`; else {
1221
- const define = this.getHeaderDefine(col, row), isCorner = this.isCornerHeader(col, row);
1222
- cacheKey = (null == define ? void 0 : define.dimensionKey) ? isCorner ? `dim-cor-${define.dimensionKey}` : `dim-${define.dimensionKey}` : (null == define ? void 0 : define.indicatorKey) ? `ind-${define.indicatorKey}` : `${col}-${row}`;
1223
- }
1224
- let cacheStyle = this.headerStyleCache.get(cacheKey);
1225
- if (cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
1226
- const hd = layoutMap.getHeader(col, row);
1227
- let paddingForAxis;
1228
- if (this.isPivotChart() && isTopOrBottomAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
1229
- paddingForAxis = null !== (_b = null === (_a = layoutMap.getBody(col, this.rowHeaderLevelCount).style) || void 0 === _a ? void 0 : _a.padding) && void 0 !== _b ? _b : this.theme.bodyStyle.padding;
1230
- } else if (this.isPivotChart() && isLeftOrRightAxis(col, row, layoutMap) && layoutMap.isAxisCell(col, row)) {
1231
- paddingForAxis = null !== (_d = null === (_c = layoutMap.getBody(this.columnHeaderLevelCount, row).style) || void 0 === _c ? void 0 : _c.padding) && void 0 !== _d ? _d : this.theme.bodyStyle.padding;
1232
- }
1233
- if ((!hd || hd.isEmpty) && (layoutMap.isLeftBottomCorner(col, row) || layoutMap.isRightBottomCorner(col, row) || layoutMap.isCornerHeader(col, row) || layoutMap.isRightTopCorner(col, row))) return EMPTY_STYLE;
1234
- const styleClass = this.internalProps.headerHelper.getStyleClass((null == hd ? void 0 : hd.headerType) || "text");
1235
- if (layoutMap.isBottomFrozenRow(col, row) && this.theme.bottomFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
1236
- padding: paddingForAxis
1237
- } : {}, this.theme.bottomFrozenStyle, {
1238
- col: col,
1239
- row: row,
1240
- table: this,
1241
- value: this.getCellValue(col, row),
1242
- dataValue: this.getCellOriginValue(col, row),
1243
- cellHeaderPaths: this.getCellHeaderPaths(col, row)
1244
- }, styleClass, this.options.autoWrapText, this.theme); else if (layoutMap.isRightFrozenColumn(col, row) && this.theme.rightFrozenStyle) cacheStyle = headerStyleContents.of(paddingForAxis ? {
1245
- padding: paddingForAxis
1246
- } : {}, this.theme.rightFrozenStyle, {
1247
- col: col,
1248
- row: row,
1249
- table: this,
1250
- value: this.getCellValue(col, row),
1251
- dataValue: this.getCellOriginValue(col, row),
1252
- cellHeaderPaths: this.getCellHeaderPaths(col, row)
1253
- }, styleClass, this.options.autoWrapText, this.theme); else {
1254
- const style = (null == hd ? void 0 : hd.style) || {};
1255
- paddingForAxis && (style.padding = paddingForAxis), cacheStyle = headerStyleContents.of(style, layoutMap.isColumnHeader(col, row) || layoutMap.isBottomFrozenRow(col, row) ? this.theme.headerStyle : layoutMap.isRowHeader(col, row) || layoutMap.isRightFrozenColumn(col, row) ? this.theme.rowHeaderStyle : this.theme.cornerHeaderStyle, {
1256
- col: col,
1257
- row: row,
1258
- table: this,
1259
- value: this.getCellValue(col, row),
1260
- dataValue: this.getCellOriginValue(col, row),
1261
- cellHeaderPaths: this.getCellHeaderPaths(col, row)
1262
- }, styleClass, this.options.autoWrapText, this.theme);
1263
- }
1264
- return this.headerStyleCache.set(cacheKey, cacheStyle), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
1265
- }
1266
- let bgColorFunc, cacheKey;
1267
- (null === (_f = null === (_e = this.internalProps) || void 0 === _e ? void 0 : _e.dataConfig) || void 0 === _f ? void 0 : _f.mappingRules) && !this.isHeader(col, row) && (null === (_j = null === (_h = null === (_g = this.internalProps) || void 0 === _g ? void 0 : _g.dataConfig) || void 0 === _h ? void 0 : _h.mappingRules) || void 0 === _j || _j.forEach(((mappingRule, i) => {
1268
- mappingRule.bgColor && this.internalProps.layoutMap.getIndicatorKey(col, row) === mappingRule.bgColor.indicatorKey && (bgColorFunc = mappingRule.bgColor.mapping);
1269
- })));
1270
- const cellType = this.getCellType(col, row);
1271
- let cacheStyle;
1272
- if (cacheKey = this.isSeriesNumberInBody(col, row) ? `${col}-series-` + cellType : this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col + cellType : row + cellType,
1273
- cacheStyle = layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.get(cacheKey) : this.bodyStyleCache.get(cacheKey),
1274
- cacheStyle) return customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
1275
- const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row)), style = null == column ? void 0 : column.style;
1276
- return cacheStyle = columnStyleContents.of(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle ? this.theme.bottomFrozenStyle : layoutMap.isRightFrozenColumn(col) && this.theme.rightFrozenStyle ? this.theme.rightFrozenStyle : this.theme.bodyStyle, {
1277
- col: col,
1278
- row: row,
1279
- table: this,
1280
- value: this.getCellValue(col, row),
1281
- dataValue: this.getCellOriginValue(col, row),
1282
- cellHeaderPaths: this.getCellHeaderPaths(col, row)
1283
- }, styleClass, this.options.autoWrapText, this.theme), bgColorFunc && (cacheStyle = mergeStyle(cacheStyle, {
1284
- bgColor: bgColorFunc
1285
- })), isFunction(style) || (layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.set(cacheKey, cacheStyle) : this.bodyStyleCache.set(cacheKey, cacheStyle)),
1286
- customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
1230
+ return getCellStyle(col, row, this);
1287
1231
  }
1288
1232
  clearCellStyleCache() {
1289
- this.headerStyleCache.clear(), this.bodyStyleCache.clear(), this.bodyBottomStyleCache.clear();
1233
+ this.headerStyleCache.clear(), this.bodyStyleCache.clear(), this.bodyMergeTitleCache.clear(),
1234
+ this.bodyBottomStyleCache.clear();
1290
1235
  }
1291
1236
  clearRowHeightCache() {
1292
1237
  this.internalProps._rowHeightsMap.clear(), this._clearRowRangeHeightsMap();
@@ -1790,5 +1735,6 @@ export class BaseTable extends EventTarget {
1790
1735
  enableScroll() {
1791
1736
  this.eventManager.enableScroll();
1792
1737
  }
1738
+ getGroupTitleLevel(col, row) {}
1793
1739
  }
1794
1740
  //# sourceMappingURL=BaseTable.js.map