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
|
@@ -59,213 +59,450 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<script lang="ts" setup>
|
|
62
|
-
import {
|
|
63
|
-
computed,
|
|
64
|
-
ref,
|
|
65
|
-
toRef
|
|
66
|
-
} from "vue";
|
|
62
|
+
import { computed, ref, toRef } from "vue";
|
|
67
63
|
import { useBackgroundColor } from "../../composables/Commons/backgroundColor.composable";
|
|
68
64
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
69
65
|
import { MEDIA_SCRUBBER_MIN_RANGE } from "../../consts/Media/media.const";
|
|
70
66
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
67
|
+
/*********************************************************
|
|
68
|
+
* Global
|
|
69
|
+
*
|
|
70
|
+
* @description
|
|
71
|
+
* Props + defaults for `<OrigamMediaScrubber>`. Headless / presentation-only —
|
|
72
|
+
* the parent owns the value, the component owns the drag pipeline,
|
|
73
|
+
* keyboard handlers and ARIA contract. Used internally by
|
|
74
|
+
* `<OrigamVideo>` for the timeline AND the (vertical) volume slider —
|
|
75
|
+
* a single pointer-events + keyboard pipeline used twice, instead of
|
|
76
|
+
* the native `<input type="range">` rotate(-90deg) hack.
|
|
77
|
+
*
|
|
78
|
+
* Defaults are inlined here (not pulled from a MEDIA_SCRUBBER_DEFAULTS
|
|
79
|
+
* const) because the Vue SFC compiler analyses `withDefaults`
|
|
80
|
+
* statically and only resolves literals — cf. CLAUDE.md rule.
|
|
81
|
+
********************************************************/
|
|
71
82
|
const props = defineProps({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
83
|
+
modelValue: {
|
|
84
|
+
type: Number,
|
|
85
|
+
required: true
|
|
86
|
+
},
|
|
87
|
+
min: {
|
|
88
|
+
type: Number,
|
|
89
|
+
required: false,
|
|
90
|
+
default: 0
|
|
91
|
+
},
|
|
92
|
+
max: {
|
|
93
|
+
type: Number,
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
step: {
|
|
97
|
+
type: Number,
|
|
98
|
+
required: false,
|
|
99
|
+
default: 0
|
|
100
|
+
},
|
|
101
|
+
buffered: {
|
|
102
|
+
type: Number,
|
|
103
|
+
required: false,
|
|
104
|
+
default: undefined
|
|
105
|
+
},
|
|
106
|
+
orientation: {
|
|
107
|
+
type: null,
|
|
108
|
+
required: false,
|
|
109
|
+
default: "horizontal"
|
|
110
|
+
},
|
|
111
|
+
disabled: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
required: false,
|
|
114
|
+
default: false
|
|
115
|
+
},
|
|
116
|
+
showThumbOnHoverOnly: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
required: false,
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
showHoverTooltip: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
required: false,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
formatHoverTooltip: {
|
|
127
|
+
type: Function,
|
|
128
|
+
required: false,
|
|
129
|
+
default: (value) => String(value)
|
|
130
|
+
},
|
|
131
|
+
ariaLabel: {
|
|
132
|
+
type: String,
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
ariaValueText: {
|
|
136
|
+
type: String,
|
|
137
|
+
required: false,
|
|
138
|
+
default: undefined
|
|
139
|
+
},
|
|
140
|
+
dataCy: {
|
|
141
|
+
type: String,
|
|
142
|
+
required: false
|
|
143
|
+
},
|
|
144
|
+
id: {
|
|
145
|
+
type: String,
|
|
146
|
+
required: false
|
|
147
|
+
},
|
|
148
|
+
class: {
|
|
149
|
+
type: [
|
|
150
|
+
String,
|
|
151
|
+
Array,
|
|
152
|
+
Object
|
|
153
|
+
],
|
|
154
|
+
required: false
|
|
155
|
+
},
|
|
156
|
+
style: {
|
|
157
|
+
type: [
|
|
158
|
+
String,
|
|
159
|
+
Array,
|
|
160
|
+
Object,
|
|
161
|
+
Boolean,
|
|
162
|
+
null
|
|
163
|
+
],
|
|
164
|
+
required: false,
|
|
165
|
+
skipCheck: true
|
|
166
|
+
},
|
|
167
|
+
color: {
|
|
168
|
+
type: [
|
|
169
|
+
String,
|
|
170
|
+
Object,
|
|
171
|
+
Boolean,
|
|
172
|
+
null
|
|
173
|
+
],
|
|
174
|
+
required: false,
|
|
175
|
+
skipCheck: true
|
|
176
|
+
},
|
|
177
|
+
rounded: {
|
|
178
|
+
type: [
|
|
179
|
+
Boolean,
|
|
180
|
+
Number,
|
|
181
|
+
String,
|
|
182
|
+
null
|
|
183
|
+
],
|
|
184
|
+
required: false,
|
|
185
|
+
skipCheck: true
|
|
186
|
+
},
|
|
187
|
+
roundedTopRight: {
|
|
188
|
+
type: [
|
|
189
|
+
Boolean,
|
|
190
|
+
Number,
|
|
191
|
+
String
|
|
192
|
+
],
|
|
193
|
+
required: false
|
|
194
|
+
},
|
|
195
|
+
roundedTopLeft: {
|
|
196
|
+
type: [
|
|
197
|
+
Boolean,
|
|
198
|
+
Number,
|
|
199
|
+
String
|
|
200
|
+
],
|
|
201
|
+
required: false
|
|
202
|
+
},
|
|
203
|
+
roundedBottomLeft: {
|
|
204
|
+
type: [
|
|
205
|
+
Boolean,
|
|
206
|
+
Number,
|
|
207
|
+
String
|
|
208
|
+
],
|
|
209
|
+
required: false
|
|
210
|
+
},
|
|
211
|
+
roundedBottomRight: {
|
|
212
|
+
type: [
|
|
213
|
+
Boolean,
|
|
214
|
+
Number,
|
|
215
|
+
String
|
|
216
|
+
],
|
|
217
|
+
required: false
|
|
218
|
+
},
|
|
219
|
+
roundedStartStart: {
|
|
220
|
+
type: [
|
|
221
|
+
Boolean,
|
|
222
|
+
Number,
|
|
223
|
+
String
|
|
224
|
+
],
|
|
225
|
+
required: false
|
|
226
|
+
},
|
|
227
|
+
roundedStartEnd: {
|
|
228
|
+
type: [
|
|
229
|
+
Boolean,
|
|
230
|
+
Number,
|
|
231
|
+
String
|
|
232
|
+
],
|
|
233
|
+
required: false
|
|
234
|
+
},
|
|
235
|
+
roundedEndStart: {
|
|
236
|
+
type: [
|
|
237
|
+
Boolean,
|
|
238
|
+
Number,
|
|
239
|
+
String
|
|
240
|
+
],
|
|
241
|
+
required: false
|
|
242
|
+
},
|
|
243
|
+
roundedEndEnd: {
|
|
244
|
+
type: [
|
|
245
|
+
Boolean,
|
|
246
|
+
Number,
|
|
247
|
+
String
|
|
248
|
+
],
|
|
249
|
+
required: false
|
|
250
|
+
}
|
|
98
251
|
});
|
|
99
|
-
const emit = defineEmits([
|
|
252
|
+
const emit = defineEmits([
|
|
253
|
+
"update:modelValue",
|
|
254
|
+
"change",
|
|
255
|
+
"dragstart",
|
|
256
|
+
"dragend",
|
|
257
|
+
"hover"
|
|
258
|
+
]);
|
|
100
259
|
defineSlots();
|
|
260
|
+
/*********************************************************
|
|
261
|
+
* Composables — class-first contract: token values map to a
|
|
262
|
+
* utility class, custom values fall through to inline style.
|
|
263
|
+
* `useBackgroundColor` paints the progress bar (the dominant
|
|
264
|
+
* surface — track + buffer stay neutral by design).
|
|
265
|
+
********************************************************/
|
|
101
266
|
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, "color"));
|
|
267
|
+
// The props-OBJECT overload, not `toRef(props, 'rounded')`: the `Ref`
|
|
268
|
+
// overload of `useRounded` carries a single scalar — the `rounded`
|
|
269
|
+
// shorthand — so `roundedTopLeft` / `roundedTopRight` /
|
|
270
|
+
// `roundedBottomLeft` / `roundedBottomRight` were unreachable by
|
|
271
|
+
// construction, whatever `useRounded` did internally. `roundedStyles`
|
|
272
|
+
// was also being dropped on the floor, which silently discarded every
|
|
273
|
+
// non-tokenised radius (a length, a `var()`, a `calc()`).
|
|
102
274
|
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
103
275
|
const colorClasses = computed(() => backgroundColorClasses.value);
|
|
104
276
|
const colorStyles = computed(() => backgroundColorStyles.value);
|
|
277
|
+
/*********************************************************
|
|
278
|
+
* Range bookkeeping — two DISTINCT quantities, deliberately not
|
|
279
|
+
* folded into one:
|
|
280
|
+
*
|
|
281
|
+
* `resolvedMax` is the DECLARED maximum. It feeds `aria-valuemax`
|
|
282
|
+
* and every clamp, so it must stay a value the consumer could
|
|
283
|
+
* recognise. Floored at `min` only, so an inverted range never
|
|
284
|
+
* announces `aria-valuemax < aria-valuemin`.
|
|
285
|
+
*
|
|
286
|
+
* `range` is the DENOMINATOR of `(value - min) / (max - min)`.
|
|
287
|
+
* It carries the epsilon floor so an empty range paints `0%`
|
|
288
|
+
* instead of `NaN%`.
|
|
289
|
+
*
|
|
290
|
+
* Collapsing the two is what leaked `aria-valuemax="1e-7"` to
|
|
291
|
+
* assistive tech for the whole pre-`loadedmetadata` window — the
|
|
292
|
+
* state every media scrubber mounts in, since
|
|
293
|
+
* `OrigamMediaController.scrubberMax` returns 0 until the duration
|
|
294
|
+
* is finite.
|
|
295
|
+
********************************************************/
|
|
105
296
|
const resolvedMin = computed(() => props.min);
|
|
106
297
|
const resolvedMax = computed(() => Math.max(props.max, props.min));
|
|
107
298
|
const range = computed(() => Math.max(resolvedMax.value - resolvedMin.value, MEDIA_SCRUBBER_MIN_RANGE));
|
|
108
299
|
const resolvedValue = computed(() => clamp(props.modelValue, resolvedMin.value, resolvedMax.value));
|
|
109
300
|
const valuePct = computed(() => (resolvedValue.value - resolvedMin.value) / range.value * 100);
|
|
110
301
|
const bufferPct = computed(() => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
302
|
+
if (!hasBuffer.value) return 0;
|
|
303
|
+
const clamped = clamp(props.buffered, resolvedMin.value, resolvedMax.value);
|
|
304
|
+
return (clamped - resolvedMin.value) / range.value * 100;
|
|
114
305
|
});
|
|
115
306
|
const hasBuffer = computed(() => typeof props.buffered === "number" && Number.isFinite(props.buffered));
|
|
307
|
+
/*********************************************************
|
|
308
|
+
* ARIA & a11y — `role="slider"` only when not disabled, so AT users
|
|
309
|
+
* are not invited to interact with a frozen widget. Tabindex drops
|
|
310
|
+
* to `-1` when disabled (slider stays addressable for tests, but
|
|
311
|
+
* out of the user's tab order).
|
|
312
|
+
********************************************************/
|
|
313
|
+
// `dataCy` is DECLARED as a prop, which removes it from `$attrs` — so the
|
|
314
|
+
// interface's "passed through $attrs to the host element" note could never
|
|
315
|
+
// hold, and the template's hardcoded `data-cy` meant a parent
|
|
316
|
+
// (OrigamMediaController, OrigamMediaVolumeControl) forwarding its own
|
|
317
|
+
// selector was silently overridden. The prop now wins, with the historical
|
|
318
|
+
// literal as the fallback so existing selectors keep matching.
|
|
116
319
|
const resolvedDataCy = computed(() => props.dataCy ?? "origam-media-scrubber");
|
|
117
|
-
const resolvedRole = computed(() => props.disabled ?
|
|
320
|
+
const resolvedRole = computed(() => props.disabled ? undefined : "slider");
|
|
118
321
|
const resolvedTabIndex = computed(() => props.disabled ? -1 : 0);
|
|
322
|
+
/*********************************************************
|
|
323
|
+
* Hover / drag state — `hoverValue` powers the tooltip; `isScrubbing`
|
|
324
|
+
* disables pointerleave-driven hover clearing so the tooltip stays
|
|
325
|
+
* pinned during a drag (YouTube UX).
|
|
326
|
+
********************************************************/
|
|
119
327
|
const rootEl = ref(null);
|
|
120
328
|
const isScrubbing = ref(false);
|
|
121
329
|
const hoverValue = ref(null);
|
|
122
330
|
const hoverPct = ref(null);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
331
|
+
/*********************************************************
|
|
332
|
+
* Tooltip — only the horizontal variant exposes a hover tooltip
|
|
333
|
+
* (the vertical variant is too narrow to anchor one cleanly; if
|
|
334
|
+
* needed, consumers can build their own tooltip outside).
|
|
335
|
+
********************************************************/
|
|
336
|
+
const showTooltip = computed(() => props.showHoverTooltip && props.orientation === DIRECTION.HORIZONTAL && hoverPct.value !== null && !props.disabled);
|
|
126
337
|
const tooltipLabel = computed(() => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
338
|
+
const fn = props.formatHoverTooltip;
|
|
339
|
+
const value = hoverValue.value ?? 0;
|
|
340
|
+
return fn ? fn(value) : String(value);
|
|
130
341
|
});
|
|
342
|
+
/*********************************************************
|
|
343
|
+
* Pointer math — single source of truth for "client coords → pct".
|
|
344
|
+
* Horizontal: `x` relative to the LEFT edge of the track.
|
|
345
|
+
* Vertical: `y` relative to the BOTTOM edge of the track (top = max).
|
|
346
|
+
* Clamped to [0, 100] to short-circuit out-of-bounds drags.
|
|
347
|
+
********************************************************/
|
|
131
348
|
function pctFromPointer(event) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
349
|
+
const el = rootEl.value;
|
|
350
|
+
if (!el) return 0;
|
|
351
|
+
const rect = el.getBoundingClientRect();
|
|
352
|
+
if (props.orientation === DIRECTION.VERTICAL) {
|
|
353
|
+
const y = clamp(event.clientY, rect.top, rect.bottom);
|
|
354
|
+
return (rect.bottom - y) / Math.max(1, rect.height) * 100;
|
|
355
|
+
}
|
|
356
|
+
const x = clamp(event.clientX, rect.left, rect.right);
|
|
357
|
+
return (x - rect.left) / Math.max(1, rect.width) * 100;
|
|
141
358
|
}
|
|
142
359
|
function valueFromPct(pct) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
360
|
+
const raw = resolvedMin.value + clamp(pct, 0, 100) / 100 * range.value;
|
|
361
|
+
if (props.step && props.step > 0) {
|
|
362
|
+
const snapped = Math.round((raw - resolvedMin.value) / props.step) * props.step + resolvedMin.value;
|
|
363
|
+
return clamp(snapped, resolvedMin.value, resolvedMax.value);
|
|
364
|
+
}
|
|
365
|
+
return clamp(raw, resolvedMin.value, resolvedMax.value);
|
|
149
366
|
}
|
|
150
367
|
function commit(value, withChange = false) {
|
|
151
|
-
|
|
152
|
-
|
|
368
|
+
emit("update:modelValue", value);
|
|
369
|
+
if (withChange) emit("change", value);
|
|
153
370
|
}
|
|
154
371
|
function onPointerDown(event) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
372
|
+
if (props.disabled) return;
|
|
373
|
+
const el = rootEl.value;
|
|
374
|
+
if (!el) return;
|
|
375
|
+
isScrubbing.value = true;
|
|
376
|
+
el.setPointerCapture(event.pointerId);
|
|
377
|
+
const pct = pctFromPointer(event);
|
|
378
|
+
const next = valueFromPct(pct);
|
|
379
|
+
hoverValue.value = next;
|
|
380
|
+
hoverPct.value = pct;
|
|
381
|
+
commit(next);
|
|
382
|
+
emit("dragstart");
|
|
383
|
+
const onMove = (e) => {
|
|
384
|
+
if (!isScrubbing.value) return;
|
|
385
|
+
const nextPct = pctFromPointer(e);
|
|
386
|
+
const nextValue = valueFromPct(nextPct);
|
|
387
|
+
hoverValue.value = nextValue;
|
|
388
|
+
hoverPct.value = nextPct;
|
|
389
|
+
commit(nextValue);
|
|
390
|
+
};
|
|
391
|
+
const onUp = (e) => {
|
|
392
|
+
if (!isScrubbing.value) return;
|
|
393
|
+
isScrubbing.value = false;
|
|
394
|
+
const lastPct = pctFromPointer(e);
|
|
395
|
+
const last = valueFromPct(lastPct);
|
|
396
|
+
commit(last, true);
|
|
397
|
+
emit("dragend");
|
|
398
|
+
el.removeEventListener("pointermove", onMove);
|
|
399
|
+
el.removeEventListener("pointerup", onUp);
|
|
400
|
+
el.removeEventListener("pointercancel", onUp);
|
|
401
|
+
};
|
|
402
|
+
el.addEventListener("pointermove", onMove);
|
|
403
|
+
el.addEventListener("pointerup", onUp);
|
|
404
|
+
el.addEventListener("pointercancel", onUp);
|
|
188
405
|
}
|
|
189
406
|
function onPointerMove(event) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
407
|
+
if (props.disabled) return;
|
|
408
|
+
if (isScrubbing.value) return;
|
|
409
|
+
const pct = pctFromPointer(event);
|
|
410
|
+
const value = valueFromPct(pct);
|
|
411
|
+
hoverPct.value = pct;
|
|
412
|
+
hoverValue.value = value;
|
|
413
|
+
emit("hover", value);
|
|
197
414
|
}
|
|
198
415
|
function onPointerLeave() {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
416
|
+
if (isScrubbing.value) return;
|
|
417
|
+
hoverPct.value = null;
|
|
418
|
+
hoverValue.value = null;
|
|
419
|
+
emit("hover", null);
|
|
203
420
|
}
|
|
421
|
+
/*********************************************************
|
|
422
|
+
* Keyboard — same matrix as ARIA Authoring Practices for a slider:
|
|
423
|
+
* - Arrow{Right|Up} → +stepSize
|
|
424
|
+
* - Arrow{Left|Down} → -stepSize
|
|
425
|
+
* - PageUp / PageDown → ±10 % of (max - min)
|
|
426
|
+
* - Home / End → min / max
|
|
427
|
+
* The "step" prop wins when > 0; otherwise we fall back to 5 % of
|
|
428
|
+
* the range — same default the WAI-ARIA pattern recommends.
|
|
429
|
+
********************************************************/
|
|
204
430
|
function keyStep() {
|
|
205
|
-
|
|
206
|
-
|
|
431
|
+
if (props.step && props.step > 0) return props.step;
|
|
432
|
+
return range.value * .05;
|
|
207
433
|
}
|
|
208
434
|
function onKeyDown(event) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
435
|
+
if (props.disabled) return;
|
|
436
|
+
const isVertical = props.orientation === DIRECTION.VERTICAL;
|
|
437
|
+
const step = keyStep();
|
|
438
|
+
let next = null;
|
|
439
|
+
if (event.key === "ArrowRight" && !isVertical) next = resolvedValue.value + step;
|
|
440
|
+
else if (event.key === "ArrowLeft" && !isVertical) next = resolvedValue.value - step;
|
|
441
|
+
else if (event.key === "ArrowUp" && isVertical) next = resolvedValue.value + step;
|
|
442
|
+
else if (event.key === "ArrowDown" && isVertical) next = resolvedValue.value - step;
|
|
443
|
+
else if (event.key === "PageUp") next = resolvedValue.value + range.value * .1;
|
|
444
|
+
else if (event.key === "PageDown") next = resolvedValue.value - range.value * .1;
|
|
445
|
+
else if (event.key === "Home") next = resolvedMin.value;
|
|
446
|
+
else if (event.key === "End") next = resolvedMax.value;
|
|
447
|
+
else return;
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
const snapped = props.step && props.step > 0 ? clamp(Math.round((next - resolvedMin.value) / props.step) * props.step + resolvedMin.value, resolvedMin.value, resolvedMax.value) : clamp(next, resolvedMin.value, resolvedMax.value);
|
|
450
|
+
commit(snapped, true);
|
|
225
451
|
}
|
|
452
|
+
/*********************************************************
|
|
453
|
+
* Inline style channels — translated from `valuePct` /
|
|
454
|
+
* `bufferPct` / `hoverPct` so the parent never has to know about
|
|
455
|
+
* the underlying track orientation.
|
|
456
|
+
********************************************************/
|
|
226
457
|
const progressStyles = computed(() => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
458
|
+
if (props.orientation === DIRECTION.VERTICAL) {
|
|
459
|
+
return { height: `${valuePct.value}%` };
|
|
460
|
+
}
|
|
461
|
+
return { width: `${valuePct.value}%` };
|
|
231
462
|
});
|
|
232
463
|
const bufferStyles = computed(() => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
464
|
+
if (props.orientation === DIRECTION.VERTICAL) {
|
|
465
|
+
return { height: `${bufferPct.value}%` };
|
|
466
|
+
}
|
|
467
|
+
return { width: `${bufferPct.value}%` };
|
|
237
468
|
});
|
|
238
469
|
const thumbStyles = computed(() => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
470
|
+
if (props.orientation === DIRECTION.VERTICAL) {
|
|
471
|
+
return { bottom: `${valuePct.value}%` };
|
|
472
|
+
}
|
|
473
|
+
return { left: `${valuePct.value}%` };
|
|
243
474
|
});
|
|
244
475
|
const tooltipStyles = computed(() => {
|
|
245
|
-
|
|
246
|
-
|
|
476
|
+
if (hoverPct.value === null) return {};
|
|
477
|
+
return { left: `${hoverPct.value}%` };
|
|
247
478
|
});
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
]);
|
|
479
|
+
/*********************************************************
|
|
480
|
+
* Class & Style
|
|
481
|
+
********************************************************/
|
|
482
|
+
const rootClasses = computed(() => [{
|
|
483
|
+
"origam-media-scrubber--horizontal": props.orientation === DIRECTION.HORIZONTAL,
|
|
484
|
+
"origam-media-scrubber--vertical": props.orientation === DIRECTION.VERTICAL,
|
|
485
|
+
"origam-media-scrubber--disabled": props.disabled,
|
|
486
|
+
"origam-media-scrubber--scrubbing": isScrubbing.value,
|
|
487
|
+
"origam-media-scrubber--thumb-on-hover": props.showThumbOnHoverOnly
|
|
488
|
+
}, props.class]);
|
|
258
489
|
const rootStyles = computed(() => [props.style]);
|
|
490
|
+
/*********************************************************
|
|
491
|
+
* Utility
|
|
492
|
+
********************************************************/
|
|
259
493
|
function clamp(value, min, max) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
494
|
+
if (!Number.isFinite(value)) return min;
|
|
495
|
+
if (value < min) return min;
|
|
496
|
+
if (value > max) return max;
|
|
497
|
+
return value;
|
|
264
498
|
}
|
|
499
|
+
/*********************************************************
|
|
500
|
+
* Expose
|
|
501
|
+
********************************************************/
|
|
265
502
|
defineExpose({
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
503
|
+
rootEl,
|
|
504
|
+
isScrubbing,
|
|
505
|
+
hoverValue
|
|
269
506
|
});
|
|
270
507
|
</script>
|
|
271
508
|
|