@visactor/vtable 1.4.0-alpha.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/cjs/ListTable.js +38 -26
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +1 -3
  4. package/cjs/PivotChart.js +5 -15
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +1 -1
  7. package/cjs/PivotTable.js +40 -18
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/components/axis/axis.js +2 -3
  10. package/cjs/components/axis/axis.js.map +1 -1
  11. package/cjs/components/empty-tip/empty-tip.js +2 -2
  12. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
  14. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  15. package/cjs/components/react/react-custom-layout.d.ts +21 -0
  16. package/cjs/components/react/react-custom-layout.js +48 -0
  17. package/cjs/components/react/react-custom-layout.js.map +1 -0
  18. package/cjs/components/tooltip/TooltipHandler.js +1 -3
  19. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  20. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +7 -3
  21. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  22. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  23. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  24. package/cjs/core/BaseTable.d.ts +10 -28
  25. package/cjs/core/BaseTable.js +88 -75
  26. package/cjs/core/BaseTable.js.map +1 -1
  27. package/cjs/core/FouseInput.d.ts +0 -1
  28. package/cjs/core/FouseInput.js +2 -5
  29. package/cjs/core/FouseInput.js.map +1 -1
  30. package/cjs/core/style.js +1 -1
  31. package/cjs/core/style.js.map +1 -1
  32. package/cjs/data/DataSource.d.ts +6 -1
  33. package/cjs/data/DataSource.js +12 -2
  34. package/cjs/data/DataSource.js.map +1 -1
  35. package/cjs/dataset/dataset.d.ts +17 -2
  36. package/cjs/dataset/dataset.js +195 -79
  37. package/cjs/dataset/dataset.js.map +1 -1
  38. package/cjs/dataset/statistics-helper.d.ts +43 -3
  39. package/cjs/dataset/statistics-helper.js +61 -26
  40. package/cjs/dataset/statistics-helper.js.map +1 -1
  41. package/cjs/event/event.js +1 -2
  42. package/cjs/event/event.js.map +1 -1
  43. package/cjs/event/listener/container-dom.js +4 -3
  44. package/cjs/event/listener/container-dom.js.map +1 -1
  45. package/cjs/event/listener/table-group.js +7 -5
  46. package/cjs/event/listener/table-group.js.map +1 -1
  47. package/cjs/event/util.js +2 -2
  48. package/cjs/event/util.js.map +1 -1
  49. package/cjs/index.d.ts +3 -1
  50. package/cjs/index.js +13 -4
  51. package/cjs/index.js.map +1 -1
  52. package/cjs/layout/layout-helper.js.map +1 -1
  53. package/cjs/layout/pivot-header-layout.d.ts +1 -0
  54. package/cjs/layout/pivot-header-layout.js +66 -39
  55. package/cjs/layout/pivot-header-layout.js.map +1 -1
  56. package/cjs/layout/row-height-map.js +1 -0
  57. package/cjs/layout/row-height-map.js.map +1 -1
  58. package/cjs/scenegraph/component/custom.js +6 -4
  59. package/cjs/scenegraph/component/custom.js.map +1 -1
  60. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
  61. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  62. package/cjs/scenegraph/graphic/chart.d.ts +0 -1
  63. package/cjs/scenegraph/graphic/chart.js +20 -34
  64. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  65. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  66. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  67. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  68. package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
  69. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  70. package/cjs/scenegraph/group-creater/cell-helper.js +6 -2
  71. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  72. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  73. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  74. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  75. package/cjs/scenegraph/group-creater/progress/proxy.js +10 -10
  76. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  77. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  78. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  79. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  80. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  81. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -14
  82. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  83. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  84. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  85. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  86. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  87. package/cjs/scenegraph/layout/compute-row-height.js +7 -4
  88. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  89. package/cjs/scenegraph/layout/frozen.js +12 -4
  90. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  91. package/cjs/scenegraph/layout/update-width.js +3 -0
  92. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  93. package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
  94. package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
  95. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  96. package/cjs/scenegraph/scenegraph.d.ts +2 -1
  97. package/cjs/scenegraph/scenegraph.js +18 -15
  98. package/cjs/scenegraph/scenegraph.js.map +1 -1
  99. package/cjs/state/cell-move/index.js +1 -1
  100. package/cjs/state/cell-move/index.js.map +1 -1
  101. package/cjs/state/sort/index.js +2 -2
  102. package/cjs/state/sort/index.js.map +1 -1
  103. package/cjs/themes/theme.js +6 -0
  104. package/cjs/themes/theme.js.map +1 -1
  105. package/cjs/ts-types/base-table.d.ts +20 -40
  106. package/cjs/ts-types/base-table.js.map +1 -1
  107. package/cjs/ts-types/customLayout.d.ts +1 -1
  108. package/cjs/ts-types/customLayout.js.map +1 -1
  109. package/cjs/ts-types/icon.d.ts +2 -0
  110. package/cjs/ts-types/icon.js.map +1 -1
  111. package/cjs/ts-types/new-data-set.d.ts +9 -1
  112. package/cjs/ts-types/new-data-set.js +1 -1
  113. package/cjs/ts-types/new-data-set.js.map +1 -1
  114. package/cjs/ts-types/pivot-table/corner.d.ts +12 -0
  115. package/cjs/ts-types/pivot-table/corner.js.map +1 -1
  116. package/cjs/ts-types/table-engine.d.ts +12 -0
  117. package/cjs/ts-types/table-engine.js.map +1 -1
  118. package/cjs/ts-types/theme.d.ts +2 -0
  119. package/cjs/ts-types/theme.js.map +1 -1
  120. package/cjs/ts-types/tooltip.d.ts +2 -0
  121. package/cjs/ts-types/tooltip.js.map +1 -1
  122. package/cjs/vrender.d.ts +4 -0
  123. package/cjs/vrender.js +39 -11
  124. package/cjs/vrender.js.map +1 -1
  125. package/dist/vtable.js +25679 -9801
  126. package/dist/vtable.min.js +2 -2
  127. package/es/ListTable.js +34 -23
  128. package/es/ListTable.js.map +1 -1
  129. package/es/PivotChart.d.ts +1 -3
  130. package/es/PivotChart.js +8 -17
  131. package/es/PivotChart.js.map +1 -1
  132. package/es/PivotTable.d.ts +1 -1
  133. package/es/PivotTable.js +41 -19
  134. package/es/PivotTable.js.map +1 -1
  135. package/es/components/axis/axis.js +1 -3
  136. package/es/components/axis/axis.js.map +1 -1
  137. package/es/components/empty-tip/empty-tip.js +2 -2
  138. package/es/components/empty-tip/empty-tip.js.map +1 -1
  139. package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
  140. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  141. package/es/components/react/react-custom-layout.d.ts +21 -0
  142. package/es/components/react/react-custom-layout.js +38 -0
  143. package/es/components/react/react-custom-layout.js.map +1 -0
  144. package/es/components/tooltip/TooltipHandler.js +1 -3
  145. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  146. package/es/components/tooltip/logic/BubbleTooltipElement.js +7 -3
  147. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  148. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  149. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  150. package/es/core/BaseTable.d.ts +10 -28
  151. package/es/core/BaseTable.js +90 -74
  152. package/es/core/BaseTable.js.map +1 -1
  153. package/es/core/FouseInput.d.ts +0 -1
  154. package/es/core/FouseInput.js +2 -5
  155. package/es/core/FouseInput.js.map +1 -1
  156. package/es/core/style.js +1 -1
  157. package/es/core/style.js.map +1 -1
  158. package/es/data/DataSource.d.ts +6 -1
  159. package/es/data/DataSource.js +12 -2
  160. package/es/data/DataSource.js.map +1 -1
  161. package/es/dataset/dataset.d.ts +17 -2
  162. package/es/dataset/dataset.js +195 -80
  163. package/es/dataset/dataset.js.map +1 -1
  164. package/es/dataset/statistics-helper.d.ts +43 -3
  165. package/es/dataset/statistics-helper.js +55 -23
  166. package/es/dataset/statistics-helper.js.map +1 -1
  167. package/es/event/event.js +1 -2
  168. package/es/event/event.js.map +1 -1
  169. package/es/event/listener/container-dom.js +4 -3
  170. package/es/event/listener/container-dom.js.map +1 -1
  171. package/es/event/listener/table-group.js +7 -5
  172. package/es/event/listener/table-group.js.map +1 -1
  173. package/es/event/util.js +2 -2
  174. package/es/event/util.js.map +1 -1
  175. package/es/index.d.ts +3 -1
  176. package/es/index.js +5 -1
  177. package/es/index.js.map +1 -1
  178. package/es/layout/layout-helper.js.map +1 -1
  179. package/es/layout/pivot-header-layout.d.ts +1 -0
  180. package/es/layout/pivot-header-layout.js +65 -37
  181. package/es/layout/pivot-header-layout.js.map +1 -1
  182. package/es/layout/row-height-map.js +1 -0
  183. package/es/layout/row-height-map.js.map +1 -1
  184. package/es/scenegraph/component/custom.js +7 -3
  185. package/es/scenegraph/component/custom.js.map +1 -1
  186. package/es/scenegraph/debug-tool/debug-tool.js +1 -4
  187. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  188. package/es/scenegraph/graphic/chart.d.ts +0 -1
  189. package/es/scenegraph/graphic/chart.js +21 -33
  190. package/es/scenegraph/graphic/chart.js.map +1 -1
  191. package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  192. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  193. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  194. package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
  195. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  196. package/es/scenegraph/group-creater/cell-helper.js +6 -2
  197. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  198. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  199. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  200. package/es/scenegraph/group-creater/progress/proxy.d.ts +3 -2
  201. package/es/scenegraph/group-creater/progress/proxy.js +10 -10
  202. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  203. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -1
  204. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -3
  205. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  206. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +3 -2
  207. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +15 -13
  208. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  209. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +7 -5
  210. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  211. package/es/scenegraph/layout/compute-col-width.js +3 -3
  212. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  213. package/es/scenegraph/layout/compute-row-height.js +8 -5
  214. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  215. package/es/scenegraph/layout/frozen.js +12 -4
  216. package/es/scenegraph/layout/frozen.js.map +1 -1
  217. package/es/scenegraph/layout/update-width.js +3 -0
  218. package/es/scenegraph/layout/update-width.js.map +1 -1
  219. package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
  220. package/es/scenegraph/refresh-node/update-chart.js +0 -6
  221. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  222. package/es/scenegraph/scenegraph.d.ts +2 -1
  223. package/es/scenegraph/scenegraph.js +18 -15
  224. package/es/scenegraph/scenegraph.js.map +1 -1
  225. package/es/state/cell-move/index.js +1 -1
  226. package/es/state/cell-move/index.js.map +1 -1
  227. package/es/state/sort/index.js +2 -2
  228. package/es/state/sort/index.js.map +1 -1
  229. package/es/themes/theme.js +6 -0
  230. package/es/themes/theme.js.map +1 -1
  231. package/es/ts-types/base-table.d.ts +20 -40
  232. package/es/ts-types/base-table.js.map +1 -1
  233. package/es/ts-types/customLayout.d.ts +1 -1
  234. package/es/ts-types/customLayout.js.map +1 -1
  235. package/es/ts-types/icon.d.ts +2 -0
  236. package/es/ts-types/icon.js.map +1 -1
  237. package/es/ts-types/new-data-set.d.ts +9 -1
  238. package/es/ts-types/new-data-set.js +1 -1
  239. package/es/ts-types/new-data-set.js.map +1 -1
  240. package/es/ts-types/pivot-table/corner.d.ts +12 -0
  241. package/es/ts-types/pivot-table/corner.js.map +1 -1
  242. package/es/ts-types/table-engine.d.ts +12 -0
  243. package/es/ts-types/table-engine.js.map +1 -1
  244. package/es/ts-types/theme.d.ts +2 -0
  245. package/es/ts-types/theme.js.map +1 -1
  246. package/es/ts-types/tooltip.d.ts +2 -0
  247. package/es/ts-types/tooltip.js.map +1 -1
  248. package/es/vrender.d.ts +4 -0
  249. package/es/vrender.js +9 -3
  250. package/es/vrender.js.map +1 -1
  251. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,WAAW,EAAE,CAAC;AACd,MAAM,aAAa,GAAG,gCAAgC,CAAC;AACvD,MAAM,aAAa,GAAG,GAAG,aAAa,WAAW,CAAC;AAClD,MAAM,cAAc,GAAG,GAAG,aAAa,YAAY,CAAC;AACpD,MAAM,YAAY,GAAG,GAAG,aAAa,UAAU,CAAC;AAChD,MAAM,WAAW,GAAG,GAAG,aAAa,SAAS,CAAC;AAE9C,MAAM,OAAO,oBAAoB;IAO/B;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9F,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzD,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAClC,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,eAAe,GAAgB,WAA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C/C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,IAAI,CAAC;IAChD,CAAC;CACF","file":"BubbleTooltipElement.js","sourcesContent":["import { EventHandler } from '../../../event/EventHandler';\nimport type { RectProps } from '../../../ts-types';\nimport { Placement } from '../../../ts-types';\nimport { createElement } from '../../../tools/dom';\nimport { importStyle } from './BubbleTooltipElementStyle';\nimport { isMobile } from '../../../tools/util';\nimport type { TooltipOptions } from '../../../ts-types/tooltip';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimportStyle();\nconst TOOLTIP_CLASS = 'vtable__bubble-tooltip-element';\nconst CONTENT_CLASS = `${TOOLTIP_CLASS}__content`;\nconst TRIANGLE_CLASS = `${TOOLTIP_CLASS}__triangle`;\nconst HIDDEN_CLASS = `${TOOLTIP_CLASS}--hidden`;\nconst SHOWN_CLASS = `${TOOLTIP_CLASS}--shown`;\n\nexport class BubbleTooltipElement {\n private _handler: EventHandler;\n private _rootElement?: HTMLElement;\n private _messageElement?: HTMLElement;\n private _triangleElement?: HTMLElement;\n private _disappearDelay?: number; // 提示框延迟多久消失\n private _disappearDelayId?: any;\n constructor() {\n this._handler = new EventHandler();\n const rootElement = (this._rootElement = createElement('div', [TOOLTIP_CLASS, HIDDEN_CLASS]));\n const messageElement = createElement('span', [CONTENT_CLASS]);\n const triangle = createElement('span', [TRIANGLE_CLASS]);\n rootElement.appendChild(triangle);\n rootElement.appendChild(messageElement);\n this._messageElement = <HTMLElement>rootElement.querySelector(`.${CONTENT_CLASS}`) || undefined;\n this._triangleElement = <HTMLElement>rootElement.querySelector(`.${TRIANGLE_CLASS}`) || undefined;\n\n rootElement.addEventListener('mousemove', () => {\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n });\n rootElement.addEventListener('mouseleave', () => {\n this._disappearDelay = undefined;\n this.unbindFromCell();\n });\n }\n bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n tooltipInstanceInfo: TooltipOptions,\n confine: boolean\n ): boolean {\n this._disappearDelay = tooltipInstanceInfo?.disappearDelay;\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n const rootElement = this._rootElement;\n const messageElement = this._messageElement;\n const triangle = this._triangleElement;\n\n rootElement?.classList.remove(SHOWN_CLASS);\n rootElement?.classList.add(HIDDEN_CLASS);\n if (this._canBindToCell(table, col, row)) {\n //设置style及类名\n messageElement.setAttribute('style', '');\n triangle.setAttribute('style', '');\n tooltipInstanceInfo?.className && rootElement.classList.add(tooltipInstanceInfo.className);\n tooltipInstanceInfo?.style?.bgColor &&\n (messageElement.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n tooltipInstanceInfo?.style?.bgColor && (triangle.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n triangle.style.display = tooltipInstanceInfo?.style?.arrowMark === true ? 'block' : 'none';\n tooltipInstanceInfo?.style?.fontSize &&\n (messageElement.style.fontSize = (tooltipInstanceInfo?.style?.fontSize ?? 12) + 'px');\n tooltipInstanceInfo?.style?.fontFamily &&\n (messageElement.style.fontFamily = tooltipInstanceInfo?.style?.fontFamily);\n tooltipInstanceInfo?.style?.color && (messageElement.style.color = tooltipInstanceInfo?.style?.color);\n tooltipInstanceInfo?.style?.padding &&\n (messageElement.style.padding = `${tooltipInstanceInfo?.style?.padding.join('px ')}px`);\n messageElement && (messageElement.textContent = tooltipInstanceInfo?.content);\n const binded = this._bindToCell(\n table,\n col,\n row,\n tooltipInstanceInfo?.position,\n tooltipInstanceInfo?.referencePosition,\n confine,\n tooltipInstanceInfo?.style?.arrowMark\n );\n if (binded) {\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n return true;\n }\n } else {\n this.unbindFromCell();\n }\n return false;\n }\n release(): void {\n this.unbindFromCell();\n\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.parentElement.removeChild(rootElement);\n }\n\n this._handler?.release?.();\n delete this._rootElement;\n delete this._messageElement;\n }\n move(table: BaseTableAPI, col: number, row: number, tooltipOptions?: TooltipOptions, confine?: boolean): void {\n const rootElement = this._rootElement;\n if (this._canBindToCell(table, col, row)) {\n this._bindToCell(table, col, row, tooltipOptions?.position, tooltipOptions?.referencePosition, confine);\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n } else {\n this.unbindFromCell();\n }\n }\n unbindFromCell(): void {\n if (this._disappearDelay) {\n this._disappearDelayId = setTimeout(() => {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }, this._disappearDelay ?? 0);\n } else {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }\n }\n _canBindToCell(table: BaseTableAPI, col: number, row: number): boolean {\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const { bottom, left, right, top } = rect;\n // const { frozenRowCount, frozenColCount } = table;\n // if (row >= frozenRowCount && frozenRowCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col, row: frozenRowCount - 1 });\n // if (bottom < frozenRect.bottom) {\n // // 范围外\n // return false;\n // }\n // } else if (bottom < 0) {\n // // 范围外\n // return false;\n // }\n // if (col >= frozenColCount && frozenColCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col: frozenColCount - 1, row });\n // if (right < frozenRect.right) {\n // //整个是被冻结列盖住的 不需要提示toolTip\n // return false;\n // }\n // } else if (left < 0) {\n // return false;\n // }\n\n if (table.isFrozenCell(col, row)) {\n return true;\n } else if (\n bottom < table.getFrozenRowsHeight() ||\n right < table.getFrozenColsWidth() ||\n left > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ||\n top > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()\n ) {\n // 范围外\n return false;\n }\n const { offsetHeight, offsetWidth } = element;\n if (top > offsetHeight) {\n return false;\n }\n if (left > offsetWidth) {\n return false;\n }\n return true;\n }\n _bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ): boolean {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const containerWidth = table.internalProps.element.offsetWidth;\n const { width } = rect;\n if (rootElement) {\n if (rootElement.parentElement !== element) {\n element.appendChild(rootElement);\n }\n rootElement.style.left = `0px`;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n if (position || referencePosition) {\n const tooltipPosition = this.getComputedPosition(\n table,\n col,\n row,\n position,\n referencePosition,\n confine,\n arrowMark\n );\n tooltipX = tooltipPosition.x;\n tooltipY = tooltipPosition.y;\n } else {\n return false;\n }\n\n rootElement.style.left = `${tooltipX}px`;\n rootElement.style.top = `${tooltipY}px`;\n // rootElement.style.width=rootElementWidth+'px';\n if (isMobile()) {\n rootElement.style.fontSize = '11px';\n }\n\n // 判断当前tooltip范围是否与tooltip重合\n const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;\n const tooltipLeft = tooltipX;\n const tooltipRight = tooltipLeft + rootElementWidth;\n const tooltipTop = tooltipY;\n const tooltipBottom = tooltipLeft + rootElementHeight;\n if (\n table.stateManager.menu.isShow &&\n menuLeft < tooltipRight &&\n menuRight > tooltipLeft &&\n menuBottom > tooltipTop &&\n menuTop < tooltipBottom\n ) {\n return false;\n }\n return true;\n }\n return false;\n }\n private getComputedPosition(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ) {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const { width: containerWidth, height: containerHeight } = table.internalProps.element.getBoundingClientRect();\n const { width } = rect;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n // this._triangleElement.setAttribute('style', '');\n const triangleHeight = arrowMark ? 6 : 0;\n if (position) {\n tooltipX = position.x;\n tooltipY = position.y + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n } else if (referencePosition) {\n let placement = referencePosition.placement ?? Placement.bottom;\n const referenceXMiddle = referencePosition.rect.left + referencePosition.rect.width / 2;\n const referenceYMiddle = referencePosition.rect.top + referencePosition.rect.height / 2;\n const referenceTop = referencePosition.rect.top;\n const referenceBottom = referencePosition.rect.bottom;\n const referenceLeft = referencePosition.rect.left;\n const referenceRight = referencePosition.rect.right;\n\n let callCount = 0;\n /** 根据placement计算弹出框的位置 躲避策略[dom的这块先去除 dom可以超出显示]:根据顺时针方向依次检测placement */\n const adjustPosition = () => {\n callCount++;\n if (callCount >= 4) {\n return;\n }\n this.removeStyleFromTriangle();\n if (placement === Placement.top) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceTop - rootElementHeight - triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.bottom = '-5px';\n\n // 判断如果超出左右范围则靠边显示\n if (confine && tooltipY < 0) {\n placement = Placement.right;\n adjustPosition();\n }\n } else if (placement === Placement.bottom) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceBottom + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n if (confine && tooltipY + rootElementHeight > containerHeight) {\n placement = Placement.left;\n adjustPosition();\n }\n } else if (placement === Placement.left) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceLeft - rootElementWidth - triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.right = '-5px';\n if (confine && tooltipX < 0) {\n placement = Placement.top;\n adjustPosition();\n }\n } else if (placement === Placement.right) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceRight + triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.left = '-5px';\n if (confine && tooltipX + rootElementWidth > containerWidth) {\n placement = Placement.bottom;\n adjustPosition();\n }\n }\n };\n adjustPosition();\n }\n // 判断如果超出左右范围则靠边显示\n if (confine) {\n if (tooltipX < 0) {\n tooltipX = 0;\n } else if (tooltipX + rootElement.offsetWidth > containerWidth) {\n tooltipX = containerWidth - rootElement.offsetWidth;\n }\n }\n return {\n x: tooltipX,\n y: tooltipY\n };\n }\n private removeStyleFromTriangle() {\n this._triangleElement.style.left = '';\n this._triangleElement.style.right = '';\n this._triangleElement.style.top = '';\n this._triangleElement.style.bottom = '';\n this._triangleElement.style.marginLeft = '';\n this._triangleElement.style.marginTop = '';\n }\n _locate(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n },\n confine?: boolean\n ) {\n const tooltipPosition = this.getComputedPosition(table, col, row, position, referencePosition, confine);\n const tooltipX = tooltipPosition.x;\n const tooltipY = tooltipPosition.y;\n this._rootElement.style.left = `${tooltipX}px`;\n this._rootElement.style.top = `${tooltipY}px`;\n }\n}\n"]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K,CAAC,SAAS,GAAG,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,CACL,KAAmB,EACnB,GAAW,EACX,GAAW,EACX,QAAmC,EACnC,iBAGC,EACD,OAAiB;QAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACxG,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,IAAI,CAAC;QAC/C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,IAAI,CAAC;IAChD,CAAC;CACF","file":"BubbleTooltipElement.js","sourcesContent":["import { EventHandler } from '../../../event/EventHandler';\nimport type { RectProps } from '../../../ts-types';\nimport { Placement } from '../../../ts-types';\nimport { createElement } from '../../../tools/dom';\nimport { importStyle } from './BubbleTooltipElementStyle';\nimport { isMobile } from '../../../tools/util';\nimport type { TooltipOptions } from '../../../ts-types/tooltip';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimportStyle();\nconst TOOLTIP_CLASS = 'vtable__bubble-tooltip-element';\nconst CONTENT_CLASS = `${TOOLTIP_CLASS}__content`;\nconst TRIANGLE_CLASS = `${TOOLTIP_CLASS}__triangle`;\nconst HIDDEN_CLASS = `${TOOLTIP_CLASS}--hidden`;\nconst SHOWN_CLASS = `${TOOLTIP_CLASS}--shown`;\n\nexport class BubbleTooltipElement {\n private _handler: EventHandler;\n private _rootElement?: HTMLElement;\n private _messageElement?: HTMLElement;\n private _triangleElement?: HTMLElement;\n private _disappearDelay?: number; // 提示框延迟多久消失\n private _disappearDelayId?: any;\n constructor() {\n this._handler = new EventHandler();\n const rootElement = (this._rootElement = createElement('div', [TOOLTIP_CLASS, HIDDEN_CLASS]));\n const messageElement = createElement('div', [CONTENT_CLASS]);\n const triangle = createElement('span', [TRIANGLE_CLASS]);\n rootElement.appendChild(triangle);\n rootElement.appendChild(messageElement);\n this._messageElement = <HTMLElement>rootElement.querySelector(`.${CONTENT_CLASS}`) || undefined;\n this._triangleElement = <HTMLElement>rootElement.querySelector(`.${TRIANGLE_CLASS}`) || undefined;\n\n rootElement.addEventListener('mousemove', () => {\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n });\n rootElement.addEventListener('mouseleave', () => {\n this._disappearDelay = undefined;\n this.unbindFromCell();\n });\n\n messageElement.addEventListener('wheel', e => {\n e.stopPropagation();\n });\n }\n bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n tooltipInstanceInfo: TooltipOptions,\n confine: boolean\n ): boolean {\n this._disappearDelay = tooltipInstanceInfo?.disappearDelay;\n this._disappearDelayId && clearTimeout(this._disappearDelayId);\n const rootElement = this._rootElement;\n const messageElement = this._messageElement;\n const triangle = this._triangleElement;\n\n rootElement?.classList.remove(SHOWN_CLASS);\n rootElement?.classList.add(HIDDEN_CLASS);\n if (this._canBindToCell(table, col, row)) {\n //设置style及类名\n messageElement.setAttribute('style', '');\n triangle.setAttribute('style', '');\n tooltipInstanceInfo?.className && rootElement.classList.add(tooltipInstanceInfo.className);\n tooltipInstanceInfo?.style?.bgColor &&\n (messageElement.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n tooltipInstanceInfo?.style?.bgColor && (triangle.style.backgroundColor = tooltipInstanceInfo?.style?.bgColor);\n triangle.style.display = tooltipInstanceInfo?.style?.arrowMark === true ? 'block' : 'none';\n tooltipInstanceInfo?.style?.fontSize &&\n (messageElement.style.fontSize = (tooltipInstanceInfo?.style?.fontSize ?? 12) + 'px');\n tooltipInstanceInfo?.style?.fontFamily &&\n (messageElement.style.fontFamily = tooltipInstanceInfo?.style?.fontFamily);\n tooltipInstanceInfo?.style?.color && (messageElement.style.color = tooltipInstanceInfo?.style?.color);\n tooltipInstanceInfo?.style?.padding &&\n (messageElement.style.padding = `${tooltipInstanceInfo?.style?.padding.join('px ')}px`);\n tooltipInstanceInfo?.style?.maxHeight &&\n (messageElement.style.maxHeight = `${tooltipInstanceInfo?.style?.maxHeight}px`);\n tooltipInstanceInfo?.style?.maxWidth &&\n (messageElement.style.maxWidth = `${tooltipInstanceInfo?.style?.maxWidth}px`);\n messageElement && (messageElement.textContent = tooltipInstanceInfo?.content);\n const binded = this._bindToCell(\n table,\n col,\n row,\n tooltipInstanceInfo?.position,\n tooltipInstanceInfo?.referencePosition,\n confine,\n tooltipInstanceInfo?.style?.arrowMark\n );\n if (binded) {\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n return true;\n }\n } else {\n this.unbindFromCell();\n }\n return false;\n }\n release(): void {\n this.unbindFromCell();\n\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.parentElement.removeChild(rootElement);\n }\n\n this._handler?.release?.();\n delete this._rootElement;\n delete this._messageElement;\n }\n move(table: BaseTableAPI, col: number, row: number, tooltipOptions?: TooltipOptions, confine?: boolean): void {\n const rootElement = this._rootElement;\n if (this._canBindToCell(table, col, row)) {\n this._bindToCell(table, col, row, tooltipOptions?.position, tooltipOptions?.referencePosition, confine);\n rootElement?.classList.add(SHOWN_CLASS);\n rootElement?.classList.remove(HIDDEN_CLASS);\n } else {\n this.unbindFromCell();\n }\n }\n unbindFromCell(): void {\n if (this._disappearDelay) {\n this._disappearDelayId = setTimeout(() => {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }, this._disappearDelay ?? 0);\n } else {\n const rootElement = this._rootElement;\n if (rootElement?.parentElement) {\n rootElement.classList.remove(SHOWN_CLASS);\n rootElement.classList.add(HIDDEN_CLASS);\n }\n }\n }\n _canBindToCell(table: BaseTableAPI, col: number, row: number): boolean {\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const { bottom, left, right, top } = rect;\n // const { frozenRowCount, frozenColCount } = table;\n // if (row >= frozenRowCount && frozenRowCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col, row: frozenRowCount - 1 });\n // if (bottom < frozenRect.bottom) {\n // // 范围外\n // return false;\n // }\n // } else if (bottom < 0) {\n // // 范围外\n // return false;\n // }\n // if (col >= frozenColCount && frozenColCount > 0) {\n // const frozenRect = table.getCellRangeRelativeRect({ col: frozenColCount - 1, row });\n // if (right < frozenRect.right) {\n // //整个是被冻结列盖住的 不需要提示toolTip\n // return false;\n // }\n // } else if (left < 0) {\n // return false;\n // }\n\n if (table.isFrozenCell(col, row)) {\n return true;\n } else if (\n bottom < table.getFrozenRowsHeight() ||\n right < table.getFrozenColsWidth() ||\n left > table.tableNoFrameWidth - table.getRightFrozenColsWidth() ||\n top > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()\n ) {\n // 范围外\n return false;\n }\n const { offsetHeight, offsetWidth } = element;\n if (top > offsetHeight) {\n return false;\n }\n if (left > offsetWidth) {\n return false;\n }\n return true;\n }\n _bindToCell(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ): boolean {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const element = table.getElement();\n const containerWidth = table.internalProps.element.offsetWidth;\n const { width } = rect;\n if (rootElement) {\n if (rootElement.parentElement !== element) {\n element.appendChild(rootElement);\n }\n rootElement.style.left = `0px`;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n if (position || referencePosition) {\n const tooltipPosition = this.getComputedPosition(\n table,\n col,\n row,\n position,\n referencePosition,\n confine,\n arrowMark\n );\n tooltipX = tooltipPosition.x;\n tooltipY = tooltipPosition.y;\n } else {\n return false;\n }\n\n rootElement.style.left = `${tooltipX}px`;\n rootElement.style.top = `${tooltipY}px`;\n // rootElement.style.width=rootElementWidth+'px';\n if (isMobile()) {\n rootElement.style.fontSize = '11px';\n }\n\n // 判断当前tooltip范围是否与tooltip重合\n const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;\n const tooltipLeft = tooltipX;\n const tooltipRight = tooltipLeft + rootElementWidth;\n const tooltipTop = tooltipY;\n const tooltipBottom = tooltipLeft + rootElementHeight;\n if (\n table.stateManager.menu.isShow &&\n menuLeft < tooltipRight &&\n menuRight > tooltipLeft &&\n menuBottom > tooltipTop &&\n menuTop < tooltipBottom\n ) {\n return false;\n }\n return true;\n }\n return false;\n }\n private getComputedPosition(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: { rect: RectProps; placement?: Placement },\n confine?: boolean,\n arrowMark?: boolean\n ) {\n const rootElement = this._rootElement;\n const rect = table.getCellRangeRelativeRect({ col, row });\n const { width: containerWidth, height: containerHeight } = table.internalProps.element.getBoundingClientRect();\n const { width } = rect;\n // 边界碰撞检测\n let tooltipY: number;\n let tooltipX: number;\n //设置最宽尺寸\n const maxWidth = Math.min(containerWidth * 0.8, width * 4);\n rootElement.style.maxWidth = `${maxWidth}px`;\n //计算弹出框的宽度\n const rootElementWidth = rootElement.clientWidth; //Math.min(Math.max(rootElement.clientWidth, width), maxWidth);\n const rootElementHeight = rootElement.clientHeight;\n // this._triangleElement.setAttribute('style', '');\n const triangleHeight = arrowMark ? 6 : 0;\n if (position) {\n tooltipX = position.x;\n tooltipY = position.y + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n } else if (referencePosition) {\n let placement = referencePosition.placement ?? Placement.bottom;\n const referenceXMiddle = referencePosition.rect.left + referencePosition.rect.width / 2;\n const referenceYMiddle = referencePosition.rect.top + referencePosition.rect.height / 2;\n const referenceTop = referencePosition.rect.top;\n const referenceBottom = referencePosition.rect.bottom;\n const referenceLeft = referencePosition.rect.left;\n const referenceRight = referencePosition.rect.right;\n\n let callCount = 0;\n /** 根据placement计算弹出框的位置 躲避策略[dom的这块先去除 dom可以超出显示]:根据顺时针方向依次检测placement */\n const adjustPosition = () => {\n callCount++;\n if (callCount >= 4) {\n return;\n }\n this.removeStyleFromTriangle();\n if (placement === Placement.top) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceTop - rootElementHeight - triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.bottom = '-5px';\n\n // 判断如果超出左右范围则靠边显示\n if (confine && tooltipY < 0) {\n placement = Placement.right;\n adjustPosition();\n }\n } else if (placement === Placement.bottom) {\n tooltipX = referenceXMiddle - rootElementWidth / 2;\n tooltipY = referenceBottom + triangleHeight;\n this._triangleElement.style.left = '50%';\n this._triangleElement.style.marginLeft = '-5px';\n this._triangleElement.style.top = '-5px';\n if (confine && tooltipY + rootElementHeight > containerHeight) {\n placement = Placement.left;\n adjustPosition();\n }\n } else if (placement === Placement.left) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceLeft - rootElementWidth - triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.right = '-5px';\n if (confine && tooltipX < 0) {\n placement = Placement.top;\n adjustPosition();\n }\n } else if (placement === Placement.right) {\n tooltipY = referenceYMiddle - rootElementHeight / 2;\n tooltipX = referenceRight + triangleHeight;\n this._triangleElement.style.top = '50%';\n this._triangleElement.style.marginTop = '-5px';\n this._triangleElement.style.left = '-5px';\n if (confine && tooltipX + rootElementWidth > containerWidth) {\n placement = Placement.bottom;\n adjustPosition();\n }\n }\n };\n adjustPosition();\n }\n // 判断如果超出左右范围则靠边显示\n if (confine) {\n if (tooltipX < 0) {\n tooltipX = 0;\n } else if (tooltipX + rootElement.offsetWidth > containerWidth) {\n tooltipX = containerWidth - rootElement.offsetWidth;\n }\n }\n return {\n x: tooltipX,\n y: tooltipY\n };\n }\n private removeStyleFromTriangle() {\n this._triangleElement.style.left = '';\n this._triangleElement.style.right = '';\n this._triangleElement.style.top = '';\n this._triangleElement.style.bottom = '';\n this._triangleElement.style.marginLeft = '';\n this._triangleElement.style.marginTop = '';\n }\n _locate(\n table: BaseTableAPI,\n col: number,\n row: number,\n position?: { x: number; y: number },\n referencePosition?: {\n rect: RectProps;\n placement?: Placement;\n },\n confine?: boolean\n ) {\n const tooltipPosition = this.getComputedPosition(table, col, row, position, referencePosition, confine);\n const tooltipX = tooltipPosition.x;\n const tooltipY = tooltipPosition.y;\n this._rootElement.style.left = `${tooltipX}px`;\n this._rootElement.style.top = `${tooltipY}px`;\n }\n}\n"]}
@@ -3,7 +3,7 @@ import { Env } from "../../../tools/env";
3
3
  export function importStyle() {
4
4
  if ("node" === Env.mode) return;
5
5
  const styleElement = document.createElement("style");
6
- styleElement.id = "vtable-tooltip-styleSheet", styleElement.textContent = "\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",
6
+ styleElement.id = "vtable-tooltip-styleSheet", styleElement.textContent = "\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",
7
7
  document.head.appendChild(styleElement);
8
8
  }
9
9
  //# sourceMappingURL=BubbleTooltipElementStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElementStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,UAAU,WAAW;IACzB,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;QACvB,OAAO;KACR;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,GAAG,2BAA2B,CAAC;IAC9C,YAAY,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE5B,CAAC;IAEA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC","file":"BubbleTooltipElementStyle.js","sourcesContent":["import { Env } from '../../../tools/env';\n\nexport function importStyle() {\n if (Env.mode === 'node') {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.id = 'vtable-tooltip-styleSheet';\n styleElement.textContent = `\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n`;\n\n document.head.appendChild(styleElement);\n}\n"]}
1
+ {"version":3,"sources":["../src/components/tooltip/logic/BubbleTooltipElementStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,UAAU,WAAW;IACzB,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE;QACvB,OAAO;KACR;IACD,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,GAAG,2BAA2B,CAAC;IAC9C,YAAY,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoF5B,CAAC;IAEA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC","file":"BubbleTooltipElementStyle.js","sourcesContent":["import { Env } from '../../../tools/env';\n\nexport function importStyle() {\n if (Env.mode === 'node') {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.id = 'vtable-tooltip-styleSheet';\n styleElement.textContent = `\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n`;\n\n document.head.appendChild(styleElement);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type CellAddress, type CellRange, type TableEventHandlersEventArgumentMap, type TableEventHandlersReturnMap, type TableKeyboardOptions, type DropDownMenuHighlightInfo, type MenuListItem, type WidthModeDef, type ICustomRender, type ICellHeaderPaths, type HeaderData, type FullExtendStyle, type FieldDef, type ColumnTypeOption, type SortState, type IPagination, type ICustomLayout, type CellInfo, type CellStyle, type DropDownMenuOptions, type FieldData, type MaybePromiseOrUndefined, type MousePointerCellEvent, type DropDownMenuEventInfo, type HierarchyState, type FieldKeyDef, type CellLocation, type LayoutObjectId, type HeightModeDef, type ITableThemeDefine } from '../ts-types';
2
- import type { AnyFunction, CellAddressWithBound, ColumnIconOption, ColumnSeriesNumber, IRowSeriesNumber, ColumnStyleOption, TableEventOptions, WidthAdaptiveModeDef, HeightAdaptiveModeDef } from '../ts-types';
2
+ import type { AnyFunction, CellAddressWithBound, ColumnIconOption, ColumnSeriesNumber, IRowSeriesNumber, ColumnStyleOption, TableEventOptions, WidthAdaptiveModeDef, HeightAdaptiveModeDef, ColumnInfo, RowInfo } from '../ts-types';
3
3
  import { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';
4
4
  import { EventTarget } from '../event/EventTarget';
5
5
  import { NumberMap } from '../tools/NumberMap';
@@ -9,7 +9,6 @@ import { Scenegraph } from '../scenegraph/scenegraph';
9
9
  import { StateManager } from '../state/state';
10
10
  import { EventManager } from '../event/event';
11
11
  import type { CachedDataSource, DataSource } from '../data';
12
- import type { IBoundsLike } from '@visactor/vutils';
13
12
  import { AABBBounds, type ITextSize } from '@visactor/vutils';
14
13
  import type { ColumnData, ColumnDefine, ColumnsDefine, IndicatorData, SeriesNumberColumnData } from '../ts-types/list-table/layout-map/api';
15
14
  import type { TooltipOptions } from '../ts-types/tooltip';
@@ -18,6 +17,7 @@ import { DataSet } from '@visactor/vdataset';
18
17
  import { NumberRangeMap } from '../layout/row-height-map';
19
18
  import { CustomCellStylePlugin } from '../plugins/custom-cell-style';
20
19
  import type { ITextGraphicAttribute } from './../vrender';
20
+ import { ReactCustomLayout } from '../components/react/react-custom-layout';
21
21
  import type { ISortedMapItem } from '../data/DataSource';
22
22
  export declare abstract class BaseTable extends EventTarget implements BaseTableAPI {
23
23
  internalProps: IBaseTableProtected;
@@ -63,6 +63,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
63
63
  }[]>;
64
64
  customCellStylePlugin: CustomCellStylePlugin;
65
65
  columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';
66
+ reactCustomLayout?: ReactCustomLayout;
66
67
  _hasAutoImageColumn?: boolean;
67
68
  constructor(container: HTMLElement, options?: BaseTableConstructorOptions);
68
69
  throttleInvalidate: (this: any, ...args: any[]) => void;
@@ -136,8 +137,6 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
136
137
  _adjustColWidth(col: number, orgWidth: number): number;
137
138
  setPixelRatio(pixelRatio: number): void;
138
139
  _updateSize(): void;
139
- updateViewBox(newViewBox: IBoundsLike): void;
140
- setViewBoxTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
141
140
  get rowHierarchyType(): 'grid' | 'tree';
142
141
  getColsWidth(startCol: number, endCol: number): number;
143
142
  getRowHeight(row: number): number;
@@ -239,30 +238,10 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
239
238
  inTable: boolean;
240
239
  };
241
240
  getTheme(): TableTheme;
242
- getTargetColAt(absoluteX: number): {
243
- col: number;
244
- left: number;
245
- right: number;
246
- width: number;
247
- } | null;
248
- getTargetRowAt(absoluteY: number): {
249
- row: number;
250
- top: number;
251
- bottom: number;
252
- height: number;
253
- } | null;
254
- getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): {
255
- col: number;
256
- left: number;
257
- right: number;
258
- width: number;
259
- } | null;
260
- getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): {
261
- row: number;
262
- top: number;
263
- bottom: number;
264
- height: number;
265
- } | null;
241
+ getTargetColAt(absoluteX: number): ColumnInfo | null;
242
+ getTargetRowAt(absoluteY: number): RowInfo | null;
243
+ getTargetColAtConsiderRightFrozen(absoluteX: number, isConsider: boolean): ColumnInfo | null;
244
+ getTargetRowAtConsiderBottomFrozen(absoluteY: number, isConsider: boolean): RowInfo | null;
266
245
  private computeTargetRowByY;
267
246
  private computeTargetColByX;
268
247
  clearSelected(): void;
@@ -419,4 +398,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
419
398
  get leftRowSeriesNumberCount(): number;
420
399
  setMinMaxLimitWidth(setWidth?: boolean): void;
421
400
  setSortedIndexMap(field: FieldDef, filedMap: ISortedMapItem): void;
401
+ checkReactCustomLayout(): void;
402
+ get bodyDomContainer(): HTMLElement;
403
+ get headerDomContainer(): HTMLElement;
422
404
  }
@@ -70,6 +70,8 @@ import { CustomCellStylePlugin, mergeStyle } from "../plugins/custom-cell-style"
70
70
 
71
71
  import { hideCellSelectBorder, restoreCellSelectBorder } from "../scenegraph/select/update-select-border";
72
72
 
73
+ import { ReactCustomLayout } from "../components/react/react-custom-layout";
74
+
73
75
  import { hasAutoImageColumn } from "../layout/layout-helper";
74
76
 
75
77
  const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
@@ -83,10 +85,10 @@ export class BaseTable extends EventTarget {
83
85
  return TABLE_EVENT_TYPE;
84
86
  }
85
87
  constructor(container, options = {}) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
87
- if (super(), this.showFrozenIcon = !0, this.version = "1.4.0-alpha.0", this.id = `VTable${Date.now()}`,
88
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
89
+ if (super(), this.showFrozenIcon = !0, this.version = "1.4.0", this.id = `VTable${Date.now()}`,
88
90
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
89
- !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
91
+ !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
90
92
  const {frozenColCount: frozenColCount = 0, 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;
91
93
  this.container = container, this.options = options, this._widthMode = widthMode,
92
94
  this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
@@ -104,12 +106,14 @@ export class BaseTable extends EventTarget {
104
106
  this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
105
107
  const internalProps = this.internalProps = {};
106
108
  if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
107
- this.options.canvas ? (internalProps.element = this.options.canvas.parentElement,
108
- internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element),
109
- internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
109
+ "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
110
110
  internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
111
- internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d")),
112
- internalProps.handler = new EventHandler, isNumber(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
111
+ internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
112
+ (null === (_b = options.customConfig) || void 0 === _b ? void 0 : _b.createReactContainer) && (internalProps.bodyDomContainer = document.createElement("div"),
113
+ internalProps.bodyDomContainer.classList.add("table-component-container"), internalProps.element.appendChild(internalProps.bodyDomContainer),
114
+ internalProps.headerDomContainer = document.createElement("div"), internalProps.headerDomContainer.classList.add("table-component-container"),
115
+ internalProps.element.appendChild(internalProps.headerDomContainer))), internalProps.handler = new EventHandler,
116
+ isNumber(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
113
117
  internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
114
118
  internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
115
119
  internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth,
@@ -127,15 +131,15 @@ export class BaseTable extends EventTarget {
127
131
  var _a;
128
132
  return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
129
133
  }
130
- }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_b = options.theme) && void 0 !== _b ? _b : themes.DEFAULT),
134
+ }, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_c = options.theme) && void 0 !== _c ? _c : themes.DEFAULT),
131
135
  internalProps.theme.isPivot = this.isPivotTable(), container ? (clearDOM && (container.innerHTML = ""),
132
136
  container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(),
133
- this.options = options, internalProps.theme = themes.of(null !== (_c = options.theme) && void 0 !== _c ? _c : themes.DEFAULT),
137
+ this.options = options, internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT),
134
138
  internalProps.theme.isPivot = this.isPivotTable(), internalProps.bodyHelper = new BodyHelper(this),
