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
|
@@ -301,147 +301,842 @@ import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
|
301
301
|
import { TEXT_FIELD_TYPE } from "../../enums/TextField/text-field.enum";
|
|
302
302
|
import { clamp } from "../../utils/Commons/commons.util";
|
|
303
303
|
import { forwardRefs } from "../../utils/Commons/forwardRefs.util";
|
|
304
|
+
/*********************************************************
|
|
305
|
+
* Global
|
|
306
|
+
*
|
|
307
|
+
* @description
|
|
308
|
+
* Props, emits, slots and filterProps for the NumberField component.
|
|
309
|
+
********************************************************/
|
|
304
310
|
const props = defineProps({
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
311
|
+
autofocus: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
required: false
|
|
314
|
+
},
|
|
315
|
+
placeholder: {
|
|
316
|
+
type: String,
|
|
317
|
+
required: false
|
|
318
|
+
},
|
|
319
|
+
persistentPlaceholder: {
|
|
320
|
+
type: Boolean,
|
|
321
|
+
required: false
|
|
322
|
+
},
|
|
323
|
+
role: {
|
|
324
|
+
type: String,
|
|
325
|
+
required: false
|
|
326
|
+
},
|
|
327
|
+
modelModifiers: {
|
|
328
|
+
type: [String, Boolean],
|
|
329
|
+
required: false
|
|
330
|
+
},
|
|
331
|
+
inset: {
|
|
332
|
+
type: Boolean,
|
|
333
|
+
required: false
|
|
334
|
+
},
|
|
335
|
+
hideInput: {
|
|
336
|
+
type: Boolean,
|
|
337
|
+
required: false
|
|
338
|
+
},
|
|
339
|
+
modelValue: {
|
|
340
|
+
type: [Number, null],
|
|
341
|
+
required: false,
|
|
342
|
+
default: null
|
|
343
|
+
},
|
|
344
|
+
min: {
|
|
345
|
+
type: Number,
|
|
346
|
+
required: false,
|
|
347
|
+
default: Number.MIN_SAFE_INTEGER
|
|
348
|
+
},
|
|
349
|
+
max: {
|
|
350
|
+
type: Number,
|
|
351
|
+
required: false,
|
|
352
|
+
default: Number.MAX_SAFE_INTEGER
|
|
353
|
+
},
|
|
354
|
+
step: {
|
|
355
|
+
type: Number,
|
|
356
|
+
required: false,
|
|
357
|
+
default: 1
|
|
358
|
+
},
|
|
359
|
+
precision: {
|
|
360
|
+
type: Number,
|
|
361
|
+
required: false,
|
|
362
|
+
default: 0
|
|
363
|
+
},
|
|
364
|
+
incrementIcon: {
|
|
365
|
+
type: null,
|
|
366
|
+
required: false,
|
|
367
|
+
default: MDI_ICONS.PLUS
|
|
368
|
+
},
|
|
369
|
+
decrementIcon: {
|
|
370
|
+
type: null,
|
|
371
|
+
required: false,
|
|
372
|
+
default: MDI_ICONS.MINUS
|
|
373
|
+
},
|
|
374
|
+
holdDelay: {
|
|
375
|
+
type: Number,
|
|
376
|
+
required: false,
|
|
377
|
+
default: 500
|
|
378
|
+
},
|
|
379
|
+
holdRepeat: {
|
|
380
|
+
type: Number,
|
|
381
|
+
required: false,
|
|
382
|
+
default: 50
|
|
383
|
+
},
|
|
384
|
+
split: {
|
|
385
|
+
type: Boolean,
|
|
386
|
+
required: false,
|
|
387
|
+
default: false
|
|
388
|
+
},
|
|
389
|
+
hideControls: {
|
|
390
|
+
type: Boolean,
|
|
391
|
+
required: false
|
|
392
|
+
},
|
|
393
|
+
compact: {
|
|
394
|
+
type: Boolean,
|
|
395
|
+
required: false,
|
|
396
|
+
default: false
|
|
397
|
+
},
|
|
398
|
+
decrementAriaLabel: {
|
|
399
|
+
type: String,
|
|
400
|
+
required: false,
|
|
401
|
+
default: "origam.number_field.aria_label.decrement"
|
|
402
|
+
},
|
|
403
|
+
incrementAriaLabel: {
|
|
404
|
+
type: String,
|
|
405
|
+
required: false,
|
|
406
|
+
default: "origam.number_field.aria_label.increment"
|
|
407
|
+
},
|
|
408
|
+
centerAffix: {
|
|
409
|
+
type: Boolean,
|
|
410
|
+
required: false,
|
|
411
|
+
default: true
|
|
412
|
+
},
|
|
413
|
+
dirty: {
|
|
414
|
+
type: Boolean,
|
|
415
|
+
required: false
|
|
416
|
+
},
|
|
417
|
+
disabled: {
|
|
418
|
+
type: Boolean,
|
|
419
|
+
required: false
|
|
420
|
+
},
|
|
421
|
+
error: {
|
|
422
|
+
type: [String, Boolean],
|
|
423
|
+
required: false
|
|
424
|
+
},
|
|
425
|
+
inline: {
|
|
426
|
+
type: Boolean,
|
|
427
|
+
required: false
|
|
428
|
+
},
|
|
429
|
+
label: {
|
|
430
|
+
type: String,
|
|
431
|
+
required: false
|
|
432
|
+
},
|
|
433
|
+
prefix: {
|
|
434
|
+
type: String,
|
|
435
|
+
required: false
|
|
436
|
+
},
|
|
437
|
+
suffix: {
|
|
438
|
+
type: String,
|
|
439
|
+
required: false
|
|
440
|
+
},
|
|
441
|
+
persistentClear: {
|
|
442
|
+
type: Boolean,
|
|
443
|
+
required: false
|
|
444
|
+
},
|
|
445
|
+
singleLine: {
|
|
446
|
+
type: Boolean,
|
|
447
|
+
required: false
|
|
448
|
+
},
|
|
449
|
+
required: {
|
|
450
|
+
type: Boolean,
|
|
451
|
+
required: false
|
|
452
|
+
},
|
|
453
|
+
id: {
|
|
454
|
+
type: String,
|
|
455
|
+
required: false
|
|
456
|
+
},
|
|
457
|
+
class: {
|
|
458
|
+
type: [
|
|
459
|
+
String,
|
|
460
|
+
Array,
|
|
461
|
+
Object
|
|
462
|
+
],
|
|
463
|
+
required: false
|
|
464
|
+
},
|
|
465
|
+
style: {
|
|
466
|
+
type: [
|
|
467
|
+
String,
|
|
468
|
+
Array,
|
|
469
|
+
Object,
|
|
470
|
+
Boolean,
|
|
471
|
+
null
|
|
472
|
+
],
|
|
473
|
+
required: false,
|
|
474
|
+
skipCheck: true
|
|
475
|
+
},
|
|
476
|
+
loading: {
|
|
477
|
+
type: [
|
|
478
|
+
Boolean,
|
|
479
|
+
Number,
|
|
480
|
+
Object
|
|
481
|
+
],
|
|
482
|
+
required: false
|
|
483
|
+
},
|
|
484
|
+
loadingText: {
|
|
485
|
+
type: String,
|
|
486
|
+
required: false
|
|
487
|
+
},
|
|
488
|
+
tag: {
|
|
489
|
+
type: String,
|
|
490
|
+
required: false
|
|
491
|
+
},
|
|
492
|
+
color: {
|
|
493
|
+
type: [
|
|
494
|
+
String,
|
|
495
|
+
Object,
|
|
496
|
+
Boolean,
|
|
497
|
+
null
|
|
498
|
+
],
|
|
499
|
+
required: false,
|
|
500
|
+
skipCheck: true
|
|
501
|
+
},
|
|
502
|
+
bgColor: {
|
|
503
|
+
type: [
|
|
504
|
+
String,
|
|
505
|
+
Object,
|
|
506
|
+
Boolean,
|
|
507
|
+
null
|
|
508
|
+
],
|
|
509
|
+
required: false,
|
|
510
|
+
skipCheck: true
|
|
511
|
+
},
|
|
512
|
+
appendInnerAvatar: {
|
|
513
|
+
type: String,
|
|
514
|
+
required: false
|
|
515
|
+
},
|
|
516
|
+
appendInnerIcon: {
|
|
517
|
+
type: null,
|
|
518
|
+
required: false
|
|
519
|
+
},
|
|
520
|
+
prependInnerAvatar: {
|
|
521
|
+
type: String,
|
|
522
|
+
required: false
|
|
523
|
+
},
|
|
524
|
+
prependInnerIcon: {
|
|
525
|
+
type: null,
|
|
526
|
+
required: false
|
|
527
|
+
},
|
|
528
|
+
clearIcon: {
|
|
529
|
+
type: null,
|
|
530
|
+
required: false
|
|
531
|
+
},
|
|
532
|
+
clearable: {
|
|
533
|
+
type: Boolean,
|
|
534
|
+
required: false
|
|
535
|
+
},
|
|
536
|
+
prependInnerAriaLabel: {
|
|
537
|
+
type: String,
|
|
538
|
+
required: false
|
|
539
|
+
},
|
|
540
|
+
appendInnerAriaLabel: {
|
|
541
|
+
type: String,
|
|
542
|
+
required: false
|
|
543
|
+
},
|
|
544
|
+
border: {
|
|
545
|
+
type: [
|
|
546
|
+
Boolean,
|
|
547
|
+
Number,
|
|
548
|
+
String,
|
|
549
|
+
Array
|
|
550
|
+
],
|
|
551
|
+
required: false,
|
|
552
|
+
skipCheck: true,
|
|
553
|
+
default: true
|
|
554
|
+
},
|
|
555
|
+
borderTop: {
|
|
556
|
+
type: [
|
|
557
|
+
Boolean,
|
|
558
|
+
Number,
|
|
559
|
+
String
|
|
560
|
+
],
|
|
561
|
+
required: false
|
|
562
|
+
},
|
|
563
|
+
borderLeft: {
|
|
564
|
+
type: [
|
|
565
|
+
Boolean,
|
|
566
|
+
Number,
|
|
567
|
+
String
|
|
568
|
+
],
|
|
569
|
+
required: false
|
|
570
|
+
},
|
|
571
|
+
borderBottom: {
|
|
572
|
+
type: [
|
|
573
|
+
Boolean,
|
|
574
|
+
Number,
|
|
575
|
+
String
|
|
576
|
+
],
|
|
577
|
+
required: false
|
|
578
|
+
},
|
|
579
|
+
borderRight: {
|
|
580
|
+
type: [
|
|
581
|
+
Boolean,
|
|
582
|
+
Number,
|
|
583
|
+
String
|
|
584
|
+
],
|
|
585
|
+
required: false
|
|
586
|
+
},
|
|
587
|
+
borderBlock: {
|
|
588
|
+
type: [
|
|
589
|
+
Boolean,
|
|
590
|
+
Number,
|
|
591
|
+
String
|
|
592
|
+
],
|
|
593
|
+
required: false
|
|
594
|
+
},
|
|
595
|
+
borderInline: {
|
|
596
|
+
type: [
|
|
597
|
+
Boolean,
|
|
598
|
+
Number,
|
|
599
|
+
String
|
|
600
|
+
],
|
|
601
|
+
required: false
|
|
602
|
+
},
|
|
603
|
+
borderInlineStart: {
|
|
604
|
+
type: [
|
|
605
|
+
Boolean,
|
|
606
|
+
Number,
|
|
607
|
+
String
|
|
608
|
+
],
|
|
609
|
+
required: false
|
|
610
|
+
},
|
|
611
|
+
borderInlineEnd: {
|
|
612
|
+
type: [
|
|
613
|
+
Boolean,
|
|
614
|
+
Number,
|
|
615
|
+
String
|
|
616
|
+
],
|
|
617
|
+
required: false
|
|
618
|
+
},
|
|
619
|
+
borderBlockStart: {
|
|
620
|
+
type: [
|
|
621
|
+
Boolean,
|
|
622
|
+
Number,
|
|
623
|
+
String
|
|
624
|
+
],
|
|
625
|
+
required: false
|
|
626
|
+
},
|
|
627
|
+
borderBlockEnd: {
|
|
628
|
+
type: [
|
|
629
|
+
Boolean,
|
|
630
|
+
Number,
|
|
631
|
+
String
|
|
632
|
+
],
|
|
633
|
+
required: false
|
|
634
|
+
},
|
|
635
|
+
borderColor: {
|
|
636
|
+
type: String,
|
|
637
|
+
required: false
|
|
638
|
+
},
|
|
639
|
+
borderStyle: {
|
|
640
|
+
type: String,
|
|
641
|
+
required: false
|
|
642
|
+
},
|
|
643
|
+
borderTopColor: {
|
|
644
|
+
type: [
|
|
645
|
+
String,
|
|
646
|
+
Object,
|
|
647
|
+
Boolean,
|
|
648
|
+
null
|
|
649
|
+
],
|
|
650
|
+
required: false,
|
|
651
|
+
skipCheck: true
|
|
652
|
+
},
|
|
653
|
+
borderRightColor: {
|
|
654
|
+
type: [
|
|
655
|
+
String,
|
|
656
|
+
Object,
|
|
657
|
+
Boolean,
|
|
658
|
+
null
|
|
659
|
+
],
|
|
660
|
+
required: false,
|
|
661
|
+
skipCheck: true
|
|
662
|
+
},
|
|
663
|
+
borderBottomColor: {
|
|
664
|
+
type: [
|
|
665
|
+
String,
|
|
666
|
+
Object,
|
|
667
|
+
Boolean,
|
|
668
|
+
null
|
|
669
|
+
],
|
|
670
|
+
required: false,
|
|
671
|
+
skipCheck: true
|
|
672
|
+
},
|
|
673
|
+
borderLeftColor: {
|
|
674
|
+
type: [
|
|
675
|
+
String,
|
|
676
|
+
Object,
|
|
677
|
+
Boolean,
|
|
678
|
+
null
|
|
679
|
+
],
|
|
680
|
+
required: false,
|
|
681
|
+
skipCheck: true
|
|
682
|
+
},
|
|
683
|
+
borderInlineStartColor: {
|
|
684
|
+
type: [
|
|
685
|
+
String,
|
|
686
|
+
Object,
|
|
687
|
+
Boolean,
|
|
688
|
+
null
|
|
689
|
+
],
|
|
690
|
+
required: false,
|
|
691
|
+
skipCheck: true
|
|
692
|
+
},
|
|
693
|
+
borderInlineEndColor: {
|
|
694
|
+
type: [
|
|
695
|
+
String,
|
|
696
|
+
Object,
|
|
697
|
+
Boolean,
|
|
698
|
+
null
|
|
699
|
+
],
|
|
700
|
+
required: false,
|
|
701
|
+
skipCheck: true
|
|
702
|
+
},
|
|
703
|
+
borderBlockStartColor: {
|
|
704
|
+
type: [
|
|
705
|
+
String,
|
|
706
|
+
Object,
|
|
707
|
+
Boolean,
|
|
708
|
+
null
|
|
709
|
+
],
|
|
710
|
+
required: false,
|
|
711
|
+
skipCheck: true
|
|
712
|
+
},
|
|
713
|
+
borderBlockEndColor: {
|
|
714
|
+
type: [
|
|
715
|
+
String,
|
|
716
|
+
Object,
|
|
717
|
+
Boolean,
|
|
718
|
+
null
|
|
719
|
+
],
|
|
720
|
+
required: false,
|
|
721
|
+
skipCheck: true
|
|
722
|
+
},
|
|
723
|
+
focused: {
|
|
724
|
+
type: Boolean,
|
|
725
|
+
required: false
|
|
726
|
+
},
|
|
727
|
+
density: {
|
|
728
|
+
type: null,
|
|
729
|
+
required: false
|
|
730
|
+
},
|
|
731
|
+
text: {
|
|
732
|
+
type: String,
|
|
733
|
+
required: false
|
|
734
|
+
},
|
|
735
|
+
floating: {
|
|
736
|
+
type: Boolean,
|
|
737
|
+
required: false
|
|
738
|
+
},
|
|
739
|
+
name: {
|
|
740
|
+
type: String,
|
|
741
|
+
required: false
|
|
742
|
+
},
|
|
743
|
+
margin: {
|
|
744
|
+
type: [
|
|
745
|
+
Boolean,
|
|
746
|
+
Number,
|
|
747
|
+
String
|
|
748
|
+
],
|
|
749
|
+
required: false
|
|
750
|
+
},
|
|
751
|
+
marginTop: {
|
|
752
|
+
type: [
|
|
753
|
+
Boolean,
|
|
754
|
+
Number,
|
|
755
|
+
String
|
|
756
|
+
],
|
|
757
|
+
required: false
|
|
758
|
+
},
|
|
759
|
+
marginLeft: {
|
|
760
|
+
type: [
|
|
761
|
+
Boolean,
|
|
762
|
+
Number,
|
|
763
|
+
String
|
|
764
|
+
],
|
|
765
|
+
required: false
|
|
766
|
+
},
|
|
767
|
+
marginBottom: {
|
|
768
|
+
type: [
|
|
769
|
+
Boolean,
|
|
770
|
+
Number,
|
|
771
|
+
String
|
|
772
|
+
],
|
|
773
|
+
required: false
|
|
774
|
+
},
|
|
775
|
+
marginRight: {
|
|
776
|
+
type: [
|
|
777
|
+
Boolean,
|
|
778
|
+
Number,
|
|
779
|
+
String
|
|
780
|
+
],
|
|
781
|
+
required: false
|
|
782
|
+
},
|
|
783
|
+
marginBlock: {
|
|
784
|
+
type: [
|
|
785
|
+
Boolean,
|
|
786
|
+
Number,
|
|
787
|
+
String
|
|
788
|
+
],
|
|
789
|
+
required: false
|
|
790
|
+
},
|
|
791
|
+
marginInline: {
|
|
792
|
+
type: [
|
|
793
|
+
Boolean,
|
|
794
|
+
Number,
|
|
795
|
+
String
|
|
796
|
+
],
|
|
797
|
+
required: false
|
|
798
|
+
},
|
|
799
|
+
marginInlineStart: {
|
|
800
|
+
type: [
|
|
801
|
+
Boolean,
|
|
802
|
+
Number,
|
|
803
|
+
String
|
|
804
|
+
],
|
|
805
|
+
required: false
|
|
806
|
+
},
|
|
807
|
+
marginInlineEnd: {
|
|
808
|
+
type: [
|
|
809
|
+
Boolean,
|
|
810
|
+
Number,
|
|
811
|
+
String
|
|
812
|
+
],
|
|
813
|
+
required: false
|
|
814
|
+
},
|
|
815
|
+
marginBlockStart: {
|
|
816
|
+
type: [
|
|
817
|
+
Boolean,
|
|
818
|
+
Number,
|
|
819
|
+
String
|
|
820
|
+
],
|
|
821
|
+
required: false
|
|
822
|
+
},
|
|
823
|
+
marginBlockEnd: {
|
|
824
|
+
type: [
|
|
825
|
+
Boolean,
|
|
826
|
+
Number,
|
|
827
|
+
String
|
|
828
|
+
],
|
|
829
|
+
required: false
|
|
830
|
+
},
|
|
831
|
+
padding: {
|
|
832
|
+
type: [
|
|
833
|
+
Boolean,
|
|
834
|
+
Number,
|
|
835
|
+
String
|
|
836
|
+
],
|
|
837
|
+
required: false
|
|
838
|
+
},
|
|
839
|
+
paddingTop: {
|
|
840
|
+
type: [
|
|
841
|
+
Boolean,
|
|
842
|
+
Number,
|
|
843
|
+
String
|
|
844
|
+
],
|
|
845
|
+
required: false
|
|
846
|
+
},
|
|
847
|
+
paddingLeft: {
|
|
848
|
+
type: [
|
|
849
|
+
Boolean,
|
|
850
|
+
Number,
|
|
851
|
+
String
|
|
852
|
+
],
|
|
853
|
+
required: false
|
|
854
|
+
},
|
|
855
|
+
paddingBottom: {
|
|
856
|
+
type: [
|
|
857
|
+
Boolean,
|
|
858
|
+
Number,
|
|
859
|
+
String
|
|
860
|
+
],
|
|
861
|
+
required: false
|
|
862
|
+
},
|
|
863
|
+
paddingRight: {
|
|
864
|
+
type: [
|
|
865
|
+
Boolean,
|
|
866
|
+
Number,
|
|
867
|
+
String
|
|
868
|
+
],
|
|
869
|
+
required: false
|
|
870
|
+
},
|
|
871
|
+
paddingBlock: {
|
|
872
|
+
type: [
|
|
873
|
+
Boolean,
|
|
874
|
+
Number,
|
|
875
|
+
String
|
|
876
|
+
],
|
|
877
|
+
required: false
|
|
878
|
+
},
|
|
879
|
+
paddingInline: {
|
|
880
|
+
type: [
|
|
881
|
+
Boolean,
|
|
882
|
+
Number,
|
|
883
|
+
String
|
|
884
|
+
],
|
|
885
|
+
required: false
|
|
886
|
+
},
|
|
887
|
+
paddingInlineStart: {
|
|
888
|
+
type: [
|
|
889
|
+
Boolean,
|
|
890
|
+
Number,
|
|
891
|
+
String
|
|
892
|
+
],
|
|
893
|
+
required: false
|
|
894
|
+
},
|
|
895
|
+
paddingInlineEnd: {
|
|
896
|
+
type: [
|
|
897
|
+
Boolean,
|
|
898
|
+
Number,
|
|
899
|
+
String
|
|
900
|
+
],
|
|
901
|
+
required: false
|
|
902
|
+
},
|
|
903
|
+
paddingBlockStart: {
|
|
904
|
+
type: [
|
|
905
|
+
Boolean,
|
|
906
|
+
Number,
|
|
907
|
+
String
|
|
908
|
+
],
|
|
909
|
+
required: false
|
|
910
|
+
},
|
|
911
|
+
paddingBlockEnd: {
|
|
912
|
+
type: [
|
|
913
|
+
Boolean,
|
|
914
|
+
Number,
|
|
915
|
+
String
|
|
916
|
+
],
|
|
917
|
+
required: false
|
|
918
|
+
},
|
|
919
|
+
rounded: {
|
|
920
|
+
type: [
|
|
921
|
+
Boolean,
|
|
922
|
+
Number,
|
|
923
|
+
String,
|
|
924
|
+
null
|
|
925
|
+
],
|
|
926
|
+
required: false,
|
|
927
|
+
skipCheck: true,
|
|
928
|
+
default: true
|
|
929
|
+
},
|
|
930
|
+
roundedTopRight: {
|
|
931
|
+
type: [
|
|
932
|
+
Boolean,
|
|
933
|
+
Number,
|
|
934
|
+
String
|
|
935
|
+
],
|
|
936
|
+
required: false
|
|
937
|
+
},
|
|
938
|
+
roundedTopLeft: {
|
|
939
|
+
type: [
|
|
940
|
+
Boolean,
|
|
941
|
+
Number,
|
|
942
|
+
String
|
|
943
|
+
],
|
|
944
|
+
required: false
|
|
945
|
+
},
|
|
946
|
+
roundedBottomLeft: {
|
|
947
|
+
type: [
|
|
948
|
+
Boolean,
|
|
949
|
+
Number,
|
|
950
|
+
String
|
|
951
|
+
],
|
|
952
|
+
required: false
|
|
953
|
+
},
|
|
954
|
+
roundedBottomRight: {
|
|
955
|
+
type: [
|
|
956
|
+
Boolean,
|
|
957
|
+
Number,
|
|
958
|
+
String
|
|
959
|
+
],
|
|
960
|
+
required: false
|
|
961
|
+
},
|
|
962
|
+
roundedStartStart: {
|
|
963
|
+
type: [
|
|
964
|
+
Boolean,
|
|
965
|
+
Number,
|
|
966
|
+
String
|
|
967
|
+
],
|
|
968
|
+
required: false
|
|
969
|
+
},
|
|
970
|
+
roundedStartEnd: {
|
|
971
|
+
type: [
|
|
972
|
+
Boolean,
|
|
973
|
+
Number,
|
|
974
|
+
String
|
|
975
|
+
],
|
|
976
|
+
required: false
|
|
977
|
+
},
|
|
978
|
+
roundedEndStart: {
|
|
979
|
+
type: [
|
|
980
|
+
Boolean,
|
|
981
|
+
Number,
|
|
982
|
+
String
|
|
983
|
+
],
|
|
984
|
+
required: false
|
|
985
|
+
},
|
|
986
|
+
roundedEndEnd: {
|
|
987
|
+
type: [
|
|
988
|
+
Boolean,
|
|
989
|
+
Number,
|
|
990
|
+
String
|
|
991
|
+
],
|
|
992
|
+
required: false
|
|
993
|
+
},
|
|
994
|
+
fontSize: {
|
|
995
|
+
type: null,
|
|
996
|
+
required: false
|
|
997
|
+
},
|
|
998
|
+
fontWeight: {
|
|
999
|
+
type: null,
|
|
1000
|
+
required: false
|
|
1001
|
+
},
|
|
1002
|
+
lineHeight: {
|
|
1003
|
+
type: null,
|
|
1004
|
+
required: false
|
|
1005
|
+
},
|
|
1006
|
+
letterSpacing: {
|
|
1007
|
+
type: null,
|
|
1008
|
+
required: false
|
|
1009
|
+
},
|
|
1010
|
+
active: {
|
|
1011
|
+
type: [Boolean, Object],
|
|
1012
|
+
required: false
|
|
1013
|
+
},
|
|
1014
|
+
activeClass: {
|
|
1015
|
+
type: String,
|
|
1016
|
+
required: false
|
|
1017
|
+
},
|
|
1018
|
+
variant: {
|
|
1019
|
+
type: null,
|
|
1020
|
+
required: false
|
|
1021
|
+
},
|
|
1022
|
+
elevation: {
|
|
1023
|
+
type: [Number, String],
|
|
1024
|
+
required: false
|
|
1025
|
+
},
|
|
1026
|
+
size: {
|
|
1027
|
+
type: null,
|
|
1028
|
+
required: false
|
|
1029
|
+
},
|
|
1030
|
+
hideDetails: {
|
|
1031
|
+
type: [Boolean, String],
|
|
1032
|
+
required: false
|
|
1033
|
+
},
|
|
1034
|
+
hideSpinButtons: {
|
|
1035
|
+
type: Boolean,
|
|
1036
|
+
required: false
|
|
1037
|
+
},
|
|
1038
|
+
hint: {
|
|
1039
|
+
type: String,
|
|
1040
|
+
required: false
|
|
1041
|
+
},
|
|
1042
|
+
persistentHint: {
|
|
1043
|
+
type: Boolean,
|
|
1044
|
+
required: false
|
|
1045
|
+
},
|
|
1046
|
+
messages: {
|
|
1047
|
+
type: [Array, String],
|
|
1048
|
+
required: false
|
|
1049
|
+
},
|
|
1050
|
+
height: {
|
|
1051
|
+
type: [Number, String],
|
|
1052
|
+
required: false
|
|
1053
|
+
},
|
|
1054
|
+
maxHeight: {
|
|
1055
|
+
type: [Number, String],
|
|
1056
|
+
required: false
|
|
1057
|
+
},
|
|
1058
|
+
maxWidth: {
|
|
1059
|
+
type: [Number, String],
|
|
1060
|
+
required: false
|
|
1061
|
+
},
|
|
1062
|
+
minHeight: {
|
|
1063
|
+
type: [Number, String],
|
|
1064
|
+
required: false
|
|
1065
|
+
},
|
|
1066
|
+
minWidth: {
|
|
1067
|
+
type: [Number, String],
|
|
1068
|
+
required: false
|
|
1069
|
+
},
|
|
1070
|
+
width: {
|
|
1071
|
+
type: [Number, String],
|
|
1072
|
+
required: false
|
|
1073
|
+
},
|
|
1074
|
+
direction: {
|
|
1075
|
+
type: null,
|
|
1076
|
+
required: false
|
|
1077
|
+
},
|
|
1078
|
+
errorMessages: {
|
|
1079
|
+
type: [Array, String],
|
|
1080
|
+
required: false
|
|
1081
|
+
},
|
|
1082
|
+
maxErrors: {
|
|
1083
|
+
type: [Number, String],
|
|
1084
|
+
required: false
|
|
1085
|
+
},
|
|
1086
|
+
readonly: {
|
|
1087
|
+
type: Boolean,
|
|
1088
|
+
required: false
|
|
1089
|
+
},
|
|
1090
|
+
rules: {
|
|
1091
|
+
type: Array,
|
|
1092
|
+
required: false
|
|
1093
|
+
},
|
|
1094
|
+
validateOn: {
|
|
1095
|
+
type: null,
|
|
1096
|
+
required: false
|
|
1097
|
+
},
|
|
1098
|
+
validationValue: {
|
|
1099
|
+
type: null,
|
|
1100
|
+
required: false
|
|
1101
|
+
},
|
|
1102
|
+
appendAvatar: {
|
|
1103
|
+
type: String,
|
|
1104
|
+
required: false
|
|
1105
|
+
},
|
|
1106
|
+
appendIcon: {
|
|
1107
|
+
type: null,
|
|
1108
|
+
required: false
|
|
1109
|
+
},
|
|
1110
|
+
prependAvatar: {
|
|
1111
|
+
type: String,
|
|
1112
|
+
required: false
|
|
1113
|
+
},
|
|
1114
|
+
prependIcon: {
|
|
1115
|
+
type: null,
|
|
1116
|
+
required: false
|
|
1117
|
+
},
|
|
1118
|
+
prependAriaLabel: {
|
|
1119
|
+
type: String,
|
|
1120
|
+
required: false
|
|
1121
|
+
},
|
|
1122
|
+
appendAriaLabel: {
|
|
1123
|
+
type: String,
|
|
1124
|
+
required: false
|
|
1125
|
+
}
|
|
443
1126
|
});
|
|
444
|
-
const emits = defineEmits([
|
|
1127
|
+
const emits = defineEmits([
|
|
1128
|
+
"click:control",
|
|
1129
|
+
"mousedown:control",
|
|
1130
|
+
"click:clear",
|
|
1131
|
+
"increment",
|
|
1132
|
+
"decrement",
|
|
1133
|
+
"update:focused",
|
|
1134
|
+
"click:appendInner",
|
|
1135
|
+
"click:prependInner",
|
|
1136
|
+
"update:modelValue",
|
|
1137
|
+
"click:append",
|
|
1138
|
+
"click:prepend"
|
|
1139
|
+
]);
|
|
445
1140
|
defineSlots();
|
|
446
1141
|
const { filterProps } = useProps(props);
|
|
447
1142
|
const { t } = useLocale();
|
|
@@ -449,279 +1144,459 @@ const vm = getCurrentInstance();
|
|
|
449
1144
|
const slots = useSlots();
|
|
450
1145
|
const origamTextFieldRef = ref();
|
|
451
1146
|
const origamCompactInputRef = ref();
|
|
1147
|
+
/*********************************************************
|
|
1148
|
+
* Disabled / readonly guard
|
|
1149
|
+
*
|
|
1150
|
+
* @description
|
|
1151
|
+
* Pre-fix this called `useForm(omit(props, ['modelValue']))`. That
|
|
1152
|
+
* was wrong on two counts:
|
|
1153
|
+
* 1. `useForm` is the FORM-CREATOR composable — meant for
|
|
1154
|
+
* `<OrigamForm>`, not for an individual field. Calling it
|
|
1155
|
+
* inside NumberField mounted a nested `provide(ORIGAM_FORM_KEY)`
|
|
1156
|
+
* scope, breaking the parent form's child registration.
|
|
1157
|
+
* 2. `useForm` internally calls `useVModel(props, 'modelValue')`
|
|
1158
|
+
* and writes BOOLEAN values into it (`true` when all children
|
|
1159
|
+
* pass validation, `false` when any fail). Because `useVModel`
|
|
1160
|
+
* grabs the current instance via `getCurrentInstance()`, the
|
|
1161
|
+
* emit landed on the NumberField itself — silently overwriting
|
|
1162
|
+
* `update:modelValue` with `true` / `false`. Consumer's
|
|
1163
|
+
* `v-model="numberRef"` then received a boolean instead of a
|
|
1164
|
+
* number.
|
|
1165
|
+
* `controlsDisabled` only needs `props.disabled` / `props.readonly`
|
|
1166
|
+
* — the field's parent form is consulted via `useValidation`
|
|
1167
|
+
* downstream (in `OrigamInput`).
|
|
1168
|
+
********************************************************/
|
|
452
1169
|
const controlsDisabled = computed(() => !!(props.disabled || props.readonly));
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
1170
|
+
/*********************************************************
|
|
1171
|
+
* Value & model
|
|
1172
|
+
*
|
|
1173
|
+
* @description
|
|
1174
|
+
* model is the clamped numeric v-model.
|
|
1175
|
+
* inputText is a writable computed that mediates between the raw
|
|
1176
|
+
* string the user types and the clamped numeric model.
|
|
1177
|
+
* _inputText is the internal mutable string buffer.
|
|
1178
|
+
********************************************************/
|
|
1179
|
+
/*********************************************************
|
|
1180
|
+
* Value
|
|
1181
|
+
********************************************************/
|
|
1182
|
+
const model = useVModel(props, "modelValue", null, (val) => val ?? null, (val) => val == null ? val ?? null : clamp(Number(val), props.min, props.max));
|
|
1183
|
+
/*********************************************************
|
|
1184
|
+
* effectiveValidationValue (#696)
|
|
1185
|
+
*
|
|
1186
|
+
* @description
|
|
1187
|
+
* Both template branches used to bind `:validation-value="model"` — the
|
|
1188
|
+
* model HARDCODED, in the compact branch (on `<origam-input>`) and in
|
|
1189
|
+
* the regular one (on `<origam-text-field>`). The `validationValue` PROP
|
|
1190
|
+
* (`INumberFieldProps` -> `ITextFieldProps` -> `IInputProps` ->
|
|
1191
|
+
* `IValidationProps.validationValue`, `validation.interface.ts:47`) is
|
|
1192
|
+
* ALSO stripped from the `filterProps` passthrough below, and the compact
|
|
1193
|
+
* branch enumerates its props one by one with no passthrough at all — so
|
|
1194
|
+
* there was no second path either and a consumer's
|
|
1195
|
+
* `<origam-number-field :validation-value="somethingElse" />` silently
|
|
1196
|
+
* validated against the model.
|
|
1197
|
+
*
|
|
1198
|
+
* @description
|
|
1199
|
+
* Same CONSEQUENCE as #693 (Select / ColorPickerField / DatePickerField),
|
|
1200
|
+
* different mechanism: no shadowing `const` here, which is why the
|
|
1201
|
+
* `const`/prop shadowing sweep did not surface it.
|
|
1202
|
+
*
|
|
1203
|
+
* @description
|
|
1204
|
+
* The fallback ladder mirrors `useValidation` exactly
|
|
1205
|
+
* (`validation.composable.ts:52`): `undefined` means "not supplied" and
|
|
1206
|
+
* falls back to the model, ANY other value — `null` included — wins.
|
|
1207
|
+
********************************************************/
|
|
460
1208
|
const effectiveValidationValue = computed(() => {
|
|
461
|
-
|
|
1209
|
+
return props.validationValue === undefined ? model.value : props.validationValue;
|
|
462
1210
|
});
|
|
1211
|
+
/*********************************************************
|
|
1212
|
+
* Effect
|
|
1213
|
+
********************************************************/
|
|
463
1214
|
const { isFocused, onFocus, onBlur } = useFocus(props);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
} = useAdjacentInner(props);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
1215
|
+
/*********************************************************
|
|
1216
|
+
* Composables
|
|
1217
|
+
********************************************************/
|
|
1218
|
+
const { onClickPrependInner: handleClickPrependInner, onClickAppendInner: handleClickAppendInner } = useAdjacentInner(props);
|
|
1219
|
+
/*********************************************************
|
|
1220
|
+
* click:prepend / click:append relay
|
|
1221
|
+
*
|
|
1222
|
+
* @description
|
|
1223
|
+
* `click:prepend` / `click:append` are declared (inherited via
|
|
1224
|
+
* `IInputEmits extends IAdjacentEmits`) but were never wired (#459):
|
|
1225
|
+
* `<origam-text-field>` DOES emit both — via ITS OWN `useAdjacent()`
|
|
1226
|
+
* call, on its outer prepend/append slot wrapper — but NumberField
|
|
1227
|
+
* never listened for them, so the events reached NumberField's
|
|
1228
|
+
* instance and stopped there. `useAdjacent(props)` here re-uses the
|
|
1229
|
+
* SAME composable to emit on NumberField's OWN instance once the
|
|
1230
|
+
* child's event is relayed to it (see the `@click:prepend` /
|
|
1231
|
+
* `@click:append` listeners on `<origam-text-field>` below) —
|
|
1232
|
+
* mirroring the *Inner relay above exactly.
|
|
1233
|
+
********************************************************/
|
|
1234
|
+
const { onClickPrepend: handleClickPrepend, onClickAppend: handleClickAppend } = useAdjacent(props);
|
|
472
1235
|
const correctPrecision = (val, precision = props.precision) => {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
1236
|
+
// `val` arrives as a number from the model in the happy path,
|
|
1237
|
+
// but a parent could legitimately pass a numeric string
|
|
1238
|
+
// (`v-model="someStringRef"`, JSON-deserialised payload, etc.).
|
|
1239
|
+
// Without coercion, `.toFixed` crashes — strings have no
|
|
1240
|
+
// `toFixed` method, but `isNaN("42")` returns `false` so the
|
|
1241
|
+
// upstream watch guard lets the string through.
|
|
1242
|
+
// We only coerce when needed and keep the original number path
|
|
1243
|
+
// untouched to avoid any subtle change in formatting semantics.
|
|
1244
|
+
const num = typeof val === "number" ? val : Number(val);
|
|
1245
|
+
if (Number.isNaN(num)) return String(val);
|
|
1246
|
+
const fixed = precision == null ? String(num) : num.toFixed(precision);
|
|
1247
|
+
return isFocused.value ? Number(fixed).toString() : fixed;
|
|
477
1248
|
};
|
|
1249
|
+
/*********************************************************
|
|
1250
|
+
* `_inputText` IS LAZY-SEEDED, NOT WRITTEN BY AN IMMEDIATE WATCH
|
|
1251
|
+
*
|
|
1252
|
+
* @description
|
|
1253
|
+
* `{immediate: true}` used to run the sync callback below synchronously
|
|
1254
|
+
* the instant the watch was created, reading `props.modelValue` at that
|
|
1255
|
+
* exact moment and writing the result into a plain `shallowRef` — so
|
|
1256
|
+
* nothing re-derived it later on its own. Creating that watch at the
|
|
1257
|
+
* top level of `setup()` ran the immediate callback before Vue's
|
|
1258
|
+
* `beforeCreate` hook runs, which is where the ADR-005 theme resolver
|
|
1259
|
+
* patches `instance.props`; the callback therefore saw whatever Vue
|
|
1260
|
+
* resolved BEFORE the theme was visible, and a watch created in
|
|
1261
|
+
* `setup()` only picks up a LATER change through the reactive proxy's
|
|
1262
|
+
* own per-key dep — which requires a subsequent parent write
|
|
1263
|
+
* (`props[key] = value`) to fire. A theme naming `modelValue` with no
|
|
1264
|
+
* accompanying parent re-render never produces one, so the ref stayed
|
|
1265
|
+
* seeded at the pre-theme value forever.
|
|
1266
|
+
* `_inputTextRaw` starts UNSEEDED (mirrors `useVModel`'s own fix): as
|
|
1267
|
+
* long as nothing has explicitly written to it, `_inputText`'s getter
|
|
1268
|
+
* falls back to deriving the display text from `props.modelValue` LIVE,
|
|
1269
|
+
* on every read — including the template's first read during render,
|
|
1270
|
+
* which is already past `beforeCreate`. The moment any code path writes
|
|
1271
|
+
* through `_inputText.value = …` (user input, clamping, stepping, …)
|
|
1272
|
+
* the raw ref takes over and the getter returns that instead.
|
|
1273
|
+
********************************************************/
|
|
478
1274
|
const _inputTextRaw = shallowRef(UNSEEDED);
|
|
479
1275
|
const seedInputText = () => {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
1276
|
+
const val = props.modelValue;
|
|
1277
|
+
if (val == null) return null;
|
|
1278
|
+
if (!isNaN(val)) return correctPrecision(val);
|
|
1279
|
+
return null;
|
|
484
1280
|
};
|
|
485
1281
|
const _inputText = computed({
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
1282
|
+
get: () => _inputTextRaw.value === UNSEEDED ? seedInputText() : _inputTextRaw.value,
|
|
1283
|
+
set: (val) => {
|
|
1284
|
+
_inputTextRaw.value = val;
|
|
1285
|
+
}
|
|
490
1286
|
});
|
|
1287
|
+
// Sync from external model changes (parent v-model updates) — no
|
|
1288
|
+
// `immediate`, the lazy seed above already covers the initial value.
|
|
491
1289
|
watch(() => props.modelValue, (val) => {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
1290
|
+
if (isFocused.value && !controlsDisabled.value) return;
|
|
1291
|
+
if (val == null) {
|
|
1292
|
+
_inputText.value = null;
|
|
1293
|
+
} else if (!isNaN(val)) {
|
|
1294
|
+
_inputText.value = correctPrecision(val);
|
|
1295
|
+
}
|
|
498
1296
|
});
|
|
499
1297
|
const inputText = computed({
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
1298
|
+
get: () => _inputText.value,
|
|
1299
|
+
set(val) {
|
|
1300
|
+
if (val === null || val === "") {
|
|
1301
|
+
model.value = null;
|
|
1302
|
+
_inputText.value = null;
|
|
1303
|
+
} else if (!isNaN(Number(val)) && Number(val) <= props.max && Number(val) >= props.min) {
|
|
1304
|
+
model.value = Number(val);
|
|
1305
|
+
_inputText.value = val;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
510
1308
|
});
|
|
1309
|
+
/*********************************************************
|
|
1310
|
+
* Increment / decrement guards
|
|
1311
|
+
*
|
|
1312
|
+
* @description
|
|
1313
|
+
* canIncrease / canDecrease gate the step buttons.
|
|
1314
|
+
* toggleUpDown performs the actual increment or decrement.
|
|
1315
|
+
* inferPrecision derives the required decimal precision from the
|
|
1316
|
+
* current value and step.
|
|
1317
|
+
********************************************************/
|
|
511
1318
|
const canIncrease = computed(() => {
|
|
512
|
-
|
|
513
|
-
|
|
1319
|
+
if (controlsDisabled.value) return false;
|
|
1320
|
+
return (model.value ?? 0) + props.step <= props.max;
|
|
514
1321
|
});
|
|
515
1322
|
const canDecrease = computed(() => {
|
|
516
|
-
|
|
517
|
-
|
|
1323
|
+
if (controlsDisabled.value) return false;
|
|
1324
|
+
return (model.value ?? 0) - props.step >= props.min;
|
|
518
1325
|
});
|
|
519
1326
|
watch(() => props.precision, () => formatInputValue());
|
|
520
1327
|
onMounted(() => {
|
|
521
|
-
|
|
1328
|
+
clampModel();
|
|
522
1329
|
});
|
|
1330
|
+
/*********************************************************
|
|
1331
|
+
* Spinbutton role (non-compact input)
|
|
1332
|
+
*
|
|
1333
|
+
* @description
|
|
1334
|
+
* The compact-mode `<input>` sets `role="spinbutton"` directly in the
|
|
1335
|
+
* template (#459) — it is NumberField's own native element. The
|
|
1336
|
+
* non-compact `<input>` is rendered two components deep
|
|
1337
|
+
* (`<origam-text-field>` → `<origam-field>` → the real `<input>`), and
|
|
1338
|
+
* `role` is ALSO a DECLARED prop on `ITextFieldProps` — TextField binds
|
|
1339
|
+
* it to its own `<origam-field>` wrapper (`:role="role"`, matching the
|
|
1340
|
+
* `role="combobox"` pattern OrigamSelect uses), not to the input. That
|
|
1341
|
+
* makes a plain `role="spinbutton"` attribute on `<origam-text-field>`
|
|
1342
|
+
* land on the WRONG element — the field chrome div, not the value-
|
|
1343
|
+
* bearing input `aria-valuenow`/`aria-valuemin`/`aria-valuemax` are
|
|
1344
|
+
* bound to just above (those are NOT declared TextField props, so they
|
|
1345
|
+
* correctly fall through to the real `<input>` via `filterInputAttrs`).
|
|
1346
|
+
* Reaching the real input for `role` specifically needs the same
|
|
1347
|
+
* DOM-querySelector escape hatch already established in
|
|
1348
|
+
* `OrigamSelect.vue`'s `handleMousedownControl` for the same class of
|
|
1349
|
+
* problem. `flush: 'post'` re-runs after the compact/non-compact
|
|
1350
|
+
* branch swaps in the DOM, so toggling `compact` at runtime keeps it
|
|
1351
|
+
* correct instead of only applying once at mount.
|
|
1352
|
+
********************************************************/
|
|
523
1353
|
watchEffect(() => {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
1354
|
+
if (props.compact) return;
|
|
1355
|
+
const root = vm?.proxy?.$el;
|
|
1356
|
+
const input = root?.querySelector?.("input");
|
|
1357
|
+
input?.setAttribute("role", "spinbutton");
|
|
528
1358
|
}, { flush: "post" });
|
|
529
1359
|
const inferPrecision = (value) => {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
1360
|
+
if (value == null) return 0;
|
|
1361
|
+
const str = value.toString();
|
|
1362
|
+
const idx = str.indexOf(".");
|
|
1363
|
+
return ~idx ? str.length - idx : 0;
|
|
534
1364
|
};
|
|
535
1365
|
const toggleUpDown = (increment = true) => {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
1366
|
+
if (controlsDisabled.value) return;
|
|
1367
|
+
if (model.value == null) {
|
|
1368
|
+
inputText.value = correctPrecision(clamp(0, props.min, props.max));
|
|
1369
|
+
return;
|
|
1370
|
+
}
|
|
1371
|
+
let inferredPrecision = Math.max(inferPrecision(model.value), inferPrecision(props.step));
|
|
1372
|
+
if (props.precision != null) inferredPrecision = Math.max(inferredPrecision, props.precision);
|
|
1373
|
+
if (increment) {
|
|
1374
|
+
if (canIncrease.value) {
|
|
1375
|
+
inputText.value = correctPrecision(model.value + props.step, inferredPrecision);
|
|
1376
|
+
emits("increment", model.value);
|
|
1377
|
+
}
|
|
1378
|
+
} else {
|
|
1379
|
+
if (canDecrease.value) {
|
|
1380
|
+
inputText.value = correctPrecision(model.value - props.step, inferredPrecision);
|
|
1381
|
+
emits("decrement", model.value);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
554
1384
|
};
|
|
1385
|
+
/*********************************************************
|
|
1386
|
+
* Hold (long-press repeat)
|
|
1387
|
+
*
|
|
1388
|
+
* @description
|
|
1389
|
+
* useHold fires toggleUpDown repeatedly while the user holds
|
|
1390
|
+
* a step button, respecting holdDelay and holdRepeat props.
|
|
1391
|
+
********************************************************/
|
|
555
1392
|
const { holdStart, holdStop } = useHold({ toggleUpDown }, () => props.holdRepeat, () => props.holdDelay);
|
|
1393
|
+
/*********************************************************
|
|
1394
|
+
* Event handlers
|
|
1395
|
+
*
|
|
1396
|
+
* @description
|
|
1397
|
+
* Input, keydown, pointer and mouse handlers for the field
|
|
1398
|
+
* and step buttons.
|
|
1399
|
+
********************************************************/
|
|
556
1400
|
const handleBeforeInput = (e) => {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
1401
|
+
if (!e.data) return;
|
|
1402
|
+
const existingTxt = e.target?.value;
|
|
1403
|
+
const selectionStart = e.target?.selectionStart;
|
|
1404
|
+
const selectionEnd = e.target?.selectionEnd;
|
|
1405
|
+
const potentialNewInputVal = existingTxt ? existingTxt.slice(0, selectionStart) + e.data + existingTxt.slice(selectionEnd) : e.data;
|
|
1406
|
+
if (!/^-?(\d+(\.\d*)?|(\.\d+)|\d*|\.)$/.test(potentialNewInputVal)) {
|
|
1407
|
+
e.preventDefault();
|
|
1408
|
+
}
|
|
1409
|
+
if (props.precision == null) return;
|
|
1410
|
+
// Ignore decimal digits above precision limit
|
|
1411
|
+
if (potentialNewInputVal.split(".")[1]?.length > props.precision) {
|
|
1412
|
+
e.preventDefault();
|
|
1413
|
+
}
|
|
1414
|
+
// Ignore decimal separator when precision = 0
|
|
1415
|
+
if (props.precision === 0 && potentialNewInputVal.includes(".")) {
|
|
1416
|
+
e.preventDefault();
|
|
1417
|
+
}
|
|
572
1418
|
};
|
|
573
1419
|
const handleKeydown = async (e) => {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
1420
|
+
if ([
|
|
1421
|
+
"Enter",
|
|
1422
|
+
"ArrowLeft",
|
|
1423
|
+
"ArrowRight",
|
|
1424
|
+
"Backspace",
|
|
1425
|
+
"Delete",
|
|
1426
|
+
"Tab"
|
|
1427
|
+
].includes(e.key) || e.ctrlKey) return;
|
|
1428
|
+
if (["ArrowDown", "ArrowUp"].includes(e.key)) {
|
|
1429
|
+
e.preventDefault();
|
|
1430
|
+
clampModel();
|
|
1431
|
+
// _model is controlled, so need to wait until props['modelValue'] is updated
|
|
1432
|
+
await nextTick();
|
|
1433
|
+
if (e.key === "ArrowDown") {
|
|
1434
|
+
toggleUpDown(false);
|
|
1435
|
+
} else {
|
|
1436
|
+
toggleUpDown();
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
585
1439
|
};
|
|
586
1440
|
const handleIncrementClick = (e) => {
|
|
587
|
-
|
|
1441
|
+
e.stopPropagation();
|
|
588
1442
|
};
|
|
589
1443
|
const handleDecrementClick = (e) => {
|
|
590
|
-
|
|
1444
|
+
e.stopPropagation();
|
|
591
1445
|
};
|
|
592
1446
|
const handleControlMouseup = (e) => {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
1447
|
+
const el = e.currentTarget;
|
|
1448
|
+
el?.releasePointerCapture(e.pointerId);
|
|
1449
|
+
e.preventDefault();
|
|
1450
|
+
e.stopPropagation();
|
|
1451
|
+
holdStop();
|
|
598
1452
|
};
|
|
599
1453
|
const handleUpControlMousedown = (e) => {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
1454
|
+
const el = e.currentTarget;
|
|
1455
|
+
el?.setPointerCapture(e.pointerId);
|
|
1456
|
+
e.preventDefault();
|
|
1457
|
+
e.stopPropagation();
|
|
1458
|
+
holdStart("up");
|
|
605
1459
|
};
|
|
606
1460
|
const handleDownControlMousedown = (e) => {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
1461
|
+
const el = e.currentTarget;
|
|
1462
|
+
el?.setPointerCapture(e.pointerId);
|
|
1463
|
+
e.preventDefault();
|
|
1464
|
+
e.stopPropagation();
|
|
1465
|
+
holdStart("down");
|
|
612
1466
|
};
|
|
613
1467
|
const handleMousedown = (e) => {
|
|
614
|
-
|
|
1468
|
+
emits("mousedown:control", e);
|
|
615
1469
|
};
|
|
616
1470
|
const handleClick = (e) => {
|
|
617
|
-
|
|
1471
|
+
emits("click:control", e);
|
|
618
1472
|
};
|
|
619
1473
|
const handleClear = (e) => {
|
|
620
|
-
|
|
1474
|
+
emits("click:clear", e);
|
|
621
1475
|
};
|
|
622
1476
|
const clampModel = () => {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
1477
|
+
if (controlsDisabled.value) return;
|
|
1478
|
+
const actualText = _inputText.value ?? origamTextFieldRef.value?.value ?? null;
|
|
1479
|
+
if (actualText && !isNaN(Number(actualText))) {
|
|
1480
|
+
const clamped = clamp(Number(actualText), props.min, props.max);
|
|
1481
|
+
model.value = clamped;
|
|
1482
|
+
_inputText.value = correctPrecision(clamped);
|
|
1483
|
+
} else {
|
|
1484
|
+
model.value = null;
|
|
1485
|
+
_inputText.value = null;
|
|
1486
|
+
}
|
|
633
1487
|
};
|
|
634
1488
|
const formatInputValue = () => {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
1489
|
+
if (controlsDisabled.value) return;
|
|
1490
|
+
if (_inputText.value === null) {
|
|
1491
|
+
_inputText.value = null;
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
const numVal = Number(_inputText.value);
|
|
1495
|
+
if (isNaN(numVal)) {
|
|
1496
|
+
_inputText.value = null;
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
_inputText.value = props.precision == null ? String(numVal) : numVal.toFixed(props.precision);
|
|
646
1500
|
};
|
|
647
1501
|
const trimDecimalZeros = () => {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
1502
|
+
if (controlsDisabled.value) return;
|
|
1503
|
+
if (_inputText.value === null) return;
|
|
1504
|
+
const numVal = Number(_inputText.value);
|
|
1505
|
+
if (isNaN(numVal)) {
|
|
1506
|
+
_inputText.value = null;
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
_inputText.value = numVal.toString();
|
|
656
1510
|
};
|
|
657
1511
|
const handleFocus = () => {
|
|
658
|
-
|
|
659
|
-
|
|
1512
|
+
onFocus();
|
|
1513
|
+
trimDecimalZeros();
|
|
660
1514
|
};
|
|
661
1515
|
const handleBlur = () => {
|
|
662
|
-
|
|
663
|
-
|
|
1516
|
+
onBlur();
|
|
1517
|
+
clampModel();
|
|
664
1518
|
};
|
|
1519
|
+
/*********************************************************
|
|
1520
|
+
* Forwarded props & slot guards
|
|
1521
|
+
*
|
|
1522
|
+
* @description
|
|
1523
|
+
* textFieldProps filters and forwards relevant props to the inner
|
|
1524
|
+
* OrigamTextField instance.
|
|
1525
|
+
* hasAppendInner guards the appendInner slot template.
|
|
1526
|
+
********************************************************/
|
|
1527
|
+
/*********************************************************
|
|
1528
|
+
* Forwarded props
|
|
1529
|
+
********************************************************/
|
|
665
1530
|
const textFieldProps = computed(() => {
|
|
666
|
-
|
|
1531
|
+
return filterPropsOf(OrigamTextField, props, [
|
|
1532
|
+
"modelValue",
|
|
1533
|
+
"class",
|
|
1534
|
+
"style",
|
|
1535
|
+
"validationValue"
|
|
1536
|
+
]);
|
|
667
1537
|
});
|
|
668
1538
|
const hasAppendInner = computed(() => {
|
|
669
|
-
|
|
1539
|
+
return slots.appendInner || !props.hideControls;
|
|
670
1540
|
});
|
|
1541
|
+
/*********************************************************
|
|
1542
|
+
* Class & Style
|
|
1543
|
+
*
|
|
1544
|
+
* @description
|
|
1545
|
+
* numberFieldClasses / numberFieldStyles compose the BEM root.
|
|
1546
|
+
* compactClasses applies the compact mode modifier.
|
|
1547
|
+
********************************************************/
|
|
671
1548
|
const numberFieldClasses = computed(() => {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
1549
|
+
return [
|
|
1550
|
+
"origam-number-field",
|
|
1551
|
+
{
|
|
1552
|
+
"origam-number-field--hide-input": props.hideInput,
|
|
1553
|
+
"origam-number-field--inset": props.inset,
|
|
1554
|
+
"origam-number-field--split": props.split,
|
|
1555
|
+
"origam-number-field--hide-controls": props.hideControls
|
|
1556
|
+
},
|
|
1557
|
+
props.class
|
|
1558
|
+
];
|
|
682
1559
|
});
|
|
683
1560
|
const numberFieldStyles = computed(() => {
|
|
684
|
-
|
|
685
|
-
props.style
|
|
686
|
-
];
|
|
1561
|
+
return [props.style];
|
|
687
1562
|
});
|
|
688
1563
|
const compactClasses = computed(() => {
|
|
689
|
-
|
|
690
|
-
"origam-number-field",
|
|
691
|
-
"origam-number-field--compact"
|
|
692
|
-
];
|
|
1564
|
+
return ["origam-number-field", "origam-number-field--compact"];
|
|
693
1565
|
});
|
|
694
1566
|
const compactInputWrapperClasses = computed(() => {
|
|
695
|
-
|
|
696
|
-
"origam-number-field__compact-wrapper",
|
|
697
|
-
props.class
|
|
698
|
-
];
|
|
1567
|
+
return ["origam-number-field__compact-wrapper", props.class];
|
|
699
1568
|
});
|
|
700
1569
|
const compactInputText = computed({
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
1570
|
+
get: () => model.value != null ? String(model.value) : "",
|
|
1571
|
+
set(val) {
|
|
1572
|
+
if (val === "") {
|
|
1573
|
+
model.value = null;
|
|
1574
|
+
} else if (!isNaN(Number(val))) {
|
|
1575
|
+
const clamped = clamp(Number(val), props.min, props.max);
|
|
1576
|
+
model.value = clamped;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
710
1579
|
});
|
|
711
1580
|
const handleCompactIncrement = () => {
|
|
712
|
-
|
|
1581
|
+
toggleUpDown(true);
|
|
713
1582
|
};
|
|
714
1583
|
const handleCompactDecrement = () => {
|
|
715
|
-
|
|
1584
|
+
toggleUpDown(false);
|
|
716
1585
|
};
|
|
717
1586
|
const { id, css, load, isLoaded, unload } = useStyle(numberFieldStyles, () => props.id);
|
|
1587
|
+
/*********************************************************
|
|
1588
|
+
* Expose
|
|
1589
|
+
*
|
|
1590
|
+
* @description
|
|
1591
|
+
* Forwards TextField ref members plus filterProps.
|
|
1592
|
+
********************************************************/
|
|
718
1593
|
defineExpose(forwardRefs({
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1594
|
+
filterProps,
|
|
1595
|
+
css,
|
|
1596
|
+
id,
|
|
1597
|
+
load,
|
|
1598
|
+
unload,
|
|
1599
|
+
isLoaded
|
|
725
1600
|
}, origamTextFieldRef, origamCompactInputRef));
|
|
726
1601
|
</script>
|
|
727
1602
|
|