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.
- package/CHANGELOG.md +24 -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 +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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
646
|
+
return {
|
|
647
|
+
container: containerRef.value,
|
|
648
|
+
duration: 200,
|
|
649
|
+
easing: "easeOutQuart"
|
|
650
|
+
};
|
|
177
651
|
});
|
|
178
652
|
const firstSelectedIndex = computed(() => {
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
184
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
243
|
-
|
|
742
|
+
const { scrollTop, scrollLeft } = e.target;
|
|
743
|
+
scrollOffset.value = isHorizontal.value ? scrollLeft : scrollTop;
|
|
244
744
|
};
|
|
245
745
|
const handleFocusin = (e) => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
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
|
-
|
|
263
|
-
|
|
765
|
+
if (!ignoreFocusEvent && !isFocused.value && !(e.relatedTarget && contentRef.value?.contains(e.relatedTarget))) focus();
|
|
766
|
+
ignoreFocusEvent = false;
|
|
264
767
|
};
|
|
265
768
|
const handleFocusAffixes = () => {
|
|
266
|
-
|
|
769
|
+
ignoreFocusEvent = true;
|
|
267
770
|
};
|
|
268
771
|
const handleKeydown = (e) => {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
316
|
-
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
834
|
+
next: group.next,
|
|
835
|
+
prev: group.prev,
|
|
836
|
+
select: group.select,
|
|
837
|
+
isSelected: group.isSelected
|
|
323
838
|
}));
|
|
324
839
|
const hasAffixes = computed(() => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
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
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
|
|
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
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
917
|
+
filterProps,
|
|
918
|
+
css,
|
|
919
|
+
id,
|
|
920
|
+
load,
|
|
921
|
+
unload,
|
|
922
|
+
isLoaded
|
|
408
923
|
});
|
|
409
924
|
</script>
|
|
410
925
|
|