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
|
@@ -49,97 +49,264 @@ import { useSnackbarGroupInternal } from "../../composables/Snackbar/snackbarGro
|
|
|
49
49
|
import { INTENT } from "../../enums/Commons/intent.enum";
|
|
50
50
|
import { SNACKBAR_GROUP_DIRECTION } from "../../enums/Snackbar/snackbar-group.enum";
|
|
51
51
|
import { SNACKBAR_GROUP_DEFAULT_DURATION, SNACKBAR_GROUP_DEFAULT_ID, SNACKBAR_GROUP_DEFAULT_MAX, SNACKBAR_GROUP_DEFAULT_SPACING } from "../../consts/Snackbar/snackbar-group.const";
|
|
52
|
+
/*********************************************************
|
|
53
|
+
* inheritAttrs — #916 / #853
|
|
54
|
+
*
|
|
55
|
+
* @description
|
|
56
|
+
* The single root is a `<teleport>` (to `document.body` by default, or
|
|
57
|
+
* wherever `attach` resolves via `useTeleport` — #attach-harmonisation),
|
|
58
|
+
* and Vue treats the TELEPORT shapeFlag like a fragment for automatic
|
|
59
|
+
* attrs inheritance — its own message says "renders fragment or text or
|
|
60
|
+
* teleport root nodes". It therefore logs "Extraneous non-props
|
|
61
|
+
* attributes", and that warning serialises every ancestor's props
|
|
62
|
+
* including Vue Router's `RouteProvider` vnode: ~4.4 MB per occurrence
|
|
63
|
+
* (#853).
|
|
64
|
+
*
|
|
65
|
+
* ⛔ The flag alone would SILENTLY swallow a consumer's `class` / `style` /
|
|
66
|
+
* `data-cy` / `aria-*` / listeners — #492's defect. They are therefore
|
|
67
|
+
* forwarded explicitly, onto the `<component :is="tag">` above: the
|
|
68
|
+
* stack's single visible root inside the teleport, already the element
|
|
69
|
+
* that owns `id`, `class`, `style` and `role="region"`. The spread sits
|
|
70
|
+
* LAST so a consumer's attribute wins over the component's own default for
|
|
71
|
+
* the same key, which is standard Vue merge order; `class` and `style` are
|
|
72
|
+
* concatenated rather than replaced by `mergeProps`.
|
|
73
|
+
*
|
|
74
|
+
* @description
|
|
75
|
+
* ⛔ THE OBJECT-SPREAD FORM `{ ...$attrs }` IS DELIBERATE, not cosmetic —
|
|
76
|
+
* the bare `v-bind="$attrs"` measurably breaks a NEIGHBOURING guard. Rule 3
|
|
77
|
+
* of `scripts/guards/lib/id-reach.mjs` credits a literal `v-bind="$attrs"`
|
|
78
|
+
* as proof that the `id` prop reaches the DOM. That inference is false
|
|
79
|
+
* whenever `id` is a DECLARED prop, because Vue REMOVES a declared prop
|
|
80
|
+
* from `$attrs` — the same mechanism guard 22 (`class-fallthrough`) is
|
|
81
|
+
* built on. With the bare form, `id-forwarding` reported this component's
|
|
82
|
+
* baselined `no-id-reach` entry as "already fixed" and demanded its
|
|
83
|
+
* deletion, on a component where the consumer's `id` still does not reach
|
|
84
|
+
* any node: `resolvedDomId` prefixes it with `origam-snackbar-group-`, on
|
|
85
|
+
* purpose, per #790. Deleting that entry would have hidden a live defect.
|
|
86
|
+
* The spread form carries exactly the same attributes at runtime and makes
|
|
87
|
+
* no such claim. Same shape as `OrigamOverlay` and `OrigamDrawer`.
|
|
88
|
+
********************************************************/
|
|
52
89
|
defineOptions({ inheritAttrs: false });
|
|
90
|
+
/*********************************************************
|
|
91
|
+
* Global
|
|
92
|
+
*
|
|
93
|
+
* @description
|
|
94
|
+
* Props + filterProps for consumers that re-export the
|
|
95
|
+
* stack as part of another composite.
|
|
96
|
+
********************************************************/
|
|
53
97
|
const props = defineProps({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
98
|
+
id: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: false,
|
|
101
|
+
default: SNACKBAR_GROUP_DEFAULT_ID
|
|
102
|
+
},
|
|
103
|
+
location: {
|
|
104
|
+
type: null,
|
|
105
|
+
required: false,
|
|
106
|
+
default: "bottom-right"
|
|
107
|
+
},
|
|
108
|
+
max: {
|
|
109
|
+
type: Number,
|
|
110
|
+
required: false,
|
|
111
|
+
default: SNACKBAR_GROUP_DEFAULT_MAX
|
|
112
|
+
},
|
|
113
|
+
defaultDuration: {
|
|
114
|
+
type: Number,
|
|
115
|
+
required: false,
|
|
116
|
+
default: SNACKBAR_GROUP_DEFAULT_DURATION
|
|
117
|
+
},
|
|
118
|
+
spacing: {
|
|
119
|
+
type: [String, Number],
|
|
120
|
+
required: false,
|
|
121
|
+
default: SNACKBAR_GROUP_DEFAULT_SPACING
|
|
122
|
+
},
|
|
123
|
+
direction: {
|
|
124
|
+
type: null,
|
|
125
|
+
required: false
|
|
126
|
+
},
|
|
127
|
+
class: {
|
|
128
|
+
type: [
|
|
129
|
+
String,
|
|
130
|
+
Array,
|
|
131
|
+
Object
|
|
132
|
+
],
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
style: {
|
|
136
|
+
type: [
|
|
137
|
+
String,
|
|
138
|
+
Array,
|
|
139
|
+
Object,
|
|
140
|
+
Boolean,
|
|
141
|
+
null
|
|
142
|
+
],
|
|
143
|
+
required: false,
|
|
144
|
+
skipCheck: true
|
|
145
|
+
},
|
|
146
|
+
tag: {
|
|
147
|
+
type: String,
|
|
148
|
+
required: false,
|
|
149
|
+
default: "div"
|
|
150
|
+
},
|
|
151
|
+
attach: {
|
|
152
|
+
type: [
|
|
153
|
+
Boolean,
|
|
154
|
+
String,
|
|
155
|
+
null
|
|
156
|
+
],
|
|
157
|
+
required: false,
|
|
158
|
+
skipCheck: true
|
|
159
|
+
}
|
|
64
160
|
});
|
|
65
161
|
defineEmits([]);
|
|
66
162
|
defineSlots();
|
|
67
163
|
const { t } = useLocale();
|
|
68
164
|
const { filterProps } = useProps(props);
|
|
69
165
|
const rootRef = ref();
|
|
166
|
+
/*********************************************************
|
|
167
|
+
* Teleport — #attach-harmonisation
|
|
168
|
+
*
|
|
169
|
+
* @description
|
|
170
|
+
* `attach` was previously absent and the stack hard-coded
|
|
171
|
+
* `<teleport to="body">`. `useTeleport` is the single resolution
|
|
172
|
+
* point the rest of the Overlay family (`OrigamOverlay`) already
|
|
173
|
+
* consumes — deferred into a `computed` (never read eagerly in
|
|
174
|
+
* `setup()`) so a themed `attach` value is honoured.
|
|
175
|
+
********************************************************/
|
|
70
176
|
const { teleportTarget } = useTeleport(computed(() => props.attach || false));
|
|
177
|
+
/*********************************************************
|
|
178
|
+
* Store wiring
|
|
179
|
+
*
|
|
180
|
+
* @description
|
|
181
|
+
* The component subscribes to the matching stack id via
|
|
182
|
+
* `useSnackbarGroupInternal`. Items are mutated by the
|
|
183
|
+
* public `useSnackbarGroup({ id }).notify / dismiss /
|
|
184
|
+
* dismissAll` composable — this side only reads them.
|
|
185
|
+
********************************************************/
|
|
71
186
|
const { rawItems, registerDefaultDuration } = useSnackbarGroupInternal(() => props.id);
|
|
187
|
+
// Publishes `defaultDuration` into the shared store so `notify()` —
|
|
188
|
+
// called from ANY `useSnackbarGroup({ id })` instance targeting this
|
|
189
|
+
// stack — honours the value declared here, without every call site
|
|
190
|
+
// having to repeat it as a composable option. `immediate: true`
|
|
191
|
+
// registers it before any consumer interaction can fire `notify()`;
|
|
192
|
+
// the watcher keeps it in sync across reactive prop updates too.
|
|
72
193
|
watch(() => props.defaultDuration, (duration) => {
|
|
73
|
-
|
|
194
|
+
registerDefaultDuration(duration);
|
|
74
195
|
}, { immediate: true });
|
|
75
196
|
const visibleItems = computed(() => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
197
|
+
const items = rawItems.value;
|
|
198
|
+
// FIFO trim — visible slice respects the `max` cap. The
|
|
199
|
+
// composable also enforces a max if its `max` option is set,
|
|
200
|
+
// but the component cap is independent: consumers can keep
|
|
201
|
+
// many items in the store while only painting a few.
|
|
202
|
+
const sliced = items.slice(-props.max);
|
|
203
|
+
return effectiveDirection.value === SNACKBAR_GROUP_DIRECTION.BOTTOM_UP ? [...sliced].reverse() : sliced;
|
|
79
204
|
});
|
|
205
|
+
/*********************************************************
|
|
206
|
+
* Direction & ARIA
|
|
207
|
+
*
|
|
208
|
+
* @description
|
|
209
|
+
* `direction` defaults to `top-down` for `top-*` anchors
|
|
210
|
+
* and `bottom-up` for `bottom-*` anchors so the newest
|
|
211
|
+
* toast always appears closest to the anchored edge.
|
|
212
|
+
********************************************************/
|
|
80
213
|
const effectiveDirection = computed(() => {
|
|
81
|
-
|
|
82
|
-
|
|
214
|
+
if (props.direction) return props.direction;
|
|
215
|
+
return props.location.startsWith("top") ? SNACKBAR_GROUP_DIRECTION.TOP_DOWN : SNACKBAR_GROUP_DIRECTION.BOTTOM_UP;
|
|
83
216
|
});
|
|
84
217
|
const groupAriaLabel = computed(() => t("origam.snackbar_group.notifications"));
|
|
85
218
|
const resolveAriaRole = (intent) => {
|
|
86
|
-
|
|
219
|
+
return intent === INTENT.WARNING || intent === INTENT.DANGER ? "alert" : "status";
|
|
87
220
|
};
|
|
88
221
|
const resolveAriaLive = (intent) => {
|
|
89
|
-
|
|
222
|
+
return intent === "warning" || intent === "danger" ? "assertive" : "polite";
|
|
90
223
|
};
|
|
224
|
+
/*********************************************************
|
|
225
|
+
* Items helpers
|
|
226
|
+
********************************************************/
|
|
91
227
|
const resolveDismissible = (item) => {
|
|
92
|
-
|
|
228
|
+
return item.dismissible !== false;
|
|
93
229
|
};
|
|
230
|
+
/*********************************************************
|
|
231
|
+
* Event handlers
|
|
232
|
+
*
|
|
233
|
+
* @description
|
|
234
|
+
* `dismiss` is intentionally NOT imported from the public
|
|
235
|
+
* `useSnackbarGroup` here to avoid forming a circular
|
|
236
|
+
* dependency at module init time. We mutate the raw items
|
|
237
|
+
* directly through the internal helper.
|
|
238
|
+
********************************************************/
|
|
94
239
|
const dismissItem = (itemId) => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
240
|
+
const index = rawItems.value.findIndex((it) => it.id === itemId);
|
|
241
|
+
if (index === -1) return;
|
|
242
|
+
const [removed] = rawItems.value.splice(index, 1);
|
|
243
|
+
removed?.onDismiss?.();
|
|
99
244
|
};
|
|
100
245
|
const handleDismissClick = (itemId) => {
|
|
101
|
-
|
|
246
|
+
dismissItem(itemId);
|
|
102
247
|
};
|
|
103
248
|
const handleActionClick = (item, action) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
249
|
+
action.handler();
|
|
250
|
+
if (!action.keepOpen) {
|
|
251
|
+
dismissItem(item.id);
|
|
252
|
+
}
|
|
108
253
|
};
|
|
254
|
+
/*********************************************************
|
|
255
|
+
* Class & Style
|
|
256
|
+
********************************************************/
|
|
109
257
|
const transitionName = computed(() => {
|
|
110
|
-
|
|
111
|
-
|
|
258
|
+
if (props.location.startsWith("top")) return "origam-snackbar-group--slide-down";
|
|
259
|
+
return "origam-snackbar-group--slide-up";
|
|
112
260
|
});
|
|
113
261
|
const spacingValue = computed(() => {
|
|
114
|
-
|
|
115
|
-
|
|
262
|
+
if (typeof props.spacing === "number") return `${props.spacing}px`;
|
|
263
|
+
return props.spacing;
|
|
116
264
|
});
|
|
117
265
|
const stackStyles = computed(() => {
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
"--origam-snackbar-group---gap": spacingValue.value
|
|
121
|
-
},
|
|
122
|
-
props.style
|
|
123
|
-
];
|
|
266
|
+
return [{ "--origam-snackbar-group---gap": spacingValue.value }, props.style];
|
|
124
267
|
});
|
|
125
268
|
const stackClasses = computed(() => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
269
|
+
return [
|
|
270
|
+
"origam-snackbar-group",
|
|
271
|
+
`origam-snackbar-group--${props.location}`,
|
|
272
|
+
`origam-snackbar-group--direction-${effectiveDirection.value}`,
|
|
273
|
+
props.class
|
|
274
|
+
];
|
|
132
275
|
});
|
|
276
|
+
// The teleport target re-uses the consumer's `id` prop as both the
|
|
277
|
+
// store key AND the DOM id of the rendered region. Doing it once
|
|
278
|
+
// keeps screen-reader announcements addressable from outside.
|
|
133
279
|
const resolvedDomId = computed(() => `origam-snackbar-group-${props.id}`);
|
|
280
|
+
/*********************************************************
|
|
281
|
+
* styleId — cible la racine reellement rendue
|
|
282
|
+
*
|
|
283
|
+
* @description
|
|
284
|
+
* ⛔ Ici `props.id` n'est PAS un id DOM : c'est la cle logique de la pile
|
|
285
|
+
* de snackbars (`useSnackbarGroup({ id })`), partagee par tous les appels
|
|
286
|
+
* qui poussent dans la meme file. D'ou `resolvedDomId`, qui la prefixe
|
|
287
|
+
* pour en faire un id DOM valide et non colisionnant. Le sweep #790 lit
|
|
288
|
+
* toute prop `id` comme un id DOM et classe donc ce composant « perdu » :
|
|
289
|
+
* c'est un FAUX POSITIF de l'instrument, pas un defaut de transmission.
|
|
290
|
+
*
|
|
291
|
+
* @description
|
|
292
|
+
* Le defaut REEL que #790 a mis au jour ici est ailleurs, et il est muet :
|
|
293
|
+
* `useStyle` etait appele sans son second argument, donc il injectait
|
|
294
|
+
* `#origam-snackbar-group-<uid> { … }` alors que la racine porte
|
|
295
|
+
* `resolvedDomId`. Aucun noeud ne matchait — un style MORT. Lui passer la
|
|
296
|
+
* cible reelle suffit ; le rendu, lui, ne change pas d'un caractere.
|
|
297
|
+
********************************************************/
|
|
134
298
|
const { id: styleId, css, load, isLoaded, unload } = useStyle(stackStyles, () => resolvedDomId.value);
|
|
299
|
+
/*********************************************************
|
|
300
|
+
* Expose
|
|
301
|
+
********************************************************/
|
|
135
302
|
defineExpose({
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
303
|
+
filterProps,
|
|
304
|
+
visibleItems,
|
|
305
|
+
css,
|
|
306
|
+
id: styleId,
|
|
307
|
+
load,
|
|
308
|
+
unload,
|
|
309
|
+
isLoaded
|
|
143
310
|
});
|
|
144
311
|
</script>
|
|
145
312
|
|
|
@@ -82,80 +82,212 @@ import { useProps } from "../../composables/Commons/props.composable";
|
|
|
82
82
|
import { useTypography } from "../../composables/Commons/typography.composable";
|
|
83
83
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
84
84
|
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
85
|
+
/*********************************************************
|
|
86
|
+
* Global
|
|
87
|
+
*
|
|
88
|
+
* @description
|
|
89
|
+
* Props with defaults. withDefaults uses inline literals only
|
|
90
|
+
* per the project rule.
|
|
91
|
+
********************************************************/
|
|
85
92
|
const props = defineProps({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
intent: {
|
|
94
|
+
type: null,
|
|
95
|
+
required: false,
|
|
96
|
+
default: "info"
|
|
97
|
+
},
|
|
98
|
+
title: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: false
|
|
101
|
+
},
|
|
102
|
+
message: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false
|
|
105
|
+
},
|
|
106
|
+
icon: {
|
|
107
|
+
type: [
|
|
108
|
+
String,
|
|
109
|
+
Array,
|
|
110
|
+
Boolean
|
|
111
|
+
],
|
|
112
|
+
required: false,
|
|
113
|
+
skipCheck: true
|
|
114
|
+
},
|
|
115
|
+
actions: {
|
|
116
|
+
type: Array,
|
|
117
|
+
required: false
|
|
118
|
+
},
|
|
119
|
+
dismissible: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
required: false,
|
|
122
|
+
default: true
|
|
123
|
+
},
|
|
124
|
+
dismissLabel: {
|
|
125
|
+
type: String,
|
|
126
|
+
required: false,
|
|
127
|
+
default: undefined
|
|
128
|
+
},
|
|
129
|
+
role: {
|
|
130
|
+
type: String,
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
133
|
+
ariaLive: {
|
|
134
|
+
type: String,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
dataCy: {
|
|
138
|
+
type: String,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
id: {
|
|
142
|
+
type: String,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
class: {
|
|
146
|
+
type: [
|
|
147
|
+
String,
|
|
148
|
+
Array,
|
|
149
|
+
Object
|
|
150
|
+
],
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
type: [
|
|
155
|
+
String,
|
|
156
|
+
Array,
|
|
157
|
+
Object,
|
|
158
|
+
Boolean,
|
|
159
|
+
null
|
|
160
|
+
],
|
|
161
|
+
required: false,
|
|
162
|
+
skipCheck: true
|
|
163
|
+
},
|
|
164
|
+
fontSize: {
|
|
165
|
+
type: null,
|
|
166
|
+
required: false
|
|
167
|
+
}
|
|
100
168
|
});
|
|
169
|
+
/*********************************************************
|
|
170
|
+
* Labels — localised through the DS i18n provider (`useLocale`).
|
|
171
|
+
* Keys live under `origam.snackbar.*` in the shipped locale messages.
|
|
172
|
+
* The `dismissLabel` prop is kept for back-compat (explicit override wins).
|
|
173
|
+
********************************************************/
|
|
101
174
|
const { t } = useLocale();
|
|
102
175
|
const dismissLabel = computed(() => props.dismissLabel ?? t("origam.snackbar.dismiss"));
|
|
103
176
|
const { filterProps } = useProps(props);
|
|
177
|
+
/*********************************************************
|
|
178
|
+
* Passed-prop tracking
|
|
179
|
+
*
|
|
180
|
+
* @description
|
|
181
|
+
* `icon` is typed `TIcon | false`. Vue's compiler infers a runtime
|
|
182
|
+
* `Boolean` branch from the `false` literal, and any unset prop whose
|
|
183
|
+
* type includes `Boolean` resolves to the concrete value `false` —
|
|
184
|
+
* never `undefined` — when the consumer does not pass it. A naive
|
|
185
|
+
* `props.icon === false` check therefore ALWAYS short-circuits, even
|
|
186
|
+
* when the consumer never touched `icon`. `usePassedProps()` reads
|
|
187
|
+
* `vnode.props` directly to tell "explicitly passed `false`" apart
|
|
188
|
+
* from "not passed at all".
|
|
189
|
+
********************************************************/
|
|
104
190
|
const wasIconPassed = usePassedProps(props, "OrigamSnackbarItem");
|
|
191
|
+
/*********************************************************
|
|
192
|
+
* Typography
|
|
193
|
+
*
|
|
194
|
+
* @description
|
|
195
|
+
* Only `fontSize` has a real visual effect: the root element
|
|
196
|
+
* reads `--origam-snackbar-item---font-size`. `fontWeight` is
|
|
197
|
+
* scoped to BEM children (`__title`, `__message`) with their
|
|
198
|
+
* own namespaced vars — a single `useTypography('snackbar-item')`
|
|
199
|
+
* cannot address both surfaces; expose via story only when
|
|
200
|
+
* per-surface control is added.
|
|
201
|
+
********************************************************/
|
|
105
202
|
const { typographyStyles } = useTypography(props, "snackbar-item");
|
|
106
203
|
const slots = useSlots();
|
|
204
|
+
/*********************************************************
|
|
205
|
+
* Emits
|
|
206
|
+
********************************************************/
|
|
107
207
|
const emit = defineEmits(["dismiss", "action"]);
|
|
108
208
|
defineSlots();
|
|
209
|
+
/*********************************************************
|
|
210
|
+
* Intent helpers
|
|
211
|
+
********************************************************/
|
|
109
212
|
const INTENT_ICONS = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
213
|
+
primary: MDI_ICONS.INFORMATION,
|
|
214
|
+
secondary: MDI_ICONS.INFORMATION,
|
|
215
|
+
ghost: MDI_ICONS.INFORMATION,
|
|
216
|
+
neutral: MDI_ICONS.INFORMATION,
|
|
217
|
+
success: MDI_ICONS.CHECK_CIRCLE,
|
|
218
|
+
warning: MDI_ICONS.ALERT,
|
|
219
|
+
danger: MDI_ICONS.ALERT_CIRCLE,
|
|
220
|
+
info: MDI_ICONS.INFORMATION
|
|
118
221
|
};
|
|
119
222
|
const resolvedIcon = computed(() => {
|
|
120
|
-
|
|
121
|
-
|
|
223
|
+
if (wasIconPassed("icon")) return props.icon;
|
|
224
|
+
return INTENT_ICONS[props.intent ?? "info"];
|
|
122
225
|
});
|
|
226
|
+
/*********************************************************
|
|
227
|
+
* A custom `#prepend` slot must render on its own merits — it must
|
|
228
|
+
* NEVER be suppressed just because the default-icon resolution landed
|
|
229
|
+
* on `false`. Coupling the zone's `v-if` to `resolvedIcon` silently
|
|
230
|
+
* dropped any consumer-provided `#prepend` content along with the icon.
|
|
231
|
+
********************************************************/
|
|
123
232
|
const hasPrepend = computed(() => {
|
|
124
|
-
|
|
233
|
+
return resolvedIcon.value !== false || !!slots["prepend"];
|
|
125
234
|
});
|
|
235
|
+
/*********************************************************
|
|
236
|
+
* `<origam-icon>` (the `#prepend` fallback) only takes `TIcon |
|
|
237
|
+
* undefined` — it has no `false` branch. `hasPrepend` (unlike the old
|
|
238
|
+
* `v-if="resolvedIcon !== false"`) is an opaque boolean the template
|
|
239
|
+
* type-checker cannot narrow `resolvedIcon` through, so the fallback
|
|
240
|
+
* needs its own correctly-typed value. Only reached at runtime when
|
|
241
|
+
* no `#prepend` slot content overrides it, so `undefined` here is
|
|
242
|
+
* inert either way.
|
|
243
|
+
********************************************************/
|
|
126
244
|
const iconToRender = computed(() => {
|
|
127
|
-
|
|
245
|
+
return resolvedIcon.value === false ? undefined : resolvedIcon.value;
|
|
128
246
|
});
|
|
129
247
|
const resolvedRole = computed(() => {
|
|
130
|
-
|
|
131
|
-
|
|
248
|
+
if (props.role) return props.role;
|
|
249
|
+
return props.intent === "warning" || props.intent === "danger" ? "alert" : "status";
|
|
132
250
|
});
|
|
133
251
|
const resolvedAriaLive = computed(() => {
|
|
134
|
-
|
|
135
|
-
|
|
252
|
+
if (props.ariaLive) return props.ariaLive;
|
|
253
|
+
return props.intent === "warning" || props.intent === "danger" ? "assertive" : "polite";
|
|
136
254
|
});
|
|
255
|
+
/*********************************************************
|
|
256
|
+
* Slot & actions helpers
|
|
257
|
+
********************************************************/
|
|
137
258
|
const hasMessage = computed(() => {
|
|
138
|
-
|
|
259
|
+
return !!(props.message || slots["message"]);
|
|
139
260
|
});
|
|
140
261
|
const hasActions = computed(() => {
|
|
141
|
-
|
|
262
|
+
// Show actions section when action buttons are provided via prop OR
|
|
263
|
+
// via the `actions` slot (e.g. OrigamSnackbar's #action slot forwarding).
|
|
264
|
+
return Array.isArray(props.actions) && props.actions.length > 0 || !!slots["actions"];
|
|
142
265
|
});
|
|
266
|
+
/*********************************************************
|
|
267
|
+
* Event handlers
|
|
268
|
+
********************************************************/
|
|
143
269
|
const handleActionClick = (action) => {
|
|
144
|
-
|
|
270
|
+
emit("action", action);
|
|
145
271
|
};
|
|
272
|
+
/*********************************************************
|
|
273
|
+
* Classes
|
|
274
|
+
********************************************************/
|
|
146
275
|
const rootStyles = computed(() => [typographyStyles.value, props.style]);
|
|
147
276
|
const itemClasses = computed(() => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
277
|
+
const intent = props.intent ?? "info";
|
|
278
|
+
return [
|
|
279
|
+
"origam-snackbar-item",
|
|
280
|
+
`origam-snackbar-item--intent-${intent}`,
|
|
281
|
+
{
|
|
282
|
+
"origam-snackbar-item--with-actions": hasActions.value,
|
|
283
|
+
"origam-snackbar-item--dismissible": props.dismissible !== false
|
|
284
|
+
},
|
|
285
|
+
props.class
|
|
286
|
+
];
|
|
158
287
|
});
|
|
288
|
+
/*********************************************************
|
|
289
|
+
* Expose
|
|
290
|
+
********************************************************/
|
|
159
291
|
defineExpose({ filterProps });
|
|
160
292
|
</script>
|
|
161
293
|
|