@visactor/vseed 0.4.2 → 0.4.4

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 (310) hide show
  1. package/dist/cjs/index.cjs +646 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/buildSpec.d.ts +1 -2
  4. package/dist/esm/builder/builder/buildSpec.js.map +1 -1
  5. package/dist/esm/builder/builder/builder.d.ts +54 -14290
  6. package/dist/esm/builder/builder/builder.js +10 -0
  7. package/dist/esm/builder/builder/builder.js.map +1 -1
  8. package/dist/esm/builder/builder/prepare.d.ts +12 -0
  9. package/dist/esm/builder/builder/prepare.js +269 -0
  10. package/dist/esm/builder/builder/prepare.js.map +1 -0
  11. package/dist/esm/builder/register/all.js +4 -1
  12. package/dist/esm/builder/register/all.js.map +1 -1
  13. package/dist/esm/builder/register/chartType/index.d.ts +3 -0
  14. package/dist/esm/builder/register/chartType/index.js +4 -1
  15. package/dist/esm/builder/register/chartType/raceDonut.d.ts +5 -0
  16. package/dist/esm/builder/register/chartType/raceDonut.js +9 -0
  17. package/dist/esm/builder/register/chartType/raceDonut.js.map +1 -0
  18. package/dist/esm/builder/register/chartType/raceLine.d.ts +5 -0
  19. package/dist/esm/builder/register/chartType/raceLine.js +9 -0
  20. package/dist/esm/builder/register/chartType/raceLine.js.map +1 -0
  21. package/dist/esm/builder/register/chartType/racePie.d.ts +5 -0
  22. package/dist/esm/builder/register/chartType/racePie.js +9 -0
  23. package/dist/esm/builder/register/chartType/racePie.js.map +1 -0
  24. package/dist/esm/dataReshape/constant.d.ts +1 -0
  25. package/dist/esm/dataReshape/constant.js +2 -1
  26. package/dist/esm/dataReshape/constant.js.map +1 -1
  27. package/dist/esm/dataSelector/selector.d.ts +71 -2
  28. package/dist/esm/dataSelector/selector.js +96 -32
  29. package/dist/esm/dataSelector/selector.js.map +1 -1
  30. package/dist/esm/pipeline/advanced/chart/pipeline/index.d.ts +3 -0
  31. package/dist/esm/pipeline/advanced/chart/pipeline/index.js +4 -1
  32. package/dist/esm/pipeline/advanced/chart/pipeline/raceDonut.d.ts +2 -0
  33. package/dist/esm/pipeline/advanced/chart/pipeline/raceDonut.js +33 -0
  34. package/dist/esm/pipeline/advanced/chart/pipeline/raceDonut.js.map +1 -0
  35. package/dist/esm/pipeline/advanced/chart/pipeline/raceLine.d.ts +2 -0
  36. package/dist/esm/pipeline/advanced/chart/pipeline/raceLine.js +36 -0
  37. package/dist/esm/pipeline/advanced/chart/pipeline/raceLine.js.map +1 -0
  38. package/dist/esm/pipeline/advanced/chart/pipeline/racePie.d.ts +2 -0
  39. package/dist/esm/pipeline/advanced/chart/pipeline/racePie.js +33 -0
  40. package/dist/esm/pipeline/advanced/chart/pipeline/racePie.js.map +1 -0
  41. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js +2 -1
  42. package/dist/esm/pipeline/advanced/chart/pipes/default/defaultMeasures.js.map +1 -1
  43. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.d.ts +3 -0
  44. package/dist/esm/pipeline/advanced/chart/pipes/encoding/index.js +4 -1
  45. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceBar.js +0 -3
  46. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceBar.js.map +1 -1
  47. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceColumn.js +0 -3
  48. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceColumn.js.map +1 -1
  49. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceDonut.d.ts +3 -0
  50. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceDonut.js +74 -0
  51. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceDonut.js.map +1 -0
  52. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceLine.d.ts +3 -0
  53. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceLine.js +89 -0
  54. package/dist/esm/pipeline/advanced/chart/pipes/encoding/raceLine.js.map +1 -0
  55. package/dist/esm/pipeline/advanced/chart/pipes/encoding/racePie.d.ts +3 -0
  56. package/dist/esm/pipeline/advanced/chart/pipes/encoding/racePie.js +74 -0
  57. package/dist/esm/pipeline/advanced/chart/pipes/encoding/racePie.js.map +1 -0
  58. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js +2 -1
  59. package/dist/esm/pipeline/advanced/table/pipes/default/defaultMeasures.js.map +1 -1
  60. package/dist/esm/pipeline/spec/chart/pipeline/index.d.ts +3 -0
  61. package/dist/esm/pipeline/spec/chart/pipeline/index.js +4 -1
  62. package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js +2 -2
  63. package/dist/esm/pipeline/spec/chart/pipeline/raceBar.js.map +1 -1
  64. package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js +2 -2
  65. package/dist/esm/pipeline/spec/chart/pipeline/raceColumn.js.map +1 -1
  66. package/dist/esm/pipeline/spec/chart/pipeline/raceDonut.d.ts +2 -0
  67. package/dist/esm/pipeline/spec/chart/pipeline/raceDonut.js +21 -0
  68. package/dist/esm/pipeline/spec/chart/pipeline/raceDonut.js.map +1 -0
  69. package/dist/esm/pipeline/spec/chart/pipeline/raceLine.d.ts +2 -0
  70. package/dist/esm/pipeline/spec/chart/pipeline/raceLine.js +25 -0
  71. package/dist/esm/pipeline/spec/chart/pipeline/raceLine.js.map +1 -0
  72. package/dist/esm/pipeline/spec/chart/pipeline/racePie.d.ts +2 -0
  73. package/dist/esm/pipeline/spec/chart/pipeline/racePie.js +21 -0
  74. package/dist/esm/pipeline/spec/chart/pipeline/racePie.js.map +1 -0
  75. package/dist/esm/pipeline/spec/chart/pipeline/raceScatter.js +2 -2
  76. package/dist/esm/pipeline/spec/chart/pipeline/raceScatter.js.map +1 -1
  77. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +10 -4
  78. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
  79. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.d.ts +8 -2
  80. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js +13 -4
  81. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js.map +1 -1
  82. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +8 -4
  83. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
  84. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +10 -4
  85. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
  86. package/dist/esm/pipeline/spec/chart/pipes/annotation/splitLine.js.map +1 -1
  87. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.d.ts +9 -1
  88. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js +7 -1
  89. package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
  90. package/dist/esm/pipeline/spec/chart/pipes/legend/boxLegend.js.map +1 -1
  91. package/dist/esm/pipeline/spec/chart/pipes/legend/heatmapColorLegend.js.map +1 -1
  92. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js +3 -2
  93. package/dist/esm/pipeline/spec/chart/pipes/markStyle/barStyle.js.map +1 -1
  94. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js +5 -2
  95. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js.map +1 -1
  96. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointState.js.map +1 -1
  97. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.js +3 -2
  98. package/dist/esm/pipeline/spec/chart/pipes/markStyle/pointStyle.js.map +1 -1
  99. package/dist/esm/pipeline/spec/chart/pipes/player/index.d.ts +5 -3
  100. package/dist/esm/pipeline/spec/chart/pipes/player/index.js +5 -3
  101. package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.d.ts +2 -2
  102. package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.js +8 -7
  103. package/dist/esm/pipeline/spec/chart/pipes/player/isPlayer.js.map +1 -1
  104. package/dist/esm/pipeline/spec/chart/pipes/player/{playerXY.d.ts → playerBar.d.ts} +1 -1
  105. package/dist/esm/pipeline/spec/chart/pipes/player/{playerYX.js → playerBar.js} +6 -7
  106. package/dist/esm/pipeline/spec/chart/pipes/player/playerBar.js.map +1 -0
  107. package/dist/esm/pipeline/spec/chart/pipes/player/playerColumn.d.ts +2 -0
  108. package/dist/esm/pipeline/spec/chart/pipes/player/{playerXY.js → playerColumn.js} +6 -7
  109. package/dist/esm/pipeline/spec/chart/pipes/player/playerColumn.js.map +1 -0
  110. package/dist/esm/pipeline/spec/chart/pipes/player/{playerYX.d.ts → playerLine.d.ts} +1 -1
  111. package/dist/esm/pipeline/spec/chart/pipes/player/playerLine.js +144 -0
  112. package/dist/esm/pipeline/spec/chart/pipes/player/playerLine.js.map +1 -0
  113. package/dist/esm/pipeline/spec/chart/pipes/player/{playerYY.d.ts → playerPie.d.ts} +1 -1
  114. package/dist/esm/pipeline/spec/chart/pipes/player/playerPie.js +174 -0
  115. package/dist/esm/pipeline/spec/chart/pipes/player/playerPie.js.map +1 -0
  116. package/dist/esm/pipeline/spec/chart/pipes/player/playerScatter.d.ts +2 -0
  117. package/dist/esm/pipeline/spec/chart/pipes/player/{playerYY.js → playerScatter.js} +7 -7
  118. package/dist/esm/pipeline/spec/chart/pipes/player/playerScatter.js.map +1 -0
  119. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.d.ts +4 -1
  120. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js +12 -1
  121. package/dist/esm/pipeline/spec/table/pipes/cellStyle/common.js.map +1 -1
  122. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js +6 -3
  123. package/dist/esm/pipeline/spec/table/pipes/cellStyle/pivot.js.map +1 -1
  124. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js +7 -3
  125. package/dist/esm/pipeline/spec/table/pipes/cellStyle/table.js.map +1 -1
  126. package/dist/esm/pipeline/spec/table/pipes/corner/titleOnDimension.js.map +1 -1
  127. package/dist/esm/pipeline/utils/index.d.ts +1 -0
  128. package/dist/esm/pipeline/utils/index.js +1 -0
  129. package/dist/esm/pipeline/utils/sandbox/builtin-utils.d.ts +6 -0
  130. package/dist/esm/pipeline/utils/sandbox/builtin-utils.js +337 -0
  131. package/dist/esm/pipeline/utils/sandbox/builtin-utils.js.map +1 -0
  132. package/dist/esm/pipeline/utils/sandbox/execute.d.ts +73 -0
  133. package/dist/esm/pipeline/utils/sandbox/execute.js +716 -0
  134. package/dist/esm/pipeline/utils/sandbox/execute.js.map +1 -0
  135. package/dist/esm/pipeline/utils/sandbox/index.d.ts +7 -0
  136. package/dist/esm/pipeline/utils/sandbox/index.js +3 -0
  137. package/dist/esm/theme/dark/dark.js +10 -5
  138. package/dist/esm/theme/dark/dark.js.map +1 -1
  139. package/dist/esm/theme/dark/raceLine.d.ts +182 -0
  140. package/dist/esm/theme/dark/raceLine.js +39 -0
  141. package/dist/esm/theme/dark/raceLine.js.map +1 -0
  142. package/dist/esm/theme/dark/racePie.d.ts +157 -0
  143. package/dist/esm/theme/dark/racePie.js +18 -0
  144. package/dist/esm/theme/dark/racePie.js.map +1 -0
  145. package/dist/esm/theme/light/light.js +6 -1
  146. package/dist/esm/theme/light/light.js.map +1 -1
  147. package/dist/esm/theme/light/raceLine.d.ts +182 -0
  148. package/dist/esm/theme/light/raceLine.js +39 -0
  149. package/dist/esm/theme/light/raceLine.js.map +1 -0
  150. package/dist/esm/theme/light/racePie.d.ts +157 -0
  151. package/dist/esm/theme/light/racePie.js +18 -0
  152. package/dist/esm/theme/light/racePie.js.map +1 -0
  153. package/dist/esm/types/builder/builder.d.ts +1 -0
  154. package/dist/esm/types/builder/builder.js.map +1 -1
  155. package/dist/esm/types/chartType/area/zArea.d.ts +682 -18
  156. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +682 -18
  157. package/dist/esm/types/chartType/bar/zBar.d.ts +362 -10
  158. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +362 -10
  159. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +362 -10
  160. package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +210 -14
  161. package/dist/esm/types/chartType/circlePacking/zCirclePacking.d.ts +2 -2
  162. package/dist/esm/types/chartType/column/zColumn.d.ts +363 -10
  163. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +363 -10
  164. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +362 -10
  165. package/dist/esm/types/chartType/donut/zDonut.d.ts +2 -2
  166. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +842 -22
  167. package/dist/esm/types/chartType/funnel/zFunnel.d.ts +2 -2
  168. package/dist/esm/types/chartType/heatmap/zHeatmap.d.ts +2 -2
  169. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +362 -10
  170. package/dist/esm/types/chartType/index.d.ts +7 -0
  171. package/dist/esm/types/chartType/index.js +3 -0
  172. package/dist/esm/types/chartType/line/zLine.d.ts +522 -14
  173. package/dist/esm/types/chartType/pie/zPie.d.ts +2 -2
  174. package/dist/esm/types/chartType/pivotTable/zPivotTable.d.ts +241 -4
  175. package/dist/esm/types/chartType/pivotTable/zPivotTable.js +1 -1
  176. package/dist/esm/types/chartType/pivotTable/zPivotTable.js.map +1 -1
  177. package/dist/esm/types/chartType/raceBar/raceBar.d.ts +2 -2
  178. package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +363 -10
  179. package/dist/esm/types/chartType/raceColumn/raceColumn.d.ts +106 -3
  180. package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +363 -10
  181. package/dist/esm/types/chartType/raceDonut/index.d.ts +2 -0
  182. package/dist/esm/types/chartType/raceDonut/index.js +1 -0
  183. package/dist/esm/types/chartType/raceDonut/raceDonut.d.ts +75 -0
  184. package/dist/esm/types/chartType/raceDonut/zRaceDonut.d.ts +387 -0
  185. package/dist/esm/types/chartType/raceDonut/zRaceDonut.js +23 -0
  186. package/dist/esm/types/chartType/raceDonut/zRaceDonut.js.map +1 -0
  187. package/dist/esm/types/chartType/raceLine/index.d.ts +2 -0
  188. package/dist/esm/types/chartType/raceLine/index.js +1 -0
  189. package/dist/esm/types/chartType/raceLine/raceLine.d.ts +122 -0
  190. package/dist/esm/types/chartType/raceLine/raceLine.js +0 -0
  191. package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +1904 -0
  192. package/dist/esm/types/chartType/raceLine/zRaceLine.js +35 -0
  193. package/dist/esm/types/chartType/raceLine/zRaceLine.js.map +1 -0
  194. package/dist/esm/types/chartType/racePie/index.d.ts +2 -0
  195. package/dist/esm/types/chartType/racePie/index.js +1 -0
  196. package/dist/esm/types/chartType/racePie/racePie.d.ts +75 -0
  197. package/dist/esm/types/chartType/racePie/racePie.js +0 -0
  198. package/dist/esm/types/chartType/racePie/zRacePie.d.ts +387 -0
  199. package/dist/esm/types/chartType/racePie/zRacePie.js +23 -0
  200. package/dist/esm/types/chartType/racePie/zRacePie.js.map +1 -0
  201. package/dist/esm/types/chartType/raceScatter/raceScatter.d.ts +84 -0
  202. package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +363 -10
  203. package/dist/esm/types/chartType/radar/zRadar.d.ts +2 -2
  204. package/dist/esm/types/chartType/rose/zRose.d.ts +2 -2
  205. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +2 -2
  206. package/dist/esm/types/chartType/scatter/zScatter.d.ts +362 -10
  207. package/dist/esm/types/chartType/sunburst/sunburst.d.ts +1 -1
  208. package/dist/esm/types/chartType/sunburst/zSunburst.d.ts +2 -2
  209. package/dist/esm/types/chartType/table/zTable.d.ts +241 -4
  210. package/dist/esm/types/chartType/table/zTable.js +1 -1
  211. package/dist/esm/types/chartType/table/zTable.js.map +1 -1
  212. package/dist/esm/types/chartType/treeMap/zTreeMap.d.ts +2 -2
  213. package/dist/esm/types/dataSelector/selector.d.ts +594 -3
  214. package/dist/esm/types/dataSelector/selector.js +58 -2
  215. package/dist/esm/types/dataSelector/selector.js.map +1 -1
  216. package/dist/esm/types/properties/annotation/annotation.d.ts +200 -4
  217. package/dist/esm/types/properties/annotation/annotationHorizontalLine.d.ts +12 -0
  218. package/dist/esm/types/properties/annotation/annotationPoint.d.ts +19 -0
  219. package/dist/esm/types/properties/annotation/annotationVerticalLine.d.ts +12 -0
  220. package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.d.ts +10 -0
  221. package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js +2 -0
  222. package/dist/esm/types/properties/annotation/zAnnotationHorizontalLine.js.map +1 -1
  223. package/dist/esm/types/properties/annotation/zAnnotationPoint.d.ts +80 -2
  224. package/dist/esm/types/properties/annotation/zAnnotationPoint.js +2 -1
  225. package/dist/esm/types/properties/annotation/zAnnotationPoint.js.map +1 -1
  226. package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.d.ts +10 -0
  227. package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js +2 -0
  228. package/dist/esm/types/properties/annotation/zAnnotationVerticalLine.js.map +1 -1
  229. package/dist/esm/types/properties/cellStyle/bodyCellStyle.d.ts +105 -2
  230. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js +2 -1
  231. package/dist/esm/types/properties/cellStyle/bodyCellStyle.js.map +1 -1
  232. package/dist/esm/types/properties/cellStyle/cellStyle.d.ts +83 -2
  233. package/dist/esm/types/properties/chartType/chartType.d.ts +4 -1
  234. package/dist/esm/types/properties/chartType/chartType.js +3 -0
  235. package/dist/esm/types/properties/chartType/chartType.js.map +1 -1
  236. package/dist/esm/types/properties/config/annotation/zAnnotation.d.ts +156 -0
  237. package/dist/esm/types/properties/config/area.d.ts +160 -4
  238. package/dist/esm/types/properties/config/bar.d.ts +240 -6
  239. package/dist/esm/types/properties/config/boxplot.d.ts +80 -2
  240. package/dist/esm/types/properties/config/circlePacking.d.ts +2 -2
  241. package/dist/esm/types/properties/config/column.d.ts +240 -6
  242. package/dist/esm/types/properties/config/config.d.ts +3576 -96
  243. package/dist/esm/types/properties/config/config.js +4 -1
  244. package/dist/esm/types/properties/config/config.js.map +1 -1
  245. package/dist/esm/types/properties/config/dualAxis.d.ts +80 -2
  246. package/dist/esm/types/properties/config/funnel.d.ts +2 -2
  247. package/dist/esm/types/properties/config/heatmap.d.ts +2 -2
  248. package/dist/esm/types/properties/config/histogram.d.ts +80 -2
  249. package/dist/esm/types/properties/config/label/zLabel.d.ts +2 -2
  250. package/dist/esm/types/properties/config/label/zPieLabel.d.ts +2 -2
  251. package/dist/esm/types/properties/config/line.d.ts +80 -2
  252. package/dist/esm/types/properties/config/pie.d.ts +6 -6
  253. package/dist/esm/types/properties/config/player/player.d.ts +2 -2
  254. package/dist/esm/types/properties/config/player/zPlayer.d.ts +1 -0
  255. package/dist/esm/types/properties/config/player/zPlayer.js +1 -0
  256. package/dist/esm/types/properties/config/player/zPlayer.js.map +1 -1
  257. package/dist/esm/types/properties/config/race.d.ts +2519 -50
  258. package/dist/esm/types/properties/config/race.js +10 -3
  259. package/dist/esm/types/properties/config/race.js.map +1 -1
  260. package/dist/esm/types/properties/config/rose.d.ts +4 -4
  261. package/dist/esm/types/properties/config/scatter.d.ts +80 -2
  262. package/dist/esm/types/properties/config/sunburst.d.ts +2 -2
  263. package/dist/esm/types/properties/config/treeMap.d.ts +2 -2
  264. package/dist/esm/types/properties/dimensions/index.d.ts +3 -0
  265. package/dist/esm/types/properties/dimensions/raceDonutDimension.d.ts +14 -0
  266. package/dist/esm/types/properties/dimensions/raceDonutDimension.js +0 -0
  267. package/dist/esm/types/properties/dimensions/raceLineDimension.d.ts +15 -0
  268. package/dist/esm/types/properties/dimensions/raceLineDimension.js +0 -0
  269. package/dist/esm/types/properties/dimensions/racePieDimension.d.ts +14 -0
  270. package/dist/esm/types/properties/dimensions/racePieDimension.js +0 -0
  271. package/dist/esm/types/properties/markStyle/areaStyle.d.ts +19 -0
  272. package/dist/esm/types/properties/markStyle/barStyle.d.ts +99 -2
  273. package/dist/esm/types/properties/markStyle/barStyle.js +2 -1
  274. package/dist/esm/types/properties/markStyle/barStyle.js.map +1 -1
  275. package/dist/esm/types/properties/markStyle/boxPlotStyle.d.ts +2 -2
  276. package/dist/esm/types/properties/markStyle/lineStyle.d.ts +99 -2
  277. package/dist/esm/types/properties/markStyle/lineStyle.js +2 -1
  278. package/dist/esm/types/properties/markStyle/lineStyle.js.map +1 -1
  279. package/dist/esm/types/properties/markStyle/markStyle.d.ts +648 -24
  280. package/dist/esm/types/properties/markStyle/outlierStyle.d.ts +2 -2
  281. package/dist/esm/types/properties/markStyle/pointStyle.d.ts +99 -2
  282. package/dist/esm/types/properties/markStyle/pointStyle.js +2 -1
  283. package/dist/esm/types/properties/markStyle/pointStyle.js.map +1 -1
  284. package/dist/esm/types/properties/markStyle/zAreaStyle.d.ts +80 -2
  285. package/dist/esm/types/properties/markStyle/zAreaStyle.js +2 -1
  286. package/dist/esm/types/properties/markStyle/zAreaStyle.js.map +1 -1
  287. package/dist/esm/types/properties/measures/hierarchyMeasure.d.ts +10 -0
  288. package/dist/esm/types/properties/measures/hierarchyMeasure.js +0 -0
  289. package/dist/esm/types/properties/measures/index.d.ts +4 -1
  290. package/dist/esm/types/properties/measures/raceDonutMeasure.d.ts +2 -0
  291. package/dist/esm/types/properties/measures/raceDonutMeasure.js +0 -0
  292. package/dist/esm/types/properties/measures/raceLineMeasure.d.ts +2 -0
  293. package/dist/esm/types/properties/measures/raceLineMeasure.js +0 -0
  294. package/dist/esm/types/properties/measures/racePieMeasure.d.ts +2 -0
  295. package/dist/esm/types/properties/measures/racePieMeasure.js +0 -0
  296. package/dist/esm/types/properties/theme/customTheme.d.ts +9495 -2535
  297. package/dist/esm/types/sandbox.d.ts +19 -0
  298. package/dist/esm/types/sandbox.js +0 -0
  299. package/dist/esm/types/vseed.d.ts +2 -2
  300. package/dist/esm/types/zVseed.d.ts +4 -25058
  301. package/dist/esm/types/zVseed.js +7 -4
  302. package/dist/esm/types/zVseed.js.map +1 -1
  303. package/dist/umd/index.js +4310 -1922
  304. package/dist/umd/index.js.map +1 -1
  305. package/package.json +1 -1
  306. package/dist/esm/pipeline/spec/chart/pipes/player/playerXY.js.map +0 -1
  307. package/dist/esm/pipeline/spec/chart/pipes/player/playerYX.js.map +0 -1
  308. package/dist/esm/pipeline/spec/chart/pipes/player/playerYY.js.map +0 -1
  309. package/dist/esm/types/properties/measures/hierarchyMeasures.d.ts +0 -4
  310. /package/dist/esm/types/{properties/measures/hierarchyMeasures.js → chartType/raceDonut/raceDonut.js} +0 -0
