origam 2.38.0 → 2.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/src/assets/locales/en.json +1 -1
- package/dist/src/assets/locales/fr.json +2 -2
- package/dist/src/components/Alert/OrigamAlert.vue +739 -165
- package/dist/src/components/App/OrigamApp.vue +95 -19
- package/dist/src/components/App/OrigamAppBar.vue +751 -158
- package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
- package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
- package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
- package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
- package/dist/src/components/Badge/OrigamBadge.vue +548 -135
- package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
- package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
- package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
- package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
- package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
- package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
- package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
- package/dist/src/components/Btn/OrigamBtn.vue +928 -249
- package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
- package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
- package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
- package/dist/src/components/Card/OrigamCard.vue +938 -194
- package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
- package/dist/src/components/Card/OrigamCardText.vue +536 -84
- package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
- package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
- package/dist/src/components/Chart/OrigamChart.vue +942 -452
- package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
- package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
- package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
- package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
- package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
- package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
- package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
- package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
- package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
- package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
- package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
- package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
- package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
- package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
- package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
- package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
- package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
- package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
- package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
- package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
- package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
- package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
- package/dist/src/components/Chip/OrigamChip.vue +867 -202
- package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
- package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
- package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
- package/dist/src/components/Code/OrigamCode.vue +844 -206
- package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
- package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
- package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
- package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
- package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
- package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
- package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
- package/dist/src/components/Counter/OrigamCounter.vue +588 -96
- package/dist/src/components/DataList/OrigamDataList.vue +619 -113
- package/dist/src/components/DataList/OrigamDataText.vue +295 -65
- package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
- package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
- package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
- package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
- package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
- package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
- package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
- package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
- package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
- package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
- package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
- package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
- package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
- package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
- package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
- package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
- package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
- package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
- package/dist/src/components/Divider/OrigamDivider.vue +210 -50
- package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
- package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
- package/dist/src/components/Field/OrigamField.vue +1118 -306
- package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
- package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
- package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
- package/dist/src/components/Form/OrigamForm.vue +197 -74
- package/dist/src/components/Grid/OrigamGrid.vue +707 -147
- package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
- package/dist/src/components/Grids/OrigamCol.vue +593 -110
- package/dist/src/components/Grids/OrigamContainer.vue +461 -80
- package/dist/src/components/Grids/OrigamRow.vue +573 -112
- package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
- package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
- package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
- package/dist/src/components/Icon/OrigamIcon.vue +561 -98
- package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
- package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
- package/dist/src/components/Img/OrigamImg.vue +869 -228
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
- package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
- package/dist/src/components/Input/OrigamInput.vue +747 -180
- package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
- package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
- package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
- package/dist/src/components/Label/OrigamLabel.vue +584 -95
- package/dist/src/components/Layout/OrigamLayout.vue +563 -94
- package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
- package/dist/src/components/List/OrigamList.vue +755 -170
- package/dist/src/components/List/OrigamListChildren.vue +59 -19
- package/dist/src/components/List/OrigamListGroup.vue +631 -134
- package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
- package/dist/src/components/List/OrigamListItem.vue +890 -224
- package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
- package/dist/src/components/List/OrigamListSubheader.vue +542 -93
- package/dist/src/components/Loader/OrigamLoader.vue +110 -25
- package/dist/src/components/Main/OrigamMain.vue +565 -96
- package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
- package/dist/src/components/Media/OrigamMediaController.vue +465 -182
- package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
- package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
- package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
- package/dist/src/components/Messages/OrigamMessages.vue +606 -97
- package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
- package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
- package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
- package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
- package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
- package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
- package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
- package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
- package/dist/src/components/Picker/OrigamPicker.vue +655 -108
- package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
- package/dist/src/components/Progress/OrigamProgress.vue +436 -70
- package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
- package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
- package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
- package/dist/src/components/Radio/OrigamRadio.vue +772 -132
- package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
- package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
- package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
- package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
- package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
- package/dist/src/components/Select/OrigamSelect.vue +1639 -567
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
- package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
- package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
- package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
- package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
- package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
- package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
- package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
- package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
- package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
- package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
- package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
- package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
- package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
- package/dist/src/components/Table/OrigamTable.vue +585 -124
- package/dist/src/components/Tabs/OrigamTab.vue +239 -73
- package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
- package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
- package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
- package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
- package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
- package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
- package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
- package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
- package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
- package/dist/src/components/Title/OrigamTitle.vue +505 -82
- package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
- package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
- package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
- package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
- package/dist/src/components/Transition/OrigamFade.vue +47 -9
- package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
- package/dist/src/components/Transition/OrigamSnack.vue +52 -10
- package/dist/src/components/Transition/OrigamTransition.vue +40 -12
- package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
- package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
- package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
- package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
- package/dist/src/components/Video/OrigamVideo.vue +1178 -331
- package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
- package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
- package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
- package/dist/src/components/Window/OrigamWindow.vue +745 -175
- package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
- package/dist/src/composables/Commons/display.composable.cjs +2 -0
- package/dist/src/composables/Commons/display.composable.js +1 -1
- package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
- package/package.json +8 -8
|
@@ -154,259 +154,924 @@ import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
|
154
154
|
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
155
155
|
import { SIZES } from "../../enums/Commons/size.enum";
|
|
156
156
|
import { computed, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
157
|
+
/*********************************************************
|
|
158
|
+
* Global
|
|
159
|
+
*
|
|
160
|
+
* @description
|
|
161
|
+
* Props, emits, defaults propagation, group item and link
|
|
162
|
+
* bindings for the chip.
|
|
163
|
+
********************************************************/
|
|
157
164
|
const props = defineProps({
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
165
|
+
closable: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
closeIcon: {
|
|
170
|
+
type: null,
|
|
171
|
+
required: false,
|
|
172
|
+
default: MDI_ICONS.CLOSE_CIRCLE_OUTLINE
|
|
173
|
+
},
|
|
174
|
+
closeLabel: {
|
|
175
|
+
type: String,
|
|
176
|
+
required: false,
|
|
177
|
+
default: "origam.close"
|
|
178
|
+
},
|
|
179
|
+
draggable: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
required: false
|
|
182
|
+
},
|
|
183
|
+
filter: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
required: false
|
|
186
|
+
},
|
|
187
|
+
filterIcon: {
|
|
188
|
+
type: null,
|
|
189
|
+
required: false,
|
|
190
|
+
default: MDI_ICONS.CHECK
|
|
191
|
+
},
|
|
192
|
+
label: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
required: false
|
|
195
|
+
},
|
|
196
|
+
link: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
required: false
|
|
199
|
+
},
|
|
200
|
+
pill: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
required: false
|
|
203
|
+
},
|
|
204
|
+
text: {
|
|
205
|
+
type: String,
|
|
206
|
+
required: false
|
|
207
|
+
},
|
|
208
|
+
modelValue: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
required: false,
|
|
211
|
+
default: true
|
|
212
|
+
},
|
|
213
|
+
id: {
|
|
214
|
+
type: String,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
217
|
+
class: {
|
|
218
|
+
type: [
|
|
219
|
+
String,
|
|
220
|
+
Array,
|
|
221
|
+
Object
|
|
222
|
+
],
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
style: {
|
|
226
|
+
type: [
|
|
227
|
+
String,
|
|
228
|
+
Array,
|
|
229
|
+
Object,
|
|
230
|
+
Boolean,
|
|
231
|
+
null
|
|
232
|
+
],
|
|
233
|
+
required: false,
|
|
234
|
+
skipCheck: true
|
|
235
|
+
},
|
|
236
|
+
appendAvatar: {
|
|
237
|
+
type: String,
|
|
238
|
+
required: false
|
|
239
|
+
},
|
|
240
|
+
appendIcon: {
|
|
241
|
+
type: null,
|
|
242
|
+
required: false
|
|
243
|
+
},
|
|
244
|
+
prependAvatar: {
|
|
245
|
+
type: String,
|
|
246
|
+
required: false
|
|
247
|
+
},
|
|
248
|
+
prependIcon: {
|
|
249
|
+
type: null,
|
|
250
|
+
required: false
|
|
251
|
+
},
|
|
252
|
+
prependAriaLabel: {
|
|
253
|
+
type: String,
|
|
254
|
+
required: false
|
|
255
|
+
},
|
|
256
|
+
appendAriaLabel: {
|
|
257
|
+
type: String,
|
|
258
|
+
required: false
|
|
259
|
+
},
|
|
260
|
+
tag: {
|
|
261
|
+
type: String,
|
|
262
|
+
required: false,
|
|
263
|
+
default: "span"
|
|
264
|
+
},
|
|
265
|
+
color: {
|
|
266
|
+
type: [
|
|
267
|
+
String,
|
|
268
|
+
Object,
|
|
269
|
+
Boolean,
|
|
270
|
+
null
|
|
271
|
+
],
|
|
272
|
+
required: false,
|
|
273
|
+
skipCheck: true
|
|
274
|
+
},
|
|
275
|
+
bgColor: {
|
|
276
|
+
type: [
|
|
277
|
+
String,
|
|
278
|
+
Object,
|
|
279
|
+
Boolean,
|
|
280
|
+
null
|
|
281
|
+
],
|
|
282
|
+
required: false,
|
|
283
|
+
skipCheck: true
|
|
284
|
+
},
|
|
285
|
+
ripple: {
|
|
286
|
+
type: [Boolean, Object],
|
|
287
|
+
required: false
|
|
288
|
+
},
|
|
289
|
+
border: {
|
|
290
|
+
type: [
|
|
291
|
+
Boolean,
|
|
292
|
+
Number,
|
|
293
|
+
String,
|
|
294
|
+
Array
|
|
295
|
+
],
|
|
296
|
+
required: false,
|
|
297
|
+
skipCheck: true
|
|
298
|
+
},
|
|
299
|
+
borderTop: {
|
|
300
|
+
type: [
|
|
301
|
+
Boolean,
|
|
302
|
+
Number,
|
|
303
|
+
String
|
|
304
|
+
],
|
|
305
|
+
required: false
|
|
306
|
+
},
|
|
307
|
+
borderLeft: {
|
|
308
|
+
type: [
|
|
309
|
+
Boolean,
|
|
310
|
+
Number,
|
|
311
|
+
String
|
|
312
|
+
],
|
|
313
|
+
required: false
|
|
314
|
+
},
|
|
315
|
+
borderBottom: {
|
|
316
|
+
type: [
|
|
317
|
+
Boolean,
|
|
318
|
+
Number,
|
|
319
|
+
String
|
|
320
|
+
],
|
|
321
|
+
required: false
|
|
322
|
+
},
|
|
323
|
+
borderRight: {
|
|
324
|
+
type: [
|
|
325
|
+
Boolean,
|
|
326
|
+
Number,
|
|
327
|
+
String
|
|
328
|
+
],
|
|
329
|
+
required: false
|
|
330
|
+
},
|
|
331
|
+
borderBlock: {
|
|
332
|
+
type: [
|
|
333
|
+
Boolean,
|
|
334
|
+
Number,
|
|
335
|
+
String
|
|
336
|
+
],
|
|
337
|
+
required: false
|
|
338
|
+
},
|
|
339
|
+
borderInline: {
|
|
340
|
+
type: [
|
|
341
|
+
Boolean,
|
|
342
|
+
Number,
|
|
343
|
+
String
|
|
344
|
+
],
|
|
345
|
+
required: false
|
|
346
|
+
},
|
|
347
|
+
borderInlineStart: {
|
|
348
|
+
type: [
|
|
349
|
+
Boolean,
|
|
350
|
+
Number,
|
|
351
|
+
String
|
|
352
|
+
],
|
|
353
|
+
required: false
|
|
354
|
+
},
|
|
355
|
+
borderInlineEnd: {
|
|
356
|
+
type: [
|
|
357
|
+
Boolean,
|
|
358
|
+
Number,
|
|
359
|
+
String
|
|
360
|
+
],
|
|
361
|
+
required: false
|
|
362
|
+
},
|
|
363
|
+
borderBlockStart: {
|
|
364
|
+
type: [
|
|
365
|
+
Boolean,
|
|
366
|
+
Number,
|
|
367
|
+
String
|
|
368
|
+
],
|
|
369
|
+
required: false
|
|
370
|
+
},
|
|
371
|
+
borderBlockEnd: {
|
|
372
|
+
type: [
|
|
373
|
+
Boolean,
|
|
374
|
+
Number,
|
|
375
|
+
String
|
|
376
|
+
],
|
|
377
|
+
required: false
|
|
378
|
+
},
|
|
379
|
+
borderColor: {
|
|
380
|
+
type: String,
|
|
381
|
+
required: false
|
|
382
|
+
},
|
|
383
|
+
borderStyle: {
|
|
384
|
+
type: String,
|
|
385
|
+
required: false
|
|
386
|
+
},
|
|
387
|
+
borderTopColor: {
|
|
388
|
+
type: [
|
|
389
|
+
String,
|
|
390
|
+
Object,
|
|
391
|
+
Boolean,
|
|
392
|
+
null
|
|
393
|
+
],
|
|
394
|
+
required: false,
|
|
395
|
+
skipCheck: true
|
|
396
|
+
},
|
|
397
|
+
borderRightColor: {
|
|
398
|
+
type: [
|
|
399
|
+
String,
|
|
400
|
+
Object,
|
|
401
|
+
Boolean,
|
|
402
|
+
null
|
|
403
|
+
],
|
|
404
|
+
required: false,
|
|
405
|
+
skipCheck: true
|
|
406
|
+
},
|
|
407
|
+
borderBottomColor: {
|
|
408
|
+
type: [
|
|
409
|
+
String,
|
|
410
|
+
Object,
|
|
411
|
+
Boolean,
|
|
412
|
+
null
|
|
413
|
+
],
|
|
414
|
+
required: false,
|
|
415
|
+
skipCheck: true
|
|
416
|
+
},
|
|
417
|
+
borderLeftColor: {
|
|
418
|
+
type: [
|
|
419
|
+
String,
|
|
420
|
+
Object,
|
|
421
|
+
Boolean,
|
|
422
|
+
null
|
|
423
|
+
],
|
|
424
|
+
required: false,
|
|
425
|
+
skipCheck: true
|
|
426
|
+
},
|
|
427
|
+
borderInlineStartColor: {
|
|
428
|
+
type: [
|
|
429
|
+
String,
|
|
430
|
+
Object,
|
|
431
|
+
Boolean,
|
|
432
|
+
null
|
|
433
|
+
],
|
|
434
|
+
required: false,
|
|
435
|
+
skipCheck: true
|
|
436
|
+
},
|
|
437
|
+
borderInlineEndColor: {
|
|
438
|
+
type: [
|
|
439
|
+
String,
|
|
440
|
+
Object,
|
|
441
|
+
Boolean,
|
|
442
|
+
null
|
|
443
|
+
],
|
|
444
|
+
required: false,
|
|
445
|
+
skipCheck: true
|
|
446
|
+
},
|
|
447
|
+
borderBlockStartColor: {
|
|
448
|
+
type: [
|
|
449
|
+
String,
|
|
450
|
+
Object,
|
|
451
|
+
Boolean,
|
|
452
|
+
null
|
|
453
|
+
],
|
|
454
|
+
required: false,
|
|
455
|
+
skipCheck: true
|
|
456
|
+
},
|
|
457
|
+
borderBlockEndColor: {
|
|
458
|
+
type: [
|
|
459
|
+
String,
|
|
460
|
+
Object,
|
|
461
|
+
Boolean,
|
|
462
|
+
null
|
|
463
|
+
],
|
|
464
|
+
required: false,
|
|
465
|
+
skipCheck: true
|
|
466
|
+
},
|
|
467
|
+
rounded: {
|
|
468
|
+
type: [
|
|
469
|
+
Boolean,
|
|
470
|
+
Number,
|
|
471
|
+
String,
|
|
472
|
+
null
|
|
473
|
+
],
|
|
474
|
+
required: false,
|
|
475
|
+
skipCheck: true
|
|
476
|
+
},
|
|
477
|
+
roundedTopRight: {
|
|
478
|
+
type: [
|
|
479
|
+
Boolean,
|
|
480
|
+
Number,
|
|
481
|
+
String
|
|
482
|
+
],
|
|
483
|
+
required: false
|
|
484
|
+
},
|
|
485
|
+
roundedTopLeft: {
|
|
486
|
+
type: [
|
|
487
|
+
Boolean,
|
|
488
|
+
Number,
|
|
489
|
+
String
|
|
490
|
+
],
|
|
491
|
+
required: false
|
|
492
|
+
},
|
|
493
|
+
roundedBottomLeft: {
|
|
494
|
+
type: [
|
|
495
|
+
Boolean,
|
|
496
|
+
Number,
|
|
497
|
+
String
|
|
498
|
+
],
|
|
499
|
+
required: false
|
|
500
|
+
},
|
|
501
|
+
roundedBottomRight: {
|
|
502
|
+
type: [
|
|
503
|
+
Boolean,
|
|
504
|
+
Number,
|
|
505
|
+
String
|
|
506
|
+
],
|
|
507
|
+
required: false
|
|
508
|
+
},
|
|
509
|
+
roundedStartStart: {
|
|
510
|
+
type: [
|
|
511
|
+
Boolean,
|
|
512
|
+
Number,
|
|
513
|
+
String
|
|
514
|
+
],
|
|
515
|
+
required: false
|
|
516
|
+
},
|
|
517
|
+
roundedStartEnd: {
|
|
518
|
+
type: [
|
|
519
|
+
Boolean,
|
|
520
|
+
Number,
|
|
521
|
+
String
|
|
522
|
+
],
|
|
523
|
+
required: false
|
|
524
|
+
},
|
|
525
|
+
roundedEndStart: {
|
|
526
|
+
type: [
|
|
527
|
+
Boolean,
|
|
528
|
+
Number,
|
|
529
|
+
String
|
|
530
|
+
],
|
|
531
|
+
required: false
|
|
532
|
+
},
|
|
533
|
+
roundedEndEnd: {
|
|
534
|
+
type: [
|
|
535
|
+
Boolean,
|
|
536
|
+
Number,
|
|
537
|
+
String
|
|
538
|
+
],
|
|
539
|
+
required: false
|
|
540
|
+
},
|
|
541
|
+
padding: {
|
|
542
|
+
type: [
|
|
543
|
+
Boolean,
|
|
544
|
+
Number,
|
|
545
|
+
String
|
|
546
|
+
],
|
|
547
|
+
required: false
|
|
548
|
+
},
|
|
549
|
+
paddingTop: {
|
|
550
|
+
type: [
|
|
551
|
+
Boolean,
|
|
552
|
+
Number,
|
|
553
|
+
String
|
|
554
|
+
],
|
|
555
|
+
required: false
|
|
556
|
+
},
|
|
557
|
+
paddingLeft: {
|
|
558
|
+
type: [
|
|
559
|
+
Boolean,
|
|
560
|
+
Number,
|
|
561
|
+
String
|
|
562
|
+
],
|
|
563
|
+
required: false
|
|
564
|
+
},
|
|
565
|
+
paddingBottom: {
|
|
566
|
+
type: [
|
|
567
|
+
Boolean,
|
|
568
|
+
Number,
|
|
569
|
+
String
|
|
570
|
+
],
|
|
571
|
+
required: false
|
|
572
|
+
},
|
|
573
|
+
paddingRight: {
|
|
574
|
+
type: [
|
|
575
|
+
Boolean,
|
|
576
|
+
Number,
|
|
577
|
+
String
|
|
578
|
+
],
|
|
579
|
+
required: false
|
|
580
|
+
},
|
|
581
|
+
paddingBlock: {
|
|
582
|
+
type: [
|
|
583
|
+
Boolean,
|
|
584
|
+
Number,
|
|
585
|
+
String
|
|
586
|
+
],
|
|
587
|
+
required: false
|
|
588
|
+
},
|
|
589
|
+
paddingInline: {
|
|
590
|
+
type: [
|
|
591
|
+
Boolean,
|
|
592
|
+
Number,
|
|
593
|
+
String
|
|
594
|
+
],
|
|
595
|
+
required: false
|
|
596
|
+
},
|
|
597
|
+
paddingInlineStart: {
|
|
598
|
+
type: [
|
|
599
|
+
Boolean,
|
|
600
|
+
Number,
|
|
601
|
+
String
|
|
602
|
+
],
|
|
603
|
+
required: false
|
|
604
|
+
},
|
|
605
|
+
paddingInlineEnd: {
|
|
606
|
+
type: [
|
|
607
|
+
Boolean,
|
|
608
|
+
Number,
|
|
609
|
+
String
|
|
610
|
+
],
|
|
611
|
+
required: false
|
|
612
|
+
},
|
|
613
|
+
paddingBlockStart: {
|
|
614
|
+
type: [
|
|
615
|
+
Boolean,
|
|
616
|
+
Number,
|
|
617
|
+
String
|
|
618
|
+
],
|
|
619
|
+
required: false
|
|
620
|
+
},
|
|
621
|
+
paddingBlockEnd: {
|
|
622
|
+
type: [
|
|
623
|
+
Boolean,
|
|
624
|
+
Number,
|
|
625
|
+
String
|
|
626
|
+
],
|
|
627
|
+
required: false
|
|
628
|
+
},
|
|
629
|
+
margin: {
|
|
630
|
+
type: [
|
|
631
|
+
Boolean,
|
|
632
|
+
Number,
|
|
633
|
+
String
|
|
634
|
+
],
|
|
635
|
+
required: false
|
|
636
|
+
},
|
|
637
|
+
marginTop: {
|
|
638
|
+
type: [
|
|
639
|
+
Boolean,
|
|
640
|
+
Number,
|
|
641
|
+
String
|
|
642
|
+
],
|
|
643
|
+
required: false
|
|
644
|
+
},
|
|
645
|
+
marginLeft: {
|
|
646
|
+
type: [
|
|
647
|
+
Boolean,
|
|
648
|
+
Number,
|
|
649
|
+
String
|
|
650
|
+
],
|
|
651
|
+
required: false
|
|
652
|
+
},
|
|
653
|
+
marginBottom: {
|
|
654
|
+
type: [
|
|
655
|
+
Boolean,
|
|
656
|
+
Number,
|
|
657
|
+
String
|
|
658
|
+
],
|
|
659
|
+
required: false
|
|
660
|
+
},
|
|
661
|
+
marginRight: {
|
|
662
|
+
type: [
|
|
663
|
+
Boolean,
|
|
664
|
+
Number,
|
|
665
|
+
String
|
|
666
|
+
],
|
|
667
|
+
required: false
|
|
668
|
+
},
|
|
669
|
+
marginBlock: {
|
|
670
|
+
type: [
|
|
671
|
+
Boolean,
|
|
672
|
+
Number,
|
|
673
|
+
String
|
|
674
|
+
],
|
|
675
|
+
required: false
|
|
676
|
+
},
|
|
677
|
+
marginInline: {
|
|
678
|
+
type: [
|
|
679
|
+
Boolean,
|
|
680
|
+
Number,
|
|
681
|
+
String
|
|
682
|
+
],
|
|
683
|
+
required: false
|
|
684
|
+
},
|
|
685
|
+
marginInlineStart: {
|
|
686
|
+
type: [
|
|
687
|
+
Boolean,
|
|
688
|
+
Number,
|
|
689
|
+
String
|
|
690
|
+
],
|
|
691
|
+
required: false
|
|
692
|
+
},
|
|
693
|
+
marginInlineEnd: {
|
|
694
|
+
type: [
|
|
695
|
+
Boolean,
|
|
696
|
+
Number,
|
|
697
|
+
String
|
|
698
|
+
],
|
|
699
|
+
required: false
|
|
700
|
+
},
|
|
701
|
+
marginBlockStart: {
|
|
702
|
+
type: [
|
|
703
|
+
Boolean,
|
|
704
|
+
Number,
|
|
705
|
+
String
|
|
706
|
+
],
|
|
707
|
+
required: false
|
|
708
|
+
},
|
|
709
|
+
marginBlockEnd: {
|
|
710
|
+
type: [
|
|
711
|
+
Boolean,
|
|
712
|
+
Number,
|
|
713
|
+
String
|
|
714
|
+
],
|
|
715
|
+
required: false
|
|
716
|
+
},
|
|
717
|
+
density: {
|
|
718
|
+
type: null,
|
|
719
|
+
required: false
|
|
720
|
+
},
|
|
721
|
+
value: {
|
|
722
|
+
type: null,
|
|
723
|
+
required: false
|
|
724
|
+
},
|
|
725
|
+
disabled: {
|
|
726
|
+
type: Boolean,
|
|
727
|
+
required: false
|
|
728
|
+
},
|
|
729
|
+
selectedClass: {
|
|
730
|
+
type: String,
|
|
731
|
+
required: false
|
|
732
|
+
},
|
|
733
|
+
href: {
|
|
734
|
+
type: String,
|
|
735
|
+
required: false
|
|
736
|
+
},
|
|
737
|
+
replace: {
|
|
738
|
+
type: Boolean,
|
|
739
|
+
required: false
|
|
740
|
+
},
|
|
741
|
+
to: {
|
|
742
|
+
type: null,
|
|
743
|
+
required: false
|
|
744
|
+
},
|
|
745
|
+
exact: {
|
|
746
|
+
type: Boolean,
|
|
747
|
+
required: false
|
|
748
|
+
},
|
|
749
|
+
size: {
|
|
750
|
+
type: null,
|
|
751
|
+
required: false,
|
|
752
|
+
default: SIZES.DEFAULT
|
|
753
|
+
},
|
|
754
|
+
elevation: {
|
|
755
|
+
type: [Number, String],
|
|
756
|
+
required: false
|
|
757
|
+
},
|
|
758
|
+
active: {
|
|
759
|
+
type: [Boolean, Object],
|
|
760
|
+
required: false
|
|
761
|
+
},
|
|
762
|
+
activeClass: {
|
|
763
|
+
type: String,
|
|
764
|
+
required: false
|
|
765
|
+
},
|
|
766
|
+
hover: {
|
|
767
|
+
type: [Boolean, Object],
|
|
768
|
+
required: false
|
|
769
|
+
},
|
|
770
|
+
hoverClass: {
|
|
771
|
+
type: String,
|
|
772
|
+
required: false
|
|
773
|
+
},
|
|
774
|
+
fontFamily: {
|
|
775
|
+
type: null,
|
|
776
|
+
required: false
|
|
777
|
+
},
|
|
778
|
+
fontSize: {
|
|
779
|
+
type: null,
|
|
780
|
+
required: false
|
|
781
|
+
},
|
|
782
|
+
fontWeight: {
|
|
783
|
+
type: null,
|
|
784
|
+
required: false
|
|
785
|
+
},
|
|
786
|
+
letterSpacing: {
|
|
787
|
+
type: null,
|
|
788
|
+
required: false
|
|
789
|
+
},
|
|
790
|
+
textTransform: {
|
|
791
|
+
type: null,
|
|
792
|
+
required: false
|
|
793
|
+
}
|
|
253
794
|
});
|
|
254
|
-
const emits = defineEmits([
|
|
795
|
+
const emits = defineEmits([
|
|
796
|
+
"update:modelValue",
|
|
797
|
+
"click",
|
|
798
|
+
"click:close",
|
|
799
|
+
"click:append",
|
|
800
|
+
"click:prepend",
|
|
801
|
+
"group:selected"
|
|
802
|
+
]);
|
|
255
803
|
defineSlots();
|
|
256
804
|
const { filterProps } = useProps(props);
|
|
257
805
|
const { t } = useLocale();
|
|
258
806
|
const attrs = useAttrs();
|
|
259
807
|
const slots = useSlots();
|
|
808
|
+
/*********************************************************
|
|
809
|
+
* Composables
|
|
810
|
+
********************************************************/
|
|
260
811
|
const { densityClasses } = useDensity(props);
|
|
261
812
|
const { isOn: isHover, config: hoverState } = useStateFlag(props, { state: "hover" });
|
|
813
|
+
/*********************************************************
|
|
814
|
+
* active — decorative state-effect toggle (IActiveProps)
|
|
815
|
+
*
|
|
816
|
+
* @description
|
|
817
|
+
* `active` here is the DECORATIVE state-effect toggle from
|
|
818
|
+
* `IActiveProps` (forced highlight / color-bgColor-border-rounded-
|
|
819
|
+
* elevation override via an `IActiveState` config) — unrelated to
|
|
820
|
+
* `closeChip` below, which reads `modelValue` (source override) under
|
|
821
|
+
* the SAME `state: 'active'` label to drive dismiss/close, not this
|
|
822
|
+
* decorative surface. Named `active` (not `isActive`) so neither
|
|
823
|
+
* call's destructured names collide.
|
|
824
|
+
********************************************************/
|
|
262
825
|
const { isOn: active, config: activeState, classes: activeClasses } = useStateFlag(props, { state: "active" });
|
|
263
|
-
const {
|
|
264
|
-
colorClasses,
|
|
265
|
-
colorStyles,
|
|
266
|
-
borderClasses,
|
|
267
|
-
borderStyles,
|
|
268
|
-
roundedClasses,
|
|
269
|
-
roundedStyles,
|
|
270
|
-
elevationClasses,
|
|
271
|
-
paddingClasses,
|
|
272
|
-
paddingStyles,
|
|
273
|
-
marginClasses,
|
|
274
|
-
marginStyles
|
|
275
|
-
} = useStateEffect(props, isHover, active, hoverState, activeState);
|
|
826
|
+
const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses, roundedStyles, elevationClasses, paddingClasses, paddingStyles, marginClasses, marginStyles } = useStateEffect(props, isHover, active, hoverState, activeState);
|
|
276
827
|
const { sizeClasses, sizeStyles } = useSize(props);
|
|
277
828
|
const { typographyStyles } = useTypography(props, "chip");
|
|
278
|
-
|
|
829
|
+
// Phase 3 (Vague D) — class-first companion alongside inline styles.
|
|
830
|
+
/*********************************************************
|
|
831
|
+
* Color — porte par useStateEffect, PAS par useBothColor.
|
|
832
|
+
*
|
|
833
|
+
* @description
|
|
834
|
+
* useStateEffect etait deja appele juste au-dessus, mais on ne lui
|
|
835
|
+
* prenait que border / rounded / elevation / padding / margin : son
|
|
836
|
+
* canal COULEUR etait jete, et la couleur repassait par useBothColor,
|
|
837
|
+
* qui est statique. Consequence : les surcharges de couleur declarees
|
|
838
|
+
* dans la config d'etat (hover / active) ne peignaient jamais — le
|
|
839
|
+
* chip lisait props.color et props.bgColor bruts quoi qu'il arrive.
|
|
840
|
+
*
|
|
841
|
+
* @description
|
|
842
|
+
* On consomme desormais colorClasses / colorStyles du meme
|
|
843
|
+
* useStateEffect que les autres axes. Un seul canal, coherent avec
|
|
844
|
+
* border / rounded / elevation qui, eux, respectaient deja l'etat.
|
|
845
|
+
********************************************************/
|
|
846
|
+
/*********************************************************
|
|
847
|
+
* Value
|
|
848
|
+
********************************************************/
|
|
849
|
+
const { unset: closeChip } = useStateFlag(props, {
|
|
850
|
+
state: "active",
|
|
851
|
+
source: "modelValue"
|
|
852
|
+
});
|
|
279
853
|
const group = useGroupItem(props, ORIGAM_CHIP_GROUP_KEY, false);
|
|
280
854
|
const link = useLink(props, attrs);
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
855
|
+
/*********************************************************
|
|
856
|
+
* Icon
|
|
857
|
+
********************************************************/
|
|
858
|
+
const { onClickPrepend: handleClickPrepend, onClickAppend: handleClickAppend, onKeydownPrepend: handleKeydownPrepend, onKeydownAppend: handleKeydownAppend, isPrependClickable, isAppendClickable, hasPrepend, hasAppend } = useAdjacent(props, toRef(props, "prependIcon"), toRef(props, "appendIcon"));
|
|
859
|
+
/*********************************************************
|
|
860
|
+
* isPrependZoneFocusable / isAppendZoneFocusable
|
|
861
|
+
*
|
|
862
|
+
* @description
|
|
863
|
+
* issue #443 — root renders `<component :is="link.tag.value">`, which is
|
|
864
|
+
* `<a>` whenever `link.isLink` is true regardless of the `link` PROP
|
|
865
|
+
* (that prop only gates the chip's OWN `isLink` computed below, not the
|
|
866
|
+
* tag resolution). A <button>/<a> content model forbids any descendant
|
|
867
|
+
* with a `tabindex` attribute specified, so the prepend/append zone can
|
|
868
|
+
* only become its own tab stop when the root is NOT actually an <a>.
|
|
869
|
+
********************************************************/
|
|
291
870
|
const isPrependZoneFocusable = computed(() => isPrependClickable.value && !link.isLink.value);
|
|
292
871
|
const isAppendZoneFocusable = computed(() => isAppendClickable.value && !link.isLink.value);
|
|
872
|
+
/*********************************************************
|
|
873
|
+
* prependCommandAttrs / appendCommandAttrs — #747
|
|
874
|
+
*
|
|
875
|
+
* @description
|
|
876
|
+
* Built locally rather than taken from `useAdjacent`, because the gate
|
|
877
|
+
* is `isXxxZoneFocusable` (link-aware) and not raw clickability. The
|
|
878
|
+
* hook's own pair is never read here, so its lazy warning never fires
|
|
879
|
+
* twice for the same zone.
|
|
880
|
+
********************************************************/
|
|
293
881
|
const prependCommandAttrs = useAccessibleCommand({
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
882
|
+
component: "OrigamChip",
|
|
883
|
+
zone: "prepend",
|
|
884
|
+
prop: "prependAriaLabel",
|
|
885
|
+
active: isPrependZoneFocusable,
|
|
886
|
+
label: () => props.prependAriaLabel
|
|
299
887
|
});
|
|
300
888
|
const appendCommandAttrs = useAccessibleCommand({
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
889
|
+
component: "OrigamChip",
|
|
890
|
+
zone: "append",
|
|
891
|
+
prop: "appendAriaLabel",
|
|
892
|
+
active: isAppendZoneFocusable,
|
|
893
|
+
label: () => props.appendAriaLabel
|
|
306
894
|
});
|
|
895
|
+
/*********************************************************
|
|
896
|
+
* rootTag / typeAttr — issue #530 (a11y sweep)
|
|
897
|
+
*
|
|
898
|
+
* @description
|
|
899
|
+
* The root used to render whatever `useLink` resolved — `<a>` when
|
|
900
|
+
* linked, `<span>` (the `tag` default) otherwise — even when the chip
|
|
901
|
+
* was clickable. A clickable, non-link `<span>` carries no implicit
|
|
902
|
+
* role at all: nothing is announced to assistive tech beyond a bare
|
|
903
|
+
* tab stop, and any `type="button"` attribute a consumer forwarded
|
|
904
|
+
* (expecting button semantics) landed on the `<span>` as an INVALID
|
|
905
|
+
* attribute (axe: `aria-allowed-attr`, `type` is not allowed outside
|
|
906
|
+
* `<button>`/`<input>`/…).
|
|
907
|
+
*
|
|
908
|
+
* Root cause fix, not an attribute strip: when the chip is purely
|
|
909
|
+
* clickable — not a link, no close button, no focusable prepend/append
|
|
910
|
+
* zone — swap the DEFAULT `span` for a real `<button>`. `<button>` is
|
|
911
|
+
* *phrasing content that forbids interactive descendants* (no nested
|
|
912
|
+
* `<a>`/`<button>`/`tabindex` element), so the swap only happens when
|
|
913
|
+
* none of those descendants can exist: `hasClose` renders an
|
|
914
|
+
* `<origam-btn>` (a real `<button>`) inside, and a focusable
|
|
915
|
+
* prepend/append zone renders `tabindex="0"` — both would make a
|
|
916
|
+
* `<button>` root invalid content. An explicit non-default `tag` (e.g.
|
|
917
|
+
* a chip deliberately rendered as `li`) is left untouched — the
|
|
918
|
+
* upgrade only applies to the unstyled `span` default, never overrides
|
|
919
|
+
* a consumer's own semantic choice.
|
|
920
|
+
*
|
|
921
|
+
* @description
|
|
922
|
+
* `typeAttr` is hardcoded, not read off a prop — mirrors `OrigamBtn`'s
|
|
923
|
+
* own `typeAttr`: without it, a chip-as-button inside a `<form>` would
|
|
924
|
+
* default to `type="submit"` and submit the form on click.
|
|
925
|
+
********************************************************/
|
|
307
926
|
const isButtonSafe = computed(() => {
|
|
308
|
-
|
|
927
|
+
return props.tag === "span" && isClickable.value && !link.isLink.value && !hasClose.value && !isPrependZoneFocusable.value && !isAppendZoneFocusable.value;
|
|
309
928
|
});
|
|
310
929
|
const rootTag = computed(() => isButtonSafe.value ? "button" : link.tag.value);
|
|
311
|
-
const typeAttr = computed(() => rootTag.value === "button" ? "button" :
|
|
930
|
+
const typeAttr = computed(() => rootTag.value === "button" ? "button" : undefined);
|
|
312
931
|
const isLink = computed(() => {
|
|
313
|
-
|
|
932
|
+
return props.link && link.isLink.value;
|
|
314
933
|
});
|
|
934
|
+
// `props.link &&` used to gate the whole expression, which short-circuited
|
|
935
|
+
// the `!!group` disjunct into dead code: a chip inside an
|
|
936
|
+
// `<origam-chip-group>` was inert unless it ALSO carried `link`, so the
|
|
937
|
+
// group never emitted `update:modelValue`. Same shape as the repaired
|
|
938
|
+
// `OrigamListItem.isClickable` — a chip is clickable when it belongs to a
|
|
939
|
+
// group, when it opts in via `link`, or when `useLink` detects an `href` /
|
|
940
|
+
// `to` / a bound `click` listener.
|
|
315
941
|
const isClickable = computed(() => {
|
|
316
|
-
|
|
942
|
+
return !props.disabled && (!!group || props.link || link.isClickable.value);
|
|
317
943
|
});
|
|
318
944
|
const rippleProps = computed(() => {
|
|
319
|
-
|
|
945
|
+
return isClickable.value && props.ripple;
|
|
320
946
|
});
|
|
321
947
|
const isSelected = computed(() => {
|
|
322
|
-
|
|
948
|
+
return !group || group.isSelected.value;
|
|
323
949
|
});
|
|
324
950
|
const contentProps = computed(() => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
951
|
+
return {
|
|
952
|
+
isSelected: group?.isSelected.value,
|
|
953
|
+
selectedClass: group?.selectedClass.value,
|
|
954
|
+
select: group?.select,
|
|
955
|
+
toggle: group?.toggle,
|
|
956
|
+
value: group?.value.value,
|
|
957
|
+
disabled: props.disabled
|
|
958
|
+
};
|
|
333
959
|
});
|
|
334
960
|
const onClick = (e) => {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
961
|
+
emits("click", e);
|
|
962
|
+
if (!isClickable.value) return;
|
|
963
|
+
link.navigate?.(e);
|
|
964
|
+
group?.toggle();
|
|
339
965
|
};
|
|
966
|
+
/*********************************************************
|
|
967
|
+
* Event handlers
|
|
968
|
+
********************************************************/
|
|
340
969
|
const handleClickClose = (e) => {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
970
|
+
e.preventDefault();
|
|
971
|
+
e.stopPropagation();
|
|
972
|
+
closeChip();
|
|
973
|
+
emits("click:close", e);
|
|
345
974
|
};
|
|
346
975
|
const handleClick = (e) => {
|
|
347
|
-
|
|
976
|
+
onClick(e);
|
|
348
977
|
};
|
|
978
|
+
/*********************************************************
|
|
979
|
+
* handleKeydown (#439)
|
|
980
|
+
*
|
|
981
|
+
* @description
|
|
982
|
+
* `@keydown="isClickable && !isLink && handleKeydown"` used to compile
|
|
983
|
+
* to `$event => (cond && _ctx.handleKeydown)` — Vue's inline-statement
|
|
984
|
+
* form for anything more complex than a bare member expression. The
|
|
985
|
+
* expression EVALUATES `handleKeydown` (a function reference) and
|
|
986
|
+
* stops there; it never CALLS it.
|
|
987
|
+
* @description
|
|
988
|
+
* Root cause fixed at the binding (`@keydown="handleKeydown"`, the one
|
|
989
|
+
* form Vue auto-invokes with `$event`) — the guard moves in here,
|
|
990
|
+
* where wrapping it in `&&`/`?:` again can't silently undo the fix
|
|
991
|
+
* (see issue #439 / #397).
|
|
992
|
+
*
|
|
993
|
+
* @description
|
|
994
|
+
* #530 — also bails when `rootTag` resolved to a real `<button>`: it
|
|
995
|
+
* already activates on Enter/Space natively and fires its own `click`
|
|
996
|
+
* event, so re-firing `onClick` here would double-invoke every handler
|
|
997
|
+
* downstream. Verified empirically against a real browser (Chromium):
|
|
998
|
+
* pressing Enter then Space on the button-tagged "Events - click" chip
|
|
999
|
+
* produced exactly one `click` per key, not two.
|
|
1000
|
+
********************************************************/
|
|
349
1001
|
const handleKeydown = (e) => {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
1002
|
+
if (!isClickable.value || isLink.value || rootTag.value === "button") return;
|
|
1003
|
+
if (e.key === KEYBOARD_VALUES.ENTER || e.key === " ") {
|
|
1004
|
+
e.preventDefault();
|
|
1005
|
+
onClick(e);
|
|
1006
|
+
}
|
|
355
1007
|
};
|
|
1008
|
+
/*********************************************************
|
|
1009
|
+
* Slots
|
|
1010
|
+
*
|
|
1011
|
+
* @description
|
|
1012
|
+
* Computed flags for conditional close / filter rendering.
|
|
1013
|
+
********************************************************/
|
|
356
1014
|
const hasClose = computed(() => {
|
|
357
|
-
|
|
1015
|
+
return slots.close || props.closable;
|
|
358
1016
|
});
|
|
359
1017
|
const hasFilter = computed(() => {
|
|
360
|
-
|
|
1018
|
+
return (slots.filter || props.filter) && group;
|
|
361
1019
|
});
|
|
1020
|
+
/*********************************************************
|
|
1021
|
+
* Class & Style
|
|
1022
|
+
*
|
|
1023
|
+
* @description
|
|
1024
|
+
* Composes size, rounded, border, spacing and color styles.
|
|
1025
|
+
********************************************************/
|
|
362
1026
|
const chipStyles = computed(() => {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
1027
|
+
return [
|
|
1028
|
+
sizeStyles.value,
|
|
1029
|
+
roundedStyles.value,
|
|
1030
|
+
borderStyles.value,
|
|
1031
|
+
paddingStyles.value,
|
|
1032
|
+
marginStyles.value,
|
|
1033
|
+
colorStyles.value,
|
|
1034
|
+
typographyStyles.value,
|
|
1035
|
+
props.style
|
|
1036
|
+
];
|
|
373
1037
|
});
|
|
374
1038
|
const chipClasses = computed(() => {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
paddingClasses.value,
|
|
397
|
-
marginClasses.value,
|
|
398
|
-
activeClasses.value,
|
|
399
|
-
props.class
|
|
400
|
-
];
|
|
1039
|
+
return [
|
|
1040
|
+
"origam-chip",
|
|
1041
|
+
group?.selectedClass.value,
|
|
1042
|
+
{
|
|
1043
|
+
"origam-chip--disabled": props.disabled,
|
|
1044
|
+
"origam-chip--label": props.label,
|
|
1045
|
+
"origam-chip--link": isClickable.value,
|
|
1046
|
+
"origam-chip--filter": hasFilter.value,
|
|
1047
|
+
"origam-chip--pill": props.pill
|
|
1048
|
+
},
|
|
1049
|
+
colorClasses.value,
|
|
1050
|
+
borderClasses.value,
|
|
1051
|
+
roundedClasses.value,
|
|
1052
|
+
densityClasses.value,
|
|
1053
|
+
elevationClasses.value,
|
|
1054
|
+
sizeClasses.value,
|
|
1055
|
+
paddingClasses.value,
|
|
1056
|
+
marginClasses.value,
|
|
1057
|
+
activeClasses.value,
|
|
1058
|
+
props.class
|
|
1059
|
+
];
|
|
401
1060
|
});
|
|
402
1061
|
const { id, css, load, isLoaded, unload } = useStyle(chipStyles, () => props.id);
|
|
1062
|
+
/*********************************************************
|
|
1063
|
+
* Expose
|
|
1064
|
+
*
|
|
1065
|
+
* @description
|
|
1066
|
+
* Public API surface: filterProps.
|
|
1067
|
+
********************************************************/
|
|
403
1068
|
defineExpose({
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
1069
|
+
filterProps,
|
|
1070
|
+
css,
|
|
1071
|
+
id,
|
|
1072
|
+
load,
|
|
1073
|
+
unload,
|
|
1074
|
+
isLoaded
|
|
410
1075
|
});
|
|
411
1076
|
</script>
|
|
412
1077
|
|