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
@@ -131,191 +131,399 @@ import { DIRECTION } from "../../enums/Commons/direction.enum";
131
131
  import { INFINITE_SCROLL_MODE, INFINITE_SCROLL_SIDE, INFINITE_SCROLL_STATUS } from "../../enums/InfiniteScroll/infinite-scroll.enum";
132
132
  import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
133
133
  import { focusableChildren } from "../../utils/Commons/commons.util";
134
+ /*********************************************************
135
+ * Global
136
+ *
137
+ * @description
138
+ * Props, emits, and composable setup.
139
+ ********************************************************/
134
140
  const props = defineProps({
135
- side: { type: null, required: false, default: INFINITE_SCROLL_SIDE.END },
136
- mode: { type: null, required: false, default: INFINITE_SCROLL_MODE.INTERSECT },
137
- loadMoreText: { type: String, required: false, default: "origam.infinite_scroll.load_more" },
138
- emptyText: { type: String, required: false, default: "origam.infinite_scroll.empty" },
139
- margin: { type: String, required: false },
140
- id: { type: String, required: false },
141
- class: { type: [String, Array, Object], required: false },
142
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
143
- color: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
144
- bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
145
- height: { type: [Number, String], required: false },
146
- maxHeight: { type: [Number, String], required: false },
147
- maxWidth: { type: [Number, String], required: false },
148
- minHeight: { type: [Number, String], required: false },
149
- minWidth: { type: [Number, String], required: false },
150
- width: { type: [Number, String], required: false },
151
- tag: { type: String, required: false, default: "div" },
152
- direction: { type: null, required: false, default: DIRECTION.VERTICAL },
153
- fontSize: { type: null, required: false }
141
+ side: {
142
+ type: null,
143
+ required: false,
144
+ default: INFINITE_SCROLL_SIDE.END
145
+ },
146
+ mode: {
147
+ type: null,
148
+ required: false,
149
+ default: INFINITE_SCROLL_MODE.INTERSECT
150
+ },
151
+ loadMoreText: {
152
+ type: String,
153
+ required: false,
154
+ default: "origam.infinite_scroll.load_more"
155
+ },
156
+ emptyText: {
157
+ type: String,
158
+ required: false,
159
+ default: "origam.infinite_scroll.empty"
160
+ },
161
+ margin: {
162
+ type: String,
163
+ required: false
164
+ },
165
+ id: {
166
+ type: String,
167
+ required: false
168
+ },
169
+ class: {
170
+ type: [
171
+ String,
172
+ Array,
173
+ Object
174
+ ],
175
+ required: false
176
+ },
177
+ style: {
178
+ type: [
179
+ String,
180
+ Array,
181
+ Object,
182
+ Boolean,
183
+ null
184
+ ],
185
+ required: false,
186
+ skipCheck: true
187
+ },
188
+ color: {
189
+ type: [
190
+ String,
191
+ Object,
192
+ Boolean,
193
+ null
194
+ ],
195
+ required: false,
196
+ skipCheck: true
197
+ },
198
+ bgColor: {
199
+ type: [
200
+ String,
201
+ Object,
202
+ Boolean,
203
+ null
204
+ ],
205
+ required: false,
206
+ skipCheck: true
207
+ },
208
+ height: {
209
+ type: [Number, String],
210
+ required: false
211
+ },
212
+ maxHeight: {
213
+ type: [Number, String],
214
+ required: false
215
+ },
216
+ maxWidth: {
217
+ type: [Number, String],
218
+ required: false
219
+ },
220
+ minHeight: {
221
+ type: [Number, String],
222
+ required: false
223
+ },
224
+ minWidth: {
225
+ type: [Number, String],
226
+ required: false
227
+ },
228
+ width: {
229
+ type: [Number, String],
230
+ required: false
231
+ },
232
+ tag: {
233
+ type: String,
234
+ required: false,
235
+ default: "div"
236
+ },
237
+ direction: {
238
+ type: null,
239
+ required: false,
240
+ default: DIRECTION.VERTICAL
241
+ },
242
+ fontSize: {
243
+ type: null,
244
+ required: false
245
+ }
154
246
  });
155
247
  const emits = defineEmits(["load"]);
156
248
  defineSlots();
157
249
  const { filterProps } = useProps(props);
158
250
  const { t } = useLocale();
251
+ /*********************************************************
252
+ * Composables
253
+ ********************************************************/
159
254
  const { dimensionStyles } = useDimension(props);
