origam 2.38.0 → 2.38.2

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 (228) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/src/assets/locales/en.json +1 -1
  3. package/dist/src/assets/locales/fr.json +2 -2
  4. package/dist/src/components/Alert/OrigamAlert.vue +739 -165
  5. package/dist/src/components/App/OrigamApp.vue +95 -19
  6. package/dist/src/components/App/OrigamAppBar.vue +751 -158
  7. package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
  8. package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
  9. package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
  10. package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
  11. package/dist/src/components/Badge/OrigamBadge.vue +548 -135
  12. package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
  13. package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
  14. package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
  15. package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
  16. package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
  17. package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
  18. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
  19. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
  20. package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
  21. package/dist/src/components/Btn/OrigamBtn.vue +928 -249
  22. package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
  23. package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
  24. package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
  25. package/dist/src/components/Card/OrigamCard.vue +938 -194
  26. package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
  27. package/dist/src/components/Card/OrigamCardText.vue +536 -84
  28. package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
  29. package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
  30. package/dist/src/components/Chart/OrigamChart.vue +942 -452
  31. package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
  32. package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
  33. package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
  34. package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
  35. package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
  36. package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
  37. package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
  38. package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
  39. package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
  40. package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
  41. package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
  42. package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
  43. package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
  44. package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
  45. package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
  46. package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
  47. package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
  48. package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
  49. package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
  50. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
  51. package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
  52. package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
  53. package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
  54. package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
  55. package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
  56. package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
  57. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
  58. package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
  59. package/dist/src/components/Chip/OrigamChip.vue +867 -202
  60. package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
  61. package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
  62. package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
  63. package/dist/src/components/Code/OrigamCode.vue +844 -206
  64. package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
  65. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
  66. package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
  67. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
  68. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
  69. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
  70. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
  71. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
  72. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
  73. package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
  74. package/dist/src/components/Counter/OrigamCounter.vue +588 -96
  75. package/dist/src/components/DataList/OrigamDataList.vue +619 -113
  76. package/dist/src/components/DataList/OrigamDataText.vue +295 -65
  77. package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
  78. package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
  79. package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
  80. package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
  81. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
  82. package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
  83. package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
  84. package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
  85. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
  86. package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
  87. package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
  88. package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
  89. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
  90. package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
  91. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
  92. package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
  93. package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
  94. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
  95. package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
  96. package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
  97. package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
  98. package/dist/src/components/Divider/OrigamDivider.vue +210 -50
  99. package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
  100. package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
  101. package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
  102. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
  103. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
  104. package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
  105. package/dist/src/components/Field/OrigamField.vue +1118 -306
  106. package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
  107. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
  108. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
  109. package/dist/src/components/Form/OrigamForm.vue +197 -74
  110. package/dist/src/components/Grid/OrigamGrid.vue +707 -147
  111. package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
  112. package/dist/src/components/Grids/OrigamCol.vue +593 -110
  113. package/dist/src/components/Grids/OrigamContainer.vue +461 -80
  114. package/dist/src/components/Grids/OrigamRow.vue +573 -112
  115. package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
  116. package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
  117. package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
  118. package/dist/src/components/Icon/OrigamIcon.vue +561 -98
  119. package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
  120. package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
  121. package/dist/src/components/Img/OrigamImg.vue +869 -228
  122. package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
  123. package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
  124. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
  125. package/dist/src/components/Input/OrigamInput.vue +747 -180
  126. package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
  127. package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
  128. package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
  129. package/dist/src/components/Label/OrigamLabel.vue +584 -95
  130. package/dist/src/components/Layout/OrigamLayout.vue +563 -94
  131. package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
  132. package/dist/src/components/List/OrigamList.vue +755 -170
  133. package/dist/src/components/List/OrigamListChildren.vue +59 -19
  134. package/dist/src/components/List/OrigamListGroup.vue +631 -134
  135. package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
  136. package/dist/src/components/List/OrigamListItem.vue +890 -224
  137. package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
  138. package/dist/src/components/List/OrigamListSubheader.vue +542 -93
  139. package/dist/src/components/Loader/OrigamLoader.vue +110 -25
  140. package/dist/src/components/Main/OrigamMain.vue +565 -96
  141. package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
  142. package/dist/src/components/Media/OrigamMediaController.vue +465 -182
  143. package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
  144. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
  145. package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
  146. package/dist/src/components/Messages/OrigamMessages.vue +606 -97
  147. package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
  148. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
  149. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
  150. package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
  151. package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
  152. package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
  153. package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
  154. package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
  155. package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
  156. package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
  157. package/dist/src/components/Picker/OrigamPicker.vue +655 -108
  158. package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
  159. package/dist/src/components/Progress/OrigamProgress.vue +436 -70
  160. package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
  161. package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
  162. package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
  163. package/dist/src/components/Radio/OrigamRadio.vue +772 -132
  164. package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
  165. package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
  166. package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
  167. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
  168. package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
  169. package/dist/src/components/Select/OrigamSelect.vue +1639 -567
  170. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
  171. package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
  172. package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
  173. package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
  174. package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
  175. package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
  176. package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
  177. package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
  178. package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
  179. package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
  180. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
  181. package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
  182. package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
  183. package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
  184. package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
  185. package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
  186. package/dist/src/components/Table/OrigamTable.vue +585 -124
  187. package/dist/src/components/Tabs/OrigamTab.vue +239 -73
  188. package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
  189. package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
  190. package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
  191. package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
  192. package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
  193. package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
  194. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
  195. package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
  196. package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
  197. package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
  198. package/dist/src/components/Title/OrigamTitle.vue +505 -82
  199. package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
  200. package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
  201. package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
  202. package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
  203. package/dist/src/components/Transition/OrigamFade.vue +47 -9
  204. package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
  205. package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
  206. package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
  207. package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
  208. package/dist/src/components/Transition/OrigamSnack.vue +52 -10
  209. package/dist/src/components/Transition/OrigamTransition.vue +40 -12
  210. package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
  211. package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
  212. package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
  213. package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
  214. package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
  215. package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
  216. package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
  217. package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
  218. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
  219. package/dist/src/components/Video/OrigamVideo.vue +1178 -331
  220. package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
  221. package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
  222. package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
  223. package/dist/src/components/Window/OrigamWindow.vue +745 -175
  224. package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
  225. package/dist/src/composables/Commons/display.composable.cjs +2 -0
  226. package/dist/src/composables/Commons/display.composable.js +1 -1
  227. package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
  228. package/package.json +8 -8
