ropav 0.1.6 → 0.1.8
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/README.md +7 -1
- package/dist/accordion.css +17 -17
- package/dist/accordion.js +123 -155
- package/dist/alert.css +18 -18
- package/dist/alert.js +10 -11
- package/dist/ancestry.js +136 -0
- package/dist/aria.js +14 -0
- package/dist/aspect-ratio.js +1 -1
- package/dist/attributes.js +9 -0
- package/dist/attributes2.js +29 -0
- package/dist/avatar.css +19 -19
- package/dist/avatar.js +9 -17
- package/dist/badge.css +16 -16
- package/dist/badge.js +5 -5
- package/dist/button-group.js +1 -1
- package/dist/button-link.js +4 -3
- package/dist/button.js +4 -3
- package/dist/button.scss_vue_type_style_index_0_src_true_lang.js +1 -1
- package/dist/calendar.css +173 -0
- package/dist/calendar.js +714 -0
- package/dist/calendar2.js +37 -0
- package/dist/card.js +1 -1
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +22 -28
- package/dist/chevron-left.js +12 -0
- package/dist/collapse.css +6 -6
- package/dist/collapse.js +7 -6
- package/dist/collectionNavigation.js +2 -99
- package/dist/color-input.css +19 -19
- package/dist/color-input.js +14 -13
- package/dist/color-picker.css +40 -40
- package/dist/color-picker.js +247 -276
- package/dist/color-picker2.js +1 -9
- package/dist/color-swatch.css +4 -4
- package/dist/color-swatch.js +6 -8
- package/dist/color.js +5 -10
- package/dist/combobox.css +251 -0
- package/dist/combobox.js +410 -0
- package/dist/componentColors.js +125 -84
- package/dist/componentRef.js +26 -0
- package/dist/components/accordion/accordionContext.d.ts +3 -0
- package/dist/components/accordion/accordionModel.d.ts +14 -0
- package/dist/components/accordion/index.d.ts +2 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/types.d.ts +1 -2
- package/dist/components/accordion/useAccordion.d.ts +2 -2
- package/dist/components/accordion/useAccordionItem.d.ts +2 -0
- package/dist/components/calendar/calendar.d.ts +30 -0
- package/dist/components/calendar/calendarBehavior.d.ts +49 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.js +3 -0
- package/dist/components/calendar/types.d.ts +53 -0
- package/dist/components/calendar/useCalendar.d.ts +24 -0
- package/dist/components/checkbox/useCheckbox.d.ts +1 -2
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/types.d.ts +2 -2
- package/dist/components/color-picker/useColorPickerDrag.d.ts +1 -1
- package/dist/components/color-picker/useColorPickerSaturation.d.ts +22 -0
- package/dist/components/color-picker/useColorPickerSlider.d.ts +20 -0
- package/dist/components/color-picker/useColorPickerValue.d.ts +1 -1
- package/dist/components/combobox/combobox.d.ts +29 -0
- package/dist/components/combobox/comboboxModel.d.ts +4 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/combobox/types.d.ts +43 -0
- package/dist/components/combobox/useCombobox.d.ts +45 -0
- package/dist/components/date-picker/date-picker.d.ts +33 -0
- package/dist/components/date-picker/datePickerModel.d.ts +10 -0
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-picker/types.d.ts +57 -0
- package/dist/components/date-picker/useDatePicker.d.ts +29 -0
- package/dist/components/date-picker/useDatePickerValueState.d.ts +21 -0
- package/dist/components/dialog/{dialog-core.d.ts → dialogContext.d.ts} +1 -5
- package/dist/components/dialog/useDialogContentInteractions.d.ts +18 -0
- package/dist/components/dialog/useDialogRootState.d.ts +19 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-model.d.ts +8 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu/{dropdown-menu-primitive-core.d.ts → dropdownMenuContext.d.ts} +17 -30
- package/dist/components/dropdown-menu/dropdownMenuDataModel.d.ts +20 -0
- package/dist/components/dropdown-menu/dropdownMenuInteraction.d.ts +3 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionNavigation.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionRegistry.d.ts +42 -0
- package/dist/components/dropdown-menu/dropdownMenuInteractionTypes.d.ts +114 -0
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +11 -11
- package/dist/components/dropdown-menu/useDropdownMenuContextTrigger.d.ts +9 -0
- package/dist/components/dropdown-menu/useDropdownMenuDataController.d.ts +35 -0
- package/dist/components/dropdown-menu/useDropdownMenuDataRegistration.d.ts +24 -0
- package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +6 -5
- package/dist/components/dropdown-menu/useDropdownMenuInteractionDismissal.d.ts +17 -0
- package/dist/components/dropdown-menu/useDropdownMenuInteractionKeyboard.d.ts +19 -0
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +0 -1
- package/dist/components/dropdown-menu/useDropdownMenuPresentation.d.ts +28 -0
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +2 -2
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +1 -1
- package/dist/components/dropdown-menu/useDropdownMenuTargetBindings.d.ts +19 -0
- package/dist/components/dropzone/dropzone.d.ts +31 -0
- package/dist/components/dropzone/dropzoneModel.d.ts +16 -0
- package/dist/components/dropzone/index.d.ts +3 -0
- package/dist/components/dropzone/index.js +2 -0
- package/dist/components/dropzone/types.d.ts +56 -0
- package/dist/components/dropzone/useDropzone.d.ts +25 -0
- package/dist/components/file-input/file-input.d.ts +29 -0
- package/dist/components/file-input/index.d.ts +3 -0
- package/dist/components/file-input/index.js +2 -0
- package/dist/components/file-input/types.d.ts +37 -0
- package/dist/components/file-input/useFileInput.d.ts +15 -0
- package/dist/components/floating/index.js +2 -2
- package/dist/components/floating/useFloatingPosition.d.ts +1 -14
- package/dist/components/floating/useFloatingTargetLifecycle.d.ts +32 -0
- package/dist/components/floating/useHoverDisclosure.d.ts +10 -0
- package/dist/components/hover-card/hover-card.d.ts +25 -0
- package/dist/components/hover-card/index.d.ts +3 -0
- package/dist/components/hover-card/index.js +2 -0
- package/dist/components/hover-card/types.d.ts +45 -0
- package/dist/components/hover-card/useHoverCard.d.ts +22 -0
- package/dist/components/hover-card/useHoverCardDisclosure.d.ts +19 -0
- package/dist/components/multi-select/index.d.ts +3 -0
- package/dist/components/multi-select/index.js +2 -0
- package/dist/components/multi-select/multi-select.d.ts +30 -0
- package/dist/components/multi-select/multiSelectModel.d.ts +3 -0
- package/dist/components/multi-select/types.d.ts +49 -0
- package/dist/components/multi-select/useMultiSelect.d.ts +46 -0
- package/dist/components/number-input/numberInputModel.d.ts +15 -0
- package/dist/components/number-input/useNumberInput.d.ts +3 -19
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/paginationModel.d.ts +4 -0
- package/dist/components/pagination/types.d.ts +15 -0
- package/dist/components/pagination/usePagination.d.ts +3 -19
- package/dist/components/popover/usePopoverBindings.d.ts +13 -0
- package/dist/components/progress/progressModel.d.ts +8 -0
- package/dist/components/progress/useProgress.d.ts +0 -6
- package/dist/components/radio/useRadio.d.ts +1 -2
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/scrollAreaModel.d.ts +64 -0
- package/dist/components/scroll-area/useScrollArea.d.ts +70 -53
- package/dist/components/scroll-area/{useScrollAreaPresentation.d.ts → useScrollAreaAttributes.d.ts} +37 -17
- package/dist/components/scroll-area/useScrollAreaDerivedState.d.ts +8 -0
- package/dist/components/scroll-area/useScrollAreaMeasurement.d.ts +35 -0
- package/dist/components/scroll-area/useScrollAreaPointer.d.ts +11 -9
- package/dist/components/scroll-area/useScrollAreaVisibility.d.ts +15 -20
- package/dist/components/segmented-control/index.d.ts +3 -0
- package/dist/components/segmented-control/index.js +2 -0
- package/dist/components/segmented-control/segmented-control.d.ts +26 -0
- package/dist/components/segmented-control/types.d.ts +47 -0
- package/dist/components/segmented-control/useSegmentedControl.d.ts +15 -0
- package/dist/components/select/useSelect.d.ts +31 -19
- package/dist/components/slider/rangeSliderModel.d.ts +41 -0
- package/dist/components/slider/{sliderCore.d.ts → sliderModel.d.ts} +0 -1
- package/dist/components/slider/useRangeSlider.d.ts +9 -17
- package/dist/components/slider/useRangeSliderPointer.d.ts +1 -1
- package/dist/components/slider/useRangeSliderValueState.d.ts +40 -0
- package/dist/components/slider/useSlider.d.ts +7 -13
- package/dist/components/slider/useSliderPointerPreview.d.ts +22 -0
- package/dist/components/slider/useSliderTooltipState.d.ts +40 -0
- package/dist/components/slider/useSliderValueState.d.ts +33 -0
- package/dist/components/tags-input/index.d.ts +3 -0
- package/dist/components/tags-input/index.js +2 -0
- package/dist/components/tags-input/tags-input.d.ts +27 -0
- package/dist/components/tags-input/tagsInputModel.d.ts +12 -0
- package/dist/components/tags-input/types.d.ts +37 -0
- package/dist/components/tags-input/useTagsInput.d.ts +23 -0
- package/dist/components/teleport-provider/index.js +1 -1
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +1 -2
- package/dist/components/toast/useToastLifecycle.d.ts +19 -0
- package/dist/components/tooltip/useTooltip.d.ts +1 -2
- package/dist/components/tooltip/useTooltipTargetBindings.d.ts +12 -0
- package/dist/css.js +12 -0
- package/dist/date-picker.css +49 -0
- package/dist/date-picker.js +809 -0
- package/dist/dialog.js +215 -218
- package/dist/direction.js +6 -0
- package/dist/dropdown-menu.css +21 -3
- package/dist/dropdown-menu.js +1626 -1185
- package/dist/dropzone.css +135 -0
- package/dist/dropzone.js +431 -0
- package/dist/events.js +59 -0
- package/dist/field.css +8 -8
- package/dist/field.js +13 -25
- package/dist/file-input.css +135 -0
- package/dist/file-input.js +198 -0
- package/dist/floatingOffset.js +11 -0
- package/dist/focus-trap.js +7 -5
- package/dist/focusNavigation.js +37 -0
- package/dist/hover-card.css +80 -0
- package/dist/hover-card.js +402 -0
- package/dist/icon-button.css +8 -8
- package/dist/icon-button.js +7 -6
- package/dist/index.d.ts +9 -0
- package/dist/index.js +20 -9
- package/dist/input.css +24 -24
- package/dist/input.js +19 -31
- package/dist/interactive.js +18 -0
- package/dist/internal/composables/useOverlayLayer.d.ts +12 -0
- package/dist/modal.js +2 -2
- package/dist/multi-select.css +316 -0
- package/dist/multi-select.js +481 -0
- package/dist/nativeChoice.js +169 -0
- package/dist/number-input.css +18 -18
- package/dist/number-input.js +44 -44
- package/dist/number.js +22 -0
- package/dist/overlay.js +3 -2
- package/dist/pagination.css +28 -28
- package/dist/pagination.js +66 -73
- package/dist/pointerSession.js +130 -0
- package/dist/popover.css +55 -37
- package/dist/popover.js +75 -101
- package/dist/progress.js +10 -13
- package/dist/query.js +40 -0
- package/dist/radio.css +18 -18
- package/dist/radio.js +30 -36
- package/dist/rafScheduler.js +34 -0
- package/dist/scroll-area.css +28 -28
- package/dist/scroll-area.js +540 -554
- package/dist/segmented-control.css +176 -0
- package/dist/segmented-control.js +382 -0
- package/dist/select.css +50 -48
- package/dist/select.js +131 -289
- package/dist/slider.css +191 -191
- package/dist/slider.js +720 -706
- package/dist/styles-api.d.ts +0 -1
- package/dist/styles-api.js +1 -4
- package/dist/switch.css +17 -17
- package/dist/switch.js +14 -15
- package/dist/tabs.css +43 -43
- package/dist/tabs.js +29 -56
- package/dist/tags-input.css +197 -0
- package/dist/tags-input.js +380 -0
- package/dist/text.js +17 -0
- package/dist/textarea.css +26 -26
- package/dist/textarea.js +21 -32
- package/dist/toast.css +26 -26
- package/dist/toast.js +141 -118
- package/dist/tooltip.css +12 -12
- package/dist/tooltip.js +64 -63
- package/dist/useCollapse.js +8 -11
- package/dist/useControlState.js +3 -6
- package/dist/useEditableOptionList.js +216 -0
- package/dist/useFlatOptionCollection.js +134 -0
- package/dist/useFloatingPosition.js +14 -40
- package/dist/useFloatingTargetLifecycle.js +127 -0
- package/dist/useFormControl.js +1 -0
- package/dist/useHoverDisclosure.js +561 -0
- package/dist/useNativeChoiceTransaction.js +46 -0
- package/dist/useNativeFileSelection.js +86 -0
- package/dist/useOverlayZIndex.js +246 -19
- package/dist/useTeleportTarget.js +3 -14
- package/dist/useTypeahead.js +94 -0
- package/dist/utils/aria.d.ts +3 -0
- package/dist/utils/attributes.d.ts +2 -0
- package/dist/utils/bem.d.ts +3 -0
- package/dist/utils/collectionNavigation.d.ts +2 -0
- package/dist/utils/color.d.ts +7 -0
- package/dist/{components/color-picker/color-picker-utils.d.ts → utils/colorPicker.d.ts} +5 -4
- package/dist/utils/componentColors.d.ts +7 -0
- package/dist/utils/css.d.ts +3 -0
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/dateAvailability.d.ts +7 -0
- package/dist/utils/dom/ancestry.d.ts +8 -0
- package/dist/utils/dom/attributes.d.ts +16 -0
- package/dist/utils/dom/componentRef.d.ts +4 -0
- package/dist/utils/dom/direction.d.ts +2 -0
- package/dist/utils/dom/events.d.ts +5 -0
- package/dist/utils/dom/files.d.ts +3 -0
- package/dist/utils/dom/focusNavigation.d.ts +7 -0
- package/dist/utils/dom/interactive.d.ts +2 -0
- package/dist/utils/dom/nativeChoice.d.ts +17 -0
- package/dist/utils/dom/pointerSession.d.ts +20 -0
- package/dist/utils/dom/query.d.ts +4 -0
- package/dist/utils/dom/scroll.d.ts +24 -0
- package/dist/utils/floatingOffset.d.ts +10 -0
- package/dist/utils/geometry.d.ts +14 -0
- package/dist/utils/indexPath.d.ts +6 -0
- package/dist/utils/number.d.ts +4 -0
- package/dist/utils/optionFilter.d.ts +5 -0
- package/dist/utils/rafScheduler.d.ts +4 -0
- package/dist/utils/text.d.ts +2 -0
- package/docs/code-architecture.md +118 -0
- package/docs/public-floating-api.md +13 -9
- package/docs/public-styles-api.md +25 -12
- package/package.json +51 -14
- package/src/styles/_mixins.scss +26 -0
- package/src/styles/styles-manifest.json +1 -2
- package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +0 -3
- package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +0 -21
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +0 -36
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +0 -29
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +0 -52
- package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +0 -17
- package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +0 -18
- package/dist/components/scroll-area/scrollAreaCore.d.ts +0 -30
- package/dist/components/scroll-area/useScrollAreaControls.d.ts +0 -25
- package/dist/components/scroll-area/useScrollAreaMetrics.d.ts +0 -38
- package/dist/components/select/useSelectNativeControl.d.ts +0 -9
- package/dist/components/select/useSelectNativeValue.d.ts +0 -9
- package/dist/floating.js +0 -415
- /package/dist/components/alert/{useAlertColor.d.ts → alertColor.d.ts} +0 -0
- /package/dist/components/avatar/{useAvatarColor.d.ts → avatarColor.d.ts} +0 -0
- /package/dist/components/badge/{useBadgeColor.d.ts → badgeColor.d.ts} +0 -0
- /package/dist/components/button/{useButtonColor.d.ts → buttonColor.d.ts} +0 -0
- /package/dist/components/color-swatch/{useColorSwatchColor.d.ts → colorSwatchColor.d.ts} +0 -0
- /package/dist/components/toast/{useToastColor.d.ts → toastColor.d.ts} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
@layer ropav.components {
|
|
2
|
+
.rp-segmented-control[data-v-aba56e2a] {
|
|
3
|
+
--_rp-segmented-control-color: var(--rp-color-control-selected-bg);
|
|
4
|
+
--_rp-segmented-control-on-color: var(--rp-color-control-selected-fg);
|
|
5
|
+
--_rp-segmented-control-height: var(--rp-size-control-md);
|
|
6
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-md) / 3);
|
|
7
|
+
--_rp-segmented-control-gap: var(--rp-spacing-2);
|
|
8
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-md);
|
|
9
|
+
--_rp-segmented-control-radius: var(--rp-radius-sm);
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
padding: 2px;
|
|
14
|
+
color: var(--rp-color-control-fg);
|
|
15
|
+
font-family: var(--rp-font-family);
|
|
16
|
+
font-size: var(--_rp-segmented-control-font-size);
|
|
17
|
+
line-height: 1;
|
|
18
|
+
background-color: var(--rp-color-control-track-bg);
|
|
19
|
+
border: var(--rp-border-width-thin) solid transparent;
|
|
20
|
+
border-radius: var(--_rp-segmented-control-radius);
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
.rp-segmented-control__control[data-v-aba56e2a] {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: stretch;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
min-height: var(--_rp-segmented-control-height);
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
.rp-segmented-control__input[data-v-aba56e2a] {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: 1px;
|
|
36
|
+
height: 1px;
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: -1px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
clip: rect(0, 0, 0, 0);
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
border-width: 0;
|
|
43
|
+
}
|
|
44
|
+
.rp-segmented-control__indicator[data-v-aba56e2a] {
|
|
45
|
+
position: absolute;
|
|
46
|
+
z-index: 0;
|
|
47
|
+
inset: 0;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
border-radius: var(--_rp-segmented-control-radius);
|
|
50
|
+
box-shadow: none;
|
|
51
|
+
transition: background-color var(--rp-transition-fast), box-shadow var(--rp-transition-fast);
|
|
52
|
+
}
|
|
53
|
+
.rp-segmented-control__label[data-v-aba56e2a] {
|
|
54
|
+
position: relative;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
width: 100%;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
padding-inline: var(--_rp-segmented-control-padding-x);
|
|
62
|
+
gap: var(--_rp-segmented-control-gap);
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
text-align: center;
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
transition: color var(--rp-transition-fast);
|
|
67
|
+
white-space: nowrap;
|
|
68
|
+
}
|
|
69
|
+
.rp-segmented-control__label[data-v-aba56e2a] svg {
|
|
70
|
+
width: 1em;
|
|
71
|
+
height: 1em;
|
|
72
|
+
flex: 0 0 auto;
|
|
73
|
+
}
|
|
74
|
+
.rp-segmented-control__control:hover:not(.rp-segmented-control__control--disabled) .rp-segmented-control__indicator[data-v-aba56e2a] {
|
|
75
|
+
background-color: color-mix(in srgb, var(--rp-color-body) 55%, transparent);
|
|
76
|
+
}
|
|
77
|
+
.rp-segmented-control__control--selected .rp-segmented-control__indicator[data-v-aba56e2a], .rp-segmented-control__control--selected:hover:not(.rp-segmented-control__control--disabled) .rp-segmented-control__indicator[data-v-aba56e2a] {
|
|
78
|
+
background-color: var(--_rp-segmented-control-color);
|
|
79
|
+
box-shadow: var(--rp-shadow-sm);
|
|
80
|
+
}
|
|
81
|
+
.rp-segmented-control__control--selected .rp-segmented-control__label[data-v-aba56e2a] {
|
|
82
|
+
color: var(--_rp-segmented-control-on-color);
|
|
83
|
+
font-weight: var(--rp-font-weight-medium);
|
|
84
|
+
}
|
|
85
|
+
.rp-segmented-control__input:focus-visible + .rp-segmented-control__indicator[data-v-aba56e2a] {
|
|
86
|
+
outline: none;
|
|
87
|
+
border-color: var(--rp-color-control-border-focus);
|
|
88
|
+
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
|
|
89
|
+
}
|
|
90
|
+
.rp-segmented-control__control--disabled[data-v-aba56e2a] {
|
|
91
|
+
opacity: var(--rp-opacity-disabled);
|
|
92
|
+
cursor: not-allowed;
|
|
93
|
+
}
|
|
94
|
+
.rp-segmented-control--disabled[data-v-aba56e2a] {
|
|
95
|
+
cursor: not-allowed;
|
|
96
|
+
}
|
|
97
|
+
.rp-segmented-control--invalid[data-v-aba56e2a] {
|
|
98
|
+
border-color: var(--rp-color-red-filled);
|
|
99
|
+
box-shadow: 0 0 0 var(--rp-border-width-thin) color-mix(in srgb, var(--rp-color-red-filled) 22%, transparent);
|
|
100
|
+
}
|
|
101
|
+
.rp-segmented-control--vertical[data-v-aba56e2a] {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
align-items: stretch;
|
|
104
|
+
}
|
|
105
|
+
.rp-segmented-control--vertical .rp-segmented-control__control[data-v-aba56e2a] {
|
|
106
|
+
width: 100%;
|
|
107
|
+
}
|
|
108
|
+
.rp-segmented-control--vertical .rp-segmented-control__label[data-v-aba56e2a] {
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
text-align: start;
|
|
111
|
+
}
|
|
112
|
+
.rp-segmented-control--full-width[data-v-aba56e2a] {
|
|
113
|
+
display: flex;
|
|
114
|
+
width: 100%;
|
|
115
|
+
}
|
|
116
|
+
.rp-segmented-control--full-width .rp-segmented-control__control[data-v-aba56e2a] {
|
|
117
|
+
flex-basis: 0;
|
|
118
|
+
}
|
|
119
|
+
.rp-segmented-control--size-xs[data-v-aba56e2a] {
|
|
120
|
+
--_rp-segmented-control-height: var(--rp-size-control-xs);
|
|
121
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-xs) / 3);
|
|
122
|
+
--_rp-segmented-control-gap: var(--rp-spacing-1);
|
|
123
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-xs);
|
|
124
|
+
}
|
|
125
|
+
.rp-segmented-control--size-sm[data-v-aba56e2a] {
|
|
126
|
+
--_rp-segmented-control-height: var(--rp-size-control-sm);
|
|
127
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-sm) / 3);
|
|
128
|
+
--_rp-segmented-control-gap: var(--rp-spacing-2);
|
|
129
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-sm);
|
|
130
|
+
}
|
|
131
|
+
.rp-segmented-control--size-md[data-v-aba56e2a] {
|
|
132
|
+
--_rp-segmented-control-height: var(--rp-size-control-md);
|
|
133
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-md) / 3);
|
|
134
|
+
--_rp-segmented-control-gap: var(--rp-spacing-2);
|
|
135
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-md);
|
|
136
|
+
}
|
|
137
|
+
.rp-segmented-control--size-lg[data-v-aba56e2a] {
|
|
138
|
+
--_rp-segmented-control-height: var(--rp-size-control-lg);
|
|
139
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-lg) / 3);
|
|
140
|
+
--_rp-segmented-control-gap: var(--rp-spacing-3);
|
|
141
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-lg);
|
|
142
|
+
}
|
|
143
|
+
.rp-segmented-control--size-xl[data-v-aba56e2a] {
|
|
144
|
+
--_rp-segmented-control-height: var(--rp-size-control-xl);
|
|
145
|
+
--_rp-segmented-control-padding-x: calc(var(--rp-size-control-xl) / 3);
|
|
146
|
+
--_rp-segmented-control-gap: var(--rp-spacing-3);
|
|
147
|
+
--_rp-segmented-control-font-size: var(--rp-font-size-xl);
|
|
148
|
+
}
|
|
149
|
+
.rp-segmented-control--radius-none[data-v-aba56e2a] {
|
|
150
|
+
--_rp-segmented-control-radius: var(--rp-radius-none);
|
|
151
|
+
}
|
|
152
|
+
.rp-segmented-control--radius-xs[data-v-aba56e2a] {
|
|
153
|
+
--_rp-segmented-control-radius: var(--rp-radius-xs);
|
|
154
|
+
}
|
|
155
|
+
.rp-segmented-control--radius-sm[data-v-aba56e2a] {
|
|
156
|
+
--_rp-segmented-control-radius: var(--rp-radius-sm);
|
|
157
|
+
}
|
|
158
|
+
.rp-segmented-control--radius-md[data-v-aba56e2a] {
|
|
159
|
+
--_rp-segmented-control-radius: var(--rp-radius-md);
|
|
160
|
+
}
|
|
161
|
+
.rp-segmented-control--radius-lg[data-v-aba56e2a] {
|
|
162
|
+
--_rp-segmented-control-radius: var(--rp-radius-lg);
|
|
163
|
+
}
|
|
164
|
+
.rp-segmented-control--radius-xl[data-v-aba56e2a] {
|
|
165
|
+
--_rp-segmented-control-radius: var(--rp-radius-xl);
|
|
166
|
+
}
|
|
167
|
+
.rp-segmented-control--radius-full[data-v-aba56e2a] {
|
|
168
|
+
--_rp-segmented-control-radius: var(--rp-radius-full);
|
|
169
|
+
}
|
|
170
|
+
@media (prefers-reduced-motion: reduce) {
|
|
171
|
+
.rp-segmented-control__indicator[data-v-aba56e2a],
|
|
172
|
+
.rp-segmented-control__label[data-v-aba56e2a] {
|
|
173
|
+
transition: none;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import './segmented-control.css';
|
|
2
|
+
import { t as useStylesApi } from "./styles-api.js";
|
|
3
|
+
import { n as toPresenceAttribute } from "./attributes.js";
|
|
4
|
+
import { t as bem } from "./bem.js";
|
|
5
|
+
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
6
|
+
import { n as getComponentCheckedColorStyle, t as componentColors } from "./componentColors.js";
|
|
7
|
+
import { o as splitCompatibilityAttributes, t as composeEventHandlers } from "./attributes2.js";
|
|
8
|
+
import { t as useControlState } from "./useControlState.js";
|
|
9
|
+
import { t as useNativeChoiceTransaction } from "./useNativeChoiceTransaction.js";
|
|
10
|
+
import { child, computed, createFor, createSlot, createTemplateRefSetter, defineVaporComponent, next, renderEffect, setDynamicProps, setInsertionState, setText, shallowRef, template, toDisplayString, unref, useId } from "vue";
|
|
11
|
+
//#region src/internal/composables/useGroupedRadioChoiceTransaction.ts
|
|
12
|
+
function getFirstEnabledValue(choices) {
|
|
13
|
+
return choices?.find((choice) => !choice.disabled)?.value ?? null;
|
|
14
|
+
}
|
|
15
|
+
function getChoiceMetadata(choices) {
|
|
16
|
+
return choices?.map((choice) => [choice.value, Boolean(choice.disabled)]) ?? [];
|
|
17
|
+
}
|
|
18
|
+
function hasSameChoiceMetadata(previous, next) {
|
|
19
|
+
return previous.length === next.length && previous.every(([value, disabled], index) => value === next[index]?.[0] && disabled === next[index]?.[1]);
|
|
20
|
+
}
|
|
21
|
+
function useGroupedRadioChoiceTransaction(options) {
|
|
22
|
+
const inputsByValue = shallowRef(/* @__PURE__ */ new Map());
|
|
23
|
+
const inputRefs = computed(() => options.choices()?.map((choice) => inputsByValue.value.get(choice.value) ?? null) ?? []);
|
|
24
|
+
const explicitDefaultValue = options.value.defaultValue();
|
|
25
|
+
const hasExplicitEmptyDefault = explicitDefaultValue === null;
|
|
26
|
+
const initialValue = explicitDefaultValue === void 0 ? getFirstEnabledValue(options.choices()) : explicitDefaultValue;
|
|
27
|
+
let nativeResetValue = initialValue;
|
|
28
|
+
let choiceMetadata = getChoiceMetadata(options.choices());
|
|
29
|
+
let shouldSyncNativeDefault = true;
|
|
30
|
+
function findInputChoice(input) {
|
|
31
|
+
const index = inputRefs.value.indexOf(input);
|
|
32
|
+
return index < 0 ? void 0 : options.choices()?.[index];
|
|
33
|
+
}
|
|
34
|
+
function getResetValue(currentValue) {
|
|
35
|
+
if (hasExplicitEmptyDefault) return null;
|
|
36
|
+
const initialChoice = options.choices()?.find((choice) => choice.value === initialValue);
|
|
37
|
+
if (initialChoice && !initialChoice.disabled) return initialChoice.value;
|
|
38
|
+
const fallbackValue = getFirstEnabledValue(options.choices());
|
|
39
|
+
return currentValue === fallbackValue ? fallbackValue : initialValue;
|
|
40
|
+
}
|
|
41
|
+
function getValidationAnchor(currentValue) {
|
|
42
|
+
let firstEnabledInput;
|
|
43
|
+
for (const [index, choice] of (options.choices() ?? []).entries()) {
|
|
44
|
+
const input = inputRefs.value[index];
|
|
45
|
+
if (!input || options.disabled() || choice.disabled) continue;
|
|
46
|
+
firstEnabledInput ??= input;
|
|
47
|
+
if (choice.value === currentValue) return input;
|
|
48
|
+
}
|
|
49
|
+
return firstEnabledInput;
|
|
50
|
+
}
|
|
51
|
+
function syncInputs(value) {
|
|
52
|
+
for (const [index, input] of inputRefs.value.entries()) {
|
|
53
|
+
if (!input) continue;
|
|
54
|
+
input.checked = options.choices()?.[index]?.value === value;
|
|
55
|
+
}
|
|
56
|
+
if (!shouldSyncNativeDefault) return;
|
|
57
|
+
shouldSyncNativeDefault = false;
|
|
58
|
+
for (const [index, input] of inputRefs.value.entries()) if (input) input.defaultChecked = options.choices()?.[index]?.value === nativeResetValue;
|
|
59
|
+
}
|
|
60
|
+
const valueOptions = {
|
|
61
|
+
modelValue: options.value.modelValue,
|
|
62
|
+
defaultValue: () => initialValue,
|
|
63
|
+
onChange: options.value.onChange
|
|
64
|
+
};
|
|
65
|
+
let currentValue;
|
|
66
|
+
const transaction = useNativeChoiceTransaction({
|
|
67
|
+
value: valueOptions,
|
|
68
|
+
adapter: {
|
|
69
|
+
commitValue(_value, _initialValue, applyValue) {
|
|
70
|
+
applyValue();
|
|
71
|
+
},
|
|
72
|
+
controls: () => inputRefs.value,
|
|
73
|
+
readResetValue(controls) {
|
|
74
|
+
const checked = controls.find((control) => control.checked);
|
|
75
|
+
return checked ? findInputChoice(checked)?.value ?? null : null;
|
|
76
|
+
},
|
|
77
|
+
reconcileValue(value, _initialValue, isControlled) {
|
|
78
|
+
const nextChoiceMetadata = getChoiceMetadata(options.choices());
|
|
79
|
+
if (hasSameChoiceMetadata(choiceMetadata, nextChoiceMetadata)) return value;
|
|
80
|
+
choiceMetadata = nextChoiceMetadata;
|
|
81
|
+
let reconciledValue = value;
|
|
82
|
+
if (!isControlled && !(value === null && hasExplicitEmptyDefault)) reconciledValue = options.choices()?.some((choice) => choice.value === value && !choice.disabled) ? value : getFirstEnabledValue(options.choices());
|
|
83
|
+
nativeResetValue = getResetValue(reconciledValue);
|
|
84
|
+
shouldSyncNativeDefault = true;
|
|
85
|
+
return reconciledValue;
|
|
86
|
+
},
|
|
87
|
+
syncValue: syncInputs,
|
|
88
|
+
validationMessage(element) {
|
|
89
|
+
return element === getValidationAnchor(currentValue.value) ? options.validationMessage?.() : void 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
currentValue = transaction.value;
|
|
94
|
+
function createInputRef(value) {
|
|
95
|
+
let mountedInput = null;
|
|
96
|
+
return (element) => {
|
|
97
|
+
const input = element instanceof HTMLInputElement ? element : null;
|
|
98
|
+
if (input) {
|
|
99
|
+
mountedInput = input;
|
|
100
|
+
input.defaultChecked = value === nativeResetValue;
|
|
101
|
+
const existingInput = inputsByValue.value.get(value);
|
|
102
|
+
const hasOtherRegistration = [...inputsByValue.value].some(([registeredValue, registeredInput]) => registeredValue !== value && registeredInput === input);
|
|
103
|
+
if (existingInput === input && !hasOtherRegistration) return;
|
|
104
|
+
const nextInputs = new Map(inputsByValue.value);
|
|
105
|
+
for (const [registeredValue, registeredInput] of nextInputs) if (registeredInput === input) nextInputs.delete(registeredValue);
|
|
106
|
+
nextInputs.set(value, input);
|
|
107
|
+
inputsByValue.value = nextInputs;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const removedInput = mountedInput;
|
|
111
|
+
mountedInput = null;
|
|
112
|
+
if (!removedInput || inputsByValue.value.get(value) !== removedInput) return;
|
|
113
|
+
const nextInputs = new Map(inputsByValue.value);
|
|
114
|
+
nextInputs.delete(value);
|
|
115
|
+
inputsByValue.value = nextInputs;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
acceptValue: transaction.requestValueUpdate,
|
|
120
|
+
createInputRef,
|
|
121
|
+
inputRefs,
|
|
122
|
+
value: transaction.value
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/components/segmented-control/useSegmentedControl.ts
|
|
127
|
+
function useSegmentedControl(props, emitUpdate) {
|
|
128
|
+
const control = useControlState(props);
|
|
129
|
+
const generatedId = useId();
|
|
130
|
+
const baseId = computed(() => props.id ?? generatedId);
|
|
131
|
+
const groupName = computed(() => props.name ?? `${baseId.value}-segmented-control`);
|
|
132
|
+
const transaction = useGroupedRadioChoiceTransaction({
|
|
133
|
+
choices: () => props.options,
|
|
134
|
+
disabled: () => control.disabled,
|
|
135
|
+
validationMessage: () => props.validationMessage,
|
|
136
|
+
value: {
|
|
137
|
+
modelValue: () => props.modelValue,
|
|
138
|
+
defaultValue: () => props.defaultValue,
|
|
139
|
+
onChange(value) {
|
|
140
|
+
if (value !== null) emitUpdate(value);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const inputRefs = transaction.inputRefs;
|
|
145
|
+
const selectedValue = transaction.value;
|
|
146
|
+
const rootClass = computed(() => bem("rp-segmented-control", {
|
|
147
|
+
[`size-${props.size ?? "md"}`]: true,
|
|
148
|
+
[`radius-${props.radius ?? "sm"}`]: true,
|
|
149
|
+
[props.orientation ?? "horizontal"]: true,
|
|
150
|
+
"full-width": props.fullWidth,
|
|
151
|
+
disabled: control.disabled,
|
|
152
|
+
invalid: control.invalid
|
|
153
|
+
}));
|
|
154
|
+
const rootStyle = computed(() => getComponentCheckedColorStyle({
|
|
155
|
+
color: props.color,
|
|
156
|
+
autoContrast: props.autoContrast,
|
|
157
|
+
contrastColor: props.contrastColor,
|
|
158
|
+
colorProperty: "--_rp-segmented-control-color",
|
|
159
|
+
checkedColorProperty: "--_rp-segmented-control-on-color"
|
|
160
|
+
}));
|
|
161
|
+
function isSelected(option) {
|
|
162
|
+
return option.value === selectedValue.value;
|
|
163
|
+
}
|
|
164
|
+
function isOptionDisabled(option) {
|
|
165
|
+
return control.disabled || Boolean(option.disabled);
|
|
166
|
+
}
|
|
167
|
+
function selectOption(option) {
|
|
168
|
+
if (isOptionDisabled(option)) return;
|
|
169
|
+
transaction.acceptValue(option.value);
|
|
170
|
+
}
|
|
171
|
+
function getInputId(index) {
|
|
172
|
+
return `${baseId.value}-option-${index}`;
|
|
173
|
+
}
|
|
174
|
+
function focus(options) {
|
|
175
|
+
const selectedInput = inputRefs.value.find((input) => input?.checked && !input.disabled);
|
|
176
|
+
const firstEnabledInput = inputRefs.value.find((input) => input && !input.disabled);
|
|
177
|
+
(selectedInput ?? firstEnabledInput)?.focus(options);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
control,
|
|
181
|
+
inputRefs,
|
|
182
|
+
selectedValue,
|
|
183
|
+
rootClass,
|
|
184
|
+
rootStyle,
|
|
185
|
+
groupName,
|
|
186
|
+
createInputRef: transaction.createInputRef,
|
|
187
|
+
isSelected,
|
|
188
|
+
isOptionDisabled,
|
|
189
|
+
selectOption,
|
|
190
|
+
getInputId,
|
|
191
|
+
focus
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/components/segmented-control/segmented-control.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
196
|
+
var t0 = template(" ");
|
|
197
|
+
var t1 = template("<label data-v-aba56e2a><input data-v-aba56e2a><span data-v-aba56e2a></span><span data-v-aba56e2a>");
|
|
198
|
+
var t2 = template("<div data-v-aba56e2a>", 1);
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/components/segmented-control/segmented-control.vue
|
|
201
|
+
var segmented_control_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
202
|
+
name: "RpSegmentedControl",
|
|
203
|
+
inheritAttrs: false,
|
|
204
|
+
__name: "segmented-control",
|
|
205
|
+
props: {
|
|
206
|
+
id: {},
|
|
207
|
+
name: {},
|
|
208
|
+
form: {},
|
|
209
|
+
modelValue: { default: void 0 },
|
|
210
|
+
defaultValue: { default: void 0 },
|
|
211
|
+
options: { default: () => [] },
|
|
212
|
+
color: {},
|
|
213
|
+
autoContrast: {
|
|
214
|
+
type: Boolean,
|
|
215
|
+
default: true
|
|
216
|
+
},
|
|
217
|
+
contrastColor: {},
|
|
218
|
+
size: { default: "md" },
|
|
219
|
+
radius: { default: "sm" },
|
|
220
|
+
orientation: { default: "horizontal" },
|
|
221
|
+
fullWidth: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
default: false
|
|
224
|
+
},
|
|
225
|
+
disabled: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
default: false
|
|
228
|
+
},
|
|
229
|
+
required: {
|
|
230
|
+
type: Boolean,
|
|
231
|
+
default: false
|
|
232
|
+
},
|
|
233
|
+
invalid: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
default: false
|
|
236
|
+
},
|
|
237
|
+
ariaLabel: {},
|
|
238
|
+
describedby: {},
|
|
239
|
+
labelledby: {},
|
|
240
|
+
inputAttrs: {},
|
|
241
|
+
validationMessage: {},
|
|
242
|
+
classNames: {},
|
|
243
|
+
styles: {}
|
|
244
|
+
},
|
|
245
|
+
emits: ["update:modelValue"],
|
|
246
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
247
|
+
const props = __props;
|
|
248
|
+
const emit = __emit;
|
|
249
|
+
const { control, inputRefs, selectedValue, rootClass, rootStyle, groupName, createInputRef, isSelected, isOptionDisabled, selectOption, getInputId, focus } = useSegmentedControl(props, (value) => emit("update:modelValue", value));
|
|
250
|
+
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
251
|
+
const rootAttrs = computed(() => getRootAttrs({
|
|
252
|
+
id: control.id,
|
|
253
|
+
class: rootClass.value,
|
|
254
|
+
style: rootStyle.value,
|
|
255
|
+
role: "radiogroup",
|
|
256
|
+
"data-value": selectedValue.value ?? void 0,
|
|
257
|
+
"data-size": props.size,
|
|
258
|
+
"data-orientation": props.orientation,
|
|
259
|
+
"data-disabled": toPresenceAttribute(control.disabled),
|
|
260
|
+
"data-invalid": toPresenceAttribute(control.invalid),
|
|
261
|
+
"aria-label": props.ariaLabel || void 0,
|
|
262
|
+
"aria-labelledby": control.ariaLabelledby,
|
|
263
|
+
"aria-describedby": control.ariaDescribedby,
|
|
264
|
+
"aria-orientation": props.orientation,
|
|
265
|
+
"aria-disabled": control.disabled || void 0,
|
|
266
|
+
"aria-invalid": control.invalid || void 0,
|
|
267
|
+
"aria-required": control.required || void 0
|
|
268
|
+
}));
|
|
269
|
+
function getControlAttrs(option) {
|
|
270
|
+
const selected = isSelected(option);
|
|
271
|
+
const disabled = isOptionDisabled(option);
|
|
272
|
+
return {
|
|
273
|
+
...getPartAttrs("control", { class: ["rp-segmented-control__control", {
|
|
274
|
+
"rp-segmented-control__control--selected": selected,
|
|
275
|
+
"rp-segmented-control__control--disabled": disabled
|
|
276
|
+
}] }),
|
|
277
|
+
"data-state": selected ? "checked" : "unchecked",
|
|
278
|
+
"data-disabled": toPresenceAttribute(disabled)
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function getInputAttrs(option) {
|
|
282
|
+
const attributes = props.inputAttrs ?? {};
|
|
283
|
+
const { compatibilityClass, compatibilityStyle, forwardedAttributes } = splitCompatibilityAttributes(attributes);
|
|
284
|
+
return {
|
|
285
|
+
...forwardedAttributes,
|
|
286
|
+
...getPartAttrs("input", {
|
|
287
|
+
class: "rp-segmented-control__input",
|
|
288
|
+
compatibilityClass,
|
|
289
|
+
compatibilityStyle
|
|
290
|
+
}),
|
|
291
|
+
onChange: composeEventHandlers(() => selectOption(option), attributes.onChange)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
__expose({
|
|
295
|
+
nativeElements: inputRefs,
|
|
296
|
+
focus
|
|
297
|
+
});
|
|
298
|
+
const _setTemplateRef = createTemplateRefSetter();
|
|
299
|
+
const n9 = t2();
|
|
300
|
+
renderEffect(() => setDynamicProps(n9, [rootAttrs.value]));
|
|
301
|
+
setInsertionState(n9, null, 0);
|
|
302
|
+
createFor(() => __props.options, (_for_item0, _for_key0) => {
|
|
303
|
+
const n8 = t1();
|
|
304
|
+
const n2 = child(n8);
|
|
305
|
+
const n3 = next(n2, 1);
|
|
306
|
+
const n7 = next(n3, 2);
|
|
307
|
+
renderEffect(() => {
|
|
308
|
+
const _option = _for_item0.value;
|
|
309
|
+
const _control = unref(control);
|
|
310
|
+
const _isOptionDisabled = unref(isOptionDisabled);
|
|
311
|
+
const _toPresenceAttribute = unref(toPresenceAttribute);
|
|
312
|
+
const _getPartAttrs = unref(getPartAttrs);
|
|
313
|
+
const _control_required = _control.required;
|
|
314
|
+
const _isSelected_option_checked_unchecked = unref(isSelected)(_option) ? "checked" : "unchecked";
|
|
315
|
+
setDynamicProps(n8, [getControlAttrs(_option)]);
|
|
316
|
+
setDynamicProps(n2, [getInputAttrs(_option), {
|
|
317
|
+
id: unref(getInputId)(_for_key0.value),
|
|
318
|
+
type: "radio",
|
|
319
|
+
name: unref(groupName),
|
|
320
|
+
form: _control.form ?? __props.inputAttrs?.form,
|
|
321
|
+
value: String(_option.value),
|
|
322
|
+
checked: unref(isSelected)(_option),
|
|
323
|
+
disabled: _isOptionDisabled(_option) || void 0,
|
|
324
|
+
required: _control_required || void 0,
|
|
325
|
+
"aria-describedby": _control.ariaDescribedby,
|
|
326
|
+
"aria-invalid": _control.invalid || void 0,
|
|
327
|
+
"aria-required": _control_required || void 0,
|
|
328
|
+
"data-state": _isSelected_option_checked_unchecked,
|
|
329
|
+
"data-disabled": _toPresenceAttribute(_isOptionDisabled(_option)),
|
|
330
|
+
"data-invalid": _toPresenceAttribute(_control.invalid)
|
|
331
|
+
}]);
|
|
332
|
+
_setTemplateRef(n2, unref(createInputRef)(_option.value), true);
|
|
333
|
+
setDynamicProps(n3, [_getPartAttrs("indicator", { class: "rp-segmented-control__indicator" }), {
|
|
334
|
+
"aria-hidden": "true",
|
|
335
|
+
"data-state": _isSelected_option_checked_unchecked
|
|
336
|
+
}]);
|
|
337
|
+
setDynamicProps(n7, [_getPartAttrs("label", { class: "rp-segmented-control__label" })]);
|
|
338
|
+
});
|
|
339
|
+
setInsertionState(n7, null, 0);
|
|
340
|
+
createSlot("option", {
|
|
341
|
+
option: () => _for_item0.value,
|
|
342
|
+
selected: () => unref(isSelected)(_for_item0.value),
|
|
343
|
+
disabled: () => unref(isOptionDisabled)(_for_item0.value)
|
|
344
|
+
}, () => {
|
|
345
|
+
const n6 = t0();
|
|
346
|
+
renderEffect(() => setText(n6, toDisplayString(_for_item0.value.label)));
|
|
347
|
+
return n6;
|
|
348
|
+
}, 1);
|
|
349
|
+
return n8;
|
|
350
|
+
}, (option, index) => option.value, 9);
|
|
351
|
+
return n9;
|
|
352
|
+
}
|
|
353
|
+
}), [["__scopeId", "data-v-aba56e2a"]]);
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/components/segmented-control/types.ts
|
|
356
|
+
var segmentedControlParts = [
|
|
357
|
+
"root",
|
|
358
|
+
"control",
|
|
359
|
+
"input",
|
|
360
|
+
"indicator",
|
|
361
|
+
"label"
|
|
362
|
+
];
|
|
363
|
+
var segmentedControlColors = componentColors;
|
|
364
|
+
var segmentedControlSizes = [
|
|
365
|
+
"xs",
|
|
366
|
+
"sm",
|
|
367
|
+
"md",
|
|
368
|
+
"lg",
|
|
369
|
+
"xl"
|
|
370
|
+
];
|
|
371
|
+
var segmentedControlRadiuses = [
|
|
372
|
+
"none",
|
|
373
|
+
"xs",
|
|
374
|
+
"sm",
|
|
375
|
+
"md",
|
|
376
|
+
"lg",
|
|
377
|
+
"xl",
|
|
378
|
+
"full"
|
|
379
|
+
];
|
|
380
|
+
var segmentedControlOrientations = ["horizontal", "vertical"];
|
|
381
|
+
//#endregion
|
|
382
|
+
export { segmentedControlSizes as a, segmentedControlRadiuses as i, segmentedControlOrientations as n, segmented_control_default as o, segmentedControlParts as r, segmentedControlColors as t };
|