@antv/infographic 0.2.11 → 0.2.13

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 (328) hide show
  1. package/dist/infographic.min.js +98 -94
  2. package/dist/infographic.min.js.map +1 -1
  3. package/esm/designs/components/Btn.js +15 -4
  4. package/esm/designs/components/BtnsGroup.js +1 -1
  5. package/esm/designs/components/Illus.js +15 -3
  6. package/esm/designs/components/ItemDesc.js +17 -11
  7. package/esm/designs/components/ItemIcon.js +17 -18
  8. package/esm/designs/components/ItemLabel.js +17 -11
  9. package/esm/designs/components/ItemValue.js +17 -12
  10. package/esm/designs/components/ItemsGroup.js +1 -1
  11. package/esm/designs/components/ShapesGroup.js +1 -1
  12. package/esm/designs/components/Title.js +2 -2
  13. package/esm/designs/decorations/simple-arrow.js +14 -2
  14. package/esm/designs/decorations/triangle.js +14 -2
  15. package/esm/designs/defs/DropShadow.js +13 -2
  16. package/esm/designs/defs/LinearGradient.js +1 -1
  17. package/esm/designs/items/BadgeCard.js +2 -2
  18. package/esm/designs/items/CandyCardLite.js +1 -1
  19. package/esm/designs/items/CapsuleItem.js +3 -3
  20. package/esm/designs/items/CircleNode.js +1 -1
  21. package/esm/designs/items/CircularProgress.js +3 -2
  22. package/esm/designs/items/CompactCard.js +1 -1
  23. package/esm/designs/items/DoneList.js +1 -1
  24. package/esm/designs/items/HorizontalIconArrow.js +2 -2
  25. package/esm/designs/items/HorizontalIconLine.js +2 -2
  26. package/esm/designs/items/IconBadge.js +4 -3
  27. package/esm/designs/items/IndexedCard.js +1 -1
  28. package/esm/designs/items/LCornerCard.js +1 -1
  29. package/esm/designs/items/LetterCard.js +4 -3
  30. package/esm/designs/items/LinedText.js +6 -5
  31. package/esm/designs/items/PillBadge.js +2 -2
  32. package/esm/designs/items/PlainText.js +4 -4
  33. package/esm/designs/items/ProgressCard.js +4 -4
  34. package/esm/designs/items/QuarterCircular.js +1 -1
  35. package/esm/designs/items/QuarterSimpleCard.js +1 -1
  36. package/esm/designs/items/RibbonCard.js +2 -2
  37. package/esm/designs/items/RoundedRectNode.js +2 -2
  38. package/esm/designs/items/SimpleCircleNode.js +1 -1
  39. package/esm/designs/items/SimpleHorizontalArrow.js +2 -2
  40. package/esm/designs/items/SimpleIllusItem.js +1 -1
  41. package/esm/designs/items/SimpleItem.js +3 -3
  42. package/esm/designs/items/SimpleVerticalArrow.js +2 -2
  43. package/esm/designs/items/UnderlineText.js +1 -1
  44. package/esm/designs/items/VerticalIconArrow.js +2 -2
  45. package/esm/designs/layouts/Align.js +22 -15
  46. package/esm/designs/layouts/Flex.js +23 -16
  47. package/esm/designs/structures/chart-bar.js +7 -5
  48. package/esm/designs/structures/chart-column.js +3 -2
  49. package/esm/designs/structures/chart-line.js +7 -5
  50. package/esm/designs/structures/chart-pie.d.ts +25 -0
  51. package/esm/designs/structures/chart-pie.js +186 -26
  52. package/esm/designs/structures/chart-wordcloud.js +5 -14
  53. package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +1 -1
  54. package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +1 -1
  55. package/esm/designs/structures/compare-binary-horizontal/dividers/types.js +2 -1
  56. package/esm/designs/structures/compare-hierarchy-left-right.js +6 -5
  57. package/esm/designs/structures/compare-hierarchy-row.js +3 -2
  58. package/esm/designs/structures/compare-quadrant.js +2 -3
  59. package/esm/designs/structures/hierarchy-mindmap.js +19 -19
  60. package/esm/designs/structures/hierarchy-structure.js +1 -1
  61. package/esm/designs/structures/hierarchy-tree.js +15 -24
  62. package/esm/designs/structures/list-sector.js +5 -6
  63. package/esm/designs/structures/list-zigzag.js +2 -1
  64. package/esm/designs/structures/relation-dagre-flow.js +30 -35
  65. package/esm/designs/structures/relation-network.js +2 -2
  66. package/esm/designs/structures/sequence-funnel.js +1 -1
  67. package/esm/designs/structures/sequence-mountain.js +4 -4
  68. package/esm/designs/structures/sequence-pyramid.js +1 -1
  69. package/esm/designs/structures/sequence-zigzag-steps.js +2 -1
  70. package/esm/designs/utils/color.js +8 -4
  71. package/esm/designs/utils/index.d.ts +1 -0
  72. package/esm/designs/utils/index.js +1 -0
  73. package/esm/designs/utils/item.js +3 -2
  74. package/esm/designs/utils/normalize-percent.d.ts +19 -0
  75. package/esm/designs/utils/normalize-percent.js +32 -0
  76. package/esm/editor/commands/Batch.js +21 -8
  77. package/esm/editor/commands/UpdateElement.js +25 -22
  78. package/esm/editor/commands/UpdateOptions.js +23 -10
  79. package/esm/editor/commands/UpdateText.js +24 -11
  80. package/esm/editor/interactions/brush-select.js +27 -13
  81. package/esm/editor/interactions/click-select.js +13 -3
  82. package/esm/editor/interactions/dblclick-edit-text.js +36 -20
  83. package/esm/editor/interactions/drag-element.js +23 -9
  84. package/esm/editor/interactions/hotkey-history.js +17 -7
  85. package/esm/editor/interactions/select-highlight.js +5 -9
  86. package/esm/editor/interactions/zoom-wheel.d.ts +3 -0
  87. package/esm/editor/interactions/zoom-wheel.js +46 -22
  88. package/esm/editor/managers/command.js +45 -27
  89. package/esm/editor/managers/interaction.js +46 -33
  90. package/esm/editor/managers/state.js +9 -3
  91. package/esm/editor/plugins/edit-bar/components/color-picker.js +9 -6
  92. package/esm/editor/plugins/edit-bar/components/popover.js +15 -12
  93. package/esm/editor/plugins/edit-bar/components/select.js +10 -8
  94. package/esm/editor/plugins/edit-bar/edit-bar.js +7 -25
  95. package/esm/editor/plugins/edit-bar/edit-items/align-elements.js +5 -3
  96. package/esm/editor/plugins/edit-bar/edit-items/font-align.js +1 -1
  97. package/esm/editor/plugins/edit-bar/edit-items/font-color.js +2 -2
  98. package/esm/editor/plugins/edit-bar/edit-items/icon-color.js +2 -2
  99. package/esm/editor/plugins/resize-element.js +6 -4
  100. package/esm/editor/utils/click-handler.js +6 -3
  101. package/esm/editor/utils/coordinate.js +2 -1
  102. package/esm/editor/utils/element.js +2 -1
  103. package/esm/editor/utils/event.js +2 -1
  104. package/esm/editor/utils/extension.js +1 -1
  105. package/esm/editor/utils/hotkey.js +2 -1
  106. package/esm/exporter/font.js +106 -90
  107. package/esm/exporter/png.js +49 -37
  108. package/esm/exporter/svg.js +55 -38
  109. package/esm/jsx/components/Ellipse.js +5 -4
  110. package/esm/jsx/components/Path.js +2 -4
  111. package/esm/jsx/components/Polygon.js +15 -6
  112. package/esm/jsx/components/Text.js +21 -41
  113. package/esm/jsx/renderer.js +15 -7
  114. package/esm/jsx/utils/bounds.js +18 -16
  115. package/esm/jsx/utils/children.js +2 -1
  116. package/esm/jsx/utils/clone.js +13 -2
  117. package/esm/jsx/utils/element.js +2 -1
  118. package/esm/options/parser.js +45 -46
  119. package/esm/renderer/composites/background.js +3 -2
  120. package/esm/renderer/composites/icon.js +14 -19
  121. package/esm/renderer/composites/illus.js +17 -22
  122. package/esm/renderer/composites/shape.js +4 -2
  123. package/esm/renderer/composites/svg.js +2 -1
  124. package/esm/renderer/composites/text.js +5 -3
  125. package/esm/renderer/fonts/loader.js +4 -3
  126. package/esm/renderer/fonts/registry.js +1 -1
  127. package/esm/renderer/palettes/utils.js +3 -2
  128. package/esm/renderer/renderer.js +7 -5
  129. package/esm/renderer/stylize/gradient.js +3 -2
  130. package/esm/renderer/stylize/pattern.js +15 -8
  131. package/esm/renderer/stylize/rough.js +1 -1
  132. package/esm/resource/load-tracker.js +22 -10
  133. package/esm/resource/loader.js +80 -67
  134. package/esm/resource/loaders/image.js +71 -59
  135. package/esm/resource/loaders/remote.js +26 -15
  136. package/esm/resource/loaders/search.js +38 -25
  137. package/esm/resource/utils/parser.js +2 -1
  138. package/esm/runtime/Infographic.js +26 -13
  139. package/esm/runtime/utils.js +5 -8
  140. package/esm/ssr/renderer.js +42 -35
  141. package/esm/syntax/index.js +19 -6
  142. package/esm/syntax/mapper.js +2 -2
  143. package/esm/templates/built-in.js +91 -269
  144. package/esm/templates/chart-pie.d.ts +2 -0
  145. package/esm/templates/chart-pie.js +87 -0
  146. package/esm/templates/hierarchy-mindmap.js +1 -5
  147. package/esm/templates/hierarchy-tree.js +1 -5
  148. package/esm/templates/relation-dagre-flow.js +4 -28
  149. package/esm/themes/generator.js +8 -14
  150. package/esm/utils/fetch.js +48 -35
  151. package/esm/utils/icon.js +1 -4
  152. package/esm/utils/is-browser.js +2 -2
  153. package/esm/utils/measure-text.js +2 -1
  154. package/esm/utils/padding.js +1 -1
  155. package/esm/utils/recognizer.js +2 -1
  156. package/esm/utils/text.js +14 -3
  157. package/esm/utils/viewbox.d.ts +20 -0
  158. package/esm/utils/viewbox.js +10 -0
  159. package/esm/version.d.ts +1 -1
  160. package/esm/version.js +1 -1
  161. package/lib/designs/components/Btn.js +15 -4
  162. package/lib/designs/components/BtnsGroup.js +1 -1
  163. package/lib/designs/components/Illus.js +15 -3
  164. package/lib/designs/components/ItemDesc.js +17 -11
  165. package/lib/designs/components/ItemIcon.js +17 -18
  166. package/lib/designs/components/ItemLabel.js +17 -11
  167. package/lib/designs/components/ItemValue.js +17 -12
  168. package/lib/designs/components/ItemsGroup.js +1 -1
  169. package/lib/designs/components/ShapesGroup.js +1 -1
  170. package/lib/designs/components/Title.js +2 -2
  171. package/lib/designs/decorations/simple-arrow.js +14 -2
  172. package/lib/designs/decorations/triangle.js +14 -2
  173. package/lib/designs/defs/DropShadow.js +13 -2
  174. package/lib/designs/defs/LinearGradient.js +1 -1
  175. package/lib/designs/items/BadgeCard.js +2 -2
  176. package/lib/designs/items/CandyCardLite.js +1 -1
  177. package/lib/designs/items/CapsuleItem.js +3 -3
  178. package/lib/designs/items/CircleNode.js +1 -1
  179. package/lib/designs/items/CircularProgress.js +3 -2
  180. package/lib/designs/items/CompactCard.js +1 -1
  181. package/lib/designs/items/DoneList.js +1 -1
  182. package/lib/designs/items/HorizontalIconArrow.js +2 -2
  183. package/lib/designs/items/HorizontalIconLine.js +2 -2
  184. package/lib/designs/items/IconBadge.js +4 -3
  185. package/lib/designs/items/IndexedCard.js +1 -1
  186. package/lib/designs/items/LCornerCard.js +1 -1
  187. package/lib/designs/items/LetterCard.js +4 -3
  188. package/lib/designs/items/LinedText.js +6 -5
  189. package/lib/designs/items/PillBadge.js +2 -2
  190. package/lib/designs/items/PlainText.js +4 -4
  191. package/lib/designs/items/ProgressCard.js +4 -4
  192. package/lib/designs/items/QuarterCircular.js +1 -1
  193. package/lib/designs/items/QuarterSimpleCard.js +1 -1
  194. package/lib/designs/items/RibbonCard.js +2 -2
  195. package/lib/designs/items/RoundedRectNode.js +2 -2
  196. package/lib/designs/items/SimpleCircleNode.js +1 -1
  197. package/lib/designs/items/SimpleHorizontalArrow.js +2 -2
  198. package/lib/designs/items/SimpleIllusItem.js +1 -1
  199. package/lib/designs/items/SimpleItem.js +3 -3
  200. package/lib/designs/items/SimpleVerticalArrow.js +2 -2
  201. package/lib/designs/items/UnderlineText.js +1 -1
  202. package/lib/designs/items/VerticalIconArrow.js +2 -2
  203. package/lib/designs/layouts/Align.js +22 -15
  204. package/lib/designs/layouts/Flex.js +23 -16
  205. package/lib/designs/structures/chart-bar.js +7 -5
  206. package/lib/designs/structures/chart-column.js +3 -2
  207. package/lib/designs/structures/chart-line.js +7 -5
  208. package/lib/designs/structures/chart-pie.d.ts +25 -0
  209. package/lib/designs/structures/chart-pie.js +186 -25
  210. package/lib/designs/structures/chart-wordcloud.js +5 -14
  211. package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +1 -1
  212. package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +1 -1
  213. package/lib/designs/structures/compare-binary-horizontal/dividers/types.js +2 -1
  214. package/lib/designs/structures/compare-hierarchy-left-right.js +6 -5
  215. package/lib/designs/structures/compare-hierarchy-row.js +3 -2
  216. package/lib/designs/structures/compare-quadrant.js +2 -3
  217. package/lib/designs/structures/hierarchy-mindmap.js +19 -19
  218. package/lib/designs/structures/hierarchy-structure.js +1 -1
  219. package/lib/designs/structures/hierarchy-tree.js +15 -24
  220. package/lib/designs/structures/list-sector.js +5 -6
  221. package/lib/designs/structures/list-zigzag.js +2 -1
  222. package/lib/designs/structures/relation-dagre-flow.js +30 -35
  223. package/lib/designs/structures/relation-network.js +2 -2
  224. package/lib/designs/structures/sequence-funnel.js +1 -1
  225. package/lib/designs/structures/sequence-mountain.js +4 -4
  226. package/lib/designs/structures/sequence-pyramid.js +1 -1
  227. package/lib/designs/structures/sequence-zigzag-steps.js +2 -1
  228. package/lib/designs/utils/color.js +8 -4
  229. package/lib/designs/utils/index.d.ts +1 -0
  230. package/lib/designs/utils/index.js +1 -0
  231. package/lib/designs/utils/item.js +3 -2
  232. package/lib/designs/utils/normalize-percent.d.ts +19 -0
  233. package/lib/designs/utils/normalize-percent.js +35 -0
  234. package/lib/editor/commands/Batch.js +21 -8
  235. package/lib/editor/commands/UpdateElement.js +25 -22
  236. package/lib/editor/commands/UpdateOptions.js +23 -10
  237. package/lib/editor/commands/UpdateText.js +24 -11
  238. package/lib/editor/interactions/brush-select.js +27 -13
  239. package/lib/editor/interactions/click-select.js +13 -3
  240. package/lib/editor/interactions/dblclick-edit-text.js +36 -20
  241. package/lib/editor/interactions/drag-element.js +23 -9
  242. package/lib/editor/interactions/hotkey-history.js +17 -7
  243. package/lib/editor/interactions/select-highlight.js +5 -9
  244. package/lib/editor/interactions/zoom-wheel.d.ts +3 -0
  245. package/lib/editor/interactions/zoom-wheel.js +45 -21
  246. package/lib/editor/managers/command.js +43 -25
  247. package/lib/editor/managers/interaction.js +46 -33
  248. package/lib/editor/managers/state.js +9 -3
  249. package/lib/editor/plugins/edit-bar/components/color-picker.js +9 -6
  250. package/lib/editor/plugins/edit-bar/components/popover.js +15 -12
  251. package/lib/editor/plugins/edit-bar/components/select.js +10 -8
  252. package/lib/editor/plugins/edit-bar/edit-bar.js +7 -25
  253. package/lib/editor/plugins/edit-bar/edit-items/align-elements.js +5 -3
  254. package/lib/editor/plugins/edit-bar/edit-items/font-align.js +1 -1
  255. package/lib/editor/plugins/edit-bar/edit-items/font-color.js +2 -2
  256. package/lib/editor/plugins/edit-bar/edit-items/icon-color.js +2 -2
  257. package/lib/editor/plugins/resize-element.js +6 -4
  258. package/lib/editor/utils/click-handler.js +6 -3
  259. package/lib/editor/utils/coordinate.js +2 -1
  260. package/lib/editor/utils/element.js +2 -1
  261. package/lib/editor/utils/event.js +2 -1
  262. package/lib/editor/utils/extension.js +1 -1
  263. package/lib/editor/utils/hotkey.js +2 -1
  264. package/lib/exporter/font.js +106 -90
  265. package/lib/exporter/png.js +49 -37
  266. package/lib/exporter/svg.js +55 -38
  267. package/lib/jsx/components/Ellipse.js +5 -4
  268. package/lib/jsx/components/Path.js +2 -4
  269. package/lib/jsx/components/Polygon.js +15 -6
  270. package/lib/jsx/components/Text.js +21 -41
  271. package/lib/jsx/renderer.js +15 -7
  272. package/lib/jsx/utils/bounds.js +18 -16
  273. package/lib/jsx/utils/children.js +2 -1
  274. package/lib/jsx/utils/clone.js +13 -2
  275. package/lib/jsx/utils/element.js +2 -1
  276. package/lib/options/parser.js +45 -46
  277. package/lib/renderer/composites/background.js +3 -2
  278. package/lib/renderer/composites/icon.js +14 -19
  279. package/lib/renderer/composites/illus.js +17 -22
  280. package/lib/renderer/composites/shape.js +4 -2
  281. package/lib/renderer/composites/svg.js +2 -1
  282. package/lib/renderer/composites/text.js +5 -3
  283. package/lib/renderer/fonts/loader.js +4 -3
  284. package/lib/renderer/fonts/registry.js +1 -1
  285. package/lib/renderer/palettes/utils.js +3 -2
  286. package/lib/renderer/renderer.js +7 -5
  287. package/lib/renderer/stylize/gradient.js +3 -2
  288. package/lib/renderer/stylize/pattern.js +15 -8
  289. package/lib/renderer/stylize/rough.js +1 -1
  290. package/lib/resource/load-tracker.js +22 -10
  291. package/lib/resource/loader.js +80 -67
  292. package/lib/resource/loaders/image.js +71 -59
  293. package/lib/resource/loaders/remote.js +26 -15
  294. package/lib/resource/loaders/search.js +38 -25
  295. package/lib/resource/utils/parser.js +2 -1
  296. package/lib/runtime/Infographic.js +26 -13
  297. package/lib/runtime/utils.js +5 -8
  298. package/lib/ssr/renderer.js +42 -35
  299. package/lib/syntax/index.js +19 -6
  300. package/lib/syntax/mapper.js +2 -2
  301. package/lib/templates/built-in.js +91 -269
  302. package/lib/templates/chart-pie.d.ts +2 -0
  303. package/lib/templates/chart-pie.js +90 -0
  304. package/lib/templates/hierarchy-mindmap.js +1 -5
  305. package/lib/templates/hierarchy-tree.js +1 -5
  306. package/lib/templates/relation-dagre-flow.js +4 -28
  307. package/lib/themes/generator.js +8 -14
  308. package/lib/utils/fetch.js +48 -35
  309. package/lib/utils/icon.js +1 -4
  310. package/lib/utils/is-browser.js +2 -2
  311. package/lib/utils/measure-text.js +2 -1
  312. package/lib/utils/padding.js +1 -1
  313. package/lib/utils/recognizer.js +2 -1
  314. package/lib/utils/text.js +14 -3
  315. package/lib/utils/viewbox.d.ts +20 -0
  316. package/lib/utils/viewbox.js +12 -0
  317. package/lib/version.d.ts +1 -1
  318. package/lib/version.js +1 -1
  319. package/package.json +1 -2
  320. package/src/designs/structures/chart-pie.tsx +259 -26
  321. package/src/designs/utils/index.ts +1 -0
  322. package/src/designs/utils/normalize-percent.ts +33 -0
  323. package/src/editor/interactions/zoom-wheel.ts +64 -22
  324. package/src/editor/managers/state.ts +10 -5
  325. package/src/templates/built-in.ts +2 -81
  326. package/src/templates/chart-pie.ts +89 -0
  327. package/src/utils/viewbox.ts +23 -0
  328. package/src/version.ts +1 -1
