origam 2.38.0 → 2.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/src/assets/locales/en.json +1 -1
- package/dist/src/assets/locales/fr.json +2 -2
- package/dist/src/components/Alert/OrigamAlert.vue +739 -165
- package/dist/src/components/App/OrigamApp.vue +95 -19
- package/dist/src/components/App/OrigamAppBar.vue +751 -158
- package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
- package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
- package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
- package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
- package/dist/src/components/Badge/OrigamBadge.vue +548 -135
- package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
- package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
- package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
- package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
- package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
- package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
- package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
- package/dist/src/components/Btn/OrigamBtn.vue +928 -249
- package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
- package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
- package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
- package/dist/src/components/Card/OrigamCard.vue +938 -194
- package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
- package/dist/src/components/Card/OrigamCardText.vue +536 -84
- package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
- package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
- package/dist/src/components/Chart/OrigamChart.vue +942 -452
- package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
- package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
- package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
- package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
- package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
- package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
- package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
- package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
- package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
- package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
- package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
- package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
- package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
- package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
- package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
- package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
- package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
- package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
- package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
- package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
- package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
- package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
- package/dist/src/components/Chip/OrigamChip.vue +867 -202
- package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
- package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
- package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
- package/dist/src/components/Code/OrigamCode.vue +844 -206
- package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
- package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
- package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
- package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
- package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
- package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
- package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
- package/dist/src/components/Counter/OrigamCounter.vue +588 -96
- package/dist/src/components/DataList/OrigamDataList.vue +619 -113
- package/dist/src/components/DataList/OrigamDataText.vue +295 -65
- package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
- package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
- package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
- package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
- package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
- package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
- package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
- package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
- package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
- package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
- package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
- package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
- package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
- package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
- package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
- package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
- package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
- package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
- package/dist/src/components/Divider/OrigamDivider.vue +210 -50
- package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
- package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
- package/dist/src/components/Field/OrigamField.vue +1118 -306
- package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
- package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
- package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
- package/dist/src/components/Form/OrigamForm.vue +197 -74
- package/dist/src/components/Grid/OrigamGrid.vue +707 -147
- package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
- package/dist/src/components/Grids/OrigamCol.vue +593 -110
- package/dist/src/components/Grids/OrigamContainer.vue +461 -80
- package/dist/src/components/Grids/OrigamRow.vue +573 -112
- package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
- package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
- package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
- package/dist/src/components/Icon/OrigamIcon.vue +561 -98
- package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
- package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
- package/dist/src/components/Img/OrigamImg.vue +869 -228
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
- package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
- package/dist/src/components/Input/OrigamInput.vue +747 -180
- package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
- package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
- package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
- package/dist/src/components/Label/OrigamLabel.vue +584 -95
- package/dist/src/components/Layout/OrigamLayout.vue +563 -94
- package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
- package/dist/src/components/List/OrigamList.vue +755 -170
- package/dist/src/components/List/OrigamListChildren.vue +59 -19
- package/dist/src/components/List/OrigamListGroup.vue +631 -134
- package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
- package/dist/src/components/List/OrigamListItem.vue +890 -224
- package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
- package/dist/src/components/List/OrigamListSubheader.vue +542 -93
- package/dist/src/components/Loader/OrigamLoader.vue +110 -25
- package/dist/src/components/Main/OrigamMain.vue +565 -96
- package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
- package/dist/src/components/Media/OrigamMediaController.vue +465 -182
- package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
- package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
- package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
- package/dist/src/components/Messages/OrigamMessages.vue +606 -97
- package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
- package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
- package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
- package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
- package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
- package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
- package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
- package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
- package/dist/src/components/Picker/OrigamPicker.vue +655 -108
- package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
- package/dist/src/components/Progress/OrigamProgress.vue +436 -70
- package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
- package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
- package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
- package/dist/src/components/Radio/OrigamRadio.vue +772 -132
- package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
- package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
- package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
- package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
- package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
- package/dist/src/components/Select/OrigamSelect.vue +1639 -567
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
- package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
- package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
- package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
- package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
- package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
- package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
- package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
- package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
- package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
- package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
- package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
- package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
- package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
- package/dist/src/components/Table/OrigamTable.vue +585 -124
- package/dist/src/components/Tabs/OrigamTab.vue +239 -73
- package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
- package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
- package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
- package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
- package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
- package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
- package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
- package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
- package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
- package/dist/src/components/Title/OrigamTitle.vue +505 -82
- package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
- package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
- package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
- package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
- package/dist/src/components/Transition/OrigamFade.vue +47 -9
- package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
- package/dist/src/components/Transition/OrigamSnack.vue +52 -10
- package/dist/src/components/Transition/OrigamTransition.vue +40 -12
- package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
- package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
- package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
- package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
- package/dist/src/components/Video/OrigamVideo.vue +1178 -331
- package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
- package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
- package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
- package/dist/src/components/Window/OrigamWindow.vue +745 -175
- package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
- package/dist/src/composables/Commons/display.composable.cjs +2 -0
- package/dist/src/composables/Commons/display.composable.js +1 -1
- package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
- package/package.json +8 -8
|
@@ -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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
168
|
-
|
|
298
|
+
if (!rootEl.value) return;
|
|
299
|
+
hasFocusableDescendant.value = focusableChildren(rootEl.value).length > 0;
|
|
169
300
|
};
|
|
170
301
|
onMounted(() => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
311
|
+
focusableObserver?.disconnect();
|
|
178
312
|
});
|
|
179
313
|
const propertyDirection = computed(() => {
|
|
180
|
-
|
|
314
|
+
return props.direction === DIRECTION.VERTICAL ? "scrollTop" : "scrollLeft";
|
|
181
315
|
});
|
|
182
316
|
const propertySize = computed(() => {
|
|
183
|
-
|
|
317
|
+
return props.direction === DIRECTION.VERTICAL ? "scrollHeight" : "scrollWidth";
|
|
184
318
|
});
|
|
185
319
|
const propertyContainerSize = computed(() => {
|
|
186
|
-
|
|
320
|
+
return props.direction === DIRECTION.VERTICAL ? "clientHeight" : "clientWidth";
|
|
187
321
|
});
|
|
188
322
|
const getScrollAmount = () => {
|
|
189
|
-
|
|
190
|
-
|
|
323
|
+
if (!rootEl.value) return 0;
|
|
324
|
+
return rootEl.value[propertyDirection.value];
|
|
191
325
|
};
|
|
192
326
|
const setScrollAmount = (amount) => {
|
|
193
|
-
|
|
194
|
-
|
|
327
|
+
if (!rootEl.value) return;
|
|
328
|
+
rootEl.value[propertyDirection.value] = amount;
|
|
195
329
|
};
|
|
196
330
|
const getScrollSize = () => {
|
|
197
|
-
|
|
198
|
-
|
|
331
|
+
if (!rootEl.value) return 0;
|
|
332
|
+
return rootEl.value[propertySize.value];
|
|
199
333
|
};
|
|
200
334
|
const getContainerSize = () => {
|
|
201
|
-
|
|
202
|
-
|
|
335
|
+
if (!rootEl.value) return 0;
|
|
336
|
+
return rootEl.value[propertyContainerSize.value];
|
|
203
337
|
};
|
|
204
338
|
onMounted(() => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
366
|
+
isIntersecting.value = _isIntersecting;
|
|
367
|
+
if (isIntersecting.value) {
|
|
368
|
+
intersecting(side);
|
|
369
|
+
}
|
|
233
370
|
};
|
|
234
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
426
|
+
scheduleFrame(count <= 1 ? cb : () => scheduleFrames(count - 1, cb));
|
|
251
427
|
};
|
|
252
428
|
const rearmIntersect = () => {
|
|
253
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
267
|
-
|
|
453
|
+
status.value = _status;
|
|
454
|
+
nextTick(afterDoneTick);
|
|
268
455
|
};
|
|
269
456
|
const intersecting = (side) => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
468
|
+
return props.side === INFINITE_SCROLL_SIDE.START || props.side === INFINITE_SCROLL_SIDE.BOTH;
|
|
279
469
|
});
|
|
280
470
|
const hasEndIntersect = computed(() => {
|
|
281
|
-
|
|
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
|
-
|
|
480
|
+
return props.mode === INFINITE_SCROLL_MODE.INTERSECT;
|
|
285
481
|
});
|
|
286
482
|
const isManualMode = computed(() => {
|
|
287
|
-
|
|
483
|
+
return props.mode === INFINITE_SCROLL_MODE.MANUAL;
|
|
288
484
|
});
|
|
289
485
|
const isLoading = computed(() => {
|
|
290
|
-
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
495
|
+
return [
|
|
496
|
+
colorStyles.value,
|
|
497
|
+
dimensionStyles.value,
|
|
498
|
+
props.style
|
|
499
|
+
];
|
|
298
500
|
});
|
|
299
501
|
const infiniteScrollClasses = computed(() => {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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>
|