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
|
@@ -63,189 +63,897 @@ import { BLOCK } from "../../enums/Commons/anchor.enum";
|
|
|
63
63
|
import { MODE } from "../../enums/Commons/mode.enum";
|
|
64
64
|
import { convertToUnit, int, omitUndefined } from "../../utils/Commons/commons.util";
|
|
65
65
|
import { computed, ref, StyleValue, toRef } from "vue";
|
|
66
|
+
/*********************************************************
|
|
67
|
+
* Global
|
|
68
|
+
*
|
|
69
|
+
* @description
|
|
70
|
+
* Props and slot defaults propagation to child buttons
|
|
71
|
+
* via OrigamDefaultsProvider.
|
|
72
|
+
********************************************************/
|
|
66
73
|
const props = defineProps({
|
|
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
|
-
|
|
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
|
-
|
|
74
|
+
grow: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
required: false
|
|
77
|
+
},
|
|
78
|
+
mode: {
|
|
79
|
+
type: null,
|
|
80
|
+
required: false,
|
|
81
|
+
default: MODE.VERTICAL
|
|
82
|
+
},
|
|
83
|
+
items: {
|
|
84
|
+
type: Array,
|
|
85
|
+
required: false,
|
|
86
|
+
default: () => []
|
|
87
|
+
},
|
|
88
|
+
position: {
|
|
89
|
+
type: null,
|
|
90
|
+
required: false,
|
|
91
|
+
default: "start"
|
|
92
|
+
},
|
|
93
|
+
tag: {
|
|
94
|
+
type: String,
|
|
95
|
+
required: false,
|
|
96
|
+
default: "nav"
|
|
97
|
+
},
|
|
98
|
+
id: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: false
|
|
101
|
+
},
|
|
102
|
+
class: {
|
|
103
|
+
type: [
|
|
104
|
+
String,
|
|
105
|
+
Array,
|
|
106
|
+
Object
|
|
107
|
+
],
|
|
108
|
+
required: false
|
|
109
|
+
},
|
|
110
|
+
style: {
|
|
111
|
+
type: [
|
|
112
|
+
String,
|
|
113
|
+
Array,
|
|
114
|
+
Object,
|
|
115
|
+
Boolean,
|
|
116
|
+
null
|
|
117
|
+
],
|
|
118
|
+
required: false,
|
|
119
|
+
skipCheck: true
|
|
120
|
+
},
|
|
121
|
+
color: {
|
|
122
|
+
type: [
|
|
123
|
+
String,
|
|
124
|
+
Object,
|
|
125
|
+
Boolean,
|
|
126
|
+
null
|
|
127
|
+
],
|
|
128
|
+
required: false,
|
|
129
|
+
skipCheck: true
|
|
130
|
+
},
|
|
131
|
+
bgColor: {
|
|
132
|
+
type: [
|
|
133
|
+
String,
|
|
134
|
+
Object,
|
|
135
|
+
Boolean,
|
|
136
|
+
null
|
|
137
|
+
],
|
|
138
|
+
required: false,
|
|
139
|
+
skipCheck: true
|
|
140
|
+
},
|
|
141
|
+
padding: {
|
|
142
|
+
type: [
|
|
143
|
+
Boolean,
|
|
144
|
+
Number,
|
|
145
|
+
String
|
|
146
|
+
],
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
paddingTop: {
|
|
150
|
+
type: [
|
|
151
|
+
Boolean,
|
|
152
|
+
Number,
|
|
153
|
+
String
|
|
154
|
+
],
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
paddingLeft: {
|
|
158
|
+
type: [
|
|
159
|
+
Boolean,
|
|
160
|
+
Number,
|
|
161
|
+
String
|
|
162
|
+
],
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
paddingBottom: {
|
|
166
|
+
type: [
|
|
167
|
+
Boolean,
|
|
168
|
+
Number,
|
|
169
|
+
String
|
|
170
|
+
],
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
paddingRight: {
|
|
174
|
+
type: [
|
|
175
|
+
Boolean,
|
|
176
|
+
Number,
|
|
177
|
+
String
|
|
178
|
+
],
|
|
179
|
+
required: false
|
|
180
|
+
},
|
|
181
|
+
paddingBlock: {
|
|
182
|
+
type: [
|
|
183
|
+
Boolean,
|
|
184
|
+
Number,
|
|
185
|
+
String
|
|
186
|
+
],
|
|
187
|
+
required: false
|
|
188
|
+
},
|
|
189
|
+
paddingInline: {
|
|
190
|
+
type: [
|
|
191
|
+
Boolean,
|
|
192
|
+
Number,
|
|
193
|
+
String
|
|
194
|
+
],
|
|
195
|
+
required: false
|
|
196
|
+
},
|
|
197
|
+
paddingInlineStart: {
|
|
198
|
+
type: [
|
|
199
|
+
Boolean,
|
|
200
|
+
Number,
|
|
201
|
+
String
|
|
202
|
+
],
|
|
203
|
+
required: false
|
|
204
|
+
},
|
|
205
|
+
paddingInlineEnd: {
|
|
206
|
+
type: [
|
|
207
|
+
Boolean,
|
|
208
|
+
Number,
|
|
209
|
+
String
|
|
210
|
+
],
|
|
211
|
+
required: false
|
|
212
|
+
},
|
|
213
|
+
paddingBlockStart: {
|
|
214
|
+
type: [
|
|
215
|
+
Boolean,
|
|
216
|
+
Number,
|
|
217
|
+
String
|
|
218
|
+
],
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
paddingBlockEnd: {
|
|
222
|
+
type: [
|
|
223
|
+
Boolean,
|
|
224
|
+
Number,
|
|
225
|
+
String
|
|
226
|
+
],
|
|
227
|
+
required: false
|
|
228
|
+
},
|
|
229
|
+
border: {
|
|
230
|
+
type: [
|
|
231
|
+
Boolean,
|
|
232
|
+
Number,
|
|
233
|
+
String,
|
|
234
|
+
Array
|
|
235
|
+
],
|
|
236
|
+
required: false,
|
|
237
|
+
skipCheck: true
|
|
238
|
+
},
|
|
239
|
+
borderTop: {
|
|
240
|
+
type: [
|
|
241
|
+
Boolean,
|
|
242
|
+
Number,
|
|
243
|
+
String
|
|
244
|
+
],
|
|
245
|
+
required: false
|
|
246
|
+
},
|
|
247
|
+
borderLeft: {
|
|
248
|
+
type: [
|
|
249
|
+
Boolean,
|
|
250
|
+
Number,
|
|
251
|
+
String
|
|
252
|
+
],
|
|
253
|
+
required: false
|
|
254
|
+
},
|
|
255
|
+
borderBottom: {
|
|
256
|
+
type: [
|
|
257
|
+
Boolean,
|
|
258
|
+
Number,
|
|
259
|
+
String
|
|
260
|
+
],
|
|
261
|
+
required: false
|
|
262
|
+
},
|
|
263
|
+
borderRight: {
|
|
264
|
+
type: [
|
|
265
|
+
Boolean,
|
|
266
|
+
Number,
|
|
267
|
+
String
|
|
268
|
+
],
|
|
269
|
+
required: false
|
|
270
|
+
},
|
|
271
|
+
borderBlock: {
|
|
272
|
+
type: [
|
|
273
|
+
Boolean,
|
|
274
|
+
Number,
|
|
275
|
+
String
|
|
276
|
+
],
|
|
277
|
+
required: false
|
|
278
|
+
},
|
|
279
|
+
borderInline: {
|
|
280
|
+
type: [
|
|
281
|
+
Boolean,
|
|
282
|
+
Number,
|
|
283
|
+
String
|
|
284
|
+
],
|
|
285
|
+
required: false
|
|
286
|
+
},
|
|
287
|
+
borderInlineStart: {
|
|
288
|
+
type: [
|
|
289
|
+
Boolean,
|
|
290
|
+
Number,
|
|
291
|
+
String
|
|
292
|
+
],
|
|
293
|
+
required: false
|
|
294
|
+
},
|
|
295
|
+
borderInlineEnd: {
|
|
296
|
+
type: [
|
|
297
|
+
Boolean,
|
|
298
|
+
Number,
|
|
299
|
+
String
|
|
300
|
+
],
|
|
301
|
+
required: false
|
|
302
|
+
},
|
|
303
|
+
borderBlockStart: {
|
|
304
|
+
type: [
|
|
305
|
+
Boolean,
|
|
306
|
+
Number,
|
|
307
|
+
String
|
|
308
|
+
],
|
|
309
|
+
required: false
|
|
310
|
+
},
|
|
311
|
+
borderBlockEnd: {
|
|
312
|
+
type: [
|
|
313
|
+
Boolean,
|
|
314
|
+
Number,
|
|
315
|
+
String
|
|
316
|
+
],
|
|
317
|
+
required: false
|
|
318
|
+
},
|
|
319
|
+
borderColor: {
|
|
320
|
+
type: String,
|
|
321
|
+
required: false
|
|
322
|
+
},
|
|
323
|
+
borderStyle: {
|
|
324
|
+
type: String,
|
|
325
|
+
required: false
|
|
326
|
+
},
|
|
327
|
+
borderTopColor: {
|
|
328
|
+
type: [
|
|
329
|
+
String,
|
|
330
|
+
Object,
|
|
331
|
+
Boolean,
|
|
332
|
+
null
|
|
333
|
+
],
|
|
334
|
+
required: false,
|
|
335
|
+
skipCheck: true
|
|
336
|
+
},
|
|
337
|
+
borderRightColor: {
|
|
338
|
+
type: [
|
|
339
|
+
String,
|
|
340
|
+
Object,
|
|
341
|
+
Boolean,
|
|
342
|
+
null
|
|
343
|
+
],
|
|
344
|
+
required: false,
|
|
345
|
+
skipCheck: true
|
|
346
|
+
},
|
|
347
|
+
borderBottomColor: {
|
|
348
|
+
type: [
|
|
349
|
+
String,
|
|
350
|
+
Object,
|
|
351
|
+
Boolean,
|
|
352
|
+
null
|
|
353
|
+
],
|
|
354
|
+
required: false,
|
|
355
|
+
skipCheck: true
|
|
356
|
+
},
|
|
357
|
+
borderLeftColor: {
|
|
358
|
+
type: [
|
|
359
|
+
String,
|
|
360
|
+
Object,
|
|
361
|
+
Boolean,
|
|
362
|
+
null
|
|
363
|
+
],
|
|
364
|
+
required: false,
|
|
365
|
+
skipCheck: true
|
|
366
|
+
},
|
|
367
|
+
borderInlineStartColor: {
|
|
368
|
+
type: [
|
|
369
|
+
String,
|
|
370
|
+
Object,
|
|
371
|
+
Boolean,
|
|
372
|
+
null
|
|
373
|
+
],
|
|
374
|
+
required: false,
|
|
375
|
+
skipCheck: true
|
|
376
|
+
},
|
|
377
|
+
borderInlineEndColor: {
|
|
378
|
+
type: [
|
|
379
|
+
String,
|
|
380
|
+
Object,
|
|
381
|
+
Boolean,
|
|
382
|
+
null
|
|
383
|
+
],
|
|
384
|
+
required: false,
|
|
385
|
+
skipCheck: true
|
|
386
|
+
},
|
|
387
|
+
borderBlockStartColor: {
|
|
388
|
+
type: [
|
|
389
|
+
String,
|
|
390
|
+
Object,
|
|
391
|
+
Boolean,
|
|
392
|
+
null
|
|
393
|
+
],
|
|
394
|
+
required: false,
|
|
395
|
+
skipCheck: true
|
|
396
|
+
},
|
|
397
|
+
borderBlockEndColor: {
|
|
398
|
+
type: [
|
|
399
|
+
String,
|
|
400
|
+
Object,
|
|
401
|
+
Boolean,
|
|
402
|
+
null
|
|
403
|
+
],
|
|
404
|
+
required: false,
|
|
405
|
+
skipCheck: true
|
|
406
|
+
},
|
|
407
|
+
elevation: {
|
|
408
|
+
type: [Number, String],
|
|
409
|
+
required: false
|
|
410
|
+
},
|
|
411
|
+
margin: {
|
|
412
|
+
type: [
|
|
413
|
+
Boolean,
|
|
414
|
+
Number,
|
|
415
|
+
String
|
|
416
|
+
],
|
|
417
|
+
required: false
|
|
418
|
+
},
|
|
419
|
+
marginTop: {
|
|
420
|
+
type: [
|
|
421
|
+
Boolean,
|
|
422
|
+
Number,
|
|
423
|
+
String
|
|
424
|
+
],
|
|
425
|
+
required: false
|
|
426
|
+
},
|
|
427
|
+
marginLeft: {
|
|
428
|
+
type: [
|
|
429
|
+
Boolean,
|
|
430
|
+
Number,
|
|
431
|
+
String
|
|
432
|
+
],
|
|
433
|
+
required: false
|
|
434
|
+
},
|
|
435
|
+
marginBottom: {
|
|
436
|
+
type: [
|
|
437
|
+
Boolean,
|
|
438
|
+
Number,
|
|
439
|
+
String
|
|
440
|
+
],
|
|
441
|
+
required: false
|
|
442
|
+
},
|
|
443
|
+
marginRight: {
|
|
444
|
+
type: [
|
|
445
|
+
Boolean,
|
|
446
|
+
Number,
|
|
447
|
+
String
|
|
448
|
+
],
|
|
449
|
+
required: false
|
|
450
|
+
},
|
|
451
|
+
marginBlock: {
|
|
452
|
+
type: [
|
|
453
|
+
Boolean,
|
|
454
|
+
Number,
|
|
455
|
+
String
|
|
456
|
+
],
|
|
457
|
+
required: false
|
|
458
|
+
},
|
|
459
|
+
marginInline: {
|
|
460
|
+
type: [
|
|
461
|
+
Boolean,
|
|
462
|
+
Number,
|
|
463
|
+
String
|
|
464
|
+
],
|
|
465
|
+
required: false
|
|
466
|
+
},
|
|
467
|
+
marginInlineStart: {
|
|
468
|
+
type: [
|
|
469
|
+
Boolean,
|
|
470
|
+
Number,
|
|
471
|
+
String
|
|
472
|
+
],
|
|
473
|
+
required: false
|
|
474
|
+
},
|
|
475
|
+
marginInlineEnd: {
|
|
476
|
+
type: [
|
|
477
|
+
Boolean,
|
|
478
|
+
Number,
|
|
479
|
+
String
|
|
480
|
+
],
|
|
481
|
+
required: false
|
|
482
|
+
},
|
|
483
|
+
marginBlockStart: {
|
|
484
|
+
type: [
|
|
485
|
+
Boolean,
|
|
486
|
+
Number,
|
|
487
|
+
String
|
|
488
|
+
],
|
|
489
|
+
required: false
|
|
490
|
+
},
|
|
491
|
+
marginBlockEnd: {
|
|
492
|
+
type: [
|
|
493
|
+
Boolean,
|
|
494
|
+
Number,
|
|
495
|
+
String
|
|
496
|
+
],
|
|
497
|
+
required: false
|
|
498
|
+
},
|
|
499
|
+
height: {
|
|
500
|
+
type: [Number, String],
|
|
501
|
+
required: false
|
|
502
|
+
},
|
|
503
|
+
maxHeight: {
|
|
504
|
+
type: [Number, String],
|
|
505
|
+
required: false
|
|
506
|
+
},
|
|
507
|
+
maxWidth: {
|
|
508
|
+
type: [Number, String],
|
|
509
|
+
required: false
|
|
510
|
+
},
|
|
511
|
+
minHeight: {
|
|
512
|
+
type: [Number, String],
|
|
513
|
+
required: false
|
|
514
|
+
},
|
|
515
|
+
minWidth: {
|
|
516
|
+
type: [Number, String],
|
|
517
|
+
required: false
|
|
518
|
+
},
|
|
519
|
+
width: {
|
|
520
|
+
type: [Number, String],
|
|
521
|
+
required: false
|
|
522
|
+
},
|
|
523
|
+
density: {
|
|
524
|
+
type: null,
|
|
525
|
+
required: false
|
|
526
|
+
},
|
|
527
|
+
rounded: {
|
|
528
|
+
type: [
|
|
529
|
+
Boolean,
|
|
530
|
+
Number,
|
|
531
|
+
String,
|
|
532
|
+
null
|
|
533
|
+
],
|
|
534
|
+
required: false,
|
|
535
|
+
skipCheck: true
|
|
536
|
+
},
|
|
537
|
+
roundedTopRight: {
|
|
538
|
+
type: [
|
|
539
|
+
Boolean,
|
|
540
|
+
Number,
|
|
541
|
+
String
|
|
542
|
+
],
|
|
543
|
+
required: false
|
|
544
|
+
},
|
|
545
|
+
roundedTopLeft: {
|
|
546
|
+
type: [
|
|
547
|
+
Boolean,
|
|
548
|
+
Number,
|
|
549
|
+
String
|
|
550
|
+
],
|
|
551
|
+
required: false
|
|
552
|
+
},
|
|
553
|
+
roundedBottomLeft: {
|
|
554
|
+
type: [
|
|
555
|
+
Boolean,
|
|
556
|
+
Number,
|
|
557
|
+
String
|
|
558
|
+
],
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
561
|
+
roundedBottomRight: {
|
|
562
|
+
type: [
|
|
563
|
+
Boolean,
|
|
564
|
+
Number,
|
|
565
|
+
String
|
|
566
|
+
],
|
|
567
|
+
required: false
|
|
568
|
+
},
|
|
569
|
+
roundedStartStart: {
|
|
570
|
+
type: [
|
|
571
|
+
Boolean,
|
|
572
|
+
Number,
|
|
573
|
+
String
|
|
574
|
+
],
|
|
575
|
+
required: false
|
|
576
|
+
},
|
|
577
|
+
roundedStartEnd: {
|
|
578
|
+
type: [
|
|
579
|
+
Boolean,
|
|
580
|
+
Number,
|
|
581
|
+
String
|
|
582
|
+
],
|
|
583
|
+
required: false
|
|
584
|
+
},
|
|
585
|
+
roundedEndStart: {
|
|
586
|
+
type: [
|
|
587
|
+
Boolean,
|
|
588
|
+
Number,
|
|
589
|
+
String
|
|
590
|
+
],
|
|
591
|
+
required: false
|
|
592
|
+
},
|
|
593
|
+
roundedEndEnd: {
|
|
594
|
+
type: [
|
|
595
|
+
Boolean,
|
|
596
|
+
Number,
|
|
597
|
+
String
|
|
598
|
+
],
|
|
599
|
+
required: false
|
|
600
|
+
},
|
|
601
|
+
name: {
|
|
602
|
+
type: String,
|
|
603
|
+
required: false,
|
|
604
|
+
default: "bottom-navigation"
|
|
605
|
+
},
|
|
606
|
+
order: {
|
|
607
|
+
type: [String, Number],
|
|
608
|
+
required: false
|
|
609
|
+
},
|
|
610
|
+
absolute: {
|
|
611
|
+
type: Boolean,
|
|
612
|
+
required: false
|
|
613
|
+
},
|
|
614
|
+
location: {
|
|
615
|
+
type: null,
|
|
616
|
+
required: false,
|
|
617
|
+
default: BLOCK.BOTTOM
|
|
618
|
+
},
|
|
619
|
+
disabled: {
|
|
620
|
+
type: Boolean,
|
|
621
|
+
required: false
|
|
622
|
+
},
|
|
623
|
+
modelValue: {
|
|
624
|
+
type: null,
|
|
625
|
+
required: false,
|
|
626
|
+
default: true
|
|
627
|
+
},
|
|
628
|
+
multiple: {
|
|
629
|
+
type: Boolean,
|
|
630
|
+
required: false
|
|
631
|
+
},
|
|
632
|
+
mandatory: {
|
|
633
|
+
type: Boolean,
|
|
634
|
+
required: false
|
|
635
|
+
},
|
|
636
|
+
max: {
|
|
637
|
+
type: Number,
|
|
638
|
+
required: false
|
|
639
|
+
},
|
|
640
|
+
selectedClass: {
|
|
641
|
+
type: String,
|
|
642
|
+
required: false,
|
|
643
|
+
default: "origam-bottom-nav__btn--selected"
|
|
644
|
+
},
|
|
645
|
+
hover: {
|
|
646
|
+
type: [Boolean, Object],
|
|
647
|
+
required: false
|
|
648
|
+
},
|
|
649
|
+
hoverClass: {
|
|
650
|
+
type: String,
|
|
651
|
+
required: false
|
|
652
|
+
},
|
|
653
|
+
active: {
|
|
654
|
+
type: [Boolean, Object],
|
|
655
|
+
required: false
|
|
656
|
+
},
|
|
657
|
+
activeClass: {
|
|
658
|
+
type: String,
|
|
659
|
+
required: false
|
|
660
|
+
},
|
|
661
|
+
transition: {
|
|
662
|
+
type: [
|
|
663
|
+
Boolean,
|
|
664
|
+
String,
|
|
665
|
+
Object
|
|
666
|
+
],
|
|
667
|
+
required: false,
|
|
668
|
+
default: () => ({ component: OrigamTranslateBottom })
|
|
669
|
+
}
|
|
152
670
|
});
|
|
153
671
|
defineEmits(["update:modelValue", "update:hover"]);
|
|
154
672
|
defineSlots();
|
|
155
673
|
const { filterProps } = useProps(props);
|
|
156
674
|
const { t } = useLocale();
|
|
157
|
-
|
|
675
|
+
// When `color` is explicitly set, mark the element so `v-contrast` keeps
|
|
676
|
+
// the chosen foreground instead of forcing black/white for legibility.
|
|
677
|
+
const colorLocked = computed(() => props.color ? "true" : undefined);
|
|
678
|
+
// Push visual-token props down to every descendant `<origam-btn>` (the
|
|
679
|
+
// bottom-nav button children) as DEFAULTS — items that pass their own
|
|
680
|
+
// props still win. The ADR-005 resolver picks this up automatically.
|
|
681
|
+
// Forward ONLY what the consumer actually passed — see #263 and the same
|
|
682
|
+
// guard on `OrigamBtnGroup` / `OrigamAvatarGroup`. A prop the consumer
|
|
683
|
+
// never set must NOT be forwarded: `mergeDeep` (used by
|
|
684
|
+
// `provideDefaults` to combine this map with an
|
|
685
|
+
// ancestor/theme `'origam-btn'` entry) copies it unconditionally and
|
|
686
|
+
// silently overwrites the theme default.
|
|
687
|
+
//
|
|
688
|
+
// A plain `omitUndefined` is NOT enough here: `color` / `bgColor` are
|
|
689
|
+
// `TColor` (which includes `false`) and `hover` / `active` are
|
|
690
|
+
// `boolean | IHoverState / IActiveState`, so Vue's boolean-prop coercion
|
|
691
|
+
// resolves every one of them to the concrete value `false` when unset —
|
|
692
|
+
// there is no `undefined` left to filter. `density` was the reverse case:
|
|
693
|
+
// it leaked a bare `undefined`, which `mergeDeep` copies just the same and
|
|
694
|
+
// which therefore ERASED any themed button density. Measured before the
|
|
695
|
+
// fix: under a theme setting `'origam-btn': { color: 'success', density:
|
|
696
|
+
// 'comfortable' }`, a standalone button rendered
|
|
697
|
+
// `origam--color-success origam-btn--density-comfortable` while the very
|
|
698
|
+
// same button inside `<origam-bottom-nav>` rendered neither.
|
|
158
699
|
const wasPropPassed = usePassedProps(props);
|
|
159
|
-
const slotDefaults = computed(() => ({
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
700
|
+
const slotDefaults = computed(() => ({ "origam-btn": omitUndefined({
|
|
701
|
+
density: wasPropPassed("density") ? props.density : undefined,
|
|
702
|
+
color: wasPropPassed("color") ? props.color : undefined,
|
|
703
|
+
bgColor: wasPropPassed("bgColor") ? props.bgColor : undefined,
|
|
704
|
+
// New API: forward `hover` / `active` (boolean | object)
|
|
705
|
+
// to each child OrigamBtn; the legacy split `hoverColor` /
|
|
706
|
+
// `hoverBgColor` / `activeColor` / `activeBgColor` props no
|
|
707
|
+
// longer exist on the parent or the children.
|
|
708
|
+
hover: wasPropPassed("hover") ? props.hover : undefined,
|
|
709
|
+
active: wasPropPassed("active") ? props.active : undefined
|
|
710
|
+
}) }));
|
|
711
|
+
/*********************************************************
|
|
712
|
+
* Effect
|
|
713
|
+
*
|
|
714
|
+
* @description
|
|
715
|
+
* Hover, active, color and scroll-aware visibility state.
|
|
716
|
+
********************************************************/
|
|
717
|
+
/*********************************************************
|
|
718
|
+
* Composables
|
|
719
|
+
********************************************************/
|
|
720
|
+
const { isOn: isActive, classes: activeClasses } = useStateFlag(props, {
|
|
721
|
+
state: "active",
|
|
722
|
+
source: "modelValue"
|
|
723
|
+
});
|
|
173
724
|
const { classes: hoverClasses, set: handleMouseenter, unset: handleMouseleave } = useStateFlag(props, { state: "hover" });
|
|
725
|
+
// Phase 3 (Vague C) — class-first companion alongside inline styles.
|
|
726
|
+
// `colorClasses` ships `.origam--bg-{intent}` / `.origam--color-{intent}`
|
|
727
|
+
// ONLY for the resting state — `useStateEffect` returns `[]` for
|
|
728
|
+
// hover/active so the inline `colorStyles` keeps owning those slots
|
|
729
|
+
// (no utility class exists for `bgHover`/`bgActive` rungs).
|
|
730
|
+
/*********************************************************
|
|
731
|
+
* Color
|
|
732
|
+
*
|
|
733
|
+
* @description
|
|
734
|
+
* The BottomNav is a CONTAINER — hover/active interaction
|
|
735
|
+
* effects belong to its child buttons, not to the nav surface
|
|
736
|
+
* itself. We deliberately feed `ref(false)` to `useStateEffect`
|
|
737
|
+
* for both `isHover` and `isActive` so:
|
|
738
|
+
* • The resting bg stays on the intent's `bg` rung (same
|
|
739
|
+
* teinte as the child buttons in their resting state).
|
|
740
|
+
* • Hovering the nav doesn't darken the whole bar.
|
|
741
|
+
* • `isActive` from `useStateFlag(props, {state: 'active', source: 'modelValue'})` means
|
|
742
|
+
* "the nav is currently displayed" (drives slide-in), NOT
|
|
743
|
+
* a pressed state — feeding it would resolve to `bgActive`
|
|
744
|
+
* (color-mix -30 %) and paint the resting bar darker than
|
|
745
|
+
* its buttons. The `hover` / `active` object props are still
|
|
746
|
+
* propagated to the child OrigamBtn instances via
|
|
747
|
+
* `slotDefaults` (see above) — that's where they take visual
|
|
748
|
+
* effect.
|
|
749
|
+
********************************************************/
|
|
174
750
|
const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, paddingClasses, paddingStyles, marginClasses, marginStyles } = useStateEffect(props, ref(false), ref(false));
|
|
751
|
+
/*********************************************************
|
|
752
|
+
* Layout
|
|
753
|
+
*
|
|
754
|
+
* @description
|
|
755
|
+
* Registers as a layout item so sibling regions offset
|
|
756
|
+
* correctly; height accounts for density.
|
|
757
|
+
********************************************************/
|
|
175
758
|
const { ssrBootStyles } = useSsrBoot();
|
|
759
|
+
/*********************************************************
|
|
760
|
+
* height
|
|
761
|
+
*
|
|
762
|
+
* @description
|
|
763
|
+
* Two DIFFERENT consumers need "the height minus 8px in compact
|
|
764
|
+
* density", and they must NOT share the same value:
|
|
765
|
+
*
|
|
766
|
+
* - `height` (numeric, px) — feeds `useLayoutItem`'s internal
|
|
767
|
+
* offset/geometry math, which needs a plain number (it cannot
|
|
768
|
+
* reactively resolve `vh`/`rem`/`%` to a live pixel value without
|
|
769
|
+
* a `ResizeObserver`). #384 — `Number(props.height)` returned NaN
|
|
770
|
+
* for any CSS length string (`Number('96px')` === NaN); replaced
|
|
771
|
+
* with `int()` (parseInt-based, already used elsewhere in this
|
|
772
|
+
* catalogue for the same "read the leading number off a
|
|
773
|
+
* possibly-unit-suffixed prop" need), which reads the numeric
|
|
774
|
+
* prefix regardless of a trailing unit.
|
|
775
|
+
*
|
|
776
|
+
* - `heightStyle` (CSS declaration string) — what the browser
|
|
777
|
+
* actually paints. This one MUST preserve the consumer's original
|
|
778
|
+
* unit. #384's first fix pass reused the numeric `height` above
|
|
779
|
+
* for BOTH purposes (`convertToUnit(height.value)`), which
|
|
780
|
+
* silently re-serialised ANY unit as a bare px number: passing
|
|
781
|
+
* `height="50vh"` rendered a fixed `50px`, not `50vh` — a
|
|
782
|
+
* regression proven at runtime (Playwright against a live
|
|
783
|
+
* Histoire `Design` variant): computed height measured `50px`
|
|
784
|
+
* against a 612px-tall sandbox instead of the expected ~306px
|
|
785
|
+
* (50% of viewport), a 256px miss. When `density` isn't
|
|
786
|
+
* `'compact'` no override is needed at all — `dimensionStyles`
|
|
787
|
+
* (via `useDimension`/`convertToUnit`) already emits the correct,
|
|
788
|
+
* unit-preserving `height` declaration, so `heightStyle` stays
|
|
789
|
+
* `undefined` and lets it win. When `density === 'compact'`, the
|
|
790
|
+
* subtraction is expressed as a native CSS `calc()` on the
|
|
791
|
+
* unit-preserving value (`convertToUnit(props.height)`, e.g.
|
|
792
|
+
* `50vh` / `10rem` / `96px`) instead of pre-computing in JS —
|
|
793
|
+
* the browser resolves `calc(50vh - 8px)` correctly for any unit,
|
|
794
|
+
* which a JS numeric subtraction cannot (CSS-first per this
|
|
795
|
+
* repo's engineering principles). For an already-px value this is
|
|
796
|
+
* mathematically identical to the previous plain-number result
|
|
797
|
+
* (`calc(96px - 8px)` computes to `88px`, matching the documented
|
|
798
|
+
* "height - 8px" contract).
|
|
799
|
+
********************************************************/
|
|
176
800
|
const height = computed(() => {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
801
|
+
if (props.height) {
|
|
802
|
+
return int(props.height) - (props.density === "compact" ? 8 : 0);
|
|
803
|
+
}
|
|
804
|
+
return 48;
|
|
181
805
|
});
|
|
182
806
|
const heightStyle = computed(() => {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
807
|
+
if (!props.height) return undefined;
|
|
808
|
+
if (props.density !== "compact") return undefined;
|
|
809
|
+
return `calc(${convertToUnit(props.height)} - 8px)`;
|
|
186
810
|
});
|
|
811
|
+
/*********************************************************
|
|
812
|
+
* ⛔ `props.name` est lu EAGERLY ici, et c'est VOULU (ADR-005).
|
|
813
|
+
*
|
|
814
|
+
* @description
|
|
815
|
+
* `setup-reads.mjs` signale cette lecture, a juste titre : le resolveur
|
|
816
|
+
* de props de theme ecrit dans `beforeCreate`, APRES l'execution de
|
|
817
|
+
* `setup()`. Une valeur capturee ici ne verra donc jamais celle du
|
|
818
|
+
* theme.
|
|
819
|
+
*
|
|
820
|
+
* @description
|
|
821
|
+
* Elle ne peut pas etre differee pour autant. `useLayoutItem` se sert
|
|
822
|
+
* de cet `id` pour trois choses qui exigent une valeur STABLE des le
|
|
823
|
+
* setup : `provide(ORIGAM_LAYOUT_ITEM_KEY, {id})`, `layout.register(vm,
|
|
824
|
+
* {..., id})` et `layout.unregister(id)` au demontage. Un identifiant
|
|
825
|
+
* qui changerait apres l'enregistrement laisserait un element fantome
|
|
826
|
+
* dans le layout et n'en desenregistrerait aucun.
|
|
827
|
+
*
|
|
828
|
+
* @description
|
|
829
|
+
* La vraie question n'est donc pas « comment differer cette lecture »
|
|
830
|
+
* mais « un theme a-t-il vocation a nommer un element de layout ? ».
|
|
831
|
+
* `name` est une IDENTITE, pas un reglage visuel — au meme titre qu'un
|
|
832
|
+
* `id`. Tant que la reponse est non, cette lecture est correcte et le
|
|
833
|
+
* signalement de l'outil est un faux positif a connaitre.
|
|
834
|
+
********************************************************/
|
|
835
|
+
/*********************************************************
|
|
836
|
+
* position — `location`, plus l'echelon du layout
|
|
837
|
+
*
|
|
838
|
+
* @description
|
|
839
|
+
* #550 (critere C1) — `location` etait DECLAREE (via `ILayoutItemProps`)
|
|
840
|
+
* et jamais lue : le cote d'accroche etait fige a
|
|
841
|
+
* `computed(() => 'bottom')`. `useCreateLayout` s'en sert pour tout :
|
|
842
|
+
* l'ancre (`{[position]: 0}`), le sens de la translation d'entree/sortie,
|
|
843
|
+
* le `height`/`width` en `calc()` et le decalage des freres. Cablee comme
|
|
844
|
+
* sur `OrigamAppBar`, avec `BLOCK.BOTTOM` en defaut — comportement
|
|
845
|
+
* actuel a l'identique pour qui ne passe rien.
|
|
846
|
+
*
|
|
847
|
+
* @description
|
|
848
|
+
* ⛔ Ne pas confondre avec la prop `position` du composant
|
|
849
|
+
* (`'start' | 'center' | 'end'`), qui regle le placement HORIZONTAL de la
|
|
850
|
+
* barre quand elle n'occupe pas toute la largeur. `location` regle le
|
|
851
|
+
* COTE d'accroche dans l'`<origam-layout>` (`top`/`bottom`/`left`/
|
|
852
|
+
* `right`). Les deux ne se rencontrent que si `location` est horizontal,
|
|
853
|
+
* cas ou la classe `origam-bottom-nav--position-*` (left/right) et
|
|
854
|
+
* l'ancre du layout se disputent le meme axe : le rendu par defaut de la
|
|
855
|
+
* famille reste `location="bottom"`.
|
|
856
|
+
*
|
|
857
|
+
* @description
|
|
858
|
+
* `toRef` (et non `props.location` lu ici) : ADR-005, le resolveur de
|
|
859
|
+
* props de theme ecrit dans `beforeCreate`, APRES `setup()`.
|
|
860
|
+
********************************************************/
|
|
187
861
|
const { layoutItemStyles } = useLayoutItem({
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
862
|
+
id: props.name,
|
|
863
|
+
order: computed(() => int(props.order ?? 0)),
|
|
864
|
+
position: toRef(props, "location"),
|
|
865
|
+
layoutSize: computed(() => isActive.value ? height.value : 0),
|
|
866
|
+
elementSize: height,
|
|
867
|
+
active: isActive,
|
|
868
|
+
absolute: toRef(props, "absolute")
|
|
195
869
|
});
|
|
870
|
+
// The ADR-005 resolver handles each `OrigamBtn`'s visual-token fallback —
|
|
871
|
+
// no manual merge needed here. Items are spread as-is; `provideDefaults`
|
|
872
|
+
// above supplies the group-level defaults.
|
|
196
873
|
const items = computed(() => {
|
|
197
|
-
|
|
874
|
+
return props.items;
|
|
198
875
|
});
|
|
199
876
|
useGroup(props, ORIGAM_BTN_TOGGLE_KEY);
|
|
877
|
+
/*********************************************************
|
|
878
|
+
* Class & Style
|
|
879
|
+
*
|
|
880
|
+
* @description
|
|
881
|
+
* Composes slide-in transform, layout, color, rounding
|
|
882
|
+
* and spacing classes/styles onto the root element.
|
|
883
|
+
********************************************************/
|
|
200
884
|
const { densityClasses } = useDensity(props);
|
|
201
885
|
const { dimensionStyles } = useDimension(props);
|
|
886
|
+
/*********************************************************
|
|
887
|
+
* bottomNavStyles
|
|
888
|
+
*
|
|
889
|
+
* @description
|
|
890
|
+
* #383 — layoutItemStyles MUST come before dimensionStyles here.
|
|
891
|
+
* useStyle() flattens every source into ONE #id{...} rule, so source
|
|
892
|
+
* order (not specificity) decides which width declaration wins when
|
|
893
|
+
* both are present. useLayoutItem unconditionally writes
|
|
894
|
+
* width: calc(100% - left - right) while docked in an OrigamLayout —
|
|
895
|
+
* placing it FIRST lets a consumer-supplied width (from
|
|
896
|
+
* dimensionStyles) override it, instead of the layout's calc()
|
|
897
|
+
* silently winning every time (the previous order, which broke the
|
|
898
|
+
* documented default usage OrigamLayout > OrigamBottomNav and made
|
|
899
|
+
* position decorative alongside it).
|
|
900
|
+
********************************************************/
|
|
202
901
|
const bottomNavStyles = computed(() => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
ssrBootStyles.value,
|
|
216
|
-
paddingStyles.value,
|
|
217
|
-
marginStyles.value,
|
|
218
|
-
props.style
|
|
219
|
-
];
|
|
902
|
+
return [
|
|
903
|
+
layoutItemStyles.value,
|
|
904
|
+
dimensionStyles.value,
|
|
905
|
+
{ height: heightStyle.value },
|
|
906
|
+
roundedStyles.value,
|
|
907
|
+
colorStyles.value,
|
|
908
|
+
borderStyles.value,
|
|
909
|
+
ssrBootStyles.value,
|
|
910
|
+
paddingStyles.value,
|
|
911
|
+
marginStyles.value,
|
|
912
|
+
props.style
|
|
913
|
+
];
|
|
220
914
|
});
|
|
221
915
|
const bottomNavClasses = computed(() => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
props.class
|
|
239
|
-
];
|
|
916
|
+
return [
|
|
917
|
+
"origam-bottom-nav",
|
|
918
|
+
`origam-bottom-nav--${props.mode}`,
|
|
919
|
+
`origam-bottom-nav--position-${props.position}`,
|
|
920
|
+
{ "origam-bottom-nav--grow": props.grow },
|
|
921
|
+
activeClasses.value,
|
|
922
|
+
hoverClasses.value,
|
|
923
|
+
borderClasses.value,
|
|
924
|
+
colorClasses.value,
|
|
925
|
+
densityClasses.value,
|
|
926
|
+
elevationClasses.value,
|
|
927
|
+
roundedClasses.value,
|
|
928
|
+
paddingClasses.value,
|
|
929
|
+
marginClasses.value,
|
|
930
|
+
props.class
|
|
931
|
+
];
|
|
240
932
|
});
|
|
933
|
+
/*********************************************************
|
|
934
|
+
* useStyle
|
|
935
|
+
*
|
|
936
|
+
* @description
|
|
937
|
+
* #381 — the `id` returned by useStyle is a GENERATED identifier,
|
|
938
|
+
* only meant for the scoped stylesheet selector. Without
|
|
939
|
+
* `() => props.id` here, it shadowed the `id` PROP of the same
|
|
940
|
+
* name: the template's `:id="id"` on the root rendered the
|
|
941
|
+
* generated id, never the consumer's.
|
|
942
|
+
********************************************************/
|
|
241
943
|
const { id, css, load, isLoaded, unload } = useStyle(bottomNavStyles, () => props.id);
|
|
944
|
+
/*********************************************************
|
|
945
|
+
* Expose
|
|
946
|
+
*
|
|
947
|
+
* @description
|
|
948
|
+
* Public API surface: filterProps, style utilities.
|
|
949
|
+
********************************************************/
|
|
242
950
|
defineExpose({
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
951
|
+
filterProps,
|
|
952
|
+
css,
|
|
953
|
+
id,
|
|
954
|
+
load,
|
|
955
|
+
unload,
|
|
956
|
+
isLoaded
|
|
249
957
|
});
|
|
250
958
|
</script>
|
|
251
959
|
|