@@ -1,23 +1,23 @@
1
1
  import { groupBy } from "remeda";
2
- import { isPivotChart, isVTable } from "../../../../utils/index.js";
3
2
  import { datasetScatter } from "../dataset/index.js";
4
- const playerYY = (spec, context)=>{
5
- const { vseed, advancedVSeed } = context;
3
+ const playerScatter = (spec, context)=>{
4
+ const { advancedVSeed } = context;
6
5
  const { datasetReshapeInfo, dimensions = [], chartType, encoding } = advancedVSeed;
7
6
  const baseConfig = advancedVSeed.config[chartType];
8
7
  const result = datasetScatter(spec, context);
9
- if (!baseConfig || !baseConfig.player || isVTable(vseed) || isPivotChart(vseed)) return result;
8
+ if (!baseConfig || !baseConfig.player) return result;
10
9
  const { player } = baseConfig;
11
10
  const id = datasetReshapeInfo[0].id;
12
11
  const { unfoldInfo } = datasetReshapeInfo[0];
13
12
  const { encodingPlayer } = unfoldInfo;
14
13
  const { autoPlay = true, interval = 1000, loop = false, position, railColor, trackColor, sliderHandleColor, sliderHandleBorderColor, startButtonColor, pauseButtonColor, backwardButtonColor, forwardButtonColor } = player;
14
+ const { maxCount } = player;
15
15
  const dataGroups = groupBy(advancedVSeed.dataset, (item)=>item[encodingPlayer]);
16
16
  if (result.data && 'values' in result.data) result.data.values = [];
17
17
  const specs = Object.values(dataGroups).map((items)=>({
18
18
  data: {
19
19
  id: id,
20
- values: items
20
+ values: maxCount ? items.slice(0, maxCount) : items
21
21
  }
22
22
  }));
23
23
  const duration = interval;
@@ -172,6 +172,6 @@ const playerYY = (spec, context)=>{
172
172
  }
173
173
  };
174
174
  };
