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
|
@@ -143,207 +143,930 @@ import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
|
143
143
|
import { SIZES } from "../../enums/Commons/size.enum";
|
|
144
144
|
import { filterInputAttrs } from "../../utils/Input/input.util";
|
|
145
145
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
146
|
+
/*********************************************************
|
|
147
|
+
* Global
|
|
148
|
+
*
|
|
149
|
+
* @description
|
|
150
|
+
* Props, emits and composables.
|
|
151
|
+
********************************************************/
|
|
146
152
|
const props = defineProps({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
153
|
+
indeterminate: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
inset: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
id: {
|
|
162
|
+
type: String,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
class: {
|
|
166
|
+
type: [
|
|
167
|
+
String,
|
|
168
|
+
Array,
|
|
169
|
+
Object
|
|
170
|
+
],
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
style: {
|
|
174
|
+
type: [
|
|
175
|
+
String,
|
|
176
|
+
Array,
|
|
177
|
+
Object,
|
|
178
|
+
Boolean,
|
|
179
|
+
null
|
|
180
|
+
],
|
|
181
|
+
required: false,
|
|
182
|
+
skipCheck: true
|
|
183
|
+
},
|
|
184
|
+
tag: {
|
|
185
|
+
type: String,
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
padding: {
|
|
189
|
+
type: [
|
|
190
|
+
Boolean,
|
|
191
|
+
Number,
|
|
192
|
+
String
|
|
193
|
+
],
|
|
194
|
+
required: false
|
|
195
|
+
},
|
|
196
|
+
paddingTop: {
|
|
197
|
+
type: [
|
|
198
|
+
Boolean,
|
|
199
|
+
Number,
|
|
200
|
+
String
|
|
201
|
+
],
|
|
202
|
+
required: false
|
|
203
|
+
},
|
|
204
|
+
paddingLeft: {
|
|
205
|
+
type: [
|
|
206
|
+
Boolean,
|
|
207
|
+
Number,
|
|
208
|
+
String
|
|
209
|
+
],
|
|
210
|
+
required: false
|
|
211
|
+
},
|
|
212
|
+
paddingBottom: {
|
|
213
|
+
type: [
|
|
214
|
+
Boolean,
|
|
215
|
+
Number,
|
|
216
|
+
String
|
|
217
|
+
],
|
|
218
|
+
required: false
|
|
219
|
+
},
|
|
220
|
+
paddingRight: {
|
|
221
|
+
type: [
|
|
222
|
+
Boolean,
|
|
223
|
+
Number,
|
|
224
|
+
String
|
|
225
|
+
],
|
|
226
|
+
required: false
|
|
227
|
+
},
|
|
228
|
+
paddingBlock: {
|
|
229
|
+
type: [
|
|
230
|
+
Boolean,
|
|
231
|
+
Number,
|
|
232
|
+
String
|
|
233
|
+
],
|
|
234
|
+
required: false
|
|
235
|
+
},
|
|
236
|
+
paddingInline: {
|
|
237
|
+
type: [
|
|
238
|
+
Boolean,
|
|
239
|
+
Number,
|
|
240
|
+
String
|
|
241
|
+
],
|
|
242
|
+
required: false
|
|
243
|
+
},
|
|
244
|
+
paddingInlineStart: {
|
|
245
|
+
type: [
|
|
246
|
+
Boolean,
|
|
247
|
+
Number,
|
|
248
|
+
String
|
|
249
|
+
],
|
|
250
|
+
required: false
|
|
251
|
+
},
|
|
252
|
+
paddingInlineEnd: {
|
|
253
|
+
type: [
|
|
254
|
+
Boolean,
|
|
255
|
+
Number,
|
|
256
|
+
String
|
|
257
|
+
],
|
|
258
|
+
required: false
|
|
259
|
+
},
|
|
260
|
+
paddingBlockStart: {
|
|
261
|
+
type: [
|
|
262
|
+
Boolean,
|
|
263
|
+
Number,
|
|
264
|
+
String
|
|
265
|
+
],
|
|
266
|
+
required: false
|
|
267
|
+
},
|
|
268
|
+
paddingBlockEnd: {
|
|
269
|
+
type: [
|
|
270
|
+
Boolean,
|
|
271
|
+
Number,
|
|
272
|
+
String
|
|
273
|
+
],
|
|
274
|
+
required: false
|
|
275
|
+
},
|
|
276
|
+
margin: {
|
|
277
|
+
type: [
|
|
278
|
+
Boolean,
|
|
279
|
+
Number,
|
|
280
|
+
String
|
|
281
|
+
],
|
|
282
|
+
required: false
|
|
283
|
+
},
|
|
284
|
+
marginTop: {
|
|
285
|
+
type: [
|
|
286
|
+
Boolean,
|
|
287
|
+
Number,
|
|
288
|
+
String
|
|
289
|
+
],
|
|
290
|
+
required: false
|
|
291
|
+
},
|
|
292
|
+
marginLeft: {
|
|
293
|
+
type: [
|
|
294
|
+
Boolean,
|
|
295
|
+
Number,
|
|
296
|
+
String
|
|
297
|
+
],
|
|
298
|
+
required: false
|
|
299
|
+
},
|
|
300
|
+
marginBottom: {
|
|
301
|
+
type: [
|
|
302
|
+
Boolean,
|
|
303
|
+
Number,
|
|
304
|
+
String
|
|
305
|
+
],
|
|
306
|
+
required: false
|
|
307
|
+
},
|
|
308
|
+
marginRight: {
|
|
309
|
+
type: [
|
|
310
|
+
Boolean,
|
|
311
|
+
Number,
|
|
312
|
+
String
|
|
313
|
+
],
|
|
314
|
+
required: false
|
|
315
|
+
},
|
|
316
|
+
marginBlock: {
|
|
317
|
+
type: [
|
|
318
|
+
Boolean,
|
|
319
|
+
Number,
|
|
320
|
+
String
|
|
321
|
+
],
|
|
322
|
+
required: false
|
|
323
|
+
},
|
|
324
|
+
marginInline: {
|
|
325
|
+
type: [
|
|
326
|
+
Boolean,
|
|
327
|
+
Number,
|
|
328
|
+
String
|
|
329
|
+
],
|
|
330
|
+
required: false
|
|
331
|
+
},
|
|
332
|
+
marginInlineStart: {
|
|
333
|
+
type: [
|
|
334
|
+
Boolean,
|
|
335
|
+
Number,
|
|
336
|
+
String
|
|
337
|
+
],
|
|
338
|
+
required: false
|
|
339
|
+
},
|
|
340
|
+
marginInlineEnd: {
|
|
341
|
+
type: [
|
|
342
|
+
Boolean,
|
|
343
|
+
Number,
|
|
344
|
+
String
|
|
345
|
+
],
|
|
346
|
+
required: false
|
|
347
|
+
},
|
|
348
|
+
marginBlockStart: {
|
|
349
|
+
type: [
|
|
350
|
+
Boolean,
|
|
351
|
+
Number,
|
|
352
|
+
String
|
|
353
|
+
],
|
|
354
|
+
required: false
|
|
355
|
+
},
|
|
356
|
+
marginBlockEnd: {
|
|
357
|
+
type: [
|
|
358
|
+
Boolean,
|
|
359
|
+
Number,
|
|
360
|
+
String
|
|
361
|
+
],
|
|
362
|
+
required: false
|
|
363
|
+
},
|
|
364
|
+
border: {
|
|
365
|
+
type: [
|
|
366
|
+
Boolean,
|
|
367
|
+
Number,
|
|
368
|
+
String,
|
|
369
|
+
Array
|
|
370
|
+
],
|
|
371
|
+
required: false,
|
|
372
|
+
skipCheck: true
|
|
373
|
+
},
|
|
374
|
+
borderTop: {
|
|
375
|
+
type: [
|
|
376
|
+
Boolean,
|
|
377
|
+
Number,
|
|
378
|
+
String
|
|
379
|
+
],
|
|
380
|
+
required: false
|
|
381
|
+
},
|
|
382
|
+
borderLeft: {
|
|
383
|
+
type: [
|
|
384
|
+
Boolean,
|
|
385
|
+
Number,
|
|
386
|
+
String
|
|
387
|
+
],
|
|
388
|
+
required: false
|
|
389
|
+
},
|
|
390
|
+
borderBottom: {
|
|
391
|
+
type: [
|
|
392
|
+
Boolean,
|
|
393
|
+
Number,
|
|
394
|
+
String
|
|
395
|
+
],
|
|
396
|
+
required: false
|
|
397
|
+
},
|
|
398
|
+
borderRight: {
|
|
399
|
+
type: [
|
|
400
|
+
Boolean,
|
|
401
|
+
Number,
|
|
402
|
+
String
|
|
403
|
+
],
|
|
404
|
+
required: false
|
|
405
|
+
},
|
|
406
|
+
borderBlock: {
|
|
407
|
+
type: [
|
|
408
|
+
Boolean,
|
|
409
|
+
Number,
|
|
410
|
+
String
|
|
411
|
+
],
|
|
412
|
+
required: false
|
|
413
|
+
},
|
|
414
|
+
borderInline: {
|
|
415
|
+
type: [
|
|
416
|
+
Boolean,
|
|
417
|
+
Number,
|
|
418
|
+
String
|
|
419
|
+
],
|
|
420
|
+
required: false
|
|
421
|
+
},
|
|
422
|
+
borderInlineStart: {
|
|
423
|
+
type: [
|
|
424
|
+
Boolean,
|
|
425
|
+
Number,
|
|
426
|
+
String
|
|
427
|
+
],
|
|
428
|
+
required: false
|
|
429
|
+
},
|
|
430
|
+
borderInlineEnd: {
|
|
431
|
+
type: [
|
|
432
|
+
Boolean,
|
|
433
|
+
Number,
|
|
434
|
+
String
|
|
435
|
+
],
|
|
436
|
+
required: false
|
|
437
|
+
},
|
|
438
|
+
borderBlockStart: {
|
|
439
|
+
type: [
|
|
440
|
+
Boolean,
|
|
441
|
+
Number,
|
|
442
|
+
String
|
|
443
|
+
],
|
|
444
|
+
required: false
|
|
445
|
+
},
|
|
446
|
+
borderBlockEnd: {
|
|
447
|
+
type: [
|
|
448
|
+
Boolean,
|
|
449
|
+
Number,
|
|
450
|
+
String
|
|
451
|
+
],
|
|
452
|
+
required: false
|
|
453
|
+
},
|
|
454
|
+
borderColor: {
|
|
455
|
+
type: String,
|
|
456
|
+
required: false
|
|
457
|
+
},
|
|
458
|
+
borderStyle: {
|
|
459
|
+
type: String,
|
|
460
|
+
required: false
|
|
461
|
+
},
|
|
462
|
+
borderTopColor: {
|
|
463
|
+
type: [
|
|
464
|
+
String,
|
|
465
|
+
Object,
|
|
466
|
+
Boolean,
|
|
467
|
+
null
|
|
468
|
+
],
|
|
469
|
+
required: false,
|
|
470
|
+
skipCheck: true
|
|
471
|
+
},
|
|
472
|
+
borderRightColor: {
|
|
473
|
+
type: [
|
|
474
|
+
String,
|
|
475
|
+
Object,
|
|
476
|
+
Boolean,
|
|
477
|
+
null
|
|
478
|
+
],
|
|
479
|
+
required: false,
|
|
480
|
+
skipCheck: true
|
|
481
|
+
},
|
|
482
|
+
borderBottomColor: {
|
|
483
|
+
type: [
|
|
484
|
+
String,
|
|
485
|
+
Object,
|
|
486
|
+
Boolean,
|
|
487
|
+
null
|
|
488
|
+
],
|
|
489
|
+
required: false,
|
|
490
|
+
skipCheck: true
|
|
491
|
+
},
|
|
492
|
+
borderLeftColor: {
|
|
493
|
+
type: [
|
|
494
|
+
String,
|
|
495
|
+
Object,
|
|
496
|
+
Boolean,
|
|
497
|
+
null
|
|
498
|
+
],
|
|
499
|
+
required: false,
|
|
500
|
+
skipCheck: true
|
|
501
|
+
},
|
|
502
|
+
borderInlineStartColor: {
|
|
503
|
+
type: [
|
|
504
|
+
String,
|
|
505
|
+
Object,
|
|
506
|
+
Boolean,
|
|
507
|
+
null
|
|
508
|
+
],
|
|
509
|
+
required: false,
|
|
510
|
+
skipCheck: true
|
|
511
|
+
},
|
|
512
|
+
borderInlineEndColor: {
|
|
513
|
+
type: [
|
|
514
|
+
String,
|
|
515
|
+
Object,
|
|
516
|
+
Boolean,
|
|
517
|
+
null
|
|
518
|
+
],
|
|
519
|
+
required: false,
|
|
520
|
+
skipCheck: true
|
|
521
|
+
},
|
|
522
|
+
borderBlockStartColor: {
|
|
523
|
+
type: [
|
|
524
|
+
String,
|
|
525
|
+
Object,
|
|
526
|
+
Boolean,
|
|
527
|
+
null
|
|
528
|
+
],
|
|
529
|
+
required: false,
|
|
530
|
+
skipCheck: true
|
|
531
|
+
},
|
|
532
|
+
borderBlockEndColor: {
|
|
533
|
+
type: [
|
|
534
|
+
String,
|
|
535
|
+
Object,
|
|
536
|
+
Boolean,
|
|
537
|
+
null
|
|
538
|
+
],
|
|
539
|
+
required: false,
|
|
540
|
+
skipCheck: true
|
|
541
|
+
},
|
|
542
|
+
rounded: {
|
|
543
|
+
type: [
|
|
544
|
+
Boolean,
|
|
545
|
+
Number,
|
|
546
|
+
String,
|
|
547
|
+
null
|
|
548
|
+
],
|
|
549
|
+
required: false,
|
|
550
|
+
skipCheck: true
|
|
551
|
+
},
|
|
552
|
+
roundedTopRight: {
|
|
553
|
+
type: [
|
|
554
|
+
Boolean,
|
|
555
|
+
Number,
|
|
556
|
+
String
|
|
557
|
+
],
|
|
558
|
+
required: false
|
|
559
|
+
},
|
|
560
|
+
roundedTopLeft: {
|
|
561
|
+
type: [
|
|
562
|
+
Boolean,
|
|
563
|
+
Number,
|
|
564
|
+
String
|
|
565
|
+
],
|
|
566
|
+
required: false
|
|
567
|
+
},
|
|
568
|
+
roundedBottomLeft: {
|
|
569
|
+
type: [
|
|
570
|
+
Boolean,
|
|
571
|
+
Number,
|
|
572
|
+
String
|
|
573
|
+
],
|
|
574
|
+
required: false
|
|
575
|
+
},
|
|
576
|
+
roundedBottomRight: {
|
|
577
|
+
type: [
|
|
578
|
+
Boolean,
|
|
579
|
+
Number,
|
|
580
|
+
String
|
|
581
|
+
],
|
|
582
|
+
required: false
|
|
583
|
+
},
|
|
584
|
+
roundedStartStart: {
|
|
585
|
+
type: [
|
|
586
|
+
Boolean,
|
|
587
|
+
Number,
|
|
588
|
+
String
|
|
589
|
+
],
|
|
590
|
+
required: false
|
|
591
|
+
},
|
|
592
|
+
roundedStartEnd: {
|
|
593
|
+
type: [
|
|
594
|
+
Boolean,
|
|
595
|
+
Number,
|
|
596
|
+
String
|
|
597
|
+
],
|
|
598
|
+
required: false
|
|
599
|
+
},
|
|
600
|
+
roundedEndStart: {
|
|
601
|
+
type: [
|
|
602
|
+
Boolean,
|
|
603
|
+
Number,
|
|
604
|
+
String
|
|
605
|
+
],
|
|
606
|
+
required: false
|
|
607
|
+
},
|
|
608
|
+
roundedEndEnd: {
|
|
609
|
+
type: [
|
|
610
|
+
Boolean,
|
|
611
|
+
Number,
|
|
612
|
+
String
|
|
613
|
+
],
|
|
614
|
+
required: false
|
|
615
|
+
},
|
|
616
|
+
centerAffix: {
|
|
617
|
+
type: Boolean,
|
|
618
|
+
required: false,
|
|
619
|
+
default: true
|
|
620
|
+
},
|
|
621
|
+
hideDetails: {
|
|
622
|
+
type: [Boolean, String],
|
|
623
|
+
required: false
|
|
624
|
+
},
|
|
625
|
+
hideSpinButtons: {
|
|
626
|
+
type: Boolean,
|
|
627
|
+
required: false
|
|
628
|
+
},
|
|
629
|
+
hint: {
|
|
630
|
+
type: String,
|
|
631
|
+
required: false
|
|
632
|
+
},
|
|
633
|
+
persistentHint: {
|
|
634
|
+
type: Boolean,
|
|
635
|
+
required: false
|
|
636
|
+
},
|
|
637
|
+
messages: {
|
|
638
|
+
type: [Array, String],
|
|
639
|
+
required: false
|
|
640
|
+
},
|
|
641
|
+
density: {
|
|
642
|
+
type: null,
|
|
643
|
+
required: false,
|
|
644
|
+
default: DENSITY.DEFAULT
|
|
645
|
+
},
|
|
646
|
+
color: {
|
|
647
|
+
type: [
|
|
648
|
+
String,
|
|
649
|
+
Object,
|
|
650
|
+
Boolean,
|
|
651
|
+
null
|
|
652
|
+
],
|
|
653
|
+
required: false,
|
|
654
|
+
skipCheck: true
|
|
655
|
+
},
|
|
656
|
+
bgColor: {
|
|
657
|
+
type: [
|
|
658
|
+
String,
|
|
659
|
+
Object,
|
|
660
|
+
Boolean,
|
|
661
|
+
null
|
|
662
|
+
],
|
|
663
|
+
required: false,
|
|
664
|
+
skipCheck: true
|
|
665
|
+
},
|
|
666
|
+
elevation: {
|
|
667
|
+
type: [Number, String],
|
|
668
|
+
required: false
|
|
669
|
+
},
|
|
670
|
+
height: {
|
|
671
|
+
type: [Number, String],
|
|
672
|
+
required: false
|
|
673
|
+
},
|
|
674
|
+
maxHeight: {
|
|
675
|
+
type: [Number, String],
|
|
676
|
+
required: false
|
|
677
|
+
},
|
|
678
|
+
maxWidth: {
|
|
679
|
+
type: [Number, String],
|
|
680
|
+
required: false
|
|
681
|
+
},
|
|
682
|
+
minHeight: {
|
|
683
|
+
type: [Number, String],
|
|
684
|
+
required: false
|
|
685
|
+
},
|
|
686
|
+
minWidth: {
|
|
687
|
+
type: [Number, String],
|
|
688
|
+
required: false
|
|
689
|
+
},
|
|
690
|
+
width: {
|
|
691
|
+
type: [Number, String],
|
|
692
|
+
required: false
|
|
693
|
+
},
|
|
694
|
+
direction: {
|
|
695
|
+
type: null,
|
|
696
|
+
required: false
|
|
697
|
+
},
|
|
698
|
+
disabled: {
|
|
699
|
+
type: Boolean,
|
|
700
|
+
required: false
|
|
701
|
+
},
|
|
702
|
+
error: {
|
|
703
|
+
type: [String, Boolean],
|
|
704
|
+
required: false
|
|
705
|
+
},
|
|
706
|
+
errorMessages: {
|
|
707
|
+
type: [Array, String],
|
|
708
|
+
required: false
|
|
709
|
+
},
|
|
710
|
+
maxErrors: {
|
|
711
|
+
type: [Number, String],
|
|
712
|
+
required: false
|
|
713
|
+
},
|
|
714
|
+
name: {
|
|
715
|
+
type: String,
|
|
716
|
+
required: false
|
|
717
|
+
},
|
|
718
|
+
readonly: {
|
|
719
|
+
type: Boolean,
|
|
720
|
+
required: false
|
|
721
|
+
},
|
|
722
|
+
rules: {
|
|
723
|
+
type: Array,
|
|
724
|
+
required: false
|
|
725
|
+
},
|
|
726
|
+
modelValue: {
|
|
727
|
+
type: null,
|
|
728
|
+
required: false
|
|
729
|
+
},
|
|
730
|
+
validateOn: {
|
|
731
|
+
type: null,
|
|
732
|
+
required: false
|
|
733
|
+
},
|
|
734
|
+
validationValue: {
|
|
735
|
+
type: null,
|
|
736
|
+
required: false
|
|
737
|
+
},
|
|
738
|
+
focused: {
|
|
739
|
+
type: Boolean,
|
|
740
|
+
required: false
|
|
741
|
+
},
|
|
742
|
+
appendAvatar: {
|
|
743
|
+
type: String,
|
|
744
|
+
required: false
|
|
745
|
+
},
|
|
746
|
+
appendIcon: {
|
|
747
|
+
type: null,
|
|
748
|
+
required: false
|
|
749
|
+
},
|
|
750
|
+
prependAvatar: {
|
|
751
|
+
type: String,
|
|
752
|
+
required: false
|
|
753
|
+
},
|
|
754
|
+
prependIcon: {
|
|
755
|
+
type: null,
|
|
756
|
+
required: false
|
|
757
|
+
},
|
|
758
|
+
prependAriaLabel: {
|
|
759
|
+
type: String,
|
|
760
|
+
required: false
|
|
761
|
+
},
|
|
762
|
+
appendAriaLabel: {
|
|
763
|
+
type: String,
|
|
764
|
+
required: false
|
|
765
|
+
},
|
|
766
|
+
size: {
|
|
767
|
+
type: null,
|
|
768
|
+
required: false
|
|
769
|
+
},
|
|
770
|
+
fontSize: {
|
|
771
|
+
type: null,
|
|
772
|
+
required: false
|
|
773
|
+
},
|
|
774
|
+
fontWeight: {
|
|
775
|
+
type: null,
|
|
776
|
+
required: false
|
|
777
|
+
},
|
|
778
|
+
lineHeight: {
|
|
779
|
+
type: null,
|
|
780
|
+
required: false
|
|
781
|
+
},
|
|
782
|
+
label: {
|
|
783
|
+
type: String,
|
|
784
|
+
required: false
|
|
785
|
+
},
|
|
786
|
+
trueValue: {
|
|
787
|
+
type: null,
|
|
788
|
+
required: false
|
|
789
|
+
},
|
|
790
|
+
falseValue: {
|
|
791
|
+
type: null,
|
|
792
|
+
required: false
|
|
793
|
+
},
|
|
794
|
+
value: {
|
|
795
|
+
type: null,
|
|
796
|
+
required: false
|
|
797
|
+
},
|
|
798
|
+
required: {
|
|
799
|
+
type: Boolean,
|
|
800
|
+
required: false
|
|
801
|
+
},
|
|
802
|
+
type: {
|
|
803
|
+
type: String,
|
|
804
|
+
required: false
|
|
805
|
+
},
|
|
806
|
+
valueComparator: {
|
|
807
|
+
type: Function,
|
|
808
|
+
required: false
|
|
809
|
+
},
|
|
810
|
+
falseIcon: {
|
|
811
|
+
type: null,
|
|
812
|
+
required: false
|
|
813
|
+
},
|
|
814
|
+
trueIcon: {
|
|
815
|
+
type: null,
|
|
816
|
+
required: false
|
|
817
|
+
},
|
|
818
|
+
multiple: {
|
|
819
|
+
type: Boolean,
|
|
820
|
+
required: false
|
|
821
|
+
},
|
|
822
|
+
inline: {
|
|
823
|
+
type: Boolean,
|
|
824
|
+
required: false
|
|
825
|
+
},
|
|
826
|
+
hover: {
|
|
827
|
+
type: [Boolean, Object],
|
|
828
|
+
required: false
|
|
829
|
+
},
|
|
830
|
+
hoverClass: {
|
|
831
|
+
type: String,
|
|
832
|
+
required: false
|
|
833
|
+
},
|
|
834
|
+
ripple: {
|
|
835
|
+
type: [Boolean, Object],
|
|
836
|
+
required: false
|
|
837
|
+
},
|
|
838
|
+
loading: {
|
|
839
|
+
type: [
|
|
840
|
+
Boolean,
|
|
841
|
+
Number,
|
|
842
|
+
Object
|
|
843
|
+
],
|
|
844
|
+
required: false
|
|
845
|
+
},
|
|
846
|
+
loadingText: {
|
|
847
|
+
type: String,
|
|
848
|
+
required: false
|
|
849
|
+
},
|
|
850
|
+
active: {
|
|
851
|
+
type: [Boolean, Object],
|
|
852
|
+
required: false
|
|
853
|
+
},
|
|
854
|
+
activeClass: {
|
|
855
|
+
type: String,
|
|
856
|
+
required: false
|
|
857
|
+
}
|
|
261
858
|
});
|
|
262
|
-
const emits = defineEmits([
|
|
859
|
+
const emits = defineEmits([
|
|
860
|
+
"update:modelValue",
|
|
861
|
+
"update:focused",
|
|
862
|
+
"update:indeterminate",
|
|
863
|
+
"click:label"
|
|
864
|
+
]);
|
|
263
865
|
defineSlots();
|
|
264
866
|
const { isOn: isHover, config: hoverState } = useStateFlag(props, { state: "hover" });
|
|
265
|
-
useStateEffect(props, isHover,
|
|
867
|
+
useStateEffect(props, isHover, undefined, hoverState, undefined);
|
|
266
868
|
const { filterProps } = useProps(props);
|
|
267
869
|
const origamSelectionControlRef = ref();
|
|
268
870
|
const origamInputRef = ref();
|
|
269
871
|
const origamSwitchTrackRef = ref();
|
|
872
|
+
/*********************************************************
|
|
873
|
+
* Value
|
|
874
|
+
*
|
|
875
|
+
* @description
|
|
876
|
+
* Model binding, indeterminate state and focus handling.
|
|
877
|
+
********************************************************/
|
|
270
878
|
const indeterminate = useVModel(props, "indeterminate");
|
|
271
879
|
const model = useVModel(props, "modelValue");
|
|
880
|
+
/*********************************************************
|
|
881
|
+
* Effect
|
|
882
|
+
********************************************************/
|
|
272
883
|
const { isFocused, onFocus: handleFocus, onBlur: handleBlur } = useFocus(props);
|
|
273
884
|
const attrs = useAttrs();
|
|
274
885
|
const slots = useSlots();
|
|
275
886
|
const { loaderClasses, loaderConfig } = useLoader(props, LOADER_KIND.CIRCULAR);
|
|
276
887
|
const uid = getUid();
|
|
277
888
|
const id = computed(() => {
|
|
278
|
-
|
|
889
|
+
return props.id || `switch-${uid}`;
|
|
279
890
|
});
|
|
891
|
+
/*********************************************************
|
|
892
|
+
* Event handlers
|
|
893
|
+
*
|
|
894
|
+
* @description
|
|
895
|
+
* Change and track-click handlers.
|
|
896
|
+
********************************************************/
|
|
280
897
|
const handleChange = () => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
898
|
+
if (indeterminate.value) {
|
|
899
|
+
indeterminate.value = false;
|
|
900
|
+
}
|
|
284
901
|
};
|
|
902
|
+
/*********************************************************
|
|
903
|
+
* Label click forwarded up — mirrors OrigamRadioBtn/OrigamRadio.
|
|
904
|
+
*
|
|
905
|
+
* @description
|
|
906
|
+
* `ISwitchEmits` extends `IClickLabelEmits`, but nothing ever wired
|
|
907
|
+
* `<origam-selection-control>`'s own `click:label` (fired from the
|
|
908
|
+
* native `<label>` click, see `OrigamSelectionControl.vue`) up to this
|
|
909
|
+
* component — the declaration was dead: consumers binding
|
|
910
|
+
* `@click:label` on `<origam-switch>` never received anything (LOT 3,
|
|
911
|
+
* unemitted-declarations guard).
|
|
912
|
+
********************************************************/
|
|
285
913
|
const handleClickLabel = (e) => {
|
|
286
|
-
|
|
914
|
+
emits("click:label", e);
|
|
287
915
|
};
|
|
288
916
|
const handleTrackClick = (_e) => {
|
|
289
|
-
|
|
290
|
-
|
|
917
|
+
// `OrigamSwitchTrack` already calls `stopPropagation` /
|
|
918
|
+
// `preventDefault` on the native event before emitting — we just
|
|
919
|
+
// need to forward the click to the hidden `<input>` so the
|
|
920
|
+
// SelectionControl picks it up and toggles `model`.
|
|
921
|
+
;
|
|
922
|
+
origamSelectionControlRef.value?.inputRef?.click();
|
|
291
923
|
};
|
|
924
|
+
/*********************************************************
|
|
925
|
+
* Props forwarding
|
|
926
|
+
*
|
|
927
|
+
* @description
|
|
928
|
+
* Filtered attrs and props passed down to inner components.
|
|
929
|
+
* `color` and `bgColor` are STRICTLY scoped to the SelectionControl
|
|
930
|
+
* (track / thumb / label). Stripping them from `inputProps` prevents
|
|
931
|
+
* `OrigamInput` (the outer row wrapper) from also applying them as
|
|
932
|
+
* `background-color` on its root — pre-fix the consumer's
|
|
933
|
+
* `bg-color="success"` painted the entire switch row green
|
|
934
|
+
* (including the label area), instead of just the track.
|
|
935
|
+
********************************************************/
|
|
292
936
|
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
937
|
+
/*********************************************************
|
|
938
|
+
* Forwarded props
|
|
939
|
+
********************************************************/
|
|
293
940
|
const inputProps = computed(() => {
|
|
294
|
-
|
|
941
|
+
return origamInputRef.value?.filterProps(props, [
|
|
942
|
+
"modelValue",
|
|
943
|
+
"class",
|
|
944
|
+
"focused",
|
|
945
|
+
"id",
|
|
946
|
+
"style",
|
|
947
|
+
"color",
|
|
948
|
+
"bgColor"
|
|
949
|
+
]);
|
|
295
950
|
});
|
|
296
951
|
const controlProps = computed(() => {
|
|
297
|
-
|
|
952
|
+
return origamSelectionControlRef.value?.filterProps(props, [
|
|
953
|
+
"modelValue",
|
|
954
|
+
"type",
|
|
955
|
+
"disabled",
|
|
956
|
+
"readonly",
|
|
957
|
+
"class",
|
|
958
|
+
"style",
|
|
959
|
+
"id"
|
|
960
|
+
]);
|
|
298
961
|
});
|
|
962
|
+
// Props-first (lot 4 theming fix) — `border`/`rounded`/`elevation` are
|
|
963
|
+
// declared on `ISwitchProps` (Commons interfaces) AND now on
|
|
964
|
+
// `ISwitchTrackProps`; `filterProps` auto-forwards only the prop names
|
|
965
|
+
// the track actually declares, so this stays in sync automatically as
|
|
966
|
+
// the track's surface grows. Everything already bound explicitly above
|
|
967
|
+
// (`bgColor`, `disabled`, `readonly`, `error`, `inset`, `isValid`,
|
|
968
|
+
// `modelValue`) is excluded here so this generic forward can never
|
|
969
|
+
// clobber those computed (`isDisabled`/`isReadonly`) values.
|
|
299
970
|
const trackProps = computed(() => {
|
|
300
|
-
|
|
971
|
+
return origamSwitchTrackRef.value?.filterProps(props, [
|
|
972
|
+
"modelValue",
|
|
973
|
+
"disabled",
|
|
974
|
+
"readonly",
|
|
975
|
+
"error",
|
|
976
|
+
"inset",
|
|
977
|
+
"isValid",
|
|
978
|
+
"bgColor",
|
|
979
|
+
"color",
|
|
980
|
+
"class",
|
|
981
|
+
"style",
|
|
982
|
+
"id"
|
|
983
|
+
]);
|
|
301
984
|
});
|
|
985
|
+
/*********************************************************
|
|
986
|
+
* Loader
|
|
987
|
+
*
|
|
988
|
+
* @description
|
|
989
|
+
* Derived flags combining slot and prop loading states.
|
|
990
|
+
********************************************************/
|
|
991
|
+
/**
|
|
992
|
+
* True when the active loader kind is `'line'` — a thin linear
|
|
993
|
+
* progress that overlays the track at the switch's full width
|
|
994
|
+
* (52 × 32 footprint). The value and the label always stay
|
|
995
|
+
* rendered — a save in flight never replaces the control:
|
|
996
|
+
* - `'circular'` → spinning circle INSIDE the thumb (default).
|
|
997
|
+
* - `'line'` → indeterminate line ACROSS the track.
|
|
998
|
+
*/
|
|
302
999
|
const isLineLoading = computed(() => {
|
|
303
|
-
|
|
1000
|
+
return loaderConfig.value.isActive && loaderConfig.value.kind === "line";
|
|
304
1001
|
});
|
|
1002
|
+
/**
|
|
1003
|
+
* True when the thumb itself should host the spinner — i.e. any
|
|
1004
|
+
* active loader EXCEPT the line variant (which lives on the
|
|
1005
|
+
* track).
|
|
1006
|
+
*/
|
|
305
1007
|
const hasCircularLoading = computed(() => {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
1008
|
+
if (slots.loader) return true;
|
|
1009
|
+
const cfg = loaderConfig.value;
|
|
1010
|
+
return cfg.isActive && cfg.kind !== "line";
|
|
309
1011
|
});
|
|
1012
|
+
/*********************************************************
|
|
1013
|
+
* Class & Style
|
|
1014
|
+
*
|
|
1015
|
+
* @description
|
|
1016
|
+
* Root element classes and inline styles.
|
|
1017
|
+
********************************************************/
|
|
310
1018
|
const switchStyles = computed(() => {
|
|
311
|
-
|
|
312
|
-
props.style
|
|
313
|
-
];
|
|
1019
|
+
return [props.style];
|
|
314
1020
|
});
|
|
1021
|
+
// The thumb follows the SAME `rounded` config as the track (lot 4
|
|
1022
|
+
// fix) — a themed switch with a low-rounded track (e.g. geek's
|
|
1023
|
+
// `rounded: 'sm'`) previously kept a perfect circle thumb regardless,
|
|
1024
|
+
// reading as visually inconsistent ("track is square-ish, thumb is
|
|
1025
|
+
// still a dot"). Reuses `useRounded` directly against `props` (the
|
|
1026
|
+
// exact same source value forwarded to the track via `trackProps`),
|
|
1027
|
+
// so track and thumb can never drift out of sync. Emits an inline
|
|
1028
|
+
// `border-radius` declaration only when `rounded` is actually set —
|
|
1029
|
+
// unset/default falls through to the existing CSS fallback
|
|
1030
|
+
// (`var(--origam-switch__thumb---border-radius, 50%)`, a full
|
|
1031
|
+
// circle), so this is additive and changes nothing for switches that
|
|
1032
|
+
// don't configure `rounded`. Bound on the thumb's OWN `:style`, not
|
|
1033
|
+
// the wrapper's — the documented Switch-thumb v2.0→v2.1 regression
|
|
1034
|
+
// was about `[style*="color:"]` on `.origam-selection-control__wrapper`
|
|
1035
|
+
// specifically, unaffected by an unrelated attribute on a different
|
|
1036
|
+
// element.
|
|
315
1037
|
const { roundedStyles: thumbRoundedStyles } = useRounded(props, "origam-switch__thumb");
|
|
316
1038
|
const switchThumbStyles = computed(() => {
|
|
317
|
-
|
|
318
|
-
thumbRoundedStyles.value
|
|
319
|
-
];
|
|
1039
|
+
return [thumbRoundedStyles.value];
|
|
320
1040
|
});
|
|
321
1041
|
const getSwitchThumbClasses = (icon) => {
|
|
322
|
-
|
|
323
|
-
"origam-switch__thumb",
|
|
324
|
-
{ "origam-switch__thumb--filled": !!icon || loaderConfig.value.isActive }
|
|
325
|
-
];
|
|
1042
|
+
return ["origam-switch__thumb", { "origam-switch__thumb--filled": !!icon || loaderConfig.value.isActive }];
|
|
326
1043
|
};
|
|
327
1044
|
const switchClasses = computed(() => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
1045
|
+
return [
|
|
1046
|
+
"origam-switch",
|
|
1047
|
+
{
|
|
1048
|
+
"origam-switch--inset": props.inset,
|
|
1049
|
+
"origam-switch--indeterminate": indeterminate.value
|
|
1050
|
+
},
|
|
1051
|
+
loaderClasses.value,
|
|
1052
|
+
props.class
|
|
1053
|
+
];
|
|
337
1054
|
});
|
|
338
1055
|
const { id: styleId, css, load, isLoaded, unload } = useStyle(switchStyles);
|
|
1056
|
+
/*********************************************************
|
|
1057
|
+
* Expose
|
|
1058
|
+
*
|
|
1059
|
+
* @description
|
|
1060
|
+
* Public API surface exposed to parent components.
|
|
1061
|
+
********************************************************/
|
|
339
1062
|
defineExpose({
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
1063
|
+
filterProps,
|
|
1064
|
+
css,
|
|
1065
|
+
id,
|
|
1066
|
+
load,
|
|
1067
|
+
unload,
|
|
1068
|
+
isLoaded,
|
|
1069
|
+
styleId
|
|
347
1070
|
});
|
|
348
1071
|
</script>
|
|
349
1072
|
|