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
|
@@ -55,21 +55,7 @@
|
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script lang="ts" setup>
|
|
58
|
-
import {
|
|
59
|
-
computed,
|
|
60
|
-
ComputedRef,
|
|
61
|
-
isRef,
|
|
62
|
-
nextTick,
|
|
63
|
-
onBeforeMount,
|
|
64
|
-
onServerPrefetch,
|
|
65
|
-
Ref,
|
|
66
|
-
ref,
|
|
67
|
-
shallowRef,
|
|
68
|
-
StyleValue,
|
|
69
|
-
toRef,
|
|
70
|
-
useSlots,
|
|
71
|
-
watch
|
|
72
|
-
} from "vue";
|
|
58
|
+
import { computed, ComputedRef, isRef, nextTick, onBeforeMount, onServerPrefetch, Ref, ref, shallowRef, StyleValue, toRef, useSlots, watch } from "vue";
|
|
73
59
|
import OrigamOverlayScrim from "../Overlay/OrigamOverlayScrim.vue";
|
|
74
60
|
import OrigamTransition from "../Transition/OrigamTransition.vue";
|
|
75
61
|
import { useBackgroundColor } from "../../composables/Commons/backgroundColor.composable";
|
|
@@ -91,113 +77,665 @@ import { useTouch } from "../../composables/Commons/touch.composable";
|
|
|
91
77
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
92
78
|
import { INLINE } from "../../enums/Commons/anchor.enum";
|
|
93
79
|
import { int } from "../../utils/Commons/commons.util";
|
|
80
|
+
/*********************************************************
|
|
81
|
+
* inheritAttrs — #916 / #853
|
|
82
|
+
*
|
|
83
|
+
* @description
|
|
84
|
+
* The single root is a `<teleport>`, and Vue treats the TELEPORT
|
|
85
|
+
* shapeFlag exactly like a fragment for automatic attrs inheritance —
|
|
86
|
+
* its own message says so ("renders fragment or text or teleport root
|
|
87
|
+
* nodes"). It therefore logs "Extraneous non-props attributes", whose
|
|
88
|
+
* component trace serialises every ancestor's props including Vue
|
|
89
|
+
* Router's `RouteProvider` vnode (~4.4 MB per occurrence, #853).
|
|
90
|
+
*
|
|
91
|
+
* `$attrs` is ALREADY forwarded by hand onto the visible root below
|
|
92
|
+
* (`v-bind="{...scopeId, ...$attrs}"` on the `<component :is="tag">`),
|
|
93
|
+
* so this flag removes a redundant attempt, not a working one.
|
|
94
|
+
*
|
|
95
|
+
* ⛔ Reading `$attrs` in the template is NOT enough on its own, and that
|
|
96
|
+
* is worth knowing: Vue suppresses the warning when `$attrs` was read
|
|
97
|
+
* through the public proxy DURING THE RENDER THAT WOULD WARN
|
|
98
|
+
* (`markAttrsAccessed()`). Here the read sits inside `v-if="isActive"`
|
|
99
|
+
* under a `defer`red teleport, so on any render where the drawer is
|
|
100
|
+
* closed the read never happens and the warning fires. Measured before
|
|
101
|
+
* this flag: 2 occurrences on a single closed mount.
|
|
102
|
+
********************************************************/
|
|
94
103
|
defineOptions({ inheritAttrs: false });
|
|
104
|
+
/*********************************************************
|
|
105
|
+
* Global
|
|
106
|
+
*
|
|
107
|
+
* @description
|
|
108
|
+
* Props, emits, and composable bootstrapping.
|
|
109
|
+
********************************************************/
|
|
95
110
|
const props = defineProps({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
111
|
+
disableResizeWatcher: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
disableRouteWatcher: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
required: false
|
|
118
|
+
},
|
|
119
|
+
expandOnHover: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
required: false
|
|
122
|
+
},
|
|
123
|
+
floating: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
required: false
|
|
126
|
+
},
|
|
127
|
+
modelValue: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
required: false,
|
|
130
|
+
default: true
|
|
131
|
+
},
|
|
132
|
+
permanent: {
|
|
133
|
+
type: [Boolean, null],
|
|
134
|
+
required: false,
|
|
135
|
+
default: null
|
|
136
|
+
},
|
|
137
|
+
rail: {
|
|
138
|
+
type: [Boolean, null],
|
|
139
|
+
required: false,
|
|
140
|
+
default: null
|
|
141
|
+
},
|
|
142
|
+
railWidth: {
|
|
143
|
+
type: [Number, String],
|
|
144
|
+
required: false,
|
|
145
|
+
default: 56
|
|
146
|
+
},
|
|
147
|
+
temporary: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
required: false
|
|
150
|
+
},
|
|
151
|
+
touchless: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
required: false
|
|
154
|
+
},
|
|
155
|
+
width: {
|
|
156
|
+
type: [Number, String],
|
|
157
|
+
required: false,
|
|
158
|
+
default: 256
|
|
159
|
+
},
|
|
160
|
+
sticky: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
required: false
|
|
163
|
+
},
|
|
164
|
+
push: {
|
|
165
|
+
type: [Boolean, null],
|
|
166
|
+
required: false,
|
|
167
|
+
default: null
|
|
168
|
+
},
|
|
169
|
+
clipped: {
|
|
170
|
+
type: [Boolean, null],
|
|
171
|
+
required: false,
|
|
172
|
+
default: null
|
|
173
|
+
},
|
|
174
|
+
attach: {
|
|
175
|
+
type: [
|
|
176
|
+
Boolean,
|
|
177
|
+
String,
|
|
178
|
+
null
|
|
179
|
+
],
|
|
180
|
+
required: false,
|
|
181
|
+
skipCheck: true,
|
|
182
|
+
default: null
|
|
183
|
+
},
|
|
184
|
+
tag: {
|
|
185
|
+
type: String,
|
|
186
|
+
required: false,
|
|
187
|
+
default: "nav"
|
|
188
|
+
},
|
|
189
|
+
id: {
|
|
190
|
+
type: String,
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
class: {
|
|
194
|
+
type: [
|
|
195
|
+
String,
|
|
196
|
+
Array,
|
|
197
|
+
Object
|
|
198
|
+
],
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
style: {
|
|
202
|
+
type: [
|
|
203
|
+
String,
|
|
204
|
+
Array,
|
|
205
|
+
Object,
|
|
206
|
+
Boolean,
|
|
207
|
+
null
|
|
208
|
+
],
|
|
209
|
+
required: false,
|
|
210
|
+
skipCheck: true
|
|
211
|
+
},
|
|
212
|
+
border: {
|
|
213
|
+
type: [
|
|
214
|
+
Boolean,
|
|
215
|
+
Number,
|
|
216
|
+
String,
|
|
217
|
+
Array
|
|
218
|
+
],
|
|
219
|
+
required: false,
|
|
220
|
+
skipCheck: true
|
|
221
|
+
},
|
|
222
|
+
borderTop: {
|
|
223
|
+
type: [
|
|
224
|
+
Boolean,
|
|
225
|
+
Number,
|
|
226
|
+
String
|
|
227
|
+
],
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
borderLeft: {
|
|
231
|
+
type: [
|
|
232
|
+
Boolean,
|
|
233
|
+
Number,
|
|
234
|
+
String
|
|
235
|
+
],
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
borderBottom: {
|
|
239
|
+
type: [
|
|
240
|
+
Boolean,
|
|
241
|
+
Number,
|
|
242
|
+
String
|
|
243
|
+
],
|
|
244
|
+
required: false
|
|
245
|
+
},
|
|
246
|
+
borderRight: {
|
|
247
|
+
type: [
|
|
248
|
+
Boolean,
|
|
249
|
+
Number,
|
|
250
|
+
String
|
|
251
|
+
],
|
|
252
|
+
required: false
|
|
253
|
+
},
|
|
254
|
+
borderBlock: {
|
|
255
|
+
type: [
|
|
256
|
+
Boolean,
|
|
257
|
+
Number,
|
|
258
|
+
String
|
|
259
|
+
],
|
|
260
|
+
required: false
|
|
261
|
+
},
|
|
262
|
+
borderInline: {
|
|
263
|
+
type: [
|
|
264
|
+
Boolean,
|
|
265
|
+
Number,
|
|
266
|
+
String
|
|
267
|
+
],
|
|
268
|
+
required: false
|
|
269
|
+
},
|
|
270
|
+
borderInlineStart: {
|
|
271
|
+
type: [
|
|
272
|
+
Boolean,
|
|
273
|
+
Number,
|
|
274
|
+
String
|
|
275
|
+
],
|
|
276
|
+
required: false
|
|
277
|
+
},
|
|
278
|
+
borderInlineEnd: {
|
|
279
|
+
type: [
|
|
280
|
+
Boolean,
|
|
281
|
+
Number,
|
|
282
|
+
String
|
|
283
|
+
],
|
|
284
|
+
required: false
|
|
285
|
+
},
|
|
286
|
+
borderBlockStart: {
|
|
287
|
+
type: [
|
|
288
|
+
Boolean,
|
|
289
|
+
Number,
|
|
290
|
+
String
|
|
291
|
+
],
|
|
292
|
+
required: false
|
|
293
|
+
},
|
|
294
|
+
borderBlockEnd: {
|
|
295
|
+
type: [
|
|
296
|
+
Boolean,
|
|
297
|
+
Number,
|
|
298
|
+
String
|
|
299
|
+
],
|
|
300
|
+
required: false
|
|
301
|
+
},
|
|
302
|
+
borderColor: {
|
|
303
|
+
type: String,
|
|
304
|
+
required: false
|
|
305
|
+
},
|
|
306
|
+
borderStyle: {
|
|
307
|
+
type: String,
|
|
308
|
+
required: false
|
|
309
|
+
},
|
|
310
|
+
borderTopColor: {
|
|
311
|
+
type: [
|
|
312
|
+
String,
|
|
313
|
+
Object,
|
|
314
|
+
Boolean,
|
|
315
|
+
null
|
|
316
|
+
],
|
|
317
|
+
required: false,
|
|
318
|
+
skipCheck: true
|
|
319
|
+
},
|
|
320
|
+
borderRightColor: {
|
|
321
|
+
type: [
|
|
322
|
+
String,
|
|
323
|
+
Object,
|
|
324
|
+
Boolean,
|
|
325
|
+
null
|
|
326
|
+
],
|
|
327
|
+
required: false,
|
|
328
|
+
skipCheck: true
|
|
329
|
+
},
|
|
330
|
+
borderBottomColor: {
|
|
331
|
+
type: [
|
|
332
|
+
String,
|
|
333
|
+
Object,
|
|
334
|
+
Boolean,
|
|
335
|
+
null
|
|
336
|
+
],
|
|
337
|
+
required: false,
|
|
338
|
+
skipCheck: true
|
|
339
|
+
},
|
|
340
|
+
borderLeftColor: {
|
|
341
|
+
type: [
|
|
342
|
+
String,
|
|
343
|
+
Object,
|
|
344
|
+
Boolean,
|
|
345
|
+
null
|
|
346
|
+
],
|
|
347
|
+
required: false,
|
|
348
|
+
skipCheck: true
|
|
349
|
+
},
|
|
350
|
+
borderInlineStartColor: {
|
|
351
|
+
type: [
|
|
352
|
+
String,
|
|
353
|
+
Object,
|
|
354
|
+
Boolean,
|
|
355
|
+
null
|
|
356
|
+
],
|
|
357
|
+
required: false,
|
|
358
|
+
skipCheck: true
|
|
359
|
+
},
|
|
360
|
+
borderInlineEndColor: {
|
|
361
|
+
type: [
|
|
362
|
+
String,
|
|
363
|
+
Object,
|
|
364
|
+
Boolean,
|
|
365
|
+
null
|
|
366
|
+
],
|
|
367
|
+
required: false,
|
|
368
|
+
skipCheck: true
|
|
369
|
+
},
|
|
370
|
+
borderBlockStartColor: {
|
|
371
|
+
type: [
|
|
372
|
+
String,
|
|
373
|
+
Object,
|
|
374
|
+
Boolean,
|
|
375
|
+
null
|
|
376
|
+
],
|
|
377
|
+
required: false,
|
|
378
|
+
skipCheck: true
|
|
379
|
+
},
|
|
380
|
+
borderBlockEndColor: {
|
|
381
|
+
type: [
|
|
382
|
+
String,
|
|
383
|
+
Object,
|
|
384
|
+
Boolean,
|
|
385
|
+
null
|
|
386
|
+
],
|
|
387
|
+
required: false,
|
|
388
|
+
skipCheck: true
|
|
389
|
+
},
|
|
390
|
+
elevation: {
|
|
391
|
+
type: [Number, String],
|
|
392
|
+
required: false
|
|
393
|
+
},
|
|
394
|
+
name: {
|
|
395
|
+
type: String,
|
|
396
|
+
required: false
|
|
397
|
+
},
|
|
398
|
+
order: {
|
|
399
|
+
type: [String, Number],
|
|
400
|
+
required: false
|
|
401
|
+
},
|
|
402
|
+
absolute: {
|
|
403
|
+
type: Boolean,
|
|
404
|
+
required: false
|
|
405
|
+
},
|
|
406
|
+
location: {
|
|
407
|
+
type: null,
|
|
408
|
+
required: false,
|
|
409
|
+
default: INLINE.LEFT
|
|
410
|
+
},
|
|
411
|
+
rounded: {
|
|
412
|
+
type: [
|
|
413
|
+
Boolean,
|
|
414
|
+
Number,
|
|
415
|
+
String,
|
|
416
|
+
null
|
|
417
|
+
],
|
|
418
|
+
required: false,
|
|
419
|
+
skipCheck: true
|
|
420
|
+
},
|
|
421
|
+
roundedTopRight: {
|
|
422
|
+
type: [
|
|
423
|
+
Boolean,
|
|
424
|
+
Number,
|
|
425
|
+
String
|
|
426
|
+
],
|
|
427
|
+
required: false
|
|
428
|
+
},
|
|
429
|
+
roundedTopLeft: {
|
|
430
|
+
type: [
|
|
431
|
+
Boolean,
|
|
432
|
+
Number,
|
|
433
|
+
String
|
|
434
|
+
],
|
|
435
|
+
required: false
|
|
436
|
+
},
|
|
437
|
+
roundedBottomLeft: {
|
|
438
|
+
type: [
|
|
439
|
+
Boolean,
|
|
440
|
+
Number,
|
|
441
|
+
String
|
|
442
|
+
],
|
|
443
|
+
required: false
|
|
444
|
+
},
|
|
445
|
+
roundedBottomRight: {
|
|
446
|
+
type: [
|
|
447
|
+
Boolean,
|
|
448
|
+
Number,
|
|
449
|
+
String
|
|
450
|
+
],
|
|
451
|
+
required: false
|
|
452
|
+
},
|
|
453
|
+
roundedStartStart: {
|
|
454
|
+
type: [
|
|
455
|
+
Boolean,
|
|
456
|
+
Number,
|
|
457
|
+
String
|
|
458
|
+
],
|
|
459
|
+
required: false
|
|
460
|
+
},
|
|
461
|
+
roundedStartEnd: {
|
|
462
|
+
type: [
|
|
463
|
+
Boolean,
|
|
464
|
+
Number,
|
|
465
|
+
String
|
|
466
|
+
],
|
|
467
|
+
required: false
|
|
468
|
+
},
|
|
469
|
+
roundedEndStart: {
|
|
470
|
+
type: [
|
|
471
|
+
Boolean,
|
|
472
|
+
Number,
|
|
473
|
+
String
|
|
474
|
+
],
|
|
475
|
+
required: false
|
|
476
|
+
},
|
|
477
|
+
roundedEndEnd: {
|
|
478
|
+
type: [
|
|
479
|
+
Boolean,
|
|
480
|
+
Number,
|
|
481
|
+
String
|
|
482
|
+
],
|
|
483
|
+
required: false
|
|
484
|
+
},
|
|
485
|
+
color: {
|
|
486
|
+
type: [
|
|
487
|
+
String,
|
|
488
|
+
Object,
|
|
489
|
+
Boolean,
|
|
490
|
+
null
|
|
491
|
+
],
|
|
492
|
+
required: false,
|
|
493
|
+
skipCheck: true
|
|
494
|
+
},
|
|
495
|
+
bgColor: {
|
|
496
|
+
type: [
|
|
497
|
+
String,
|
|
498
|
+
Object,
|
|
499
|
+
Boolean,
|
|
500
|
+
null
|
|
501
|
+
],
|
|
502
|
+
required: false,
|
|
503
|
+
skipCheck: true
|
|
504
|
+
},
|
|
505
|
+
density: {
|
|
506
|
+
type: null,
|
|
507
|
+
required: false
|
|
508
|
+
},
|
|
509
|
+
padding: {
|
|
510
|
+
type: [
|
|
511
|
+
Boolean,
|
|
512
|
+
Number,
|
|
513
|
+
String
|
|
514
|
+
],
|
|
515
|
+
required: false
|
|
516
|
+
},
|
|
517
|
+
paddingTop: {
|
|
518
|
+
type: [
|
|
519
|
+
Boolean,
|
|
520
|
+
Number,
|
|
521
|
+
String
|
|
522
|
+
],
|
|
523
|
+
required: false
|
|
524
|
+
},
|
|
525
|
+
paddingLeft: {
|
|
526
|
+
type: [
|
|
527
|
+
Boolean,
|
|
528
|
+
Number,
|
|
529
|
+
String
|
|
530
|
+
],
|
|
531
|
+
required: false
|
|
532
|
+
},
|
|
533
|
+
paddingBottom: {
|
|
534
|
+
type: [
|
|
535
|
+
Boolean,
|
|
536
|
+
Number,
|
|
537
|
+
String
|
|
538
|
+
],
|
|
539
|
+
required: false
|
|
540
|
+
},
|
|
541
|
+
paddingRight: {
|
|
542
|
+
type: [
|
|
543
|
+
Boolean,
|
|
544
|
+
Number,
|
|
545
|
+
String
|
|
546
|
+
],
|
|
547
|
+
required: false
|
|
548
|
+
},
|
|
549
|
+
paddingBlock: {
|
|
550
|
+
type: [
|
|
551
|
+
Boolean,
|
|
552
|
+
Number,
|
|
553
|
+
String
|
|
554
|
+
],
|
|
555
|
+
required: false
|
|
556
|
+
},
|
|
557
|
+
paddingInline: {
|
|
558
|
+
type: [
|
|
559
|
+
Boolean,
|
|
560
|
+
Number,
|
|
561
|
+
String
|
|
562
|
+
],
|
|
563
|
+
required: false
|
|
564
|
+
},
|
|
565
|
+
paddingInlineStart: {
|
|
566
|
+
type: [
|
|
567
|
+
Boolean,
|
|
568
|
+
Number,
|
|
569
|
+
String
|
|
570
|
+
],
|
|
571
|
+
required: false
|
|
572
|
+
},
|
|
573
|
+
paddingInlineEnd: {
|
|
574
|
+
type: [
|
|
575
|
+
Boolean,
|
|
576
|
+
Number,
|
|
577
|
+
String
|
|
578
|
+
],
|
|
579
|
+
required: false
|
|
580
|
+
},
|
|
581
|
+
paddingBlockStart: {
|
|
582
|
+
type: [
|
|
583
|
+
Boolean,
|
|
584
|
+
Number,
|
|
585
|
+
String
|
|
586
|
+
],
|
|
587
|
+
required: false
|
|
588
|
+
},
|
|
589
|
+
paddingBlockEnd: {
|
|
590
|
+
type: [
|
|
591
|
+
Boolean,
|
|
592
|
+
Number,
|
|
593
|
+
String
|
|
594
|
+
],
|
|
595
|
+
required: false
|
|
596
|
+
},
|
|
597
|
+
margin: {
|
|
598
|
+
type: [
|
|
599
|
+
Boolean,
|
|
600
|
+
Number,
|
|
601
|
+
String
|
|
602
|
+
],
|
|
603
|
+
required: false
|
|
604
|
+
},
|
|
605
|
+
marginTop: {
|
|
606
|
+
type: [
|
|
607
|
+
Boolean,
|
|
608
|
+
Number,
|
|
609
|
+
String
|
|
610
|
+
],
|
|
611
|
+
required: false
|
|
612
|
+
},
|
|
613
|
+
marginLeft: {
|
|
614
|
+
type: [
|
|
615
|
+
Boolean,
|
|
616
|
+
Number,
|
|
617
|
+
String
|
|
618
|
+
],
|
|
619
|
+
required: false
|
|
620
|
+
},
|
|
621
|
+
marginBottom: {
|
|
622
|
+
type: [
|
|
623
|
+
Boolean,
|
|
624
|
+
Number,
|
|
625
|
+
String
|
|
626
|
+
],
|
|
627
|
+
required: false
|
|
628
|
+
},
|
|
629
|
+
marginRight: {
|
|
630
|
+
type: [
|
|
631
|
+
Boolean,
|
|
632
|
+
Number,
|
|
633
|
+
String
|
|
634
|
+
],
|
|
635
|
+
required: false
|
|
636
|
+
},
|
|
637
|
+
marginBlock: {
|
|
638
|
+
type: [
|
|
639
|
+
Boolean,
|
|
640
|
+
Number,
|
|
641
|
+
String
|
|
642
|
+
],
|
|
643
|
+
required: false
|
|
644
|
+
},
|
|
645
|
+
marginInline: {
|
|
646
|
+
type: [
|
|
647
|
+
Boolean,
|
|
648
|
+
Number,
|
|
649
|
+
String
|
|
650
|
+
],
|
|
651
|
+
required: false
|
|
652
|
+
},
|
|
653
|
+
marginInlineStart: {
|
|
654
|
+
type: [
|
|
655
|
+
Boolean,
|
|
656
|
+
Number,
|
|
657
|
+
String
|
|
658
|
+
],
|
|
659
|
+
required: false
|
|
660
|
+
},
|
|
661
|
+
marginInlineEnd: {
|
|
662
|
+
type: [
|
|
663
|
+
Boolean,
|
|
664
|
+
Number,
|
|
665
|
+
String
|
|
666
|
+
],
|
|
667
|
+
required: false
|
|
668
|
+
},
|
|
669
|
+
marginBlockStart: {
|
|
670
|
+
type: [
|
|
671
|
+
Boolean,
|
|
672
|
+
Number,
|
|
673
|
+
String
|
|
674
|
+
],
|
|
675
|
+
required: false
|
|
676
|
+
},
|
|
677
|
+
marginBlockEnd: {
|
|
678
|
+
type: [
|
|
679
|
+
Boolean,
|
|
680
|
+
Number,
|
|
681
|
+
String
|
|
682
|
+
],
|
|
683
|
+
required: false
|
|
684
|
+
},
|
|
685
|
+
transition: {
|
|
686
|
+
type: [
|
|
687
|
+
Boolean,
|
|
688
|
+
String,
|
|
689
|
+
Object
|
|
690
|
+
],
|
|
691
|
+
required: false,
|
|
692
|
+
default: "origam-transition--drawer"
|
|
693
|
+
},
|
|
694
|
+
scrim: {
|
|
695
|
+
type: [Boolean, String],
|
|
696
|
+
required: false,
|
|
697
|
+
default: true
|
|
698
|
+
},
|
|
699
|
+
active: {
|
|
700
|
+
type: [Boolean, Object],
|
|
701
|
+
required: false
|
|
702
|
+
},
|
|
703
|
+
activeClass: {
|
|
704
|
+
type: String,
|
|
705
|
+
required: false
|
|
706
|
+
},
|
|
707
|
+
hover: {
|
|
708
|
+
type: [Boolean, Object],
|
|
709
|
+
required: false
|
|
710
|
+
},
|
|
711
|
+
hoverClass: {
|
|
712
|
+
type: String,
|
|
713
|
+
required: false
|
|
714
|
+
}
|
|
181
715
|
});
|
|
182
716
|
const emits = defineEmits(["update:rail", "update:modelValue"]);
|
|
183
717
|
defineSlots();
|
|
184
718
|
const { filterProps } = useProps(props);
|
|
719
|
+
// Phase 3 (Vague C) — class-first companion alongside inline styles.
|
|
720
|
+
// `backgroundColorClasses` ships `.origam--bg-{intent}` for tokenised
|
|
721
|
+
// intents on the drawer root; `backgroundColorStyles` keeps the
|
|
722
|
+
// legacy raw-color fallback in parallel.
|
|
723
|
+
/*********************************************************
|
|
724
|
+
* Composables
|
|
725
|
+
********************************************************/
|
|
185
726
|
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, "bgColor"));
|
|
186
727
|
const { densityClasses } = useDensity(props);
|
|
187
728
|
const { isOn: isHover, config: hoverState } = useStateFlag(props, { state: "hover" });
|
|
188
729
|
const { config: activeState } = useStateFlag(props, { state: "active" });
|
|
730
|
+
/*********************************************************
|
|
731
|
+
* Value
|
|
732
|
+
*
|
|
733
|
+
* @description
|
|
734
|
+
* Active state, width derivation, and location/sticky flags.
|
|
735
|
+
* Declared BEFORE `useStateEffect` so it can be passed in.
|
|
736
|
+
********************************************************/
|
|
189
737
|
const isActive = useVModel(props, "modelValue", false, (v) => !!v);
|
|
190
|
-
const {
|
|
191
|
-
borderClasses,
|
|
192
|
-
borderStyles,
|
|
193
|
-
roundedClasses,
|
|
194
|
-
roundedStyles,
|
|
195
|
-
elevationClasses,
|
|
196
|
-
paddingClasses,
|
|
197
|
-
paddingStyles,
|
|
198
|
-
marginClasses,
|
|
199
|
-
marginStyles
|
|
200
|
-
} = useStateEffect(props, isHover, isActive, hoverState, activeState);
|
|
738
|
+
const { borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, paddingClasses, paddingStyles, marginClasses, marginStyles } = useStateEffect(props, isHover, isActive, hoverState, activeState);
|
|
201
739
|
const slots = useSlots();
|
|
202
740
|
const router = useRouter();
|
|
203
741
|
const { ssrBootStyles } = useSsrBoot();
|
|
@@ -205,163 +743,327 @@ const { scopeId } = useScopeId();
|
|
|
205
743
|
const { t } = useLocale();
|
|
206
744
|
const rootEl = ref();
|
|
207
745
|
const isHovering = shallowRef(false);
|
|
746
|
+
/*********************************************************
|
|
747
|
+
* width
|
|
748
|
+
*
|
|
749
|
+
* @description
|
|
750
|
+
* #384 — `Number(props.width)` / `Number(props.railWidth)`
|
|
751
|
+
* returned NaN for any CSS length string (`Number('256px')`
|
|
752
|
+
* === NaN). Unlike OrigamBottomNav/OrigamSystemBar, this
|
|
753
|
+
* component has no `useDimension()` fallback — this value
|
|
754
|
+
* is the ONLY source feeding `useLayoutItem`'s `elementSize`,
|
|
755
|
+
* so the invalid `width: NaN` declaration was silently
|
|
756
|
+
* dropped and the drawer rendered with NO explicit width at
|
|
757
|
+
* all instead of a wrong one. `int()` parses both a bare
|
|
758
|
+
* number and a CSS-length string (`parseInt(value, 10)`).
|
|
759
|
+
********************************************************/
|
|
208
760
|
const width = computed(() => {
|
|
209
|
-
|
|
761
|
+
return props.rail && props.expandOnHover && isHovering.value ? int(props.width) : int(props.rail ? props.railWidth : props.width);
|
|
210
762
|
});
|
|
211
763
|
const location = computed(() => {
|
|
212
|
-
|
|
764
|
+
return props.location;
|
|
213
765
|
});
|
|
214
766
|
const isTemporary = computed(() => !props.permanent && props.temporary);
|
|
215
767
|
const isSticky = computed(() => {
|
|
216
|
-
|
|
768
|
+
return props.sticky && !isTemporary.value && location.value !== "bottom";
|
|
217
769
|
});
|
|
218
770
|
useToggleScope(() => props.expandOnHover && props.rail != null, () => {
|
|
219
|
-
|
|
771
|
+
watch(isHovering, (val) => emits("update:rail", !val));
|
|
220
772
|
});
|
|
221
773
|
useToggleScope(() => !props.disableResizeWatcher, () => {
|
|
222
|
-
|
|
774
|
+
watch(isTemporary, (val) => !props.permanent && nextTick(() => isActive.value = !val));
|
|
223
775
|
});
|
|
224
776
|
useToggleScope(() => !props.disableRouteWatcher && !!router, () => {
|
|
225
|
-
|
|
777
|
+
watch(router.currentRoute, () => isTemporary.value && (isActive.value = false));
|
|
226
778
|
});
|
|
227
779
|
watch(() => props.permanent, (val) => {
|
|
228
|
-
|
|
780
|
+
if (val) isActive.value = true;
|
|
229
781
|
});
|
|
230
782
|
const initActive = () => {
|
|
231
|
-
|
|
232
|
-
|
|
783
|
+
if (props.modelValue != null || isTemporary.value) return;
|
|
784
|
+
isActive.value = props.permanent;
|
|
233
785
|
};
|
|
234
786
|
onBeforeMount(initActive);
|
|
787
|
+
/*********************************************************
|
|
788
|
+
* SSR initial state — #1223
|
|
789
|
+
*
|
|
790
|
+
* @description
|
|
791
|
+
* `onBeforeMount` never runs during SSR, so a `permanent` drawer rendered
|
|
792
|
+
* inactive on the server but active on the client (mismatch).
|
|
793
|
+
********************************************************/
|
|
235
794
|
onServerPrefetch(initActive);
|
|
795
|
+
/*********************************************************
|
|
796
|
+
* Drag
|
|
797
|
+
*
|
|
798
|
+
* @description
|
|
799
|
+
* Touch-drag to open/close the drawer.
|
|
800
|
+
********************************************************/
|
|
236
801
|
const { isDragging, dragProgress, dragStyles } = useTouch({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
802
|
+
isActive,
|
|
803
|
+
isTemporary,
|
|
804
|
+
width,
|
|
805
|
+
touchless: toRef(props, "touchless"),
|
|
806
|
+
position: location
|
|
242
807
|
});
|
|
808
|
+
/*********************************************************
|
|
809
|
+
* Layout
|
|
810
|
+
*
|
|
811
|
+
* @description
|
|
812
|
+
* Registers the drawer as a layout item. When no OrigamLayout
|
|
813
|
+
* ancestor exists, `layoutId` is 'origam-layout-orphan' and the
|
|
814
|
+
* teleport is disabled so the drawer renders inline.
|
|
815
|
+
********************************************************/
|
|
243
816
|
const layoutSize = computed(() => {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
817
|
+
// Push gate: if the drawer isn't supposed to push the layout,
|
|
818
|
+
// reserve 0 space so adjacent toolbar / main / footer stay full
|
|
819
|
+
// width regardless of whether the drawer is currently visible.
|
|
820
|
+
if (!isPushing.value) return 0;
|
|
821
|
+
const size = isTemporary.value ? 0 : props.rail && props.expandOnHover ? int(props.railWidth) : width.value;
|
|
822
|
+
return isDragging.value ? size * dragProgress.value : size;
|
|
247
823
|
});
|
|
824
|
+
// ── Push / clipped resolution ─────────────────────────────────
|
|
825
|
+
//
|
|
826
|
+
// `push`: does the drawer reserve space in the layout grid (push
|
|
827
|
+
// adjacent toolbar / main / footer) or overlay them?
|
|
828
|
+
// • explicit prop wins
|
|
829
|
+
// • else: permanent drawers push, temporary drawers overlay
|
|
830
|
+
//
|
|
831
|
+
// `clipped`: does the drawer slot BELOW the AppBar (and any other
|
|
832
|
+
// top-anchored layout item) or extend full-height
|
|
833
|
+
// (covering the AppBar from the left)?
|
|
834
|
+
// • explicit prop wins
|
|
835
|
+
// • else: HTML declaration order decides
|
|
836
|
+
// (AppBar before Drawer → clipped; Drawer before AppBar → full-height)
|
|
837
|
+
//
|
|
838
|
+
// Effective order:
|
|
839
|
+
// • clipped=true → bump order to 1 so drawer comes AFTER any
|
|
840
|
+
// AppBar registered at order 0
|
|
841
|
+
// • clipped=false → keep order 0 so drawer comes BEFORE the AppBar
|
|
842
|
+
// • default (undefined) → 0 + natural HTML order via
|
|
843
|
+
// `registered.value` insertion (top items at index < drawer index
|
|
844
|
+
// will register first)
|
|
248
845
|
const isPushing = computed(() => {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
846
|
+
// `null` means "not set by consumer" — fall back to heuristic
|
|
847
|
+
// (permanent drawers push, temporary drawers overlay).
|
|
848
|
+
// `true` / `false` is the explicit consumer choice.
|
|
849
|
+
if (props.push === null || props.push === undefined) {
|
|
850
|
+
return !!props.permanent && !props.temporary;
|
|
851
|
+
}
|
|
852
|
+
return !!props.push;
|
|
253
853
|
});
|
|
254
854
|
const layoutOrder = computed(() => {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
855
|
+
const explicit = int(props.order);
|
|
856
|
+
if (Number.isFinite(explicit)) return explicit;
|
|
857
|
+
if (props.clipped === true) return 1;
|
|
858
|
+
if (props.clipped === false) return 0;
|
|
859
|
+
return 0;
|
|
260
860
|
});
|
|
861
|
+
/*********************************************************
|
|
862
|
+
* ⛔ `props.name` est lu EAGERLY ici, et c'est VOULU (ADR-005).
|
|
863
|
+
*
|
|
864
|
+
* @description
|
|
865
|
+
* `useLayoutItem` se sert de cet `id` pour `provide(
|
|
866
|
+
* ORIGAM_LAYOUT_ITEM_KEY, {id})`, `layout.register(vm, {..., id})` et
|
|
867
|
+
* `layout.unregister(id)` au demontage : il exige une valeur STABLE des
|
|
868
|
+
* le setup. Le differer laisserait un element fantome dans le layout et
|
|
869
|
+
* n'en desenregistrerait aucun.
|
|
870
|
+
*
|
|
871
|
+
* @description
|
|
872
|
+
* `name` est une IDENTITE, pas un reglage visuel — au meme titre qu'un
|
|
873
|
+
* `id`. Arbitrage utilisateur du 2026-09-02 : un theme n'a pas vocation
|
|
874
|
+
* a nommer un element de layout. L'exception est actee dans
|
|
875
|
+
* `scripts/guards/lib/setup-reads.exceptions.mjs`, avec sa raison.
|
|
876
|
+
********************************************************/
|
|
261
877
|
const { layoutItemStyles, layoutItemScrimStyles, layoutId } = useLayoutItem({
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
() => props.absolute || isSticky.value && typeof isStuck.value !== "string"
|
|
277
|
-
)
|
|
878
|
+
id: props.name,
|
|
879
|
+
order: layoutOrder,
|
|
880
|
+
position: location,
|
|
881
|
+
layoutSize,
|
|
882
|
+
elementSize: width,
|
|
883
|
+
// `active` controls the VISUAL transform of the drawer (open
|
|
884
|
+
// vs off-screen via translateX(0%) / translateX(-110%)).
|
|
885
|
+
// It must follow `isActive` regardless of push mode — otherwise
|
|
886
|
+
// the inline transform would stick the drawer off-screen even
|
|
887
|
+
// when the consumer is trying to display it. The PUSH gate
|
|
888
|
+
// lives in `layoutSize` above (returns 0 → no layer reservation).
|
|
889
|
+
active: computed(() => isActive.value || isDragging.value),
|
|
890
|
+
disableTransitions: computed(() => isDragging.value),
|
|
891
|
+
absolute: computed(() => props.absolute || isSticky.value && typeof isStuck.value !== "string")
|
|
278
892
|
});
|
|
893
|
+
// `useLayoutItem` falls back to `layoutId: 'origam-layout-orphan'`
|
|
894
|
+
// when no `<OrigamLayout>` ancestor is in the tree (stories, modal
|
|
895
|
+
// previews, tests). The corresponding `#origam-layout-orphan
|
|
896
|
+
// .origam-layout__wrapper` selector doesn't exist in the DOM, so
|
|
897
|
+
// `<teleport :to="…">` silently no-ops and the drawer never mounts.
|
|
898
|
+
// Detect the orphan case and disable the teleport — Vue's
|
|
899
|
+
// `disabled` flag falls back to inline rendering at the declared
|
|
900
|
+
// position, which is what the consumer expects in standalone use.
|
|
279
901
|
const resolvedLayoutId = computed(() => isRef(layoutId) ? layoutId.value : layoutId);
|
|
280
902
|
const isLayoutOrphan = computed(() => resolvedLayoutId.value === "origam-layout-orphan");
|
|
281
903
|
const teleportDrawer = computed(() => {
|
|
282
|
-
|
|
904
|
+
return `#${resolvedLayoutId.value} .origam-layout__wrapper`;
|
|
283
905
|
});
|
|
906
|
+
/*********************************************************
|
|
907
|
+
* `attach` — #attach-harmonisation
|
|
908
|
+
*
|
|
909
|
+
* @description
|
|
910
|
+
* `OrigamDrawer`'s OWN default target (the layout wrapper above, or
|
|
911
|
+
* inline when orphaned) is NOT `document.body`, unlike the rest of
|
|
912
|
+
* the Overlay family — so `attach` only overrides it when the
|
|
913
|
+
* consumer EXPLICITLY sets it. `props.attach !== null` is that
|
|
914
|
+
* signal (the `null` default, like `push` / `clipped`, survives
|
|
915
|
+
* Vue's boolean-prop casting untouched). When overridden, resolution
|
|
916
|
+
* goes through the same `useTeleport()` every other teleporting
|
|
917
|
+
* component in the DS consumes — `?? false` only normalises the type
|
|
918
|
+
* for the composable; the attach-ed branch below never calls it with
|
|
919
|
+
* `null` because `hasExplicitAttach` already excludes that case.
|
|
920
|
+
********************************************************/
|
|
284
921
|
const hasExplicitAttach = computed(() => props.attach !== null);
|
|
285
922
|
const { teleportTarget: attachTarget } = useTeleport(computed(() => props.attach || false));
|
|
923
|
+
/*********************************************************
|
|
924
|
+
* Hydration — #1223
|
|
925
|
+
*
|
|
926
|
+
* @description
|
|
927
|
+
* The default branch teleported during SSR and the first client render
|
|
928
|
+
* (hydration mismatch). Stay inline until hydrated so the client's first
|
|
929
|
+
* render matches the server.
|
|
930
|
+
*
|
|
931
|
+
* @description
|
|
932
|
+
* `to` must stay a string: Vue's SSR renders NOTHING for a Teleport
|
|
933
|
+
* without a target, even when disabled.
|
|
934
|
+
********************************************************/
|
|
286
935
|
const isHydrated = useHydration();
|
|
287
936
|
const teleportDisabled = computed(() => {
|
|
288
|
-
|
|
937
|
+
return hasExplicitAttach.value ? !attachTarget.value : isLayoutOrphan.value || !isHydrated.value;
|
|
289
938
|
});
|
|
290
939
|
const teleportTo = computed(() => {
|
|
291
|
-
|
|
940
|
+
return hasExplicitAttach.value ? attachTarget.value : teleportDrawer.value;
|
|
941
|
+
});
|
|
942
|
+
const { isStuck, stickyStyles } = useSticky({
|
|
943
|
+
rootEl,
|
|
944
|
+
isSticky,
|
|
945
|
+
layoutItemStyles
|
|
292
946
|
});
|
|
293
|
-
|
|
947
|
+
/*********************************************************
|
|
948
|
+
* Scrim
|
|
949
|
+
*
|
|
950
|
+
* @description
|
|
951
|
+
* Scrim opacity follows drag progress when dragging.
|
|
952
|
+
********************************************************/
|
|
294
953
|
const scrimStyles = computed(() => ({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
954
|
+
...isDragging.value ? {
|
|
955
|
+
opacity: dragProgress.value * .2,
|
|
956
|
+
transition: "none"
|
|
957
|
+
} : undefined,
|
|
958
|
+
...layoutItemScrimStyles.value
|
|
300
959
|
}));
|
|
960
|
+
/*********************************************************
|
|
961
|
+
* Event handlers
|
|
962
|
+
********************************************************/
|
|
301
963
|
const handleClickScrim = () => {
|
|
302
|
-
|
|
964
|
+
isActive.value = false;
|
|
303
965
|
};
|
|
966
|
+
/*********************************************************
|
|
967
|
+
* Hover
|
|
968
|
+
*
|
|
969
|
+
* @description
|
|
970
|
+
* Expand-on-hover rail mode toggle.
|
|
971
|
+
********************************************************/
|
|
304
972
|
const handleMouseEnter = () => {
|
|
305
|
-
|
|
973
|
+
isHovering.value = true;
|
|
306
974
|
};
|
|
307
975
|
const handleMouseLeave = () => {
|
|
308
|
-
|
|
976
|
+
isHovering.value = false;
|
|
309
977
|
};
|
|
978
|
+
/*********************************************************
|
|
979
|
+
* Slots
|
|
980
|
+
*
|
|
981
|
+
* @description
|
|
982
|
+
* Detects presence of prepend, default (content), and append slots.
|
|
983
|
+
********************************************************/
|
|
310
984
|
const hasPrepend = computed(() => {
|
|
311
|
-
|
|
985
|
+
return slots.prepend;
|
|
312
986
|
});
|
|
313
987
|
const hasContent = computed(() => {
|
|
314
|
-
|
|
988
|
+
return slots.default;
|
|
315
989
|
});
|
|
316
990
|
const hasAppend = computed(() => {
|
|
317
|
-
|
|
991
|
+
return slots.append;
|
|
318
992
|
});
|
|
993
|
+
/*********************************************************
|
|
994
|
+
* Nom accessible
|
|
995
|
+
*
|
|
996
|
+
* @description
|
|
997
|
+
* Le repli était la chaîne anglaise `'Navigation'` écrite en dur dans
|
|
998
|
+
* le gabarit, derrière un `||` — la position exacte où le détecteur C8
|
|
999
|
+
* est aveugle. Elle était annoncée telle quelle par tout lecteur
|
|
1000
|
+
* d'écran, quelle que soit la langue active.
|
|
1001
|
+
*
|
|
1002
|
+
* @description
|
|
1003
|
+
* `name` reste prioritaire : c'est le libellé que le consommateur a
|
|
1004
|
+
* choisi. On ne retombe sur le catalogue que s'il n'en a fourni aucun.
|
|
1005
|
+
* Lecture DIFFÉRÉE dans un `computed` (ADR-005) — contrairement à la
|
|
1006
|
+
* lecture eager de `name` par `useLayoutItem`, qui est une exception
|
|
1007
|
+
* actée parce qu'un id de layout doit être stable dès le setup.
|
|
1008
|
+
********************************************************/
|
|
319
1009
|
const drawerAriaLabel = computed(() => props.name || t("origam.drawer.aria_label"));
|
|
1010
|
+
/*********************************************************
|
|
1011
|
+
* Class & Style
|
|
1012
|
+
*
|
|
1013
|
+
* @description
|
|
1014
|
+
* drawerClasses and drawerStyles computed properties.
|
|
1015
|
+
********************************************************/
|
|
320
1016
|
const drawerStyles = computed(() => {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
1017
|
+
return [
|
|
1018
|
+
backgroundColorStyles.value,
|
|
1019
|
+
roundedStyles.value,
|
|
1020
|
+
borderStyles.value,
|
|
1021
|
+
paddingStyles.value,
|
|
1022
|
+
marginStyles.value,
|
|
1023
|
+
layoutItemStyles.value,
|
|
1024
|
+
dragStyles.value,
|
|
1025
|
+
ssrBootStyles.value,
|
|
1026
|
+
stickyStyles.value,
|
|
1027
|
+
props.style
|
|
1028
|
+
];
|
|
333
1029
|
});
|
|
334
1030
|
const drawerClasses = computed(() => {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
1031
|
+
return [
|
|
1032
|
+
"origam-drawer",
|
|
1033
|
+
`origam-drawer--${location.value}`,
|
|
1034
|
+
{
|
|
1035
|
+
"origam-drawer--expand-on-hover": props.expandOnHover,
|
|
1036
|
+
"origam-drawer--floating": props.floating,
|
|
1037
|
+
"origam-drawer--is-hovering": isHovering.value,
|
|
1038
|
+
"origam-drawer--rail": props.rail,
|
|
1039
|
+
"origam-drawer--temporary": isTemporary.value,
|
|
1040
|
+
"origam-drawer--active": isActive.value,
|
|
1041
|
+
"origam-drawer--sticky": isSticky.value
|
|
1042
|
+
},
|
|
1043
|
+
backgroundColorClasses.value,
|
|
1044
|
+
borderClasses.value,
|
|
1045
|
+
paddingClasses.value,
|
|
1046
|
+
marginClasses.value,
|
|
1047
|
+
densityClasses.value,
|
|
1048
|
+
elevationClasses.value,
|
|
1049
|
+
roundedClasses.value,
|
|
1050
|
+
props.class
|
|
1051
|
+
];
|
|
356
1052
|
});
|
|
357
1053
|
const { id, css, load, isLoaded, unload } = useStyle(drawerStyles, () => props.id);
|
|
1054
|
+
/*********************************************************
|
|
1055
|
+
* Expose
|
|
1056
|
+
*
|
|
1057
|
+
* @description
|
|
1058
|
+
* Forwards filterProps to parent components.
|
|
1059
|
+
********************************************************/
|
|
358
1060
|
defineExpose({
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
1061
|
+
filterProps,
|
|
1062
|
+
css,
|
|
1063
|
+
id,
|
|
1064
|
+
load,
|
|
1065
|
+
unload,
|
|
1066
|
+
isLoaded
|
|
365
1067
|
});
|
|
366
1068
|
</script>
|
|
367
1069
|
|