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
|
@@ -428,167 +428,829 @@ import { DENSITY } from "../../enums/Commons/density.enum";
|
|
|
428
428
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
429
429
|
import { SLIDER_FIELD_VARIANT } from "../../enums/SliderField/slider-field.enum";
|
|
430
430
|
import { clamp, convertToUnit, createRange, omit } from "../../utils/Commons/commons.util";
|
|
431
|
+
/*********************************************************
|
|
432
|
+
* Global
|
|
433
|
+
*
|
|
434
|
+
* @description
|
|
435
|
+
* Props, emits, slots and the focus + RTL composables.
|
|
436
|
+
********************************************************/
|
|
431
437
|
const props = defineProps({
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
438
|
+
disabled: {
|
|
439
|
+
type: Boolean,
|
|
440
|
+
required: false
|
|
441
|
+
},
|
|
442
|
+
required: {
|
|
443
|
+
type: Boolean,
|
|
444
|
+
required: false
|
|
445
|
+
},
|
|
446
|
+
label: {
|
|
447
|
+
type: String,
|
|
448
|
+
required: false
|
|
449
|
+
},
|
|
450
|
+
error: {
|
|
451
|
+
type: Boolean,
|
|
452
|
+
required: false
|
|
453
|
+
},
|
|
454
|
+
readonly: {
|
|
455
|
+
type: Boolean,
|
|
456
|
+
required: false
|
|
457
|
+
},
|
|
458
|
+
max: {
|
|
459
|
+
type: [Number, String],
|
|
460
|
+
required: false,
|
|
461
|
+
default: 100
|
|
462
|
+
},
|
|
463
|
+
min: {
|
|
464
|
+
type: [Number, String],
|
|
465
|
+
required: false,
|
|
466
|
+
default: 0
|
|
467
|
+
},
|
|
468
|
+
step: {
|
|
469
|
+
type: [Number, String],
|
|
470
|
+
required: false,
|
|
471
|
+
default: 0
|
|
472
|
+
},
|
|
473
|
+
trackProps: {
|
|
474
|
+
type: Object,
|
|
475
|
+
required: false
|
|
476
|
+
},
|
|
477
|
+
reverse: {
|
|
478
|
+
type: Boolean,
|
|
479
|
+
required: false
|
|
480
|
+
},
|
|
481
|
+
modelValue: {
|
|
482
|
+
type: [
|
|
483
|
+
Number,
|
|
484
|
+
String,
|
|
485
|
+
Array
|
|
486
|
+
],
|
|
487
|
+
required: false,
|
|
488
|
+
default: 0
|
|
489
|
+
},
|
|
490
|
+
range: {
|
|
491
|
+
type: Boolean,
|
|
492
|
+
required: false
|
|
493
|
+
},
|
|
494
|
+
showTicks: {
|
|
495
|
+
type: [Boolean, String],
|
|
496
|
+
required: false
|
|
497
|
+
},
|
|
498
|
+
ticks: {
|
|
499
|
+
type: [Array, Object],
|
|
500
|
+
required: false
|
|
501
|
+
},
|
|
502
|
+
tickSize: {
|
|
503
|
+
type: null,
|
|
504
|
+
required: false
|
|
505
|
+
},
|
|
506
|
+
inset: {
|
|
507
|
+
type: Boolean,
|
|
508
|
+
required: false,
|
|
509
|
+
default: false
|
|
510
|
+
},
|
|
511
|
+
variant: {
|
|
512
|
+
type: null,
|
|
513
|
+
required: false,
|
|
514
|
+
default: "field"
|
|
515
|
+
},
|
|
516
|
+
buffered: {
|
|
517
|
+
type: Number,
|
|
518
|
+
required: false
|
|
519
|
+
},
|
|
520
|
+
showThumbOnHoverOnly: {
|
|
521
|
+
type: Boolean,
|
|
522
|
+
required: false,
|
|
523
|
+
default: false
|
|
524
|
+
},
|
|
525
|
+
showHoverTooltip: {
|
|
526
|
+
type: Boolean,
|
|
527
|
+
required: false,
|
|
528
|
+
default: false
|
|
529
|
+
},
|
|
530
|
+
formatHoverTooltip: {
|
|
531
|
+
type: Function,
|
|
532
|
+
required: false,
|
|
533
|
+
default: (value) => String(value)
|
|
534
|
+
},
|
|
535
|
+
peaks: {
|
|
536
|
+
type: Array,
|
|
537
|
+
required: false
|
|
538
|
+
},
|
|
539
|
+
id: {
|
|
540
|
+
type: String,
|
|
541
|
+
required: false
|
|
542
|
+
},
|
|
543
|
+
class: {
|
|
544
|
+
type: [
|
|
545
|
+
String,
|
|
546
|
+
Array,
|
|
547
|
+
Object
|
|
548
|
+
],
|
|
549
|
+
required: false
|
|
550
|
+
},
|
|
551
|
+
style: {
|
|
552
|
+
type: [
|
|
553
|
+
String,
|
|
554
|
+
Array,
|
|
555
|
+
Object,
|
|
556
|
+
Boolean,
|
|
557
|
+
null
|
|
558
|
+
],
|
|
559
|
+
required: false,
|
|
560
|
+
skipCheck: true
|
|
561
|
+
},
|
|
562
|
+
density: {
|
|
563
|
+
type: null,
|
|
564
|
+
required: false,
|
|
565
|
+
default: DENSITY.DEFAULT
|
|
566
|
+
},
|
|
567
|
+
color: {
|
|
568
|
+
type: [
|
|
569
|
+
String,
|
|
570
|
+
Object,
|
|
571
|
+
Boolean,
|
|
572
|
+
null
|
|
573
|
+
],
|
|
574
|
+
required: false,
|
|
575
|
+
skipCheck: true
|
|
576
|
+
},
|
|
577
|
+
centerAffix: {
|
|
578
|
+
type: Boolean,
|
|
579
|
+
required: false
|
|
580
|
+
},
|
|
581
|
+
hideDetails: {
|
|
582
|
+
type: [Boolean, String],
|
|
583
|
+
required: false
|
|
584
|
+
},
|
|
585
|
+
hideSpinButtons: {
|
|
586
|
+
type: Boolean,
|
|
587
|
+
required: false
|
|
588
|
+
},
|
|
589
|
+
hint: {
|
|
590
|
+
type: String,
|
|
591
|
+
required: false
|
|
592
|
+
},
|
|
593
|
+
persistentHint: {
|
|
594
|
+
type: Boolean,
|
|
595
|
+
required: false
|
|
596
|
+
},
|
|
597
|
+
messages: {
|
|
598
|
+
type: [Array, String],
|
|
599
|
+
required: false
|
|
600
|
+
},
|
|
601
|
+
padding: {
|
|
602
|
+
type: [
|
|
603
|
+
Boolean,
|
|
604
|
+
Number,
|
|
605
|
+
String
|
|
606
|
+
],
|
|
607
|
+
required: false
|
|
608
|
+
},
|
|
609
|
+
paddingTop: {
|
|
610
|
+
type: [
|
|
611
|
+
Boolean,
|
|
612
|
+
Number,
|
|
613
|
+
String
|
|
614
|
+
],
|
|
615
|
+
required: false
|
|
616
|
+
},
|
|
617
|
+
paddingLeft: {
|
|
618
|
+
type: [
|
|
619
|
+
Boolean,
|
|
620
|
+
Number,
|
|
621
|
+
String
|
|
622
|
+
],
|
|
623
|
+
required: false
|
|
624
|
+
},
|
|
625
|
+
paddingBottom: {
|
|
626
|
+
type: [
|
|
627
|
+
Boolean,
|
|
628
|
+
Number,
|
|
629
|
+
String
|
|
630
|
+
],
|
|
631
|
+
required: false
|
|
632
|
+
},
|
|
633
|
+
paddingRight: {
|
|
634
|
+
type: [
|
|
635
|
+
Boolean,
|
|
636
|
+
Number,
|
|
637
|
+
String
|
|
638
|
+
],
|
|
639
|
+
required: false
|
|
640
|
+
},
|
|
641
|
+
paddingBlock: {
|
|
642
|
+
type: [
|
|
643
|
+
Boolean,
|
|
644
|
+
Number,
|
|
645
|
+
String
|
|
646
|
+
],
|
|
647
|
+
required: false
|
|
648
|
+
},
|
|
649
|
+
paddingInline: {
|
|
650
|
+
type: [
|
|
651
|
+
Boolean,
|
|
652
|
+
Number,
|
|
653
|
+
String
|
|
654
|
+
],
|
|
655
|
+
required: false
|
|
656
|
+
},
|
|
657
|
+
paddingInlineStart: {
|
|
658
|
+
type: [
|
|
659
|
+
Boolean,
|
|
660
|
+
Number,
|
|
661
|
+
String
|
|
662
|
+
],
|
|
663
|
+
required: false
|
|
664
|
+
},
|
|
665
|
+
paddingInlineEnd: {
|
|
666
|
+
type: [
|
|
667
|
+
Boolean,
|
|
668
|
+
Number,
|
|
669
|
+
String
|
|
670
|
+
],
|
|
671
|
+
required: false
|
|
672
|
+
},
|
|
673
|
+
paddingBlockStart: {
|
|
674
|
+
type: [
|
|
675
|
+
Boolean,
|
|
676
|
+
Number,
|
|
677
|
+
String
|
|
678
|
+
],
|
|
679
|
+
required: false
|
|
680
|
+
},
|
|
681
|
+
paddingBlockEnd: {
|
|
682
|
+
type: [
|
|
683
|
+
Boolean,
|
|
684
|
+
Number,
|
|
685
|
+
String
|
|
686
|
+
],
|
|
687
|
+
required: false
|
|
688
|
+
},
|
|
689
|
+
margin: {
|
|
690
|
+
type: [
|
|
691
|
+
Boolean,
|
|
692
|
+
Number,
|
|
693
|
+
String
|
|
694
|
+
],
|
|
695
|
+
required: false
|
|
696
|
+
},
|
|
697
|
+
marginTop: {
|
|
698
|
+
type: [
|
|
699
|
+
Boolean,
|
|
700
|
+
Number,
|
|
701
|
+
String
|
|
702
|
+
],
|
|
703
|
+
required: false
|
|
704
|
+
},
|
|
705
|
+
marginLeft: {
|
|
706
|
+
type: [
|
|
707
|
+
Boolean,
|
|
708
|
+
Number,
|
|
709
|
+
String
|
|
710
|
+
],
|
|
711
|
+
required: false
|
|
712
|
+
},
|
|
713
|
+
marginBottom: {
|
|
714
|
+
type: [
|
|
715
|
+
Boolean,
|
|
716
|
+
Number,
|
|
717
|
+
String
|
|
718
|
+
],
|
|
719
|
+
required: false
|
|
720
|
+
},
|
|
721
|
+
marginRight: {
|
|
722
|
+
type: [
|
|
723
|
+
Boolean,
|
|
724
|
+
Number,
|
|
725
|
+
String
|
|
726
|
+
],
|
|
727
|
+
required: false
|
|
728
|
+
},
|
|
729
|
+
marginBlock: {
|
|
730
|
+
type: [
|
|
731
|
+
Boolean,
|
|
732
|
+
Number,
|
|
733
|
+
String
|
|
734
|
+
],
|
|
735
|
+
required: false
|
|
736
|
+
},
|
|
737
|
+
marginInline: {
|
|
738
|
+
type: [
|
|
739
|
+
Boolean,
|
|
740
|
+
Number,
|
|
741
|
+
String
|
|
742
|
+
],
|
|
743
|
+
required: false
|
|
744
|
+
},
|
|
745
|
+
marginInlineStart: {
|
|
746
|
+
type: [
|
|
747
|
+
Boolean,
|
|
748
|
+
Number,
|
|
749
|
+
String
|
|
750
|
+
],
|
|
751
|
+
required: false
|
|
752
|
+
},
|
|
753
|
+
marginInlineEnd: {
|
|
754
|
+
type: [
|
|
755
|
+
Boolean,
|
|
756
|
+
Number,
|
|
757
|
+
String
|
|
758
|
+
],
|
|
759
|
+
required: false
|
|
760
|
+
},
|
|
761
|
+
marginBlockStart: {
|
|
762
|
+
type: [
|
|
763
|
+
Boolean,
|
|
764
|
+
Number,
|
|
765
|
+
String
|
|
766
|
+
],
|
|
767
|
+
required: false
|
|
768
|
+
},
|
|
769
|
+
marginBlockEnd: {
|
|
770
|
+
type: [
|
|
771
|
+
Boolean,
|
|
772
|
+
Number,
|
|
773
|
+
String
|
|
774
|
+
],
|
|
775
|
+
required: false
|
|
776
|
+
},
|
|
777
|
+
rounded: {
|
|
778
|
+
type: [
|
|
779
|
+
Boolean,
|
|
780
|
+
Number,
|
|
781
|
+
String,
|
|
782
|
+
null
|
|
783
|
+
],
|
|
784
|
+
required: false,
|
|
785
|
+
skipCheck: true
|
|
786
|
+
},
|
|
787
|
+
roundedTopRight: {
|
|
788
|
+
type: [
|
|
789
|
+
Boolean,
|
|
790
|
+
Number,
|
|
791
|
+
String
|
|
792
|
+
],
|
|
793
|
+
required: false
|
|
794
|
+
},
|
|
795
|
+
roundedTopLeft: {
|
|
796
|
+
type: [
|
|
797
|
+
Boolean,
|
|
798
|
+
Number,
|
|
799
|
+
String
|
|
800
|
+
],
|
|
801
|
+
required: false
|
|
802
|
+
},
|
|
803
|
+
roundedBottomLeft: {
|
|
804
|
+
type: [
|
|
805
|
+
Boolean,
|
|
806
|
+
Number,
|
|
807
|
+
String
|
|
808
|
+
],
|
|
809
|
+
required: false
|
|
810
|
+
},
|
|
811
|
+
roundedBottomRight: {
|
|
812
|
+
type: [
|
|
813
|
+
Boolean,
|
|
814
|
+
Number,
|
|
815
|
+
String
|
|
816
|
+
],
|
|
817
|
+
required: false
|
|
818
|
+
},
|
|
819
|
+
roundedStartStart: {
|
|
820
|
+
type: [
|
|
821
|
+
Boolean,
|
|
822
|
+
Number,
|
|
823
|
+
String
|
|
824
|
+
],
|
|
825
|
+
required: false
|
|
826
|
+
},
|
|
827
|
+
roundedStartEnd: {
|
|
828
|
+
type: [
|
|
829
|
+
Boolean,
|
|
830
|
+
Number,
|
|
831
|
+
String
|
|
832
|
+
],
|
|
833
|
+
required: false
|
|
834
|
+
},
|
|
835
|
+
roundedEndStart: {
|
|
836
|
+
type: [
|
|
837
|
+
Boolean,
|
|
838
|
+
Number,
|
|
839
|
+
String
|
|
840
|
+
],
|
|
841
|
+
required: false
|
|
842
|
+
},
|
|
843
|
+
roundedEndEnd: {
|
|
844
|
+
type: [
|
|
845
|
+
Boolean,
|
|
846
|
+
Number,
|
|
847
|
+
String
|
|
848
|
+
],
|
|
849
|
+
required: false
|
|
850
|
+
},
|
|
851
|
+
bgColor: {
|
|
852
|
+
type: [
|
|
853
|
+
String,
|
|
854
|
+
Object,
|
|
855
|
+
Boolean,
|
|
856
|
+
null
|
|
857
|
+
],
|
|
858
|
+
required: false,
|
|
859
|
+
skipCheck: true
|
|
860
|
+
},
|
|
861
|
+
border: {
|
|
862
|
+
type: [
|
|
863
|
+
Boolean,
|
|
864
|
+
Number,
|
|
865
|
+
String,
|
|
866
|
+
Array
|
|
867
|
+
],
|
|
868
|
+
required: false,
|
|
869
|
+
skipCheck: true
|
|
870
|
+
},
|
|
871
|
+
borderTop: {
|
|
872
|
+
type: [
|
|
873
|
+
Boolean,
|
|
874
|
+
Number,
|
|
875
|
+
String
|
|
876
|
+
],
|
|
877
|
+
required: false
|
|
878
|
+
},
|
|
879
|
+
borderLeft: {
|
|
880
|
+
type: [
|
|
881
|
+
Boolean,
|
|
882
|
+
Number,
|
|
883
|
+
String
|
|
884
|
+
],
|
|
885
|
+
required: false
|
|
886
|
+
},
|
|
887
|
+
borderBottom: {
|
|
888
|
+
type: [
|
|
889
|
+
Boolean,
|
|
890
|
+
Number,
|
|
891
|
+
String
|
|
892
|
+
],
|
|
893
|
+
required: false
|
|
894
|
+
},
|
|
895
|
+
borderRight: {
|
|
896
|
+
type: [
|
|
897
|
+
Boolean,
|
|
898
|
+
Number,
|
|
899
|
+
String
|
|
900
|
+
],
|
|
901
|
+
required: false
|
|
902
|
+
},
|
|
903
|
+
borderBlock: {
|
|
904
|
+
type: [
|
|
905
|
+
Boolean,
|
|
906
|
+
Number,
|
|
907
|
+
String
|
|
908
|
+
],
|
|
909
|
+
required: false
|
|
910
|
+
},
|
|
911
|
+
borderInline: {
|
|
912
|
+
type: [
|
|
913
|
+
Boolean,
|
|
914
|
+
Number,
|
|
915
|
+
String
|
|
916
|
+
],
|
|
917
|
+
required: false
|
|
918
|
+
},
|
|
919
|
+
borderInlineStart: {
|
|
920
|
+
type: [
|
|
921
|
+
Boolean,
|
|
922
|
+
Number,
|
|
923
|
+
String
|
|
924
|
+
],
|
|
925
|
+
required: false
|
|
926
|
+
},
|
|
927
|
+
borderInlineEnd: {
|
|
928
|
+
type: [
|
|
929
|
+
Boolean,
|
|
930
|
+
Number,
|
|
931
|
+
String
|
|
932
|
+
],
|
|
933
|
+
required: false
|
|
934
|
+
},
|
|
935
|
+
borderBlockStart: {
|
|
936
|
+
type: [
|
|
937
|
+
Boolean,
|
|
938
|
+
Number,
|
|
939
|
+
String
|
|
940
|
+
],
|
|
941
|
+
required: false
|
|
942
|
+
},
|
|
943
|
+
borderBlockEnd: {
|
|
944
|
+
type: [
|
|
945
|
+
Boolean,
|
|
946
|
+
Number,
|
|
947
|
+
String
|
|
948
|
+
],
|
|
949
|
+
required: false
|
|
950
|
+
},
|
|
951
|
+
borderColor: {
|
|
952
|
+
type: String,
|
|
953
|
+
required: false
|
|
954
|
+
},
|
|
955
|
+
borderStyle: {
|
|
956
|
+
type: String,
|
|
957
|
+
required: false
|
|
958
|
+
},
|
|
959
|
+
borderTopColor: {
|
|
960
|
+
type: [
|
|
961
|
+
String,
|
|
962
|
+
Object,
|
|
963
|
+
Boolean,
|
|
964
|
+
null
|
|
965
|
+
],
|
|
966
|
+
required: false,
|
|
967
|
+
skipCheck: true
|
|
968
|
+
},
|
|
969
|
+
borderRightColor: {
|
|
970
|
+
type: [
|
|
971
|
+
String,
|
|
972
|
+
Object,
|
|
973
|
+
Boolean,
|
|
974
|
+
null
|
|
975
|
+
],
|
|
976
|
+
required: false,
|
|
977
|
+
skipCheck: true
|
|
978
|
+
},
|
|
979
|
+
borderBottomColor: {
|
|
980
|
+
type: [
|
|
981
|
+
String,
|
|
982
|
+
Object,
|
|
983
|
+
Boolean,
|
|
984
|
+
null
|
|
985
|
+
],
|
|
986
|
+
required: false,
|
|
987
|
+
skipCheck: true
|
|
988
|
+
},
|
|
989
|
+
borderLeftColor: {
|
|
990
|
+
type: [
|
|
991
|
+
String,
|
|
992
|
+
Object,
|
|
993
|
+
Boolean,
|
|
994
|
+
null
|
|
995
|
+
],
|
|
996
|
+
required: false,
|
|
997
|
+
skipCheck: true
|
|
998
|
+
},
|
|
999
|
+
borderInlineStartColor: {
|
|
1000
|
+
type: [
|
|
1001
|
+
String,
|
|
1002
|
+
Object,
|
|
1003
|
+
Boolean,
|
|
1004
|
+
null
|
|
1005
|
+
],
|
|
1006
|
+
required: false,
|
|
1007
|
+
skipCheck: true
|
|
1008
|
+
},
|
|
1009
|
+
borderInlineEndColor: {
|
|
1010
|
+
type: [
|
|
1011
|
+
String,
|
|
1012
|
+
Object,
|
|
1013
|
+
Boolean,
|
|
1014
|
+
null
|
|
1015
|
+
],
|
|
1016
|
+
required: false,
|
|
1017
|
+
skipCheck: true
|
|
1018
|
+
},
|
|
1019
|
+
borderBlockStartColor: {
|
|
1020
|
+
type: [
|
|
1021
|
+
String,
|
|
1022
|
+
Object,
|
|
1023
|
+
Boolean,
|
|
1024
|
+
null
|
|
1025
|
+
],
|
|
1026
|
+
required: false,
|
|
1027
|
+
skipCheck: true
|
|
1028
|
+
},
|
|
1029
|
+
borderBlockEndColor: {
|
|
1030
|
+
type: [
|
|
1031
|
+
String,
|
|
1032
|
+
Object,
|
|
1033
|
+
Boolean,
|
|
1034
|
+
null
|
|
1035
|
+
],
|
|
1036
|
+
required: false,
|
|
1037
|
+
skipCheck: true
|
|
1038
|
+
},
|
|
1039
|
+
elevation: {
|
|
1040
|
+
type: [Number, String],
|
|
1041
|
+
required: false
|
|
1042
|
+
},
|
|
1043
|
+
height: {
|
|
1044
|
+
type: [Number, String],
|
|
1045
|
+
required: false
|
|
1046
|
+
},
|
|
1047
|
+
maxHeight: {
|
|
1048
|
+
type: [Number, String],
|
|
1049
|
+
required: false
|
|
1050
|
+
},
|
|
1051
|
+
maxWidth: {
|
|
1052
|
+
type: [Number, String],
|
|
1053
|
+
required: false
|
|
1054
|
+
},
|
|
1055
|
+
minHeight: {
|
|
1056
|
+
type: [Number, String],
|
|
1057
|
+
required: false
|
|
1058
|
+
},
|
|
1059
|
+
minWidth: {
|
|
1060
|
+
type: [Number, String],
|
|
1061
|
+
required: false
|
|
1062
|
+
},
|
|
1063
|
+
width: {
|
|
1064
|
+
type: [Number, String],
|
|
1065
|
+
required: false
|
|
1066
|
+
},
|
|
1067
|
+
direction: {
|
|
1068
|
+
type: null,
|
|
1069
|
+
required: false,
|
|
1070
|
+
default: DIRECTION.HORIZONTAL
|
|
1071
|
+
},
|
|
1072
|
+
errorMessages: {
|
|
1073
|
+
type: [Array, String],
|
|
1074
|
+
required: false
|
|
1075
|
+
},
|
|
1076
|
+
maxErrors: {
|
|
1077
|
+
type: [Number, String],
|
|
1078
|
+
required: false
|
|
1079
|
+
},
|
|
1080
|
+
name: {
|
|
1081
|
+
type: String,
|
|
1082
|
+
required: false
|
|
1083
|
+
},
|
|
1084
|
+
rules: {
|
|
1085
|
+
type: Array,
|
|
1086
|
+
required: false
|
|
1087
|
+
},
|
|
1088
|
+
validateOn: {
|
|
1089
|
+
type: null,
|
|
1090
|
+
required: false
|
|
1091
|
+
},
|
|
1092
|
+
validationValue: {
|
|
1093
|
+
type: null,
|
|
1094
|
+
required: false
|
|
1095
|
+
},
|
|
1096
|
+
focused: {
|
|
1097
|
+
type: Boolean,
|
|
1098
|
+
required: false
|
|
1099
|
+
},
|
|
1100
|
+
appendAvatar: {
|
|
1101
|
+
type: String,
|
|
1102
|
+
required: false
|
|
1103
|
+
},
|
|
1104
|
+
appendIcon: {
|
|
1105
|
+
type: null,
|
|
1106
|
+
required: false
|
|
1107
|
+
},
|
|
1108
|
+
prependAvatar: {
|
|
1109
|
+
type: String,
|
|
1110
|
+
required: false
|
|
1111
|
+
},
|
|
1112
|
+
prependIcon: {
|
|
1113
|
+
type: null,
|
|
1114
|
+
required: false
|
|
1115
|
+
},
|
|
1116
|
+
prependAriaLabel: {
|
|
1117
|
+
type: String,
|
|
1118
|
+
required: false
|
|
1119
|
+
},
|
|
1120
|
+
appendAriaLabel: {
|
|
1121
|
+
type: String,
|
|
1122
|
+
required: false
|
|
1123
|
+
},
|
|
1124
|
+
size: {
|
|
1125
|
+
type: null,
|
|
1126
|
+
required: false
|
|
1127
|
+
},
|
|
1128
|
+
fontSize: {
|
|
1129
|
+
type: null,
|
|
1130
|
+
required: false
|
|
1131
|
+
},
|
|
1132
|
+
fontWeight: {
|
|
1133
|
+
type: null,
|
|
1134
|
+
required: false
|
|
1135
|
+
},
|
|
1136
|
+
lineHeight: {
|
|
1137
|
+
type: null,
|
|
1138
|
+
required: false
|
|
1139
|
+
},
|
|
1140
|
+
ripple: {
|
|
1141
|
+
type: [Boolean, Object],
|
|
1142
|
+
required: false
|
|
1143
|
+
}
|
|
544
1144
|
});
|
|
545
|
-
const emits = defineEmits([
|
|
1145
|
+
const emits = defineEmits([
|
|
1146
|
+
"start",
|
|
1147
|
+
"end",
|
|
1148
|
+
"update:modelValue",
|
|
1149
|
+
"update:focused"
|
|
1150
|
+
]);
|
|
546
1151
|
defineSlots();
|
|
547
1152
|
const { filterProps } = useProps(props);
|
|
548
1153
|
const origamInputRef = ref();
|
|
549
1154
|
const slots = useSlots();
|
|
550
1155
|
const { t } = useLocale();
|
|
1156
|
+
/*********************************************************
|
|
1157
|
+
* Variant routing
|
|
1158
|
+
*
|
|
1159
|
+
* @description
|
|
1160
|
+
* `variant='field'` keeps the legacy chrome (Phase-1 default).
|
|
1161
|
+
* `variant='timer' | 'audio'` drop the `<origam-input>` wrapper
|
|
1162
|
+
* for a sober media-scrubber look. Audio adds a waveform SVG.
|
|
1163
|
+
********************************************************/
|
|
551
1164
|
const isFieldVariant = computed(() => props.variant === SLIDER_FIELD_VARIANT.FIELD);
|
|
552
1165
|
const isAudioVariant = computed(() => props.variant === SLIDER_FIELD_VARIANT.AUDIO);
|
|
553
1166
|
const isBareVariant = computed(() => !isFieldVariant.value);
|
|
1167
|
+
/*********************************************************
|
|
1168
|
+
* Value & Range
|
|
1169
|
+
*
|
|
1170
|
+
* @description
|
|
1171
|
+
* Model value management, range mode detection, and the
|
|
1172
|
+
* tick-aware stepping math via `useSteps`.
|
|
1173
|
+
********************************************************/
|
|
554
1174
|
const isRange = computed(() => !!props.range);
|
|
555
1175
|
const isVertical = computed(() => props.direction === DIRECTION.VERTICAL);
|
|
556
1176
|
const isReversed = computed(() => !!props.reverse);
|
|
557
1177
|
const indexFromEnd = computed(() => isVertical.value !== isReversed.value);
|
|
1178
|
+
/*********************************************************
|
|
1179
|
+
* Noms accessibles des deux poignees en mode `range`
|
|
1180
|
+
*
|
|
1181
|
+
* @description
|
|
1182
|
+
* Le gabarit `${label} (start)` etait ecrit en dur dans les quatre
|
|
1183
|
+
* `<input type="range">` du composant (#764, C8) : un lecteur d'ecran
|
|
1184
|
+
* francophone entendait « Prix (start) ». Le suffixe passe desormais
|
|
1185
|
+
* par `t()`, qui interpole le `label` du consommateur dans la phrase
|
|
1186
|
+
* de la locale active.
|
|
1187
|
+
*
|
|
1188
|
+
* @description
|
|
1189
|
+
* `undefined` quand `label` est vide : un `aria-label=""` ne nomme
|
|
1190
|
+
* rien et prive l'element de son nom implicite, ce que la version
|
|
1191
|
+
* precedente evitait deja.
|
|
1192
|
+
********************************************************/
|
|
558
1193
|
const rangeStartAriaLabel = computed(() => {
|
|
559
|
-
|
|
1194
|
+
return props.label ? t("origam.slider_field.thumb_start_aria_label", props.label) : undefined;
|
|
560
1195
|
});
|
|
561
1196
|
const rangeEndAriaLabel = computed(() => {
|
|
562
|
-
|
|
1197
|
+
return props.label ? t("origam.slider_field.thumb_end_aria_label", props.label) : undefined;
|
|
563
1198
|
});
|
|
564
1199
|
const steps = useSteps(props);
|
|
565
1200
|
const { min: resolvedMin, max: resolvedMax, step: resolvedStep, roundValue } = steps;
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
1201
|
+
/*********************************************************
|
|
1202
|
+
* `useVModel`'s THIRD ARGUMENT IS A PLAIN VALUE, EVALUATED EAGERLY
|
|
1203
|
+
*
|
|
1204
|
+
* @description
|
|
1205
|
+
* `isRange.value ? [resolvedMin.value, resolvedMax.value] :
|
|
1206
|
+
* resolvedMin.value` is a normal JS expression: as an argument to
|
|
1207
|
+
* `useVModel(...)`, it is evaluated BEFORE the call, at the top level
|
|
1208
|
+
* of `setup()` — before Vue's `beforeCreate` hook runs, which is where
|
|
1209
|
+
* the ADR-005 theme resolver patches `instance.props`. That FIRST read
|
|
1210
|
+
* of `isRange.value` / `resolvedMin.value` (both `computed()`s wrapping
|
|
1211
|
+
* `props.range` / `props.min`) caches them at their pre-theme value —
|
|
1212
|
+
* and since a `computed` only invalidates on a tracked-dependency
|
|
1213
|
+
* change, and a theme naming a prop with no accompanying parent
|
|
1214
|
+
* re-render never writes one, they stayed stuck at that snapshot
|
|
1215
|
+
* forever, breaking the SAME `resolvedMin` / `isRange` the template
|
|
1216
|
+
* reads for `:min="resolvedMin"` and the range/single-thumb branch.
|
|
1217
|
+
* The argument is passed as `undefined` because it is DEAD, not merely
|
|
1218
|
+
* harmless: `useVModel` reaches its third argument only when
|
|
1219
|
+
* `props.modelValue === undefined`, and `withDefaults()` above declares
|
|
1220
|
+
* `modelValue: 0`, so it never is. Naming any expression here — even a
|
|
1221
|
+
* literal-only one like `props.range ? [0, 100] : 0` — would reintroduce
|
|
1222
|
+
* an eager read of `props.range` for a value nothing consumes, and leave
|
|
1223
|
+
* `setup-reads.mjs` reporting a defect that no longer exists.
|
|
1224
|
+
********************************************************/
|
|
1225
|
+
const model = useVModel(props, "modelValue", undefined, (value) => {
|
|
1226
|
+
if (isRange.value) {
|
|
1227
|
+
const array = value;
|
|
1228
|
+
if (!array?.length) return [resolvedMin.value, resolvedMax.value];
|
|
1229
|
+
return array.map((val) => roundValue(val));
|
|
1230
|
+
}
|
|
1231
|
+
return roundValue(value == null ? resolvedMin.value : value);
|
|
1232
|
+
});
|
|
579
1233
|
const singleValue = computed(() => {
|
|
580
|
-
|
|
1234
|
+
return isRange.value ? resolvedMin.value : model.value;
|
|
581
1235
|
});
|
|
582
1236
|
const rangeValue = computed(() => {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
1237
|
+
if (!isRange.value) return [resolvedMin.value, resolvedMax.value];
|
|
1238
|
+
const v = model.value;
|
|
1239
|
+
return [v[0] ?? resolvedMin.value, v[1] ?? resolvedMax.value];
|
|
586
1240
|
});
|
|
1241
|
+
/*********************************************************
|
|
1242
|
+
* Position math
|
|
1243
|
+
*
|
|
1244
|
+
* @description
|
|
1245
|
+
* Pure-function value → percentage conversion, fully driven
|
|
1246
|
+
* by the native `<input type="range">` value. No JS drag
|
|
1247
|
+
* pipeline, no pointer math — the browser owns it.
|
|
1248
|
+
********************************************************/
|
|
587
1249
|
const toPercent = (val) => {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
1250
|
+
const span = resolvedMax.value - resolvedMin.value;
|
|
1251
|
+
if (!span) return 0;
|
|
1252
|
+
const pct = (val - resolvedMin.value) / span * 100;
|
|
1253
|
+
return clamp(isNaN(pct) ? 0 : pct, 0, 100);
|
|
592
1254
|
};
|
|
593
1255
|
const modelPercentage = computed(() => toPercent(singleValue.value));
|
|
594
1256
|
const rangeStartPercentage = computed(() => toPercent(rangeValue.value[0]));
|
|
@@ -596,294 +1258,454 @@ const rangeStopPercentage = computed(() => toPercent(rangeValue.value[1]));
|
|
|
596
1258
|
const trackStop = computed(() => modelPercentage.value);
|
|
597
1259
|
const trackRangeStart = computed(() => rangeStartPercentage.value);
|
|
598
1260
|
const trackRangeStop = computed(() => rangeStopPercentage.value);
|
|
1261
|
+
/*********************************************************
|
|
1262
|
+
* Buffered (media-scrubber parity)
|
|
1263
|
+
*
|
|
1264
|
+
* @description
|
|
1265
|
+
* `buffered` paints a secondary fill from `min` to `buffered`.
|
|
1266
|
+
* Rendered as a sibling DOM element behind the active fill —
|
|
1267
|
+
* CSS owns the visual stacking, no inline JS layout math.
|
|
1268
|
+
********************************************************/
|
|
599
1269
|
const hasBuffered = computed(() => {
|
|
600
|
-
|
|
601
|
-
|
|
1270
|
+
if (typeof props.buffered !== "number") return false;
|
|
1271
|
+
return Number.isFinite(props.buffered);
|
|
602
1272
|
});
|
|
603
1273
|
const bufferedPercentage = computed(() => {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
1274
|
+
if (!hasBuffered.value) return 0;
|
|
1275
|
+
const clamped = clamp(props.buffered, resolvedMin.value, resolvedMax.value);
|
|
1276
|
+
return toPercent(clamped);
|
|
607
1277
|
});
|
|
1278
|
+
/**
|
|
1279
|
+
* Where the buffered fill is anchored: vertical sliders grow from the
|
|
1280
|
+
* bottom, horizontal ones from whichever inline edge the track starts at.
|
|
1281
|
+
* Split out of `bufferedStyles` as guard clauses — the three cases are
|
|
1282
|
+
* mutually exclusive and read better than a nested ternary.
|
|
1283
|
+
*/
|
|
608
1284
|
const bufferedPosition = computed(() => {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
1285
|
+
const pct = bufferedPercentage.value;
|
|
1286
|
+
if (isVertical.value) return {
|
|
1287
|
+
height: `${pct}%`,
|
|
1288
|
+
bottom: "0"
|
|
1289
|
+
};
|
|
1290
|
+
if (indexFromEnd.value) return {
|
|
1291
|
+
width: `${pct}%`,
|
|
1292
|
+
insetInlineEnd: "0"
|
|
1293
|
+
};
|
|
1294
|
+
return {
|
|
1295
|
+
width: `${pct}%`,
|
|
1296
|
+
insetInlineStart: "0"
|
|
1297
|
+
};
|
|
613
1298
|
});
|
|
614
1299
|
const bufferedStyles = computed(() => {
|
|
615
|
-
|
|
1300
|
+
return [bufferedPosition.value, roundedStyles.value];
|
|
616
1301
|
});
|
|
1302
|
+
/*********************************************************
|
|
1303
|
+
* Waveform (variant='audio')
|
|
1304
|
+
*
|
|
1305
|
+
* @description
|
|
1306
|
+
* `peaks` is a `[0..1]` array drawn as vertical bars BEHIND the
|
|
1307
|
+
* track via inline SVG (a single `<svg>` sibling — `pointer-events:
|
|
1308
|
+
* none` so the native input keeps full pointer capture). The bar
|
|
1309
|
+
* fill is split at the model thumb position: left of the thumb uses
|
|
1310
|
+
* `currentColor`, right uses a 35 % mix.
|
|
1311
|
+
********************************************************/
|
|
617
1312
|
const hasPeaks = computed(() => {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
1313
|
+
if (!isAudioVariant.value) return false;
|
|
1314
|
+
const peaks = props.peaks;
|
|
1315
|
+
return Array.isArray(peaks) && peaks.length > 0;
|
|
621
1316
|
});
|
|
1317
|
+
/*********************************************************
|
|
1318
|
+
* Hover tooltip (RAF-throttled)
|
|
1319
|
+
*
|
|
1320
|
+
* @description
|
|
1321
|
+
* The X-position of the cursor on the rail is forwarded as a CSS
|
|
1322
|
+
* variable (`--origam-slider-field---hover-x`). A single pointermove
|
|
1323
|
+
* handler is RAF-throttled so the tooltip position never re-renders
|
|
1324
|
+
* more than once per frame.
|
|
1325
|
+
********************************************************/
|
|
622
1326
|
const hoverValue = ref(null);
|
|
623
1327
|
const hoverRafId = ref(null);
|
|
624
1328
|
const hoverContainerEl = ref(null);
|
|
625
1329
|
const hoverTooltipLabel = computed(() => {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
1330
|
+
const fn = props.formatHoverTooltip;
|
|
1331
|
+
const value = hoverValue.value ?? 0;
|
|
1332
|
+
return fn ? fn(value) : String(value);
|
|
629
1333
|
});
|
|
630
1334
|
const computeHoverFromEvent = (event, container) => {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
1335
|
+
const rect = container.getBoundingClientRect();
|
|
1336
|
+
const pct = isVertical.value ? clamp((rect.bottom - event.clientY) / Math.max(1, rect.height) * 100, 0, 100) : clamp((event.clientX - rect.left) / Math.max(1, rect.width) * 100, 0, 100);
|
|
1337
|
+
const adjusted = indexFromEnd.value && !isVertical.value ? 100 - pct : pct;
|
|
1338
|
+
const span = resolvedMax.value - resolvedMin.value;
|
|
1339
|
+
const rawValue = resolvedMin.value + adjusted / 100 * span;
|
|
1340
|
+
hoverValue.value = roundValue(clamp(rawValue, resolvedMin.value, resolvedMax.value));
|
|
1341
|
+
container.style.setProperty("--origam-slider-field---hover-x", `${pct}%`);
|
|
638
1342
|
};
|
|
639
1343
|
const handleHoverPointerMove = (event) => {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
1344
|
+
if (props.disabled) return;
|
|
1345
|
+
if (!props.showHoverTooltip) return;
|
|
1346
|
+
const container = event.currentTarget;
|
|
1347
|
+
if (!container) return;
|
|
1348
|
+
hoverContainerEl.value = container;
|
|
1349
|
+
if (hoverRafId.value !== null) return;
|
|
1350
|
+
hoverRafId.value = requestAnimationFrame(() => {
|
|
1351
|
+
hoverRafId.value = null;
|
|
1352
|
+
computeHoverFromEvent(event, container);
|
|
1353
|
+
});
|
|
650
1354
|
};
|
|
651
1355
|
const handleHoverPointerLeave = () => {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
1356
|
+
if (hoverRafId.value !== null) {
|
|
1357
|
+
cancelAnimationFrame(hoverRafId.value);
|
|
1358
|
+
hoverRafId.value = null;
|
|
1359
|
+
}
|
|
1360
|
+
const container = hoverContainerEl.value;
|
|
1361
|
+
if (container) {
|
|
1362
|
+
container.style.removeProperty("--origam-slider-field---hover-x");
|
|
1363
|
+
}
|
|
1364
|
+
hoverValue.value = null;
|
|
661
1365
|
};
|
|
1366
|
+
/*********************************************************
|
|
1367
|
+
* Ticks
|
|
1368
|
+
*
|
|
1369
|
+
* @description
|
|
1370
|
+
* Tick descriptors computed once at the parent level and
|
|
1371
|
+
* forwarded to the track as a flat array — keeps the track
|
|
1372
|
+
* component dumb (props in, DOM out).
|
|
1373
|
+
********************************************************/
|
|
662
1374
|
const tickSize = computed(() => {
|
|
663
|
-
|
|
664
|
-
|
|
1375
|
+
if (typeof props.tickSize === "number") return props.tickSize;
|
|
1376
|
+
return 2;
|
|
665
1377
|
});
|
|
666
1378
|
const parsedTicks = computed(() => {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
1379
|
+
if (!props.showTicks) return [];
|
|
1380
|
+
const span = resolvedMax.value - resolvedMin.value;
|
|
1381
|
+
const step = resolvedStep.value;
|
|
1382
|
+
const ticksProp = props.ticks;
|
|
1383
|
+
if (!ticksProp) {
|
|
1384
|
+
if (!step || span <= 0) return [];
|
|
1385
|
+
const count = span / step;
|
|
1386
|
+
if (!isFinite(count)) return [];
|
|
1387
|
+
return createRange(count + 1).map((t) => {
|
|
1388
|
+
const value = resolvedMin.value + t * step;
|
|
1389
|
+
return {
|
|
1390
|
+
value,
|
|
1391
|
+
position: toPercent(value)
|
|
1392
|
+
};
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
if (Array.isArray(ticksProp)) {
|
|
1396
|
+
return ticksProp.map((t) => ({
|
|
1397
|
+
value: t,
|
|
1398
|
+
position: toPercent(t),
|
|
1399
|
+
label: String(t)
|
|
1400
|
+
}));
|
|
1401
|
+
}
|
|
1402
|
+
if (typeof ticksProp === "object" && ticksProp !== null) {
|
|
1403
|
+
return Object.keys(ticksProp).map((key) => ({
|
|
1404
|
+
value: parseFloat(key),
|
|
1405
|
+
position: toPercent(parseFloat(key)),
|
|
1406
|
+
label: ticksProp[key]
|
|
1407
|
+
}));
|
|
1408
|
+
}
|
|
1409
|
+
return [];
|
|
698
1410
|
});
|
|
699
1411
|
const hasTickLabels = computed(() => parsedTicks.value.some(({ label }) => !!label));
|
|
1412
|
+
/*********************************************************
|
|
1413
|
+
* Focus & range thumb routing
|
|
1414
|
+
*
|
|
1415
|
+
* @description
|
|
1416
|
+
* Focus state plus a `lastInteracted` flag that tracks which
|
|
1417
|
+
* of the two range thumbs received the most recent input —
|
|
1418
|
+
* used by the visual thumb proxy + the e2e/ a11y story.
|
|
1419
|
+
********************************************************/
|
|
700
1420
|
const { isFocused, onFocus, onBlur } = useFocus(props);
|
|
701
1421
|
const { rtlClasses } = useRtl();
|
|
702
1422
|
const lastInteracted = ref("stop");
|
|
703
1423
|
const handleFocus = () => {
|
|
704
|
-
|
|
1424
|
+
onFocus();
|
|
705
1425
|
};
|
|
706
1426
|
const handleBlur = () => {
|
|
707
|
-
|
|
1427
|
+
onBlur();
|
|
708
1428
|
};
|
|
709
1429
|
const handleRangeFocusStart = () => {
|
|
710
|
-
|
|
711
|
-
|
|
1430
|
+
lastInteracted.value = "start";
|
|
1431
|
+
onFocus();
|
|
712
1432
|
};
|
|
713
1433
|
const handleRangeFocusStop = () => {
|
|
714
|
-
|
|
715
|
-
|
|
1434
|
+
lastInteracted.value = "stop";
|
|
1435
|
+
onFocus();
|
|
716
1436
|
};
|
|
1437
|
+
/*********************************************************
|
|
1438
|
+
* Pointer lifecycle
|
|
1439
|
+
*
|
|
1440
|
+
* @description
|
|
1441
|
+
* `start` / `end` emits map 1:1 to pointerdown / pointerup
|
|
1442
|
+
* on the native input. The browser handles the drag itself,
|
|
1443
|
+
* so we only need to flag pressed state for styling.
|
|
1444
|
+
********************************************************/
|
|
717
1445
|
const mousePressed = ref(false);
|
|
718
1446
|
const handleStart = () => {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1447
|
+
if (props.readonly || props.disabled) return;
|
|
1448
|
+
mousePressed.value = true;
|
|
1449
|
+
emits("start", model.value);
|
|
722
1450
|
};
|
|
723
1451
|
const handleEnd = () => {
|
|
724
|
-
|
|
725
|
-
|
|
1452
|
+
mousePressed.value = false;
|
|
1453
|
+
emits("end", model.value);
|
|
726
1454
|
};
|
|
1455
|
+
/*********************************************************
|
|
1456
|
+
* Input handlers
|
|
1457
|
+
*
|
|
1458
|
+
* @description
|
|
1459
|
+
* Native `input` (live drag) and `change` (commit) events
|
|
1460
|
+
* are bridged to v-model with step rounding.
|
|
1461
|
+
********************************************************/
|
|
727
1462
|
const handleSingleInput = (e) => {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
1463
|
+
const target = e.target;
|
|
1464
|
+
const v = roundValue(target.value);
|
|
1465
|
+
model.value = v;
|
|
731
1466
|
};
|
|
732
1467
|
const handleSingleChange = handleSingleInput;
|
|
733
1468
|
const handleRangeStartInput = (e) => {
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
1469
|
+
const target = e.target;
|
|
1470
|
+
lastInteracted.value = "start";
|
|
1471
|
+
const v = roundValue(target.value);
|
|
1472
|
+
const [, stop] = rangeValue.value;
|
|
1473
|
+
model.value = [Math.min(v, stop), stop];
|
|
739
1474
|
};
|
|
740
1475
|
const handleRangeStartChange = (e) => handleRangeStartInput(e);
|
|
741
1476
|
const handleRangeStopInput = (e) => {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
1477
|
+
const target = e.target;
|
|
1478
|
+
lastInteracted.value = "stop";
|
|
1479
|
+
const v = roundValue(target.value);
|
|
1480
|
+
const [start] = rangeValue.value;
|
|
1481
|
+
model.value = [start, Math.max(v, start)];
|
|
747
1482
|
};
|
|
748
1483
|
const handleRangeStopChange = (e) => handleRangeStopInput(e);
|
|
1484
|
+
/*********************************************************
|
|
1485
|
+
* Click-on-rail (range mode)
|
|
1486
|
+
*
|
|
1487
|
+
* @description
|
|
1488
|
+
* In range mode the two stacked native inputs can shadow
|
|
1489
|
+
* each other for a rail click — we proxy the click to the
|
|
1490
|
+
* closest thumb when the original target is the container
|
|
1491
|
+
* itself (not an input).
|
|
1492
|
+
********************************************************/
|
|
749
1493
|
const handleContainerClick = (e) => {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1494
|
+
if (!isRange.value) return;
|
|
1495
|
+
if (props.readonly || props.disabled) return;
|
|
1496
|
+
const target = e.target;
|
|
1497
|
+
if (target.tagName === "INPUT") return;
|
|
1498
|
+
const container = e.currentTarget;
|
|
1499
|
+
const rect = container.getBoundingClientRect();
|
|
1500
|
+
const pct = isVertical.value ? (rect.bottom - e.clientY) / rect.height : (e.clientX - rect.left) / rect.width;
|
|
1501
|
+
const adjusted = indexFromEnd.value ? 1 - pct : pct;
|
|
1502
|
+
const span = resolvedMax.value - resolvedMin.value;
|
|
1503
|
+
const rawValue = clamp(resolvedMin.value + adjusted * span, resolvedMin.value, resolvedMax.value);
|
|
1504
|
+
const value = roundValue(rawValue);
|
|
1505
|
+
const [start, stop] = rangeValue.value;
|
|
1506
|
+
// Pick the thumb whose value is closer to the click position.
|
|
1507
|
+
const distStart = Math.abs(value - start);
|
|
1508
|
+
const distStop = Math.abs(value - stop);
|
|
1509
|
+
if (distStart <= distStop) {
|
|
1510
|
+
lastInteracted.value = "start";
|
|
1511
|
+
model.value = [Math.min(value, stop), stop];
|
|
1512
|
+
} else {
|
|
1513
|
+
lastInteracted.value = "stop";
|
|
1514
|
+
model.value = [start, Math.max(value, start)];
|
|
1515
|
+
}
|
|
771
1516
|
};
|
|
1517
|
+
/*********************************************************
|
|
1518
|
+
* Color
|
|
1519
|
+
*
|
|
1520
|
+
* @description
|
|
1521
|
+
* `color` paints the fill + thumb surface (`currentColor`),
|
|
1522
|
+
* `bgColor` paints the rail. `error` forces `danger` on both
|
|
1523
|
+
* (override convention shared with Input/Form/Snackbar).
|
|
1524
|
+
********************************************************/
|
|
772
1525
|
const color = computed(() => {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
1526
|
+
if (props.disabled) return undefined;
|
|
1527
|
+
if (props.error) return "danger";
|
|
1528
|
+
return props.color;
|
|
776
1529
|
});
|
|
777
1530
|
const bgColor = computed(() => {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
1531
|
+
if (props.disabled) return undefined;
|
|
1532
|
+
if (props.error) return "danger";
|
|
1533
|
+
return props.bgColor;
|
|
781
1534
|
});
|
|
782
1535
|
const { backgroundColorClasses: thumbBgClasses, backgroundColorStyles: thumbBgStyles } = useBackgroundColor(color);
|
|
783
1536
|
const { textColorClasses: thumbTextClasses, textColorStyles: thumbTextStyles } = useTextColor(color);
|
|
1537
|
+
/*********************************************************
|
|
1538
|
+
* Rounded
|
|
1539
|
+
*
|
|
1540
|
+
* @description
|
|
1541
|
+
* `ISliderFieldProps extends IRoundedProps`, but until #283 the
|
|
1542
|
+
* `rounded` prop was declared and never consumed anywhere in this
|
|
1543
|
+
* component — no `useRounded()` call, no forwarding to the track,
|
|
1544
|
+
* every radius in the SCSS was hardcoded (`999px`/`9999px`).
|
|
1545
|
+
*
|
|
1546
|
+
* `resolvedRounded` lets an explicit `trackProps.rounded` win (the
|
|
1547
|
+
* dedicated track-level override channel), falling back to the
|
|
1548
|
+
* slider's own top-level `rounded` prop otherwise. The SAME resolved
|
|
1549
|
+
* value both (1) gets forwarded to `<OrigamSliderFieldTrack>` — which
|
|
1550
|
+
* already wires `useRounded()` correctly, so the rail picks it up for
|
|
1551
|
+
* free (no duplicated logic) — and (2) drives `roundedStyles` here,
|
|
1552
|
+
* applied to the `__buffered` fill so it always matches the rail's
|
|
1553
|
+
* shape. The default (unset) case is untouched: `roundedStyles` stays
|
|
1554
|
+
* empty and every hardcoded radius falls back to the new
|
|
1555
|
+
* `--origam-slider-field---border-radius` token (themeable without
|
|
1556
|
+
* ever touching the `rounded` prop).
|
|
1557
|
+
********************************************************/
|
|
784
1558
|
const resolvedRounded = computed(() => {
|
|
785
|
-
|
|
1559
|
+
return props.trackProps?.rounded ?? props.rounded;
|
|
786
1560
|
});
|
|
787
1561
|
const { roundedClasses, roundedStyles } = useRounded(resolvedRounded);
|
|
1562
|
+
/*********************************************************
|
|
1563
|
+
* Native input styling
|
|
1564
|
+
*
|
|
1565
|
+
* @description
|
|
1566
|
+
* Forwarded props (Input wrapper, Track, container classes,
|
|
1567
|
+
* and the thumb visual proxy). The native `<input>` itself
|
|
1568
|
+
* is transparent — it owns interaction only.
|
|
1569
|
+
********************************************************/
|
|
1570
|
+
/*********************************************************
|
|
1571
|
+
* Forwarded props
|
|
1572
|
+
********************************************************/
|
|
1573
|
+
/*********************************************************
|
|
1574
|
+
* inputProps
|
|
1575
|
+
*
|
|
1576
|
+
* @description
|
|
1577
|
+
* Strips the entire IColorProps surface so `OrigamInput` (the row
|
|
1578
|
+
* wrapper) doesn't paint the consumer's intent on its background.
|
|
1579
|
+
* `color` / `bgColor` stay strictly scoped to the slider track +
|
|
1580
|
+
* thumb (per the project's color contract).
|
|
1581
|
+
* @description
|
|
1582
|
+
* #421 — `id` is deliberately NOT in this exclude list: OrigamInput
|
|
1583
|
+
* needs it to build `<id>-messages`, the target of its own
|
|
1584
|
+
* `aria-describedby`, and to feed its default slot's `id` (consumed
|
|
1585
|
+
* by OrigamField, then the real `<input type="range">`). Excluding it
|
|
1586
|
+
* forced OrigamInput to invent an id, so a consumer passing `id` got
|
|
1587
|
+
* a range input unreachable by `getElementById` — same fix as
|
|
1588
|
+
* OrigamTextField (ce365b10).
|
|
1589
|
+
********************************************************/
|
|
788
1590
|
const inputProps = computed(() => {
|
|
789
|
-
|
|
1591
|
+
return origamInputRef.value?.filterProps(props, [
|
|
1592
|
+
"modelValue",
|
|
1593
|
+
"class",
|
|
1594
|
+
"style",
|
|
1595
|
+
"focused",
|
|
1596
|
+
"centerAffix",
|
|
1597
|
+
"color",
|
|
1598
|
+
"bgColor"
|
|
1599
|
+
]);
|
|
790
1600
|
});
|
|
791
1601
|
const trackProps = computed(() => {
|
|
792
|
-
|
|
1602
|
+
return omit(props.trackProps ?? {}, [
|
|
1603
|
+
"class",
|
|
1604
|
+
"start",
|
|
1605
|
+
"stop",
|
|
1606
|
+
"color",
|
|
1607
|
+
"bgColor",
|
|
1608
|
+
"disabled",
|
|
1609
|
+
"error",
|
|
1610
|
+
"isVertical",
|
|
1611
|
+
"indexFromEnd",
|
|
1612
|
+
"showTicks",
|
|
1613
|
+
"tickSize",
|
|
1614
|
+
"ticks",
|
|
1615
|
+
"min",
|
|
1616
|
+
"max"
|
|
1617
|
+
]);
|
|
793
1618
|
});
|
|
794
1619
|
const hasPrepend = computed(() => {
|
|
795
|
-
|
|
1620
|
+
return !!props.label || slots.label || slots.prepend;
|
|
796
1621
|
});
|
|
797
1622
|
const nativeInputClasses = (isStop) => {
|
|
798
|
-
|
|
799
|
-
"origam-slider-field__input",
|
|
800
|
-
isStop ? "origam-slider-field__input--upper" : "origam-slider-field__input--lower"
|
|
801
|
-
];
|
|
1623
|
+
return ["origam-slider-field__input", isStop ? "origam-slider-field__input--upper" : "origam-slider-field__input--lower"];
|
|
802
1624
|
};
|
|
803
1625
|
const nativeInputStyles = (percentage) => {
|
|
804
|
-
|
|
805
|
-
"--origam-slider-field__input---percentage": `${percentage}%`
|
|
806
|
-
};
|
|
1626
|
+
return { "--origam-slider-field__input---percentage": `${percentage}%` };
|
|
807
1627
|
};
|
|
808
1628
|
const thumbClasses = (focused) => {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
1629
|
+
return [
|
|
1630
|
+
"origam-slider-field-thumb",
|
|
1631
|
+
"origam-slider-field__thumb",
|
|
1632
|
+
{
|
|
1633
|
+
"origam-slider-field-thumb--focused": focused,
|
|
1634
|
+
"origam-slider-field-thumb--pressed": focused && mousePressed.value
|
|
1635
|
+
}
|
|
1636
|
+
];
|
|
817
1637
|
};
|
|
818
1638
|
const thumbStyles = (percentage) => {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
[dirVar]: `${computedPct}%`
|
|
823
|
-
};
|
|
1639
|
+
const dirVar = isVertical.value ? "bottom" : "inset-inline-start";
|
|
1640
|
+
const computedPct = indexFromEnd.value && !isVertical.value ? 100 - percentage : percentage;
|
|
1641
|
+
return { [dirVar]: `${computedPct}%` };
|
|
824
1642
|
};
|
|
825
1643
|
const thumbSurfaceClasses = computed(() => [
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
]);
|
|
830
|
-
const thumbSurfaceStyles = computed(() => [
|
|
831
|
-
thumbTextStyles.value,
|
|
832
|
-
thumbBgStyles.value
|
|
1644
|
+
"origam-slider-field-thumb__surface",
|
|
1645
|
+
thumbTextClasses.value,
|
|
1646
|
+
thumbBgClasses.value
|
|
833
1647
|
]);
|
|
1648
|
+
const thumbSurfaceStyles = computed(() => [thumbTextStyles.value, thumbBgStyles.value]);
|
|
1649
|
+
/*********************************************************
|
|
1650
|
+
* Class & Style
|
|
1651
|
+
*
|
|
1652
|
+
* @description
|
|
1653
|
+
* Root element classes and styles.
|
|
1654
|
+
********************************************************/
|
|
834
1655
|
const sliderFieldStyles = computed(() => {
|
|
835
|
-
|
|
836
|
-
{
|
|
837
|
-
"--origam-slider-field---track-size": convertToUnit(typeof props.trackProps?.size === "number" ? props.trackProps.size : 4)
|
|
838
|
-
},
|
|
839
|
-
props.style
|
|
840
|
-
];
|
|
1656
|
+
return [{ "--origam-slider-field---track-size": convertToUnit(typeof props.trackProps?.size === "number" ? props.trackProps.size : 4) }, props.style];
|
|
841
1657
|
});
|
|
842
1658
|
const variantClass = computed(() => `origam-slider-field--variant-${props.variant ?? SLIDER_FIELD_VARIANT.FIELD}`);
|
|
843
1659
|
const sharedStateClasses = computed(() => ({
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1660
|
+
"origam-slider-field--has-labels": slots.tickLabel || hasTickLabels.value,
|
|
1661
|
+
"origam-slider-field--focused": isFocused.value,
|
|
1662
|
+
"origam-slider-field--pressed": mousePressed.value,
|
|
1663
|
+
"origam-slider-field--disabled": props.disabled,
|
|
1664
|
+
"origam-slider-field--readonly": props.readonly,
|
|
1665
|
+
"origam-slider-field--error": props.error,
|
|
1666
|
+
"origam-slider-field--range": isRange.value,
|
|
1667
|
+
"origam-slider-field--inset": props.inset,
|
|
1668
|
+
"origam-slider-field--vertical": isVertical.value,
|
|
1669
|
+
"origam-slider-field--horizontal": !isVertical.value,
|
|
1670
|
+
"origam-slider-field--thumb-on-hover": props.showThumbOnHoverOnly || isBareVariant.value,
|
|
1671
|
+
"origam-slider-field--has-buffered": hasBuffered.value,
|
|
1672
|
+
"origam-slider-field--has-peaks": hasPeaks.value
|
|
857
1673
|
}));
|
|
858
1674
|
const sliderFieldClasses = computed(() => {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1675
|
+
return [
|
|
1676
|
+
"origam-slider-field",
|
|
1677
|
+
variantClass.value,
|
|
1678
|
+
sharedStateClasses.value,
|
|
1679
|
+
rtlClasses.value,
|
|
1680
|
+
roundedClasses.value,
|
|
1681
|
+
props.class
|
|
1682
|
+
];
|
|
867
1683
|
});
|
|
868
1684
|
const bareWrapperClasses = computed(() => {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1685
|
+
return [
|
|
1686
|
+
"origam-slider-field",
|
|
1687
|
+
"origam-slider-field--bare",
|
|
1688
|
+
variantClass.value,
|
|
1689
|
+
sharedStateClasses.value,
|
|
1690
|
+
rtlClasses.value,
|
|
1691
|
+
roundedClasses.value,
|
|
1692
|
+
props.class
|
|
1693
|
+
];
|
|
878
1694
|
});
|
|
879
1695
|
const { id, css, load, isLoaded, unload } = useStyle(sliderFieldStyles);
|
|
1696
|
+
/*********************************************************
|
|
1697
|
+
* Expose
|
|
1698
|
+
*
|
|
1699
|
+
* @description
|
|
1700
|
+
* Public API surface exposed to parent refs.
|
|
1701
|
+
********************************************************/
|
|
880
1702
|
defineExpose({
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1703
|
+
filterProps,
|
|
1704
|
+
css,
|
|
1705
|
+
id,
|
|
1706
|
+
load,
|
|
1707
|
+
unload,
|
|
1708
|
+
isLoaded
|
|
887
1709
|
});
|
|
888
1710
|
</script>
|
|
889
1711
|
|