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
|
@@ -41,88 +41,589 @@ import { ORIGAM_PARALLAX_LAYER_KEY } from "../../consts/Parallax/parallax-layer.
|
|
|
41
41
|
import { PARALLAX_DIRECTION, PARALLAX_EASING, PARALLAX_EVENT } from "../../enums/Parallax/parallax.enum";
|
|
42
42
|
import { getCenter, inViewport } from "../../utils/Commons/point.util";
|
|
43
43
|
import { getTargetBox } from "../../utils/Commons/box.util";
|
|
44
|
+
/*********************************************************
|
|
45
|
+
* Global
|
|
46
|
+
*
|
|
47
|
+
* @description
|
|
48
|
+
* Props and filterProps for the Parallax component. Defaults preserve
|
|
49
|
+
* the v2.x single-layer / mouse-driven behaviour. Multi-layer support
|
|
50
|
+
* activates as soon as at least one <OrigamParallaxLayer> is mounted
|
|
51
|
+
* inside the slot (the legacy <OrigamParallaxElement> path keeps
|
|
52
|
+
* working in parallel — the two are independent injection contexts).
|
|
53
|
+
********************************************************/
|
|
44
54
|
const props = defineProps({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
55
|
+
animationDuration: {
|
|
56
|
+
type: Number,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
easing: {
|
|
60
|
+
type: null,
|
|
61
|
+
required: false,
|
|
62
|
+
default: PARALLAX_EASING.LINEAR
|
|
63
|
+
},
|
|
64
|
+
perspective: {
|
|
65
|
+
type: Number,
|
|
66
|
+
required: false,
|
|
67
|
+
default: 1e3
|
|
68
|
+
},
|
|
69
|
+
event: {
|
|
70
|
+
type: null,
|
|
71
|
+
required: false,
|
|
72
|
+
default: PARALLAX_EVENT.MOVE
|
|
73
|
+
},
|
|
74
|
+
active: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
required: false,
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
duration: {
|
|
80
|
+
type: Number,
|
|
81
|
+
required: false,
|
|
82
|
+
default: 1e3
|
|
83
|
+
},
|
|
84
|
+
direction: {
|
|
85
|
+
type: null,
|
|
86
|
+
required: false,
|
|
87
|
+
default: PARALLAX_DIRECTION.VERTICAL
|
|
88
|
+
},
|
|
89
|
+
speed: {
|
|
90
|
+
type: Number,
|
|
91
|
+
required: false,
|
|
92
|
+
default: .5
|
|
93
|
+
},
|
|
94
|
+
disabled: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
required: false,
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
99
|
+
threshold: {
|
|
100
|
+
type: Number,
|
|
101
|
+
required: false,
|
|
102
|
+
default: 0
|
|
103
|
+
},
|
|
104
|
+
id: {
|
|
105
|
+
type: String,
|
|
106
|
+
required: false
|
|
107
|
+
},
|
|
108
|
+
class: {
|
|
109
|
+
type: [
|
|
110
|
+
String,
|
|
111
|
+
Array,
|
|
112
|
+
Object
|
|
113
|
+
],
|
|
114
|
+
required: false
|
|
115
|
+
},
|
|
116
|
+
style: {
|
|
117
|
+
type: [
|
|
118
|
+
String,
|
|
119
|
+
Array,
|
|
120
|
+
Object,
|
|
121
|
+
Boolean,
|
|
122
|
+
null
|
|
123
|
+
],
|
|
124
|
+
required: false,
|
|
125
|
+
skipCheck: true
|
|
126
|
+
},
|
|
127
|
+
tag: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: false,
|
|
130
|
+
default: "div"
|
|
131
|
+
},
|
|
132
|
+
color: {
|
|
133
|
+
type: [
|
|
134
|
+
String,
|
|
135
|
+
Object,
|
|
136
|
+
Boolean,
|
|
137
|
+
null
|
|
138
|
+
],
|
|
139
|
+
required: false,
|
|
140
|
+
skipCheck: true
|
|
141
|
+
},
|
|
142
|
+
bgColor: {
|
|
143
|
+
type: [
|
|
144
|
+
String,
|
|
145
|
+
Object,
|
|
146
|
+
Boolean,
|
|
147
|
+
null
|
|
148
|
+
],
|
|
149
|
+
required: false,
|
|
150
|
+
skipCheck: true
|
|
151
|
+
},
|
|
152
|
+
padding: {
|
|
153
|
+
type: [
|
|
154
|
+
Boolean,
|
|
155
|
+
Number,
|
|
156
|
+
String
|
|
157
|
+
],
|
|
158
|
+
required: false
|
|
159
|
+
},
|
|
160
|
+
paddingTop: {
|
|
161
|
+
type: [
|
|
162
|
+
Boolean,
|
|
163
|
+
Number,
|
|
164
|
+
String
|
|
165
|
+
],
|
|
166
|
+
required: false
|
|
167
|
+
},
|
|
168
|
+
paddingLeft: {
|
|
169
|
+
type: [
|
|
170
|
+
Boolean,
|
|
171
|
+
Number,
|
|
172
|
+
String
|
|
173
|
+
],
|
|
174
|
+
required: false
|
|
175
|
+
},
|
|
176
|
+
paddingBottom: {
|
|
177
|
+
type: [
|
|
178
|
+
Boolean,
|
|
179
|
+
Number,
|
|
180
|
+
String
|
|
181
|
+
],
|
|
182
|
+
required: false
|
|
183
|
+
},
|
|
184
|
+
paddingRight: {
|
|
185
|
+
type: [
|
|
186
|
+
Boolean,
|
|
187
|
+
Number,
|
|
188
|
+
String
|
|
189
|
+
],
|
|
190
|
+
required: false
|
|
191
|
+
},
|
|
192
|
+
paddingBlock: {
|
|
193
|
+
type: [
|
|
194
|
+
Boolean,
|
|
195
|
+
Number,
|
|
196
|
+
String
|
|
197
|
+
],
|
|
198
|
+
required: false
|
|
199
|
+
},
|
|
200
|
+
paddingInline: {
|
|
201
|
+
type: [
|
|
202
|
+
Boolean,
|
|
203
|
+
Number,
|
|
204
|
+
String
|
|
205
|
+
],
|
|
206
|
+
required: false
|
|
207
|
+
},
|
|
208
|
+
paddingInlineStart: {
|
|
209
|
+
type: [
|
|
210
|
+
Boolean,
|
|
211
|
+
Number,
|
|
212
|
+
String
|
|
213
|
+
],
|
|
214
|
+
required: false
|
|
215
|
+
},
|
|
216
|
+
paddingInlineEnd: {
|
|
217
|
+
type: [
|
|
218
|
+
Boolean,
|
|
219
|
+
Number,
|
|
220
|
+
String
|
|
221
|
+
],
|
|
222
|
+
required: false
|
|
223
|
+
},
|
|
224
|
+
paddingBlockStart: {
|
|
225
|
+
type: [
|
|
226
|
+
Boolean,
|
|
227
|
+
Number,
|
|
228
|
+
String
|
|
229
|
+
],
|
|
230
|
+
required: false
|
|
231
|
+
},
|
|
232
|
+
paddingBlockEnd: {
|
|
233
|
+
type: [
|
|
234
|
+
Boolean,
|
|
235
|
+
Number,
|
|
236
|
+
String
|
|
237
|
+
],
|
|
238
|
+
required: false
|
|
239
|
+
},
|
|
240
|
+
margin: {
|
|
241
|
+
type: [
|
|
242
|
+
Boolean,
|
|
243
|
+
Number,
|
|
244
|
+
String
|
|
245
|
+
],
|
|
246
|
+
required: false
|
|
247
|
+
},
|
|
248
|
+
marginTop: {
|
|
249
|
+
type: [
|
|
250
|
+
Boolean,
|
|
251
|
+
Number,
|
|
252
|
+
String
|
|
253
|
+
],
|
|
254
|
+
required: false
|
|
255
|
+
},
|
|
256
|
+
marginLeft: {
|
|
257
|
+
type: [
|
|
258
|
+
Boolean,
|
|
259
|
+
Number,
|
|
260
|
+
String
|
|
261
|
+
],
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
marginBottom: {
|
|
265
|
+
type: [
|
|
266
|
+
Boolean,
|
|
267
|
+
Number,
|
|
268
|
+
String
|
|
269
|
+
],
|
|
270
|
+
required: false
|
|
271
|
+
},
|
|
272
|
+
marginRight: {
|
|
273
|
+
type: [
|
|
274
|
+
Boolean,
|
|
275
|
+
Number,
|
|
276
|
+
String
|
|
277
|
+
],
|
|
278
|
+
required: false
|
|
279
|
+
},
|
|
280
|
+
marginBlock: {
|
|
281
|
+
type: [
|
|
282
|
+
Boolean,
|
|
283
|
+
Number,
|
|
284
|
+
String
|
|
285
|
+
],
|
|
286
|
+
required: false
|
|
287
|
+
},
|
|
288
|
+
marginInline: {
|
|
289
|
+
type: [
|
|
290
|
+
Boolean,
|
|
291
|
+
Number,
|
|
292
|
+
String
|
|
293
|
+
],
|
|
294
|
+
required: false
|
|
295
|
+
},
|
|
296
|
+
marginInlineStart: {
|
|
297
|
+
type: [
|
|
298
|
+
Boolean,
|
|
299
|
+
Number,
|
|
300
|
+
String
|
|
301
|
+
],
|
|
302
|
+
required: false
|
|
303
|
+
},
|
|
304
|
+
marginInlineEnd: {
|
|
305
|
+
type: [
|
|
306
|
+
Boolean,
|
|
307
|
+
Number,
|
|
308
|
+
String
|
|
309
|
+
],
|
|
310
|
+
required: false
|
|
311
|
+
},
|
|
312
|
+
marginBlockStart: {
|
|
313
|
+
type: [
|
|
314
|
+
Boolean,
|
|
315
|
+
Number,
|
|
316
|
+
String
|
|
317
|
+
],
|
|
318
|
+
required: false
|
|
319
|
+
},
|
|
320
|
+
marginBlockEnd: {
|
|
321
|
+
type: [
|
|
322
|
+
Boolean,
|
|
323
|
+
Number,
|
|
324
|
+
String
|
|
325
|
+
],
|
|
326
|
+
required: false
|
|
327
|
+
},
|
|
328
|
+
border: {
|
|
329
|
+
type: [
|
|
330
|
+
Boolean,
|
|
331
|
+
Number,
|
|
332
|
+
String,
|
|
333
|
+
Array
|
|
334
|
+
],
|
|
335
|
+
required: false,
|
|
336
|
+
skipCheck: true
|
|
337
|
+
},
|
|
338
|
+
borderTop: {
|
|
339
|
+
type: [
|
|
340
|
+
Boolean,
|
|
341
|
+
Number,
|
|
342
|
+
String
|
|
343
|
+
],
|
|
344
|
+
required: false
|
|
345
|
+
},
|
|
346
|
+
borderLeft: {
|
|
347
|
+
type: [
|
|
348
|
+
Boolean,
|
|
349
|
+
Number,
|
|
350
|
+
String
|
|
351
|
+
],
|
|
352
|
+
required: false
|
|
353
|
+
},
|
|
354
|
+
borderBottom: {
|
|
355
|
+
type: [
|
|
356
|
+
Boolean,
|
|
357
|
+
Number,
|
|
358
|
+
String
|
|
359
|
+
],
|
|
360
|
+
required: false
|
|
361
|
+
},
|
|
362
|
+
borderRight: {
|
|
363
|
+
type: [
|
|
364
|
+
Boolean,
|
|
365
|
+
Number,
|
|
366
|
+
String
|
|
367
|
+
],
|
|
368
|
+
required: false
|
|
369
|
+
},
|
|
370
|
+
borderBlock: {
|
|
371
|
+
type: [
|
|
372
|
+
Boolean,
|
|
373
|
+
Number,
|
|
374
|
+
String
|
|
375
|
+
],
|
|
376
|
+
required: false
|
|
377
|
+
},
|
|
378
|
+
borderInline: {
|
|
379
|
+
type: [
|
|
380
|
+
Boolean,
|
|
381
|
+
Number,
|
|
382
|
+
String
|
|
383
|
+
],
|
|
384
|
+
required: false
|
|
385
|
+
},
|
|
386
|
+
borderInlineStart: {
|
|
387
|
+
type: [
|
|
388
|
+
Boolean,
|
|
389
|
+
Number,
|
|
390
|
+
String
|
|
391
|
+
],
|
|
392
|
+
required: false
|
|
393
|
+
},
|
|
394
|
+
borderInlineEnd: {
|
|
395
|
+
type: [
|
|
396
|
+
Boolean,
|
|
397
|
+
Number,
|
|
398
|
+
String
|
|
399
|
+
],
|
|
400
|
+
required: false
|
|
401
|
+
},
|
|
402
|
+
borderBlockStart: {
|
|
403
|
+
type: [
|
|
404
|
+
Boolean,
|
|
405
|
+
Number,
|
|
406
|
+
String
|
|
407
|
+
],
|
|
408
|
+
required: false
|
|
409
|
+
},
|
|
410
|
+
borderBlockEnd: {
|
|
411
|
+
type: [
|
|
412
|
+
Boolean,
|
|
413
|
+
Number,
|
|
414
|
+
String
|
|
415
|
+
],
|
|
416
|
+
required: false
|
|
417
|
+
},
|
|
418
|
+
borderColor: {
|
|
419
|
+
type: String,
|
|
420
|
+
required: false
|
|
421
|
+
},
|
|
422
|
+
borderStyle: {
|
|
423
|
+
type: String,
|
|
424
|
+
required: false
|
|
425
|
+
},
|
|
426
|
+
borderTopColor: {
|
|
427
|
+
type: [
|
|
428
|
+
String,
|
|
429
|
+
Object,
|
|
430
|
+
Boolean,
|
|
431
|
+
null
|
|
432
|
+
],
|
|
433
|
+
required: false,
|
|
434
|
+
skipCheck: true
|
|
435
|
+
},
|
|
436
|
+
borderRightColor: {
|
|
437
|
+
type: [
|
|
438
|
+
String,
|
|
439
|
+
Object,
|
|
440
|
+
Boolean,
|
|
441
|
+
null
|
|
442
|
+
],
|
|
443
|
+
required: false,
|
|
444
|
+
skipCheck: true
|
|
445
|
+
},
|
|
446
|
+
borderBottomColor: {
|
|
447
|
+
type: [
|
|
448
|
+
String,
|
|
449
|
+
Object,
|
|
450
|
+
Boolean,
|
|
451
|
+
null
|
|
452
|
+
],
|
|
453
|
+
required: false,
|
|
454
|
+
skipCheck: true
|
|
455
|
+
},
|
|
456
|
+
borderLeftColor: {
|
|
457
|
+
type: [
|
|
458
|
+
String,
|
|
459
|
+
Object,
|
|
460
|
+
Boolean,
|
|
461
|
+
null
|
|
462
|
+
],
|
|
463
|
+
required: false,
|
|
464
|
+
skipCheck: true
|
|
465
|
+
},
|
|
466
|
+
borderInlineStartColor: {
|
|
467
|
+
type: [
|
|
468
|
+
String,
|
|
469
|
+
Object,
|
|
470
|
+
Boolean,
|
|
471
|
+
null
|
|
472
|
+
],
|
|
473
|
+
required: false,
|
|
474
|
+
skipCheck: true
|
|
475
|
+
},
|
|
476
|
+
borderInlineEndColor: {
|
|
477
|
+
type: [
|
|
478
|
+
String,
|
|
479
|
+
Object,
|
|
480
|
+
Boolean,
|
|
481
|
+
null
|
|
482
|
+
],
|
|
483
|
+
required: false,
|
|
484
|
+
skipCheck: true
|
|
485
|
+
},
|
|
486
|
+
borderBlockStartColor: {
|
|
487
|
+
type: [
|
|
488
|
+
String,
|
|
489
|
+
Object,
|
|
490
|
+
Boolean,
|
|
491
|
+
null
|
|
492
|
+
],
|
|
493
|
+
required: false,
|
|
494
|
+
skipCheck: true
|
|
495
|
+
},
|
|
496
|
+
borderBlockEndColor: {
|
|
497
|
+
type: [
|
|
498
|
+
String,
|
|
499
|
+
Object,
|
|
500
|
+
Boolean,
|
|
501
|
+
null
|
|
502
|
+
],
|
|
503
|
+
required: false,
|
|
504
|
+
skipCheck: true
|
|
505
|
+
},
|
|
506
|
+
rounded: {
|
|
507
|
+
type: [
|
|
508
|
+
Boolean,
|
|
509
|
+
Number,
|
|
510
|
+
String,
|
|
511
|
+
null
|
|
512
|
+
],
|
|
513
|
+
required: false,
|
|
514
|
+
skipCheck: true
|
|
515
|
+
},
|
|
516
|
+
roundedTopRight: {
|
|
517
|
+
type: [
|
|
518
|
+
Boolean,
|
|
519
|
+
Number,
|
|
520
|
+
String
|
|
521
|
+
],
|
|
522
|
+
required: false
|
|
523
|
+
},
|
|
524
|
+
roundedTopLeft: {
|
|
525
|
+
type: [
|
|
526
|
+
Boolean,
|
|
527
|
+
Number,
|
|
528
|
+
String
|
|
529
|
+
],
|
|
530
|
+
required: false
|
|
531
|
+
},
|
|
532
|
+
roundedBottomLeft: {
|
|
533
|
+
type: [
|
|
534
|
+
Boolean,
|
|
535
|
+
Number,
|
|
536
|
+
String
|
|
537
|
+
],
|
|
538
|
+
required: false
|
|
539
|
+
},
|
|
540
|
+
roundedBottomRight: {
|
|
541
|
+
type: [
|
|
542
|
+
Boolean,
|
|
543
|
+
Number,
|
|
544
|
+
String
|
|
545
|
+
],
|
|
546
|
+
required: false
|
|
547
|
+
},
|
|
548
|
+
roundedStartStart: {
|
|
549
|
+
type: [
|
|
550
|
+
Boolean,
|
|
551
|
+
Number,
|
|
552
|
+
String
|
|
553
|
+
],
|
|
554
|
+
required: false
|
|
555
|
+
},
|
|
556
|
+
roundedStartEnd: {
|
|
557
|
+
type: [
|
|
558
|
+
Boolean,
|
|
559
|
+
Number,
|
|
560
|
+
String
|
|
561
|
+
],
|
|
562
|
+
required: false
|
|
563
|
+
},
|
|
564
|
+
roundedEndStart: {
|
|
565
|
+
type: [
|
|
566
|
+
Boolean,
|
|
567
|
+
Number,
|
|
568
|
+
String
|
|
569
|
+
],
|
|
570
|
+
required: false
|
|
571
|
+
},
|
|
572
|
+
roundedEndEnd: {
|
|
573
|
+
type: [
|
|
574
|
+
Boolean,
|
|
575
|
+
Number,
|
|
576
|
+
String
|
|
577
|
+
],
|
|
578
|
+
required: false
|
|
579
|
+
},
|
|
580
|
+
elevation: {
|
|
581
|
+
type: [Number, String],
|
|
582
|
+
required: false
|
|
583
|
+
},
|
|
584
|
+
height: {
|
|
585
|
+
type: [Number, String],
|
|
586
|
+
required: false
|
|
587
|
+
},
|
|
588
|
+
maxHeight: {
|
|
589
|
+
type: [Number, String],
|
|
590
|
+
required: false
|
|
591
|
+
},
|
|
592
|
+
maxWidth: {
|
|
593
|
+
type: [Number, String],
|
|
594
|
+
required: false
|
|
595
|
+
},
|
|
596
|
+
minHeight: {
|
|
597
|
+
type: [Number, String],
|
|
598
|
+
required: false
|
|
599
|
+
},
|
|
600
|
+
minWidth: {
|
|
601
|
+
type: [Number, String],
|
|
602
|
+
required: false
|
|
603
|
+
},
|
|
604
|
+
width: {
|
|
605
|
+
type: [Number, String],
|
|
606
|
+
required: false
|
|
607
|
+
},
|
|
608
|
+
audio: {
|
|
609
|
+
type: String,
|
|
610
|
+
required: false
|
|
611
|
+
},
|
|
612
|
+
playAudio: {
|
|
613
|
+
type: Boolean,
|
|
614
|
+
required: false
|
|
615
|
+
}
|
|
122
616
|
});
|
|
123
|
-
const emit = defineEmits([
|
|
617
|
+
const emit = defineEmits([
|
|
618
|
+
"enter",
|
|
619
|
+
"leave",
|
|
620
|
+
"scroll-progress"
|
|
621
|
+
]);
|
|
124
622
|
const { filterProps } = useProps(props);
|
|
125
623
|
defineSlots();
|
|
624
|
+
/*********************************************************
|
|
625
|
+
* Composables (chrome)
|
|
626
|
+
********************************************************/
|
|
126
627
|
const { audioRef, audioData, onStop: handleStop } = useAudio(props);
|
|
127
628
|
const { platform } = useDisplay();
|
|
128
629
|
const { dimensionStyles } = useDimension(props);
|
|
@@ -132,231 +633,271 @@ const { roundedClasses, roundedStyles } = useRounded(props);
|
|
|
132
633
|
const { elevationClasses } = useElevation(props);
|
|
133
634
|
const { paddingClasses, paddingStyles } = usePadding(props);
|
|
134
635
|
const { marginClasses, marginStyles } = useMargin(props);
|
|
636
|
+
/*********************************************************
|
|
637
|
+
* State (legacy mouse / scroll / orientation path)
|
|
638
|
+
********************************************************/
|
|
135
639
|
const root = ref();
|
|
136
640
|
const isMoving = ref(false);
|
|
137
641
|
const leftOnce = ref(false);
|
|
138
642
|
const shape = ref(null);
|
|
139
|
-
const movement = ref({
|
|
643
|
+
const movement = ref({
|
|
644
|
+
x: 0,
|
|
645
|
+
y: 0
|
|
646
|
+
});
|
|
140
647
|
const data = ref();
|
|
141
648
|
const isTouch = computed(() => platform.value.touch);
|
|
142
649
|
const eventActions = computed(() => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
650
|
+
return {
|
|
651
|
+
move: {
|
|
652
|
+
action: mouseMovement,
|
|
653
|
+
condition: isMoving.value && !isTouch.value,
|
|
654
|
+
type: isTouch.value ? "deviceorientation" : null
|
|
655
|
+
},
|
|
656
|
+
scroll: {
|
|
657
|
+
action: scrollMovement,
|
|
658
|
+
condition: !!shape.value?.height,
|
|
659
|
+
type: "scroll"
|
|
660
|
+
},
|
|
661
|
+
orientation: {
|
|
662
|
+
action: orientationElement,
|
|
663
|
+
// `handleMovement` looks up `eventActions.value[props.event]` — when
|
|
664
|
+
// `props.event === 'orientation'` we are ALREADY in this branch, so
|
|
665
|
+
// gating on `props.event === 'move'` here can never be true. That
|
|
666
|
+
// left `<origam-parallax event="orientation">` permanently inert:
|
|
667
|
+
// the `deviceorientation` listener fired (registered via
|
|
668
|
+
// `eventMap.value.orientation`) but `condition` always evaluated to
|
|
669
|
+
// `false`, so `movement.value` never updated regardless of a real
|
|
670
|
+
// sensor being present. Mirrors the `scroll` branch's guard (a
|
|
671
|
+
// measured target box must exist before applying movement).
|
|
672
|
+
condition: props.event === "orientation" && !!shape.value?.height,
|
|
673
|
+
type: "deviceorientation"
|
|
674
|
+
}
|
|
675
|
+
};
|
|
169
676
|
});
|
|
170
677
|
const eventMap = computed(() => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
678
|
+
return {
|
|
679
|
+
orientation: "deviceorientation",
|
|
680
|
+
scroll: "scroll",
|
|
681
|
+
move: isTouch.value ? "deviceorientation" : null
|
|
682
|
+
};
|
|
176
683
|
});
|
|
177
684
|
const mouseMovement = ({ target, event }) => {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
685
|
+
const x = event.clientX;
|
|
686
|
+
const y = event.clientY;
|
|
687
|
+
const relativeX = x - target.left;
|
|
688
|
+
const relativeY = y - target.top;
|
|
689
|
+
const center = getCenter(target);
|
|
690
|
+
return {
|
|
691
|
+
x: relativeX / center.x,
|
|
692
|
+
y: relativeY / center.y,
|
|
693
|
+
target
|
|
694
|
+
};
|
|
188
695
|
};
|
|
189
696
|
const scrollMovement = ({ target }) => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
697
|
+
const x = window.scrollX;
|
|
698
|
+
const y = window.scrollY;
|
|
699
|
+
const relativeX = x - target.left;
|
|
700
|
+
const relativeY = y - target.top;
|
|
701
|
+
const center = getCenter(target);
|
|
702
|
+
return {
|
|
703
|
+
x: relativeX / center.x,
|
|
704
|
+
y: relativeY / center.y,
|
|
705
|
+
target
|
|
706
|
+
};
|
|
200
707
|
};
|
|
201
708
|
const orientationElement = ({ event, target }) => {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
709
|
+
const x = event.gamma ?? 1 / 45;
|
|
710
|
+
const y = event.beta ?? 1 / 90;
|
|
711
|
+
return {
|
|
712
|
+
x,
|
|
713
|
+
y,
|
|
714
|
+
target
|
|
715
|
+
};
|
|
205
716
|
};
|
|
206
717
|
const handleMovement = useThrottleFn((event) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
718
|
+
// WORK-AVOIDANCE ONLY — this is NOT the guard that makes `disabled`
|
|
719
|
+
// visible. Mutation testing (2026-08-18) confirmed it: delete this line
|
|
720
|
+
// and both `disabled` e2e tests still pass, because the gate on the
|
|
721
|
+
// PROVIDED `isMoving` (see the `provide` block below) already pins the
|
|
722
|
+
// rendered transform to offset 0 on its own. What this line buys is that
|
|
723
|
+
// a disabled host stops doing per-mousemove work it can't display —
|
|
724
|
+
// `getTargetBox` (a forced `getBoundingClientRect`) every 100 ms, plus
|
|
725
|
+
// writes to `movement` / `data` that invalidate every child's computeds
|
|
726
|
+
// and keep pushing `eventData` at consumers of ORIGAM_PARALLAX_KEY.
|
|
727
|
+
// Keep it, but don't mistake it for the fix.
|
|
728
|
+
if (props.disabled) return;
|
|
729
|
+
if (!props.active && !root.value) return;
|
|
730
|
+
if (!isMoving.value && !leftOnce.value) {
|
|
731
|
+
handleMovementStart();
|
|
732
|
+
}
|
|
733
|
+
shape.value = getTargetBox(root.value);
|
|
734
|
+
const isInViewport = inViewport(shape.value);
|
|
735
|
+
const condition = eventActions.value[props.event].condition;
|
|
736
|
+
const action = eventActions.value[props.event].action;
|
|
737
|
+
if (isInViewport && condition) {
|
|
738
|
+
movement.value = action({
|
|
739
|
+
target: shape.value,
|
|
740
|
+
event
|
|
741
|
+
});
|
|
742
|
+
data.value = {
|
|
743
|
+
x: event.clientX,
|
|
744
|
+
y: event.clientY
|
|
745
|
+
};
|
|
746
|
+
}
|
|
220
747
|
}, 100);
|
|
221
748
|
const addEvents = (event = props.event) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
749
|
+
if (eventMap.value[event]) {
|
|
750
|
+
window.addEventListener(eventMap.value[event], handleMovement, true);
|
|
751
|
+
}
|
|
225
752
|
};
|
|
226
753
|
const removeEvents = (event = props.event) => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
754
|
+
if (eventMap.value[event]) {
|
|
755
|
+
window.removeEventListener(eventMap.value[event], handleMovement, true);
|
|
756
|
+
}
|
|
230
757
|
};
|
|
758
|
+
// `active` and `disabled` both stop movement, and the asymmetry between them
|
|
759
|
+
// is deliberate — see `IParallaxProps`. `disabled` is the HARD switch
|
|
760
|
+
// ("translate stays at 0 regardless of scroll / events") and is enforced on
|
|
761
|
+
// the provided `isMoving`, so it kills every legacy mode at once. `active` is
|
|
762
|
+
// the NARROW legacy kill-switch: it only freezes the MOUSE mode, which is
|
|
763
|
+
// exactly why it is enforced here — `handleMovementStart` is the mouse
|
|
764
|
+
// entry point, so an `event="scroll"` host with `active={false}` keeps
|
|
765
|
+
// scrolling (the provided `isMoving` is forced true for SCROLL). Do not
|
|
766
|
+
// "harmonise" the two by moving this test next to the `disabled` one: that
|
|
767
|
+
// would silently widen `active` into a second hard switch.
|
|
231
768
|
const handleMovementStart = () => {
|
|
232
|
-
|
|
233
|
-
|
|
769
|
+
if (!props.active) return;
|
|
770
|
+
isMoving.value = true;
|
|
234
771
|
};
|
|
235
772
|
const handleMovementStop = () => {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
773
|
+
if (!props.active) return;
|
|
774
|
+
leftOnce.value = true;
|
|
775
|
+
isMoving.value = false;
|
|
239
776
|
};
|
|
240
777
|
onMounted(() => addEvents());
|
|
241
778
|
onBeforeUnmount(() => removeEvents());
|
|
242
779
|
watch(() => props.event, (newEvent, oldEvent) => {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
780
|
+
if (newEvent === oldEvent) return;
|
|
781
|
+
removeEvents(oldEvent);
|
|
782
|
+
addEvents(newEvent);
|
|
783
|
+
isMoving.value = false;
|
|
784
|
+
movement.value = {
|
|
785
|
+
x: 0,
|
|
786
|
+
y: 0
|
|
787
|
+
};
|
|
248
788
|
});
|
|
789
|
+
/*********************************************************
|
|
790
|
+
* Provide — legacy <OrigamParallaxElement> context.
|
|
791
|
+
********************************************************/
|
|
249
792
|
let _animationDurationWarned = false;
|
|
250
793
|
const resolvedDuration = computed(() => {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
return props.animationDuration ?? props.duration ?? 1e3;
|
|
794
|
+
if (props.animationDuration != null && !_animationDurationWarned) {
|
|
795
|
+
_animationDurationWarned = true;
|
|
796
|
+
console.warn("[origam] OrigamParallax: the `animationDuration` prop is deprecated and will be removed in v3.0.0. " + "Use `duration` instead. Both props currently resolve to the same value (`animationDuration` wins when both are set).");
|
|
797
|
+
}
|
|
798
|
+
return props.animationDuration ?? props.duration ?? 1e3;
|
|
258
799
|
});
|
|
259
800
|
provide(ORIGAM_PARALLAX_KEY, {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
801
|
+
audioData,
|
|
802
|
+
event: toRef(props, "event"),
|
|
803
|
+
eventData: data,
|
|
804
|
+
// ⛔ THIS is the `disabled` kill-switch for the legacy
|
|
805
|
+
// <OrigamParallaxElement> path — the only gate whose removal reddens a
|
|
806
|
+
// test (`disabled — flipping it mid-hover…`). Before it, `disabled`
|
|
807
|
+
// reached only `useParallaxRuntime` (the <OrigamParallaxLayer> path) and
|
|
808
|
+
// the `origam-parallax--disabled` class, whose SCSS neutralises
|
|
809
|
+
// `.origam-parallax__layer` and nothing else — so a
|
|
810
|
+
// `<origam-parallax disabled event="move">` kept translating under the
|
|
811
|
+
// mouse (measured: matrix(1,0,0,1,-1,-1) → matrix(1,0,0,1,-50.58,-50.62)).
|
|
812
|
+
//
|
|
813
|
+
// It has to live HERE rather than only in `handleMovement`: stopping
|
|
814
|
+
// future updates leaves `movement` at whatever value it held when
|
|
815
|
+
// `disabled` flipped on, freezing the element mid-travel (measured at
|
|
816
|
+
// -91,-91) instead of returning to offset 0 as `IParallaxProps.disabled`
|
|
817
|
+
// documents. `OrigamParallaxElement.transformCalculation` short-circuits
|
|
818
|
+
// to `{x: 0, y: 0}` as soon as this ref reads false, so gating it here is
|
|
819
|
+
// what makes "translate stays at 0" literally true, and it covers the
|
|
820
|
+
// `event="scroll"` branch of this same expression too.
|
|
821
|
+
isMoving: computed(() => !props.disabled && (isMoving.value || props.event === PARALLAX_EVENT.SCROLL)),
|
|
822
|
+
movement,
|
|
823
|
+
duration: resolvedDuration,
|
|
824
|
+
easing: toRef(props, "easing"),
|
|
825
|
+
shape
|
|
285
826
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onProgress: (p) => emit("scroll-progress", p)
|
|
827
|
+
/*********************************************************
|
|
828
|
+
* Multi-layer runtime — drives <OrigamParallaxLayer> children.
|
|
829
|
+
*
|
|
830
|
+
* Distinct from the legacy provide above so we don't couple the two
|
|
831
|
+
* APIs. Layers register themselves at mount and unregister on unmount;
|
|
832
|
+
* the runtime owns scroll / mouse listeners + the rAF loop.
|
|
833
|
+
********************************************************/
|
|
834
|
+
const { progress, mouseRatio, cssScrollDriven, reducedMotion, register, unregister, update } = useParallaxRuntime({
|
|
835
|
+
target: root,
|
|
836
|
+
direction: toRef(props, "direction"),
|
|
837
|
+
easing: toRef(props, "easing"),
|
|
838
|
+
threshold: toRef(props, "threshold"),
|
|
839
|
+
disabled: toRef(props, "disabled"),
|
|
840
|
+
speed: toRef(props, "speed"),
|
|
841
|
+
onEnter: () => emit("enter"),
|
|
842
|
+
onLeave: () => emit("leave"),
|
|
843
|
+
onProgress: (p) => emit("scroll-progress", p)
|
|
304
844
|
});
|
|
305
845
|
provide(ORIGAM_PARALLAX_LAYER_KEY, {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
846
|
+
direction: toRef(props, "direction"),
|
|
847
|
+
easing: toRef(props, "easing"),
|
|
848
|
+
disabled: toRef(props, "disabled"),
|
|
849
|
+
progress,
|
|
850
|
+
mouseRatio,
|
|
851
|
+
cssScrollDriven,
|
|
852
|
+
reducedMotion,
|
|
853
|
+
register,
|
|
854
|
+
unregister,
|
|
855
|
+
update
|
|
316
856
|
});
|
|
857
|
+
/*********************************************************
|
|
858
|
+
* Class & Style
|
|
859
|
+
********************************************************/
|
|
317
860
|
const parallaxStyles = computed(() => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
props.style
|
|
329
|
-
];
|
|
861
|
+
return [
|
|
862
|
+
dimensionStyles.value,
|
|
863
|
+
borderStyles.value,
|
|
864
|
+
colorStyles.value,
|
|
865
|
+
roundedStyles.value,
|
|
866
|
+
paddingStyles.value,
|
|
867
|
+
marginStyles.value,
|
|
868
|
+
{ "--origam-parallax---perspective": `${props.perspective}px` },
|
|
869
|
+
props.style
|
|
870
|
+
];
|
|
330
871
|
});
|
|
331
872
|
const parallaxClasses = computed(() => {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
873
|
+
return [
|
|
874
|
+
"origam-parallax",
|
|
875
|
+
{
|
|
876
|
+
"origam-parallax--disabled": props.disabled,
|
|
877
|
+
"origam-parallax--reduced-motion": reducedMotion.value,
|
|
878
|
+
"origam-parallax--css-driven": cssScrollDriven.value,
|
|
879
|
+
[`origam-parallax--${props.direction}`]: !!props.direction
|
|
880
|
+
},
|
|
881
|
+
colorClasses.value,
|
|
882
|
+
borderClasses.value,
|
|
883
|
+
roundedClasses.value,
|
|
884
|
+
elevationClasses.value,
|
|
885
|
+
paddingClasses.value,
|
|
886
|
+
marginClasses.value,
|
|
887
|
+
props.class
|
|
888
|
+
];
|
|
348
889
|
});
|
|
349
890
|
const { id, css, load, isLoaded, unload } = useStyle(parallaxStyles, () => props.id);
|
|
350
891
|
defineExpose({
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
892
|
+
filterProps,
|
|
893
|
+
css,
|
|
894
|
+
id,
|
|
895
|
+
load,
|
|
896
|
+
unload,
|
|
897
|
+
isLoaded,
|
|
898
|
+
progress,
|
|
899
|
+
cssScrollDriven,
|
|
900
|
+
reducedMotion
|
|
360
901
|
});
|
|
361
902
|
</script>
|
|
362
903
|
|