@@ -296,10 +296,7 @@
296
296
 
297
297
  <script lang="ts" setup>
298
298
  import { CHART_SIZE_FALLBACK, CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
299
- import {
300
- computed,
301
- ref
302
- } from "vue";
299
+ import { computed, ref } from "vue";
303
300
  import OrigamChartLegend from "./OrigamChartLegend.vue";
304
301
  import OrigamChartTooltip from "./OrigamChartTooltip.vue";
305
302
  import { useChartHeaderTypography } from "../../composables/Chart/chart-header-typography.composable";
@@ -315,77 +312,451 @@ import { usePadding } from "../../composables/Commons/padding.composable";
315
312
  import { usePassedProps } from "../../composables/Commons/passedProps.composable";
316
313
  import { useRounded } from "../../composables/Commons/rounded.composable";
317
314
  import { intentBgExpr, isIntent } from "../../utils/Commons/color.util";
318
- defineOptions({
319
- name: "OrigamChartPareto"
320
- });
315
+ /*********************************************************
316
+ * Global
317
+ *
318
+ * @description
319
+ * Pareto chart family. Combines vertical columns sorted
320
+ * descending by value with a cumulative percentage line
321
+ * overlaid on a secondary right Y-axis.
322
+ *
323
+ * Classic uses: quality control, root-cause analysis,
324
+ * the 80/20 rule (Pareto principle).
325
+ *
326
+ * `withDefaults` literals only, per CLAUDE.md.
327
+ ********************************************************/
328
+ defineOptions({ name: "OrigamChartPareto" });
321
329
  const props = defineProps({
322
- barColor: { type: null, required: false, default: "primary" },
323
- lineColor: { type: null, required: false, default: "danger" },
324
- barGap: { type: Number, required: false, default: 4 },
325
- showLine: { type: Boolean, required: false, default: true },
326
- showLabel: { type: Boolean, required: false, default: false },
327
- showAxis: { type: Boolean, required: false, default: true },
328
- showGrid: { type: Boolean, required: false, default: true },
329
- xAxisFormat: { type: Function, required: false, default: void 0 },
330
- yAxisFormat: { type: Function, required: false, default: void 0 },
331
- cumulativeFormat: { type: Function, required: false, default: void 0 },
332
- series: { type: Array, required: true },
333
- categories: { type: Array, required: false, default: () => [] },
334
- title: { type: String, required: false, default: void 0 },
335
- subtitle: { type: String, required: false, default: void 0 },
336
- showLegend: { type: Boolean, required: false, default: true },
337
- legendPosition: { type: null, required: false, default: "bottom" },
338
- showTooltip: { type: Boolean, required: false, default: true },
339
- animated: { type: Boolean, required: false, default: true },
340
- animationDuration: { type: Number, required: false, default: 600 },
341
- colorScheme: { type: Array, required: false, default: () => [] },
342
- aspectRatio: { type: String, required: false, default: void 0 },
343
- id: { type: String, required: false },
344
- class: { type: [String, Array, Object], required: false },
345
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
346
- height: { type: [Number, String], required: false, default: 360 },
347
- maxHeight: { type: [Number, String], required: false },
348
- maxWidth: { type: [Number, String], required: false },
349
- minHeight: { type: [Number, String], required: false },
350
- minWidth: { type: [Number, String], required: false },
351
- width: { type: [Number, String], required: false },
352
- margin: { type: [Boolean, Number, String], required: false },
353
- marginTop: { type: [Boolean, Number, String], required: false },
354
- marginLeft: { type: [Boolean, Number, String], required: false },
355
- marginBottom: { type: [Boolean, Number, String], required: false },
356
- marginRight: { type: [Boolean, Number, String], required: false },
357
- marginBlock: { type: [Boolean, Number, String], required: false },
358
- marginInline: { type: [Boolean, Number, String], required: false },
359
- marginInlineStart: { type: [Boolean, Number, String], required: false },
360
- marginInlineEnd: { type: [Boolean, Number, String], required: false },
361
- marginBlockStart: { type: [Boolean, Number, String], required: false },
362
- marginBlockEnd: { type: [Boolean, Number, String], required: false },
363
- padding: { type: [Boolean, Number, String], required: false },
364
- paddingTop: { type: [Boolean, Number, String], required: false },
365
- paddingLeft: { type: [Boolean, Number, String], required: false },
366
- paddingBottom: { type: [Boolean, Number, String], required: false },
367
- paddingRight: { type: [Boolean, Number, String], required: false },
368
- paddingBlock: { type: [Boolean, Number, String], required: false },
369
- paddingInline: { type: [Boolean, Number, String], required: false },
370
- paddingInlineStart: { type: [Boolean, Number, String], required: false },
371
- paddingInlineEnd: { type: [Boolean, Number, String], required: false },
372
- paddingBlockStart: { type: [Boolean, Number, String], required: false },
373
- paddingBlockEnd: { type: [Boolean, Number, String], required: false },
374
- rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
375
- roundedTopRight: { type: [Boolean, Number, String], required: false },
376
- roundedTopLeft: { type: [Boolean, Number, String], required: false },
377
- roundedBottomLeft: { type: [Boolean, Number, String], required: false },
378
- roundedBottomRight: { type: [Boolean, Number, String], required: false },
379
- roundedStartStart: { type: [Boolean, Number, String], required: false },
380
- roundedStartEnd: { type: [Boolean, Number, String], required: false },
381
- roundedEndStart: { type: [Boolean, Number, String], required: false },
382
- roundedEndEnd: { type: [Boolean, Number, String], required: false },
383
- elevation: { type: [Number, String], required: false },
384
- bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
385
- fontSize: { type: null, required: false },
386
- fontWeight: { type: null, required: false }
330
+ barColor: {
331
+ type: null,
332
+ required: false,
333
+ default: "primary"
334
+ },
335
+ lineColor: {
336
+ type: null,
337
+ required: false,
338
+ default: "danger"
339
+ },
340
+ barGap: {
341
+ type: Number,
342
+ required: false,
343
+ default: 4
344
+ },
345
+ showLine: {
346
+ type: Boolean,
347
+ required: false,
348
+ default: true
349
+ },
350
+ showLabel: {
351
+ type: Boolean,
352
+ required: false,
353
+ default: false
354
+ },
355
+ showAxis: {
356
+ type: Boolean,
357
+ required: false,
358
+ default: true
359
+ },
360
+ showGrid: {
361
+ type: Boolean,
362
+ required: false,
363
+ default: true
364
+ },
365
+ xAxisFormat: {
366
+ type: Function,
367
+ required: false,
368
+ default: undefined
369
+ },
370
+ yAxisFormat: {
371
+ type: Function,
372
+ required: false,
373
+ default: undefined
374
+ },
375
+ cumulativeFormat: {
376
+ type: Function,
377
+ required: false,
378
+ default: undefined
379
+ },
380
+ series: {
381
+ type: Array,
382
+ required: true
383
+ },
384
+ categories: {
385
+ type: Array,
386
+ required: false,
387
+ default: () => []
388
+ },
389
+ title: {
390
+ type: String,
391
+ required: false,
392
+ default: undefined
393
+ },
394
+ subtitle: {
395
+ type: String,
396
+ required: false,
397
+ default: undefined
398
+ },
399
+ showLegend: {
400
+ type: Boolean,
401
+ required: false,
402
+ default: true
403
+ },
404
+ legendPosition: {
405
+ type: null,
406
+ required: false,
407
+ default: "bottom"
408
+ },
409
+ showTooltip: {
410
+ type: Boolean,
411
+ required: false,
412
+ default: true
413
+ },
414
+ animated: {
415
+ type: Boolean,
416
+ required: false,
417
+ default: true
418
+ },
419
+ animationDuration: {
420
+ type: Number,
421
+ required: false,
422
+ default: 600
423
+ },
424
+ colorScheme: {
425
+ type: Array,
426
+ required: false,
427
+ default: () => []
428
+ },
429
+ aspectRatio: {
430
+ type: String,
431
+ required: false,
432
+ default: undefined
433
+ },
434
+ id: {
435
+ type: String,
436
+ required: false
437
+ },
438
+ class: {
439
+ type: [
440
+ String,
441
+ Array,
442
+ Object
443
+ ],
444
+ required: false
445
+ },
446
+ style: {
447
+ type: [
448
+ String,
449
+ Array,
450
+ Object,
451
+ Boolean,
452
+ null
453
+ ],
454
+ required: false,
455
+ skipCheck: true
456
+ },
457
+ height: {
458
+ type: [Number, String],
459
+ required: false,
460
+ default: 360
461
+ },
462
+ maxHeight: {
463
+ type: [Number, String],
464
+ required: false
465
+ },
466
+ maxWidth: {
467
+ type: [Number, String],
468
+ required: false
469
+ },
470
+ minHeight: {
471
+ type: [Number, String],
472
+ required: false
473
+ },
474
+ minWidth: {
475
+ type: [Number, String],
476
+ required: false
477
+ },
478
+ width: {
479
+ type: [Number, String],
480
+ required: false
481
+ },
482
+ margin: {
483
+ type: [
484
+ Boolean,
485
+ Number,
486
+ String
487
+ ],
488
+ required: false
489
+ },
490
+ marginTop: {
491
+ type: [
492
+ Boolean,
493
+ Number,
494
+ String
495
+ ],
496
+ required: false
497
+ },
498
+ marginLeft: {
499
+ type: [
500
+ Boolean,
501
+ Number,
502
+ String
503
+ ],
504
+ required: false
505
+ },
506
+ marginBottom: {
507
+ type: [
508
+ Boolean,
509
+ Number,
510
+ String
511
+ ],
512
+ required: false
513
+ },
514
+ marginRight: {
515
+ type: [
516
+ Boolean,
517
+ Number,
518
+ String
519
+ ],
520
+ required: false
521
+ },
522
+ marginBlock: {
523
+ type: [
524
+ Boolean,
525
+ Number,
526
+ String
527
+ ],
528
+ required: false
529
+ },
530
+ marginInline: {
531
+ type: [
532
+ Boolean,
533
+ Number,
534
+ String
535
+ ],
536
+ required: false
537
+ },
538
+ marginInlineStart: {
539
+ type: [
540
+ Boolean,
541
+ Number,
542
+ String
543
+ ],
544
+ required: false
545
+ },
546
+ marginInlineEnd: {
547
+ type: [
548
+ Boolean,
549
+ Number,
550
+ String
551
+ ],
552
+ required: false
553
+ },
554
+ marginBlockStart: {
555
+ type: [
556
+ Boolean,
557
+ Number,
558
+ String
559
+ ],
560
+ required: false
561
+ },
562
+ marginBlockEnd: {
563
+ type: [
564
+ Boolean,
565
+ Number,
566
+ String
567
+ ],
568
+ required: false
569
+ },
570
+ padding: {
571
+ type: [
572
+ Boolean,
573
+ Number,
574
+ String
575
+ ],
576
+ required: false
577
+ },
578
+ paddingTop: {
579
+ type: [
580
+ Boolean,
581
+ Number,
582
+ String
583
+ ],
584
+ required: false
585
+ },
586
+ paddingLeft: {
587
+ type: [
588
+ Boolean,
589
+ Number,
590
+ String
591
+ ],
592
+ required: false
593
+ },
594
+ paddingBottom: {
595
+ type: [
596
+ Boolean,
597
+ Number,
598
+ String
599
+ ],
600
+ required: false
601
+ },
602
+ paddingRight: {
603
+ type: [
604
+ Boolean,
605
+ Number,
606
+ String
607
+ ],
608
+ required: false
609
+ },
610
+ paddingBlock: {
611
+ type: [
612
+ Boolean,
613
+ Number,
614
+ String
615
+ ],
616
+ required: false
617
+ },
618
+ paddingInline: {
619
+ type: [
620
+ Boolean,
621
+ Number,
622
+ String
623
+ ],
624
+ required: false
625
+ },
626
+ paddingInlineStart: {
627
+ type: [
628
+ Boolean,
629
+ Number,
630
+ String
631
+ ],
632
+ required: false
633
+ },
634
+ paddingInlineEnd: {
635
+ type: [
636
+ Boolean,
637
+ Number,
638
+ String
639
+ ],
640
+ required: false
641
+ },
642
+ paddingBlockStart: {
643
+ type: [
644
+ Boolean,
645
+ Number,
646
+ String
647
+ ],
648
+ required: false
649
+ },
650
+ paddingBlockEnd: {
651
+ type: [
652
+ Boolean,
653
+ Number,
654
+ String
655
+ ],
656
+ required: false
657
+ },
658
+ rounded: {
659
+ type: [
660
+ Boolean,
661
+ Number,
662
+ String,
663
+ null
664
+ ],
665
+ required: false,
666
+ skipCheck: true
667
+ },
668
+ roundedTopRight: {
669
+ type: [
670
+ Boolean,
671
+ Number,
672
+ String
673
+ ],
674
+ required: false
675
+ },
676
+ roundedTopLeft: {
677
+ type: [
678
+ Boolean,
679
+ Number,
680
+ String
681
+ ],
682
+ required: false
683
+ },
684
+ roundedBottomLeft: {
685
+ type: [
686
+ Boolean,
687
+ Number,
688
+ String
689
+ ],
690
+ required: false
691
+ },
692
+ roundedBottomRight: {
693
+ type: [
694
+ Boolean,
695
+ Number,
696
+ String
697
+ ],
698
+ required: false
699
+ },
700
+ roundedStartStart: {
701
+ type: [
702
+ Boolean,
703
+ Number,
704
+ String
705
+ ],
706
+ required: false
707
+ },
708
+ roundedStartEnd: {
709
+ type: [
710
+ Boolean,
711
+ Number,
712
+ String
713
+ ],
714
+ required: false
715
+ },
716
+ roundedEndStart: {
717
+ type: [
718
+ Boolean,
719
+ Number,
720
+ String
721
+ ],
722
+ required: false
723
+ },
724
+ roundedEndEnd: {
725
+ type: [
726
+ Boolean,
727
+ Number,
728
+ String
729
+ ],
730
+ required: false
731
+ },
732
+ elevation: {
733
+ type: [Number, String],
734
+ required: false
735
+ },
736
+ bgColor: {
737
+ type: [
738
+ String,
739
+ Object,
740
+ Boolean,
741
+ null
742
+ ],
743
+ required: false,
744
+ skipCheck: true
745
+ },
746
+ fontSize: {
747
+ type: null,
748
+ required: false
749
+ },
750
+ fontWeight: {
751
+ type: null,
752
+ required: false
753
+ }
387
754
  });
388
- const emit = defineEmits(["point-click", "legend-click", "series-toggle"]);
755
+ const emit = defineEmits([
756
+ "point-click",
757
+ "legend-click",
758
+ "series-toggle"
759
+ ]);
389
760
  defineSlots();
390
761
  const { t } = useLocale();
391
762
  const { dimensionStyles } = useDimension(props);
@@ -396,279 +767,353 @@ const { paddingClasses, paddingStyles } = usePadding(props);
396
767
  const { roundedClasses, roundedStyles } = useRounded(props);
397
768
  const { headerTypographyStyles } = useChartHeaderTypography(props);
398
769
  const chartAnimationStyle = useChartAnimationStyle(props);
770
+ /*********************************************************
771
+ * Static SVG box — fixed 600 × 400 coordinate space;
772
+ * CSS scales it to the container.
773
+ * Right padding is wider to accommodate the right Y-axis.
774
+ ********************************************************/
399
775
  const { resizeRef: svgRef, width: svgWidth, height: svgHeight } = useChartSize(CHART_SIZE_FALLBACK.pareto);
400
776
  const { onKeydown: onChartKeydown } = useChartRoving(svgRef);
401
777
  const TICK_SIZE = 4;
402
778
  const PLOT = {
403
- top: 24,
404
- right: 60,
405
- bottom: 48,
406
- left: 52
779
+ top: 24,
780
+ right: 60,
781
+ bottom: 48,
782
+ left: 52
407
783
  };
408
784
  const plotWidth = computed(() => svgWidth.value - PLOT.left - PLOT.right);
409
785
  const plotHeight = computed(() => svgHeight.value - PLOT.top - PLOT.bottom);
786
+ /*********************************************************
787
+ * Color resolution
788
+ ********************************************************/
410
789
  const resolveColor = (raw) => {
411
- if (!raw) return "currentColor";
412
- if (/^(#|rgb|hsl|var|currentColor|transparent|linear-gradient|radial-gradient|conic-gradient)/i.test(raw)) {
413
- return raw;
414
- }
415
- if (isIntent(raw)) {
416
- return intentBgExpr(raw, "default");
417
- }
418
- return "currentColor";
790
+ if (!raw) return "currentColor";
791
+ if (/^(#|rgb|hsl|var|currentColor|transparent|linear-gradient|radial-gradient|conic-gradient)/i.test(raw)) {
792
+ return raw;
793
+ }
794
+ if (isIntent(raw)) {
795
+ return intentBgExpr(raw, "default");
796
+ }
797
+ return "currentColor";
419
798
  };
420
799
  const resolvedBarColor = computed(() => resolveColor(props.barColor));
421
800
  const resolvedLineColor = computed(() => resolveColor(props.lineColor));
801
+ /*********************************************************
802
+ * wasBarColorPassed / barColorAt
803
+ *
804
+ * @description
805
+ * `barColor` carries a hard `withDefaults()` default ('primary'), so
806
+ * `props.barColor` is NEVER `undefined` at render time — a plain
807
+ * `props.barColor ?? colorScheme[...]` fallback could never fire.
808
+ *
809
+ * @description
810
+ * Same shadowing shape `useChartAnimationStyle` documents for
811
+ * `animationDuration` (#505): the distinguishing test is whether the
812
+ * CONSUMER (or a theme) actually touched the prop, not whether the
813
+ * resolved value is falsy (#426).
814
+ ********************************************************/
422
815
  const wasBarColorPassed = usePassedProps(props, "OrigamChartPareto");
423
816
  const barColorAt = (i) => {
424
- if (!wasBarColorPassed("barColor") && props.colorScheme?.length) {
425
- return resolveColor(props.colorScheme[i % props.colorScheme.length]);
426
- }
427
- return resolvedBarColor.value;
817
+ if (!wasBarColorPassed("barColor") && props.colorScheme?.length) {
818
+ return resolveColor(props.colorScheme[i % props.colorScheme.length]);
819
+ }
820
+ return resolvedBarColor.value;
428
821
  };
822
+ /*********************************************************
823
+ * Data normalisation — accepts IChartParetoDatum objects
824
+ * or legacy {x, y} point shapes from IChartSeries.data.
825
+ ********************************************************/
429
826
  const sortedData = computed(() => {
430
- const series = props.series?.[0];
431
- if (!series?.data?.length) return [];
432
- const items = series.data.map((item, i) => {
433
- if (typeof item === "number") {
434
- const cat = props.categories?.[i] ?? String(i);
435
- return { category: cat, value: item };
436
- }
437
- if (typeof item === "object" && item !== null) {
438
- const obj = item;
439
- if ("category" in obj && typeof obj["value"] === "number") {
440
- return item;
441
- }
442
- const x = obj["x"];
443
- const y = obj["y"];
444
- return {
445
- category: x != null ? String(x) : props.categories?.[i] ?? String(i),
446
- value: typeof y === "number" ? y : 0
447
- };
448
- }
449
- return { category: props.categories?.[i] ?? String(i), value: 0 };
450
- });
451
- return [...items].sort((a, b) => b.value - a.value);
827
+ const series = props.series?.[0];
828
+ if (!series?.data?.length) return [];
829
+ const items = series.data.map((item, i) => {
830
+ if (typeof item === "number") {
831
+ const cat = props.categories?.[i] ?? String(i);
832
+ return {
833
+ category: cat,
834
+ value: item
835
+ };
836
+ }
837
+ if (typeof item === "object" && item !== null) {
838
+ const obj = item;
839
+ if ("category" in obj && typeof obj["value"] === "number") {
840
+ return item;
841
+ }
842
+ const x = obj["x"];
843
+ const y = obj["y"];
844
+ return {
845
+ category: x != null ? String(x) : props.categories?.[i] ?? String(i),
846
+ value: typeof y === "number" ? y : 0
847
+ };
848
+ }
849
+ return {
850
+ category: props.categories?.[i] ?? String(i),
851
+ value: 0
852
+ };
853
+ });
854
+ return [...items].sort((a, b) => b.value - a.value);
452
855
  });
453
- const total = computed(
454
- () => sortedData.value.reduce((acc, d) => acc + (Number.isFinite(d.value) && d.value >= 0 ? d.value : 0), 0) || 1e-9
455
- );
856
+ const total = computed(() => sortedData.value.reduce((acc, d) => acc + (Number.isFinite(d.value) && d.value >= 0 ? d.value : 0), 0) || 1e-9);
857
+ /*********************************************************
858
+ * Y scale — left axis (values)
859
+ ********************************************************/
456
860
  const yMax = computed(() => {
457
- if (!sortedData.value.length) return 1;
458
- return Math.max(...sortedData.value.map((d) => d.value).filter(Number.isFinite), 1);
861
+ if (!sortedData.value.length) return 1;
862
+ return Math.max(...sortedData.value.map((d) => d.value).filter(Number.isFinite), 1);
459
863
  });
460
864
  const scaleY = (value) => {
461
- const fraction = value / yMax.value;
462
- return PLOT.top + plotHeight.value * (1 - fraction);
865
+ const fraction = value / yMax.value;
866
+ return PLOT.top + plotHeight.value * (1 - fraction);
463
867
  };
868
+ /*********************************************************
869
+ * Y scale — right axis (cumulative %)
870
+ ********************************************************/
464
871
  const scaleYCumulative = (fraction) => {
465
- return PLOT.top + plotHeight.value * (1 - fraction);
872
+ return PLOT.top + plotHeight.value * (1 - fraction);
466
873
  };
874
+ /*********************************************************
875
+ * Y-axis ticks — left (values)
876
+ ********************************************************/
467
877
  const Y_TICK_COUNT = 5;
468
878
  const yTicks = computed(() => {
469
- const max = yMax.value;
470
- const step = max / (Y_TICK_COUNT - 1);
471
- return Array.from({ length: Y_TICK_COUNT }, (_, i) => {
472
- const value = i * step;
473
- const label = props.yAxisFormat ? props.yAxisFormat(value) : String(Math.round(value * 100) / 100);
474
- return { value, label };
475
- });
879
+ const max = yMax.value;
880
+ const step = max / (Y_TICK_COUNT - 1);
881
+ return Array.from({ length: Y_TICK_COUNT }, (_, i) => {
882
+ const value = i * step;
883
+ const label = props.yAxisFormat ? props.yAxisFormat(value) : String(Math.round(value * 100) / 100);
884
+ return {
885
+ value,
886
+ label
887
+ };
888
+ });
476
889
  });
890
+ /*********************************************************
891
+ * Cumulative axis ticks — right (0–100%)
892
+ ********************************************************/
477
893
  const CUMULATIVE_TICK_COUNT = 5;
478
894
  const cumulativeTicks = computed(() => {
479
- return Array.from({ length: CUMULATIVE_TICK_COUNT }, (_, i) => {
480
- const fraction = i / (CUMULATIVE_TICK_COUNT - 1);
481
- const label = props.cumulativeFormat ? props.cumulativeFormat(fraction) : `${Math.round(fraction * 100)}%`;
482
- return { value: fraction, label };
483
- });
895
+ return Array.from({ length: CUMULATIVE_TICK_COUNT }, (_, i) => {
896
+ const fraction = i / (CUMULATIVE_TICK_COUNT - 1);
897
+ const label = props.cumulativeFormat ? props.cumulativeFormat(fraction) : `${Math.round(fraction * 100)}%`;
898
+ return {
899
+ value: fraction,
900
+ label
901
+ };
902
+ });
484
903
  });
904
+ /*********************************************************
905
+ * Geometry — Pareto bars
906
+ ********************************************************/
485
907
  const bars = computed(() => {
486
- const items = sortedData.value;
487
- if (!items.length) return [];
488
- const count = items.length;
489
- const totalBarSpace = plotWidth.value - props.barGap * Math.max(0, count - 1);
490
- const barWidth = Math.max(1, totalBarSpace / count);
491
- const baseline = scaleY(0);
492
- let cumulativeSum = 0;
493
- let cursorX = PLOT.left;
494
- return items.map((datum, i) => {
495
- const safeValue = Number.isFinite(datum.value) && datum.value >= 0 ? datum.value : 0;
496
- cumulativeSum += safeValue;
497
- const cumulative = cumulativeSum / total.value;
498
- const share = safeValue / total.value;
499
- const barTop = scaleY(safeValue);
500
- const barHeight = Math.abs(baseline - barTop);
501
- const x = cursorX;
502
- const cx = cursorX + barWidth / 2;
503
- const dotY = scaleYCumulative(cumulative);
504
- cursorX += barWidth + props.barGap;
505
- return {
506
- index: i,
507
- category: datum.category,
508
- value: safeValue,
509
- formattedValue: props.yAxisFormat ? props.yAxisFormat(safeValue) : String(safeValue),
510
- share,
511
- cumulative,
512
- color: barColorAt(i),
513
- x,
514
- y: barTop,
515
- w: barWidth,
516
- h: Math.max(barHeight, 1),
517
- cx,
518
- dotY
519
- };
520
- });
908
+ const items = sortedData.value;
909
+ if (!items.length) return [];
910
+ const count = items.length;
911
+ const totalBarSpace = plotWidth.value - props.barGap * Math.max(0, count - 1);
912
+ const barWidth = Math.max(1, totalBarSpace / count);
913
+ const baseline = scaleY(0);
914
+ let cumulativeSum = 0;
915
+ let cursorX = PLOT.left;
916
+ return items.map((datum, i) => {
917
+ const safeValue = Number.isFinite(datum.value) && datum.value >= 0 ? datum.value : 0;
918
+ cumulativeSum += safeValue;
919
+ const cumulative = cumulativeSum / total.value;
920
+ const share = safeValue / total.value;
921
+ const barTop = scaleY(safeValue);
922
+ const barHeight = Math.abs(baseline - barTop);
923
+ const x = cursorX;
924
+ const cx = cursorX + barWidth / 2;
925
+ const dotY = scaleYCumulative(cumulative);
926
+ cursorX += barWidth + props.barGap;
927
+ return {
928
+ index: i,
929
+ category: datum.category,
930
+ value: safeValue,
931
+ formattedValue: props.yAxisFormat ? props.yAxisFormat(safeValue) : String(safeValue),
932
+ share,
933
+ cumulative,
934
+ color: barColorAt(i),
935
+ x,
936
+ y: barTop,
937
+ w: barWidth,
938
+ h: Math.max(barHeight, 1),
939
+ cx,
940
+ dotY
941
+ };
942
+ });
521
943
  });
944
+ /*********************************************************
945
+ * Cumulative line path
946
+ ********************************************************/
522
947
  const cumulativeLinePath = computed(() => {
523
- if (!bars.value.length) return "";
524
- return bars.value.map((bar, i) => `${i === 0 ? "M" : "L"} ${bar.cx},${bar.dotY}`).join(" ");
948
+ if (!bars.value.length) return "";
949
+ return bars.value.map((bar, i) => `${i === 0 ? "M" : "L"} ${bar.cx},${bar.dotY}`).join(" ");
525
950
  });
951
+ /*********************************************************
952
+ * formatCategory helper
953
+ ********************************************************/
526
954
  const formatCategory = (cat) => {
527
- if (props.xAxisFormat) return String(props.xAxisFormat(cat));
528
- return cat;
955
+ if (props.xAxisFormat) return String(props.xAxisFormat(cat));
956
+ return cat;
529
957
  };
958
+ /*********************************************************
959
+ * Legend items — two entries: bars + cumulative line
960
+ ********************************************************/
530
961
  const legendItems = computed(() => {
531
- const series = props.series?.[0];
532
- if (!series) return [];
533
- const items = [
534
- {
535
- series: {
536
- ...series,
537
- name: series.name || "Values",
538
- visible: true
539
- },
540
- index: 0,
541
- color: resolvedBarColor.value,
542
- visible: true
543
- }
544
- ];
545
- if (props.showLine) {
546
- items.push({
547
- series: {
548
- name: t("origam.chart.pareto.cumulative_label"),
549
- data: [],
550
- visible: true
551
- },
552
- index: 1,
553
- color: resolvedLineColor.value,
554
- visible: true
555
- });
556
- }
557
- return items;
962
+ const series = props.series?.[0];
963
+ if (!series) return [];
964
+ const items = [{
965
+ series: {
966
+ ...series,
967
+ name: series.name || "Values",
968
+ visible: true
969
+ },
970
+ index: 0,
971
+ color: resolvedBarColor.value,
972
+ visible: true
973
+ }];
974
+ if (props.showLine) {
975
+ items.push({
976
+ series: {
977
+ name: t("origam.chart.pareto.cumulative_label"),
978
+ data: [],
979
+ visible: true
980
+ },
981
+ index: 1,
982
+ color: resolvedLineColor.value,
983
+ visible: true
984
+ });
985
+ }
986
+ return items;
558
987
  });
988
+ /*********************************************************
989
+ * Empty state
990
+ ********************************************************/
559
991
  const showEmpty = computed(() => {
560
- if (!props.series?.length) return true;
561
- const first = props.series[0];
562
- if (!first?.data?.length) return true;
563
- return bars.value.length === 0;
992
+ if (!props.series?.length) return true;
993
+ const first = props.series[0];
994
+ if (!first?.data?.length) return true;
995
+ return bars.value.length === 0;
996
+ });
997
+ /*********************************************************
998
+ * Hover / tooltip
999
+ ********************************************************/
1000
+ const mousePos = ref({
1001
+ x: 0,
1002
+ y: 0
564
1003
  });
565
- const mousePos = ref({ x: 0, y: 0 });
566
1004
  const hoveredIndex = ref(null);
567
1005
  const hoveredBar = computed(() => {
568
- if (hoveredIndex.value === null) return null;
569
- return bars.value.find((b) => b.index === hoveredIndex.value) ?? null;
1006
+ if (hoveredIndex.value === null) return null;
1007
+ return bars.value.find((b) => b.index === hoveredIndex.value) ?? null;
570
1008
  });
571
1009
  const hoveredPoint = computed(() => {
572
- const bar = hoveredBar.value;
573
- if (!bar || !props.series?.[0]) return null;
574
- return {
575
- seriesIndex: 0,
576
- seriesName: props.series[0].name,
577
- dataIndex: bar.index,
578
- x: bar.category,
579
- y: bar.value,
580
- color: bar.color
581
- };
1010
+ const bar = hoveredBar.value;
1011
+ if (!bar || !props.series?.[0]) return null;
1012
+ return {
1013
+ seriesIndex: 0,
1014
+ seriesName: props.series[0].name,
1015
+ dataIndex: bar.index,
1016
+ x: bar.category,
1017
+ y: bar.value,
1018
+ color: bar.color
1019
+ };
582
1020
  });
583
1021
  const hoveredSeries = computed(() => {
584
- if (!hoveredBar.value || !props.series?.[0]) return null;
585
- return props.series[0];
1022
+ if (!hoveredBar.value || !props.series?.[0]) return null;
1023
+ return props.series[0];
586
1024
  });
587
- const hoveredCategory = computed(
588
- () => hoveredBar.value?.category ?? ""
589
- );
1025
+ const hoveredCategory = computed(() => hoveredBar.value?.category ?? "");
1026
+ /**
1027
+ * Builds the `IChartParetoSlots['tooltip']` scope from the default
1028
+ * `{ point, series, category }` binding + the hovered bar's own
1029
+ * fields (`value`, `formattedValue`, `share`, `cumulative`,
1030
+ * `color`). `bar` is guaranteed non-null whenever this runs — the
1031
+ * tooltip only renders while `hoveredBar` backs `hoveredPoint` /
1032
+ * `hoveredSeries`, which the `<origam-chart-tooltip>` wrapper's own
1033
+ * `v-if="point && series"` already gates — but the fallback keeps
1034
+ * the return type honest without a non-null assertion.
1035
+ */
590
1036
  const tooltipBindings = (bindings) => {
591
- const bar = hoveredBar.value;
592
- return {
593
- point: bindings.point,
594
- category: bar?.category ?? "",
595
- value: bar?.value ?? 0,
596
- formattedValue: bar?.formattedValue ?? "",
597
- share: bar?.share ?? 0,
598
- cumulative: bar?.cumulative ?? 0,
599
- color: bar?.color ?? ""
600
- };
1037
+ const bar = hoveredBar.value;
1038
+ return {
1039
+ point: bindings.point,
1040
+ category: bar?.category ?? "",
1041
+ value: bar?.value ?? 0,
1042
+ formattedValue: bar?.formattedValue ?? "",
1043
+ share: bar?.share ?? 0,
1044
+ cumulative: bar?.cumulative ?? 0,
1045
+ color: bar?.color ?? ""
1046
+ };
601
1047
  };
1048
+ /*********************************************************
1049
+ * Root classes / styles
1050
+ ********************************************************/
602
1051
  const rootClasses = computed(() => [
603
- {
604
- [`origam-chart-pareto--legend-${props.legendPosition}`]: true,
605
- "origam-chart-pareto--no-animation": !props.animated
606
- },
607
- backgroundColorClasses.value,
608
- elevationClasses.value,
609
- marginClasses.value,
610
- paddingClasses.value,
611
- roundedClasses.value,
612
- props.class
1052
+ {
1053
+ [`origam-chart-pareto--legend-${props.legendPosition}`]: true,
1054
+ "origam-chart-pareto--no-animation": !props.animated
1055
+ },
1056
+ backgroundColorClasses.value,
1057
+ elevationClasses.value,
1058
+ marginClasses.value,
1059
+ paddingClasses.value,
1060
+ roundedClasses.value,
1061
+ props.class
613
1062
  ]);
614
1063
  const rootStyles = computed(() => {
615
- const out = {};
616
- if (props.aspectRatio) {
617
- out.aspectRatio = props.aspectRatio;
618
- }
619
- Object.assign(out, chartAnimationStyle.value);
620
- return [out, props.style];
1064
+ const out = {};
1065
+ if (props.aspectRatio) {
1066
+ out.aspectRatio = props.aspectRatio;
1067
+ }
1068
+ Object.assign(out, chartAnimationStyle.value);
1069
+ return [out, props.style];
621
1070
  });
622
- const bodyClasses = computed(() => ({
623
- "origam-chart-pareto__body--with-side-legend": props.showLegend && (props.legendPosition === "left" || props.legendPosition === "right")
624
- }));
625
- const svgClasses = computed(() => ({
626
- "origam-chart__svg--animated": props.animated
627
- }));
1071
+ const bodyClasses = computed(() => ({ "origam-chart-pareto__body--with-side-legend": props.showLegend && (props.legendPosition === "left" || props.legendPosition === "right") }));
1072
+ const svgClasses = computed(() => ({ "origam-chart__svg--animated": props.animated }));
628
1073
  const hasTitleBlock = computed(() => Boolean(props.title || props.subtitle));
1074
+ /*********************************************************
1075
+ * ARIA
1076
+ ********************************************************/
629
1077
  const ariaLabel = computed(() => props.title ?? t("origam.chart.pareto.aria_label"));
630
1078
  const svgAriaLabel = computed(() => props.title ?? t("origam.chart.pareto.aria_label"));
631
1079
  const svgTitle = computed(() => props.title ?? t("origam.chart.pareto.aria_label"));
632
1080
  const svgDesc = computed(() => {
633
- const n = bars.value.length;
634
- return t("origam.chart.pareto.desc", n);
1081
+ const n = bars.value.length;
1082
+ return t("origam.chart.pareto.desc", n);
635
1083
  });
636
- const barAriaLabel = (bar) => t(
637
- "origam.chart.pareto.bar_aria_label",
638
- bar.category,
639
- bar.formattedValue,
640
- Math.round(bar.share * 100),
641
- Math.round(bar.cumulative * 100)
642
- );
1084
+ const barAriaLabel = (bar) => t("origam.chart.pareto.bar_aria_label", bar.category, bar.formattedValue, Math.round(bar.share * 100), Math.round(bar.cumulative * 100));
1085
+ /*********************************************************
1086
+ * Interaction
1087
+ ********************************************************/
643
1088
  const onBarEnter = (bar) => {
644
- hoveredIndex.value = bar.index;
1089
+ hoveredIndex.value = bar.index;
645
1090
  };
646
1091
  const onBarLeave = () => {
647
- hoveredIndex.value = null;
1092
+ hoveredIndex.value = null;
648
1093
  };
649
1094
  const onSvgMouseMove = (event) => {
650
- const target = svgRef.value;
651
- if (!target) return;
652
- const rect = target.getBoundingClientRect();
653
- mousePos.value = {
654
- x: event.clientX - rect.left,
655
- y: event.clientY - rect.top
656
- };
1095
+ const target = svgRef.value;
1096
+ if (!target) return;
1097
+ const rect = target.getBoundingClientRect();
1098
+ mousePos.value = {
1099
+ x: event.clientX - rect.left,
1100
+ y: event.clientY - rect.top
1101
+ };
657
1102
  };
658
1103
  const onSvgMouseLeave = () => {
659
- onBarLeave();
1104
+ onBarLeave();
660
1105
  };
661
1106
  const onBarActivate = (bar, event) => {
662
- hoveredIndex.value = bar.index;
663
- if (hoveredPoint.value) {
664
- emit("point-click", hoveredPoint.value, event);
665
- }
1107
+ hoveredIndex.value = bar.index;
1108
+ if (hoveredPoint.value) {
1109
+ emit("point-click", hoveredPoint.value, event);
1110
+ }
666
1111
  };
667
1112
  const onLegendClick = (series, index) => {
668
- emit("legend-click", series, index);
1113
+ emit("legend-click", series, index);
669
1114
  };
670
1115
  const onSeriesToggle = (series, visible) => {
671
- emit("series-toggle", series, visible);
1116
+ emit("series-toggle", series, visible);
672
1117
  };
673
1118
  </script>
674
1119