135
139
  internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this),
136
140
  internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak,
137
- internalProps.allowFrozenColCount = null !== (_d = options.allowFrozenColCount) && void 0 !== _d ? _d : 0,
138
- internalProps.limitMaxAutoWidth = null !== (_e = options.limitMaxAutoWidth) && void 0 !== _e ? _e : 450,
141
+ internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0,
142
+ internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450,
139
143
  internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
140
144
  internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
141
145
  this._vDataSet = new DataSet, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this),
@@ -157,13 +161,13 @@ export class BaseTable extends EventTarget {
157
161
  }, options.tooltip), "html" === internalProps.tooltip.renderMode && (internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine)),
158
162
  internalProps.menu = Object.assign({
159
163
  renderMode: "html"
160
- }, options.menu), Array.isArray(null === (_f = options.menu) || void 0 === _f ? void 0 : _f.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight),
161
- Array.isArray(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
164
+ }, options.menu), Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.dropDownMenuHighlight),
165
+ Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
162
166
  "html" === internalProps.menu.renderMode && (internalProps.menuHandler = new MenuHandler(this)),
163
167
  this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyBottomStyleCache = new Map,
164
168
  internalProps.stick = {
165
169
  changedCells: new Map
166
- }, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []);
170
+ }, 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 : []);
167
171
  }