255
+ // Phase 3 (Vague D) — class-first companion alongside inline styles.
256
+ // BEM-child surface: .origam-infinite-scroll__side reads
257
+ // --origam-infinite-scroll__loader---font-size. Bound directly on both
258
+ // __side divs; only fontSize has a real visual effect (no font-weight /
259
+ // font-family / line-height / letter-spacing rule in the SCSS).
160
260
  const { typographyStyles } = useTypography(props, "infinite-scroll__loader");
261
+ /*********************************************************
262
+ * Color
263
+ ********************************************************/
161
264
  const { colorClasses, colorStyles } = useBothColor(toRef(props, "bgColor"), toRef(props, "color"));
162
265
  const rootEl = ref();
163
266
  const isIntersecting = shallowRef(false);
267
+ /*********************************************************
268
+ * hasFocusableDescendant — scrollable-region-focusable (a11y baseline)
269
+ *
270
+ * @description
271
+ * The root renders `overflow-y: auto` unconditionally, so as soon as
272
+ * the `default` slot's content is taller than the container it
273
+ * becomes a genuinely scrollable region. axe-core's
274
+ * `scrollable-region-focusable` rule requires such a region to be
275
+ * reachable by keyboard: either it carries its own `tabindex`, or it
276
+ * contains at least one focusable descendant already in the tab
277
+ * order.
278
+ *
279
+ * @description
280
+ * Most real consumers slot in interactive rows (links, buttons) —
281
+ * axe already passes there, and forcing `tabindex="0"` on the root
282
+ * regardless would add a redundant tab stop in front of content
283
+ * that is already reachable. The root is therefore only made
284
+ * focusable when the slotted content has NO focusable descendant at
285
+ * all (the exact shape of the `intersect`-mode default story: plain
286
+ * non-interactive rows) — the one case where the region would
287
+ * otherwise be unreachable by keyboard entirely.
288
+ *
289
+ * @description
290
+ * Recomputed on every DOM mutation inside the root — infinite
291
+ * scroll content changes constantly (rows are appended on
292
+ * `@load`), so a value captured only once at mount would go stale
293
+ * the moment the first page of results lands.
294
+ ********************************************************/
164
295
  const hasFocusableDescendant = shallowRef(false);
165
296
  let focusableObserver;
166
297
  const refreshHasFocusableDescendant = () => {
167
- if (!rootEl.value) return;
168
- hasFocusableDescendant.value = focusableChildren(rootEl.value).length > 0;
298
+ if (!rootEl.value) return;
299
+ hasFocusableDescendant.value = focusableChildren(rootEl.value).length > 0;
169
300
  };
170
301
  onMounted(() => {
171
- if (!IN_BROWSER || !rootEl.value) return;
172
- refreshHasFocusableDescendant();
173
- focusableObserver = new MutationObserver(refreshHasFocusableDescendant);
174
- focusableObserver.observe(rootEl.value, { childList: true, subtree: true });
302
+ if (!IN_BROWSER || !rootEl.value) return;
303
+ refreshHasFocusableDescendant();
304
+ focusableObserver = new MutationObserver(refreshHasFocusableDescendant);
305
+ focusableObserver.observe(rootEl.value, {
306
+ childList: true,
307
+ subtree: true
308
+ });
175
309
  });
176
310
  onBeforeUnmount(() => {
177
- focusableObserver?.disconnect();
311
+ focusableObserver?.disconnect();
178
312
  });
179
313
  const propertyDirection = computed(() => {
180
- return props.direction === DIRECTION.VERTICAL ? "scrollTop" : "scrollLeft";
314
+ return props.direction === DIRECTION.VERTICAL ? "scrollTop" : "scrollLeft";
181
315
  });
182
316
  const propertySize = computed(() => {
183
- return props.direction === DIRECTION.VERTICAL ? "scrollHeight" : "scrollWidth";
317
+ return props.direction === DIRECTION.VERTICAL ? "scrollHeight" : "scrollWidth";
184
318
  });
185
319
  const propertyContainerSize = computed(() => {
186
- return props.direction === DIRECTION.VERTICAL ? "clientHeight" : "clientWidth";
320
+ return props.direction === DIRECTION.VERTICAL ? "clientHeight" : "clientWidth";
187
321
  });
188
322
  const getScrollAmount = () => {
189
- if (!rootEl.value) return 0;
190
- return rootEl.value[propertyDirection.value];
323
+ if (!rootEl.value) return 0;
324
+ return rootEl.value[propertyDirection.value];
191
325
  };
