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
|
@@ -216,252 +216,996 @@ import { LOADER_KIND } from "../../enums/Commons/loader.enum";
|
|
|
216
216
|
import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
217
217
|
import { splitSkeletonOverrides } from "../../utils/Skeleton/skeleton.util";
|
|
218
218
|
import { computed, ref, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
219
|
+
/*********************************************************
|
|
220
|
+
* Global
|
|
221
|
+
*
|
|
222
|
+
* @description
|
|
223
|
+
* Props, emits and link resolution for the Card component.
|
|
224
|
+
********************************************************/
|
|
219
225
|
const props = defineProps({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
226
|
+
contentDisplay: {
|
|
227
|
+
type: null,
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
disabled: {
|
|
231
|
+
type: Boolean,
|
|
232
|
+
required: false
|
|
233
|
+
},
|
|
234
|
+
flat: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
image: {
|
|
239
|
+
type: String,
|
|
240
|
+
required: false
|
|
241
|
+
},
|
|
242
|
+
link: {
|
|
243
|
+
type: Boolean,
|
|
244
|
+
required: false
|
|
245
|
+
},
|
|
246
|
+
subtitle: {
|
|
247
|
+
type: [String, Number],
|
|
248
|
+
required: false
|
|
249
|
+
},
|
|
250
|
+
text: {
|
|
251
|
+
type: [String, Number],
|
|
252
|
+
required: false
|
|
253
|
+
},
|
|
254
|
+
title: {
|
|
255
|
+
type: [String, Number],
|
|
256
|
+
required: false
|
|
257
|
+
},
|
|
258
|
+
type: {
|
|
259
|
+
type: null,
|
|
260
|
+
required: false
|
|
261
|
+
},
|
|
262
|
+
titleId: {
|
|
263
|
+
type: String,
|
|
264
|
+
required: false
|
|
265
|
+
},
|
|
266
|
+
id: {
|
|
267
|
+
type: String,
|
|
268
|
+
required: false
|
|
269
|
+
},
|
|
270
|
+
class: {
|
|
271
|
+
type: [
|
|
272
|
+
String,
|
|
273
|
+
Array,
|
|
274
|
+
Object
|
|
275
|
+
],
|
|
276
|
+
required: false
|
|
277
|
+
},
|
|
278
|
+
style: {
|
|
279
|
+
type: [
|
|
280
|
+
String,
|
|
281
|
+
Array,
|
|
282
|
+
Object,
|
|
283
|
+
Boolean,
|
|
284
|
+
null
|
|
285
|
+
],
|
|
286
|
+
required: false,
|
|
287
|
+
skipCheck: true
|
|
288
|
+
},
|
|
289
|
+
tag: {
|
|
290
|
+
type: String,
|
|
291
|
+
required: false,
|
|
292
|
+
default: "div"
|
|
293
|
+
},
|
|
294
|
+
border: {
|
|
295
|
+
type: [
|
|
296
|
+
Boolean,
|
|
297
|
+
Number,
|
|
298
|
+
String,
|
|
299
|
+
Array
|
|
300
|
+
],
|
|
301
|
+
required: false,
|
|
302
|
+
skipCheck: true
|
|
303
|
+
},
|
|
304
|
+
borderTop: {
|
|
305
|
+
type: [
|
|
306
|
+
Boolean,
|
|
307
|
+
Number,
|
|
308
|
+
String
|
|
309
|
+
],
|
|
310
|
+
required: false
|
|
311
|
+
},
|
|
312
|
+
borderLeft: {
|
|
313
|
+
type: [
|
|
314
|
+
Boolean,
|
|
315
|
+
Number,
|
|
316
|
+
String
|
|
317
|
+
],
|
|
318
|
+
required: false
|
|
319
|
+
},
|
|
320
|
+
borderBottom: {
|
|
321
|
+
type: [
|
|
322
|
+
Boolean,
|
|
323
|
+
Number,
|
|
324
|
+
String
|
|
325
|
+
],
|
|
326
|
+
required: false
|
|
327
|
+
},
|
|
328
|
+
borderRight: {
|
|
329
|
+
type: [
|
|
330
|
+
Boolean,
|
|
331
|
+
Number,
|
|
332
|
+
String
|
|
333
|
+
],
|
|
334
|
+
required: false
|
|
335
|
+
},
|
|
336
|
+
borderBlock: {
|
|
337
|
+
type: [
|
|
338
|
+
Boolean,
|
|
339
|
+
Number,
|
|
340
|
+
String
|
|
341
|
+
],
|
|
342
|
+
required: false
|
|
343
|
+
},
|
|
344
|
+
borderInline: {
|
|
345
|
+
type: [
|
|
346
|
+
Boolean,
|
|
347
|
+
Number,
|
|
348
|
+
String
|
|
349
|
+
],
|
|
350
|
+
required: false
|
|
351
|
+
},
|
|
352
|
+
borderInlineStart: {
|
|
353
|
+
type: [
|
|
354
|
+
Boolean,
|
|
355
|
+
Number,
|
|
356
|
+
String
|
|
357
|
+
],
|
|
358
|
+
required: false
|
|
359
|
+
},
|
|
360
|
+
borderInlineEnd: {
|
|
361
|
+
type: [
|
|
362
|
+
Boolean,
|
|
363
|
+
Number,
|
|
364
|
+
String
|
|
365
|
+
],
|
|
366
|
+
required: false
|
|
367
|
+
},
|
|
368
|
+
borderBlockStart: {
|
|
369
|
+
type: [
|
|
370
|
+
Boolean,
|
|
371
|
+
Number,
|
|
372
|
+
String
|
|
373
|
+
],
|
|
374
|
+
required: false
|
|
375
|
+
},
|
|
376
|
+
borderBlockEnd: {
|
|
377
|
+
type: [
|
|
378
|
+
Boolean,
|
|
379
|
+
Number,
|
|
380
|
+
String
|
|
381
|
+
],
|
|
382
|
+
required: false
|
|
383
|
+
},
|
|
384
|
+
borderColor: {
|
|
385
|
+
type: String,
|
|
386
|
+
required: false
|
|
387
|
+
},
|
|
388
|
+
borderStyle: {
|
|
389
|
+
type: String,
|
|
390
|
+
required: false
|
|
391
|
+
},
|
|
392
|
+
borderTopColor: {
|
|
393
|
+
type: [
|
|
394
|
+
String,
|
|
395
|
+
Object,
|
|
396
|
+
Boolean,
|
|
397
|
+
null
|
|
398
|
+
],
|
|
399
|
+
required: false,
|
|
400
|
+
skipCheck: true
|
|
401
|
+
},
|
|
402
|
+
borderRightColor: {
|
|
403
|
+
type: [
|
|
404
|
+
String,
|
|
405
|
+
Object,
|
|
406
|
+
Boolean,
|
|
407
|
+
null
|
|
408
|
+
],
|
|
409
|
+
required: false,
|
|
410
|
+
skipCheck: true
|
|
411
|
+
},
|
|
412
|
+
borderBottomColor: {
|
|
413
|
+
type: [
|
|
414
|
+
String,
|
|
415
|
+
Object,
|
|
416
|
+
Boolean,
|
|
417
|
+
null
|
|
418
|
+
],
|
|
419
|
+
required: false,
|
|
420
|
+
skipCheck: true
|
|
421
|
+
},
|
|
422
|
+
borderLeftColor: {
|
|
423
|
+
type: [
|
|
424
|
+
String,
|
|
425
|
+
Object,
|
|
426
|
+
Boolean,
|
|
427
|
+
null
|
|
428
|
+
],
|
|
429
|
+
required: false,
|
|
430
|
+
skipCheck: true
|
|
431
|
+
},
|
|
432
|
+
borderInlineStartColor: {
|
|
433
|
+
type: [
|
|
434
|
+
String,
|
|
435
|
+
Object,
|
|
436
|
+
Boolean,
|
|
437
|
+
null
|
|
438
|
+
],
|
|
439
|
+
required: false,
|
|
440
|
+
skipCheck: true
|
|
441
|
+
},
|
|
442
|
+
borderInlineEndColor: {
|
|
443
|
+
type: [
|
|
444
|
+
String,
|
|
445
|
+
Object,
|
|
446
|
+
Boolean,
|
|
447
|
+
null
|
|
448
|
+
],
|
|
449
|
+
required: false,
|
|
450
|
+
skipCheck: true
|
|
451
|
+
},
|
|
452
|
+
borderBlockStartColor: {
|
|
453
|
+
type: [
|
|
454
|
+
String,
|
|
455
|
+
Object,
|
|
456
|
+
Boolean,
|
|
457
|
+
null
|
|
458
|
+
],
|
|
459
|
+
required: false,
|
|
460
|
+
skipCheck: true
|
|
461
|
+
},
|
|
462
|
+
borderBlockEndColor: {
|
|
463
|
+
type: [
|
|
464
|
+
String,
|
|
465
|
+
Object,
|
|
466
|
+
Boolean,
|
|
467
|
+
null
|
|
468
|
+
],
|
|
469
|
+
required: false,
|
|
470
|
+
skipCheck: true
|
|
471
|
+
},
|
|
472
|
+
color: {
|
|
473
|
+
type: [
|
|
474
|
+
String,
|
|
475
|
+
Object,
|
|
476
|
+
Boolean,
|
|
477
|
+
null
|
|
478
|
+
],
|
|
479
|
+
required: false,
|
|
480
|
+
skipCheck: true
|
|
481
|
+
},
|
|
482
|
+
bgColor: {
|
|
483
|
+
type: [
|
|
484
|
+
String,
|
|
485
|
+
Object,
|
|
486
|
+
Boolean,
|
|
487
|
+
null
|
|
488
|
+
],
|
|
489
|
+
required: false,
|
|
490
|
+
skipCheck: true
|
|
491
|
+
},
|
|
492
|
+
density: {
|
|
493
|
+
type: null,
|
|
494
|
+
required: false,
|
|
495
|
+
default: DENSITY.DEFAULT
|
|
496
|
+
},
|
|
497
|
+
height: {
|
|
498
|
+
type: [Number, String],
|
|
499
|
+
required: false
|
|
500
|
+
},
|
|
501
|
+
maxHeight: {
|
|
502
|
+
type: [Number, String],
|
|
503
|
+
required: false
|
|
504
|
+
},
|
|
505
|
+
maxWidth: {
|
|
506
|
+
type: [Number, String],
|
|
507
|
+
required: false
|
|
508
|
+
},
|
|
509
|
+
minHeight: {
|
|
510
|
+
type: [Number, String],
|
|
511
|
+
required: false
|
|
512
|
+
},
|
|
513
|
+
minWidth: {
|
|
514
|
+
type: [Number, String],
|
|
515
|
+
required: false
|
|
516
|
+
},
|
|
517
|
+
width: {
|
|
518
|
+
type: [Number, String],
|
|
519
|
+
required: false
|
|
520
|
+
},
|
|
521
|
+
elevation: {
|
|
522
|
+
type: [Number, String],
|
|
523
|
+
required: false
|
|
524
|
+
},
|
|
525
|
+
loading: {
|
|
526
|
+
type: [
|
|
527
|
+
Boolean,
|
|
528
|
+
Number,
|
|
529
|
+
Object
|
|
530
|
+
],
|
|
531
|
+
required: false
|
|
532
|
+
},
|
|
533
|
+
loadingText: {
|
|
534
|
+
type: String,
|
|
535
|
+
required: false
|
|
536
|
+
},
|
|
537
|
+
location: {
|
|
538
|
+
type: null,
|
|
539
|
+
required: false
|
|
540
|
+
},
|
|
541
|
+
position: {
|
|
542
|
+
type: null,
|
|
543
|
+
required: false
|
|
544
|
+
},
|
|
545
|
+
top: {
|
|
546
|
+
type: [Number, String],
|
|
547
|
+
required: false
|
|
548
|
+
},
|
|
549
|
+
bottom: {
|
|
550
|
+
type: [Number, String],
|
|
551
|
+
required: false
|
|
552
|
+
},
|
|
553
|
+
left: {
|
|
554
|
+
type: [Number, String],
|
|
555
|
+
required: false
|
|
556
|
+
},
|
|
557
|
+
right: {
|
|
558
|
+
type: [Number, String],
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
561
|
+
rounded: {
|
|
562
|
+
type: [
|
|
563
|
+
Boolean,
|
|
564
|
+
Number,
|
|
565
|
+
String,
|
|
566
|
+
null
|
|
567
|
+
],
|
|
568
|
+
required: false,
|
|
569
|
+
skipCheck: true
|
|
570
|
+
},
|
|
571
|
+
roundedTopRight: {
|
|
572
|
+
type: [
|
|
573
|
+
Boolean,
|
|
574
|
+
Number,
|
|
575
|
+
String
|
|
576
|
+
],
|
|
577
|
+
required: false
|
|
578
|
+
},
|
|
579
|
+
roundedTopLeft: {
|
|
580
|
+
type: [
|
|
581
|
+
Boolean,
|
|
582
|
+
Number,
|
|
583
|
+
String
|
|
584
|
+
],
|
|
585
|
+
required: false
|
|
586
|
+
},
|
|
587
|
+
roundedBottomLeft: {
|
|
588
|
+
type: [
|
|
589
|
+
Boolean,
|
|
590
|
+
Number,
|
|
591
|
+
String
|
|
592
|
+
],
|
|
593
|
+
required: false
|
|
594
|
+
},
|
|
595
|
+
roundedBottomRight: {
|
|
596
|
+
type: [
|
|
597
|
+
Boolean,
|
|
598
|
+
Number,
|
|
599
|
+
String
|
|
600
|
+
],
|
|
601
|
+
required: false
|
|
602
|
+
},
|
|
603
|
+
roundedStartStart: {
|
|
604
|
+
type: [
|
|
605
|
+
Boolean,
|
|
606
|
+
Number,
|
|
607
|
+
String
|
|
608
|
+
],
|
|
609
|
+
required: false
|
|
610
|
+
},
|
|
611
|
+
roundedStartEnd: {
|
|
612
|
+
type: [
|
|
613
|
+
Boolean,
|
|
614
|
+
Number,
|
|
615
|
+
String
|
|
616
|
+
],
|
|
617
|
+
required: false
|
|
618
|
+
},
|
|
619
|
+
roundedEndStart: {
|
|
620
|
+
type: [
|
|
621
|
+
Boolean,
|
|
622
|
+
Number,
|
|
623
|
+
String
|
|
624
|
+
],
|
|
625
|
+
required: false
|
|
626
|
+
},
|
|
627
|
+
roundedEndEnd: {
|
|
628
|
+
type: [
|
|
629
|
+
Boolean,
|
|
630
|
+
Number,
|
|
631
|
+
String
|
|
632
|
+
],
|
|
633
|
+
required: false
|
|
634
|
+
},
|
|
635
|
+
margin: {
|
|
636
|
+
type: [
|
|
637
|
+
Boolean,
|
|
638
|
+
Number,
|
|
639
|
+
String
|
|
640
|
+
],
|
|
641
|
+
required: false
|
|
642
|
+
},
|
|
643
|
+
marginTop: {
|
|
644
|
+
type: [
|
|
645
|
+
Boolean,
|
|
646
|
+
Number,
|
|
647
|
+
String
|
|
648
|
+
],
|
|
649
|
+
required: false
|
|
650
|
+
},
|
|
651
|
+
marginLeft: {
|
|
652
|
+
type: [
|
|
653
|
+
Boolean,
|
|
654
|
+
Number,
|
|
655
|
+
String
|
|
656
|
+
],
|
|
657
|
+
required: false
|
|
658
|
+
},
|
|
659
|
+
marginBottom: {
|
|
660
|
+
type: [
|
|
661
|
+
Boolean,
|
|
662
|
+
Number,
|
|
663
|
+
String
|
|
664
|
+
],
|
|
665
|
+
required: false
|
|
666
|
+
},
|
|
667
|
+
marginRight: {
|
|
668
|
+
type: [
|
|
669
|
+
Boolean,
|
|
670
|
+
Number,
|
|
671
|
+
String
|
|
672
|
+
],
|
|
673
|
+
required: false
|
|
674
|
+
},
|
|
675
|
+
marginBlock: {
|
|
676
|
+
type: [
|
|
677
|
+
Boolean,
|
|
678
|
+
Number,
|
|
679
|
+
String
|
|
680
|
+
],
|
|
681
|
+
required: false
|
|
682
|
+
},
|
|
683
|
+
marginInline: {
|
|
684
|
+
type: [
|
|
685
|
+
Boolean,
|
|
686
|
+
Number,
|
|
687
|
+
String
|
|
688
|
+
],
|
|
689
|
+
required: false
|
|
690
|
+
},
|
|
691
|
+
marginInlineStart: {
|
|
692
|
+
type: [
|
|
693
|
+
Boolean,
|
|
694
|
+
Number,
|
|
695
|
+
String
|
|
696
|
+
],
|
|
697
|
+
required: false
|
|
698
|
+
},
|
|
699
|
+
marginInlineEnd: {
|
|
700
|
+
type: [
|
|
701
|
+
Boolean,
|
|
702
|
+
Number,
|
|
703
|
+
String
|
|
704
|
+
],
|
|
705
|
+
required: false
|
|
706
|
+
},
|
|
707
|
+
marginBlockStart: {
|
|
708
|
+
type: [
|
|
709
|
+
Boolean,
|
|
710
|
+
Number,
|
|
711
|
+
String
|
|
712
|
+
],
|
|
713
|
+
required: false
|
|
714
|
+
},
|
|
715
|
+
marginBlockEnd: {
|
|
716
|
+
type: [
|
|
717
|
+
Boolean,
|
|
718
|
+
Number,
|
|
719
|
+
String
|
|
720
|
+
],
|
|
721
|
+
required: false
|
|
722
|
+
},
|
|
723
|
+
padding: {
|
|
724
|
+
type: [
|
|
725
|
+
Boolean,
|
|
726
|
+
Number,
|
|
727
|
+
String
|
|
728
|
+
],
|
|
729
|
+
required: false
|
|
730
|
+
},
|
|
731
|
+
paddingTop: {
|
|
732
|
+
type: [
|
|
733
|
+
Boolean,
|
|
734
|
+
Number,
|
|
735
|
+
String
|
|
736
|
+
],
|
|
737
|
+
required: false
|
|
738
|
+
},
|
|
739
|
+
paddingLeft: {
|
|
740
|
+
type: [
|
|
741
|
+
Boolean,
|
|
742
|
+
Number,
|
|
743
|
+
String
|
|
744
|
+
],
|
|
745
|
+
required: false
|
|
746
|
+
},
|
|
747
|
+
paddingBottom: {
|
|
748
|
+
type: [
|
|
749
|
+
Boolean,
|
|
750
|
+
Number,
|
|
751
|
+
String
|
|
752
|
+
],
|
|
753
|
+
required: false
|
|
754
|
+
},
|
|
755
|
+
paddingRight: {
|
|
756
|
+
type: [
|
|
757
|
+
Boolean,
|
|
758
|
+
Number,
|
|
759
|
+
String
|
|
760
|
+
],
|
|
761
|
+
required: false
|
|
762
|
+
},
|
|
763
|
+
paddingBlock: {
|
|
764
|
+
type: [
|
|
765
|
+
Boolean,
|
|
766
|
+
Number,
|
|
767
|
+
String
|
|
768
|
+
],
|
|
769
|
+
required: false
|
|
770
|
+
},
|
|
771
|
+
paddingInline: {
|
|
772
|
+
type: [
|
|
773
|
+
Boolean,
|
|
774
|
+
Number,
|
|
775
|
+
String
|
|
776
|
+
],
|
|
777
|
+
required: false
|
|
778
|
+
},
|
|
779
|
+
paddingInlineStart: {
|
|
780
|
+
type: [
|
|
781
|
+
Boolean,
|
|
782
|
+
Number,
|
|
783
|
+
String
|
|
784
|
+
],
|
|
785
|
+
required: false
|
|
786
|
+
},
|
|
787
|
+
paddingInlineEnd: {
|
|
788
|
+
type: [
|
|
789
|
+
Boolean,
|
|
790
|
+
Number,
|
|
791
|
+
String
|
|
792
|
+
],
|
|
793
|
+
required: false
|
|
794
|
+
},
|
|
795
|
+
paddingBlockStart: {
|
|
796
|
+
type: [
|
|
797
|
+
Boolean,
|
|
798
|
+
Number,
|
|
799
|
+
String
|
|
800
|
+
],
|
|
801
|
+
required: false
|
|
802
|
+
},
|
|
803
|
+
paddingBlockEnd: {
|
|
804
|
+
type: [
|
|
805
|
+
Boolean,
|
|
806
|
+
Number,
|
|
807
|
+
String
|
|
808
|
+
],
|
|
809
|
+
required: false
|
|
810
|
+
},
|
|
811
|
+
href: {
|
|
812
|
+
type: String,
|
|
813
|
+
required: false
|
|
814
|
+
},
|
|
815
|
+
replace: {
|
|
816
|
+
type: Boolean,
|
|
817
|
+
required: false
|
|
818
|
+
},
|
|
819
|
+
to: {
|
|
820
|
+
type: null,
|
|
821
|
+
required: false
|
|
822
|
+
},
|
|
823
|
+
exact: {
|
|
824
|
+
type: Boolean,
|
|
825
|
+
required: false
|
|
826
|
+
},
|
|
827
|
+
ripple: {
|
|
828
|
+
type: [Boolean, Object],
|
|
829
|
+
required: false,
|
|
830
|
+
default: true
|
|
831
|
+
},
|
|
832
|
+
appendAvatar: {
|
|
833
|
+
type: String,
|
|
834
|
+
required: false
|
|
835
|
+
},
|
|
836
|
+
appendIcon: {
|
|
837
|
+
type: null,
|
|
838
|
+
required: false
|
|
839
|
+
},
|
|
840
|
+
prependAvatar: {
|
|
841
|
+
type: String,
|
|
842
|
+
required: false
|
|
843
|
+
},
|
|
844
|
+
prependIcon: {
|
|
845
|
+
type: null,
|
|
846
|
+
required: false
|
|
847
|
+
},
|
|
848
|
+
prependAriaLabel: {
|
|
849
|
+
type: String,
|
|
850
|
+
required: false
|
|
851
|
+
},
|
|
852
|
+
appendAriaLabel: {
|
|
853
|
+
type: String,
|
|
854
|
+
required: false
|
|
855
|
+
},
|
|
856
|
+
active: {
|
|
857
|
+
type: [Boolean, Object],
|
|
858
|
+
required: false
|
|
859
|
+
},
|
|
860
|
+
activeClass: {
|
|
861
|
+
type: String,
|
|
862
|
+
required: false
|
|
863
|
+
},
|
|
864
|
+
hover: {
|
|
865
|
+
type: [Boolean, Object],
|
|
866
|
+
required: false
|
|
867
|
+
},
|
|
868
|
+
hoverClass: {
|
|
869
|
+
type: String,
|
|
870
|
+
required: false
|
|
871
|
+
}
|
|
319
872
|
});
|
|
320
|
-
defineEmits([
|
|
873
|
+
defineEmits([
|
|
874
|
+
"click:append",
|
|
875
|
+
"click:prepend",
|
|
876
|
+
"update:active",
|
|
877
|
+
"update:hover"
|
|
878
|
+
]);
|
|
321
879
|
defineSlots();
|
|
322
880
|
const { filterProps } = useProps(props);
|
|
323
881
|
const attrs = useAttrs();
|
|
324
882
|
const link = useLink(props, attrs);
|
|
325
883
|
const root = ref();
|
|
884
|
+
/*********************************************************
|
|
885
|
+
* Adjacent (prepend / append) & clickability
|
|
886
|
+
*
|
|
887
|
+
* @description
|
|
888
|
+
* Resolves prepend/append icons, click handlers and the
|
|
889
|
+
* clickable flag that enables ripple + overlay.
|
|
890
|
+
********************************************************/
|
|
891
|
+
// `useStateEffect` produces inline `color: …` / `background-color: …`
|
|
892
|
+
// declarations from intent props (`color`, `bgColor`) and also reacts
|
|
893
|
+
// to hover/active states by swapping in the `hover` / `active` object
|
|
894
|
+
// prop's `color` / `bgColor` overrides (or auto-darken via color-mix
|
|
895
|
+
// when no explicit override is provided).
|
|
896
|
+
//
|
|
897
|
+
// Pre-fix Card used `useBothColor` — the legacy composable — which
|
|
898
|
+
// is stateless: passing `<origam-card :hover="{ color: 'success' }">`
|
|
899
|
+
// was a silent no-op because the composable never saw `isHover.value`.
|
|
900
|
+
// We now wire `useStateFlag` (hover + active) so the resting / hover /
|
|
901
|
+
// pressed cycles cascade through the same intent system as Btn /
|
|
902
|
+
// BottomNav / Alert.
|
|
903
|
+
/*********************************************************
|
|
904
|
+
* Effect
|
|
905
|
+
********************************************************/
|
|
326
906
|
const { isOn: isHover, config: hoverState, classes: hoverClasses, set: onMouseenter, unset: onMouseleave } = useStateFlag(props, { state: "hover" });
|
|
327
907
|
const { isOn: isActive, config: activeState, classes: activeClasses, toggle: onActive } = useStateFlag(props, { state: "active" });
|
|
908
|
+
/*********************************************************
|
|
909
|
+
* Color
|
|
910
|
+
********************************************************/
|
|
911
|
+
// `useElevation` (inside `useStateEffect` below) treats `flat` as a hard
|
|
912
|
+
// "no shadow, ever" override of `elevation` — by design, for the case
|
|
913
|
+
// where a consumer sets BOTH props explicitly on the same instance.
|
|
914
|
+
// Since the ADR-005 resolver, `flat` can also resolve
|
|
915
|
+
// from `theme.components['origam-card'].flat` (the origam base theme
|
|
916
|
+
// defaults every card to `flat: true`) — so a consumer who explicitly
|
|
917
|
+
// passes only `elevation` (e.g. the free-form custom box-shadow escape
|
|
918
|
+
// hatch) had their explicit choice silently suppressed by the THEME's
|
|
919
|
+
// flat default, even though `elevation` itself correctly resolved via
|
|
920
|
+
// the resolver's own explicit-prop-wins precedence. `props.elevation` is
|
|
921
|
+
// non-null ONLY when a consumer explicitly sets it (the origam base
|
|
922
|
+
// theme never sets `elevation` on `origam-card`) — a reliable, low-risk
|
|
923
|
+
// signal to stop `flat` from suppressing that explicit choice, without
|
|
924
|
+
// touching the shared `useElevation`/`useStateEffect` composables used
|
|
925
|
+
// by other components. `origam-card--flat` (the visual/hover modifier
|
|
926
|
+
// class) is unaffected — only the value fed to useElevation's shadow
|
|
927
|
+
// suppression is adjusted.
|
|
328
928
|
const flatForElevation = computed(() => props.elevation != null ? false : props.flat);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
} =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
929
|
+
// Single state-aware composable for ALL 8 visual axes
|
|
930
|
+
// (color/bgColor/border/rounded/elevation/padding/margin/gap).
|
|
931
|
+
// Hover / active object overrides (e.g. `:hover="{ border: 'thick' }"`)
|
|
932
|
+
// flow through here uniformly; previously these axes were each
|
|
933
|
+
// resolved by their own per-axis composable AND missed the state
|
|
934
|
+
// swap entirely.
|
|
935
|
+
const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, elevationStyles, paddingClasses, paddingStyles, marginClasses, marginStyles } = useStateEffect(props, isHover, isActive, hoverState, activeState, computed(() => !!props.disabled), flatForElevation);
|
|
936
|
+
/*********************************************************
|
|
937
|
+
* Icon
|
|
938
|
+
********************************************************/
|
|
939
|
+
/*********************************************************
|
|
940
|
+
* Composables
|
|
941
|
+
********************************************************/
|
|
942
|
+
const { onClickPrepend: handleClickPrepend, onClickAppend: handleClickAppend, hasAppend, hasPrepend } = useAdjacent(props, toRef(props, "prependIcon"), toRef(props, "appendIcon"));
|
|
943
|
+
// `isClickable` drives the ripple, the `__overlay` element, the
|
|
944
|
+
// `--link` modifier class and the click-to-navigate bridge. It must be
|
|
945
|
+
// true whenever the card is interactive for any reason — i.e. when
|
|
946
|
+
// EITHER of the following holds:
|
|
947
|
+
// • `props.link` toggles explicit router-link mode
|
|
948
|
+
// • `link.isClickable.value` — useLink detects an `href`, a `to`,
|
|
949
|
+
// OR an `onClick` listener (on attrs or props)
|
|
950
|
+
//
|
|
951
|
+
// Unlike `OrigamChip` / `OrigamListItem`, Card has no group notion, so
|
|
952
|
+
// there is no `!!group` disjunct to carry over here.
|
|
953
|
+
//
|
|
954
|
+
// Pre-fix the chain was `… && props.link && (props.link || …)`. The
|
|
955
|
+
// middle `props.link` short-circuited the whole parenthesis to false
|
|
956
|
+
// whenever the consumer didn't opt into link mode, making
|
|
957
|
+
// `link.isClickable.value` dead code — an `href`-only card rendered as
|
|
958
|
+
// an `<a>` but stayed visually and behaviourally inert. Same repair as
|
|
959
|
+
// `OrigamListItem` and `OrigamChip` before it.
|
|
357
960
|
const isClickable = computed(() => {
|
|
358
|
-
|
|
961
|
+
return !props.disabled && (props.link || link.isClickable.value);
|
|
359
962
|
});
|
|
963
|
+
/*********************************************************
|
|
964
|
+
* isHoverable
|
|
965
|
+
*
|
|
966
|
+
* @description
|
|
967
|
+
* Gates whether `@mouseenter`/`@mouseleave` are even wired to the root
|
|
968
|
+
* element. Mirrors the guard the hand-rolled `origam-card--hover` class
|
|
969
|
+
* has always carried (`props.hover && !(props.disabled || props.flat)`)
|
|
970
|
+
* minus the `props.hover` check, since a real mouse hover — not just a
|
|
971
|
+
* forced `hover` prop — must also respect it.
|
|
972
|
+
*
|
|
973
|
+
* @description
|
|
974
|
+
* Before this, `onMouseenter`/`onMouseleave` (from `useStateFlag`) were
|
|
975
|
+
* bound unconditionally: a `flat` or `disabled` Card still flipped
|
|
976
|
+
* `isHover` to `true` on real mouse hover, which now that
|
|
977
|
+
* `useStateFlag`'s hover suffix resolves to a real `&--hover` rule
|
|
978
|
+
* (`--hover`, not the dead `--hovered`) painted `cursor:pointer` + a
|
|
979
|
+
* ripple overlay + `box-shadow-hover` on cards that were never meant to
|
|
980
|
+
* look interactive. This restores the original intent — a decorative
|
|
981
|
+
* Card stops reacting to hover — without duplicating the hand-rolled
|
|
982
|
+
* class's condition (see `cardClasses` below, still gated on
|
|
983
|
+
* `props.hover` specifically).
|
|
984
|
+
********************************************************/
|
|
360
985
|
const isHoverable = computed(() => {
|
|
361
|
-
|
|
986
|
+
return !props.disabled && !props.flat;
|
|
362
987
|
});
|
|
363
|
-
|
|
364
|
-
|
|
988
|
+
/*********************************************************
|
|
989
|
+
* mouseenterHandler / mouseleaveHandler
|
|
990
|
+
*
|
|
991
|
+
* @description
|
|
992
|
+
* Template-safe wrappers around `isHoverable` — keeps the conditional
|
|
993
|
+
* out of the `<template>` (repo convention: no expressions in event
|
|
994
|
+
* bindings). Binding `undefined` removes the native listener entirely
|
|
995
|
+
* (Vue's `patchEvent` treats a nullish handler as "no listener"), it
|
|
996
|
+
* does not merely no-op it.
|
|
997
|
+
********************************************************/
|
|
998
|
+
const mouseenterHandler = computed(() => isHoverable.value ? onMouseenter : undefined);
|
|
999
|
+
const mouseleaveHandler = computed(() => isHoverable.value ? onMouseleave : undefined);
|
|
1000
|
+
// Combined click handler — drives both `isActive` (so `activeColor`
|
|
1001
|
+
// / `activeBgColor` resolve via `useStateEffect`) and the link
|
|
1002
|
+
// navigation when the Card is interactive (`link` prop / clickable).
|
|
365
1003
|
const handleClick = (event) => {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
1004
|
+
onActive();
|
|
1005
|
+
if (isClickable.value && link.navigate) {
|
|
1006
|
+
link.navigate(event);
|
|
1007
|
+
}
|
|
370
1008
|
};
|
|
1009
|
+
/*********************************************************
|
|
1010
|
+
* cardRole / cardTabindex (#392)
|
|
1011
|
+
*
|
|
1012
|
+
* @description
|
|
1013
|
+
* A Card rendered with `href`/`to` is a native `<a>` — already
|
|
1014
|
+
* focusable, already announced as a link, `role="button"` on top of
|
|
1015
|
+
* that would misrepresent it. A Card made clickable only through a
|
|
1016
|
+
* `@click` listener or the `link` prop (no URL to navigate to) stays
|
|
1017
|
+
* a `<div>` (or `tag`): a `<button>` is not an option here because
|
|
1018
|
+
* it is phrasing content and cannot legally contain the flow content
|
|
1019
|
+
* a Card renders (header, image, footer slots, …) — the content
|
|
1020
|
+
* model rejects it outright, so ARIA is the only remaining option,
|
|
1021
|
+
* not a shortcut around the native element. `role="button"` +
|
|
1022
|
+
* `tabindex="0"` restore the semantics a native control would have
|
|
1023
|
+
* given for free.
|
|
1024
|
+
* @description
|
|
1025
|
+
* A purely decorative Card (`isClickable` false) must NOT become
|
|
1026
|
+
* focusable — the symmetric defect flagged in #392 alongside the
|
|
1027
|
+
* missing tabindex/role.
|
|
1028
|
+
********************************************************/
|
|
371
1029
|
const cardRole = computed(() => {
|
|
372
|
-
|
|
1030
|
+
return isClickable.value && !link.isLink.value ? "button" : undefined;
|
|
373
1031
|
});
|
|
374
1032
|
const cardTabindex = computed(() => {
|
|
375
|
-
|
|
376
|
-
|
|
1033
|
+
if (props.disabled) return -1;
|
|
1034
|
+
return isClickable.value && !link.isLink.value ? 0 : undefined;
|
|
377
1035
|
});
|
|
1036
|
+
/*********************************************************
|
|
1037
|
+
* handleKeydown (#392)
|
|
1038
|
+
*
|
|
1039
|
+
* @description
|
|
1040
|
+
* Native `<a href>` already activates on Enter and needs no help;
|
|
1041
|
+
* this handler only runs for the ARIA-button `<div>` path
|
|
1042
|
+
* (`isClickable && !link.isLink`). Enter AND Space both activate —
|
|
1043
|
+
* Space is prevented from scrolling the page, matching the WAI-ARIA
|
|
1044
|
+
* button pattern.
|
|
1045
|
+
* @description
|
|
1046
|
+
* Dispatches a real `click()` on the root element instead of
|
|
1047
|
+
* re-implementing the click behaviour here: Card never declares
|
|
1048
|
+
* `click` as its own emit (see `ICardEmits`), so a consumer's
|
|
1049
|
+
* `@click="fn"` reaches the root purely through Vue's automatic
|
|
1050
|
+
* `$attrs` fallthrough merge, not through anything this component's
|
|
1051
|
+
* script can call directly. A synthetic `click()` re-triggers that
|
|
1052
|
+
* exact same native event path — both `handleClick` and the
|
|
1053
|
+
* consumer's own listener — instead of guessing at how to invoke an
|
|
1054
|
+
* attrs-only handler by hand (same bridging pattern already used by
|
|
1055
|
+
* `OrigamFileField` / `OrigamSwitch`).
|
|
1056
|
+
********************************************************/
|
|
378
1057
|
const handleKeydown = (event) => {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
1058
|
+
if (!isClickable.value || link.isLink.value) return;
|
|
1059
|
+
if (event.key === KEYBOARD_VALUES.ENTER || event.key === " ") {
|
|
1060
|
+
event.preventDefault();
|
|
1061
|
+
root.value?.click();
|
|
1062
|
+
}
|
|
384
1063
|
};
|
|
1064
|
+
/*********************************************************
|
|
1065
|
+
* Loader
|
|
1066
|
+
*
|
|
1067
|
+
* @description
|
|
1068
|
+
* Controls the card loader slot and progress renderer.
|
|
1069
|
+
*
|
|
1070
|
+
* @description
|
|
1071
|
+
* `loadingText` is handed to the ACTIVE renderer's `label` prop in the
|
|
1072
|
+
* template — `<origam-skeleton>` and `<origam-progress>` both already
|
|
1073
|
+
* own the "locale key -> aria-label" wiring (`t(props.label)`, default
|
|
1074
|
+
* key `'origam.loading'`), so nothing is re-implemented here and the
|
|
1075
|
+
* default announcement stays the shared one. Bound BEFORE
|
|
1076
|
+
* `v-bind="loaderConfig.overrides"` so a per-instance
|
|
1077
|
+
* `loading="{ type, label }"` still wins.
|
|
1078
|
+
********************************************************/
|
|
385
1079
|
const { loaderClasses, loaderConfig } = useLoader(props, LOADER_KIND.LINE);
|
|
386
1080
|
const slots = useSlots();
|
|
1081
|
+
/*********************************************************
|
|
1082
|
+
* Skeleton silhouette
|
|
1083
|
+
*
|
|
1084
|
+
* @description
|
|
1085
|
+
* `loading="{ type: 'skeleton' }"` draws the card's own anatomy — media,
|
|
1086
|
+
* title, subtitle, two lines, actions — as light primitives inside ONE
|
|
1087
|
+
* `<OrigamSkeletonGroup>`: one announcement for the zone, one pulse
|
|
1088
|
+
* clock, no wrapper and no per-instance `<style>`. Only the parts the
|
|
1089
|
+
* card really has are drawn (media when there is an `image` / `#asset`,
|
|
1090
|
+
* actions when there is a `#footer`).
|
|
1091
|
+
********************************************************/
|
|
387
1092
|
const isSkeleton = computed(() => loaderConfig.value.isActive && loaderConfig.value.kind === LOADER_KIND.SKELETON);
|
|
388
1093
|
const skeletonOverrides = computed(() => splitSkeletonOverrides(loaderConfig.value.overrides, props.loadingText));
|
|
389
1094
|
const hasLoading = computed(() => {
|
|
390
|
-
|
|
1095
|
+
// `loaderConfig` is a `ComputedRef<IResolvedLoader>` from
|
|
1096
|
+
// `useLoader`. In `<script lang="ts" setup>` JS the ref must be unwrapped via
|
|
1097
|
+
// `.value` to read its fields — pre-fix this read `loaderConfig
|
|
1098
|
+
// .isActive` (a property of the Ref object itself, always
|
|
1099
|
+
// `undefined`) so `hasLoading` was permanently falsy and the
|
|
1100
|
+
// `<template v-if="hasLoading">` block — including the
|
|
1101
|
+
// `<origam-card__loader>` div with the linear/circular/skeleton
|
|
1102
|
+
// renderer — never mounted. The Card was visually marked
|
|
1103
|
+
// `origam-card--loading` (because `loaderClasses` does the
|
|
1104
|
+
// auto-unwrap correctly) yet rendered no loader, breaking the
|
|
1105
|
+
// "Loading shapes" e2e suite. Btn already uses the correct
|
|
1106
|
+
// `loaderConfig.value.isActive` form.
|
|
1107
|
+
return slots.loader || loaderConfig.value.isActive;
|
|
391
1108
|
});
|
|
1109
|
+
/*********************************************************
|
|
1110
|
+
* Slots
|
|
1111
|
+
*
|
|
1112
|
+
* @description
|
|
1113
|
+
* Computed flags controlling header, asset, text and
|
|
1114
|
+
* footer section rendering.
|
|
1115
|
+
********************************************************/
|
|
392
1116
|
const hasTitle = computed(() => {
|
|
393
|
-
|
|
1117
|
+
return slots["header.title"] || props.title != null;
|
|
394
1118
|
});
|
|
395
1119
|
const hasSubtitle = computed(() => {
|
|
396
|
-
|
|
1120
|
+
return slots["header.subtitle"] || props.subtitle != null;
|
|
397
1121
|
});
|
|
398
1122
|
const hasAsset = computed(() => {
|
|
399
|
-
|
|
1123
|
+
return !!(slots.asset || props.image);
|
|
400
1124
|
});
|
|
401
1125
|
const hasFooter = computed(() => {
|
|
402
|
-
|
|
1126
|
+
return slots.footer;
|
|
403
1127
|
});
|
|
404
1128
|
const hasHeader = computed(() => {
|
|
405
|
-
|
|
1129
|
+
return slots.header || hasTitle.value || hasSubtitle.value || hasPrepend.value || hasAppend.value;
|
|
406
1130
|
});
|
|
407
1131
|
const hasText = computed(() => {
|
|
408
|
-
|
|
1132
|
+
return slots.text || props.text != null;
|
|
409
1133
|
});
|
|
1134
|
+
/*********************************************************
|
|
1135
|
+
* Class & Style
|
|
1136
|
+
*
|
|
1137
|
+
* @description
|
|
1138
|
+
* Composes all border, color, elevation, loader and
|
|
1139
|
+
* layout classes/styles onto the root element.
|
|
1140
|
+
********************************************************/
|
|
410
1141
|
const { densityClasses } = useDensity(props);
|
|
411
1142
|
const { dimensionStyles } = useDimension(props);
|
|
412
1143
|
const { locationStyles } = useLocation(props);
|
|
413
1144
|
const { positionClasses } = usePosition(props);
|
|
1145
|
+
// border / rounded / elevation / padding / margin all come from
|
|
1146
|
+
// `useStateEffect` above — state-aware versions that honour
|
|
1147
|
+
// `:hover="{ … }"` / `:active="{ … }"` overrides.
|
|
414
1148
|
const cardStyles = computed(() => {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
1149
|
+
return [
|
|
1150
|
+
borderStyles.value,
|
|
1151
|
+
colorStyles.value,
|
|
1152
|
+
dimensionStyles.value,
|
|
1153
|
+
elevationStyles.value,
|
|
1154
|
+
locationStyles.value,
|
|
1155
|
+
roundedStyles.value,
|
|
1156
|
+
marginStyles.value,
|
|
1157
|
+
paddingStyles.value,
|
|
1158
|
+
props.style
|
|
1159
|
+
];
|
|
426
1160
|
});
|
|
427
|
-
|
|
1161
|
+
/*********************************************************
|
|
1162
|
+
* contentStyles
|
|
1163
|
+
*
|
|
1164
|
+
* @description
|
|
1165
|
+
* Instance-level `contentDisplay` rides INLINE on the wrapper itself, not as a custom property on the root.
|
|
1166
|
+
* A custom property would inherit into any Card nested in the slot and flatten its content too.
|
|
1167
|
+
********************************************************/
|
|
1168
|
+
const contentStyles = computed(() => props.contentDisplay ? { display: props.contentDisplay } : undefined);
|
|
428
1169
|
const cardProgressClasses = computed(() => {
|
|
429
|
-
|
|
430
|
-
"origam-card__progress",
|
|
431
|
-
`origam-card__progress--${loaderConfig.value.kind === "line" ? "linear" : loaderConfig.value.kind}`
|
|
432
|
-
];
|
|
1170
|
+
return ["origam-card__progress", `origam-card__progress--${loaderConfig.value.kind === "line" ? "linear" : loaderConfig.value.kind}`];
|
|
433
1171
|
});
|
|
434
1172
|
const cardClasses = computed(() => {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
1173
|
+
return [
|
|
1174
|
+
"origam-card",
|
|
1175
|
+
{
|
|
1176
|
+
"origam-card--disabled": props.disabled,
|
|
1177
|
+
"origam-card--flat": props.flat,
|
|
1178
|
+
"origam-card--hover": props.hover && !(props.disabled || props.flat),
|
|
1179
|
+
"origam-card--link": isClickable.value
|
|
1180
|
+
},
|
|
1181
|
+
borderClasses.value,
|
|
1182
|
+
colorClasses.value,
|
|
1183
|
+
densityClasses.value,
|
|
1184
|
+
elevationClasses.value,
|
|
1185
|
+
hoverClasses.value,
|
|
1186
|
+
activeClasses.value,
|
|
1187
|
+
loaderClasses.value,
|
|
1188
|
+
positionClasses.value,
|
|
1189
|
+
roundedClasses.value,
|
|
1190
|
+
marginClasses.value,
|
|
1191
|
+
paddingClasses.value,
|
|
1192
|
+
props.class
|
|
1193
|
+
];
|
|
456
1194
|
});
|
|
457
1195
|
const { id, css, load, isLoaded, unload } = useStyle(cardStyles, () => props.id);
|
|
1196
|
+
/*********************************************************
|
|
1197
|
+
* Expose
|
|
1198
|
+
*
|
|
1199
|
+
* @description
|
|
1200
|
+
* Public API surface: filterProps.
|
|
1201
|
+
********************************************************/
|
|
458
1202
|
defineExpose({
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
1203
|
+
filterProps,
|
|
1204
|
+
css,
|
|
1205
|
+
id,
|
|
1206
|
+
load,
|
|
1207
|
+
unload,
|
|
1208
|
+
isLoaded
|
|
465
1209
|
});
|
|
466
1210
|
</script>
|
|
467
1211
|
|