168
172
  getContainer() {
169
173
  return this.container;
@@ -195,8 +199,8 @@ export class BaseTable extends EventTarget {
195
199
  this.internalProps.colCount = colCount;
196
200
  }
197
201
  get frozenColCount() {
198
- var _a, _b, _c;
199
- return null !== (_c = null !== (_b = null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.frozenColCount) && void 0 !== _b ? _b : this.internalProps.frozenColCount) && void 0 !== _c ? _c : 0;
202
+ var _a, _b, _c, _d, _e;
203
+ return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.frozenColCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.frozenColCount) && void 0 !== _e ? _e : 0;
200
204
  }
201
205
  set frozenColCount(frozenColCount) {
202
206
  frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
@@ -215,22 +219,22 @@ export class BaseTable extends EventTarget {
215
219
  this.options.frozenColCount && (this.tableNoFrameWidth - this.getColsWidth(0, this.options.frozenColCount - 1) <= 120 ? this._setFrozenColCount(0) : this.frozenColCount !== this.options.frozenColCount && this._setFrozenColCount(this.options.frozenColCount));
216
220
  }
217
221
  get frozenRowCount() {
218
- var _a, _b, _c;
219
- return null !== (_c = null !== (_b = null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.frozenRowCount) && void 0 !== _b ? _b : this.internalProps.frozenRowCount) && void 0 !== _c ? _c : 0;
222
+ var _a, _b, _c, _d, _e;
223
+ return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.frozenRowCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.frozenRowCount) && void 0 !== _e ? _e : 0;
220
224
  }
