@visactor/vtable 1.26.5 → 1.26.7

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 (327) 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 +5 -2
  4. package/cjs/ListTable.js +22 -6
  5. package/cjs/ListTable.js.map +1 -1
  6. package/cjs/PivotChart.js +5 -4
  7. package/cjs/PivotChart.js.map +1 -1
  8. package/cjs/PivotTable-all.js +4 -3
  9. package/cjs/PivotTable-all.js.map +1 -1
  10. package/cjs/body-helper/body-helper.d.ts +2 -1
  11. package/cjs/body-helper/body-helper.js +5 -3
  12. package/cjs/body-helper/body-helper.js.map +1 -1
  13. package/cjs/components/index.js +2 -1
  14. package/cjs/components/tooltip/TooltipHandler.d.ts +4 -0
  15. package/cjs/components/tooltip/TooltipHandler.js +32 -7
  16. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  17. package/cjs/core/BaseTable.d.ts +1 -0
  18. package/cjs/core/BaseTable.js +26 -13
  19. package/cjs/core/BaseTable.js.map +1 -1
  20. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  21. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  22. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  23. package/cjs/core/row-series-number-helper.d.ts +1 -0
  24. package/cjs/core/row-series-number-helper.js +3 -1
  25. package/cjs/core/row-series-number-helper.js.map +1 -1
  26. package/cjs/core/tableHelper.js +1 -2
  27. package/cjs/data/CachedDataSource.js +5 -3
  28. package/cjs/data/CachedDataSource.js.map +1 -1
  29. package/cjs/data/DataSource.js +2 -1
  30. package/cjs/event/event.js +1 -1
  31. package/cjs/event/helper.js +1 -1
  32. package/cjs/event/media-click.js +145 -13
  33. package/cjs/event/media-click.js.map +1 -1
  34. package/cjs/event/scroll.js +1 -1
  35. package/cjs/event/sparkline-event.js +1 -1
  36. package/cjs/event/util.js +1 -1
  37. package/cjs/header-helper/header-helper.d.ts +1 -0
  38. package/cjs/header-helper/header-helper.js +4 -1
  39. package/cjs/header-helper/header-helper.js.map +1 -1
  40. package/cjs/index.d.ts +3 -3
  41. package/cjs/index.js +1 -1
  42. package/cjs/index.js.map +1 -1
  43. package/cjs/layout/index.js +2 -1
  44. package/cjs/plugins/custom-cell-style.js +1 -1
  45. package/cjs/plugins/index.js +1 -2
  46. package/cjs/plugins/interface.d.ts +2 -1
  47. package/cjs/plugins/interface.js +1 -1
  48. package/cjs/plugins/interface.js.map +1 -1
  49. package/cjs/plugins/invert-highlight.js +1 -1
  50. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  51. package/cjs/plugins/plugin-manager.d.ts +1 -1
  52. package/cjs/plugins/plugin-manager.js +12 -7
  53. package/cjs/plugins/plugin-manager.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-helper.d.ts +4 -2
  55. package/cjs/scenegraph/group-creater/cell-helper.js +67 -42
  56. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/cell-type/audio-cell.d.ts +7 -0
  58. package/cjs/scenegraph/group-creater/cell-type/audio-cell.js +83 -0
  59. package/cjs/scenegraph/group-creater/cell-type/audio-cell.js.map +1 -0
  60. package/cjs/scenegraph/group-creater/cell-type/button-cell.d.ts +1 -1
  61. package/cjs/scenegraph/group-creater/cell-type/button-cell.js +5 -4
  62. package/cjs/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  63. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
  64. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  66. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +5 -4
  67. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  68. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  69. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +43 -15
  70. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  71. package/cjs/scenegraph/group-creater/cell-type/index.d.ts +1 -0
  72. package/cjs/scenegraph/group-creater/cell-type/index.js +8 -2
  73. package/cjs/scenegraph/group-creater/cell-type/index.js.map +1 -1
  74. package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.d.ts +13 -0
  75. package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.js +64 -0
  76. package/cjs/scenegraph/group-creater/cell-type/media-cell-helper.js.map +1 -0
  77. package/cjs/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -1
  78. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js +23 -7
  79. package/cjs/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  80. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  81. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +6 -5
  82. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  83. package/cjs/scenegraph/group-creater/cell-type/switch-cell.d.ts +1 -1
  84. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js +5 -4
  85. package/cjs/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  86. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  87. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +44 -23
  88. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  89. package/cjs/scenegraph/group-creater/column-helper.js +14 -7
  90. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  91. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
  92. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  93. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  94. package/cjs/scenegraph/group-creater/progress/proxy.js +11 -5
  95. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  96. package/cjs/scenegraph/icon/icon-update.js +1 -0
  97. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  98. package/cjs/scenegraph/layout/compute-col-width.js +8 -3
  99. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  100. package/cjs/scenegraph/layout/compute-row-height.js +33 -9
  101. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  102. package/cjs/scenegraph/layout/update-height.js +1 -1
  103. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  104. package/cjs/scenegraph/layout/update-row.js +24 -3
  105. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  106. package/cjs/scenegraph/layout/update-width.js +1 -1
  107. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  108. package/cjs/scenegraph/scenegraph.d.ts +1 -0
  109. package/cjs/scenegraph/scenegraph.js +93 -64
  110. package/cjs/scenegraph/scenegraph.js.map +1 -1
  111. package/cjs/scenegraph/stick-text/index.js +46 -20
  112. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  113. package/cjs/scenegraph/utils/deal-promise-data.d.ts +1 -1
  114. package/cjs/scenegraph/utils/deal-promise-data.js +2 -2
  115. package/cjs/scenegraph/utils/deal-promise-data.js.map +1 -1
  116. package/cjs/scenegraph/utils/text-icon-layout.js +4 -3
  117. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  118. package/cjs/state/cell-move/index.js +6 -3
  119. package/cjs/state/cell-move/index.js.map +1 -1
  120. package/cjs/state/checkbox/checkbox.d.ts +6 -1
  121. package/cjs/state/checkbox/checkbox.js +191 -36
  122. package/cjs/state/checkbox/checkbox.js.map +1 -1
  123. package/cjs/state/radio/radio.d.ts +3 -1
  124. package/cjs/state/radio/radio.js +69 -12
  125. package/cjs/state/radio/radio.js.map +1 -1
  126. package/cjs/state/state.d.ts +3 -2
  127. package/cjs/state/state.js +6 -3
  128. package/cjs/state/state.js.map +1 -1
  129. package/cjs/tools/media.d.ts +1 -0
  130. package/cjs/tools/media.js +19 -0
  131. package/cjs/tools/media.js.map +1 -0
  132. package/cjs/ts-types/base-table.d.ts +2 -0
  133. package/cjs/ts-types/base-table.js.map +1 -1
  134. package/cjs/ts-types/column/type.d.ts +2 -2
  135. package/cjs/ts-types/column/type.js.map +1 -1
  136. package/cjs/ts-types/events.d.ts +3 -1
  137. package/cjs/ts-types/events.js.map +1 -1
  138. package/cjs/ts-types/icon.d.ts +1 -0
  139. package/cjs/ts-types/icon.js.map +1 -1
  140. package/cjs/ts-types/list-table/define/image-define.d.ts +10 -0
  141. package/cjs/ts-types/list-table/define/image-define.js.map +1 -1
  142. package/cjs/ts-types/list-table/define/index.d.ts +5 -4
  143. package/cjs/ts-types/list-table/define/index.js.map +1 -1
  144. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -4
  145. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  146. package/cjs/ts-types/list-table/layout-map/index.d.ts +1 -1
  147. package/cjs/ts-types/list-table/layout-map/index.js.map +1 -1
  148. package/cjs/ts-types/menu.d.ts +12 -0
  149. package/cjs/ts-types/menu.js.map +1 -1
  150. package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +5 -0
  151. package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  152. package/cjs/ts-types/pivot-table/dimension/index.d.ts +5 -3
  153. package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -1
  154. package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +10 -0
  155. package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  156. package/cjs/ts-types/pivot-table/indicator/index.d.ts +3 -3
  157. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -1
  158. package/cjs/ts-types/table-engine.d.ts +13 -4
  159. package/cjs/ts-types/table-engine.js.map +1 -1
  160. package/cjs/ts-types/tooltip.d.ts +1 -0
  161. package/cjs/ts-types/tooltip.js.map +1 -1
  162. package/cjs/vrender.js.map +1 -1
  163. package/dist/vtable.js +1528 -367
  164. package/dist/vtable.min.js +1 -1
  165. package/es/ListTable-all.js +4 -4
  166. package/es/ListTable-all.js.map +1 -1
  167. package/es/ListTable.d.ts +5 -2
  168. package/es/ListTable.js +22 -7
  169. package/es/ListTable.js.map +1 -1
  170. package/es/PivotChart.js +4 -4
  171. package/es/PivotChart.js.map +1 -1
  172. package/es/PivotTable-all.js +4 -4
  173. package/es/PivotTable-all.js.map +1 -1
  174. package/es/body-helper/body-helper.d.ts +2 -1
  175. package/es/body-helper/body-helper.js +5 -3
  176. package/es/body-helper/body-helper.js.map +1 -1
  177. package/es/components/index.js +2 -1
  178. package/es/components/tooltip/TooltipHandler.d.ts +4 -0
  179. package/es/components/tooltip/TooltipHandler.js +32 -7
  180. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  181. package/es/core/BaseTable.d.ts +1 -0
  182. package/es/core/BaseTable.js +28 -15
  183. package/es/core/BaseTable.js.map +1 -1
  184. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  185. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  186. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  187. package/es/core/row-series-number-helper.d.ts +1 -0
  188. package/es/core/row-series-number-helper.js +3 -1
  189. package/es/core/row-series-number-helper.js.map +1 -1
  190. package/es/core/tableHelper.js +1 -2
  191. package/es/data/CachedDataSource.js +5 -3
  192. package/es/data/CachedDataSource.js.map +1 -1
  193. package/es/data/DataSource.js +2 -1
  194. package/es/event/event.js +1 -1
  195. package/es/event/helper.js +1 -1
  196. package/es/event/media-click.js +148 -12
  197. package/es/event/media-click.js.map +1 -1
  198. package/es/event/scroll.js +1 -1
  199. package/es/event/sparkline-event.js +1 -1
  200. package/es/event/util.js +1 -1
  201. package/es/header-helper/header-helper.d.ts +1 -0
  202. package/es/header-helper/header-helper.js +4 -1
  203. package/es/header-helper/header-helper.js.map +1 -1
  204. package/es/index.d.ts +3 -3
  205. package/es/index.js +1 -1
  206. package/es/index.js.map +1 -1
  207. package/es/layout/index.js +2 -1
  208. package/es/plugins/custom-cell-style.js +1 -1
  209. package/es/plugins/index.js +1 -2
  210. package/es/plugins/interface.d.ts +2 -1
  211. package/es/plugins/interface.js +1 -1
  212. package/es/plugins/interface.js.map +1 -1
  213. package/es/plugins/invert-highlight.js +1 -1
  214. package/es/plugins/list-tree-stick-cell.js +1 -1
  215. package/es/plugins/plugin-manager.d.ts +1 -1
  216. package/es/plugins/plugin-manager.js +12 -7
  217. package/es/plugins/plugin-manager.js.map +1 -1
  218. package/es/scenegraph/group-creater/cell-helper.d.ts +4 -2
  219. package/es/scenegraph/group-creater/cell-helper.js +67 -40
  220. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  221. package/es/scenegraph/group-creater/cell-type/audio-cell.d.ts +7 -0
  222. package/es/scenegraph/group-creater/cell-type/audio-cell.js +89 -0
  223. package/es/scenegraph/group-creater/cell-type/audio-cell.js.map +1 -0
  224. package/es/scenegraph/group-creater/cell-type/button-cell.d.ts +1 -1
  225. package/es/scenegraph/group-creater/cell-type/button-cell.js +5 -4
  226. package/es/scenegraph/group-creater/cell-type/button-cell.js.map +1 -1
  227. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -2
  228. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  229. package/es/scenegraph/group-creater/cell-type/checkbox-cell.d.ts +1 -1
  230. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +5 -4
  231. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  232. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  233. package/es/scenegraph/group-creater/cell-type/image-cell.js +43 -14
  234. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  235. package/es/scenegraph/group-creater/cell-type/index.d.ts +1 -0
  236. package/es/scenegraph/group-creater/cell-type/index.js +6 -0
  237. package/es/scenegraph/group-creater/cell-type/index.js.map +1 -1
  238. package/es/scenegraph/group-creater/cell-type/media-cell-helper.d.ts +13 -0
  239. package/es/scenegraph/group-creater/cell-type/media-cell-helper.js +56 -0
  240. package/es/scenegraph/group-creater/cell-type/media-cell-helper.js.map +1 -0
  241. package/es/scenegraph/group-creater/cell-type/radio-cell.d.ts +1 -1
  242. package/es/scenegraph/group-creater/cell-type/radio-cell.js +23 -7
  243. package/es/scenegraph/group-creater/cell-type/radio-cell.js.map +1 -1
  244. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +1 -1
  245. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +6 -5
  246. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  247. package/es/scenegraph/group-creater/cell-type/switch-cell.d.ts +1 -1
  248. package/es/scenegraph/group-creater/cell-type/switch-cell.js +5 -4
  249. package/es/scenegraph/group-creater/cell-type/switch-cell.js.map +1 -1
  250. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  251. package/es/scenegraph/group-creater/cell-type/video-cell.js +47 -22
  252. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  253. package/es/scenegraph/group-creater/column-helper.js +14 -8
  254. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  255. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +24 -8
  256. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  257. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  258. package/es/scenegraph/group-creater/progress/proxy.js +11 -5
  259. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  260. package/es/scenegraph/icon/icon-update.js +1 -0
  261. package/es/scenegraph/icon/icon-update.js.map +1 -1
  262. package/es/scenegraph/layout/compute-col-width.js +8 -3
  263. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  264. package/es/scenegraph/layout/compute-row-height.js +32 -9
  265. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  266. package/es/scenegraph/layout/update-height.js +1 -1
  267. package/es/scenegraph/layout/update-height.js.map +1 -1
  268. package/es/scenegraph/layout/update-row.js +25 -2
  269. package/es/scenegraph/layout/update-row.js.map +1 -1
  270. package/es/scenegraph/layout/update-width.js +1 -1
  271. package/es/scenegraph/layout/update-width.js.map +1 -1
  272. package/es/scenegraph/scenegraph.d.ts +1 -0
  273. package/es/scenegraph/scenegraph.js +93 -64
  274. package/es/scenegraph/scenegraph.js.map +1 -1
  275. package/es/scenegraph/stick-text/index.js +46 -18
  276. package/es/scenegraph/stick-text/index.js.map +1 -1
  277. package/es/scenegraph/utils/deal-promise-data.d.ts +1 -1
  278. package/es/scenegraph/utils/deal-promise-data.js +2 -2
  279. package/es/scenegraph/utils/deal-promise-data.js.map +1 -1
  280. package/es/scenegraph/utils/text-icon-layout.js +7 -6
  281. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  282. package/es/state/cell-move/index.js +6 -3
  283. package/es/state/cell-move/index.js.map +1 -1
  284. package/es/state/checkbox/checkbox.d.ts +6 -1
  285. package/es/state/checkbox/checkbox.js +186 -34
  286. package/es/state/checkbox/checkbox.js.map +1 -1
  287. package/es/state/radio/radio.d.ts +3 -1
  288. package/es/state/radio/radio.js +70 -13
  289. package/es/state/radio/radio.js.map +1 -1
  290. package/es/state/state.d.ts +3 -2
  291. package/es/state/state.js +6 -2
  292. package/es/state/state.js.map +1 -1
  293. package/es/tools/media.d.ts +1 -0
  294. package/es/tools/media.js +11 -0
  295. package/es/tools/media.js.map +1 -0
  296. package/es/ts-types/base-table.d.ts +2 -0
  297. package/es/ts-types/base-table.js.map +1 -1
  298. package/es/ts-types/column/type.d.ts +2 -2
  299. package/es/ts-types/column/type.js.map +1 -1
  300. package/es/ts-types/events.d.ts +3 -1
  301. package/es/ts-types/events.js.map +1 -1
  302. package/es/ts-types/icon.d.ts +1 -0
  303. package/es/ts-types/icon.js.map +1 -1
  304. package/es/ts-types/list-table/define/image-define.d.ts +10 -0
  305. package/es/ts-types/list-table/define/image-define.js.map +1 -1
  306. package/es/ts-types/list-table/define/index.d.ts +5 -4
  307. package/es/ts-types/list-table/define/index.js.map +1 -1
  308. package/es/ts-types/list-table/layout-map/api.d.ts +4 -4
  309. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  310. package/es/ts-types/list-table/layout-map/index.d.ts +1 -1
  311. package/es/ts-types/list-table/layout-map/index.js.map +1 -1
  312. package/es/ts-types/menu.d.ts +12 -0
  313. package/es/ts-types/menu.js.map +1 -1
  314. package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +5 -0
  315. package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -1
  316. package/es/ts-types/pivot-table/dimension/index.d.ts +5 -3
  317. package/es/ts-types/pivot-table/dimension/index.js.map +1 -1
  318. package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +10 -0
  319. package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -1
  320. package/es/ts-types/pivot-table/indicator/index.d.ts +3 -3
  321. package/es/ts-types/pivot-table/indicator/index.js.map +1 -1
  322. package/es/ts-types/table-engine.d.ts +13 -4
  323. package/es/ts-types/table-engine.js.map +1 -1
  324. package/es/ts-types/tooltip.d.ts +1 -0
  325. package/es/ts-types/tooltip.js.map +1 -1
  326. package/es/vrender.js.map +1 -1
  327. package/package.json +5 -4
