@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,202 +1,161 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtractPropTypes, Slots } from 'vue'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Merge
|
|
5
|
-
* @param {
|
|
4
|
+
* Merge array of string
|
|
5
|
+
* @param {string[] | string} items
|
|
6
6
|
* @returns {string}
|
|
7
7
|
*/
|
|
8
|
-
function joinLines(
|
|
9
|
-
if (Array.isArray(
|
|
10
|
-
return
|
|
8
|
+
function joinLines(items: string[] | string | unknown[] | undefined) {
|
|
9
|
+
if (Array.isArray(items)) {
|
|
10
|
+
return items.filter((item) => isString(item)).join(' ')
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return items
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
15
|
+
export type HintSlotProps = Readonly<
|
|
16
|
+
ExtractPropTypes<{
|
|
17
|
+
hintLabel: {
|
|
18
|
+
type: StringConstructor
|
|
19
|
+
default: ''
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
modelValue: null
|
|
23
|
+
valid: BooleanConstructor
|
|
24
|
+
validLabel: (StringConstructor | ArrayConstructor)[]
|
|
25
|
+
invalid: BooleanConstructor
|
|
26
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[]
|
|
27
|
+
loading: BooleanConstructor
|
|
28
|
+
loadingLabel: StringConstructor
|
|
29
|
+
}>
|
|
30
|
+
>
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* Return a vue component (HintSlot) to render and manage hint, errors, valid, loading state and messages
|
|
35
|
-
* @param {
|
|
34
|
+
* @param {HintSlotProps} parentProps vue props
|
|
36
35
|
* @param {Slots} parentSlots vue slots
|
|
37
36
|
* @returns {Component} vue component
|
|
38
37
|
*/
|
|
39
|
-
export function HintSlotFactory(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
hasLoading: Ref<boolean>
|
|
50
|
-
} {
|
|
51
|
-
// slots
|
|
52
|
-
const {
|
|
53
|
-
invalid: invalidSlot,
|
|
54
|
-
valid: validSlot,
|
|
55
|
-
hint: hintSlot,
|
|
56
|
-
loading: loadingSlot,
|
|
57
|
-
} = parentSlots
|
|
58
|
-
|
|
59
|
-
// props
|
|
60
|
-
const {
|
|
61
|
-
hintLabel,
|
|
62
|
-
modelValue,
|
|
63
|
-
valid,
|
|
64
|
-
validLabel,
|
|
65
|
-
invalid,
|
|
66
|
-
invalidLabel,
|
|
67
|
-
...otherProps
|
|
68
|
-
} = toRefs(parentProps)
|
|
69
|
-
|
|
70
|
-
const loading = resolveFieldData(otherProps, 'loading') as
|
|
71
|
-
| Ref<boolean>
|
|
72
|
-
| undefined
|
|
73
|
-
const loadingLabel = resolveFieldData(otherProps, 'loadingLabel') as
|
|
74
|
-
| Ref<string>
|
|
75
|
-
| undefined
|
|
76
|
-
|
|
77
|
-
const hasInvalid = computed(() => {
|
|
78
|
-
if (!invalid.value) {
|
|
79
|
-
return false
|
|
80
|
-
}
|
|
81
|
-
if (invalid.value && invalidSlot) {
|
|
82
|
-
return true
|
|
83
|
-
}
|
|
84
|
-
if (
|
|
85
|
-
invalidLabel?.value &&
|
|
86
|
-
Array.isArray(invalidLabel.value) &&
|
|
87
|
-
invalidLabel.value.length > 0
|
|
88
|
-
) {
|
|
89
|
-
return true
|
|
90
|
-
}
|
|
91
|
-
if (invalidLabel?.value && !isEmpty(invalidLabel)) {
|
|
92
|
-
return true
|
|
93
|
-
}
|
|
94
|
-
return false
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
const hasHint = computed(
|
|
98
|
-
() => !!((hintLabel && hintLabel.value) || hintSlot),
|
|
38
|
+
export function HintSlotFactory(props: HintSlotProps, slots: Slots) {
|
|
39
|
+
// label
|
|
40
|
+
const invalidLabel = computed(() => joinLines(props.invalidLabel))
|
|
41
|
+
const validLabel = computed(() => joinLines(props.validLabel))
|
|
42
|
+
const loadingLabel = computed(() => props.loadingLabel)
|
|
43
|
+
const hintLabel = computed(() => props.hintLabel)
|
|
44
|
+
|
|
45
|
+
// type
|
|
46
|
+
const hasLoadingLabelOrSlot = computed(() =>
|
|
47
|
+
Boolean(props.loading && (slots.loading || loadingLabel.value)),
|
|
99
48
|
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
49
|
+
const hasInvalidLabelOrSlot = computed(
|
|
50
|
+
() =>
|
|
51
|
+
!hasLoadingLabelOrSlot.value &&
|
|
52
|
+
Boolean(props.invalid && (slots.invalid || invalidLabel.value)),
|
|
103
53
|
)
|
|
104
|
-
|
|
105
|
-
const hasLoading = computed(
|
|
54
|
+
const hasValidLabelOrSlot = computed(
|
|
106
55
|
() =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
56
|
+
!hasLoadingLabelOrSlot.value &&
|
|
57
|
+
!hasInvalidLabelOrSlot.value &&
|
|
58
|
+
Boolean(props.valid && (slots.valid || validLabel.value)),
|
|
59
|
+
)
|
|
60
|
+
const hasHintLabelOrSlot = computed(
|
|
61
|
+
() =>
|
|
62
|
+
!hasLoadingLabelOrSlot.value &&
|
|
63
|
+
!hasInvalidLabelOrSlot.value &&
|
|
64
|
+
!hasValidLabelOrSlot.value &&
|
|
65
|
+
Boolean(slots.hint || hintLabel.value),
|
|
111
66
|
)
|
|
112
|
-
|
|
113
67
|
const isVisible = computed(
|
|
114
68
|
() =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
69
|
+
hasInvalidLabelOrSlot.value ||
|
|
70
|
+
hasValidLabelOrSlot.value ||
|
|
71
|
+
hasLoadingLabelOrSlot.value ||
|
|
72
|
+
hasHintLabelOrSlot.value,
|
|
119
73
|
)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
74
|
+
const hintSlotScope = computed(() => ({
|
|
75
|
+
modelValue: props.modelValue,
|
|
76
|
+
valid: props.valid,
|
|
77
|
+
invalid: props.invalid,
|
|
78
|
+
loading: props.loading,
|
|
79
|
+
}))
|
|
80
|
+
// component
|
|
81
|
+
const HintSlot = defineComponent({
|
|
82
|
+
name: 'HintSlot',
|
|
83
|
+
props: {
|
|
84
|
+
tag: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: 'small',
|
|
133
87
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
loadingSlot?.(slotProps) ||
|
|
166
|
-
joinLines(loadingLabel?.value) ||
|
|
167
|
-
hintLabel?.value
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
hintSlot?.(slotProps) ||
|
|
172
|
-
joinLines(hintLabel?.value) ||
|
|
173
|
-
hintLabel?.value
|
|
88
|
+
},
|
|
89
|
+
setup() {
|
|
90
|
+
return {
|
|
91
|
+
isVisible,
|
|
92
|
+
invalidLabel,
|
|
93
|
+
validLabel,
|
|
94
|
+
loadingLabel,
|
|
95
|
+
hintLabel,
|
|
96
|
+
hasInvalidLabelOrSlot,
|
|
97
|
+
hasValidLabelOrSlot,
|
|
98
|
+
hasLoadingLabelOrSlot,
|
|
99
|
+
hasHintLabelOrSlot,
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
render() {
|
|
103
|
+
if (this.isVisible) {
|
|
104
|
+
let role
|
|
105
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
106
|
+
role = 'alert'
|
|
107
|
+
}
|
|
108
|
+
if (this.hasValidLabelOrSlot) {
|
|
109
|
+
role = 'status'
|
|
110
|
+
}
|
|
111
|
+
if (this.hasLoadingLabelOrSlot) {
|
|
112
|
+
return h(
|
|
113
|
+
this.tag,
|
|
114
|
+
{
|
|
115
|
+
role,
|
|
116
|
+
},
|
|
117
|
+
this.$slots.loading?.() ?? this.loadingLabel,
|
|
174
118
|
)
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
return {
|
|
178
|
-
isVisible,
|
|
179
|
-
hasInvalid,
|
|
180
|
-
hasValid,
|
|
181
|
-
hintContent,
|
|
182
119
|
}
|
|
183
|
-
|
|
184
|
-
render() {
|
|
185
|
-
if (this.isVisible) {
|
|
120
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
186
121
|
return h(
|
|
187
|
-
|
|
122
|
+
this.tag,
|
|
188
123
|
{
|
|
189
|
-
role
|
|
190
|
-
? 'alert'
|
|
191
|
-
: this.hasValid
|
|
192
|
-
? 'status'
|
|
193
|
-
: undefined,
|
|
124
|
+
role,
|
|
194
125
|
},
|
|
195
|
-
this.
|
|
126
|
+
this.$slots.invalid?.() ??
|
|
127
|
+
this.$slots.invalid ??
|
|
128
|
+
this.invalidLabel,
|
|
196
129
|
)
|
|
197
130
|
}
|
|
198
|
-
|
|
131
|
+
if (this.hasValidLabelOrSlot) {
|
|
132
|
+
return h(
|
|
133
|
+
this.tag,
|
|
134
|
+
{
|
|
135
|
+
role,
|
|
136
|
+
},
|
|
137
|
+
this.$slots.valid?.() ?? this.validLabel,
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
return h(
|
|
141
|
+
this.tag,
|
|
142
|
+
{
|
|
143
|
+
role,
|
|
144
|
+
},
|
|
145
|
+
this.$slots.hint?.() ?? this.$slots.hint ?? this.hintLabel,
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
return null
|
|
199
149
|
},
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
hasInvalidLabelOrSlot,
|
|
154
|
+
hasHintLabelOrSlot,
|
|
155
|
+
hasValidLabelOrSlot,
|
|
156
|
+
hasLoadingLabelOrSlot,
|
|
157
|
+
hintSlotScope,
|
|
158
|
+
HintSlot,
|
|
200
159
|
}
|
|
201
160
|
}
|
|
202
161
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import mitt from 'mitt'
|
|
3
|
+
import { INJECTION_KEY_ALERT_GROUP } from '@/constants'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Share the alert group name with all its children.
|
|
7
|
+
* @param {Ref<string | undefined>} name the alert group name
|
|
8
|
+
*/
|
|
9
|
+
export function useProvideAlertGroup({
|
|
10
|
+
name,
|
|
11
|
+
}: {
|
|
12
|
+
name: Ref<string | undefined>
|
|
13
|
+
}) {
|
|
14
|
+
const bus = mitt<{
|
|
15
|
+
close: string
|
|
16
|
+
}>()
|
|
17
|
+
provide(INJECTION_KEY_ALERT_GROUP, {
|
|
18
|
+
name,
|
|
19
|
+
bus,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return bus
|
|
23
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'vue'
|
|
2
|
-
import type { Emitter, EventType } from 'mitt'
|
|
3
1
|
import {
|
|
4
|
-
type DropdownItemRole,
|
|
5
2
|
INJECTION_KEY_DROPDOWN_TRIGGER,
|
|
6
3
|
INJECTION_KEY_DROPDOWN_ACTION,
|
|
7
4
|
INJECTION_KEY_DROPDOWN_ITEM,
|
|
@@ -10,42 +7,20 @@ import {
|
|
|
10
7
|
/**
|
|
11
8
|
* Injects dropdown reference and the event bus
|
|
12
9
|
*/
|
|
13
|
-
export function useInjectedDropdownTrigger()
|
|
14
|
-
| {
|
|
15
|
-
id: Ref<string | number>
|
|
16
|
-
reference: Ref<HTMLElement | null>
|
|
17
|
-
bus: Emitter<Record<EventType, unknown>>
|
|
18
|
-
expanded: Ref<boolean>
|
|
19
|
-
aria: Ref<{
|
|
20
|
-
'aria-controls': string
|
|
21
|
-
'aria-haspopup': boolean
|
|
22
|
-
'aria-expanded': boolean
|
|
23
|
-
}>
|
|
24
|
-
}
|
|
25
|
-
| Record<string, never> {
|
|
10
|
+
export function useInjectedDropdownTrigger() {
|
|
26
11
|
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {})
|
|
27
12
|
}
|
|
28
13
|
|
|
29
14
|
/**
|
|
30
15
|
* Injects dropdown item role
|
|
31
16
|
*/
|
|
32
|
-
export function useInjectedDropdownItem()
|
|
33
|
-
| {
|
|
34
|
-
role: Ref<DropdownItemRole>
|
|
35
|
-
expanded: Ref<boolean>
|
|
36
|
-
}
|
|
37
|
-
| Record<string, never> {
|
|
17
|
+
export function useInjectedDropdownItem() {
|
|
38
18
|
return inject(INJECTION_KEY_DROPDOWN_ITEM, {})
|
|
39
19
|
}
|
|
40
20
|
|
|
41
21
|
/**
|
|
42
22
|
* Injects dropdown action role
|
|
43
23
|
*/
|
|
44
|
-
export function useInjectedDropdownAction()
|
|
45
|
-
| {
|
|
46
|
-
role: string
|
|
47
|
-
expanded: Ref<boolean>
|
|
48
|
-
}
|
|
49
|
-
| Record<string, never> {
|
|
24
|
+
export function useInjectedDropdownAction() {
|
|
50
25
|
return inject(INJECTION_KEY_DROPDOWN_ACTION, {})
|
|
51
26
|
}
|
|
@@ -28,22 +28,21 @@ export function useProvideDropdownTrigger({
|
|
|
28
28
|
'aria-expanded': boolean
|
|
29
29
|
}>
|
|
30
30
|
}) {
|
|
31
|
-
const bus = mitt
|
|
31
|
+
const bus = mitt<{
|
|
32
|
+
click: Event
|
|
33
|
+
mouseover: Event
|
|
34
|
+
mouseleave: Event
|
|
35
|
+
}>()
|
|
32
36
|
const component = defineComponent({
|
|
33
37
|
name: 'VvDropdownTriggerProvider',
|
|
34
|
-
provide() {
|
|
35
|
-
return {
|
|
36
|
-
[INJECTION_KEY_DROPDOWN_TRIGGER]: {
|
|
37
|
-
reference,
|
|
38
|
-
id,
|
|
39
|
-
expanded,
|
|
40
|
-
aria,
|
|
41
|
-
bus,
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
38
|
setup() {
|
|
46
|
-
|
|
39
|
+
provide(INJECTION_KEY_DROPDOWN_TRIGGER, {
|
|
40
|
+
reference,
|
|
41
|
+
id,
|
|
42
|
+
expanded,
|
|
43
|
+
aria,
|
|
44
|
+
bus,
|
|
45
|
+
})
|
|
47
46
|
},
|
|
48
47
|
render() {
|
|
49
48
|
return h(Fragment, {}, this.$slots.default?.())
|
|
@@ -86,10 +85,10 @@ export function useProvideDropdownItem({
|
|
|
86
85
|
export function useProvideDropdownAction({
|
|
87
86
|
expanded,
|
|
88
87
|
}: {
|
|
89
|
-
expanded
|
|
88
|
+
expanded?: Ref<boolean>
|
|
90
89
|
}) {
|
|
91
90
|
provide(INJECTION_KEY_DROPDOWN_ACTION, {
|
|
92
|
-
role: ActionRoles.menuitem,
|
|
91
|
+
role: ref(ActionRoles.menuitem),
|
|
93
92
|
expanded,
|
|
94
93
|
})
|
|
95
94
|
}
|
|
@@ -5,12 +5,14 @@ export function useOptions(props: any) {
|
|
|
5
5
|
const { options, labelKey, valueKey, disabledKey } = toRefs(props)
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line
|
|
8
|
-
const getOptionLabel = (option: string | Option) => {
|
|
8
|
+
const getOptionLabel = (option: string | Option): string => {
|
|
9
9
|
if (typeof option !== 'object' && option !== null) return option
|
|
10
10
|
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return String(
|
|
12
|
+
typeof labelKey.value === 'function'
|
|
13
|
+
? labelKey.value(option)
|
|
14
|
+
: option[labelKey.value],
|
|
15
|
+
)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const getOptionValue = (option: string | Option) => {
|
|
@@ -21,7 +23,7 @@ export function useOptions(props: any) {
|
|
|
21
23
|
: option[valueKey.value]
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
const getOptionDisabled = (option: string | Option) => {
|
|
26
|
+
const getOptionDisabled = (option: string | Option): boolean => {
|
|
25
27
|
if (typeof option !== 'object' && option !== null) return false
|
|
26
28
|
|
|
27
29
|
return typeof disabledKey.value === 'function'
|
|
@@ -30,7 +32,7 @@ export function useOptions(props: any) {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const getOptionGrouped = (option: string | Option) => {
|
|
33
|
-
|
|
35
|
+
if (typeof option !== 'object' && option !== null) return []
|
|
34
36
|
return option.options || []
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -39,6 +41,6 @@ export function useOptions(props: any) {
|
|
|
39
41
|
getOptionLabel,
|
|
40
42
|
getOptionValue,
|
|
41
43
|
getOptionDisabled,
|
|
42
|
-
getOptionGrouped
|
|
44
|
+
getOptionGrouped,
|
|
43
45
|
}
|
|
44
46
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue'
|
|
2
|
+
import type { Emitter } from 'mitt'
|
|
3
|
+
import type { Volver } from './Volver'
|
|
4
|
+
|
|
1
5
|
export const DEFAULT_ICONIFY_PROVIDER = 'vv'
|
|
2
6
|
|
|
3
7
|
export enum Side {
|
|
@@ -60,7 +64,7 @@ export enum AnchorTarget {
|
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
// volver
|
|
63
|
-
export const INJECTION_KEY_VOLVER = Symbol.for('volver')
|
|
67
|
+
export const INJECTION_KEY_VOLVER = Symbol.for('volver') as InjectionKey<Volver>
|
|
64
68
|
|
|
65
69
|
// groups
|
|
66
70
|
export const INJECTION_KEY_BUTTON_GROUP = Symbol.for('buttonGroup')
|
|
@@ -69,6 +73,40 @@ export const INJECTION_KEY_CHECK_GROUP = Symbol.for('checkGroup')
|
|
|
69
73
|
export const INJECTION_KEY_ACCORDION_GROUP = Symbol.for('accordionGroup')
|
|
70
74
|
|
|
71
75
|
// dropdown
|
|
72
|
-
export const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
export const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
77
|
+
'dropdownTrigger',
|
|
78
|
+
) as InjectionKey<{
|
|
79
|
+
id?: Ref<string | number>
|
|
80
|
+
reference?: Ref<HTMLElement | null>
|
|
81
|
+
bus?: Emitter<{
|
|
82
|
+
click: Event
|
|
83
|
+
mouseover: Event
|
|
84
|
+
mouseleave: Event
|
|
85
|
+
}>
|
|
86
|
+
expanded?: Ref<boolean>
|
|
87
|
+
aria?: Ref<{
|
|
88
|
+
'aria-controls': string
|
|
89
|
+
'aria-haspopup': boolean
|
|
90
|
+
'aria-expanded': boolean
|
|
91
|
+
}>
|
|
92
|
+
}>
|
|
93
|
+
export const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
|
|
94
|
+
'dropdownItem',
|
|
95
|
+
) as InjectionKey<{
|
|
96
|
+
role?: Ref<`${DropdownItemRole}`>
|
|
97
|
+
expanded?: Ref<boolean>
|
|
98
|
+
}>
|
|
99
|
+
export const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
|
|
100
|
+
'dropdownAction',
|
|
101
|
+
) as InjectionKey<{
|
|
102
|
+
role?: Ref<`${ActionRoles}`>
|
|
103
|
+
expanded?: Ref<boolean>
|
|
104
|
+
}>
|
|
105
|
+
|
|
106
|
+
// alert
|
|
107
|
+
export const INJECTION_KEY_ALERT_GROUP = Symbol.for(
|
|
108
|
+
'alertGroup',
|
|
109
|
+
) as InjectionKey<{
|
|
110
|
+
name?: Ref<string | undefined>
|
|
111
|
+
bus?: Emitter<{ close: string }>
|
|
112
|
+
}>
|
package/src/props/index.ts
CHANGED
|
@@ -126,7 +126,7 @@ export const ModifiersProps = {
|
|
|
126
126
|
/**
|
|
127
127
|
* Component BEM modifiers
|
|
128
128
|
*/
|
|
129
|
-
modifiers: [String, Array] as PropType<string |
|
|
129
|
+
modifiers: [String, Array] as PropType<string | string[]>,
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export const HintProps = {
|
|
@@ -138,7 +138,7 @@ export const OptionsProps = {
|
|
|
138
138
|
* List of options, can be string[] or object[]
|
|
139
139
|
*/
|
|
140
140
|
options: {
|
|
141
|
-
type: Array as PropType<
|
|
141
|
+
type: Array as PropType<(Option | string)[]>,
|
|
142
142
|
default: () => [],
|
|
143
143
|
},
|
|
144
144
|
/**
|
|
@@ -302,11 +302,11 @@ export const DropdownProps = {
|
|
|
302
302
|
default: false,
|
|
303
303
|
},
|
|
304
304
|
/**
|
|
305
|
-
*
|
|
305
|
+
* Keep open dropdown on click outside
|
|
306
306
|
*/
|
|
307
|
-
|
|
307
|
+
keepOpen: {
|
|
308
308
|
type: Boolean,
|
|
309
|
-
default:
|
|
309
|
+
default: false,
|
|
310
310
|
},
|
|
311
311
|
/**
|
|
312
312
|
* Autofocus first item on dropdown open
|
|
@@ -406,6 +406,7 @@ export const CheckboxRadioProps = {
|
|
|
406
406
|
...ReadonlyProps,
|
|
407
407
|
...ModifiersProps,
|
|
408
408
|
...LabelProps,
|
|
409
|
+
...LoadingProps,
|
|
409
410
|
/**
|
|
410
411
|
* Input value
|
|
411
412
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -426,6 +427,7 @@ export const CheckboxRadioGroupProps = {
|
|
|
426
427
|
...ReadonlyProps,
|
|
427
428
|
...ModifiersProps,
|
|
428
429
|
...LabelProps,
|
|
430
|
+
...LoadingProps,
|
|
429
431
|
/**
|
|
430
432
|
* Input value
|
|
431
433
|
*/
|
|
@@ -61,13 +61,16 @@ export const getStyleNames = function (kebabName: string) {
|
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
if (kebabName === 'vv-accordion-group') {
|
|
64
|
-
return ['vv-accordion
|
|
64
|
+
return ['vv-accordion', 'vv-accordion-group']
|
|
65
65
|
}
|
|
66
66
|
if (kebabName === 'vv-checkbox-group') {
|
|
67
|
-
return ['vv-checkbox
|
|
67
|
+
return ['vv-checkbox', 'vv-checkbox-group']
|
|
68
68
|
}
|
|
69
69
|
if (kebabName === 'vv-radio-group') {
|
|
70
|
-
return ['vv-radio
|
|
70
|
+
return ['vv-radio', 'vv-radio-group']
|
|
71
|
+
}
|
|
72
|
+
if (kebabName === 'vv-alert-group') {
|
|
73
|
+
return ['vv-alert', 'vv-alert-group']
|
|
71
74
|
}
|
|
72
75
|
if (kebabName === 'v-tooltip') {
|
|
73
76
|
return ['vv-tooltip']
|