221
225
  set frozenRowCount(frozenRowCount) {
222
226
  this.internalProps.frozenRowCount = frozenRowCount;
223
227
  }
224
228
  get rightFrozenColCount() {
225
- var _a, _b, _c;
226
- return null !== (_c = null !== (_b = null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.rightFrozenColCount) && void 0 !== _b ? _b : this.internalProps.rightFrozenColCount) && void 0 !== _c ? _c : 0;
229
+ var _a, _b, _c, _d, _e;
230
+ return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.rightFrozenColCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.rightFrozenColCount) && void 0 !== _e ? _e : 0;
227
231
  }
228
232
  set rightFrozenColCount(rightFrozenColCount) {
229
233
  this.scenegraph.dealWidthRightFrozen(rightFrozenColCount);
230
234
  }
231
235
  get bottomFrozenRowCount() {
232
- var _a, _b, _c;
233
- return null !== (_c = null !== (_b = null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.bottomFrozenRowCount) && void 0 !== _b ? _b : this.internalProps.bottomFrozenRowCount) && void 0 !== _c ? _c : 0;
236
+ var _a, _b, _c, _d, _e;
237
+ return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.bottomFrozenRowCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.bottomFrozenRowCount) && void 0 !== _e ? _e : 0;
234
238
  }
235
239
  set bottomFrozenRowCount(bottomFrozenRowCount) {
236
240
  this.scenegraph.dealWidthBottomFrozen(bottomFrozenRowCount);
@@ -374,11 +378,10 @@ export class BaseTable extends EventTarget {
374
378
  }
375
379
  }
