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
|
@@ -194,382 +194,1194 @@ import { VARIANT_INPUT } from "../../enums/Commons/variant.enum";
|
|
|
194
194
|
import { animate, nullifyTransforms } from "../../utils/Commons/animation.util";
|
|
195
195
|
import { convertToUnit } from "../../utils/Commons/commons.util";
|
|
196
196
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
197
|
+
/*********************************************************
|
|
198
|
+
* Global
|
|
199
|
+
********************************************************/
|
|
197
200
|
const props = defineProps({
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
201
|
+
centerAffix: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
required: false,
|
|
204
|
+
default: true
|
|
205
|
+
},
|
|
206
|
+
dirty: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
required: false
|
|
209
|
+
},
|
|
210
|
+
disabled: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
required: false
|
|
213
|
+
},
|
|
214
|
+
error: {
|
|
215
|
+
type: [String, Boolean],
|
|
216
|
+
required: false
|
|
217
|
+
},
|
|
218
|
+
inline: {
|
|
219
|
+
type: Boolean,
|
|
220
|
+
required: false
|
|
221
|
+
},
|
|
222
|
+
label: {
|
|
223
|
+
type: String,
|
|
224
|
+
required: false
|
|
225
|
+
},
|
|
226
|
+
prefix: {
|
|
227
|
+
type: String,
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
suffix: {
|
|
231
|
+
type: String,
|
|
232
|
+
required: false
|
|
233
|
+
},
|
|
234
|
+
persistentClear: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
singleLine: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
required: false
|
|
241
|
+
},
|
|
242
|
+
required: {
|
|
243
|
+
type: Boolean,
|
|
244
|
+
required: false
|
|
245
|
+
},
|
|
246
|
+
id: {
|
|
247
|
+
type: String,
|
|
248
|
+
required: false
|
|
249
|
+
},
|
|
250
|
+
class: {
|
|
251
|
+
type: [
|
|
252
|
+
String,
|
|
253
|
+
Array,
|
|
254
|
+
Object
|
|
255
|
+
],
|
|
256
|
+
required: false
|
|
257
|
+
},
|
|
258
|
+
style: {
|
|
259
|
+
type: [
|
|
260
|
+
String,
|
|
261
|
+
Array,
|
|
262
|
+
Object,
|
|
263
|
+
Boolean,
|
|
264
|
+
null
|
|
265
|
+
],
|
|
266
|
+
required: false,
|
|
267
|
+
skipCheck: true
|
|
268
|
+
},
|
|
269
|
+
loading: {
|
|
270
|
+
type: [
|
|
271
|
+
Boolean,
|
|
272
|
+
Number,
|
|
273
|
+
Object
|
|
274
|
+
],
|
|
275
|
+
required: false
|
|
276
|
+
},
|
|
277
|
+
loadingText: {
|
|
278
|
+
type: String,
|
|
279
|
+
required: false
|
|
280
|
+
},
|
|
281
|
+
tag: {
|
|
282
|
+
type: String,
|
|
283
|
+
required: false
|
|
284
|
+
},
|
|
285
|
+
color: {
|
|
286
|
+
type: [
|
|
287
|
+
String,
|
|
288
|
+
Object,
|
|
289
|
+
Boolean,
|
|
290
|
+
null
|
|
291
|
+
],
|
|
292
|
+
required: false,
|
|
293
|
+
skipCheck: true
|
|
294
|
+
},
|
|
295
|
+
bgColor: {
|
|
296
|
+
type: [
|
|
297
|
+
String,
|
|
298
|
+
Object,
|
|
299
|
+
Boolean,
|
|
300
|
+
null
|
|
301
|
+
],
|
|
302
|
+
required: false,
|
|
303
|
+
skipCheck: true
|
|
304
|
+
},
|
|
305
|
+
appendInnerAvatar: {
|
|
306
|
+
type: String,
|
|
307
|
+
required: false
|
|
308
|
+
},
|
|
309
|
+
appendInnerIcon: {
|
|
310
|
+
type: null,
|
|
311
|
+
required: false
|
|
312
|
+
},
|
|
313
|
+
prependInnerAvatar: {
|
|
314
|
+
type: String,
|
|
315
|
+
required: false
|
|
316
|
+
},
|
|
317
|
+
prependInnerIcon: {
|
|
318
|
+
type: null,
|
|
319
|
+
required: false
|
|
320
|
+
},
|
|
321
|
+
clearIcon: {
|
|
322
|
+
type: null,
|
|
323
|
+
required: false,
|
|
324
|
+
default: MDI_ICONS.CLOSE_CIRCLE_OUTLINE
|
|
325
|
+
},
|
|
326
|
+
clearable: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
required: false
|
|
329
|
+
},
|
|
330
|
+
prependInnerAriaLabel: {
|
|
331
|
+
type: String,
|
|
332
|
+
required: false
|
|
333
|
+
},
|
|
334
|
+
appendInnerAriaLabel: {
|
|
335
|
+
type: String,
|
|
336
|
+
required: false
|
|
337
|
+
},
|
|
338
|
+
border: {
|
|
339
|
+
type: [
|
|
340
|
+
Boolean,
|
|
341
|
+
Number,
|
|
342
|
+
String,
|
|
343
|
+
Array
|
|
344
|
+
],
|
|
345
|
+
required: false,
|
|
346
|
+
skipCheck: true
|
|
347
|
+
},
|
|
348
|
+
borderTop: {
|
|
349
|
+
type: [
|
|
350
|
+
Boolean,
|
|
351
|
+
Number,
|
|
352
|
+
String
|
|
353
|
+
],
|
|
354
|
+
required: false
|
|
355
|
+
},
|
|
356
|
+
borderLeft: {
|
|
357
|
+
type: [
|
|
358
|
+
Boolean,
|
|
359
|
+
Number,
|
|
360
|
+
String
|
|
361
|
+
],
|
|
362
|
+
required: false
|
|
363
|
+
},
|
|
364
|
+
borderBottom: {
|
|
365
|
+
type: [
|
|
366
|
+
Boolean,
|
|
367
|
+
Number,
|
|
368
|
+
String
|
|
369
|
+
],
|
|
370
|
+
required: false
|
|
371
|
+
},
|
|
372
|
+
borderRight: {
|
|
373
|
+
type: [
|
|
374
|
+
Boolean,
|
|
375
|
+
Number,
|
|
376
|
+
String
|
|
377
|
+
],
|
|
378
|
+
required: false
|
|
379
|
+
},
|
|
380
|
+
borderBlock: {
|
|
381
|
+
type: [
|
|
382
|
+
Boolean,
|
|
383
|
+
Number,
|
|
384
|
+
String
|
|
385
|
+
],
|
|
386
|
+
required: false
|
|
387
|
+
},
|
|
388
|
+
borderInline: {
|
|
389
|
+
type: [
|
|
390
|
+
Boolean,
|
|
391
|
+
Number,
|
|
392
|
+
String
|
|
393
|
+
],
|
|
394
|
+
required: false
|
|
395
|
+
},
|
|
396
|
+
borderInlineStart: {
|
|
397
|
+
type: [
|
|
398
|
+
Boolean,
|
|
399
|
+
Number,
|
|
400
|
+
String
|
|
401
|
+
],
|
|
402
|
+
required: false
|
|
403
|
+
},
|
|
404
|
+
borderInlineEnd: {
|
|
405
|
+
type: [
|
|
406
|
+
Boolean,
|
|
407
|
+
Number,
|
|
408
|
+
String
|
|
409
|
+
],
|
|
410
|
+
required: false
|
|
411
|
+
},
|
|
412
|
+
borderBlockStart: {
|
|
413
|
+
type: [
|
|
414
|
+
Boolean,
|
|
415
|
+
Number,
|
|
416
|
+
String
|
|
417
|
+
],
|
|
418
|
+
required: false
|
|
419
|
+
},
|
|
420
|
+
borderBlockEnd: {
|
|
421
|
+
type: [
|
|
422
|
+
Boolean,
|
|
423
|
+
Number,
|
|
424
|
+
String
|
|
425
|
+
],
|
|
426
|
+
required: false
|
|
427
|
+
},
|
|
428
|
+
borderColor: {
|
|
429
|
+
type: String,
|
|
430
|
+
required: false
|
|
431
|
+
},
|
|
432
|
+
borderStyle: {
|
|
433
|
+
type: String,
|
|
434
|
+
required: false
|
|
435
|
+
},
|
|
436
|
+
borderTopColor: {
|
|
437
|
+
type: [
|
|
438
|
+
String,
|
|
439
|
+
Object,
|
|
440
|
+
Boolean,
|
|
441
|
+
null
|
|
442
|
+
],
|
|
443
|
+
required: false,
|
|
444
|
+
skipCheck: true
|
|
445
|
+
},
|
|
446
|
+
borderRightColor: {
|
|
447
|
+
type: [
|
|
448
|
+
String,
|
|
449
|
+
Object,
|
|
450
|
+
Boolean,
|
|
451
|
+
null
|
|
452
|
+
],
|
|
453
|
+
required: false,
|
|
454
|
+
skipCheck: true
|
|
455
|
+
},
|
|
456
|
+
borderBottomColor: {
|
|
457
|
+
type: [
|
|
458
|
+
String,
|
|
459
|
+
Object,
|
|
460
|
+
Boolean,
|
|
461
|
+
null
|
|
462
|
+
],
|
|
463
|
+
required: false,
|
|
464
|
+
skipCheck: true
|
|
465
|
+
},
|
|
466
|
+
borderLeftColor: {
|
|
467
|
+
type: [
|
|
468
|
+
String,
|
|
469
|
+
Object,
|
|
470
|
+
Boolean,
|
|
471
|
+
null
|
|
472
|
+
],
|
|
473
|
+
required: false,
|
|
474
|
+
skipCheck: true
|
|
475
|
+
},
|
|
476
|
+
borderInlineStartColor: {
|
|
477
|
+
type: [
|
|
478
|
+
String,
|
|
479
|
+
Object,
|
|
480
|
+
Boolean,
|
|
481
|
+
null
|
|
482
|
+
],
|
|
483
|
+
required: false,
|
|
484
|
+
skipCheck: true
|
|
485
|
+
},
|
|
486
|
+
borderInlineEndColor: {
|
|
487
|
+
type: [
|
|
488
|
+
String,
|
|
489
|
+
Object,
|
|
490
|
+
Boolean,
|
|
491
|
+
null
|
|
492
|
+
],
|
|
493
|
+
required: false,
|
|
494
|
+
skipCheck: true
|
|
495
|
+
},
|
|
496
|
+
borderBlockStartColor: {
|
|
497
|
+
type: [
|
|
498
|
+
String,
|
|
499
|
+
Object,
|
|
500
|
+
Boolean,
|
|
501
|
+
null
|
|
502
|
+
],
|
|
503
|
+
required: false,
|
|
504
|
+
skipCheck: true
|
|
505
|
+
},
|
|
506
|
+
borderBlockEndColor: {
|
|
507
|
+
type: [
|
|
508
|
+
String,
|
|
509
|
+
Object,
|
|
510
|
+
Boolean,
|
|
511
|
+
null
|
|
512
|
+
],
|
|
513
|
+
required: false,
|
|
514
|
+
skipCheck: true
|
|
515
|
+
},
|
|
516
|
+
focused: {
|
|
517
|
+
type: Boolean,
|
|
518
|
+
required: false
|
|
519
|
+
},
|
|
520
|
+
density: {
|
|
521
|
+
type: null,
|
|
522
|
+
required: false,
|
|
523
|
+
default: DENSITY.DEFAULT
|
|
524
|
+
},
|
|
525
|
+
text: {
|
|
526
|
+
type: String,
|
|
527
|
+
required: false
|
|
528
|
+
},
|
|
529
|
+
floating: {
|
|
530
|
+
type: Boolean,
|
|
531
|
+
required: false
|
|
532
|
+
},
|
|
533
|
+
name: {
|
|
534
|
+
type: String,
|
|
535
|
+
required: false
|
|
536
|
+
},
|
|
537
|
+
margin: {
|
|
538
|
+
type: [
|
|
539
|
+
Boolean,
|
|
540
|
+
Number,
|
|
541
|
+
String
|
|
542
|
+
],
|
|
543
|
+
required: false
|
|
544
|
+
},
|
|
545
|
+
marginTop: {
|
|
546
|
+
type: [
|
|
547
|
+
Boolean,
|
|
548
|
+
Number,
|
|
549
|
+
String
|
|
550
|
+
],
|
|
551
|
+
required: false
|
|
552
|
+
},
|
|
553
|
+
marginLeft: {
|
|
554
|
+
type: [
|
|
555
|
+
Boolean,
|
|
556
|
+
Number,
|
|
557
|
+
String
|
|
558
|
+
],
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
561
|
+
marginBottom: {
|
|
562
|
+
type: [
|
|
563
|
+
Boolean,
|
|
564
|
+
Number,
|
|
565
|
+
String
|
|
566
|
+
],
|
|
567
|
+
required: false
|
|
568
|
+
},
|
|
569
|
+
marginRight: {
|
|
570
|
+
type: [
|
|
571
|
+
Boolean,
|
|
572
|
+
Number,
|
|
573
|
+
String
|
|
574
|
+
],
|
|
575
|
+
required: false
|
|
576
|
+
},
|
|
577
|
+
marginBlock: {
|
|
578
|
+
type: [
|
|
579
|
+
Boolean,
|
|
580
|
+
Number,
|
|
581
|
+
String
|
|
582
|
+
],
|
|
583
|
+
required: false
|
|
584
|
+
},
|
|
585
|
+
marginInline: {
|
|
586
|
+
type: [
|
|
587
|
+
Boolean,
|
|
588
|
+
Number,
|
|
589
|
+
String
|
|
590
|
+
],
|
|
591
|
+
required: false
|
|
592
|
+
},
|
|
593
|
+
marginInlineStart: {
|
|
594
|
+
type: [
|
|
595
|
+
Boolean,
|
|
596
|
+
Number,
|
|
597
|
+
String
|
|
598
|
+
],
|
|
599
|
+
required: false
|
|
600
|
+
},
|
|
601
|
+
marginInlineEnd: {
|
|
602
|
+
type: [
|
|
603
|
+
Boolean,
|
|
604
|
+
Number,
|
|
605
|
+
String
|
|
606
|
+
],
|
|
607
|
+
required: false
|
|
608
|
+
},
|
|
609
|
+
marginBlockStart: {
|
|
610
|
+
type: [
|
|
611
|
+
Boolean,
|
|
612
|
+
Number,
|
|
613
|
+
String
|
|
614
|
+
],
|
|
615
|
+
required: false
|
|
616
|
+
},
|
|
617
|
+
marginBlockEnd: {
|
|
618
|
+
type: [
|
|
619
|
+
Boolean,
|
|
620
|
+
Number,
|
|
621
|
+
String
|
|
622
|
+
],
|
|
623
|
+
required: false
|
|
624
|
+
},
|
|
625
|
+
padding: {
|
|
626
|
+
type: [
|
|
627
|
+
Boolean,
|
|
628
|
+
Number,
|
|
629
|
+
String
|
|
630
|
+
],
|
|
631
|
+
required: false
|
|
632
|
+
},
|
|
633
|
+
paddingTop: {
|
|
634
|
+
type: [
|
|
635
|
+
Boolean,
|
|
636
|
+
Number,
|
|
637
|
+
String
|
|
638
|
+
],
|
|
639
|
+
required: false
|
|
640
|
+
},
|
|
641
|
+
paddingLeft: {
|
|
642
|
+
type: [
|
|
643
|
+
Boolean,
|
|
644
|
+
Number,
|
|
645
|
+
String
|
|
646
|
+
],
|
|
647
|
+
required: false
|
|
648
|
+
},
|
|
649
|
+
paddingBottom: {
|
|
650
|
+
type: [
|
|
651
|
+
Boolean,
|
|
652
|
+
Number,
|
|
653
|
+
String
|
|
654
|
+
],
|
|
655
|
+
required: false
|
|
656
|
+
},
|
|
657
|
+
paddingRight: {
|
|
658
|
+
type: [
|
|
659
|
+
Boolean,
|
|
660
|
+
Number,
|
|
661
|
+
String
|
|
662
|
+
],
|
|
663
|
+
required: false
|
|
664
|
+
},
|
|
665
|
+
paddingBlock: {
|
|
666
|
+
type: [
|
|
667
|
+
Boolean,
|
|
668
|
+
Number,
|
|
669
|
+
String
|
|
670
|
+
],
|
|
671
|
+
required: false
|
|
672
|
+
},
|
|
673
|
+
paddingInline: {
|
|
674
|
+
type: [
|
|
675
|
+
Boolean,
|
|
676
|
+
Number,
|
|
677
|
+
String
|
|
678
|
+
],
|
|
679
|
+
required: false
|
|
680
|
+
},
|
|
681
|
+
paddingInlineStart: {
|
|
682
|
+
type: [
|
|
683
|
+
Boolean,
|
|
684
|
+
Number,
|
|
685
|
+
String
|
|
686
|
+
],
|
|
687
|
+
required: false
|
|
688
|
+
},
|
|
689
|
+
paddingInlineEnd: {
|
|
690
|
+
type: [
|
|
691
|
+
Boolean,
|
|
692
|
+
Number,
|
|
693
|
+
String
|
|
694
|
+
],
|
|
695
|
+
required: false
|
|
696
|
+
},
|
|
697
|
+
paddingBlockStart: {
|
|
698
|
+
type: [
|
|
699
|
+
Boolean,
|
|
700
|
+
Number,
|
|
701
|
+
String
|
|
702
|
+
],
|
|
703
|
+
required: false
|
|
704
|
+
},
|
|
705
|
+
paddingBlockEnd: {
|
|
706
|
+
type: [
|
|
707
|
+
Boolean,
|
|
708
|
+
Number,
|
|
709
|
+
String
|
|
710
|
+
],
|
|
711
|
+
required: false
|
|
712
|
+
},
|
|
713
|
+
rounded: {
|
|
714
|
+
type: [
|
|
715
|
+
Boolean,
|
|
716
|
+
Number,
|
|
717
|
+
String,
|
|
718
|
+
null
|
|
719
|
+
],
|
|
720
|
+
required: false,
|
|
721
|
+
skipCheck: true
|
|
722
|
+
},
|
|
723
|
+
roundedTopRight: {
|
|
724
|
+
type: [
|
|
725
|
+
Boolean,
|
|
726
|
+
Number,
|
|
727
|
+
String
|
|
728
|
+
],
|
|
729
|
+
required: false
|
|
730
|
+
},
|
|
731
|
+
roundedTopLeft: {
|
|
732
|
+
type: [
|
|
733
|
+
Boolean,
|
|
734
|
+
Number,
|
|
735
|
+
String
|
|
736
|
+
],
|
|
737
|
+
required: false
|
|
738
|
+
},
|
|
739
|
+
roundedBottomLeft: {
|
|
740
|
+
type: [
|
|
741
|
+
Boolean,
|
|
742
|
+
Number,
|
|
743
|
+
String
|
|
744
|
+
],
|
|
745
|
+
required: false
|
|
746
|
+
},
|
|
747
|
+
roundedBottomRight: {
|
|
748
|
+
type: [
|
|
749
|
+
Boolean,
|
|
750
|
+
Number,
|
|
751
|
+
String
|
|
752
|
+
],
|
|
753
|
+
required: false
|
|
754
|
+
},
|
|
755
|
+
roundedStartStart: {
|
|
756
|
+
type: [
|
|
757
|
+
Boolean,
|
|
758
|
+
Number,
|
|
759
|
+
String
|
|
760
|
+
],
|
|
761
|
+
required: false
|
|
762
|
+
},
|
|
763
|
+
roundedStartEnd: {
|
|
764
|
+
type: [
|
|
765
|
+
Boolean,
|
|
766
|
+
Number,
|
|
767
|
+
String
|
|
768
|
+
],
|
|
769
|
+
required: false
|
|
770
|
+
},
|
|
771
|
+
roundedEndStart: {
|
|
772
|
+
type: [
|
|
773
|
+
Boolean,
|
|
774
|
+
Number,
|
|
775
|
+
String
|
|
776
|
+
],
|
|
777
|
+
required: false
|
|
778
|
+
},
|
|
779
|
+
roundedEndEnd: {
|
|
780
|
+
type: [
|
|
781
|
+
Boolean,
|
|
782
|
+
Number,
|
|
783
|
+
String
|
|
784
|
+
],
|
|
785
|
+
required: false
|
|
786
|
+
},
|
|
787
|
+
fontSize: {
|
|
788
|
+
type: null,
|
|
789
|
+
required: false
|
|
790
|
+
},
|
|
791
|
+
fontWeight: {
|
|
792
|
+
type: null,
|
|
793
|
+
required: false
|
|
794
|
+
},
|
|
795
|
+
lineHeight: {
|
|
796
|
+
type: null,
|
|
797
|
+
required: false
|
|
798
|
+
},
|
|
799
|
+
letterSpacing: {
|
|
800
|
+
type: null,
|
|
801
|
+
required: false
|
|
802
|
+
},
|
|
803
|
+
active: {
|
|
804
|
+
type: [Boolean, Object],
|
|
805
|
+
required: false
|
|
806
|
+
},
|
|
807
|
+
activeClass: {
|
|
808
|
+
type: String,
|
|
809
|
+
required: false
|
|
810
|
+
},
|
|
811
|
+
variant: {
|
|
812
|
+
type: null,
|
|
813
|
+
required: false,
|
|
814
|
+
default: VARIANT_INPUT.OUTLINED
|
|
815
|
+
},
|
|
816
|
+
elevation: {
|
|
817
|
+
type: [Number, String],
|
|
818
|
+
required: false
|
|
819
|
+
},
|
|
820
|
+
size: {
|
|
821
|
+
type: null,
|
|
822
|
+
required: false
|
|
823
|
+
}
|
|
291
824
|
});
|
|
292
|
-
defineEmits([
|
|
825
|
+
defineEmits([
|
|
826
|
+
"update:focused",
|
|
827
|
+
"click:appendInner",
|
|
828
|
+
"click:prependInner",
|
|
829
|
+
"click:clear",
|
|
830
|
+
"update:active"
|
|
831
|
+
]);
|
|
293
832
|
defineSlots();
|
|
294
833
|
const slots = useSlots();
|
|
295
834
|
const attrs = useAttrs();
|
|
296
835
|
const { t } = useLocale();
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
836
|
+
/*********************************************************
|
|
837
|
+
* Adjacent
|
|
838
|
+
*
|
|
839
|
+
* @description
|
|
840
|
+
*
|
|
841
|
+
********************************************************/
|
|
842
|
+
/*********************************************************
|
|
843
|
+
* Composables
|
|
844
|
+
********************************************************/
|
|
845
|
+
const { prependInnerCommandAttrs, appendInnerCommandAttrs, hasAppendInner, onClickAppendInner: handleClickAppendInner, onClickPrependInner: handleClickPrependInner, onKeydownAppendInner: handleKeydownAppendInner, onKeydownPrependInner: handleKeydownPrependInner, clickClear: handleClickClear, hasPrependInner, hasClear } = useAdjacentInner(props);
|
|
846
|
+
/*********************************************************
|
|
847
|
+
* Clear button — accessible name (issue #443)
|
|
848
|
+
*
|
|
849
|
+
* @description
|
|
850
|
+
* Reuses the pre-existing, previously-unwired `origam.input.clear`
|
|
851
|
+
* locale key ("Clear {0}").
|
|
852
|
+
********************************************************/
|
|
309
853
|
const clearLabel = computed(() => t("origam.input.clear", props.label ?? ""));
|
|
854
|
+
/*********************************************************
|
|
855
|
+
* Input
|
|
856
|
+
*
|
|
857
|
+
* @description
|
|
858
|
+
*
|
|
859
|
+
********************************************************/
|
|
310
860
|
const uid = getUid();
|
|
311
861
|
const id = computed(() => props.id || `input-${uid}`);
|
|
312
862
|
const messagesId = computed(() => `${id.value}-messages`);
|
|
863
|
+
/*********************************************************
|
|
864
|
+
* Events
|
|
865
|
+
*
|
|
866
|
+
* @description
|
|
867
|
+
*
|
|
868
|
+
********************************************************/
|
|
869
|
+
/*********************************************************
|
|
870
|
+
* Event handlers
|
|
871
|
+
********************************************************/
|
|
313
872
|
const handleClick = (e) => {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
873
|
+
if (e.target !== document.activeElement) {
|
|
874
|
+
e.preventDefault();
|
|
875
|
+
}
|
|
317
876
|
};
|
|
877
|
+
/*********************************************************
|
|
878
|
+
* Clear button (issue #443)
|
|
879
|
+
*
|
|
880
|
+
* @description
|
|
881
|
+
* Was a bare `<div @mousedown>` wrapping an `aria-hidden` icon whose
|
|
882
|
+
* own `@keydown`/`@focus`/`@blur` listeners could never fire —
|
|
883
|
+
* `OrigamIcon` never sets `tabindex`, so the icon was never reachable
|
|
884
|
+
* by Tab in the first place. Now a real `<button type="button">`
|
|
885
|
+
* (Tab-reachable, has an accessible name), but the trigger stays
|
|
886
|
+
* `@mousedown` — NOT `@click` — to preserve the exact pre-existing
|
|
887
|
+
* mouse behaviour: `handleMousedownClear` calls `preventDefault()` +
|
|
888
|
+
* `stopPropagation()` so clearing never blurs the input nor bubbles
|
|
889
|
+
* into the field root's own `@click`. A manual `@keydown` handler
|
|
890
|
+
* (Enter/Space) gives keyboard users the same action WITHOUT also
|
|
891
|
+
* binding `@click` — the button's native keyboard activation
|
|
892
|
+
* synthesizes a `click` DOM event nothing listens for, so there is no
|
|
893
|
+
* double-fire risk between the two paths.
|
|
894
|
+
********************************************************/
|
|
318
895
|
const handleKeydownClear = (e) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
896
|
+
if (e.key !== KEYBOARD_VALUES.ENTER && e.key !== KEYBOARD_VALUES.EMPTY) return;
|
|
897
|
+
e.preventDefault();
|
|
898
|
+
e.stopPropagation();
|
|
899
|
+
handleClickClear(new MouseEvent("click"));
|
|
323
900
|
};
|
|
324
901
|
const handleMousedownClear = (e) => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
902
|
+
e.preventDefault();
|
|
903
|
+
e.stopPropagation();
|
|
904
|
+
handleClickClear(e);
|
|
328
905
|
};
|
|
906
|
+
/*********************************************************
|
|
907
|
+
* Slot Props
|
|
908
|
+
*
|
|
909
|
+
* @description
|
|
910
|
+
*
|
|
911
|
+
********************************************************/
|
|
329
912
|
const controlRef = ref();
|
|
913
|
+
/*********************************************************
|
|
914
|
+
* slotProps — default-slot channel to every consumer's real <input>
|
|
915
|
+
*
|
|
916
|
+
* @description
|
|
917
|
+
* #422 — `required` was declared on IFieldProps and read nowhere: no
|
|
918
|
+
* asterisk (the label side already worked via the template-ref
|
|
919
|
+
* forwarding to OrigamLabel, one render tick later — verified with
|
|
920
|
+
* nextTick before assuming otherwise), but NO aria-required at all on
|
|
921
|
+
* any of the field-family inputs.
|
|
922
|
+
*
|
|
923
|
+
* @description
|
|
924
|
+
* `slotProps` is the one channel every `<origam-field>` consumer
|
|
925
|
+
* (TextField, NumberField, PasswordField, FileField) already
|
|
926
|
+
* destructures via `#default="{class, ref, ...fieldSlotProps}"` and
|
|
927
|
+
* spreads onto its real `<input>` — wiring `aria-required` here fixes
|
|
928
|
+
* all of them at once instead of duplicating it in each consumer.
|
|
929
|
+
********************************************************/
|
|
330
930
|
const slotProps = computed(() => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
931
|
+
return {
|
|
932
|
+
class: "origam-field__input",
|
|
933
|
+
id: id.value,
|
|
934
|
+
"aria-describedby": messagesId.value,
|
|
935
|
+
"aria-required": props.required || undefined,
|
|
936
|
+
isActive: isActive.value,
|
|
937
|
+
isFocused: isFocused.value,
|
|
938
|
+
ref: controlRef.value,
|
|
939
|
+
onBlur: handleBlur,
|
|
940
|
+
onFocus: handleFocus
|
|
941
|
+
};
|
|
342
942
|
});
|
|
943
|
+
/*********************************************************
|
|
944
|
+
* Typography — BEM child surface
|
|
945
|
+
*
|
|
946
|
+
* @description
|
|
947
|
+
* Emits --origam-field__label---font-size on the __label child element.
|
|
948
|
+
* The SCSS reads this var on &__label--floating (the animated floating
|
|
949
|
+
* label). The var is also consumed by the JS animation scale calculation
|
|
950
|
+
* (line: `getPropertyValue('--origam-field__label---font-size')`).
|
|
951
|
+
*
|
|
952
|
+
* ⛔ fontWeight / lineHeight / letterSpacing are NOT read via THIS
|
|
953
|
+
* `field__label` prefix — but they are NOT inert either (issue #501
|
|
954
|
+
* correction). `labelProps` / `floatingLabelProps` below forward the
|
|
955
|
+
* full prop set to the nested `<OrigamLabel>` via
|
|
956
|
+
* `origamLabelRef.value.filterProps(props, …)`, and `OrigamLabel` has
|
|
957
|
+
* its OWN `useTypography(props, 'label')` call that DOES read those
|
|
958
|
+
* three (`--origam-label---font-weight` / `---line-height` /
|
|
959
|
+
* `---letter-spacing`) — confirmed via `@vue/test-utils` + `nextTick`
|
|
960
|
+
* (the ref is `undefined` on the first render; the forward lands on
|
|
961
|
+
* the second, invisible-to-paint render per `useProps`'s own doc
|
|
962
|
+
* comment). Only `fontFamily` is genuinely dead on both prefixes.
|
|
963
|
+
********************************************************/
|
|
343
964
|
const { typographyStyles } = useTypography(props, "field__label");
|
|
965
|
+
/*********************************************************
|
|
966
|
+
* Label
|
|
967
|
+
*
|
|
968
|
+
* @description
|
|
969
|
+
*
|
|
970
|
+
********************************************************/
|
|
344
971
|
const origamLabelRef = ref();
|
|
345
972
|
const hasLabel = computed(() => {
|
|
346
|
-
|
|
973
|
+
return !props.singleLine && !!(props.label || slots.label);
|
|
347
974
|
});
|
|
975
|
+
/*********************************************************
|
|
976
|
+
* Forwarded props
|
|
977
|
+
********************************************************/
|
|
348
978
|
const labelProps = computed(() => {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
979
|
+
const defaultLabelProps = origamLabelRef.value?.filterProps(props, [
|
|
980
|
+
"text",
|
|
981
|
+
"class",
|
|
982
|
+
"style"
|
|
983
|
+
]);
|
|
984
|
+
return {
|
|
985
|
+
class: ["origam-field__label"],
|
|
986
|
+
for: id.value,
|
|
987
|
+
text: props.label,
|
|
988
|
+
...defaultLabelProps,
|
|
989
|
+
// BEM-child typography — emits --origam-field__label---font-size on the
|
|
990
|
+
// label element so the SCSS floating rule and JS animation scale read it.
|
|
991
|
+
style: typographyStyles.value,
|
|
992
|
+
// The field's `border` / `rounded` visual props belong to
|
|
993
|
+
// the FIELD outline (the input box). Forwarding them onto
|
|
994
|
+
// the `<origam-label>` would draw a chip-like border + 8px
|
|
995
|
+
// radius around the label text — which is what user
|
|
996
|
+
// reported on OrigamFileField (the default `border: true,
|
|
997
|
+
// rounded: true` defaults of FileField were bleeding into
|
|
998
|
+
// the "Document" label). Reset them to `false` here so the
|
|
999
|
+
// label always renders as plain text regardless of what the
|
|
1000
|
+
// surrounding field declares.
|
|
1001
|
+
border: false,
|
|
1002
|
+
rounded: false
|
|
1003
|
+
};
|
|
370
1004
|
});
|
|
1005
|
+
/*********************************************************
|
|
1006
|
+
* Floating Label
|
|
1007
|
+
*
|
|
1008
|
+
* @description
|
|
1009
|
+
*
|
|
1010
|
+
********************************************************/
|
|
371
1011
|
const origamFloatingLabelRef = ref();
|
|
372
1012
|
const hasFloatingLabel = computed(() => {
|
|
373
|
-
|
|
1013
|
+
return !props.singleLine && !!(props.label || slots.floatingLabel);
|
|
374
1014
|
});
|
|
375
1015
|
const floatingLabelProps = computed(() => {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
1016
|
+
const defaultFloatingLabelProps = origamFloatingLabelRef.value?.filterProps(props, [
|
|
1017
|
+
"text",
|
|
1018
|
+
"class",
|
|
1019
|
+
"style"
|
|
1020
|
+
]);
|
|
1021
|
+
return {
|
|
1022
|
+
class: ["origam-field__label", "origam-field__label--floating"],
|
|
1023
|
+
for: id.value,
|
|
1024
|
+
text: props.label,
|
|
1025
|
+
floating: true,
|
|
1026
|
+
ref: "origamFloatingLabelRef",
|
|
1027
|
+
...defaultFloatingLabelProps,
|
|
1028
|
+
// BEM-child typography — same var as labelProps so the floating
|
|
1029
|
+
// label's font-size SCSS rule and the JS scale animation both read it.
|
|
1030
|
+
style: typographyStyles.value,
|
|
1031
|
+
// Same reason as `labelProps` above — the field's `border` /
|
|
1032
|
+
// `rounded` defaults belong to the field outline, NOT to the
|
|
1033
|
+
// floating label that animates above/inside the input on focus.
|
|
1034
|
+
// Without this override the floating "Document" label inherits
|
|
1035
|
+
// `--border-thin` + `--rounded-md` from the field's defaults
|
|
1036
|
+
// and renders as a chip-bordered pill, which the user reported
|
|
1037
|
+
// as still wrong after fixing the static label.
|
|
1038
|
+
border: false,
|
|
1039
|
+
rounded: false
|
|
1040
|
+
};
|
|
397
1041
|
});
|
|
1042
|
+
/*********************************************************
|
|
1043
|
+
* Loader
|
|
1044
|
+
*
|
|
1045
|
+
* @description
|
|
1046
|
+
*
|
|
1047
|
+
********************************************************/
|
|
398
1048
|
const { loaderClasses, loaderConfig } = useLoader(props, LOADER_KIND.LINE);
|
|
399
1049
|
const hasLoader = computed(() => {
|
|
400
|
-
|
|
1050
|
+
return slots.loader || loaderConfig.value.isActive;
|
|
401
1051
|
});
|
|
1052
|
+
/*********************************************************
|
|
1053
|
+
* Prefix & suffix
|
|
1054
|
+
*
|
|
1055
|
+
* @description
|
|
1056
|
+
*
|
|
1057
|
+
********************************************************/
|
|
402
1058
|
const hasPrefix = computed(() => {
|
|
403
|
-
|
|
1059
|
+
return !!props.prefix || !!slots.prefix;
|
|
404
1060
|
});
|
|
405
1061
|
const hasSuffix = computed(() => {
|
|
406
|
-
|
|
1062
|
+
return !!props.suffix || !!slots.suffix;
|
|
407
1063
|
});
|
|
1064
|
+
/*********************************************************
|
|
1065
|
+
* Effect
|
|
1066
|
+
*
|
|
1067
|
+
* @description
|
|
1068
|
+
* isActive is a ref that holds a boolean value indicating whether the field is active.
|
|
1069
|
+
********************************************************/
|
|
408
1070
|
const { focusClasses, isFocused, onFocus: handleFocus, onBlur: handleBlur } = useFocus(props);
|
|
409
1071
|
const { isOn: active, config: activeState, toggle: handleActive } = useStateFlag(props, { state: "active" });
|
|
410
1072
|
const isActive = computed(() => {
|
|
411
|
-
|
|
1073
|
+
return props.dirty || active.value || hasPrefix.value || hasSuffix.value;
|
|
412
1074
|
});
|
|
413
|
-
|
|
1075
|
+
/*********************************************************
|
|
1076
|
+
* WATCHERS DEFERRED TO onMounted — NOT AN OPTIMISATION
|
|
1077
|
+
*
|
|
1078
|
+
* @description
|
|
1079
|
+
* `watch(source, cb)` reads `source` synchronously the instant it is
|
|
1080
|
+
* created, to seed `oldValue` — regardless of `immediate`. `isFocused`
|
|
1081
|
+
* and `isActive` are `computed()`s that read `props.focused` /
|
|
1082
|
+
* `props.dirty` / `active.value` / `hasPrefix.value` / `hasSuffix.value`.
|
|
1083
|
+
* Creating these watchers at the top level of `setup()` forced that
|
|
1084
|
+
* seeding read before Vue's `beforeCreate` hook runs, which is where the
|
|
1085
|
+
* ADR-005 theme resolver patches `instance.props`. A `computed` caches
|
|
1086
|
+
* whatever its first evaluation saw and only invalidates on a tracked
|
|
1087
|
+
* dependency change; the resolver's `Object.defineProperty` patch is not
|
|
1088
|
+
* one on a static mount with no parent re-render, so `isFocused` /
|
|
1089
|
+
* `isActive` stayed cached at their pre-theme value forever — a theme
|
|
1090
|
+
* naming `focused`, `active`, `dirty`, `prefix` or `suffix` never
|
|
1091
|
+
* flipped `--origam-field--active` / `--origam-field--focused`.
|
|
1092
|
+
* Deferring both watchers to `onMounted` delays their first read to
|
|
1093
|
+
* after the component's first render, which is already past
|
|
1094
|
+
* `beforeCreate` — the template's own `fieldClasses` read gets there
|
|
1095
|
+
* first and seeds the correct, themed value.
|
|
1096
|
+
********************************************************/
|
|
1097
|
+
/*********************************************************
|
|
1098
|
+
* scheduleLabelFrame — rAF bound to the component's lifetime (#719)
|
|
1099
|
+
*
|
|
1100
|
+
* @description
|
|
1101
|
+
* The floating-label animation is deferred by one frame so the label
|
|
1102
|
+
* and its target have been laid out before their rects are read.
|
|
1103
|
+
* Nothing cancelled that frame at unmount. The body is NOT benign:
|
|
1104
|
+
* it calls `getComputedStyle` twice — a bare global. Landing after
|
|
1105
|
+
* the jsdom environment is destroyed throws
|
|
1106
|
+
* `ReferenceError: getComputedStyle is not defined`, which fails the
|
|
1107
|
+
* whole Vitest run with zero red tests (the #706 family).
|
|
1108
|
+
*
|
|
1109
|
+
* @description
|
|
1110
|
+
* `onBeforeUnmount` cancels the armed frames and flips `disposed`, so
|
|
1111
|
+
* a schedule attempt that somehow arrives later is a no-op too.
|
|
1112
|
+
*
|
|
1113
|
+
* @description
|
|
1114
|
+
* Every armed id is tracked, NOT just the latest. Collapsing them into
|
|
1115
|
+
* a single handle would make a later call supersede an earlier one —
|
|
1116
|
+
* a coalescing semantic this component never had, and one no failing
|
|
1117
|
+
* test asks for. The fix adds cancellation at unmount and nothing else.
|
|
1118
|
+
********************************************************/
|
|
1119
|
+
const labelFrames = new Set();
|
|
414
1120
|
let disposed = false;
|
|
415
1121
|
const scheduleLabelFrame = (cb) => {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
1122
|
+
if (disposed || !IN_BROWSER) return;
|
|
1123
|
+
const id = requestAnimationFrame(() => {
|
|
1124
|
+
labelFrames.delete(id);
|
|
1125
|
+
cb();
|
|
1126
|
+
});
|
|
1127
|
+
labelFrames.add(id);
|
|
422
1128
|
};
|
|
423
1129
|
onBeforeUnmount(() => {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
1130
|
+
disposed = true;
|
|
1131
|
+
for (const id of labelFrames) cancelAnimationFrame(id);
|
|
1132
|
+
labelFrames.clear();
|
|
427
1133
|
});
|
|
428
1134
|
onMounted(() => {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
1135
|
+
watch(isFocused, (newVal, oldVal) => {
|
|
1136
|
+
if (newVal !== oldVal) {
|
|
1137
|
+
handleActive();
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
watch(isActive, (newVal, oldVal) => {
|
|
1141
|
+
if (hasLabel.value && newVal !== oldVal) {
|
|
1142
|
+
const el = origamLabelRef.value.$el;
|
|
1143
|
+
const targetEl = origamFloatingLabelRef.value.$el;
|
|
1144
|
+
scheduleLabelFrame(() => {
|
|
1145
|
+
const rect = nullifyTransforms(el);
|
|
1146
|
+
const targetRect = targetEl.getBoundingClientRect();
|
|
1147
|
+
const x = targetRect.x - rect.x;
|
|
1148
|
+
const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2);
|
|
1149
|
+
const targetWidth = targetRect.width / .75;
|
|
1150
|
+
const width = Math.abs(targetWidth - rect.width) > 1 ? { maxWidth: convertToUnit(targetWidth) } : undefined;
|
|
1151
|
+
const style = getComputedStyle(el);
|
|
1152
|
+
const targetStyle = getComputedStyle(targetEl);
|
|
1153
|
+
const duration = parseFloat(style.transitionDuration) * 1e3 || 150;
|
|
1154
|
+
const scale = parseFloat(targetStyle.getPropertyValue("--origam-field__label---font-size"));
|
|
1155
|
+
const color = targetStyle.getPropertyValue("color");
|
|
1156
|
+
el.style.visibility = "visible";
|
|
1157
|
+
targetEl.style.visibility = "hidden";
|
|
1158
|
+
animate(el, {
|
|
1159
|
+
transform: `translate(${x}px, ${y}px) scale(${scale})`,
|
|
1160
|
+
color,
|
|
1161
|
+
...width
|
|
1162
|
+
}, {
|
|
1163
|
+
duration,
|
|
1164
|
+
easing: EASING.STANDARD,
|
|
1165
|
+
direction: newVal ? "normal" : "reverse"
|
|
1166
|
+
}).finished.then(() => {
|
|
1167
|
+
el.style.removeProperty("visibility");
|
|
1168
|
+
targetEl.style.removeProperty("visibility");
|
|
1169
|
+
});
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
}, { flush: "post" });
|
|
467
1173
|
});
|
|
1174
|
+
/*********************************************************
|
|
1175
|
+
* Class & Style
|
|
1176
|
+
*
|
|
1177
|
+
* @description
|
|
1178
|
+
* fieldClasses is a computed property that returns an array of classes for the field element.
|
|
1179
|
+
* fieldStyles is a computed property that returns an array of styles for the field element.
|
|
1180
|
+
********************************************************/
|
|
1181
|
+
// `activeColor` / `activeBgColor` (flat props) were removed — the
|
|
1182
|
+
// override now reads from the `active` object prop (`activeState`,
|
|
1183
|
+
// already resolved above by `useStateFlag` for the rounded/elevation
|
|
1184
|
+
// axes at line ~541). Gate stays `isActive.value && isFocused.value`
|
|
1185
|
+
// exactly as before: `isActive` alone also turns true on dirty/prefix/
|
|
1186
|
+
// suffix WITHOUT focus, and the accent colour is deliberately a
|
|
1187
|
+
// focus-only affordance (unlike rounded/elevation, which persist once
|
|
1188
|
+
// the field carries content).
|
|
468
1189
|
const color = computed(() => {
|
|
469
|
-
|
|
1190
|
+
return isActive.value && isFocused.value && activeState.value?.color ? activeState.value.color : props.color;
|
|
470
1191
|
});
|
|
471
1192
|
const bgColor = computed(() => {
|
|
472
|
-
|
|
1193
|
+
return isActive.value && isFocused.value && activeState.value?.bgColor ? activeState.value.bgColor : props.bgColor;
|
|
473
1194
|
});
|
|
1195
|
+
// Phase 3 (Vague D) — class-first companion alongside inline styles.
|
|
1196
|
+
/*********************************************************
|
|
1197
|
+
* Color
|
|
1198
|
+
********************************************************/
|
|
474
1199
|
const { colorClasses, colorStyles } = useBothColor(bgColor, color);
|
|
1200
|
+
/*********************************************************
|
|
1201
|
+
* Border — #726
|
|
1202
|
+
*
|
|
1203
|
+
* @description
|
|
1204
|
+
* `borderStyles` ONLY. `borderClasses` is deliberately NOT bound on the
|
|
1205
|
+
* field root: `.origam--border-*` is a real `border-width` utility, so it
|
|
1206
|
+
* would paint a rectangle around `.origam-field` whose top edge sits
|
|
1207
|
+
* exactly where the floating label floats — re-creating the very defect
|
|
1208
|
+
* this fixes, one element further in.
|
|
1209
|
+
*
|
|
1210
|
+
* @description
|
|
1211
|
+
* The resolved declarations are re-routed into the outline's own token
|
|
1212
|
+
* channel by `fieldBorderVarStyles` below.
|
|
1213
|
+
********************************************************/
|
|
475
1214
|
const { borderStyles } = useBorder(props);
|
|
476
1215
|
const { densityClasses } = useDensity(props);
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
} = useStateEffect(props, void 0, isActive, void 0, activeState);
|
|
1216
|
+
// Field re-defines its own `isActive` computed above (line 405) combining
|
|
1217
|
+
// `active` from useActive + `dirty` + `hasPrefix` + `hasSuffix` — pass
|
|
1218
|
+
// the computed one so the state-aware rounded / elevation cycle through
|
|
1219
|
+
// any `:active="{ rounded: 'lg', elevation: 'md' }"` override.
|
|
1220
|
+
const { roundedClasses, roundedStyles, elevationClasses, elevationStyles } = useStateEffect(props, undefined, isActive, undefined, activeState);
|
|
483
1221
|
const { rtlClasses } = useRtl();
|
|
484
1222
|
const { variantClasses } = useVariant(props);
|
|
485
1223
|
const { sizeClasses } = useSize(props, "origam-field");
|
|
1224
|
+
// The `rounded` prop rounds the OUTER box (inline `border-radius` via
|
|
1225
|
+
// useStyle), but the field's inner chrome (outline legs, per-corner radii)
|
|
1226
|
+
// reads `--origam-field---border-radius` — which the prop never touched, so
|
|
1227
|
+
// the outline corners stayed at the default and mismatched the box (themes
|
|
1228
|
+
// had to force the var with `!important` hacks). Mirror the radius already
|
|
1229
|
+
// resolved by `roundedStyles` into the component var so both stay in sync.
|
|
1230
|
+
// (`shaped`/`shaped-invert` emit nothing here and stay SCSS-owned.)
|
|
486
1231
|
const fieldRadiusVarStyles = computed(() => {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
1232
|
+
const declarations = roundedStyles.value;
|
|
1233
|
+
if (!Array.isArray(declarations)) return [];
|
|
1234
|
+
const radius = declarations.find((declaration) => declaration.startsWith("border-radius:"));
|
|
1235
|
+
if (!radius) return [];
|
|
1236
|
+
return [`--origam-field---border-radius: ${radius.slice("border-radius:".length).trim()}`];
|
|
492
1237
|
});
|
|
1238
|
+
/*********************************************************
|
|
1239
|
+
* fieldBorderVarStyles — #726
|
|
1240
|
+
*
|
|
1241
|
+
* @description
|
|
1242
|
+
* `border` used to live ONLY on the outer `OrigamInput` wrapper, which has
|
|
1243
|
+
* no notch: `useBorder` painted a real CSS border on that box and its top
|
|
1244
|
+
* edge ran straight THROUGH the floating label (measured on the live
|
|
1245
|
+
* story: label box `[-7, 11]`, input border band `[0, 2]`, 61.41 px² of
|
|
1246
|
+
* label crossed).
|
|
1247
|
+
*
|
|
1248
|
+
* @description
|
|
1249
|
+
* The field already owns a notched outline — three legs (`--start` /
|
|
1250
|
+
* `--notch` / `--end`) whose width, style and colour are driven entirely
|
|
1251
|
+
* by `--origam-field---border-width`,
|
|
1252
|
+
* `--origam-field__outline---border-style` and
|
|
1253
|
+
* `--origam-field---border-color`, and whose `--notch` leg drops its top
|
|
1254
|
+
* border to 0 under `--active` / `--focused`. That IS the notch.
|
|
1255
|
+
*
|
|
1256
|
+
* @description
|
|
1257
|
+
* So the fix is not to draw a second border anywhere: it is to feed the
|
|
1258
|
+
* channel the mechanism already reads, exactly as `fieldRadiusVarStyles`
|
|
1259
|
+
* above mirrors `rounded` into `--origam-field---border-radius`.
|
|
1260
|
+
*
|
|
1261
|
+
* @description
|
|
1262
|
+
* Only the three GLOBAL declarations are mapped. A directional value
|
|
1263
|
+
* (`border="top"`) emits per-side widths, which have no meaning on a
|
|
1264
|
+
* three-leg outline — those are deliberately left unmapped (the leg keeps
|
|
1265
|
+
* the variant's own width; style and colour, which `useBorder` still emits
|
|
1266
|
+
* globally, do land).
|
|
1267
|
+
*
|
|
1268
|
+
* @description
|
|
1269
|
+
* When no border prop is passed `useBorder` returns an empty array, so
|
|
1270
|
+
* this emits nothing and the field renders exactly as it did before.
|
|
1271
|
+
********************************************************/
|
|
493
1272
|
const fieldBorderVarStyles = computed(() => {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
1273
|
+
const declarations = borderStyles.value;
|
|
1274
|
+
if (!Array.isArray(declarations)) return [];
|
|
1275
|
+
const vars = [];
|
|
1276
|
+
const lastValueOf = (property) => {
|
|
1277
|
+
const prefix = `${property}:`;
|
|
1278
|
+
const match = declarations.filter((declaration) => declaration.startsWith(prefix)).pop();
|
|
1279
|
+
return match ? match.slice(prefix.length).trim() : null;
|
|
1280
|
+
};
|
|
1281
|
+
const width = lastValueOf("border-width");
|
|
1282
|
+
const style = lastValueOf("border-style");
|
|
1283
|
+
const color = lastValueOf("border-color");
|
|
1284
|
+
if (width) vars.push(`--origam-field---border-width: ${width}`);
|
|
1285
|
+
if (style) vars.push(`--origam-field__outline---border-style: ${style}`);
|
|
1286
|
+
/*********************************************************
|
|
1287
|
+
* Colour — forced opaque
|
|
1288
|
+
*
|
|
1289
|
+
* @description
|
|
1290
|
+
* The outline legs read the colour through
|
|
1291
|
+
* `--origam-field---border-color` and paint at
|
|
1292
|
+
* `--origam-field---border-opacity` (.38 by default). An explicit
|
|
1293
|
+
* border colour is an explicit request, so force it opaque —
|
|
1294
|
+
* otherwise `border="2px solid red"` renders a washed-out pink.
|
|
1295
|
+
********************************************************/
|
|
1296
|
+
if (color) {
|
|
1297
|
+
vars.push(`--origam-field---border-color: ${color}`);
|
|
1298
|
+
vars.push("--origam-field---border-opacity: 1");
|
|
1299
|
+
}
|
|
1300
|
+
return vars;
|
|
512
1301
|
});
|
|
513
1302
|
const fieldStyles = computed(() => {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
1303
|
+
return [
|
|
1304
|
+
colorStyles.value,
|
|
1305
|
+
roundedStyles.value,
|
|
1306
|
+
fieldRadiusVarStyles.value,
|
|
1307
|
+
fieldBorderVarStyles.value,
|
|
1308
|
+
elevationStyles.value,
|
|
1309
|
+
props.style
|
|
1310
|
+
];
|
|
522
1311
|
});
|
|
523
1312
|
const fieldProgressClasses = computed(() => {
|
|
524
|
-
|
|
525
|
-
"origam-field__progress",
|
|
526
|
-
`origam-field__progress--${loaderConfig.value.kind === "line" ? "linear" : loaderConfig.value.kind}`
|
|
527
|
-
];
|
|
1313
|
+
return ["origam-field__progress", `origam-field__progress--${loaderConfig.value.kind === "line" ? "linear" : loaderConfig.value.kind}`];
|
|
528
1314
|
});
|
|
529
1315
|
const fieldClasses = computed(() => {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
1316
|
+
return [
|
|
1317
|
+
"origam-field",
|
|
1318
|
+
{
|
|
1319
|
+
"origam-field--active": isActive.value,
|
|
1320
|
+
"origam-field--appended": hasAppendInner.value,
|
|
1321
|
+
"origam-field--center-affix": props.centerAffix,
|
|
1322
|
+
"origam-field--disabled": props.disabled,
|
|
1323
|
+
"origam-field--dirty": props.dirty,
|
|
1324
|
+
"origam-field--error": props.error,
|
|
1325
|
+
"origam-field--has-background": !!props.bgColor,
|
|
1326
|
+
"origam-field--inline": props.inline,
|
|
1327
|
+
"origam-field--persistent-clear": props.persistentClear,
|
|
1328
|
+
"origam-field--prepended": hasPrependInner.value,
|
|
1329
|
+
"origam-field--single-line": props.singleLine,
|
|
1330
|
+
"origam-field--no-label": !hasLabel.value,
|
|
1331
|
+
"origam-text-field--prefixed": props.prefix,
|
|
1332
|
+
"origam-text-field--suffixed": props.suffix
|
|
1333
|
+
},
|
|
1334
|
+
loaderClasses.value,
|
|
1335
|
+
colorClasses.value,
|
|
1336
|
+
rtlClasses.value,
|
|
1337
|
+
densityClasses.value,
|
|
1338
|
+
focusClasses.value,
|
|
1339
|
+
variantClasses.value,
|
|
1340
|
+
roundedClasses.value,
|
|
1341
|
+
elevationClasses.value,
|
|
1342
|
+
sizeClasses.value,
|
|
1343
|
+
props.class
|
|
1344
|
+
];
|
|
559
1345
|
});
|
|
1346
|
+
/*********************************************************
|
|
1347
|
+
* Expose
|
|
1348
|
+
*
|
|
1349
|
+
* @description
|
|
1350
|
+
* Forwards filterProps to parent components.
|
|
1351
|
+
********************************************************/
|
|
560
1352
|
const { filterProps } = useProps(props);
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
1353
|
+
/*********************************************************
|
|
1354
|
+
* styleId — l'id de la RACINE, derive de celui du consommateur
|
|
1355
|
+
*
|
|
1356
|
+
* @description
|
|
1357
|
+
* #421/#422 — `useStyle(fieldStyles)` etait appele sans son second
|
|
1358
|
+
* argument : la racine rendait `origam-field-<uid>` et l'id du
|
|
1359
|
+
* consommateur n'atteignait jamais le wrapper.
|
|
1360
|
+
*
|
|
1361
|
+
* @description
|
|
1362
|
+
* ⛔ La correction evidente — lier `:id="id"` sur la racine — est
|
|
1363
|
+
* FAUSSE. `props.id` est deja porte par le vrai controle (via
|
|
1364
|
+
* `slotProps.id`) et sert de cible aux `for=` des deux labels : le
|
|
1365
|
+
* poser aussi sur la racine fabriquerait DEUX elements de meme id et
|
|
1366
|
+
* casserait le pairage `label[for]`. Le meme piege a ete mesure sur
|
|
1367
|
+
* `OrigamInput` (#421), ou six consommateurs de la famille auraient
|
|
1368
|
+
* pris un id duplique.
|
|
1369
|
+
*
|
|
1370
|
+
* @description
|
|
1371
|
+
* D'ou un id DERIVE : adressable et deterministe pour qui veut cibler
|
|
1372
|
+
* le wrapper, jamais egal a celui du controle. Le getter garde la
|
|
1373
|
+
* lecture PARESSEUSE (ADR-005) : le resolveur de theme ecrit dans
|
|
1374
|
+
* `beforeCreate`, donc APRES `setup()`.
|
|
1375
|
+
********************************************************/
|
|
1376
|
+
const { id: styleId, css, load, isLoaded, unload } = useStyle(fieldStyles, () => props.id ? `${props.id}-field` : undefined);
|
|
565
1377
|
defineExpose({
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
1378
|
+
filterProps,
|
|
1379
|
+
css,
|
|
1380
|
+
id,
|
|
1381
|
+
load,
|
|
1382
|
+
unload,
|
|
1383
|
+
isLoaded,
|
|
1384
|
+
styleId
|
|
573
1385
|
});
|
|
574
1386
|
</script>
|
|
575
1387
|
|