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
|
@@ -168,349 +168,1093 @@ import { filterInputAttrs } from "../../utils/Input/input.util";
|
|
|
168
168
|
import { focusChild, wrapInArray } from "../../utils/Commons/commons.util";
|
|
169
169
|
import { forwardRefs } from "../../utils/Commons/forwardRefs.util";
|
|
170
170
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
171
|
+
/*********************************************************
|
|
172
|
+
* Global
|
|
173
|
+
*
|
|
174
|
+
* @description
|
|
175
|
+
* Props, emits, slots and filterProps for the OtpInputField component.
|
|
176
|
+
********************************************************/
|
|
171
177
|
const props = defineProps({
|
|
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
|
-
|
|
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
|
-
|
|
178
|
+
autofocus: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
required: false
|
|
181
|
+
},
|
|
182
|
+
divider: {
|
|
183
|
+
type: String,
|
|
184
|
+
required: false
|
|
185
|
+
},
|
|
186
|
+
focusAll: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
required: false
|
|
189
|
+
},
|
|
190
|
+
length: {
|
|
191
|
+
type: [Number, String],
|
|
192
|
+
required: false,
|
|
193
|
+
default: 6
|
|
194
|
+
},
|
|
195
|
+
modelValue: {
|
|
196
|
+
type: [
|
|
197
|
+
Number,
|
|
198
|
+
String,
|
|
199
|
+
null
|
|
200
|
+
],
|
|
201
|
+
required: false
|
|
202
|
+
},
|
|
203
|
+
placeholder: {
|
|
204
|
+
type: String,
|
|
205
|
+
required: false
|
|
206
|
+
},
|
|
207
|
+
role: {
|
|
208
|
+
type: String,
|
|
209
|
+
required: false,
|
|
210
|
+
default: "group"
|
|
211
|
+
},
|
|
212
|
+
type: {
|
|
213
|
+
type: null,
|
|
214
|
+
required: false,
|
|
215
|
+
default: OTP_INPUT_FIELD_TYPE.NUMBER
|
|
216
|
+
},
|
|
217
|
+
centerAffix: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
dirty: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
disabled: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
required: false
|
|
228
|
+
},
|
|
229
|
+
error: {
|
|
230
|
+
type: [String, Boolean],
|
|
231
|
+
required: false
|
|
232
|
+
},
|
|
233
|
+
inline: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
required: false
|
|
236
|
+
},
|
|
237
|
+
label: {
|
|
238
|
+
type: String,
|
|
239
|
+
required: false
|
|
240
|
+
},
|
|
241
|
+
prefix: {
|
|
242
|
+
type: String,
|
|
243
|
+
required: false
|
|
244
|
+
},
|
|
245
|
+
suffix: {
|
|
246
|
+
type: String,
|
|
247
|
+
required: false
|
|
248
|
+
},
|
|
249
|
+
persistentClear: {
|
|
250
|
+
type: Boolean,
|
|
251
|
+
required: false
|
|
252
|
+
},
|
|
253
|
+
singleLine: {
|
|
254
|
+
type: Boolean,
|
|
255
|
+
required: false
|
|
256
|
+
},
|
|
257
|
+
required: {
|
|
258
|
+
type: Boolean,
|
|
259
|
+
required: false
|
|
260
|
+
},
|
|
261
|
+
id: {
|
|
262
|
+
type: String,
|
|
263
|
+
required: false
|
|
264
|
+
},
|
|
265
|
+
class: {
|
|
266
|
+
type: [
|
|
267
|
+
String,
|
|
268
|
+
Array,
|
|
269
|
+
Object
|
|
270
|
+
],
|
|
271
|
+
required: false
|
|
272
|
+
},
|
|
273
|
+
style: {
|
|
274
|
+
type: [
|
|
275
|
+
String,
|
|
276
|
+
Array,
|
|
277
|
+
Object,
|
|
278
|
+
Boolean,
|
|
279
|
+
null
|
|
280
|
+
],
|
|
281
|
+
required: false,
|
|
282
|
+
skipCheck: true
|
|
283
|
+
},
|
|
284
|
+
loading: {
|
|
285
|
+
type: [
|
|
286
|
+
Boolean,
|
|
287
|
+
Number,
|
|
288
|
+
Object
|
|
289
|
+
],
|
|
290
|
+
required: false
|
|
291
|
+
},
|
|
292
|
+
loadingText: {
|
|
293
|
+
type: String,
|
|
294
|
+
required: false
|
|
295
|
+
},
|
|
296
|
+
tag: {
|
|
297
|
+
type: String,
|
|
298
|
+
required: false
|
|
299
|
+
},
|
|
300
|
+
color: {
|
|
301
|
+
type: [
|
|
302
|
+
String,
|
|
303
|
+
Object,
|
|
304
|
+
Boolean,
|
|
305
|
+
null
|
|
306
|
+
],
|
|
307
|
+
required: false,
|
|
308
|
+
skipCheck: true
|
|
309
|
+
},
|
|
310
|
+
bgColor: {
|
|
311
|
+
type: [
|
|
312
|
+
String,
|
|
313
|
+
Object,
|
|
314
|
+
Boolean,
|
|
315
|
+
null
|
|
316
|
+
],
|
|
317
|
+
required: false,
|
|
318
|
+
skipCheck: true
|
|
319
|
+
},
|
|
320
|
+
appendInnerAvatar: {
|
|
321
|
+
type: String,
|
|
322
|
+
required: false
|
|
323
|
+
},
|
|
324
|
+
appendInnerIcon: {
|
|
325
|
+
type: null,
|
|
326
|
+
required: false
|
|
327
|
+
},
|
|
328
|
+
prependInnerAvatar: {
|
|
329
|
+
type: String,
|
|
330
|
+
required: false
|
|
331
|
+
},
|
|
332
|
+
prependInnerIcon: {
|
|
333
|
+
type: null,
|
|
334
|
+
required: false
|
|
335
|
+
},
|
|
336
|
+
clearIcon: {
|
|
337
|
+
type: null,
|
|
338
|
+
required: false
|
|
339
|
+
},
|
|
340
|
+
clearable: {
|
|
341
|
+
type: Boolean,
|
|
342
|
+
required: false
|
|
343
|
+
},
|
|
344
|
+
prependInnerAriaLabel: {
|
|
345
|
+
type: String,
|
|
346
|
+
required: false
|
|
347
|
+
},
|
|
348
|
+
appendInnerAriaLabel: {
|
|
349
|
+
type: String,
|
|
350
|
+
required: false
|
|
351
|
+
},
|
|
352
|
+
border: {
|
|
353
|
+
type: [
|
|
354
|
+
Boolean,
|
|
355
|
+
Number,
|
|
356
|
+
String,
|
|
357
|
+
Array
|
|
358
|
+
],
|
|
359
|
+
required: false,
|
|
360
|
+
skipCheck: true
|
|
361
|
+
},
|
|
362
|
+
borderTop: {
|
|
363
|
+
type: [
|
|
364
|
+
Boolean,
|
|
365
|
+
Number,
|
|
366
|
+
String
|
|
367
|
+
],
|
|
368
|
+
required: false
|
|
369
|
+
},
|
|
370
|
+
borderLeft: {
|
|
371
|
+
type: [
|
|
372
|
+
Boolean,
|
|
373
|
+
Number,
|
|
374
|
+
String
|
|
375
|
+
],
|
|
376
|
+
required: false
|
|
377
|
+
},
|
|
378
|
+
borderBottom: {
|
|
379
|
+
type: [
|
|
380
|
+
Boolean,
|
|
381
|
+
Number,
|
|
382
|
+
String
|
|
383
|
+
],
|
|
384
|
+
required: false
|
|
385
|
+
},
|
|
386
|
+
borderRight: {
|
|
387
|
+
type: [
|
|
388
|
+
Boolean,
|
|
389
|
+
Number,
|
|
390
|
+
String
|
|
391
|
+
],
|
|
392
|
+
required: false
|
|
393
|
+
},
|
|
394
|
+
borderBlock: {
|
|
395
|
+
type: [
|
|
396
|
+
Boolean,
|
|
397
|
+
Number,
|
|
398
|
+
String
|
|
399
|
+
],
|
|
400
|
+
required: false
|
|
401
|
+
},
|
|
402
|
+
borderInline: {
|
|
403
|
+
type: [
|
|
404
|
+
Boolean,
|
|
405
|
+
Number,
|
|
406
|
+
String
|
|
407
|
+
],
|
|
408
|
+
required: false
|
|
409
|
+
},
|
|
410
|
+
borderInlineStart: {
|
|
411
|
+
type: [
|
|
412
|
+
Boolean,
|
|
413
|
+
Number,
|
|
414
|
+
String
|
|
415
|
+
],
|
|
416
|
+
required: false
|
|
417
|
+
},
|
|
418
|
+
borderInlineEnd: {
|
|
419
|
+
type: [
|
|
420
|
+
Boolean,
|
|
421
|
+
Number,
|
|
422
|
+
String
|
|
423
|
+
],
|
|
424
|
+
required: false
|
|
425
|
+
},
|
|
426
|
+
borderBlockStart: {
|
|
427
|
+
type: [
|
|
428
|
+
Boolean,
|
|
429
|
+
Number,
|
|
430
|
+
String
|
|
431
|
+
],
|
|
432
|
+
required: false
|
|
433
|
+
},
|
|
434
|
+
borderBlockEnd: {
|
|
435
|
+
type: [
|
|
436
|
+
Boolean,
|
|
437
|
+
Number,
|
|
438
|
+
String
|
|
439
|
+
],
|
|
440
|
+
required: false
|
|
441
|
+
},
|
|
442
|
+
borderColor: {
|
|
443
|
+
type: String,
|
|
444
|
+
required: false
|
|
445
|
+
},
|
|
446
|
+
borderStyle: {
|
|
447
|
+
type: String,
|
|
448
|
+
required: false
|
|
449
|
+
},
|
|
450
|
+
borderTopColor: {
|
|
451
|
+
type: [
|
|
452
|
+
String,
|
|
453
|
+
Object,
|
|
454
|
+
Boolean,
|
|
455
|
+
null
|
|
456
|
+
],
|
|
457
|
+
required: false,
|
|
458
|
+
skipCheck: true
|
|
459
|
+
},
|
|
460
|
+
borderRightColor: {
|
|
461
|
+
type: [
|
|
462
|
+
String,
|
|
463
|
+
Object,
|
|
464
|
+
Boolean,
|
|
465
|
+
null
|
|
466
|
+
],
|
|
467
|
+
required: false,
|
|
468
|
+
skipCheck: true
|
|
469
|
+
},
|
|
470
|
+
borderBottomColor: {
|
|
471
|
+
type: [
|
|
472
|
+
String,
|
|
473
|
+
Object,
|
|
474
|
+
Boolean,
|
|
475
|
+
null
|
|
476
|
+
],
|
|
477
|
+
required: false,
|
|
478
|
+
skipCheck: true
|
|
479
|
+
},
|
|
480
|
+
borderLeftColor: {
|
|
481
|
+
type: [
|
|
482
|
+
String,
|
|
483
|
+
Object,
|
|
484
|
+
Boolean,
|
|
485
|
+
null
|
|
486
|
+
],
|
|
487
|
+
required: false,
|
|
488
|
+
skipCheck: true
|
|
489
|
+
},
|
|
490
|
+
borderInlineStartColor: {
|
|
491
|
+
type: [
|
|
492
|
+
String,
|
|
493
|
+
Object,
|
|
494
|
+
Boolean,
|
|
495
|
+
null
|
|
496
|
+
],
|
|
497
|
+
required: false,
|
|
498
|
+
skipCheck: true
|
|
499
|
+
},
|
|
500
|
+
borderInlineEndColor: {
|
|
501
|
+
type: [
|
|
502
|
+
String,
|
|
503
|
+
Object,
|
|
504
|
+
Boolean,
|
|
505
|
+
null
|
|
506
|
+
],
|
|
507
|
+
required: false,
|
|
508
|
+
skipCheck: true
|
|
509
|
+
},
|
|
510
|
+
borderBlockStartColor: {
|
|
511
|
+
type: [
|
|
512
|
+
String,
|
|
513
|
+
Object,
|
|
514
|
+
Boolean,
|
|
515
|
+
null
|
|
516
|
+
],
|
|
517
|
+
required: false,
|
|
518
|
+
skipCheck: true
|
|
519
|
+
},
|
|
520
|
+
borderBlockEndColor: {
|
|
521
|
+
type: [
|
|
522
|
+
String,
|
|
523
|
+
Object,
|
|
524
|
+
Boolean,
|
|
525
|
+
null
|
|
526
|
+
],
|
|
527
|
+
required: false,
|
|
528
|
+
skipCheck: true
|
|
529
|
+
},
|
|
530
|
+
focused: {
|
|
531
|
+
type: Boolean,
|
|
532
|
+
required: false
|
|
533
|
+
},
|
|
534
|
+
density: {
|
|
535
|
+
type: null,
|
|
536
|
+
required: false
|
|
537
|
+
},
|
|
538
|
+
text: {
|
|
539
|
+
type: String,
|
|
540
|
+
required: false
|
|
541
|
+
},
|
|
542
|
+
floating: {
|
|
543
|
+
type: Boolean,
|
|
544
|
+
required: false
|
|
545
|
+
},
|
|
546
|
+
name: {
|
|
547
|
+
type: String,
|
|
548
|
+
required: false
|
|
549
|
+
},
|
|
550
|
+
margin: {
|
|
551
|
+
type: [
|
|
552
|
+
Boolean,
|
|
553
|
+
Number,
|
|
554
|
+
String
|
|
555
|
+
],
|
|
556
|
+
required: false
|
|
557
|
+
},
|
|
558
|
+
marginTop: {
|
|
559
|
+
type: [
|
|
560
|
+
Boolean,
|
|
561
|
+
Number,
|
|
562
|
+
String
|
|
563
|
+
],
|
|
564
|
+
required: false
|
|
565
|
+
},
|
|
566
|
+
marginLeft: {
|
|
567
|
+
type: [
|
|
568
|
+
Boolean,
|
|
569
|
+
Number,
|
|
570
|
+
String
|
|
571
|
+
],
|
|
572
|
+
required: false
|
|
573
|
+
},
|
|
574
|
+
marginBottom: {
|
|
575
|
+
type: [
|
|
576
|
+
Boolean,
|
|
577
|
+
Number,
|
|
578
|
+
String
|
|
579
|
+
],
|
|
580
|
+
required: false
|
|
581
|
+
},
|
|
582
|
+
marginRight: {
|
|
583
|
+
type: [
|
|
584
|
+
Boolean,
|
|
585
|
+
Number,
|
|
586
|
+
String
|
|
587
|
+
],
|
|
588
|
+
required: false
|
|
589
|
+
},
|
|
590
|
+
marginBlock: {
|
|
591
|
+
type: [
|
|
592
|
+
Boolean,
|
|
593
|
+
Number,
|
|
594
|
+
String
|
|
595
|
+
],
|
|
596
|
+
required: false
|
|
597
|
+
},
|
|
598
|
+
marginInline: {
|
|
599
|
+
type: [
|
|
600
|
+
Boolean,
|
|
601
|
+
Number,
|
|
602
|
+
String
|
|
603
|
+
],
|
|
604
|
+
required: false
|
|
605
|
+
},
|
|
606
|
+
marginInlineStart: {
|
|
607
|
+
type: [
|
|
608
|
+
Boolean,
|
|
609
|
+
Number,
|
|
610
|
+
String
|
|
611
|
+
],
|
|
612
|
+
required: false
|
|
613
|
+
},
|
|
614
|
+
marginInlineEnd: {
|
|
615
|
+
type: [
|
|
616
|
+
Boolean,
|
|
617
|
+
Number,
|
|
618
|
+
String
|
|
619
|
+
],
|
|
620
|
+
required: false
|
|
621
|
+
},
|
|
622
|
+
marginBlockStart: {
|
|
623
|
+
type: [
|
|
624
|
+
Boolean,
|
|
625
|
+
Number,
|
|
626
|
+
String
|
|
627
|
+
],
|
|
628
|
+
required: false
|
|
629
|
+
},
|
|
630
|
+
marginBlockEnd: {
|
|
631
|
+
type: [
|
|
632
|
+
Boolean,
|
|
633
|
+
Number,
|
|
634
|
+
String
|
|
635
|
+
],
|
|
636
|
+
required: false
|
|
637
|
+
},
|
|
638
|
+
padding: {
|
|
639
|
+
type: [
|
|
640
|
+
Boolean,
|
|
641
|
+
Number,
|
|
642
|
+
String
|
|
643
|
+
],
|
|
644
|
+
required: false
|
|
645
|
+
},
|
|
646
|
+
paddingTop: {
|
|
647
|
+
type: [
|
|
648
|
+
Boolean,
|
|
649
|
+
Number,
|
|
650
|
+
String
|
|
651
|
+
],
|
|
652
|
+
required: false
|
|
653
|
+
},
|
|
654
|
+
paddingLeft: {
|
|
655
|
+
type: [
|
|
656
|
+
Boolean,
|
|
657
|
+
Number,
|
|
658
|
+
String
|
|
659
|
+
],
|
|
660
|
+
required: false
|
|
661
|
+
},
|
|
662
|
+
paddingBottom: {
|
|
663
|
+
type: [
|
|
664
|
+
Boolean,
|
|
665
|
+
Number,
|
|
666
|
+
String
|
|
667
|
+
],
|
|
668
|
+
required: false
|
|
669
|
+
},
|
|
670
|
+
paddingRight: {
|
|
671
|
+
type: [
|
|
672
|
+
Boolean,
|
|
673
|
+
Number,
|
|
674
|
+
String
|
|
675
|
+
],
|
|
676
|
+
required: false
|
|
677
|
+
},
|
|
678
|
+
paddingBlock: {
|
|
679
|
+
type: [
|
|
680
|
+
Boolean,
|
|
681
|
+
Number,
|
|
682
|
+
String
|
|
683
|
+
],
|
|
684
|
+
required: false
|
|
685
|
+
},
|
|
686
|
+
paddingInline: {
|
|
687
|
+
type: [
|
|
688
|
+
Boolean,
|
|
689
|
+
Number,
|
|
690
|
+
String
|
|
691
|
+
],
|
|
692
|
+
required: false
|
|
693
|
+
},
|
|
694
|
+
paddingInlineStart: {
|
|
695
|
+
type: [
|
|
696
|
+
Boolean,
|
|
697
|
+
Number,
|
|
698
|
+
String
|
|
699
|
+
],
|
|
700
|
+
required: false
|
|
701
|
+
},
|
|
702
|
+
paddingInlineEnd: {
|
|
703
|
+
type: [
|
|
704
|
+
Boolean,
|
|
705
|
+
Number,
|
|
706
|
+
String
|
|
707
|
+
],
|
|
708
|
+
required: false
|
|
709
|
+
},
|
|
710
|
+
paddingBlockStart: {
|
|
711
|
+
type: [
|
|
712
|
+
Boolean,
|
|
713
|
+
Number,
|
|
714
|
+
String
|
|
715
|
+
],
|
|
716
|
+
required: false
|
|
717
|
+
},
|
|
718
|
+
paddingBlockEnd: {
|
|
719
|
+
type: [
|
|
720
|
+
Boolean,
|
|
721
|
+
Number,
|
|
722
|
+
String
|
|
723
|
+
],
|
|
724
|
+
required: false
|
|
725
|
+
},
|
|
726
|
+
rounded: {
|
|
727
|
+
type: [
|
|
728
|
+
Boolean,
|
|
729
|
+
Number,
|
|
730
|
+
String,
|
|
731
|
+
null
|
|
732
|
+
],
|
|
733
|
+
required: false,
|
|
734
|
+
skipCheck: true
|
|
735
|
+
},
|
|
736
|
+
roundedTopRight: {
|
|
737
|
+
type: [
|
|
738
|
+
Boolean,
|
|
739
|
+
Number,
|
|
740
|
+
String
|
|
741
|
+
],
|
|
742
|
+
required: false
|
|
743
|
+
},
|
|
744
|
+
roundedTopLeft: {
|
|
745
|
+
type: [
|
|
746
|
+
Boolean,
|
|
747
|
+
Number,
|
|
748
|
+
String
|
|
749
|
+
],
|
|
750
|
+
required: false
|
|
751
|
+
},
|
|
752
|
+
roundedBottomLeft: {
|
|
753
|
+
type: [
|
|
754
|
+
Boolean,
|
|
755
|
+
Number,
|
|
756
|
+
String
|
|
757
|
+
],
|
|
758
|
+
required: false
|
|
759
|
+
},
|
|
760
|
+
roundedBottomRight: {
|
|
761
|
+
type: [
|
|
762
|
+
Boolean,
|
|
763
|
+
Number,
|
|
764
|
+
String
|
|
765
|
+
],
|
|
766
|
+
required: false
|
|
767
|
+
},
|
|
768
|
+
roundedStartStart: {
|
|
769
|
+
type: [
|
|
770
|
+
Boolean,
|
|
771
|
+
Number,
|
|
772
|
+
String
|
|
773
|
+
],
|
|
774
|
+
required: false
|
|
775
|
+
},
|
|
776
|
+
roundedStartEnd: {
|
|
777
|
+
type: [
|
|
778
|
+
Boolean,
|
|
779
|
+
Number,
|
|
780
|
+
String
|
|
781
|
+
],
|
|
782
|
+
required: false
|
|
783
|
+
},
|
|
784
|
+
roundedEndStart: {
|
|
785
|
+
type: [
|
|
786
|
+
Boolean,
|
|
787
|
+
Number,
|
|
788
|
+
String
|
|
789
|
+
],
|
|
790
|
+
required: false
|
|
791
|
+
},
|
|
792
|
+
roundedEndEnd: {
|
|
793
|
+
type: [
|
|
794
|
+
Boolean,
|
|
795
|
+
Number,
|
|
796
|
+
String
|
|
797
|
+
],
|
|
798
|
+
required: false
|
|
799
|
+
},
|
|
800
|
+
fontSize: {
|
|
801
|
+
type: null,
|
|
802
|
+
required: false
|
|
803
|
+
},
|
|
804
|
+
active: {
|
|
805
|
+
type: [Boolean, Object],
|
|
806
|
+
required: false
|
|
807
|
+
},
|
|
808
|
+
activeClass: {
|
|
809
|
+
type: String,
|
|
810
|
+
required: false
|
|
811
|
+
},
|
|
812
|
+
variant: {
|
|
813
|
+
type: null,
|
|
814
|
+
required: false
|
|
815
|
+
},
|
|
816
|
+
elevation: {
|
|
817
|
+
type: [Number, String],
|
|
818
|
+
required: false
|
|
819
|
+
},
|
|
820
|
+
size: {
|
|
821
|
+
type: null,
|
|
822
|
+
required: false
|
|
823
|
+
},
|
|
824
|
+
hideDetails: {
|
|
825
|
+
type: [Boolean, String],
|
|
826
|
+
required: false
|
|
827
|
+
},
|
|
828
|
+
hideSpinButtons: {
|
|
829
|
+
type: Boolean,
|
|
830
|
+
required: false
|
|
831
|
+
},
|
|
832
|
+
hint: {
|
|
833
|
+
type: String,
|
|
834
|
+
required: false
|
|
835
|
+
},
|
|
836
|
+
persistentHint: {
|
|
837
|
+
type: Boolean,
|
|
838
|
+
required: false
|
|
839
|
+
},
|
|
840
|
+
messages: {
|
|
841
|
+
type: [Array, String],
|
|
842
|
+
required: false
|
|
843
|
+
},
|
|
844
|
+
height: {
|
|
845
|
+
type: [Number, String],
|
|
846
|
+
required: false
|
|
847
|
+
},
|
|
848
|
+
maxHeight: {
|
|
849
|
+
type: [Number, String],
|
|
850
|
+
required: false
|
|
851
|
+
},
|
|
852
|
+
maxWidth: {
|
|
853
|
+
type: [Number, String],
|
|
854
|
+
required: false
|
|
855
|
+
},
|
|
856
|
+
minHeight: {
|
|
857
|
+
type: [Number, String],
|
|
858
|
+
required: false
|
|
859
|
+
},
|
|
860
|
+
minWidth: {
|
|
861
|
+
type: [Number, String],
|
|
862
|
+
required: false
|
|
863
|
+
},
|
|
864
|
+
width: {
|
|
865
|
+
type: [Number, String],
|
|
866
|
+
required: false
|
|
867
|
+
},
|
|
868
|
+
direction: {
|
|
869
|
+
type: null,
|
|
870
|
+
required: false
|
|
871
|
+
},
|
|
872
|
+
errorMessages: {
|
|
873
|
+
type: [Array, String],
|
|
874
|
+
required: false
|
|
875
|
+
},
|
|
876
|
+
maxErrors: {
|
|
877
|
+
type: [Number, String],
|
|
878
|
+
required: false
|
|
879
|
+
},
|
|
880
|
+
readonly: {
|
|
881
|
+
type: Boolean,
|
|
882
|
+
required: false
|
|
883
|
+
},
|
|
884
|
+
rules: {
|
|
885
|
+
type: Array,
|
|
886
|
+
required: false
|
|
887
|
+
},
|
|
888
|
+
validateOn: {
|
|
889
|
+
type: null,
|
|
890
|
+
required: false
|
|
891
|
+
},
|
|
892
|
+
validationValue: {
|
|
893
|
+
type: null,
|
|
894
|
+
required: false
|
|
895
|
+
}
|
|
288
896
|
});
|
|
289
|
-
const emits = defineEmits([
|
|
897
|
+
const emits = defineEmits([
|
|
898
|
+
"finish",
|
|
899
|
+
"click:control",
|
|
900
|
+
"mousedown:control",
|
|
901
|
+
"update:modelValue",
|
|
902
|
+
"update:focused",
|
|
903
|
+
"click:appendInner",
|
|
904
|
+
"click:prependInner",
|
|
905
|
+
"click:clear"
|
|
906
|
+
]);
|
|
290
907
|
defineSlots();
|
|
908
|
+
/*********************************************************
|
|
909
|
+
* Frames bornees a la duree de vie du composant (#753)
|
|
910
|
+
*
|
|
911
|
+
* @description
|
|
912
|
+
* Les deux rAF de gestion du focus etaient nus. Leur corps
|
|
913
|
+
* dereference `contentRef.value!` et `inputRef.value[index]` avec un
|
|
914
|
+
* `!` — or apres le demontage `contentRef.value` vaut `null`, et
|
|
915
|
+
* `focusChild(null, target)` n'a aucune raison de survivre a ca. La
|
|
916
|
+
* frame est armee depuis un `keydown`, donc typiquement une touche
|
|
917
|
+
* pressee au moment ou le champ disparait (validation d'OTP qui ferme
|
|
918
|
+
* la modale) tombe pile dans la fenetre.
|
|
919
|
+
********************************************************/
|
|
291
920
|
let disposed = false;
|
|
292
|
-
const frames =
|
|
921
|
+
const frames = new Set();
|
|
293
922
|
const scheduleFrame = (cb) => {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
923
|
+
if (disposed) return;
|
|
924
|
+
const id = requestAnimationFrame(() => {
|
|
925
|
+
frames.delete(id);
|
|
926
|
+
if (disposed) return;
|
|
927
|
+
cb();
|
|
928
|
+
});
|
|
929
|
+
frames.add(id);
|
|
301
930
|
};
|
|
302
931
|
onBeforeUnmount(() => {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
932
|
+
disposed = true;
|
|
933
|
+
for (const id of frames) cancelAnimationFrame(id);
|
|
934
|
+
frames.clear();
|
|
306
935
|
});
|
|
307
936
|
const { filterProps } = useProps(props);
|
|
308
937
|
const { t } = useLocale();
|
|
309
938
|
const attrs = useAttrs();
|
|
310
939
|
const slots = useSlots();
|
|
940
|
+
/*********************************************************
|
|
941
|
+
* Identity
|
|
942
|
+
********************************************************/
|
|
311
943
|
const uid = getUid();
|
|
312
944
|
const id = computed(() => props.id || `otp-input-field-${uid}`);
|
|
313
945
|
const messagesId = computed(() => `${id.value}-messages`);
|
|
946
|
+
/*********************************************************
|
|
947
|
+
* Composables
|
|
948
|
+
********************************************************/
|
|
314
949
|
const { dimensionStyles } = useDimension(props);
|
|
950
|
+
/*********************************************************
|
|
951
|
+
* Effect
|
|
952
|
+
********************************************************/
|
|
315
953
|
const { isFocused, onFocus: focus, onBlur: blur } = useFocus(props);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
954
|
+
/*********************************************************
|
|
955
|
+
* Value & model
|
|
956
|
+
*
|
|
957
|
+
* @description
|
|
958
|
+
* model is a char-array split from the string v-model value.
|
|
959
|
+
* length / fields drive the rendered cell count.
|
|
960
|
+
********************************************************/
|
|
961
|
+
const model = useVModel(props, "modelValue", "", (val) => val == null ? [] : String(val).split(""), (val) => val.join(""));
|
|
323
962
|
const length = computed(() => {
|
|
324
|
-
|
|
963
|
+
return Number(props.length);
|
|
325
964
|
});
|
|
326
965
|
const fields = computed(() => {
|
|
327
|
-
|
|
966
|
+
return Array(length.value).fill(0);
|
|
328
967
|
});
|
|
329
968
|
const otpStringValue = computed(() => model.value.join(""));
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
969
|
+
/*********************************************************
|
|
970
|
+
* Validation
|
|
971
|
+
*
|
|
972
|
+
* @description
|
|
973
|
+
* useValidation evaluates `props.rules` against the joined OTP
|
|
974
|
+
* string (otpStringValue). A Proxy wraps props so that both
|
|
975
|
+
* `modelValue` and `validationValue` accesses transparently
|
|
976
|
+
* return the reactive OTP string — without duplicating the
|
|
977
|
+
* useVModel wiring that already lives above.
|
|
978
|
+
*
|
|
979
|
+
* `validationValue` is overridden DELIBERATELY, not by accident
|
|
980
|
+
* of the `||` condition: an OTP field only ever has one thing
|
|
981
|
+
* worth validating — the joined code the user actually typed.
|
|
982
|
+
* Validating a cell array, or some unrelated consumer-supplied
|
|
983
|
+
* value, has no functional meaning here. The prop stays on the
|
|
984
|
+
* declared surface (it is inherited from `IInputProps`, and
|
|
985
|
+
* removing it would be a public API break), but whatever a
|
|
986
|
+
* consumer passes is IGNORED: the rules always receive
|
|
987
|
+
* `otpStringValue`. This exception is documented in
|
|
988
|
+
* `packages/docs/components/OtpInputField/OrigamOtpInputField.md`
|
|
989
|
+
* and pinned by the `validationValue` tests in
|
|
990
|
+
* `packages/tests/TU/components/OtpInputField/OrigamOtpInputField.spec.ts`.
|
|
991
|
+
* See issue #697.
|
|
992
|
+
*
|
|
993
|
+
* `validationMessages` mirrors the `messages` computed from
|
|
994
|
+
* OrigamInput: errorMessages take precedence, then hint, then
|
|
995
|
+
* props.messages.
|
|
996
|
+
********************************************************/
|
|
997
|
+
const { errorMessages, isPristine, isValid, isValidating, reset: resetValidation, validate, validationClasses } = useValidation(new Proxy(props, { get(target, key) {
|
|
998
|
+
if (key === "modelValue" || key === "validationValue") {
|
|
999
|
+
return otpStringValue.value;
|
|
1000
|
+
}
|
|
1001
|
+
return target[key];
|
|
1002
|
+
} }), "origam-otp-input-field", id);
|
|
350
1003
|
const validationMessages = computed(() => {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
1004
|
+
if (props.errorMessages?.length || !isPristine.value && errorMessages.value.length) {
|
|
1005
|
+
return errorMessages.value;
|
|
1006
|
+
} else if (props.hint && (props.persistentHint || isFocused.value)) {
|
|
1007
|
+
return wrapInArray(props.hint);
|
|
1008
|
+
}
|
|
1009
|
+
return wrapInArray(props.messages ?? []);
|
|
357
1010
|
});
|
|
358
1011
|
const hasMessages = computed(() => validationMessages.value.length > 0);
|
|
359
1012
|
const hasDetails = computed(() => {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
1013
|
+
if (props.hideDetails === true) return false;
|
|
1014
|
+
if (props.hideDetails === "auto") return hasMessages.value;
|
|
1015
|
+
return true;
|
|
363
1016
|
});
|
|
1017
|
+
/*********************************************************
|
|
1018
|
+
* DOM refs
|
|
1019
|
+
*
|
|
1020
|
+
* @description
|
|
1021
|
+
* focusIndex tracks which cell currently has focus (-1 = none).
|
|
1022
|
+
* contentRef is the scrollable wrapper used by focusChild.
|
|
1023
|
+
* inputRef holds native <input> references, one per cell.
|
|
1024
|
+
* origamFieldRef holds OrigamField component references.
|
|
1025
|
+
* current is the currently focused native input.
|
|
1026
|
+
********************************************************/
|
|
364
1027
|
const focusIndex = ref(-1);
|
|
365
1028
|
const contentRef = ref();
|
|
366
1029
|
const inputRef = ref([]);
|
|
367
1030
|
const origamFieldRef = ref([]);
|
|
368
1031
|
const current = computed(() => {
|
|
369
|
-
|
|
1032
|
+
return inputRef.value[focusIndex.value];
|
|
370
1033
|
});
|
|
371
1034
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
372
1035
|
const fieldProps = (index) => {
|
|
373
|
-
|
|
1036
|
+
return origamFieldRef.value?.[index]?.filterProps(props, [
|
|
1037
|
+
"class",
|
|
1038
|
+
"style",
|
|
1039
|
+
"id",
|
|
1040
|
+
"label"
|
|
1041
|
+
]);
|
|
374
1042
|
};
|
|
1043
|
+
/*********************************************************
|
|
1044
|
+
* Event handlers
|
|
1045
|
+
*
|
|
1046
|
+
* @description
|
|
1047
|
+
* handleInput, handleKeydown, handlePaste manage OTP cell navigation.
|
|
1048
|
+
* handleFocus / handleBlur track focusIndex and isFocused state.
|
|
1049
|
+
* reset is exposed for external programmatic clearing.
|
|
1050
|
+
* isInvalidValue guards non-numeric characters in number mode.
|
|
1051
|
+
********************************************************/
|
|
375
1052
|
const handleInput = () => {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
1053
|
+
if (!current.value) return;
|
|
1054
|
+
// The maxlength attribute doesn't work for the number type input, so the text type is used.
|
|
1055
|
+
// The following logic simulates the behavior of a number input.
|
|
1056
|
+
if (isInvalidValue(current.value.value)) {
|
|
1057
|
+
current.value.value = "";
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const array = model.value.slice();
|
|
1061
|
+
const value = current.value.value;
|
|
1062
|
+
array[focusIndex.value] = value;
|
|
1063
|
+
let target = null;
|
|
1064
|
+
if (focusIndex.value > model.value.length) {
|
|
1065
|
+
target = model.value.length + 1;
|
|
1066
|
+
} else if (focusIndex.value + 1 !== length.value) {
|
|
1067
|
+
target = "next";
|
|
1068
|
+
}
|
|
1069
|
+
model.value = array;
|
|
1070
|
+
if (target) focusChild(contentRef.value, target);
|
|
392
1071
|
};
|
|
393
1072
|
const handleKeydown = (e) => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
1073
|
+
const array = model.value.slice();
|
|
1074
|
+
const index = focusIndex.value;
|
|
1075
|
+
let target = null;
|
|
1076
|
+
if (![
|
|
1077
|
+
"ArrowLeft",
|
|
1078
|
+
"ArrowRight",
|
|
1079
|
+
"Backspace",
|
|
1080
|
+
"Delete"
|
|
1081
|
+
].includes(e.key)) return;
|
|
1082
|
+
e.preventDefault();
|
|
1083
|
+
if (e.key === "ArrowLeft") {
|
|
1084
|
+
target = "prev";
|
|
1085
|
+
} else if (e.key === "ArrowRight") {
|
|
1086
|
+
target = "next";
|
|
1087
|
+
} else if (["Backspace", "Delete"].includes(e.key)) {
|
|
1088
|
+
array[focusIndex.value] = "";
|
|
1089
|
+
model.value = array;
|
|
1090
|
+
if (focusIndex.value > 0 && e.key === "Backspace") {
|
|
1091
|
+
target = "prev";
|
|
1092
|
+
} else {
|
|
1093
|
+
scheduleFrame(() => {
|
|
1094
|
+
inputRef.value[index]?.select();
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
scheduleFrame(() => {
|
|
1099
|
+
if (target != null) {
|
|
1100
|
+
focusChild(contentRef.value, target);
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
424
1103
|
};
|
|
425
1104
|
const handlePaste = (index, e) => {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
1105
|
+
e.preventDefault();
|
|
1106
|
+
e.stopPropagation();
|
|
1107
|
+
const clipboardText = e?.clipboardData?.getData("Text").slice(0, length.value) ?? "";
|
|
1108
|
+
if (isInvalidValue(clipboardText)) return;
|
|
1109
|
+
model.value = clipboardText.split("");
|
|
1110
|
+
inputRef.value?.[index].blur();
|
|
432
1111
|
};
|
|
433
1112
|
const reset = () => {
|
|
434
|
-
|
|
1113
|
+
model.value = [];
|
|
435
1114
|
};
|
|
436
1115
|
const handleFocus = (_e, index) => {
|
|
437
|
-
|
|
438
|
-
|
|
1116
|
+
if (!isFocused.value) focus();
|
|
1117
|
+
focusIndex.value = index;
|
|
439
1118
|
};
|
|
440
1119
|
const handleBlur = () => {
|
|
441
|
-
|
|
442
|
-
|
|
1120
|
+
blur();
|
|
1121
|
+
focusIndex.value = -1;
|
|
443
1122
|
};
|
|
1123
|
+
/*********************************************************
|
|
1124
|
+
* Control / clear handlers
|
|
1125
|
+
*
|
|
1126
|
+
* @description
|
|
1127
|
+
* Mirrors the sibling Field-wrapping components (TextField,
|
|
1128
|
+
* NumberField, PasswordField, Select, FileField, DatePickerField,
|
|
1129
|
+
* TextareaField, ColorPickerField): `click:control`/`mousedown:control`
|
|
1130
|
+
* relay a click/mousedown on the control area, `click:clear` relays
|
|
1131
|
+
* `<origam-field>`'s own `click:clear` and — same as TextField's
|
|
1132
|
+
* `handleClear` — actually performs the clear via the existing
|
|
1133
|
+
* `reset()` rather than only notifying.
|
|
1134
|
+
********************************************************/
|
|
444
1135
|
const handleControlClick = (e) => {
|
|
445
|
-
|
|
1136
|
+
emits("click:control", e);
|
|
446
1137
|
};
|
|
447
1138
|
const handleControlMousedown = (e) => {
|
|
448
|
-
|
|
1139
|
+
emits("mousedown:control", e);
|
|
449
1140
|
};
|
|
450
1141
|
const handleClear = (e) => {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
1142
|
+
e.stopPropagation();
|
|
1143
|
+
reset();
|
|
1144
|
+
emits("click:clear", e);
|
|
454
1145
|
};
|
|
1146
|
+
/*********************************************************
|
|
1147
|
+
* click:appendInner / click:prependInner relay
|
|
1148
|
+
*
|
|
1149
|
+
* @description
|
|
1150
|
+
* `<origam-field>` (one per OTP cell) already emits both via its own
|
|
1151
|
+
* `useAdjacentInner` when a consumer sets `appendInnerIcon` /
|
|
1152
|
+
* `prependInnerIcon`, but nothing here listened for them — declared,
|
|
1153
|
+
* never fired (issue: guard `unemitted-declarations`,
|
|
1154
|
+
* `OtpInputField:click:appendInner,click:prependInner`). Mirrors
|
|
1155
|
+
* `handleClear` above: relay on THIS component's own instance whichever
|
|
1156
|
+
* cell the click came from.
|
|
1157
|
+
********************************************************/
|
|
455
1158
|
const handleClickAppendInner = (e) => {
|
|
456
|
-
|
|
1159
|
+
emits("click:appendInner", e);
|
|
457
1160
|
};
|
|
458
1161
|
const handleClickPrependInner = (e) => {
|
|
459
|
-
|
|
1162
|
+
emits("click:prependInner", e);
|
|
460
1163
|
};
|
|
461
1164
|
const isInvalidValue = (value) => {
|
|
462
|
-
|
|
1165
|
+
return props.type === OTP_INPUT_FIELD_TYPE.NUMBER && /[^0-9]/g.test(value);
|
|
463
1166
|
};
|
|
464
1167
|
watch(model, (val) => {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
1168
|
+
if (val.length === length.value) {
|
|
1169
|
+
emits("finish", val.join(""));
|
|
1170
|
+
validate();
|
|
1171
|
+
}
|
|
469
1172
|
}, { deep: true });
|
|
470
1173
|
watch(focusIndex, (val) => {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
1174
|
+
if (val < 0) return;
|
|
1175
|
+
nextTick(() => {
|
|
1176
|
+
inputRef.value[val]?.select();
|
|
1177
|
+
});
|
|
475
1178
|
});
|
|
1179
|
+
/*********************************************************
|
|
1180
|
+
* Class & Style
|
|
1181
|
+
*
|
|
1182
|
+
* @description
|
|
1183
|
+
* otpInputFieldStyles and otpInputFieldClasses compose the BEM root.
|
|
1184
|
+
********************************************************/
|
|
476
1185
|
const { typographyStyles } = useTypography(props, "otp-input-field__cell");
|
|
477
1186
|
const otpInputFieldStyles = computed(() => {
|
|
478
|
-
|
|
479
|
-
props.style
|
|
480
|
-
];
|
|
1187
|
+
return [props.style];
|
|
481
1188
|
});
|
|
482
1189
|
const otpInputFieldClasses = computed(() => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
props.class
|
|
490
|
-
];
|
|
1190
|
+
return [
|
|
1191
|
+
"origam-otp-input-field",
|
|
1192
|
+
{ "origam-otp-input-field--divided": !!props.divider },
|
|
1193
|
+
validationClasses.value,
|
|
1194
|
+
props.class
|
|
1195
|
+
];
|
|
491
1196
|
});
|
|
1197
|
+
/*********************************************************
|
|
1198
|
+
* styleId — l'id de la RACINE, celui du consommateur quand il en passe un
|
|
1199
|
+
*
|
|
1200
|
+
* @description
|
|
1201
|
+
* #790 — la racine ne portait AUCUN `:id`, et `useStyle` etait appele
|
|
1202
|
+
* sans son second argument. Deux defauts en un, mesures :
|
|
1203
|
+
* 1. l'`id` du consommateur n'atteignait aucun noeud — un
|
|
1204
|
+
* `getElementById` ou un `aria-describedby` externe ne trouvait
|
|
1205
|
+
* rien, sans le moindre avertissement ;
|
|
1206
|
+
* 2. la regle `#origam-otp-input-field-<uid> { … }` injectee dans
|
|
1207
|
+
* <head> ne matchait aucun noeud — un style MORT et silencieux.
|
|
1208
|
+
*
|
|
1209
|
+
* @description
|
|
1210
|
+
* Les deux contraintes de #790 se satisfont d'un seul geste, et c'est
|
|
1211
|
+
* la raison pour laquelle l'arbitrage redoute par le ticket n'existe
|
|
1212
|
+
* pas : `useStyle` retourne l'id qu'il CIBLE. Lier ce meme id sur la
|
|
1213
|
+
* racine garantit par construction que la regle generee continue de
|
|
1214
|
+
* s'appliquer, que l'id vienne du consommateur ou du repli genere.
|
|
1215
|
+
*
|
|
1216
|
+
* @description
|
|
1217
|
+
* ⛔ Pas de doublon ici, contrairement a `OrigamInput` / `OrigamField`
|
|
1218
|
+
* (#421/#422) : `props.id` n'est porte par aucun autre noeud de cet
|
|
1219
|
+
* arbre — les six `<origam-field>` l'excluent via `filterProps`, et
|
|
1220
|
+
* seul `messagesId` en DERIVE (`<id>-messages`). Mesure a l'appui dans
|
|
1221
|
+
* la sonde de rayon de souffle. La racine est bien le noeud a designer :
|
|
1222
|
+
* elle porte deja `role` et `aria-label`, c'est l'element de groupe.
|
|
1223
|
+
*
|
|
1224
|
+
* @description
|
|
1225
|
+
* Le getter garde la lecture PARESSEUSE (ADR-005) : le resolveur de
|
|
1226
|
+
* theme ecrit dans `beforeCreate`, donc APRES `setup()`.
|
|
1227
|
+
********************************************************/
|
|
492
1228
|
const { id: styleId, css, load, isLoaded, unload } = useStyle(otpInputFieldStyles, () => props.id);
|
|
1229
|
+
/*********************************************************
|
|
1230
|
+
* Expose
|
|
1231
|
+
*
|
|
1232
|
+
* @description
|
|
1233
|
+
* Exposes blur, focus, reset, resetValidation, validate, isValid,
|
|
1234
|
+
* isValidating, errorMessages, isFocused and filterProps to
|
|
1235
|
+
* parent ref consumers.
|
|
1236
|
+
********************************************************/
|
|
493
1237
|
defineExpose(forwardRefs({
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
1238
|
+
blur: () => {
|
|
1239
|
+
inputRef.value?.forEach((input) => input.blur());
|
|
1240
|
+
},
|
|
1241
|
+
focus: () => {
|
|
1242
|
+
inputRef.value?.[0]?.focus();
|
|
1243
|
+
},
|
|
1244
|
+
reset,
|
|
1245
|
+
resetValidation,
|
|
1246
|
+
validate,
|
|
1247
|
+
isValid,
|
|
1248
|
+
isValidating,
|
|
1249
|
+
errorMessages,
|
|
1250
|
+
isFocused,
|
|
1251
|
+
filterProps,
|
|
1252
|
+
css,
|
|
1253
|
+
id,
|
|
1254
|
+
styleId,
|
|
1255
|
+
load,
|
|
1256
|
+
unload,
|
|
1257
|
+
isLoaded
|
|
514
1258
|
}));
|
|
515
1259
|
</script>
|
|
516
1260
|
|