origam 2.38.1 → 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 +24 -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 +6 -6
@@ -79,79 +79,528 @@ import { DIRECTION } from "../../enums/Commons/direction.enum";
79
79
  import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
80
80
  import { calculateCenteredTarget, calculateUpdatedTarget, getClientSize, getOffsetSize, getScrollPosition, getScrollSize } from "../../utils/Slide/slide-group.util";
81
81
  import { focusableChildren } from "../../utils/Commons/commons.util";
82
+ /*********************************************************
83
+ * Global
84
+ *
85
+ * @description
86
+ * Props, emits, composables and group registration.
87
+ ********************************************************/
82
88
  const props = defineProps({
83
- centerActive: { type: Boolean, required: false },
84
- nextIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_RIGHT },
85
- prevIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_LEFT },
86
- showArrows: { type: [Boolean, String], required: false },
87
- id: { type: String, required: false },
88
- class: { type: [String, Array, Object], required: false },
89
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
90
- tag: { type: String, required: false, default: "div" },
91
- direction: { type: null, required: false, default: DIRECTION.HORIZONTAL },
92
- disabled: { type: Boolean, required: false },
93
- modelValue: { type: null, required: false },
94
- multiple: { type: Boolean, required: false },
95
- mandatory: { type: Boolean, required: false },
96
- max: { type: Number, required: false },
97
- selectedClass: { type: String, required: false, default: "origam-slide-group-item--active" },
98
- padding: { type: [Boolean, Number, String], required: false },
99
- paddingTop: { type: [Boolean, Number, String], required: false },
100
- paddingLeft: { type: [Boolean, Number, String], required: false },
101
- paddingBottom: { type: [Boolean, Number, String], required: false },
102
- paddingRight: { type: [Boolean, Number, String], required: false },
103
- paddingBlock: { type: [Boolean, Number, String], required: false },
104
- paddingInline: { type: [Boolean, Number, String], required: false },
105
- paddingInlineStart: { type: [Boolean, Number, String], required: false },
106
- paddingInlineEnd: { type: [Boolean, Number, String], required: false },
107
- paddingBlockStart: { type: [Boolean, Number, String], required: false },
108
- paddingBlockEnd: { type: [Boolean, Number, String], required: false },
109
- margin: { type: [Boolean, Number, String], required: false },
110
- marginTop: { type: [Boolean, Number, String], required: false },
111
- marginLeft: { type: [Boolean, Number, String], required: false },
112
- marginBottom: { type: [Boolean, Number, String], required: false },
113
- marginRight: { type: [Boolean, Number, String], required: false },
114
- marginBlock: { type: [Boolean, Number, String], required: false },
115
- marginInline: { type: [Boolean, Number, String], required: false },
116
- marginInlineStart: { type: [Boolean, Number, String], required: false },
117
- marginInlineEnd: { type: [Boolean, Number, String], required: false },
118
- marginBlockStart: { type: [Boolean, Number, String], required: false },
119
- marginBlockEnd: { type: [Boolean, Number, String], required: false },
120
- rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
121
- roundedTopRight: { type: [Boolean, Number, String], required: false },
122
- roundedTopLeft: { type: [Boolean, Number, String], required: false },
123
- roundedBottomLeft: { type: [Boolean, Number, String], required: false },
124
- roundedBottomRight: { type: [Boolean, Number, String], required: false },
125
- roundedStartStart: { type: [Boolean, Number, String], required: false },
126
- roundedStartEnd: { type: [Boolean, Number, String], required: false },
127
- roundedEndStart: { type: [Boolean, Number, String], required: false },
128
- roundedEndEnd: { type: [Boolean, Number, String], required: false },
129
- border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
130
- borderTop: { type: [Boolean, Number, String], required: false },
131
- borderLeft: { type: [Boolean, Number, String], required: false },
132
- borderBottom: { type: [Boolean, Number, String], required: false },
133
- borderRight: { type: [Boolean, Number, String], required: false },
134
- borderBlock: { type: [Boolean, Number, String], required: false },
135
- borderInline: { type: [Boolean, Number, String], required: false },
136
- borderInlineStart: { type: [Boolean, Number, String], required: false },
137
- borderInlineEnd: { type: [Boolean, Number, String], required: false },
138
- borderBlockStart: { type: [Boolean, Number, String], required: false },
139
- borderBlockEnd: { type: [Boolean, Number, String], required: false },
140
- borderColor: { type: String, required: false },
141
- borderStyle: { type: String, required: false },
142
- borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
143
- borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
144
- borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
145
- borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
146
- borderInlineStartColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
147
- borderInlineEndColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
148
- borderBlockStartColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
149
- borderBlockEndColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
150
- mobileBreakpoint: { type: null, required: false }
89
+ centerActive: {
90
+ type: Boolean,
91
+ required: false
92
+ },
93
+ nextIcon: {
94
+ type: null,
95
+ required: false,
96
+ default: MDI_ICONS.CHEVRON_RIGHT
97
+ },
98
+ prevIcon: {
99
+ type: null,
100
+ required: false,
101
+ default: MDI_ICONS.CHEVRON_LEFT
102
+ },
103
+ showArrows: {
104
+ type: [Boolean, String],
105
+ required: false
106
+ },
107
+ id: {
108
+ type: String,
109
+ required: false
110
+ },
111
+ class: {
112
+ type: [
113
+ String,
114
+ Array,
115
+ Object
116
+ ],
117
+ required: false
118
+ },
119
+ style: {
120
+ type: [
121
+ String,
122
+ Array,
123
+ Object,
124
+ Boolean,
125
+ null
126
+ ],
127
+ required: false,
128
+ skipCheck: true
129
+ },
130
+ tag: {
131
+ type: String,
132
+ required: false,
133
+ default: "div"
134
+ },
135
+ direction: {
136
+ type: null,
137
+ required: false,
138
+ default: DIRECTION.HORIZONTAL
139
+ },
140
+ disabled: {
141
+ type: Boolean,
142
+ required: false
143
+ },
144
+ modelValue: {
145
+ type: null,
146
+ required: false
147
+ },
148
+ multiple: {
149
+ type: Boolean,
150
+ required: false
151
+ },
152
+ mandatory: {
153
+ type: Boolean,
154
+ required: false
155
+ },
156
+ max: {
157
+ type: Number,
158
+ required: false
159
+ },
160
+ selectedClass: {
161
+ type: String,
162
+ required: false,
163
+ default: "origam-slide-group-item--active"
164
+ },
165
+ padding: {
166
+ type: [
167
+ Boolean,
168
+ Number,
169
+ String
170
+ ],
171
+ required: false
172
+ },
173
+ paddingTop: {
174
+ type: [
175
+ Boolean,
176
+ Number,
177
+ String
178
+ ],
179
+ required: false
180
+ },
181
+ paddingLeft: {
182
+ type: [
183
+ Boolean,
184
+ Number,
185
+ String
186
+ ],
187
+ required: false
188
+ },
189
+ paddingBottom: {
190
+ type: [
191
+ Boolean,
192
+ Number,
193
+ String
194
+ ],
195
+ required: false
196
+ },
197
+ paddingRight: {
198
+ type: [
199
+ Boolean,
200
+ Number,
201
+ String
202
+ ],
203
+ required: false
204
+ },
205
+ paddingBlock: {
206
+ type: [
207
+ Boolean,
208
+ Number,
209
+ String
210
+ ],
211
+ required: false
212
+ },
213
+ paddingInline: {
214
+ type: [
215
+ Boolean,
216
+ Number,
217
+ String
218
+ ],
219
+ required: false
220
+ },
221
+ paddingInlineStart: {
222
+ type: [
223
+ Boolean,
224
+ Number,
225
+ String
226
+ ],
227
+ required: false
228
+ },
229
+ paddingInlineEnd: {
230
+ type: [
231
+ Boolean,
232
+ Number,
233
+ String
234
+ ],
235
+ required: false
236
+ },
237
+ paddingBlockStart: {
238
+ type: [
239
+ Boolean,
240
+ Number,
241
+ String
242
+ ],
243
+ required: false
244
+ },
245
+ paddingBlockEnd: {
246
+ type: [
247
+ Boolean,
248
+ Number,
249
+ String
250
+ ],
251
+ required: false
252
+ },
253
+ margin: {
254
+ type: [
255
+ Boolean,
256
+ Number,
257
+ String
258
+ ],
259
+ required: false
260
+ },
261
+ marginTop: {
262
+ type: [
263
+ Boolean,
264
+ Number,
265
+ String
266
+ ],
267
+ required: false
268
+ },
269
+ marginLeft: {
270
+ type: [
271
+ Boolean,
272
+ Number,
273
+ String
274
+ ],
275
+ required: false
276
+ },
277
+ marginBottom: {
278
+ type: [
279
+ Boolean,
280
+ Number,
281
+ String
282
+ ],
283
+ required: false
284
+ },
285
+ marginRight: {
286
+ type: [
287
+ Boolean,
288
+ Number,
289
+ String
290
+ ],
291
+ required: false
292
+ },
293
+ marginBlock: {
294
+ type: [
295
+ Boolean,
296
+ Number,
297
+ String
298
+ ],
299
+ required: false
300
+ },
301
+ marginInline: {
302
+ type: [
303
+ Boolean,
304
+ Number,
305
+ String
306
+ ],
307
+ required: false
308
+ },
309
+ marginInlineStart: {
310
+ type: [
311
+ Boolean,
312
+ Number,
313
+ String
314
+ ],
315
+ required: false
316
+ },
317
+ marginInlineEnd: {
318
+ type: [
319
+ Boolean,
320
+ Number,
321
+ String
322
+ ],
323
+ required: false
324
+ },
325
+ marginBlockStart: {
326
+ type: [
327
+ Boolean,
328
+ Number,
329
+ String
330
+ ],
331
+ required: false
332
+ },
333
+ marginBlockEnd: {
334
+ type: [
335
+ Boolean,
336
+ Number,
337
+ String
338
+ ],
339
+ required: false
340
+ },
341
+ rounded: {
342
+ type: [
343
+ Boolean,
344
+ Number,
345
+ String,
346
+ null
347
+ ],
348
+ required: false,
349
+ skipCheck: true
350
+ },
351
+ roundedTopRight: {
352
+ type: [
353
+ Boolean,
354
+ Number,
355
+ String
356
+ ],
357
+ required: false
358
+ },
359
+ roundedTopLeft: {
360
+ type: [
361
+ Boolean,
362
+ Number,
363
+ String
364
+ ],
365
+ required: false
366
+ },
367
+ roundedBottomLeft: {
368
+ type: [
369
+ Boolean,
370
+ Number,
371
+ String
372
+ ],
373
+ required: false
374
+ },
375
+ roundedBottomRight: {
376
+ type: [
377
+ Boolean,
378
+ Number,
379
+ String
380
+ ],
381
+ required: false
382
+ },
383
+ roundedStartStart: {
384
+ type: [
385
+ Boolean,
386
+ Number,
387
+ String
388
+ ],
389
+ required: false
390
+ },
391
+ roundedStartEnd: {
392
+ type: [
393
+ Boolean,
394
+ Number,
395
+ String
396
+ ],
397
+ required: false
398
+ },
399
+ roundedEndStart: {
400
+ type: [
401
+ Boolean,
402
+ Number,
403
+ String
404
+ ],
405
+ required: false
406
+ },
407
+ roundedEndEnd: {
408
+ type: [
409
+ Boolean,
410
+ Number,
411
+ String
412
+ ],
413
+ required: false
414
+ },
415
+ border: {
416
+ type: [
417
+ Boolean,
418
+ Number,
419
+ String,
420
+ Array
421
+ ],
422
+ required: false,
423
+ skipCheck: true
424
+ },
425
+ borderTop: {
426
+ type: [
427
+ Boolean,
428
+ Number,
429
+ String
430
+ ],
431
+ required: false
432
+ },
433
+ borderLeft: {
434
+ type: [
435
+ Boolean,
436
+ Number,
437
+ String
438
+ ],
439
+ required: false
440
+ },
441
+ borderBottom: {
442
+ type: [
443
+ Boolean,
444
+ Number,
445
+ String
446
+ ],
447
+ required: false
448
+ },
449
+ borderRight: {
450
+ type: [
451
+ Boolean,
452
+ Number,
453
+ String
454
+ ],
455
+ required: false
456
+ },
457
+ borderBlock: {
458
+ type: [
459
+ Boolean,
460
+ Number,
461
+ String
462
+ ],
463
+ required: false
464
+ },
465
+ borderInline: {
466
+ type: [
467
+ Boolean,
468
+ Number,
469
+ String
470
+ ],
471
+ required: false
472
+ },
473
+ borderInlineStart: {
474
+ type: [
475
+ Boolean,
476
+ Number,
477
+ String
478
+ ],
479
+ required: false
480
+ },
481
+ borderInlineEnd: {
482
+ type: [
483
+ Boolean,
484
+ Number,
485
+ String
486
+ ],
487
+ required: false
488
+ },
489
+ borderBlockStart: {
490
+ type: [
491
+ Boolean,
492
+ Number,
493
+ String
494
+ ],
495
+ required: false
496
+ },
497
+ borderBlockEnd: {
498
+ type: [
499
+ Boolean,
500
+ Number,
501
+ String
502
+ ],
503
+ required: false
504
+ },
505
+ borderColor: {
506
+ type: String,
507
+ required: false
508
+ },
509
+ borderStyle: {
510
+ type: String,
511
+ required: false
512
+ },
513
+ borderTopColor: {
514
+ type: [
515
+ String,
516
+ Object,
517
+ Boolean,
518
+ null
519
+ ],
520
+ required: false,
521
+ skipCheck: true
522
+ },
523
+ borderRightColor: {
524
+ type: [
525
+ String,
526
+ Object,
527
+ Boolean,
528
+ null
529
+ ],
530
+ required: false,
531
+ skipCheck: true
532
+ },
533
+ borderBottomColor: {
534
+ type: [
535
+ String,
536
+ Object,
537
+ Boolean,
538
+ null
539
+ ],
540
+ required: false,
541
+ skipCheck: true
542
+ },
543
+ borderLeftColor: {
544
+ type: [
545
+ String,
546
+ Object,
547
+ Boolean,
548
+ null
549
+ ],
550
+ required: false,
551
+ skipCheck: true
552
+ },
553
+ borderInlineStartColor: {
554
+ type: [
555
+ String,
556
+ Object,
557
+ Boolean,
558
+ null
559
+ ],
560
+ required: false,
561
+ skipCheck: true
562
+ },
563
+ borderInlineEndColor: {
564
+ type: [
565
+ String,
566
+ Object,
567
+ Boolean,
568
+ null
569
+ ],
570
+ required: false,
571
+ skipCheck: true
572
+ },
573
+ borderBlockStartColor: {
574
+ type: [
575
+ String,
576
+ Object,
577
+ Boolean,
578
+ null
579
+ ],
580
+ required: false,
581
+ skipCheck: true
582
+ },
583
+ borderBlockEndColor: {
584
+ type: [
585
+ String,
586
+ Object,
587
+ Boolean,
588
+ null
589
+ ],
590
+ required: false,
591
+ skipCheck: true
592
+ },
593
+ mobileBreakpoint: {
594
+ type: null,
595
+ required: false
596
+ }
151
597
  });
