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
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div
|
|
33
33
|
v-show="isActive"
|
|
34
34
|
ref="contentEl"
|
|
35
|
-
v-click-outside="{ handler: handleClickOutside, closeConditional, include: () => [activatorEl] }"
|
|
35
|
+
v-click-outside="{ handler: handleClickOutside, closeConditional, include: () => activatorEl ? [activatorEl] : [] }"
|
|
36
36
|
:class="overlayContentClasses"
|
|
37
37
|
:style="overlayContentStyles"
|
|
38
38
|
v-bind="{ ...contentEvents, ...contentProps }"
|
|
@@ -80,224 +80,512 @@ import { SCROLL_STRATEGIES } from "../../enums/Commons/scroll.enum";
|
|
|
80
80
|
import { animate } from "../../utils/Commons/animation.util";
|
|
81
81
|
import { convertToUnit } from "../../utils/Commons/commons.util";
|
|
82
82
|
import { getScrollParent } from "../../utils/Commons/scroll.util";
|
|
83
|
+
/*********************************************************
|
|
84
|
+
* inheritAttrs — #853
|
|
85
|
+
*
|
|
86
|
+
* @description
|
|
87
|
+
* The template's actual root is a FRAGMENT: the `activator` slot
|
|
88
|
+
* (line 2) sits as a sibling of the `<template v-if="isMounted &&
|
|
89
|
+
* hasContent">` block that wraps the `<Teleport>`. With a multi-root
|
|
90
|
+
* template, Vue's automatic single-root attrs fallthrough cannot
|
|
91
|
+
* apply, and — since `$attrs` is already explicitly forwarded onto
|
|
92
|
+
* the teleported `<div>` below (`v-bind="{ ...scopeId, ...$attrs }"`)
|
|
93
|
+
* — the automatic attempt is redundant, not missing. Without this
|
|
94
|
+
* flag, Vue still runs its dev-only fallthrough check on every
|
|
95
|
+
* render, finds the "fragment root" case, and logs a "Extraneous
|
|
96
|
+
* non-props attributes" warning whose component trace serializes
|
|
97
|
+
* every ancestor's props — including Vue Router's `RouteProvider`,
|
|
98
|
+
* whose `vnode` prop is the entire page's reactive vnode graph
|
|
99
|
+
* (~4.4 MB per occurrence, dominated by repeated "[Circular]").
|
|
100
|
+
* `OrigamOverlay` backs every floating/teleported component (Menu,
|
|
101
|
+
* Dialog, Tooltip, Snackbar, Picker, …), so this single flag removes
|
|
102
|
+
* the warning at its only source rather than in each consumer.
|
|
103
|
+
* Same defect family as #818 (a single missing `inheritAttrs` caused
|
|
104
|
+
* 12 `aria-allowed-attr` violations).
|
|
105
|
+
********************************************************/
|
|
83
106
|
defineOptions({ inheritAttrs: false });
|
|
107
|
+
/*********************************************************
|
|
108
|
+
* Global
|
|
109
|
+
*
|
|
110
|
+
* @description
|
|
111
|
+
* Props, emits and filterProps for the Overlay component.
|
|
112
|
+
* `openOnClick` defaults to `true` so the activator button opens
|
|
113
|
+
* the overlay out of the box. Without this default, `useActivator`'s
|
|
114
|
+
* fallback (`props.openOnClick == null && !openOnHover && !openOnFocus`)
|
|
115
|
+
* resolved to `undefined` when Vue coerces the missing boolean prop
|
|
116
|
+
* to `false` — and the strict equality `props.openOnClick == null`
|
|
117
|
+
* never matched, leaving every event hook off.
|
|
118
|
+
********************************************************/
|
|
84
119
|
const props = defineProps({
|
|
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
|
-
|
|
120
|
+
absolute: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
required: false
|
|
123
|
+
},
|
|
124
|
+
closeOnBack: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
required: false,
|
|
127
|
+
default: true
|
|
128
|
+
},
|
|
129
|
+
contentClass: {
|
|
130
|
+
type: [String, Array],
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
133
|
+
contentProps: {
|
|
134
|
+
type: null,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
disabled: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
noClickAnimation: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
modelValue: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
zIndex: {
|
|
150
|
+
type: [Number, String],
|
|
151
|
+
required: false,
|
|
152
|
+
default: 2e3
|
|
153
|
+
},
|
|
154
|
+
disableGlobalStack: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
required: false
|
|
157
|
+
},
|
|
158
|
+
persistent: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
required: false
|
|
161
|
+
},
|
|
162
|
+
id: {
|
|
163
|
+
type: String,
|
|
164
|
+
required: false
|
|
165
|
+
},
|
|
166
|
+
class: {
|
|
167
|
+
type: [
|
|
168
|
+
String,
|
|
169
|
+
Array,
|
|
170
|
+
Object
|
|
171
|
+
],
|
|
172
|
+
required: false
|
|
173
|
+
},
|
|
174
|
+
style: {
|
|
175
|
+
type: [
|
|
176
|
+
String,
|
|
177
|
+
Array,
|
|
178
|
+
Object,
|
|
179
|
+
Boolean,
|
|
180
|
+
null
|
|
181
|
+
],
|
|
182
|
+
required: false,
|
|
183
|
+
skipCheck: true
|
|
184
|
+
},
|
|
185
|
+
height: {
|
|
186
|
+
type: [Number, String],
|
|
187
|
+
required: false
|
|
188
|
+
},
|
|
189
|
+
maxHeight: {
|
|
190
|
+
type: [Number, String],
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
maxWidth: {
|
|
194
|
+
type: [Number, String],
|
|
195
|
+
required: false
|
|
196
|
+
},
|
|
197
|
+
minHeight: {
|
|
198
|
+
type: [Number, String],
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
minWidth: {
|
|
202
|
+
type: [Number, String],
|
|
203
|
+
required: false
|
|
204
|
+
},
|
|
205
|
+
width: {
|
|
206
|
+
type: [Number, String],
|
|
207
|
+
required: false
|
|
208
|
+
},
|
|
209
|
+
target: {
|
|
210
|
+
type: null,
|
|
211
|
+
required: false
|
|
212
|
+
},
|
|
213
|
+
activator: {
|
|
214
|
+
type: null,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
217
|
+
activatorProps: {
|
|
218
|
+
type: null,
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
openOnClick: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
required: false,
|
|
224
|
+
default: true
|
|
225
|
+
},
|
|
226
|
+
openOnContextMenu: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
openOnHover: {
|
|
231
|
+
type: Boolean,
|
|
232
|
+
required: false
|
|
233
|
+
},
|
|
234
|
+
openOnFocus: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
closeOnContentClick: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
required: false
|
|
241
|
+
},
|
|
242
|
+
closeDelay: {
|
|
243
|
+
type: [Number, String],
|
|
244
|
+
required: false
|
|
245
|
+
},
|
|
246
|
+
openDelay: {
|
|
247
|
+
type: [Number, String],
|
|
248
|
+
required: false
|
|
249
|
+
},
|
|
250
|
+
locationStrategy: {
|
|
251
|
+
type: Function,
|
|
252
|
+
required: false,
|
|
253
|
+
skipCheck: true,
|
|
254
|
+
default: LOCATION_STRATEGIES.STATIC
|
|
255
|
+
},
|
|
256
|
+
location: {
|
|
257
|
+
type: null,
|
|
258
|
+
required: false,
|
|
259
|
+
default: BLOCK.BOTTOM
|
|
260
|
+
},
|
|
261
|
+
origin: {
|
|
262
|
+
type: null,
|
|
263
|
+
required: false,
|
|
264
|
+
default: "auto"
|
|
265
|
+
},
|
|
266
|
+
offset: {
|
|
267
|
+
type: [
|
|
268
|
+
Number,
|
|
269
|
+
String,
|
|
270
|
+
Array
|
|
271
|
+
],
|
|
272
|
+
required: false
|
|
273
|
+
},
|
|
274
|
+
viewportMargin: {
|
|
275
|
+
type: Number,
|
|
276
|
+
required: false,
|
|
277
|
+
default: 12
|
|
278
|
+
},
|
|
279
|
+
scrollStrategy: {
|
|
280
|
+
type: Function,
|
|
281
|
+
required: false,
|
|
282
|
+
skipCheck: true,
|
|
283
|
+
default: SCROLL_STRATEGIES.BLOCK
|
|
284
|
+
},
|
|
285
|
+
contained: {
|
|
286
|
+
type: Boolean,
|
|
287
|
+
required: false
|
|
288
|
+
},
|
|
289
|
+
eager: {
|
|
290
|
+
type: Boolean,
|
|
291
|
+
required: false
|
|
292
|
+
},
|
|
293
|
+
transition: {
|
|
294
|
+
type: [
|
|
295
|
+
Boolean,
|
|
296
|
+
String,
|
|
297
|
+
Object
|
|
298
|
+
],
|
|
299
|
+
required: false,
|
|
300
|
+
default: () => ({ component: OrigamFade })
|
|
301
|
+
},
|
|
302
|
+
scrim: {
|
|
303
|
+
type: [Boolean, String],
|
|
304
|
+
required: false,
|
|
305
|
+
default: true
|
|
306
|
+
},
|
|
307
|
+
attach: {
|
|
308
|
+
type: [
|
|
309
|
+
Boolean,
|
|
310
|
+
String,
|
|
311
|
+
null
|
|
312
|
+
],
|
|
313
|
+
required: false,
|
|
314
|
+
skipCheck: true
|
|
315
|
+
}
|
|
125
316
|
});
|
|
126
|
-
const emits = defineEmits([
|
|
317
|
+
const emits = defineEmits([
|
|
318
|
+
"afterEnter",
|
|
319
|
+
"afterLeave",
|
|
320
|
+
"keydown",
|
|
321
|
+
"update:modelValue",
|
|
322
|
+
"click:outside"
|
|
323
|
+
]);
|
|
127
324
|
defineSlots();
|
|
128
325
|
const { filterProps } = useProps(props);
|
|
326
|
+
/*********************************************************
|
|
327
|
+
* Value
|
|
328
|
+
*
|
|
329
|
+
* @description
|
|
330
|
+
* model drives open/close state. isActive wraps it with a
|
|
331
|
+
* disabled-guard so a disabled overlay can't be opened.
|
|
332
|
+
********************************************************/
|
|
129
333
|
const model = useVModel(props, "modelValue");
|
|
130
334
|
const isActive = computed({
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
335
|
+
get: () => model.value,
|
|
336
|
+
set: (v) => {
|
|
337
|
+
if (!(v && props.disabled)) model.value = v;
|
|
338
|
+
}
|
|
135
339
|
});
|
|
340
|
+
/*********************************************************
|
|
341
|
+
* Teleport, lazy, stack & activator
|
|
342
|
+
*
|
|
343
|
+
* @description
|
|
344
|
+
* teleportTarget resolves the portal target (body, or contained).
|
|
345
|
+
* hasContent / onAfterLeave implement lazy unmounting.
|
|
346
|
+
* globalTop / localTop / stackStyles manage the z-index stack.
|
|
347
|
+
* useActivator wires activator events, target ref, content events
|
|
348
|
+
* and scrim events.
|
|
349
|
+
********************************************************/
|
|
350
|
+
/*********************************************************
|
|
351
|
+
* Composables
|
|
352
|
+
********************************************************/
|
|
353
|
+
/*********************************************************
|
|
354
|
+
* disableGlobalStack
|
|
355
|
+
*
|
|
356
|
+
* @description
|
|
357
|
+
* ⛔ ADR-005 — `computed` (not `toRef`) so an optional `boolean |
|
|
358
|
+
* undefined` prop normalises to a definite `boolean` for `useStack`'s
|
|
359
|
+
* `Ref<boolean>` parameter, while still deferring the read past
|
|
360
|
+
* `setup()` (see the long comment in `stack.composable.ts`).
|
|
361
|
+
********************************************************/
|
|
136
362
|
const { teleportTarget } = useTeleport(computed(() => props.attach || props.contained));
|
|
137
363
|
const { hasContent, onAfterLeave } = useLazy(props, isActive);
|
|
138
364
|
const disableGlobalStack = computed(() => !!props.disableGlobalStack);
|
|
139
365
|
const { globalTop, localTop, stackStyles } = useStack(isActive, toRef(props, "zIndex"), disableGlobalStack);
|
|
140
|
-
const {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
targetEl,
|
|
145
|
-
targetRef,
|
|
146
|
-
activatorEvents,
|
|
147
|
-
contentEvents,
|
|
148
|
-
scrimEvents
|
|
149
|
-
} = useActivator(props, { isActive, isTop: localTop });
|
|
366
|
+
const { activatorEl, activatorRef, target, targetEl, targetRef, activatorEvents, contentEvents, scrimEvents } = useActivator(props, {
|
|
367
|
+
isActive,
|
|
368
|
+
isTop: localTop
|
|
369
|
+
});
|
|
150
370
|
const { dimensionStyles } = useDimension(props);
|
|
151
371
|
const isMounted = useHydration();
|
|
152
372
|
const { scopeId } = useScopeId();
|
|
153
373
|
const { rtlClasses } = useRtl();
|
|
154
374
|
watch(() => props.disabled, (v) => {
|
|
155
|
-
|
|
375
|
+
if (v) isActive.value = false;
|
|
156
376
|
});
|
|
377
|
+
/*********************************************************
|
|
378
|
+
* Content & location
|
|
379
|
+
*
|
|
380
|
+
* @description
|
|
381
|
+
* root and contentEl are the DOM refs for the overlay wrapper and
|
|
382
|
+
* the positioned content panel. useLocationStrategies computes
|
|
383
|
+
* contentStyles and updateLocation. useScrollStrategies blocks or
|
|
384
|
+
* repositions scroll while the overlay is open.
|
|
385
|
+
********************************************************/
|
|
157
386
|
const root = ref();
|
|
158
387
|
const contentEl = ref();
|
|
159
388
|
const scrimEl = ref();
|
|
160
389
|
const { contentStyles, updateLocation } = useLocationStrategies(props, {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
390
|
+
contentEl,
|
|
391
|
+
target,
|
|
392
|
+
isActive
|
|
164
393
|
});
|
|
165
394
|
const overlayContentStyles = computed(() => {
|
|
166
|
-
|
|
167
|
-
dimensionStyles.value,
|
|
168
|
-
contentStyles.value
|
|
169
|
-
];
|
|
395
|
+
return [dimensionStyles.value, contentStyles.value];
|
|
170
396
|
});
|
|
171
397
|
const overlayContentClasses = computed(() => {
|
|
172
|
-
|
|
173
|
-
"origam-overlay__content",
|
|
174
|
-
props.contentClass
|
|
175
|
-
];
|
|
398
|
+
return ["origam-overlay__content", props.contentClass];
|
|
176
399
|
});
|
|
177
400
|
useScrollStrategies(props, {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
401
|
+
root,
|
|
402
|
+
contentEl,
|
|
403
|
+
targetEl,
|
|
404
|
+
isActive,
|
|
405
|
+
updateLocation
|
|
183
406
|
});
|
|
407
|
+
/*********************************************************
|
|
408
|
+
* Click outside
|
|
409
|
+
*
|
|
410
|
+
* @description
|
|
411
|
+
* handleClickOutside closes the overlay on outside clicks,
|
|
412
|
+
* or bounces it when persistent.
|
|
413
|
+
* closeConditional guards the directive so it only fires
|
|
414
|
+
* while the overlay is active and at the top of the stack.
|
|
415
|
+
********************************************************/
|
|
416
|
+
/*********************************************************
|
|
417
|
+
* Event handlers
|
|
418
|
+
********************************************************/
|
|
184
419
|
const handleClickOutside = (e) => {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
420
|
+
emits("click:outside", e);
|
|
421
|
+
if (!props.persistent) isActive.value = false;
|
|
422
|
+
else animateClick();
|
|
188
423
|
};
|
|
189
424
|
const closeConditional = () => {
|
|
190
|
-
|
|
425
|
+
return isActive.value && globalTop.value;
|
|
191
426
|
};
|
|
427
|
+
/*********************************************************
|
|
428
|
+
* Keydown handler (Escape)
|
|
429
|
+
*
|
|
430
|
+
* @description
|
|
431
|
+
* Closes the overlay on Escape when it is the topmost overlay,
|
|
432
|
+
* or bounces it when persistent. Attached to the window while
|
|
433
|
+
* the overlay is active so multiple overlays each handle Escape
|
|
434
|
+
* independently.
|
|
435
|
+
*
|
|
436
|
+
* @description
|
|
437
|
+
* The `keydown` emit itself is forwarded unconditionally, ahead of the
|
|
438
|
+
* Escape-only logic below — it documents "any key pressed while the
|
|
439
|
+
* overlay is open" (IOverlayEmits/the doc), not only the Escape key
|
|
440
|
+
* this handler reacts to. The window listener is only attached while
|
|
441
|
+
* `isActive` (see the `watch` below), so "while open" is already the
|
|
442
|
+
* natural gate.
|
|
443
|
+
********************************************************/
|
|
192
444
|
const handleKeydown = (e) => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
445
|
+
emits("keydown", e);
|
|
446
|
+
if (e.key === KEYBOARD_VALUES.ESC && globalTop.value) {
|
|
447
|
+
if (!props.persistent) {
|
|
448
|
+
isActive.value = false;
|
|
449
|
+
if (contentEl.value?.contains(document.activeElement)) {
|
|
450
|
+
activatorEl.value?.focus();
|
|
451
|
+
}
|
|
452
|
+
} else animateClick();
|
|
453
|
+
}
|
|
202
454
|
};
|
|
203
455
|
if (IN_BROWSER) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
456
|
+
watch(isActive, (val) => {
|
|
457
|
+
if (val) {
|
|
458
|
+
window.addEventListener("keydown", handleKeydown);
|
|
459
|
+
} else {
|
|
460
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
461
|
+
}
|
|
462
|
+
}, { immediate: true });
|
|
211
463
|
}
|
|
212
464
|
onBeforeUnmount(() => {
|
|
213
|
-
|
|
214
|
-
|
|
465
|
+
if (!IN_BROWSER) return;
|
|
466
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
215
467
|
});
|
|
468
|
+
/*********************************************************
|
|
469
|
+
* Back-button / router integration
|
|
470
|
+
*
|
|
471
|
+
* @description
|
|
472
|
+
* When closeOnBack is true, intercepts the browser back-button
|
|
473
|
+
* and closes the overlay instead of navigating away.
|
|
474
|
+
********************************************************/
|
|
216
475
|
const router = useRouter();
|
|
217
476
|
useToggleScope(() => props.closeOnBack, () => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
477
|
+
useBackButton(router, (next) => {
|
|
478
|
+
if (globalTop.value && isActive.value) {
|
|
479
|
+
next(false);
|
|
480
|
+
if (!props.persistent) isActive.value = false;
|
|
481
|
+
else animateClick();
|
|
482
|
+
} else {
|
|
483
|
+
next();
|
|
484
|
+
}
|
|
485
|
+
});
|
|
227
486
|
});
|
|
228
487
|
const top = ref();
|
|
229
488
|
watch(() => isActive.value && (props.absolute || props.contained) && teleportTarget.value == null, (val) => {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
489
|
+
if (val) {
|
|
490
|
+
const scrollParent = getScrollParent(root.value);
|
|
491
|
+
if (scrollParent && scrollParent !== document.scrollingElement) {
|
|
492
|
+
top.value = scrollParent.scrollTop;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
236
495
|
});
|
|
496
|
+
// Add a quick "bounce" animation to the content
|
|
237
497
|
const animateClick = () => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
498
|
+
if (props.noClickAnimation) return;
|
|
499
|
+
if (contentEl.value) {
|
|
500
|
+
animate(contentEl.value, [
|
|
501
|
+
{ transformOrigin: "center" },
|
|
502
|
+
{ transform: "scale(1.03)" },
|
|
503
|
+
{ transformOrigin: "center" }
|
|
504
|
+
], {
|
|
505
|
+
duration: 150,
|
|
506
|
+
easing: EASING.STANDARD
|
|
507
|
+
});
|
|
508
|
+
}
|
|
249
509
|
};
|
|
250
510
|
const handleAfterEnter = () => {
|
|
251
|
-
|
|
511
|
+
emits("afterEnter");
|
|
252
512
|
};
|
|
253
513
|
const handleAfterLeave = () => {
|
|
254
|
-
|
|
255
|
-
|
|
514
|
+
onAfterLeave();
|
|
515
|
+
emits("afterLeave");
|
|
256
516
|
};
|
|
517
|
+
/*********************************************************
|
|
518
|
+
* Scrim color
|
|
519
|
+
*
|
|
520
|
+
* @description
|
|
521
|
+
* When `scrim` is a string, it is treated as a color token.
|
|
522
|
+
********************************************************/
|
|
257
523
|
const scrimColor = useBackgroundColor(computed(() => {
|
|
258
|
-
|
|
524
|
+
return typeof props.scrim === "string" ? props.scrim : null;
|
|
259
525
|
}));
|
|
526
|
+
/*********************************************************
|
|
527
|
+
* Activator slot props
|
|
528
|
+
*
|
|
529
|
+
* @description
|
|
530
|
+
* activatorProps merges the activator ref, target ref, activator
|
|
531
|
+
* events and consumer-provided activatorProps for the slot binding.
|
|
532
|
+
********************************************************/
|
|
260
533
|
const activatorProps = computed(() => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
534
|
+
return {
|
|
535
|
+
isActive: isActive.value,
|
|
536
|
+
props: mergeProps({
|
|
537
|
+
ref: activatorRef,
|
|
538
|
+
targetRef
|
|
539
|
+
}, activatorEvents.value, props.activatorProps)
|
|
540
|
+
};
|
|
265
541
|
});
|
|
542
|
+
/*********************************************************
|
|
543
|
+
* Class & Style
|
|
544
|
+
*
|
|
545
|
+
* @description
|
|
546
|
+
* overlayStyles / overlayClasses compose the BEM root element.
|
|
547
|
+
********************************************************/
|
|
266
548
|
const overlayStyles = computed(() => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
549
|
+
return [
|
|
550
|
+
stackStyles.value,
|
|
551
|
+
{ top: convertToUnit(top.value) },
|
|
552
|
+
props.style
|
|
553
|
+
];
|
|
272
554
|
});
|
|
273
555
|
const overlayClasses = computed(() => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
556
|
+
return [
|
|
557
|
+
"origam-overlay",
|
|
558
|
+
{
|
|
559
|
+
"origam-overlay--absolute": props.absolute || props.contained,
|
|
560
|
+
"origam-overlay--active": isActive.value,
|
|
561
|
+
"origam-overlay--contained": props.contained
|
|
562
|
+
},
|
|
563
|
+
rtlClasses.value,
|
|
564
|
+
props.class
|
|
565
|
+
];
|
|
284
566
|
});
|
|
285
567
|
const { id, css, load, isLoaded, unload } = useStyle(overlayStyles, () => props.id);
|
|
568
|
+
/*********************************************************
|
|
569
|
+
* Expose
|
|
570
|
+
*
|
|
571
|
+
* @description
|
|
572
|
+
* Exposes internal DOM refs and update helpers to parent refs.
|
|
573
|
+
********************************************************/
|
|
286
574
|
defineExpose({
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
575
|
+
activatorEl,
|
|
576
|
+
scrimEl,
|
|
577
|
+
target,
|
|
578
|
+
animateClick,
|
|
579
|
+
contentEl,
|
|
580
|
+
globalTop,
|
|
581
|
+
localTop,
|
|
582
|
+
updateLocation,
|
|
583
|
+
filterProps,
|
|
584
|
+
css,
|
|
585
|
+
id,
|
|
586
|
+
load,
|
|
587
|
+
unload,
|
|
588
|
+
isLoaded
|
|
301
589
|
});
|
|
302
590
|
</script>
|
|
303
591
|
|