192
326
  const setScrollAmount = (amount) => {
193
- if (!rootEl.value) return;
194
- rootEl.value[propertyDirection.value] = amount;
327
+ if (!rootEl.value) return;
328
+ rootEl.value[propertyDirection.value] = amount;
195
329
  };
196
330
  const getScrollSize = () => {
197
- if (!rootEl.value) return 0;
198
- return rootEl.value[propertySize.value];
331
+ if (!rootEl.value) return 0;
332
+ return rootEl.value[propertySize.value];
199
333
  };
200
334
  const getContainerSize = () => {
201
- if (!rootEl.value) return 0;
202
- return rootEl.value[propertyContainerSize.value];
335
+ if (!rootEl.value) return 0;
336
+ return rootEl.value[propertyContainerSize.value];
203
337
  };
204
338
  onMounted(() => {
205
- if (!rootEl.value) return;
206
- if (props.side === INFINITE_SCROLL_SIDE.START) {
207
- setScrollAmount(getScrollSize());
208
- } else if (props.side === INFINITE_SCROLL_SIDE.BOTH) {
209
- setScrollAmount(getScrollSize() / 2 - getContainerSize() / 2);
210
- }
339
+ if (!rootEl.value) return;
340
+ if (props.side === INFINITE_SCROLL_SIDE.START) {
341
+ setScrollAmount(getScrollSize());
342
+ } else if (props.side === INFINITE_SCROLL_SIDE.BOTH) {
343
+ setScrollAmount(getScrollSize() / 2 - getContainerSize() / 2);
344
+ }
211
345
  });
212
346
  const currentSide = shallowRef(INFINITE_SCROLL_SIDE.START);
213
347
  const startStatus = shallowRef(INFINITE_SCROLL_STATUS.OK);
214
348
  const endStatus = shallowRef(INFINITE_SCROLL_STATUS.OK);
215
349
  const status = computed({
216
- get() {
217
- return currentSide.value === INFINITE_SCROLL_SIDE.START ? startStatus.value : endStatus.value;
218
- },
219
- set(status2) {
220
- if (currentSide.value === INFINITE_SCROLL_SIDE.START) {
221
- startStatus.value = status2;
222
- } else if (currentSide.value === INFINITE_SCROLL_SIDE.END) {
223
- endStatus.value = status2;
224
- }
225
- }
350
+ get() {
351
+ return currentSide.value === INFINITE_SCROLL_SIDE.START ? startStatus.value : endStatus.value;
352
+ },
353
+ set(status) {
354
+ if (currentSide.value === INFINITE_SCROLL_SIDE.START) {
355
+ startStatus.value = status;
356
+ } else if (currentSide.value === INFINITE_SCROLL_SIDE.END) {
357
+ endStatus.value = status;
358
+ }
359
+ }
226
360
  });
227
361
  let previousScrollSize = 0;
362
+ /*********************************************************
363
+ * Event handlers
364
+ ********************************************************/
228
365
  const handleIntersect = ({ side, isIntersecting: _isIntersecting }) => {
229
- isIntersecting.value = _isIntersecting;
230
- if (isIntersecting.value) {
231
- intersecting(side);
232
- }
366
+ isIntersecting.value = _isIntersecting;
367
+ if (isIntersecting.value) {
368
+ intersecting(side);
369
+ }
233
370
  };
234
- const frames = /* @__PURE__ */ new Set();
371
+ /*********************************************************
372
+ * scheduleFrame — rAF bound to the component's lifetime (#719)
373
+ *
374
+ * @description
375
+ * `done()` re-arms the intersection three frames later, through two
376
+ * `nextTick`s. Nothing used to cancel that chain, so a component
377
+ * unmounted in between kept a continuation queued on a torn-down
378
+ * environment — the family measured in #706: under Vitest the frame
379
+ * lands AFTER jsdom is destroyed, `window` no longer exists, and the
380
+ * *scheduler* itself (`window.requestAnimationFrame` on the next
381
+ * rung) throws `ReferenceError: window is not defined`. That failure
382
+ * kills the whole run with zero red tests.
383
+ *
384
+ * @description
385
+ * One mechanism, both failure modes: `onBeforeUnmount` cancels the
386
+ * frame already armed AND flips `disposed`, which makes any LATER
387
+ * scheduling attempt a no-op — needed because the scheduling here is
388
+ * itself deferred behind two `nextTick`s, so at unmount time there is
389
+ * not always a handle to cancel yet.
390
+ *
391
+ * @description
392
+ * Every armed id is tracked, NOT just the latest: `done()` is called
393
+ * once per side, so two chains can be in flight at the same time and
394
+ * a single handle would lose one of them.
395
+ ********************************************************/
396
+ const frames = new Set();
235
397
  let disposed = false;