175
- export { playerYY };
175
+ export { playerScatter };
176
176
 
177
- //# sourceMappingURL=playerYY.js.map
177
+ //# sourceMappingURL=playerScatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/player/playerScatter.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/chart/pipes/player/playerScatter.ts"],"sourcesContent":["import type { IPlayerSpec, ISpec } from '@visactor/vchart'\nimport { groupBy } from 'remeda'\nimport type { Player, VChartSpecPipe } from 'src/types'\nimport { datasetScatter } from '../dataset'\n\nexport const playerScatter: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { datasetReshapeInfo, dimensions = [], chartType, encoding } = advancedVSeed\n const baseConfig = advancedVSeed.config[chartType] as { player: Player }\n const result = datasetScatter(spec, context)\n\n if (!baseConfig || !baseConfig.player) {\n return result\n }\n const { player } = baseConfig\n\n const id = datasetReshapeInfo[0].id\n const { unfoldInfo } = datasetReshapeInfo[0]\n const { encodingPlayer } = unfoldInfo\n const {\n autoPlay = true,\n interval = 1000,\n loop = false,\n position,\n railColor,\n trackColor,\n sliderHandleColor,\n sliderHandleBorderColor,\n startButtonColor,\n pauseButtonColor,\n backwardButtonColor,\n forwardButtonColor,\n } = player\n\n const { maxCount } = player\n\n const dataGroups = groupBy(advancedVSeed.dataset, (item) => item[encodingPlayer])\n if (result.data && 'values' in result.data) {\n result.data.values = []\n }\n const specs = Object.values(dataGroups).map((items) => ({\n data: {\n id: id,\n values: maxCount ? items.slice(0, maxCount) : items,\n },\n }))\n\n const duration = interval\n const exchangeDuration = interval * 0.6\n const dataKey = dimensions.filter((d) => !encoding.player?.includes(d.id)).map((d) => d.id)\n const padding = 12\n const textSize = 36\n return {\n ...result,\n dataKey,\n stackCornerRadius: undefined,\n animationUpdate: {\n bar: [\n {\n type: 'update',\n options: { excludeChannels: ['x'] },\n easing: 'linear',\n duration,\n },\n {\n channel: ['x'],\n easing: 'circInOut',\n duration: exchangeDuration,\n },\n ],\n point: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n line: [\n {\n type: 'update',\n easing: 'linear',\n duration,\n },\n ],\n axis: {\n duration: exchangeDuration,\n easing: 'circInOut',\n },\n },\n animationEnter: {\n bar: [\n {\n type: 'moveIn',\n duration: exchangeDuration,\n easing: 'circInOut',\n options: {\n direction: 'x',\n orient: 'negative',\n },\n },\n ],\n },\n animationExit: {\n bar: [\n {\n type: 'fadeOut',\n duration: exchangeDuration,\n },\n ],\n },\n customMark: [\n {\n type: 'text',\n dataId: 'year',\n style: {\n textBaseline: 'bottom',\n fontSize: textSize,\n textAlign: 'right',\n fontFamily: 'PingFang SC',\n fontWeight: 600,\n text: (datum: any) => datum[encodingPlayer],\n x: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.width - padding\n },\n y: (datum: any, ctx: any) => {\n return ctx.vchart.getChart().getCanvasRect()?.height - padding - textSize\n },\n fill: 'grey',\n fillOpacity: 0.5,\n },\n },\n ],\n player: {\n visible: true,\n auto: autoPlay,\n interval: interval,\n loop: loop,\n alternate: false,\n position: 'middle',\n orient: position,\n type: 'discrete',\n specs,\n controller: {\n visible: true,\n start: { visible: true, order: 0, style: { fill: startButtonColor } },\n pause: { visible: true, order: 1, style: { fill: pauseButtonColor } },\n backward: { visible: true, order: 2, style: { fill: backwardButtonColor } },\n forward: { visible: true, order: 3, position: 'end', style: { fill: forwardButtonColor } },\n },\n slider: {\n visible: true,\n railStyle: {\n visible: true,\n fill: railColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n trackStyle: {\n visible: true,\n fill: trackColor,\n [position === 'top' || position === 'bottom' ? 'height' : 'width']: 2,\n },\n handlerStyle: {\n visible: true,\n lineWidth: 2,\n stroke: sliderHandleBorderColor,\n fill: sliderHandleColor,\n size: 9,\n },\n },\n } as IPlayerSpec,\n } as unknown as ISpec\n}\n"],"names":["playerScatter","spec","context","advancedVSeed","datasetReshapeInfo","dimensions","chartType","encoding","baseConfig","result","datasetScatter","player","id","unfoldInfo","encodingPlayer","autoPlay","interval","loop","position","railColor","trackColor","sliderHandleColor","sliderHandleBorderColor","startButtonColor","pauseButtonColor","backwardButtonColor","forwardButtonColor","maxCount","dataGroups","groupBy","item","specs","Object","items","duration","exchangeDuration","dataKey","d","padding","textSize","undefined","datum","ctx"],"mappings":";;AAKO,MAAMA,gBAAgC,CAACC,MAAMC;IAClD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,kBAAkB,EAAEC,aAAa,EAAE,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IACrE,MAAMK,aAAaL,cAAc,MAAM,CAACG,UAAU;IAClD,MAAMG,SAASC,eAAeT,MAAMC;IAEpC,IAAI,CAACM,cAAc,CAACA,WAAW,MAAM,EACnC,OAAOC;IAET,MAAM,EAAEE,MAAM,EAAE,GAAGH;IAEnB,MAAMI,KAAKR,kBAAkB,CAAC,EAAE,CAAC,EAAE;IACnC,MAAM,EAAES,UAAU,EAAE,GAAGT,kBAAkB,CAAC,EAAE;IAC5C,MAAM,EAAEU,cAAc,EAAE,GAAGD;IAC3B,MAAM,EACJE,WAAW,IAAI,EACfC,WAAW,IAAI,EACfC,OAAO,KAAK,EACZC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,iBAAiB,EACjBC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,mBAAmB,EACnBC,kBAAkB,EACnB,GAAGf;IAEJ,MAAM,EAAEgB,QAAQ,EAAE,GAAGhB;IAErB,MAAMiB,aAAaC,QAAQ1B,cAAc,OAAO,EAAE,CAAC2B,OAASA,IAAI,CAAChB,eAAe;IAChF,IAAIL,OAAO,IAAI,IAAI,YAAYA,OAAO,IAAI,EACxCA,OAAO,IAAI,CAAC,MAAM,GAAG,EAAE;IAEzB,MAAMsB,QAAQC,OAAO,MAAM,CAACJ,YAAY,GAAG,CAAC,CAACK,QAAW;YACtD,MAAM;gBACJ,IAAIrB;gBACJ,QAAQe,WAAWM,MAAM,KAAK,CAAC,GAAGN,YAAYM;YAChD;QACF;IAEA,MAAMC,WAAWlB;IACjB,MAAMmB,mBAAmBnB,AAAW,MAAXA;IACzB,MAAMoB,UAAU/B,WAAW,MAAM,CAAC,CAACgC,IAAM,CAAC9B,SAAS,MAAM,EAAE,SAAS8B,EAAE,EAAE,GAAG,GAAG,CAAC,CAACA,IAAMA,EAAE,EAAE;IAC1F,MAAMC,UAAU;IAChB,MAAMC,WAAW;IACjB,OAAO;QACL,GAAG9B,MAAM;QACT2B;QACA,mBAAmBI;QACnB,iBAAiB;YACf,KAAK;gBACH;oBACE,MAAM;oBACN,SAAS;wBAAE,iBAAiB;4BAAC;yBAAI;oBAAC;oBAClC,QAAQ;oBACRN;gBACF;gBACA;oBACE,SAAS;wBAAC;qBAAI;oBACd,QAAQ;oBACR,UAAUC;gBACZ;aACD;YACD,OAAO;gBACL;oBACE,MAAM;oBACN,QAAQ;oBACRD;gBACF;aACD;YACD,MAAM;gBACJ;oBACE,MAAM;oBACN,QAAQ;oBACRA;gBACF;aACD;YACD,MAAM;gBACJ,UAAUC;gBACV,QAAQ;YACV;QACF;QACA,gBAAgB;YACd,KAAK;gBACH;oBACE,MAAM;oBACN,UAAUA;oBACV,QAAQ;oBACR,SAAS;wBACP,WAAW;wBACX,QAAQ;oBACV;gBACF;aACD;QACH;QACA,eAAe;YACb,KAAK;gBACH;oBACE,MAAM;oBACN,UAAUA;gBACZ;aACD;QACH;QACA,YAAY;YACV;gBACE,MAAM;gBACN,QAAQ;gBACR,OAAO;oBACL,cAAc;oBACd,UAAUI;oBACV,WAAW;oBACX,YAAY;oBACZ,YAAY;oBACZ,MAAM,CAACE,QAAeA,KAAK,CAAC3B,eAAe;oBAC3C,GAAG,CAAC2B,OAAYC,MACPA,IAAI,MAAM,CAAC,QAAQ,GAAG,aAAa,IAAI,QAAQJ;oBAExD,GAAG,CAACG,OAAYC,MACPA,IAAI,MAAM,CAAC,QAAQ,GAAG,aAAa,IAAI,SAASJ,UAAUC;oBAEnE,MAAM;oBACN,aAAa;gBACf;YACF;SACD;QACD,QAAQ;YACN,SAAS;YACT,MAAMxB;YACN,UAAUC;YACV,MAAMC;YACN,WAAW;YACX,UAAU;YACV,QAAQC;YACR,MAAM;YACNa;YACA,YAAY;gBACV,SAAS;gBACT,OAAO;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMR;oBAAiB;gBAAE;gBACpE,OAAO;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMC;oBAAiB;gBAAE;gBACpE,UAAU;oBAAE,SAAS;oBAAM,OAAO;oBAAG,OAAO;wBAAE,MAAMC;oBAAoB;gBAAE;gBAC1E,SAAS;oBAAE,SAAS;oBAAM,OAAO;oBAAG,UAAU;oBAAO,OAAO;wBAAE,MAAMC;oBAAmB;gBAAE;YAC3F;YACA,QAAQ;gBACN,SAAS;gBACT,WAAW;oBACT,SAAS;oBACT,MAAMP;oBACN,CAACD,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,YAAY;oBACV,SAAS;oBACT,MAAME;oBACN,CAACF,AAAa,UAAbA,YAAsBA,AAAa,aAAbA,WAAwB,WAAW,QAAQ,EAAE;gBACtE;gBACA,cAAc;oBACZ,SAAS;oBACT,WAAW;oBACX,QAAQI;oBACR,MAAMD;oBACN,MAAM;gBACR;YACF;QACF;IACF;AACF"}
@@ -1,2 +1,5 @@
1
- import type { BodyCellStyle } from '../../../../../types';
1
+ import type { BodyCellStyle, Datum } from '../../../../../types';
2
2
  export declare const pickBodyCellStyle: (bodyCellStyle: BodyCellStyle) => Record<string, any>;
