origam 2.40.1 → 2.41.1

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 (330) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/src/components/Alert/OrigamAlert.vue +1 -2
  3. package/dist/src/components/Audio/OrigamAudio.vue +15 -14
  4. package/dist/src/components/Badge/OrigamBadge.vue +6 -1
  5. package/dist/src/components/Bracket/OrigamBracket.vue +5 -5
  6. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +2 -1
  7. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +1 -2
  8. package/dist/src/components/Btn/OrigamBtn.vue +14 -15
  9. package/dist/src/components/Card/OrigamCard.vue +2 -1
  10. package/dist/src/components/Carousel/OrigamCarousel.vue +14 -13
  11. package/dist/src/components/Chart/OrigamChartBullet.vue +4 -1
  12. package/dist/src/components/Chart/OrigamChartCartesian.vue +1 -2
  13. package/dist/src/components/Chart/OrigamChartPictorial.vue +3 -6
  14. package/dist/src/components/Chart/OrigamChartPolar.vue +2 -1
  15. package/dist/src/components/Chart/OrigamChartPolarBar.vue +3 -1
  16. package/dist/src/components/Chart/OrigamChartSankey.vue +9 -167
  17. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +14 -12
  18. package/dist/src/components/Chart/OrigamChartSunburst.vue +10 -2
  19. package/dist/src/components/Chart/OrigamChartWordCloud.vue +39 -36
  20. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +3 -4
  21. package/dist/src/components/Chip/OrigamChip.vue +2 -3
  22. package/dist/src/components/Chip/OrigamChipGroup.vue +2 -3
  23. package/dist/src/components/Clipboard/OrigamClipboard.vue +1 -1
  24. package/dist/src/components/Code/OrigamCode.vue +9 -18
  25. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +5 -1
  26. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +1 -2
  27. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +1 -2
  28. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +1 -2
  29. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +6 -2
  30. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +2 -4
  31. package/dist/src/components/Counter/OrigamCounter.vue +1 -0
  32. package/dist/src/components/DataTable/OrigamDataTable.vue +6 -8
  33. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +1 -2
  34. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +3 -2
  35. package/dist/src/components/DataTable/OrigamDataTableRow.vue +2 -3
  36. package/dist/src/components/DataTable/OrigamDataTableRows.vue +43 -39
  37. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +3 -4
  38. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +1 -1
  39. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1 -2
  40. package/dist/src/components/Dialog/OrigamDialog.vue +4 -12
  41. package/dist/src/components/Drawer/OrigamDrawer.vue +4 -2
  42. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +2 -3
  43. package/dist/src/components/Field/OrigamField.vue +2 -6
  44. package/dist/src/components/FileField/OrigamFileField.vue +23 -6
  45. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +3 -4
  46. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +3 -4
  47. package/dist/src/components/Form/OrigamForm.vue +0 -2
  48. package/dist/src/components/Grids/OrigamRow.vue +8 -11
  49. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +7 -7
  50. package/dist/src/components/Input/OrigamInput.vue +3 -11
  51. package/dist/src/components/List/OrigamListGroup.vue +2 -3
  52. package/dist/src/components/List/OrigamListItem.vue +4 -5
  53. package/dist/src/components/Media/OrigamMediaController.vue +15 -15
  54. package/dist/src/components/Media/OrigamMediaScrubber.vue +15 -12
  55. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +4 -5
  56. package/dist/src/components/Menu/OrigamMenu.vue +1 -2
  57. package/dist/src/components/NumberField/OrigamNumberField.vue +7 -10
  58. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +7 -1
  59. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1 -1
  60. package/dist/src/components/Overlay/OrigamOverlay.vue +3 -4
  61. package/dist/src/components/Pagination/OrigamPagination.vue +4 -5
  62. package/dist/src/components/Parallax/OrigamParallaxElement.vue +1 -4
  63. package/dist/src/components/PasswordField/OrigamPasswordField.vue +9 -7
  64. package/dist/src/components/Radio/OrigamRadioBtn.vue +2 -3
  65. package/dist/src/components/RatingField/OrigamRatingField.vue +1 -2
  66. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +2 -3
  67. package/dist/src/components/Select/OrigamSelect.vue +135 -105
  68. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +7 -2
  69. package/dist/src/components/Slide/OrigamSlideGroup.vue +7 -10
  70. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +9 -10
  71. package/dist/src/components/Stepper/OrigamStepper.vue +7 -11
  72. package/dist/src/components/Stepper/OrigamStepperItem.vue +2 -3
  73. package/dist/src/components/Switch/OrigamSwitch.vue +0 -9
  74. package/dist/src/components/Tabs/OrigamTabs.vue +1 -1
  75. package/dist/src/components/TextField/OrigamTextField.vue +2 -5
  76. package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -2
  77. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +13 -14
  78. package/dist/src/components/Transition/OrigamExpandX.vue +4 -10
  79. package/dist/src/components/Transition/OrigamExpandY.vue +4 -10
  80. package/dist/src/components/Transition/OrigamSnack.vue +2 -8
  81. package/dist/src/components/Transition/OrigamTranslateScale.vue +4 -1
  82. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +24 -18
  83. package/dist/src/components/Video/OrigamVideo.vue +14 -19
  84. package/dist/src/components/Window/OrigamWindow.vue +4 -6
  85. package/dist/src/composables/Audio/use-waveform.composable.cjs +24 -19
  86. package/dist/src/composables/Audio/use-waveform.composable.js +24 -19
  87. package/dist/src/composables/Calendar/calendar.composable.cjs +11 -11
  88. package/dist/src/composables/Calendar/calendar.composable.js +1 -1
  89. package/dist/src/composables/Chart/chart.composable.cjs +541 -415
  90. package/dist/src/composables/Chart/chart.composable.d.ts +2 -5
  91. package/dist/src/composables/Chart/chart.composable.js +392 -338
  92. package/dist/src/composables/Code/code.composable.cjs +4 -4
  93. package/dist/src/composables/Code/code.composable.js +1 -1
  94. package/dist/src/composables/Commons/accessibleCommand.composable.cjs +2 -1
  95. package/dist/src/composables/Commons/accessibleCommand.composable.js +2 -1
  96. package/dist/src/composables/Commons/backButton.composable.cjs +14 -18
  97. package/dist/src/composables/Commons/backButton.composable.d.ts +4 -2
  98. package/dist/src/composables/Commons/backButton.composable.js +14 -18
  99. package/dist/src/composables/Commons/backgroundColor.composable.cjs +7 -3
  100. package/dist/src/composables/Commons/backgroundColor.composable.js +6 -3
  101. package/dist/src/composables/Commons/bothColor.composable.cjs +6 -2
  102. package/dist/src/composables/Commons/bothColor.composable.js +7 -4
  103. package/dist/src/composables/Commons/color.composable.cjs +106 -48
  104. package/dist/src/composables/Commons/color.composable.js +55 -48
  105. package/dist/src/composables/Commons/colorEffect.composable.cjs +2 -1
  106. package/dist/src/composables/Commons/colorEffect.composable.js +3 -1
  107. package/dist/src/composables/Commons/createLayout.composable.cjs +3 -2
  108. package/dist/src/composables/Commons/createLayout.composable.js +3 -2
  109. package/dist/src/composables/Commons/cssSupportClient.composable.d.ts +2 -1
  110. package/dist/src/composables/Commons/display.composable.cjs +7 -1
  111. package/dist/src/composables/Commons/display.composable.js +2 -2
  112. package/dist/src/composables/Commons/dragResizer.composable.cjs +16 -18
  113. package/dist/src/composables/Commons/dragResizer.composable.d.ts +2 -2
  114. package/dist/src/composables/Commons/dragResizer.composable.js +9 -11
  115. package/dist/src/composables/Commons/elevation.composable.cjs +2 -1
  116. package/dist/src/composables/Commons/elevation.composable.js +2 -1
  117. package/dist/src/composables/Commons/group.composable.cjs +17 -14
  118. package/dist/src/composables/Commons/group.composable.js +19 -15
  119. package/dist/src/composables/Commons/locationStrategies.composable.d.ts +1 -1
  120. package/dist/src/composables/Commons/nested.composable.cjs +16 -16
  121. package/dist/src/composables/Commons/nested.composable.d.ts +1 -1
  122. package/dist/src/composables/Commons/nested.composable.js +1 -1
  123. package/dist/src/composables/Commons/nestedItem.composable.cjs +3 -3
  124. package/dist/src/composables/Commons/nestedItem.composable.d.ts +1 -1
  125. package/dist/src/composables/Commons/nestedItem.composable.js +1 -1
  126. package/dist/src/composables/Commons/passedProps.composable.cjs +1 -1
  127. package/dist/src/composables/Commons/passedProps.composable.js +1 -1
  128. package/dist/src/composables/Commons/size.composable.cjs +1 -1
  129. package/dist/src/composables/Commons/size.composable.js +1 -1
  130. package/dist/src/composables/Commons/stateEffect.composable.cjs +54 -32
  131. package/dist/src/composables/Commons/stateEffect.composable.js +43 -33
  132. package/dist/src/composables/Commons/teleport.composable.cjs +2 -1
  133. package/dist/src/composables/Commons/teleport.composable.js +4 -1
  134. package/dist/src/composables/Commons/textColor.composable.cjs +7 -3
  135. package/dist/src/composables/Commons/textColor.composable.js +6 -3
  136. package/dist/src/composables/Commons/touch.composable.cjs +80 -20
  137. package/dist/src/composables/Commons/touch.composable.js +80 -20
  138. package/dist/src/composables/Commons/vModel.composable.cjs +1 -1
  139. package/dist/src/composables/Commons/vModel.composable.js +1 -1
  140. package/dist/src/composables/Commons/validation.composable.cjs +1 -1
  141. package/dist/src/composables/Commons/validation.composable.js +1 -1
  142. package/dist/src/composables/Commons/velocity.composable.cjs +5 -1
  143. package/dist/src/composables/Commons/velocity.composable.js +5 -1
  144. package/dist/src/composables/DataTable/headers.composable.cjs +36 -30
  145. package/dist/src/composables/DataTable/headers.composable.d.ts +1 -1
  146. package/dist/src/composables/DataTable/headers.composable.js +29 -23
  147. package/dist/src/composables/DataTable/headersCell.composable.cjs +2 -2
  148. package/dist/src/composables/DataTable/headersCell.composable.js +1 -1
  149. package/dist/src/composables/DataTable/select.composable.cjs +4 -4
  150. package/dist/src/composables/DataTable/select.composable.js +1 -1
  151. package/dist/src/composables/DataTable/sort.composable.cjs +6 -6
  152. package/dist/src/composables/DataTable/sort.composable.js +1 -1
  153. package/dist/src/composables/Form/form.composable.cjs +1 -1
  154. package/dist/src/composables/Form/form.composable.js +3 -1
  155. package/dist/src/composables/Masonry/masonry.composable.cjs +29 -20
  156. package/dist/src/composables/Masonry/masonry.composable.d.ts +0 -14
  157. package/dist/src/composables/Masonry/masonry.composable.js +29 -20
  158. package/dist/src/composables/NumberFormat/number-format.composable.cjs +28 -23
  159. package/dist/src/composables/NumberFormat/number-format.composable.js +28 -23
  160. package/dist/src/composables/Parallax/parallax.composable.cjs +11 -19
  161. package/dist/src/composables/Parallax/parallax.composable.js +5 -13
  162. package/dist/src/composables/Parallax/transform.composable.cjs +14 -13
  163. package/dist/src/composables/Parallax/transform.composable.js +2 -1
  164. package/dist/src/composables/PasswordField/passwordStrength.composable.cjs +2 -2
  165. package/dist/src/composables/PasswordField/passwordStrength.composable.js +1 -1
  166. package/dist/src/composables/QrCode/qr-code.composable.cjs +1 -1
  167. package/dist/src/composables/QrCode/qr-code.composable.js +1 -1
  168. package/dist/src/composables/Sheet/sheetSwipe.composable.cjs +3 -4
  169. package/dist/src/composables/Sheet/sheetSwipe.composable.js +4 -4
  170. package/dist/src/composables/TextareaField/textarea-field-rich.composable.cjs +31 -31
  171. package/dist/src/composables/TextareaField/textarea-field-rich.composable.js +1 -1
  172. package/dist/src/composables/Watermark/watermark.composable.cjs +1 -1
  173. package/dist/src/composables/Watermark/watermark.composable.js +1 -1
  174. package/dist/src/consts/Audio/audio.const.cjs +5 -4
  175. package/dist/src/consts/Audio/audio.const.d.ts +2 -1
  176. package/dist/src/consts/Audio/audio.const.js +2 -1
  177. package/dist/src/consts/Blockquote/blockquote.const.cjs +3 -3
  178. package/dist/src/consts/Blockquote/blockquote.const.js +1 -1
  179. package/dist/src/consts/Bracket/bracket.const.cjs +4 -3
  180. package/dist/src/consts/Bracket/bracket.const.js +2 -1
  181. package/dist/src/consts/Code/code.const.cjs +3 -3
  182. package/dist/src/consts/Code/code.const.d.ts +1 -1
  183. package/dist/src/consts/Code/code.const.js +1 -1
  184. package/dist/src/consts/Commons/autocomplete.const.cjs +2 -2
  185. package/dist/src/consts/Commons/autocomplete.const.d.ts +1 -1
  186. package/dist/src/consts/Commons/autocomplete.const.js +1 -1
  187. package/dist/src/consts/Commons/border.const.cjs +5 -1
  188. package/dist/src/consts/Commons/border.const.js +5 -1
  189. package/dist/src/consts/Commons/display.const.cjs +2 -2
  190. package/dist/src/consts/Commons/display.const.js +1 -1
  191. package/dist/src/consts/Commons/hotkey.const.cjs +2 -2
  192. package/dist/src/consts/Commons/hotkey.const.js +1 -1
  193. package/dist/src/consts/Commons/margin.const.cjs +1 -1
  194. package/dist/src/consts/Commons/margin.const.js +1 -1
  195. package/dist/src/consts/Commons/padding.const.cjs +1 -1
  196. package/dist/src/consts/Commons/padding.const.js +1 -1
  197. package/dist/src/consts/Commons/rounded.const.cjs +6 -2
  198. package/dist/src/consts/Commons/rounded.const.js +6 -2
  199. package/dist/src/consts/EmptyState/empty-state.const.cjs +12 -12
  200. package/dist/src/consts/EmptyState/empty-state.const.js +6 -6
  201. package/dist/src/consts/PasswordField/password-field.const.cjs +1 -1
  202. package/dist/src/consts/PasswordField/password-field.const.js +1 -1
  203. package/dist/src/consts/QrCode/qr-code.const.cjs +2 -2
  204. package/dist/src/consts/QrCode/qr-code.const.js +1 -1
  205. package/dist/src/consts/TextField/text-field.const.cjs +21 -21
  206. package/dist/src/consts/TextField/text-field.const.d.ts +1 -2
  207. package/dist/src/consts/TextField/text-field.const.js +1 -2
  208. package/dist/src/consts/TextareaField/textarea-field.const.cjs +32 -4
  209. package/dist/src/consts/TextareaField/textarea-field.const.d.ts +1 -0
  210. package/dist/src/consts/TextareaField/textarea-field.const.js +29 -1
  211. package/dist/src/directives/Contrast/contrast.directive.cjs +6 -4
  212. package/dist/src/directives/Contrast/contrast.directive.js +6 -4
  213. package/dist/src/directives/Intersect/intersect.directive.cjs +2 -1
  214. package/dist/src/directives/Intersect/intersect.directive.js +2 -1
  215. package/dist/src/enums/BottomNav/bottom-nav.enum.cjs +4 -5
  216. package/dist/src/enums/BottomNav/bottom-nav.enum.js +4 -5
  217. package/dist/src/interfaces/Blockquote/blockquote.interface.d.ts +1 -1
  218. package/dist/src/interfaces/Chart/chart-map.interface.d.ts +5 -4
  219. package/dist/src/interfaces/Chart/chart.interface.d.ts +70 -1
  220. package/dist/src/interfaces/ColorPicker/color-picker.interface.d.ts +1 -1
  221. package/dist/src/interfaces/Commons/activator.interface.d.ts +1 -1
  222. package/dist/src/interfaces/Commons/border.interface.d.ts +11 -10
  223. package/dist/src/interfaces/Commons/filters.interface.d.ts +7 -0
  224. package/dist/src/interfaces/Commons/margin.interface.d.ts +12 -11
  225. package/dist/src/interfaces/Commons/padding.interface.d.ts +12 -11
  226. package/dist/src/interfaces/Commons/ripple.interface.d.ts +1 -3
  227. package/dist/src/interfaces/Commons/rounded.interface.d.ts +10 -9
  228. package/dist/src/interfaces/DataTable/sort.interface.d.ts +6 -0
  229. package/dist/src/interfaces/Grid/grid.interface.d.ts +4 -4
  230. package/dist/src/interfaces/Parallax/parallax.interface.d.ts +3 -2
  231. package/dist/src/interfaces/SliderField/slider-field.interface.d.ts +4 -4
  232. package/dist/src/origam-core.cjs +52 -34
  233. package/dist/src/origam-core.js +22 -28
  234. package/dist/src/types/Commons/box-value.type.cjs +1 -0
  235. package/dist/src/types/Commons/box-value.type.d.ts +1 -0
  236. package/dist/src/types/Commons/box-value.type.js +0 -0
  237. package/dist/src/types/Commons/location.type.d.ts +13 -0
  238. package/dist/src/types/Commons/point.type.d.ts +1 -1
  239. package/dist/src/types/DataTable/data-table.type.d.ts +1 -0
  240. package/dist/src/types/Grid/grid.type.d.ts +7 -0
  241. package/dist/src/types/Grids/row.type.d.ts +2 -1
  242. package/dist/src/types/Parallax/parallax.type.d.ts +1 -2
  243. package/dist/src/types/SliderField/slider-field.type.d.ts +8 -0
  244. package/dist/src/types/TextField/text-field.type.d.ts +2 -1
  245. package/dist/src/utils/Bracket/bracket-surface.util.cjs +9 -2
  246. package/dist/src/utils/Bracket/bracket-surface.util.js +9 -2
  247. package/dist/src/utils/Calendar/rrule.util.cjs +12 -7
  248. package/dist/src/utils/Calendar/rrule.util.js +12 -7
  249. package/dist/src/utils/Chart/chart-point.util.cjs +15 -0
  250. package/dist/src/utils/Chart/chart-point.util.d.ts +11 -0
  251. package/dist/src/utils/Chart/chart-point.util.js +8 -0
  252. package/dist/src/utils/Chart/sankey-layout.util.cjs +144 -0
  253. package/dist/src/utils/Chart/sankey-layout.util.d.ts +27 -0
  254. package/dist/src/utils/Chart/sankey-layout.util.js +130 -0
  255. package/dist/src/utils/Code/parse-highlight-lines.util.cjs +17 -14
  256. package/dist/src/utils/Code/parse-highlight-lines.util.js +17 -14
  257. package/dist/src/utils/CommandPalette/fuzzy-match.util.cjs +13 -9
  258. package/dist/src/utils/CommandPalette/fuzzy-match.util.js +13 -9
  259. package/dist/src/utils/Commons/anchor.util.cjs +6 -1
  260. package/dist/src/utils/Commons/anchor.util.js +6 -1
  261. package/dist/src/utils/Commons/animation.util.cjs +7 -4
  262. package/dist/src/utils/Commons/animation.util.js +4 -1
  263. package/dist/src/utils/Commons/apply-mask.util.cjs +11 -14
  264. package/dist/src/utils/Commons/apply-mask.util.js +7 -10
  265. package/dist/src/utils/Commons/apply-theme.util.cjs +6 -4
  266. package/dist/src/utils/Commons/apply-theme.util.js +6 -4
  267. package/dist/src/utils/Commons/bindProps.util.cjs +3 -5
  268. package/dist/src/utils/Commons/bindProps.util.js +3 -5
  269. package/dist/src/utils/Commons/color.util.cjs +43 -36
  270. package/dist/src/utils/Commons/color.util.js +44 -31
  271. package/dist/src/utils/Commons/commons.util.cjs +3 -3
  272. package/dist/src/utils/Commons/commons.util.js +3 -3
  273. package/dist/src/utils/Commons/console.util.cjs +6 -0
  274. package/dist/src/utils/Commons/console.util.d.ts +11 -0
  275. package/dist/src/utils/Commons/console.util.js +5 -0
  276. package/dist/src/utils/Commons/date.util.cjs +2 -27
  277. package/dist/src/utils/Commons/date.util.js +2 -27
  278. package/dist/src/utils/Commons/display.util.cjs +10 -1
  279. package/dist/src/utils/Commons/display.util.d.ts +8 -1
  280. package/dist/src/utils/Commons/display.util.js +9 -1
  281. package/dist/src/utils/Commons/eventListener.util.cjs +1 -2
  282. package/dist/src/utils/Commons/eventListener.util.js +1 -2
  283. package/dist/src/utils/Commons/filters.util.cjs +48 -34
  284. package/dist/src/utils/Commons/filters.util.d.ts +3 -8
  285. package/dist/src/utils/Commons/filters.util.js +47 -34
  286. package/dist/src/utils/Commons/forwardRefs.util.cjs +44 -40
  287. package/dist/src/utils/Commons/forwardRefs.util.js +44 -40
  288. package/dist/src/utils/Commons/group.util.cjs +1 -1
  289. package/dist/src/utils/Commons/group.util.js +1 -1
  290. package/dist/src/utils/Commons/hotkey.util.cjs +65 -61
  291. package/dist/src/utils/Commons/hotkey.util.js +56 -53
  292. package/dist/src/utils/Commons/hover.util.cjs +2 -2
  293. package/dist/src/utils/Commons/hover.util.js +2 -2
  294. package/dist/src/utils/Commons/locale.util.cjs +1 -1
  295. package/dist/src/utils/Commons/locale.util.js +1 -1
  296. package/dist/src/utils/Commons/location.util.cjs +87 -92
  297. package/dist/src/utils/Commons/location.util.js +75 -83
  298. package/dist/src/utils/Commons/nested.util.cjs +12 -10
  299. package/dist/src/utils/Commons/nested.util.js +5 -2
  300. package/dist/src/utils/Commons/point.util.cjs +16 -14
  301. package/dist/src/utils/Commons/point.util.js +13 -8
  302. package/dist/src/utils/Commons/ripple.util.cjs +4 -4
  303. package/dist/src/utils/Commons/ripple.util.js +4 -4
  304. package/dist/src/utils/Commons/scroll.util.cjs +9 -6
  305. package/dist/src/utils/Commons/scroll.util.js +9 -6
  306. package/dist/src/utils/Commons/spacing.util.cjs +1 -1
  307. package/dist/src/utils/Commons/spacing.util.js +1 -1
  308. package/dist/src/utils/Commons/token-name.util.cjs +31 -27
  309. package/dist/src/utils/Commons/token-name.util.js +31 -27
  310. package/dist/src/utils/Commons/validate-pattern.util.cjs +6 -6
  311. package/dist/src/utils/Commons/validate-pattern.util.js +1 -1
  312. package/dist/src/utils/DataTable/headers.util.cjs +20 -26
  313. package/dist/src/utils/DataTable/headers.util.js +18 -26
  314. package/dist/src/utils/DataTable/sort.util.cjs +41 -47
  315. package/dist/src/utils/DataTable/sort.util.d.ts +2 -7
  316. package/dist/src/utils/DataTable/sort.util.js +49 -47
  317. package/dist/src/utils/List/list-item.util.cjs +6 -1
  318. package/dist/src/utils/List/list-item.util.js +6 -1
  319. package/dist/src/utils/Parallax/parallax-element.util.cjs +13 -14
  320. package/dist/src/utils/Parallax/parallax-element.util.js +10 -11
  321. package/dist/src/utils/Slide/slide-group.util.cjs +4 -4
  322. package/dist/src/utils/Slide/slide-group.util.js +4 -4
  323. package/dist/src/utils/TextareaField/html-to-markdown.util.cjs +5 -36
  324. package/dist/src/utils/TextareaField/html-to-markdown.util.js +5 -36
  325. package/dist/src/utils/TextareaField/sanitize-html.util.cjs +18 -22
  326. package/dist/src/utils/TextareaField/sanitize-html.util.js +19 -23
  327. package/dist/src/utils/index.cjs +11 -0
  328. package/dist/src/utils/index.d.ts +1 -0
  329. package/dist/src/utils/index.js +1 -0
  330. package/package.json +1 -1
