@volverjs/ui-vue 0.0.6-beta.6 → 0.0.6
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 -5
- package/auto-imports.d.ts +11 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +220 -4
- 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 +1 -4
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +221 -8
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +6 -6
- package/dist/components/VvAccordionGroup/index.d.ts +2 -5
- 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 +3 -3
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +3 -3
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
- 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 +3 -3
- package/dist/components/VvButton/VvButton.es.js +39 -29
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +13 -13
- package/dist/components/VvButton/index.d.ts +2 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +4 -4
- 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 +5 -5
- 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 +46 -10
- package/dist/components/VvCheckbox/index.d.ts +8 -3
- 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 +271 -174
- 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 +44 -33
- 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 +21 -17
- 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 +1 -1
- 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 +25 -19
- 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 +2 -2
- 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 +165 -141
- 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 +12 -8
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNavItemTitle/VvNavItemTitle.vue.d.ts +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.d.ts +1 -1
- 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 +46 -10
- package/dist/components/VvRadio/index.d.ts +8 -3
- 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 +166 -140
- 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 +12 -8
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +163 -139
- 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 +1066 -768
- 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/useOptions.d.ts +2 -2
- package/dist/composables/useVolver.d.ts +1 -2
- package/dist/constants.d.ts +33 -4
- 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 +2 -33
- package/dist/stories/Avatar/Avatar.stories.d.ts +7 -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 +0 -6
- package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -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 +1 -18
- 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 +0 -3
- package/dist/stories/Nav/Nav.stories.d.ts +6 -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.stories.d.ts +6 -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/package.json +68 -52
- 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 +2 -4
- package/src/components/VvAccordionGroup/index.ts +3 -4
- 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/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 +9 -3
- 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 +2 -2
- package/src/components/VvInputText/VvInputText.vue +26 -9
- 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/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 +5 -3
- 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 +7 -6
- package/src/stories/Avatar/Avatar.stories.ts +42 -0
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- 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.stories.ts +35 -0
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +31 -0
- package/src/stories/AvatarGroup/{AvatarGroupSlotDefault.stories.mdx → AvatarGroupSlotDefault.stories.ts} +24 -30
- 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 +2 -11
- 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.stories.ts +33 -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.stories.ts +70 -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/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/Avatar/Avatar.stories.mdx +0 -40
- package/src/stories/Avatar/AvatarBadge.stories.mdx +0 -41
- package/src/stories/Avatar/AvatarModifiers.stories.mdx +0 -87
- package/src/stories/Avatar/AvatarSlotDefault.stories.mdx +0 -29
- package/src/stories/AvatarGroup/AvatarGroup.stories.mdx +0 -30
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.mdx +0 -24
- 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 -112
- 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/Nav/Nav.stories.mdx +0 -28
- package/src/stories/Nav/NavModifiers.stories.mdx +0 -48
- 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/Tab/Tab.stories.mdx +0 -65
- 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, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, nextTick, Transition, normalizeStyle, vShow, vModelSelect,
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, createSlots, nextTick, Transition, toHandlers, normalizeStyle, vShow, vModelSelect, vModelText, vModelDynamic, vModelRadio } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
|
-
import { useToggle, useStorage,
|
|
3
|
+
import { useToggle, useStorage, useVModel, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced } from "@vueuse/core";
|
|
4
4
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
5
5
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
6
6
|
import mitt from "mitt";
|
|
@@ -69,495 +69,15 @@ const INJECTION_KEY_BUTTON_GROUP = Symbol.for("buttonGroup");
|
|
|
69
69
|
const INJECTION_KEY_RADIO_GROUP = Symbol.for("radioGroup");
|
|
70
70
|
const INJECTION_KEY_CHECK_GROUP = Symbol.for("checkGroup");
|
|
71
71
|
const INJECTION_KEY_ACCORDION_GROUP = Symbol.for("accordionGroup");
|
|
72
|
-
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function deepEquals(a, b) {
|
|
82
|
-
if (a === b)
|
|
83
|
-
return true;
|
|
84
|
-
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
85
|
-
const arrA = Array.isArray(a);
|
|
86
|
-
const arrB = Array.isArray(b);
|
|
87
|
-
let i, length, key;
|
|
88
|
-
if (arrA && arrB) {
|
|
89
|
-
length = a.length;
|
|
90
|
-
if (length != b.length)
|
|
91
|
-
return false;
|
|
92
|
-
for (i = length; i-- !== 0; )
|
|
93
|
-
if (!deepEquals(a[i], b[i]))
|
|
94
|
-
return false;
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
if (arrA != arrB)
|
|
98
|
-
return false;
|
|
99
|
-
const dateA = a instanceof Date, dateB = b instanceof Date;
|
|
100
|
-
if (dateA != dateB)
|
|
101
|
-
return false;
|
|
102
|
-
if (dateA && dateB)
|
|
103
|
-
return a.getTime() == b.getTime();
|
|
104
|
-
const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
|
|
105
|
-
if (regexpA != regexpB)
|
|
106
|
-
return false;
|
|
107
|
-
if (regexpA && regexpB)
|
|
108
|
-
return a.toString() == b.toString();
|
|
109
|
-
const keys = Object.keys(a);
|
|
110
|
-
length = keys.length;
|
|
111
|
-
if (length !== Object.keys(b).length)
|
|
112
|
-
return false;
|
|
113
|
-
for (i = length; i-- !== 0; )
|
|
114
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
115
|
-
return false;
|
|
116
|
-
for (i = length; i-- !== 0; ) {
|
|
117
|
-
key = keys[i];
|
|
118
|
-
if (!deepEquals(a[key], b[key]))
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
return a !== a && b !== b;
|
|
124
|
-
}
|
|
125
|
-
function resolveFieldData(data, field) {
|
|
126
|
-
if (data && Object.keys(data).length && field) {
|
|
127
|
-
if (field.indexOf(".") === -1) {
|
|
128
|
-
return data[field];
|
|
129
|
-
} else {
|
|
130
|
-
const fields = field.split(".");
|
|
131
|
-
let value = data;
|
|
132
|
-
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
133
|
-
if (data == null) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
value = value[fields[i]];
|
|
137
|
-
}
|
|
138
|
-
return value;
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function findIndexInList(value, list) {
|
|
145
|
-
let index = -1;
|
|
146
|
-
if (list) {
|
|
147
|
-
for (let i = 0; i < list.length; i++) {
|
|
148
|
-
if (equals(list[i], value)) {
|
|
149
|
-
index = i;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return index;
|
|
155
|
-
}
|
|
156
|
-
function contains(value, list) {
|
|
157
|
-
if (value != null && list && list.length) {
|
|
158
|
-
for (const val of list) {
|
|
159
|
-
if (equals(value, val)) {
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
function isEmpty(value) {
|
|
167
|
-
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
168
|
-
}
|
|
169
|
-
function removeFromList(value, list) {
|
|
170
|
-
const indexElToRemove = findIndexInList(value, list);
|
|
171
|
-
if (indexElToRemove > -1) {
|
|
172
|
-
return list.filter((el, elIndex) => elIndex !== indexElToRemove);
|
|
173
|
-
} else {
|
|
174
|
-
return list;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function isString(value) {
|
|
178
|
-
return typeof value === "string" || value instanceof String;
|
|
179
|
-
}
|
|
180
|
-
function useInjectedGroupState(groupKey) {
|
|
181
|
-
const group = inject(groupKey, void 0);
|
|
182
|
-
const isInGroup = computed(() => !isEmpty(group));
|
|
183
|
-
function getGroupOrLocalRef(propName, props, emit) {
|
|
184
|
-
if (group == null ? void 0 : group.value) {
|
|
185
|
-
const groupPropValue = unref(group.value)[propName];
|
|
186
|
-
return computed({
|
|
187
|
-
get() {
|
|
188
|
-
return groupPropValue == null ? void 0 : groupPropValue.value;
|
|
189
|
-
},
|
|
190
|
-
set(value) {
|
|
191
|
-
groupPropValue.value = value;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
const propRef = toRef(props, propName);
|
|
196
|
-
return computed({
|
|
197
|
-
get() {
|
|
198
|
-
return propRef.value;
|
|
199
|
-
},
|
|
200
|
-
set(value) {
|
|
201
|
-
if (emit)
|
|
202
|
-
emit(`update:${propName}`, value);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
group,
|
|
208
|
-
isInGroup,
|
|
209
|
-
getGroupOrLocalRef
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
const VvAccordionProps = {
|
|
213
|
-
/**
|
|
214
|
-
* Accordion name
|
|
215
|
-
*/
|
|
216
|
-
name: String,
|
|
217
|
-
/**
|
|
218
|
-
* Header title
|
|
219
|
-
*/
|
|
220
|
-
title: String,
|
|
221
|
-
/**
|
|
222
|
-
* Content text
|
|
223
|
-
*/
|
|
224
|
-
content: String,
|
|
225
|
-
/**
|
|
226
|
-
* (Optional) Defines if item is open. Event "update:modelValue" is emitted on accordion header click
|
|
227
|
-
*/
|
|
228
|
-
modelValue: {
|
|
229
|
-
type: Boolean,
|
|
230
|
-
default: void 0
|
|
231
|
-
},
|
|
232
|
-
/**
|
|
233
|
-
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion--'
|
|
234
|
-
*/
|
|
235
|
-
modifiers: [String, Array],
|
|
236
|
-
/**
|
|
237
|
-
* If true, the accordion will be disabled
|
|
238
|
-
*/
|
|
239
|
-
disabled: Boolean,
|
|
240
|
-
/**
|
|
241
|
-
* If true, the accordion will be opened by default
|
|
242
|
-
*/
|
|
243
|
-
not: Boolean
|
|
244
|
-
};
|
|
245
|
-
const VvAccordionEvents = ["update:modelValue"];
|
|
246
|
-
function useGroupProps$3(props, emit) {
|
|
247
|
-
const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(
|
|
248
|
-
INJECTION_KEY_ACCORDION_GROUP
|
|
249
|
-
);
|
|
250
|
-
const { title, content } = toRefs(props);
|
|
251
|
-
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
252
|
-
const not = getGroupOrLocalRef("not", props);
|
|
253
|
-
const collapse = getGroupOrLocalRef("collapse", props);
|
|
254
|
-
const disabled = computed(
|
|
255
|
-
() => {
|
|
256
|
-
var _a;
|
|
257
|
-
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
258
|
-
}
|
|
259
|
-
);
|
|
260
|
-
const modifiers = computed(() => {
|
|
261
|
-
let localModifiers = props.modifiers;
|
|
262
|
-
let groupModifiers = group == null ? void 0 : group.value.modifiers.value;
|
|
263
|
-
const toReturn = /* @__PURE__ */ new Set();
|
|
264
|
-
if (localModifiers) {
|
|
265
|
-
if (!Array.isArray(localModifiers)) {
|
|
266
|
-
localModifiers = localModifiers.split(" ");
|
|
267
|
-
}
|
|
268
|
-
localModifiers.forEach((modifier) => toReturn.add(modifier));
|
|
269
|
-
}
|
|
270
|
-
if (groupModifiers) {
|
|
271
|
-
if (!Array.isArray(groupModifiers)) {
|
|
272
|
-
groupModifiers = groupModifiers.split(" ");
|
|
273
|
-
}
|
|
274
|
-
groupModifiers.forEach((modifier) => toReturn.add(modifier));
|
|
275
|
-
}
|
|
276
|
-
return Array.from(toReturn);
|
|
277
|
-
});
|
|
278
|
-
return {
|
|
279
|
-
// group props
|
|
280
|
-
modelValue,
|
|
281
|
-
not,
|
|
282
|
-
isInGroup,
|
|
283
|
-
group,
|
|
284
|
-
collapse,
|
|
285
|
-
modifiers,
|
|
286
|
-
disabled,
|
|
287
|
-
// local props
|
|
288
|
-
title,
|
|
289
|
-
content
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
function useModifiers(prefix, modifiers, others) {
|
|
293
|
-
return computed(() => {
|
|
294
|
-
const toReturn = {
|
|
295
|
-
[prefix]: true
|
|
296
|
-
};
|
|
297
|
-
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
298
|
-
if (modifiersArray) {
|
|
299
|
-
if (Array.isArray(modifiersArray)) {
|
|
300
|
-
modifiersArray.forEach((modifier) => {
|
|
301
|
-
if (modifier) {
|
|
302
|
-
toReturn[`${prefix}--${modifier}`] = true;
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
if (others) {
|
|
308
|
-
Object.keys(others.value).forEach((key) => {
|
|
309
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
return toReturn;
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
const _hoisted_1$f = ["id", "open"];
|
|
316
|
-
const _hoisted_2$c = ["aria-controls", "aria-expanded"];
|
|
317
|
-
const _hoisted_3$6 = ["aria-hidden"];
|
|
318
|
-
const __default__$m = {
|
|
319
|
-
name: "VvAccordion"
|
|
320
|
-
};
|
|
321
|
-
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
322
|
-
...__default__$m,
|
|
323
|
-
props: VvAccordionProps,
|
|
324
|
-
emits: VvAccordionEvents,
|
|
325
|
-
setup(__props, { emit }) {
|
|
326
|
-
const props = __props;
|
|
327
|
-
const attrs = useAttrs();
|
|
328
|
-
const accordionName = computed(
|
|
329
|
-
() => props.name || (attrs == null ? void 0 : attrs.id) || nanoid()
|
|
330
|
-
);
|
|
331
|
-
const {
|
|
332
|
-
modifiers,
|
|
333
|
-
title,
|
|
334
|
-
content,
|
|
335
|
-
disabled,
|
|
336
|
-
collapse,
|
|
337
|
-
modelValue,
|
|
338
|
-
isInGroup,
|
|
339
|
-
not
|
|
340
|
-
} = useGroupProps$3(props, emit);
|
|
341
|
-
const localModelValue = ref(false);
|
|
342
|
-
const isOpen = computed({
|
|
343
|
-
get: () => {
|
|
344
|
-
let toReturn = modelValue.value;
|
|
345
|
-
if (isInGroup.value) {
|
|
346
|
-
if (collapse.value && Array.isArray(modelValue.value)) {
|
|
347
|
-
toReturn = modelValue.value.includes(accordionName.value);
|
|
348
|
-
} else {
|
|
349
|
-
toReturn = modelValue.value === accordionName.value;
|
|
350
|
-
}
|
|
351
|
-
} else if (modelValue.value === void 0) {
|
|
352
|
-
toReturn = localModelValue.value;
|
|
353
|
-
}
|
|
354
|
-
return not.value ? !toReturn : toReturn;
|
|
355
|
-
},
|
|
356
|
-
set: (newValue) => {
|
|
357
|
-
if (not.value) {
|
|
358
|
-
newValue = !newValue;
|
|
359
|
-
}
|
|
360
|
-
if (isInGroup.value) {
|
|
361
|
-
if (collapse.value && Array.isArray(modelValue.value)) {
|
|
362
|
-
if (newValue) {
|
|
363
|
-
modelValue.value.push(accordionName.value);
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
modelValue.value = modelValue.value.filter(
|
|
367
|
-
(name) => name !== accordionName.value
|
|
368
|
-
);
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
modelValue.value = newValue ? accordionName.value : null;
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
if (modelValue.value === void 0 && typeof newValue === "boolean") {
|
|
375
|
-
localModelValue.value = newValue;
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
modelValue.value = newValue;
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
const bemCssClasses = useModifiers(
|
|
382
|
-
"vv-accordion",
|
|
383
|
-
modifiers,
|
|
384
|
-
computed(() => ({
|
|
385
|
-
disabled: disabled.value
|
|
386
|
-
}))
|
|
387
|
-
);
|
|
388
|
-
const onClick = useToggle(isOpen);
|
|
389
|
-
return (_ctx, _cache) => {
|
|
390
|
-
return openBlock(), createElementBlock("details", {
|
|
391
|
-
id: unref(accordionName),
|
|
392
|
-
class: normalizeClass(unref(bemCssClasses)),
|
|
393
|
-
open: unref(isOpen)
|
|
394
|
-
}, [
|
|
395
|
-
createElementVNode("summary", {
|
|
396
|
-
"aria-controls": unref(accordionName),
|
|
397
|
-
"aria-expanded": unref(isOpen),
|
|
398
|
-
class: "vv-accordion__summary",
|
|
399
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
|
|
400
|
-
}, [
|
|
401
|
-
renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
402
|
-
createTextVNode(toDisplayString(unref(title)), 1)
|
|
403
|
-
])
|
|
404
|
-
], 8, _hoisted_2$c),
|
|
405
|
-
createElementVNode("div", {
|
|
406
|
-
"aria-hidden": !unref(isOpen),
|
|
407
|
-
class: "vv-accordion__content"
|
|
408
|
-
}, [
|
|
409
|
-
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
410
|
-
createTextVNode(toDisplayString(unref(content)), 1)
|
|
411
|
-
])
|
|
412
|
-
], 8, _hoisted_3$6)
|
|
413
|
-
], 10, _hoisted_1$f);
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
const VvAccordionGroupProps = {
|
|
418
|
-
/**
|
|
419
|
-
* VModel
|
|
420
|
-
*/
|
|
421
|
-
modelValue: [String, Array],
|
|
422
|
-
/**
|
|
423
|
-
* Accordion items
|
|
424
|
-
* @type VvAccordionGroupItem
|
|
425
|
-
*/
|
|
426
|
-
items: {
|
|
427
|
-
type: Array,
|
|
428
|
-
default: () => []
|
|
429
|
-
},
|
|
430
|
-
/**
|
|
431
|
-
* If true, accordion items stay open when another item is opened
|
|
432
|
-
*/
|
|
433
|
-
collapse: Boolean,
|
|
434
|
-
/**
|
|
435
|
-
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion-group--'
|
|
436
|
-
*/
|
|
437
|
-
modifiers: [String, Array],
|
|
438
|
-
/**
|
|
439
|
-
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion--'
|
|
440
|
-
*/
|
|
441
|
-
itemModifiers: {
|
|
442
|
-
type: [String, Array],
|
|
443
|
-
default: ""
|
|
444
|
-
},
|
|
445
|
-
/**
|
|
446
|
-
* If true, the accordion items will be disabled
|
|
447
|
-
*/
|
|
448
|
-
disabled: Boolean,
|
|
449
|
-
/**
|
|
450
|
-
* If true, the accordion items will be opened by default
|
|
451
|
-
*/
|
|
452
|
-
not: Boolean,
|
|
453
|
-
/**
|
|
454
|
-
* Enable local storage persistence
|
|
455
|
-
*/
|
|
456
|
-
storeKey: String
|
|
457
|
-
};
|
|
458
|
-
const VvAccordionGroupEvents = ["update:modelValue"];
|
|
459
|
-
function useProvideGroupState(groupState) {
|
|
460
|
-
if (Object.keys(groupState).some(
|
|
461
|
-
(k) => k !== "key" && !isRef(groupState[k])
|
|
462
|
-
))
|
|
463
|
-
throw Error("One or more groupState props aren't ref.");
|
|
464
|
-
provide(
|
|
465
|
-
groupState.key,
|
|
466
|
-
computed(() => groupState)
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
const __default__$l = {
|
|
470
|
-
name: "VvAccordionGroup"
|
|
471
|
-
};
|
|
472
|
-
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
473
|
-
...__default__$l,
|
|
474
|
-
props: VvAccordionGroupProps,
|
|
475
|
-
emits: VvAccordionGroupEvents,
|
|
476
|
-
setup(__props, { emit }) {
|
|
477
|
-
const props = __props;
|
|
478
|
-
const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
|
|
479
|
-
watchEffect(() => {
|
|
480
|
-
if (typeof props.modelValue === "string" && collapse.value) {
|
|
481
|
-
console.warn(
|
|
482
|
-
`[VvAccordionGroup]: modelValue is a string but collapse is true.`
|
|
483
|
-
);
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
let localModelValue = ref([]);
|
|
487
|
-
watch(
|
|
488
|
-
() => props.storeKey,
|
|
489
|
-
(newKey) => {
|
|
490
|
-
if (newKey) {
|
|
491
|
-
localModelValue = useStorage(newKey, localModelValue.value);
|
|
492
|
-
} else {
|
|
493
|
-
localModelValue = ref([]);
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{ immediate: true }
|
|
497
|
-
);
|
|
498
|
-
const modelValue = computed({
|
|
499
|
-
get: () => {
|
|
500
|
-
var _a;
|
|
501
|
-
if (props.modelValue !== void 0) {
|
|
502
|
-
if (!collapse.value) {
|
|
503
|
-
return Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
|
|
504
|
-
}
|
|
505
|
-
return props.modelValue;
|
|
506
|
-
}
|
|
507
|
-
return !collapse.value ? (_a = localModelValue.value) == null ? void 0 : _a[0] : localModelValue.value;
|
|
508
|
-
},
|
|
509
|
-
set: (newValue) => {
|
|
510
|
-
if (props.modelValue !== void 0) {
|
|
511
|
-
if ((Array.isArray(props.modelValue) || collapse.value) && !Array.isArray(newValue)) {
|
|
512
|
-
newValue = [newValue];
|
|
513
|
-
}
|
|
514
|
-
return emit("update:modelValue", newValue);
|
|
515
|
-
}
|
|
516
|
-
localModelValue.value = Array.isArray(newValue) ? newValue : [newValue];
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
useProvideGroupState({
|
|
520
|
-
key: INJECTION_KEY_ACCORDION_GROUP,
|
|
521
|
-
modelValue,
|
|
522
|
-
disabled,
|
|
523
|
-
collapse,
|
|
524
|
-
modifiers: itemModifiers,
|
|
525
|
-
not
|
|
526
|
-
});
|
|
527
|
-
const bemCssClasses = useModifiers(
|
|
528
|
-
"vv-accordion-group",
|
|
529
|
-
modifiers,
|
|
530
|
-
computed(() => ({
|
|
531
|
-
disabled: disabled.value
|
|
532
|
-
}))
|
|
533
|
-
);
|
|
534
|
-
return (_ctx, _cache) => {
|
|
535
|
-
return openBlock(), createElementBlock("div", {
|
|
536
|
-
class: normalizeClass(unref(bemCssClasses))
|
|
537
|
-
}, [
|
|
538
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
539
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
|
|
540
|
-
return openBlock(), createBlock(_sfc_main$m, mergeProps({
|
|
541
|
-
key: item.title
|
|
542
|
-
}, {
|
|
543
|
-
name: item.name,
|
|
544
|
-
title: item.title,
|
|
545
|
-
content: item.content
|
|
546
|
-
}), {
|
|
547
|
-
header: withCtx((data) => [
|
|
548
|
-
renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
549
|
-
]),
|
|
550
|
-
details: withCtx((data) => [
|
|
551
|
-
renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
552
|
-
]),
|
|
553
|
-
_: 2
|
|
554
|
-
}, 1040);
|
|
555
|
-
}), 128))
|
|
556
|
-
])
|
|
557
|
-
], 2);
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
});
|
|
72
|
+
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
73
|
+
"dropdownTrigger"
|
|
74
|
+
);
|
|
75
|
+
const INJECTION_KEY_DROPDOWN_ITEM = Symbol.for(
|
|
76
|
+
"dropdownItem"
|
|
77
|
+
);
|
|
78
|
+
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
|
|
79
|
+
"dropdownAction"
|
|
80
|
+
);
|
|
561
81
|
const LinkProps = {
|
|
562
82
|
/**
|
|
563
83
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
@@ -817,11 +337,11 @@ const DropdownProps = {
|
|
|
817
337
|
default: false
|
|
818
338
|
},
|
|
819
339
|
/**
|
|
820
|
-
*
|
|
340
|
+
* Keep open dropdown on click outside
|
|
821
341
|
*/
|
|
822
|
-
|
|
342
|
+
keepOpen: {
|
|
823
343
|
type: Boolean,
|
|
824
|
-
default:
|
|
344
|
+
default: false
|
|
825
345
|
},
|
|
826
346
|
/**
|
|
827
347
|
* Autofocus first item on dropdown open
|
|
@@ -883,86 +403,568 @@ const InputTextareaProps = {
|
|
|
883
403
|
* Available for input types: text, search, url, tel, email, password
|
|
884
404
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
885
405
|
*/
|
|
886
|
-
minlength: [String, Number],
|
|
406
|
+
minlength: [String, Number],
|
|
407
|
+
/**
|
|
408
|
+
* Input / Textarea maxlength
|
|
409
|
+
* Maximum length (number of characters) of value
|
|
410
|
+
* Available for input types: text, search, url, tel, email, password
|
|
411
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
412
|
+
*/
|
|
413
|
+
maxlength: [String, Number],
|
|
414
|
+
/**
|
|
415
|
+
* Input / Textarea placeholder
|
|
416
|
+
* Text that appears in the form control when it has no value set
|
|
417
|
+
* Available for input types: text, search, url, tel, email, password, number
|
|
418
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
|
|
419
|
+
*/
|
|
420
|
+
placeholder: String,
|
|
421
|
+
/**
|
|
422
|
+
* Input / Textarea required
|
|
423
|
+
* A value is required or must be check for the form to be submittable
|
|
424
|
+
* Available for all input types except color
|
|
425
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
|
|
426
|
+
*/
|
|
427
|
+
required: Boolean
|
|
428
|
+
};
|
|
429
|
+
const CheckboxRadioProps = {
|
|
430
|
+
...IdNameProps,
|
|
431
|
+
...TabindexProps,
|
|
432
|
+
...ValidProps,
|
|
433
|
+
...InvalidProps,
|
|
434
|
+
...HintProps,
|
|
435
|
+
...DisabledProps,
|
|
436
|
+
...ReadonlyProps,
|
|
437
|
+
...ModifiersProps,
|
|
438
|
+
...LabelProps,
|
|
439
|
+
...LoadingProps,
|
|
440
|
+
/**
|
|
441
|
+
* Input value
|
|
442
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
443
|
+
*/
|
|
444
|
+
value: [String, Number, Boolean],
|
|
445
|
+
/**
|
|
446
|
+
* Input value
|
|
447
|
+
*/
|
|
448
|
+
modelValue: [Object, Number, Boolean, String]
|
|
449
|
+
};
|
|
450
|
+
const CheckboxRadioGroupProps = {
|
|
451
|
+
...ValidProps,
|
|
452
|
+
...InvalidProps,
|
|
453
|
+
...OptionsProps,
|
|
454
|
+
...HintProps,
|
|
455
|
+
...DisabledProps,
|
|
456
|
+
...ReadonlyProps,
|
|
457
|
+
...ModifiersProps,
|
|
458
|
+
...LabelProps,
|
|
459
|
+
...LoadingProps,
|
|
460
|
+
/**
|
|
461
|
+
* Input value
|
|
462
|
+
*/
|
|
463
|
+
modelValue: [String, Array, Boolean, Number, Symbol],
|
|
464
|
+
/**
|
|
465
|
+
* Input name
|
|
466
|
+
*/
|
|
467
|
+
name: { type: String, required: true },
|
|
468
|
+
/**
|
|
469
|
+
* If true, the group will be displayed in a vertical column
|
|
470
|
+
*/
|
|
471
|
+
vertical: Boolean
|
|
472
|
+
};
|
|
473
|
+
const ActionProps = {
|
|
474
|
+
...DisabledProps,
|
|
475
|
+
...LabelProps,
|
|
476
|
+
...PressedProps,
|
|
477
|
+
...ActiveProps,
|
|
478
|
+
...LinkProps,
|
|
479
|
+
/**
|
|
480
|
+
* Button type
|
|
481
|
+
*/
|
|
482
|
+
type: {
|
|
483
|
+
type: String,
|
|
484
|
+
default: ButtonType.button,
|
|
485
|
+
validator: (value) => Object.values(ButtonType).includes(value)
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
function equals(obj1, obj2, field) {
|
|
489
|
+
if (field)
|
|
490
|
+
return resolveFieldData(obj1, field) === resolveFieldData(obj2, field);
|
|
491
|
+
else
|
|
492
|
+
return deepEquals(obj1, obj2);
|
|
493
|
+
}
|
|
494
|
+
function deepEquals(a, b) {
|
|
495
|
+
if (a === b)
|
|
496
|
+
return true;
|
|
497
|
+
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
498
|
+
const arrA = Array.isArray(a);
|
|
499
|
+
const arrB = Array.isArray(b);
|
|
500
|
+
let i, length, key;
|
|
501
|
+
if (arrA && arrB) {
|
|
502
|
+
length = a.length;
|
|
503
|
+
if (length != b.length)
|
|
504
|
+
return false;
|
|
505
|
+
for (i = length; i-- !== 0; )
|
|
506
|
+
if (!deepEquals(a[i], b[i]))
|
|
507
|
+
return false;
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
if (arrA != arrB)
|
|
511
|
+
return false;
|
|
512
|
+
const dateA = a instanceof Date, dateB = b instanceof Date;
|
|
513
|
+
if (dateA != dateB)
|
|
514
|
+
return false;
|
|
515
|
+
if (dateA && dateB)
|
|
516
|
+
return a.getTime() == b.getTime();
|
|
517
|
+
const regexpA = a instanceof RegExp, regexpB = b instanceof RegExp;
|
|
518
|
+
if (regexpA != regexpB)
|
|
519
|
+
return false;
|
|
520
|
+
if (regexpA && regexpB)
|
|
521
|
+
return a.toString() == b.toString();
|
|
522
|
+
const keys = Object.keys(a);
|
|
523
|
+
length = keys.length;
|
|
524
|
+
if (length !== Object.keys(b).length)
|
|
525
|
+
return false;
|
|
526
|
+
for (i = length; i-- !== 0; )
|
|
527
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
|
|
528
|
+
return false;
|
|
529
|
+
for (i = length; i-- !== 0; ) {
|
|
530
|
+
key = keys[i];
|
|
531
|
+
if (!deepEquals(a[key], b[key]))
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
return a !== a && b !== b;
|
|
537
|
+
}
|
|
538
|
+
function resolveFieldData(data, field) {
|
|
539
|
+
if (data && Object.keys(data).length && field) {
|
|
540
|
+
if (field.indexOf(".") === -1) {
|
|
541
|
+
return data[field];
|
|
542
|
+
} else {
|
|
543
|
+
const fields = field.split(".");
|
|
544
|
+
let value = data;
|
|
545
|
+
for (let i = 0, len = fields.length; i < len; ++i) {
|
|
546
|
+
if (data == null) {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
value = value[fields[i]];
|
|
550
|
+
}
|
|
551
|
+
return value;
|
|
552
|
+
}
|
|
553
|
+
} else {
|
|
554
|
+
return null;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function findIndexInList(value, list) {
|
|
558
|
+
let index = -1;
|
|
559
|
+
if (list) {
|
|
560
|
+
for (let i = 0; i < list.length; i++) {
|
|
561
|
+
if (equals(list[i], value)) {
|
|
562
|
+
index = i;
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return index;
|
|
568
|
+
}
|
|
569
|
+
function contains(value, list) {
|
|
570
|
+
if (value != null && list && list.length) {
|
|
571
|
+
for (const val of list) {
|
|
572
|
+
if (equals(value, val)) {
|
|
573
|
+
return true;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
function isEmpty(value) {
|
|
580
|
+
return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
|
|
581
|
+
}
|
|
582
|
+
function removeFromList(value, list) {
|
|
583
|
+
const indexElToRemove = findIndexInList(value, list);
|
|
584
|
+
if (indexElToRemove > -1) {
|
|
585
|
+
return list.filter((el, elIndex) => elIndex !== indexElToRemove);
|
|
586
|
+
} else {
|
|
587
|
+
return list;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function isString(value) {
|
|
591
|
+
return typeof value === "string" || value instanceof String;
|
|
592
|
+
}
|
|
593
|
+
function useInjectedGroupState(groupKey) {
|
|
594
|
+
const group = inject(groupKey, void 0);
|
|
595
|
+
const isInGroup = computed(() => !isEmpty(group));
|
|
596
|
+
function getGroupOrLocalRef(propName, props, emit) {
|
|
597
|
+
if (group == null ? void 0 : group.value) {
|
|
598
|
+
const groupPropValue = unref(group.value)[propName];
|
|
599
|
+
return computed({
|
|
600
|
+
get() {
|
|
601
|
+
return groupPropValue == null ? void 0 : groupPropValue.value;
|
|
602
|
+
},
|
|
603
|
+
set(value) {
|
|
604
|
+
groupPropValue.value = value;
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
const propRef = toRef(props, propName);
|
|
609
|
+
return computed({
|
|
610
|
+
get() {
|
|
611
|
+
return propRef.value;
|
|
612
|
+
},
|
|
613
|
+
set(value) {
|
|
614
|
+
if (emit)
|
|
615
|
+
emit(`update:${propName}`, value);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
return {
|
|
620
|
+
group,
|
|
621
|
+
isInGroup,
|
|
622
|
+
getGroupOrLocalRef
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
const VvAccordionProps = {
|
|
626
|
+
...ModifiersProps,
|
|
627
|
+
/**
|
|
628
|
+
* Accordion name
|
|
629
|
+
*/
|
|
630
|
+
name: String,
|
|
631
|
+
/**
|
|
632
|
+
* Header title
|
|
633
|
+
*/
|
|
634
|
+
title: String,
|
|
635
|
+
/**
|
|
636
|
+
* Content text
|
|
637
|
+
*/
|
|
638
|
+
content: String,
|
|
887
639
|
/**
|
|
888
|
-
*
|
|
889
|
-
* Maximum length (number of characters) of value
|
|
890
|
-
* Available for input types: text, search, url, tel, email, password
|
|
891
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
640
|
+
* (Optional) Defines if item is open. Event "update:modelValue" is emitted on accordion header click
|
|
892
641
|
*/
|
|
893
|
-
|
|
642
|
+
modelValue: {
|
|
643
|
+
type: Boolean,
|
|
644
|
+
default: void 0
|
|
645
|
+
},
|
|
894
646
|
/**
|
|
895
|
-
*
|
|
896
|
-
* Text that appears in the form control when it has no value set
|
|
897
|
-
* Available for input types: text, search, url, tel, email, password, number
|
|
898
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder
|
|
647
|
+
* If true, the accordion will be disabled
|
|
899
648
|
*/
|
|
900
|
-
|
|
649
|
+
disabled: Boolean,
|
|
901
650
|
/**
|
|
902
|
-
*
|
|
903
|
-
* A value is required or must be check for the form to be submittable
|
|
904
|
-
* Available for all input types except color
|
|
905
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#required
|
|
651
|
+
* If true, the accordion will be opened by default
|
|
906
652
|
*/
|
|
907
|
-
|
|
653
|
+
not: Boolean
|
|
908
654
|
};
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
655
|
+
const VvAccordionEvents = ["update:modelValue"];
|
|
656
|
+
function useGroupProps$3(props, emit) {
|
|
657
|
+
const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(
|
|
658
|
+
INJECTION_KEY_ACCORDION_GROUP
|
|
659
|
+
);
|
|
660
|
+
const { title, content } = toRefs(props);
|
|
661
|
+
const modelValue = getGroupOrLocalRef("modelValue", props, emit);
|
|
662
|
+
const not = getGroupOrLocalRef("not", props);
|
|
663
|
+
const collapse = getGroupOrLocalRef("collapse", props);
|
|
664
|
+
const disabled = computed(
|
|
665
|
+
() => {
|
|
666
|
+
var _a;
|
|
667
|
+
return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
|
|
668
|
+
}
|
|
669
|
+
);
|
|
670
|
+
const modifiers = computed(() => {
|
|
671
|
+
let localModifiers = props.modifiers;
|
|
672
|
+
let groupModifiers = group == null ? void 0 : group.value.modifiers.value;
|
|
673
|
+
const toReturn = /* @__PURE__ */ new Set();
|
|
674
|
+
if (localModifiers) {
|
|
675
|
+
if (!Array.isArray(localModifiers)) {
|
|
676
|
+
localModifiers = localModifiers.split(" ");
|
|
677
|
+
}
|
|
678
|
+
localModifiers.forEach((modifier) => toReturn.add(modifier));
|
|
679
|
+
}
|
|
680
|
+
if (groupModifiers) {
|
|
681
|
+
if (!Array.isArray(groupModifiers)) {
|
|
682
|
+
groupModifiers = groupModifiers.split(" ");
|
|
683
|
+
}
|
|
684
|
+
groupModifiers.forEach((modifier) => toReturn.add(modifier));
|
|
685
|
+
}
|
|
686
|
+
return Array.from(toReturn);
|
|
687
|
+
});
|
|
688
|
+
return {
|
|
689
|
+
// group props
|
|
690
|
+
modelValue,
|
|
691
|
+
not,
|
|
692
|
+
isInGroup,
|
|
693
|
+
group,
|
|
694
|
+
collapse,
|
|
695
|
+
modifiers,
|
|
696
|
+
disabled,
|
|
697
|
+
// local props
|
|
698
|
+
title,
|
|
699
|
+
content
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function useModifiers(prefix, modifiers, others) {
|
|
703
|
+
return computed(() => {
|
|
704
|
+
const toReturn = {
|
|
705
|
+
[prefix]: true
|
|
706
|
+
};
|
|
707
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
708
|
+
if (modifiersArray) {
|
|
709
|
+
if (Array.isArray(modifiersArray)) {
|
|
710
|
+
modifiersArray.forEach((modifier) => {
|
|
711
|
+
if (modifier) {
|
|
712
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
if (others) {
|
|
718
|
+
Object.keys(others.value).forEach((key) => {
|
|
719
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
return toReturn;
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
const _hoisted_1$f = ["id", "open"];
|
|
726
|
+
const _hoisted_2$c = ["aria-controls", "aria-expanded"];
|
|
727
|
+
const _hoisted_3$6 = ["aria-hidden"];
|
|
728
|
+
const __default__$m = {
|
|
729
|
+
name: "VvAccordion"
|
|
730
|
+
};
|
|
731
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
732
|
+
...__default__$m,
|
|
733
|
+
props: VvAccordionProps,
|
|
734
|
+
emits: VvAccordionEvents,
|
|
735
|
+
setup(__props, { emit }) {
|
|
736
|
+
const props = __props;
|
|
737
|
+
const attrs = useAttrs();
|
|
738
|
+
const accordionName = computed(
|
|
739
|
+
() => props.name || (attrs == null ? void 0 : attrs.id) || nanoid()
|
|
740
|
+
);
|
|
741
|
+
const {
|
|
742
|
+
modifiers,
|
|
743
|
+
title,
|
|
744
|
+
content,
|
|
745
|
+
disabled,
|
|
746
|
+
collapse,
|
|
747
|
+
modelValue,
|
|
748
|
+
isInGroup,
|
|
749
|
+
not
|
|
750
|
+
} = useGroupProps$3(props, emit);
|
|
751
|
+
const localModelValue = ref(false);
|
|
752
|
+
const isOpen = computed({
|
|
753
|
+
get: () => {
|
|
754
|
+
let toReturn = modelValue.value;
|
|
755
|
+
if (isInGroup.value) {
|
|
756
|
+
if (collapse.value && Array.isArray(modelValue.value)) {
|
|
757
|
+
toReturn = modelValue.value.includes(accordionName.value);
|
|
758
|
+
} else {
|
|
759
|
+
toReturn = modelValue.value === accordionName.value;
|
|
760
|
+
}
|
|
761
|
+
} else if (modelValue.value === void 0) {
|
|
762
|
+
toReturn = localModelValue.value;
|
|
763
|
+
}
|
|
764
|
+
return not.value ? !toReturn : toReturn;
|
|
765
|
+
},
|
|
766
|
+
set: (newValue) => {
|
|
767
|
+
if (not.value) {
|
|
768
|
+
newValue = !newValue;
|
|
769
|
+
}
|
|
770
|
+
if (isInGroup.value) {
|
|
771
|
+
if (collapse.value && Array.isArray(modelValue.value)) {
|
|
772
|
+
if (newValue) {
|
|
773
|
+
modelValue.value.push(accordionName.value);
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
modelValue.value = modelValue.value.filter(
|
|
777
|
+
(name) => name !== accordionName.value
|
|
778
|
+
);
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
modelValue.value = newValue ? accordionName.value : null;
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (modelValue.value === void 0 && typeof newValue === "boolean") {
|
|
785
|
+
localModelValue.value = newValue;
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
modelValue.value = newValue;
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
const bemCssClasses = useModifiers(
|
|
792
|
+
"vv-accordion",
|
|
793
|
+
modifiers,
|
|
794
|
+
computed(() => ({
|
|
795
|
+
disabled: disabled.value
|
|
796
|
+
}))
|
|
797
|
+
);
|
|
798
|
+
const onClick = useToggle(isOpen);
|
|
799
|
+
return (_ctx, _cache) => {
|
|
800
|
+
return openBlock(), createElementBlock("details", {
|
|
801
|
+
id: unref(accordionName),
|
|
802
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
803
|
+
open: unref(isOpen)
|
|
804
|
+
}, [
|
|
805
|
+
createElementVNode("summary", {
|
|
806
|
+
"aria-controls": unref(accordionName),
|
|
807
|
+
"aria-expanded": unref(isOpen),
|
|
808
|
+
class: "vv-accordion__summary",
|
|
809
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
|
|
810
|
+
}, [
|
|
811
|
+
renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
812
|
+
createTextVNode(toDisplayString(unref(title)), 1)
|
|
813
|
+
])
|
|
814
|
+
], 8, _hoisted_2$c),
|
|
815
|
+
createElementVNode("div", {
|
|
816
|
+
"aria-hidden": !unref(isOpen),
|
|
817
|
+
class: "vv-accordion__content"
|
|
818
|
+
}, [
|
|
819
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
820
|
+
createTextVNode(toDisplayString(unref(content)), 1)
|
|
821
|
+
])
|
|
822
|
+
], 8, _hoisted_3$6)
|
|
823
|
+
], 10, _hoisted_1$f);
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
const VvAccordionGroupProps = {
|
|
917
828
|
...ModifiersProps,
|
|
918
|
-
...LabelProps,
|
|
919
829
|
/**
|
|
920
|
-
*
|
|
921
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
830
|
+
* VModel
|
|
922
831
|
*/
|
|
923
|
-
|
|
832
|
+
modelValue: [String, Array],
|
|
924
833
|
/**
|
|
925
|
-
*
|
|
834
|
+
* Accordion items
|
|
835
|
+
* @type VvAccordionGroupItem
|
|
926
836
|
*/
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
...InvalidProps,
|
|
932
|
-
...OptionsProps,
|
|
933
|
-
...HintProps,
|
|
934
|
-
...DisabledProps,
|
|
935
|
-
...ReadonlyProps,
|
|
936
|
-
...ModifiersProps,
|
|
937
|
-
...LabelProps,
|
|
837
|
+
items: {
|
|
838
|
+
type: Array,
|
|
839
|
+
default: () => []
|
|
840
|
+
},
|
|
938
841
|
/**
|
|
939
|
-
*
|
|
842
|
+
* If true, accordion items stay open when another item is opened
|
|
940
843
|
*/
|
|
941
|
-
|
|
844
|
+
collapse: Boolean,
|
|
942
845
|
/**
|
|
943
|
-
*
|
|
846
|
+
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion--'
|
|
944
847
|
*/
|
|
945
|
-
|
|
848
|
+
itemModifiers: {
|
|
849
|
+
type: [String, Array],
|
|
850
|
+
default: ""
|
|
851
|
+
},
|
|
946
852
|
/**
|
|
947
|
-
* If true, the
|
|
948
|
-
*/
|
|
949
|
-
|
|
950
|
-
};
|
|
951
|
-
const ActionProps = {
|
|
952
|
-
...DisabledProps,
|
|
953
|
-
...LabelProps,
|
|
954
|
-
...PressedProps,
|
|
955
|
-
...ActiveProps,
|
|
956
|
-
...LinkProps,
|
|
853
|
+
* If true, the accordion items will be disabled
|
|
854
|
+
*/
|
|
855
|
+
disabled: Boolean,
|
|
957
856
|
/**
|
|
958
|
-
*
|
|
857
|
+
* If true, the accordion items will be opened by default
|
|
959
858
|
*/
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
859
|
+
not: Boolean,
|
|
860
|
+
/**
|
|
861
|
+
* Enable local storage persistence
|
|
862
|
+
*/
|
|
863
|
+
storeKey: String
|
|
864
|
+
};
|
|
865
|
+
const VvAccordionGroupEvents = ["update:modelValue"];
|
|
866
|
+
function useProvideGroupState(groupState) {
|
|
867
|
+
if (Object.keys(groupState).some(
|
|
868
|
+
(k) => k !== "key" && !isRef(groupState[k])
|
|
869
|
+
))
|
|
870
|
+
throw Error("One or more groupState props aren't ref.");
|
|
871
|
+
provide(
|
|
872
|
+
groupState.key,
|
|
873
|
+
computed(() => groupState)
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
const __default__$l = {
|
|
877
|
+
name: "VvAccordionGroup"
|
|
965
878
|
};
|
|
879
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
880
|
+
...__default__$l,
|
|
881
|
+
props: VvAccordionGroupProps,
|
|
882
|
+
emits: VvAccordionGroupEvents,
|
|
883
|
+
setup(__props, { emit }) {
|
|
884
|
+
const props = __props;
|
|
885
|
+
const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
|
|
886
|
+
watchEffect(() => {
|
|
887
|
+
if (typeof props.modelValue === "string" && collapse.value) {
|
|
888
|
+
console.warn(
|
|
889
|
+
`[VvAccordionGroup]: modelValue is a string but collapse is true.`
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
let localModelValue = ref([]);
|
|
894
|
+
watch(
|
|
895
|
+
() => props.storeKey,
|
|
896
|
+
(newKey) => {
|
|
897
|
+
if (newKey) {
|
|
898
|
+
localModelValue = useStorage(newKey, localModelValue.value);
|
|
899
|
+
} else {
|
|
900
|
+
localModelValue = ref([]);
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
{ immediate: true }
|
|
904
|
+
);
|
|
905
|
+
const modelValue = computed({
|
|
906
|
+
get: () => {
|
|
907
|
+
var _a;
|
|
908
|
+
if (props.modelValue !== void 0) {
|
|
909
|
+
if (!collapse.value) {
|
|
910
|
+
return Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
|
|
911
|
+
}
|
|
912
|
+
return props.modelValue;
|
|
913
|
+
}
|
|
914
|
+
return !collapse.value ? (_a = localModelValue.value) == null ? void 0 : _a[0] : localModelValue.value;
|
|
915
|
+
},
|
|
916
|
+
set: (newValue) => {
|
|
917
|
+
if (props.modelValue !== void 0) {
|
|
918
|
+
if ((Array.isArray(props.modelValue) || collapse.value) && !Array.isArray(newValue)) {
|
|
919
|
+
newValue = [newValue];
|
|
920
|
+
}
|
|
921
|
+
return emit("update:modelValue", newValue);
|
|
922
|
+
}
|
|
923
|
+
localModelValue.value = Array.isArray(newValue) ? newValue : [newValue];
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
useProvideGroupState({
|
|
927
|
+
key: INJECTION_KEY_ACCORDION_GROUP,
|
|
928
|
+
modelValue,
|
|
929
|
+
disabled,
|
|
930
|
+
collapse,
|
|
931
|
+
modifiers: itemModifiers,
|
|
932
|
+
not
|
|
933
|
+
});
|
|
934
|
+
const bemCssClasses = useModifiers(
|
|
935
|
+
"vv-accordion-group",
|
|
936
|
+
modifiers,
|
|
937
|
+
computed(() => ({
|
|
938
|
+
disabled: disabled.value
|
|
939
|
+
}))
|
|
940
|
+
);
|
|
941
|
+
return (_ctx, _cache) => {
|
|
942
|
+
return openBlock(), createElementBlock("div", {
|
|
943
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
944
|
+
}, [
|
|
945
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
946
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
|
|
947
|
+
return openBlock(), createBlock(_sfc_main$m, mergeProps({
|
|
948
|
+
key: item.title
|
|
949
|
+
}, {
|
|
950
|
+
name: item.name,
|
|
951
|
+
title: item.title,
|
|
952
|
+
content: item.content
|
|
953
|
+
}), {
|
|
954
|
+
header: withCtx((data) => [
|
|
955
|
+
renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
956
|
+
]),
|
|
957
|
+
details: withCtx((data) => [
|
|
958
|
+
renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
959
|
+
]),
|
|
960
|
+
_: 2
|
|
961
|
+
}, 1040);
|
|
962
|
+
}), 128))
|
|
963
|
+
])
|
|
964
|
+
], 2);
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
});
|
|
966
968
|
const VvBadgeProps = {
|
|
967
969
|
...ModifiersProps,
|
|
968
970
|
value: [String, Number]
|
|
@@ -1153,6 +1155,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1153
1155
|
props: VvIconProps,
|
|
1154
1156
|
setup(__props) {
|
|
1155
1157
|
const props = __props;
|
|
1158
|
+
const hasRotate = computed(() => {
|
|
1159
|
+
if (typeof props.rotate === "string") {
|
|
1160
|
+
return parseFloat(props.rotate);
|
|
1161
|
+
}
|
|
1162
|
+
return props.rotate;
|
|
1163
|
+
});
|
|
1156
1164
|
const show = ref(true);
|
|
1157
1165
|
const volver = useVolver();
|
|
1158
1166
|
const { modifiers } = toRefs(props);
|
|
@@ -1161,25 +1169,24 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1161
1169
|
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
1162
1170
|
});
|
|
1163
1171
|
const icon = computed(() => {
|
|
1164
|
-
const
|
|
1165
|
-
const iconName = `@${provider.value}:${props.prefix}:${
|
|
1166
|
-
if (iconExists(
|
|
1167
|
-
return _name;
|
|
1168
|
-
} else if (iconExists(iconName)) {
|
|
1172
|
+
const name = props.name ?? "";
|
|
1173
|
+
const iconName = `@${provider.value}:${props.prefix}:${name}`;
|
|
1174
|
+
if (iconExists(iconName)) {
|
|
1169
1175
|
return iconName;
|
|
1170
|
-
} else {
|
|
1171
|
-
return (volver == null ? void 0 : volver.iconsCollections.find(
|
|
1172
|
-
(iconsCollection) => {
|
|
1173
|
-
const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
|
|
1174
|
-
if (iconExists(icon2)) {
|
|
1175
|
-
return icon2;
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
)) || _name;
|
|
1179
1176
|
}
|
|
1177
|
+
const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
|
|
1178
|
+
(iconsCollection2) => {
|
|
1179
|
+
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
1180
|
+
return iconExists(icon2);
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
if (iconsCollection) {
|
|
1184
|
+
return `@${provider.value}:${iconsCollection.prefix}:${name}`;
|
|
1185
|
+
}
|
|
1186
|
+
return name;
|
|
1180
1187
|
});
|
|
1181
1188
|
function getSvgContent(svg) {
|
|
1182
|
-
let dom
|
|
1189
|
+
let dom;
|
|
1183
1190
|
if (typeof window === "undefined") {
|
|
1184
1191
|
const { JSDOM } = require("jsdom");
|
|
1185
1192
|
dom = new JSDOM().window;
|
|
@@ -1210,12 +1217,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1210
1217
|
show.value = true;
|
|
1211
1218
|
}
|
|
1212
1219
|
}).catch((e) => {
|
|
1213
|
-
throw new Error(`
|
|
1220
|
+
throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
|
|
1214
1221
|
});
|
|
1215
|
-
} else if (props.svg) {
|
|
1216
|
-
addIconFromSvg(props.svg);
|
|
1217
1222
|
}
|
|
1218
1223
|
}
|
|
1224
|
+
if (props.svg) {
|
|
1225
|
+
addIconFromSvg(props.svg);
|
|
1226
|
+
}
|
|
1219
1227
|
return (_ctx, _cache) => {
|
|
1220
1228
|
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
1221
1229
|
key: 0,
|
|
@@ -1227,7 +1235,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1227
1235
|
horizontalFlip: _ctx.horizontalFlip,
|
|
1228
1236
|
verticalFlip: _ctx.verticalFlip,
|
|
1229
1237
|
flip: _ctx.flip,
|
|
1230
|
-
rotate:
|
|
1238
|
+
rotate: unref(hasRotate),
|
|
1231
1239
|
color: _ctx.color,
|
|
1232
1240
|
onLoad: _ctx.onLoad,
|
|
1233
1241
|
icon: unref(icon)
|
|
@@ -1253,11 +1261,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
1253
1261
|
...__default__$h,
|
|
1254
1262
|
props: VvActionProps,
|
|
1255
1263
|
emits: VvActionEvents,
|
|
1256
|
-
setup(__props, { expose, emit }) {
|
|
1264
|
+
setup(__props, { expose: __expose, emit }) {
|
|
1257
1265
|
const props = __props;
|
|
1258
1266
|
const volver = useVolver();
|
|
1259
1267
|
const element = ref(null);
|
|
1260
|
-
|
|
1268
|
+
__expose({ $el: element });
|
|
1261
1269
|
const {
|
|
1262
1270
|
reference: dropdownTriggerReference,
|
|
1263
1271
|
bus: dropdownEventBus,
|
|
@@ -1292,7 +1300,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
1292
1300
|
const toReturn = {
|
|
1293
1301
|
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
1294
1302
|
"aria-pressed": pressed.value ? true : void 0,
|
|
1295
|
-
role
|
|
1303
|
+
role: role == null ? void 0 : role.value
|
|
1296
1304
|
};
|
|
1297
1305
|
switch (hasTag.value) {
|
|
1298
1306
|
case ActionTag.a:
|
|
@@ -1476,7 +1484,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1476
1484
|
...__default__$g,
|
|
1477
1485
|
props: VvButtonProps,
|
|
1478
1486
|
emits: VvButtonEvents,
|
|
1479
|
-
setup(__props, { expose, emit }) {
|
|
1487
|
+
setup(__props, { expose: __expose, emit }) {
|
|
1480
1488
|
const props = __props;
|
|
1481
1489
|
const attrs = useAttrs();
|
|
1482
1490
|
const slots = useSlots();
|
|
@@ -1498,7 +1506,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1498
1506
|
var _a;
|
|
1499
1507
|
return (_a = element.value) == null ? void 0 : _a.$el;
|
|
1500
1508
|
});
|
|
1501
|
-
|
|
1509
|
+
__expose({ $el });
|
|
1502
1510
|
const pressed = computed(() => {
|
|
1503
1511
|
if (!toggle.value) {
|
|
1504
1512
|
return props.pressed;
|
|
@@ -1674,8 +1682,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1674
1682
|
}
|
|
1675
1683
|
});
|
|
1676
1684
|
const VvCardProps = {
|
|
1677
|
-
|
|
1678
|
-
|
|
1685
|
+
...ModifiersProps,
|
|
1686
|
+
title: String
|
|
1679
1687
|
};
|
|
1680
1688
|
const _hoisted_1$c = {
|
|
1681
1689
|
key: 0,
|
|
@@ -1769,115 +1777,118 @@ function useGroupProps$1(props, emit) {
|
|
|
1769
1777
|
disabled
|
|
1770
1778
|
};
|
|
1771
1779
|
}
|
|
1772
|
-
function joinLines(
|
|
1773
|
-
if (Array.isArray(
|
|
1774
|
-
return
|
|
1780
|
+
function joinLines(items) {
|
|
1781
|
+
if (Array.isArray(items)) {
|
|
1782
|
+
return items.filter((item) => isString(item)).join(" ");
|
|
1775
1783
|
}
|
|
1776
|
-
return
|
|
1784
|
+
return items;
|
|
1777
1785
|
}
|
|
1778
|
-
function HintSlotFactory(
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
valid,
|
|
1789
|
-
validLabel,
|
|
1790
|
-
invalid,
|
|
1791
|
-
invalidLabel,
|
|
1792
|
-
...otherProps
|
|
1793
|
-
} = toRefs(parentProps);
|
|
1794
|
-
const loading = resolveFieldData(otherProps, "loading");
|
|
1795
|
-
const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
|
|
1796
|
-
const hasInvalid = computed(() => {
|
|
1797
|
-
if (!invalid.value) {
|
|
1798
|
-
return false;
|
|
1799
|
-
}
|
|
1800
|
-
if (invalid.value && invalidSlot) {
|
|
1801
|
-
return true;
|
|
1802
|
-
}
|
|
1803
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
|
|
1804
|
-
return true;
|
|
1805
|
-
}
|
|
1806
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
|
|
1807
|
-
return true;
|
|
1808
|
-
}
|
|
1809
|
-
return false;
|
|
1810
|
-
});
|
|
1811
|
-
const hasHint = computed(
|
|
1812
|
-
() => !!(hintLabel && hintLabel.value || hintSlot)
|
|
1786
|
+
function HintSlotFactory(props, slots) {
|
|
1787
|
+
const invalidLabel = computed(() => joinLines(props.invalidLabel));
|
|
1788
|
+
const validLabel = computed(() => joinLines(props.validLabel));
|
|
1789
|
+
const loadingLabel = computed(() => props.loadingLabel);
|
|
1790
|
+
const hintLabel = computed(() => props.hintLabel);
|
|
1791
|
+
const hasLoadingLabelOrSlot = computed(
|
|
1792
|
+
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
1793
|
+
);
|
|
1794
|
+
const hasInvalidLabelOrSlot = computed(
|
|
1795
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
|
|
1813
1796
|
);
|
|
1814
|
-
const
|
|
1815
|
-
() =>
|
|
1797
|
+
const hasValidLabelOrSlot = computed(
|
|
1798
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
1816
1799
|
);
|
|
1817
|
-
const
|
|
1818
|
-
() =>
|
|
1800
|
+
const hasHintLabelOrSlot = computed(
|
|
1801
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
1819
1802
|
);
|
|
1820
1803
|
const isVisible = computed(
|
|
1821
|
-
() =>
|
|
1804
|
+
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
1822
1805
|
);
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1806
|
+
const hintSlotScope = computed(() => ({
|
|
1807
|
+
modelValue: props.modelValue,
|
|
1808
|
+
valid: props.valid,
|
|
1809
|
+
invalid: props.invalid,
|
|
1810
|
+
loading: props.loading
|
|
1811
|
+
}));
|
|
1812
|
+
const HintSlot = defineComponent({
|
|
1813
|
+
name: "HintSlot",
|
|
1814
|
+
props: {
|
|
1815
|
+
tag: {
|
|
1816
|
+
type: String,
|
|
1817
|
+
default: "small"
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
setup() {
|
|
1821
|
+
return {
|
|
1822
|
+
isVisible,
|
|
1823
|
+
invalidLabel,
|
|
1824
|
+
validLabel,
|
|
1825
|
+
loadingLabel,
|
|
1826
|
+
hintLabel,
|
|
1827
|
+
hasInvalidLabelOrSlot,
|
|
1828
|
+
hasValidLabelOrSlot,
|
|
1829
|
+
hasLoadingLabelOrSlot,
|
|
1830
|
+
hasHintLabelOrSlot
|
|
1831
|
+
};
|
|
1832
|
+
},
|
|
1833
|
+
render() {
|
|
1834
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1835
|
+
if (this.isVisible) {
|
|
1836
|
+
let role;
|
|
1837
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
1838
|
+
role = "alert";
|
|
1834
1839
|
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
});
|
|
1858
|
-
return {
|
|
1859
|
-
isVisible,
|
|
1860
|
-
hasInvalid,
|
|
1861
|
-
hasValid,
|
|
1862
|
-
hintContent
|
|
1863
|
-
};
|
|
1864
|
-
},
|
|
1865
|
-
render() {
|
|
1866
|
-
if (this.isVisible) {
|
|
1840
|
+
if (this.hasValidLabelOrSlot) {
|
|
1841
|
+
role = "status";
|
|
1842
|
+
}
|
|
1843
|
+
if (this.hasLoadingLabelOrSlot) {
|
|
1844
|
+
return h(
|
|
1845
|
+
this.tag,
|
|
1846
|
+
{
|
|
1847
|
+
role
|
|
1848
|
+
},
|
|
1849
|
+
((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1852
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
1853
|
+
return h(
|
|
1854
|
+
this.tag,
|
|
1855
|
+
{
|
|
1856
|
+
role
|
|
1857
|
+
},
|
|
1858
|
+
((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
|
|
1859
|
+
);
|
|
1860
|
+
}
|
|
1861
|
+
if (this.hasValidLabelOrSlot) {
|
|
1867
1862
|
return h(
|
|
1868
|
-
|
|
1863
|
+
this.tag,
|
|
1869
1864
|
{
|
|
1870
|
-
role
|
|
1865
|
+
role
|
|
1871
1866
|
},
|
|
1872
|
-
this.
|
|
1867
|
+
((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
|
|
1873
1868
|
);
|
|
1874
1869
|
}
|
|
1870
|
+
return h(
|
|
1871
|
+
this.tag,
|
|
1872
|
+
{
|
|
1873
|
+
role
|
|
1874
|
+
},
|
|
1875
|
+
((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
|
|
1876
|
+
);
|
|
1875
1877
|
}
|
|
1878
|
+
return null;
|
|
1876
1879
|
}
|
|
1880
|
+
});
|
|
1881
|
+
return {
|
|
1882
|
+
hasInvalidLabelOrSlot,
|
|
1883
|
+
hasHintLabelOrSlot,
|
|
1884
|
+
hasValidLabelOrSlot,
|
|
1885
|
+
hasLoadingLabelOrSlot,
|
|
1886
|
+
hintSlotScope,
|
|
1887
|
+
HintSlot
|
|
1877
1888
|
};
|
|
1878
1889
|
}
|
|
1879
1890
|
const _hoisted_1$b = ["for"];
|
|
1880
|
-
const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
|
|
1891
|
+
const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
1881
1892
|
const __default__$d = {
|
|
1882
1893
|
name: "VvCheckbox"
|
|
1883
1894
|
};
|
|
@@ -1900,6 +1911,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1900
1911
|
isInGroup
|
|
1901
1912
|
} = useGroupProps$1(props, emit);
|
|
1902
1913
|
const hasId = useUniqueId(id);
|
|
1914
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
1903
1915
|
const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
|
|
1904
1916
|
const input = ref();
|
|
1905
1917
|
const isBinary = computed(
|
|
@@ -1994,7 +2006,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1994
2006
|
input.value.indeterminate = true;
|
|
1995
2007
|
}
|
|
1996
2008
|
});
|
|
1997
|
-
const {
|
|
2009
|
+
const {
|
|
2010
|
+
HintSlot,
|
|
2011
|
+
hasHintLabelOrSlot,
|
|
2012
|
+
hasInvalidLabelOrSlot,
|
|
2013
|
+
hintSlotScope
|
|
2014
|
+
} = HintSlotFactory(props, slots);
|
|
1998
2015
|
return (_ctx, _cache) => {
|
|
1999
2016
|
return openBlock(), createElementBlock("label", {
|
|
2000
2017
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -2011,7 +2028,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2011
2028
|
disabled: unref(isDisabled),
|
|
2012
2029
|
value: unref(hasValue),
|
|
2013
2030
|
tabindex: unref(tabindex),
|
|
2014
|
-
"aria-invalid": unref(isInvalid)
|
|
2031
|
+
"aria-invalid": unref(isInvalid),
|
|
2032
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2033
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
|
|
2015
2034
|
}, null, 8, _hoisted_2$8), [
|
|
2016
2035
|
[vModelCheckbox, unref(localModelValue)]
|
|
2017
2036
|
]),
|
|
@@ -2019,9 +2038,38 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2019
2038
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
2020
2039
|
]),
|
|
2021
2040
|
createVNode(unref(HintSlot), {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
},
|
|
2041
|
+
id: unref(hasHintId),
|
|
2042
|
+
class: "vv-checkbox__hint"
|
|
2043
|
+
}, createSlots({ _: 2 }, [
|
|
2044
|
+
_ctx.$slots.hint ? {
|
|
2045
|
+
name: "hint",
|
|
2046
|
+
fn: withCtx(() => [
|
|
2047
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2048
|
+
]),
|
|
2049
|
+
key: "0"
|
|
2050
|
+
} : void 0,
|
|
2051
|
+
_ctx.$slots.loading ? {
|
|
2052
|
+
name: "loading",
|
|
2053
|
+
fn: withCtx(() => [
|
|
2054
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2055
|
+
]),
|
|
2056
|
+
key: "1"
|
|
2057
|
+
} : void 0,
|
|
2058
|
+
_ctx.$slots.valid ? {
|
|
2059
|
+
name: "valid",
|
|
2060
|
+
fn: withCtx(() => [
|
|
2061
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2062
|
+
]),
|
|
2063
|
+
key: "2"
|
|
2064
|
+
} : void 0,
|
|
2065
|
+
_ctx.$slots.invalid ? {
|
|
2066
|
+
name: "invalid",
|
|
2067
|
+
fn: withCtx(() => [
|
|
2068
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2069
|
+
]),
|
|
2070
|
+
key: "3"
|
|
2071
|
+
} : void 0
|
|
2072
|
+
]), 1032, ["id"])
|
|
2025
2073
|
], 10, _hoisted_1$b);
|
|
2026
2074
|
};
|
|
2027
2075
|
}
|
|
@@ -2033,7 +2081,9 @@ function useOptions(props) {
|
|
|
2033
2081
|
const getOptionLabel = (option) => {
|
|
2034
2082
|
if (typeof option !== "object" && option !== null)
|
|
2035
2083
|
return option;
|
|
2036
|
-
return
|
|
2084
|
+
return String(
|
|
2085
|
+
typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value]
|
|
2086
|
+
);
|
|
2037
2087
|
};
|
|
2038
2088
|
const getOptionValue = (option) => {
|
|
2039
2089
|
if (typeof option !== "object" && option !== null)
|
|
@@ -2100,7 +2150,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2100
2150
|
value: getOptionValue(option)
|
|
2101
2151
|
};
|
|
2102
2152
|
};
|
|
2103
|
-
const { HintSlot } = HintSlotFactory(props, slots);
|
|
2153
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
|
|
2104
2154
|
return (_ctx, _cache) => {
|
|
2105
2155
|
return openBlock(), createElementBlock("fieldset", {
|
|
2106
2156
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -2114,7 +2164,36 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2114
2164
|
return openBlock(), createBlock(_sfc_main$d, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
2115
2165
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
2116
2166
|
]),
|
|
2117
|
-
createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }
|
|
2167
|
+
createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }, createSlots({ _: 2 }, [
|
|
2168
|
+
_ctx.$slots.hint ? {
|
|
2169
|
+
name: "hint",
|
|
2170
|
+
fn: withCtx(() => [
|
|
2171
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2172
|
+
]),
|
|
2173
|
+
key: "0"
|
|
2174
|
+
} : void 0,
|
|
2175
|
+
_ctx.$slots.loading ? {
|
|
2176
|
+
name: "loading",
|
|
2177
|
+
fn: withCtx(() => [
|
|
2178
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2179
|
+
]),
|
|
2180
|
+
key: "1"
|
|
2181
|
+
} : void 0,
|
|
2182
|
+
_ctx.$slots.valid ? {
|
|
2183
|
+
name: "valid",
|
|
2184
|
+
fn: withCtx(() => [
|
|
2185
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2186
|
+
]),
|
|
2187
|
+
key: "2"
|
|
2188
|
+
} : void 0,
|
|
2189
|
+
_ctx.$slots.invalid ? {
|
|
2190
|
+
name: "invalid",
|
|
2191
|
+
fn: withCtx(() => [
|
|
2192
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2193
|
+
]),
|
|
2194
|
+
key: "3"
|
|
2195
|
+
} : void 0
|
|
2196
|
+
]), 1024)
|
|
2118
2197
|
], 2);
|
|
2119
2198
|
};
|
|
2120
2199
|
}
|
|
@@ -2237,11 +2316,17 @@ const VvComboboxProps = {
|
|
|
2237
2316
|
/**
|
|
2238
2317
|
* Open dropdown on focus
|
|
2239
2318
|
*/
|
|
2240
|
-
autoOpen:
|
|
2319
|
+
autoOpen: {
|
|
2320
|
+
type: Boolean,
|
|
2321
|
+
default: false
|
|
2322
|
+
},
|
|
2241
2323
|
/**
|
|
2242
|
-
*
|
|
2324
|
+
* Keep open dropdown on single select
|
|
2243
2325
|
*/
|
|
2244
|
-
|
|
2326
|
+
keepOpen: {
|
|
2327
|
+
type: Boolean,
|
|
2328
|
+
default: false
|
|
2329
|
+
}
|
|
2245
2330
|
};
|
|
2246
2331
|
const VvDropdownProps = {
|
|
2247
2332
|
...IdProps,
|
|
@@ -2279,19 +2364,14 @@ function useProvideDropdownTrigger({
|
|
|
2279
2364
|
const bus = mitt();
|
|
2280
2365
|
const component = defineComponent({
|
|
2281
2366
|
name: "VvDropdownTriggerProvider",
|
|
2282
|
-
provide() {
|
|
2283
|
-
return {
|
|
2284
|
-
[INJECTION_KEY_DROPDOWN_TRIGGER]: {
|
|
2285
|
-
reference,
|
|
2286
|
-
id,
|
|
2287
|
-
expanded,
|
|
2288
|
-
aria,
|
|
2289
|
-
bus
|
|
2290
|
-
}
|
|
2291
|
-
};
|
|
2292
|
-
},
|
|
2293
2367
|
setup() {
|
|
2294
|
-
|
|
2368
|
+
provide(INJECTION_KEY_DROPDOWN_TRIGGER, {
|
|
2369
|
+
reference,
|
|
2370
|
+
id,
|
|
2371
|
+
expanded,
|
|
2372
|
+
aria,
|
|
2373
|
+
bus
|
|
2374
|
+
});
|
|
2295
2375
|
},
|
|
2296
2376
|
render() {
|
|
2297
2377
|
var _a, _b;
|
|
@@ -2320,7 +2400,7 @@ function useProvideDropdownAction({
|
|
|
2320
2400
|
expanded
|
|
2321
2401
|
}) {
|
|
2322
2402
|
provide(INJECTION_KEY_DROPDOWN_ACTION, {
|
|
2323
|
-
role: ActionRoles.menuitem,
|
|
2403
|
+
role: ref(ActionRoles.menuitem),
|
|
2324
2404
|
expanded
|
|
2325
2405
|
});
|
|
2326
2406
|
}
|
|
@@ -2332,8 +2412,14 @@ const __default__$b = {
|
|
|
2332
2412
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2333
2413
|
...__default__$b,
|
|
2334
2414
|
props: VvDropdownProps,
|
|
2335
|
-
emits: [
|
|
2336
|
-
|
|
2415
|
+
emits: [
|
|
2416
|
+
"update:modelValue",
|
|
2417
|
+
"beforeExpand",
|
|
2418
|
+
"beforeCollapse",
|
|
2419
|
+
"afterExpand",
|
|
2420
|
+
"afterCollapse"
|
|
2421
|
+
],
|
|
2422
|
+
setup(__props, { expose: __expose, emit }) {
|
|
2337
2423
|
const props = __props;
|
|
2338
2424
|
const { id } = toRefs(props);
|
|
2339
2425
|
const hasId = useUniqueId(id);
|
|
@@ -2478,7 +2564,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2478
2564
|
const init = (el) => {
|
|
2479
2565
|
referenceEl.value = el;
|
|
2480
2566
|
};
|
|
2481
|
-
|
|
2567
|
+
__expose({ toggle, show, hide, init });
|
|
2482
2568
|
watch(expanded, (newValue) => {
|
|
2483
2569
|
if (newValue && props.autofocusFirst) {
|
|
2484
2570
|
nextTick(() => {
|
|
@@ -2494,7 +2580,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2494
2580
|
onClickOutside(
|
|
2495
2581
|
floatingEl,
|
|
2496
2582
|
() => {
|
|
2497
|
-
if (props.
|
|
2583
|
+
if (!props.keepOpen) {
|
|
2498
2584
|
expanded.value = false;
|
|
2499
2585
|
}
|
|
2500
2586
|
},
|
|
@@ -2603,6 +2689,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2603
2689
|
activeElement.click();
|
|
2604
2690
|
}
|
|
2605
2691
|
});
|
|
2692
|
+
const onTransitionBeforeEnter = () => {
|
|
2693
|
+
emit(expanded.value ? "beforeExpand" : "beforeCollapse");
|
|
2694
|
+
};
|
|
2695
|
+
const onTransitionAfterLeave = () => {
|
|
2696
|
+
emit(expanded.value ? "afterExpand" : "afterCollapse");
|
|
2697
|
+
};
|
|
2606
2698
|
return (_ctx, _cache) => {
|
|
2607
2699
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2608
2700
|
createVNode(unref(VvDropdownTriggerProvider), null, {
|
|
@@ -2611,7 +2703,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2611
2703
|
]),
|
|
2612
2704
|
_: 3
|
|
2613
2705
|
}),
|
|
2614
|
-
createVNode(Transition, { name: _ctx.transitionName }, {
|
|
2706
|
+
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers({
|
|
2707
|
+
beforeEnter: onTransitionBeforeEnter,
|
|
2708
|
+
onAfterLeave: onTransitionAfterLeave
|
|
2709
|
+
})), {
|
|
2615
2710
|
default: withCtx(() => [
|
|
2616
2711
|
withDirectives(createElementVNode("div", {
|
|
2617
2712
|
ref_key: "floatingEl",
|
|
@@ -2627,7 +2722,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2627
2722
|
class: "vv-dropdown__arrow"
|
|
2628
2723
|
}, null, 4)) : createCommentVNode("", true),
|
|
2629
2724
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ expanded: unref(expanded) }))),
|
|
2630
|
-
createElementVNode("
|
|
2725
|
+
createElementVNode("div", mergeProps(unref(attrs), {
|
|
2631
2726
|
id: unref(hasId),
|
|
2632
2727
|
ref_key: "listEl",
|
|
2633
2728
|
ref: listEl,
|
|
@@ -2646,7 +2741,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2646
2741
|
])
|
|
2647
2742
|
]),
|
|
2648
2743
|
_: 3
|
|
2649
|
-
},
|
|
2744
|
+
}, 16, ["name"])
|
|
2650
2745
|
], 64);
|
|
2651
2746
|
};
|
|
2652
2747
|
}
|
|
@@ -2669,7 +2764,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2669
2764
|
}
|
|
2670
2765
|
});
|
|
2671
2766
|
return (_ctx, _cache) => {
|
|
2672
|
-
return openBlock(), createElementBlock("
|
|
2767
|
+
return openBlock(), createElementBlock("div", mergeProps({ role: unref(role) }, {
|
|
2673
2768
|
ref_key: "element",
|
|
2674
2769
|
ref: element,
|
|
2675
2770
|
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
@@ -2883,7 +2978,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2883
2978
|
const props = __props;
|
|
2884
2979
|
const slots = useSlots();
|
|
2885
2980
|
const select = ref();
|
|
2886
|
-
const {
|
|
2981
|
+
const {
|
|
2982
|
+
HintSlot,
|
|
2983
|
+
hasHintLabelOrSlot,
|
|
2984
|
+
hasInvalidLabelOrSlot,
|
|
2985
|
+
hintSlotScope
|
|
2986
|
+
} = HintSlotFactory(props, slots);
|
|
2887
2987
|
const {
|
|
2888
2988
|
id,
|
|
2889
2989
|
modifiers,
|
|
@@ -2898,7 +2998,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2898
2998
|
multiple
|
|
2899
2999
|
} = toRefs(props);
|
|
2900
3000
|
const hasId = useUniqueId(id);
|
|
2901
|
-
const
|
|
3001
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
2902
3002
|
const { focused } = useComponentFocus(select, emit);
|
|
2903
3003
|
const isVisible = useElementVisibility(select);
|
|
2904
3004
|
watch(isVisible, (newValue) => {
|
|
@@ -2951,8 +3051,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2951
3051
|
autocomplete: props.autocomplete,
|
|
2952
3052
|
multiple: props.multiple,
|
|
2953
3053
|
"aria-invalid": isInvalid.value,
|
|
2954
|
-
"aria-describedby":
|
|
2955
|
-
"aria-errormessage":
|
|
3054
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
3055
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
2956
3056
|
};
|
|
2957
3057
|
});
|
|
2958
3058
|
const slotProps = computed(() => ({
|
|
@@ -3045,9 +3145,38 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3045
3145
|
])) : createCommentVNode("", true)
|
|
3046
3146
|
]),
|
|
3047
3147
|
createVNode(unref(HintSlot), {
|
|
3048
|
-
id: unref(
|
|
3148
|
+
id: unref(hasHintId),
|
|
3049
3149
|
class: "vv-select__hint"
|
|
3050
|
-
},
|
|
3150
|
+
}, createSlots({ _: 2 }, [
|
|
3151
|
+
_ctx.$slots.hint ? {
|
|
3152
|
+
name: "hint",
|
|
3153
|
+
fn: withCtx(() => [
|
|
3154
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3155
|
+
]),
|
|
3156
|
+
key: "0"
|
|
3157
|
+
} : void 0,
|
|
3158
|
+
_ctx.$slots.loading ? {
|
|
3159
|
+
name: "loading",
|
|
3160
|
+
fn: withCtx(() => [
|
|
3161
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3162
|
+
]),
|
|
3163
|
+
key: "1"
|
|
3164
|
+
} : void 0,
|
|
3165
|
+
_ctx.$slots.valid ? {
|
|
3166
|
+
name: "valid",
|
|
3167
|
+
fn: withCtx(() => [
|
|
3168
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3169
|
+
]),
|
|
3170
|
+
key: "2"
|
|
3171
|
+
} : void 0,
|
|
3172
|
+
_ctx.$slots.invalid ? {
|
|
3173
|
+
name: "invalid",
|
|
3174
|
+
fn: withCtx(() => [
|
|
3175
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3176
|
+
]),
|
|
3177
|
+
key: "3"
|
|
3178
|
+
} : void 0
|
|
3179
|
+
]), 1032, ["id"])
|
|
3051
3180
|
], 2);
|
|
3052
3181
|
};
|
|
3053
3182
|
}
|
|
@@ -3107,13 +3236,13 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
3107
3236
|
}
|
|
3108
3237
|
const _hoisted_1$5 = ["id"];
|
|
3109
3238
|
const _hoisted_2$5 = ["id", "for"];
|
|
3110
|
-
const _hoisted_3$3 = ["id", "aria-controls", "
|
|
3239
|
+
const _hoisted_3$3 = ["id", "aria-controls", "placeholder"];
|
|
3111
3240
|
const _hoisted_4$2 = {
|
|
3112
3241
|
key: 0,
|
|
3113
3242
|
class: "vv-select__input-before"
|
|
3114
3243
|
};
|
|
3115
3244
|
const _hoisted_5$2 = { class: "vv-select__inner" };
|
|
3116
|
-
const _hoisted_6$2 = ["aria-labelledby", "tabindex"];
|
|
3245
|
+
const _hoisted_6$2 = ["aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
3117
3246
|
const _hoisted_7$2 = ["aria-label", "onClick"];
|
|
3118
3247
|
const _hoisted_8$1 = {
|
|
3119
3248
|
key: 1,
|
|
@@ -3141,7 +3270,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3141
3270
|
}
|
|
3142
3271
|
return option.options && option.options.length > 0;
|
|
3143
3272
|
};
|
|
3144
|
-
const {
|
|
3273
|
+
const {
|
|
3274
|
+
HintSlot,
|
|
3275
|
+
hasHintLabelOrSlot,
|
|
3276
|
+
hasInvalidLabelOrSlot,
|
|
3277
|
+
hintSlotScope
|
|
3278
|
+
} = HintSlotFactory(props, slots);
|
|
3145
3279
|
const inputEl = ref(null);
|
|
3146
3280
|
const inputSearchEl = ref(null);
|
|
3147
3281
|
const wrapperEl = ref(null);
|
|
@@ -3189,19 +3323,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3189
3323
|
return;
|
|
3190
3324
|
expanded.value = false;
|
|
3191
3325
|
};
|
|
3192
|
-
|
|
3326
|
+
const onAfterExpand = () => {
|
|
3193
3327
|
if (searchable.value) {
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
inputSearchEl.value.focus();
|
|
3198
|
-
}
|
|
3199
|
-
return;
|
|
3200
|
-
}
|
|
3201
|
-
searchText.value = "";
|
|
3202
|
-
});
|
|
3328
|
+
if (inputSearchEl.value) {
|
|
3329
|
+
inputSearchEl.value.focus();
|
|
3330
|
+
}
|
|
3203
3331
|
}
|
|
3204
|
-
}
|
|
3332
|
+
};
|
|
3333
|
+
const onAfterCollapse = () => {
|
|
3334
|
+
if (searchable.value) {
|
|
3335
|
+
searchText.value = "";
|
|
3336
|
+
}
|
|
3337
|
+
};
|
|
3205
3338
|
const {
|
|
3206
3339
|
id,
|
|
3207
3340
|
icon,
|
|
@@ -3290,11 +3423,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3290
3423
|
const hasValue = computed(() => {
|
|
3291
3424
|
return selectedOptions.value.map((option) => getOptionLabel(option)).join(props.separator);
|
|
3292
3425
|
});
|
|
3293
|
-
watch(selectedOptions, () => {
|
|
3294
|
-
if (!props.multiple && props.autoClose) {
|
|
3295
|
-
collapse();
|
|
3296
|
-
}
|
|
3297
|
-
});
|
|
3298
3426
|
const onClickInput = () => {
|
|
3299
3427
|
props.autoOpen ? expand() : toggleExpanded();
|
|
3300
3428
|
};
|
|
@@ -3318,7 +3446,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3318
3446
|
toReturn = [value];
|
|
3319
3447
|
}
|
|
3320
3448
|
} else {
|
|
3321
|
-
if (props.
|
|
3449
|
+
if (!props.keepOpen) {
|
|
3322
3450
|
collapse();
|
|
3323
3451
|
}
|
|
3324
3452
|
if (props.unselectable && value === props.modelValue) {
|
|
@@ -3364,7 +3492,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3364
3492
|
flip: props.flip,
|
|
3365
3493
|
autoPlacement: props.autoPlacement,
|
|
3366
3494
|
arrow: props.arrow,
|
|
3367
|
-
autoClose: props.autoClose,
|
|
3368
3495
|
autofocusFirst: searchable.value ? false : props.autofocusFirst,
|
|
3369
3496
|
triggerWidth: props.triggerWidth,
|
|
3370
3497
|
modifiers: props.dropdownModifiers
|
|
@@ -3404,7 +3531,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3404
3531
|
modelValue: unref(expanded),
|
|
3405
3532
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
3406
3533
|
}, unref(dropdownProps), {
|
|
3407
|
-
role: unref(DropdownRole).listbox
|
|
3534
|
+
role: unref(DropdownRole).listbox,
|
|
3535
|
+
onAfterExpand,
|
|
3536
|
+
onAfterCollapse
|
|
3408
3537
|
}), createSlots({
|
|
3409
3538
|
default: withCtx(({ aria }) => [
|
|
3410
3539
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
@@ -3419,9 +3548,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3419
3548
|
ref_key: "inputEl",
|
|
3420
3549
|
ref: inputEl
|
|
3421
3550
|
}, aria, {
|
|
3422
|
-
"aria-labelledby": unref(hasLabelId),
|
|
3423
3551
|
class: "vv-select__input",
|
|
3424
3552
|
role: "combobox",
|
|
3553
|
+
"aria-expanded": unref(expanded),
|
|
3554
|
+
"aria-labelledby": unref(hasLabelId),
|
|
3555
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
3556
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
3425
3557
|
tabindex: unref(hasTabindex),
|
|
3426
3558
|
onClickPassive: onClickInput
|
|
3427
3559
|
}), [
|
|
@@ -3557,8 +3689,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3557
3689
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
3558
3690
|
"aria-autocomplete": "list",
|
|
3559
3691
|
"aria-controls": unref(hasDropdownId),
|
|
3560
|
-
"aria-labelledby": unref(hasLabelId),
|
|
3561
|
-
"aria-describedby": unref(hasHintId),
|
|
3562
3692
|
autocomplete: "off",
|
|
3563
3693
|
spellcheck: "false",
|
|
3564
3694
|
type: "search",
|
|
@@ -3583,7 +3713,36 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3583
3713
|
createVNode(unref(HintSlot), {
|
|
3584
3714
|
id: unref(hasHintId),
|
|
3585
3715
|
class: "vv-select__hint"
|
|
3586
|
-
},
|
|
3716
|
+
}, createSlots({ _: 2 }, [
|
|
3717
|
+
_ctx.$slots.hint ? {
|
|
3718
|
+
name: "hint",
|
|
3719
|
+
fn: withCtx(() => [
|
|
3720
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3721
|
+
]),
|
|
3722
|
+
key: "0"
|
|
3723
|
+
} : void 0,
|
|
3724
|
+
_ctx.$slots.loading ? {
|
|
3725
|
+
name: "loading",
|
|
3726
|
+
fn: withCtx(() => [
|
|
3727
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3728
|
+
]),
|
|
3729
|
+
key: "1"
|
|
3730
|
+
} : void 0,
|
|
3731
|
+
_ctx.$slots.valid ? {
|
|
3732
|
+
name: "valid",
|
|
3733
|
+
fn: withCtx(() => [
|
|
3734
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3735
|
+
]),
|
|
3736
|
+
key: "2"
|
|
3737
|
+
} : void 0,
|
|
3738
|
+
_ctx.$slots.invalid ? {
|
|
3739
|
+
name: "invalid",
|
|
3740
|
+
fn: withCtx(() => [
|
|
3741
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3742
|
+
]),
|
|
3743
|
+
key: "3"
|
|
3744
|
+
} : void 0
|
|
3745
|
+
]), 1032, ["id"])
|
|
3587
3746
|
], 10, _hoisted_1$5)) : (openBlock(), createBlock(_sfc_main$7, mergeProps({ key: 1 }, unref(selectProps), {
|
|
3588
3747
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => emit("update:modelValue", $event))
|
|
3589
3748
|
}), null, 16));
|
|
@@ -3613,9 +3772,9 @@ const VvDialogProps = {
|
|
|
3613
3772
|
*/
|
|
3614
3773
|
size: String,
|
|
3615
3774
|
/**
|
|
3616
|
-
*
|
|
3775
|
+
* Keep open dialog on click outside
|
|
3617
3776
|
*/
|
|
3618
|
-
|
|
3777
|
+
keepOpen: { type: Boolean, default: false }
|
|
3619
3778
|
};
|
|
3620
3779
|
const _hoisted_1$4 = {
|
|
3621
3780
|
key: 0,
|
|
@@ -3633,8 +3792,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3633
3792
|
...__default__$5,
|
|
3634
3793
|
props: VvDialogProps,
|
|
3635
3794
|
emits: VvDialogEvents,
|
|
3636
|
-
setup(__props, { expose, emit }) {
|
|
3795
|
+
setup(__props, { expose: __expose, emit }) {
|
|
3637
3796
|
const props = __props;
|
|
3797
|
+
const dialogEl = ref();
|
|
3638
3798
|
const localModelValue = ref(false);
|
|
3639
3799
|
const modelValue = computed({
|
|
3640
3800
|
get() {
|
|
@@ -3647,13 +3807,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3647
3807
|
emit("update:modelValue", value);
|
|
3648
3808
|
}
|
|
3649
3809
|
});
|
|
3650
|
-
const htmlAttrIsOpen = ref(true);
|
|
3651
3810
|
const modalWrapper = ref(null);
|
|
3652
3811
|
const dialogAttrs = computed(() => {
|
|
3653
3812
|
const { id } = props;
|
|
3654
3813
|
return {
|
|
3655
|
-
id
|
|
3656
|
-
open: htmlAttrIsOpen.value
|
|
3814
|
+
id
|
|
3657
3815
|
};
|
|
3658
3816
|
});
|
|
3659
3817
|
const dialogClass = computed(() => {
|
|
@@ -3665,16 +3823,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3665
3823
|
const transitioName = computed(() => `vv-dialog--${props.transition}`);
|
|
3666
3824
|
const dialogTransitionHandlers = {
|
|
3667
3825
|
"before-enter": () => {
|
|
3668
|
-
|
|
3826
|
+
var _a;
|
|
3827
|
+
(_a = dialogEl.value) == null ? void 0 : _a.showModal();
|
|
3669
3828
|
emit("open");
|
|
3670
3829
|
},
|
|
3671
3830
|
"after-leave": () => {
|
|
3672
|
-
|
|
3831
|
+
var _a;
|
|
3832
|
+
(_a = dialogEl.value) == null ? void 0 : _a.close();
|
|
3673
3833
|
emit("close");
|
|
3674
3834
|
}
|
|
3675
3835
|
};
|
|
3676
3836
|
onClickOutside(modalWrapper, () => {
|
|
3677
|
-
if (props.
|
|
3837
|
+
if (!props.keepOpen) {
|
|
3678
3838
|
modelValue.value = false;
|
|
3679
3839
|
}
|
|
3680
3840
|
});
|
|
@@ -3684,7 +3844,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3684
3844
|
function open() {
|
|
3685
3845
|
modelValue.value = true;
|
|
3686
3846
|
}
|
|
3687
|
-
|
|
3847
|
+
__expose({ close, open });
|
|
3688
3848
|
onKeyStroke("Escape", (e) => {
|
|
3689
3849
|
if (modelValue.value) {
|
|
3690
3850
|
e.preventDefault();
|
|
@@ -3694,7 +3854,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3694
3854
|
return (_ctx, _cache) => {
|
|
3695
3855
|
return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
|
|
3696
3856
|
default: withCtx(() => [
|
|
3697
|
-
withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
|
|
3857
|
+
withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), {
|
|
3858
|
+
ref_key: "dialogEl",
|
|
3859
|
+
ref: dialogEl,
|
|
3860
|
+
class: unref(dialogClass)
|
|
3861
|
+
}), [
|
|
3698
3862
|
createElementVNode("article", {
|
|
3699
3863
|
ref_key: "modalWrapper",
|
|
3700
3864
|
ref: modalWrapper,
|
|
@@ -4233,12 +4397,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4233
4397
|
...__default__$4,
|
|
4234
4398
|
props: VvInputTextProps,
|
|
4235
4399
|
emits: VvInputTextEvents,
|
|
4236
|
-
setup(__props, { expose, emit }) {
|
|
4400
|
+
setup(__props, { expose: __expose, emit }) {
|
|
4237
4401
|
const props = __props;
|
|
4238
4402
|
const slots = useSlots();
|
|
4239
4403
|
const inputEl = ref();
|
|
4240
4404
|
const innerEl = ref();
|
|
4241
|
-
|
|
4405
|
+
__expose({ $inner: innerEl });
|
|
4242
4406
|
const {
|
|
4243
4407
|
id,
|
|
4244
4408
|
icon,
|
|
@@ -4251,7 +4415,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4251
4415
|
loading
|
|
4252
4416
|
} = toRefs(props);
|
|
4253
4417
|
const hasId = useUniqueId(id);
|
|
4254
|
-
const
|
|
4418
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4255
4419
|
const inputTextPlaceholder = computed(
|
|
4256
4420
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
4257
4421
|
);
|
|
@@ -4387,8 +4551,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4387
4551
|
required: props.required,
|
|
4388
4552
|
autocomplete: props.autocomplete,
|
|
4389
4553
|
"aria-invalid": isInvalid.value,
|
|
4390
|
-
"aria-describedby":
|
|
4391
|
-
"aria-errormessage":
|
|
4554
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
4555
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
4392
4556
|
};
|
|
4393
4557
|
if (type === INPUT_TYPES.DATE || type === INPUT_TYPES.MONTH || type === INPUT_TYPES.WEEK || type === INPUT_TYPES.TIME || type === INPUT_TYPES.DATETIME_LOCAL || type === INPUT_TYPES.NUMBER) {
|
|
4394
4558
|
toReturn.step = props.step;
|
|
@@ -4417,7 +4581,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4417
4581
|
stepDown: onStepDown,
|
|
4418
4582
|
clear: onClear
|
|
4419
4583
|
}));
|
|
4420
|
-
const {
|
|
4584
|
+
const {
|
|
4585
|
+
HintSlot,
|
|
4586
|
+
hasHintLabelOrSlot,
|
|
4587
|
+
hasInvalidLabelOrSlot,
|
|
4588
|
+
hintSlotScope
|
|
4589
|
+
} = HintSlotFactory(props, slots);
|
|
4421
4590
|
const PasswordInputActions = VvInputTextActionsFactory(
|
|
4422
4591
|
INPUT_TYPES.PASSWORD,
|
|
4423
4592
|
props
|
|
@@ -4532,9 +4701,38 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4532
4701
|
])) : createCommentVNode("", true)
|
|
4533
4702
|
]),
|
|
4534
4703
|
createVNode(unref(HintSlot), {
|
|
4535
|
-
id: unref(
|
|
4704
|
+
id: unref(hasHintId),
|
|
4536
4705
|
class: "vv-input-text__hint"
|
|
4537
|
-
},
|
|
4706
|
+
}, createSlots({ _: 2 }, [
|
|
4707
|
+
_ctx.$slots.hint ? {
|
|
4708
|
+
name: "hint",
|
|
4709
|
+
fn: withCtx(() => [
|
|
4710
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4711
|
+
]),
|
|
4712
|
+
key: "0"
|
|
4713
|
+
} : void 0,
|
|
4714
|
+
_ctx.$slots.loading ? {
|
|
4715
|
+
name: "loading",
|
|
4716
|
+
fn: withCtx(() => [
|
|
4717
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4718
|
+
]),
|
|
4719
|
+
key: "1"
|
|
4720
|
+
} : void 0,
|
|
4721
|
+
_ctx.$slots.valid ? {
|
|
4722
|
+
name: "valid",
|
|
4723
|
+
fn: withCtx(() => [
|
|
4724
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4725
|
+
]),
|
|
4726
|
+
key: "2"
|
|
4727
|
+
} : void 0,
|
|
4728
|
+
_ctx.$slots.invalid ? {
|
|
4729
|
+
name: "invalid",
|
|
4730
|
+
fn: withCtx(() => [
|
|
4731
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4732
|
+
]),
|
|
4733
|
+
key: "3"
|
|
4734
|
+
} : void 0
|
|
4735
|
+
]), 1032, ["id"])
|
|
4538
4736
|
], 2);
|
|
4539
4737
|
};
|
|
4540
4738
|
}
|
|
@@ -4629,7 +4827,7 @@ function useGroupProps(props, emit) {
|
|
|
4629
4827
|
};
|
|
4630
4828
|
}
|
|
4631
4829
|
const _hoisted_1$2 = ["for"];
|
|
4632
|
-
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
|
|
4830
|
+
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
4633
4831
|
const __default__$2 = {
|
|
4634
4832
|
name: "VvRadio"
|
|
4635
4833
|
};
|
|
@@ -4642,6 +4840,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4642
4840
|
const slots = useSlots();
|
|
4643
4841
|
const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
|
|
4644
4842
|
const hasId = useUniqueId(id);
|
|
4843
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4645
4844
|
const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
|
|
4646
4845
|
const input = ref();
|
|
4647
4846
|
const isDisabled = computed(() => disabled.value || readonly.value);
|
|
@@ -4684,7 +4883,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4684
4883
|
readonly: readonly.value
|
|
4685
4884
|
}))
|
|
4686
4885
|
);
|
|
4687
|
-
const {
|
|
4886
|
+
const {
|
|
4887
|
+
HintSlot,
|
|
4888
|
+
hasHintLabelOrSlot,
|
|
4889
|
+
hasInvalidLabelOrSlot,
|
|
4890
|
+
hintSlotScope
|
|
4891
|
+
} = HintSlotFactory(props, slots);
|
|
4688
4892
|
return (_ctx, _cache) => {
|
|
4689
4893
|
return openBlock(), createElementBlock("label", {
|
|
4690
4894
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -4701,7 +4905,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4701
4905
|
disabled: unref(isDisabled),
|
|
4702
4906
|
value: unref(hasValue),
|
|
4703
4907
|
tabindex: unref(tabindex),
|
|
4704
|
-
"aria-invalid": unref(isInvalid)
|
|
4908
|
+
"aria-invalid": unref(isInvalid),
|
|
4909
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
4910
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
|
|
4705
4911
|
}, null, 8, _hoisted_2$2), [
|
|
4706
4912
|
[vModelRadio, unref(localModelValue)]
|
|
4707
4913
|
]),
|
|
@@ -4709,9 +4915,38 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4709
4915
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
4710
4916
|
]),
|
|
4711
4917
|
createVNode(unref(HintSlot), {
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
},
|
|
4918
|
+
id: unref(hasHintId),
|
|
4919
|
+
class: "vv-radio__hint"
|
|
4920
|
+
}, createSlots({ _: 2 }, [
|
|
4921
|
+
_ctx.$slots.hint ? {
|
|
4922
|
+
name: "hint",
|
|
4923
|
+
fn: withCtx(() => [
|
|
4924
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4925
|
+
]),
|
|
4926
|
+
key: "0"
|
|
4927
|
+
} : void 0,
|
|
4928
|
+
_ctx.$slots.loading ? {
|
|
4929
|
+
name: "loading",
|
|
4930
|
+
fn: withCtx(() => [
|
|
4931
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4932
|
+
]),
|
|
4933
|
+
key: "1"
|
|
4934
|
+
} : void 0,
|
|
4935
|
+
_ctx.$slots.valid ? {
|
|
4936
|
+
name: "valid",
|
|
4937
|
+
fn: withCtx(() => [
|
|
4938
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4939
|
+
]),
|
|
4940
|
+
key: "2"
|
|
4941
|
+
} : void 0,
|
|
4942
|
+
_ctx.$slots.invalid ? {
|
|
4943
|
+
name: "invalid",
|
|
4944
|
+
fn: withCtx(() => [
|
|
4945
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4946
|
+
]),
|
|
4947
|
+
key: "3"
|
|
4948
|
+
} : void 0
|
|
4949
|
+
]), 1032, ["id"])
|
|
4715
4950
|
], 10, _hoisted_1$2);
|
|
4716
4951
|
};
|
|
4717
4952
|
}
|
|
@@ -4760,7 +4995,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4760
4995
|
value: getOptionValue(option)
|
|
4761
4996
|
};
|
|
4762
4997
|
};
|
|
4763
|
-
const { HintSlot } = HintSlotFactory(props, slots);
|
|
4998
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
|
|
4764
4999
|
return (_ctx, _cache) => {
|
|
4765
5000
|
return openBlock(), createElementBlock("fieldset", {
|
|
4766
5001
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -4774,7 +5009,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4774
5009
|
return openBlock(), createBlock(_sfc_main$2, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
4775
5010
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
4776
5011
|
]),
|
|
4777
|
-
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }
|
|
5012
|
+
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
|
|
5013
|
+
_ctx.$slots.hint ? {
|
|
5014
|
+
name: "hint",
|
|
5015
|
+
fn: withCtx(() => [
|
|
5016
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5017
|
+
]),
|
|
5018
|
+
key: "0"
|
|
5019
|
+
} : void 0,
|
|
5020
|
+
_ctx.$slots.loading ? {
|
|
5021
|
+
name: "loading",
|
|
5022
|
+
fn: withCtx(() => [
|
|
5023
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5024
|
+
]),
|
|
5025
|
+
key: "1"
|
|
5026
|
+
} : void 0,
|
|
5027
|
+
_ctx.$slots.valid ? {
|
|
5028
|
+
name: "valid",
|
|
5029
|
+
fn: withCtx(() => [
|
|
5030
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5031
|
+
]),
|
|
5032
|
+
key: "2"
|
|
5033
|
+
} : void 0,
|
|
5034
|
+
_ctx.$slots.invalid ? {
|
|
5035
|
+
name: "invalid",
|
|
5036
|
+
fn: withCtx(() => [
|
|
5037
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5038
|
+
]),
|
|
5039
|
+
key: "3"
|
|
5040
|
+
} : void 0
|
|
5041
|
+
]), 1024)
|
|
4778
5042
|
], 2);
|
|
4779
5043
|
};
|
|
4780
5044
|
}
|
|
@@ -4861,7 +5125,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4861
5125
|
modifiers
|
|
4862
5126
|
} = toRefs(props);
|
|
4863
5127
|
const hasId = useUniqueId(id);
|
|
4864
|
-
const
|
|
5128
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4865
5129
|
const hasPlaceholder = computed(
|
|
4866
5130
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
4867
5131
|
);
|
|
@@ -4896,7 +5160,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4896
5160
|
}
|
|
4897
5161
|
return void 0;
|
|
4898
5162
|
});
|
|
4899
|
-
const {
|
|
5163
|
+
const {
|
|
5164
|
+
HintSlot,
|
|
5165
|
+
hasHintLabelOrSlot,
|
|
5166
|
+
hasInvalidLabelOrSlot,
|
|
5167
|
+
hintSlotScope
|
|
5168
|
+
} = HintSlotFactory(props, slots);
|
|
4900
5169
|
const bemCssClasses = useModifiers(
|
|
4901
5170
|
"vv-textarea",
|
|
4902
5171
|
modifiers,
|
|
@@ -4930,8 +5199,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4930
5199
|
wrap: props.wrap,
|
|
4931
5200
|
spellcheck: props.spellcheck,
|
|
4932
5201
|
"aria-invalid": isInvalid.value,
|
|
4933
|
-
"aria-describedby":
|
|
4934
|
-
"aria-errormessage":
|
|
5202
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
5203
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
4935
5204
|
})
|
|
4936
5205
|
);
|
|
4937
5206
|
const slotProps = computed(() => ({
|
|
@@ -4989,9 +5258,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4989
5258
|
])) : createCommentVNode("", true)
|
|
4990
5259
|
]),
|
|
4991
5260
|
createVNode(unref(HintSlot), {
|
|
4992
|
-
id: unref(
|
|
5261
|
+
id: unref(hasHintId),
|
|
4993
5262
|
class: "vv-textarea__hint"
|
|
4994
|
-
},
|
|
5263
|
+
}, createSlots({ _: 2 }, [
|
|
5264
|
+
_ctx.$slots.hint ? {
|
|
5265
|
+
name: "hint",
|
|
5266
|
+
fn: withCtx(() => [
|
|
5267
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5268
|
+
]),
|
|
5269
|
+
key: "0"
|
|
5270
|
+
} : void 0,
|
|
5271
|
+
_ctx.$slots.loading ? {
|
|
5272
|
+
name: "loading",
|
|
5273
|
+
fn: withCtx(() => [
|
|
5274
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5275
|
+
]),
|
|
5276
|
+
key: "1"
|
|
5277
|
+
} : void 0,
|
|
5278
|
+
_ctx.$slots.valid ? {
|
|
5279
|
+
name: "valid",
|
|
5280
|
+
fn: withCtx(() => [
|
|
5281
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5282
|
+
]),
|
|
5283
|
+
key: "2"
|
|
5284
|
+
} : void 0,
|
|
5285
|
+
_ctx.$slots.invalid ? {
|
|
5286
|
+
name: "invalid",
|
|
5287
|
+
fn: withCtx(() => [
|
|
5288
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5289
|
+
]),
|
|
5290
|
+
key: "3"
|
|
5291
|
+
} : void 0
|
|
5292
|
+
]), 1032, ["id"])
|
|
4995
5293
|
], 2);
|
|
4996
5294
|
};
|
|
4997
5295
|
}
|