3
+ export declare const getCellOriginalDataByDatum: (datum: any, hasDynamicFilter: boolean, originalDatum: Datum) => {
4
+ __row_index: any;
5
+ } | null;
@@ -1,3 +1,5 @@
1
+ import { isArray } from "remeda";
2
+ import { InnerRowIndex } from "../../../../../dataReshape/index.js";
1
3
  const tableStyleMap = {
2
4
  backgroundColor: 'bgColor',
3
5
  textColor: 'color',
@@ -9,6 +11,15 @@ const pickBodyCellStyle = (bodyCellStyle)=>Object.keys(tableStyleMap).reduce((ac
9
11
  if (key in bodyCellStyle) acc[tableStyleMap[key]] = bodyCellStyle[key];
10
12
  return acc;
11
13
  }, {});
12
- export { pickBodyCellStyle };
14
+ const getCellOriginalDataByDatum = (datum, hasDynamicFilter, originalDatum)=>{
15
+ const tableInstance = datum?.table;
16
+ let originRowData = tableInstance && hasDynamicFilter ? tableInstance?.getCellOriginRecord(datum?.col, datum?.row) : null;
17
+ if (originRowData && isArray(originRowData)) originRowData = originRowData[0];
18
+ return originRowData ? {
19
+ ...originalDatum,
20
+ [InnerRowIndex]: originRowData?.[InnerRowIndex]
21
+ } : null;
22
+ };
23
+ export { getCellOriginalDataByDatum, pickBodyCellStyle };
13
24
 
14
25
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/common.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/common.ts"],"sourcesContent":["import type { BodyCellStyle } from 'src/types'\n\nconst tableStyleMap = {\n backgroundColor: 'bgColor',\n textColor: 'color',\n textFontSize: 'fontSize',\n borderColor: 'borderColor',\n borderLineWidth: 'borderLineWidth',\n}\n\nexport const pickBodyCellStyle = (bodyCellStyle: BodyCellStyle) => {\n return (Object.keys(tableStyleMap) as Array<keyof typeof tableStyleMap>).reduce<Record<string, any>>((acc, key) => {\n if (key in bodyCellStyle) {\n acc[tableStyleMap[key]] = bodyCellStyle[key]\n }\n\n return acc\n }, {})\n}\n"],"names":["tableStyleMap","pickBodyCellStyle","bodyCellStyle","Object","acc","key"],"mappings":"AAEA,MAAMA,gBAAgB;IACpB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,aAAa;IACb,iBAAiB;AACnB;AAEO,MAAMC,oBAAoB,CAACC,gBACxBC,OAAO,IAAI,CAACH,eAAqD,MAAM,CAAsB,CAACI,KAAKC;QACzG,IAAIA,OAAOH,eACTE,GAAG,CAACJ,aAAa,CAACK,IAAI,CAAC,GAAGH,aAAa,CAACG,IAAI;QAG9C,OAAOD;IACT,GAAG,CAAC"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/common.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/common.ts"],"sourcesContent":["import { isArray } from 'remeda'\nimport { InnerRowIndex } from 'src/dataReshape'\nimport type { BodyCellStyle, Datum } from 'src/types'\n\nconst tableStyleMap = {\n backgroundColor: 'bgColor',\n textColor: 'color',\n textFontSize: 'fontSize',\n borderColor: 'borderColor',\n borderLineWidth: 'borderLineWidth',\n}\n\nexport const pickBodyCellStyle = (bodyCellStyle: BodyCellStyle) => {\n return (Object.keys(tableStyleMap) as Array<keyof typeof tableStyleMap>).reduce<Record<string, any>>((acc, key) => {\n if (key in bodyCellStyle) {\n acc[tableStyleMap[key]] = bodyCellStyle[key]\n }\n\n return acc\n }, {})\n}\n\nexport const getCellOriginalDataByDatum = (datum: any, hasDynamicFilter: boolean, originalDatum: Datum) => {\n const tableInstance = datum?.table\n let originRowData =\n tableInstance && hasDynamicFilter ? tableInstance?.getCellOriginRecord(datum?.col, datum?.row) : null\n if (originRowData && isArray(originRowData)) {\n originRowData = originRowData[0]\n }\n return originRowData\n ? {\n ...originalDatum,\n [InnerRowIndex]: originRowData?.[InnerRowIndex], // 内部行号字段\n }\n : null\n}\n"],"names":["tableStyleMap","pickBodyCellStyle","bodyCellStyle","Object","acc","key","getCellOriginalDataByDatum","datum","hasDynamicFilter","originalDatum","tableInstance","originRowData","isArray","InnerRowIndex"],"mappings":";;AAIA,MAAMA,gBAAgB;IACpB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,aAAa;IACb,iBAAiB;AACnB;AAEO,MAAMC,oBAAoB,CAACC,gBACxBC,OAAO,IAAI,CAACH,eAAqD,MAAM,CAAsB,CAACI,KAAKC;QACzG,IAAIA,OAAOH,eACTE,GAAG,CAACJ,aAAa,CAACK,IAAI,CAAC,GAAGH,aAAa,CAACG,IAAI;QAG9C,OAAOD;IACT,GAAG,CAAC;AAGC,MAAME,6BAA6B,CAACC,OAAYC,kBAA2BC;IAChF,MAAMC,gBAAgBH,OAAO;IAC7B,IAAII,gBACFD,iBAAiBF,mBAAmBE,eAAe,oBAAoBH,OAAO,KAAKA,OAAO,OAAO;IACnG,IAAII,iBAAiBC,QAAQD,gBAC3BA,gBAAgBA,aAAa,CAAC,EAAE;IAElC,OAAOA,gBACH;QACE,GAAGF,aAAa;QAChB,CAACI,cAAc,EAAEF,eAAe,CAACE,cAAc;IACjD,IACA;AACN"}
@@ -1,7 +1,7 @@
1
1
  import { array } from "@visactor/vutils";
2
2
  import { isNullish, isString } from "remeda";
3
- import { selector } from "../../../../../dataSelector/selector.js";
4
- import { pickBodyCellStyle } from "./common.js";
3
+ import { selector, selectorWithDynamicFilter } from "../../../../../dataSelector/selector.js";
4
+ import { getCellOriginalDataByDatum, pickBodyCellStyle } from "./common.js";
5
5
  import { FoldMeasureValue, MeasureId } from "../../../../../dataReshape/index.js";