152
598
  defineEmits(["update:modelValue"]);
153
599
  defineSlots();
154
600
  const { filterProps } = useProps(props);
601
+ /*********************************************************
602
+ * Composables
603
+ ********************************************************/
155
604
  const { roundedClasses, roundedStyles } = useRounded(props);
156
605
  const { borderClasses, borderStyles } = useBorder(props);
157
606
  const { paddingClasses, paddingStyles } = usePadding(props);
@@ -159,6 +608,31 @@ const { marginClasses, marginStyles } = useMargin(props);
159
608
  const { displayClasses, mobile } = useDisplay(props);
160
609
  const group = useGroup(props, ORIGAM_SLIDE_GROUP_KEY);
161
610
  const isOverflowing = shallowRef(false);
611
+ /*********************************************************
612
+ * hasFocusableContent — scrollable-region-focusable (a11y baseline)
613
+ *
614
+ * @description
615
+ * `.origam-slide-group__container` is the element that actually
616
+ * scrolls (`overflow-x: auto`) — axe-core's
617
+ * `scrollable-region-focusable` rule requires it to be reachable by
618
+ * keyboard, either through its own `tabindex` or a focusable
619
+ * descendant. The DS's one real consumer (`OrigamChipGroup`) always
620
+ * slots in focusable items, so the container is already reachable —
621
+ * giving it a `tabindex` unconditionally would insert a redundant
622
+ * stop BEFORE those items. It is therefore only made focusable when
623
+ * the slotted content has no focusable descendant at all (see the
624
+ * `:tabindex` binding on `__container`), which is exactly the shape
625
+ * of a `<origam-slide-group>` used directly with plain, non-
626
+ * interactive children.
627
+ *
628
+ * @description
629
+ * The root (`<component :is="tag">`) already carries a conditional
630
+ * `tabindex` of its own, but that is a DIFFERENT mechanism (a roving-
631
+ * tabindex proxy that redirects focus to the first group item on
632
+ * `focus`, cf. `handleFocus`) — it is not read by axe here because
633
+ * `__container`, the scrollable element, is not an ancestor of the
634
+ * root, so the root's tabindex cannot satisfy this rule.
635
+ ********************************************************/
162
636
  const hasFocusableContent = shallowRef(false);