376
380
  _updateSize() {
377
- 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;
381
+ 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;
378
382
  const {padding: padding} = this;
379
383
  let widthP = 0, heightP = 0;
380
- if (this.tableX = 0, this.tableY = 0, this.options.canvas && this.options.viewBox) widthP = this.options.viewBox.x2 - this.options.viewBox.x1,
381
- 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) {
384
+ if ("browser" === Env.mode) {
382
385
  const element = this.getElement();
383
386
  let widthWithoutPadding = 0, heightWithoutPadding = 0;
384
387
  if (element.parentElement) {
@@ -390,31 +393,25 @@ export class BaseTable extends EventTarget {
390
393
  element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
391
394
  element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
392
395
  const {canvas: canvas} = this.internalProps;
393
- widthP = null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 0,
394
- heightP = null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 0,
395
- (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
396
+ widthP = null !== (_b = null === (_a = canvas.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 0,
397
+ heightP = null !== (_d = null === (_c = canvas.parentElement) || void 0 === _c ? void 0 : _c.offsetHeight) && void 0 !== _d ? _d : 0,
398
+ (null === (_e = null == this ? void 0 : this.scenegraph) || void 0 === _e ? void 0 : _e.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
396
399
  canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
397
- canvas.style.height = `${heightP}px`);
400
+ canvas.style.height = `${heightP}px`), this.internalProps.bodyDomContainer && (this.internalProps.bodyDomContainer.style.width = `${widthP}px`,
401
+ this.internalProps.bodyDomContainer.style.height = `${heightP}px`), this.internalProps.headerDomContainer && (this.internalProps.headerDomContainer.style.width = `${widthP}px`,
402
+ this.internalProps.headerDomContainer.style.height = `${heightP}px`);
398
403
  } else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
399
404
  const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
400
- if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
401
- 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 ]);
402
- (null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0,
403
- this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_o = shadowWidths[1]) && void 0 !== _o ? _o : 0),
404
- 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),
405
- this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
406
- 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)),
407
- 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)));
405
+ if (null === (_f = this.internalProps.theme) || void 0 === _f ? void 0 : _f.frameStyle) {
406
+ 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 ]);
407
+ (null === (_l = this.theme.frameStyle) || void 0 === _l ? void 0 : _l.innerBorder) ? (this.tableX = 0,
408
+ this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_m = shadowWidths[1]) && void 0 !== _m ? _m : 0),
409
+ 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),
410
+ this.tableY = (null !== (_r = lineWidths[0]) && void 0 !== _r ? _r : 0) + (null !== (_s = shadowWidths[0]) && void 0 !== _s ? _s : 0),
411
+ 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)),
412
+ 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)));
408
413
  }