@@ -2,7 +2,8 @@ import {
2
2
  computed,
3
3
  ref
4
4
  } from "vue";
5
- import { CHART_SMOOTHING, CHART_STACKING, CHART_TYPE, INTENT } from "../../enums/index.js";
5
+ import { CHART_SMOOTHING, CHART_STACKING, CHART_TYPE } from "../../enums/Chart/chart.enum.js";
6
+ import { INTENT } from "../../enums/Commons/intent.enum.js";
6
7
  import {
7
8
  arcPath,
8
9
  areaPath,
@@ -247,28 +248,30 @@ const computeYRange = (series, stacked, stacking, yMinOverride, yMaxOverride) =>
247
248
  if (stacked && stacking === CHART_STACKING.PERCENT) {
248
249
  return { min: CHART_PERCENT_MIN, max: CHART_PERCENT_MAX };
249
250
  }
250
- if (stacked) {
251
- const dataLengths = visible.map((s) => s.data.length);
252
- const maxLength = Math.max(...dataLengths);
253
- let stackMax = 0;
254
- let stackMin = 0;
255
- for (let i = 0; i < maxLength; i++) {
256
- let positive = 0;
257
- let negative = 0;
258
- for (const s of visible) {
259
- const entry = s.data[i];
260
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
261
- if (y >= 0) positive += y;
262
- else negative += y;
263
- }
264
- stackMax = Math.max(stackMax, positive);
265
- stackMin = Math.min(stackMin, negative);
251
+ return stacked ? stackedYRange(visible, yMinOverride, yMaxOverride) : plainYRange(visible, yMinOverride, yMaxOverride);
252
+ };
253
+ const entryValue = (entry) => typeof entry === "number" ? entry : entry?.y ?? 0;
254
+ const stackedYRange = (visible, yMinOverride, yMaxOverride) => {
255
+ const maxLength = Math.max(...visible.map((s) => s.data.length));
256
+ let stackMax = 0;
257
+ let stackMin = 0;
258
+ for (let i = 0; i < maxLength; i++) {
259
+ let positive = 0;
260
+ let negative = 0;
261
+ for (const s of visible) {
262
+ const y = entryValue(s.data[i]);
263
+ if (y >= 0) positive += y;
264
+ else negative += y;
266
265
  }
267
- return {
268
- min: yMinOverride ?? stackMin,
269
- max: yMaxOverride ?? stackMax
270
- };
266
+ stackMax = Math.max(stackMax, positive);
267
+ stackMin = Math.min(stackMin, negative);
271
268
  }
269
+ return {
270
+ min: yMinOverride ?? stackMin,
271
+ max: yMaxOverride ?? stackMax
272
+ };
273
+ };
274
+ const dataYExtent = (visible) => {
272
275
  let min = Number.POSITIVE_INFINITY;
273
276
  let max = Number.NEGATIVE_INFINITY;
274
277
  for (const s of visible) {
@@ -278,6 +281,10 @@ const computeYRange = (series, stacked, stacking, yMinOverride, yMaxOverride) =>
278
281
  if (y > max) max = y;
279
282
  }
280
283
  }
284
+ return { min, max };
285
+ };
286
+ const plainYRange = (visible, yMinOverride, yMaxOverride) => {
287
+ let { min, max } = dataYExtent(visible);
281
288
  if (!Number.isFinite(min)) min = 0;
282
289
  if (!Number.isFinite(max)) max = 1;
283
290
  if (min === max) {
@@ -288,6 +295,282 @@ const computeYRange = (series, stacked, stacking, yMinOverride, yMaxOverride) =>
288
295
  max: yMaxOverride ?? max
289
296
  };
290
297
  };
298
+ const indexVisibleSeries = (series) => series.map((s, i) => ({ s, i })).filter(({ s }) => s.visible !== false);
299
+ const maxDataLength = (visible) => Math.max(...visible.map(({ s }) => s.data.length), 0);
300
+ const positiveColumnTotal = (visible, dataIdx) => {
301
+ let total = 0;
302
+ for (const { s } of visible) {
303
+ const y = entryValue(s.data[dataIdx]);
304
+ if (y > 0) total += y;
305
+ }
306
+ return total;
307
+ };
308
+ const setSeriesSlot = (map, seriesIdx, dataIdx, value) => {
309
+ if (!map.has(seriesIdx)) map.set(seriesIdx, []);
310
+ map.get(seriesIdx)[dataIdx] = value;
311
+ };
312
+ const fillPercentStackOffsets = (offsets, visible) => {
313
+ const length = maxDataLength(visible);
314
+ for (let dataIdx = 0; dataIdx < length; dataIdx++) {
315
+ const safeTot = positiveColumnTotal(visible, dataIdx) || 1;
316
+ let runningPct = 0;
317
+ for (const { s, i } of visible) {
318
+ const y = entryValue(s.data[dataIdx]);
319
+ setSeriesSlot(offsets, i, dataIdx, runningPct);
320
+ if (y > 0) runningPct += y / safeTot * CHART_PERCENT_MAX;
321
+ }
322
+ }
323
+ };
324
+ const fillSignedStackOffsets = (offsets, visible) => {
325
+ const length = maxDataLength(visible);
326
+ for (let dataIdx = 0; dataIdx < length; dataIdx++) {
327
+ let runningPositive = 0;
328
+ let runningNegative = 0;
329
+ for (const { s, i } of visible) {
330
+ const y = entryValue(s.data[dataIdx]);
331
+ setSeriesSlot(offsets, i, dataIdx, y >= 0 ? runningPositive : runningNegative);
332
+ if (y >= 0) runningPositive += y;
333
+ else runningNegative += y;
334
+ }
335
+ }
336
+ };
337
+ const isLineFamily = (kind) => kind === CHART_TYPE.LINE || kind === CHART_TYPE.AREA || kind === CHART_TYPE.SPLINE || kind === CHART_TYPE.STEPPED_LINE;
338
+ const lineGeometry = (kind, smoothing, pts) => {
339
+ if (kind === CHART_TYPE.STEPPED_LINE) return { dLine: steppedPath(pts), areaMode: "stepped" };
340
+ const effectiveSmoothing = kind === CHART_TYPE.SPLINE && smoothing === CHART_SMOOTHING.NONE ? CHART_SMOOTHING.MONOTONE : smoothing;
341
+ if (effectiveSmoothing === CHART_SMOOTHING.MONOTONE) return { dLine: monotonePath(pts), areaMode: "monotone" };
342
+ if (effectiveSmoothing === CHART_SMOOTHING.CURVE) return { dLine: smoothPath(pts), areaMode: true };
343
+ return { dLine: linePath(pts), areaMode: false };
344
+ };
345
+ const pushLinePaths = (out, frame) => {
346
+ const { series, seriesIdx, color, kind, pts, smoothing, baseline } = frame;
347
+ const { dLine, areaMode } = lineGeometry(kind, smoothing, pts);
348
+ const length = kind === CHART_TYPE.STEPPED_LINE ? steppedPathLength(pts) : computePathLength(pts);
349
+ if (kind === CHART_TYPE.AREA) {
350
+ out.push({
351
+ seriesIndex: seriesIdx,
352
+ kind: "path",
353
+ d: areaPath(pts, baseline, areaMode),
354
+ color,
355
+ series,
356
+ pathLength: length,
357
+ variant: "fill"
358
+ });
359
+ }
360
+ out.push({
361
+ seriesIndex: seriesIdx,
362
+ kind: "path",
363
+ d: dLine,
364
+ color,
365
+ series,
366
+ pathLength: length,
367
+ variant: kind === CHART_TYPE.AREA ? "stroke" : void 0
368
+ });
369
+ for (let dataIdx = 0; dataIdx < pts.length; dataIdx++) {
370
+ out.push({
371
+ seriesIndex: seriesIdx,
372
+ kind: "circle",
373
+ circle: {
374
+ cx: pts[dataIdx][0],
375
+ cy: pts[dataIdx][1],
376
+ r: CHART_POINT_MARKER_RADIUS
377
+ },
378
+ color,
379
+ series,
380
+ dataIndex: dataIdx
381
+ });
382
+ }
383
+ };
384
+ const projectToPlotX = (v, min, span, x0, x1) => {
385
+ const ratio = (v - min) / span;
386
+ const px = x0 + ratio * (x1 - x0);
387
+ if (px < x0) return x0;
388
+ if (px > x1) return x1;
389
+ return px;
390
+ };
391
+ const barThickness = (frame, slotPx) => frame.stacked ? slotPx * CHART_BAR_SLOT_FILL_RATIO : slotPx * CHART_BAR_SLOT_FILL_RATIO / Math.max(1, frame.visibleCount);
392
+ const barBandStart = (frame, slotCenter, slotPx, thickness) => frame.stacked ? slotCenter - thickness / 2 : slotCenter - slotPx * CHART_BAR_SLOT_FILL_RATIO / 2 + frame.visibleIdxInGroup * thickness;
393
+ const columnRect = (frame, dataIdx, slotPx, renderY, offset) => {
394
+ const centerX = frame.plot.x0 + (dataIdx + 0.5) * slotPx;
395
+ const barWidth = barThickness(frame, slotPx);
396
+ const top = frame.yFn(renderY + offset);
397
+ const base = frame.yFn(offset);
398
+ return {
399
+ x: barBandStart(frame, centerX, slotPx, barWidth),
400
+ y: Math.min(top, base),
401
+ width: barWidth,
402
+ height: Math.abs(base - top)
403
+ };
404
+ };
405
+ const horizontalBarRect = (frame, dataIdx, slotPx, renderY, offset, horizSpan) => {
406
+ const { x0, x1, y0, y1 } = frame.plot;
407
+ const slots = Math.max(1, frame.groupCount);
408
+ const slotCenterY = slots === 1 ? (y0 + y1) / 2 : y0 + (dataIdx + 0.5) * slotPx;
409
+ const barHeight = barThickness(frame, slotPx);
410
+ const rightPx = projectToPlotX(renderY + offset, frame.yRange.min, horizSpan, x0, x1);
411
+ const basePx = projectToPlotX(offset, frame.yRange.min, horizSpan, x0, x1);
412
+ return {
413
+ x: Math.min(rightPx, basePx),
414
+ y: barBandStart(frame, slotCenterY, slotPx, barHeight),
415
+ width: Math.abs(rightPx - basePx),
416
+ height: barHeight
417
+ };
418
+ };
419
+ const pushBarPaths = (out, frame) => {
420
+ const { plot, kind, groupCount, series, seriesIdx, color, normalised, stacked, isPercent } = frame;
421
+ const slotPx = kind === CHART_TYPE.COLUMN ? (plot.x1 - plot.x0) / Math.max(1, groupCount) : (plot.y1 - plot.y0) / Math.max(1, groupCount);
422
+ const horizSpan = Math.max(CHART_EPSILON, frame.yRange.max - frame.yRange.min);
423
+ for (let dataIdx = 0; dataIdx < normalised.length; dataIdx++) {
424
+ const renderY = isPercent ? frame.percentShares?.[dataIdx] ?? 0 : normalised[dataIdx].y;
425
+ const offset = stacked ? frame.stackOffsets[dataIdx] ?? 0 : 0;
426
+ out.push({
427
+ seriesIndex: seriesIdx,
428
+ kind: "rect",
429
+ rect: kind === CHART_TYPE.COLUMN ? columnRect(frame, dataIdx, slotPx, renderY, offset) : horizontalBarRect(frame, dataIdx, slotPx, renderY, offset, horizSpan),
430
+ color,
431
+ series,
432
+ dataIndex: dataIdx
433
+ });
434
+ }
435
+ };
436
+ const scatterX = (entry) => {
437
+ const xv = typeof entry === "number" ? entry : entry.x;
438
+ return typeof xv === "number" ? xv : 0;
439
+ };
440
+ const scatterZ = (entry) => typeof entry !== "number" && typeof entry.z === "number" && Number.isFinite(entry.z) ? entry.z : void 0;
441
+ const boundsOf = (values) => {
442
+ let min = Infinity;
443
+ let max = -Infinity;
444
+ for (const v of values) {
445
+ if (v < min) min = v;
446
+ if (v > max) max = v;
447
+ }
448
+ return { min, max };
449
+ };
450
+ const scatterExtent = (scatterSeries) => {
451
+ const entries = scatterSeries.flatMap((sp) => [...sp.data]);
452
+ const { min: xMin, max: xMax } = boundsOf(entries.map(scatterX));
453
+ const zs = entries.map(scatterZ).filter((z) => z !== void 0);
454
+ const { min: zMin, max: zMax } = boundsOf(zs);
455
+ return { xMin, xMax, zMin, zMax, hasZ: zs.length > 0 };
456
+ };
457
+ const pushScatterPaths = (out, frame) => {
458
+ const { plot, series, seriesIdx, color, normalised, yFn } = frame;
459
+ const { xMin, xMax, zMin, zMax, hasZ } = scatterExtent(frame.scatterSeries);
460
+ const xSpan = Math.max(CHART_EPSILON, xMax - xMin);
461
+ const zSpan = Math.max(CHART_EPSILON, zMax - zMin);
462
+ const radiusFor = (z) => {
463
+ if (!hasZ || typeof z !== "number" || !Number.isFinite(z)) return CHART_SCATTER_DEFAULT_RADIUS;
464
+ const ratio = zSpan === 0 ? 0.5 : (z - zMin) / zSpan;
465
+ return CHART_SCATTER_MIN_RADIUS + ratio * (CHART_SCATTER_MAX_RADIUS - CHART_SCATTER_MIN_RADIUS);
466
+ };
467
+ for (let dataIdx = 0; dataIdx < normalised.length; dataIdx++) {
468
+ const p = normalised[dataIdx];
469
+ const cxRaw = typeof p.x === "number" ? p.x : Number(p.x);
470
+ out.push({
471
+ seriesIndex: seriesIdx,
472
+ kind: "circle",
473
+ circle: {
474
+ cx: projectToPlotX(Number.isFinite(cxRaw) ? cxRaw : 0, xMin, xSpan, plot.x0, plot.x1),
475
+ cy: yFn(p.y),
476
+ r: radiusFor(p.z)
477
+ },
478
+ color,
479
+ series,
480
+ dataIndex: dataIdx
481
+ });
482
+ }
483
+ };
484
+ const pushRadarPaths = (out, frame) => {
485
+ const { plot, axes, series, seriesIdx, color, normalised, yRange } = frame;
486
+ if (!axes) return;
487
+ const radius = Math.max(
488
+ CHART_RADAR_MIN_RADIUS,
489
+ Math.min(plot.x1 - plot.x0, plot.y1 - plot.y0) / 2 - CHART_RADAR_RADIUS_INSET
490
+ );
491
+ const pts = normalised.map((p, i) => {
492
+ const yRangeSize = Math.max(CHART_EPSILON, yRange.max - yRange.min);
493
+ const ratio = (p.y - yRange.min) / yRangeSize;
494
+ const angle = i / axes * Math.PI * 2;
495
+ return polarToCartesian(plot.cx, plot.cy, radius * ratio, angle);
496
+ });
497
+ out.push({
498
+ seriesIndex: seriesIdx,
499
+ kind: "polygon",
500
+ d: polygonPath(pts),
501
+ color,
502
+ series
503
+ });
504
+ for (let i = 0; i < pts.length; i++) {
505
+ out.push({
506
+ seriesIndex: seriesIdx,
507
+ kind: "circle",
508
+ circle: { cx: pts[i][0], cy: pts[i][1], r: CHART_RADAR_MARKER_RADIUS },
509
+ color,
510
+ series,
511
+ dataIndex: i
512
+ });
513
+ }
514
+ };
515
+ const pieSliceLabel = (cats, i, entry) => {
516
+ if (cats[i] != null) return String(cats[i]);
517
+ if (entry != null && typeof entry === "object") return String(entry.x);
518
+ return `${CHART_SLICE_LABEL_PREFIX} ${i + 1}`;
519
+ };
520
+ const pieSliceColor = (scheme, dataIdx, series) => {
521
+ if (series.color) return resolveColor(series.color);
522
+ return resolveColor(scheme[dataIdx % scheme.length]);
523
+ };
524
+ const pieRingSlices = (data, isSingleRing, hidden, cats) => {
525
+ const slices = [];
526
+ for (let i = 0; i < data.length; i++) {
527
+ const entry = data[i];
528
+ if (isSingleRing && hidden.has(pieSliceLabel(cats, i, entry))) continue;
529
+ const v = entryValue(entry);
530
+ if (Number.isFinite(v) && v > 0) slices.push({ v, i });
531
+ }
532
+ return slices;
533
+ };
534
+ const buildPiePaths = (frame) => {
535
+ const out = [];
536
+ const { plot, series, scheme, hidden } = frame;
537
+ const outerR = Math.max(
538
+ CHART_PIE_MIN_RADIUS,
539
+ Math.min(plot.x1 - plot.x0, plot.y1 - plot.y0) / 2 - CHART_PIE_RADIUS_INSET
540
+ );
541
+ const baseInner = frame.isDonut ? outerR * frame.donutHoleSize : 0;
542
+ const visibleSeries = frame.pieSeriesList.filter((s) => s.visible !== false);
543
+ if (visibleSeries.length === 0) return out;
544
+ const bandThickness = (outerR - baseInner) / visibleSeries.length;
545
+ const isSingleRing = visibleSeries.length === 1;
546
+ for (let ringIdx = 0; ringIdx < visibleSeries.length; ringIdx++) {
547
+ const s = visibleSeries[ringIdx];
548
+ const ringInner = baseInner + bandThickness * ringIdx;
549
+ const ringOuter = baseInner + bandThickness * (ringIdx + 1);
550
+ const slices = pieRingSlices(
551
+ s.data,
552
+ isSingleRing,
553
+ hidden,
554
+ frame.categories
555
+ );
556
+ const ringTotal = slices.reduce((acc, { v }) => acc + v, 0);
557
+ if (ringTotal === 0) continue;
558
+ let angle = 0;
559
+ for (const { v, i } of slices) {
560
+ const endAngle = angle + v / ringTotal * Math.PI * 2;
561
+ out.push({
562
+ seriesIndex: series.indexOf(s),
563
+ kind: "path",
564
+ d: arcPath(plot.cx, plot.cy, ringOuter, ringInner, angle, endAngle),
565
+ color: pieSliceColor(scheme, i, s),
566
+ series: s,
567
+ dataIndex: i
568
+ });
569
+ angle = endAngle;
570
+ }
571
+ }
572
+ return out;
573
+ };
291
574
  const niceStep = (range, count) => {
292
575
  if (range <= 0 || count <= 0) return 1;
293
576
  const rough = range / count;
@@ -491,345 +774,116 @@ export const useChart = (options) => {
491
774
  const stackOffsets = computed(() => {
492
775
  const offsets = /* @__PURE__ */ new Map();
493
776
  if (!options.stacked()) return offsets;
494
- const isPercent = effectiveStacking.value === CHART_STACKING.PERCENT;
495
- const visible = options.series().map((s, i) => ({ s, i })).filter(({ s }) => s.visible !== false);
496
- const length = Math.max(...visible.map(({ s }) => s.data.length), 0);
497
- if (isPercent) {
498
- for (let dataIdx = 0; dataIdx < length; dataIdx++) {
499
- let total = 0;
500
- for (const { s } of visible) {
501
- const entry = s.data[dataIdx];
502
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
503
- if (y > 0) total += y;
504
- }
505
- const safeTot = total || 1;
506
- let runningPct = 0;
507
- for (const { s, i } of visible) {
508
- const entry = s.data[dataIdx];
509
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
510
- if (!offsets.has(i)) offsets.set(i, []);
511
- offsets.get(i)[dataIdx] = runningPct;
512
- if (y > 0) runningPct += y / safeTot * CHART_PERCENT_MAX;
513
- }
514
- }
777
+ const visible = indexVisibleSeries(options.series());
778
+ if (effectiveStacking.value === CHART_STACKING.PERCENT) {
779
+ fillPercentStackOffsets(offsets, visible);
515
780
  } else {
516
- for (let dataIdx = 0; dataIdx < length; dataIdx++) {
517
- let runningPositive = 0;
518
- let runningNegative = 0;
519
- for (const { s, i } of visible) {
520
- const entry = s.data[dataIdx];
521
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
522
- if (!offsets.has(i)) offsets.set(i, []);
523
- offsets.get(i)[dataIdx] = y >= 0 ? runningPositive : runningNegative;
524
- if (y >= 0) runningPositive += y;
525
- else runningNegative += y;
526
- }
527
- }
781
+ fillSignedStackOffsets(offsets, visible);
528
782
  }
529
783
  return offsets;
530
784
  });
531
785
  const percentValues = computed(() => {
532
786
  const pctMap = /* @__PURE__ */ new Map();
533
787
  if (!options.stacked() || effectiveStacking.value !== CHART_STACKING.PERCENT) return pctMap;
534
- const visible = options.series().map((s, i) => ({ s, i })).filter(({ s }) => s.visible !== false);
535
- const length = Math.max(...visible.map(({ s }) => s.data.length), 0);
788
+ const visible = indexVisibleSeries(options.series());
789
+ const length = maxDataLength(visible);
536
790
  for (let dataIdx = 0; dataIdx < length; dataIdx++) {
537
- let total = 0;
538
- for (const { s } of visible) {
539
- const entry = s.data[dataIdx];
540
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
541
- if (y > 0) total += y;
542
- }
543
- const safeTot = total || 1;
791
+ const safeTot = positiveColumnTotal(visible, dataIdx) || 1;
544
792
  for (const { s, i } of visible) {
545
- const entry = s.data[dataIdx];
546
- const y = typeof entry === "number" ? entry : entry?.y ?? 0;
547
- if (!pctMap.has(i)) pctMap.set(i, []);
548
- pctMap.get(i)[dataIdx] = y > 0 ? y / safeTot * CHART_PERCENT_MAX : 0;
793
+ const y = entryValue(s.data[dataIdx]);
794
+ setSeriesSlot(pctMap, i, dataIdx, y > 0 ? y / safeTot * CHART_PERCENT_MAX : 0);
549
795
  }
550
796
  }
551
797
  return pctMap;
552
798
  });
799
+ const pushSeriesPaths = (out, series, seriesIdx, cats, smoothing) => {
800
+ const s = series[seriesIdx];
801
+ if (s.visible === false) return;
802
+ const plotRect = plot.value;
803
+ const kind = effectiveType(s);
804
+ const normalised = toPoints(s);
805
+ const onSecondaryAxis = (s.yAxis ?? 0) === 1;
806
+ const yFn = onSecondaryAxis ? scaleY1.value : scales.value.y;
807
+ const seriesRange = onSecondaryAxis ? secondaryYRange.value : yRange.value;
808
+ const frame = {
809
+ series: s,
810
+ seriesIdx,
811
+ color: colorFor(s, seriesIdx),
812
+ kind,
813
+ normalised,
814
+ yFn
815
+ };
816
+ if (isLineFamily(kind)) {
817
+ const linePathFrame = {
818
+ ...frame,
819
+ pts: normalised.map((p) => [
820
+ scales.value.x(p.x, p.dataIndex, slotCount.value),
821
+ yFn(p.y)
822
+ ]),
823
+ smoothing,
824
+ baseline: yFn(Math.max(0, seriesRange.min))
825
+ };
826
+ pushLinePaths(out, linePathFrame);
827
+ return;
828
+ }
829
+ if (kind === CHART_TYPE.BAR || kind === CHART_TYPE.COLUMN) {
830
+ const stacked = options.stacked();
831
+ const barFrame = {
832
+ ...frame,
833
+ plot: plotRect,
834
+ groupCount: slotCount.value,
835
+ visibleCount: series.filter((other) => other.visible !== false).length,
836
+ visibleIdxInGroup: series.slice(0, seriesIdx).filter((other) => other.visible !== false).length,
837
+ stacked,
838
+ isPercent: stacked && effectiveStacking.value === CHART_STACKING.PERCENT,
839
+ stackOffsets: stackOffsets.value.get(seriesIdx) ?? [],
840
+ percentShares: percentValues.value.get(seriesIdx),
841
+ yRange: yRange.value
842
+ };
843
+ pushBarPaths(out, barFrame);
844
+ return;
845
+ }
846
+ if (kind === CHART_TYPE.SCATTER) {
847
+ const scatterFrame = {
848
+ ...frame,
849
+ plot: plotRect,
850
+ scatterSeries: series.filter((other) => effectiveType(other) === CHART_TYPE.SCATTER && other.visible !== false)
851
+ };
852
+ pushScatterPaths(out, scatterFrame);
853
+ return;
854
+ }
855
+ if (kind === CHART_TYPE.RADAR) {
856
+ const radarFrame = {
857
+ ...frame,
858
+ plot: plotRect,
859
+ axes: Math.max(cats.length, normalised.length),
860
+ yRange: yRange.value
861
+ };
862
+ pushRadarPaths(out, radarFrame);
863
+ }
864
+ };
553
865
  const paths = computed(() => {
554
- const out = [];
555
866
  const series = options.series();
556
867
  const cats = categories.value;
557
- const { x0, x1, y0, y1, cx, cy } = plot.value;
868
+ const plotRect = plot.value;
558
869
  const smoothing = options.smoothing();
559
870
  const pieSeriesList = series.filter((s) => effectiveType(s) === CHART_TYPE.PIE || effectiveType(s) === CHART_TYPE.DONUT);
560
871
  if (pieSeriesList.length > 0) {
561
- const outerR = Math.max(
562
- CHART_PIE_MIN_RADIUS,
563
- Math.min(x1 - x0, y1 - y0) / 2 - CHART_PIE_RADIUS_INSET
564
- );
565
872
  const isDonut = effectiveType(pieSeriesList[0]) === CHART_TYPE.DONUT;
566
- const baseInner = isDonut ? outerR * options.donutHoleSize() : 0;
567
- const scheme = options.colorScheme().length ? options.colorScheme() : CHART_DEFAULT_PALETTE;
568
- const visibleSeries = pieSeriesList.filter((s) => s.visible !== false);
569
- if (visibleSeries.length === 0) return out;
570
- const bandThickness = (outerR - baseInner) / visibleSeries.length;
571
- const hidden = options.hiddenLabels?.() ?? /* @__PURE__ */ new Set();
572
- const cats2 = options.categories();
573
- const isSingleRing = visibleSeries.length === 1;
574
- const categoryColor = (dataIdx, fallbackSeries) => {
575
- if (fallbackSeries.color) return resolveColor(fallbackSeries.color);
576
- return resolveColor(scheme[dataIdx % scheme.length]);
577
- };
578
- const labelFor = (i, entry) => {
579
- if (cats2[i] != null) return String(cats2[i]);
580
- if (entry != null && typeof entry === "object") return String(entry.x);
581
- return `${CHART_SLICE_LABEL_PREFIX} ${i + 1}`;
582
- };
583
- for (let ringIdx = 0; ringIdx < visibleSeries.length; ringIdx++) {
584
- const s = visibleSeries[ringIdx];
585
- const ringInner = baseInner + bandThickness * ringIdx;
586
- const ringOuter = baseInner + bandThickness * (ringIdx + 1);
587
- const data = s.data;
588
- const ringTotal = data.reduce((acc, entry, i) => {
589
- if (isSingleRing && hidden.has(labelFor(i, entry))) return acc;
590
- const v = typeof entry === "number" ? entry : entry?.y ?? 0;
591
- return acc + (Number.isFinite(v) && v > 0 ? v : 0);
592
- }, 0);
593
- if (ringTotal === 0) continue;
594
- let angle = 0;
595
- for (let i = 0; i < data.length; i++) {
596
- const entry = data[i];
597
- if (isSingleRing && hidden.has(labelFor(i, entry))) continue;
598
- const v = typeof entry === "number" ? entry : entry?.y ?? 0;
599
- if (!Number.isFinite(v) || v <= 0) continue;
600
- const sweep = v / ringTotal * Math.PI * 2;
601
- const endAngle = angle + sweep;
602
- out.push({
603
- seriesIndex: series.indexOf(s),
604
- kind: "path",
605
- d: arcPath(cx, cy, ringOuter, ringInner, angle, endAngle),
606
- color: categoryColor(i, s),
607
- series: s,
608
- dataIndex: i
609
- });
610
- angle = endAngle;
611
- }
612
- }
613
- return out;
873
+ return buildPiePaths({
874
+ series,
875
+ pieSeriesList,
876
+ plot: plotRect,
877
+ isDonut,
878
+ donutHoleSize: isDonut ? options.donutHoleSize() : 0,
879
+ scheme: options.colorScheme().length ? options.colorScheme() : CHART_DEFAULT_PALETTE,
880
+ hidden: options.hiddenLabels?.() ?? /* @__PURE__ */ new Set(),
881
+ categories: options.categories()
882
+ });
614
883
  }
884
+ const out = [];
615
885
  for (let seriesIdx = 0; seriesIdx < series.length; seriesIdx++) {
616
- const s = series[seriesIdx];
617
- if (s.visible === false) continue;
618
- const color = colorFor(s, seriesIdx);
619
- const kind = effectiveType(s);
620
- const normalised = toPoints(s);
621
- const seriesAxisIndex = s.yAxis ?? 0;
622
- const yFn = seriesAxisIndex === 1 ? scaleY1.value : scales.value.y;
623
- const seriesRange = seriesAxisIndex === 1 ? secondaryYRange.value : yRange.value;
624
- const seriesBaseline = yFn(Math.max(0, seriesRange.min));
625
- if (kind === CHART_TYPE.LINE || kind === CHART_TYPE.AREA || kind === CHART_TYPE.SPLINE || kind === CHART_TYPE.STEPPED_LINE) {
626
- const pts = normalised.map((p) => [
627
- scales.value.x(p.x, p.dataIndex, slotCount.value),
628
- yFn(p.y)
629
- ]);
630
- const effectiveSmoothing = kind === CHART_TYPE.SPLINE && smoothing === CHART_SMOOTHING.NONE ? CHART_SMOOTHING.MONOTONE : smoothing;
631
- let dLine;
632
- let areaMode = false;
633
- if (kind === CHART_TYPE.STEPPED_LINE) {
634
- dLine = steppedPath(pts);
635
- areaMode = "stepped";
636
- } else if (effectiveSmoothing === CHART_SMOOTHING.MONOTONE) {
637
- dLine = monotonePath(pts);
638
- areaMode = "monotone";
639
- } else if (effectiveSmoothing === CHART_SMOOTHING.CURVE) {
640
- dLine = smoothPath(pts);
641
- areaMode = true;
642
- } else {
643
- dLine = linePath(pts);
644
- areaMode = false;
645
- }
646
- const length = kind === CHART_TYPE.STEPPED_LINE ? steppedPathLength(pts) : computePathLength(pts);
647
- if (kind === CHART_TYPE.AREA) {
648
- out.push({
649
- seriesIndex: seriesIdx,
650
- kind: "path",
651
- d: areaPath(pts, seriesBaseline, areaMode),
652
- color,
653
- series: s,
654
- pathLength: length,
655
- variant: "fill"
656
- });
657
- }
658
- out.push({
659
- seriesIndex: seriesIdx,
660
- kind: "path",
661
- d: dLine,
662
- color,
663
- series: s,
664
- pathLength: length,
665
- variant: kind === CHART_TYPE.AREA ? "stroke" : void 0
666
- });
667
- {
668
- for (let dataIdx = 0; dataIdx < pts.length; dataIdx++) {
669
- out.push({
670
- seriesIndex: seriesIdx,
671
- kind: "circle",
672
- circle: {
673
- cx: pts[dataIdx][0],
674
- cy: pts[dataIdx][1],
675
- r: CHART_POINT_MARKER_RADIUS
676
- },
677
- color,
678
- series: s,
679
- dataIndex: dataIdx
680
- });
681
- }
682
- }
683
- continue;
684
- }
685
- if (kind === CHART_TYPE.BAR || kind === CHART_TYPE.COLUMN) {
686
- const visibleCount = series.filter((other) => other.visible !== false).length;
687
- const groupCount = slotCount.value;
688
- const slotPx = kind === CHART_TYPE.COLUMN ? (x1 - x0) / Math.max(1, groupCount) : (y1 - y0) / Math.max(1, groupCount);
689
- const stacked = options.stacked();
690
- const isPercent = stacked && effectiveStacking.value === CHART_STACKING.PERCENT;
691
- const visibleIdxInGroup = series.slice(0, seriesIdx).filter((other) => other.visible !== false).length;
692
- const stackOff = stackOffsets.value.get(seriesIdx) ?? [];
693
- const horizRange = yRange.value;
694
- const horizSpan = Math.max(CHART_EPSILON, horizRange.max - horizRange.min);
695
- const xValuePx = (v) => {
696
- const ratio = (v - horizRange.min) / horizSpan;
697
- const px = x0 + ratio * (x1 - x0);
698
- if (px < x0) return x0;
699
- if (px > x1) return x1;
700
- return px;
701
- };
702
- for (let dataIdx = 0; dataIdx < normalised.length; dataIdx++) {
703
- const p = normalised[dataIdx];
704
- const renderY = isPercent ? percentValues.value.get(seriesIdx)?.[dataIdx] ?? 0 : p.y;
705
- if (kind === CHART_TYPE.COLUMN) {
706
- const centerX = x0 + (dataIdx + 0.5) * slotPx;
707
- const barWidth = stacked ? slotPx * CHART_BAR_SLOT_FILL_RATIO : slotPx * CHART_BAR_SLOT_FILL_RATIO / Math.max(1, visibleCount);
708
- const left = stacked ? centerX - barWidth / 2 : centerX - slotPx * CHART_BAR_SLOT_FILL_RATIO / 2 + visibleIdxInGroup * barWidth;
709
- const offset = stacked ? stackOff[dataIdx] ?? 0 : 0;
710
- const top = yFn(renderY + offset);
711
- const base = yFn(offset);
712
- out.push({
713
- seriesIndex: seriesIdx,
714
- kind: "rect",
715
- rect: {
716
- x: left,
717
- y: Math.min(top, base),
718
- width: barWidth,
719
- height: Math.abs(base - top)
720
- },
721
- color,
722
- series: s,
723
- dataIndex: dataIdx
724
- });
725
- } else {
726
- const slots = Math.max(1, groupCount);
727
- const slotCenterY = slots === 1 ? (y0 + y1) / 2 : y0 + (dataIdx + 0.5) * slotPx;
728
- const barHeight = stacked ? slotPx * CHART_BAR_SLOT_FILL_RATIO : slotPx * CHART_BAR_SLOT_FILL_RATIO / Math.max(1, visibleCount);
729
- const top = stacked ? slotCenterY - barHeight / 2 : slotCenterY - slotPx * CHART_BAR_SLOT_FILL_RATIO / 2 + visibleIdxInGroup * barHeight;
730
- const offset = stacked ? stackOff[dataIdx] ?? 0 : 0;
731
- const rightPx = xValuePx(renderY + offset);
732
- const basePx = xValuePx(offset);
733
- out.push({
734
- seriesIndex: seriesIdx,
735
- kind: "rect",
736
- rect: {
737
- x: Math.min(rightPx, basePx),
738
- y: top,
739
- width: Math.abs(rightPx - basePx),
740
- height: barHeight
741
- },
742
- color,
743
- series: s,
744
- dataIndex: dataIdx
745
- });
746
- }
747
- }
748
- continue;
749
- }
750
- if (kind === CHART_TYPE.SCATTER) {
751
- const scatterSeries = series.filter((other) => effectiveType(other) === CHART_TYPE.SCATTER && other.visible !== false);
752
- let xMin = Infinity;
753
- let xMax = -Infinity;
754
- let zMin = Infinity;
755
- let zMax = -Infinity;
756
- let hasZ = false;
757
- for (const sp of scatterSeries) {
758
- for (const entry of sp.data) {
759
- const xv = typeof entry === "number" ? entry : entry.x;
760
- const x = typeof xv === "number" ? xv : 0;
761
- if (x < xMin) xMin = x;
762
- if (x > xMax) xMax = x;
763
- if (typeof entry !== "number" && typeof entry.z === "number" && Number.isFinite(entry.z)) {
764
- hasZ = true;
765
- if (entry.z < zMin) zMin = entry.z;
766
- if (entry.z > zMax) zMax = entry.z;
767
- }
768
- }
769
- }
770
- const xSpan = Math.max(CHART_EPSILON, xMax - xMin);
771
- const xPx = (v) => {
772
- const ratio = (v - xMin) / xSpan;
773
- const px = x0 + ratio * (x1 - x0);
774
- if (px < x0) return x0;
775
- if (px > x1) return x1;
776
- return px;
777
- };
778
- const zSpan = Math.max(CHART_EPSILON, zMax - zMin);
779
- const radiusFor = (z) => {
780
- if (!hasZ || typeof z !== "number" || !Number.isFinite(z)) return CHART_SCATTER_DEFAULT_RADIUS;
781
- const ratio = zSpan === 0 ? 0.5 : (z - zMin) / zSpan;
782
- return CHART_SCATTER_MIN_RADIUS + ratio * (CHART_SCATTER_MAX_RADIUS - CHART_SCATTER_MIN_RADIUS);
783
- };
784
- for (let dataIdx = 0; dataIdx < normalised.length; dataIdx++) {
785
- const p = normalised[dataIdx];
786
- const cxRaw = typeof p.x === "number" ? p.x : Number(p.x);
787
- out.push({
788
- seriesIndex: seriesIdx,
789
- kind: "circle",
790
- circle: {
791
- cx: xPx(Number.isFinite(cxRaw) ? cxRaw : 0),
792
- cy: yFn(p.y),
793
- r: radiusFor(p.z)
794
- },
795
- color,
796
- series: s,
797
- dataIndex: dataIdx
798
- });
799
- }
800
- continue;
801
- }
802
- if (kind === CHART_TYPE.RADAR) {
803
- const axes = Math.max(cats.length, normalised.length);
804
- if (!axes) continue;
805
- const radius = Math.max(
806
- CHART_RADAR_MIN_RADIUS,
807
- Math.min(x1 - x0, y1 - y0) / 2 - CHART_RADAR_RADIUS_INSET
808
- );
809
- const pts = normalised.map((p, i) => {
810
- const yRangeSize = Math.max(CHART_EPSILON, yRange.value.max - yRange.value.min);
811
- const ratio = (p.y - yRange.value.min) / yRangeSize;
812
- const angle = i / axes * Math.PI * 2;
813
- return polarToCartesian(cx, cy, radius * ratio, angle);
814
- });
815
- out.push({
816
- seriesIndex: seriesIdx,
817
- kind: "polygon",
818
- d: polygonPath(pts),
819
- color,
820
- series: s
821
- });
822
- for (let i = 0; i < pts.length; i++) {
823
- out.push({
824
- seriesIndex: seriesIdx,
825
- kind: "circle",
826
- circle: { cx: pts[i][0], cy: pts[i][1], r: CHART_RADAR_MARKER_RADIUS },
827
- color,
828
- series: s,
829
- dataIndex: i
830
- });
831
- }
832
- }
886
+ pushSeriesPaths(out, series, seriesIdx, cats, smoothing);
833
887
  }
834
888
  return out;
835
889
  });