236
398
  const scheduleFrame = (cb) => {
237
- if (disposed || !IN_BROWSER) return;
238
- const id2 = window.requestAnimationFrame(() => {
239
- frames.delete(id2);
240
- cb();
241
- });
242
- frames.add(id2);
399
+ if (disposed || !IN_BROWSER) return;
400
+ const id = window.requestAnimationFrame(() => {
401
+ frames.delete(id);
402
+ cb();
403
+ });
404
+ frames.add(id);
243
405
  };
244
406
  onBeforeUnmount(() => {
245
- disposed = true;
246
- for (const id2 of frames) window.cancelAnimationFrame(id2);
247
- frames.clear();
407
+ disposed = true;
408
+ for (const id of frames) window.cancelAnimationFrame(id);
409
+ frames.clear();
248
410
  });
411
+ /*********************************************************
412
+ * scheduleFrames — la chaine de rAF, mise a plat
413
+ *
414
+ * @description
415
+ * Remplace mot pour mot l'imbrication
416
+ * `scheduleFrame(scheduleFrame(scheduleFrame(cb)))` que `done`
417
+ * portait en ligne : meme nombre de frames, meme ordre, meme
418
+ * court-circuit sur `disposed` (porte par `scheduleFrame`).
419
+ *
420
+ * @description
421
+ * `count <= 1 ? cb : …` et non `count <= 0` : a 1 il reste UNE
422
+ * frame a armer, celle qui execute `cb`. Avec `<= 0` la recursion
423
+ * armerait une frame de trop et decalerait la re-mesure d'un tick.
424
+ ********************************************************/
249
425
  const scheduleFrames = (count, cb) => {
250
- scheduleFrame(count <= 1 ? cb : () => scheduleFrames(count - 1, cb));
426
+ scheduleFrame(count <= 1 ? cb : () => scheduleFrames(count - 1, cb));
251
427
  };
252
428
  const rearmIntersect = () => {
253
- intersecting(currentSide.value);
429
+ intersecting(currentSide.value);
254
430
  };
431
+ /*********************************************************
432
+ * afterDoneTick — le corps du `nextTick` de `done`, extrait
433
+ *
434
+ * @description
435
+ * Extraction pure (Sonar #771 : plus de 4 niveaux de fonctions
436
+ * imbriquees a l'ancienne ligne 324). Aucune instruction deplacee,
437
+ * ajoutee ni retiree — seul le niveau d'imbrication change.
438
+ ********************************************************/
255
439
  const afterDoneTick = () => {
256
- if (disposed) return;
257
- if (status.value === INFINITE_SCROLL_STATUS.EMPTY || status.value === INFINITE_SCROLL_STATUS.ERROR) return;
258
- if (status.value === INFINITE_SCROLL_STATUS.OK && currentSide.value === INFINITE_SCROLL_SIDE.START) {
259
- setScrollAmount(getScrollSize() - previousScrollSize + getScrollAmount());
260
- }
261
- if (props.mode !== INFINITE_SCROLL_MODE.MANUAL) {
262
- nextTick(() => scheduleFrames(3, rearmIntersect));
263
- }
440
+ if (disposed) return;
441
+ if (status.value === INFINITE_SCROLL_STATUS.EMPTY || status.value === INFINITE_SCROLL_STATUS.ERROR) return;
442
+ if (status.value === INFINITE_SCROLL_STATUS.OK && currentSide.value === INFINITE_SCROLL_SIDE.START) {
443
+ setScrollAmount(getScrollSize() - previousScrollSize + getScrollAmount());
444
+ }
445
+ if (props.mode !== INFINITE_SCROLL_MODE.MANUAL) {
446
+ /*********************************************************
447
+ * 3 frames — exactement la triple imbrication d'origine.
448
+ ********************************************************/
449
+ nextTick(() => scheduleFrames(3, rearmIntersect));
450
+ }
264
451
  };
265
452
  const done = (_status) => {
266
- status.value = _status;
267
- nextTick(afterDoneTick);
453
+ status.value = _status;
454
+ nextTick(afterDoneTick);
268
455
  };