409
414
  }
410
- updateViewBox(newViewBox) {
411
- var _a, _b, _c, _d, _e, _f, _g, _h;
412
- 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;
413
- this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
414
- }
415
- setViewBoxTransform(a, b, c, d, e, f) {
416
- this.internalProps.modifiedViewBoxTransform = !0, this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
417
- }
418
415
  get rowHierarchyType() {
419
416
  return "grid";
420
417
  }
@@ -564,9 +561,9 @@ export class BaseTable extends EventTarget {
564
561
  let absoluteLeft;
565
562
  const width = this.getColWidth(col);
566
563
  let absoluteTop;
567
- absoluteLeft = isFrozenCell && isFrozenCell.col && this.isRightFrozenColumn(col, row) ? this.tableNoFrameWidth - (null !== (_a = this.getColsWidth(col, this.colCount - 1)) && void 0 !== _a ? _a : 0) : this.getColsWidth(0, col - 1) || 0;
564
+ absoluteLeft = isFrozenCell && isFrozenCell.col && this.isRightFrozenColumn(col, row) ? this.getAllColsWidth() <= this.tableNoFrameWidth ? this.getColsWidth(0, col - 1) || 0 : this.tableNoFrameWidth - (null !== (_a = this.getColsWidth(col, this.colCount - 1)) && void 0 !== _a ? _a : 0) : this.getColsWidth(0, col - 1) || 0;
568
565
  const height = this.getRowHeight(row);
569
- return absoluteTop = isFrozenCell && isFrozenCell.row && this.isBottomFrozenRow(col, row) ? this.tableNoFrameHeight - (null !== (_b = this.getRowsHeight(row, this.rowCount - 1)) && void 0 !== _b ? _b : 0) : this.getRowsHeight(0, row - 1),
566
+ return absoluteTop = isFrozenCell && isFrozenCell.row && this.isBottomFrozenRow(col, row) ? this.getAllRowsHeight() <= this.tableNoFrameHeight ? this.getRowsHeight(0, row - 1) : this.tableNoFrameHeight - (null !== (_b = this.getRowsHeight(row, this.rowCount - 1)) && void 0 !== _b ? _b : 0) : this.getRowsHeight(0, row - 1),
570
567
  new Rect(Math.round(absoluteLeft), Math.round(absoluteTop), Math.round(width), Math.round(height));
571
568
  }
