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
|
@@ -173,11 +173,7 @@ import { useLocale } from "../../composables/Commons/locale.composable";
|
|
|
173
173
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
174
174
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
175
175
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
176
|
-
import {
|
|
177
|
-
RATING_FIELD_ENABLED_RADIO_SELECTOR,
|
|
178
|
-
RATING_FIELD_MUTATING_KEYS,
|
|
179
|
-
RATING_FIELD_ROOT_SELECTOR
|
|
180
|
-
} from "../../consts/RatingField/rating-field.const";
|
|
176
|
+
import { RATING_FIELD_ENABLED_RADIO_SELECTOR, RATING_FIELD_MUTATING_KEYS, RATING_FIELD_ROOT_SELECTOR } from "../../consts/RatingField/rating-field.const";
|
|
181
177
|
import { BLOCK } from "../../enums/Commons/anchor.enum";
|
|
182
178
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
183
179
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
@@ -187,243 +183,1016 @@ import { VARIANT } from "../../enums/Commons/variant.enum";
|
|
|
187
183
|
import { clamp, createRange } from "../../utils/Commons/commons.util";
|
|
188
184
|
import { filterInputAttrs } from "../../utils/Input/input.util";
|
|
189
185
|
import { getUid } from "../../utils/Commons/getCurrentInstance.util";
|
|
186
|
+
/*********************************************************
|
|
187
|
+
* Global
|
|
188
|
+
*
|
|
189
|
+
* @description
|
|
190
|
+
* Props, emits and filterProps for the RatingField component.
|
|
191
|
+
********************************************************/
|
|
190
192
|
const props = defineProps({
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
193
|
+
name: {
|
|
194
|
+
type: String,
|
|
195
|
+
required: false
|
|
196
|
+
},
|
|
197
|
+
label: {
|
|
198
|
+
type: String,
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
itemAriaLabel: {
|
|
202
|
+
type: String,
|
|
203
|
+
required: false
|
|
204
|
+
},
|
|
205
|
+
clearable: {
|
|
206
|
+
type: Boolean,
|
|
207
|
+
required: false
|
|
208
|
+
},
|
|
209
|
+
disabled: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
required: false
|
|
212
|
+
},
|
|
213
|
+
emptyIcon: {
|
|
214
|
+
type: null,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
217
|
+
fullIcon: {
|
|
218
|
+
type: null,
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
halfIncrements: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
hover: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
required: false
|
|
228
|
+
},
|
|
229
|
+
length: {
|
|
230
|
+
type: [Number, String],
|
|
231
|
+
required: false,
|
|
232
|
+
default: 5
|
|
233
|
+
},
|
|
234
|
+
readonly: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
modelValue: {
|
|
239
|
+
type: [Number, String],
|
|
240
|
+
required: false,
|
|
241
|
+
default: 0
|
|
242
|
+
},
|
|
243
|
+
itemLabels: {
|
|
244
|
+
type: Array,
|
|
245
|
+
required: false
|
|
246
|
+
},
|
|
247
|
+
itemLabelPosition: {
|
|
248
|
+
type: null,
|
|
249
|
+
required: false,
|
|
250
|
+
default: BLOCK.TOP
|
|
251
|
+
},
|
|
252
|
+
centerAffix: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
required: false
|
|
255
|
+
},
|
|
256
|
+
hideDetails: {
|
|
257
|
+
type: [Boolean, String],
|
|
258
|
+
required: false
|
|
259
|
+
},
|
|
260
|
+
hideSpinButtons: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
hint: {
|
|
265
|
+
type: String,
|
|
266
|
+
required: false
|
|
267
|
+
},
|
|
268
|
+
persistentHint: {
|
|
269
|
+
type: Boolean,
|
|
270
|
+
required: false
|
|
271
|
+
},
|
|
272
|
+
messages: {
|
|
273
|
+
type: [Array, String],
|
|
274
|
+
required: false
|
|
275
|
+
},
|
|
276
|
+
id: {
|
|
277
|
+
type: String,
|
|
278
|
+
required: false
|
|
279
|
+
},
|
|
280
|
+
class: {
|
|
281
|
+
type: [
|
|
282
|
+
String,
|
|
283
|
+
Array,
|
|
284
|
+
Object
|
|
285
|
+
],
|
|
286
|
+
required: false
|
|
287
|
+
},
|
|
288
|
+
style: {
|
|
289
|
+
type: [
|
|
290
|
+
String,
|
|
291
|
+
Array,
|
|
292
|
+
Object,
|
|
293
|
+
Boolean,
|
|
294
|
+
null
|
|
295
|
+
],
|
|
296
|
+
required: false,
|
|
297
|
+
skipCheck: true
|
|
298
|
+
},
|
|
299
|
+
density: {
|
|
300
|
+
type: null,
|
|
301
|
+
required: false,
|
|
302
|
+
default: DENSITY.DEFAULT
|
|
303
|
+
},
|
|
304
|
+
padding: {
|
|
305
|
+
type: [
|
|
306
|
+
Boolean,
|
|
307
|
+
Number,
|
|
308
|
+
String
|
|
309
|
+
],
|
|
310
|
+
required: false
|
|
311
|
+
},
|
|
312
|
+
paddingTop: {
|
|
313
|
+
type: [
|
|
314
|
+
Boolean,
|
|
315
|
+
Number,
|
|
316
|
+
String
|
|
317
|
+
],
|
|
318
|
+
required: false
|
|
319
|
+
},
|
|
320
|
+
paddingLeft: {
|
|
321
|
+
type: [
|
|
322
|
+
Boolean,
|
|
323
|
+
Number,
|
|
324
|
+
String
|
|
325
|
+
],
|
|
326
|
+
required: false
|
|
327
|
+
},
|
|
328
|
+
paddingBottom: {
|
|
329
|
+
type: [
|
|
330
|
+
Boolean,
|
|
331
|
+
Number,
|
|
332
|
+
String
|
|
333
|
+
],
|
|
334
|
+
required: false
|
|
335
|
+
},
|
|
336
|
+
paddingRight: {
|
|
337
|
+
type: [
|
|
338
|
+
Boolean,
|
|
339
|
+
Number,
|
|
340
|
+
String
|
|
341
|
+
],
|
|
342
|
+
required: false
|
|
343
|
+
},
|
|
344
|
+
paddingBlock: {
|
|
345
|
+
type: [
|
|
346
|
+
Boolean,
|
|
347
|
+
Number,
|
|
348
|
+
String
|
|
349
|
+
],
|
|
350
|
+
required: false
|
|
351
|
+
},
|
|
352
|
+
paddingInline: {
|
|
353
|
+
type: [
|
|
354
|
+
Boolean,
|
|
355
|
+
Number,
|
|
356
|
+
String
|
|
357
|
+
],
|
|
358
|
+
required: false
|
|
359
|
+
},
|
|
360
|
+
paddingInlineStart: {
|
|
361
|
+
type: [
|
|
362
|
+
Boolean,
|
|
363
|
+
Number,
|
|
364
|
+
String
|
|
365
|
+
],
|
|
366
|
+
required: false
|
|
367
|
+
},
|
|
368
|
+
paddingInlineEnd: {
|
|
369
|
+
type: [
|
|
370
|
+
Boolean,
|
|
371
|
+
Number,
|
|
372
|
+
String
|
|
373
|
+
],
|
|
374
|
+
required: false
|
|
375
|
+
},
|
|
376
|
+
paddingBlockStart: {
|
|
377
|
+
type: [
|
|
378
|
+
Boolean,
|
|
379
|
+
Number,
|
|
380
|
+
String
|
|
381
|
+
],
|
|
382
|
+
required: false
|
|
383
|
+
},
|
|
384
|
+
paddingBlockEnd: {
|
|
385
|
+
type: [
|
|
386
|
+
Boolean,
|
|
387
|
+
Number,
|
|
388
|
+
String
|
|
389
|
+
],
|
|
390
|
+
required: false
|
|
391
|
+
},
|
|
392
|
+
margin: {
|
|
393
|
+
type: [
|
|
394
|
+
Boolean,
|
|
395
|
+
Number,
|
|
396
|
+
String
|
|
397
|
+
],
|
|
398
|
+
required: false
|
|
399
|
+
},
|
|
400
|
+
marginTop: {
|
|
401
|
+
type: [
|
|
402
|
+
Boolean,
|
|
403
|
+
Number,
|
|
404
|
+
String
|
|
405
|
+
],
|
|
406
|
+
required: false
|
|
407
|
+
},
|
|
408
|
+
marginLeft: {
|
|
409
|
+
type: [
|
|
410
|
+
Boolean,
|
|
411
|
+
Number,
|
|
412
|
+
String
|
|
413
|
+
],
|
|
414
|
+
required: false
|
|
415
|
+
},
|
|
416
|
+
marginBottom: {
|
|
417
|
+
type: [
|
|
418
|
+
Boolean,
|
|
419
|
+
Number,
|
|
420
|
+
String
|
|
421
|
+
],
|
|
422
|
+
required: false
|
|
423
|
+
},
|
|
424
|
+
marginRight: {
|
|
425
|
+
type: [
|
|
426
|
+
Boolean,
|
|
427
|
+
Number,
|
|
428
|
+
String
|
|
429
|
+
],
|
|
430
|
+
required: false
|
|
431
|
+
},
|
|
432
|
+
marginBlock: {
|
|
433
|
+
type: [
|
|
434
|
+
Boolean,
|
|
435
|
+
Number,
|
|
436
|
+
String
|
|
437
|
+
],
|
|
438
|
+
required: false
|
|
439
|
+
},
|
|
440
|
+
marginInline: {
|
|
441
|
+
type: [
|
|
442
|
+
Boolean,
|
|
443
|
+
Number,
|
|
444
|
+
String
|
|
445
|
+
],
|
|
446
|
+
required: false
|
|
447
|
+
},
|
|
448
|
+
marginInlineStart: {
|
|
449
|
+
type: [
|
|
450
|
+
Boolean,
|
|
451
|
+
Number,
|
|
452
|
+
String
|
|
453
|
+
],
|
|
454
|
+
required: false
|
|
455
|
+
},
|
|
456
|
+
marginInlineEnd: {
|
|
457
|
+
type: [
|
|
458
|
+
Boolean,
|
|
459
|
+
Number,
|
|
460
|
+
String
|
|
461
|
+
],
|
|
462
|
+
required: false
|
|
463
|
+
},
|
|
464
|
+
marginBlockStart: {
|
|
465
|
+
type: [
|
|
466
|
+
Boolean,
|
|
467
|
+
Number,
|
|
468
|
+
String
|
|
469
|
+
],
|
|
470
|
+
required: false
|
|
471
|
+
},
|
|
472
|
+
marginBlockEnd: {
|
|
473
|
+
type: [
|
|
474
|
+
Boolean,
|
|
475
|
+
Number,
|
|
476
|
+
String
|
|
477
|
+
],
|
|
478
|
+
required: false
|
|
479
|
+
},
|
|
480
|
+
rounded: {
|
|
481
|
+
type: [
|
|
482
|
+
Boolean,
|
|
483
|
+
Number,
|
|
484
|
+
String,
|
|
485
|
+
null
|
|
486
|
+
],
|
|
487
|
+
required: false,
|
|
488
|
+
skipCheck: true
|
|
489
|
+
},
|
|
490
|
+
roundedTopRight: {
|
|
491
|
+
type: [
|
|
492
|
+
Boolean,
|
|
493
|
+
Number,
|
|
494
|
+
String
|
|
495
|
+
],
|
|
496
|
+
required: false
|
|
497
|
+
},
|
|
498
|
+
roundedTopLeft: {
|
|
499
|
+
type: [
|
|
500
|
+
Boolean,
|
|
501
|
+
Number,
|
|
502
|
+
String
|
|
503
|
+
],
|
|
504
|
+
required: false
|
|
505
|
+
},
|
|
506
|
+
roundedBottomLeft: {
|
|
507
|
+
type: [
|
|
508
|
+
Boolean,
|
|
509
|
+
Number,
|
|
510
|
+
String
|
|
511
|
+
],
|
|
512
|
+
required: false
|
|
513
|
+
},
|
|
514
|
+
roundedBottomRight: {
|
|
515
|
+
type: [
|
|
516
|
+
Boolean,
|
|
517
|
+
Number,
|
|
518
|
+
String
|
|
519
|
+
],
|
|
520
|
+
required: false
|
|
521
|
+
},
|
|
522
|
+
roundedStartStart: {
|
|
523
|
+
type: [
|
|
524
|
+
Boolean,
|
|
525
|
+
Number,
|
|
526
|
+
String
|
|
527
|
+
],
|
|
528
|
+
required: false
|
|
529
|
+
},
|
|
530
|
+
roundedStartEnd: {
|
|
531
|
+
type: [
|
|
532
|
+
Boolean,
|
|
533
|
+
Number,
|
|
534
|
+
String
|
|
535
|
+
],
|
|
536
|
+
required: false
|
|
537
|
+
},
|
|
538
|
+
roundedEndStart: {
|
|
539
|
+
type: [
|
|
540
|
+
Boolean,
|
|
541
|
+
Number,
|
|
542
|
+
String
|
|
543
|
+
],
|
|
544
|
+
required: false
|
|
545
|
+
},
|
|
546
|
+
roundedEndEnd: {
|
|
547
|
+
type: [
|
|
548
|
+
Boolean,
|
|
549
|
+
Number,
|
|
550
|
+
String
|
|
551
|
+
],
|
|
552
|
+
required: false
|
|
553
|
+
},
|
|
554
|
+
color: {
|
|
555
|
+
type: [
|
|
556
|
+
String,
|
|
557
|
+
Object,
|
|
558
|
+
Boolean,
|
|
559
|
+
null
|
|
560
|
+
],
|
|
561
|
+
required: false,
|
|
562
|
+
skipCheck: true
|
|
563
|
+
},
|
|
564
|
+
bgColor: {
|
|
565
|
+
type: [
|
|
566
|
+
String,
|
|
567
|
+
Object,
|
|
568
|
+
Boolean,
|
|
569
|
+
null
|
|
570
|
+
],
|
|
571
|
+
required: false,
|
|
572
|
+
skipCheck: true
|
|
573
|
+
},
|
|
574
|
+
border: {
|
|
575
|
+
type: [
|
|
576
|
+
Boolean,
|
|
577
|
+
Number,
|
|
578
|
+
String,
|
|
579
|
+
Array
|
|
580
|
+
],
|
|
581
|
+
required: false,
|
|
582
|
+
skipCheck: true
|
|
583
|
+
},
|
|
584
|
+
borderTop: {
|
|
585
|
+
type: [
|
|
586
|
+
Boolean,
|
|
587
|
+
Number,
|
|
588
|
+
String
|
|
589
|
+
],
|
|
590
|
+
required: false
|
|
591
|
+
},
|
|
592
|
+
borderLeft: {
|
|
593
|
+
type: [
|
|
594
|
+
Boolean,
|
|
595
|
+
Number,
|
|
596
|
+
String
|
|
597
|
+
],
|
|
598
|
+
required: false
|
|
599
|
+
},
|
|
600
|
+
borderBottom: {
|
|
601
|
+
type: [
|
|
602
|
+
Boolean,
|
|
603
|
+
Number,
|
|
604
|
+
String
|
|
605
|
+
],
|
|
606
|
+
required: false
|
|
607
|
+
},
|
|
608
|
+
borderRight: {
|
|
609
|
+
type: [
|
|
610
|
+
Boolean,
|
|
611
|
+
Number,
|
|
612
|
+
String
|
|
613
|
+
],
|
|
614
|
+
required: false
|
|
615
|
+
},
|
|
616
|
+
borderBlock: {
|
|
617
|
+
type: [
|
|
618
|
+
Boolean,
|
|
619
|
+
Number,
|
|
620
|
+
String
|
|
621
|
+
],
|
|
622
|
+
required: false
|
|
623
|
+
},
|
|
624
|
+
borderInline: {
|
|
625
|
+
type: [
|
|
626
|
+
Boolean,
|
|
627
|
+
Number,
|
|
628
|
+
String
|
|
629
|
+
],
|
|
630
|
+
required: false
|
|
631
|
+
},
|
|
632
|
+
borderInlineStart: {
|
|
633
|
+
type: [
|
|
634
|
+
Boolean,
|
|
635
|
+
Number,
|
|
636
|
+
String
|
|
637
|
+
],
|
|
638
|
+
required: false
|
|
639
|
+
},
|
|
640
|
+
borderInlineEnd: {
|
|
641
|
+
type: [
|
|
642
|
+
Boolean,
|
|
643
|
+
Number,
|
|
644
|
+
String
|
|
645
|
+
],
|
|
646
|
+
required: false
|
|
647
|
+
},
|
|
648
|
+
borderBlockStart: {
|
|
649
|
+
type: [
|
|
650
|
+
Boolean,
|
|
651
|
+
Number,
|
|
652
|
+
String
|
|
653
|
+
],
|
|
654
|
+
required: false
|
|
655
|
+
},
|
|
656
|
+
borderBlockEnd: {
|
|
657
|
+
type: [
|
|
658
|
+
Boolean,
|
|
659
|
+
Number,
|
|
660
|
+
String
|
|
661
|
+
],
|
|
662
|
+
required: false
|
|
663
|
+
},
|
|
664
|
+
borderColor: {
|
|
665
|
+
type: String,
|
|
666
|
+
required: false
|
|
667
|
+
},
|
|
668
|
+
borderStyle: {
|
|
669
|
+
type: String,
|
|
670
|
+
required: false
|
|
671
|
+
},
|
|
672
|
+
borderTopColor: {
|
|
673
|
+
type: [
|
|
674
|
+
String,
|
|
675
|
+
Object,
|
|
676
|
+
Boolean,
|
|
677
|
+
null
|
|
678
|
+
],
|
|
679
|
+
required: false,
|
|
680
|
+
skipCheck: true
|
|
681
|
+
},
|
|
682
|
+
borderRightColor: {
|
|
683
|
+
type: [
|
|
684
|
+
String,
|
|
685
|
+
Object,
|
|
686
|
+
Boolean,
|
|
687
|
+
null
|
|
688
|
+
],
|
|
689
|
+
required: false,
|
|
690
|
+
skipCheck: true
|
|
691
|
+
},
|
|
692
|
+
borderBottomColor: {
|
|
693
|
+
type: [
|
|
694
|
+
String,
|
|
695
|
+
Object,
|
|
696
|
+
Boolean,
|
|
697
|
+
null
|
|
698
|
+
],
|
|
699
|
+
required: false,
|
|
700
|
+
skipCheck: true
|
|
701
|
+
},
|
|
702
|
+
borderLeftColor: {
|
|
703
|
+
type: [
|
|
704
|
+
String,
|
|
705
|
+
Object,
|
|
706
|
+
Boolean,
|
|
707
|
+
null
|
|
708
|
+
],
|
|
709
|
+
required: false,
|
|
710
|
+
skipCheck: true
|
|
711
|
+
},
|
|
712
|
+
borderInlineStartColor: {
|
|
713
|
+
type: [
|
|
714
|
+
String,
|
|
715
|
+
Object,
|
|
716
|
+
Boolean,
|
|
717
|
+
null
|
|
718
|
+
],
|
|
719
|
+
required: false,
|
|
720
|
+
skipCheck: true
|
|
721
|
+
},
|
|
722
|
+
borderInlineEndColor: {
|
|
723
|
+
type: [
|
|
724
|
+
String,
|
|
725
|
+
Object,
|
|
726
|
+
Boolean,
|
|
727
|
+
null
|
|
728
|
+
],
|
|
729
|
+
required: false,
|
|
730
|
+
skipCheck: true
|
|
731
|
+
},
|
|
732
|
+
borderBlockStartColor: {
|
|
733
|
+
type: [
|
|
734
|
+
String,
|
|
735
|
+
Object,
|
|
736
|
+
Boolean,
|
|
737
|
+
null
|
|
738
|
+
],
|
|
739
|
+
required: false,
|
|
740
|
+
skipCheck: true
|
|
741
|
+
},
|
|
742
|
+
borderBlockEndColor: {
|
|
743
|
+
type: [
|
|
744
|
+
String,
|
|
745
|
+
Object,
|
|
746
|
+
Boolean,
|
|
747
|
+
null
|
|
748
|
+
],
|
|
749
|
+
required: false,
|
|
750
|
+
skipCheck: true
|
|
751
|
+
},
|
|
752
|
+
elevation: {
|
|
753
|
+
type: [Number, String],
|
|
754
|
+
required: false
|
|
755
|
+
},
|
|
756
|
+
height: {
|
|
757
|
+
type: [Number, String],
|
|
758
|
+
required: false
|
|
759
|
+
},
|
|
760
|
+
maxHeight: {
|
|
761
|
+
type: [Number, String],
|
|
762
|
+
required: false
|
|
763
|
+
},
|
|
764
|
+
maxWidth: {
|
|
765
|
+
type: [Number, String],
|
|
766
|
+
required: false
|
|
767
|
+
},
|
|
768
|
+
minHeight: {
|
|
769
|
+
type: [Number, String],
|
|
770
|
+
required: false
|
|
771
|
+
},
|
|
772
|
+
minWidth: {
|
|
773
|
+
type: [Number, String],
|
|
774
|
+
required: false
|
|
775
|
+
},
|
|
776
|
+
width: {
|
|
777
|
+
type: [Number, String],
|
|
778
|
+
required: false
|
|
779
|
+
},
|
|
780
|
+
direction: {
|
|
781
|
+
type: null,
|
|
782
|
+
required: false
|
|
783
|
+
},
|
|
784
|
+
error: {
|
|
785
|
+
type: [String, Boolean],
|
|
786
|
+
required: false
|
|
787
|
+
},
|
|
788
|
+
errorMessages: {
|
|
789
|
+
type: [Array, String],
|
|
790
|
+
required: false
|
|
791
|
+
},
|
|
792
|
+
maxErrors: {
|
|
793
|
+
type: [Number, String],
|
|
794
|
+
required: false
|
|
795
|
+
},
|
|
796
|
+
rules: {
|
|
797
|
+
type: Array,
|
|
798
|
+
required: false
|
|
799
|
+
},
|
|
800
|
+
validateOn: {
|
|
801
|
+
type: null,
|
|
802
|
+
required: false
|
|
803
|
+
},
|
|
804
|
+
validationValue: {
|
|
805
|
+
type: null,
|
|
806
|
+
required: false
|
|
807
|
+
},
|
|
808
|
+
focused: {
|
|
809
|
+
type: Boolean,
|
|
810
|
+
required: false
|
|
811
|
+
},
|
|
812
|
+
appendAvatar: {
|
|
813
|
+
type: String,
|
|
814
|
+
required: false
|
|
815
|
+
},
|
|
816
|
+
appendIcon: {
|
|
817
|
+
type: null,
|
|
818
|
+
required: false
|
|
819
|
+
},
|
|
820
|
+
prependAvatar: {
|
|
821
|
+
type: String,
|
|
822
|
+
required: false
|
|
823
|
+
},
|
|
824
|
+
prependIcon: {
|
|
825
|
+
type: null,
|
|
826
|
+
required: false
|
|
827
|
+
},
|
|
828
|
+
prependAriaLabel: {
|
|
829
|
+
type: String,
|
|
830
|
+
required: false
|
|
831
|
+
},
|
|
832
|
+
appendAriaLabel: {
|
|
833
|
+
type: String,
|
|
834
|
+
required: false
|
|
835
|
+
},
|
|
836
|
+
size: {
|
|
837
|
+
type: null,
|
|
838
|
+
required: false,
|
|
839
|
+
default: SIZES.DEFAULT
|
|
840
|
+
},
|
|
841
|
+
fontSize: {
|
|
842
|
+
type: null,
|
|
843
|
+
required: false
|
|
844
|
+
},
|
|
845
|
+
fontWeight: {
|
|
846
|
+
type: null,
|
|
847
|
+
required: false
|
|
848
|
+
},
|
|
849
|
+
lineHeight: {
|
|
850
|
+
type: null,
|
|
851
|
+
required: false
|
|
852
|
+
},
|
|
853
|
+
ripple: {
|
|
854
|
+
type: [Boolean, Object],
|
|
855
|
+
required: false
|
|
856
|
+
},
|
|
857
|
+
tag: {
|
|
858
|
+
type: String,
|
|
859
|
+
required: false,
|
|
860
|
+
default: "div"
|
|
861
|
+
},
|
|
862
|
+
text: {
|
|
863
|
+
type: String,
|
|
864
|
+
required: false
|
|
865
|
+
},
|
|
866
|
+
floating: {
|
|
867
|
+
type: Boolean,
|
|
868
|
+
required: false
|
|
869
|
+
},
|
|
870
|
+
required: {
|
|
871
|
+
type: Boolean,
|
|
872
|
+
required: false
|
|
873
|
+
},
|
|
874
|
+
letterSpacing: {
|
|
875
|
+
type: null,
|
|
876
|
+
required: false
|
|
877
|
+
}
|
|
300
878
|
});
|
|
301
879
|
defineEmits(["update:modelValue"]);
|
|
302
880
|
defineSlots();
|
|
303
881
|
const { filterProps } = useProps(props);
|
|
882
|
+
/*********************************************************
|
|
883
|
+
* DOM refs
|
|
884
|
+
*
|
|
885
|
+
* @description
|
|
886
|
+
* Refs to sub-components for forward-prop delegation.
|
|
887
|
+
********************************************************/
|
|
304
888
|
const origamInputRef = ref();
|
|
305
889
|
const origamRatingFieldItemRef = ref();
|
|
890
|
+
/*********************************************************
|
|
891
|
+
* Value & model
|
|
892
|
+
*
|
|
893
|
+
* @description
|
|
894
|
+
* Slots, locale, v-model binding and attrs.
|
|
895
|
+
********************************************************/
|
|
306
896
|
const slots = useSlots();
|
|
307
897
|
const { t } = useLocale();
|
|
898
|
+
/*********************************************************
|
|
899
|
+
* Value
|
|
900
|
+
********************************************************/
|
|
308
901
|
const model = useVModel(props, "modelValue");
|
|
309
902
|
const attrs = useAttrs();
|
|
903
|
+
/*********************************************************
|
|
904
|
+
* Range & items
|
|
905
|
+
*
|
|
906
|
+
* @description
|
|
907
|
+
* Derived ranges, increments, item name and hover state
|
|
908
|
+
* for the rating items row.
|
|
909
|
+
********************************************************/
|
|
310
910
|
const normalizedValue = computed(() => {
|
|
311
|
-
|
|
911
|
+
return clamp(parseFloat(model.value), 0, +props.length);
|
|
312
912
|
});
|
|
313
913
|
const ranges = computed(() => {
|
|
314
|
-
|
|
914
|
+
return createRange(Number(props.length), 1);
|
|
315
915
|
});
|
|
316
916
|
const increments = computed(() => {
|
|
317
|
-
|
|
917
|
+
return ranges.value.flatMap((v) => props.halfIncrements ? [v - .5, v] : [v]);
|
|
318
918
|
});
|
|
319
919
|
const name = computed(() => {
|
|
320
|
-
|
|
920
|
+
return props.name ?? `origam-rating-${getUid()}`;
|
|
321
921
|
});
|
|
322
922
|
const hoverIndex = shallowRef(-1);
|
|
923
|
+
/*********************************************************
|
|
924
|
+
* Keyboard (#812)
|
|
925
|
+
*
|
|
926
|
+
* @description
|
|
927
|
+
* What the PLATFORM already does for a radio group sharing one `name`,
|
|
928
|
+
* measured in Chromium on a bare `<input type="radio">` group:
|
|
929
|
+
*
|
|
930
|
+
* Tab one stop for the whole group, entering on the
|
|
931
|
+
* checked radio (or the first when none is)
|
|
932
|
+
* Arrow{Right,Down} focus AND selection to the next, wrapping
|
|
933
|
+
* Arrow{Left,Up} focus AND selection to the previous, wrapping
|
|
934
|
+
* Space checks the focused radio when it is not already
|
|
935
|
+
* Home / End / Enter NOTHING — plain no-ops
|
|
936
|
+
*
|
|
937
|
+
* The first four lines are the WAI-ARIA roving-tabindex behaviour, written
|
|
938
|
+
* by the browser. They were unreachable only because every radio carried
|
|
939
|
+
* `tabindex="-1"`; dropping it is the whole navigation fix. So this handler
|
|
940
|
+
* implements strictly the remainder:
|
|
941
|
+
*
|
|
942
|
+
* - `Home` / `End`, which the pattern asks for and the platform omits;
|
|
943
|
+
* - cancelling the native default while `readonly`, so the group stays
|
|
944
|
+
* REACHABLE and announced instead of being dropped out of the tab
|
|
945
|
+
* order (arrows are cancelable — verified: with `preventDefault()`,
|
|
946
|
+
* focus and `:checked` both stayed put).
|
|
947
|
+
*
|
|
948
|
+
* `Enter` is left as the no-op it natively is. The radiogroup pattern
|
|
949
|
+
* assigns it no role, and claiming it here would break form submission for
|
|
950
|
+
* a consumer who put the field in a `<form>`.
|
|
951
|
+
*
|
|
952
|
+
* `focus()` then `click()`, in that order and both needed: a scripted
|
|
953
|
+
* `.click()` fires `change` but does NOT move focus (measured), and a bare
|
|
954
|
+
* `focus()` on a radio changes no selection.
|
|
955
|
+
********************************************************/
|
|
323
956
|
const handleKeydown = (e) => {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
957
|
+
if (props.disabled || props.readonly) {
|
|
958
|
+
if (RATING_FIELD_MUTATING_KEYS.includes(e.key)) e.preventDefault();
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (e.key !== KEYBOARD_VALUES.HOME && e.key !== KEYBOARD_VALUES.END) return;
|
|
962
|
+
const group = e.target?.closest(RATING_FIELD_ROOT_SELECTOR);
|
|
963
|
+
if (!group) return;
|
|
964
|
+
const radios = Array.from(group.querySelectorAll(RATING_FIELD_ENABLED_RADIO_SELECTOR));
|
|
965
|
+
if (!radios.length) return;
|
|
966
|
+
e.preventDefault();
|
|
967
|
+
const target = e.key === KEYBOARD_VALUES.HOME ? radios[0] : radios[radios.length - 1];
|
|
968
|
+
target.focus();
|
|
969
|
+
if (!target.checked) target.click();
|
|
337
970
|
};
|
|
338
971
|
const itemState = computed(() => {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
972
|
+
return increments.value.map((value) => {
|
|
973
|
+
const isFilled = normalizedValue.value >= value;
|
|
974
|
+
const isHovered = hoverIndex.value >= value;
|
|
975
|
+
const isHovering = props.hover && hoverIndex.value > -1;
|
|
976
|
+
const ratingFieldItemProps = origamRatingFieldItemRef.value?.filterProps(props, [
|
|
977
|
+
"class",
|
|
978
|
+
"style",
|
|
979
|
+
"id",
|
|
980
|
+
"name"
|
|
981
|
+
]);
|
|
982
|
+
return {
|
|
983
|
+
isFilled,
|
|
984
|
+
isHovered,
|
|
985
|
+
isHovering,
|
|
986
|
+
name: name.value,
|
|
987
|
+
...ratingFieldItemProps
|
|
988
|
+
};
|
|
989
|
+
});
|
|
346
990
|
});
|
|
347
991
|
const eventState = computed(() => {
|
|
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
|
-
|
|
992
|
+
return [0, ...increments.value].map((value) => {
|
|
993
|
+
const onMouseenter = () => {
|
|
994
|
+
hoverIndex.value = value;
|
|
995
|
+
};
|
|
996
|
+
const onMouseleave = () => {
|
|
997
|
+
hoverIndex.value = -1;
|
|
998
|
+
};
|
|
999
|
+
const onClick = (e) => {
|
|
1000
|
+
if (!props.disabled && !props.readonly) {
|
|
1001
|
+
model.value = normalizedValue.value === value && props.clearable ? 0 : value;
|
|
1002
|
+
}
|
|
1003
|
+
nextTick(() => resyncRadios(e?.target));
|
|
1004
|
+
};
|
|
1005
|
+
/*********************************************************
|
|
1006
|
+
* onChange — the keyboard's ONLY signal
|
|
1007
|
+
*
|
|
1008
|
+
* @description
|
|
1009
|
+
* `onClick` above is wired to the star `<div>`; the browser's radio
|
|
1010
|
+
* navigation never goes through it. Arrows and `Space` fire `click`
|
|
1011
|
+
* + `change` on the `<input>` that just became checked, and nothing
|
|
1012
|
+
* was listening — the DOM moved, the model did not.
|
|
1013
|
+
*
|
|
1014
|
+
* @description
|
|
1015
|
+
* ⛔ No `clearable` toggle here, deliberately: a `change` only fires
|
|
1016
|
+
* when the checked radio ACTUALLY changes, so "re-select the current
|
|
1017
|
+
* value to clear it" has no keyboard equivalent to hook. The clear
|
|
1018
|
+
* affordance stays the `__clear` button.
|
|
1019
|
+
********************************************************/
|
|
1020
|
+
const onChange = (e) => {
|
|
1021
|
+
if (!props.disabled && !props.readonly) {
|
|
1022
|
+
model.value = value;
|
|
1023
|
+
}
|
|
1024
|
+
nextTick(() => resyncRadios(e?.target));
|
|
1025
|
+
};
|
|
1026
|
+
return {
|
|
1027
|
+
onMouseenter: props.hover ? onMouseenter : undefined,
|
|
1028
|
+
onMouseleave: props.hover ? onMouseleave : undefined,
|
|
1029
|
+
onClick,
|
|
1030
|
+
onChange,
|
|
1031
|
+
onKeydown: handleKeydown
|
|
1032
|
+
};
|
|
1033
|
+
});
|
|
375
1034
|
});
|
|
376
1035
|
const isChecked = (value) => {
|
|
377
|
-
|
|
1036
|
+
return normalizedValue.value === value;
|
|
378
1037
|
};
|
|
1038
|
+
/*********************************************************
|
|
1039
|
+
* resyncRadios (#827)
|
|
1040
|
+
*
|
|
1041
|
+
* @description
|
|
1042
|
+
* A CONTROLLED input must show only what the model says — nothing else.
|
|
1043
|
+
* Under this radiogroup, the browser is the one that flips `.checked`:
|
|
1044
|
+
* clicking a label, or the native arrow/Home/End navigation, sets the DOM
|
|
1045
|
+
* property directly on the radios it touches, `change` fires, and only
|
|
1046
|
+
* THEN does our handler run `model.value = value`. Two independent DOM
|
|
1047
|
+
* radios move on a single interaction — the one that becomes checked AND,
|
|
1048
|
+
* because they share one `name`, the sibling the browser un-checks at the
|
|
1049
|
+
* same time — while Vue's own patch only re-touches a `checked` binding
|
|
1050
|
+
* whose COMPUTED VALUE differs from the previous render.
|
|
1051
|
+
*
|
|
1052
|
+
* @description
|
|
1053
|
+
* When the parent accepts the new value, that computed value does differ
|
|
1054
|
+
* next render and Vue's normal patch already lines the DOM back up — this
|
|
1055
|
+
* function is then a no-op. When the parent silently refuses it (never
|
|
1056
|
+
* writes `modelValue` back), `isChecked(...)` returns the exact same
|
|
1057
|
+
* booleans as before for every item, Vue sees no prop change and never
|
|
1058
|
+
* revisits `checked` on either radio, and the browser's own mutation is
|
|
1059
|
+
* left standing indefinitely. Measured in Chromium (built Histoire, the
|
|
1060
|
+
* "Default" playground variant, `v-bind="state"` with no
|
|
1061
|
+
* `state.modelValue = $event`): clicking star 1 while the model holds 3
|
|
1062
|
+
* left `{value:"1",checked:true}` AND `{value:"3",checked:false}` in the
|
|
1063
|
+
* DOM — both wrong, only one of them the radio the click landed on.
|
|
1064
|
+
*
|
|
1065
|
+
* @description
|
|
1066
|
+
* `nextTick` is required, not optional: reading `model.value` (hence
|
|
1067
|
+
* `isChecked`) synchronously right after emitting `update:modelValue`
|
|
1068
|
+
* still sees the PRE-update props — a parent that accepts the value only
|
|
1069
|
+
* applies it once Vue flushes its render queue, and `props[prop]` here
|
|
1070
|
+
* only reflects that after the same flush. Deferring to `nextTick` lets
|
|
1071
|
+
* that queue drain (Vue's own patch included) before this reads the
|
|
1072
|
+
* settled state and reasserts it on every radio in the group — the
|
|
1073
|
+
* "accepts" and "refuses" cases end up going through the exact same code
|
|
1074
|
+
* path, which is what keeps this a correction rather than a bespoke
|
|
1075
|
+
* branch per outcome.
|
|
1076
|
+
********************************************************/
|
|
379
1077
|
const resyncRadios = (source) => {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
1078
|
+
const group = source?.closest(RATING_FIELD_ROOT_SELECTOR);
|
|
1079
|
+
if (!group) return;
|
|
1080
|
+
group.querySelectorAll("input[type=\"radio\"]").forEach((radio) => {
|
|
1081
|
+
const shouldBeChecked = isChecked(parseFloat(radio.value));
|
|
1082
|
+
if (radio.checked !== shouldBeChecked) radio.checked = shouldBeChecked;
|
|
1083
|
+
});
|
|
386
1084
|
};
|
|
1085
|
+
/*********************************************************
|
|
1086
|
+
* Label position
|
|
1087
|
+
*
|
|
1088
|
+
* @description
|
|
1089
|
+
* Whether item labels appear above or below the star row.
|
|
1090
|
+
********************************************************/
|
|
387
1091
|
const hasLabels = computed(() => {
|
|
388
|
-
|
|
1092
|
+
return !!props.itemLabels?.length || slots.itemLabel;
|
|
389
1093
|
});
|
|
390
1094
|
const labelOnTop = computed(() => {
|
|
391
|
-
|
|
1095
|
+
return props.itemLabelPosition === BLOCK.TOP;
|
|
392
1096
|
});
|
|
393
1097
|
const labelOnBottom = computed(() => {
|
|
394
|
-
|
|
1098
|
+
return props.itemLabelPosition === BLOCK.BOTTOM;
|
|
395
1099
|
});
|
|
1100
|
+
/*********************************************************
|
|
1101
|
+
* Forwarded props
|
|
1102
|
+
*
|
|
1103
|
+
* @description
|
|
1104
|
+
* Attrs split between root and control; props forwarded to
|
|
1105
|
+
* Input sub-component via filterProps.
|
|
1106
|
+
********************************************************/
|
|
396
1107
|
const [rootAttrs, _controlAttrs] = filterInputAttrs(attrs);
|
|
397
1108
|
const inputProps = computed(() => {
|
|
398
|
-
|
|
1109
|
+
return origamInputRef.value?.filterProps(props, [
|
|
1110
|
+
"class",
|
|
1111
|
+
"style",
|
|
1112
|
+
"modelValue",
|
|
1113
|
+
"id",
|
|
1114
|
+
"focused"
|
|
1115
|
+
]);
|
|
399
1116
|
});
|
|
1117
|
+
/*********************************************************
|
|
1118
|
+
* Class & Style
|
|
1119
|
+
*
|
|
1120
|
+
* @description
|
|
1121
|
+
* ratingFieldStyles and ratingFieldClasses compose the BEM block.
|
|
1122
|
+
********************************************************/
|
|
400
1123
|
const ratingFieldStyles = computed(() => {
|
|
401
|
-
|
|
402
|
-
props.style
|
|
403
|
-
];
|
|
1124
|
+
return [props.style];
|
|
404
1125
|
});
|
|
405
1126
|
const ratingFieldClasses = computed(() => {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
1127
|
+
return [
|
|
1128
|
+
"origam-rating-field",
|
|
1129
|
+
{
|
|
1130
|
+
"origam-rating-field--hover": props.hover,
|
|
1131
|
+
"origam-rating-field--readonly": props.readonly
|
|
1132
|
+
},
|
|
1133
|
+
props.class
|
|
1134
|
+
];
|
|
414
1135
|
});
|
|
1136
|
+
/*********************************************************
|
|
1137
|
+
* useStyle
|
|
1138
|
+
*
|
|
1139
|
+
* @description
|
|
1140
|
+
* #381 — the `id` returned by useStyle is a GENERATED identifier,
|
|
1141
|
+
* only meant for the scoped stylesheet selector. Without
|
|
1142
|
+
* `() => props.id` here, it shadowed the `id` PROP of the same
|
|
1143
|
+
* name: the template's `:id="id"` on <origam-input> (line 3)
|
|
1144
|
+
* rendered the generated id, never the consumer's.
|
|
1145
|
+
********************************************************/
|
|
415
1146
|
const { id, css, load, isLoaded, unload } = useStyle(ratingFieldStyles, () => props.id);
|
|
1147
|
+
/*********************************************************
|
|
1148
|
+
* Group naming (#810)
|
|
1149
|
+
*
|
|
1150
|
+
* @description
|
|
1151
|
+
* This component used to render `<origam-label :for="id">`. That `for`
|
|
1152
|
+
* RESOLVED TO NOTHING — measured in Chromium against the built
|
|
1153
|
+
* Histoire, on the story's own "Default" variant and with no consumer
|
|
1154
|
+
* `id` at all: `for="origam-rating-field-v-2"`,
|
|
1155
|
+
* `document.getElementById(...)` → `null`. The id the Input exposes to
|
|
1156
|
+
* its `#default` slot lands on `…-messages`, never on an element the
|
|
1157
|
+
* `for` could reach.
|
|
1158
|
+
*
|
|
1159
|
+
* ⛔ Making `OrigamInput` honour that id would have been WORSE, not
|
|
1160
|
+
* better: the Input root is a `<div>`, which is not a labelable
|
|
1161
|
+
* element, so the `for` would have started "resolving" while a screen
|
|
1162
|
+
* reader still announced nothing. A detectable orphan would have become
|
|
1163
|
+
* an undetectable dead relation.
|
|
1164
|
+
*
|
|
1165
|
+
* So the label no longer labels a single control — it names the GROUP,
|
|
1166
|
+
* which is what a rating actually is (WAI-ARIA radiogroup pattern). The
|
|
1167
|
+
* `aria-labelledby` target is the WRAPPER `div`, not the `<origam-label>`
|
|
1168
|
+
* inside it, so a consumer overriding the `label` slot still gets a named
|
|
1169
|
+
* group. The `<origam-label>` renders as a `span`: a bare `<label>` with
|
|
1170
|
+
* no associated control would be exactly the dangling relation this
|
|
1171
|
+
* change removes.
|
|
1172
|
+
*
|
|
1173
|
+
* The name is only claimed when there IS one. Pointing `aria-labelledby`
|
|
1174
|
+
* at an empty wrapper would reproduce the defect in a new form, and
|
|
1175
|
+
* fabricating a fallback string is explicitly rejected in this DS
|
|
1176
|
+
* (#622 — a guessed name silences the audit tool and tells the user
|
|
1177
|
+
* nothing).
|
|
1178
|
+
********************************************************/
|
|
416
1179
|
const groupLabelId = computed(() => `${id.value}-label`);
|
|
417
1180
|
const groupLabelledBy = computed(() => {
|
|
418
|
-
|
|
1181
|
+
return props.label || slots.label ? groupLabelId.value : undefined;
|
|
419
1182
|
});
|
|
1183
|
+
/*********************************************************
|
|
1184
|
+
* Expose
|
|
1185
|
+
*
|
|
1186
|
+
* @description
|
|
1187
|
+
* Exposes filterProps to parent ref consumers.
|
|
1188
|
+
********************************************************/
|
|
420
1189
|
defineExpose({
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
1190
|
+
filterProps,
|
|
1191
|
+
css,
|
|
1192
|
+
id,
|
|
1193
|
+
load,
|
|
1194
|
+
unload,
|
|
1195
|
+
isLoaded
|
|
427
1196
|
});
|
|
428
1197
|
</script>
|
|
429
1198
|
|