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
|
@@ -268,22 +268,7 @@
|
|
|
268
268
|
</template>
|
|
269
269
|
|
|
270
270
|
<script lang="ts" setup>
|
|
271
|
-
import {
|
|
272
|
-
computed,
|
|
273
|
-
getCurrentInstance,
|
|
274
|
-
inject,
|
|
275
|
-
mergeProps,
|
|
276
|
-
nextTick,
|
|
277
|
-
onBeforeUnmount,
|
|
278
|
-
onMounted,
|
|
279
|
-
ref,
|
|
280
|
-
shallowRef,
|
|
281
|
-
StyleValue,
|
|
282
|
-
toRef,
|
|
283
|
-
useSlots,
|
|
284
|
-
VNodeRef,
|
|
285
|
-
watch
|
|
286
|
-
} from "vue";
|
|
271
|
+
import { computed, getCurrentInstance, inject, mergeProps, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, StyleValue, toRef, useSlots, VNodeRef, watch } from "vue";
|
|
287
272
|
import OrigamAvatar from "../Avatar/OrigamAvatar.vue";
|
|
288
273
|
import OrigamCheckboxBtn from "../Checkbox/OrigamCheckboxBtn.vue";
|
|
289
274
|
import OrigamChip from "../Chip/OrigamChip.vue";
|
|
@@ -319,233 +304,1072 @@ import { TEXT_FIELD_TYPE } from "../../enums/TextField/text-field.enum";
|
|
|
319
304
|
import { deepEqual, matchesSelector, wrapInArray } from "../../utils/Commons/commons.util";
|
|
320
305
|
import { forwardRefs } from "../../utils/Commons/forwardRefs.util";
|
|
321
306
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
307
|
+
/*********************************************************
|
|
308
|
+
* Global
|
|
309
|
+
*
|
|
310
|
+
* @description
|
|
311
|
+
* Props, emits and filterProps for the Select component.
|
|
312
|
+
********************************************************/
|
|
322
313
|
const props = defineProps({
|
|
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
|
-
|
|
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
|
-
|
|
314
|
+
chips: {
|
|
315
|
+
type: Boolean,
|
|
316
|
+
required: false
|
|
317
|
+
},
|
|
318
|
+
closableChips: {
|
|
319
|
+
type: Boolean,
|
|
320
|
+
required: false
|
|
321
|
+
},
|
|
322
|
+
hideNoData: {
|
|
323
|
+
type: Boolean,
|
|
324
|
+
required: false
|
|
325
|
+
},
|
|
326
|
+
hideSelected: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
required: false
|
|
329
|
+
},
|
|
330
|
+
listProps: {
|
|
331
|
+
type: Object,
|
|
332
|
+
required: false
|
|
333
|
+
},
|
|
334
|
+
menu: {
|
|
335
|
+
type: Boolean,
|
|
336
|
+
required: false
|
|
337
|
+
},
|
|
338
|
+
menuIcon: {
|
|
339
|
+
type: null,
|
|
340
|
+
required: false,
|
|
341
|
+
default: MDI_ICONS.CHEVRON_DOWN
|
|
342
|
+
},
|
|
343
|
+
menuProps: {
|
|
344
|
+
type: Object,
|
|
345
|
+
required: false
|
|
346
|
+
},
|
|
347
|
+
chipProps: {
|
|
348
|
+
type: Object,
|
|
349
|
+
required: false
|
|
350
|
+
},
|
|
351
|
+
multiple: {
|
|
352
|
+
type: Boolean,
|
|
353
|
+
required: false
|
|
354
|
+
},
|
|
355
|
+
noDataText: {
|
|
356
|
+
type: String,
|
|
357
|
+
required: false,
|
|
358
|
+
default: "origam.no_data_text"
|
|
359
|
+
},
|
|
360
|
+
openOnClear: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
required: false
|
|
363
|
+
},
|
|
364
|
+
autocomplete: {
|
|
365
|
+
type: Boolean,
|
|
366
|
+
required: false
|
|
367
|
+
},
|
|
368
|
+
autoSelectFirst: {
|
|
369
|
+
type: [Boolean, String],
|
|
370
|
+
required: false
|
|
371
|
+
},
|
|
372
|
+
clearOnSelect: {
|
|
373
|
+
type: Boolean,
|
|
374
|
+
required: false
|
|
375
|
+
},
|
|
376
|
+
divider: {
|
|
377
|
+
type: String,
|
|
378
|
+
required: false,
|
|
379
|
+
default: ","
|
|
380
|
+
},
|
|
381
|
+
search: {
|
|
382
|
+
type: String,
|
|
383
|
+
required: false
|
|
384
|
+
},
|
|
385
|
+
closeText: {
|
|
386
|
+
type: String,
|
|
387
|
+
required: false,
|
|
388
|
+
default: "origam.close"
|
|
389
|
+
},
|
|
390
|
+
openText: {
|
|
391
|
+
type: String,
|
|
392
|
+
required: false,
|
|
393
|
+
default: "origam.open"
|
|
394
|
+
},
|
|
395
|
+
id: {
|
|
396
|
+
type: String,
|
|
397
|
+
required: false
|
|
398
|
+
},
|
|
399
|
+
class: {
|
|
400
|
+
type: [
|
|
401
|
+
String,
|
|
402
|
+
Array,
|
|
403
|
+
Object
|
|
404
|
+
],
|
|
405
|
+
required: false
|
|
406
|
+
},
|
|
407
|
+
style: {
|
|
408
|
+
type: [
|
|
409
|
+
String,
|
|
410
|
+
Array,
|
|
411
|
+
Object,
|
|
412
|
+
Boolean,
|
|
413
|
+
null
|
|
414
|
+
],
|
|
415
|
+
required: false,
|
|
416
|
+
skipCheck: true
|
|
417
|
+
},
|
|
418
|
+
color: {
|
|
419
|
+
type: [
|
|
420
|
+
String,
|
|
421
|
+
Object,
|
|
422
|
+
Boolean,
|
|
423
|
+
null
|
|
424
|
+
],
|
|
425
|
+
required: false,
|
|
426
|
+
skipCheck: true
|
|
427
|
+
},
|
|
428
|
+
bgColor: {
|
|
429
|
+
type: [
|
|
430
|
+
String,
|
|
431
|
+
Object,
|
|
432
|
+
Boolean,
|
|
433
|
+
null
|
|
434
|
+
],
|
|
435
|
+
required: false,
|
|
436
|
+
skipCheck: true
|
|
437
|
+
},
|
|
438
|
+
autofocus: {
|
|
439
|
+
type: Boolean,
|
|
440
|
+
required: false
|
|
441
|
+
},
|
|
442
|
+
counter: {
|
|
443
|
+
type: [
|
|
444
|
+
Boolean,
|
|
445
|
+
Number,
|
|
446
|
+
String
|
|
447
|
+
],
|
|
448
|
+
required: false
|
|
449
|
+
},
|
|
450
|
+
counterValue: {
|
|
451
|
+
type: [Number, Function],
|
|
452
|
+
required: false
|
|
453
|
+
},
|
|
454
|
+
placeholder: {
|
|
455
|
+
type: String,
|
|
456
|
+
required: false
|
|
457
|
+
},
|
|
458
|
+
persistentPlaceholder: {
|
|
459
|
+
type: Boolean,
|
|
460
|
+
required: false
|
|
461
|
+
},
|
|
462
|
+
persistentCounter: {
|
|
463
|
+
type: Boolean,
|
|
464
|
+
required: false
|
|
465
|
+
},
|
|
466
|
+
role: {
|
|
467
|
+
type: String,
|
|
468
|
+
required: false,
|
|
469
|
+
default: "combobox"
|
|
470
|
+
},
|
|
471
|
+
type: {
|
|
472
|
+
type: null,
|
|
473
|
+
required: false,
|
|
474
|
+
default: TEXT_FIELD_TYPE.TEXT
|
|
475
|
+
},
|
|
476
|
+
modelModifiers: {
|
|
477
|
+
type: [String, Boolean],
|
|
478
|
+
required: false
|
|
479
|
+
},
|
|
480
|
+
mask: {
|
|
481
|
+
type: null,
|
|
482
|
+
required: false
|
|
483
|
+
},
|
|
484
|
+
density: {
|
|
485
|
+
type: null,
|
|
486
|
+
required: false,
|
|
487
|
+
default: DENSITY.DEFAULT
|
|
488
|
+
},
|
|
489
|
+
centerAffix: {
|
|
490
|
+
type: Boolean,
|
|
491
|
+
required: false,
|
|
492
|
+
default: true
|
|
493
|
+
},
|
|
494
|
+
dirty: {
|
|
495
|
+
type: Boolean,
|
|
496
|
+
required: false
|
|
497
|
+
},
|
|
498
|
+
disabled: {
|
|
499
|
+
type: Boolean,
|
|
500
|
+
required: false
|
|
501
|
+
},
|
|
502
|
+
error: {
|
|
503
|
+
type: [String, Boolean],
|
|
504
|
+
required: false
|
|
505
|
+
},
|
|
506
|
+
inline: {
|
|
507
|
+
type: Boolean,
|
|
508
|
+
required: false
|
|
509
|
+
},
|
|
510
|
+
label: {
|
|
511
|
+
type: String,
|
|
512
|
+
required: false
|
|
513
|
+
},
|
|
514
|
+
prefix: {
|
|
515
|
+
type: String,
|
|
516
|
+
required: false
|
|
517
|
+
},
|
|
518
|
+
suffix: {
|
|
519
|
+
type: String,
|
|
520
|
+
required: false
|
|
521
|
+
},
|
|
522
|
+
persistentClear: {
|
|
523
|
+
type: Boolean,
|
|
524
|
+
required: false
|
|
525
|
+
},
|
|
526
|
+
singleLine: {
|
|
527
|
+
type: Boolean,
|
|
528
|
+
required: false
|
|
529
|
+
},
|
|
530
|
+
required: {
|
|
531
|
+
type: Boolean,
|
|
532
|
+
required: false
|
|
533
|
+
},
|
|
534
|
+
loading: {
|
|
535
|
+
type: [
|
|
536
|
+
Boolean,
|
|
537
|
+
Number,
|
|
538
|
+
Object
|
|
539
|
+
],
|
|
540
|
+
required: false
|
|
541
|
+
},
|
|
542
|
+
loadingText: {
|
|
543
|
+
type: String,
|
|
544
|
+
required: false
|
|
545
|
+
},
|
|
546
|
+
tag: {
|
|
547
|
+
type: String,
|
|
548
|
+
required: false
|
|
549
|
+
},
|
|
550
|
+
appendInnerAvatar: {
|
|
551
|
+
type: String,
|
|
552
|
+
required: false
|
|
553
|
+
},
|
|
554
|
+
appendInnerIcon: {
|
|
555
|
+
type: null,
|
|
556
|
+
required: false
|
|
557
|
+
},
|
|
558
|
+
prependInnerAvatar: {
|
|
559
|
+
type: String,
|
|
560
|
+
required: false
|
|
561
|
+
},
|
|
562
|
+
prependInnerIcon: {
|
|
563
|
+
type: null,
|
|
564
|
+
required: false
|
|
565
|
+
},
|
|
566
|
+
clearIcon: {
|
|
567
|
+
type: null,
|
|
568
|
+
required: false
|
|
569
|
+
},
|
|
570
|
+
clearable: {
|
|
571
|
+
type: Boolean,
|
|
572
|
+
required: false
|
|
573
|
+
},
|
|
574
|
+
prependInnerAriaLabel: {
|
|
575
|
+
type: String,
|
|
576
|
+
required: false
|
|
577
|
+
},
|
|
578
|
+
appendInnerAriaLabel: {
|
|
579
|
+
type: String,
|
|
580
|
+
required: false
|
|
581
|
+
},
|
|
582
|
+
border: {
|
|
583
|
+
type: [
|
|
584
|
+
Boolean,
|
|
585
|
+
Number,
|
|
586
|
+
String,
|
|
587
|
+
Array
|
|
588
|
+
],
|
|
589
|
+
required: false,
|
|
590
|
+
skipCheck: true,
|
|
591
|
+
default: true
|
|
592
|
+
},
|
|
593
|
+
borderTop: {
|
|
594
|
+
type: [
|
|
595
|
+
Boolean,
|
|
596
|
+
Number,
|
|
597
|
+
String
|
|
598
|
+
],
|
|
599
|
+
required: false
|
|
600
|
+
},
|
|
601
|
+
borderLeft: {
|
|
602
|
+
type: [
|
|
603
|
+
Boolean,
|
|
604
|
+
Number,
|
|
605
|
+
String
|
|
606
|
+
],
|
|
607
|
+
required: false
|
|
608
|
+
},
|
|
609
|
+
borderBottom: {
|
|
610
|
+
type: [
|
|
611
|
+
Boolean,
|
|
612
|
+
Number,
|
|
613
|
+
String
|
|
614
|
+
],
|
|
615
|
+
required: false
|
|
616
|
+
},
|
|
617
|
+
borderRight: {
|
|
618
|
+
type: [
|
|
619
|
+
Boolean,
|
|
620
|
+
Number,
|
|
621
|
+
String
|
|
622
|
+
],
|
|
623
|
+
required: false
|
|
624
|
+
},
|
|
625
|
+
borderBlock: {
|
|
626
|
+
type: [
|
|
627
|
+
Boolean,
|
|
628
|
+
Number,
|
|
629
|
+
String
|
|
630
|
+
],
|
|
631
|
+
required: false
|
|
632
|
+
},
|
|
633
|
+
borderInline: {
|
|
634
|
+
type: [
|
|
635
|
+
Boolean,
|
|
636
|
+
Number,
|
|
637
|
+
String
|
|
638
|
+
],
|
|
639
|
+
required: false
|
|
640
|
+
},
|
|
641
|
+
borderInlineStart: {
|
|
642
|
+
type: [
|
|
643
|
+
Boolean,
|
|
644
|
+
Number,
|
|
645
|
+
String
|
|
646
|
+
],
|
|
647
|
+
required: false
|
|
648
|
+
},
|
|
649
|
+
borderInlineEnd: {
|
|
650
|
+
type: [
|
|
651
|
+
Boolean,
|
|
652
|
+
Number,
|
|
653
|
+
String
|
|
654
|
+
],
|
|
655
|
+
required: false
|
|
656
|
+
},
|
|
657
|
+
borderBlockStart: {
|
|
658
|
+
type: [
|
|
659
|
+
Boolean,
|
|
660
|
+
Number,
|
|
661
|
+
String
|
|
662
|
+
],
|
|
663
|
+
required: false
|
|
664
|
+
},
|
|
665
|
+
borderBlockEnd: {
|
|
666
|
+
type: [
|
|
667
|
+
Boolean,
|
|
668
|
+
Number,
|
|
669
|
+
String
|
|
670
|
+
],
|
|
671
|
+
required: false
|
|
672
|
+
},
|
|
673
|
+
borderColor: {
|
|
674
|
+
type: String,
|
|
675
|
+
required: false
|
|
676
|
+
},
|
|
677
|
+
borderStyle: {
|
|
678
|
+
type: String,
|
|
679
|
+
required: false
|
|
680
|
+
},
|
|
681
|
+
borderTopColor: {
|
|
682
|
+
type: [
|
|
683
|
+
String,
|
|
684
|
+
Object,
|
|
685
|
+
Boolean,
|
|
686
|
+
null
|
|
687
|
+
],
|
|
688
|
+
required: false,
|
|
689
|
+
skipCheck: true
|
|
690
|
+
},
|
|
691
|
+
borderRightColor: {
|
|
692
|
+
type: [
|
|
693
|
+
String,
|
|
694
|
+
Object,
|
|
695
|
+
Boolean,
|
|
696
|
+
null
|
|
697
|
+
],
|
|
698
|
+
required: false,
|
|
699
|
+
skipCheck: true
|
|
700
|
+
},
|
|
701
|
+
borderBottomColor: {
|
|
702
|
+
type: [
|
|
703
|
+
String,
|
|
704
|
+
Object,
|
|
705
|
+
Boolean,
|
|
706
|
+
null
|
|
707
|
+
],
|
|
708
|
+
required: false,
|
|
709
|
+
skipCheck: true
|
|
710
|
+
},
|
|
711
|
+
borderLeftColor: {
|
|
712
|
+
type: [
|
|
713
|
+
String,
|
|
714
|
+
Object,
|
|
715
|
+
Boolean,
|
|
716
|
+
null
|
|
717
|
+
],
|
|
718
|
+
required: false,
|
|
719
|
+
skipCheck: true
|
|
720
|
+
},
|
|
721
|
+
borderInlineStartColor: {
|
|
722
|
+
type: [
|
|
723
|
+
String,
|
|
724
|
+
Object,
|
|
725
|
+
Boolean,
|
|
726
|
+
null
|
|
727
|
+
],
|
|
728
|
+
required: false,
|
|
729
|
+
skipCheck: true
|
|
730
|
+
},
|
|
731
|
+
borderInlineEndColor: {
|
|
732
|
+
type: [
|
|
733
|
+
String,
|
|
734
|
+
Object,
|
|
735
|
+
Boolean,
|
|
736
|
+
null
|
|
737
|
+
],
|
|
738
|
+
required: false,
|
|
739
|
+
skipCheck: true
|
|
740
|
+
},
|
|
741
|
+
borderBlockStartColor: {
|
|
742
|
+
type: [
|
|
743
|
+
String,
|
|
744
|
+
Object,
|
|
745
|
+
Boolean,
|
|
746
|
+
null
|
|
747
|
+
],
|
|
748
|
+
required: false,
|
|
749
|
+
skipCheck: true
|
|
750
|
+
},
|
|
751
|
+
borderBlockEndColor: {
|
|
752
|
+
type: [
|
|
753
|
+
String,
|
|
754
|
+
Object,
|
|
755
|
+
Boolean,
|
|
756
|
+
null
|
|
757
|
+
],
|
|
758
|
+
required: false,
|
|
759
|
+
skipCheck: true
|
|
760
|
+
},
|
|
761
|
+
focused: {
|
|
762
|
+
type: Boolean,
|
|
763
|
+
required: false
|
|
764
|
+
},
|
|
765
|
+
text: {
|
|
766
|
+
type: String,
|
|
767
|
+
required: false
|
|
768
|
+
},
|
|
769
|
+
floating: {
|
|
770
|
+
type: Boolean,
|
|
771
|
+
required: false
|
|
772
|
+
},
|
|
773
|
+
name: {
|
|
774
|
+
type: String,
|
|
775
|
+
required: false
|
|
776
|
+
},
|
|
777
|
+
margin: {
|
|
778
|
+
type: [
|
|
779
|
+
Boolean,
|
|
780
|
+
Number,
|
|
781
|
+
String
|
|
782
|
+
],
|
|
783
|
+
required: false
|
|
784
|
+
},
|
|
785
|
+
marginTop: {
|
|
786
|
+
type: [
|
|
787
|
+
Boolean,
|
|
788
|
+
Number,
|
|
789
|
+
String
|
|
790
|
+
],
|
|
791
|
+
required: false
|
|
792
|
+
},
|
|
793
|
+
marginLeft: {
|
|
794
|
+
type: [
|
|
795
|
+
Boolean,
|
|
796
|
+
Number,
|
|
797
|
+
String
|
|
798
|
+
],
|
|
799
|
+
required: false
|
|
800
|
+
},
|
|
801
|
+
marginBottom: {
|
|
802
|
+
type: [
|
|
803
|
+
Boolean,
|
|
804
|
+
Number,
|
|
805
|
+
String
|
|
806
|
+
],
|
|
807
|
+
required: false
|
|
808
|
+
},
|
|
809
|
+
marginRight: {
|
|
810
|
+
type: [
|
|
811
|
+
Boolean,
|
|
812
|
+
Number,
|
|
813
|
+
String
|
|
814
|
+
],
|
|
815
|
+
required: false
|
|
816
|
+
},
|
|
817
|
+
marginBlock: {
|
|
818
|
+
type: [
|
|
819
|
+
Boolean,
|
|
820
|
+
Number,
|
|
821
|
+
String
|
|
822
|
+
],
|
|
823
|
+
required: false
|
|
824
|
+
},
|
|
825
|
+
marginInline: {
|
|
826
|
+
type: [
|
|
827
|
+
Boolean,
|
|
828
|
+
Number,
|
|
829
|
+
String
|
|
830
|
+
],
|
|
831
|
+
required: false
|
|
832
|
+
},
|
|
833
|
+
marginInlineStart: {
|
|
834
|
+
type: [
|
|
835
|
+
Boolean,
|
|
836
|
+
Number,
|
|
837
|
+
String
|
|
838
|
+
],
|
|
839
|
+
required: false
|
|
840
|
+
},
|
|
841
|
+
marginInlineEnd: {
|
|
842
|
+
type: [
|
|
843
|
+
Boolean,
|
|
844
|
+
Number,
|
|
845
|
+
String
|
|
846
|
+
],
|
|
847
|
+
required: false
|
|
848
|
+
},
|
|
849
|
+
marginBlockStart: {
|
|
850
|
+
type: [
|
|
851
|
+
Boolean,
|
|
852
|
+
Number,
|
|
853
|
+
String
|
|
854
|
+
],
|
|
855
|
+
required: false
|
|
856
|
+
},
|
|
857
|
+
marginBlockEnd: {
|
|
858
|
+
type: [
|
|
859
|
+
Boolean,
|
|
860
|
+
Number,
|
|
861
|
+
String
|
|
862
|
+
],
|
|
863
|
+
required: false
|
|
864
|
+
},
|
|
865
|
+
padding: {
|
|
866
|
+
type: [
|
|
867
|
+
Boolean,
|
|
868
|
+
Number,
|
|
869
|
+
String
|
|
870
|
+
],
|
|
871
|
+
required: false
|
|
872
|
+
},
|
|
873
|
+
paddingTop: {
|
|
874
|
+
type: [
|
|
875
|
+
Boolean,
|
|
876
|
+
Number,
|
|
877
|
+
String
|
|
878
|
+
],
|
|
879
|
+
required: false
|
|
880
|
+
},
|
|
881
|
+
paddingLeft: {
|
|
882
|
+
type: [
|
|
883
|
+
Boolean,
|
|
884
|
+
Number,
|
|
885
|
+
String
|
|
886
|
+
],
|
|
887
|
+
required: false
|
|
888
|
+
},
|
|
889
|
+
paddingBottom: {
|
|
890
|
+
type: [
|
|
891
|
+
Boolean,
|
|
892
|
+
Number,
|
|
893
|
+
String
|
|
894
|
+
],
|
|
895
|
+
required: false
|
|
896
|
+
},
|
|
897
|
+
paddingRight: {
|
|
898
|
+
type: [
|
|
899
|
+
Boolean,
|
|
900
|
+
Number,
|
|
901
|
+
String
|
|
902
|
+
],
|
|
903
|
+
required: false
|
|
904
|
+
},
|
|
905
|
+
paddingBlock: {
|
|
906
|
+
type: [
|
|
907
|
+
Boolean,
|
|
908
|
+
Number,
|
|
909
|
+
String
|
|
910
|
+
],
|
|
911
|
+
required: false
|
|
912
|
+
},
|
|
913
|
+
paddingInline: {
|
|
914
|
+
type: [
|
|
915
|
+
Boolean,
|
|
916
|
+
Number,
|
|
917
|
+
String
|
|
918
|
+
],
|
|
919
|
+
required: false
|
|
920
|
+
},
|
|
921
|
+
paddingInlineStart: {
|
|
922
|
+
type: [
|
|
923
|
+
Boolean,
|
|
924
|
+
Number,
|
|
925
|
+
String
|
|
926
|
+
],
|
|
927
|
+
required: false
|
|
928
|
+
},
|
|
929
|
+
paddingInlineEnd: {
|
|
930
|
+
type: [
|
|
931
|
+
Boolean,
|
|
932
|
+
Number,
|
|
933
|
+
String
|
|
934
|
+
],
|
|
935
|
+
required: false
|
|
936
|
+
},
|
|
937
|
+
paddingBlockStart: {
|
|
938
|
+
type: [
|
|
939
|
+
Boolean,
|
|
940
|
+
Number,
|
|
941
|
+
String
|
|
942
|
+
],
|
|
943
|
+
required: false
|
|
944
|
+
},
|
|
945
|
+
paddingBlockEnd: {
|
|
946
|
+
type: [
|
|
947
|
+
Boolean,
|
|
948
|
+
Number,
|
|
949
|
+
String
|
|
950
|
+
],
|
|
951
|
+
required: false
|
|
952
|
+
},
|
|
953
|
+
rounded: {
|
|
954
|
+
type: [
|
|
955
|
+
Boolean,
|
|
956
|
+
Number,
|
|
957
|
+
String,
|
|
958
|
+
null
|
|
959
|
+
],
|
|
960
|
+
required: false,
|
|
961
|
+
skipCheck: true,
|
|
962
|
+
default: true
|
|
963
|
+
},
|
|
964
|
+
roundedTopRight: {
|
|
965
|
+
type: [
|
|
966
|
+
Boolean,
|
|
967
|
+
Number,
|
|
968
|
+
String
|
|
969
|
+
],
|
|
970
|
+
required: false
|
|
971
|
+
},
|
|
972
|
+
roundedTopLeft: {
|
|
973
|
+
type: [
|
|
974
|
+
Boolean,
|
|
975
|
+
Number,
|
|
976
|
+
String
|
|
977
|
+
],
|
|
978
|
+
required: false
|
|
979
|
+
},
|
|
980
|
+
roundedBottomLeft: {
|
|
981
|
+
type: [
|
|
982
|
+
Boolean,
|
|
983
|
+
Number,
|
|
984
|
+
String
|
|
985
|
+
],
|
|
986
|
+
required: false
|
|
987
|
+
},
|
|
988
|
+
roundedBottomRight: {
|
|
989
|
+
type: [
|
|
990
|
+
Boolean,
|
|
991
|
+
Number,
|
|
992
|
+
String
|
|
993
|
+
],
|
|
994
|
+
required: false
|
|
995
|
+
},
|
|
996
|
+
roundedStartStart: {
|
|
997
|
+
type: [
|
|
998
|
+
Boolean,
|
|
999
|
+
Number,
|
|
1000
|
+
String
|
|
1001
|
+
],
|
|
1002
|
+
required: false
|
|
1003
|
+
},
|
|
1004
|
+
roundedStartEnd: {
|
|
1005
|
+
type: [
|
|
1006
|
+
Boolean,
|
|
1007
|
+
Number,
|
|
1008
|
+
String
|
|
1009
|
+
],
|
|
1010
|
+
required: false
|
|
1011
|
+
},
|
|
1012
|
+
roundedEndStart: {
|
|
1013
|
+
type: [
|
|
1014
|
+
Boolean,
|
|
1015
|
+
Number,
|
|
1016
|
+
String
|
|
1017
|
+
],
|
|
1018
|
+
required: false
|
|
1019
|
+
},
|
|
1020
|
+
roundedEndEnd: {
|
|
1021
|
+
type: [
|
|
1022
|
+
Boolean,
|
|
1023
|
+
Number,
|
|
1024
|
+
String
|
|
1025
|
+
],
|
|
1026
|
+
required: false
|
|
1027
|
+
},
|
|
1028
|
+
fontSize: {
|
|
1029
|
+
type: null,
|
|
1030
|
+
required: false
|
|
1031
|
+
},
|
|
1032
|
+
fontWeight: {
|
|
1033
|
+
type: null,
|
|
1034
|
+
required: false
|
|
1035
|
+
},
|
|
1036
|
+
lineHeight: {
|
|
1037
|
+
type: null,
|
|
1038
|
+
required: false
|
|
1039
|
+
},
|
|
1040
|
+
letterSpacing: {
|
|
1041
|
+
type: null,
|
|
1042
|
+
required: false
|
|
1043
|
+
},
|
|
1044
|
+
active: {
|
|
1045
|
+
type: [Boolean, Object],
|
|
1046
|
+
required: false
|
|
1047
|
+
},
|
|
1048
|
+
activeClass: {
|
|
1049
|
+
type: String,
|
|
1050
|
+
required: false
|
|
1051
|
+
},
|
|
1052
|
+
variant: {
|
|
1053
|
+
type: null,
|
|
1054
|
+
required: false
|
|
1055
|
+
},
|
|
1056
|
+
elevation: {
|
|
1057
|
+
type: [Number, String],
|
|
1058
|
+
required: false
|
|
1059
|
+
},
|
|
1060
|
+
size: {
|
|
1061
|
+
type: null,
|
|
1062
|
+
required: false
|
|
1063
|
+
},
|
|
1064
|
+
hideDetails: {
|
|
1065
|
+
type: [Boolean, String],
|
|
1066
|
+
required: false
|
|
1067
|
+
},
|
|
1068
|
+
hideSpinButtons: {
|
|
1069
|
+
type: Boolean,
|
|
1070
|
+
required: false
|
|
1071
|
+
},
|
|
1072
|
+
hint: {
|
|
1073
|
+
type: String,
|
|
1074
|
+
required: false
|
|
1075
|
+
},
|
|
1076
|
+
persistentHint: {
|
|
1077
|
+
type: Boolean,
|
|
1078
|
+
required: false
|
|
1079
|
+
},
|
|
1080
|
+
messages: {
|
|
1081
|
+
type: [Array, String],
|
|
1082
|
+
required: false
|
|
1083
|
+
},
|
|
1084
|
+
height: {
|
|
1085
|
+
type: [Number, String],
|
|
1086
|
+
required: false
|
|
1087
|
+
},
|
|
1088
|
+
maxHeight: {
|
|
1089
|
+
type: [Number, String],
|
|
1090
|
+
required: false
|
|
1091
|
+
},
|
|
1092
|
+
maxWidth: {
|
|
1093
|
+
type: [Number, String],
|
|
1094
|
+
required: false
|
|
1095
|
+
},
|
|
1096
|
+
minHeight: {
|
|
1097
|
+
type: [Number, String],
|
|
1098
|
+
required: false
|
|
1099
|
+
},
|
|
1100
|
+
minWidth: {
|
|
1101
|
+
type: [Number, String],
|
|
1102
|
+
required: false
|
|
1103
|
+
},
|
|
1104
|
+
width: {
|
|
1105
|
+
type: [Number, String],
|
|
1106
|
+
required: false
|
|
1107
|
+
},
|
|
1108
|
+
direction: {
|
|
1109
|
+
type: null,
|
|
1110
|
+
required: false,
|
|
1111
|
+
default: DIRECTION.HORIZONTAL
|
|
1112
|
+
},
|
|
1113
|
+
errorMessages: {
|
|
1114
|
+
type: [Array, String],
|
|
1115
|
+
required: false
|
|
1116
|
+
},
|
|
1117
|
+
maxErrors: {
|
|
1118
|
+
type: [Number, String],
|
|
1119
|
+
required: false
|
|
1120
|
+
},
|
|
1121
|
+
readonly: {
|
|
1122
|
+
type: Boolean,
|
|
1123
|
+
required: false
|
|
1124
|
+
},
|
|
1125
|
+
rules: {
|
|
1126
|
+
type: Array,
|
|
1127
|
+
required: false
|
|
1128
|
+
},
|
|
1129
|
+
modelValue: {
|
|
1130
|
+
type: null,
|
|
1131
|
+
required: false,
|
|
1132
|
+
default: null
|
|
1133
|
+
},
|
|
1134
|
+
validateOn: {
|
|
1135
|
+
type: null,
|
|
1136
|
+
required: false
|
|
1137
|
+
},
|
|
1138
|
+
validationValue: {
|
|
1139
|
+
type: null,
|
|
1140
|
+
required: false
|
|
1141
|
+
},
|
|
1142
|
+
appendAvatar: {
|
|
1143
|
+
type: String,
|
|
1144
|
+
required: false
|
|
1145
|
+
},
|
|
1146
|
+
appendIcon: {
|
|
1147
|
+
type: null,
|
|
1148
|
+
required: false
|
|
1149
|
+
},
|
|
1150
|
+
prependAvatar: {
|
|
1151
|
+
type: String,
|
|
1152
|
+
required: false
|
|
1153
|
+
},
|
|
1154
|
+
prependIcon: {
|
|
1155
|
+
type: null,
|
|
1156
|
+
required: false
|
|
1157
|
+
},
|
|
1158
|
+
prependAriaLabel: {
|
|
1159
|
+
type: String,
|
|
1160
|
+
required: false
|
|
1161
|
+
},
|
|
1162
|
+
appendAriaLabel: {
|
|
1163
|
+
type: String,
|
|
1164
|
+
required: false
|
|
1165
|
+
},
|
|
1166
|
+
items: {
|
|
1167
|
+
type: Array,
|
|
1168
|
+
required: false,
|
|
1169
|
+
default: () => []
|
|
1170
|
+
},
|
|
1171
|
+
itemTitle: {
|
|
1172
|
+
type: null,
|
|
1173
|
+
required: false,
|
|
1174
|
+
default: "title"
|
|
1175
|
+
},
|
|
1176
|
+
itemValue: {
|
|
1177
|
+
type: null,
|
|
1178
|
+
required: false,
|
|
1179
|
+
default: "value"
|
|
1180
|
+
},
|
|
1181
|
+
itemChildren: {
|
|
1182
|
+
type: null,
|
|
1183
|
+
required: false,
|
|
1184
|
+
default: "children"
|
|
1185
|
+
},
|
|
1186
|
+
itemProps: {
|
|
1187
|
+
type: null,
|
|
1188
|
+
required: false,
|
|
1189
|
+
default: "props"
|
|
1190
|
+
},
|
|
1191
|
+
returnObject: {
|
|
1192
|
+
type: Boolean,
|
|
1193
|
+
required: false
|
|
1194
|
+
},
|
|
1195
|
+
valueComparator: {
|
|
1196
|
+
type: null,
|
|
1197
|
+
required: false,
|
|
1198
|
+
default: deepEqual
|
|
1199
|
+
},
|
|
1200
|
+
transition: {
|
|
1201
|
+
type: [
|
|
1202
|
+
Boolean,
|
|
1203
|
+
String,
|
|
1204
|
+
Object
|
|
1205
|
+
],
|
|
1206
|
+
required: false,
|
|
1207
|
+
default: () => ({ component: OrigamTranslateScale })
|
|
1208
|
+
},
|
|
1209
|
+
customFilter: {
|
|
1210
|
+
type: Function,
|
|
1211
|
+
required: false
|
|
1212
|
+
},
|
|
1213
|
+
customKeyFilter: {
|
|
1214
|
+
type: Object,
|
|
1215
|
+
required: false
|
|
1216
|
+
},
|
|
1217
|
+
filterKeys: {
|
|
1218
|
+
type: [String, Array],
|
|
1219
|
+
required: false,
|
|
1220
|
+
default: () => ["title"]
|
|
1221
|
+
},
|
|
1222
|
+
filterMode: {
|
|
1223
|
+
type: null,
|
|
1224
|
+
required: false,
|
|
1225
|
+
default: FILTERS_MODE.INTERSECTION
|
|
1226
|
+
},
|
|
1227
|
+
noFilter: {
|
|
1228
|
+
type: Boolean,
|
|
1229
|
+
required: false
|
|
1230
|
+
},
|
|
1231
|
+
eager: {
|
|
1232
|
+
type: Boolean,
|
|
1233
|
+
required: false
|
|
1234
|
+
}
|
|
484
1235
|
});
|
|
485
|
-
const emit = defineEmits([
|
|
1236
|
+
const emit = defineEmits([
|
|
1237
|
+
"click:control",
|
|
1238
|
+
"mousedown:control",
|
|
1239
|
+
"update:menu",
|
|
1240
|
+
"update:modelValue",
|
|
1241
|
+
"update:focused",
|
|
1242
|
+
"click:append",
|
|
1243
|
+
"click:prepend",
|
|
1244
|
+
"click:appendInner",
|
|
1245
|
+
"click:prependInner",
|
|
1246
|
+
"click:clear"
|
|
1247
|
+
]);
|
|
486
1248
|
defineSlots();
|
|
487
1249
|
const { filterProps } = useProps(props);
|
|
1250
|
+
/*********************************************************
|
|
1251
|
+
* DOM refs
|
|
1252
|
+
*
|
|
1253
|
+
* @description
|
|
1254
|
+
* Refs to sub-components for forward-prop delegation.
|
|
1255
|
+
* `vm` is the component instance — used as a fallback path
|
|
1256
|
+
* to reach the underlying `<input>` when the forwardRefs-
|
|
1257
|
+
* based proxy on `origamTextFieldRef` doesn't expose `$el`
|
|
1258
|
+
* (filtered because of its `$` prefix).
|
|
1259
|
+
********************************************************/
|
|
488
1260
|
const { t } = useLocale();
|
|
489
1261
|
const origamTextFieldRef = ref();
|
|
490
1262
|
const origamMenuRef = ref();
|
|
491
1263
|
const origamVirtualScrollRef = ref();
|
|
492
1264
|
const origamListRef = ref();
|
|
493
1265
|
const origamChipsRef = ref();
|
|
1266
|
+
// Component instance — used as a fallback path to reach the
|
|
1267
|
+
// underlying `<input>` (`vm.proxy.$el.querySelector('input')`) when
|
|
1268
|
+
// the `forwardRefs`-based proxy on `origamTextFieldRef` doesn't
|
|
1269
|
+
// expose certain props/methods (notably `$el`, which the proxy filters
|
|
1270
|
+
// because of its `$` prefix).
|
|
494
1271
|
const vm = getCurrentInstance();
|
|
1272
|
+
/*********************************************************
|
|
1273
|
+
* WAI-ARIA combobox IDs
|
|
1274
|
+
*
|
|
1275
|
+
* @description
|
|
1276
|
+
* Stable IDs for the listbox + per-option elements.
|
|
1277
|
+
* `listboxId` is applied to the OrigamList root; each option
|
|
1278
|
+
* gets `optionId(index)` so `aria-activedescendant` on the
|
|
1279
|
+
* combobox input can point to the keyboard-highlighted row
|
|
1280
|
+
* without moving DOM focus off the input.
|
|
1281
|
+
********************************************************/
|
|
495
1282
|
const _uid = getUid();
|
|
496
1283
|
const listboxId = `origam-select-listbox-${_uid}`;
|
|
497
1284
|
const optionId = (index) => `${listboxId}-opt-${index}`;
|
|
1285
|
+
// Index of the currently keyboard-highlighted option.
|
|
1286
|
+
// -1 = no highlight (listbox closed or nothing highlighted).
|
|
498
1287
|
const highlightIndex = shallowRef(-1);
|
|
1288
|
+
/*********************************************************
|
|
1289
|
+
* Value & model
|
|
1290
|
+
*
|
|
1291
|
+
* @description
|
|
1292
|
+
* Locale, slots, color, items, model and search bindings.
|
|
1293
|
+
********************************************************/
|
|
499
1294
|
const slots = useSlots();
|
|
1295
|
+
// Phase 3 (Vague B) — class-first companion alongside inline styles.
|
|
1296
|
+
// When `color` resolves to a tokenisable intent, `textColorClasses`
|
|
1297
|
+
// hits `.origam--color-{intent}` on the selection chip; `textColorStyles`
|
|
1298
|
+
// stays in parallel to cover legacy raw colors and to keep zero-regression
|
|
1299
|
+
// during the transition (strategy "a").
|
|
1300
|
+
/*********************************************************
|
|
1301
|
+
* Color
|
|
1302
|
+
********************************************************/
|
|
500
1303
|
const { textColorClasses, textColorStyles } = useTextColor(toRef(props, "color"));
|
|
1304
|
+
/*********************************************************
|
|
1305
|
+
* Composables
|
|
1306
|
+
********************************************************/
|
|
501
1307
|
const { items, transformIn, transformOut } = useItems(props);
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
return props.multiple ? transformed : transformed[0] ?? null;
|
|
512
|
-
}
|
|
513
|
-
);
|
|
1308
|
+
/*********************************************************
|
|
1309
|
+
* Value
|
|
1310
|
+
********************************************************/
|
|
1311
|
+
const model = useVModel(props, "modelValue", [], (v) => {
|
|
1312
|
+
return transformIn(v === null ? [null] : wrapInArray(v));
|
|
1313
|
+
}, (v) => {
|
|
1314
|
+
const transformed = transformOut(v);
|
|
1315
|
+
return props.multiple ? transformed : transformed[0] ?? null;
|
|
1316
|
+
});
|
|
514
1317
|
const search = useVModel(props, "search", "");
|
|
1318
|
+
/*********************************************************
|
|
1319
|
+
* effectiveValidationValue (#693)
|
|
1320
|
+
*
|
|
1321
|
+
* @description
|
|
1322
|
+
* This was previously named `validationValue`, a bare `const` that
|
|
1323
|
+
* SHADOWED the `validationValue` PROP (`ISelectProps` -> `IInputProps`
|
|
1324
|
+
* -> `IValidationProps.validationValue`, `validation.interface.ts:47`)
|
|
1325
|
+
* inside this `<script lang="ts" setup>` block. The template's
|
|
1326
|
+
* `:validation-value="validationValue"` therefore always resolved to
|
|
1327
|
+
* this model-derived local, never to the consumer's prop — and since
|
|
1328
|
+
* `validationValue` is also stripped from the `filterProps` passthrough
|
|
1329
|
+
* below, there was no second path either: a
|
|
1330
|
+
* `<origam-select :validation-value="somethingElse" />` silently
|
|
1331
|
+
* validated against the model. Same defect family as #622 / #665 /
|
|
1332
|
+
* #666.
|
|
1333
|
+
*
|
|
1334
|
+
* @description
|
|
1335
|
+
* The fallback ladder mirrors `useValidation` exactly
|
|
1336
|
+
* (`validation.composable.ts:52`): `undefined` means "not supplied" and
|
|
1337
|
+
* falls back to the model, ANY other value — `null` included — wins.
|
|
1338
|
+
********************************************************/
|
|
515
1339
|
const effectiveValidationValue = computed(() => {
|
|
516
|
-
|
|
1340
|
+
return props.validationValue === undefined ? model.externalValue : props.validationValue;
|
|
517
1341
|
});
|
|
518
1342
|
const menuState = useVModel(props, "menu");
|
|
519
1343
|
const menu = computed({
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
1344
|
+
get: () => menuState.value,
|
|
1345
|
+
set: (v) => {
|
|
1346
|
+
if (menuState.value && !v && origamMenuRef.value?.openChildren) {
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
menuState.value = v;
|
|
1350
|
+
}
|
|
527
1351
|
});
|
|
528
1352
|
const counterValue = computed(() => {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
1353
|
+
if (typeof props.counterValue === "function") {
|
|
1354
|
+
return props.counterValue(model.value);
|
|
1355
|
+
}
|
|
1356
|
+
if (props.counterValue) {
|
|
1357
|
+
return props.counterValue;
|
|
1358
|
+
}
|
|
1359
|
+
return model.value.length;
|
|
536
1360
|
});
|
|
537
1361
|
const selectedValues = computed(() => {
|
|
538
|
-
|
|
1362
|
+
return model.value.map((selection) => selection.value);
|
|
539
1363
|
});
|
|
540
1364
|
const highlightFirst = computed(() => {
|
|
541
|
-
|
|
542
|
-
|
|
1365
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === "exact" && search.value === displayItems.value[0]?.title;
|
|
1366
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
543
1367
|
});
|
|
544
1368
|
const showCheckbox = computed(() => {
|
|
545
|
-
|
|
1369
|
+
return props.multiple && !props.hideSelected;
|
|
546
1370
|
});
|
|
547
1371
|
const hasNoData = computed(() => {
|
|
548
|
-
|
|
1372
|
+
return !displayItems.value.length && (!props.hideNoData || slots.noData);
|
|
549
1373
|
});
|
|
550
1374
|
const isFocused = shallowRef(false);
|
|
551
1375
|
const form = inject(ORIGAM_FORM_KEY, null);
|
|
@@ -557,455 +1381,703 @@ const listHasFocus = shallowRef(false);
|
|
|
557
1381
|
const selectionIndex = shallowRef(-1);
|
|
558
1382
|
const isSelecting = shallowRef(false);
|
|
559
1383
|
const displayItems = computed(() => {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
1384
|
+
if (props.hideSelected) {
|
|
1385
|
+
return filteredItems.value.filter((filteredItem) => !model.value.some((s) => s.value === filteredItem.value));
|
|
1386
|
+
}
|
|
1387
|
+
return filteredItems.value;
|
|
564
1388
|
});
|
|
565
1389
|
const menuDisabled = computed(() => {
|
|
566
|
-
|
|
1390
|
+
return props.hideNoData && !displayItems.value.length || props.readonly || form?.isReadonly.value;
|
|
567
1391
|
});
|
|
1392
|
+
// Typography bridge across the teleport — see `useTeleportTypography` for
|
|
1393
|
+
// the full rationale (the menu is teleported out of the select's DOM
|
|
1394
|
+
// subtree, so a consumer's CSS never reaches it, and `rem`-sized option
|
|
1395
|
+
// text would stay pinned to the document root even if it did).
|
|
568
1396
|
const { typographyStyles: menuTypographyStyles } = useTeleportTypography(origamTextFieldRef, menu, (fontSize) => ({
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
1397
|
+
"--origam-list-item__title---font-size": fontSize,
|
|
1398
|
+
// Kept proportional to the title rather than pinned, so the pair
|
|
1399
|
+
// keeps its relationship at any scale.
|
|
1400
|
+
"--origam-list-item__subtitle---font-size": `calc(${fontSize} * 0.875)`
|
|
573
1401
|
}));
|
|
574
1402
|
const menuProps = computed(() => {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
1403
|
+
const consumerProps = props.menuProps ?? {};
|
|
1404
|
+
const consumerContentProps = consumerProps.contentProps ?? {};
|
|
1405
|
+
return {
|
|
1406
|
+
...consumerProps,
|
|
1407
|
+
/*********************************************************
|
|
1408
|
+
* Menu activator ARIA — #1247
|
|
1409
|
+
*
|
|
1410
|
+
* @description
|
|
1411
|
+
* `activator="parent"` is the role-less `.origam-field` wrapper: OrigamMenu's
|
|
1412
|
+
* default aria-haspopup/expanded/owns are illegal there (aria-allowed-attr).
|
|
1413
|
+
* The combobox ARIA lives on the <input> (`comboboxAriaAttrs`); `undefined`
|
|
1414
|
+
* suppresses the defaults.
|
|
1415
|
+
********************************************************/
|
|
1416
|
+
activatorProps: {
|
|
1417
|
+
...MENU_WRAPPER_ARIA_RESET,
|
|
1418
|
+
...consumerProps.activatorProps ?? {}
|
|
1419
|
+
},
|
|
1420
|
+
contentProps: {
|
|
1421
|
+
...consumerContentProps,
|
|
1422
|
+
// The consumer's own style is listed last so it still wins —
|
|
1423
|
+
// the bridge is a default, not a lock.
|
|
1424
|
+
style: [menuTypographyStyles.value, consumerContentProps.style]
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
599
1427
|
});
|
|
1428
|
+
// Computed ARIA attrs forwarded to the TextField (→ <input>).
|
|
1429
|
+
// `aria-activedescendant` is only emitted when the menu is open
|
|
1430
|
+
// AND a real option is highlighted.
|
|
600
1431
|
const comboboxAriaAttrs = computed(() => {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
1432
|
+
const activeDescendant = menu.value && highlightIndex.value >= 0 ? optionId(highlightIndex.value) : undefined;
|
|
1433
|
+
/*
|
|
1434
|
+
* `role="combobox"` MUST sit on the same element as the
|
|
1435
|
+
* `aria-haspopup` / `aria-expanded` / `aria-controls`
|
|
1436
|
+
* attributes — axe-core's `aria-allowed-attr` rule will
|
|
1437
|
+
* flag those attrs as illegal on an element without the
|
|
1438
|
+
* matching combobox role. We force the role here so
|
|
1439
|
+
* regardless of how `OrigamTextField` distributes the
|
|
1440
|
+
* fall-through attrs, the role travels with them.
|
|
1441
|
+
*/
|
|
1442
|
+
return {
|
|
1443
|
+
role: "combobox",
|
|
1444
|
+
"aria-haspopup": "listbox",
|
|
1445
|
+
"aria-expanded": menu.value ? "true" : "false",
|
|
1446
|
+
"aria-controls": listboxId,
|
|
1447
|
+
"aria-autocomplete": props.autocomplete ? "list" : undefined,
|
|
1448
|
+
"aria-activedescendant": activeDescendant
|
|
1449
|
+
};
|
|
610
1450
|
});
|
|
611
1451
|
const menuListItemProps = (item, itemRef, index) => {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
1452
|
+
const isKeyboardHighlighted = highlightIndex.value === index;
|
|
1453
|
+
const isItemSelected = isSelected(item);
|
|
1454
|
+
return mergeProps(item.props ?? {}, {
|
|
1455
|
+
ref: itemRef,
|
|
1456
|
+
key: index,
|
|
1457
|
+
id: optionId(index),
|
|
1458
|
+
role: "option",
|
|
1459
|
+
"aria-selected": isItemSelected,
|
|
1460
|
+
active: highlightFirst.value && index === 0 || isItemSelected || isKeyboardHighlighted,
|
|
1461
|
+
onClick: () => handleSelect(item, null)
|
|
1462
|
+
});
|
|
623
1463
|
};
|
|
624
1464
|
const isSelected = (item) => {
|
|
625
|
-
|
|
1465
|
+
return selectedValues.value.includes(item.value);
|
|
626
1466
|
};
|
|
1467
|
+
// Type-narrow helpers used in the template to avoid TS18048 / TS2365.
|
|
1468
|
+
// `getMatches(item)?.title` is `TFilterMatch | undefined` (union of
|
|
1469
|
+
// boolean | number | tuples) — coerce to number before arithmetic.
|
|
1470
|
+
// `search` is `string | undefined` from the VLS context — fallback to 0
|
|
1471
|
+
// for the length so substr stays well-typed.
|
|
627
1472
|
const getMatchStart = (item) => Number(getMatches(item)?.title ?? 0);
|
|
628
1473
|
const getSearchLength = () => (search.value ?? "").length;
|
|
629
|
-
const {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
1474
|
+
const { onListScroll: handleListScroll, onListKeydown: handleListKeydown } = useScrolling(origamListRef, origamTextFieldRef);
|
|
1475
|
+
/*********************************************************
|
|
1476
|
+
* scheduleScrollFrame — rAF bound to the component's lifetime (#719)
|
|
1477
|
+
*
|
|
1478
|
+
* @description
|
|
1479
|
+
* Two sites defer `scrollToIndex` by one frame (keyboard lookup, and
|
|
1480
|
+
* the `menu` watcher that re-centres on the selected item). Nothing
|
|
1481
|
+
* cancelled that frame at unmount, so the continuation could land on
|
|
1482
|
+
* a destroyed environment — the #706 family. It is not benign here:
|
|
1483
|
+
* `scrollToIndex` runs through `useVirtual` → `useGoTo`, which arms
|
|
1484
|
+
* its own rAF loop and reads `window`.
|
|
1485
|
+
*
|
|
1486
|
+
* @description
|
|
1487
|
+
* `onBeforeUnmount` cancels the frames already armed and flips
|
|
1488
|
+
* `disposed`, which also neutralises any later scheduling attempt.
|
|
1489
|
+
*
|
|
1490
|
+
* @description
|
|
1491
|
+
* Every armed id is tracked, NOT just the latest. Collapsing them into
|
|
1492
|
+
* a single handle would make a later call supersede an earlier one —
|
|
1493
|
+
* a coalescing semantic this component never had, and one no failing
|
|
1494
|
+
* test asks for. The fix adds cancellation at unmount and nothing else.
|
|
1495
|
+
********************************************************/
|
|
1496
|
+
const scrollFrames = new Set();
|
|
634
1497
|
let disposed = false;
|
|
635
1498
|
const scheduleScrollFrame = (cb) => {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1499
|
+
if (disposed || !IN_BROWSER) return;
|
|
1500
|
+
const id = window.requestAnimationFrame(() => {
|
|
1501
|
+
scrollFrames.delete(id);
|
|
1502
|
+
cb();
|
|
1503
|
+
});
|
|
1504
|
+
scrollFrames.add(id);
|
|
642
1505
|
};
|
|
643
|
-
|
|
1506
|
+
/*********************************************************
|
|
1507
|
+
* scheduleMacrotask — le pendant `setTimeout` du garde ci-dessus
|
|
1508
|
+
* (#779)
|
|
1509
|
+
*
|
|
1510
|
+
* @description
|
|
1511
|
+
* Deux macrotaches de ce fichier n'ont jamais eu de garde :
|
|
1512
|
+
* la re-selection du texte au `mousedown:control` en mode
|
|
1513
|
+
* autocomplete, et le `listHasFocus = true` du `focusin`. Elles
|
|
1514
|
+
* cohabitaient avec le `disposed` de #719 — pose pour les frames de
|
|
1515
|
+
* defilement, jamais pour elles. C'est precisement le site qu'une
|
|
1516
|
+
* heuristique PAR FICHIER blanchit : le fichier a bien un
|
|
1517
|
+
* `onBeforeUnmount`, il ne couvrait simplement pas ces deux-la.
|
|
1518
|
+
*
|
|
1519
|
+
* @description
|
|
1520
|
+
* Rien d'observable ne change : la premiere dereference
|
|
1521
|
+
* `vm.proxy.$el` pour appeler `input.select()` — sur un arbre
|
|
1522
|
+
* demonte il n'y a plus d'input a selectionner ; la seconde ecrit un
|
|
1523
|
+
* `ref` interne que plus personne ne lit. Ce que le garde retire,
|
|
1524
|
+
* c'est la tache elle-meme, pas un effet.
|
|
1525
|
+
********************************************************/
|
|
1526
|
+
const macrotasks = new Set();
|
|
644
1527
|
const scheduleMacrotask = (cb) => {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
1528
|
+
if (disposed || !IN_BROWSER) return;
|
|
1529
|
+
const id = window.setTimeout(() => {
|
|
1530
|
+
macrotasks.delete(id);
|
|
1531
|
+
cb();
|
|
1532
|
+
}, 0);
|
|
1533
|
+
macrotasks.add(id);
|
|
651
1534
|
};
|
|
652
1535
|
onBeforeUnmount(() => {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
1536
|
+
disposed = true;
|
|
1537
|
+
for (const id of scrollFrames) window.cancelAnimationFrame(id);
|
|
1538
|
+
for (const id of macrotasks) window.clearTimeout(id);
|
|
1539
|
+
scrollFrames.clear();
|
|
1540
|
+
macrotasks.clear();
|
|
658
1541
|
});
|
|
1542
|
+
/*********************************************************
|
|
1543
|
+
* Event handlers
|
|
1544
|
+
********************************************************/
|
|
659
1545
|
const handleSelect = (item, set = true) => {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
1546
|
+
if (item.props?.disabled) return;
|
|
1547
|
+
if (props.multiple) {
|
|
1548
|
+
const index = model.value.findIndex((selection) => props.valueComparator ? props.valueComparator(selection.value, item.value) : deepEqual(selection.value, item.value));
|
|
1549
|
+
const add = set == null ? !~index : set;
|
|
1550
|
+
if (~index) {
|
|
1551
|
+
const value = add ? [...model.value, item] : [...model.value];
|
|
1552
|
+
value.splice(index, 1);
|
|
1553
|
+
model.value = value;
|
|
1554
|
+
} else if (add) {
|
|
1555
|
+
model.value = [...model.value, item];
|
|
1556
|
+
}
|
|
1557
|
+
if (props.clearOnSelect && props.autocomplete) {
|
|
1558
|
+
search.value = "";
|
|
1559
|
+
}
|
|
1560
|
+
} else {
|
|
1561
|
+
const add = set !== false;
|
|
1562
|
+
model.value = add ? [item] : [];
|
|
1563
|
+
if (props.autocomplete) {
|
|
1564
|
+
search.value = add ? item.title : "";
|
|
1565
|
+
}
|
|
1566
|
+
nextTick(() => {
|
|
1567
|
+
menu.value = false;
|
|
1568
|
+
isPristine.value = true;
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
685
1571
|
};
|
|
686
1572
|
const handleClear = (e) => {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
1573
|
+
if (props.openOnClear) {
|
|
1574
|
+
menu.value = true;
|
|
1575
|
+
}
|
|
1576
|
+
if (props.autocomplete) {
|
|
1577
|
+
search.value = "";
|
|
1578
|
+
}
|
|
1579
|
+
emit("click:clear", e);
|
|
694
1580
|
};
|
|
695
1581
|
const handleClickControl = (e) => {
|
|
696
|
-
|
|
1582
|
+
emit("click:control", e);
|
|
697
1583
|
};
|
|
1584
|
+
/*********************************************************
|
|
1585
|
+
* click:append / click:prepend / click:appendInner /
|
|
1586
|
+
* click:prependInner relay
|
|
1587
|
+
*
|
|
1588
|
+
* @description
|
|
1589
|
+
* `<origam-text-field>` already emits all four via its own
|
|
1590
|
+
* `useAdjacent` / `useAdjacentInner` calls, but nothing here listened
|
|
1591
|
+
* for them — declared, never fired (issue: guard
|
|
1592
|
+
* `unemitted-declarations`, `Select:click:append,click:appendInner,
|
|
1593
|
+
* click:prepend,click:prependInner`). Mirrors `handleClickControl`
|
|
1594
|
+
* above: relay on THIS component's own instance.
|
|
1595
|
+
********************************************************/
|
|
698
1596
|
const handleClickAppend = (e) => {
|
|
699
|
-
|
|
1597
|
+
emit("click:append", e);
|
|
700
1598
|
};
|
|
701
1599
|
const handleClickPrepend = (e) => {
|
|
702
|
-
|
|
1600
|
+
emit("click:prepend", e);
|
|
703
1601
|
};
|
|
704
1602
|
const handleClickAppendInner = (e) => {
|
|
705
|
-
|
|
1603
|
+
emit("click:appendInner", e);
|
|
706
1604
|
};
|
|
707
1605
|
const handleClickPrependInner = (e) => {
|
|
708
|
-
|
|
1606
|
+
emit("click:prependInner", e);
|
|
709
1607
|
};
|
|
710
1608
|
const handleMousedownControl = (e) => {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
1609
|
+
emit("mousedown:control", e);
|
|
1610
|
+
if (menuDisabled.value) return;
|
|
1611
|
+
menu.value = !menu.value;
|
|
1612
|
+
// Select-all the input text on every field click in autocomplete-
|
|
1613
|
+
// single mode when there's a selection. The focus watcher already
|
|
1614
|
+
// runs select() on the focus TRANSITION, but that fires only on
|
|
1615
|
+
// the false→true edge — clicking an already-focused field, OR a
|
|
1616
|
+
// click that races with the menu's focus management (focusin
|
|
1617
|
+
// steal / scroll-strategy refocus), leaves the cursor at the end
|
|
1618
|
+
// with the selection cleared. Wiring it here too means EVERY
|
|
1619
|
+
// mousedown re-selects, so the next keystroke always replaces.
|
|
1620
|
+
// We DOM-query the `<input>` instead of going through the
|
|
1621
|
+
// `origamTextFieldRef` proxy — `forwardRefs` doesn't reliably
|
|
1622
|
+
// expose the underlying HTMLInputElement's `select()` method.
|
|
1623
|
+
// Two `nextTick`s — one for Vue to flush, one to land AFTER the
|
|
1624
|
+
// menu's focusin handler has run.
|
|
1625
|
+
if (props.autocomplete && !props.multiple && search.value) {
|
|
1626
|
+
// `setTimeout(0)` instead of `nextTick` — the browser's
|
|
1627
|
+
// click cursor-placement and the TextField's
|
|
1628
|
+
// `handleFocus` chain (which calls `input.focus()` →
|
|
1629
|
+
// cursor jumps to end) run AFTER mousedown's synchronous
|
|
1630
|
+
// handlers AND after Vue's microtask queue. A microtask
|
|
1631
|
+
// `nextTick` resolves too early (before the click cycle
|
|
1632
|
+
// finishes its cursor placement) so our select() takes
|
|
1633
|
+
// effect for an instant then gets clobbered. A macrotask
|
|
1634
|
+
// (setTimeout) lands AFTER all that, so the selection
|
|
1635
|
+
// sticks.
|
|
1636
|
+
scheduleMacrotask(() => {
|
|
1637
|
+
const root = vm?.proxy?.$el;
|
|
1638
|
+
const input = root?.querySelector("input");
|
|
1639
|
+
input?.select();
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
721
1642
|
};
|
|
722
1643
|
const handleMousedownMenuIcon = (e) => {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1644
|
+
if (menuDisabled.value) return;
|
|
1645
|
+
if (isFocused.value) {
|
|
1646
|
+
// Field is already focused: stop propagation so the bubbling
|
|
1647
|
+
// mousedown does NOT also reach handleMousedownControl (which
|
|
1648
|
+
// would toggle the menu a second time and cancel the opening).
|
|
1649
|
+
e.preventDefault();
|
|
1650
|
+
e.stopPropagation();
|
|
1651
|
+
menu.value = !menu.value;
|
|
1652
|
+
}
|
|
1653
|
+
// When the field is NOT yet focused, let the event bubble up to
|
|
1654
|
+
// handleControlMousedown in OrigamTextField. That handler emits
|
|
1655
|
+
// mousedown:control → handleMousedownControl toggles the menu AND
|
|
1656
|
+
// manages focus in a single step. Without this guard the first
|
|
1657
|
+
// click double-toggles (icon → open, control → close again) because
|
|
1658
|
+
// stopPropagation is only called after the first focus is set.
|
|
729
1659
|
};
|
|
730
1660
|
const handleKeydown = (e) => {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
1661
|
+
if (!e.key || props.readonly || form?.isReadonly.value) return;
|
|
1662
|
+
const selectionStart = origamTextFieldRef.value?.selectionStart;
|
|
1663
|
+
const length = model.value.length;
|
|
1664
|
+
const keyAutocompleteOut = [
|
|
1665
|
+
KEYBOARD_VALUES.ENTER,
|
|
1666
|
+
KEYBOARD_VALUES.EMPTY,
|
|
1667
|
+
KEYBOARD_VALUES.DOWN,
|
|
1668
|
+
KEYBOARD_VALUES.UP,
|
|
1669
|
+
KEYBOARD_VALUES.HOME,
|
|
1670
|
+
KEYBOARD_VALUES.END
|
|
1671
|
+
];
|
|
1672
|
+
if (props.autocomplete && selectionIndex.value > -1 || keyAutocompleteOut.includes(e.key)) {
|
|
1673
|
+
e.preventDefault();
|
|
1674
|
+
}
|
|
1675
|
+
const keyMenuOpen = [
|
|
1676
|
+
KEYBOARD_VALUES.ENTER,
|
|
1677
|
+
KEYBOARD_VALUES.DOWN,
|
|
1678
|
+
KEYBOARD_VALUES.EMPTY
|
|
1679
|
+
];
|
|
1680
|
+
if (keyMenuOpen.includes(e.key)) {
|
|
1681
|
+
menu.value = true;
|
|
1682
|
+
}
|
|
1683
|
+
const keyMenuOut = [KEYBOARD_VALUES.ESC, KEYBOARD_VALUES.TAB];
|
|
1684
|
+
if (keyMenuOut.includes(e.key)) {
|
|
1685
|
+
highlightIndex.value = -1;
|
|
1686
|
+
menu.value = false;
|
|
1687
|
+
}
|
|
1688
|
+
// WAI-ARIA combobox: highlight navigation stays on the <input>.
|
|
1689
|
+
// DOM focus never leaves the input — only aria-activedescendant changes.
|
|
1690
|
+
const itemCount = displayItems.value.length;
|
|
1691
|
+
if (menu.value && itemCount > 0) {
|
|
1692
|
+
if (e.key === KEYBOARD_VALUES.DOWN) {
|
|
1693
|
+
highlightIndex.value = highlightIndex.value < itemCount - 1 ? highlightIndex.value + 1 : 0;
|
|
1694
|
+
} else if (e.key === KEYBOARD_VALUES.UP) {
|
|
1695
|
+
highlightIndex.value = highlightIndex.value > 0 ? highlightIndex.value - 1 : itemCount - 1;
|
|
1696
|
+
} else if (e.key === KEYBOARD_VALUES.HOME) {
|
|
1697
|
+
highlightIndex.value = 0;
|
|
1698
|
+
} else if (e.key === KEYBOARD_VALUES.END) {
|
|
1699
|
+
highlightIndex.value = itemCount - 1;
|
|
1700
|
+
} else if (e.key === KEYBOARD_VALUES.ENTER && highlightIndex.value >= 0) {
|
|
1701
|
+
handleSelect(displayItems.value[highlightIndex.value], null);
|
|
1702
|
+
highlightIndex.value = -1;
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
if (e.key === KEYBOARD_VALUES.HOME) {
|
|
1707
|
+
origamListRef.value?.focus("first");
|
|
1708
|
+
} else if (e.key === KEYBOARD_VALUES.END) {
|
|
1709
|
+
origamListRef.value?.focus("last");
|
|
1710
|
+
}
|
|
1711
|
+
const keyAutocompleteEnter = [KEYBOARD_VALUES.ENTER, KEYBOARD_VALUES.TAB];
|
|
1712
|
+
if (props.autocomplete) {
|
|
1713
|
+
if (highlightFirst.value && keyAutocompleteEnter.includes(e.key)) {
|
|
1714
|
+
handleSelect(displayItems.value[0]);
|
|
1715
|
+
}
|
|
1716
|
+
if (e.key === KEYBOARD_VALUES.DOWN && highlightFirst.value) {
|
|
1717
|
+
origamListRef.value?.focus("next");
|
|
1718
|
+
}
|
|
1719
|
+
const keyBack = [KEYBOARD_VALUES.BACKSPACE, KEYBOARD_VALUES.DELETE];
|
|
1720
|
+
if (keyBack.includes(e.key)) {
|
|
1721
|
+
if (!props.multiple && model.value.length > 0 && !search.value) return handleSelect(model.value[0], false);
|
|
1722
|
+
if (~selectionIndex.value) {
|
|
1723
|
+
const originalSelectionIndex = selectionIndex.value;
|
|
1724
|
+
handleSelect(model.value[selectionIndex.value], false);
|
|
1725
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
|
1726
|
+
} else if (e.key === KEYBOARD_VALUES.BACKSPACE && !search.value) {
|
|
1727
|
+
selectionIndex.value = length - 1;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
if (!props.multiple) return;
|
|
1731
|
+
if (e.key === KEYBOARD_VALUES.LEFT) {
|
|
1732
|
+
if (selectionIndex.value < 0 && (selectionStart ?? 0) > 0) return;
|
|
1733
|
+
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
|
1734
|
+
if (model.value[prev]) {
|
|
1735
|
+
selectionIndex.value = prev;
|
|
1736
|
+
} else {
|
|
1737
|
+
selectionIndex.value = -1;
|
|
1738
|
+
origamTextFieldRef.value?.setSelectionRange(search.value?.length ?? null, search.value?.length ?? null);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if (e.key === KEYBOARD_VALUES.RIGHT) {
|
|
1742
|
+
if (selectionIndex.value < 0) return;
|
|
1743
|
+
const next = selectionIndex.value + 1;
|
|
1744
|
+
if (model.value[next]) {
|
|
1745
|
+
selectionIndex.value = next;
|
|
1746
|
+
} else {
|
|
1747
|
+
selectionIndex.value = -1;
|
|
1748
|
+
origamTextFieldRef.value?.setSelectionRange(0, 0);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
} else {
|
|
1752
|
+
// html select hotkeys
|
|
1753
|
+
const KEYBOARD_LOOKUP_THRESHOLD = 1e3;
|
|
1754
|
+
const checkPrintable = (e) => {
|
|
1755
|
+
const isPrintableChar = e.key.length === 1;
|
|
1756
|
+
const noModifier = !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
1757
|
+
return isPrintableChar && noModifier;
|
|
1758
|
+
};
|
|
1759
|
+
if (props.multiple || !checkPrintable(e)) return;
|
|
1760
|
+
const now = performance.now();
|
|
1761
|
+
if (now - keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {
|
|
1762
|
+
keyboardLookupPrefix = "";
|
|
1763
|
+
}
|
|
1764
|
+
keyboardLookupPrefix += e.key.toLowerCase();
|
|
1765
|
+
keyboardLookupLastTime = now;
|
|
1766
|
+
const item = items.value.find((item) => item.title?.toLowerCase().startsWith(keyboardLookupPrefix));
|
|
1767
|
+
if (item !== undefined) {
|
|
1768
|
+
model.value = [item];
|
|
1769
|
+
const index = displayItems.value.indexOf(item);
|
|
1770
|
+
scheduleScrollFrame(() => {
|
|
1771
|
+
if (index >= 0) {
|
|
1772
|
+
origamVirtualScrollRef.value?.scrollToIndex(index);
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
833
1777
|
};
|
|
834
1778
|
const handleBlur = (e) => {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1779
|
+
if (!origamListRef.value?.$el.contains(e.relatedTarget)) {
|
|
1780
|
+
menu.value = false;
|
|
1781
|
+
}
|
|
838
1782
|
};
|
|
839
1783
|
const handleChange = (e) => {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1784
|
+
if (matchesSelector(origamTextFieldRef.value, ":autofill") || matchesSelector(origamTextFieldRef.value, ":-webkit-autofill")) {
|
|
1785
|
+
const item = items.value.find((item) => item.title === e.target.value);
|
|
1786
|
+
if (item) {
|
|
1787
|
+
handleSelect(item);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
846
1790
|
};
|
|
847
1791
|
const handleAfterLeave = () => {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
1792
|
+
highlightIndex.value = -1;
|
|
1793
|
+
if (isFocused.value) {
|
|
1794
|
+
isPristine.value = true;
|
|
1795
|
+
origamTextFieldRef.value?.focus();
|
|
1796
|
+
}
|
|
853
1797
|
};
|
|
854
1798
|
const handleFocusin = () => {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1799
|
+
isFocused.value = true;
|
|
1800
|
+
scheduleMacrotask(() => {
|
|
1801
|
+
listHasFocus.value = true;
|
|
1802
|
+
});
|
|
859
1803
|
};
|
|
860
1804
|
const handleFocusout = () => {
|
|
861
|
-
|
|
1805
|
+
listHasFocus.value = false;
|
|
862
1806
|
};
|
|
863
1807
|
const handleModelUpdate = (v) => {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
1808
|
+
if (v == null || v === "" && !props.multiple) {
|
|
1809
|
+
model.value = [];
|
|
1810
|
+
}
|
|
1811
|
+
if (origamTextFieldRef.value) {
|
|
1812
|
+
origamTextFieldRef.value.value = "";
|
|
1813
|
+
}
|
|
870
1814
|
};
|
|
871
1815
|
const handleMousedown = (e) => {
|
|
872
|
-
|
|
1816
|
+
e.preventDefault();
|
|
873
1817
|
};
|
|
1818
|
+
/*********************************************************
|
|
1819
|
+
* Chips
|
|
1820
|
+
*
|
|
1821
|
+
* @description
|
|
1822
|
+
* Chip slot props and chip event handlers (close, keydown,
|
|
1823
|
+
* mousedown) for the multi-select chip display mode.
|
|
1824
|
+
********************************************************/
|
|
874
1825
|
const hasChips = computed(() => {
|
|
875
|
-
|
|
1826
|
+
return props.chips || slots.chip;
|
|
876
1827
|
});
|
|
1828
|
+
/*********************************************************
|
|
1829
|
+
* chipSlotProps
|
|
1830
|
+
*
|
|
1831
|
+
* @description
|
|
1832
|
+
* Return typed as Record<string, unknown> so vue-tsc does not try to
|
|
1833
|
+
* validate the event-handler keys ('onClick:close', 'onKeydown', …)
|
|
1834
|
+
* against IChipProps when the object is spread via v-bind on <origam-chip>.
|
|
1835
|
+
* `bgColor` / `color` are deliberately OMITTED (#456) — they used to be
|
|
1836
|
+
* hardcoded RGB literals, hiding the chip behind whatever theme was
|
|
1837
|
+
* active. `OrigamChip`'s own SCSS already reads
|
|
1838
|
+
* `var(--origam-chip---background-color)` / `var(--origam-chip---color)`
|
|
1839
|
+
* with no inline fallback, and the token pipeline emits both
|
|
1840
|
+
* (`packages/ds/tokens/component/chip.json` → `color.surface.overlay` /
|
|
1841
|
+
* `color.text.primary`) — so leaving them unset lets Chip resolve its
|
|
1842
|
+
* own themed default instead of this component overriding it.
|
|
1843
|
+
********************************************************/
|
|
877
1844
|
const chipSlotProps = (item) => {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1845
|
+
return {
|
|
1846
|
+
closable: props.closableChips,
|
|
1847
|
+
disabled: item.props?.disabled,
|
|
1848
|
+
border: true,
|
|
1849
|
+
rounded: true,
|
|
1850
|
+
"onClick:close": (e) => handleChipClose(e, item),
|
|
1851
|
+
onKeydown: (e) => handleChipKeydown(e, item),
|
|
1852
|
+
onMousedown: (e) => handleChipMousedown(e),
|
|
1853
|
+
modelValue: true,
|
|
1854
|
+
size: "small",
|
|
1855
|
+
...props.chipProps
|
|
1856
|
+
};
|
|
890
1857
|
};
|
|
891
1858
|
const handleChipClose = (e, item) => {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1859
|
+
e.stopPropagation();
|
|
1860
|
+
e.preventDefault();
|
|
1861
|
+
handleSelect(item, false);
|
|
895
1862
|
};
|
|
896
1863
|
const handleChipKeydown = (e, item) => {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1864
|
+
if (e.key !== KEYBOARD_VALUES.ENTER && e.key !== KEYBOARD_VALUES.EMPTY) return;
|
|
1865
|
+
e.preventDefault();
|
|
1866
|
+
e.stopPropagation();
|
|
1867
|
+
handleChipClose(e, item);
|
|
901
1868
|
};
|
|
902
1869
|
const handleChipMousedown = (e) => {
|
|
903
|
-
|
|
904
|
-
|
|
1870
|
+
e.preventDefault();
|
|
1871
|
+
e.stopPropagation();
|
|
905
1872
|
};
|
|
906
1873
|
watch(isFocused, (val, oldVal) => {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1874
|
+
if (val === oldVal) return;
|
|
1875
|
+
/*********************************************************
|
|
1876
|
+
* unemitted-declarations — update:focused relay
|
|
1877
|
+
*
|
|
1878
|
+
* @description
|
|
1879
|
+
* `update:focused` was declared but never fired:
|
|
1880
|
+
* `v-model:focused="isFocused"` only CONSUMES the echo from the
|
|
1881
|
+
* nested `<origam-text-field>` into this local ref, it never
|
|
1882
|
+
* relays it back out to Select's own consumers.
|
|
1883
|
+
********************************************************/
|
|
1884
|
+
emit("update:focused", val);
|
|
1885
|
+
if (val) {
|
|
1886
|
+
isSelecting.value = true;
|
|
1887
|
+
// Sync `search` (the input value) from the current model on focus
|
|
1888
|
+
// — but ONLY in autocomplete mode, where the input is meant to
|
|
1889
|
+
// be editable so the user can refine their pick. In non-
|
|
1890
|
+
// autocomplete mode this writes the selected title into the
|
|
1891
|
+
// `<input value>`, which then renders ALONGSIDE the
|
|
1892
|
+
// `.origam-select__selection` div that ALSO carries the title
|
|
1893
|
+
// → user sees "Germany Germany" in the field after a re-focus
|
|
1894
|
+
// (tab-out-then-back, click-elsewhere-then-back, …). The input
|
|
1895
|
+
// in non-autocomplete is effectively a screen-reader proxy
|
|
1896
|
+
// (`pointer-events: none`, opacity flipped on by --active) —
|
|
1897
|
+
// it must stay empty so it doesn't visually duplicate the
|
|
1898
|
+
// selection.
|
|
1899
|
+
if (props.autocomplete) {
|
|
1900
|
+
// @ts-expect-error TODO
|
|
1901
|
+
search.value = props.multiple ? "" : String(model.value?.at(-1)?.props.title ?? "");
|
|
1902
|
+
}
|
|
1903
|
+
isPristine.value = true;
|
|
1904
|
+
nextTick(() => {
|
|
1905
|
+
isSelecting.value = false;
|
|
1906
|
+
// Select-all the input text in single-autocomplete mode
|
|
1907
|
+
// when there IS a selection. The user expects: "click
|
|
1908
|
+
// the field with `France` already picked, start typing
|
|
1909
|
+
// → my keystrokes REPLACE the selection". Without the
|
|
1910
|
+
// select-all the cursor lands at the end and typing
|
|
1911
|
+
// appends — `France` + `S` → `FranceS` filters against
|
|
1912
|
+
// nothing and looks broken.
|
|
1913
|
+
// Skip in multiple mode (the input is meant to be a
|
|
1914
|
+
// fresh filter input, NOT a copy of any chip).
|
|
1915
|
+
// We DOM-query the input instead of going through
|
|
1916
|
+
// `origamTextFieldRef.value.select()` — the
|
|
1917
|
+
// `forwardRefs` proxy on TextField doesn't reliably
|
|
1918
|
+
// expose the HTMLInputElement's `select()` method.
|
|
1919
|
+
if (props.autocomplete && !props.multiple && search.value) {
|
|
1920
|
+
const root = vm?.proxy?.$el;
|
|
1921
|
+
const input = root?.querySelector("input");
|
|
1922
|
+
input?.select();
|
|
1923
|
+
}
|
|
1924
|
+
});
|
|
1925
|
+
} else {
|
|
1926
|
+
if (!props.multiple && search.value == null) model.value = [];
|
|
1927
|
+
else if (highlightFirst.value && !listHasFocus.value && !model.value.some(({ value }) => value === displayItems.value[0].value)) {
|
|
1928
|
+
handleSelect(displayItems.value[0]);
|
|
1929
|
+
}
|
|
1930
|
+
menu.value = false;
|
|
1931
|
+
search.value = "";
|
|
1932
|
+
selectionIndex.value = -1;
|
|
1933
|
+
}
|
|
932
1934
|
});
|
|
1935
|
+
/*********************************************************
|
|
1936
|
+
* DEFERRED TO onMounted — NOT AN OPTIMISATION
|
|
1937
|
+
*
|
|
1938
|
+
* @description
|
|
1939
|
+
* `watch(search, cb)` reads `search.value` synchronously the instant it
|
|
1940
|
+
* is created, to seed `oldValue`. `search` is a `useVModel(props,
|
|
1941
|
+
* 'search', '')` model — its getter reads `props.search`. Creating this
|
|
1942
|
+
* watch at the top level of `setup()` forced that seeding read before
|
|
1943
|
+
* Vue's `beforeCreate` hook runs, which is where the ADR-005 theme
|
|
1944
|
+
* resolver patches `instance.props`. A `computed` (which the `useVModel`
|
|
1945
|
+
* model is) caches whatever its first evaluation saw and only
|
|
1946
|
+
* invalidates on a tracked dependency change; the resolver's
|
|
1947
|
+
* `Object.defineProperty` patch is not one on a static mount with no
|
|
1948
|
+
* parent re-render, so `search` stayed cached at `''` forever — a theme
|
|
1949
|
+
* naming `search` never landed. Deferring to `onMounted` delays the
|
|
1950
|
+
* seeding read to after the component's first render, which is already
|
|
1951
|
+
* past `beforeCreate`.
|
|
1952
|
+
********************************************************/
|
|
933
1953
|
onMounted(() => {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1954
|
+
watch(search, (val) => {
|
|
1955
|
+
if (!isFocused.value || isSelecting.value) return;
|
|
1956
|
+
if (val) menu.value = true;
|
|
1957
|
+
isPristine.value = !val;
|
|
1958
|
+
});
|
|
939
1959
|
});
|
|
940
1960
|
watch(menu, () => {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
});
|
|
950
|
-
}
|
|
1961
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
|
1962
|
+
const index = displayItems.value.findIndex((item) => model.value.some((s) => props.valueComparator ? props.valueComparator(s.value, item.value) : deepEqual(s.value, item.value)));
|
|
1963
|
+
scheduleScrollFrame(() => {
|
|
1964
|
+
if (index >= 0) {
|
|
1965
|
+
origamVirtualScrollRef.value?.scrollToIndex(index);
|
|
1966
|
+
}
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
951
1969
|
});
|
|
952
1970
|
watch(() => props.items, (newVal, oldVal) => {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1971
|
+
if (menu.value) return;
|
|
1972
|
+
if (isFocused.value && !oldVal.length && newVal.length) {
|
|
1973
|
+
menu.value = true;
|
|
1974
|
+
}
|
|
957
1975
|
});
|
|
958
1976
|
const hasList = computed(() => {
|
|
959
|
-
|
|
1977
|
+
return !props.hideNoData || displayItems.value.length || slots.prependItem || slots.appendItem || slots.noData;
|
|
960
1978
|
});
|
|
1979
|
+
/*********************************************************
|
|
1980
|
+
* Forwarded props
|
|
1981
|
+
********************************************************/
|
|
961
1982
|
const textFieldProps = computed(() => {
|
|
962
|
-
|
|
1983
|
+
return filterPropsOf(OrigamTextField, props, [
|
|
1984
|
+
"class",
|
|
1985
|
+
"id",
|
|
1986
|
+
"style",
|
|
1987
|
+
"counterValue",
|
|
1988
|
+
"dirty",
|
|
1989
|
+
"modelValue",
|
|
1990
|
+
"placeholder",
|
|
1991
|
+
"validationValue",
|
|
1992
|
+
"focused"
|
|
1993
|
+
]);
|
|
963
1994
|
});
|
|
1995
|
+
// The dropdown rows must sit on the same height rung as the control, so the
|
|
1996
|
+
// popup never dwarfs a small field. `size` is optional on the select and an
|
|
1997
|
+
// unsized `.origam-field` still resolves its control height from the `md`
|
|
1998
|
+
// rung — the list has to be told that explicitly, because with no `size` at
|
|
1999
|
+
// all `useSize` emits no rung class and the row would fall back to the
|
|
2000
|
+
// standalone-list height instead.
|
|
964
2001
|
const listSize = computed(() => {
|
|
965
|
-
|
|
2002
|
+
return props.size ?? SIZES.DEFAULT;
|
|
966
2003
|
});
|
|
967
2004
|
const isDirty = computed(() => {
|
|
968
|
-
|
|
2005
|
+
return model.value.length > 0;
|
|
969
2006
|
});
|
|
970
2007
|
const placeholder = computed(() => {
|
|
971
|
-
|
|
2008
|
+
return isDirty.value || !isFocused.value && props.label && !props.persistentPlaceholder ? undefined : props.placeholder;
|
|
972
2009
|
});
|
|
2010
|
+
/*********************************************************
|
|
2011
|
+
* Accessible name (#622, #1251)
|
|
2012
|
+
*
|
|
2013
|
+
* @description
|
|
2014
|
+
* `aria-label` / `title` mirror `props.label` only. Without a `label`
|
|
2015
|
+
* prop NOTHING is emitted: the name then comes from an external
|
|
2016
|
+
* `<label for>` / the consumer's `aria-labelledby`, which an `aria-label`
|
|
2017
|
+
* would override (it ranks above `<label for>` in the name computation).
|
|
2018
|
+
* The open/close wording stays on the toggle button, not on the input.
|
|
2019
|
+
********************************************************/
|
|
2020
|
+
/*********************************************************
|
|
2021
|
+
* Class & Style
|
|
2022
|
+
*
|
|
2023
|
+
* @description
|
|
2024
|
+
* selectStyles and selectClasses compose the BEM block.
|
|
2025
|
+
********************************************************/
|
|
973
2026
|
const selectStyles = computed(() => {
|
|
974
|
-
|
|
975
|
-
props.style
|
|
976
|
-
];
|
|
2027
|
+
return [props.style];
|
|
977
2028
|
});
|
|
978
2029
|
const getSelectionClasses = (index) => {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
2030
|
+
return [
|
|
2031
|
+
"origam-select__selection",
|
|
2032
|
+
{ "origam-select__selection--selected": index === selectionIndex.value },
|
|
2033
|
+
textColorClasses.value
|
|
2034
|
+
];
|
|
984
2035
|
};
|
|
985
2036
|
const selectClasses = computed(() => {
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
2037
|
+
return [
|
|
2038
|
+
"origam-select",
|
|
2039
|
+
`origam-select--${props.multiple ? "multiple" : "single"}`,
|
|
2040
|
+
{
|
|
2041
|
+
"origam-select--autocomplete": props.autocomplete,
|
|
2042
|
+
"origam-select--active-menu": menu.value,
|
|
2043
|
+
"origam-select--chips": props.chips,
|
|
2044
|
+
"origam-select--selected": selectionIndex.value > -1
|
|
2045
|
+
},
|
|
2046
|
+
props.class
|
|
2047
|
+
];
|
|
997
2048
|
});
|
|
2049
|
+
/*********************************************************
|
|
2050
|
+
* useStyle
|
|
2051
|
+
*
|
|
2052
|
+
* @description
|
|
2053
|
+
* #372 — `id` must be seeded with `() => props.id`: without it, the id
|
|
2054
|
+
* returned here is a purely GENERATED one for the scoped stylesheet
|
|
2055
|
+
* selector, and the template's `:id="id"` on `<origam-text-field>`
|
|
2056
|
+
* would forward that generated id instead of the consumer's.
|
|
2057
|
+
* @description
|
|
2058
|
+
* `id` was already excluded from `textFieldProps` below
|
|
2059
|
+
* (`filterProps(props, [..., 'id', ...])`) because it needed this
|
|
2060
|
+
* explicit binding instead of the generic spread — the explicit
|
|
2061
|
+
* binding was simply missing.
|
|
2062
|
+
********************************************************/
|
|
998
2063
|
const { id, css, load, isLoaded, unload } = useStyle(selectStyles, () => props.id);
|
|
2064
|
+
/*********************************************************
|
|
2065
|
+
* Expose
|
|
2066
|
+
*
|
|
2067
|
+
* @description
|
|
2068
|
+
* Exposes filterProps and imperative handles to parent ref
|
|
2069
|
+
* consumers, forwarded through origamTextFieldRef.
|
|
2070
|
+
********************************************************/
|
|
999
2071
|
defineExpose(forwardRefs({
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
2072
|
+
filterProps,
|
|
2073
|
+
isFocused,
|
|
2074
|
+
menu,
|
|
2075
|
+
handleSelect,
|
|
2076
|
+
css,
|
|
2077
|
+
id,
|
|
2078
|
+
load,
|
|
2079
|
+
unload,
|
|
2080
|
+
isLoaded
|
|
1009
2081
|
}, origamTextFieldRef));
|
|
1010
2082
|
</script>
|
|
1011
2083
|
|