163
637
  const scrollOffset = shallowRef(0);
164
638
  const containerSize = shallowRef(0);
@@ -169,242 +643,283 @@ const { resizeRef: contentRef, contentRect } = useResizeObserver();
169
643
  const { isRtl } = useRtl();
170
644
  const goTo = useGoTo();
171
645
  const goToOptions = computed(() => {
172
- return {
173
- container: containerRef.value,
174
- duration: 200,
175
- easing: "easeOutQuart"
176
- };
646
+ return {
647
+ container: containerRef.value,
648
+ duration: 200,
649
+ easing: "easeOutQuart"
650
+ };
177
651
  });
178
652
  const firstSelectedIndex = computed(() => {
179
- if (!group.selected.value.length) return -1;
180
- return group.items.value.findIndex((item) => item.id === group.selected.value[0]);
653
+ if (!group.selected.value.length) return -1;
654
+ return group.items.value.findIndex((item) => item.id === group.selected.value[0]);
181
655
  });
182
656
  const lastSelectedIndex = computed(() => {
183
- if (!group.selected.value.length) return -1;
184
- return group.items.value.findIndex((item) => item.id === group.selected.value[group.selected.value.length - 1]);
657
+ if (!group.selected.value.length) return -1;
658
+ return group.items.value.findIndex((item) => item.id === group.selected.value[group.selected.value.length - 1]);
185
659
  });