572
569
  getMergeCellRect(col, row) {
@@ -705,11 +702,8 @@ export class BaseTable extends EventTarget {
705
702
  }));
706
703
  }
707
704
  _toRelativeRect(absoluteRect, relativeX = !0, relativeY = !0) {
708
- var _a, _b, _c, _d;
709
705
  const rect = absoluteRect.copy(), visibleRect = this.getVisibleRect();
710
706
  return rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0)), rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0)),
711
- rect.offsetLeft(null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
712
- rect.offsetTop(null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
713
707
  rect;
714
708
  }
715
709
  getVisibleRect() {
@@ -814,11 +808,9 @@ export class BaseTable extends EventTarget {
814
808
  internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
815
809
  var _a;
816
810
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
817
- })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release(),
818
- internalProps.focusControl.release();
811
+ })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
819
812
  const {parentElement: parentElement} = internalProps.element;
820
- parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
821
- 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),
813
+ 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),
822
814
  this.isReleased = !0, this.scenegraph = null, this.internalProps = null;
823
815
  }
824
816
  fireListeners(type, event) {
@@ -895,8 +887,8 @@ export class BaseTable extends EventTarget {
895
887
  col: this.stateManager.hover.cellPos.col,
896
888
  row: this.stateManager.hover.cellPos.row
897
889
  };
898
- this.refreshHeader(), this.scenegraph.clearCells(), this.clearCellStyleCache(),
899
- this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
890
+ this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.clearCells(),
891
+ this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
900
892
  this.render();
901
893
  }