6
6
  const pivotTableBodyCell = (spec, context)=>{
7
7
  const { advancedVSeed } = context;
@@ -11,6 +11,7 @@ const pivotTableBodyCell = (spec, context)=>{
11
11
  const bodyCellStyleList = array(bodyCellStyle);
12
12
  const indicators = spec.indicators || [];
13
13
  const selectedPos = [];
14
+ const hasDynamicFilter = bodyCellStyleList.some((style)=>!!style.dynamicFilter);
14
15
  const newIndicators = indicators.map((ind)=>{
15
16
  const newInd = isString(ind) ? {
16
17
  indicatorKey: ind
@@ -29,8 +30,10 @@ const pivotTableBodyCell = (spec, context)=>{
29
30
  if (path.dimensionKey) originalDatum[path.dimensionKey] = path.value;
30
31
  });
31
32
  if (!isNullish(originalDatum[MeasureId]) && !isNullish(originalDatum[FoldMeasureValue])) originalDatum[originalDatum[MeasureId]] = originalDatum[FoldMeasureValue];
33
+ const currentCellData = getCellOriginalDataByDatum(datum, hasDynamicFilter, originalDatum);
32
34
  const mergedStyle = bodyCellStyleList.reduce((result, style)=>{
33
- if (selector(originalDatum, style.selector)) {
35
+ const shouldApply = style.dynamicFilter ? selectorWithDynamicFilter(currentCellData || originalDatum, style.dynamicFilter, style.selector) : selector(originalDatum, style.selector);
36
+ if (shouldApply) {
34
37
  if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) selectedPos.length = 0;
35
38
  selectedPos.push({
36
39
  col: datum?.col,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/pivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/pivot.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport type { IIndicator, PivotTableConstructorOptions } from '@visactor/vtable'\nimport { array } from '@visactor/vutils'\nimport { isNullish, isString } from 'remeda'\nimport { selector } from 'src/dataSelector/selector'\nimport type { BodyCellStyle, Datum, PivotTableSpecPipe } from 'src/types'\nimport { pickBodyCellStyle } from './common'\nimport { FoldMeasureValue, MeasureId } from 'src/dataReshape'\n\nexport const pivotTableBodyCell: PivotTableSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { cellStyle } = advancedVSeed\n const bodyCellStyle = cellStyle?.bodyCellStyle\n\n if (!bodyCellStyle) {\n return spec as PivotTableConstructorOptions\n }\n const bodyCellStyleList = array(bodyCellStyle) as BodyCellStyle[]\n const indicators = (spec as PivotTableConstructorOptions).indicators || []\n const selectedPos: { col: number; row: number }[] = []\n\n const newIndicators = indicators.map((ind) => {\n const newInd = isString(ind)\n ? ({\n indicatorKey: ind,\n } as IIndicator)\n : ind\n\n const { indicatorKey } = newInd\n\n newInd.style = (datum: any) => {\n const { dataValue, cellHeaderPaths } = datum\n const headerPaths = [...cellHeaderPaths.colHeaderPaths, ...cellHeaderPaths.rowHeaderPaths]\n\n const originalDatum: Datum = {\n [indicatorKey]: dataValue,\n }\n\n headerPaths.forEach((path: any) => {\n if (path.dimensionKey) {\n originalDatum[path.dimensionKey] = path.value\n }\n })\n\n if (!isNullish(originalDatum[MeasureId]) && !isNullish(originalDatum[FoldMeasureValue])) {\n originalDatum[originalDatum[MeasureId]] = originalDatum[FoldMeasureValue]\n }\n\n const mergedStyle = bodyCellStyleList.reduce<Record<string, any>>((result, style) => {\n if (selector(originalDatum, style.selector)) {\n if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) {\n // 说明重复进入了,清空历史\n selectedPos.length = 0\n }\n selectedPos.push({\n col: datum?.col,\n row: datum?.row,\n })\n return {\n ...result,\n ...pickBodyCellStyle(style),\n }\n }\n\n return result\n }, {})\n\n return mergedStyle\n }\n return newInd\n })\n return {\n ...spec,\n runningConfig: {\n ...((spec as any)?.runningConfig || {}),\n selectedPos,\n },\n indicators: newIndicators,\n } as PivotTableConstructorOptions\n}\n"],"names":["pivotTableBodyCell","spec","context","advancedVSeed","cellStyle","bodyCellStyle","bodyCellStyleList","array","indicators","selectedPos","newIndicators","ind","newInd","isString","indicatorKey","datum","dataValue","cellHeaderPaths","headerPaths","originalDatum","path","isNullish","MeasureId","FoldMeasureValue","mergedStyle","result","style","selector","pickBodyCellStyle"],"mappings":";;;;;AASO,MAAMA,qBAAyC,CAACC,MAAMC;IAC3D,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,gBAAgBD,WAAW;IAEjC,IAAI,CAACC,eACH,OAAOJ;IAET,MAAMK,oBAAoBC,MAAMF;IAChC,MAAMG,aAAcP,KAAsC,UAAU,IAAI,EAAE;IAC1E,MAAMQ,cAA8C,EAAE;IAEtD,MAAMC,gBAAgBF,WAAW,GAAG,CAAC,CAACG;QACpC,MAAMC,SAASC,SAASF,OACnB;YACC,cAAcA;QAChB,IACAA;QAEJ,MAAM,EAAEG,YAAY,EAAE,GAAGF;QAEzBA,OAAO,KAAK,GAAG,CAACG;YACd,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAE,GAAGF;YACvC,MAAMG,cAAc;mBAAID,gBAAgB,cAAc;mBAAKA,gBAAgB,cAAc;aAAC;YAE1F,MAAME,gBAAuB;gBAC3B,CAACL,aAAa,EAAEE;YAClB;YAEAE,YAAY,OAAO,CAAC,CAACE;gBACnB,IAAIA,KAAK,YAAY,EACnBD,aAAa,CAACC,KAAK,YAAY,CAAC,GAAGA,KAAK,KAAK;YAEjD;YAEA,IAAI,CAACC,UAAUF,aAAa,CAACG,UAAU,KAAK,CAACD,UAAUF,aAAa,CAACI,iBAAiB,GACpFJ,aAAa,CAACA,aAAa,CAACG,UAAU,CAAC,GAAGH,aAAa,CAACI,iBAAiB;YAG3E,MAAMC,cAAclB,kBAAkB,MAAM,CAAsB,CAACmB,QAAQC;gBACzE,IAAIC,SAASR,eAAeO,MAAM,QAAQ,GAAG;oBAC3C,IAAIjB,YAAY,MAAM,IAAIA,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKM,OAAO,OAAON,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKM,OAAO,KAE3FN,YAAY,MAAM,GAAG;oBAEvBA,YAAY,IAAI,CAAC;wBACf,KAAKM,OAAO;wBACZ,KAAKA,OAAO;oBACd;oBACA,OAAO;wBACL,GAAGU,MAAM;wBACT,GAAGG,kBAAkBF,MAAM;oBAC7B;gBACF;gBAEA,OAAOD;YACT,GAAG,CAAC;YAEJ,OAAOD;QACT;QACA,OAAOZ;IACT;IACA,OAAO;QACL,GAAGX,IAAI;QACP,eAAe;YACb,GAAKA,MAAc,iBAAiB,CAAC,CAAC;YACtCQ;QACF;QACA,YAAYC;IACd;AACF"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/pivot.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/pivot.ts"],"sourcesContent":["import type { IIndicator, PivotTableConstructorOptions } from '@visactor/vtable'\nimport { array } from '@visactor/vutils'\nimport { isNullish, isString } from 'remeda'\nimport { selector, selectorWithDynamicFilter } from 'src/dataSelector/selector'\nimport type { BodyCellStyle, Datum, PivotTableSpecPipe } from 'src/types'\nimport { getCellOriginalDataByDatum, pickBodyCellStyle } from './common'\nimport { FoldMeasureValue, MeasureId } from 'src/dataReshape'\n\nexport const pivotTableBodyCell: PivotTableSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { cellStyle } = advancedVSeed\n const bodyCellStyle = cellStyle?.bodyCellStyle\n\n if (!bodyCellStyle) {\n return spec as PivotTableConstructorOptions\n }\n const bodyCellStyleList = array(bodyCellStyle) as BodyCellStyle[]\n const indicators = (spec as PivotTableConstructorOptions).indicators || []\n const selectedPos: { col: number; row: number }[] = []\n const hasDynamicFilter = bodyCellStyleList.some((style) => !!style.dynamicFilter)\n\n const newIndicators = indicators.map((ind) => {\n const newInd = isString(ind)\n ? ({\n indicatorKey: ind,\n } as IIndicator)\n : ind\n\n const { indicatorKey } = newInd\n\n newInd.style = (datum: any) => {\n const { dataValue, cellHeaderPaths } = datum\n const headerPaths = [...cellHeaderPaths.colHeaderPaths, ...cellHeaderPaths.rowHeaderPaths]\n\n const originalDatum: Datum = {\n [indicatorKey]: dataValue,\n }\n\n headerPaths.forEach((path: any) => {\n if (path.dimensionKey) {\n originalDatum[path.dimensionKey] = path.value\n }\n })\n\n if (!isNullish(originalDatum[MeasureId]) && !isNullish(originalDatum[FoldMeasureValue])) {\n originalDatum[originalDatum[MeasureId]] = originalDatum[FoldMeasureValue]\n }\n const currentCellData = getCellOriginalDataByDatum(datum, hasDynamicFilter, originalDatum)\n\n const mergedStyle = bodyCellStyleList.reduce<Record<string, any>>((result, style) => {\n const shouldApply = style.dynamicFilter\n ? selectorWithDynamicFilter(currentCellData || originalDatum, style.dynamicFilter, style.selector)\n : selector(originalDatum, style.selector)\n if (shouldApply) {\n if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) {\n // 说明重复进入了,清空历史\n selectedPos.length = 0\n }\n selectedPos.push({\n col: datum?.col,\n row: datum?.row,\n })\n return {\n ...result,\n ...pickBodyCellStyle(style),\n }\n }\n\n return result\n }, {})\n\n return mergedStyle\n }\n return newInd\n })\n return {\n ...spec,\n runningConfig: {\n ...((spec as any)?.runningConfig || {}),\n selectedPos,\n },\n indicators: newIndicators,\n } as PivotTableConstructorOptions\n}\n"],"names":["pivotTableBodyCell","spec","context","advancedVSeed","cellStyle","bodyCellStyle","bodyCellStyleList","array","indicators","selectedPos","hasDynamicFilter","style","newIndicators","ind","newInd","isString","indicatorKey","datum","dataValue","cellHeaderPaths","headerPaths","originalDatum","path","isNullish","MeasureId","FoldMeasureValue","currentCellData","getCellOriginalDataByDatum","mergedStyle","result","shouldApply","selectorWithDynamicFilter","selector","pickBodyCellStyle"],"mappings":";;;;;AAQO,MAAMA,qBAAyC,CAACC,MAAMC;IAC3D,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,gBAAgBD,WAAW;IAEjC,IAAI,CAACC,eACH,OAAOJ;IAET,MAAMK,oBAAoBC,MAAMF;IAChC,MAAMG,aAAcP,KAAsC,UAAU,IAAI,EAAE;IAC1E,MAAMQ,cAA8C,EAAE;IACtD,MAAMC,mBAAmBJ,kBAAkB,IAAI,CAAC,CAACK,QAAU,CAAC,CAACA,MAAM,aAAa;IAEhF,MAAMC,gBAAgBJ,WAAW,GAAG,CAAC,CAACK;QACpC,MAAMC,SAASC,SAASF,OACnB;YACC,cAAcA;QAChB,IACAA;QAEJ,MAAM,EAAEG,YAAY,EAAE,GAAGF;QAEzBA,OAAO,KAAK,GAAG,CAACG;YACd,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAE,GAAGF;YACvC,MAAMG,cAAc;mBAAID,gBAAgB,cAAc;mBAAKA,gBAAgB,cAAc;aAAC;YAE1F,MAAME,gBAAuB;gBAC3B,CAACL,aAAa,EAAEE;YAClB;YAEAE,YAAY,OAAO,CAAC,CAACE;gBACnB,IAAIA,KAAK,YAAY,EACnBD,aAAa,CAACC,KAAK,YAAY,CAAC,GAAGA,KAAK,KAAK;YAEjD;YAEA,IAAI,CAACC,UAAUF,aAAa,CAACG,UAAU,KAAK,CAACD,UAAUF,aAAa,CAACI,iBAAiB,GACpFJ,aAAa,CAACA,aAAa,CAACG,UAAU,CAAC,GAAGH,aAAa,CAACI,iBAAiB;YAE3E,MAAMC,kBAAkBC,2BAA2BV,OAAOP,kBAAkBW;YAE5E,MAAMO,cAActB,kBAAkB,MAAM,CAAsB,CAACuB,QAAQlB;gBACzE,MAAMmB,cAAcnB,MAAM,aAAa,GACnCoB,0BAA0BL,mBAAmBL,eAAeV,MAAM,aAAa,EAAEA,MAAM,QAAQ,IAC/FqB,SAASX,eAAeV,MAAM,QAAQ;gBAC1C,IAAImB,aAAa;oBACf,IAAIrB,YAAY,MAAM,IAAIA,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKQ,OAAO,OAAOR,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKQ,OAAO,KAE3FR,YAAY,MAAM,GAAG;oBAEvBA,YAAY,IAAI,CAAC;wBACf,KAAKQ,OAAO;wBACZ,KAAKA,OAAO;oBACd;oBACA,OAAO;wBACL,GAAGY,MAAM;wBACT,GAAGI,kBAAkBtB,MAAM;oBAC7B;gBACF;gBAEA,OAAOkB;YACT,GAAG,CAAC;YAEJ,OAAOD;QACT;QACA,OAAOd;IACT;IACA,OAAO;QACL,GAAGb,IAAI;QACP,eAAe;YACb,GAAKA,MAAc,iBAAiB,CAAC,CAAC;YACtCQ;QACF;QACA,YAAYG;IACd;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { array } from "@visactor/vutils";
2
2
  import { isNullish, isNumber, isPlainObject, isString } from "remeda";
3
- import { selector as selector_js_selector } from "../../../../../dataSelector/selector.js";
4
- import { pickBodyCellStyle } from "./common.js";
3
+ import { selector as selector_js_selector, selectorWithDynamicFilter } from "../../../../../dataSelector/selector.js";
4
+ import { getCellOriginalDataByDatum, pickBodyCellStyle } from "./common.js";
5
5
  import { preorderTraverse } from "../../../../utils/tree/traverse.js";
6
6
  const tableBodyCell = (spec, context)=>{
7
7
  const { advancedVSeed } = context;
@@ -14,17 +14,21 @@ const tableBodyCell = (spec, context)=>{
14
14
  const setStyleOfColumn = (col)=>{
15
15
  const field = col.field;
16
16
  const matchedStyles = bodyCellStyleList.filter((style)=>{
17
+ if (style?.dynamicFilter) return style.dynamicFilter?.result?.success === true || !!style.dynamicFilter?.fallback;
17
18
  if (isNullish(style.selector)) return true;
18
19
  const selectors = array(style.selector);
19
20
  return selectors.some((selector)=>isPlainObject(selector) ? isNullish(selector.field) || selector.field === field : isNumber(selector) || isString(selector));
20
21
  });
21
22
  if (!matchedStyles.length) return false;
23
+ const hasDynamicFilter = matchedStyles.some((style)=>!!style.dynamicFilter);
22
24
  col.style = (datum)=>{
23
25
  const originalDatum = {
24
26
  [field]: datum.dataValue
25
27
  };
28
+ const currentCellData = getCellOriginalDataByDatum(datum, hasDynamicFilter, originalDatum);
26
29
  const mergedStyle = matchedStyles.reduce((result, style)=>{
27
- if (selector_js_selector(originalDatum, style.selector)) {
30
+ const shouldApply = style.dynamicFilter ? selectorWithDynamicFilter(currentCellData || originalDatum, style.dynamicFilter, style.selector) : selector_js_selector(originalDatum, style.selector);
31
+ if (shouldApply) {
28
32
  if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) selectedPos.length = 0;
29
33
  selectedPos.push({
30
34
  col: datum?.col,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/table.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/table.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport type { ListTableConstructorOptions, ColumnDefine } from '@visactor/vtable'\nimport { array } from '@visactor/vutils'\nimport { isNullish, isNumber, isPlainObject, isString } from 'remeda'\nimport { selector } from 'src/dataSelector/selector'\nimport type { BodyCellStyle, ListTableSpecPipe } from 'src/types'\nimport type { MeasureSelector, Selectors } from 'src/types/dataSelector'\nimport { pickBodyCellStyle } from './common'\nimport { preorderTraverse } from 'src/pipeline/utils/tree/traverse'\n\nexport const tableBodyCell: ListTableSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { cellStyle } = advancedVSeed\n const bodyCellStyle = cellStyle?.bodyCellStyle\n\n if (!bodyCellStyle) {\n return spec as ListTableConstructorOptions\n }\n const bodyCellStyleList = array(bodyCellStyle) as BodyCellStyle[]\n const columns = (spec as ListTableConstructorOptions).columns || []\n const selectedPos: { col: number; row: number }[] = []\n const setStyleOfColumn = (col: ColumnDefine) => {\n const field = col.field as string\n const matchedStyles = bodyCellStyleList.filter((style) => {\n if (isNullish(style.selector)) {\n return true\n }\n const selectors = array(style.selector) as Selectors\n\n return selectors.some((selector) => {\n return isPlainObject(selector)\n ? isNullish(selector.field) || (selector as MeasureSelector).field === field\n : isNumber(selector) || isString(selector)\n })\n })\n\n if (!matchedStyles.length) {\n return false\n }\n\n col.style = (datum: any) => {\n const originalDatum = {\n [field]: datum.dataValue,\n }\n\n const mergedStyle = matchedStyles.reduce<Record<string, any>>((result, style) => {\n if (selector(originalDatum, style.selector)) {\n if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) {\n // 说明重复进入了,清空历史\n selectedPos.length = 0\n }\n selectedPos.push({\n col: datum?.col,\n row: datum?.row,\n })\n return {\n ...result,\n ...pickBodyCellStyle(style),\n }\n }\n\n return result\n }, {})\n\n return mergedStyle\n }\n return false\n }\n\n preorderTraverse<ColumnDefine, 'columns'>(columns, setStyleOfColumn, 'columns')\n ;(spec as any).runningConfig = {\n ...((spec as any).runningConfig || {}),\n selectedPos,\n }\n\n return spec as ListTableConstructorOptions\n}\n"],"names":["tableBodyCell","spec","context","advancedVSeed","cellStyle","bodyCellStyle","bodyCellStyleList","array","columns","selectedPos","setStyleOfColumn","col","field","matchedStyles","style","isNullish","selectors","selector","isPlainObject","isNumber","isString","datum","originalDatum","mergedStyle","result","pickBodyCellStyle","preorderTraverse"],"mappings":";;;;;AAUO,MAAMA,gBAAmC,CAACC,MAAMC;IACrD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,gBAAgBD,WAAW;IAEjC,IAAI,CAACC,eACH,OAAOJ;IAET,MAAMK,oBAAoBC,MAAMF;IAChC,MAAMG,UAAWP,KAAqC,OAAO,IAAI,EAAE;IACnE,MAAMQ,cAA8C,EAAE;IACtD,MAAMC,mBAAmB,CAACC;QACxB,MAAMC,QAAQD,IAAI,KAAK;QACvB,MAAME,gBAAgBP,kBAAkB,MAAM,CAAC,CAACQ;YAC9C,IAAIC,UAAUD,MAAM,QAAQ,GAC1B,OAAO;YAET,MAAME,YAAYT,MAAMO,MAAM,QAAQ;YAEtC,OAAOE,UAAU,IAAI,CAAC,CAACC,WACdC,cAAcD,YACjBF,UAAUE,SAAS,KAAK,KAAMA,SAA6B,KAAK,KAAKL,QACrEO,SAASF,aAAaG,SAASH;QAEvC;QAEA,IAAI,CAACJ,cAAc,MAAM,EACvB,OAAO;QAGTF,IAAI,KAAK,GAAG,CAACU;YACX,MAAMC,gBAAgB;gBACpB,CAACV,MAAM,EAAES,MAAM,SAAS;YAC1B;YAEA,MAAME,cAAcV,cAAc,MAAM,CAAsB,CAACW,QAAQV;gBACrE,IAAIG,qBAASK,eAAeR,MAAM,QAAQ,GAAG;oBAC3C,IAAIL,YAAY,MAAM,IAAIA,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKY,OAAO,OAAOZ,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKY,OAAO,KAE3FZ,YAAY,MAAM,GAAG;oBAEvBA,YAAY,IAAI,CAAC;wBACf,KAAKY,OAAO;wBACZ,KAAKA,OAAO;oBACd;oBACA,OAAO;wBACL,GAAGG,MAAM;wBACT,GAAGC,kBAAkBX,MAAM;oBAC7B;gBACF;gBAEA,OAAOU;YACT,GAAG,CAAC;YAEJ,OAAOD;QACT;QACA,OAAO;IACT;IAEAG,iBAA0ClB,SAASE,kBAAkB;IACnET,KAAa,aAAa,GAAG;QAC7B,GAAKA,KAAa,aAAa,IAAI,CAAC,CAAC;QACrCQ;IACF;IAEA,OAAOR;AACT"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/cellStyle/table.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/cellStyle/table.ts"],"sourcesContent":["import type { ListTableConstructorOptions, ColumnDefine } from '@visactor/vtable'\nimport { array } from '@visactor/vutils'\nimport { isNullish, isNumber, isPlainObject, isString } from 'remeda'\nimport { selector, selectorWithDynamicFilter } from 'src/dataSelector/selector'\nimport type { BodyCellStyle, ListTableSpecPipe } from 'src/types'\nimport type { MeasureSelector, Selectors } from 'src/types/dataSelector'\nimport { getCellOriginalDataByDatum, pickBodyCellStyle } from './common'\nimport { preorderTraverse } from 'src/pipeline/utils/tree/traverse'\n\nexport const tableBodyCell: ListTableSpecPipe = (spec, context) => {\n const { advancedVSeed } = context\n const { cellStyle } = advancedVSeed\n const bodyCellStyle = cellStyle?.bodyCellStyle\n\n if (!bodyCellStyle) {\n return spec as ListTableConstructorOptions\n }\n const bodyCellStyleList = array(bodyCellStyle) as BodyCellStyle[]\n const columns = (spec as ListTableConstructorOptions).columns || []\n const selectedPos: { col: number; row: number }[] = []\n const setStyleOfColumn = (col: ColumnDefine) => {\n const field = col.field as string\n const matchedStyles = bodyCellStyleList.filter((style) => {\n if (style?.dynamicFilter) {\n return style.dynamicFilter?.result?.success === true || !!style.dynamicFilter?.fallback\n }\n if (isNullish(style.selector)) {\n return true\n }\n const selectors = array(style.selector) as Selectors\n\n return selectors.some((selector) => {\n return isPlainObject(selector)\n ? isNullish(selector.field) || (selector as MeasureSelector).field === field\n : isNumber(selector) || isString(selector)\n })\n })\n\n if (!matchedStyles.length) {\n return false\n }\n\n const hasDynamicFilter = matchedStyles.some((style) => !!style.dynamicFilter)\n\n col.style = (datum: any) => {\n const originalDatum = {\n [field]: datum.dataValue,\n }\n const currentCellData = getCellOriginalDataByDatum(datum, hasDynamicFilter, originalDatum)\n\n const mergedStyle = matchedStyles.reduce<Record<string, any>>((result, style) => {\n const shouldApply = style.dynamicFilter\n ? selectorWithDynamicFilter(currentCellData || originalDatum, style.dynamicFilter, style.selector)\n : selector(originalDatum, style.selector)\n\n if (shouldApply) {\n if (selectedPos.length && selectedPos[0].col === datum?.col && selectedPos[0].row === datum?.row) {\n // 说明重复进入了,清空历史\n selectedPos.length = 0\n }\n selectedPos.push({\n col: datum?.col,\n row: datum?.row,\n })\n return {\n ...result,\n ...pickBodyCellStyle(style),\n }\n }\n\n return result\n }, {})\n\n return mergedStyle\n }\n return false\n }\n\n preorderTraverse<ColumnDefine, 'columns'>(columns, setStyleOfColumn, 'columns')\n ;(spec as any).runningConfig = {\n ...((spec as any).runningConfig || {}),\n selectedPos,\n }\n\n return spec as ListTableConstructorOptions\n}\n"],"names":["tableBodyCell","spec","context","advancedVSeed","cellStyle","bodyCellStyle","bodyCellStyleList","array","columns","selectedPos","setStyleOfColumn","col","field","matchedStyles","style","isNullish","selectors","selector","isPlainObject","isNumber","isString","hasDynamicFilter","datum","originalDatum","currentCellData","getCellOriginalDataByDatum","mergedStyle","result","shouldApply","selectorWithDynamicFilter","pickBodyCellStyle","preorderTraverse"],"mappings":";;;;;AASO,MAAMA,gBAAmC,CAACC,MAAMC;IACrD,MAAM,EAAEC,aAAa,EAAE,GAAGD;IAC1B,MAAM,EAAEE,SAAS,EAAE,GAAGD;IACtB,MAAME,gBAAgBD,WAAW;IAEjC,IAAI,CAACC,eACH,OAAOJ;IAET,MAAMK,oBAAoBC,MAAMF;IAChC,MAAMG,UAAWP,KAAqC,OAAO,IAAI,EAAE;IACnE,MAAMQ,cAA8C,EAAE;IACtD,MAAMC,mBAAmB,CAACC;QACxB,MAAMC,QAAQD,IAAI,KAAK;QACvB,MAAME,gBAAgBP,kBAAkB,MAAM,CAAC,CAACQ;YAC9C,IAAIA,OAAO,eACT,OAAOA,MAAM,aAAa,EAAE,QAAQ,YAAY,QAAQ,CAAC,CAACA,MAAM,aAAa,EAAE;YAEjF,IAAIC,UAAUD,MAAM,QAAQ,GAC1B,OAAO;YAET,MAAME,YAAYT,MAAMO,MAAM,QAAQ;YAEtC,OAAOE,UAAU,IAAI,CAAC,CAACC,WACdC,cAAcD,YACjBF,UAAUE,SAAS,KAAK,KAAMA,SAA6B,KAAK,KAAKL,QACrEO,SAASF,aAAaG,SAASH;QAEvC;QAEA,IAAI,CAACJ,cAAc,MAAM,EACvB,OAAO;QAGT,MAAMQ,mBAAmBR,cAAc,IAAI,CAAC,CAACC,QAAU,CAAC,CAACA,MAAM,aAAa;QAE5EH,IAAI,KAAK,GAAG,CAACW;YACX,MAAMC,gBAAgB;gBACpB,CAACX,MAAM,EAAEU,MAAM,SAAS;YAC1B;YACA,MAAME,kBAAkBC,2BAA2BH,OAAOD,kBAAkBE;YAE5E,MAAMG,cAAcb,cAAc,MAAM,CAAsB,CAACc,QAAQb;gBACrE,MAAMc,cAAcd,MAAM,aAAa,GACnCe,0BAA0BL,mBAAmBD,eAAeT,MAAM,aAAa,EAAEA,MAAM,QAAQ,IAC/FG,qBAASM,eAAeT,MAAM,QAAQ;gBAE1C,IAAIc,aAAa;oBACf,IAAInB,YAAY,MAAM,IAAIA,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKa,OAAO,OAAOb,WAAW,CAAC,EAAE,CAAC,GAAG,KAAKa,OAAO,KAE3Fb,YAAY,MAAM,GAAG;oBAEvBA,YAAY,IAAI,CAAC;wBACf,KAAKa,OAAO;wBACZ,KAAKA,OAAO;oBACd;oBACA,OAAO;wBACL,GAAGK,MAAM;wBACT,GAAGG,kBAAkBhB,MAAM;oBAC7B;gBACF;gBAEA,OAAOa;YACT,GAAG,CAAC;YAEJ,OAAOD;QACT;QACA,OAAO;IACT;IAEAK,iBAA0CvB,SAASE,kBAAkB;IACnET,KAAa,aAAa,GAAG;QAC7B,GAAKA,KAAa,aAAa,IAAI,CAAC,CAAC;QACrCQ;IACF;IAEA,OAAOR;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/table/pipes/corner/titleOnDimension.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/corner/titleOnDimension.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { PivotTableSpecPipe } from 'src/types'\n\nexport const titleOnDimension: PivotTableSpecPipe = (spec) => {\n const { rows = [], columns = [] } = spec\n\n return {\n ...spec,\n corner: {\n titleOnDimension: (rows as any[]).length <= 1 && (columns as any[]).length >= 1 ? 'column' : 'row',\n },\n }\n}\n"],"names":["titleOnDimension","spec","rows","columns"],"mappings":"AAIO,MAAMA,mBAAuC,CAACC;IACnD,MAAM,EAAEC,OAAO,EAAE,EAAEC,UAAU,EAAE,EAAE,GAAGF;IAEpC,OAAO;QACL,GAAGA,IAAI;QACP,QAAQ;YACN,kBAAmBC,KAAe,MAAM,IAAI,KAAMC,QAAkB,MAAM,IAAI,IAAI,WAAW;QAC/F;IACF;AACF"}
1
+ {"version":3,"file":"pipeline/spec/table/pipes/corner/titleOnDimension.js","sources":["webpack://@visactor/vseed/./src/pipeline/spec/table/pipes/corner/titleOnDimension.ts"],"sourcesContent":["import type { PivotTableSpecPipe } from 'src/types'\n\nexport const titleOnDimension: PivotTableSpecPipe = (spec) => {\n const { rows = [], columns = [] } = spec\n\n return {\n ...spec,\n corner: {\n titleOnDimension: (rows as any[]).length <= 1 && (columns as any[]).length >= 1 ? 'column' : 'row',\n },\n }\n}\n"],"names":["titleOnDimension","spec","rows","columns"],"mappings":"AAEO,MAAMA,mBAAuC,CAACC;IACnD,MAAM,EAAEC,OAAO,EAAE,EAAEC,UAAU,EAAE,EAAE,GAAGF;IAEpC,OAAO;QACL,GAAGA,IAAI;QACP,QAAQ;YACN,kBAAmBC,KAAe,MAAM,IAAI,KAAMC,QAAkB,MAAM,IAAI,IAAI,WAAW;QAC/F;IACF;AACF"}
@@ -8,3 +8,4 @@ export * from './replaceNullToUndefined';
8
8
  export * from './valid';
9
9
  export * from './constant';
10
10
  export * from './boxplot';
11
+ export * from './sandbox';
@@ -8,3 +8,4 @@ export * from "./replaceNullToUndefined.js";
8
8
  export * from "./valid/index.js";
9
9
  export * from "./constant.js";
10
10
  export * from "./boxplot.js";
11
+ export * from "./sandbox/index.js";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 内置工具函数库
3
+ * @description 提供数据筛选、统计、转换等常用功能,API 与 lodash/Ramda 兼容
4
+ */
5
+ export declare const BUILTIN_UTILS_SOURCE: string;
6
+ export declare const HAS_BUILTIN_UTILS: boolean;
@@ -0,0 +1,337 @@
1
+ const BUILTIN_UTILS_SOURCE = `
2
+ // ============================================
3
+ // 内置工具库 - 与 lodash/Ramda 兼容
4
+ // ============================================
5
+
6
+ const _ = {
7
+ // ========== 数组操作 ==========
8
+
9
+ map: (array, iteratee) => {
10
+ if (!Array.isArray(array)) return [];
11
+ return array.map(typeof iteratee === 'function'
12
+ ? iteratee
13
+ : item => item?.[iteratee]);
14
+ },
15
+
16
+ filter: (array, predicate) => {
17
+ if (!Array.isArray(array)) return [];
18
+ if (typeof predicate === 'function') return array.filter(predicate);
19
+ if (typeof predicate === 'object') {
20
+ return array.filter(item =>
21
+ Object.entries(predicate).every(([key, val]) => item?.[key] === val)
22
+ );
23
+ }
24
+ return array.filter(item => item?.[predicate]);
25
+ },
26
+
27
+ find: (array, predicate) => {
28
+ if (!Array.isArray(array)) return undefined;
29
+ if (typeof predicate === 'function') return array.find(predicate);
30
+ if (typeof predicate === 'object') {
31
+ return array.find(item =>
32
+ Object.entries(predicate).every(([key, val]) => item?.[key] === val)
33
+ );
34
+ }
35
+ return array.find(item => item?.[predicate]);
36
+ },
37
+
38
+ some: (array, predicate) => {
39
+ if (!Array.isArray(array)) return false;
40
+ if (typeof predicate === 'function') return array.some(predicate);
41
+ return array.some(item => item?.[predicate]);
42
+ },
43
+
44
+ every: (array, predicate) => {
45
+ if (!Array.isArray(array)) return true;
46
+ if (typeof predicate === 'function') return array.every(predicate);
47
+ return array.every(item => item?.[predicate]);
48
+ },
49
+
50
+ reduce: (array, iteratee, accumulator) => {
51
+ if (!Array.isArray(array)) return accumulator;
52
+ return accumulator !== undefined
53
+ ? array.reduce(iteratee, accumulator)
54
+ : array.reduce(iteratee);
55
+ },
56
+
57
+ groupBy: (array, iteratee) => {
58
+ if (!Array.isArray(array)) return {};
59
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
60
+ return array.reduce((result, item) => {
61
+ const key = fn(item);
62
+ (result[key] = result[key] || []).push(item);
63
+ return result;
64
+ }, {});
65
+ },
66
+
67
+ sortBy: (array, iteratees) => {
68
+ if (!Array.isArray(array)) return [];
69
+ const arr = [...array];
70
+ const fns = Array.isArray(iteratees) ? iteratees : [iteratees];
71
+ return arr.sort((a, b) => {
72
+ for (const fn of fns) {
73
+ const getVal = typeof fn === 'function' ? fn : item => item?.[fn];
74
+ const valA = getVal(a);
75
+ const valB = getVal(b);
76
+ if (valA < valB) return -1;
77
+ if (valA > valB) return 1;
78
+ }
79
+ return 0;
80
+ });
81
+ },
82
+
83
+ uniq: (array) => {
84
+ if (!Array.isArray(array)) return [];
85
+ return [...new Set(array)];
86
+ },
87
+
88
+ uniqBy: (array, iteratee) => {
89
+ if (!Array.isArray(array)) return [];
90
+ const seen = new Set();
91
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
92
+ return array.filter(item => {
93
+ const key = fn(item);
94
+ if (seen.has(key)) return false;
95
+ seen.add(key);
96
+ return true;
97
+ });
98
+ },
99
+
100
+ flatten: (array) => {
101
+ if (!Array.isArray(array)) return [];
102
+ return array.flat();
103
+ },
104
+
105
+ flattenDeep: (array) => {
106
+ if (!Array.isArray(array)) return [];
107
+ return array.flat(Infinity);
108
+ },
109
+
110
+ chunk: (array, size = 1) => {
111
+ if (!Array.isArray(array) || size < 1) return [];
112
+ const result = [];
113
+ for (let i = 0; i < array.length; i += size) {
114
+ result.push(array.slice(i, i + size));
115
+ }
116
+ return result;
117
+ },
118
+
119
+ take: (array, n = 1) => {
120
+ if (!Array.isArray(array)) return [];
121
+ return array.slice(0, n);
122
+ },
123
+
124
+ drop: (array, n = 1) => {
125
+ if (!Array.isArray(array)) return [];
126
+ return array.slice(n);
127
+ },
128
+
129
+ compact: (array) => {
130
+ if (!Array.isArray(array)) return [];
131
+ return array.filter(Boolean);
132
+ },
133
+
134
+ // ========== 对象操作 ==========
135
+
136
+ keys: (obj) => {
137
+ if (!obj || typeof obj !== 'object') return [];
138
+ return Object.keys(obj);
139
+ },
140
+
141
+ values: (obj) => {
142
+ if (!obj || typeof obj !== 'object') return [];
143
+ return Object.values(obj);
144
+ },
145
+
146
+ entries: (obj) => {
147
+ if (!obj || typeof obj !== 'object') return [];
148
+ return Object.entries(obj);
149
+ },
150
+
151
+ pick: (obj, keys) => {
152
+ if (!obj || typeof obj !== 'object') return {};
153
+ const picked = {};
154
+ const keyArray = Array.isArray(keys) ? keys : [keys];
155
+ keyArray.forEach(key => {
156
+ if (key in obj) picked[key] = obj[key];
157
+ });
158
+ return picked;
159
+ },
160
+
161
+ omit: (obj, keys) => {
162
+ if (!obj || typeof obj !== 'object') return {};
163
+ const result = { ...obj };
164
+ const keyArray = Array.isArray(keys) ? keys : [keys];
165
+ keyArray.forEach(key => delete result[key]);
166
+ return result;
167
+ },
168
+
169
+ mapValues: (obj, iteratee) => {
170
+ if (!obj || typeof obj !== 'object') return {};
171
+ const result = {};
172
+ const fn = typeof iteratee === 'function' ? iteratee : () => iteratee;
173
+ Object.entries(obj).forEach(([key, value]) => {
174
+ result[key] = fn(value, key, obj);
175
+ });
176
+ return result;
177
+ },
178
+
179
+ get: (obj, path, defaultValue) => {
180
+ if (!obj) return defaultValue;
181
+ const keys = Array.isArray(path) ? path : path.split('.');
182
+ let result = obj;
183
+ for (const key of keys) {
184
+ result = result?.[key];
185
+ if (result === undefined) return defaultValue;
186
+ }
187
+ return result;
188
+ },
189
+
190
+ // ========== 数据判断 ==========
191
+
192
+ isArray: (value) => Array.isArray(value),
193
+
194
+ isObject: (value) => {
195
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
196
+ },
197
+
198
+ isString: (value) => typeof value === 'string',
199
+
200
+ isNumber: (value) => typeof value === 'number' && !isNaN(value),
201
+
202
+ isBoolean: (value) => typeof value === 'boolean',
203
+
204
+ isFunction: (value) => typeof value === 'function',
205
+
206
+ isNil: (value) => value === null || value === undefined,
207
+
208
+ isEmpty: (value) => {
209
+ if (value == null) return true;
210
+ if (Array.isArray(value) || typeof value === 'string') return value.length === 0;
211
+ if (typeof value === 'object') return Object.keys(value).length === 0;
212
+ return false;
213
+ },
214
+
215
+ // ========== 数学统计 ==========
216
+
217
+ sum: (array) => {
218
+ if (!Array.isArray(array)) return 0;
219
+ return array.reduce((sum, n) => sum + (Number(n) || 0), 0);
220
+ },
221
+
222
+ sumBy: (array, iteratee) => {
223
+ if (!Array.isArray(array)) return 0;
224
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
225
+ return array.reduce((sum, item) => sum + (Number(fn(item)) || 0), 0);
226
+ },
227
+
228
+ mean: (array) => {
229
+ if (!Array.isArray(array) || array.length === 0) return 0;
230
+ return _.sum(array) / array.length;
231
+ },
232
+
233
+ meanBy: (array, iteratee) => {
234
+ if (!Array.isArray(array) || array.length === 0) return 0;
235
+ return _.sumBy(array, iteratee) / array.length;
236
+ },
237
+
238
+ max: (array) => {
239
+ if (!Array.isArray(array) || array.length === 0) return undefined;
240
+ return Math.max(...array.map(Number).filter(n => !isNaN(n)));
241
+ },
242
+
243
+ maxBy: (array, iteratee) => {
244
+ if (!Array.isArray(array) || array.length === 0) return undefined;
245
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
246
+ return array.reduce((max, item) => {
247
+ const val = fn(item);
248
+ return max === undefined || val > fn(max) ? item : max;
249
+ }, undefined);
250
+ },
251
+
252
+ min: (array) => {
253
+ if (!Array.isArray(array) || array.length === 0) return undefined;
254
+ return Math.min(...array.map(Number).filter(n => !isNaN(n)));
255
+ },
256
+
257
+ minBy: (array, iteratee) => {
258
+ if (!Array.isArray(array) || array.length === 0) return undefined;
259
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
260
+ return array.reduce((min, item) => {
261
+ const val = fn(item);
262
+ return min === undefined || val < fn(min) ? item : min;
263
+ }, undefined);
264
+ },
265
+
266
+ count: (array) => {
267
+ if (!Array.isArray(array)) return 0;
268
+ return array.length;
269
+ },
270
+
271
+ countBy: (array, iteratee) => {
272
+ if (!Array.isArray(array)) return {};
273
+ const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];
274
+ return array.reduce((result, item) => {
275
+ const key = fn(item);
276
+ result[key] = (result[key] || 0) + 1;
277
+ return result;
278
+ }, {});
279
+ },
280
+
281
+ // ========== 其他工具 ==========
282
+
283
+ cloneDeep: (value) => {
284
+ if (value === null || typeof value !== 'object') return value;
285
+ if (Array.isArray(value)) return value.map(_.cloneDeep);
286
+ return Object.fromEntries(
287
+ Object.entries(value).map(([k, v]) => [k, _.cloneDeep(v)])
288
+ );
289
+ },
290
+
291
+ merge: (...objects) => {
292
+ return Object.assign({}, ...objects);
293
+ },
294
+
295
+ debounce: (func, wait = 0) => {
296
+ let timeout;
297
+ return function(...args) {
298
+ clearTimeout(timeout);
299
+ timeout = setTimeout(() => func.apply(this, args), wait);
300
+ };
301
+ },
302
+
303
+ throttle: (func, wait = 0) => {
304
+ let lastTime = 0;
305
+ return function(...args) {
306
+ const now = Date.now();
307
+ if (now - lastTime >= wait) {
308
+ lastTime = now;
309
+ return func.apply(this, args);
310
+ }
311
+ };
312
+ },
313
+
314
+ range: (start, end, step = 1) => {
315
+ if (end === undefined) {
316
+ end = start;
317
+ start = 0;
318
+ }
319
+ const result = [];
320
+ for (let i = start; i < end; i += step) {
321
+ result.push(i);
322
+ }
323
+ return result;
324
+ },
325
+ };
326
+
327
+ // 同时暴露为 R (Ramda 风格)
328
+ const R = _;
329
+
330
+ // 暴露到全局
331
+ self._ = _;
332
+ self.R = R;
333
+ `.trim();
334
+ const HAS_BUILTIN_UTILS = BUILTIN_UTILS_SOURCE.length > 100;
335
+ export { BUILTIN_UTILS_SOURCE, HAS_BUILTIN_UTILS };
336
+
337
+ //# sourceMappingURL=builtin-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/utils/sandbox/builtin-utils.js","sources":["webpack://@visactor/vseed/./src/pipeline/utils/sandbox/builtin-utils.ts"],"sourcesContent":["/**\n * 内置工具函数库\n * @description 提供数据筛选、统计、转换等常用功能,API 与 lodash/Ramda 兼容\n */\n\nexport const BUILTIN_UTILS_SOURCE = `\n// ============================================\n// 内置工具库 - 与 lodash/Ramda 兼容\n// ============================================\n\nconst _ = {\n // ========== 数组操作 ==========\n \n map: (array, iteratee) => {\n if (!Array.isArray(array)) return [];\n return array.map(typeof iteratee === 'function' \n ? iteratee \n : item => item?.[iteratee]);\n },\n \n filter: (array, predicate) => {\n if (!Array.isArray(array)) return [];\n if (typeof predicate === 'function') return array.filter(predicate);\n if (typeof predicate === 'object') {\n return array.filter(item => \n Object.entries(predicate).every(([key, val]) => item?.[key] === val)\n );\n }\n return array.filter(item => item?.[predicate]);\n },\n \n find: (array, predicate) => {\n if (!Array.isArray(array)) return undefined;\n if (typeof predicate === 'function') return array.find(predicate);\n if (typeof predicate === 'object') {\n return array.find(item => \n Object.entries(predicate).every(([key, val]) => item?.[key] === val)\n );\n }\n return array.find(item => item?.[predicate]);\n },\n \n some: (array, predicate) => {\n if (!Array.isArray(array)) return false;\n if (typeof predicate === 'function') return array.some(predicate);\n return array.some(item => item?.[predicate]);\n },\n \n every: (array, predicate) => {\n if (!Array.isArray(array)) return true;\n if (typeof predicate === 'function') return array.every(predicate);\n return array.every(item => item?.[predicate]);\n },\n \n reduce: (array, iteratee, accumulator) => {\n if (!Array.isArray(array)) return accumulator;\n return accumulator !== undefined \n ? array.reduce(iteratee, accumulator)\n : array.reduce(iteratee);\n },\n \n groupBy: (array, iteratee) => {\n if (!Array.isArray(array)) return {};\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.reduce((result, item) => {\n const key = fn(item);\n (result[key] = result[key] || []).push(item);\n return result;\n }, {});\n },\n \n sortBy: (array, iteratees) => {\n if (!Array.isArray(array)) return [];\n const arr = [...array];\n const fns = Array.isArray(iteratees) ? iteratees : [iteratees];\n return arr.sort((a, b) => {\n for (const fn of fns) {\n const getVal = typeof fn === 'function' ? fn : item => item?.[fn];\n const valA = getVal(a);\n const valB = getVal(b);\n if (valA < valB) return -1;\n if (valA > valB) return 1;\n }\n return 0;\n });\n },\n \n uniq: (array) => {\n if (!Array.isArray(array)) return [];\n return [...new Set(array)];\n },\n \n uniqBy: (array, iteratee) => {\n if (!Array.isArray(array)) return [];\n const seen = new Set();\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.filter(item => {\n const key = fn(item);\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n },\n \n flatten: (array) => {\n if (!Array.isArray(array)) return [];\n return array.flat();\n },\n \n flattenDeep: (array) => {\n if (!Array.isArray(array)) return [];\n return array.flat(Infinity);\n },\n \n chunk: (array, size = 1) => {\n if (!Array.isArray(array) || size < 1) return [];\n const result = [];\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n },\n \n take: (array, n = 1) => {\n if (!Array.isArray(array)) return [];\n return array.slice(0, n);\n },\n \n drop: (array, n = 1) => {\n if (!Array.isArray(array)) return [];\n return array.slice(n);\n },\n \n compact: (array) => {\n if (!Array.isArray(array)) return [];\n return array.filter(Boolean);\n },\n \n // ========== 对象操作 ==========\n \n keys: (obj) => {\n if (!obj || typeof obj !== 'object') return [];\n return Object.keys(obj);\n },\n \n values: (obj) => {\n if (!obj || typeof obj !== 'object') return [];\n return Object.values(obj);\n },\n \n entries: (obj) => {\n if (!obj || typeof obj !== 'object') return [];\n return Object.entries(obj);\n },\n \n pick: (obj, keys) => {\n if (!obj || typeof obj !== 'object') return {};\n const picked = {};\n const keyArray = Array.isArray(keys) ? keys : [keys];\n keyArray.forEach(key => {\n if (key in obj) picked[key] = obj[key];\n });\n return picked;\n },\n \n omit: (obj, keys) => {\n if (!obj || typeof obj !== 'object') return {};\n const result = { ...obj };\n const keyArray = Array.isArray(keys) ? keys : [keys];\n keyArray.forEach(key => delete result[key]);\n return result;\n },\n \n mapValues: (obj, iteratee) => {\n if (!obj || typeof obj !== 'object') return {};\n const result = {};\n const fn = typeof iteratee === 'function' ? iteratee : () => iteratee;\n Object.entries(obj).forEach(([key, value]) => {\n result[key] = fn(value, key, obj);\n });\n return result;\n },\n \n get: (obj, path, defaultValue) => {\n if (!obj) return defaultValue;\n const keys = Array.isArray(path) ? path : path.split('.');\n let result = obj;\n for (const key of keys) {\n result = result?.[key];\n if (result === undefined) return defaultValue;\n }\n return result;\n },\n \n // ========== 数据判断 ==========\n \n isArray: (value) => Array.isArray(value),\n \n isObject: (value) => {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n },\n \n isString: (value) => typeof value === 'string',\n \n isNumber: (value) => typeof value === 'number' && !isNaN(value),\n \n isBoolean: (value) => typeof value === 'boolean',\n \n isFunction: (value) => typeof value === 'function',\n \n isNil: (value) => value === null || value === undefined,\n \n isEmpty: (value) => {\n if (value == null) return true;\n if (Array.isArray(value) || typeof value === 'string') return value.length === 0;\n if (typeof value === 'object') return Object.keys(value).length === 0;\n return false;\n },\n \n // ========== 数学统计 ==========\n \n sum: (array) => {\n if (!Array.isArray(array)) return 0;\n return array.reduce((sum, n) => sum + (Number(n) || 0), 0);\n },\n \n sumBy: (array, iteratee) => {\n if (!Array.isArray(array)) return 0;\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.reduce((sum, item) => sum + (Number(fn(item)) || 0), 0);\n },\n \n mean: (array) => {\n if (!Array.isArray(array) || array.length === 0) return 0;\n return _.sum(array) / array.length;\n },\n \n meanBy: (array, iteratee) => {\n if (!Array.isArray(array) || array.length === 0) return 0;\n return _.sumBy(array, iteratee) / array.length;\n },\n \n max: (array) => {\n if (!Array.isArray(array) || array.length === 0) return undefined;\n return Math.max(...array.map(Number).filter(n => !isNaN(n)));\n },\n \n maxBy: (array, iteratee) => {\n if (!Array.isArray(array) || array.length === 0) return undefined;\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.reduce((max, item) => {\n const val = fn(item);\n return max === undefined || val > fn(max) ? item : max;\n }, undefined);\n },\n \n min: (array) => {\n if (!Array.isArray(array) || array.length === 0) return undefined;\n return Math.min(...array.map(Number).filter(n => !isNaN(n)));\n },\n \n minBy: (array, iteratee) => {\n if (!Array.isArray(array) || array.length === 0) return undefined;\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.reduce((min, item) => {\n const val = fn(item);\n return min === undefined || val < fn(min) ? item : min;\n }, undefined);\n },\n \n count: (array) => {\n if (!Array.isArray(array)) return 0;\n return array.length;\n },\n \n countBy: (array, iteratee) => {\n if (!Array.isArray(array)) return {};\n const fn = typeof iteratee === 'function' ? iteratee : item => item?.[iteratee];\n return array.reduce((result, item) => {\n const key = fn(item);\n result[key] = (result[key] || 0) + 1;\n return result;\n }, {});\n },\n \n // ========== 其他工具 ==========\n \n cloneDeep: (value) => {\n if (value === null || typeof value !== 'object') return value;\n if (Array.isArray(value)) return value.map(_.cloneDeep);\n return Object.fromEntries(\n Object.entries(value).map(([k, v]) => [k, _.cloneDeep(v)])\n );\n },\n \n merge: (...objects) => {\n return Object.assign({}, ...objects);\n },\n \n debounce: (func, wait = 0) => {\n let timeout;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => func.apply(this, args), wait);\n };\n },\n \n throttle: (func, wait = 0) => {\n let lastTime = 0;\n return function(...args) {\n const now = Date.now();\n if (now - lastTime >= wait) {\n lastTime = now;\n return func.apply(this, args);\n }\n };\n },\n \n range: (start, end, step = 1) => {\n if (end === undefined) {\n end = start;\n start = 0;\n }\n const result = [];\n for (let i = start; i < end; i += step) {\n result.push(i);\n }\n return result;\n },\n};\n\n// 同时暴露为 R (Ramda 风格)\nconst R = _;\n\n// 暴露到全局\nself._ = _;\nself.R = R;\n`.trim()\n\nexport const HAS_BUILTIN_UTILS = BUILTIN_UTILS_SOURCE.length > 100\n"],"names":["BUILTIN_UTILS_SOURCE","HAS_BUILTIN_UTILS"],"mappings":"AAKO,MAAMA,uBAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4UrC,CAAC,CAAC,IAAI;AAEC,MAAMC,oBAAoBD,qBAAqB,MAAM,GAAG"}