186
660
  if (IN_BROWSER) {
187
- let frame = -1;
188
- watch(() => [group.selected.value, containerRect.value, contentRect.value, isHorizontal.value], () => {
189
- cancelAnimationFrame(frame);
190
- frame = requestAnimationFrame(() => {
191
- if (containerRect.value && contentRect.value) {
192
- const sizeProperty = isHorizontal.value ? "width" : "height";
193
- containerSize.value = containerRect.value[sizeProperty];
194
- contentSize.value = contentRect.value[sizeProperty];
195
- isOverflowing.value = containerSize.value + 1 < contentSize.value;
196
- }
197
- if (contentRef.value) {
198
- hasFocusableContent.value = focusableChildren(contentRef.value).length > 0;
199
- }
200
- if (firstSelectedIndex.value >= 0 && contentRef.value) {
201
- const selectedElement = contentRef.value.children[lastSelectedIndex.value];
202
- scrollToChildren(selectedElement, props.centerActive);
203
- }
204
- });
205
- });
661
+ let frame = -1;
662
+ watch(() => [
663
+ group.selected.value,
664
+ containerRect.value,
665
+ contentRect.value,
666
+ isHorizontal.value
667
+ ], () => {
668
+ cancelAnimationFrame(frame);
669
+ frame = requestAnimationFrame(() => {
670
+ if (containerRect.value && contentRect.value) {
671
+ const sizeProperty = isHorizontal.value ? "width" : "height";
672
+ containerSize.value = containerRect.value[sizeProperty];
673
+ contentSize.value = contentRect.value[sizeProperty];
674
+ isOverflowing.value = containerSize.value + 1 < contentSize.value;
675
+ }
676
+ if (contentRef.value) {
677
+ hasFocusableContent.value = focusableChildren(contentRef.value).length > 0;
678
+ }
679
+ if (firstSelectedIndex.value >= 0 && contentRef.value) {
680
+ // TODO: Is this too naive? Should we store element references in group composable?
681
+ const selectedElement = contentRef.value.children[lastSelectedIndex.value];
682
+ scrollToChildren(selectedElement, props.centerActive);
683
+ }
684
+ });
685
+ });
206
686
  }
