@volverjs/ui-vue 0.0.5 → 0.0.6-beta.15
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 +3 -4
- package/auto-imports.d.ts +11 -0
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +238 -5
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +8 -8
- package/dist/components/VvAccordion/index.d.ts +3 -6
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +243 -10
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +10 -62
- package/dist/components/VvAccordionGroup/index.d.ts +4 -33
- package/dist/components/VvAction/VvAction.es.js +12 -8
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +4 -4
- package/dist/components/VvAction/index.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +661 -0
- package/dist/components/VvAlert/VvAlert.umd.js +1 -0
- package/dist/components/VvAlert/VvAlert.vue.d.ts +104 -0
- package/dist/components/VvAlert/index.d.ts +95 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +799 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +89 -0
- package/dist/components/VvAlertGroup/index.d.ts +55 -0
- package/dist/components/VvAvatar/VvAvatar.es.js +279 -0
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -0
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +15 -0
- package/dist/components/VvAvatar/index.d.ts +7 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +363 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +42 -0
- package/dist/components/VvAvatarGroup/index.d.ts +25 -0
- package/dist/components/VvBadge/VvBadge.es.js +3 -3
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -3
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +5 -31
- package/dist/components/VvBreadcrumb/index.d.ts +1 -14
- package/dist/components/VvButton/VvButton.es.js +90 -49
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +38 -13
- package/dist/components/VvButton/index.d.ts +27 -4
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +13 -7
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -62
- package/dist/components/VvButtonGroup/index.d.ts +3 -29
- package/dist/components/VvCard/VvCard.es.js +221 -2
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +7 -7
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +154 -101
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +47 -11
- package/dist/components/VvCheckbox/index.d.ts +9 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -104
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +44 -8
- package/dist/components/VvCheckboxGroup/index.d.ts +8 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +272 -175
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +73 -37
- package/dist/components/VvCombobox/index.d.ts +13 -7
- package/dist/components/VvDialog/VvDialog.es.js +45 -34
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +7 -7
- package/dist/components/VvDialog/index.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdown.es.js +39 -25
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +24 -20
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +4 -4
- package/dist/components/VvDropdown/index.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +9 -5
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +3 -3
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +12 -8
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +26 -20
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +3 -3
- package/dist/components/VvIcon/index.d.ts +3 -3
- package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +166 -142
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +46 -22
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvNav/VvNav.es.js +454 -0
- package/dist/components/VvNav/VvNav.umd.js +1 -0
- package/dist/components/VvNav/VvNav.vue.d.ts +21 -0
- package/dist/components/VvNav/index.d.ts +19 -0
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +19 -0
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +1 -0
- package/dist/components/VvNavItemTitle/VvNavItemTitle.vue.d.ts +6 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.d.ts +2 -0
- package/dist/components/VvProgress/VvProgress.es.js +3 -3
- package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +154 -101
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +47 -11
- package/dist/components/VvRadio/index.d.ts +9 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -104
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +44 -8
- package/dist/components/VvRadioGroup/index.d.ts +8 -3
- package/dist/components/VvSelect/VvSelect.es.js +167 -141
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +42 -18
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTab/VvTab.es.js +509 -0
- package/dist/components/VvTab/VvTab.umd.js +1 -0
- package/dist/components/VvTab/VvTab.vue.d.ts +26 -0
- package/dist/components/VvTab/index.d.ts +10 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +164 -140
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +40 -16
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +3 -3
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
- package/dist/components/common/HintSlot.d.ts +38 -12
- package/dist/components/index.es.js +1336 -981
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useInjectAlert.d.ts +9 -0
- package/dist/composables/alert/useProvideAlert.d.ts +10 -0
- package/dist/composables/dropdown/useInjectDropdown.d.ts +17 -16
- package/dist/composables/dropdown/useProvideDropdown.d.ts +7 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useVolver.d.ts +1 -2
- package/dist/constants.d.ts +33 -4
- package/dist/directives/index.d.ts +2 -2
- package/dist/directives/index.es.js +3 -3
- package/dist/directives/v-tooltip.es.js +3 -3
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +38 -16
- package/dist/resolvers/unplugin.es.js +6 -3
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Accordion/Accordion.settings.d.ts +18 -17
- package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
- package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
- package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +23 -4
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +134 -0
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +894 -0
- package/dist/stories/Alert/Alert.settings.d.ts +105 -0
- package/dist/stories/Alert/Alert.stories.d.ts +9 -0
- package/dist/stories/Alert/Alert.test.d.ts +2 -0
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
- package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
- package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +97 -0
- package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
- package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
- package/dist/stories/Avatar/Avatar.settings.d.ts +5 -0
- package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
- package/dist/stories/Avatar/Avatar.test.d.ts +2 -0
- package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
- package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
- package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
- package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +50 -0
- package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
- package/dist/stories/AvatarGroup/AvatarGroup.test.d.ts +2 -0
- package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
- package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
- package/dist/stories/Badge/Badge.settings.d.ts +0 -3
- package/dist/stories/Badge/Badge.stories.d.ts +7 -0
- package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
- package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
- package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
- package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +17 -9
- package/dist/stories/Button/Button.stories.d.ts +6 -0
- package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
- package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
- package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
- package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
- package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
- package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
- package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +0 -4
- package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
- package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
- package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
- package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
- package/dist/stories/Card/Card.settings.d.ts +0 -3
- package/dist/stories/Card/Card.stories.d.ts +6 -0
- package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
- package/dist/stories/Checkbox/Checkbox.settings.d.ts +1 -21
- package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
- package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
- package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -27
- package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
- package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
- package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +2 -54
- package/dist/stories/Combobox/Combobox.stories.d.ts +21 -0
- package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
- package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +8 -0
- package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +9 -0
- package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
- package/dist/stories/Dialog/Dialog.settings.d.ts +1 -1
- package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
- package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +1 -1
- package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
- package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
- package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
- package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -3
- package/dist/stories/Icon/Icon.stories.d.ts +8 -0
- package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
- package/dist/stories/InputText/InputText.settings.d.ts +1 -74
- package/dist/stories/InputText/InputText.stories.d.ts +15 -0
- package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
- package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
- package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
- package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
- package/dist/stories/Nav/Nav.settings.d.ts +30 -0
- package/dist/stories/Nav/Nav.stories.d.ts +6 -0
- package/dist/stories/Nav/Nav.test.d.ts +2 -0
- package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
- package/dist/stories/Progress/Progress.settings.d.ts +0 -6
- package/dist/stories/Progress/Progress.stories.d.ts +7 -0
- package/dist/stories/Radio/Radio.settings.d.ts +1 -19
- package/dist/stories/Radio/Radio.stories.d.ts +11 -0
- package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -27
- package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
- package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
- package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
- package/dist/stories/Select/Select.settings.d.ts +1 -47
- package/dist/stories/Select/Select.stories.d.ts +15 -0
- package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
- package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
- package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
- package/dist/stories/Tab/Tab.settings.d.ts +37 -0
- package/dist/stories/Tab/Tab.stories.d.ts +6 -0
- package/dist/stories/Tab/Tab.test.d.ts +2 -0
- package/dist/stories/Textarea/Textarea.settings.d.ts +1 -43
- package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
- package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
- package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
- package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +2 -39
- package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
- package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
- package/dist/stories/argTypes.d.ts +5 -125
- package/dist/test/expect.d.ts +3 -0
- package/package.json +112 -56
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/index.ts +22 -7
- package/src/components/VvAccordionGroup/index.ts +8 -6
- package/src/components/VvAction/VvAction.vue +1 -1
- package/src/components/VvAlert/VvAlert.vue +54 -0
- package/src/components/VvAlert/index.ts +162 -0
- package/src/components/VvAlertGroup/VvAlertGroup.vue +34 -0
- package/src/components/VvAlertGroup/index.ts +122 -0
- package/src/components/VvAvatar/VvAvatar.vue +21 -0
- package/src/components/VvAvatar/index.ts +9 -0
- package/src/components/VvAvatarGroup/VvAvatarGroup.vue +65 -0
- package/src/components/VvAvatarGroup/index.ts +28 -0
- package/src/components/VvBreadcrumb/index.ts +1 -1
- package/src/components/VvButton/VvButton.vue +9 -6
- package/src/components/VvButton/index.ts +44 -21
- package/src/components/VvButtonGroup/VvButtonGroup.vue +2 -2
- package/src/components/VvButtonGroup/index.ts +14 -2
- package/src/components/VvCard/index.ts +3 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +23 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +15 -2
- package/src/components/VvCombobox/VvCombobox.vue +41 -24
- package/src/components/VvCombobox/index.ts +11 -5
- package/src/components/VvDialog/VvDialog.vue +11 -7
- package/src/components/VvDialog/index.ts +2 -2
- package/src/components/VvDropdown/VvDropdown.vue +23 -5
- package/src/components/VvDropdown/VvDropdownItem.vue +2 -2
- package/src/components/VvIcon/VvIcon.vue +37 -34
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputText.vue +26 -9
- package/src/components/VvNav/VvNav.vue +66 -0
- package/src/components/VvNav/index.ts +21 -0
- package/src/components/VvNavItemTitle/VvNavItemTitle.vue +11 -0
- package/src/components/VvNavSeparator/VvNavSeparator.ts +8 -0
- package/src/components/VvRadio/VvRadio.vue +23 -2
- package/src/components/VvRadioGroup/VvRadioGroup.vue +15 -2
- package/src/components/VvSelect/VvSelect.vue +26 -9
- package/src/components/VvTab/VvTab.vue +53 -0
- package/src/components/VvTab/index.ts +13 -0
- package/src/components/VvTextarea/VvTextarea.vue +26 -9
- package/src/components/common/HintSlot.ts +129 -170
- package/src/composables/alert/useInjectAlert.ts +8 -0
- package/src/composables/alert/useProvideAlert.ts +23 -0
- package/src/composables/dropdown/useInjectDropdown.ts +3 -28
- package/src/composables/dropdown/useProvideDropdown.ts +14 -15
- package/src/composables/useOptions.ts +9 -7
- package/src/composables/useVolver.ts +1 -2
- package/src/constants.ts +42 -4
- package/src/props/index.ts +7 -5
- package/src/resolvers/unplugin.ts +6 -3
- package/src/stories/Accordion/Accordion.settings.ts +18 -7
- package/src/stories/Accordion/Accordion.stories.ts +45 -0
- package/src/stories/Accordion/AccordionSlots.stories.ts +29 -0
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +22 -0
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +62 -0
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +53 -0
- package/src/stories/Alert/Alert.settings.ts +110 -0
- package/src/stories/Alert/Alert.stories.ts +60 -0
- package/src/stories/Alert/Alert.test.ts +95 -0
- package/src/stories/Alert/AlertModifiers.stories.ts +77 -0
- package/src/stories/Alert/AlertSlots.stories.ts +74 -0
- package/src/stories/AlertGroup/AlertGroup.settings.ts +110 -0
- package/src/stories/AlertGroup/AlertGroup.stories.ts +50 -0
- package/src/stories/AlertGroup/AlertGroup.test.ts +76 -0
- package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +103 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +67 -0
- package/src/stories/Avatar/Avatar.settings.ts +37 -0
- package/src/stories/Avatar/Avatar.stories.ts +42 -0
- package/src/stories/Avatar/Avatar.test.ts +34 -0
- package/src/stories/Avatar/AvatarBadge.stories.ts +36 -0
- package/src/stories/Avatar/AvatarModifiers.stories.ts +100 -0
- package/src/stories/Avatar/AvatarSlots.stories.ts +34 -0
- package/src/stories/AvatarGroup/AvatarGroup.settings.ts +60 -0
- package/src/stories/AvatarGroup/AvatarGroup.stories.ts +35 -0
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +36 -0
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +31 -0
- package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +39 -0
- package/src/stories/Badge/Badge.stories.ts +43 -0
- package/src/stories/Badge/BadgeSlots.stories.ts +23 -0
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +41 -0
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +37 -0
- package/src/stories/Button/Button.settings.ts +14 -2
- package/src/stories/Button/Button.stories.ts +38 -0
- package/src/stories/Button/ButtonIcon.stories.ts +67 -0
- package/src/stories/Button/ButtonLink.stories.ts +40 -0
- package/src/stories/Button/ButtonLoading.stories.ts +41 -0
- package/src/stories/Button/ButtonModifiers.stories.ts +158 -0
- package/src/stories/Button/ButtonSlots.stories.ts +87 -0
- package/src/stories/Button/ButtonState.stories.ts +42 -0
- package/src/stories/Button/ButtonToggle.stories.ts +52 -0
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +39 -0
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +39 -0
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +38 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +41 -0
- package/src/stories/Card/Card.stories.ts +46 -0
- package/src/stories/Card/CardSlots.stories.ts +81 -0
- package/src/stories/Checkbox/Checkbox.settings.ts +0 -2
- package/src/stories/Checkbox/Checkbox.stories.ts +97 -0
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +33 -0
- package/src/stories/Checkbox/CheckboxSlots.stories.ts +31 -0
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +87 -0
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +53 -0
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +47 -0
- package/src/stories/Combobox/Combobox.settings.ts +3 -23
- package/src/stories/Combobox/Combobox.stories.ts +176 -0
- package/src/stories/Combobox/Combobox.test.ts +2 -2
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +43 -0
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +41 -0
- package/src/stories/Combobox/ComboboxOptions.stories.ts +78 -0
- package/src/stories/Combobox/ComboboxSlots.stories.ts +104 -0
- package/src/stories/Dialog/Dialog.settings.ts +1 -1
- package/src/stories/Dialog/Dialog.stories.ts +51 -0
- package/src/stories/Dialog/Dialog.test.ts +2 -2
- package/src/stories/Dialog/DialogSlots.stories.ts +39 -0
- package/src/stories/Dropdown/Dropdown.stories.ts +107 -0
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +49 -0
- package/src/stories/Dropdown/DropdownMultilevel.stories.ts +61 -0
- package/src/stories/Dropdown/DropdownSlots.stories.ts +95 -0
- package/src/stories/Icon/Icon.settings.ts +1 -0
- package/src/stories/Icon/Icon.stories.ts +48 -0
- package/src/stories/Icon/IconsCollection.stories.ts +53 -0
- package/src/stories/InputText/InputText.settings.ts +3 -39
- package/src/stories/InputText/InputText.stories.ts +121 -0
- package/src/stories/InputText/InputTextIconPosition.stories.ts +43 -0
- package/src/stories/InputText/InputTextLength.stories.ts +58 -0
- package/src/stories/InputText/InputTextMinMax.stories.ts +51 -0
- package/src/stories/InputText/InputTextSlots.stories.ts +39 -0
- package/src/stories/InputText/InputTextType.stories.ts +119 -0
- package/src/stories/Nav/Nav.settings.ts +34 -0
- package/src/stories/Nav/Nav.stories.ts +33 -0
- package/src/stories/Nav/Nav.test.ts +32 -0
- package/src/stories/Nav/NavModifiers.stories.ts +47 -0
- package/src/stories/Progress/Progress.settings.ts +0 -3
- package/src/stories/Progress/Progress.stories.ts +41 -0
- package/src/stories/Radio/Radio.stories.ts +81 -0
- package/src/stories/Radio/RadioSlots.stories.ts +31 -0
- package/src/stories/RadioGroup/RadioGroup.stories.ts +88 -0
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +53 -0
- package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +47 -0
- package/src/stories/Select/Select.settings.ts +0 -5
- package/src/stories/Select/Select.stories.ts +113 -0
- package/src/stories/Select/SelectIconPosition.stories.ts +43 -0
- package/src/stories/Select/SelectOptions.stories.ts +77 -0
- package/src/stories/Select/SelectSlots.stories.ts +39 -0
- package/src/stories/Tab/Tab.settings.ts +41 -0
- package/src/stories/Tab/Tab.stories.ts +70 -0
- package/src/stories/Tab/Tab.test.ts +37 -0
- package/src/stories/Textarea/Textarea.settings.ts +0 -8
- package/src/stories/Textarea/Textarea.stories.ts +107 -0
- package/src/stories/Textarea/TextareaLength.stories.ts +58 -0
- package/src/stories/Textarea/TextareaSlots.stories.ts +39 -0
- package/src/stories/Textarea/TextareatIconPosition.stories.ts +43 -0
- package/src/stories/Tooltip/Tooltip.settings.ts +4 -4
- package/src/stories/Tooltip/Tooltip.stories.ts +40 -0
- package/src/stories/Tooltip/TooltipDirective.stories.ts +68 -0
- package/src/stories/argTypes.ts +5 -59
- package/src/test/expect.ts +15 -0
- package/src/types/group.d.ts +5 -3
- package/src/stories/Accordion/Accordion.stories.mdx +0 -45
- package/src/stories/Accordion/AccordionSlots.stories.mdx +0 -58
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +0 -58
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +0 -59
- package/src/stories/Badge/Badge.stories.mdx +0 -51
- package/src/stories/Badge/BadgeSlots.stories.mdx +0 -20
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +0 -50
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +0 -43
- package/src/stories/Button/Button.stories.mdx +0 -35
- package/src/stories/Button/ButtonIcon.stories.mdx +0 -153
- package/src/stories/Button/ButtonLink.stories.mdx +0 -72
- package/src/stories/Button/ButtonLoading.stories.mdx +0 -108
- package/src/stories/Button/ButtonModifiers.stories.mdx +0 -257
- package/src/stories/Button/ButtonSlots.stories.mdx +0 -116
- package/src/stories/Button/ButtonState.stories.mdx +0 -66
- package/src/stories/Button/ButtonToggle.stories.mdx +0 -50
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +0 -37
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.mdx +0 -52
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +0 -37
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +0 -73
- package/src/stories/Card/Card.stories.mdx +0 -40
- package/src/stories/Card/CardSlots.stories.mdx +0 -98
- package/src/stories/Checkbox/Checkbox.stories.mdx +0 -164
- package/src/stories/Checkbox/CheckboxBinary.stories.mdx +0 -68
- package/src/stories/Checkbox/CheckboxSlots.stories.mdx +0 -46
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +0 -135
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.mdx +0 -100
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +0 -68
- package/src/stories/Combobox/Combobox.stories.mdx +0 -324
- package/src/stories/Combobox/ComboboxIconPosition.stories.mdx +0 -78
- package/src/stories/Combobox/ComboboxMultiple.stories.mdx +0 -73
- package/src/stories/Combobox/ComboboxOptions.stories.mdx +0 -135
- package/src/stories/Combobox/ComboboxSlots.stories.mdx +0 -153
- package/src/stories/Dialog/Dialog.stories.mdx +0 -56
- package/src/stories/Dialog/DialogSlots.stories.mdx +0 -63
- package/src/stories/Dropdown/Dropdown.stories.mdx +0 -124
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +0 -41
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +0 -56
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +0 -114
- package/src/stories/Icon/Icon.stories.mdx +0 -91
- package/src/stories/Icon/IconsCollection.stories.mdx +0 -69
- package/src/stories/InputText/InputText.stories.mdx +0 -211
- package/src/stories/InputText/InputTextIconPosition.stories.mdx +0 -78
- package/src/stories/InputText/InputTextLength.stories.mdx +0 -110
- package/src/stories/InputText/InputTextMinMax.stories.mdx +0 -112
- package/src/stories/InputText/InputTextSlots.stories.mdx +0 -69
- package/src/stories/InputText/InputTextType.stories.mdx +0 -259
- package/src/stories/Progress/Progress.stories.mdx +0 -30
- package/src/stories/Radio/Radio.stories.mdx +0 -128
- package/src/stories/Radio/RadioSlots.stories.mdx +0 -46
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +0 -135
- package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +0 -100
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +0 -68
- package/src/stories/Select/Select.stories.mdx +0 -196
- package/src/stories/Select/SelectIconPosition.stories.mdx +0 -78
- package/src/stories/Select/SelectOptions.stories.mdx +0 -135
- package/src/stories/Select/SelectSlots.stories.mdx +0 -48
- package/src/stories/Textarea/Textarea.stories.mdx +0 -187
- package/src/stories/Textarea/TextareaLength.stories.mdx +0 -110
- package/src/stories/Textarea/TextareaSlots.stories.mdx +0 -69
- package/src/stories/Textarea/TextareatIconPosition.stories.mdx +0 -78
- package/src/stories/Tooltip/Tooltip.stories.mdx +0 -102
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +0 -99
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { unref,
|
|
2
|
-
import { toReactive, useVModel } from "@vueuse/core";
|
|
1
|
+
import { unref, computed, defineComponent, h, inject, toRef, toRefs, useSlots, ref, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, isRef, vModelRadio, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
|
|
3
2
|
import { nanoid } from "nanoid";
|
|
3
|
+
import { useVModel } from "@vueuse/core";
|
|
4
4
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
5
5
|
Side2["left"] = "left";
|
|
6
6
|
Side2["right"] = "right";
|
|
@@ -123,111 +123,114 @@ function isEmpty(value) {
|
|
|
123
123
|
function isString(value) {
|
|
124
124
|
return typeof value === "string" || value instanceof String;
|
|
125
125
|
}
|
|
126
|
-
function joinLines(
|
|
127
|
-
if (Array.isArray(
|
|
128
|
-
return
|
|
126
|
+
function joinLines(items) {
|
|
127
|
+
if (Array.isArray(items)) {
|
|
128
|
+
return items.filter((item) => isString(item)).join(" ");
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return items;
|
|
131
131
|
}
|
|
132
|
-
function HintSlotFactory(
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
valid,
|
|
143
|
-
validLabel,
|
|
144
|
-
invalid,
|
|
145
|
-
invalidLabel,
|
|
146
|
-
...otherProps
|
|
147
|
-
} = toRefs(parentProps);
|
|
148
|
-
const loading = resolveFieldData(otherProps, "loading");
|
|
149
|
-
const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
|
|
150
|
-
const hasInvalid = computed(() => {
|
|
151
|
-
if (!invalid.value) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
if (invalid.value && invalidSlot) {
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
|
|
158
|
-
return true;
|
|
159
|
-
}
|
|
160
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
return false;
|
|
164
|
-
});
|
|
165
|
-
const hasHint = computed(
|
|
166
|
-
() => !!(hintLabel && hintLabel.value || hintSlot)
|
|
132
|
+
function HintSlotFactory(props, slots) {
|
|
133
|
+
const invalidLabel = computed(() => joinLines(props.invalidLabel));
|
|
134
|
+
const validLabel = computed(() => joinLines(props.validLabel));
|
|
135
|
+
const loadingLabel = computed(() => props.loadingLabel);
|
|
136
|
+
const hintLabel = computed(() => props.hintLabel);
|
|
137
|
+
const hasLoadingLabelOrSlot = computed(
|
|
138
|
+
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
139
|
+
);
|
|
140
|
+
const hasInvalidLabelOrSlot = computed(
|
|
141
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
|
|
167
142
|
);
|
|
168
|
-
const
|
|
169
|
-
() =>
|
|
143
|
+
const hasValidLabelOrSlot = computed(
|
|
144
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
170
145
|
);
|
|
171
|
-
const
|
|
172
|
-
() =>
|
|
146
|
+
const hasHintLabelOrSlot = computed(
|
|
147
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
173
148
|
);
|
|
174
149
|
const isVisible = computed(
|
|
175
|
-
() =>
|
|
150
|
+
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
176
151
|
);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
152
|
+
const hintSlotScope = computed(() => ({
|
|
153
|
+
modelValue: props.modelValue,
|
|
154
|
+
valid: props.valid,
|
|
155
|
+
invalid: props.invalid,
|
|
156
|
+
loading: props.loading
|
|
157
|
+
}));
|
|
158
|
+
const HintSlot = defineComponent({
|
|
159
|
+
name: "HintSlot",
|
|
160
|
+
props: {
|
|
161
|
+
tag: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: "small"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
setup() {
|
|
167
|
+
return {
|
|
168
|
+
isVisible,
|
|
169
|
+
invalidLabel,
|
|
170
|
+
validLabel,
|
|
171
|
+
loadingLabel,
|
|
172
|
+
hintLabel,
|
|
173
|
+
hasInvalidLabelOrSlot,
|
|
174
|
+
hasValidLabelOrSlot,
|
|
175
|
+
hasLoadingLabelOrSlot,
|
|
176
|
+
hasHintLabelOrSlot
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
render() {
|
|
180
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
181
|
+
if (this.isVisible) {
|
|
182
|
+
let role;
|
|
183
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
184
|
+
role = "alert";
|
|
188
185
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
hintLabel,
|
|
194
|
-
modelValue,
|
|
195
|
-
valid,
|
|
196
|
-
validLabel,
|
|
197
|
-
invalid,
|
|
198
|
-
invalidLabel,
|
|
199
|
-
loading,
|
|
200
|
-
loadingLabel,
|
|
201
|
-
...props.params
|
|
202
|
-
});
|
|
203
|
-
if (invalid == null ? void 0 : invalid.value) {
|
|
204
|
-
return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
205
|
-
}
|
|
206
|
-
if (valid == null ? void 0 : valid.value)
|
|
207
|
-
return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
208
|
-
if (loading == null ? void 0 : loading.value)
|
|
209
|
-
return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
210
|
-
return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
211
|
-
});
|
|
212
|
-
return {
|
|
213
|
-
isVisible,
|
|
214
|
-
hasInvalid,
|
|
215
|
-
hasValid,
|
|
216
|
-
hintContent
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
render() {
|
|
220
|
-
if (this.isVisible) {
|
|
186
|
+
if (this.hasValidLabelOrSlot) {
|
|
187
|
+
role = "status";
|
|
188
|
+
}
|
|
189
|
+
if (this.hasLoadingLabelOrSlot) {
|
|
221
190
|
return h(
|
|
222
|
-
|
|
191
|
+
this.tag,
|
|
223
192
|
{
|
|
224
|
-
role
|
|
193
|
+
role
|
|
225
194
|
},
|
|
226
|
-
this.
|
|
195
|
+
((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
|
|
227
196
|
);
|
|
228
197
|
}
|
|
198
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
199
|
+
return h(
|
|
200
|
+
this.tag,
|
|
201
|
+
{
|
|
202
|
+
role
|
|
203
|
+
},
|
|
204
|
+
((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
if (this.hasValidLabelOrSlot) {
|
|
208
|
+
return h(
|
|
209
|
+
this.tag,
|
|
210
|
+
{
|
|
211
|
+
role
|
|
212
|
+
},
|
|
213
|
+
((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return h(
|
|
217
|
+
this.tag,
|
|
218
|
+
{
|
|
219
|
+
role
|
|
220
|
+
},
|
|
221
|
+
((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
|
|
222
|
+
);
|
|
229
223
|
}
|
|
224
|
+
return null;
|
|
230
225
|
}
|
|
226
|
+
});
|
|
227
|
+
return {
|
|
228
|
+
hasInvalidLabelOrSlot,
|
|
229
|
+
hasHintLabelOrSlot,
|
|
230
|
+
hasValidLabelOrSlot,
|
|
231
|
+
hasLoadingLabelOrSlot,
|
|
232
|
+
hintSlotScope,
|
|
233
|
+
HintSlot
|
|
231
234
|
};
|
|
232
235
|
}
|
|
233
236
|
const LinkProps = {
|
|
@@ -277,6 +280,19 @@ const InvalidProps = {
|
|
|
277
280
|
*/
|
|
278
281
|
invalidLabel: [String, Array]
|
|
279
282
|
};
|
|
283
|
+
const LoadingProps = {
|
|
284
|
+
/**
|
|
285
|
+
* Loading status
|
|
286
|
+
*/
|
|
287
|
+
loading: Boolean,
|
|
288
|
+
/**
|
|
289
|
+
* Loading label
|
|
290
|
+
*/
|
|
291
|
+
loadingLabel: {
|
|
292
|
+
type: String,
|
|
293
|
+
default: "Loading..."
|
|
294
|
+
}
|
|
295
|
+
};
|
|
280
296
|
const DisabledProps = {
|
|
281
297
|
/**
|
|
282
298
|
* Whether the form control is disabled
|
|
@@ -442,11 +458,11 @@ const IdProps = {
|
|
|
442
458
|
default: false
|
|
443
459
|
},
|
|
444
460
|
/**
|
|
445
|
-
*
|
|
461
|
+
* Keep open dropdown on click outside
|
|
446
462
|
*/
|
|
447
|
-
|
|
463
|
+
keepOpen: {
|
|
448
464
|
type: Boolean,
|
|
449
|
-
default:
|
|
465
|
+
default: false
|
|
450
466
|
},
|
|
451
467
|
/**
|
|
452
468
|
* Autofocus first item on dropdown open
|
|
@@ -481,6 +497,7 @@ const CheckboxRadioProps = {
|
|
|
481
497
|
...ReadonlyProps,
|
|
482
498
|
...ModifiersProps,
|
|
483
499
|
...LabelProps,
|
|
500
|
+
...LoadingProps,
|
|
484
501
|
/**
|
|
485
502
|
* Input value
|
|
486
503
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -500,6 +517,7 @@ const CheckboxRadioGroupProps = {
|
|
|
500
517
|
...ReadonlyProps,
|
|
501
518
|
...ModifiersProps,
|
|
502
519
|
...LabelProps,
|
|
520
|
+
...LoadingProps,
|
|
503
521
|
/**
|
|
504
522
|
* Input value
|
|
505
523
|
*/
|
|
@@ -618,7 +636,7 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
618
636
|
});
|
|
619
637
|
}
|
|
620
638
|
const _hoisted_1$1 = ["for"];
|
|
621
|
-
const _hoisted_2$1 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
|
|
639
|
+
const _hoisted_2$1 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
622
640
|
const __default__$1 = {
|
|
623
641
|
name: "VvRadio"
|
|
624
642
|
};
|
|
@@ -631,6 +649,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
631
649
|
const slots = useSlots();
|
|
632
650
|
const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
|
|
633
651
|
const hasId = useUniqueId(id);
|
|
652
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
634
653
|
const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
|
|
635
654
|
const input = ref();
|
|
636
655
|
const isDisabled = computed(() => disabled.value || readonly.value);
|
|
@@ -673,7 +692,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
673
692
|
readonly: readonly.value
|
|
674
693
|
}))
|
|
675
694
|
);
|
|
676
|
-
const {
|
|
695
|
+
const {
|
|
696
|
+
HintSlot,
|
|
697
|
+
hasHintLabelOrSlot,
|
|
698
|
+
hasInvalidLabelOrSlot,
|
|
699
|
+
hintSlotScope
|
|
700
|
+
} = HintSlotFactory(props, slots);
|
|
677
701
|
return (_ctx, _cache) => {
|
|
678
702
|
return openBlock(), createElementBlock("label", {
|
|
679
703
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -690,7 +714,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
690
714
|
disabled: unref(isDisabled),
|
|
691
715
|
value: unref(hasValue),
|
|
692
716
|
tabindex: unref(tabindex),
|
|
693
|
-
"aria-invalid": unref(isInvalid)
|
|
717
|
+
"aria-invalid": unref(isInvalid),
|
|
718
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
719
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
|
|
694
720
|
}, null, 8, _hoisted_2$1), [
|
|
695
721
|
[vModelRadio, unref(localModelValue)]
|
|
696
722
|
]),
|
|
@@ -698,9 +724,38 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
698
724
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
699
725
|
]),
|
|
700
726
|
createVNode(unref(HintSlot), {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
},
|
|
727
|
+
id: unref(hasHintId),
|
|
728
|
+
class: "vv-radio__hint"
|
|
729
|
+
}, createSlots({ _: 2 }, [
|
|
730
|
+
_ctx.$slots.hint ? {
|
|
731
|
+
name: "hint",
|
|
732
|
+
fn: withCtx(() => [
|
|
733
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
734
|
+
]),
|
|
735
|
+
key: "0"
|
|
736
|
+
} : void 0,
|
|
737
|
+
_ctx.$slots.loading ? {
|
|
738
|
+
name: "loading",
|
|
739
|
+
fn: withCtx(() => [
|
|
740
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
741
|
+
]),
|
|
742
|
+
key: "1"
|
|
743
|
+
} : void 0,
|
|
744
|
+
_ctx.$slots.valid ? {
|
|
745
|
+
name: "valid",
|
|
746
|
+
fn: withCtx(() => [
|
|
747
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
748
|
+
]),
|
|
749
|
+
key: "2"
|
|
750
|
+
} : void 0,
|
|
751
|
+
_ctx.$slots.invalid ? {
|
|
752
|
+
name: "invalid",
|
|
753
|
+
fn: withCtx(() => [
|
|
754
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
755
|
+
]),
|
|
756
|
+
key: "3"
|
|
757
|
+
} : void 0
|
|
758
|
+
]), 1032, ["id"])
|
|
704
759
|
], 10, _hoisted_1$1);
|
|
705
760
|
};
|
|
706
761
|
}
|
|
@@ -722,7 +777,9 @@ function useOptions(props) {
|
|
|
722
777
|
const getOptionLabel = (option) => {
|
|
723
778
|
if (typeof option !== "object" && option !== null)
|
|
724
779
|
return option;
|
|
725
|
-
return
|
|
780
|
+
return String(
|
|
781
|
+
typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value]
|
|
782
|
+
);
|
|
726
783
|
};
|
|
727
784
|
const getOptionValue = (option) => {
|
|
728
785
|
if (typeof option !== "object" && option !== null)
|
|
@@ -789,7 +846,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
789
846
|
value: getOptionValue(option)
|
|
790
847
|
};
|
|
791
848
|
};
|
|
792
|
-
const { HintSlot } = HintSlotFactory(props, slots);
|
|
849
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
|
|
793
850
|
return (_ctx, _cache) => {
|
|
794
851
|
return openBlock(), createElementBlock("fieldset", {
|
|
795
852
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -803,7 +860,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
803
860
|
return openBlock(), createBlock(_sfc_main$1, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
804
861
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
805
862
|
]),
|
|
806
|
-
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }
|
|
863
|
+
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
|
|
864
|
+
_ctx.$slots.hint ? {
|
|
865
|
+
name: "hint",
|
|
866
|
+
fn: withCtx(() => [
|
|
867
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
868
|
+
]),
|
|
869
|
+
key: "0"
|
|
870
|
+
} : void 0,
|
|
871
|
+
_ctx.$slots.loading ? {
|
|
872
|
+
name: "loading",
|
|
873
|
+
fn: withCtx(() => [
|
|
874
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
875
|
+
]),
|
|
876
|
+
key: "1"
|
|
877
|
+
} : void 0,
|
|
878
|
+
_ctx.$slots.valid ? {
|
|
879
|
+
name: "valid",
|
|
880
|
+
fn: withCtx(() => [
|
|
881
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
882
|
+
]),
|
|
883
|
+
key: "2"
|
|
884
|
+
} : void 0,
|
|
885
|
+
_ctx.$slots.invalid ? {
|
|
886
|
+
name: "invalid",
|
|
887
|
+
fn: withCtx(() => [
|
|
888
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
889
|
+
]),
|
|
890
|
+
key: "3"
|
|
891
|
+
} : void 0
|
|
892
|
+
]), 1024)
|
|
807
893
|
], 2);
|
|
808
894
|
};
|
|
809
895
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=l(e.vue,e.core,e.nanoid)}(this,(function(e,l,n){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{});const u=Symbol.for("radioGroup");function i(e,l,n){return n?d(e,n)===d(l,n):r(e,l)}function r(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const n=Array.isArray(e),t=Array.isArray(l);let o,a,u;if(n&&t){if(a=e.length,a!=l.length)return!1;for(o=a;0!=o--;)if(!r(e[o],l[o]))return!1;return!0}if(n!=t)return!1;const i=e instanceof Date,d=l instanceof Date;if(i!=d)return!1;if(i&&d)return e.getTime()==l.getTime();const v=e instanceof RegExp,s=l instanceof RegExp;if(v!=s)return!1;if(v&&s)return e.toString()==l.toString();const c=Object.keys(e);if(a=c.length,a!==Object.keys(l).length)return!1;for(o=a;0!=o--;)if(!Object.prototype.hasOwnProperty.call(l,c[o]))return!1;for(o=a;0!=o--;)if(u=c[o],!r(e[u],l[u]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const n=l.split(".");let t=e;for(let l=0,o=n.length;l<o;++l){if(null==e)return null;t=t[n[l]]}return t}}return null}function v(l){return null==(n=e.unref(l))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length;var n}function s(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function c(n,t){const{invalid:o,valid:a,hint:u,loading:i}=t,{hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,...y}=e.toRefs(n),g=d(y,"loading"),h=d(y,"loadingLabel"),S=e.computed((()=>!!m.value&&(!(!m.value||!o)||(!!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)||!(!(null==b?void 0:b.value)||v(b)))))),B=e.computed((()=>!!(r&&r.value||u))),V=e.computed((()=>!!(p&&p.value||a))),k=e.computed((()=>!!((null==g?void 0:g.value)&&i||(null==g?void 0:g.value)&&(null==h?void 0:h.value)))),A=e.computed((()=>B.value||V.value||S.value||k.value));return{hasInvalid:S,hasHint:B,hasValid:V,hasLoading:k,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(n){const t=e.computed((()=>{const e=l.toReactive({hintLabel:r,modelValue:c,valid:f,validLabel:p,invalid:m,invalidLabel:b,loading:g,loadingLabel:h,...n.params});return(null==m?void 0:m.value)?(null==o?void 0:o(e))||s(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==f?void 0:f.value)?(null==a?void 0:a(e))||s(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==g?void 0:g.value)?(null==i?void 0:i(e))||s(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==u?void 0:u(e))||s(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:A,hasInvalid:S,hasValid:V,hintContent:t}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const f={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},g={modifiers:[String,Array]},h={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};o.before;const B={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const k={...{...V,name:{type:String,required:!0}},...B,...f,...p,...h,...m,...y,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},A={...f,...p,...S,...h,...m,...y,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};a.button;const O=k;function j(l,n){const{id:t}=e.toRefs(l),{group:o,isInGroup:a,getGroupOrLocalRef:i}=function(l){const n=e.inject(l,void 0),t=e.computed((()=>!v(n)));return{group:n,isInGroup:t,getGroupOrLocalRef:function(l,t,o){if(null==n?void 0:n.value){const t=e.unref(n.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const a=e.toRef(t,l);return e.computed({get:()=>a.value,set(e){o&&o(`update:${l}`,e)}})}}}(u),r=i("modelValue",l,n),d=i("valid",l),s=i("invalid",l),c=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==o?void 0:o.value)?void 0:e.readonly.value))})),f=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==o?void 0:o.value)?void 0:e.disabled.value))}));return{id:t,group:o,isInGroup:a,modelValue:r,valid:d,invalid:s,readonly:c,disabled:f}}function L(l,n,t){return e.computed((()=>{const o={[l]:!0},a="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(o[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{o[`${l}--${n}`]=e.unref(t.value[n])})),o}))}const R=["for"],x=["id","name","disabled","value","tabindex","aria-invalid"],N=e.defineComponent({name:"VvRadio",props:O,emits:["click","update:modelValue","change","blur"],setup(l,{emit:t}){const o=l,a=e.useSlots(),{id:u,disabled:r,readonly:d,modelValue:v,valid:s,invalid:f}=j(o,t),p=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(u),m=e.computed((()=>y.value?-1:o.tabindex)),b=e.ref(),y=e.computed((()=>r.value||d.value)),g=e.computed((()=>!0===f.value||!0!==s.value&&void 0)),h=e.computed((()=>Array.isArray(v.value)?function(e,l){if(null!=e&&l&&l.length)for(const n of l)if(i(e,n))return!0;return!1}(o.value,v.value):i(o.value,v.value))),S=e.computed((()=>!["string","number","boolean"].includes(typeof o.value)||o.value)),B=e.computed({get:()=>h.value?S.value:null,set(e){Array.isArray(v.value)?v.value=[o.value]:v.value=o.value,t("change",e)}}),{modifiers:V}=e.toRefs(o),k=L("vv-radio",V,e.computed((()=>({valid:s.value,invalid:f.value,disabled:r.value,readonly:d.value})))),{HintSlot:A}=c(o,a);return(l,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(k)),for:e.unref(p)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),ref_key:"input",ref:b,"onUpdate:modelValue":n[0]||(n[0]=l=>e.isRef(B)?B.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(y),value:e.unref(S),tabindex:e.unref(m),"aria-invalid":e.unref(g)},null,8,x),[[e.vModelRadio,e.unref(B)]]),e.renderSlot(l.$slots,"default",{value:e.unref(v)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(A),{class:"vv-radio__hint",params:{value:e.unref(v)}},null,8,["params"])],10,R))}}),E=A;const _=["textContent"],C={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:E,emits:["update:modelValue","change"],setup(n,{emit:t}){const o=n,a=e.useSlots(),i=l.useVModel(o,"modelValue",t),{disabled:r,readonly:d,vertical:v,valid:s,invalid:f,modifiers:p}=e.toRefs(o);!function(l){if(Object.keys(l).some((n=>"key"!==n&&!e.isRef(l[n]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:u,modelValue:i,disabled:r,readonly:d,valid:s,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:n,labelKey:t,valueKey:o,disabledKey:a}=e.toRefs(l);return{options:n,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof o.value?o.value(e):e[o.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof a.value?a.value(e):e[a.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(o),y=L("vv-radio-group",p,e.computed((()=>({disabled:r.value,readonly:d.value,horizontal:!v.value,valid:s.value,invalid:f.value})))),{HintSlot:g}=c(o,a);return(l,n)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,_)):e.createCommentVNode("",!0),e.createElementVNode("div",C,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,n)=>(e.openBlock(),e.createBlock(N,e.mergeProps({key:n},((e,l)=>({id:`${o.name}_opt${l}`,name:o.name,label:m(e),value:b(e)}))(l,n)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(g),{class:"vv-radio-group__hint"})],2))}})}));
|
|
1
|
+
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvRadioGroup=l(e.vue,e.nanoid,e.core)}(this,(function(e,l,t){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const i=Symbol.for("radioGroup");function r(e,l,t){return t?d(e,t)===d(l,t):u(e,l)}function u(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),o=Array.isArray(l);let a,n,i;if(t&&o){if(n=e.length,n!=l.length)return!1;for(a=n;0!=a--;)if(!u(e[a],l[a]))return!1;return!0}if(t!=o)return!1;const r=e instanceof Date,d=l instanceof Date;if(r!=d)return!1;if(r&&d)return e.getTime()==l.getTime();const s=e instanceof RegExp,v=l instanceof RegExp;if(s!=v)return!1;if(s&&v)return e.toString()==l.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(l).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,c[a]))return!1;for(a=n;0!=a--;)if(i=c[a],!u(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let o=e;for(let l=0,a=t.length;l<a;++l){if(null==e)return null;o=o[t[l]]}return o}}return null}function s(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function v(l,t){const o=e.computed((()=>s(l.invalidLabel))),a=e.computed((()=>s(l.validLabel))),n=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(t.loading||n.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(t.invalid||o.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(t.valid||a.value)))),v=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(t.hint||i.value))),c=e.computed((()=>u.value||d.value||r.value||v.value)),f=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:o,validLabel:a,loadingLabel:n,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:v}),render(){var l,t,o,a,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:u,hasHintLabelOrSlot:v,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:f,HintSlot:p}}const c={valid:Boolean,validLabel:[String,Array]},f={invalid:Boolean,invalidLabel:[String,Array]},p={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),g={readonly:Boolean},y={modifiers:[String,Array]},h={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};a.before;const L={tabindex:{type:[String,Number],default:0}},B={id:[String,Number]};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const O={...{...B,name:{type:String,required:!0}},...L,...c,...f,...h,...m,...g,...y,...b,...p,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},k={...c,...f,...S,...h,...m,...g,...y,...b,...p,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function $(l){const t=e.inject(l,void 0),o=e.computed((()=>{return l=t,!(null==(o=e.unref(l))||""===o||Array.isArray(o)&&0===o.length||!(o instanceof Date)&&"object"==typeof o&&0===Object.keys(o).length);var l,o}));return{group:t,isInGroup:o,getGroupOrLocalRef:function(l,o,a){if(null==t?void 0:t.value){const o=e.unref(t.value)[l];return e.computed({get:()=>null==o?void 0:o.value,set(e){o.value=e}})}const n=e.toRef(o,l);return e.computed({get:()=>n.value,set(e){a&&a(`update:${l}`,e)}})}}}n.button;const V=O;function R(l,t,o){return e.computed((()=>{const a={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((t=>{a[`${l}--${t}`]=e.unref(o.value[t])})),a}))}const x=["for"],A=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],j=e.defineComponent({name:"VvRadio",props:V,emits:["click","update:modelValue","change","blur"],setup(t,{emit:o}){const a=t,n=e.useSlots(),{id:u,disabled:d,readonly:s,modelValue:c,valid:f,invalid:p}=function(l,t){const{id:o}=e.toRefs(l),{group:a,isInGroup:n,getGroupOrLocalRef:r}=$(i),u=r("modelValue",l,t),d=r("valid",l),s=r("invalid",l),v=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),c=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:o,group:a,isInGroup:n,modelValue:u,valid:d,invalid:s,readonly:v,disabled:c}}(a,o),m=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(u),b=e.computed((()=>`${m.value}-hint`)),g=e.computed((()=>h.value?-1:a.tabindex)),y=e.ref(),h=e.computed((()=>d.value||s.value)),S=e.computed((()=>!0===p.value||!0!==f.value&&void 0)),L=e.computed((()=>Array.isArray(c.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(r(e,t))return!0;return!1}(a.value,c.value):r(a.value,c.value))),B=e.computed((()=>!["string","number","boolean"].includes(typeof a.value)||a.value)),O=e.computed({get:()=>L.value?B.value:null,set(e){Array.isArray(c.value)?c.value=[a.value]:c.value=a.value,o("change",e)}}),{modifiers:k}=e.toRefs(a),V=R("vv-radio",k,e.computed((()=>({valid:f.value,invalid:p.value,disabled:d.value,readonly:s.value})))),{HintSlot:j,hasHintLabelOrSlot:P,hasInvalidLabelOrSlot:C,hintSlotScope:w}=v(a,n);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(V)),for:e.unref(m)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(m),ref_key:"input",ref:y,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(O)?O.value=l:null),type:"radio",class:"vv-radio__input",name:l.name,disabled:e.unref(h),value:e.unref(B),tabindex:e.unref(g),"aria-invalid":e.unref(S),"aria-describedby":e.unref(P)?e.unref(b):void 0,"aria-errormessage":e.unref(C)?e.unref(b):void 0},null,8,A),[[e.vModelRadio,e.unref(O)]]),e.renderSlot(l.$slots,"default",{value:e.unref(c)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(j),{id:e.unref(b),class:"vv-radio__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(w))))])),key:"3"}:void 0]),1032,["id"])],10,x))}}),P=k;const C=["textContent"],w={class:"vv-radio-group__wrapper"};return e.defineComponent({name:"VvRadioGroup",props:P,emits:["update:modelValue","change"],setup(l,{emit:o}){const a=l,n=e.useSlots(),r=t.useVModel(a,"modelValue",o),{disabled:u,readonly:d,vertical:s,valid:c,invalid:f,modifiers:p}=e.toRefs(a);!function(l){if(Object.keys(l).some((t=>"key"!==t&&!e.isRef(l[t]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:i,modelValue:r,disabled:u,readonly:d,valid:c,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:t,labelKey:o,valueKey:a,disabledKey:n}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof o.value?o.value(e):e[o.value]),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):e[a.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof n.value?n.value(e):e[n.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(a),g=R("vv-radio-group",p,e.computed((()=>({disabled:u.value,readonly:d.value,horizontal:!s.value,valid:c.value,invalid:f.value})))),{HintSlot:y,hintSlotScope:h}=v(a,n);return(l,t)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(g))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,C)):e.createCommentVNode("",!0),e.createElementVNode("div",w,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,t)=>(e.openBlock(),e.createBlock(j,e.mergeProps({key:t},((e,l)=>({id:`${a.name}_opt${l}`,name:a.name,label:m(e),value:b(e)}))(l,t)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(y),{class:"vv-radio-group__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(h))))])),key:"3"}:void 0]),1024)],2))}})}));
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { Option } from '../../types/generic';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
-
modelValue: (SymbolConstructor |
|
|
3
|
+
modelValue: (SymbolConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
4
4
|
name: {
|
|
5
5
|
type: StringConstructor;
|
|
6
6
|
required: boolean;
|
|
7
7
|
};
|
|
8
8
|
vertical: BooleanConstructor;
|
|
9
|
+
loading: BooleanConstructor;
|
|
10
|
+
loadingLabel: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
9
14
|
label: (StringConstructor | NumberConstructor)[];
|
|
10
15
|
modifiers: globalThis.PropType<string | string[]>;
|
|
11
16
|
readonly: BooleanConstructor;
|
|
@@ -31,16 +36,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
31
36
|
default: string;
|
|
32
37
|
};
|
|
33
38
|
invalid: BooleanConstructor;
|
|
34
|
-
invalidLabel: (
|
|
39
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
35
40
|
valid: BooleanConstructor;
|
|
36
|
-
validLabel: (
|
|
41
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
37
42
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
-
modelValue: (SymbolConstructor |
|
|
43
|
+
modelValue: (SymbolConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
39
44
|
name: {
|
|
40
45
|
type: StringConstructor;
|
|
41
46
|
required: boolean;
|
|
42
47
|
};
|
|
43
48
|
vertical: BooleanConstructor;
|
|
49
|
+
loading: BooleanConstructor;
|
|
50
|
+
loadingLabel: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
44
54
|
label: (StringConstructor | NumberConstructor)[];
|
|
45
55
|
modifiers: globalThis.PropType<string | string[]>;
|
|
46
56
|
readonly: BooleanConstructor;
|
|
@@ -66,14 +76,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
66
76
|
default: string;
|
|
67
77
|
};
|
|
68
78
|
invalid: BooleanConstructor;
|
|
69
|
-
invalidLabel: (
|
|
79
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
70
80
|
valid: BooleanConstructor;
|
|
71
|
-
validLabel: (
|
|
81
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
72
82
|
}>> & {
|
|
73
83
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
74
84
|
}, {
|
|
75
85
|
disabled: boolean;
|
|
76
86
|
options: (string | Option)[];
|
|
87
|
+
loading: boolean;
|
|
88
|
+
loadingLabel: string;
|
|
77
89
|
readonly: boolean;
|
|
78
90
|
hintLabel: string;
|
|
79
91
|
invalid: boolean;
|
|
@@ -82,8 +94,32 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
82
94
|
labelKey: string | Function;
|
|
83
95
|
valueKey: string | Function;
|
|
84
96
|
disabledKey: string | Function;
|
|
85
|
-
}>, {
|
|
86
|
-
default
|
|
97
|
+
}, {}>, {
|
|
98
|
+
default?(_: {}): any;
|
|
99
|
+
hint?(_: {
|
|
100
|
+
modelValue: any;
|
|
101
|
+
valid: boolean;
|
|
102
|
+
invalid: boolean;
|
|
103
|
+
loading: boolean;
|
|
104
|
+
}): any;
|
|
105
|
+
loading?(_: {
|
|
106
|
+
modelValue: any;
|
|
107
|
+
valid: boolean;
|
|
108
|
+
invalid: boolean;
|
|
109
|
+
loading: boolean;
|
|
110
|
+
}): any;
|
|
111
|
+
valid?(_: {
|
|
112
|
+
modelValue: any;
|
|
113
|
+
valid: boolean;
|
|
114
|
+
invalid: boolean;
|
|
115
|
+
loading: boolean;
|
|
116
|
+
}): any;
|
|
117
|
+
invalid?(_: {
|
|
118
|
+
modelValue: any;
|
|
119
|
+
valid: boolean;
|
|
120
|
+
invalid: boolean;
|
|
121
|
+
loading: boolean;
|
|
122
|
+
}): any;
|
|
87
123
|
}>;
|
|
88
124
|
export default _default;
|
|
89
125
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export declare const VvRadioGroupProps: {
|
|
2
|
-
modelValue: (SymbolConstructor |
|
|
2
|
+
modelValue: (SymbolConstructor | ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
3
3
|
name: {
|
|
4
4
|
type: StringConstructor;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
vertical: BooleanConstructor;
|
|
8
|
+
loading: BooleanConstructor;
|
|
9
|
+
loadingLabel: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
8
13
|
label: (StringConstructor | NumberConstructor)[];
|
|
9
14
|
modifiers: globalThis.PropType<string | string[]>;
|
|
10
15
|
readonly: BooleanConstructor;
|
|
@@ -30,8 +35,8 @@ export declare const VvRadioGroupProps: {
|
|
|
30
35
|
default: string;
|
|
31
36
|
};
|
|
32
37
|
invalid: BooleanConstructor;
|
|
33
|
-
invalidLabel: (
|
|
38
|
+
invalidLabel: (ArrayConstructor | StringConstructor)[];
|
|
34
39
|
valid: BooleanConstructor;
|
|
35
|
-
validLabel: (
|
|
40
|
+
validLabel: (ArrayConstructor | StringConstructor)[];
|
|
36
41
|
};
|
|
37
42
|
export declare const VvRadioGroupEvents: string[];
|