@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
@@ -64,9 +64,8 @@ class CartesianAxis {
64
64
  createComponent() {
65
65
  const axisStylrAttrs = (0, get_axis_attributes_1.getAxisAttributes)(this.option), attrs = this.getUpdateAttribute();
66
66
  attrs.verticalFactor = "top" === this.orient || "right" === this.orient ? -1 : 1,
67
- this.component = new vrender_components_1.LineAxis((0, vutils_1.merge)({
68
- disableTriggerEvent: this.table.options.disableInteraction
69
- }, axisStylrAttrs, attrs)), this.component.setAttributes(this.setLayoutStartPosition({
67
+ this.component = new vrender_components_1.LineAxis((0, vutils_1.merge)({}, axisStylrAttrs, attrs)),
68
+ this.component.setAttributes(this.setLayoutStartPosition({
70
69
  x: 0,
71
70
  y: 0
72
71
  })), this.component.originAxis = this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/axis/axis.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAG/E,qEAAiF;AACjF,+DAAqF;AACrF,2CAAkD;AAElD,6CAA6C;AAC7C,+CAAmG;AAEnG,iDAA8C;AAE9C,uEAAqD;AACrD,iDAAiD;AACjD,mDAA4C;AAG5C,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,WAAW,GAAW,CAAC,KAAiB,EAAE,EAAE;IAChD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAa,aAAa;IAgBxB,YACE,MAAuB,EACvB,KAAa,EACb,MAAc,EACd,OAAyC,EACzC,KAAmB;;QAlBrB,MAAC,GAAW,CAAC,CAAC;QACd,MAAC,GAAW,CAAC,CAAC;QAmBZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,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;QAC3B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC;KAC/C;SAAM,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC9B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC;KAClD;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAmB,EACnB,IAA6D,EAC7D,cAAoB;IAEpB,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,EAAE,CAAC;KACX;IACD,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC;IACtC,IAAI,aAAa,CAAC;IAClB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,QAAQ,EAAE;QAC5D,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC;KAC3C;SAAM,IAAI,IAAI,KAAK,MAAM,EAAE;QAC1B,aAAa,GAAG,cAAc,CAAC,QAAQ,CAAC;KACzC;IAED,IAAI,eAAe,CAAC;IACpB,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;SAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE;QAClD,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAC9D,CAAC","file":"axis.js","sourcesContent":["import { degreeToRadian, isNil, isValidNumber, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { LineAxis, type LineAxisAttributes } from '@visactor/vrender-components';\nimport { commonAxis, getAxisAttributes, getCommonAxis } from './get-axis-attributes';\nimport { isXAxis, isYAxis } from '../util/orient';\nimport type { IOrientType } from '../../ts-types/component/util';\nimport { BandAxisScale } from './band-scale';\nimport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../util/register';\nimport type { Parser } from '@visactor/vdataset';\nimport { DataView } from '@visactor/vdataset';\nimport type { IBaseScale } from '@visactor/vscale';\nimport { ticks } from './../../vutil-extension-temp';\nimport { LinearAxisScale } from './linear-scale';\nimport { doOverlap } from './label-overlap';\nimport type { TableTheme } from '../../themes/theme';\n\nconst DEFAULT_BAND_INNER_PADDING = 0.1;\nconst DEFAULT_BAND_OUTER_PADDING = 0.3;\nconst scaleParser: Parser = (scale: IBaseScale) => {\n return scale;\n};\n\nexport class CartesianAxis {\n width: number;\n height: number;\n x: number = 0;\n y: number = 0;\n table: BaseTableAPI;\n option: ICellAxisOption;\n orient: IOrientType;\n visible: boolean;\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog';\n inverse: boolean;\n data?: any[];\n tickData: DataView;\n scale: BandAxisScale | LinearAxisScale;\n component: LineAxis;\n\n constructor(\n option: ICellAxisOption,\n width: number,\n height: number,\n padding: [number, number, number, number],\n table: BaseTableAPI\n ) {\n this.table = table;\n this.orient = option.orient ?? 'left';\n this.type = option.type ?? 'band';\n this.option = merge(\n {},\n // commonAxis,\n getCommonAxis(option.__vtableChartTheme),\n getTableAxisTheme(this.orient, table.theme),\n getChartSpecAxisTheme(this.orient, this.type, option.__vtableChartTheme),\n option\n );\n\n if (this.orient === 'left' || this.orient === 'right') {\n // const innerOffsetTop = this.option.innerOffset?.top ?? 0;\n // const innerOffsetBottom = this.option.innerOffset?.bottom ?? 0;\n const innerOffsetTop = 0;\n const innerOffsetBottom = 0;\n this.width = width;\n this.height = height - padding[2] - innerOffsetBottom;\n this.y = padding[0] + innerOffsetTop;\n } else if (this.orient === 'top' || this.orient === 'bottom') {\n // const innerOffsetLeft = this.option.innerOffset?.left ?? 0;\n // const innerOffsetRight = this.option.innerOffset?.right ?? 0;\n const innerOffsetLeft = 0;\n const innerOffsetRight = 0;\n this.width = width - padding[1] - innerOffsetRight;\n this.height = height;\n this.x = padding[3] + innerOffsetLeft;\n }\n\n this.visible = option.visible ?? true;\n this.inverse = 'inverse' in option ? !!option.inverse : false;\n if (option.type === 'band') {\n this.data = option.domain;\n }\n\n this.initScale();\n this.initData();\n this.createComponent();\n this.initEvent();\n }\n\n initScale() {\n const option = this.option as any;\n if (this.type === 'band' || this.type === 'point') {\n this.scale = new BandAxisScale();\n this.scale.bandPadding = option.bandPadding;\n this.scale.paddingInner = option.paddingInner;\n this.scale.paddingOuter = option.paddingOuter;\n this.scale.calcScales(DEFAULT_BAND_INNER_PADDING, DEFAULT_BAND_OUTER_PADDING); // 0.1 0.3\n this.scale.updateScaleDomain(this.data);\n this.updateScaleRange();\n } else if (this.type === 'linear' || this.type === 'time' || this.type === 'log' || this.type === 'symlog') {\n this.scale = new LinearAxisScale(this.type);\n this.scale.setExtraAttrFromSpec(\n option.nice,\n option.zero,\n option.range,\n option.expand,\n option.base,\n option.constant\n );\n this.scale.transformScaleDomain();\n this.scale.updateScaleDomain();\n this.updateScaleRange();\n }\n }\n\n initData() {\n registerDataSetInstanceParser(this.table._vDataSet, 'scale', scaleParser);\n registerDataSetInstanceTransform(this.table._vDataSet, 'ticks', ticks);\n\n const label = this.option.label || {};\n const tick = this.option.tick || {};\n const tickData = new DataView(this.table._vDataSet)\n .parse(this.scale._scale, {\n type: 'scale'\n })\n .transform(\n {\n type: 'ticks',\n options: {\n sampling: this.option.sampling !== false, // default do sampling\n tickCount: tick.tickCount,\n forceTickCount: tick.forceTickCount,\n tickStep: tick.tickStep,\n tickMode: tick.tickMode,\n noDecimals: tick.noDecimals,\n\n axisOrientType: this.orient,\n coordinateType: 'cartesian',\n\n labelStyle: label.style,\n labelFormatter: label.formatMethod,\n labelGap: label.minGap,\n\n labelLastVisible: label.lastVisible,\n labelFlush: label.flush\n }\n },\n false\n );\n this.tickData = tickData;\n\n this.computeData();\n }\n\n computeData(): void {\n this.tickData.reRunAllTransform();\n }\n\n initEvent() {\n // to be added\n }\n\n createComponent() {\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component = new LineAxis(\n merge(\n {\n disableTriggerEvent: this.table.options.disableInteraction\n },\n axisStylrAttrs,\n attrs\n )\n );\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n (this.component as any).originAxis = this;\n }\n\n resize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.updateScaleRange();\n this.computeData();\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component.setAttributes(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n this.overlap();\n }\n\n overlap() {\n doOverlap(this.component, this);\n }\n\n getLayoutRect() {\n // const padding = getQuadProps(this.table.theme.bodyStyle.padding as number);\n return {\n // width: this.width - (this.orient === 'top' || this.orient === 'bottom' ? padding[3] + padding[1] : 0),\n // height: this.height - (this.orient === 'left' || this.orient === 'right' ? padding[0] + padding[2] : 0)\n width: this.width,\n height: this.height\n };\n }\n\n getUpdateAttribute() {\n // 获取更新的坐标轴属性\n const regionHeight = this.table.tableNoFrameHeight;\n const regionWidth = this.table.tableNoFrameWidth;\n\n const { width, height } = this.getLayoutRect();\n const isX = isXAxis(this.orient);\n const isY = isYAxis(this.orient);\n let end = { x: 0, y: 0 };\n let gridLength = 0;\n let axisLength = 0;\n if (isX) {\n end = { x: width, y: 0 };\n gridLength = regionHeight;\n axisLength = width;\n } else if (isY) {\n end = { x: 0, y: height };\n gridLength = regionWidth;\n axisLength = height;\n }\n const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;\n const attrs: LineAxisAttributes = {\n start: { x: this.x, y: this.y },\n end,\n // grid: {\n // type: 'line',\n // length: gridLength,\n // visible: this.option.grid.visible\n // },\n title: {\n text: this.option.title.text as string,\n maxWidth: this._getTitleLimit(isX)\n },\n items: this.getLabelItems(axisLength),\n verticalLimitSize: size,\n verticalMinSize: size\n };\n return attrs;\n }\n\n getLabelItems(length: number) {\n return [\n this.tickData.latestData\n .map((obj: any) => {\n return {\n id: obj.value,\n label: obj.value,\n value: length === 0 ? 0 : this.scale.dataToPosition([obj.value]) / length,\n rawValue: obj.value\n };\n })\n .filter((entry: any) => entry.value >= 0 && entry.value <= 1)\n ];\n }\n\n updateScaleRange() {\n const right = this.option.innerOffset?.right ?? 0;\n const left = this.option.innerOffset?.left ?? 0;\n const top = this.option.innerOffset?.top ?? 0;\n const bottom = this.option.innerOffset?.bottom ?? 0;\n\n const { width, height } = this.getLayoutRect();\n const inverse = (this.option as any).inverse || false;\n let newRange: [number, number] = [0, 0];\n if (isXAxis(this.orient)) {\n if (isValidNumber(width)) {\n // newRange = inverse ? [width, 0] : [0, width];\n newRange = inverse ? [width - right, left] : [left, width - right];\n }\n } else {\n if (isValidNumber(height)) {\n // newRange = inverse ? [0, height] : [height, 0];\n newRange = inverse ? [top, height - bottom] : [height - bottom, top];\n }\n }\n\n this.scale.updateRange(newRange);\n }\n\n setLayoutStartPosition(pos: any) {\n let { x, y } = pos;\n\n if (isValidNumber(x)) {\n x += Number(this.orient === 'left') * this.getLayoutRect().width;\n }\n if (isValidNumber(y)) {\n y += Number(this.orient === 'top') * this.getLayoutRect().height;\n }\n\n return { x, y };\n // super.setLayoutStartPosition({ x, y });\n }\n\n private _getTitleLimit(isX: boolean) {\n if (this.option.title.visible && isNil(this.option.title.style?.maxLineWidth)) {\n let angle = this.option.title.style?.angle || 0;\n if (this.option.title?.autoRotate && isNil(this.option.title.angle)) {\n angle = this.option.orient === 'left' ? -90 : 90;\n }\n if (isX) {\n const width = this.getLayoutRect().width;\n const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));\n // VRender 接收到的limit是考虑角度计算后的宽度\n // TODO:还需要考虑angle后,高度是否太高,综合计算一个limit,比如高度不能超过图表整体高度的1/4\n return cosValue < 1e-6 ? Infinity : width / cosValue;\n }\n const height = this.getLayoutRect().height;\n const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));\n\n // TODO:还需要考虑angle后,宽度是否太宽,综合计算一个limit,比如宽度度不能超过图表整体宽度的1/4\n return sinValue < 1e-6 ? Infinity : height / sinValue;\n }\n\n return null;\n }\n\n getScale() {\n return this.scale._scale;\n }\n\n getDomainSpec() {\n return (this.scale as LinearAxisScale).domain;\n }\n}\n\nfunction getTableAxisTheme(orient: IOrientType, theme: TableTheme) {\n let directionStyle;\n if (orient === 'left') {\n directionStyle = theme.axisStyle.leftAxisStyle;\n } else if (orient === 'right') {\n directionStyle = theme.axisStyle.rightAxisStyle;\n } else if (orient === 'top') {\n directionStyle = theme.axisStyle.topAxisStyle;\n } else if (orient === 'bottom') {\n directionStyle = theme.axisStyle.bottomAxisStyle;\n }\n return merge({}, theme.axisStyle.defaultAxisStyle, directionStyle);\n}\n\nfunction getChartSpecAxisTheme(\n orient: IOrientType,\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog',\n chartSpecTheme?: any\n) {\n if (!chartSpecTheme) {\n return {};\n }\n const axisTheme = chartSpecTheme.axis;\n let axisTypeTheme;\n if (type === 'linear' || type === 'log' || type === 'symlog') {\n axisTypeTheme = chartSpecTheme.axisLinear;\n } else if (type === 'band') {\n axisTypeTheme = chartSpecTheme.axisBand;\n }\n\n let axisOrientTheme;\n if (orient === 'top' || orient === 'bottom') {\n axisOrientTheme = chartSpecTheme.axisX;\n } else if (orient === 'left' || orient === 'right') {\n axisOrientTheme = chartSpecTheme.axisY;\n }\n return merge({}, axisTheme, axisTypeTheme, axisOrientTheme);\n}\n"]}
1
+ {"version":3,"sources":["../src/components/axis/axis.ts"],"names":[],"mappings":";;;AAAA,6CAA+E;AAG/E,qEAAiF;AACjF,+DAA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AAI,MAAM,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;SAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE;QAClD,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC;KACxC;IACD,OAAO,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAC9D,CAAC","file":"axis.js","sourcesContent":["import { degreeToRadian, isNil, isValidNumber, merge } from '@visactor/vutils';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport type { ICellAxisOption } from '../../ts-types/component/axis';\nimport { LineAxis, type LineAxisAttributes } from '@visactor/vrender-components';\nimport { commonAxis, getAxisAttributes, getCommonAxis } from './get-axis-attributes';\nimport { isXAxis, isYAxis } from '../util/orient';\nimport type { IOrientType } from '../../ts-types/component/util';\nimport { BandAxisScale } from './band-scale';\nimport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../util/register';\nimport type { Parser } from '@visactor/vdataset';\nimport { DataView } from '@visactor/vdataset';\nimport type { IBaseScale } from '@visactor/vscale';\nimport { ticks } from './../../vutil-extension-temp';\nimport { LinearAxisScale } from './linear-scale';\nimport { doOverlap } from './label-overlap';\nimport type { TableTheme } from '../../themes/theme';\n\nconst DEFAULT_BAND_INNER_PADDING = 0.1;\nconst DEFAULT_BAND_OUTER_PADDING = 0.3;\nconst scaleParser: Parser = (scale: IBaseScale) => {\n return scale;\n};\n\nexport class CartesianAxis {\n width: number;\n height: number;\n x: number = 0;\n y: number = 0;\n table: BaseTableAPI;\n option: ICellAxisOption;\n orient: IOrientType;\n visible: boolean;\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog';\n inverse: boolean;\n data?: any[];\n tickData: DataView;\n scale: BandAxisScale | LinearAxisScale;\n component: LineAxis;\n\n constructor(\n option: ICellAxisOption,\n width: number,\n height: number,\n padding: [number, number, number, number],\n table: BaseTableAPI\n ) {\n this.table = table;\n this.orient = option.orient ?? 'left';\n this.type = option.type ?? 'band';\n this.option = merge(\n {},\n // commonAxis,\n getCommonAxis(option.__vtableChartTheme),\n getTableAxisTheme(this.orient, table.theme),\n getChartSpecAxisTheme(this.orient, this.type, option.__vtableChartTheme),\n option\n );\n\n if (this.orient === 'left' || this.orient === 'right') {\n // const innerOffsetTop = this.option.innerOffset?.top ?? 0;\n // const innerOffsetBottom = this.option.innerOffset?.bottom ?? 0;\n const innerOffsetTop = 0;\n const innerOffsetBottom = 0;\n this.width = width;\n this.height = height - padding[2] - innerOffsetBottom;\n this.y = padding[0] + innerOffsetTop;\n } else if (this.orient === 'top' || this.orient === 'bottom') {\n // const innerOffsetLeft = this.option.innerOffset?.left ?? 0;\n // const innerOffsetRight = this.option.innerOffset?.right ?? 0;\n const innerOffsetLeft = 0;\n const innerOffsetRight = 0;\n this.width = width - padding[1] - innerOffsetRight;\n this.height = height;\n this.x = padding[3] + innerOffsetLeft;\n }\n\n this.visible = option.visible ?? true;\n this.inverse = 'inverse' in option ? !!option.inverse : false;\n if (option.type === 'band') {\n this.data = option.domain;\n }\n\n this.initScale();\n this.initData();\n this.createComponent();\n this.initEvent();\n }\n\n initScale() {\n const option = this.option as any;\n if (this.type === 'band' || this.type === 'point') {\n this.scale = new BandAxisScale();\n this.scale.bandPadding = option.bandPadding;\n this.scale.paddingInner = option.paddingInner;\n this.scale.paddingOuter = option.paddingOuter;\n this.scale.calcScales(DEFAULT_BAND_INNER_PADDING, DEFAULT_BAND_OUTER_PADDING); // 0.1 0.3\n this.scale.updateScaleDomain(this.data);\n this.updateScaleRange();\n } else if (this.type === 'linear' || this.type === 'time' || this.type === 'log' || this.type === 'symlog') {\n this.scale = new LinearAxisScale(this.type);\n this.scale.setExtraAttrFromSpec(\n option.nice,\n option.zero,\n option.range,\n option.expand,\n option.base,\n option.constant\n );\n this.scale.transformScaleDomain();\n this.scale.updateScaleDomain();\n this.updateScaleRange();\n }\n }\n\n initData() {\n registerDataSetInstanceParser(this.table._vDataSet, 'scale', scaleParser);\n registerDataSetInstanceTransform(this.table._vDataSet, 'ticks', ticks);\n\n const label = this.option.label || {};\n const tick = this.option.tick || {};\n const tickData = new DataView(this.table._vDataSet)\n .parse(this.scale._scale, {\n type: 'scale'\n })\n .transform(\n {\n type: 'ticks',\n options: {\n sampling: this.option.sampling !== false, // default do sampling\n tickCount: tick.tickCount,\n forceTickCount: tick.forceTickCount,\n tickStep: tick.tickStep,\n tickMode: tick.tickMode,\n noDecimals: tick.noDecimals,\n\n axisOrientType: this.orient,\n coordinateType: 'cartesian',\n\n labelStyle: label.style,\n labelFormatter: label.formatMethod,\n labelGap: label.minGap,\n\n labelLastVisible: label.lastVisible,\n labelFlush: label.flush\n }\n },\n false\n );\n this.tickData = tickData;\n\n this.computeData();\n }\n\n computeData(): void {\n this.tickData.reRunAllTransform();\n }\n\n initEvent() {\n // to be added\n }\n\n createComponent() {\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n (this.component as any).originAxis = this;\n }\n\n resize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.updateScaleRange();\n this.computeData();\n const axisStylrAttrs = getAxisAttributes(this.option);\n const attrs = this.getUpdateAttribute();\n attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;\n this.component.setAttributes(merge({}, axisStylrAttrs, attrs));\n this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));\n this.overlap();\n }\n\n overlap() {\n doOverlap(this.component, this);\n }\n\n getLayoutRect() {\n // const padding = getQuadProps(this.table.theme.bodyStyle.padding as number);\n return {\n // width: this.width - (this.orient === 'top' || this.orient === 'bottom' ? padding[3] + padding[1] : 0),\n // height: this.height - (this.orient === 'left' || this.orient === 'right' ? padding[0] + padding[2] : 0)\n width: this.width,\n height: this.height\n };\n }\n\n getUpdateAttribute() {\n // 获取更新的坐标轴属性\n const regionHeight = this.table.tableNoFrameHeight;\n const regionWidth = this.table.tableNoFrameWidth;\n\n const { width, height } = this.getLayoutRect();\n const isX = isXAxis(this.orient);\n const isY = isYAxis(this.orient);\n let end = { x: 0, y: 0 };\n let gridLength = 0;\n let axisLength = 0;\n if (isX) {\n end = { x: width, y: 0 };\n gridLength = regionHeight;\n axisLength = width;\n } else if (isY) {\n end = { x: 0, y: height };\n gridLength = regionWidth;\n axisLength = height;\n }\n const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;\n const attrs: LineAxisAttributes = {\n start: { x: this.x, y: this.y },\n end,\n // grid: {\n // type: 'line',\n // length: gridLength,\n // visible: this.option.grid.visible\n // },\n title: {\n text: this.option.title.text as string,\n maxWidth: this._getTitleLimit(isX)\n },\n items: this.getLabelItems(axisLength),\n verticalLimitSize: size,\n verticalMinSize: size\n };\n return attrs;\n }\n\n getLabelItems(length: number) {\n return [\n this.tickData.latestData\n .map((obj: any) => {\n return {\n id: obj.value,\n label: obj.value,\n value: length === 0 ? 0 : this.scale.dataToPosition([obj.value]) / length,\n rawValue: obj.value\n };\n })\n .filter((entry: any) => entry.value >= 0 && entry.value <= 1)\n ];\n }\n\n updateScaleRange() {\n const right = this.option.innerOffset?.right ?? 0;\n const left = this.option.innerOffset?.left ?? 0;\n const top = this.option.innerOffset?.top ?? 0;\n const bottom = this.option.innerOffset?.bottom ?? 0;\n\n const { width, height } = this.getLayoutRect();\n const inverse = (this.option as any).inverse || false;\n let newRange: [number, number] = [0, 0];\n if (isXAxis(this.orient)) {\n if (isValidNumber(width)) {\n // newRange = inverse ? [width, 0] : [0, width];\n newRange = inverse ? [width - right, left] : [left, width - right];\n }\n } else {\n if (isValidNumber(height)) {\n // newRange = inverse ? [0, height] : [height, 0];\n newRange = inverse ? [top, height - bottom] : [height - bottom, top];\n }\n }\n\n this.scale.updateRange(newRange);\n }\n\n setLayoutStartPosition(pos: any) {\n let { x, y } = pos;\n\n if (isValidNumber(x)) {\n x += Number(this.orient === 'left') * this.getLayoutRect().width;\n }\n if (isValidNumber(y)) {\n y += Number(this.orient === 'top') * this.getLayoutRect().height;\n }\n\n return { x, y };\n // super.setLayoutStartPosition({ x, y });\n }\n\n private _getTitleLimit(isX: boolean) {\n if (this.option.title.visible && isNil(this.option.title.style?.maxLineWidth)) {\n let angle = this.option.title.style?.angle || 0;\n if (this.option.title?.autoRotate && isNil(this.option.title.angle)) {\n angle = this.option.orient === 'left' ? -90 : 90;\n }\n if (isX) {\n const width = this.getLayoutRect().width;\n const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));\n // VRender 接收到的limit是考虑角度计算后的宽度\n // TODO:还需要考虑angle后,高度是否太高,综合计算一个limit,比如高度不能超过图表整体高度的1/4\n return cosValue < 1e-6 ? Infinity : width / cosValue;\n }\n const height = this.getLayoutRect().height;\n const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));\n\n // TODO:还需要考虑angle后,宽度是否太宽,综合计算一个limit,比如宽度度不能超过图表整体宽度的1/4\n return sinValue < 1e-6 ? Infinity : height / sinValue;\n }\n\n return null;\n }\n\n getScale() {\n return this.scale._scale;\n }\n\n getDomainSpec() {\n return (this.scale as LinearAxisScale).domain;\n }\n}\n\nfunction getTableAxisTheme(orient: IOrientType, theme: TableTheme) {\n let directionStyle;\n if (orient === 'left') {\n directionStyle = theme.axisStyle.leftAxisStyle;\n } else if (orient === 'right') {\n directionStyle = theme.axisStyle.rightAxisStyle;\n } else if (orient === 'top') {\n directionStyle = theme.axisStyle.topAxisStyle;\n } else if (orient === 'bottom') {\n directionStyle = theme.axisStyle.bottomAxisStyle;\n }\n return merge({}, theme.axisStyle.defaultAxisStyle, directionStyle);\n}\n\nfunction getChartSpecAxisTheme(\n orient: IOrientType,\n type: 'linear' | 'band' | 'point' | 'time' | 'log' | 'symlog',\n chartSpecTheme?: any\n) {\n if (!chartSpecTheme) {\n return {};\n }\n const axisTheme = chartSpecTheme.axis;\n let axisTypeTheme;\n if (type === 'linear' || type === 'log' || type === 'symlog') {\n axisTypeTheme = chartSpecTheme.axisLinear;\n } else if (type === 'band') {\n axisTypeTheme = chartSpecTheme.axisBand;\n }\n\n let axisOrientTheme;\n if (orient === 'top' || orient === 'bottom') {\n axisOrientTheme = chartSpecTheme.axisX;\n } else if (orient === 'left' || orient === 'right') {\n axisOrientTheme = chartSpecTheme.axisY;\n }\n return merge({}, axisTheme, axisTypeTheme, axisOrientTheme);\n}\n"]}
@@ -34,7 +34,7 @@ class EmptyTip {
34
34
  resize() {
35
35
  var _a;
36
36
  if (!this._emptyTipComponent) return;
37
- const leftHeaderWidth = this.table.transpose || !1 === this.table.options.indicatorsAsCol ? this.table.getFrozenColsWidth() : 0, topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol ? this.table.getFrozenRowsHeight() : 0, width = (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) - leftHeaderWidth, height = (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) - topHeaderHeight;
37
+ const leftHeaderWidth = this.table.transpose || !1 === this.table.options.indicatorsAsCol ? this.table.getFrozenColsWidth() : 0, topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol ? this.table.getFrozenRowsHeight() : 0, width = (this.table.columnHeaderLevelCount > 0 && this.table.isListTable() ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) - leftHeaderWidth, height = (this.table.rowHeaderLevelCount > 0 && this.table.isListTable() ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) - topHeaderHeight;
38
38
  this._emptyTipComponent.setAttributes({
39
39
  spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
40
40
  x: this.table.tableX + leftHeaderWidth,
@@ -58,7 +58,7 @@ class EmptyTip {
58
58
  }
59
59
  _getEmptyTipAttrs() {
60
60
  var _a;
61
- const leftHeaderWidth = this.table.transpose || !1 === this.table.options.indicatorsAsCol ? this.table.getFrozenColsWidth() : 0, topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol ? this.table.getFrozenRowsHeight() : 0, width = (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) - leftHeaderWidth, height = (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) - topHeaderHeight;
61
+ const leftHeaderWidth = this.table.transpose || !1 === this.table.options.indicatorsAsCol ? this.table.getFrozenColsWidth() : 0, topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol ? this.table.getFrozenRowsHeight() : 0, width = (this.table.columnHeaderLevelCount > 0 && this.table.isListTable() ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) - leftHeaderWidth, height = (this.table.rowHeaderLevelCount > 0 && this.table.isListTable() ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) - topHeaderHeight;
62
62
  return {
63
63
  spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
64
64
  x: this.table.tableX + leftHeaderWidth,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAK9E,6CAA2C;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAE/pD,MAAa,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,MAAM;aACd;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF,CAAC;QACF,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;Q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,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE;YAClC,CAAC,CAAC,CAAC,CAAC;QACR,MAAM,KAAK,GACT,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;YACxG,eAAe,CAAC;QAClB,MAAM,MAAM,GACV,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;YACvG,eAAe,CAAC;QAElB,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF;AAzID,4BAyIC","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (\n ((!this.table.recordsCount || this.table.recordsCount === 0) &&\n this.table.internalProps.layoutMap.rowCount === this.table.internalProps.layoutMap.columnHeaderLevelCount) ||\n this.table.internalProps.layoutMap.colCount === this.table.internalProps.layoutMap.rowHeaderLevelCount\n ) {\n // this._emptyTipComponent.setAttributes({\n // visible: true\n // });\n // this._emptyTipComponent.showAll();\n if (!this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);\n }\n } else {\n // this._emptyTipComponent.setAttributes({\n // visible: false\n // });\n // this._emptyTipComponent.hideAll();\n if (this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n }\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAK9E,6CAA2C;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAE/pD,MAAa,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,MAAM;aACd;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF,CAAC;QACF,eAAU,GAAY,KAAK,CAAC;QAI1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAC1G,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC5F,CAAC;IAEO,gCAAgC,CAAC,KAAyB;QAChE,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;gBACrC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;aAC9C;SACF;aAAM;YACL,MAAM,QAAQ,GAAG,IAAI,6BAAkB,CAAC,KAAK,CAAC,CAAC;YAC/C,QAAQ,C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,CAAC,YAAY,EAAE,CAAC,MAAM;YAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,eAAe,CAAC;QAEvD,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF;AA7ID,4BA6IC","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (\n ((!this.table.recordsCount || this.table.recordsCount === 0) &&\n this.table.internalProps.layoutMap.rowCount === this.table.internalProps.layoutMap.columnHeaderLevelCount) ||\n this.table.internalProps.layoutMap.colCount === this.table.internalProps.layoutMap.rowHeaderLevelCount\n ) {\n // this._emptyTipComponent.setAttributes({\n // visible: true\n // });\n // this._emptyTipComponent.showAll();\n if (!this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);\n }\n } else {\n // this._emptyTipComponent.setAttributes({\n // visible: false\n // });\n // this._emptyTipComponent.hideAll();\n if (this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n }\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().width\n : this.table.tableNoFrameWidth) - leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()\n ? this.table.getDrawRange().height\n : this.table.tableNoFrameHeight) - topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
@@ -19,8 +19,7 @@ class DiscreteTableLegend {
19
19
  width: this.table.tableNoFrameWidth,
20
20
  height: this.table.tableNoFrameHeight
21
21
  }), legend = new vrender_components_1.DiscreteLegend((0, vutils_1.merge)({}, attrs, {
22
- defaultSelected: this.selectedData,
23
- disableTriggerEvent: this.table.options.disableInteraction
22
+ defaultSelected: this.selectedData
24
23
  }));
25
24
  legend.name = "legend", this.legendComponent = legend, this.table.scenegraph.stage.defaultLayer.appendChild(legend),
26
25
  this.adjustTableSize(attrs);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/legend/discrete-legend/discrete-legend.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAGzD,qEAA2E;AAC3E,qFAAuE;AACvE,qEAAkE;AAClE,+DAAiE;AAGjE,MAAa,mBAAmB;IAS9B,YAAY,MAAkC,EAAE,KAAmB;;QACjE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAI,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,MAAA,MAAM,CAAC,QAAQ,mCAAI,QAAQ,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,IAAI,CAAC;QAEnD,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC;YACrC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB;YACnC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;SACtC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,mCAAc,CAC/B,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,EAAE;YACf,eAAe,EAAE,IAAI,CAAC,YAAY;YAClC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;SAC3D,CAAC,CACH,CAAC;QACF,MAAM,CAAC,IAA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AC,CAAC,CAAC;QAC9G,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjH,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AArLD,kDAqLC","file":"discrete-legend.js","sourcesContent":["import { cloneDeep, get, merge } from '@visactor/vutils';\nimport type { IDiscreteTableLegendOption } from '../../../ts-types/component/legend';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { DiscreteLegend, LegendEvent } from '@visactor/vrender-components';\nimport { getLegendAttributes } from './get-discrete-legend-attributes';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport { getQuadProps } from '../../../scenegraph/utils/padding';\nimport type { IOrientType } from '../../../ts-types/component/util';\n\nexport class DiscreteTableLegend {\n table: BaseTableAPI;\n option: IDiscreteTableLegendOption;\n orient: IOrientType;\n visible: boolean;\n position: 'start' | 'middle' | 'end';\n selectedData: (string | number)[];\n legendComponent: DiscreteLegend;\n\n constructor(option: IDiscreteTableLegendOption, table: BaseTableAPI) {\n this.table = table;\n this.option = cloneDeep(option);\n this.orient = option.orient ?? 'left';\n this.visible = option.visible ?? true;\n this.position = option.position ?? 'middle';\n this.selectedData = option.defaultSelected ?? null;\n\n this.createComponent();\n this.initEvent();\n }\n\n createComponent() {\n const attrs = this.getLegendAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n const legend = new DiscreteLegend(\n merge({}, attrs, {\n defaultSelected: this.selectedData,\n disableTriggerEvent: this.table.options.disableInteraction\n })\n );\n legend.name = 'legend';\n this.legendComponent = legend;\n this.table.scenegraph.stage.defaultLayer.appendChild(legend);\n\n this.adjustTableSize(attrs);\n }\n\n resize() {\n if (!this.legendComponent) {\n return;\n }\n\n this.legendComponent.setAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n this.adjustTableSize(this.legendComponent.attribute);\n }\n\n adjustTableSize(attrs: any) {\n // 调整位置\n let width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n let height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n if (width <= 0 || height <= 0) {\n return;\n }\n const rectWidth = this.table.tableNoFrameWidth;\n const rectHeight = this.table.tableNoFrameHeight;\n const padding = getQuadProps(attrs.padding ?? this.option.padding ?? 10);\n\n let x = 0;\n let y = 0;\n if (this.orient === 'left') {\n x = padding[3];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'top') {\n x = 0;\n y = padding[0];\n height += padding[0] + padding[2];\n } else if (this.orient === 'right') {\n x = rectWidth - width - padding[1];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'bottom') {\n x = 0;\n y = rectHeight - height - padding[2];\n height += padding[0] + padding[2];\n }\n\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const position = this.position;\n // const { width: rectWidth, height: rectHeight } = fullSpace;\n let offsetX = 0;\n let offsetY = 0;\n if (layout === 'horizontal') {\n if (position === 'middle') {\n offsetX = (rectWidth - width) / 2;\n } else if (position === 'end') {\n offsetX = rectWidth - width - padding[1];\n } else {\n offsetX = padding[3];\n }\n } else {\n if (position === 'middle') {\n offsetY = (rectHeight - height) / 2;\n } else if (position === 'end') {\n offsetY = rectHeight - height - padding[2];\n } else {\n offsetY = padding[0];\n }\n }\n\n this.legendComponent.setAttributes({\n dx: offsetX,\n dy: offsetY,\n x,\n y\n });\n\n // update table size\n if (this.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n }\n\n getLegendAttributes(rect: any) {\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const attrs = {\n layout,\n items: this.getLegendItems(),\n // zIndex: this.layoutZIndex,\n maxWidth: rect.width,\n maxHeight: rect.height,\n ...getLegendAttributes(this.option, rect)\n };\n return attrs;\n }\n\n getLegendItems() {\n return this.option.data;\n }\n\n initEvent() {\n if (this.legendComponent) {\n this.legendComponent.addEventListener(LegendEvent.legendItemClick, (e: any) => {\n const selectedData = get(e, 'detail.currentSelected');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_CLICK, { model: this, value: selectedData, event: e });\n });\n\n this.legendComponent.addEventListener(LegendEvent.legendItemHover, (e: any) => {\n const detail = get(e, 'detail');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_HOVER, { model: this, value: detail, event: e });\n });\n\n this.legendComponent.addEventListener(LegendEvent.legendItemUnHover, (e: any) => {\n const detail = get(e, 'detail');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_UNHOVER, { model: this, value: detail, event: e });\n });\n\n // wait for vrender-vcomponent version update\n this.legendComponent.addEventListener('legendItemAttributeUpdate', (e: any) => {\n this.table.scenegraph.updateNextFrame();\n });\n }\n }\n\n getLegendBounds() {\n const width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n const height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n\n return {\n width: width,\n height: height\n };\n }\n release() {\n this.legendComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent);\n this.legendComponent = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/legend/discrete-legend/discrete-legend.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAGzD,qEAA2E;AAC3E,qFAAuE;AACvE,qEAAkE;AAClE,+DAAiE;AAGjE,MAAa,mBAAmB;IAS9B,YAAY,MAAkC,EAAE,KAAmB;;QACjE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAA,MAAM,CAAC,MAAM,mCAAI,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAI,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,MAAA,MAAM,CAAC,QAAQ,mCAAI,QAAQ,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,IAAI,CAAC;QAEnD,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC;YACrC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB;YACnC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;SACtC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,mCAAc,CAC/B,IAAA,cAAK,EAAC,EAAE,EAAE,KAAK,EAAE;YACf,eAAe,EAAE,IAAI,CAAC,YAAY;SACnC,CAAC,CACH,CAAC;QACF,MAAM,CAA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AC,CAAC,CAAC,CAAC;QAC9G,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjH,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnG,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF;AApLD,kDAoLC","file":"discrete-legend.js","sourcesContent":["import { cloneDeep, get, merge } from '@visactor/vutils';\nimport type { IDiscreteTableLegendOption } from '../../../ts-types/component/legend';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { DiscreteLegend, LegendEvent } from '@visactor/vrender-components';\nimport { getLegendAttributes } from './get-discrete-legend-attributes';\nimport { TABLE_EVENT_TYPE } from '../../../core/TABLE_EVENT_TYPE';\nimport { getQuadProps } from '../../../scenegraph/utils/padding';\nimport type { IOrientType } from '../../../ts-types/component/util';\n\nexport class DiscreteTableLegend {\n table: BaseTableAPI;\n option: IDiscreteTableLegendOption;\n orient: IOrientType;\n visible: boolean;\n position: 'start' | 'middle' | 'end';\n selectedData: (string | number)[];\n legendComponent: DiscreteLegend;\n\n constructor(option: IDiscreteTableLegendOption, table: BaseTableAPI) {\n this.table = table;\n this.option = cloneDeep(option);\n this.orient = option.orient ?? 'left';\n this.visible = option.visible ?? true;\n this.position = option.position ?? 'middle';\n this.selectedData = option.defaultSelected ?? null;\n\n this.createComponent();\n this.initEvent();\n }\n\n createComponent() {\n const attrs = this.getLegendAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n const legend = new DiscreteLegend(\n merge({}, attrs, {\n defaultSelected: this.selectedData\n })\n );\n legend.name = 'legend';\n this.legendComponent = legend;\n this.table.scenegraph.stage.defaultLayer.appendChild(legend);\n\n this.adjustTableSize(attrs);\n }\n\n resize() {\n if (!this.legendComponent) {\n return;\n }\n\n this.legendComponent.setAttributes({\n width: this.table.tableNoFrameWidth,\n height: this.table.tableNoFrameHeight\n });\n\n this.adjustTableSize(this.legendComponent.attribute);\n }\n\n adjustTableSize(attrs: any) {\n // 调整位置\n let width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n let height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n if (width <= 0 || height <= 0) {\n return;\n }\n const rectWidth = this.table.tableNoFrameWidth;\n const rectHeight = this.table.tableNoFrameHeight;\n const padding = getQuadProps(attrs.padding ?? this.option.padding ?? 10);\n\n let x = 0;\n let y = 0;\n if (this.orient === 'left') {\n x = padding[3];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'top') {\n x = 0;\n y = padding[0];\n height += padding[0] + padding[2];\n } else if (this.orient === 'right') {\n x = rectWidth - width - padding[1];\n y = 0;\n width += padding[1] + padding[3];\n } else if (this.orient === 'bottom') {\n x = 0;\n y = rectHeight - height - padding[2];\n height += padding[0] + padding[2];\n }\n\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const position = this.position;\n // const { width: rectWidth, height: rectHeight } = fullSpace;\n let offsetX = 0;\n let offsetY = 0;\n if (layout === 'horizontal') {\n if (position === 'middle') {\n offsetX = (rectWidth - width) / 2;\n } else if (position === 'end') {\n offsetX = rectWidth - width - padding[1];\n } else {\n offsetX = padding[3];\n }\n } else {\n if (position === 'middle') {\n offsetY = (rectHeight - height) / 2;\n } else if (position === 'end') {\n offsetY = rectHeight - height - padding[2];\n } else {\n offsetY = padding[0];\n }\n }\n\n this.legendComponent.setAttributes({\n dx: offsetX,\n dy: offsetY,\n x,\n y\n });\n\n // update table size\n if (this.orient === 'left') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n this.table.tableX += Math.ceil(width);\n } else if (this.orient === 'top') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n this.table.tableY += Math.ceil(height);\n } else if (this.orient === 'right') {\n this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);\n } else if (this.orient === 'bottom') {\n this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);\n }\n }\n\n getLegendAttributes(rect: any) {\n const layout = this.orient === 'bottom' || this.orient === 'top' ? 'horizontal' : 'vertical';\n const attrs = {\n layout,\n items: this.getLegendItems(),\n // zIndex: this.layoutZIndex,\n maxWidth: rect.width,\n maxHeight: rect.height,\n ...getLegendAttributes(this.option, rect)\n };\n return attrs;\n }\n\n getLegendItems() {\n return this.option.data;\n }\n\n initEvent() {\n if (this.legendComponent) {\n this.legendComponent.addEventListener(LegendEvent.legendItemClick, (e: any) => {\n const selectedData = get(e, 'detail.currentSelected');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_CLICK, { model: this, value: selectedData, event: e });\n });\n\n this.legendComponent.addEventListener(LegendEvent.legendItemHover, (e: any) => {\n const detail = get(e, 'detail');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_HOVER, { model: this, value: detail, event: e });\n });\n\n this.legendComponent.addEventListener(LegendEvent.legendItemUnHover, (e: any) => {\n const detail = get(e, 'detail');\n this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_UNHOVER, { model: this, value: detail, event: e });\n });\n\n // wait for vrender-vcomponent version update\n this.legendComponent.addEventListener('legendItemAttributeUpdate', (e: any) => {\n this.table.scenegraph.updateNextFrame();\n });\n }\n }\n\n getLegendBounds() {\n const width = isFinite(this.legendComponent.AABBBounds.width()) ? this.legendComponent.AABBBounds.width() : 0;\n const height = isFinite(this.legendComponent.AABBBounds.height()) ? this.legendComponent.AABBBounds.height() : 0;\n\n return {\n width: width,\n height: height\n };\n }\n release() {\n this.legendComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent);\n this.legendComponent = null;\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import { Group } from './../../vrender';
2
+ import type { CustomRenderFunctionArg, ICustomLayoutFuc } from '../../ts-types';
3
+ import type { BaseTableAPI } from '../../ts-types/base-table';
4
+ export declare function emptyCustomLayout(args: CustomRenderFunctionArg): {
5
+ rootContainer: Group;
6
+ renderDefault: boolean;
7
+ };
8
+ export declare class ReactCustomLayout {
9
+ table: BaseTableAPI;
10
+ customLayoutFuncCache: Map<number, ICustomLayoutFuc>;
11
+ reactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;
12
+ headerCustomLayoutFuncCache: Map<number, ICustomLayoutFuc>;
13
+ headerReactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;
14
+ constructor(table: BaseTableAPI);
15
+ hasReactCreateGraphic(componentIndex: number, isHeaderCustomLayout?: boolean): boolean;
16
+ setReactCreateGraphic(componentIndex: number, createGraphic: ICustomLayoutFuc, isHeaderCustomLayout?: boolean): void;
17
+ setReactRemoveGraphic(componentIndex: number, removeGraphic: (col: number, row: number) => void, isHeaderCustomLayout?: boolean): void;
18
+ updateCustomCell(componentIndex: number, isHeaderCustomLayout?: boolean): void;
19
+ getCustomLayoutFunc(col: number, row: number): ICustomLayoutFuc | typeof emptyCustomLayout;
20
+ removeCustomCell(col: number, row: number): void;
21
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.ReactCustomLayout = exports.emptyCustomLayout = void 0;
6
+
7
+ const vrender_1 = require("./../../vrender");
8
+
9
+ function emptyCustomLayout(args) {
10
+ return {
11
+ rootContainer: new vrender_1.Group({}),
12
+ renderDefault: !0
13
+ };
14
+ }
15
+
16
+ exports.emptyCustomLayout = emptyCustomLayout;
17
+
18
+ class ReactCustomLayout {
19
+ constructor(table) {
20
+ this.table = table, this.customLayoutFuncCache = new Map, this.reactRemoveGraphicCache = new Map,
21
+ this.headerCustomLayoutFuncCache = new Map, this.headerReactRemoveGraphicCache = new Map;
22
+ }
23
+ hasReactCreateGraphic(componentIndex, isHeaderCustomLayout) {
24
+ return isHeaderCustomLayout ? this.headerCustomLayoutFuncCache.has(componentIndex) : this.customLayoutFuncCache.has(componentIndex);
25
+ }
26
+ setReactCreateGraphic(componentIndex, createGraphic, isHeaderCustomLayout) {
27
+ isHeaderCustomLayout ? this.headerCustomLayoutFuncCache.set(componentIndex, createGraphic) : this.customLayoutFuncCache.set(componentIndex, createGraphic);
28
+ }
29
+ setReactRemoveGraphic(componentIndex, removeGraphic, isHeaderCustomLayout) {
30
+ isHeaderCustomLayout ? this.headerReactRemoveGraphicCache.set(componentIndex, removeGraphic) : this.reactRemoveGraphicCache.set(componentIndex, removeGraphic);
31
+ }
32
+ updateCustomCell(componentIndex, isHeaderCustomLayout) {
33
+ const table = this.table, col = componentIndex;
34
+ if (isHeaderCustomLayout) for (let row = 0; row < table.columnHeaderLevelCount; row++) table.scenegraph.updateCellContent(col, row); else for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) table.scenegraph.updateCellContent(col, row);
35
+ table.scenegraph.renderSceneGraph();
36
+ }
37
+ getCustomLayoutFunc(col, row) {
38
+ const {startInTotal: startInTotal} = this.table.getBodyColumnDefine(col, row);
39
+ return (this.table.isHeader(col, row) ? this.headerCustomLayoutFuncCache.get(startInTotal) : this.customLayoutFuncCache.get(startInTotal)) || emptyCustomLayout;
40
+ }
41
+ removeCustomCell(col, row) {
42
+ const {startInTotal: startInTotal} = this.table.getBodyColumnDefine(col, row), removeFun = this.table.isHeader(col, row) ? this.headerReactRemoveGraphicCache.get(startInTotal) : this.reactRemoveGraphicCache.get(startInTotal);
43
+ removeFun && removeFun(col, row);
44
+ }
45
+ }
46
+
47
+ exports.ReactCustomLayout = ReactCustomLayout;
48
+ //# sourceMappingURL=react-custom-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/react/react-custom-layout.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAIxC,SAAgB,iBAAiB,CAAC,IAA6B;IAC7D,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,IAAI;KACpB,CAAC;AACJ,CAAC;AAND,8CAMC;AAED,MAAa,iBAAiB;IAO5B,YAAY,KAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,EAAE,CAAC;QAEvC,IAAI,CAAC,uBAAuB,GAAG,IAAI,GAAG,EAAE,CAAC;QACzC,IAAI,CAAC,2BAA2B,GAAG,IAAI,GAAG,EAAE,CAAC;QAE7C,IAAI,CAAC,6BAA6B,GAAG,IAAI,GAAG,EAAE,CAAC;IACjD,CAAC;IAED,qBAAqB,CAAC,cAAsB,EAAE,oBAA8B;QAC1E,IAAI,oBAAoB,EAAE;YACxB,OAAO,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;SAC7D;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACxD,CAAC;IAED,qBAAqB,CACnB,cAAsB,EACtB,aAA+B,EAE/B,oBAA8B;QAE9B,IAAI,oBAAoB,EAAE;YACxB,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;SACrE;aAAM;YACL,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;SAC/D;IAEH,CAAC;IAED,qBAAqB,CACnB,cAAsB,EACtB,aAAiD,EACjD,oBAA8B;QAE9B,IAAI,oB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C;IACJ,CAAC;IAED,gBAAgB,CAAC,GAAW,EAAE,GAAW;QACvC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAQ,CAAC;QACzE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,QAAQ;YACxB,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAAC,YAAY,CAAC;YACtD,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACnD,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SACrB;IACH,CAAC;CACF;AAtFD,8CAsFC","file":"react-custom-layout.js","sourcesContent":["import { Group } from './../../vrender';\nimport type { CustomRenderFunctionArg, ICustomLayoutFuc } from '../../ts-types';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\n\nexport function emptyCustomLayout(args: CustomRenderFunctionArg) {\n const group = new Group({});\n return {\n rootContainer: group,\n renderDefault: true\n };\n}\n\nexport class ReactCustomLayout {\n table: BaseTableAPI;\n customLayoutFuncCache: Map<number, ICustomLayoutFuc>;\n reactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;\n headerCustomLayoutFuncCache: Map<number, ICustomLayoutFuc>;\n headerReactRemoveGraphicCache: Map<number, (col: number, row: number) => void>;\n // reactContainerCache: Map<number, Map<string, any>>;\n constructor(table: BaseTableAPI) {\n this.table = table;\n this.customLayoutFuncCache = new Map();\n // this.reactContainerCache = new Map();\n this.reactRemoveGraphicCache = new Map();\n this.headerCustomLayoutFuncCache = new Map();\n // this.headerCeactContainerCache = new Map();\n this.headerReactRemoveGraphicCache = new Map();\n }\n\n hasReactCreateGraphic(componentIndex: number, isHeaderCustomLayout?: boolean) {\n if (isHeaderCustomLayout) {\n return this.headerCustomLayoutFuncCache.has(componentIndex);\n }\n return this.customLayoutFuncCache.has(componentIndex);\n }\n\n setReactCreateGraphic(\n componentIndex: number,\n createGraphic: ICustomLayoutFuc,\n // containerCache: Map<string, any>,\n isHeaderCustomLayout?: boolean\n ) {\n if (isHeaderCustomLayout) {\n this.headerCustomLayoutFuncCache.set(componentIndex, createGraphic);\n } else {\n this.customLayoutFuncCache.set(componentIndex, createGraphic);\n }\n // this.reactContainerCache.set(componentIndex, containerCache);\n }\n\n setReactRemoveGraphic(\n componentIndex: number,\n removeGraphic: (col: number, row: number) => void,\n isHeaderCustomLayout?: boolean\n ) {\n if (isHeaderCustomLayout) {\n this.headerReactRemoveGraphicCache.set(componentIndex, removeGraphic);\n } else {\n this.reactRemoveGraphicCache.set(componentIndex, removeGraphic);\n }\n }\n\n updateCustomCell(componentIndex: number, isHeaderCustomLayout?: boolean) {\n const table = this.table;\n const col = componentIndex;\n // to do: deal with transpose table\n if (isHeaderCustomLayout) {\n for (let row = 0; row < table.columnHeaderLevelCount; row++) {\n table.scenegraph.updateCellContent(col, row);\n }\n } else {\n for (let row = table.columnHeaderLevelCount; row < table.rowCount; row++) {\n table.scenegraph.updateCellContent(col, row);\n }\n }\n // table.scenegraph.updateNextFrame();\n table.scenegraph.renderSceneGraph(); // use sync render for faster update\n }\n\n getCustomLayoutFunc(col: number, row: number) {\n const { startInTotal } = this.table.getBodyColumnDefine(col, row) as any;\n const isHeader = this.table.isHeader(col, row);\n return (\n (isHeader ? this.headerCustomLayoutFuncCache.get(startInTotal) : this.customLayoutFuncCache.get(startInTotal)) ||\n emptyCustomLayout\n );\n }\n\n removeCustomCell(col: number, row: number) {\n const { startInTotal } = this.table.getBodyColumnDefine(col, row) as any;\n const isHeader = this.table.isHeader(col, row);\n const removeFun = isHeader\n ? this.headerReactRemoveGraphicCache.get(startInTotal)\n : this.reactRemoveGraphicCache.get(startInTotal);\n if (removeFun) {\n removeFun(col, row);\n }\n }\n}\n"]}
@@ -99,9 +99,7 @@ class TooltipHandler {
99
99
  rect: rect
100
100
  },
101
101
  disappearDelay: null !== (_a = table.internalProps.tooltip.overflowTextTooltipDisappearDelay) && void 0 !== _a ? _a : 0,
102
- style: {
103
- arrowMark: !1
104
- }
102
+ style: table.theme.tooltipStyle
105
103
  };
106
104
  } else if (null === (_b = table.internalProps.tooltip) || void 0 === _b ? void 0 : _b.isShowOverflowTextTooltip) {
107
105
  const overflowText = table.getCellOverflowText(col, row), rect = table.getCellRangeRelativeRect({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/tooltip/TooltipHandler.ts"],"names":[],"mappings":";;;AACA,6CAA2C;AAE3C,uCAA0C;AAC1C,+CAAiD;AACjD,2CAA4C;AAG5C,kEAA+D;AAE/D,MAAM,wBAAwB,GAAG;IAI/B,gBAAgB,EAAE,UAAU,KAAmB;QAC7C,OAAO,IAAI,uBAAa,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF,CAAC;AAOF,MAAa,cAAc;IAKzB,YAAY,KAAmB,EAAE,OAAgB;QAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,OAAO;;QACL,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAChD,KAAK,MAAM,CAAC,IAAI,gBAAgB,EAAE;YAChC,MAAA,MAAA,gBAAgB,CAAC,CAAC,CAAC,0CAAE,OAAO,kDAAI,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IACD,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,cAA+B;;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;QAC9B,MAAM,QAAQ,G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AAM,QAAQ,GACZ,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;YACnD,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvG,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,QAAQ,CAAC,cAA8B;;QACrC,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAA,IAAI,CAAC,WAAW,0CAAE,cAAc,CAAC,EAAE;YACvF,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA5ND,wCA4NC","file":"TooltipHandler.js","sourcesContent":["import type { CellRange, RectProps } from '../../ts-types';\nimport { 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';\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};\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, false);\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: Placement.bottom,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: { arrowMark: false }\n };\n } else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {\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: Placement.bottom,\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":";;;AACA,6CAA2C;AAE3C,uCAA0C;AAC1C,+CAAiD;AACjD,2CAA4C;AAG5C,kEAA+D;AAE/D,MAAM,wBAAwB,GAAG;IAI/B,gBAAgB,EAA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CellRange, RectProps } from '../../ts-types';\nimport { 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';\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};\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, false);\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: Placement.bottom,\n rect\n },\n disappearDelay: table.internalProps.tooltip.overflowTextTooltipDisappearDelay ?? 0,\n style: table.theme.tooltipStyle\n };\n } else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {\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: Placement.bottom,\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"]}
@@ -14,17 +14,19 @@ class BubbleTooltipElement {
14
14
  constructor() {
15
15
  this._handler = new EventHandler_1.EventHandler;
16
16
  const rootElement = this._rootElement = (0, dom_1.createElement)("div", [ TOOLTIP_CLASS, HIDDEN_CLASS ]), messageElement = (0,
17
- dom_1.createElement)("span", [ CONTENT_CLASS ]), triangle = (0, dom_1.createElement)("span", [ TRIANGLE_CLASS ]);
17
+ dom_1.createElement)("div", [ CONTENT_CLASS ]), triangle = (0, dom_1.createElement)("span", [ TRIANGLE_CLASS ]);
18
18
  rootElement.appendChild(triangle), rootElement.appendChild(messageElement), this._messageElement = rootElement.querySelector(`.${CONTENT_CLASS}`) || void 0,
19
19
  this._triangleElement = rootElement.querySelector(`.${TRIANGLE_CLASS}`) || void 0,
20
20
  rootElement.addEventListener("mousemove", (() => {
21
21
  this._disappearDelayId && clearTimeout(this._disappearDelayId);
22
22
  })), rootElement.addEventListener("mouseleave", (() => {
23
23
  this._disappearDelay = void 0, this.unbindFromCell();
24
+ })), messageElement.addEventListener("wheel", (e => {
25
+ e.stopPropagation();
24
26
  }));
25
27
  }
26
28
  bindToCell(table, col, row, tooltipInstanceInfo, confine) {
27
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
28
30
  this._disappearDelay = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.disappearDelay,
29
31
  this._disappearDelayId && clearTimeout(this._disappearDelayId);
30
32
  const rootElement = this._rootElement, messageElement = this._messageElement, triangle = this._triangleElement;
@@ -38,8 +40,10 @@ class BubbleTooltipElement {
38
40
  (null === (_j = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _j ? void 0 : _j.fontFamily) && (messageElement.style.fontFamily = null === (_k = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _k ? void 0 : _k.fontFamily),
39
41
  (null === (_l = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _l ? void 0 : _l.color) && (messageElement.style.color = null === (_m = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _m ? void 0 : _m.color),
40
42
  (null === (_o = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _o ? void 0 : _o.padding) && (messageElement.style.padding = `${null === (_p = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _p ? void 0 : _p.padding.join("px ")}px`),
43
+ (null === (_q = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _q ? void 0 : _q.maxHeight) && (messageElement.style.maxHeight = `${null === (_r = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _r ? void 0 : _r.maxHeight}px`),
44
+ (null === (_s = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _s ? void 0 : _s.maxWidth) && (messageElement.style.maxWidth = `${null === (_t = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _t ? void 0 : _t.maxWidth}px`),
41
45
  messageElement && (messageElement.textContent = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.content);
42
- if (this._bindToCell(table, col, row, null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.position, null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.referencePosition, confine, null === (_q = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _q ? void 0 : _q.arrowMark)) return null == rootElement || rootElement.classList.add(SHOWN_CLASS),
46
+ if (this._bindToCell(table, col, row, null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.position, null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.referencePosition, confine, null === (_u = null == tooltipInstanceInfo ? void 0 : tooltipInstanceInfo.style) || void 0 === _u ? void 0 : _u.arrowMark)) return null == rootElement || rootElement.classList.add(SHOWN_CLASS),
43
47
  null == rootElement || rootElement.classList.remove(HIDDEN_CLASS), !0;
44
48
  } else this.unbindFromCell();
45
49
  return !1;