269
456
  const intersecting = (side) => {
270
- if (props.mode !== "manual" && !isIntersecting.value) return;
271
- currentSide.value = side;
272
- if (!rootEl.value || isLoading.value) return;
273
- previousScrollSize = getScrollSize();
274
- status.value = INFINITE_SCROLL_STATUS.LOADING;
275
- emits("load", { side: currentSide.value, done });
457
+ if (props.mode !== "manual" && !isIntersecting.value) return;
458
+ currentSide.value = side;
459
+ if (!rootEl.value || isLoading.value) return;
460
+ previousScrollSize = getScrollSize();
461
+ status.value = INFINITE_SCROLL_STATUS.LOADING;
462
+ emits("load", {
463
+ side: currentSide.value,
464
+ done
465
+ });
276
466
  };
277
467
  const hasStartIntersect = computed(() => {
278
- return props.side === INFINITE_SCROLL_SIDE.START || props.side === INFINITE_SCROLL_SIDE.BOTH;
468
+ return props.side === INFINITE_SCROLL_SIDE.START || props.side === INFINITE_SCROLL_SIDE.BOTH;
279
469
  });
280
470
  const hasEndIntersect = computed(() => {
281
- return props.side === INFINITE_SCROLL_SIDE.END || props.side === INFINITE_SCROLL_SIDE.BOTH;
471
+ // Pre-fix: `props.side === END || INFINITE_SCROLL_SIDE.BOTH` —
472
+ // the second operand was a string literal (truthy), so this
473
+ // always returned true regardless of the `side` prop. The end
474
+ // sentinel rendered even when `side="start"`, the start
475
+ // sentinel rendered as expected, and side="both" worked by
476
+ // accident.
477
+ return props.side === INFINITE_SCROLL_SIDE.END || props.side === INFINITE_SCROLL_SIDE.BOTH;
282
478
  });
283
479
  const isIntersectMode = computed(() => {
284
- return props.mode === INFINITE_SCROLL_MODE.INTERSECT;
480
+ return props.mode === INFINITE_SCROLL_MODE.INTERSECT;
285
481
  });
286
482
  const isManualMode = computed(() => {
287
- return props.mode === INFINITE_SCROLL_MODE.MANUAL;
483
+ return props.mode === INFINITE_SCROLL_MODE.MANUAL;
288
484
  });
289
485
  const isLoading = computed(() => {
290
- return status.value === INFINITE_SCROLL_STATUS.LOADING;
486
+ return status.value === INFINITE_SCROLL_STATUS.LOADING;
291
487
  });
488
+ /*********************************************************
489
+ * Class & Style
490
+ *
491
+ * @description
492
+ * Composable-driven class and style composition.
493
+ ********************************************************/
292
494
  const infiniteScrollStyles = computed(() => {
293
- return [
294
- colorStyles.value,
295
- dimensionStyles.value,
296
- props.style
297
- ];
495
+ return [
496
+ colorStyles.value,
497
+ dimensionStyles.value,
498
+ props.style
499
+ ];
298
500
  });
299
501
  const infiniteScrollClasses = computed(() => {
300
- return [
301
- "origam-infinite-scroll",
302
- `origam-infinite-scroll--${props.direction}`,
303
- {
304
- "origam-infinite-scroll--start": hasStartIntersect.value,
305
- "origam-infinite-scroll--end": hasEndIntersect.value
306
- },
307
- colorClasses.value,
308
- props.class
309
- ];
502
+ return [
503
+ "origam-infinite-scroll",
504
+ `origam-infinite-scroll--${props.direction}`,
505
+ {
506
+ "origam-infinite-scroll--start": hasStartIntersect.value,
507
+ "origam-infinite-scroll--end": hasEndIntersect.value
508
+ },
509
+ colorClasses.value,
510
+ props.class
511
+ ];
310
512
  });
311
513
  const { id, css, load, isLoaded, unload } = useStyle(infiniteScrollStyles, () => props.id);
514
+ /*********************************************************
515
+ * Expose
516
+ *
517
+ * @description
518
+ * Forwards filterProps to parent components.
519
+ ********************************************************/
312
520
  defineExpose({
313
- filterProps,
314
- css,
315
- id,
316
- load,
317
- unload,
318
- isLoaded
521
+ filterProps,
522
+ css,
523
+ id,
524
+ load,
525
+ unload,
526
+ isLoaded
319
527
  });