207
687
  const isFocused = shallowRef(false);
688
+ /*********************************************************
689
+ * Scroll helpers
690
+ *
691
+ * @description
692
+ * Scroll-to-children and scroll-to-position utilities.
693
+ ********************************************************/
208
694
  const scrollToChildren = (children, center) => {
209
- let target = calculateUpdatedTarget({
210
- containerElement: containerRef.value,
211
- isHorizontal: isHorizontal.value,
212
- isRtl: isRtl.value,
213
- selectedElement: children
214
- });
215
- if (center) {
216
- target = calculateCenteredTarget({
217
- containerElement: containerRef.value,
218
- isHorizontal: isHorizontal.value,
219
- selectedElement: children
220
- });
221
- }
222
- scrollToPosition(target);
695
+ let target = calculateUpdatedTarget({
696
+ containerElement: containerRef.value,
697
+ isHorizontal: isHorizontal.value,
698
+ isRtl: isRtl.value,
699
+ selectedElement: children
700
+ });
701
+ if (center) {
702
+ target = calculateCenteredTarget({
703
+ containerElement: containerRef.value,
704
+ isHorizontal: isHorizontal.value,
705
+ selectedElement: children
706
+ });
707
+ }
708
+ scrollToPosition(target);
223
709
  };
224
710
  const scrollToPosition = (newPosition) => {
225
- if (!IN_BROWSER || !containerRef.value) return;
226
- const offsetSize = getOffsetSize(isHorizontal.value, containerRef.value);
227
- const scrollPosition = getScrollPosition(isHorizontal.value, isRtl.value, containerRef.value);
228
- const scrollSize = getScrollSize(isHorizontal.value, containerRef.value);
229
- if (scrollSize <= offsetSize || // Prevent scrolling by only a couple of pixels, which doesn't look smooth
230
- Math.abs(newPosition - scrollPosition) < 16) return;
231
- if (isHorizontal.value && isRtl.value && containerRef.value) {
232
- const { scrollWidth, offsetWidth: containerWidth } = containerRef.value;
233
- newPosition = scrollWidth - containerWidth - newPosition;
234
- }
235
- if (isHorizontal.value) {
236
- goTo.horizontal(newPosition, goToOptions.value);
237
- } else {
238
- goTo(newPosition, goToOptions.value);
239
- }
711
+ if (!IN_BROWSER || !containerRef.value) return;
712
+ const offsetSize = getOffsetSize(isHorizontal.value, containerRef.value);
713
+ const scrollPosition = getScrollPosition(isHorizontal.value, isRtl.value, containerRef.value);
714
+ const scrollSize = getScrollSize(isHorizontal.value, containerRef.value);
715
+ if (scrollSize <= offsetSize || Math.abs(newPosition - scrollPosition) < 16) return;
716
+ // In RTL, scroll positions are mirrored: position 0 is the
717
+ // right-most edge and increases as you go left. Flip
718
+ // `newPosition` against the max scrollable distance so the
719
+ // caller always works in LTR-style coordinates. In LTR, leave
720
+ // the requested position untouched — the previous code applied
721
+ // this flip unconditionally, which sent every "go to N" call
722
+ // to `(maxScroll − N)` instead of `N`. With a 5-tab viewport
723
+ // that meant clicking "next" jumped past the middle of the
724
+ // list and skipped tabs.
725
+ if (isHorizontal.value && isRtl.value && containerRef.value) {
726
+ const { scrollWidth, offsetWidth: containerWidth } = containerRef.value;
727
+ newPosition = scrollWidth - containerWidth - newPosition;
728
+ }
729
+ if (isHorizontal.value) {
730
+ goTo.horizontal(newPosition, goToOptions.value);
731
+ } else {
732
+ goTo(newPosition, goToOptions.value);
733
+ }
240
734
  };
