@visactor/vchart 1.12.15 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +2381 -1727
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/animation/utils.js +8 -6
  6. package/cjs/animation/utils.js.map +1 -1
  7. package/cjs/chart/base/base-chart.d.ts +1 -0
  8. package/cjs/chart/base/base-chart.js +3 -0
  9. package/cjs/chart/base/base-chart.js.map +1 -1
  10. package/cjs/chart/index.d.ts +5 -3
  11. package/cjs/chart/index.js +16 -2
  12. package/cjs/chart/index.js.map +1 -1
  13. package/cjs/chart/interface/chart.d.ts +1 -0
  14. package/cjs/chart/interface/chart.js.map +1 -1
  15. package/cjs/chart/interface/type.d.ts +2 -1
  16. package/cjs/chart/interface/type.js +1 -1
  17. package/cjs/chart/interface/type.js.map +1 -1
  18. package/cjs/chart/pictogram/index.d.ts +3 -0
  19. package/cjs/{plugin/components/tooltip-handler/canvas → chart/pictogram}/index.js +2 -1
  20. package/cjs/chart/pictogram/index.js.map +1 -0
  21. package/cjs/chart/pictogram/interface.d.ts +6 -0
  22. package/cjs/chart/pictogram/interface.js.map +1 -0
  23. package/cjs/chart/pictogram/pictogram-transformer.d.ts +8 -0
  24. package/cjs/chart/pictogram/pictogram-transformer.js +38 -0
  25. package/cjs/chart/pictogram/pictogram-transformer.js.map +1 -0
  26. package/cjs/chart/pictogram/pictogram.d.ts +12 -0
  27. package/cjs/chart/pictogram/pictogram.js +24 -0
  28. package/cjs/chart/pictogram/pictogram.js.map +1 -0
  29. package/cjs/chart/sankey/sankey-transformer.js +2 -1
  30. package/cjs/chart/sankey/sankey-transformer.js.map +1 -1
  31. package/cjs/chart/sankey/sankey.js +3 -2
  32. package/cjs/chart/sankey/sankey.js.map +1 -1
  33. package/cjs/compile/mark/compilable-mark.js +1 -1
  34. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  35. package/cjs/component/custom-mark/custom-mark.js +7 -1
  36. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  37. package/cjs/component/geo/geo-coordinate.js +6 -6
  38. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  39. package/cjs/component/tooltip/interface/theme.d.ts +2 -2
  40. package/cjs/component/tooltip/interface/theme.js.map +1 -1
  41. package/cjs/component/tooltip/utils/get-value.js +3 -1
  42. package/cjs/component/tooltip/utils/get-value.js.map +1 -1
  43. package/cjs/core/index.d.ts +1 -1
  44. package/cjs/core/index.js +1 -1
  45. package/cjs/core/index.js.map +1 -1
  46. package/cjs/core/vchart.d.ts +4 -1
  47. package/cjs/core/vchart.js +21 -7
  48. package/cjs/core/vchart.js.map +1 -1
  49. package/cjs/data/transforms/pictogram.d.ts +84 -0
  50. package/cjs/data/transforms/pictogram.js +149 -0
  51. package/cjs/data/transforms/pictogram.js.map +1 -0
  52. package/cjs/mark/group.d.ts +3 -2
  53. package/cjs/mark/group.js +12 -2
  54. package/cjs/mark/group.js.map +1 -1
  55. package/cjs/mark/interface/type.d.ts +2 -1
  56. package/cjs/mark/interface/type.js +2 -1
  57. package/cjs/mark/interface/type.js.map +1 -1
  58. package/cjs/plugin/components/tooltip-handler/base.d.ts +4 -6
  59. package/cjs/plugin/components/tooltip-handler/base.js +3 -20
  60. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  61. package/cjs/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.d.ts → canvas-tooltip-handler.d.ts} +8 -3
  62. package/cjs/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.js → canvas-tooltip-handler.js} +15 -2
  63. package/cjs/plugin/components/tooltip-handler/canvas-tooltip-handler.js.map +1 -0
  64. package/cjs/plugin/components/tooltip-handler/constants.d.ts +7 -8
  65. package/cjs/plugin/components/tooltip-handler/constants.js +6 -9
  66. package/cjs/plugin/components/tooltip-handler/constants.js.map +1 -1
  67. package/cjs/plugin/components/tooltip-handler/{dom/dom-tooltip-handler.d.ts → dom-tooltip-handler.d.ts} +20 -9
  68. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +187 -0
  69. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -0
  70. package/cjs/plugin/components/tooltip-handler/index.d.ts +2 -2
  71. package/cjs/plugin/components/tooltip-handler/index.js +1 -1
  72. package/cjs/plugin/components/tooltip-handler/index.js.map +1 -1
  73. package/cjs/plugin/components/tooltip-handler/interface/index.d.ts +15 -2
  74. package/cjs/plugin/components/tooltip-handler/interface/index.js +1 -16
  75. package/cjs/plugin/components/tooltip-handler/interface/index.js.map +1 -1
  76. package/cjs/plugin/components/tooltip-handler/utils/attribute.d.ts +9 -2
  77. package/cjs/plugin/components/tooltip-handler/utils/attribute.js +36 -18
  78. package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  79. package/cjs/plugin/components/tooltip-handler/utils/common.d.ts +1 -12
  80. package/cjs/plugin/components/tooltip-handler/utils/common.js +7 -35
  81. package/cjs/plugin/components/tooltip-handler/utils/common.js.map +1 -1
  82. package/cjs/plugin/components/tooltip-handler/utils/style.d.ts +18 -0
  83. package/cjs/plugin/components/tooltip-handler/utils/style.js +94 -0
  84. package/cjs/plugin/components/tooltip-handler/utils/style.js.map +1 -0
  85. package/cjs/plugin/components/tooltip-handler/utils/svg.d.ts +2 -0
  86. package/cjs/plugin/components/tooltip-handler/utils/svg.js +48 -0
  87. package/cjs/plugin/components/tooltip-handler/utils/svg.js.map +1 -0
  88. package/cjs/series/base/base-series.d.ts +22 -6
  89. package/cjs/series/base/base-series.js +33 -24
  90. package/cjs/series/base/base-series.js.map +1 -1
  91. package/cjs/series/interface/type.d.ts +4 -2
  92. package/cjs/series/interface/type.js +4 -2
  93. package/cjs/series/interface/type.js.map +1 -1
  94. package/cjs/series/pictogram/constant.d.ts +2 -0
  95. package/cjs/series/pictogram/constant.js +15 -0
  96. package/cjs/series/pictogram/constant.js.map +1 -0
  97. package/cjs/series/pictogram/interface.d.ts +15 -0
  98. package/cjs/series/pictogram/interface.js.map +1 -0
  99. package/cjs/series/pictogram/pictogram-transformer.d.ts +5 -0
  100. package/cjs/series/pictogram/pictogram-transformer.js +23 -0
  101. package/cjs/series/pictogram/pictogram-transformer.js.map +1 -0
  102. package/cjs/series/pictogram/pictogram.d.ts +77 -0
  103. package/cjs/series/pictogram/pictogram.js +303 -0
  104. package/cjs/series/pictogram/pictogram.js.map +1 -0
  105. package/cjs/series/pictogram/svg-source.d.ts +7 -0
  106. package/cjs/series/pictogram/svg-source.js +38 -0
  107. package/cjs/series/pictogram/svg-source.js.map +1 -0
  108. package/cjs/series/pictogram/tooltip-helper.d.ts +9 -0
  109. package/cjs/series/pictogram/tooltip-helper.js +26 -0
  110. package/cjs/series/pictogram/tooltip-helper.js.map +1 -0
  111. package/cjs/series/sankey/interface.d.ts +1 -0
  112. package/cjs/series/sankey/interface.js.map +1 -1
  113. package/cjs/series/sankey/sankey.js +4 -0
  114. package/cjs/series/sankey/sankey.js.map +1 -1
  115. package/cjs/typings/spec/common.d.ts +1 -0
  116. package/cjs/typings/spec/common.js.map +1 -1
  117. package/cjs/typings/tooltip/common.d.ts +3 -1
  118. package/cjs/typings/tooltip/common.js.map +1 -1
  119. package/esm/animation/utils.js +8 -6
  120. package/esm/animation/utils.js.map +1 -1
  121. package/esm/chart/base/base-chart.d.ts +1 -0
  122. package/esm/chart/base/base-chart.js +3 -0
  123. package/esm/chart/base/base-chart.js.map +1 -1
  124. package/esm/chart/index.d.ts +5 -3
  125. package/esm/chart/index.js +4 -2
  126. package/esm/chart/index.js.map +1 -1
  127. package/esm/chart/interface/chart.d.ts +1 -0
  128. package/esm/chart/interface/chart.js.map +1 -1
  129. package/esm/chart/interface/type.d.ts +2 -1
  130. package/esm/chart/interface/type.js +1 -1
  131. package/esm/chart/interface/type.js.map +1 -1
  132. package/esm/chart/pictogram/index.d.ts +3 -0
  133. package/esm/chart/pictogram/index.js +6 -0
  134. package/esm/chart/pictogram/index.js.map +1 -0
  135. package/esm/chart/pictogram/interface.d.ts +6 -0
  136. package/esm/chart/pictogram/interface.js.map +1 -0
  137. package/esm/chart/pictogram/pictogram-transformer.d.ts +8 -0
  138. package/esm/chart/pictogram/pictogram-transformer.js +32 -0
  139. package/esm/chart/pictogram/pictogram-transformer.js.map +1 -0
  140. package/esm/chart/pictogram/pictogram.d.ts +12 -0
  141. package/esm/chart/pictogram/pictogram.js +24 -0
  142. package/esm/chart/pictogram/pictogram.js.map +1 -0
  143. package/esm/chart/sankey/sankey-transformer.js +2 -1
  144. package/esm/chart/sankey/sankey-transformer.js.map +1 -1
  145. package/esm/chart/sankey/sankey.js +3 -1
  146. package/esm/chart/sankey/sankey.js.map +1 -1
  147. package/esm/compile/mark/compilable-mark.js +1 -1
  148. package/esm/compile/mark/compilable-mark.js.map +1 -1
  149. package/esm/component/custom-mark/custom-mark.js +7 -1
  150. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  151. package/esm/component/geo/geo-coordinate.js +6 -6
  152. package/esm/component/geo/geo-coordinate.js.map +1 -1
  153. package/esm/component/tooltip/interface/theme.d.ts +2 -2
  154. package/esm/component/tooltip/interface/theme.js.map +1 -1
  155. package/esm/component/tooltip/utils/get-value.js +3 -2
  156. package/esm/component/tooltip/utils/get-value.js.map +1 -1
  157. package/esm/core/index.d.ts +1 -1
  158. package/esm/core/index.js +1 -1
  159. package/esm/core/index.js.map +1 -1
  160. package/esm/core/vchart.d.ts +4 -1
  161. package/esm/core/vchart.js +23 -6
  162. package/esm/core/vchart.js.map +1 -1
  163. package/esm/data/transforms/pictogram.d.ts +84 -0
  164. package/esm/data/transforms/pictogram.js +145 -0
  165. package/esm/data/transforms/pictogram.js.map +1 -0
  166. package/esm/mark/group.d.ts +3 -2
  167. package/esm/mark/group.js +12 -2
  168. package/esm/mark/group.js.map +1 -1
  169. package/esm/mark/interface/type.d.ts +2 -1
  170. package/esm/mark/interface/type.js +2 -1
  171. package/esm/mark/interface/type.js.map +1 -1
  172. package/esm/plugin/components/tooltip-handler/base.d.ts +4 -6
  173. package/esm/plugin/components/tooltip-handler/base.js +3 -22
  174. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  175. package/esm/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.d.ts → canvas-tooltip-handler.d.ts} +8 -3
  176. package/esm/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.js → canvas-tooltip-handler.js} +19 -5
  177. package/esm/plugin/components/tooltip-handler/canvas-tooltip-handler.js.map +1 -0
  178. package/esm/plugin/components/tooltip-handler/constants.d.ts +7 -8
  179. package/esm/plugin/components/tooltip-handler/constants.js +9 -4
  180. package/esm/plugin/components/tooltip-handler/constants.js.map +1 -1
  181. package/esm/plugin/components/tooltip-handler/{dom/dom-tooltip-handler.d.ts → dom-tooltip-handler.d.ts} +20 -9
  182. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +191 -0
  183. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -0
  184. package/esm/plugin/components/tooltip-handler/index.d.ts +2 -2
  185. package/esm/plugin/components/tooltip-handler/index.js +2 -2
  186. package/esm/plugin/components/tooltip-handler/index.js.map +1 -1
  187. package/esm/plugin/components/tooltip-handler/interface/index.d.ts +15 -2
  188. package/esm/plugin/components/tooltip-handler/interface/index.js +1 -3
  189. package/esm/plugin/components/tooltip-handler/interface/index.js.map +1 -1
  190. package/esm/plugin/components/tooltip-handler/utils/attribute.d.ts +9 -2
  191. package/esm/plugin/components/tooltip-handler/utils/attribute.js +31 -11
  192. package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  193. package/esm/plugin/components/tooltip-handler/utils/common.d.ts +1 -12
  194. package/esm/plugin/components/tooltip-handler/utils/common.js +3 -31
  195. package/esm/plugin/components/tooltip-handler/utils/common.js.map +1 -1
  196. package/esm/plugin/components/tooltip-handler/utils/style.d.ts +18 -0
  197. package/esm/plugin/components/tooltip-handler/utils/style.js +80 -0
  198. package/esm/plugin/components/tooltip-handler/utils/style.js.map +1 -0
  199. package/esm/plugin/components/tooltip-handler/utils/svg.d.ts +2 -0
  200. package/esm/plugin/components/tooltip-handler/utils/svg.js +42 -0
  201. package/esm/plugin/components/tooltip-handler/utils/svg.js.map +1 -0
  202. package/esm/series/base/base-series.d.ts +22 -6
  203. package/esm/series/base/base-series.js +33 -23
  204. package/esm/series/base/base-series.js.map +1 -1
  205. package/esm/series/interface/type.d.ts +4 -2
  206. package/esm/series/interface/type.js +4 -2
  207. package/esm/series/interface/type.js.map +1 -1
  208. package/esm/series/pictogram/constant.d.ts +2 -0
  209. package/esm/series/pictogram/constant.js +9 -0
  210. package/esm/series/pictogram/constant.js.map +1 -0
  211. package/esm/series/pictogram/interface.d.ts +15 -0
  212. package/esm/series/pictogram/interface.js.map +1 -0
  213. package/esm/series/pictogram/pictogram-transformer.d.ts +5 -0
  214. package/esm/series/pictogram/pictogram-transformer.js +19 -0
  215. package/esm/series/pictogram/pictogram-transformer.js.map +1 -0
  216. package/esm/series/pictogram/pictogram.d.ts +77 -0
  217. package/esm/series/pictogram/pictogram.js +329 -0
  218. package/esm/series/pictogram/pictogram.js.map +1 -0
  219. package/esm/series/pictogram/svg-source.d.ts +7 -0
  220. package/esm/series/pictogram/svg-source.js +35 -0
  221. package/esm/series/pictogram/svg-source.js.map +1 -0
  222. package/esm/series/pictogram/tooltip-helper.d.ts +9 -0
  223. package/esm/series/pictogram/tooltip-helper.js +18 -0
  224. package/esm/series/pictogram/tooltip-helper.js.map +1 -0
  225. package/esm/series/sankey/interface.d.ts +1 -0
  226. package/esm/series/sankey/interface.js.map +1 -1
  227. package/esm/series/sankey/sankey.js +4 -0
  228. package/esm/series/sankey/sankey.js.map +1 -1
  229. package/esm/typings/spec/common.d.ts +1 -0
  230. package/esm/typings/spec/common.js.map +1 -1
  231. package/esm/typings/tooltip/common.d.ts +3 -1
  232. package/esm/typings/tooltip/common.js.map +1 -1
  233. package/package.json +15 -15
  234. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +0 -1
  235. package/cjs/plugin/components/tooltip-handler/canvas/index.d.ts +0 -1
  236. package/cjs/plugin/components/tooltip-handler/canvas/index.js.map +0 -1
  237. package/cjs/plugin/components/tooltip-handler/dom/constant.d.ts +0 -1
  238. package/cjs/plugin/components/tooltip-handler/dom/constant.js +0 -6
  239. package/cjs/plugin/components/tooltip-handler/dom/constant.js.map +0 -1
  240. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +0 -98
  241. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +0 -1
  242. package/cjs/plugin/components/tooltip-handler/dom/index.d.ts +0 -1
  243. package/cjs/plugin/components/tooltip-handler/dom/index.js +0 -21
  244. package/cjs/plugin/components/tooltip-handler/dom/index.js.map +0 -1
  245. package/cjs/plugin/components/tooltip-handler/dom/interface.d.ts +0 -58
  246. package/cjs/plugin/components/tooltip-handler/dom/interface.js.map +0 -1
  247. package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +0 -25
  248. package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js +0 -73
  249. package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +0 -1
  250. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +0 -23
  251. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +0 -126
  252. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +0 -1
  253. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.d.ts +0 -14
  254. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js +0 -54
  255. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +0 -1
  256. package/cjs/plugin/components/tooltip-handler/dom/model/interface.d.ts +0 -10
  257. package/cjs/plugin/components/tooltip-handler/dom/model/interface.js.map +0 -1
  258. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.d.ts +0 -23
  259. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +0 -69
  260. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +0 -1
  261. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.d.ts +0 -7
  262. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js +0 -34
  263. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js.map +0 -1
  264. package/cjs/plugin/components/tooltip-handler/dom/model/text-model.d.ts +0 -5
  265. package/cjs/plugin/components/tooltip-handler/dom/model/text-model.js +0 -21
  266. package/cjs/plugin/components/tooltip-handler/dom/model/text-model.js.map +0 -1
  267. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.d.ts +0 -15
  268. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js +0 -66
  269. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +0 -1
  270. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.d.ts +0 -21
  271. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js +0 -79
  272. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +0 -1
  273. package/cjs/plugin/components/tooltip-handler/dom/utils/common.d.ts +0 -3
  274. package/cjs/plugin/components/tooltip-handler/dom/utils/common.js +0 -33
  275. package/cjs/plugin/components/tooltip-handler/dom/utils/common.js.map +0 -1
  276. package/cjs/plugin/components/tooltip-handler/dom/utils/index.d.ts +0 -2
  277. package/cjs/plugin/components/tooltip-handler/dom/utils/index.js +0 -21
  278. package/cjs/plugin/components/tooltip-handler/dom/utils/index.js.map +0 -1
  279. package/cjs/plugin/components/tooltip-handler/dom/utils/style.d.ts +0 -4
  280. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +0 -91
  281. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +0 -1
  282. package/cjs/plugin/components/tooltip-handler/interface/common.d.ts +0 -4
  283. package/cjs/plugin/components/tooltip-handler/interface/common.js +0 -6
  284. package/cjs/plugin/components/tooltip-handler/interface/common.js.map +0 -1
  285. package/cjs/plugin/components/tooltip-handler/interface/style.d.ts +0 -13
  286. package/cjs/plugin/components/tooltip-handler/interface/style.js +0 -6
  287. package/cjs/plugin/components/tooltip-handler/interface/style.js.map +0 -1
  288. package/cjs/plugin/components/tooltip-handler/utils/index.d.ts +0 -3
  289. package/cjs/plugin/components/tooltip-handler/utils/index.js +0 -22
  290. package/cjs/plugin/components/tooltip-handler/utils/index.js.map +0 -1
  291. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +0 -1
  292. package/esm/plugin/components/tooltip-handler/canvas/index.d.ts +0 -1
  293. package/esm/plugin/components/tooltip-handler/canvas/index.js +0 -2
  294. package/esm/plugin/components/tooltip-handler/canvas/index.js.map +0 -1
  295. package/esm/plugin/components/tooltip-handler/dom/constant.d.ts +0 -1
  296. package/esm/plugin/components/tooltip-handler/dom/constant.js +0 -2
  297. package/esm/plugin/components/tooltip-handler/dom/constant.js.map +0 -1
  298. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +0 -104
  299. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +0 -1
  300. package/esm/plugin/components/tooltip-handler/dom/index.d.ts +0 -1
  301. package/esm/plugin/components/tooltip-handler/dom/index.js +0 -2
  302. package/esm/plugin/components/tooltip-handler/dom/index.js.map +0 -1
  303. package/esm/plugin/components/tooltip-handler/dom/interface.d.ts +0 -58
  304. package/esm/plugin/components/tooltip-handler/dom/interface.js.map +0 -1
  305. package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +0 -25
  306. package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js +0 -67
  307. package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +0 -1
  308. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +0 -23
  309. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +0 -130
  310. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +0 -1
  311. package/esm/plugin/components/tooltip-handler/dom/model/content-model.d.ts +0 -14
  312. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js +0 -52
  313. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +0 -1
  314. package/esm/plugin/components/tooltip-handler/dom/model/interface.d.ts +0 -10
  315. package/esm/plugin/components/tooltip-handler/dom/model/interface.js.map +0 -1
  316. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.d.ts +0 -23
  317. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +0 -66
  318. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +0 -1
  319. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.d.ts +0 -7
  320. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js +0 -41
  321. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js.map +0 -1
  322. package/esm/plugin/components/tooltip-handler/dom/model/text-model.d.ts +0 -5
  323. package/esm/plugin/components/tooltip-handler/dom/model/text-model.js +0 -13
  324. package/esm/plugin/components/tooltip-handler/dom/model/text-model.js.map +0 -1
  325. package/esm/plugin/components/tooltip-handler/dom/model/title-model.d.ts +0 -15
  326. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js +0 -65
  327. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +0 -1
  328. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.d.ts +0 -21
  329. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js +0 -82
  330. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +0 -1
  331. package/esm/plugin/components/tooltip-handler/dom/utils/common.d.ts +0 -3
  332. package/esm/plugin/components/tooltip-handler/dom/utils/common.js +0 -22
  333. package/esm/plugin/components/tooltip-handler/dom/utils/common.js.map +0 -1
  334. package/esm/plugin/components/tooltip-handler/dom/utils/index.d.ts +0 -2
  335. package/esm/plugin/components/tooltip-handler/dom/utils/index.js +0 -4
  336. package/esm/plugin/components/tooltip-handler/dom/utils/index.js.map +0 -1
  337. package/esm/plugin/components/tooltip-handler/dom/utils/style.d.ts +0 -4
  338. package/esm/plugin/components/tooltip-handler/dom/utils/style.js +0 -87
  339. package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +0 -1
  340. package/esm/plugin/components/tooltip-handler/interface/common.d.ts +0 -4
  341. package/esm/plugin/components/tooltip-handler/interface/common.js +0 -2
  342. package/esm/plugin/components/tooltip-handler/interface/common.js.map +0 -1
  343. package/esm/plugin/components/tooltip-handler/interface/style.d.ts +0 -13
  344. package/esm/plugin/components/tooltip-handler/interface/style.js +0 -2
  345. package/esm/plugin/components/tooltip-handler/interface/style.js.map +0 -1
  346. package/esm/plugin/components/tooltip-handler/utils/index.d.ts +0 -3
  347. package/esm/plugin/components/tooltip-handler/utils/index.js +0 -6
  348. package/esm/plugin/components/tooltip-handler/utils/index.js.map +0 -1
  349. /package/cjs/{plugin/components/tooltip-handler/dom → chart/pictogram}/interface.js +0 -0
  350. /package/cjs/{plugin/components/tooltip-handler/dom/model → series/pictogram}/interface.js +0 -0
  351. /package/esm/{plugin/components/tooltip-handler/dom → chart/pictogram}/interface.js +0 -0
  352. /package/esm/{plugin/components/tooltip-handler/dom/model → series/pictogram}/interface.js +0 -0