320
528
  </script>
321
529
 
@@ -12,32 +12,95 @@
12
12
  import { computed, StyleValue, watch } from "vue";
13
13
  import { useIntersectionObserver } from "../../composables/Commons/intersectionObserver.composable";
14
14
  import { useProps } from "../../composables/Commons/props.composable";
15
+ /*********************************************************
16
+ * Global
17
+ ********************************************************/
15
18
  const props = defineProps({
16
- side: { type: null, required: false },
17
- rootRef: { type: null, required: false },
18
- margin: { type: String, required: false },
19
- id: { type: String, required: false },
20
- class: { type: [String, Array, Object], required: false },
21
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true }
19
+ side: {
20
+ type: null,
21
+ required: false
22
+ },
23
+ rootRef: {
24
+ type: null,
25
+ required: false
26
+ },
27
+ margin: {
28
+ type: String,
29
+ required: false
30
+ },
31
+ id: {
32
+ type: String,
33
+ required: false
34
+ },
35
+ class: {
36
+ type: [
37
+ String,
38
+ Array,
39
+ Object
40
+ ],
41
+ required: false
42
+ },
43
+ style: {
44
+ type: [
45
+ String,
46
+ Array,
47
+ Object,
48
+ Boolean,
49
+ null
50
+ ],
51
+ required: false,
52
+ skipCheck: true
53
+ }
22
54
  });
23
55
  const emits = defineEmits(["intersect"]);
24
56
  defineSlots();
25
57
  const { filterProps } = useProps(props);
58
+ /*********************************************************
59
+ * Composables
60
+ ********************************************************/
61
+ /*********************************************************
62
+ * observerOptions
63
+ *
64
+ * @description
65
+ * ⛔ `rootRef` etait declaree OBLIGATOIRE et n'etait lue nulle part :
66
+ * l'observateur restait sur le viewport quel que soit l'element passe.
67
+ * Un `<origam-infinite-scroll>` place dans un conteneur defilant ne
68
+ * declenchait donc jamais — le consommateur devait fournir un element
69
+ * pour rien.
70
+ *
71
+ * @description
72
+ * Les options sont transmises telles quelles a `IntersectionObserver`,
73
+ * qui accepte `root`. La sentinelle observe desormais le conteneur
74
+ * annonce. Issue #550, critere C1.
75
+ *
76
+ * @description
77
+ * ⛔ issue #682 / critere C4 — `observerOptions.value` etait deballe
78
+ * UNE FOIS ici, au corps de `setup()`, avant d'etre passe a
79
+ * `useIntersectionObserver`. Un theme visant `origam-infinite-scroll-
80
+ * intersect.margin` (resolu en `beforeCreate`, APRES `setup()`, cf.
81
+ * ADR-005) ne pouvait donc jamais l'atteindre — la valeur etait deja
82
+ * figee. Le computed lui-meme est desormais passe tel quel (pas son
83
+ * `.value`) : `useIntersectionObserver` le consomme via un `watch`
84
+ * reactif et recree l'observateur des que la valeur resolue change.
85
+ ********************************************************/
26
86
  const rootClasses = computed(() => ["origam-infinite-scroll-intersect", props.class]);
27
87
  const rootStyles = computed(() => props.style);
28
88
  const observerOptions = computed(() => {
29
- const options = {};
30
- if (props.rootRef) options.root = props.rootRef;
31
- if (props.margin) options.rootMargin = props.margin;
32
- return Object.keys(options).length ? options : void 0;
89
+ const options = {};
90
+ if (props.rootRef) options.root = props.rootRef;
91
+ if (props.margin) options.rootMargin = props.margin;
92
+ return Object.keys(options).length ? options : undefined;
33
93
  });
34
- const { intersectionRef, isIntersecting } = useIntersectionObserver(() => {
35
- }, observerOptions);
94
+ const { intersectionRef, isIntersecting } = useIntersectionObserver(() => {}, observerOptions);
36
95
  watch(isIntersecting, async (val) => {
37
- if (!props.side) return;
38
- emits("intersect", { isIntersecting: val, side: props.side });
39
- });
40
- defineExpose({
41
- filterProps
96
+ if (!props.side) return;
97
+ emits("intersect", {
98
+ isIntersecting: val,
99
+ side: props.side
100
+ });
42
101
  });
102
+ /*********************************************************
103
+ * Expose
104
+ ********************************************************/
105
+ defineExpose({ filterProps });
43
106
  </script>