735
+ /*********************************************************
736
+ * Event handlers
737
+ *
738
+ * @description
739
+ * Scroll, focus, keyboard and affix click handlers.
740
+ ********************************************************/
241
741
  const handleScroll = (e) => {
242
- const { scrollTop, scrollLeft } = e.target;
243
- scrollOffset.value = isHorizontal.value ? scrollLeft : scrollTop;
742
+ const { scrollTop, scrollLeft } = e.target;
743
+ scrollOffset.value = isHorizontal.value ? scrollLeft : scrollTop;
244
744
  };
245
745
  const handleFocusin = (e) => {
246
- isFocused.value = true;
247
- if (!isOverflowing.value || !contentRef.value) return;
248
- for (const el of e.composedPath()) {
249
- for (const item of contentRef.value.children) {
250
- if (item === el) {
251
- scrollToChildren(item);
252
- return;
253
- }
254
- }
255
- }
746
+ isFocused.value = true;
747
+ if (!isOverflowing.value || !contentRef.value) return;
748
+ // Focused element is likely to be the root of an item, so a
749
+ // breadth-first search will probably find it in the first iteration
750
+ for (const el of e.composedPath()) {
751
+ for (const item of contentRef.value.children) {
752
+ if (item === el) {
753
+ scrollToChildren(item);
754
+ return;
755
+ }
756
+ }
757
+ }
256
758
  };
257
759
  const handleFocusout = () => {
258
- isFocused.value = false;
760
+ isFocused.value = false;
259
761
  };
762
+ // Affix clicks produce onFocus that we have to ignore to avoid extra scrollToChildren
260
763
  let ignoreFocusEvent = false;
261
764
  const handleFocus = (e) => {
262
- if (!ignoreFocusEvent && !isFocused.value && !(e.relatedTarget && contentRef.value?.contains(e.relatedTarget))) focus();
263
- ignoreFocusEvent = false;
765
+ if (!ignoreFocusEvent && !isFocused.value && !(e.relatedTarget && contentRef.value?.contains(e.relatedTarget))) focus();
766
+ ignoreFocusEvent = false;
264
767
  };
265
768
  const handleFocusAffixes = () => {
266
- ignoreFocusEvent = true;
769
+ ignoreFocusEvent = true;
267
770
  };
268
771
  const handleKeydown = (e) => {
269
- if (!contentRef.value) return;
270
- const toFocus = (location) => {
271
- e.preventDefault();
272
- focus(location);
273
- };
274
- if (isHorizontal.value) {
275
- if (e.key === "ArrowRight") {
276
- toFocus("next");
277
- } else if (e.key === "ArrowLeft") {
278
- toFocus("prev");
279
- }
280
- } else {
281
- if (e.key === "ArrowDown") {
282
- toFocus("next");
283
- } else if (e.key === "ArrowUp") {
284
- toFocus("prev");
285
- }
286
- }
287
- if (e.key === "Home") {
288
- toFocus("first");
289
- } else if (e.key === "End") {
290
- toFocus("last");
291
- }
772
+ if (!contentRef.value) return;
773
+ const toFocus = (location) => {
774
+ e.preventDefault();
775
+ focus(location);
776
+ };
777
+ if (isHorizontal.value) {
778
+ if (e.key === "ArrowRight") {
779
+ toFocus("next");
780
+ } else if (e.key === "ArrowLeft") {
781
+ toFocus("prev");
782
+ }
783
+ } else {
784
+ if (e.key === "ArrowDown") {
785
+ toFocus("next");
786
+ } else if (e.key === "ArrowUp") {
787
+ toFocus("prev");
788
+ }
789
+ }
790
+ if (e.key === "Home") {
791
+ toFocus("first");
792
+ } else if (e.key === "End") {
793
+ toFocus("last");
794
+ }
292
795
  };