@@ -1,10 +0,0 @@
1
- import type { ITooltipActual, Maybe } from '../../../../../typings';
2
- import type { IDomTooltipStyle } from '../interface';
3
- import type { ITooltipAttributes } from '../../interface';
4
- export interface ITooltipModelOption {
5
- valueToHtml: (value: any) => string;
6
- getTooltipStyle: () => IDomTooltipStyle;
7
- getTooltipActual: () => Maybe<ITooltipActual>;
8
- getTooltipAttributes: () => Maybe<ITooltipAttributes>;
9
- getContainer: () => HTMLElement;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { ITooltipActual, Maybe } from '../../../../../typings';\nimport type { IDomTooltipStyle } from '../interface';\nimport type { ITooltipAttributes } from '../../interface';\n\nexport interface ITooltipModelOption {\n valueToHtml: (value: any) => string;\n getTooltipStyle: () => IDomTooltipStyle;\n getTooltipActual: () => Maybe<ITooltipActual>;\n getTooltipAttributes: () => Maybe<ITooltipAttributes>;\n getContainer: () => HTMLElement;\n}\n"]}
@@ -1,23 +0,0 @@
1
- import type { IGradientColor } from '@visactor/vrender-core';
2
- import type { ShapeType } from '../../../../../typings';
3
- import { BaseTooltipModel } from './base-tooltip-model';
4
- export interface IShapeSvgOption {
5
- hasShape?: boolean;
6
- symbolType?: ShapeType | string;
7
- size?: string;
8
- fill?: string | IGradientColor;
9
- stroke?: string;
10
- lineWidth?: number;
11
- hollow?: boolean;
12
- marginTop?: string;
13
- index?: number;
14
- }
15
- export declare class ShapeModel extends BaseTooltipModel {
16
- svg: SVGElement;
17
- private _svgHtmlCache;
18
- init(classList?: string[], id?: string, tag?: keyof HTMLElementTagNameMap): void;
19
- setStyle(style?: Partial<CSSStyleDeclaration>, option?: IShapeSvgOption): void;
20
- setContent(option: IShapeSvgOption): void;
21
- setSvg(option?: IShapeSvgOption): void;
22
- release(): void;
23
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.ShapeModel = void 0;
6
-
7
- const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), base_tooltip_model_1 = require("./base-tooltip-model"), utils_1 = require("../utils");
8
-
9
- class ShapeModel extends base_tooltip_model_1.BaseTooltipModel {
10
- init(classList, id, tag) {
11
- if (!this.product) {
12
- const container = this.createElement(null != tag ? tag : "div", [ ...null != classList ? classList : [], "shape" ], void 0, id);
13
- this.product = container;
14
- }
15
- }
16
- setStyle(style, option) {
17
- super.setStyle(style), this.setSvg(option);
18
- }
19
- setContent(option) {
20
- this.setSvg(option);
21
- }
22
- setSvg(option) {
23
- const html = getSvgHtml(option, this._option.valueToHtml);
24
- this.product && html !== this._svgHtmlCache && (this._svgHtmlCache = html, this.product.innerHTML = html);
25
- }
26
- release() {
27
- super.release(), this._svgHtmlCache = "";
28
- }
29
- }
30
-
31
- function getSvgHtml(option, valueToHtml) {
32
- var _a, _b, _c, _d, _e, _f;
33
- if (!(null == option ? void 0 : option.hasShape) || !option.symbolType) return "";
34
- const {symbolType: symbolType, fill: fill, stroke: stroke, hollow: hollow = !1} = option, size = option.size ? valueToHtml(option.size) : "8px", lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + "px" : "0px";
35
- let fillString = "currentColor";
36
- const getStroke = () => stroke ? valueToHtml(stroke) : fillString, sizeNumber = (0,
37
- utils_1.pixelPropertyStrToNumber)(size), createSymbol = symbolType => new vrender_core_1.Symbol({
38
- symbolType: symbolType,
39
- size: sizeNumber,
40
- fill: !0
41
- });
42
- let symbol = createSymbol(symbolType);
43
- const parsedPath = symbol.getParsedPath();
44
- let bounds, path;
45
- if (!parsedPath.path && parsedPath.pathStr && (symbol = createSymbol(parsedPath.pathStr)),
46
- symbol.getParsedPath().path) {
47
- const pathModel = symbol.getParsedPath().path;
48
- path = pathModel.toString(), bounds = pathModel.bounds;
49
- } else parsedPath.isSvg && parsedPath.svgCache && (path = parsedPath.svgCache.map((s => s.path.toString())).join(),
50
- bounds = parsedPath.svgCache.reduce(((acc, cur) => acc.union(cur.path.bounds)), new vutils_1.Bounds));
51
- let viewBox = `${bounds.x1} ${bounds.y1} ${bounds.width()} ${bounds.height()}`;
52
- if ("0px" !== lineWidth) {
53
- const [x, y, w, h] = viewBox.split(" ").map((n => Number(n))), lw = Number(lineWidth.slice(0, -2));
54
- viewBox = `${x - lw / 2} ${y - lw / 2} ${w + lw} ${h + lw}`;
55
- }
56
- if (!fill || (0, vutils_1.isString)(fill) || hollow) return fillString = hollow ? "none" : fill ? valueToHtml(fill) : "currentColor",
57
- `\n <svg width="${size}" height="${size}" viewBox="${viewBox}"\n style="display: block;">\n <path\n d="${path}"\n style="fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}"\n >\n </path>\n </svg>`;
58
- if ((0, vutils_1.isObject)(fill)) {
59
- fillString = null !== (_a = "gradientColor" + option.index) && void 0 !== _a ? _a : "";
60
- let gradient = "";
61
- const stops = (null !== (_b = fill.stops) && void 0 !== _b ? _b : []).map((s => `<stop offset="${valueToHtml(s.offset.toString())}" stop-color="${valueToHtml(s.color)}"/>`)).join("");
62
- return "radial" === fill.gradient ? gradient = `<radialGradient id="${fillString}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${stops}\n </radialGradient>` : "linear" === fill.gradient && (gradient = `<linearGradient id="${fillString}" x1="${100 * (null !== (_c = fill.x0) && void 0 !== _c ? _c : 0)}%" y1="${100 * (null !== (_d = fill.y0) && void 0 !== _d ? _d : 0)}%" x2="${100 * (null !== (_e = fill.x1) && void 0 !== _e ? _e : 0)}%" y2="${100 * (null !== (_f = fill.y1) && void 0 !== _f ? _f : 0)}%">\n ${stops}\n </linearGradient>`),
63
- `\n <svg width="${size}" height="${size}" viewBox="-0.5 -0.5 1 1"\n style="display: block;">\n ${gradient}\n <path\n d="${path}"\n style="fill: url(#${fillString}); stroke: ${getStroke()}; stroke-width: ${lineWidth}"\n >\n </path>\n </svg>`;
64
- }
65
- return "";
66
- }
67
-
68
- exports.ShapeModel = ShapeModel;
69
- //# sourceMappingURL=shape-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/shape-model.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAEhD,6CAA8D;AAE9D,6DAAwD;AACxD,oCAAoD;AAcpD,MAAa,UAAW,SAAQ,qCAAgB;IAK9C,IAAI,CAAC,SAAoB,EAAE,EAAW,EAAE,GAAiC;QACvE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,KAAK,EAAE,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BAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,UAAU,GAAG,MAAA,eAAe,GAAG,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC;QAClD,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,iBAAiB,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;aACrG,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,IAAK,IAAuB,CAAC,QAAQ,KAAK,QAAQ,EAAE;YAClD,QAAQ,GAAG,uBAAuB,UAAU;QAC1C,KAAK;wBACW,CAAC;SACpB;aAAM,IAAK,IAAuB,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACzD,QAAQ,GAAG,uBAAuB,UAAU,SAC1C,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GACpD,UAAU,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GAAG,UAC7D,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GACpD,UAAU,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GAAG;QAC7D,KAAK;wBACW,CAAC;SACpB;QACD,OAAO;kBACO,IAAI,aAAa,IAAI;;QAE/B,QAAQ;;aAEH,IAAI;4BACW,UAAU,cAAc,SAAS,EAAE,mBAAmB,SAAS;;;WAGhF,CAAC;KACT;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","file":"shape-model.js","sourcesContent":["import type { CustomSymbolClass, IGradientColor, ILinearGradient } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { Symbol } from '@visactor/vrender-core';\n\nimport { isObject, isString, Bounds } from '@visactor/vutils';\nimport type { ShapeType } from '../../../../../typings';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport { pixelPropertyStrToNumber } from '../utils';\n\nexport interface IShapeSvgOption {\n hasShape?: boolean;\n symbolType?: ShapeType | string;\n size?: string;\n fill?: string | IGradientColor;\n stroke?: string;\n lineWidth?: number;\n hollow?: boolean;\n marginTop?: string;\n index?: number;\n}\n\nexport class ShapeModel extends BaseTooltipModel {\n svg: SVGElement;\n\n private _svgHtmlCache: string;\n\n init(classList?: string[], id?: string, tag?: keyof HTMLElementTagNameMap): void {\n if (!this.product) {\n const container = this.createElement(tag ?? 'div', [...(classList ?? []), 'shape'], undefined, id);\n this.product = container;\n }\n }\n\n setStyle(style?: Partial<CSSStyleDeclaration>, option?: IShapeSvgOption): void {\n super.setStyle(style);\n this.setSvg(option);\n }\n\n setContent(option: IShapeSvgOption) {\n this.setSvg(option);\n }\n\n setSvg(option?: IShapeSvgOption) {\n const html = getSvgHtml(option, this._option.valueToHtml);\n if (this.product && html !== this._svgHtmlCache) {\n this._svgHtmlCache = html;\n this.product.innerHTML = html;\n }\n }\n\n release(): void {\n super.release();\n this._svgHtmlCache = '';\n }\n}\n\nfunction getSvgHtml(option: IShapeSvgOption | undefined, valueToHtml: (value: any) => string) {\n if (!option?.hasShape || !option.symbolType) {\n return '';\n }\n\n const { symbolType, fill, stroke, hollow = false } = option;\n const size = option.size ? valueToHtml(option.size) : '8px';\n const lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + 'px' : '0px';\n let fillString: string = 'currentColor';\n const getStroke = () => (stroke ? valueToHtml(stroke) : fillString);\n\n const sizeNumber = pixelPropertyStrToNumber(size) as number;\n const createSymbol = (symbolType: string) => new Symbol({ symbolType, size: sizeNumber, fill: true });\n\n let symbol = createSymbol(symbolType);\n const parsedPath = symbol.getParsedPath();\n if (!parsedPath.path && parsedPath.pathStr) {\n symbol = createSymbol(parsedPath.pathStr);\n }\n\n let bounds;\n let path;\n if (symbol.getParsedPath().path) {\n const pathModel = symbol.getParsedPath().path;\n path = pathModel.toString();\n bounds = pathModel.bounds;\n } else if (parsedPath.isSvg && (parsedPath as unknown as CustomSymbolClass).svgCache) {\n path = (parsedPath as unknown as CustomSymbolClass).svgCache.map(s => s.path.toString()).join();\n bounds = (parsedPath as unknown as CustomSymbolClass).svgCache.reduce(\n (acc, cur) => acc.union(cur.path.bounds),\n new Bounds()\n );\n }\n\n let viewBox = `${bounds.x1} ${bounds.y1} ${bounds.width()} ${bounds.height()}`;\n\n // svg 不支持内描边,需要手动将描边空间预留在 viewBox 上\n if (lineWidth !== '0px') {\n const [x, y, w, h] = viewBox.split(' ').map(n => Number(n));\n const lw = Number(lineWidth.slice(0, -2));\n viewBox = `${x - lw / 2} ${y - lw / 2} ${w + lw} ${h + lw}`;\n }\n\n if (!fill || isString(fill) || hollow) {\n fillString = hollow ? 'none' : fill ? valueToHtml(fill) : 'currentColor';\n return `\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"${viewBox}\"\n style=\"display: block;\">\n <path\n d=\"${path}\"\n style=\"fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}\"\n >\n </path>\n </svg>`;\n }\n if (isObject(fill)) {\n fillString = 'gradientColor' + option.index ?? '';\n let gradient = '';\n const stops = (fill.stops ?? [])\n .map(s => `<stop offset=\"${valueToHtml(s.offset.toString())}\" stop-color=\"${valueToHtml(s.color)}\"/>`)\n .join('');\n if ((fill as IGradientColor).gradient === 'radial') {\n gradient = `<radialGradient id=\"${fillString}\" cx=\"50%\" cy=\"50%\" r=\"50%\" fx=\"0%\" fy=\"0%\">\n ${stops}\n </radialGradient>`;\n } else if ((fill as IGradientColor).gradient === 'linear') {\n gradient = `<linearGradient id=\"${fillString}\" x1=\"${\n (((fill as ILinearGradient).x0 as number) ?? 0) * 100\n }%\" y1=\"${(((fill as ILinearGradient).y0 as number) ?? 0) * 100}%\" x2=\"${\n (((fill as ILinearGradient).x1 as number) ?? 0) * 100\n }%\" y2=\"${(((fill as ILinearGradient).y1 as number) ?? 0) * 100}%\">\n ${stops}\n </linearGradient>`;\n }\n return `\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"-0.5 -0.5 1 1\"\n style=\"display: block;\">\n ${gradient}\n <path\n d=\"${path}\"\n style=\"fill: url(#${fillString}); stroke: ${getStroke()}; stroke-width: ${lineWidth}\"\n >\n </path>\n </svg>`;\n }\n\n return '';\n}\n"]}
@@ -1,7 +0,0 @@
1
- export declare const defaultH2Style: Partial<CSSStyleDeclaration>;
2
- export declare const defaultContainerStyle: Partial<CSSStyleDeclaration>;
3
- export declare const defaultContentColumnStyle: Partial<CSSStyleDeclaration>;
4
- export declare const defaultKeyStyle: Partial<CSSStyleDeclaration>;
5
- export declare const defaultAdaptiveKeyStyle: Partial<CSSStyleDeclaration>;
6
- export declare const defaultValueStyle: Partial<CSSStyleDeclaration>;
7
- export declare const defaultShapeStyle: Partial<CSSStyleDeclaration>;
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.defaultShapeStyle = exports.defaultValueStyle = exports.defaultAdaptiveKeyStyle = exports.defaultKeyStyle = exports.defaultContentColumnStyle = exports.defaultContainerStyle = exports.defaultH2Style = void 0,
6
- exports.defaultH2Style = {
7
- fontSize: "13px",
8
- marginBottom: "0px",
9
- fontWeight: "normal"
10
- }, exports.defaultContainerStyle = {
11
- boxSizing: "border-box"
12
- }, exports.defaultContentColumnStyle = {
13
- display: "inline-block",
14
- verticalAlign: "top"
15
- }, exports.defaultKeyStyle = {
16
- paddingTop: "0px",
17
- paddingBottom: "0px",
18
- textAlign: "left",
19
- fontWeight: "normal"
20
- }, exports.defaultAdaptiveKeyStyle = {
21
- paddingTop: "0px",
22
- paddingBottom: "0px",
23
- textAlign: "left",
24
- fontWeight: "normal"
25
- }, exports.defaultValueStyle = {
26
- paddingTop: "0px",
27
- paddingBottom: "0px",
28
- textAlign: "right",
29
- fontWeight: "normal"
30
- }, exports.defaultShapeStyle = {
31
- lineHeight: "normal",
32
- boxSizing: "border-box"
33
- };
34
- //# sourceMappingURL=style-constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/style-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAiC;IAC1D,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,KAAK;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEW,QAAA,qBAAqB,GAAiC;IACjE,SAAS,EAAE,YAAY;CACxB,CAAC;AAEW,QAAA,yBAAyB,GAAiC;IACrE,OAAO,EAAE,cAAc;IACvB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEW,QAAA,eAAe,GAAiC;IAC3D,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IAGpB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEW,QAAA,uBAAuB,GAAiC;IACnE,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEW,QAAA,iBAAiB,GAAiC;IAC7D,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IAEpB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAEW,QAAA,iBAAiB,GAAiC;IAC7D,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,YAAY;CACxB,CAAC","file":"style-constants.js","sourcesContent":["export const defaultH2Style: Partial<CSSStyleDeclaration> = {\n fontSize: '13px',\n marginBottom: '0px',\n fontWeight: 'normal'\n};\n\nexport const defaultContainerStyle: Partial<CSSStyleDeclaration> = {\n boxSizing: 'border-box'\n};\n\nexport const defaultContentColumnStyle: Partial<CSSStyleDeclaration> = {\n display: 'inline-block',\n verticalAlign: 'top'\n};\n\nexport const defaultKeyStyle: Partial<CSSStyleDeclaration> = {\n paddingTop: '0px',\n paddingBottom: '0px',\n // overflow: 'hidden',\n // textOverflow: 'ellipsis',\n textAlign: 'left',\n fontWeight: 'normal'\n};\n\nexport const defaultAdaptiveKeyStyle: Partial<CSSStyleDeclaration> = {\n paddingTop: '0px',\n paddingBottom: '0px',\n textAlign: 'left',\n fontWeight: 'normal'\n};\n\nexport const defaultValueStyle: Partial<CSSStyleDeclaration> = {\n paddingTop: '0px',\n paddingBottom: '0px',\n // overflow: 'hidden',\n textAlign: 'right',\n fontWeight: 'normal'\n};\n\nexport const defaultShapeStyle: Partial<CSSStyleDeclaration> = {\n lineHeight: 'normal',\n boxSizing: 'border-box'\n};\n"]}
@@ -1,5 +0,0 @@
1
- import { BaseTooltipModel } from './base-tooltip-model';
2
- export declare class TextModel extends BaseTooltipModel {
3
- init(classList?: string[], id?: string, tag?: keyof HTMLElementTagNameMap): void;
4
- setContent(content?: any, multiLine?: boolean): void;
5
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.TextModel = void 0;
6
-
7
- const base_tooltip_model_1 = require("./base-tooltip-model");
8
-
9
- class TextModel extends base_tooltip_model_1.BaseTooltipModel {
10
- init(classList, id, tag) {
11
- this.product || (this.product = this.createElement(null != tag ? tag : "span", classList, void 0, id));
12
- }
13
- setContent(content, multiLine) {
14
- if (!this.product) return;
15
- let html = this._option.valueToHtml(content);
16
- multiLine && (html = html.replaceAll("\n", "<br>")), html !== this.product.innerHTML && (this.product.innerHTML = html);
17
- }
18
- }
19
-
20
- exports.TextModel = TextModel;
21
- //# sourceMappingURL=text-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/text-model.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AAExD,MAAa,SAAU,SAAQ,qCAAgB;IAC7C,IAAI,CAAC,SAAoB,EAAE,EAAW,EAAE,GAAiC;QACvE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;SAC5E;IACH,CAAC;IAED,UAAU,CAAC,OAAa,EAAE,SAAmB;QAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO;SACR;QACD,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,SAAS,EAAE;YACb,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SACtC;QACD,IAAI,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACnC,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;SAC/B;IACH,CAAC;CACF;AAnBD,8BAmBC","file":"text-model.js","sourcesContent":["import { BaseTooltipModel } from './base-tooltip-model';\n\nexport class TextModel extends BaseTooltipModel {\n init(classList?: string[], id?: string, tag?: keyof HTMLElementTagNameMap): void {\n if (!this.product) {\n this.product = this.createElement(tag ?? 'span', classList, undefined, id);\n }\n }\n\n setContent(content?: any, multiLine?: boolean): void {\n if (!this.product) {\n return;\n }\n let html = this._option.valueToHtml(content);\n if (multiLine) {\n html = html.replaceAll('\\n', '<br>');\n }\n if (html !== this.product.innerHTML) {\n this.product.innerHTML = html;\n }\n }\n}\n"]}
@@ -1,15 +0,0 @@
1
- import type { Maybe } from '@visactor/vutils';
2
- import { BaseTooltipModel } from './base-tooltip-model';
3
- import { ShapeModel } from './shape-model';
4
- import { TextModel } from './text-model';
5
- export declare class TitleModel extends BaseTooltipModel {
6
- shape: Maybe<ShapeModel>;
7
- textSpan: Maybe<TextModel>;
8
- init(): void;
9
- private _initShape;
10
- private _releaseShape;
11
- private _initTextSpan;
12
- setStyle(style?: Partial<CSSStyleDeclaration>): void;
13
- setContent(): void;
14
- release(): void;
15
- }
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.TitleModel = void 0;
6
-
7
- const style_constants_1 = require("./style-constants"), base_tooltip_model_1 = require("./base-tooltip-model"), shape_model_1 = require("./shape-model"), text_model_1 = require("./text-model"), vutils_extension_1 = require("@visactor/vutils-extension");
8
-
9
- class TitleModel extends base_tooltip_model_1.BaseTooltipModel {
10
- init() {
11
- const tooltipActual = this._option.getTooltipActual();
12
- this.product || (this.product = this.createElement("h2"));
13
- const {align: align} = this._option.getTooltipAttributes();
14
- "right" !== align || this.textSpan || this._initTextSpan(0);
15
- const {title: title} = tooltipActual;
16
- (null == title ? void 0 : title.hasShape) && (null == title ? void 0 : title.shapeType) ? this.shape || this._initShape("right" === align ? 1 : 0) : this.shape && this._releaseShape(),
17
- "right" === align || this.textSpan || this._initTextSpan(1);
18
- }
19
- _initShape(index = 0) {
20
- const shape = new shape_model_1.ShapeModel(this.product, this._option, index);
21
- shape.init(), this.shape = shape, this.children[shape.childIndex] = shape;
22
- }
23
- _releaseShape() {
24
- this.shape && (this.shape.release(), delete this.children[this.shape.childIndex],
25
- this.shape = null);
26
- }
27
- _initTextSpan(index = 1) {
28
- const textSpan = new text_model_1.TextModel(this.product, this._option, index);
29
- textSpan.init(), this.textSpan = textSpan, this.children[textSpan.childIndex] = textSpan;
30
- }
31
- setStyle(style) {
32
- var _a, _b, _c, _d;
33
- const tooltipStyle = this._option.getTooltipStyle(), tooltipActual = this._option.getTooltipActual(), {title: title} = tooltipActual;
34
- super.setStyle((0, vutils_extension_1.mergeSpec)({}, style_constants_1.defaultH2Style, tooltipStyle.title, style)),
35
- null === (_a = this.shape) || void 0 === _a || _a.setStyle({
36
- paddingRight: null === (_b = tooltipStyle.shapeColumn.common) || void 0 === _b ? void 0 : _b.marginRight
37
- }, {
38
- hasShape: null == title ? void 0 : title.hasShape,
39
- symbolType: null == title ? void 0 : title.shapeType,
40
- size: null === (_c = tooltipStyle.shapeColumn.common) || void 0 === _c ? void 0 : _c.width,
41
- fill: null == title ? void 0 : title.shapeFill,
42
- hollow: null == title ? void 0 : title.shapeHollow
43
- }), null === (_d = this.textSpan) || void 0 === _d || _d.setStyle({
44
- color: "inherit"
45
- });
46
- }
47
- setContent() {
48
- var _a, _b, _c, _d, _e, _f;
49
- const tooltipStyle = this._option.getTooltipStyle(), tooltipActual = this._option.getTooltipActual(), tooltipAttributes = this._option.getTooltipAttributes(), {title: title} = tooltipActual;
50
- this.init(), null === (_a = this.shape) || void 0 === _a || _a.setStyle(void 0, {
51
- hasShape: null == title ? void 0 : title.hasShape,
52
- symbolType: null == title ? void 0 : title.shapeType,
53
- size: null === (_b = tooltipStyle.shapeColumn.common) || void 0 === _b ? void 0 : _b.width,
54
- fill: null == title ? void 0 : title.shapeFill,
55
- hollow: null == title ? void 0 : title.shapeHollow
56
- }), null === (_c = this.textSpan) || void 0 === _c || _c.setStyle({
57
- color: "inherit"
58
- }), null === (_d = this.textSpan) || void 0 === _d || _d.setContent(null == title ? void 0 : title.value, null === (_f = null === (_e = tooltipAttributes.title) || void 0 === _e ? void 0 : _e.value) || void 0 === _f ? void 0 : _f.multiLine);
59
- }
60
- release() {
61
- super.release(), this.shape = null, this.textSpan = null;
62
- }
63
- }
64
-
65
- exports.TitleModel = TitleModel;
66
- //# sourceMappingURL=title-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/title-model.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AACnD,6DAAwD;AACxD,+CAA2C;AAC3C,6CAAyC;AACzC,iEAAuD;AAEvD,MAAa,UAAW,SAAQ,qCAAgB;IAI9C,IAAI;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAEtD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GA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AtGD,gCAsGC","file":"title-model.js","sourcesContent":["import type { Maybe } from '@visactor/vutils';\nimport { defaultH2Style } from './style-constants';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport { ShapeModel } from './shape-model';\nimport { TextModel } from './text-model';\nimport { mergeSpec } from '@visactor/vutils-extension';\n\nexport class TitleModel extends BaseTooltipModel {\n shape: Maybe<ShapeModel>;\n textSpan: Maybe<TextModel>;\n\n init(): void {\n const tooltipActual = this._option.getTooltipActual();\n\n if (!this.product) {\n this.product = this.createElement('h2');\n }\n const { align } = this._option.getTooltipAttributes();\n\n if (align === 'right' && !this.textSpan) {\n this._initTextSpan(0);\n }\n\n const { title } = tooltipActual;\n if (title?.hasShape && title?.shapeType) {\n if (!this.shape) {\n this._initShape(align === 'right' ? 1 : 0);\n }\n } else if (this.shape) {\n this._releaseShape();\n }\n\n if (align !== 'right' && !this.textSpan) {\n this._initTextSpan(1);\n }\n }\n\n private _initShape(index: number = 0) {\n const shape = new ShapeModel(this.product!, this._option, index);\n shape.init();\n this.shape = shape;\n this.children[shape.childIndex] = shape;\n }\n\n private _releaseShape() {\n if (!this.shape) {\n return;\n }\n this.shape.release();\n delete this.children[this.shape.childIndex];\n this.shape = null;\n }\n\n private _initTextSpan(index: number = 1) {\n const textSpan = new TextModel(this.product!, this._option, index);\n textSpan.init();\n this.textSpan = textSpan;\n this.children[textSpan.childIndex] = textSpan;\n }\n\n setStyle(style?: Partial<CSSStyleDeclaration>): void {\n const tooltipStyle = this._option.getTooltipStyle();\n const tooltipActual = this._option.getTooltipActual();\n\n const { title } = tooltipActual;\n super.setStyle(mergeSpec({}, defaultH2Style, tooltipStyle.title, style));\n\n this.shape?.setStyle(\n {\n paddingRight: tooltipStyle.shapeColumn.common?.marginRight\n },\n {\n hasShape: title?.hasShape,\n symbolType: title?.shapeType,\n size: tooltipStyle.shapeColumn.common?.width,\n fill: title?.shapeFill,\n hollow: title?.shapeHollow\n }\n );\n this.textSpan?.setStyle({\n color: 'inherit'\n });\n }\n\n setContent(): void {\n const tooltipStyle = this._option.getTooltipStyle();\n const tooltipActual = this._option.getTooltipActual();\n const tooltipAttributes = this._option.getTooltipAttributes();\n\n const { title } = tooltipActual;\n this.init();\n this.shape?.setStyle(undefined, {\n hasShape: title?.hasShape,\n symbolType: title?.shapeType,\n size: tooltipStyle.shapeColumn.common?.width,\n fill: title?.shapeFill,\n hollow: title?.shapeHollow\n });\n this.textSpan?.setStyle({\n color: 'inherit'\n });\n this.textSpan?.setContent(title?.value, tooltipAttributes.title?.value?.multiLine);\n }\n\n release(): void {\n super.release();\n this.shape = null;\n this.textSpan = null;\n }\n}\n"]}
@@ -1,21 +0,0 @@
1
- import { BaseTooltipModel } from './base-tooltip-model';
2
- import { ContentModel } from './content-model';
3
- import type { ITooltipModelOption } from './interface';
4
- import { TitleModel } from './title-model';
5
- export declare class TooltipModel extends BaseTooltipModel {
6
- title: TitleModel | null;
7
- content: ContentModel | null;
8
- private _classList;
9
- private _id;
10
- constructor(option: ITooltipModelOption, classList: string[], id: string);
11
- setVisibility(visibility: boolean): void;
12
- init(): void;
13
- private _initPanel;
14
- private _initTitle;
15
- private _releaseTitle;
16
- private _initContent;
17
- private _releaseContent;
18
- setStyle(): void;
19
- setContent(): void;
20
- release(): void;
21
- }
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.TooltipModel = void 0;
6
-
7
- const vutils_1 = require("@visactor/vutils"), base_tooltip_model_1 = require("./base-tooltip-model"), content_model_1 = require("./content-model"), title_model_1 = require("./title-model"), style_constants_1 = require("./style-constants"), vutils_extension_1 = require("@visactor/vutils-extension"), constant_1 = require("../constant");
8
-
9
- class TooltipModel extends base_tooltip_model_1.BaseTooltipModel {
10
- constructor(option, classList, id) {
11
- super(option.getContainer(), option, 0), this.title = null, this.content = null,
12
- this._classList = classList, this._id = id;
13
- }
14
- setVisibility(visibility) {
15
- if (super.setVisibility(visibility), !this.product) return;
16
- const {classList: classList} = this.product;
17
- visibility ? classList.add("visible") : classList.remove("visible");
18
- }
19
- init() {
20
- var _a;
21
- const tooltipActual = this._option.getTooltipActual();
22
- this.product || this._initPanel(this._classList, this._id);
23
- const {title: title} = tooltipActual;
24
- !1 !== (null == title ? void 0 : title.visible) && (0, vutils_1.isValid)(null == title ? void 0 : title.value) ? this.title || this._initTitle() : this.title && this._releaseTitle();
25
- (null !== (_a = tooltipActual.content) && void 0 !== _a ? _a : []).length > 0 ? this.content || this._initContent() : this.content && this._releaseContent();
26
- }
27
- _initPanel(classList, id) {
28
- const panel = this.createElement("div", classList, {
29
- left: "0",
30
- top: "0",
31
- pointerEvents: "none",
32
- padding: "12px",
33
- position: "absolute",
34
- zIndex: constant_1.DEFAULT_TOOLTIP_Z_INDEX,
35
- fontFamily: "sans-serif",
36
- fontSize: "11px",
37
- borderRadius: "3px",
38
- borderStyle: "solid",
39
- lineHeight: "initial",
40
- background: "#fff",
41
- boxShadow: "2px 2px 4px rgba(0, 0, 0, 0.1)",
42
- maxWidth: "100wh",
43
- maxHeight: "100vh"
44
- }, id);
45
- this.product = panel;
46
- }
47
- _initTitle() {
48
- const title = new title_model_1.TitleModel(this.product, this._option, 0);
49
- title.init(), this.title = title, this.children[title.childIndex] = title;
50
- }
51
- _releaseTitle() {
52
- this.title && (this.title.release(), delete this.children[this.title.childIndex],
53
- this.title = null);
54
- }
55
- _initContent() {
56
- const content = new content_model_1.ContentModel(this.product, this._option, 1);
57
- content.init(), this.content = content, this.children[content.childIndex] = content;
58
- }
59
- _releaseContent() {
60
- this.content && (this.content.release(), delete this.children[this.content.childIndex],
61
- this.content = null);
62
- }
63
- setStyle() {
64
- const tooltipStyle = this._option.getTooltipStyle();
65
- super.setStyle((0, vutils_extension_1.mergeSpec)({}, style_constants_1.defaultContainerStyle, tooltipStyle.panel)),
66
- Object.values(this.children).forEach((c => c.setStyle()));
67
- }
68
- setContent() {
69
- Object.values(this.children).forEach((c => {
70
- c.setContent();
71
- }));
72
- }
73
- release() {
74
- super.release(), this.title = null, this.content = null;
75
- }
76
- }
77
-
78
- exports.TooltipModel = TooltipModel;
79
- //# sourceMappingURL=tooltip-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/tooltip-model.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,6DAAwD;AACxD,mDAA+C;AAE/C,+CAA2C;AAC3C,uDAA0D;AAC1D,iEAAuD;AACvD,0CAAsD;AAEtD,MAAa,YAAa,SAAQ,qCAAgB;IAOhD,YAAY,MAA2B,EAAE,SAAmB,EAAE,EAAU;QACtE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAP1C,UAAK,GAAsB,IAAI,CAAC;QAChC,YAAO,GAAwB,IAAI,CAAC;QAOlC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,aAAa,CAAC,UAAmB;QAC/B,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO;SACR;QACD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACnC,IAAI,UAAU,EAAE;YACd,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SAC1B;aAAM;YACL,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAC7B;IACH,CAAC;IAED,IAAI;;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAEtD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;SAC5C;QAED,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC;QAChC,I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AAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,UAAU;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACvC,CAAC,CAAC,UAAU,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF;AA/HD,oCA+HC","file":"tooltip-model.js","sourcesContent":["import { isValid } from '@visactor/vutils';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport { ContentModel } from './content-model';\nimport type { ITooltipModelOption } from './interface';\nimport { TitleModel } from './title-model';\nimport { defaultContainerStyle } from './style-constants';\nimport { mergeSpec } from '@visactor/vutils-extension';\nimport { DEFAULT_TOOLTIP_Z_INDEX } from '../constant';\n\nexport class TooltipModel extends BaseTooltipModel {\n title: TitleModel | null = null;\n content: ContentModel | null = null;\n\n private _classList: string[];\n private _id: string;\n\n constructor(option: ITooltipModelOption, classList: string[], id: string) {\n super(option.getContainer(), option, 0);\n this._classList = classList;\n this._id = id;\n }\n\n setVisibility(visibility: boolean) {\n super.setVisibility(visibility);\n if (!this.product) {\n return;\n }\n const { classList } = this.product;\n if (visibility) {\n classList.add('visible');\n } else {\n classList.remove('visible');\n }\n }\n\n init(): void {\n const tooltipActual = this._option.getTooltipActual();\n\n if (!this.product) {\n this._initPanel(this._classList, this._id);\n }\n\n const { title } = tooltipActual;\n if (title?.visible !== false && isValid(title?.value)) {\n if (!this.title) {\n this._initTitle();\n }\n } else if (this.title) {\n this._releaseTitle();\n }\n\n const renderContent = tooltipActual.content ?? [];\n if (renderContent.length > 0) {\n if (!this.content) {\n this._initContent();\n }\n } else if (this.content) {\n this._releaseContent();\n }\n }\n\n private _initPanel(classList?: string[], id?: string) {\n const panel = this.createElement(\n 'div',\n classList,\n {\n left: '0',\n top: '0',\n pointerEvents: 'none',\n padding: '12px',\n position: 'absolute',\n zIndex: DEFAULT_TOOLTIP_Z_INDEX,\n fontFamily: 'sans-serif',\n fontSize: '11px',\n borderRadius: '3px',\n borderStyle: 'solid',\n lineHeight: 'initial',\n background: '#fff',\n boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.1)',\n maxWidth: '100wh',\n maxHeight: '100vh'\n },\n id\n );\n this.product = panel;\n }\n\n private _initTitle() {\n const title = new TitleModel(this.product!, this._option, 0);\n title.init();\n this.title = title;\n this.children[title.childIndex] = title;\n }\n\n private _releaseTitle() {\n if (!this.title) {\n return;\n }\n this.title.release();\n delete this.children[this.title.childIndex];\n this.title = null;\n }\n\n private _initContent() {\n const content = new ContentModel(this.product!, this._option, 1);\n content.init();\n this.content = content;\n this.children[content.childIndex] = content;\n }\n\n private _releaseContent() {\n if (!this.content) {\n return;\n }\n this.content.release();\n delete this.children[this.content.childIndex];\n this.content = null;\n }\n\n setStyle(): void {\n const tooltipStyle = this._option.getTooltipStyle();\n super.setStyle(mergeSpec({}, defaultContainerStyle, tooltipStyle.panel));\n Object.values(this.children).forEach(c => c.setStyle());\n }\n\n setContent() {\n Object.values(this.children).forEach(c => {\n c.setContent();\n });\n }\n\n release(): void {\n super.release();\n this.title = null;\n this.content = null;\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- export declare const getPixelPropertyStr: (num?: number | number[], defaultStr?: string) => string;
2
- export declare const pixelPropertyStrToNumber: (str: string) => number | number[];
3
- export declare const getScrollbarWidth: (container?: HTMLElement) => number;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.getScrollbarWidth = exports.pixelPropertyStrToNumber = exports.getPixelPropertyStr = void 0;
6
-
7
- const vutils_1 = require("@visactor/vutils"), getPixelPropertyStr = (num, defaultStr) => (0,
8
- vutils_1.isValid)(num) ? (0, vutils_1.isArray)(num) ? num.map((n => `${n}px`)).join(" ") : `${num}px` : null != defaultStr ? defaultStr : "initial";
9
-
10
- exports.getPixelPropertyStr = getPixelPropertyStr;
11
-
12
- const pixelPropertyStrToNumber = str => {
13
- const numArr = str.split(" ").map((n => Number.isNaN(n) ? Number.parseFloat(n.substring(0, n.length - 2)) : Number.parseFloat(n)));
14
- return 1 === numArr.length ? numArr[0] : numArr;
15
- };
16
-
17
- let cacheScrollbarWidth;
18
-
19
- exports.pixelPropertyStrToNumber = pixelPropertyStrToNumber;
20
-
21
- const getScrollbarWidth = (container = document.body) => {
22
- if ((0, vutils_1.isNil)(cacheScrollbarWidth)) {
23
- const outer = document.createElement("div");
24
- outer.style.visibility = "hidden", outer.style.overflow = "scroll", container.appendChild(outer);
25
- const inner = document.createElement("div");
26
- outer.appendChild(inner), cacheScrollbarWidth = outer.offsetWidth - inner.offsetWidth,
27
- outer.parentNode.removeChild(outer);
28
- }
29
- return cacheScrollbarWidth;
30
- };
31
-
32
- exports.getScrollbarWidth = getScrollbarWidth;
33
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/utils/common.ts"],"names":[],"mappings":";;;AAAA,6CAA2D;AAEpD,MAAM,mBAAmB,GAAG,CAAC,GAAuB,EAAE,UAAmB,EAAE,EAAE;IAClF,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC,EAAE;QAChB,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC,EAAE;YAChB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACzC;QACD,OAAO,GAAG,GAAG,IAAI,CAAC;KACnB;IACD,OAAO,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,SAAS,CAAC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C;QAC5D,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B","file":"common.js","sourcesContent":["import { isArray, isNil, isValid } from '@visactor/vutils';\n\nexport const getPixelPropertyStr = (num?: number | number[], defaultStr?: string) => {\n if (isValid(num)) {\n if (isArray(num)) {\n return num.map(n => `${n}px`).join(' ');\n }\n return `${num}px`;\n }\n return defaultStr ?? 'initial';\n};\n\nexport const pixelPropertyStrToNumber = (str: string): number | number[] => {\n const strArr = str.split(' ');\n const numArr = strArr.map(n => {\n if (!Number.isNaN(n)) {\n return Number.parseFloat(n);\n }\n return Number.parseFloat(n.substring(0, n.length - 2));\n });\n if (numArr.length === 1) {\n return numArr[0];\n }\n return numArr;\n};\n\nlet cacheScrollbarWidth: number | undefined;\nexport const getScrollbarWidth = (container = document.body) => {\n if (isNil(cacheScrollbarWidth)) {\n const outer = document.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n container.appendChild(outer);\n const inner = document.createElement('div');\n outer.appendChild(inner);\n cacheScrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.parentNode.removeChild(outer);\n }\n return cacheScrollbarWidth;\n};\n"]}
@@ -1,2 +0,0 @@
1
- export * from './common';
2
- export * from './style';
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
- void 0 === k2 && (k2 = k);
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
- enumerable: !0,
8
- get: function() {
9
- return m[k];
10
- }
11
- }), Object.defineProperty(o, k2, desc);
12
- } : function(o, m, k, k2) {
13
- void 0 === k2 && (k2 = k), o[k2] = m[k];
14
- }), __exportStar = this && this.__exportStar || function(m, exports) {
15
- for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
- };
17
-
18
- Object.defineProperty(exports, "__esModule", {
19
- value: !0
20
- }), __exportStar(require("./common"), exports), __exportStar(require("./style"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB","file":"index.js","sourcesContent":["export * from './common';\nexport * from './style';\n"]}
@@ -1,4 +0,0 @@
1
- import type { Maybe } from '@visactor/vutils';
2
- import type { ITooltipAttributes } from '../../interface';
3
- import type { IDomTooltipStyle } from '../interface';
4
- export declare function getDomStyles(attributes?: Maybe<ITooltipAttributes>): IDomTooltipStyle;
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.getDomStyles = void 0;
6
-
7
- const vutils_extension_1 = require("@visactor/vutils-extension"), space_1 = require("../../../../../util/space"), vrender_core_1 = require("@visactor/vrender-core"), common_1 = require("./common"), DEFAULT_SHAPE_SPACING = 8, DEFAULT_KEY_SPACING = 26, DEFAULT_VALUE_SPACING = 0;
8
-
9
- function getDomStyles(attributes) {
10
- var _a, _b, _c;
11
- const {panel: panel = {}, title: titleAttribute, content: contentAttribute, titleStyle: titleStyle = {}, contentStyle: contentStyle = {}, padding: padding, keyWidth: keyWidth, valueWidth: valueWidth, enterable: enterable, transitionDuration: transitionDuration, panelDomHeight: panelDomHeight = 0, align: align = "left"} = null != attributes ? attributes : {}, {fill: backgroundColor, shadow: shadow, shadowBlur: shadowBlur, shadowColor: shadowColor, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowSpread: shadowSpread, cornerRadius: cornerRadius, stroke: strokeColor, lineWidth: lineWidth = 0, width: width = 0} = panel, {value: title = {}} = titleStyle, {shape: shape = {}, key: key = {}, value: value = {}} = contentStyle, shapeStyle = getShapeStyle(shape), keyStyle = getLabelStyle(key), valueStyle = getLabelStyle(value), {bottom: bottom, left: left, right: right, top: top} = (0,
12
- space_1.normalizeLayoutPaddingSpec)(padding), marginKey = "right" === align ? "marginLeft" : "marginRight";
13
- return {
14
- align: align,
15
- panel: {
16
- width: (0, common_1.getPixelPropertyStr)(width + 2 * lineWidth),
17
- minHeight: (0, common_1.getPixelPropertyStr)(panelDomHeight + 2 * lineWidth),
18
- paddingBottom: (0, common_1.getPixelPropertyStr)(bottom),
19
- paddingLeft: (0, common_1.getPixelPropertyStr)(left),
20
- paddingRight: (0, common_1.getPixelPropertyStr)(right),
21
- paddingTop: (0, common_1.getPixelPropertyStr)(top),
22
- borderColor: strokeColor,
23
- borderWidth: (0, common_1.getPixelPropertyStr)(lineWidth),
24
- borderRadius: (0, common_1.getPixelPropertyStr)(cornerRadius),
25
- backgroundColor: backgroundColor ? `${backgroundColor}` : "transparent",
26
- boxShadow: shadow ? `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}` : "initial",
27
- pointerEvents: enterable ? "auto" : "none",
28
- transitionDuration: transitionDuration ? `${transitionDuration}ms` : "initial",
29
- transitionProperty: transitionDuration ? "transform" : "initial",
30
- transitionTimingFunction: transitionDuration ? "ease-out" : "initial"
31
- },
32
- title: Object.assign({
33
- marginTop: "0px",
34
- marginBottom: (null == contentAttribute ? void 0 : contentAttribute.length) ? (0,
35
- common_1.getPixelPropertyStr)(null == titleAttribute ? void 0 : titleAttribute.spaceRow) : "0px"
36
- }, getLabelStyle((0, vutils_extension_1.mergeSpec)({}, title, null == titleAttribute ? void 0 : titleAttribute.value))),
37
- content: {},
38
- shapeColumn: {
39
- common: shapeStyle,
40
- items: null == contentAttribute ? void 0 : contentAttribute.map((({spaceRow: spaceRow}, i) => ({
41
- marginTop: "0px",
42
- marginBottom: i < contentAttribute.length - 1 ? (0, common_1.getPixelPropertyStr)(spaceRow) : "0px"
43
- }))),
44
- width: (0, common_1.getPixelPropertyStr)(shape.size),
45
- [marginKey]: (0, common_1.getPixelPropertyStr)(null !== (_a = shape.spacing) && void 0 !== _a ? _a : 8)
46
- },
47
- keyColumn: {
48
- common: keyStyle,
49
- items: null == contentAttribute ? void 0 : contentAttribute.map((({key: key, spaceRow: spaceRow}, i) => Object.assign(Object.assign(Object.assign({
50
- marginTop: "0px",
51
- marginBottom: i < contentAttribute.length - 1 ? (0, common_1.getPixelPropertyStr)(spaceRow) : "0px"
52
- }, keyStyle), getLabelStyle(key)), (null == key ? void 0 : key.multiLine) ? {
53
- width: (0, common_1.getPixelPropertyStr)(Math.ceil(key.width))
54
- } : void 0))),
55
- width: (0, common_1.getPixelPropertyStr)(keyWidth),
56
- [marginKey]: (0, common_1.getPixelPropertyStr)(null !== (_b = key.spacing) && void 0 !== _b ? _b : 26)
57
- },
58
- valueColumn: {
59
- common: valueStyle,
60
- items: null == contentAttribute ? void 0 : contentAttribute.map((({value: value, spaceRow: spaceRow}, i) => Object.assign(Object.assign(Object.assign({
61
- marginTop: "0px",
62
- marginBottom: i < contentAttribute.length - 1 ? (0, common_1.getPixelPropertyStr)(spaceRow) : "0px"
63
- }, valueStyle), getLabelStyle(value)), (null == value ? void 0 : value.multiLine) ? {
64
- width: (0, common_1.getPixelPropertyStr)(Math.ceil(value.width))
65
- } : void 0))),
66
- width: (0, common_1.getPixelPropertyStr)(valueWidth),
67
- [marginKey]: (0, common_1.getPixelPropertyStr)(null !== (_c = value.spacing) && void 0 !== _c ? _c : 0)
68
- }
69
- };
70
- }
71
-
72
- function getLabelStyle(labelStyle, defaultStyle) {
73
- if (!labelStyle) return;
74
- const {fontFamily: labelFont, fontSize: labelFontSize, fill: labelColor, textAlign: textAlign, lineHeight: lineHeight, fontWeight: fontWeight, multiLine: multiLine, wordBreak: wordBreak, maxWidth: maxWidth} = (0,
75
- vutils_extension_1.mergeSpec)({}, defaultStyle, labelStyle), styleObj = {};
76
- return styleObj.fontFamily = labelFont, styleObj.fontSize = (0, common_1.getPixelPropertyStr)(labelFontSize),
77
- styleObj.color = labelColor, styleObj.textAlign = textAlign, styleObj.lineHeight = (0,
78
- common_1.getPixelPropertyStr)((0, vrender_core_1.calculateLineHeight)(lineHeight, labelFontSize)),
79
- styleObj.fontWeight = fontWeight, styleObj.whiteSpace = multiLine ? "initial" : "nowrap",
80
- styleObj.wordBreak = multiLine ? null != wordBreak ? wordBreak : "break-word" : "normal",
81
- styleObj.maxWidth = (0, common_1.getPixelPropertyStr)(maxWidth), styleObj;
82
- }
83
-
84
- function getShapeStyle(shapeStyle, defaultStyle) {
85
- if (!shapeStyle) return;
86
- const {size: size} = (0, vutils_extension_1.mergeSpec)({}, defaultStyle, shapeStyle), styleObj = {};
87
- return styleObj.width = (0, common_1.getPixelPropertyStr)(size), styleObj;
88
- }
89
-
90
- exports.getDomStyles = getDomStyles;
91
- //# sourceMappingURL=style.js.map