@@ -4,12 +4,12 @@ import { registerAxis, registerEmptyTip, registerLegend, registerMenu, registerT
4
4
 
5
5
  import { registerCustomCellStylePlugin } from "./plugins/custom-cell-style";
6
6
 
7
- import { registerCheckboxCell, registerImageCell, registerProgressBarCell, registerRadioCell, registerSparkLineCell, registerTextCell, registerVideoCell } from "./scenegraph/group-creater/cell-type";
7
+ import { registerAudioCell, registerCheckboxCell, registerImageCell, registerProgressBarCell, registerRadioCell, registerSparkLineCell, registerTextCell, registerVideoCell } from "./scenegraph/group-creater/cell-type";
8
8
 
9
9
  registerAxis(), registerEmptyTip(), registerLegend(), registerMenu(), registerTitle(),
10
- registerTooltip(), registerCustomCellStylePlugin(), registerAnimation(), registerCheckboxCell(),
11
- registerImageCell(), registerProgressBarCell(), registerRadioCell(), registerSparkLineCell(),
12
- registerTextCell(), registerVideoCell();
10
+ registerTooltip(), registerCustomCellStylePlugin(), registerAnimation(), registerAudioCell(),
11
+ registerCheckboxCell(), registerImageCell(), registerProgressBarCell(), registerRadioCell(),
12
+ registerSparkLineCell(), registerTextCell(), registerVideoCell();
13
13
 
14
14
  export class PivotTableAll extends PivotTable {}
15
15
  //# sourceMappingURL=PivotTable-all.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PivotTable-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,CAAC;AACf,gBAAgB,EAAE,CAAC;AACnB,cAAc,EAAE,CAAC;AACjB,YAAY,EAAE,CAAC;AACf,aAAa,EAAE,CAAC;AAChB,eAAe,EAAE,CAAC;AAClB,6BAA6B,EAAE,CAAC;AAChC,iBAAiB,EAAE,CAAC;AACpB,oBAAoB,EAAE,CAAC;AACvB,iBAAiB,EAAE,CAAC;AACpB,uBAAuB,EAAE,CAAC;AAC1B,iBAAiB,EAAE,CAAC;AACpB,qBAAqB,EAAE,CAAC;AACxB,gBAAgB,EAAE,CAAC;AACnB,iBAAiB,EAAE,CAAC;AAEpB,MAAM,OAAO,aAAc,SAAQ,UAAU;CAAG","file":"PivotTable-all.js","sourcesContent":["import { PivotTable } from './PivotTable';\nimport {\n registerAxis,\n registerEmptyTip,\n registerLegend,\n registerMenu,\n registerTitle,\n registerTooltip,\n registerAnimation\n} from './components';\nimport { registerCustomCellStylePlugin } from './plugins/custom-cell-style';\nimport {\n registerChartCell,\n registerCheckboxCell,\n registerImageCell,\n registerProgressBarCell,\n registerRadioCell,\n registerSparkLineCell,\n registerTextCell,\n registerVideoCell\n} from './scenegraph/group-creater/cell-type';\n\nregisterAxis();\nregisterEmptyTip();\nregisterLegend();\nregisterMenu();\nregisterTitle();\nregisterTooltip();\nregisterCustomCellStylePlugin();\nregisterAnimation();\nregisterCheckboxCell();\nregisterImageCell();\nregisterProgressBarCell();\nregisterRadioCell();\nregisterSparkLineCell();\nregisterTextCell();\nregisterVideoCell();\n\nexport class PivotTableAll extends PivotTable {}\n"]}
1
+ {"version":3,"sources":["../src/PivotTable-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,CAAC;AACf,gBAAgB,EAAE,CAAC;AACnB,cAAc,EAAE,CAAC;AACjB,YAAY,EAAE,CAAC;AACf,aAAa,EAAE,CAAC;AAChB,eAAe,EAAE,CAAC;AAClB,6BAA6B,EAAE,CAAC;AAChC,iBAAiB,EAAE,CAAC;AACpB,iBAAiB,EAAE,CAAC;AACpB,oBAAoB,EAAE,CAAC;AACvB,iBAAiB,EAAE,CAAC;AACpB,uBAAuB,EAAE,CAAC;AAC1B,iBAAiB,EAAE,CAAC;AACpB,qBAAqB,EAAE,CAAC;AACxB,gBAAgB,EAAE,CAAC;AACnB,iBAAiB,EAAE,CAAC;AAEpB,MAAM,OAAO,aAAc,SAAQ,UAAU;CAAG","file":"PivotTable-all.js","sourcesContent":["import { PivotTable } from './PivotTable';\nimport {\n registerAxis,\n registerEmptyTip,\n registerLegend,\n registerMenu,\n registerTitle,\n registerTooltip,\n registerAnimation\n} from './components';\nimport { registerCustomCellStylePlugin } from './plugins/custom-cell-style';\nimport {\n registerAudioCell,\n registerChartCell,\n registerCheckboxCell,\n registerImageCell,\n registerProgressBarCell,\n registerRadioCell,\n registerSparkLineCell,\n registerTextCell,\n registerVideoCell\n} from './scenegraph/group-creater/cell-type';\n\nregisterAxis();\nregisterEmptyTip();\nregisterLegend();\nregisterMenu();\nregisterTitle();\nregisterTooltip();\nregisterCustomCellStylePlugin();\nregisterAnimation();\nregisterAudioCell();\nregisterCheckboxCell();\nregisterImageCell();\nregisterProgressBarCell();\nregisterRadioCell();\nregisterSparkLineCell();\nregisterTextCell();\nregisterVideoCell();\n\nexport class PivotTableAll extends PivotTable {}\n"]}
@@ -10,8 +10,9 @@ export declare class BodyHelper {
10
10
  collapseIcon: SvgIcon;
11
11
  _table: BaseTableAPI;
12
12
  constructor(_table: BaseTableAPI);
13
+ updateIcons(): void;
13
14
  getIcons(col: number, row: number, cellValue: any, dataValue: any, context: CanvasRenderingContext2D): ColumnIconOption[];
14
- getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio' | 'switch' | 'button'): typeof Style | typeof RadioStyle | typeof SwitchStyle | typeof ButtonStyle | typeof CheckboxStyle;
15
+ getStyleClass(cellType: 'text' | 'link' | 'image' | 'video' | 'audio' | 'chart' | 'sparkline' | 'progressbar' | 'chart' | 'checkbox' | 'radio' | 'switch' | 'button'): typeof Style | typeof RadioStyle | typeof SwitchStyle | typeof ButtonStyle | typeof CheckboxStyle;
15
16
  getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;
16
17
  getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];
17
18
  getCellIconFromRecordValue(icon: ColumnIconOption | ColumnIconOption[], col: number, row: number): ColumnIconOption | ColumnIconOption[];
@@ -26,7 +26,9 @@ import { ButtonStyle } from "./style/ButtonStyle";
26
26
 
27
27
  export class BodyHelper {
28
28
  constructor(_table) {
29
- this._table = _table;
29
+ this._table = _table, this.updateIcons();
30
+ }
31
+ updateIcons() {
30
32
  const regedIcons = registerIcons.get();
31
33
  this.expandIcon = regedIcons[InternalIconName.expandIconName], this.collapseIcon = regedIcons[InternalIconName.collapseIconName];
32
34
  }
@@ -65,6 +67,7 @@ export class BodyHelper {
65
67
 
66
68
  case "image":
67
69
  case "video":
70
+ case "audio":
68
71
  return ImageStyle;
69
72
 
70
73
  case "chart":
@@ -108,5 +111,4 @@ export class BodyHelper {
108
111
  var _a, _b;
109
112
  return this.expandIcon.width + (null !== (_a = this.expandIcon.marginLeft) && void 0 !== _a ? _a : 0) + (null !== (_b = this.expandIcon.marginRight) && void 0 !== _b ? _b : 0);
110
113
  }
111
- }
112
- //# sourceMappingURL=body-helper.js.map
114
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/body-helper/body-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MA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E,GAAG,CAAC,CAAA,EAAE;oBACzD,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;iBACzB;aACF;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,gBAAgB,CAAC,GAAW,EAAE,GAAW;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/D,IAAI,cAAc,KAAK,cAAc,CAAC,MAAM,EAAE;YAE5C,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;aAAM,IAAI,cAAc,KAAK,cAAc,CAAC,QAAQ,EAAE;YAErD,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,qBAAqB;;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC;IACxG,CAAC;CACF","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n return ImageStyle;\n case 'video':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/body-helper/body-helper.ts"],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AC;CACF","file":"body-helper.js","sourcesContent":["import type { ColumnIconOption, ImageIcon, ListTableAPI, SvgIcon } from '../ts-types';\nimport { HierarchyState, InternalIconName } from '../ts-types';\nimport * as registerIcons from '../icons';\nimport { Style } from './style/Style';\nimport { TextStyle } from './style/MultilineTextStyle';\nimport { ProgressBarStyle } from './style/ProgressBarStyle';\nimport { ImageStyle } from './style/ImageStyle';\nimport type { BaseTableAPI } from '../ts-types/base-table';\nimport * as icons from '../tools/icons';\nimport { obj } from '../tools/helper';\nimport { CheckboxStyle } from './style/CheckboxStyle';\nimport { RadioStyle } from './style/RadioStyle';\nimport { isValid } from '@visactor/vutils';\nimport { SwitchStyle } from './style/SwitchStyle';\nimport { ButtonStyle } from './style/ButtonStyle';\nexport class BodyHelper {\n expandIcon: SvgIcon;\n collapseIcon: SvgIcon;\n _table: BaseTableAPI;\n constructor(_table: BaseTableAPI) {\n this._table = _table;\n this.updateIcons();\n }\n\n updateIcons() {\n const regedIcons = registerIcons.get();\n //展开折叠按钮\n this.expandIcon = regedIcons[InternalIconName.expandIconName] as SvgIcon;\n this.collapseIcon = regedIcons[InternalIconName.collapseIconName] as SvgIcon;\n }\n getIcons(\n col: number,\n row: number,\n cellValue: any,\n dataValue: any,\n context: CanvasRenderingContext2D\n ): ColumnIconOption[] {\n //加入固定列图标 排序 文本中元素\n const iconArr: ColumnIconOption[] = [];\n\n const hierarchyIcon = this.getHierarchyIcon(col, row);\n if (hierarchyIcon) {\n iconArr.push(hierarchyIcon);\n }\n\n const { icon: iconDefine } = this._table.getBodyColumnDefine(col, row);\n\n if (iconDefine) {\n let iconResults;\n if (typeof iconDefine === 'function') {\n const arg = {\n col,\n row,\n value: cellValue,\n dataValue,\n table: this._table\n };\n iconResults = iconDefine(arg);\n } else {\n iconResults = iconDefine;\n }\n const regedIcons = registerIcons.get();\n const addIcon = (columnIcon: string | ColumnIconOption) => {\n let icon;\n if (typeof columnIcon === 'string') {\n icon = regedIcons[columnIcon];\n } else {\n icon = columnIcon;\n }\n if (icon) {\n iconArr.push(icon);\n }\n };\n if (Array.isArray(iconResults)) {\n iconResults.forEach((columnIcon: string | ColumnIconOption, index: number) => {\n addIcon(columnIcon);\n });\n } else {\n addIcon(iconResults);\n }\n }\n\n context &&\n iconArr.forEach((i, index) => {\n if ((i as any).content || (<ImageIcon>i).src) {\n iconArr[index] = this.getCellIconFromRecordValue(i, col, row);\n // if ((<FontIcon>i).font)\n // helper.testFontLoad((<FontIcon>i).font, (<FontIcon>i).content, col, row);\n }\n });\n\n return iconArr;\n }\n getStyleClass(\n cellType:\n | 'text'\n | 'link'\n | 'image'\n | 'video'\n | 'audio'\n | 'chart'\n | 'sparkline'\n | 'progressbar'\n | 'chart'\n | 'checkbox'\n | 'radio'\n | 'switch'\n | 'button'\n ) {\n switch (cellType) {\n case 'text':\n return TextStyle;\n case 'image':\n case 'video':\n case 'audio':\n return ImageStyle;\n case 'link':\n return TextStyle;\n case 'chart':\n return Style;\n case 'sparkline':\n return Style;\n case 'progressbar':\n return ProgressBarStyle;\n case 'checkbox':\n return CheckboxStyle;\n case 'radio':\n return RadioStyle;\n case 'switch':\n return SwitchStyle;\n case 'button':\n return ButtonStyle;\n }\n return TextStyle;\n }\n getCellIconFromRecordValue(icon: ColumnIconOption, col: number, row: number): ColumnIconOption;\n getCellIconFromRecordValue(icon: ColumnIconOption[], col: number, row: number): ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[];\n getCellIconFromRecordValue(\n icon: ColumnIconOption | ColumnIconOption[],\n col: number,\n row: number\n ): ColumnIconOption | ColumnIconOption[] {\n if (Array.isArray(icon)) {\n return icon.map(i => this.getCellIconFromRecordValue(i, col, row));\n }\n // icon.positionType = IconPosition.inlineFront;\n if (!obj.isObject(icon) || typeof icon === 'function') {\n return (this._table as ListTableAPI).getFieldData(icon, col, row);\n }\n // 新建对象 挨个属性赋值\n const retIcon: any = {};\n const iconOpt: any = icon;\n icons.iconPropKeys.forEach(k => {\n if (typeof iconOpt[k] !== 'undefined') {\n const f = (this._table as ListTableAPI).getFieldData(iconOpt[k], col, row);\n if (isValid(f)) {\n retIcon[k] = f;\n } else if (!this._table._hasField?.(iconOpt[k], col, row)) {\n retIcon[k] = iconOpt[k];\n }\n }\n });\n return retIcon;\n }\n\n getHierarchyIcon(col: number, row: number) {\n const hierarchyState = this._table.getHierarchyState(col, row);\n if (hierarchyState === HierarchyState.expand) {\n //展开状态 应该显示-号\n return this.expandIcon;\n } else if (hierarchyState === HierarchyState.collapse) {\n //折叠状态 应该显示-号\n return this.collapseIcon;\n }\n return undefined;\n }\n getHierarchyIconWidth() {\n return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);\n }\n}\n"]}
@@ -46,4 +46,5 @@ export const registerTooltip = () => {
46
46
 
47
47
  export const registerAnimation = () => {
48
48
  registerCustomAnimate(), registerAnimate();
49
- };
49
+ };
50
+ //# sourceMappingURL=index.js.map
@@ -10,10 +10,14 @@ export declare class TooltipHandler {
10
10
  private _table;
11
11
  private _tooltipInstances?;
12
12
  private _attachInfo?;
13
+ private _pendingInfo?;
13
14
  private confine?;
14
15
  constructor(table: BaseTableAPI, confine: boolean);
15
16
  release(): void;
16
17
  _bindToCell(col: number, row: number, tooltipOptions?: TooltipOptions): void;
18
+ _bindToCellImmediately(col: number, row: number, tooltipOptions?: TooltipOptions): void;
19
+ _clearPendingBind(): void;
20
+ _unbindAttachedTooltip(): void;
17
21
  _move(col: number, row: number, tooltipOptions: TooltipOptions): void;
18
22
  moveToPosition(col: number, row: number, position?: {
19
23
  x: number;
@@ -20,12 +20,30 @@ export class TooltipHandler {
20
20
  }
21
21
  release() {
22
22
  var _a, _b;
23
+ this._clearPendingBind();
23
24
  const tooltipInstances = this._tooltipInstances;
24
25
  for (const k in tooltipInstances) null === (_b = null === (_a = tooltipInstances[k]) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a);
25
- delete this._tooltipInstances, this._attachInfo = null;
26
+ delete this._tooltipInstances, this._attachInfo = null, this._pendingInfo = null;
26
27
  }
27
28
  _bindToCell(col, row, tooltipOptions) {
29
+ this._clearPendingBind();
30
+ const appearDelay = null == tooltipOptions ? void 0 : tooltipOptions.appearDelay;
31
+ if (tooltipOptions && appearDelay && appearDelay > 0) {
32
+ this._unbindAttachedTooltip();
33
+ const id = setTimeout((() => {
34
+ this._pendingInfo = null, this._bindToCellImmediately(col, row, tooltipOptions);
35
+ }), appearDelay);
36
+ this._pendingInfo = {
37
+ id: id,
38
+ col: col,
39
+ row: row,
40
+ tooltipOptions: tooltipOptions
41
+ };
42
+ } else this._bindToCellImmediately(col, row, tooltipOptions);
43
+ }
44
+ _bindToCellImmediately(col, row, tooltipOptions) {
28
45
  var _a;
46
+ if (!tooltipOptions) return void this._unbindAttachedTooltip();
29
47
  const info = this._attachInfo, instance = this._getTooltipInstanceInfo(col, row);
30
48
  if (!info || instance && info.instance === instance || (null === (_a = info.instance) || void 0 === _a || _a.unbindTooltipElement(),
31
49
  this._attachInfo = null), !instance) return;
@@ -38,6 +56,15 @@ export class TooltipHandler {
38
56
  };
39
57
  }
40
58
  }
59
+ _clearPendingBind() {
60
+ this._pendingInfo && (clearTimeout(this._pendingInfo.id), this._pendingInfo = null);
61
+ }
62
+ _unbindAttachedTooltip() {
63
+ const info = this._attachInfo;
64
+ if (!info) return;
65
+ const {instance: instance} = info;
66
+ null == instance || instance.unbindTooltipElement(), this._attachInfo = null;
67
+ }
41
68
  _move(col, row, tooltipOptions) {
42
69
  const info = this._attachInfo;
43
70
  if (!info || !cellInRange(info.range, col, row)) return;
@@ -52,12 +79,10 @@ export class TooltipHandler {
52
79
  null == instance || instance.locateTooltipElement(col, row, position, referencePosition, this.confine);
53
80
  }
54
81
  _unbindFromCell() {
55
- const info = this._attachInfo;
56
- if (!info) return;
57
- const {instance: instance} = info;
58
- null == instance || instance.unbindTooltipElement(), this._attachInfo = null;
82
+ this._clearPendingBind(), this._unbindAttachedTooltip();
59
83
  }
60
84
  _isBindCell(col, row) {
85
+ if (this._pendingInfo && this._pendingInfo.col === col && this._pendingInfo.row === row) return !0;
61
86
  const info = this._attachInfo;
62
87
  return !!info && cellInRange(info.range, col, row);
63
88
  }
@@ -127,8 +152,8 @@ export class TooltipHandler {
127
152
  return tooltipInstances && tooltipInstances["bubble-tooltip"] || tooltipInstances && (tooltipInstances["bubble-tooltip"] = TOOLTIP_INSTANCE_FACTORY["bubble-tooltip"](table));
128
153
  }
129
154
  isBinded(tooltipOptions) {
130
- var _a;
131
- return JSON.stringify(tooltipOptions) === JSON.stringify(null === (_a = this._attachInfo) || void 0 === _a ? void 0 : _a.tooltipOptions);
155
+ var _a, _b;
156
+ return JSON.stringify(tooltipOptions) === JSON.stringify(null === (_a = this._attachInfo) || void 0 === _a ? void 0 : _a.tooltipOptions) || JSON.stringify(tooltipOptions) === JSON.stringify(null === (_b = this._pendingInfo) || void 0 === _b ? void 0 : _b.tooltipOptions);
132
157
  }
133
158
  }
134
159
  //# sourceMappingURL=TooltipHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tooltip/TooltipHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,MAAM,wBAAwB,GAAG;IAI/B,gBAAgB,EAAE,UAAU,KAAmB;QAC7C,OAAO,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF,CAAC;AAUF,MAAM,OAAO,cAAc;IAKzB,YAAY,KAAmB,EAAE,OAAgB;QAC/C,IAAI,CAAC,MAA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["import type { CellRange, RectProps } from '../../ts-types';\nimport type { Placement } from '../../ts-types';\nimport type { BaseTooltip } from './BaseTooltip';\nimport { BubbleTooltip } from './Tooltip';\nimport { cellInRange } from '../../tools/helper';\nimport { isMobile } from '../../tools/util';\n// import { DG_EVENT_TYPE } from '../core/DG_EVENT_TYPE';\nimport type { TooltipOptions } from '../../ts-types/tooltip';\nimport { TABLE_EVENT_TYPE } from '../../core/TABLE_EVENT_TYPE';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isFunction } from '@visactor/vutils';\nconst TOOLTIP_INSTANCE_FACTORY = {\n // tooltip(table: BaseTableAPI): BaseTooltip {\n // return new Tooltip(table);\n // },\n 'bubble-tooltip': function (table: BaseTableAPI): BaseTooltip {\n return new BubbleTooltip(table);\n }\n};\ntype AttachInfo = {\n instance?: BaseTooltip;\n range: CellRange;\n tooltipOptions: TooltipOptions;\n};\nexport interface ITooltipHandler {\n new (table: BaseTableAPI, confine: boolean): TooltipHandler;\n}\n\nexport class TooltipHandler {\n private _table: BaseTableAPI;\n private _tooltipInstances?: { [type: string]: BaseTooltip };\n private _attachInfo?: AttachInfo | null;\n private confine?: boolean; //弹出框是否需要限定在canvas区域\n constructor(table: BaseTableAPI, confine: boolean) {\n this._table = table;\n this._tooltipInstances = {};\n this._bindTableEvent(table);\n this.confine = confine;\n }\n release(): void {\n const tooltipInstances = this._tooltipInstances;\n for (const k in tooltipInstances) {\n tooltipInstances[k]?.release?.();\n }\n delete this._tooltipInstances;\n this._attachInfo = null;\n }\n _bindToCell(col: number, row: number, tooltipOptions?: TooltipOptions): void {\n const info = this._attachInfo;\n const instance = this._getTooltipInstanceInfo(col, row);\n if (info && (!instance || info.instance !== instance)) {\n info.instance?.unbindTooltipElement();\n this._attachInfo = null;\n }\n if (!instance) {\n return;\n }\n // const { instance, info: tooltipInstanceInfo } = instanceInfo;\n const attach = instance && instance.bindTooltipElement(col, row, tooltipOptions, this.confine);\n if (attach) {\n const range = this._table.getCellRange(col, row);\n this._attachInfo = { range, instance, tooltipOptions };\n }\n }\n _move(col: number, row: number, tooltipOptions: TooltipOptions): void {\n const info = this._attachInfo;\n if (!info || !cellInRange(info.range, col, row)) {\n return;\n }\n const { instance } = info;\n instance?.moveTooltipElement(col, row, tooltipOptions, this.confine);\n }\n moveToPosition(\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n }\n ): void {\n const info = this._attachInfo;\n if (!info || !cellInRange(info.range, col, row)) {\n return;\n }\n const { instance } = info;\n this._attachInfo.tooltipOptions.position = position;\n this._attachInfo.tooltipOptions.referencePosition = referencePosition;\n instance?.locateTooltipElement(col, row, position, referencePosition, this.confine);\n }\n _unbindFromCell(): void {\n const info = this._attachInfo;\n if (!info) {\n return;\n }\n const { instance } = info;\n instance?.unbindTooltipElement();\n this._attachInfo = null;\n }\n _isBindCell(col: number, row: number): boolean {\n const info = this._attachInfo;\n if (!info) {\n return false;\n }\n return cellInRange(info.range, col, row);\n }\n _bindTableEvent(table: BaseTableAPI): void {\n // (table.options.hover?.isShowTooltip || table.options.tooltip?.isShowOverflowTextTooltip) &&\n table.on(TABLE_EVENT_TYPE.MOUSEENTER_CELL, e => {\n //移动端不监听mousemove事件 (修改移动端tooltip时加的isMobile判断)\n if (isMobile()) {\n return;\n }\n // dropDownMenu区域不响应\n const { x1: left, x2: right, y1: top, y2: bottom } = table.stateManager.menu.bounds;\n if (\n table.stateManager.menu.isShow &&\n typeof e.x === 'number' &&\n typeof e.y === 'number' &&\n e.x > left &&\n e.x < right &&\n e.y > top &&\n e.y < bottom\n ) {\n return;\n }\n const { col, row } = e;\n this.showTooltip(col, row);\n // if (e.related) {\n // if (this._isBindCell(col, row)) {\n // return;\n // }\n // }\n });\n table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, e => {\n //移动端不监听mousemove事件 (修改移动端tooltip时加的isMobile判断)\n if (isMobile()) {\n return;\n }\n if (this._attachInfo?.tooltipOptions?.referencePosition) {\n const position = this._attachInfo.tooltipOptions.referencePosition;\n const { event } = e;\n const { left, right, top, bottom } = position.rect;\n const abstractPos = table._getMouseAbstractPoint(event);\n if (\n !(\n abstractPos.inTable &&\n abstractPos.x >= left - 5 &&\n abstractPos.x <= right + 5 &&\n abstractPos.y >= top - 5 &&\n abstractPos.y <= bottom + 5\n )\n ) {\n // 这里加5px的判断buffer\n this._unbindFromCell();\n }\n }\n // dropDownMenu区域不响应\n if (this._attachInfo && table.stateManager.menu.isShow) {\n this._bindToCell(e.col, e.row);\n }\n });\n table.on(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, e => {\n // if (e.related) {\n // if (this._isBindCell(e.related.col, e.related.row)) {\n // return;\n // }\n // }\n this._unbindFromCell();\n });\n table.on(TABLE_EVENT_TYPE.SELECTED_CELL, e => {\n if (this._isBindCell(e.col, e.row)) {\n this._unbindFromCell();\n }\n });\n table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, e => {\n this._unbindFromCell();\n });\n table.on(TABLE_EVENT_TYPE.SCROLL, e => {\n this._unbindFromCell();\n // const info = this._attachInfo;\n // if (info?.tooltipOptions && info?.range?.start) {\n // const { col, row } = info.range.start;\n // const rect = table.getCellRangeRelativeRect({ col, row });\n // info.tooltipOptions.referencePosition.rect = rect;\n // this._move(info.range.start.col, info.range.start.row, info.tooltipOptions);\n // }\n });\n }\n showTooltip(col: number, row: number) {\n let tooltipOption;\n const table = this._table;\n const headerDescription = table.getHeaderDescription(col, row);\n if (headerDescription) {\n const rect = table.getCellRangeRelativeRect({ col, row });\n tooltipOption = {\n content: headerDescription,\n referencePosition: {\n placement: table.internalProps.tooltip.position,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: table.theme.tooltipStyle\n };\n } else if (\n isFunction(table.internalProps.tooltip?.isShowOverflowTextTooltip)\n ? table.internalProps.tooltip.isShowOverflowTextTooltip(col, row, table)\n : table.internalProps.tooltip.isShowOverflowTextTooltip\n ) {\n const overflowText = table.getCellOverflowText(col, row);\n const rect = table.getCellRangeRelativeRect({ col, row });\n if (overflowText) {\n tooltipOption = {\n content: headerDescription\n ? `${headerDescription}\n ${overflowText}`\n : overflowText,\n referencePosition: {\n placement: table.internalProps.tooltip.position,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: table.theme.tooltipStyle\n };\n }\n }\n if (tooltipOption) {\n this._bindToCell(col, row, tooltipOption);\n } else {\n this._unbindFromCell();\n }\n }\n _getTooltipInstanceInfo(col: number, row: number): BaseTooltip | null {\n const table = this._table;\n const tooltipInstances = this._tooltipInstances;\n // const info = getTooltipInstanceInfo(table, col, row, tooltipOptions);\n // if (!info) {\n // return null;\n // }\n const tooltipType = 'bubble-tooltip';\n // const { tooltipType } = info;\n const instance =\n (tooltipInstances && tooltipInstances[tooltipType]) ||\n (tooltipInstances && (tooltipInstances[tooltipType] = TOOLTIP_INSTANCE_FACTORY[tooltipType](table)));\n return instance;\n }\n isBinded(tooltipOptions: TooltipOptions) {\n if (JSON.stringify(tooltipOptions) === JSON.stringify(this._attachInfo?.tooltipOptions)) {\n return true;\n }\n return false;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/tooltip/TooltipHandler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,MAAM,wBAAwB,GAAG;IAI/B,gBAAgB,EAAE,UAAU,KAAmB;QAC7C,OAAO,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF,CAAC;AAgBF,MAAM,OAAO,cAAc;IAMzB,YAAY,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Ac,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,YAAY,0CAAE,cAAc,CAAC,EACpF;YACA,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","file":"TooltipHandler.js","sourcesContent":["import type { CellRange, RectProps } from '../../ts-types';\nimport type { Placement } from '../../ts-types';\nimport type { BaseTooltip } from './BaseTooltip';\nimport { BubbleTooltip } from './Tooltip';\nimport { cellInRange } from '../../tools/helper';\nimport { isMobile } from '../../tools/util';\n// import { DG_EVENT_TYPE } from '../core/DG_EVENT_TYPE';\nimport type { TooltipOptions } from '../../ts-types/tooltip';\nimport { TABLE_EVENT_TYPE } from '../../core/TABLE_EVENT_TYPE';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isFunction } from '@visactor/vutils';\nconst TOOLTIP_INSTANCE_FACTORY = {\n // tooltip(table: BaseTableAPI): BaseTooltip {\n // return new Tooltip(table);\n // },\n 'bubble-tooltip': function (table: BaseTableAPI): BaseTooltip {\n return new BubbleTooltip(table);\n }\n};\ntype AttachInfo = {\n instance?: BaseTooltip;\n range: CellRange;\n tooltipOptions: TooltipOptions;\n};\ntype PendingInfo = {\n id: ReturnType<typeof setTimeout>;\n col: number;\n row: number;\n tooltipOptions: TooltipOptions;\n};\nexport interface ITooltipHandler {\n new (table: BaseTableAPI, confine: boolean): TooltipHandler;\n}\n\nexport class TooltipHandler {\n private _table: BaseTableAPI;\n private _tooltipInstances?: { [type: string]: BaseTooltip };\n private _attachInfo?: AttachInfo | null;\n private _pendingInfo?: PendingInfo | null;\n private confine?: boolean; //弹出框是否需要限定在canvas区域\n constructor(table: BaseTableAPI, confine: boolean) {\n this._table = table;\n this._tooltipInstances = {};\n this._bindTableEvent(table);\n this.confine = confine;\n }\n release(): void {\n this._clearPendingBind();\n const tooltipInstances = this._tooltipInstances;\n for (const k in tooltipInstances) {\n tooltipInstances[k]?.release?.();\n }\n delete this._tooltipInstances;\n this._attachInfo = null;\n this._pendingInfo = null;\n }\n _bindToCell(col: number, row: number, tooltipOptions?: TooltipOptions): void {\n this._clearPendingBind();\n const appearDelay = tooltipOptions?.appearDelay;\n if (tooltipOptions && appearDelay && appearDelay > 0) {\n this._unbindAttachedTooltip();\n const id = setTimeout(() => {\n this._pendingInfo = null;\n this._bindToCellImmediately(col, row, tooltipOptions);\n }, appearDelay);\n this._pendingInfo = {\n id,\n col,\n row,\n tooltipOptions\n };\n return;\n }\n this._bindToCellImmediately(col, row, tooltipOptions);\n }\n _bindToCellImmediately(col: number, row: number, tooltipOptions?: TooltipOptions): void {\n if (!tooltipOptions) {\n this._unbindAttachedTooltip();\n return;\n }\n const info = this._attachInfo;\n const instance = this._getTooltipInstanceInfo(col, row);\n if (info && (!instance || info.instance !== instance)) {\n info.instance?.unbindTooltipElement();\n this._attachInfo = null;\n }\n if (!instance) {\n return;\n }\n // const { instance, info: tooltipInstanceInfo } = instanceInfo;\n const attach = instance && instance.bindTooltipElement(col, row, tooltipOptions, this.confine);\n if (attach) {\n const range = this._table.getCellRange(col, row);\n this._attachInfo = { range, instance, tooltipOptions };\n }\n }\n _clearPendingBind(): void {\n if (this._pendingInfo) {\n clearTimeout(this._pendingInfo.id);\n this._pendingInfo = null;\n }\n }\n _unbindAttachedTooltip(): void {\n const info = this._attachInfo;\n if (!info) {\n return;\n }\n const { instance } = info;\n instance?.unbindTooltipElement();\n this._attachInfo = null;\n }\n _move(col: number, row: number, tooltipOptions: TooltipOptions): void {\n const info = this._attachInfo;\n if (!info || !cellInRange(info.range, col, row)) {\n return;\n }\n const { instance } = info;\n instance?.moveTooltipElement(col, row, tooltipOptions, this.confine);\n }\n moveToPosition(\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n }\n ): void {\n const info = this._attachInfo;\n if (!info || !cellInRange(info.range, col, row)) {\n return;\n }\n const { instance } = info;\n this._attachInfo.tooltipOptions.position = position;\n this._attachInfo.tooltipOptions.referencePosition = referencePosition;\n instance?.locateTooltipElement(col, row, position, referencePosition, this.confine);\n }\n _unbindFromCell(): void {\n this._clearPendingBind();\n this._unbindAttachedTooltip();\n }\n _isBindCell(col: number, row: number): boolean {\n if (this._pendingInfo && this._pendingInfo.col === col && this._pendingInfo.row === row) {\n return true;\n }\n const info = this._attachInfo;\n if (!info) {\n return false;\n }\n return cellInRange(info.range, col, row);\n }\n _bindTableEvent(table: BaseTableAPI): void {\n // (table.options.hover?.isShowTooltip || table.options.tooltip?.isShowOverflowTextTooltip) &&\n table.on(TABLE_EVENT_TYPE.MOUSEENTER_CELL, e => {\n //移动端不监听mousemove事件 (修改移动端tooltip时加的isMobile判断)\n if (isMobile()) {\n return;\n }\n // dropDownMenu区域不响应\n const { x1: left, x2: right, y1: top, y2: bottom } = table.stateManager.menu.bounds;\n if (\n table.stateManager.menu.isShow &&\n typeof e.x === 'number' &&\n typeof e.y === 'number' &&\n e.x > left &&\n e.x < right &&\n e.y > top &&\n e.y < bottom\n ) {\n return;\n }\n const { col, row } = e;\n this.showTooltip(col, row);\n // if (e.related) {\n // if (this._isBindCell(col, row)) {\n // return;\n // }\n // }\n });\n table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, e => {\n //移动端不监听mousemove事件 (修改移动端tooltip时加的isMobile判断)\n if (isMobile()) {\n return;\n }\n if (this._attachInfo?.tooltipOptions?.referencePosition) {\n const position = this._attachInfo.tooltipOptions.referencePosition;\n const { event } = e;\n const { left, right, top, bottom } = position.rect;\n const abstractPos = table._getMouseAbstractPoint(event);\n if (\n !(\n abstractPos.inTable &&\n abstractPos.x >= left - 5 &&\n abstractPos.x <= right + 5 &&\n abstractPos.y >= top - 5 &&\n abstractPos.y <= bottom + 5\n )\n ) {\n // 这里加5px的判断buffer\n this._unbindFromCell();\n }\n }\n // dropDownMenu区域不响应\n if (this._attachInfo && table.stateManager.menu.isShow) {\n this._bindToCell(e.col, e.row);\n }\n });\n table.on(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, e => {\n // if (e.related) {\n // if (this._isBindCell(e.related.col, e.related.row)) {\n // return;\n // }\n // }\n this._unbindFromCell();\n });\n table.on(TABLE_EVENT_TYPE.SELECTED_CELL, e => {\n if (this._isBindCell(e.col, e.row)) {\n this._unbindFromCell();\n }\n });\n table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, e => {\n this._unbindFromCell();\n });\n table.on(TABLE_EVENT_TYPE.SCROLL, e => {\n this._unbindFromCell();\n // const info = this._attachInfo;\n // if (info?.tooltipOptions && info?.range?.start) {\n // const { col, row } = info.range.start;\n // const rect = table.getCellRangeRelativeRect({ col, row });\n // info.tooltipOptions.referencePosition.rect = rect;\n // this._move(info.range.start.col, info.range.start.row, info.tooltipOptions);\n // }\n });\n }\n showTooltip(col: number, row: number) {\n let tooltipOption;\n const table = this._table;\n const headerDescription = table.getHeaderDescription(col, row);\n if (headerDescription) {\n const rect = table.getCellRangeRelativeRect({ col, row });\n tooltipOption = {\n content: headerDescription,\n referencePosition: {\n placement: table.internalProps.tooltip.position,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: table.theme.tooltipStyle\n };\n } else if (\n isFunction(table.internalProps.tooltip?.isShowOverflowTextTooltip)\n ? table.internalProps.tooltip.isShowOverflowTextTooltip(col, row, table)\n : table.internalProps.tooltip.isShowOverflowTextTooltip\n ) {\n const overflowText = table.getCellOverflowText(col, row);\n const rect = table.getCellRangeRelativeRect({ col, row });\n if (overflowText) {\n tooltipOption = {\n content: headerDescription\n ? `${headerDescription}\n ${overflowText}`\n : overflowText,\n referencePosition: {\n placement: table.internalProps.tooltip.position,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: table.theme.tooltipStyle\n };\n }\n }\n if (tooltipOption) {\n this._bindToCell(col, row, tooltipOption);\n } else {\n this._unbindFromCell();\n }\n }\n _getTooltipInstanceInfo(col: number, row: number): BaseTooltip | null {\n const table = this._table;\n const tooltipInstances = this._tooltipInstances;\n // const info = getTooltipInstanceInfo(table, col, row, tooltipOptions);\n // if (!info) {\n // return null;\n // }\n const tooltipType = 'bubble-tooltip';\n // const { tooltipType } = info;\n const instance =\n (tooltipInstances && tooltipInstances[tooltipType]) ||\n (tooltipInstances && (tooltipInstances[tooltipType] = TOOLTIP_INSTANCE_FACTORY[tooltipType](table)));\n return instance;\n }\n isBinded(tooltipOptions: TooltipOptions) {\n if (\n JSON.stringify(tooltipOptions) === JSON.stringify(this._attachInfo?.tooltipOptions) ||\n JSON.stringify(tooltipOptions) === JSON.stringify(this._pendingInfo?.tooltipOptions)\n ) {\n return true;\n }\n return false;\n }\n}\n"]}
@@ -352,6 +352,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
352
352
  get enableLineBreak(): boolean;
353
353
  set enableLineBreak(enableLineBreak: boolean);
354
354
  updateAutoWrapText(autoWrapText: boolean): void;
355
+ private _updateFunctionalIcons;
355
356
  get theme(): TableTheme;
356
357
  set theme(theme: TableTheme);
357
358
  updateTheme(theme: ITableThemeDefine): void;
@@ -82,6 +82,10 @@ import { PluginManager } from "../plugins/plugin-manager";
82
82
 
83
83
  const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
84
84
 
85
+ function normalizeCellType(cellType) {
86
+ return isValid(cellType) ? cellType : "text";
87
+ }
88
+
85
89
  importStyle();
86
90
 
87
91
  export class BaseTable extends EventTarget {
@@ -92,7 +96,7 @@ export class BaseTable extends EventTarget {
92
96
  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;
93
97
  if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
94
98
  this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
95
- this.version = "1.26.5", this.id = `VTable${Date.now()}`, this.isReleased = !1,
99
+ this.version = "1.26.7", this.id = `VTable${Date.now()}`, this.isReleased = !1,
96
100
  this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
97
101
  "undefined" != typeof window) {
98
102
  const g = window;
@@ -181,7 +185,7 @@ export class BaseTable extends EventTarget {
181
185
  return "node" === Env.mode ? that.canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_b = null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : that.internalProps.pixelRatio) && void 0 !== _b ? _b : window.devicePixelRatio);
182
186
  }
183
187
  }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_r = options.theme) && void 0 !== _r ? _r : themes.DEFAULT),
184
- internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
188
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
185
189
  container ? (clearDOM && (container.innerHTML = ""), container.appendChild(internalProps.element),
186
190
  this._updateSize()) : this._updateSize(), internalProps.bodyHelper = new BodyHelper(this),
187
191
  internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this),