@@ -1,7 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Rect } from '../../jsx/index.js';
3
14
  export const BtnAdd = (props) => {
4
- const { indexes, ...restProps } = props;
15
+ const { indexes } = props, restProps = __rest(props, ["indexes"]);
5
16
  const defaultProps = {
6
17
  fill: '#B9EBCA',
7
18
  fillOpacity: 0.3,
@@ -10,10 +21,10 @@ export const BtnAdd = (props) => {
10
21
  'data-indexes': indexes,
11
22
  'data-element-type': "btn-add" /* ElementTypeEnum.BtnAdd */,
12
23
  };
13
- return _jsx(Rect, { ...defaultProps, ...restProps });
24
+ return _jsx(Rect, Object.assign({}, defaultProps, restProps));
14
25
  };
15
26
  export const BtnRemove = (props) => {
16
- const { indexes, ...restProps } = props;
27
+ const { indexes } = props, restProps = __rest(props, ["indexes"]);
17
28
  const defaultProps = {
18
29
  fill: '#F9C0C0',
19
30
  fillOpacity: 0.3,
@@ -22,5 +33,5 @@ export const BtnRemove = (props) => {
22
33
  'data-indexes': indexes,
23
34
  'data-element-type': "btn-remove" /* ElementTypeEnum.BtnRemove */,
24
35
  };
25
- return _jsx(Rect, { ...defaultProps, ...restProps });
36
+ return _jsx(Rect, Object.assign({}, defaultProps, restProps));
26
37
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
2
  import { Group } from '../../jsx/index.js';
3
3
  export const BtnsGroup = (props) => {
4
- return (_jsx(Group, { "data-element-type": "btns-group" /* ElementTypeEnum.BtnsGroup */, width: 0, height: 0, ...props, display: "none" }));
4
+ return (_jsx(Group, Object.assign({ "data-element-type": "btns-group" /* ElementTypeEnum.BtnsGroup */, width: 0, height: 0 }, props, { display: "none" })));
5
5
  };
@@ -1,10 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Rect } from '../../jsx/index.js';
3
- export const Illus = ({ indexes, ...props }) => {
14
+ export const Illus = (_a) => {
15
+ var { indexes } = _a, props = __rest(_a, ["indexes"]);
4
16
  const defaultProps = {
5
17
  fill: 'lightgray',
6
18
  };
7
- const finalProps = { ...defaultProps, ...props };
19
+ const finalProps = Object.assign(Object.assign({}, defaultProps), props);
8
20
  if (indexes) {
9
21
  finalProps['data-indexes'] = indexes;
10
22
  finalProps['data-element-type'] = "item-illus" /* ElementTypeEnum.ItemIllus */;
@@ -12,5 +24,5 @@ export const Illus = ({ indexes, ...props }) => {
12
24
  else {
13
25
  finalProps['data-element-type'] = "illus" /* ElementTypeEnum.Illus */;
14
26
  }
15
- return _jsx(Rect, { ...finalProps });
27
+ return _jsx(Rect, Object.assign({}, finalProps));
16
28
  };
@@ -1,16 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Text } from '../../jsx/index.js';
3
- export const ItemDesc = ({ indexes, lineNumber = 2, children, ...props }) => {
14
+ export const ItemDesc = (_a) => {
15
+ var _b;
16
+ var { indexes, lineNumber = 2, children } = _a, props = __rest(_a, ["indexes", "lineNumber", "children"]);
4
17
  if (!children)
5
18
  return null;
6
- const finalProps = {
7
- fontSize: 14,
8
- fill: '#666',
9
- wordWrap: true,
10
- lineHeight: 1.4,
11
- children,
12
- ...props,
13
- };
14
- finalProps.height ?? (finalProps.height = Math.ceil(lineNumber * +finalProps.lineHeight * +finalProps.fontSize));
15
- return (_jsx(Text, { ...finalProps, "data-indexes": indexes, "data-element-type": "item-desc" /* ElementTypeEnum.ItemDesc */ }));
19
+ const finalProps = Object.assign({ fontSize: 14, fill: '#666', wordWrap: true, lineHeight: 1.4, children }, props);
20
+ (_b = finalProps.height) !== null && _b !== void 0 ? _b : (finalProps.height = Math.ceil(lineNumber * +finalProps.lineHeight * +finalProps.fontSize));
21
+ return (_jsx(Text, Object.assign({}, finalProps, { "data-indexes": indexes, "data-element-type": "item-desc" /* ElementTypeEnum.ItemDesc */ })));
16
22
  };
@@ -1,27 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "../../jsx-runtime.js";
2
13
  import { Ellipse, Group, Rect } from '../../jsx/index.js';
3
14
  export const ItemIcon = (props) => {
4
- const { indexes, size = 32, ...restProps } = props;
5
- const finalProps = {
6
- fill: 'lightgray',
7
- width: size,
8
- height: size,
9
- ...restProps,
10
- };
11
- return (_jsx(Rect, { ...finalProps, "data-indexes": indexes, "data-element-type": "item-icon" }));
15
+ const { indexes, size = 32 } = props, restProps = __rest(props, ["indexes", "size"]);
16
+ const finalProps = Object.assign({ fill: 'lightgray', width: size, height: size }, restProps);
17
+ return (_jsx(Rect, Object.assign({}, finalProps, { "data-indexes": indexes, "data-element-type": "item-icon" })));
12
18
  };
13
19
  export const ItemIconCircle = (props) => {
14
- const { indexes, size = 50, fill, colorBg = 'white', ...restProps } = props;
20
+ const { indexes, size = 50, fill, colorBg = 'white' } = props, restProps = __rest(props, ["indexes", "size", "fill", "colorBg"]);
15
21
  // 圆形内最大内切正方形的边长 = 圆的直径 / √2
16
22
  const innerSize = (size / Math.SQRT2) * 0.9;
17
23
  const offset = (size - innerSize) / 2;
18
- const iconProps = {
19
- fill: colorBg,
20
- ...restProps,
21
- x: offset,
22
- y: offset,
23
- width: innerSize,
24
- height: innerSize,
25
- };
26
- return (_jsxs(Group, { ...restProps, width: size, height: size, "data-element-type": "item-icon-group" /* ElementTypeEnum.ItemIconGroup */, children: [_jsx(Ellipse, { width: size, height: size, fill: fill, "data-element-type": "shape" }), _jsx(Rect, { ...iconProps, "data-indexes": indexes, "data-element-type": "item-icon" /* ElementTypeEnum.ItemIcon */ })] }));
24
+ const iconProps = Object.assign(Object.assign({ fill: colorBg }, restProps), { x: offset, y: offset, width: innerSize, height: innerSize });
25
+ return (_jsxs(Group, Object.assign({}, restProps, { width: size, height: size, "data-element-type": "item-icon-group" /* ElementTypeEnum.ItemIconGroup */, children: [_jsx(Ellipse, { width: size, height: size, fill: fill, "data-element-type": "shape" }), _jsx(Rect, Object.assign({}, iconProps, { "data-indexes": indexes, "data-element-type": "item-icon" /* ElementTypeEnum.ItemIcon */ }))] })));
27
26
  };
@@ -1,14 +1,20 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Text } from '../../jsx/index.js';
3
- export const ItemLabel = ({ indexes, children, ...props }) => {
4
- const finalProps = {
5
- fontSize: 18,
6
- fontWeight: 'bold',
7
- fill: '#252525',
8
- lineHeight: 1.4,
9
- children,
10
- ...props,
11
- };
12
- finalProps.height ?? (finalProps.height = Math.ceil(+finalProps.lineHeight * +finalProps.fontSize));
13
- return (_jsx(Text, { ...finalProps, "data-indexes": indexes, "data-element-type": "item-label" /* ElementTypeEnum.ItemLabel */ }));
14
+ export const ItemLabel = (_a) => {
15
+ var _b;
16
+ var { indexes, children } = _a, props = __rest(_a, ["indexes", "children"]);
17
+ const finalProps = Object.assign({ fontSize: 18, fontWeight: 'bold', fill: '#252525', lineHeight: 1.4, children }, props);
18
+ (_b = finalProps.height) !== null && _b !== void 0 ? _b : (finalProps.height = Math.ceil(+finalProps.lineHeight * +finalProps.fontSize));
19
+ return (_jsx(Text, Object.assign({}, finalProps, { "data-indexes": indexes, "data-element-type": "item-label" /* ElementTypeEnum.ItemLabel */ })));
14
20
  };
@@ -1,15 +1,20 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Text } from '../../jsx/index.js';
3
- export const ItemValue = ({ indexes, value, formatter = (v) => String(v), ...props }) => {
4
- const finalProps = {
5
- fontSize: 14,
6
- fill: '#666',
7
- wordWrap: true,
8
- lineHeight: 1.4,
9
- children: formatter(value),
10
- 'data-value': value,
11
- ...props,
12
- };
13
- finalProps.height ?? (finalProps.height = Math.ceil(+finalProps.lineHeight * +finalProps.fontSize));
14
- return (_jsx(Text, { ...finalProps, "data-indexes": indexes, "data-element-type": "item-value" /* ElementTypeEnum.ItemValue */ }));
14
+ export const ItemValue = (_a) => {
15
+ var _b;
16
+ var { indexes, value, formatter = (v) => String(v) } = _a, props = __rest(_a, ["indexes", "value", "formatter"]);
17
+ const finalProps = Object.assign({ fontSize: 14, fill: '#666', wordWrap: true, lineHeight: 1.4, children: formatter(value), 'data-value': value }, props);
18
+ (_b = finalProps.height) !== null && _b !== void 0 ? _b : (finalProps.height = Math.ceil(+finalProps.lineHeight * +finalProps.fontSize));
19
+ return (_jsx(Text, Object.assign({}, finalProps, { "data-indexes": indexes, "data-element-type": "item-value" /* ElementTypeEnum.ItemValue */ })));
15
20
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
2
  import { Group } from '../../jsx/index.js';
3
3
  export const ItemsGroup = (props) => {
4
- return _jsx(Group, { "data-element-type": "items-group" /* ElementTypeEnum.ItemsGroup */, ...props });
4
+ return _jsx(Group, Object.assign({ "data-element-type": "items-group" /* ElementTypeEnum.ItemsGroup */ }, props));
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
2
  import { Group } from '../../jsx/index.js';
3
3
  export const ShapesGroup = (props) => {
4
- return _jsx(Group, { "data-element-type": "shapes-group", ...props });
4
+ return _jsx(Group, Object.assign({ "data-element-type": "shapes-group" }, props));
5
5
  };
@@ -10,7 +10,7 @@ export const Title = (props) => {
10
10
  lineHeight: 1.4,
11
11
  alignHorizontal,
12
12
  };
13
- return (_jsx(Text, { ...defaultProps, ...props, "data-element-type": "title", children: title }));
13
+ return (_jsx(Text, Object.assign({}, defaultProps, props, { "data-element-type": "title", children: title })));
14
14
  };
15
15
  const Desc = (props) => {
16
16
  const defaultProps = {
@@ -20,7 +20,7 @@ export const Title = (props) => {
20
20
  lineHeight: 1.4,
21
21
  height: subTitleLineNumber * 24,
22
22
  };
23
- return (_jsx(Text, { ...defaultProps, ...props, "data-element-type": "desc", children: desc }));
23
+ return (_jsx(Text, Object.assign({}, defaultProps, props, { "data-element-type": "desc", children: desc })));
24
24
  };
25
25
  if (!title && !desc)
26
26
  return null;
@@ -1,6 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "../../jsx-runtime.js";
2
13
  import { Defs, Polygon } from '../../jsx/index.js';
3
- export const SimpleArrow = ({ width = 25, height = 25, colorPrimary = '#6699FF', rotation = 0, ...rest }) => {
14
+ export const SimpleArrow = (_a) => {
15
+ var { width = 25, height = 25, colorPrimary = '#6699FF', rotation = 0 } = _a, rest = __rest(_a, ["width", "height", "colorPrimary", "rotation"]);
4
16
  const strokeId = `gradient-arrow-stroke-${colorPrimary.replace('#', '')}`;
5
17
  const fillId = `gradient-arrow-fill-${colorPrimary.replace('#', '')}`;
6
18
  const shaftWidth = Math.round(width * 0.515);
@@ -18,5 +30,5 @@ export const SimpleArrow = ({ width = 25, height = 25, colorPrimary = '#6699FF',
18
30
  const centerX = width / 2;
19
31
  const centerY = height / 2;
20
32
  const transform = `rotate(${rotation} ${centerX} ${centerY})`;
21
- return (_jsxs(_Fragment, { children: [_jsx(Polygon, { ...rest, width: width, height: height, points: points, fill: `url(#${fillId})`, stroke: `url(#${strokeId})`, transform: transform, "data-element-type": "shape" }), _jsxs(Defs, { children: [_jsxs("linearGradient", { id: fillId, x1: "100%", y1: "0%", x2: "0%", y2: "0%", children: [_jsx("stop", { offset: "0%", "stop-color": colorPrimary, "stop-opacity": "0.36" }), _jsx("stop", { offset: "100%", "stop-color": colorPrimary, "stop-opacity": "0" })] }), _jsxs("linearGradient", { id: strokeId, x1: "100%", y1: "0%", x2: "0%", y2: "0%", children: [_jsx("stop", { offset: "0%", "stop-color": colorPrimary }), _jsx("stop", { offset: "58%", "stop-color": colorPrimary, "stop-opacity": "0" })] })] })] }));
33
+ return (_jsxs(_Fragment, { children: [_jsx(Polygon, Object.assign({}, rest, { width: width, height: height, points: points, fill: `url(#${fillId})`, stroke: `url(#${strokeId})`, transform: transform, "data-element-type": "shape" })), _jsxs(Defs, { children: [_jsxs("linearGradient", { id: fillId, x1: "100%", y1: "0%", x2: "0%", y2: "0%", children: [_jsx("stop", { offset: "0%", "stop-color": colorPrimary, "stop-opacity": "0.36" }), _jsx("stop", { offset: "100%", "stop-color": colorPrimary, "stop-opacity": "0" })] }), _jsxs("linearGradient", { id: strokeId, x1: "100%", y1: "0%", x2: "0%", y2: "0%", children: [_jsx("stop", { offset: "0%", "stop-color": colorPrimary }), _jsx("stop", { offset: "58%", "stop-color": colorPrimary, "stop-opacity": "0" })] })] })] }));
22
34
  };
@@ -1,6 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  import { Polygon } from '../../jsx/index.js';
3
- export const Triangle = ({ width = 25, height = 25, colorPrimary = '#6699FF', rotation = 0, strokeWidth = 4, ...rest }) => {
14
+ export const Triangle = (_a) => {
15
+ var { width = 25, height = 25, colorPrimary = '#6699FF', rotation = 0, strokeWidth = 4 } = _a, rest = __rest(_a, ["width", "height", "colorPrimary", "rotation", "strokeWidth"]);
4
16
  // 定义三角形的三个顶点
5
17
  const points = [
6
18
  { x: width / 2, y: 0 }, // 顶点
@@ -10,5 +22,5 @@ export const Triangle = ({ width = 25, height = 25, colorPrimary = '#6699FF', ro
10
22
  const centerX = width / 2;
11
23
  const centerY = height / 2;
12
24
  const transform = `rotate(${rotation} ${centerX} ${centerY})`;
13
- return (_jsx(Polygon, { ...rest, width: width, height: height, points: points, fill: colorPrimary, stroke: colorPrimary, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", transform: transform }));
25
+ return (_jsx(Polygon, Object.assign({}, rest, { width: width, height: height, points: points, fill: colorPrimary, stroke: colorPrimary, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", transform: transform })));
14
26
  };
@@ -1,5 +1,16 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "../../jsx-runtime.js";
2
13
  export const DropShadow = (props) => {
3
- const { color = 'black', opacity = 0.8, ...restProps } = props;
4
- return (_jsx("filter", { id: "drop-shadow", x: "-25%", y: "-25%", width: "200%", height: "200%", ...restProps, children: _jsx("feDropShadow", { dx: "4", dy: "4", stdDeviation: "4", "flood-color": color, "flood-opacity": opacity }) }));
14
+ const { color = 'black', opacity = 0.8 } = props, restProps = __rest(props, ["color", "opacity"]);
15
+ return (_jsx("filter", Object.assign({ id: "drop-shadow", x: "-25%", y: "-25%", width: "200%", height: "200%" }, restProps, { children: _jsx("feDropShadow", { dx: "4", dy: "4", stdDeviation: "4", "flood-color": color, "flood-opacity": opacity }) })));
5
16
  };
@@ -7,5 +7,5 @@ export const LinearGradient = (props) => {
7
7
  'top-bottom': { x1: '0%', y1: '0%', x2: '0%', y2: '100%' },
8
8
  'bottom-top': { x1: '0%', y1: '100%', x2: '0%', y2: '0%' },
9
9
  };
10
- return (_jsxs("linearGradient", { id: id, ...directionMap[direction], children: [_jsx("stop", { offset: "0%", stopColor: startColor }), _jsx("stop", { offset: "100%", stopColor: stopColor })] }));
10
+ return (_jsxs("linearGradient", Object.assign({ id: id }, directionMap[direction], { children: [_jsx("stop", { offset: "0%", stopColor: startColor }), _jsx("stop", { offset: "100%", stopColor: stopColor })] })));
11
11
  };
@@ -32,9 +32,9 @@ export const BadgeCard = (props) => {
32
32
  : positionH === 'flipped'
33
33
  ? 'right'
34
34
  : 'left';
35
- return (_jsxs(Group, { ...restProps, width: width, height: height, children: [_jsx(Defs, { children: _jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "50%", r: "50%", children: [_jsx("stop", { offset: "0%", stopColor: themeColors.colorPrimary }), _jsx("stop", { offset: "100%", stopColor: tinycolor(themeColors.colorPrimary)
35
+ return (_jsxs(Group, Object.assign({}, restProps, { width: width, height: height, children: [_jsx(Defs, { children: _jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "50%", r: "50%", children: [_jsx("stop", { offset: "0%", stopColor: themeColors.colorPrimary }), _jsx("stop", { offset: "100%", stopColor: tinycolor(themeColors.colorPrimary)
36
36
  .darken(20)
37
- .toHexString() })] }) }), _jsx(Rect, { "data-element-type": "shape", x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimaryBg, rx: 8, ry: 8 }), hasIcon && (_jsxs(_Fragment, { children: [_jsx(Ellipse, { x: badgeX, y: badgeY, width: badgeSize, height: badgeSize, fill: `url(#${gradientId})` }), _jsx(ItemIcon, { indexes: indexes, x: badgeX + (badgeSize - iconSize) / 2, y: badgeY + (badgeSize - iconSize) / 2, size: iconSize, fill: themeColors.colorWhite })] })), _jsxs(FlexLayout, { flexDirection: "column", x: contentStartX, y: contentY, width: contentWidth, height: !hasValue && !hasDesc ? undefined : contentAreaHeight, alignItems: "center", justifyContent: "center", children: [_jsx(ItemLabel, { indexes: indexes, width: contentWidth, alignHorizontal: textAlign, alignVertical: "middle", fontSize: 14, fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, width: contentWidth, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', alignVertical: "middle", fontSize: 18, lineHeight: 1, fontWeight: "bold", fill: themeColors.colorPrimary, value: value, formatter: valueFormatter }))] }), hasDesc && (_jsx(ItemDesc, { indexes: indexes, x: gap, y: descY, width: fullWidth, alignHorizontal: textAlign, fontSize: 11, fill: themeColors.colorTextSecondary, lineNumber: 2, lineHeight: 1.2, wordWrap: true, children: datum.desc }))] }));
37
+ .toHexString() })] }) }), _jsx(Rect, { "data-element-type": "shape", x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimaryBg, rx: 8, ry: 8 }), hasIcon && (_jsxs(_Fragment, { children: [_jsx(Ellipse, { x: badgeX, y: badgeY, width: badgeSize, height: badgeSize, fill: `url(#${gradientId})` }), _jsx(ItemIcon, { indexes: indexes, x: badgeX + (badgeSize - iconSize) / 2, y: badgeY + (badgeSize - iconSize) / 2, size: iconSize, fill: themeColors.colorWhite })] })), _jsxs(FlexLayout, { flexDirection: "column", x: contentStartX, y: contentY, width: contentWidth, height: !hasValue && !hasDesc ? undefined : contentAreaHeight, alignItems: "center", justifyContent: "center", children: [_jsx(ItemLabel, { indexes: indexes, width: contentWidth, alignHorizontal: textAlign, alignVertical: "middle", fontSize: 14, fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, width: contentWidth, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', alignVertical: "middle", fontSize: 18, lineHeight: 1, fontWeight: "bold", fill: themeColors.colorPrimary, value: value, formatter: valueFormatter }))] }), hasDesc && (_jsx(ItemDesc, { indexes: indexes, x: gap, y: descY, width: fullWidth, alignHorizontal: textAlign, fontSize: 11, fill: themeColors.colorTextSecondary, lineNumber: 2, lineHeight: 1.2, wordWrap: true, children: datum.desc }))] })));
38
38
  };
39
39
  registerItem('badge-card', {
40
40
  component: BadgeCard,
@@ -5,7 +5,7 @@ import { getItemProps } from '../utils/index.js';
5
5
  import { registerItem } from './registry.js';
6
6
  export const CandyCardLite = (props) => {
7
7
  const [{ indexes, datum, width = 280, height = 140, themeColors }, restProps,] = getItemProps(props, ['width', 'height']);
8
- return (_jsxs(Group, { ...restProps, children: [_jsx("rect", { x: 0, y: 0, width: width, height: height, rx: 22, ry: 22, fill: themeColors.colorPrimaryBg, stroke: themeColors.colorPrimary, "data-element-type": "shape" }), _jsx(Path, { x: width - 85, y: 0.5, width: 85, height: 65, d: "M0 0H62.4495C74.9557 0 85.4549 10.8574 84.4557 23.1875V60.1875L77.8772 62.5839C64.3776 67.6876 48.51 64.6893 37.8662 53.7441L10.2361 25.3312C4.91402 19.8571 1.65356 13.1736 0.435652 6.21819L0 0Z", fill: themeColors.colorBg, "data-element-type": "shape" }), _jsx(ItemLabel, { indexes: indexes, x: 20, y: 24, width: 200, alignHorizontal: "left", alignVertical: "middle", fill: themeColors.colorText, children: datum.label }), _jsx(ItemDesc, { indexes: indexes, x: 20, y: 58, width: 220, height: 70, fill: themeColors.colorTextSecondary, alignHorizontal: "left", alignVertical: "top", children: datum.desc }), _jsx(ItemIcon, { indexes: indexes, x: width - 48, y: 12, width: 32, height: 32, fill: themeColors.colorPrimary })] }));
8
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsx("rect", { x: 0, y: 0, width: width, height: height, rx: 22, ry: 22, fill: themeColors.colorPrimaryBg, stroke: themeColors.colorPrimary, "data-element-type": "shape" }), _jsx(Path, { x: width - 85, y: 0.5, width: 85, height: 65, d: "M0 0H62.4495C74.9557 0 85.4549 10.8574 84.4557 23.1875V60.1875L77.8772 62.5839C64.3776 67.6876 48.51 64.6893 37.8662 53.7441L10.2361 25.3312C4.91402 19.8571 1.65356 13.1736 0.435652 6.21819L0 0Z", fill: themeColors.colorBg, "data-element-type": "shape" }), _jsx(ItemLabel, { indexes: indexes, x: 20, y: 24, width: 200, alignHorizontal: "left", alignVertical: "middle", fill: themeColors.colorText, children: datum.label }), _jsx(ItemDesc, { indexes: indexes, x: 20, y: 58, width: 220, height: 70, fill: themeColors.colorTextSecondary, alignHorizontal: "left", alignVertical: "top", children: datum.desc }), _jsx(ItemIcon, { indexes: indexes, x: width - 48, y: 12, width: 32, height: 32, fill: themeColors.colorPrimary })] })));
9
9
  };
10
10
  registerItem('candy-card-lite', {
11
11
  component: CandyCardLite,
@@ -26,7 +26,7 @@ export const CapsuleItem = (props) => {
26
26
  fill: themeColors.colorWhite,
27
27
  };
28
28
  // Get label bounds to calculate layout
29
- const labelBounds = getElementBounds(_jsx(ItemLabel, { ...labelProps, children: datum.label }));
29
+ const labelBounds = getElementBounds(_jsx(ItemLabel, Object.assign({}, labelProps, { children: datum.label })));
30
30
  const descProps = {
31
31
  indexes,
32
32
  width: textWidth,
@@ -37,7 +37,7 @@ export const CapsuleItem = (props) => {
37
37
  fill: themeColors.colorWhite,
38
38
  };
39
39
  // Get desc bounds to calculate layout
40
- const descBounds = getElementBounds(datum.desc ? _jsx(ItemDesc, { ...descProps, children: datum.desc }) : null);
40
+ const descBounds = getElementBounds(datum.desc ? _jsx(ItemDesc, Object.assign({}, descProps, { children: datum.desc })) : null);
41
41
  // Calculate vertical positions for text elements
42
42
  const textGap = 4;
43
43
  const totalTextHeight = labelBounds.height + textGap + descBounds.height;
@@ -47,7 +47,7 @@ export const CapsuleItem = (props) => {
47
47
  // Calculate icon position (centered in the circle area with padding)
48
48
  const iconX = isFlipped ? width - height + iconPadding : iconPadding;
49
49
  const iconY = iconPadding;
50
- return (_jsxs(Group, { ...restProps, children: [_jsx(Defs, { children: _jsx(DropShadow, {}) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimary, rx: borderRadius, ry: borderRadius, "data-element-type": "shape" }), datum.icon && (_jsxs(_Fragment, { children: [_jsx(Ellipse, { x: iconX, y: iconY, width: iconSize, height: iconSize, fillOpacity: 0.5, fill: themeColors.colorBg, filter: "url(#drop-shadow)" }), _jsx(ItemIconCircle, { indexes: indexes, x: iconX, y: iconY, size: iconSize, fill: themeColors.colorBg, colorBg: themeColors.colorPrimary })] })), datum.label && (_jsx(ItemLabel, { x: textX, y: labelY, ...labelProps, children: datum.label })), datum.desc && (_jsx(ItemDesc, { x: textX, y: descY, ...descProps, children: datum.desc }))] }));
50
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsx(Defs, { children: _jsx(DropShadow, {}) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimary, rx: borderRadius, ry: borderRadius, "data-element-type": "shape" }), datum.icon && (_jsxs(_Fragment, { children: [_jsx(Ellipse, { x: iconX, y: iconY, width: iconSize, height: iconSize, fillOpacity: 0.5, fill: themeColors.colorBg, filter: "url(#drop-shadow)" }), _jsx(ItemIconCircle, { indexes: indexes, x: iconX, y: iconY, size: iconSize, fill: themeColors.colorBg, colorBg: themeColors.colorPrimary })] })), datum.label && (_jsx(ItemLabel, Object.assign({ x: textX, y: labelY }, labelProps, { children: datum.label }))), datum.desc && (_jsx(ItemDesc, Object.assign({ x: textX, y: descY }, descProps, { children: datum.desc })))] })));
51
51
  };
52
52
  registerItem('capsule-item', {
53
53
  component: CapsuleItem,
@@ -22,7 +22,7 @@ export const CircleNode = (props) => {
22
22
  const gradientDirection = positionH === 'flipped'
23
23
  ? { x1: '0%', y1: '0%', x2: '100%', y2: '0%' }
24
24
  : { x1: '100%', y1: '0%', x2: '0%', y2: '0%' };
25
- return (_jsxs(Group, { ...restProps, children: [_jsxs(Defs, { children: [_jsxs("linearGradient", { id: outerGradientId, ...gradientDirection, children: [_jsx("stop", { offset: "0%", stopColor: colorOuterStart }), _jsx("stop", { offset: "100%", stopColor: colorOuterEnd })] }), _jsxs("linearGradient", { id: innerGradientId, ...gradientDirection, children: [_jsx("stop", { offset: "0%", stopColor: colorInnerStart }), _jsx("stop", { offset: "100%", stopColor: colorInnerEnd })] })] }), _jsx(Ellipse, { width: size, height: size, fill: `url(#${outerGradientId})`, "data-element-type": "shape" }), _jsx(Ellipse, { x: innerCircleOffset, y: innerCircleOffset, width: innerCircleSize, height: innerCircleSize, fill: `url(#${innerGradientId})`, stroke: "#FFFFFF", strokeWidth: 1, "data-element-type": "shape" }), _jsx(ItemLabel, { indexes: indexes, x: labelOffset, y: labelOffset, width: labelSize, height: labelSize, lineHeight: 1.1, alignHorizontal: "center", alignVertical: "middle", fill: colorText, fontWeight: "500", children: datum.label })] }));
25
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsxs(Defs, { children: [_jsxs("linearGradient", Object.assign({ id: outerGradientId }, gradientDirection, { children: [_jsx("stop", { offset: "0%", stopColor: colorOuterStart }), _jsx("stop", { offset: "100%", stopColor: colorOuterEnd })] })), _jsxs("linearGradient", Object.assign({ id: innerGradientId }, gradientDirection, { children: [_jsx("stop", { offset: "0%", stopColor: colorInnerStart }), _jsx("stop", { offset: "100%", stopColor: colorInnerEnd })] }))] }), _jsx(Ellipse, { width: size, height: size, fill: `url(#${outerGradientId})`, "data-element-type": "shape" }), _jsx(Ellipse, { x: innerCircleOffset, y: innerCircleOffset, width: innerCircleSize, height: innerCircleSize, fill: `url(#${innerGradientId})`, stroke: "#FFFFFF", strokeWidth: 1, "data-element-type": "shape" }), _jsx(ItemLabel, { indexes: indexes, x: labelOffset, y: labelOffset, width: labelSize, height: labelSize, lineHeight: 1.1, alignHorizontal: "center", alignVertical: "middle", fill: colorText, fontWeight: "500", children: datum.label })] })));
26
26
  };
27
27
  registerItem('circle-node', {
28
28
  component: CircleNode,
@@ -4,8 +4,9 @@ import { ItemLabel, ItemValue } from '../components/index.js';
4
4
  import { getItemProps } from '../utils/index.js';
5
5
  import { registerItem } from './registry.js';
6
6
  export const CircularProgress = (props) => {
7
+ var _a;
7
8
  const [{ datum, indexes, size = 120, strokeWidth = 12, gap = 8, themeColors, valueFormatter = (value) => `${Math.round(value)}%`, }, restProps,] = getItemProps(props, ['size', 'strokeWidth', 'gap']);
8
- const value = datum.value ?? 0;
9
+ const value = (_a = datum.value) !== null && _a !== void 0 ? _a : 0;
9
10
  const maxValue = 100;
10
11
  const percentage = Math.min(Math.max(value / maxValue, 0), 1);
11
12
  const radius = (size - strokeWidth) / 2;
@@ -16,7 +17,7 @@ export const CircularProgress = (props) => {
16
17
  const angle = percentage * 360;
17
18
  const pathData = describeArc(center, center, radius, 0, angle);
18
19
  const bounds = { x: start, y: start, width: d, height: d };
19
- return (_jsxs(Group, { ...restProps, width: size, height: size + gap + 20, children: [_jsx(Rect, { width: size, height: size, fill: "none" }), _jsx(Ellipse, { ...bounds, fill: "none", stroke: "#f0f0f0", strokeWidth: strokeWidth, "data-element-type": "shape" }), isFullCircle ? (_jsx(Ellipse, { ...bounds, fill: "none", stroke: themeColors.colorPrimary, strokeWidth: strokeWidth, "data-element-type": "shape" })) : (_jsx(Path, { d: pathData, fill: "none", stroke: themeColors.colorPrimary, strokeWidth: strokeWidth, strokeLinecap: "round", "data-element-type": "shape" })), _jsx(ItemValue, { indexes: indexes, x: strokeWidth, y: strokeWidth, width: d - strokeWidth, height: d - strokeWidth, fontSize: 24, fontWeight: "bold", fill: themeColors.colorPrimary, alignHorizontal: "center", alignVertical: "middle", value: value, formatter: valueFormatter }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorTextSecondary, children: datum.label })] }));
20
+ return (_jsxs(Group, Object.assign({}, restProps, { width: size, height: size + gap + 20, children: [_jsx(Rect, { width: size, height: size, fill: "none" }), _jsx(Ellipse, Object.assign({}, bounds, { fill: "none", stroke: "#f0f0f0", strokeWidth: strokeWidth, "data-element-type": "shape" })), isFullCircle ? (_jsx(Ellipse, Object.assign({}, bounds, { fill: "none", stroke: themeColors.colorPrimary, strokeWidth: strokeWidth, "data-element-type": "shape" }))) : (_jsx(Path, { d: pathData, fill: "none", stroke: themeColors.colorPrimary, strokeWidth: strokeWidth, strokeLinecap: "round", "data-element-type": "shape" })), _jsx(ItemValue, { indexes: indexes, x: strokeWidth, y: strokeWidth, width: d - strokeWidth, height: d - strokeWidth, fontSize: 24, fontWeight: "bold", fill: themeColors.colorPrimary, alignHorizontal: "center", alignVertical: "middle", value: value, formatter: valueFormatter }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorTextSecondary, children: datum.label })] })));
20
21
  };
21
22
  function describeArc(x, y, radius, startAngle, endAngle) {
22
23
  const start = polarToCartesian(x, y, radius, endAngle);
@@ -15,7 +15,7 @@ export const CompactCard = (props) => {
15
15
  // 为 Label 和 Value 分配空间
16
16
  const labelWidth = hasValue ? textWidth * 0.8 : textWidth;
17
17
  const valueWidth = hasValue ? textWidth * 0.2 : 0;
18
- return (_jsxs(Group, { ...restProps, children: [_jsx(Defs, { children: _jsx("filter", { id: shadowId, children: _jsx("feDropShadow", { dx: "0", dy: "2", stdDeviation: "2", floodOpacity: "0.15" }) }) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorBgElevated, stroke: themeColors.colorBgElevated, strokeWidth: 1, rx: 6, ry: 6, filter: `url(#${shadowId})`, "data-element-type": "shape" }), _jsx(Rect, { x: positionH === 'flipped' ? width - 3 : 0, y: 0, width: 3, height: height, fill: themeColors.colorPrimary, rx: 1.5, ry: 1.5, "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: iconX, y: (height - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimary }), _jsxs(FlexLayout, { x: textStartX, y: gap, width: textWidth, height: height - gap * 2, flexDirection: "column", justifyContent: "center", alignItems: "flex-start", children: [_jsxs(FlexLayout, { width: textWidth, flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(ItemLabel, { indexes: indexes, width: labelWidth, alignHorizontal: "left", fontSize: 12, fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, width: valueWidth, alignHorizontal: "right", fontSize: 12, fontWeight: "bold", fill: themeColors.colorPrimary, value: value, formatter: valueFormatter }))] }), _jsx(ItemDesc, { indexes: indexes, width: textWidth, alignHorizontal: "left", alignVertical: "middle", fontSize: 10, fill: themeColors.colorTextSecondary, lineNumber: 2, wordWrap: true, children: datum.desc })] })] }));
18
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsx(Defs, { children: _jsx("filter", { id: shadowId, children: _jsx("feDropShadow", { dx: "0", dy: "2", stdDeviation: "2", floodOpacity: "0.15" }) }) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorBgElevated, stroke: themeColors.colorBgElevated, strokeWidth: 1, rx: 6, ry: 6, filter: `url(#${shadowId})`, "data-element-type": "shape" }), _jsx(Rect, { x: positionH === 'flipped' ? width - 3 : 0, y: 0, width: 3, height: height, fill: themeColors.colorPrimary, rx: 1.5, ry: 1.5, "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: iconX, y: (height - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimary }), _jsxs(FlexLayout, { x: textStartX, y: gap, width: textWidth, height: height - gap * 2, flexDirection: "column", justifyContent: "center", alignItems: "flex-start", children: [_jsxs(FlexLayout, { width: textWidth, flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(ItemLabel, { indexes: indexes, width: labelWidth, alignHorizontal: "left", fontSize: 12, fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, width: valueWidth, alignHorizontal: "right", fontSize: 12, fontWeight: "bold", fill: themeColors.colorPrimary, value: value, formatter: valueFormatter }))] }), _jsx(ItemDesc, { indexes: indexes, width: textWidth, alignHorizontal: "left", alignVertical: "middle", fontSize: 10, fill: themeColors.colorTextSecondary, lineNumber: 2, wordWrap: true, children: datum.desc })] })] })));
19
19
  };
20
20
  registerItem('compact-card', {
21
21
  component: CompactCard,
@@ -11,7 +11,7 @@ export const DoneList = (props) => {
11
11
  : positionV === 'flipped'
12
12
  ? height - iconSize
13
13
  : 0;
14
- return (_jsxs(Group, { ...restProps, children: [_jsx(Path, { "data-element-type": "shape", x: positionH === 'flipped' ? textWidth + gap : 0, y: shapeY, fill: themeColors.colorPrimary, width: iconSize, height: iconSize, d: "M14.7273 30C6.54538 30 0 22.9077 0 14.7269C0 6.54617 6.54538 0 14.7273 0C22.9092 0 30 6.54617 30 14.7269C30 22.9077 22.9092 30 14.7273 30ZM24.5454 10.9077C22.9092 9.27307 22.9092 9.27307 22.9092 9.27307C22.3638 8.72692 22.3638 8.7269 21.8181 8.7269C21.2727 8.7269 21.2727 8.72692 20.7273 9.27307C13.0908 16.9077 13.0908 16.9077 13.0908 16.9077C8.72731 12.5461 8.72731 12.5462 8.72731 12.5462C8.18193 12.5462 8.18193 12 7.63654 12L7.09077 12.5462C4.90923 14.1808 4.90923 14.1808 4.90923 14.1808C4.90923 14.7269 4.90923 14.7269 4.90923 15.2731C4.90923 15.8192 4.90923 15.8192 4.90923 16.3654C12 23.4539 12 23.4538 12 23.4538C12.5454 23.4538 12.5454 23.4538 13.0908 23.4538C13.6365 23.4538 13.6365 23.4538 14.1819 23.4538C24.5454 12.5461 24.5454 12.5462 24.5454 12.5462L25.0908 12C25.0908 11.4538 24.5454 10.9077 24.5454 10.9077Z" }), _jsx(ItemLabel, { indexes: indexes, x: positionH === 'flipped' ? 0 : iconSize + gap, width: textWidth, height: height, fontWeight: "normal", alignVertical: "middle", wordWrap: false, fill: "#666", children: datum.label || datum.desc })] }));
14
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsx(Path, { "data-element-type": "shape", x: positionH === 'flipped' ? textWidth + gap : 0, y: shapeY, fill: themeColors.colorPrimary, width: iconSize, height: iconSize, d: "M14.7273 30C6.54538 30 0 22.9077 0 14.7269C0 6.54617 6.54538 0 14.7273 0C22.9092 0 30 6.54617 30 14.7269C30 22.9077 22.9092 30 14.7273 30ZM24.5454 10.9077C22.9092 9.27307 22.9092 9.27307 22.9092 9.27307C22.3638 8.72692 22.3638 8.7269 21.8181 8.7269C21.2727 8.7269 21.2727 8.72692 20.7273 9.27307C13.0908 16.9077 13.0908 16.9077 13.0908 16.9077C8.72731 12.5461 8.72731 12.5462 8.72731 12.5462C8.18193 12.5462 8.18193 12 7.63654 12L7.09077 12.5462C4.90923 14.1808 4.90923 14.1808 4.90923 14.1808C4.90923 14.7269 4.90923 14.7269 4.90923 15.2731C4.90923 15.8192 4.90923 15.8192 4.90923 16.3654C12 23.4539 12 23.4538 12 23.4538C12.5454 23.4538 12.5454 23.4538 13.0908 23.4538C13.6365 23.4538 13.6365 23.4538 14.1819 23.4538C24.5454 12.5461 24.5454 12.5462 24.5454 12.5462L25.0908 12C25.0908 11.4538 24.5454 10.9077 24.5454 10.9077Z" }), _jsx(ItemLabel, { indexes: indexes, x: positionH === 'flipped' ? 0 : iconSize + gap, width: textWidth, height: height, fontWeight: "normal", alignVertical: "middle", wordWrap: false, fill: "#666", children: datum.label || datum.desc })] })));
15
15
  };
16
16
  registerItem('done-list', {
17
17
  component: DoneList,
@@ -32,11 +32,11 @@ export const HorizontalIconArrow = (props) => {
32
32
  dotLineGap +
33
33
  labelBounds.height +
34
34
  descBounds.height;
35
- return (_jsx(Group, { width: width, height: totalHeight, ...restProps, children: _jsxs(FlexLayout, { flexDirection: "column", alignItems: "center", children: [isVNormal ? (_jsxs(_Fragment, { children: [desc, label, _jsx(Gap, { height: dotLineGap }), dotLine] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: fixedGap }), icon, _jsx(Gap, { height: iconGap })] })), _jsxs(AlignLayout, { horizontal: "center", vertical: "middle", width: width, height: arrowHeight, children: [_jsx(HorizontalArrow, { width: width, height: arrowHeight, fill: themeColors.colorPrimary }), _jsx(Text, { width: width, height: arrowHeight, alignHorizontal: "center", alignVertical: "middle", fill: themeColors.colorWhite, fontWeight: "bold", fontSize: 16, children: datum.time
35
+ return (_jsx(Group, Object.assign({ width: width, height: totalHeight }, restProps, { children: _jsxs(FlexLayout, { flexDirection: "column", alignItems: "center", children: [isVNormal ? (_jsxs(_Fragment, { children: [desc, label, _jsx(Gap, { height: dotLineGap }), dotLine] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: fixedGap }), icon, _jsx(Gap, { height: iconGap })] })), _jsxs(AlignLayout, { horizontal: "center", vertical: "middle", width: width, height: arrowHeight, children: [_jsx(HorizontalArrow, { width: width, height: arrowHeight, fill: themeColors.colorPrimary }), _jsx(Text, { width: width, height: arrowHeight, alignHorizontal: "center", alignVertical: "middle", fill: themeColors.colorWhite, fontWeight: "bold", fontSize: 16, children: datum.time
36
36
  ? datum.time
37
37
  : String(indexes[0] + 1)
38
38
  .padStart(2, '0')
39
- .slice(-2) })] }), !isVNormal ? (_jsxs(_Fragment, { children: [dotLine, _jsx(Gap, { height: dotLineGap }), label, desc] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: iconGap }), icon] }))] }) }));
39
+ .slice(-2) })] }), !isVNormal ? (_jsxs(_Fragment, { children: [dotLine, _jsx(Gap, { height: dotLineGap }), label, desc] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: iconGap }), icon] }))] }) })));
40
40
  };
41
41
  const HorizontalArrow = (props) => {
42
42
  const { x = 0, y = 0, width = 100, height = 40, fill = '#FF356A', size = 10, } = props;
@@ -29,9 +29,9 @@ export const HorizontalIconLine = (props) => {
29
29
  const topBalance = iconSideHeight > textSideHeight ? heightDiff : 0;
30
30
  const bottomBalance = textSideHeight > iconSideHeight ? heightDiff : 0;
31
31
  if (positionV === 'flipped') {
32
- return (_jsxs(FlexLayout, { ...restProps, flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: bottomBalance }), time, icon, _jsx(Gap, { height: 5 }), line, label, desc, _jsx(Gap, { height: topBalance })] }));
32
+ return (_jsxs(FlexLayout, Object.assign({}, restProps, { flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: bottomBalance }), time, icon, _jsx(Gap, { height: 5 }), line, label, desc, _jsx(Gap, { height: topBalance })] })));
33
33
  }
34
- return (_jsxs(FlexLayout, { ...restProps, flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: topBalance }), label, desc, line, _jsx(Gap, { height: 5 }), icon, time, _jsx(Gap, { height: bottomBalance })] }));
34
+ return (_jsxs(FlexLayout, Object.assign({}, restProps, { flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: topBalance }), label, desc, line, _jsx(Gap, { height: 5 }), icon, time, _jsx(Gap, { height: bottomBalance })] })));
35
35
  };
36
36
  registerItem('horizontal-icon-line', {
37
37
  component: HorizontalIconLine,
@@ -5,13 +5,14 @@ import { ItemIcon, ItemLabel } from '../components/index.js';
5
5
  import { getItemProps } from '../utils/index.js';
6
6
  import { registerItem } from './registry.js';
7
7
  export const IconBadge = (props) => {
8
+ var _a;
8
9
  const [{ datum, indexes, size = 80, iconSize = 28, badgeSize = 24, gap = 8, themeColors, width = 84, height = 105, }, restProps,] = getItemProps(props, ['size', 'iconSize', 'badgeSize', 'gap']);
9
- const value = datum.value ?? 0;
10
+ const value = (_a = datum.value) !== null && _a !== void 0 ? _a : 0;
10
11
  const gradientId = `${themeColors.colorPrimary}-icon`;
11
12
  const badgeGradientId = '#ff6b6b-badge';
12
- return (_jsxs(Group, { ...restProps, width: width, height: height, children: [_jsxs(Defs, { children: [_jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "30%", r: "70%", children: [_jsx("stop", { offset: "0%", stopColor: tinycolor(themeColors.colorPrimary)
13
+ return (_jsxs(Group, Object.assign({}, restProps, { width: width, height: height, children: [_jsxs(Defs, { children: [_jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "30%", r: "70%", children: [_jsx("stop", { offset: "0%", stopColor: tinycolor(themeColors.colorPrimary)
13
14
  .lighten(30)
14
- .toHexString() }), _jsx("stop", { offset: "100%", stopColor: themeColors.colorPrimary })] }), _jsxs("linearGradient", { id: badgeGradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: "#ff6b6b" }), _jsx("stop", { offset: "100%", stopColor: "#ee5a52" })] })] }), _jsx(Ellipse, { x: 0, y: 0, width: size, height: size, fill: `url(#${gradientId})`, "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: (size - iconSize) / 2, y: (size - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimaryText }), _jsx(Ellipse, { x: size - badgeSize + 4, width: badgeSize, height: badgeSize, fill: `url(#${badgeGradientId})` }), _jsx(Text, { x: size - badgeSize + 4, width: badgeSize, height: badgeSize, fontSize: 10, fontWeight: "bold", fill: themeColors.colorWhite, alignHorizontal: "center", alignVertical: "middle", children: value > 99 ? '99+' : Math.round(value) }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorText, children: datum.label })] }));
15
+ .toHexString() }), _jsx("stop", { offset: "100%", stopColor: themeColors.colorPrimary })] }), _jsxs("linearGradient", { id: badgeGradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: "#ff6b6b" }), _jsx("stop", { offset: "100%", stopColor: "#ee5a52" })] })] }), _jsx(Ellipse, { x: 0, y: 0, width: size, height: size, fill: `url(#${gradientId})`, "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: (size - iconSize) / 2, y: (size - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimaryText }), _jsx(Ellipse, { x: size - badgeSize + 4, width: badgeSize, height: badgeSize, fill: `url(#${badgeGradientId})` }), _jsx(Text, { x: size - badgeSize + 4, width: badgeSize, height: badgeSize, fontSize: 10, fontWeight: "bold", fill: themeColors.colorWhite, alignHorizontal: "center", alignVertical: "middle", children: value > 99 ? '99+' : Math.round(value) }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorText, children: datum.label })] })));
15
16
  };
16
17
  registerItem('icon-badge', {
17
18
  component: IconBadge,
@@ -53,7 +53,7 @@ export const IndexedCard = (props) => {
53
53
  (showDesc ? gap : 0) + // 分隔线后间距
54
54
  descBounds.height; // 描述高度
55
55
  // 4. 组件结构
56
- return (_jsxs(Group, { ...restProps, width: width, height: contentHeight, children: [_jsx(Rect, { x: 0, y: 0, width: width, height: contentHeight, rx: borderRadius, ry: borderRadius, fill: cardBgColor, stroke: tinycolor(cardBgColor).darken(5).toHexString(), strokeWidth: 0.5, "data-element-type": "shape" }), _jsxs(Group, { x: padding, y: padding, children: [_jsxs(Group, { x: 0, y: 0, children: [_jsx(Text, { x: 0, y: 0, fontSize: indexFontSize, fontWeight: "bold", fill: themeColors.colorPrimary, alignVertical: "top", children: indexStr }), showLabel && (_jsx(ItemLabel, { indexes: indexes, x: indexFontSize + gap, y: 0, width: labelAvailableWidth, fontSize: labelFontSize, fontWeight: "bold", fill: themeColors.colorTextSecondary, alignVertical: "top", children: datum.label }))] }), _jsx(Rect, { x: 0, y: titleRowHeight + gap, width: contentWidth, height: separatorHeight, fill: separatorColor, "data-element-type": "shape" }), showDesc && (_jsx(ItemDesc, { indexes: indexes, x: 0, y: titleRowHeight + gap + separatorHeight + gap, width: contentWidth, fontSize: 14, lineHeight: 1.5, wordWrap: true, fill: themeColors.colorTextSecondary, children: datum.desc }))] })] }));
56
+ return (_jsxs(Group, Object.assign({}, restProps, { width: width, height: contentHeight, children: [_jsx(Rect, { x: 0, y: 0, width: width, height: contentHeight, rx: borderRadius, ry: borderRadius, fill: cardBgColor, stroke: tinycolor(cardBgColor).darken(5).toHexString(), strokeWidth: 0.5, "data-element-type": "shape" }), _jsxs(Group, { x: padding, y: padding, children: [_jsxs(Group, { x: 0, y: 0, children: [_jsx(Text, { x: 0, y: 0, fontSize: indexFontSize, fontWeight: "bold", fill: themeColors.colorPrimary, alignVertical: "top", children: indexStr }), showLabel && (_jsx(ItemLabel, { indexes: indexes, x: indexFontSize + gap, y: 0, width: labelAvailableWidth, fontSize: labelFontSize, fontWeight: "bold", fill: themeColors.colorTextSecondary, alignVertical: "top", children: datum.label }))] }), _jsx(Rect, { x: 0, y: titleRowHeight + gap, width: contentWidth, height: separatorHeight, fill: separatorColor, "data-element-type": "shape" }), showDesc && (_jsx(ItemDesc, { indexes: indexes, x: 0, y: titleRowHeight + gap + separatorHeight + gap, width: contentWidth, fontSize: 14, lineHeight: 1.5, wordWrap: true, fill: themeColors.colorTextSecondary, children: datum.desc }))] })] })));
57
57
  };
58
58
  registerItem('indexed-card', {
59
59
  component: IndexedCard,
@@ -31,7 +31,7 @@ export const LCornerCard = (props) => {
31
31
  const x1 = lx1 + halfStroke;
32
32
  const y1 = ly1 + halfStroke;
33
33
  const gap = 8;
34
- return (_jsxs(Group, { ...restProps, children: [_jsx(ItemDesc, { indexes: indexes, x: descX, width: descWidth, height: descHeight, fontSize: 12, alignHorizontal: "left", alignVertical: "bottom", fill: themeColors.colorTextSecondary, children: desc }), _jsx(Polygon, { points: arrowVertices, fill: themeColors.colorPrimary, opacity: 0.9, width: arrowSize, height: arrowSize, "data-element-type": "shape" }), _jsx(Path, { d: d, stroke: themeColors.colorPrimary, strokeWidth: lStroke, fill: "none", "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: x1 + innerWidth / 2 - iconSize / 2, y: y1 + gap, size: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemLabel, { indexes: indexes, x: x1, y: y1 + iconSize + gap * 2, width: innerWidth, fontSize: 14, fontWeight: "bold", alignHorizontal: "center", alignVertical: "middle", fill: themeColors.colorText, children: label })] }));
34
+ return (_jsxs(Group, Object.assign({}, restProps, { children: [_jsx(ItemDesc, { indexes: indexes, x: descX, width: descWidth, height: descHeight, fontSize: 12, alignHorizontal: "left", alignVertical: "bottom", fill: themeColors.colorTextSecondary, children: desc }), _jsx(Polygon, { points: arrowVertices, fill: themeColors.colorPrimary, opacity: 0.9, width: arrowSize, height: arrowSize, "data-element-type": "shape" }), _jsx(Path, { d: d, stroke: themeColors.colorPrimary, strokeWidth: lStroke, fill: "none", "data-element-type": "shape" }), _jsx(ItemIcon, { indexes: indexes, x: x1 + innerWidth / 2 - iconSize / 2, y: y1 + gap, size: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemLabel, { indexes: indexes, x: x1, y: y1 + iconSize + gap * 2, width: innerWidth, fontSize: 14, fontWeight: "bold", alignHorizontal: "center", alignVertical: "middle", fill: themeColors.colorText, children: label })] })));
35
35
  };
36
36
  registerItem('l-corner-card', {
37
37
  component: LCornerCard,