293
796
  const focus = (location) => {
294
- if (!contentRef.value) return;
295
- let el;
296
- if (!location) {
297
- const focusable = focusableChildren(contentRef.value);
298
- el = focusable[0];
299
- } else if (location === "next") {
300
- el = contentRef.value.querySelector(":focus")?.nextElementSibling;
301
- if (!el) return focus("first");
302
- } else if (location === "prev") {
303
- el = contentRef.value.querySelector(":focus")?.previousElementSibling;
304
- if (!el) return focus("last");
305
- } else if (location === "first") {
306
- el = contentRef.value.firstElementChild;
307
- } else if (location === "last") {
308
- el = contentRef.value.lastElementChild;
309
- }
310
- if (el) {
311
- el.focus({ preventScroll: true });
312
- }
797
+ if (!contentRef.value) return;
798
+ let el;
799
+ if (!location) {
800
+ const focusable = focusableChildren(contentRef.value);
801
+ el = focusable[0];
802
+ } else if (location === "next") {
803
+ el = contentRef.value.querySelector(":focus")?.nextElementSibling;
804
+ if (!el) return focus("first");
805
+ } else if (location === "prev") {
806
+ el = contentRef.value.querySelector(":focus")?.previousElementSibling;
807
+ if (!el) return focus("last");
808
+ } else if (location === "first") {
809
+ el = contentRef.value.firstElementChild;
810
+ } else if (location === "last") {
811
+ el = contentRef.value.lastElementChild;
812
+ }
813
+ if (el) {
814
+ el.focus({ preventScroll: true });
815
+ }
313
816
  };
314
817
  const scrollTo = (location) => {
315
- const offsetStep = (location === "prev" ? -1 : 1) * containerSize.value;
316
- scrollToPosition(scrollOffset.value + offsetStep);
818
+ // Step one container-width per click, in the direction of the
819
+ // affix. The previous implementation added `scrollWidth -
820
+ // containerWidth` on top of the step, jumping straight to the
821
+ // far end on the first click and then walking back from there —
822
+ // arrows looked broken. A pure `currentOffset ± containerSize`
823
+ // behaviour is the standard pattern for slide groups.
824
+ const offsetStep = (location === "prev" ? -1 : 1) * containerSize.value;
825
+ scrollToPosition(scrollOffset.value + offsetStep);
317
826
  };
827
+ /*********************************************************
828
+ * Affixes & slot props
829
+ *
830
+ * @description
831
+ * Arrow visibility logic and group slot props.
832
+ ********************************************************/
318
833
  const slotProps = computed(() => ({
319
- next: group.next,
320
- prev: group.prev,
321
- select: group.select,
322
- isSelected: group.isSelected
834
+ next: group.next,
835
+ prev: group.prev,
836
+ select: group.select,
837
+ isSelected: group.isSelected
323
838
  }));
324
839
  const hasAffixes = computed(() => {
325
- switch (props.showArrows) {
326
- // Always show arrows on desktop & mobile
327
- case "always":
328
- return true;
329
- // Always show arrows on desktop
330
- case "desktop":
331
- return !mobile.value;
332
- // Show arrows on mobile when overflowing.
333
- // This matches the default 2.2 behavior
334
- case true:
335
- return isOverflowing.value || Math.abs(scrollOffset.value) > 0;
336
- // Always show on mobile
337
- case "mobile":
338
- return mobile.value || (isOverflowing.value || Math.abs(scrollOffset.value) > 0);
339
- // https://material.io/components/tabs#scrollable-tabs
340
- // Always show arrows when
341
- // overflowed on desktop
342
- default:
343
- return !mobile.value && (isOverflowing.value || Math.abs(scrollOffset.value) > 0);
344
- }
840
+ switch (props.showArrows) {
841
+ // Always show arrows on desktop & mobile
842
+ case "always": return true;
843
+ // Always show arrows on desktop
844
+ case "desktop": return !mobile.value;
845
+ // Show arrows on mobile when overflowing.
846
+ // This matches the default 2.2 behavior
847
+ case true: return isOverflowing.value || Math.abs(scrollOffset.value) > 0;
848
+ // Always show on mobile
849
+ case "mobile": return mobile.value || isOverflowing.value || Math.abs(scrollOffset.value) > 0;
850
+ // https://material.io/components/tabs#scrollable-tabs
851
+ // Always show arrows when
852
+ // overflowed on desktop
853
+ default: return !mobile.value && (isOverflowing.value || Math.abs(scrollOffset.value) > 0);
854
+ }
345
855
  });