@@ -1119,7 +1123,7 @@ export class BaseTable extends EventTarget {
1119
1123
  internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map,
1120
1124
  internalProps._colRangeWidthsMap = new Map), internalProps.stick.changedCells.clear(),
1121
1125
  internalProps.theme = themes.of(null !== (_p = options.theme) && void 0 !== _p ? _p : themes.DEFAULT),
1122
- internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle),
1126
+ internalProps.theme.isPivot = this.isPivotTable(), this._updateFunctionalIcons(),
1123
1127
  this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText,
1124
1128
  internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_q = options.allowFrozenColCount) && void 0 !== _q ? _q : 0,
1125
1129
  internalProps.limitMaxAutoWidth = null !== (_r = options.limitMaxAutoWidth) && void 0 !== _r ? _r : 450,
@@ -1392,9 +1396,12 @@ export class BaseTable extends EventTarget {
1392
1396
  const sourceMergeInfo = this.getCellRange(args.source.col, args.source.row), targetMergeInfo = this.getCellRange(args.target.col, args.target.row), colMin = Math.min(sourceMergeInfo.start.col, targetMergeInfo.start.col, oldSourceMergeInfo.start.col, oldTargetMergeInfo.start.col), colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col), rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
1393
1397
  let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
1394
1398
  if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1),