902
894
  getFrozenRowsHeight() {
@@ -926,7 +918,6 @@ export class BaseTable extends EventTarget {
926
918
  return new Rect(this.tableX, this.tableY, width, height);
927
919
  }
928
920
  _getMouseAbstractPoint(evt, isAddScroll = !0) {
929
- var _a, _b, _c, _d;
930
921
  let e;
931
922
  if (!evt) return {
932
923
  inTable: !1,
@@ -937,15 +928,12 @@ export class BaseTable extends EventTarget {
937
928
  const clientX = e.clientX || e.pageX + window.scrollX, clientY = e.clientY || e.pageY + window.scrollY, rect = this.internalProps.canvas.getBoundingClientRect();
938
929
  let inTable = !0;
939
930
  rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
940
- const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight), point = {
941
- 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),
942
- 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
+ const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight);
932
+ return {
933
+ x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0),
934
+ y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0),
943
935
  inTable: inTable
944
936
  };
945
- if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
946
- this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point);
947
- }
948
- return point;
949
937
  }
950
938
  getTheme() {
951
939
  return this.internalProps.theme;
@@ -1214,7 +1202,7 @@ export class BaseTable extends EventTarget {
1214
1202
  var _a;
1215
1203
  if (this.internalProps.customMergeCell) {
1216
1204
  const customMerge = this.internalProps.customMergeCell(col, row, this);
1217
- if (customMerge && customMerge.range && customMerge.text) return customMerge.range;
1205
+ if (customMerge && customMerge.range && (customMerge.text || customMerge.customLayout || customMerge.customRender)) return customMerge.range;
1218
1206
  }
1219
1207
  return null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.getCellRange(col, row);
1220
1208
  }
@@ -1693,30 +1681,49 @@ export class BaseTable extends EventTarget {
1693
1681
  return "chart" === (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _e ? void 0 : _e[0]) || void 0 === _f ? void 0 : _f.type) ? cellGroup.getChildren()[0].activeChartInstance : null;
1694
1682
  }
1695
1683
  cellIsInVisualView(col, row) {
1684
+ var _a, _b, _c, _d;
1696
1685
  const drawRange = this.getDrawRange(), rect = this.getCellRelativeRect(col, row);
1697
1686
  if (col < this.frozenColCount && row < this.frozenRowCount) return !0;
1698
- const colHeaderRangeRect = this.getCellRangeRelativeRect({
1687
+ let colHeaderRangeRect, rowHeaderRangeRect, bottomFrozenRangeRect, rightFrozenRangeRect;
1688
+ if (this.frozenRowCount >= 1 && (colHeaderRangeRect = this.getCellRangeRelativeRect({
1699
1689
  start: {
1700
1690
  col: 0,
1701
1691
  row: 0
1702
1692
  },
1703
1693
  end: {
1704
1694
  col: this.colCount - 1,
1705
- row: this.columnHeaderLevelCount
1695
+ row: this.frozenRowCount - 1
1706
1696
  }
1707
- }), rowHeaderRangeRect = this.getCellRangeRelativeRect({
1697
+ })), this.frozenColCount >= 1 && (rowHeaderRangeRect = this.getCellRangeRelativeRect({
1708
1698
  start: {
1709
1699
  col: 0,
1710
1700
  row: 0
1711
1701
  },
1712
1702
  end: {
1713
- col: this.rowHeaderLevelCount,
1703
+ col: this.frozenColCount - 1,
1714
1704
  row: this.rowCount - 1
1715
1705
  }
1716
- });
1717
- if (rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right) {
1718
- if (this.isHeader(col, row)) return !0;
1719
- if (drawRange.top >= colHeaderRangeRect.bottom && drawRange.left >= rowHeaderRangeRect.right) return !0;
1706
+ })), this.bottomFrozenRowCount >= 1 && (bottomFrozenRangeRect = this.getCellRangeRelativeRect({
1707
+ start: {
1708
+ col: 0,
1709
+ row: this.rowCount - this.bottomFrozenRowCount
1710
+ },
1711
+ end: {
1712
+ col: this.colCount - 1,
1713
+ row: this.rowCount - 1
1714
+ }
1715
+ })), this.rightFrozenColCount >= 1 && (rightFrozenRangeRect = this.getCellRangeRelativeRect({
1716
+ start: {
1717
+ col: this.colCount - this.rightFrozenColCount,
1718
+ row: 0
1719
+ },
1720
+ end: {
1721
+ col: this.colCount - 1,
1722
+ row: this.rowCount - 1
1723
+ }
1724
+ })), rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right) {
1725
+ if (this.isFrozenCell(col, row)) return !0;
1726
+ if (rect.top >= (null !== (_a = null == colHeaderRangeRect ? void 0 : colHeaderRangeRect.bottom) && void 0 !== _a ? _a : rect.top) && rect.left >= (null !== (_b = null == rowHeaderRangeRect ? void 0 : rowHeaderRangeRect.right) && void 0 !== _b ? _b : rect.left) && rect.bottom <= (null !== (_c = null == bottomFrozenRangeRect ? void 0 : bottomFrozenRangeRect.top) && void 0 !== _c ? _c : rect.bottom) && rect.right <= (null !== (_d = null == rightFrozenRangeRect ? void 0 : rightFrozenRangeRect.left) && void 0 !== _d ? _d : rect.right)) return !0;
1720
1727
  }
1721
1728
  return !1;
1722
1729
  }
@@ -1874,5 +1881,14 @@ export class BaseTable extends EventTarget {
1874
1881
  var _a;
1875
1882
  null === (_a = this.dataSource) || void 0 === _a || _a.setSortedIndexMap(field, filedMap);
1876
1883
  }
1884
+ checkReactCustomLayout() {
1885
+ this.reactCustomLayout || (this.reactCustomLayout = new ReactCustomLayout(this));
1886
+ }
1887
+ get bodyDomContainer() {
1888
+ return this.internalProps.bodyDomContainer;
1889
+ }
1890
+ get headerDomContainer() {
1891
+ return this.internalProps.headerDomContainer;
1892
+ }
1877
1893
  }
1878
1894
  //# sourceMappingURL=BaseTable.js.map