346
856
  const hasPrev = computed(() => {
347
- return Math.abs(scrollOffset.value) > 1;
857
+ // 1 pixel in reserve, may be lost after rounding
858
+ return Math.abs(scrollOffset.value) > 1;
348
859
  });
349
860
  const hasNext = computed(() => {
350
- if (!containerRef.value) return false;
351
- const scrollSize = getScrollSize(isHorizontal.value, containerRef.value);
352
- const clientSize = getClientSize(isHorizontal.value, containerRef.value);
353
- const scrollSizeMax = scrollSize - clientSize;
354
- return scrollSizeMax - Math.abs(scrollOffset.value) > 1;
861
+ if (!containerRef.value) return false;
862
+ const scrollSize = getScrollSize(isHorizontal.value, containerRef.value);
863
+ const clientSize = getClientSize(isHorizontal.value, containerRef.value);
864
+ const scrollSizeMax = scrollSize - clientSize;
865
+ // 1 pixel in reserve, may be lost after rounding
866
+ return scrollSizeMax - Math.abs(scrollOffset.value) > 1;
355
867
  });
868
+ /*********************************************************
869
+ * Class & Style
870
+ *
871
+ * @description
872
+ * Root element classes and inline styles.
873
+ ********************************************************/
356
874
  const slideGroupStyles = computed(() => {
357
- return [
358
- roundedStyles.value,
359
- borderStyles.value,
360
- paddingStyles.value,
361
- marginStyles.value,
362
- props.style
363
- ];
875
+ return [
876
+ roundedStyles.value,
877
+ borderStyles.value,
878
+ paddingStyles.value,
879
+ marginStyles.value,
880
+ props.style
881
+ ];
364
882
  });
365
883
  const slideGroupClasses = computed(() => {
366
- return [
367
- "origam-slide-group",
368
- {
369
- "origam-slide-group--vertical": !isHorizontal.value,
370
- "origam-slide-group--has-affixes": hasAffixes.value,
371
- "origam-slide-group--is-overflowing": isOverflowing.value
372
- },
373
- displayClasses.value,
374
- roundedClasses.value,
375
- borderClasses.value,
376
- paddingClasses.value,
377
- marginClasses.value,
378
- props.class
379
- ];
884
+ return [
885
+ "origam-slide-group",
886
+ {
887
+ "origam-slide-group--vertical": !isHorizontal.value,
888
+ "origam-slide-group--has-affixes": hasAffixes.value,
889
+ "origam-slide-group--is-overflowing": isOverflowing.value
890
+ },
891
+ displayClasses.value,
892
+ roundedClasses.value,
893
+ borderClasses.value,
894
+ paddingClasses.value,
895
+ marginClasses.value,
896
+ props.class
897
+ ];
380
898
  });
381
899
  const slideGroupPrevClasses = computed(() => {
382
- return [
383
- "origam-slide-group__prev",
384
- {
385
- "origam-slide-group__prev--disabled": !hasPrev.value
386
- }
387
- ];
900
+ return ["origam-slide-group__prev", { "origam-slide-group__prev--disabled": !hasPrev.value }];
388
901
  });
389
902
  const slideGroupNextClasses = computed(() => {
390
- return [
391
- "origam-slide-group__next",
392
- {
393
- // Was `!hasPrev.value` (copy-paste from the prev affix
394
- // classes) — the next button stayed enabled at the end
395
- // of the scroll and disabled at the start.
396
- "origam-slide-group__next--disabled": !hasNext.value
397
- }
398
- ];
903
+ return ["origam-slide-group__next", {
904
+ // Was `!hasPrev.value` (copy-paste from the prev affix
905
+ // classes) — the next button stayed enabled at the end
906
+ // of the scroll and disabled at the start.
907
+ "origam-slide-group__next--disabled": !hasNext.value }];
399
908
  });
400
909
  const { id, css, load, isLoaded, unload } = useStyle(slideGroupStyles, () => props.id);
910
+ /*********************************************************
911
+ * Expose
912
+ *
913
+ * @description
914
+ * Public API surface exposed to parent components.
915
+ ********************************************************/
401
916
  defineExpose({
402
- filterProps,
403
- css,
404
- id,
405
- load,
406
- unload,
407
- isLoaded
917
+ filterProps,
918
+ css,
919
+ id,
920
+ load,
921
+ unload,
922
+ isLoaded
408
923
  });
409
924
  </script>
410
925