1395
- this.transpose || !this.isSeriesNumberInBody(args.source.col, args.source.row) && "row" !== args.movingColumnOrRow || (this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex),
1396
- this.stateManager.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)),
1397
- "column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col); else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
1399
+ this.isListTable() && !this.transpose && (this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow)) {
1400
+ const listTable = this, sourceRecordPath = listTable.getRecordIndexByCell(args.source.col, moveContext.sourceIndex), targetRecordPath = listTable.getRecordIndexByCell(args.target.col, moveContext.targetIndex);
1401
+ this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex), this.stateManager.changeCheckboxOrder(sourceRecordPath, targetRecordPath),
1402
+ this.stateManager.changeRadioOrder(sourceRecordPath, targetRecordPath);
1403
+ }
1404
+ if ("column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col); else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
1398
1405
  return this.clearCellStyleCache(), this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow ? this.scenegraph.updateHeaderPosition(this.scenegraph.proxy.colStart, this.scenegraph.proxy.colEnd, this.scenegraph.proxy.rowStart, this.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? this.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : this.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType),
1399
1406
  "adjustFrozenCount" === this.internalProps.frozenColDragHeaderMode && this.isListTable() && (this.isLeftFrozenColumn(args.target.col) && !this.isLeftFrozenColumn(args.source.col) ? this.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isLeftFrozenColumn(args.source.col) && !this.isLeftFrozenColumn(args.target.col) && (this.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1),
1400
1407
  this.isRightFrozenColumn(args.target.col) && !this.isRightFrozenColumn(args.source.col) ? this.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isRightFrozenColumn(args.source.col) && !this.isRightFrozenColumn(args.target.col) && (this.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)),
@@ -1444,12 +1451,18 @@ export class BaseTable extends EventTarget {
1444
1451
  this.options.autoWrapText = autoWrapText, this.scenegraph.clearCells(), this.clearCellStyleCache(),
1445
1452
  this.scenegraph.createSceneGraph(), this.render());
1446
1453
  }
