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
|
@@ -77,114 +77,280 @@ import vContrast from "../../directives/Contrast/contrast.directive";
|
|
|
77
77
|
import { intentBgExpr, intentFgExpr, isIntent } from "../../utils/Commons/color.util";
|
|
78
78
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
79
79
|
import { ORIGAM_TABS_COLOR_KEY, ORIGAM_TABS_KEY, ORIGAM_TAB_PANELS_LINK_KEY } from "../../consts/Tabs/tabs.const";
|
|
80
|
+
/*********************************************************
|
|
81
|
+
* Global
|
|
82
|
+
********************************************************/
|
|
80
83
|
const props = defineProps({
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
tag: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false,
|
|
87
|
+
default: "button"
|
|
88
|
+
},
|
|
89
|
+
text: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
default: ""
|
|
93
|
+
},
|
|
94
|
+
variant: {
|
|
95
|
+
type: null,
|
|
96
|
+
required: false,
|
|
97
|
+
default: undefined
|
|
98
|
+
},
|
|
99
|
+
icon: {
|
|
100
|
+
type: null,
|
|
101
|
+
required: false
|
|
102
|
+
},
|
|
103
|
+
id: {
|
|
104
|
+
type: String,
|
|
105
|
+
required: false
|
|
106
|
+
},
|
|
107
|
+
class: {
|
|
108
|
+
type: [
|
|
109
|
+
String,
|
|
110
|
+
Array,
|
|
111
|
+
Object
|
|
112
|
+
],
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
style: {
|
|
116
|
+
type: [
|
|
117
|
+
String,
|
|
118
|
+
Array,
|
|
119
|
+
Object,
|
|
120
|
+
Boolean,
|
|
121
|
+
null
|
|
122
|
+
],
|
|
123
|
+
required: false,
|
|
124
|
+
skipCheck: true
|
|
125
|
+
},
|
|
126
|
+
value: {
|
|
127
|
+
type: null,
|
|
128
|
+
required: false,
|
|
129
|
+
default: undefined
|
|
130
|
+
},
|
|
131
|
+
disabled: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
selectedClass: {
|
|
136
|
+
type: String,
|
|
137
|
+
required: false
|
|
138
|
+
},
|
|
139
|
+
color: {
|
|
140
|
+
type: [
|
|
141
|
+
String,
|
|
142
|
+
Object,
|
|
143
|
+
Boolean,
|
|
144
|
+
null
|
|
145
|
+
],
|
|
146
|
+
required: false,
|
|
147
|
+
skipCheck: true
|
|
148
|
+
},
|
|
149
|
+
fontSize: {
|
|
150
|
+
type: null,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
fontWeight: {
|
|
154
|
+
type: null,
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
letterSpacing: {
|
|
158
|
+
type: null,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
lineHeight: {
|
|
162
|
+
type: null,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
appendAvatar: {
|
|
166
|
+
type: String,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
appendIcon: {
|
|
170
|
+
type: null,
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
prependAvatar: {
|
|
174
|
+
type: String,
|
|
175
|
+
required: false
|
|
176
|
+
},
|
|
177
|
+
prependIcon: {
|
|
178
|
+
type: null,
|
|
179
|
+
required: false
|
|
180
|
+
},
|
|
181
|
+
prependAriaLabel: {
|
|
182
|
+
type: String,
|
|
183
|
+
required: false
|
|
184
|
+
},
|
|
185
|
+
appendAriaLabel: {
|
|
186
|
+
type: String,
|
|
187
|
+
required: false
|
|
188
|
+
}
|
|
102
189
|
});
|
|
103
190
|
defineEmits(["group:selected"]);
|
|
104
191
|
defineSlots();
|
|
105
192
|
const { filterProps } = useProps(props);
|
|
106
193
|
const rootRef = ref();
|
|
194
|
+
/*********************************************************
|
|
195
|
+
* Adjacent
|
|
196
|
+
*
|
|
197
|
+
* `icon` is a deprecated alias for `prependIcon` (same leading-icon
|
|
198
|
+
* position) — the merged computed is handed to `useAdjacent` so a
|
|
199
|
+
* legacy consumer's `icon` keeps rendering while a `prependIcon`
|
|
200
|
+
* takes priority when both are set.
|
|
201
|
+
********************************************************/
|
|
107
202
|
const resolvedPrependIcon = computed(() => props.prependIcon ?? props.icon);
|
|
108
|
-
const {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
203
|
+
const { hasPrependMedia, hasAppendMedia } = useAdjacent(props, resolvedPrependIcon, toRef(props, "appendIcon"));
|
|
204
|
+
/*********************************************************
|
|
205
|
+
* Group registration
|
|
206
|
+
*
|
|
207
|
+
* @description
|
|
208
|
+
* Self-registers in the parent `<OrigamTabs>` tablist via
|
|
209
|
+
* `useGroupItem`. The panels group is NOT reachable via a plain
|
|
210
|
+
* `inject(ORIGAM_TAB_PANELS_KEY)` — `<OrigamTabPanels>` is a
|
|
211
|
+
* SIBLING of `<OrigamTabs>`, not its ancestor (#441). `<OrigamTabs>`
|
|
212
|
+
* resolves the sibling once (`useGroupSiblingLink`) and re-provides
|
|
213
|
+
* it under `ORIGAM_TAB_PANELS_LINK_KEY`, down its OWN ancestor
|
|
214
|
+
* chain — THAT is what we inject here.
|
|
215
|
+
********************************************************/
|
|
112
216
|
const groupItem = useGroupItem(props, ORIGAM_TABS_KEY);
|
|
113
|
-
const panelsGroupLink = inject(ORIGAM_TAB_PANELS_LINK_KEY,
|
|
217
|
+
const panelsGroupLink = inject(ORIGAM_TAB_PANELS_LINK_KEY, undefined);
|
|
114
218
|
if (!groupItem) {
|
|
115
|
-
|
|
219
|
+
throw new Error("[Origam] <OrigamTab> must be used inside an <OrigamTabs>");
|
|
116
220
|
}
|
|
117
221
|
const slotProps = computed(() => ({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
222
|
+
isSelected: groupItem.isSelected.value,
|
|
223
|
+
toggle: groupItem.toggle,
|
|
224
|
+
select: groupItem.select,
|
|
225
|
+
value: groupItem.value.value,
|
|
226
|
+
disabled: groupItem.disabled.value
|
|
123
227
|
}));
|
|
228
|
+
/*********************************************************
|
|
229
|
+
* ARIA wiring
|
|
230
|
+
*
|
|
231
|
+
* @description
|
|
232
|
+
* `tabDomId` is the DOM id of THIS tab — `props.id` when the
|
|
233
|
+
* consumer supplies one, a generated fallback otherwise
|
|
234
|
+
* (referenced by the panel via `aria-labelledby`). It is
|
|
235
|
+
* published onto this tab's OWN entry in the tabs group's
|
|
236
|
+
* `items` registry (`domId`, see `IGroupItem`) so the sibling
|
|
237
|
+
* `<OrigamTabPanel>` can read the REAL id instead of guessing
|
|
238
|
+
* the generated-fallback naming scheme — otherwise a consumer
|
|
239
|
+
* `id` on one side without a matching guess on the other would
|
|
240
|
+
* silently break the pairing (#519-#522).
|
|
241
|
+
*
|
|
242
|
+
* `panelId` is the DOM id of the sibling panel — derived by
|
|
243
|
+
* reading the panels group's registry and matching on `value`
|
|
244
|
+
* (the user-supplied identifier, not the internal numeric id),
|
|
245
|
+
* then reading THAT panel's own published `domId` — and nothing
|
|
246
|
+
* else. No reconstructed guess: since #741 the generated
|
|
247
|
+
* fallback is per-instance and cannot be derived from the
|
|
248
|
+
* sibling's registration id, so a guess would be wrong every
|
|
249
|
+
* time instead of merely wrong when the consumer supplied an
|
|
250
|
+
* `id`. `undefined` means « no `aria-controls` yet », which is
|
|
251
|
+
* already this computed's answer when the panel is not
|
|
252
|
+
* registered; a dangling reference would be worse than none.
|
|
253
|
+
*
|
|
254
|
+
* @description
|
|
255
|
+
* ⛔ THE GENERATED FALLBACK DERIVES FROM `getUid()`, NEVER FROM
|
|
256
|
+
* `groupItem.id` (#741). `useGroupItem`'s id is a module-global
|
|
257
|
+
* monotonic counter, deliberately never reset — its own header
|
|
258
|
+
* says so, and states the condition that makes that safe:
|
|
259
|
+
* « This id never reaches the DOM ». It did, through this very
|
|
260
|
+
* line. On a persistent SSR process the counter keeps climbing
|
|
261
|
+
* from request to request, so the server served
|
|
262
|
+
* `id="origam-tab-285"` where the freshly-booted client rendered
|
|
263
|
+
* `id="origam-tab-9"` — measured on the marketing site's
|
|
264
|
+
* /installation: 3 attribute mismatches and the « Hydration
|
|
265
|
+
* completed but contains mismatches. » console error. `getUid()`
|
|
266
|
+
* is the DS's SSR-stable id source (position in the tree, no
|
|
267
|
+
* module state) — see `getCurrentInstance.util.ts`.
|
|
268
|
+
********************************************************/
|
|
124
269
|
const uid = getUid();
|
|
125
270
|
const tabDomId = computed(() => props.id || `origam-tab-${uid}`);
|
|
126
271
|
watchEffect(() => {
|
|
127
|
-
|
|
128
|
-
|
|
272
|
+
const self = groupItem.group.items.value.find((item) => item.id === groupItem.id);
|
|
273
|
+
if (self) self.domId = tabDomId.value;
|
|
129
274
|
});
|
|
130
275
|
const panelId = computed(() => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
276
|
+
const panelsGroup = panelsGroupLink?.value;
|
|
277
|
+
if (!panelsGroup) return undefined;
|
|
278
|
+
const panel = panelsGroup.items.value.find((item) => item.value === groupItem.value.value);
|
|
279
|
+
if (!panel) return undefined;
|
|
280
|
+
return panel.domId;
|
|
136
281
|
});
|
|
137
282
|
const ariaSelected = computed(() => groupItem.isSelected.value ? "true" : "false");
|
|
138
283
|
const tabIndex = computed(() => {
|
|
139
|
-
|
|
140
|
-
|
|
284
|
+
if (groupItem.disabled.value) return -1;
|
|
285
|
+
return groupItem.isSelected.value ? 0 : -1;
|
|
141
286
|
});
|
|
287
|
+
/*********************************************************
|
|
288
|
+
* Disabled + activation
|
|
289
|
+
********************************************************/
|
|
142
290
|
const isDisabled = computed(() => groupItem.disabled.value);
|
|
143
291
|
const handleClick = (event) => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
292
|
+
if (isDisabled.value) return;
|
|
293
|
+
event.preventDefault();
|
|
294
|
+
groupItem.select(true);
|
|
147
295
|
};
|
|
296
|
+
/*********************************************************
|
|
297
|
+
* Indicator (only on variant=underline)
|
|
298
|
+
********************************************************/
|
|
148
299
|
const hasIndicator = computed(() => props.variant === "underline");
|
|
300
|
+
/*********************************************************
|
|
301
|
+
* Typography
|
|
302
|
+
********************************************************/
|
|
149
303
|
const { typographyStyles } = useTypography(props, "tabs__item");
|
|
150
|
-
|
|
304
|
+
/*********************************************************
|
|
305
|
+
* Class & Style
|
|
306
|
+
********************************************************/
|
|
307
|
+
/*********************************************************
|
|
308
|
+
* pillsColorStyles (#1253)
|
|
309
|
+
*
|
|
310
|
+
* @description
|
|
311
|
+
* `color` (own prop, or mirrored from `<OrigamTabs>`) feeds the pills active-tab tokens; unset leaves the SCSS fallback (primary).
|
|
312
|
+
********************************************************/
|
|
313
|
+
const tabsColor = inject(ORIGAM_TABS_COLOR_KEY, undefined);
|
|
151
314
|
const pillsIntent = computed(() => {
|
|
152
|
-
|
|
153
|
-
|
|
315
|
+
const color = props.color || tabsColor?.value;
|
|
316
|
+
return typeof color === "string" && isIntent(color) ? color : undefined;
|
|
154
317
|
});
|
|
155
318
|
const pillsColorStyles = computed(() => pillsIntent.value ? {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} :
|
|
319
|
+
"--origam-tabs__item--pills--active---background-color": intentBgExpr(pillsIntent.value, "default"),
|
|
320
|
+
"--origam-tabs__item--pills--active---color": intentFgExpr(pillsIntent.value, "default")
|
|
321
|
+
} : undefined);
|
|
159
322
|
const tabStyles = computed(() => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
323
|
+
return [
|
|
324
|
+
typographyStyles.value,
|
|
325
|
+
pillsColorStyles.value,
|
|
326
|
+
props.style
|
|
327
|
+
];
|
|
165
328
|
});
|
|
166
329
|
const tabClasses = computed(() => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
330
|
+
return [
|
|
331
|
+
"origam-tab",
|
|
332
|
+
groupItem.selectedClass.value,
|
|
333
|
+
{
|
|
334
|
+
"origam-tab--disabled": isDisabled.value,
|
|
335
|
+
"origam-tab--with-prepend": hasPrependMedia.value,
|
|
336
|
+
"origam-tab--with-append": hasAppendMedia.value
|
|
337
|
+
},
|
|
338
|
+
props.class
|
|
339
|
+
];
|
|
177
340
|
});
|
|
178
341
|
const { id, css, load, isLoaded, unload } = useStyle(tabStyles);
|
|
342
|
+
/*********************************************************
|
|
343
|
+
* Expose
|
|
344
|
+
********************************************************/
|
|
179
345
|
defineExpose({
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
346
|
+
filterProps,
|
|
347
|
+
toggle: groupItem.toggle,
|
|
348
|
+
select: groupItem.select,
|
|
349
|
+
css,
|
|
350
|
+
id,
|
|
351
|
+
load,
|
|
352
|
+
unload,
|
|
353
|
+
isLoaded
|
|
188
354
|
});
|
|
189
355
|
</script>
|
|
190
356
|
|
|
@@ -30,71 +30,157 @@ import { useLazy } from "../../composables/Commons/lazy.composable";
|
|
|
30
30
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
31
31
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
32
32
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} from "../../consts/Tabs/tabs.const";
|
|
33
|
+
import { ORIGAM_TABS_LINK_KEY, ORIGAM_TAB_PANELS_KEY, ORIGAM_TAB_PANELS_CTX_KEY } from "../../consts/Tabs/tabs.const";
|
|
34
|
+
/*********************************************************
|
|
35
|
+
* Global
|
|
36
|
+
********************************************************/
|
|
38
37
|
const props = defineProps({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
tag: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: false,
|
|
41
|
+
default: "div"
|
|
42
|
+
},
|
|
43
|
+
id: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
class: {
|
|
48
|
+
type: [
|
|
49
|
+
String,
|
|
50
|
+
Array,
|
|
51
|
+
Object
|
|
52
|
+
],
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
style: {
|
|
56
|
+
type: [
|
|
57
|
+
String,
|
|
58
|
+
Array,
|
|
59
|
+
Object,
|
|
60
|
+
Boolean,
|
|
61
|
+
null
|
|
62
|
+
],
|
|
63
|
+
required: false,
|
|
64
|
+
skipCheck: true
|
|
65
|
+
},
|
|
66
|
+
value: {
|
|
67
|
+
type: null,
|
|
68
|
+
required: false,
|
|
69
|
+
default: undefined
|
|
70
|
+
},
|
|
71
|
+
disabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
selectedClass: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
eager: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
required: false,
|
|
82
|
+
default: false
|
|
83
|
+
}
|
|
47
84
|
});
|
|
48
85
|
const { filterProps } = useProps(props);
|
|
49
86
|
defineEmits(["group:selected"]);
|
|
50
87
|
defineSlots();
|
|
51
88
|
const rootRef = ref();
|
|
89
|
+
/*********************************************************
|
|
90
|
+
* Group registration
|
|
91
|
+
*
|
|
92
|
+
* @description
|
|
93
|
+
* The tabs group is NOT reachable via a plain
|
|
94
|
+
* `inject(ORIGAM_TABS_KEY)` — `<OrigamTabs>` is a SIBLING of
|
|
95
|
+
* `<OrigamTabPanels>`, not its ancestor (#441). `<OrigamTabPanels>`
|
|
96
|
+
* resolves the sibling once (`useGroupSiblingLink`) and re-provides
|
|
97
|
+
* it under `ORIGAM_TABS_LINK_KEY`, down its OWN ancestor chain —
|
|
98
|
+
* THAT is what we inject here.
|
|
99
|
+
********************************************************/
|
|
52
100
|
const groupItem = useGroupItem(props, ORIGAM_TAB_PANELS_KEY);
|
|
53
|
-
const tabsGroupLink = inject(ORIGAM_TABS_LINK_KEY,
|
|
101
|
+
const tabsGroupLink = inject(ORIGAM_TABS_LINK_KEY, undefined);
|
|
54
102
|
const panelsCtx = inject(ORIGAM_TAB_PANELS_CTX_KEY, null);
|
|
55
103
|
if (!groupItem) {
|
|
56
|
-
|
|
104
|
+
throw new Error("[Origam] <OrigamTabPanel> must be used inside an <OrigamTabPanels>");
|
|
57
105
|
}
|
|
106
|
+
/*********************************************************
|
|
107
|
+
* ARIA wiring
|
|
108
|
+
*
|
|
109
|
+
* @description
|
|
110
|
+
* `panelDomId` is the DOM id of THIS panel — `props.id` when
|
|
111
|
+
* the consumer supplies one, a generated fallback otherwise
|
|
112
|
+
* (referenced by the tab via `aria-controls`). Published onto
|
|
113
|
+
* this panel's OWN entry in the tab-panels group's `items`
|
|
114
|
+
* registry (`domId`, see `IGroupItem`) so the sibling
|
|
115
|
+
* `<OrigamTab>` can read the REAL id instead of guessing the
|
|
116
|
+
* generated-fallback naming scheme (#519-#522) — symmetric to
|
|
117
|
+
* `<OrigamTab>`'s own wiring.
|
|
118
|
+
*
|
|
119
|
+
* `tabLabelledBy` mirrors that lookup in the other direction,
|
|
120
|
+
* and returns the id the tab PUBLISHED or nothing — no
|
|
121
|
+
* reconstructed guess (#741), symmetric to `<OrigamTab>`'s
|
|
122
|
+
* `panelId`.
|
|
123
|
+
*
|
|
124
|
+
* @description
|
|
125
|
+
* ⛔ THE GENERATED FALLBACK DERIVES FROM `getUid()`, never from
|
|
126
|
+
* the process-global `groupItem.id`, which is not stable across
|
|
127
|
+
* an SSR render and its hydration — same contract as
|
|
128
|
+
* `<OrigamTab>`'s `tabDomId`, where the measurement is written
|
|
129
|
+
* out in full (#741).
|
|
130
|
+
********************************************************/
|
|
58
131
|
const uid = getUid();
|
|
59
132
|
const panelDomId = computed(() => props.id || `origam-tab-panel-${uid}`);
|
|
60
133
|
watchEffect(() => {
|
|
61
|
-
|
|
62
|
-
|
|
134
|
+
const self = groupItem.group.items.value.find((item) => item.id === groupItem.id);
|
|
135
|
+
if (self) self.domId = panelDomId.value;
|
|
63
136
|
});
|
|
64
137
|
const tabLabelledBy = computed(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
138
|
+
const tabsGroup = tabsGroupLink?.value;
|
|
139
|
+
if (!tabsGroup) return undefined;
|
|
140
|
+
const tab = tabsGroup.items.value.find((item) => item.value === groupItem.value.value);
|
|
141
|
+
if (!tab) return undefined;
|
|
142
|
+
return tab.domId;
|
|
70
143
|
});
|
|
144
|
+
/*********************************************************
|
|
145
|
+
* Visibility + lazy mounting
|
|
146
|
+
*
|
|
147
|
+
* @description
|
|
148
|
+
* `isShown` toggles via `v-show` so the panel stays in the
|
|
149
|
+
* DOM once mounted (preserves child component state, scroll
|
|
150
|
+
* position, etc.). `useLazy` gates the slot content so the
|
|
151
|
+
* first render is deferred until the panel becomes active.
|
|
152
|
+
********************************************************/
|
|
71
153
|
const isShown = computed(() => groupItem.isSelected.value);
|
|
72
154
|
const { hasContent } = useLazy({ eager: !!props.eager }, isShown);
|
|
73
155
|
const transitionName = computed(() => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
156
|
+
const t = panelsCtx?.transition.value;
|
|
157
|
+
if (t === false) return "";
|
|
158
|
+
return t || "fade";
|
|
77
159
|
});
|
|
160
|
+
/*********************************************************
|
|
161
|
+
* Class & Style
|
|
162
|
+
********************************************************/
|
|
78
163
|
const panelStyles = computed(() => {
|
|
79
|
-
|
|
80
|
-
props.style
|
|
81
|
-
];
|
|
164
|
+
return [props.style];
|
|
82
165
|
});
|
|
83
166
|
const panelClasses = computed(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
167
|
+
return [
|
|
168
|
+
"origam-tab-panel",
|
|
169
|
+
groupItem.selectedClass.value,
|
|
170
|
+
props.class
|
|
171
|
+
];
|
|
89
172
|
});
|
|
90
173
|
const { id, css, load, isLoaded, unload } = useStyle(panelStyles);
|
|
174
|
+
/*********************************************************
|
|
175
|
+
* Expose
|
|
176
|
+
********************************************************/
|
|
91
177
|
defineExpose({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
178
|
+
filterProps,
|
|
179
|
+
css,
|
|
180
|
+
id,
|
|
181
|
+
load,
|
|
182
|
+
unload,
|
|
183
|
+
isLoaded
|
|
98
184
|
});
|
|
99
185
|
</script>
|
|
100
186
|
|