1454
+ _updateFunctionalIcons() {
1455
+ var _a, _b, _c;
1456
+ setIconColor(this.internalProps.theme.functionalIconsStyle), null === (_a = this.internalProps.headerHelper) || void 0 === _a || _a.updateIcons(),
1457
+ null === (_b = this.internalProps.bodyHelper) || void 0 === _b || _b.updateIcons(),
1458
+ null === (_c = this.internalProps.rowSeriesNumberHelper) || void 0 === _c || _c.updateIcons();
1459
+ }
1447
1460
  get theme() {
1448
1461
  return this.internalProps.theme;
1449
1462
  }
1450
1463
  set theme(theme) {
1451
1464
  this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
1452
- this.options.theme = theme, setIconColor(this.internalProps.theme.functionalIconsStyle);
1465
+ this.options.theme = theme, this._updateFunctionalIcons();
1453
1466
  }
1454
1467
  updateTheme(theme) {
1455
1468
  const oldHoverState = {
@@ -1457,9 +1470,9 @@ export class BaseTable extends EventTarget {
1457
1470
  row: this.stateManager.hover.cellPos.row
1458
1471
  };
1459
1472
  this.internalProps.theme = themes.of(null != theme ? theme : themes.DEFAULT), this.internalProps.theme.isPivot = this.isPivotTable(),
1460
- setIconColor(this.internalProps.theme.functionalIconsStyle), this.options.theme = theme,
1461
- this.scenegraph.updateComponent(), this.scenegraph.updateStageBackground(), this.scenegraph.clearCells(),
1462
- this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
1473
+ this._updateFunctionalIcons(), this.options.theme = theme, this.scenegraph.updateComponent(),
1474
+ this.scenegraph.updateStageBackground(), this.scenegraph.clearCells(), this.clearCellStyleCache(),
1475
+ this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
1463
1476
  this.render();
1464
1477
  }
1465
1478
  getBodyField(col, row) {
@@ -1472,20 +1485,20 @@ export class BaseTable extends EventTarget {
1472
1485
  getBodyColumnType(col, row) {
1473
1486
  var _a, _b;
1474
1487
  const cellType = null !== (_b = null === (_a = this.internalProps.layoutMap.getBody(col, row)) || void 0 === _a ? void 0 : _a.cellType) && void 0 !== _b ? _b : "text";
1475
- return getProp("cellType", {
1488
+ return normalizeCellType(getProp("cellType", {
1476
1489
  cellType: cellType
1477
- }, col, row, this);
1490
+ }, col, row, this));
1478
1491
  }
1479
1492
  getCellType(col, row) {
1480
1493
  let cellType;
1481
1494
  if (this.isSeriesNumberInHeader(col, row)) {
1482
1495
  const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
1483
- return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
1496
+ return normalizeCellType("radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType);
1484
1497
  }
1485
1498
  return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType,
1486
- getProp("cellType", {
1499
+ normalizeCellType(getProp("cellType", {
1487
1500
  cellType: cellType
1488
- }, col, row, this);
1501
+ }, col, row, this));
1489
1502
  }
1490
1503
  getHeaderField(col, row) {
1491
1504
  return this.internalProps.layoutMap.getHeaderField(col, row);