@volverjs/ui-vue 0.0.10-beta.35 → 0.0.10-beta.36
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 +78 -77
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +5 -5
- package/dist/Volver.d.ts +10 -10
- package/dist/components/VvAccordion/VvAccordion.es.js +11 -11
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +17 -17
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +6 -6
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +23 -21
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/index.d.ts +2 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +351 -349
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAlertGroup/index.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +4 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +11 -3
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +10 -10
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +31 -25
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +208 -202
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +21 -15
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +454 -446
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +5 -5
- package/dist/components/VvCombobox/index.d.ts +5 -10
- package/dist/components/VvDialog/VvDialog.es.js +11 -11
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +29 -25
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +12 -8
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +61 -55
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +2 -2
- package/dist/components/VvInputFile/index.d.ts +6 -6
- package/dist/components/VvInputText/VvInputText.es.js +287 -286
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +2 -2
- package/dist/components/VvInputText/index.d.ts +7 -2
- package/dist/components/VvNav/VvNav.es.js +23 -20
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +6 -6
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +208 -202
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +21 -15
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +22 -20
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +29 -23
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +29 -27
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -2
- package/dist/components/VvTooltip/VvTooltip.es.js +4 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/common/HintSlot.d.ts +3 -4
- package/dist/components/index.es.js +893 -876
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +2 -2
- package/dist/composables/index.es.js +10 -10
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +1 -1
- package/dist/composables/usePersistence.d.ts +2 -1
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/directives/index.es.js +5 -2
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +1 -1
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +4 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2 -2
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
- package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Badge/Badge.test.d.ts +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +1 -1
- package/dist/test/options.d.ts +1 -1
- package/dist/test/sleep.d.ts +1 -1
- package/dist/types/alert.d.ts +1 -1
- package/dist/utils/ObjectUtilities.d.ts +7 -7
- package/package.json +232 -239
- package/src/Volver.ts +243 -243
- 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/VvAccordion.vue +155 -155
- package/src/components/VvAccordion/index.ts +62 -62
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +220 -219
- package/src/components/VvAccordionGroup/index.ts +41 -41
- package/src/components/VvAction/VvAction.vue +144 -142
- package/src/components/VvAlert/VvAlert.vue +72 -70
- package/src/components/VvAlert/index.ts +147 -150
- package/src/components/VvAlertGroup/VvAlertGroup.vue +56 -55
- package/src/components/VvAlertGroup/index.ts +99 -103
- package/src/components/VvAvatar/VvAvatar.vue +20 -14
- package/src/components/VvAvatar/index.ts +5 -5
- package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
- package/src/components/VvAvatarGroup/index.ts +21 -21
- package/src/components/VvBadge/VvBadge.vue +15 -14
- package/src/components/VvBadge/index.ts +2 -2
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +49 -48
- package/src/components/VvBreadcrumb/index.ts +2 -2
- package/src/components/VvButton/VvButton.vue +163 -162
- package/src/components/VvButton/index.ts +102 -102
- package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -72
- package/src/components/VvButtonGroup/index.ts +22 -22
- package/src/components/VvCard/VvCard.vue +30 -30
- package/src/components/VvCard/index.ts +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +185 -180
- package/src/components/VvCheckbox/index.ts +44 -44
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -86
- package/src/components/VvCombobox/VvCombobox.vue +633 -623
- package/src/components/VvCombobox/index.ts +166 -166
- package/src/components/VvDialog/VvDialog.vue +131 -129
- package/src/components/VvDialog/index.ts +35 -35
- package/src/components/VvDropdown/VvDropdown.vue +464 -452
- package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
- package/src/components/VvDropdown/VvDropdownItem.vue +29 -28
- package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
- package/src/components/VvDropdown/VvDropdownOption.vue +47 -47
- package/src/components/VvDropdown/index.ts +53 -53
- package/src/components/VvIcon/README.md +1 -1
- package/src/components/VvIcon/VvIcon.vue +133 -133
- package/src/components/VvIcon/index.ts +77 -77
- package/src/components/VvInputFile/VvInputFile.vue +367 -363
- package/src/components/VvInputFile/index.ts +125 -125
- package/src/components/VvInputText/VvInputClearAction.ts +50 -50
- package/src/components/VvInputText/VvInputPasswordAction.ts +65 -65
- package/src/components/VvInputText/VvInputStepAction.ts +43 -43
- package/src/components/VvInputText/VvInputText.vue +636 -637
- package/src/components/VvInputText/VvInputTextActions.ts +86 -86
- package/src/components/VvInputText/index.ts +198 -198
- package/src/components/VvNav/VvNav.vue +40 -33
- package/src/components/VvNav/VvNavItem.vue +12 -12
- package/src/components/VvNav/VvNavSeparator.vue +6 -6
- package/src/components/VvNav/index.ts +2 -2
- package/src/components/VvProgress/VvProgress.vue +27 -26
- package/src/components/VvProgress/index.ts +28 -28
- package/src/components/VvRadio/VvRadio.vue +115 -112
- package/src/components/VvRadio/index.ts +27 -27
- package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -89
- package/src/components/VvSelect/VvSelect.vue +241 -238
- package/src/components/VvSelect/index.ts +62 -62
- package/src/components/VvTab/VvTab.vue +79 -73
- package/src/components/VvTab/index.ts +12 -12
- package/src/components/VvTextarea/VvTextarea.vue +218 -216
- package/src/components/VvTextarea/index.ts +35 -35
- package/src/components/VvTooltip/VvTooltip.vue +22 -16
- package/src/components/VvTooltip/index.ts +12 -12
- package/src/components/common/HintSlot.ts +149 -150
- package/src/composables/alert/useAlert.ts +74 -74
- package/src/composables/alert/useInjectAlert.ts +1 -1
- package/src/composables/alert/useProvideAlert.ts +10 -10
- package/src/composables/dropdown/useInjectDropdown.ts +6 -6
- package/src/composables/dropdown/useProvideDropdown.ts +62 -62
- package/src/composables/group/useInjectedGroupState.ts +41 -41
- package/src/composables/group/useProvideGroupState.ts +1 -2
- package/src/composables/useBlurhash.ts +52 -60
- package/src/composables/useComponentFocus.ts +9 -9
- package/src/composables/useComponentIcon.ts +35 -35
- package/src/composables/useDebouncedInput.ts +25 -25
- package/src/composables/useDefaults.ts +77 -76
- package/src/composables/useModifiers.ts +29 -29
- package/src/composables/useOptions.ts +45 -43
- package/src/composables/usePersistence.ts +70 -72
- package/src/composables/useTextCount.ts +44 -44
- package/src/composables/useUniqueId.ts +3 -2
- package/src/composables/useVolver.ts +1 -1
- package/src/constants.ts +70 -70
- package/src/directives/v-contextmenu.ts +34 -34
- package/src/directives/v-tooltip.ts +17 -17
- package/src/index.ts +3 -3
- package/src/props/index.ts +453 -453
- package/src/resolvers/unplugin.ts +138 -138
- package/src/shims.d.ts +4 -5
- package/src/stories/Accordion/Accordion.settings.ts +49 -49
- package/src/stories/Accordion/Accordion.stories.ts +21 -21
- package/src/stories/Accordion/Accordion.test.ts +56 -54
- package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +69 -67
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +37 -37
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -47
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +34 -34
- package/src/stories/Alert/Alert.settings.ts +115 -115
- package/src/stories/Alert/Alert.stories.ts +30 -30
- package/src/stories/Alert/Alert.test.ts +78 -78
- package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
- package/src/stories/Alert/AlertSlots.stories.ts +35 -35
- package/src/stories/AlertGroup/AlertGroup.settings.ts +104 -104
- package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
- package/src/stories/AlertGroup/AlertGroup.test.ts +67 -67
- package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +57 -57
- package/src/stories/Avatar/Avatar.settings.ts +29 -29
- package/src/stories/Avatar/Avatar.stories.ts +23 -23
- package/src/stories/Avatar/Avatar.test.ts +22 -22
- package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
- package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
- package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
- package/src/stories/AvatarGroup/AvatarGroup.settings.ts +53 -53
- package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -24
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
- package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
- package/src/stories/Badge/Badge.settings.ts +20 -20
- package/src/stories/Badge/Badge.stories.ts +23 -23
- package/src/stories/Badge/Badge.test.ts +8 -8
- package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +77 -76
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +34 -34
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +22 -22
- package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
- package/src/stories/Button/Button.settings.ts +144 -144
- package/src/stories/Button/Button.stories.ts +18 -18
- package/src/stories/Button/Button.test.ts +41 -40
- package/src/stories/Button/ButtonIcon.stories.ts +42 -42
- package/src/stories/Button/ButtonLink.stories.ts +24 -24
- package/src/stories/Button/ButtonLoading.stories.ts +22 -22
- package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
- package/src/stories/Button/ButtonSlots.stories.ts +47 -47
- package/src/stories/Button/ButtonState.stories.ts +23 -23
- package/src/stories/Button/ButtonToggle.stories.ts +30 -30
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +32 -32
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +19 -19
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -22
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
- package/src/stories/Card/Card.settings.ts +48 -48
- package/src/stories/Card/Card.stories.ts +22 -22
- package/src/stories/Card/Card.test.ts +14 -14
- package/src/stories/Card/CardSlots.stories.ts +42 -42
- package/src/stories/Checkbox/Checkbox.settings.ts +35 -35
- package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
- package/src/stories/Checkbox/Checkbox.test.ts +63 -62
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +17 -17
- package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
- package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -63
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
- package/src/stories/Combobox/Combobox.settings.ts +390 -390
- package/src/stories/Combobox/Combobox.stories.ts +107 -107
- package/src/stories/Combobox/Combobox.test.ts +89 -87
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +24 -24
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +22 -22
- package/src/stories/Combobox/ComboboxOptions.stories.ts +84 -84
- package/src/stories/Combobox/ComboboxSlots.stories.ts +55 -55
- package/src/stories/Dialog/Dialog.settings.ts +39 -39
- package/src/stories/Dialog/Dialog.stories.ts +28 -28
- package/src/stories/Dialog/Dialog.test.ts +49 -49
- package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
- package/src/stories/Dropdown/Dropdown.settings.ts +62 -62
- package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
- package/src/stories/Dropdown/Dropdown.test.ts +9 -9
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
- package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
- package/src/stories/Dropdown/DropdownSlots.stories.ts +49 -49
- package/src/stories/Icon/Icon.settings.ts +64 -64
- package/src/stories/Icon/Icon.stories.ts +28 -28
- package/src/stories/Icon/IconsCollection.stories.ts +22 -22
- package/src/stories/InputFile/InputFile.settings.ts +29 -29
- package/src/stories/InputFile/InputFile.stories.ts +54 -54
- package/src/stories/InputFile/InputFileDropArea.stories.ts +34 -34
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +24 -24
- package/src/stories/InputFile/InputFileSlots.stories.ts +17 -17
- package/src/stories/InputText/InputText.settings.ts +245 -246
- package/src/stories/InputText/InputText.stories.ts +67 -67
- package/src/stories/InputText/InputText.test.ts +118 -117
- package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
- package/src/stories/InputText/InputTextLength.stories.ts +33 -33
- package/src/stories/InputText/InputTextMask.stories.ts +91 -91
- package/src/stories/InputText/InputTextMinMax.stories.ts +29 -29
- package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
- package/src/stories/InputText/InputTextType.stories.ts +70 -70
- package/src/stories/Nav/Nav.settings.ts +25 -25
- package/src/stories/Nav/Nav.stories.ts +17 -17
- package/src/stories/Nav/Nav.test.ts +10 -10
- package/src/stories/Nav/NavModifiers.stories.ts +25 -25
- package/src/stories/Progress/Progress.settings.ts +23 -23
- package/src/stories/Progress/Progress.stories.ts +23 -23
- package/src/stories/Progress/Progress.test.ts +4 -4
- package/src/stories/Radio/Radio.settings.ts +9 -9
- package/src/stories/Radio/Radio.stories.ts +47 -47
- package/src/stories/Radio/Radio.test.ts +54 -53
- package/src/stories/Radio/RadioSlots.stories.ts +15 -15
- package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
- package/src/stories/RadioGroup/RadioGroup.stories.ts +50 -50
- package/src/stories/RadioGroup/RadioGroup.test.ts +63 -63
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +34 -34
- package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
- package/src/stories/Select/Select.settings.ts +70 -70
- package/src/stories/Select/Select.stories.ts +66 -66
- package/src/stories/Select/Select.test.ts +65 -64
- package/src/stories/Select/SelectIconPosition.stories.ts +24 -24
- package/src/stories/Select/SelectOptions.stories.ts +54 -54
- package/src/stories/Select/SelectSlots.stories.ts +20 -20
- package/src/stories/Tab/Tab.settings.ts +32 -32
- package/src/stories/Tab/Tab.stories.ts +17 -17
- package/src/stories/Tab/Tab.test.ts +17 -17
- package/src/stories/Textarea/Textarea.settings.ts +78 -79
- package/src/stories/Textarea/Textarea.stories.ts +63 -63
- package/src/stories/Textarea/Textarea.test.ts +70 -69
- package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
- package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
- package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
- package/src/stories/Tooltip/Tooltip.settings.ts +16 -16
- package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
- package/src/stories/Tooltip/Tooltip.test.ts +53 -52
- package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
- package/src/stories/argTypes.ts +484 -485
- package/src/test/expect.ts +71 -74
- package/src/test/options.ts +17 -16
- package/src/test/sleep.ts +3 -2
- package/src/test/types.d.ts +11 -11
- package/src/types/alert.ts +18 -18
- package/src/types/blurhash.ts +18 -18
- package/src/types/generic.ts +1 -2
- package/src/types/group.ts +21 -21
- package/src/types/input-file.ts +17 -17
- package/src/types/nav.ts +13 -13
- package/src/utils/ObjectUtilities.ts +192 -177
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
[](https://volverjs.github.io/ui-vue)
|
|
4
4
|
|
|
5
5
|
## @volverjs/ui-vue
|
|
@@ -46,12 +46,12 @@ Install the plugin in your `main.ts` file.
|
|
|
46
46
|
```typescript
|
|
47
47
|
// main.ts
|
|
48
48
|
import { createApp } from 'vue'
|
|
49
|
-
import App from './App.vue'
|
|
50
49
|
|
|
51
50
|
// import @volverjs/ui-vue plugin
|
|
52
51
|
import { VolverPlugin } from '@volverjs/ui-vue'
|
|
53
52
|
// import @volverjs/ui-vue icons collections
|
|
54
53
|
import iconsCollections from '@volverjs/ui-vue/icons'
|
|
54
|
+
import App from './App.vue'
|
|
55
55
|
/*
|
|
56
56
|
* import @volverjs/style base style with reset and props
|
|
57
57
|
* for scss support you can import the scss file
|
|
@@ -63,28 +63,28 @@ const app = createApp(App).mount('#app')
|
|
|
63
63
|
|
|
64
64
|
// install the plugin
|
|
65
65
|
app.use(VolverPlugin, {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
iconsCollections,
|
|
67
|
+
/*
|
|
68
68
|
* if you want can import components globally
|
|
69
69
|
* components: { VvButton, VvInputText }
|
|
70
70
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
components: undefined,
|
|
72
|
+
/*
|
|
73
73
|
* if you want can import directives globally
|
|
74
74
|
* directives: { toolip: VTooltip }
|
|
75
75
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
directives: undefined,
|
|
77
|
+
/*
|
|
78
78
|
* if you want can create components aliases
|
|
79
79
|
* aliases: { Btn: VvButton, BtnDanger: VvButton}
|
|
80
80
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
aliases: undefined,
|
|
82
|
+
/*
|
|
83
83
|
* if you want can change default props
|
|
84
84
|
* for globally imported components and aliases
|
|
85
85
|
* defaults: { VvButton: { modifiers: 'secondary', BtnDanger: { modifiers: 'danger' } }
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
defaults: undefined
|
|
88
88
|
})
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -129,32 +129,32 @@ import Components from 'unplugin-vue-components/vite'
|
|
|
129
129
|
import { VolverResolver } from '@volverjs/ui-vue/resolvers/unplugin'
|
|
130
130
|
|
|
131
131
|
export default defineConfig({
|
|
132
|
-
// ...
|
|
133
|
-
plugins: [
|
|
134
132
|
// ...
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
plugins: [
|
|
134
|
+
// ...
|
|
135
|
+
Components({
|
|
136
|
+
resolvers: [
|
|
137
|
+
VolverResolver({
|
|
138
|
+
/*
|
|
139
139
|
* enable/disable auto import of components style
|
|
140
140
|
* also accept 'scss' for scss support
|
|
141
141
|
* default: false
|
|
142
142
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
importStyle: false,
|
|
144
|
+
/*
|
|
145
145
|
* enable/disable auto import of directives
|
|
146
146
|
* default: false
|
|
147
147
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
directives: false,
|
|
149
|
+
/*
|
|
150
150
|
* Change components prefix
|
|
151
151
|
* default: 'vv'
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
prefix: 'vv'
|
|
154
|
+
})
|
|
155
|
+
]
|
|
154
156
|
})
|
|
155
|
-
|
|
156
|
-
})
|
|
157
|
-
]
|
|
157
|
+
]
|
|
158
158
|
})
|
|
159
159
|
```
|
|
160
160
|
|
|
@@ -168,27 +168,27 @@ Used to show alert messages and notifications
|
|
|
168
168
|
|
|
169
169
|
```typescript
|
|
170
170
|
export type AlertModifier =
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
| 'success'
|
|
172
|
+
| 'info'
|
|
173
|
+
| 'warning'
|
|
174
|
+
| 'danger'
|
|
175
|
+
| 'brand'
|
|
176
|
+
| 'accent'
|
|
177
|
+
| string
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
181
|
export type Alert = {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
182
|
+
id: string | number
|
|
183
|
+
title?: string
|
|
184
|
+
icon?: string | VvIconProps
|
|
185
|
+
content?: string
|
|
186
|
+
footer?: string
|
|
187
|
+
modifiers?: AlertModifier | AlertModifier[]
|
|
188
|
+
dismissable?: boolean
|
|
189
|
+
autoClose?: number
|
|
190
|
+
closeLabel?: string
|
|
191
|
+
role?: AlertRole
|
|
192
192
|
}
|
|
193
193
|
```
|
|
194
194
|
|
|
@@ -200,10 +200,10 @@ import { useAlert } from '@volverjs/ui-vue/composables'
|
|
|
200
200
|
const { addAlert, removeAlert, alerts } = useAlert()
|
|
201
201
|
|
|
202
202
|
function showSuccess() {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
addAlert({
|
|
204
|
+
title: 'Success!',
|
|
205
|
+
modifiers: 'success'
|
|
206
|
+
})
|
|
207
207
|
}
|
|
208
208
|
```
|
|
209
209
|
|
|
@@ -240,41 +240,42 @@ const imageUrl = ref('')
|
|
|
240
240
|
const image = ref()
|
|
241
241
|
|
|
242
242
|
watch(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
243
|
+
file,
|
|
244
|
+
async (newValue) => {
|
|
245
|
+
if (newValue?.size) {
|
|
246
|
+
this.imageUrl = URL.createObjectURL(newValue)
|
|
247
|
+
this.image = await this.loadImage(this.imageUrl)
|
|
248
|
+
this.blurhash = await this.encode(newValue)
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
this.image = null
|
|
252
|
+
this.imageUrl = ''
|
|
253
|
+
this.blurhash = ''
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{ immediate: true }
|
|
256
257
|
)
|
|
257
258
|
|
|
258
259
|
watch(blurhash, async (newValue) => {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
260
|
+
if (this.image) {
|
|
261
|
+
const blurhashDecoded = await this.decode(
|
|
262
|
+
newValue,
|
|
263
|
+
this.image.width,
|
|
264
|
+
this.image.height
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
if (this.canvas) {
|
|
268
|
+
this.canvas.width = this.image.width
|
|
269
|
+
this.canvas.height = this.image.height
|
|
270
|
+
const ctx = this.canvas.getContext('2d')
|
|
271
|
+
const imageData = ctx.createImageData(
|
|
272
|
+
this.canvas.width,
|
|
273
|
+
this.canvas.height
|
|
274
|
+
)
|
|
275
|
+
imageData.data.set(blurhashDecoded)
|
|
276
|
+
ctx.putImageData(imageData, 0, 0)
|
|
277
|
+
}
|
|
276
278
|
}
|
|
277
|
-
}
|
|
278
279
|
})
|
|
279
280
|
```
|
|
280
281
|
|
package/bin/icons.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("node:fs"),require("node:path"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("@iconify/utils"),require("chokidar")):"function"==typeof define&&define.amd?define(["exports","node:fs","node:path","yargs","yargs/helpers","@iconify/tools","@iconify/utils","chokidar"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["generate-icons"]={},e.fileSystem,e.path,e.yargs,e.helpers,e.tools,e.utils,e.chokidar)}(this,(function(e,o,r,n,i,t,s,c){"use strict";function a(e,n="iconify",i={}){return o.readdirSync(e).forEach((t=>{o.statSync(`${e}/${t}`).isDirectory()?i=a(`${e}/${t}`,t,i):t.includes(".svg")&&(i[n]?i[n].push(r.join(e,"/",t)):i[n]=[r.join(e,"/",t)])})),i}function l(e,n,i){const c=a(e,i);Object.keys(c).length?Object.keys(c).forEach((e=>{!async function(e,n,i){const c=t.blankIconSet(e);for(const r of n)try{const e=await o.promises.readFile(r,{encoding:"utf-8"}),n=new t.SVG(e);await t.cleanupSVG(n),await t.parseColors(n,{defaultColor:"currentColor",callback:(e,o,r)=>!r||t.isEmptyColor(r)?o:"currentColor"}),await t.runSVGO(n);const i=r.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");c.fromSVG(i,n)}catch(f){console.error(f)}const a=c.export();try{s.validateIconSet(a)}catch(f){throw new Error(`Icon set is not valid: ${null==f?void 0:f.message}`)}const l=`${i}/${a.prefix}.json`;o.mkdirSync(r.dirname(l),{recursive:!0}),o.writeFileSync(l,JSON.stringify(a))}(e,c[e],n),console.info(`Icons generated in: ${n}/${e}.json\n`)})):console.error(`There are no files in ${e}`)}const f=n(i.hideBin(process.argv)).argv,d=f.srcPath,u=f.destPath||d;d&&u||(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit()),f.watch?(l(d,u,f.prefix),c.watch(d,{ignoreInitial:!0}).on("add",(()=>{l(d,u,f.prefix)})).on("change",(()=>{l(d,u,f.prefix)}))):l(d,u,f.prefix),e.createIconifyJsonFiles=l,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/bin/icons.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import fileSystem from "fs";
|
|
1
|
+
import fileSystem from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import yargs from "yargs";
|
|
3
4
|
import { hideBin } from "yargs/helpers";
|
|
4
5
|
import { blankIconSet, SVG, cleanupSVG, parseColors, isEmptyColor, runSVGO } from "@iconify/tools";
|
|
5
|
-
import path from "path";
|
|
6
6
|
import { validateIconSet } from "@iconify/utils";
|
|
7
7
|
import chokidar from "chokidar";
|
|
8
8
|
function getAllFiles(dirPath, prefix = "iconify", objectFiles = {}) {
|
|
9
9
|
const files = fileSystem.readdirSync(dirPath);
|
|
10
|
-
files.forEach(
|
|
11
|
-
if (fileSystem.statSync(dirPath
|
|
12
|
-
objectFiles = getAllFiles(dirPath
|
|
10
|
+
files.forEach((file) => {
|
|
11
|
+
if (fileSystem.statSync(`${dirPath}/${file}`).isDirectory()) {
|
|
12
|
+
objectFiles = getAllFiles(`${dirPath}/${file}`, file, objectFiles);
|
|
13
13
|
} else {
|
|
14
14
|
if (file.includes(".svg")) {
|
|
15
15
|
objectFiles[prefix] ? objectFiles[prefix].push(path.join(dirPath, "/", file)) : objectFiles[prefix] = [path.join(dirPath, "/", file)];
|
package/dist/Volver.d.ts
CHANGED
|
@@ -45,33 +45,33 @@ export type VolverOptions = {
|
|
|
45
45
|
};
|
|
46
46
|
export interface VolverInterface {
|
|
47
47
|
/**
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {string} src Icon source path (url)
|
|
49
49
|
* @param {RequestInit} options
|
|
50
50
|
* @returns {Promise<string | undefined>} String SVG if exist
|
|
51
51
|
*/
|
|
52
|
-
fetchIcon(src: string, options?: RequestInit)
|
|
52
|
+
fetchIcon: (src: string, options?: RequestInit) => Promise<string | undefined>;
|
|
53
53
|
/**
|
|
54
54
|
* Add iconify collection to library
|
|
55
55
|
* @see https://docs.iconify.design/icon-components/vue/add-collection.html
|
|
56
56
|
* @param {IconifyJSON} collection
|
|
57
|
-
* @param {
|
|
57
|
+
* @param {string} providerName Optional provider name
|
|
58
58
|
*/
|
|
59
|
-
addCollection(collection: IconifyJSON, providerName?: string)
|
|
59
|
+
addCollection: (collection: IconifyJSON, providerName?: string) => boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Add icon to collection
|
|
62
62
|
* @see https://docs.iconify.design/icon-components/vue/add-icon.html
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {string} name
|
|
64
64
|
* @param {IconifyIcon} data
|
|
65
|
-
* @returns {
|
|
65
|
+
* @returns {boolean} true on success, false if something is wrong with data
|
|
66
66
|
*/
|
|
67
|
-
addIcon(name: string, data: IconifyIcon)
|
|
67
|
+
addIcon: (name: string, data: IconifyIcon) => boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Add custom config for icons provider
|
|
70
|
-
* @param {
|
|
70
|
+
* @param {string} provider
|
|
71
71
|
* @param {PartialIconifyAPIConfig} customConfig
|
|
72
|
-
* @returns {
|
|
72
|
+
* @returns {boolean} true on success, false if something is wrong with data
|
|
73
73
|
*/
|
|
74
|
-
addIconsAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig)
|
|
74
|
+
addIconsAPIProvider: (provider: string, customConfig: PartialIconifyAPIConfig) => boolean;
|
|
75
75
|
/**
|
|
76
76
|
* Current provider
|
|
77
77
|
*/
|
|
@@ -411,8 +411,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
411
411
|
emits: VvAccordionEvents,
|
|
412
412
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
413
413
|
const props = __props;
|
|
414
|
-
const attrs = useAttrs();
|
|
415
414
|
const emit = __emit;
|
|
415
|
+
const attrs = useAttrs();
|
|
416
416
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
417
417
|
const accordionName = computed(
|
|
418
418
|
() => props.name || (attrs == null ? void 0 : attrs.id) || uid()
|
|
@@ -438,7 +438,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
438
438
|
}
|
|
439
439
|
isExpanded.value = value;
|
|
440
440
|
});
|
|
441
|
-
|
|
441
|
+
function onClick() {
|
|
442
442
|
if (disabled.value) {
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
@@ -450,7 +450,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
452
|
isExpanded.value = !isExpanded.value;
|
|
453
|
-
}
|
|
453
|
+
}
|
|
454
454
|
watch(
|
|
455
455
|
accordionName,
|
|
456
456
|
(newValue, oldValue) => {
|
|
@@ -470,19 +470,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
470
470
|
bus.emit("unregister", { name: accordionName.value });
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
|
-
|
|
473
|
+
function expand() {
|
|
474
474
|
if (isExpanded.value) {
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
477
|
onClick();
|
|
478
|
-
}
|
|
479
|
-
|
|
478
|
+
}
|
|
479
|
+
function collapse() {
|
|
480
480
|
if (!isExpanded.value) {
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
onClick();
|
|
484
|
-
}
|
|
485
|
-
|
|
484
|
+
}
|
|
485
|
+
function groupExpand(name) {
|
|
486
486
|
if (!bus) {
|
|
487
487
|
console.warn(
|
|
488
488
|
`[VvAccordion]: You are trying to expand accordion group of "${accordionName.value}" but it is not in a group`
|
|
@@ -490,8 +490,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
bus.emit("expand", { name });
|
|
493
|
-
}
|
|
494
|
-
|
|
493
|
+
}
|
|
494
|
+
function groupCollapse(name) {
|
|
495
495
|
if (!bus) {
|
|
496
496
|
console.warn(
|
|
497
497
|
`[VvAccordion]: You are trying to collapse accordion group of "${accordionName.value}" but it is not in a group`
|
|
@@ -499,7 +499,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
501
|
bus == null ? void 0 : bus.emit("collapse", { name });
|
|
502
|
-
}
|
|
502
|
+
}
|
|
503
503
|
__expose({
|
|
504
504
|
isExpanded,
|
|
505
505
|
expand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const i=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,l.button,t.local;const s={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o){const{group:n,isInGroup:t}=function(o){const n=e.inject(o,void 0),t=e.computed((()=>void 0!==n));return{group:n,isInGroup:t,getGroupOrLocalRef:function(o,t,a){const r=null==n?void 0:n[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const u=e.toRef(t,o);return e.computed({get:()=>u.value,set(e){a&&a(`update:${o}`,e)}})}}}(i),a=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value)))),r=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>a.add(e)))),Array.from(a)}));return{isInGroup:t,group:n,modifiers:r,disabled:a,bus:null==n?void 0:n.bus}}const p=["id","open"],
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const i=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,l.button,t.local;const s={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o){const{group:n,isInGroup:t}=function(o){const n=e.inject(o,void 0),t=e.computed((()=>void 0!==n));return{group:n,isInGroup:t,getGroupOrLocalRef:function(o,t,a){const r=null==n?void 0:n[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const u=e.toRef(t,o);return e.computed({get:()=>u.value,set(e){a&&a(`update:${o}`,e)}})}}}(i),a=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value)))),r=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>a.add(e)))),Array.from(a)}));return{isInGroup:t,group:n,modifiers:r,disabled:a,bus:null==n?void 0:n.bus}}const p=["id","open"],f=["aria-controls","aria-expanded"],m=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(t,{expose:a,emit:r}){const u=t,l=r,i=e.useAttrs(),d=n.useVModel(u,"modelValue",l),s=e.computed((()=>u.name||(null==i?void 0:i.id)||o.uid())),{title:v,content:g,not:b}=e.toRefs(u),{isInGroup:y,modifiers:x,disabled:B,bus:h}=c(u),A=e.ref(!1);function E(){B.value||(y.value?null==h||h.emit("toggle",{name:s.value,value:!A.value}):A.value=!A.value)}function V(){A.value||E()}function S(){A.value&&E()}function $(e){h?h.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${s.value}" but it is not in a group`)}function k(e){h?null==h||h.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${s.value}" but it is not in a group`)}e.watch(d,(e=>{"boolean"==typeof e&&(A.value=b.value?!e:e)}),{immediate:!0}),e.watch(A,(e=>{d.value=b.value?!e:e})),null==h||h.on("toggle",(({name:e,value:o})=>{e===s.value&&(A.value=o)})),e.watch(s,((e,o)=>{h&&(o&&o!==e&&h.emit("unregister",{name:o}),h.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{h&&h.emit("unregister",{name:s.value})})),a({isExpanded:A,expand:V,collapse:S,groupExpand:$,groupCollapse:k});const w=function(o,n,t){return e.computed((()=>{const a={[o]:!0},r="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${o}--${n}`]=e.unref(t.value[n])})),a}))}("vv-accordion",x,e.computed((()=>({disabled:B.value}))));return(o,n)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(w)),open:e.unref(A)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(A),class:"vv-accordion__summary",onClick:n[0]||(n[0]=e.withModifiers((e=>E()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)]))],8,f),e.createElementVNode("div",{"aria-hidden":!e.unref(A),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,m)],10,p))}})}));
|
|
@@ -412,8 +412,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
412
412
|
emits: VvAccordionEvents,
|
|
413
413
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
414
414
|
const props = __props;
|
|
415
|
-
const attrs = useAttrs();
|
|
416
415
|
const emit = __emit;
|
|
416
|
+
const attrs = useAttrs();
|
|
417
417
|
const modelValue = useVModel(props, "modelValue", emit);
|
|
418
418
|
const accordionName = computed(
|
|
419
419
|
() => props.name || (attrs == null ? void 0 : attrs.id) || uid()
|
|
@@ -439,7 +439,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
439
439
|
}
|
|
440
440
|
isExpanded.value = value;
|
|
441
441
|
});
|
|
442
|
-
|
|
442
|
+
function onClick() {
|
|
443
443
|
if (disabled.value) {
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
@@ -451,7 +451,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
453
|
isExpanded.value = !isExpanded.value;
|
|
454
|
-
}
|
|
454
|
+
}
|
|
455
455
|
watch(
|
|
456
456
|
accordionName,
|
|
457
457
|
(newValue, oldValue) => {
|
|
@@ -471,19 +471,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
471
471
|
bus.emit("unregister", { name: accordionName.value });
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
|
-
|
|
474
|
+
function expand() {
|
|
475
475
|
if (isExpanded.value) {
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
478
|
onClick();
|
|
479
|
-
}
|
|
480
|
-
|
|
479
|
+
}
|
|
480
|
+
function collapse() {
|
|
481
481
|
if (!isExpanded.value) {
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
484
484
|
onClick();
|
|
485
|
-
}
|
|
486
|
-
|
|
485
|
+
}
|
|
486
|
+
function groupExpand(name) {
|
|
487
487
|
if (!bus) {
|
|
488
488
|
console.warn(
|
|
489
489
|
`[VvAccordion]: You are trying to expand accordion group of "${accordionName.value}" but it is not in a group`
|
|
@@ -491,8 +491,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
493
|
bus.emit("expand", { name });
|
|
494
|
-
}
|
|
495
|
-
|
|
494
|
+
}
|
|
495
|
+
function groupCollapse(name) {
|
|
496
496
|
if (!bus) {
|
|
497
497
|
console.warn(
|
|
498
498
|
`[VvAccordion]: You are trying to collapse accordion group of "${accordionName.value}" but it is not in a group`
|
|
@@ -500,7 +500,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
502
|
bus == null ? void 0 : bus.emit("collapse", { name });
|
|
503
|
-
}
|
|
503
|
+
}
|
|
504
504
|
__expose({
|
|
505
505
|
isExpanded,
|
|
506
506
|
expand,
|
|
@@ -602,7 +602,7 @@ const VvAccordionGroupProps = {
|
|
|
602
602
|
not: Boolean
|
|
603
603
|
};
|
|
604
604
|
const VvAccordionGroupEvents = ["update:modelValue"];
|
|
605
|
-
|
|
605
|
+
function usePersistence(storageKey, storageType = StorageType.local, defaultValue) {
|
|
606
606
|
const localValue = ref();
|
|
607
607
|
if (defaultValue) {
|
|
608
608
|
localValue.value = defaultValue;
|
|
@@ -661,7 +661,7 @@ const usePersistence = (storageKey, storageType = StorageType.local, defaultValu
|
|
|
661
661
|
localValue.value = value;
|
|
662
662
|
}
|
|
663
663
|
});
|
|
664
|
-
}
|
|
664
|
+
}
|
|
665
665
|
function useProvideGroupState(key, groupState) {
|
|
666
666
|
provide(key, groupState);
|
|
667
667
|
}
|
|
@@ -794,7 +794,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
794
794
|
newValue.delete(name);
|
|
795
795
|
expandedAccordions.value = newValue;
|
|
796
796
|
});
|
|
797
|
-
|
|
797
|
+
function expand(name) {
|
|
798
798
|
if (typeof name === "string") {
|
|
799
799
|
bus.emit("toggle", { name, value: true });
|
|
800
800
|
return;
|
|
@@ -808,9 +808,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
808
808
|
for (const item of accordionNames) {
|
|
809
809
|
bus.emit("toggle", { name: item, value: true });
|
|
810
810
|
}
|
|
811
|
-
}
|
|
811
|
+
}
|
|
812
812
|
bus.on("expand", ({ name }) => expand(name));
|
|
813
|
-
|
|
813
|
+
function collapse(name) {
|
|
814
814
|
if (typeof name === "string") {
|
|
815
815
|
bus.emit("toggle", { name, value: false });
|
|
816
816
|
return;
|
|
@@ -824,7 +824,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
824
824
|
for (const item of accordionNames) {
|
|
825
825
|
bus.emit("toggle", { name: item, value: false });
|
|
826
826
|
}
|
|
827
|
-
}
|
|
827
|
+
}
|
|
828
828
|
bus.on("collapse", ({ name }) => collapse(name));
|
|
829
829
|
__expose({ expandedAccordions, expand, collapse });
|
|
830
830
|
const bemCssClasses = useModifiers(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,i.button;const c={storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String};const m={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function v(o){const{group:t,isInGroup:a}=function(o){const t=e.inject(o,void 0),a=e.computed((()=>void 0!==t));return{group:t,isInGroup:a,getGroupOrLocalRef:function(o,a,n){const l=null==t?void 0:t[o];if(l)return e.computed({get:()=>l.value,set(e){l.value=e}});const r=e.toRef(a,o);return e.computed({get:()=>r.value,set(e){n&&n(`update:${o}`,e)}})}}}(s),n=e.computed((()=>Boolean(o.disabled||(null==t?void 0:t.disabled.value)))),l=e.computed((()=>{let e=o.modifiers,a=null==t?void 0:t.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach((e=>n.add(e)))),Array.from(n)}));return{isInGroup:a,group:t,modifiers:l,disabled:n,bus:null==t?void 0:t.bus}}function p(o,t,a){return e.computed((()=>{const n={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${o}--${t}`]=e.unref(a.value[t])})),n}))}const f=["id","open"],g=["aria-controls","aria-expanded"],y=["aria-hidden"],b=e.defineComponent({name:"VvAccordion",props:m,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const r=o,u=e.useAttrs(),
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,i.button;const c={storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String};const m={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function v(o){const{group:t,isInGroup:a}=function(o){const t=e.inject(o,void 0),a=e.computed((()=>void 0!==t));return{group:t,isInGroup:a,getGroupOrLocalRef:function(o,a,n){const l=null==t?void 0:t[o];if(l)return e.computed({get:()=>l.value,set(e){l.value=e}});const r=e.toRef(a,o);return e.computed({get:()=>r.value,set(e){n&&n(`update:${o}`,e)}})}}}(s),n=e.computed((()=>Boolean(o.disabled||(null==t?void 0:t.disabled.value)))),l=e.computed((()=>{let e=o.modifiers,a=null==t?void 0:t.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach((e=>n.add(e)))),Array.from(n)}));return{isInGroup:a,group:t,modifiers:l,disabled:n,bus:null==t?void 0:t.bus}}function p(o,t,a){return e.computed((()=>{const n={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${o}--${t}`]=e.unref(a.value[t])})),n}))}const f=["id","open"],g=["aria-controls","aria-expanded"],y=["aria-hidden"],b=e.defineComponent({name:"VvAccordion",props:m,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const r=o,u=l,i=e.useAttrs(),s=a.useVModel(r,"modelValue",u),d=e.computed((()=>r.name||(null==i?void 0:i.id)||t.uid())),{title:c,content:m,not:b}=e.toRefs(r),{isInGroup:S,modifiers:x,disabled:A,bus:B}=v(r),h=e.ref(!1);function V(){A.value||(S.value?null==B||B.emit("toggle",{name:d.value,value:!h.value}):h.value=!h.value)}function w(){h.value||V()}function k(){h.value&&V()}function $(e){B?B.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${d.value}" but it is not in a group`)}function E(e){B?null==B||B.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${d.value}" but it is not in a group`)}e.watch(s,(e=>{"boolean"==typeof e&&(h.value=b.value?!e:e)}),{immediate:!0}),e.watch(h,(e=>{s.value=b.value?!e:e})),null==B||B.on("toggle",(({name:e,value:o})=>{e===d.value&&(h.value=o)})),e.watch(d,((e,o)=>{B&&(o&&o!==e&&B.emit("unregister",{name:o}),B.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{B&&B.emit("unregister",{name:d.value})})),n({isExpanded:h,expand:w,collapse:k,groupExpand:$,groupCollapse:E});const C=p("vv-accordion",x,e.computed((()=>({disabled:A.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(d),class:e.normalizeClass(e.unref(C)),open:e.unref(h)},[e.createElementVNode("summary",{"aria-controls":e.unref(d),"aria-expanded":e.unref(h),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((e=>V()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]))],8,g),e.createElementVNode("div",{"aria-hidden":!e.unref(h),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,y)],10,f))}}),S={...d,...c,modelValue:{type:[String,Array],default:void 0},items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean};return e.defineComponent({name:"VvAccordionGroup",props:S,emits:["update:modelValue"],setup(t,{expose:l,emit:r}){const u=t,i=r,{disabled:d,modifiers:c,itemModifiers:m,items:v,storageKey:f,storageType:g}=e.toRefs(u);e.watchEffect((()=>{"string"==typeof u.modelValue&&u.collapse&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));const y=e.reactive(new Set),S=function(o,t=n.local,l){const r=e.ref();let u;return l&&(r.value=l),o&&e.watch(o,((o,l)=>{const i=e.unref(t)===n.session?sessionStorage:localStorage;l&&l!==o&&i.removeItem(l),u=o?a.useStorage(o,(null==u?void 0:u.value)??r.value,i):void 0}),{immediate:!0}),e.isRef(t)&&e.watch(t,((e,t)=>{if(null==o?void 0:o.value){if(e){const t=e===n.session?sessionStorage:localStorage;u=a.useStorage(o.value,(null==u?void 0:u.value)??r.value,t)}t&&t!==e&&(t===n.session?sessionStorage:localStorage).removeItem(o.value)}})),e.computed({get:()=>(null==u?void 0:u.value)??r.value,set:e=>{u?u.value=e:r.value=e}})}(f,g,[]),x=e.computed({get:()=>null!==u.modelValue&&void 0!==u.modelValue?u.modelValue:S.value,set:e=>{i("update:modelValue",e),S.value=e}}),A=e.computed({get:()=>{if(void 0===x.value)return new Set;let e=new Set;return u.not?"string"==typeof x.value?e=new Set([...y].filter((e=>e!==x.value))):Array.isArray(x.value)&&(e=new Set([...y].filter((e=>!x.value.includes(e))))):"string"==typeof x.value?e=new Set([x.value]):Array.isArray(x.value)&&(e=new Set(x.value)),e},set:e=>{u.not?x.value=[...y].filter((o=>!e.has(o))):u.collapse?x.value=[...e]:x.value=e.values().next().value}});e.onMounted((()=>{u.not&&void 0===x.value&&(x.value=u.collapse?[]:[...y.values()].splice(1,y.size)),e.nextTick((()=>{for(const e of y)B.emit("toggle",{name:e,value:A.value.has(e)})}))}));const B=o();var h,V;function w(e){if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!0});else for(const o of y)B.emit("toggle",{name:o,value:!0});else B.emit("toggle",{name:e,value:!0})}function k(e){if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!1});else for(const o of y)B.emit("toggle",{name:o,value:!1});else B.emit("toggle",{name:e,value:!1})}h=s,V={disabled:d,modifiers:m,bus:B},e.provide(h,V),B.on("register",(({name:e})=>{y.add(e)})),B.on("unregister",(({name:e})=>{y.delete(e)})),B.on("toggle",(({name:e,value:o})=>{const t=new Set(A.value);if(o){if(!u.collapse){for(const o of t)o!==e&&B.emit("toggle",{name:o,value:!1});t.clear()}return t.add(e),void(A.value=t)}t.delete(e),A.value=t})),B.on("expand",(({name:e})=>w(e))),B.on("collapse",(({name:e})=>k(e))),l({expandedAccordions:A,expand:w,collapse:k});const $=p("vv-accordion-group",c,e.computed((()=>({disabled:d.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($))},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({expandedAccordions:e.unref(A),expand:w,collapse:k})),(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(t=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:t.title,ref_for:!0},{name:t.name,title:t.title,content:t.content}),e.createSlots({_:2},[o.$slots[`summary::${t.name}`]?{name:"summary",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`summary::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"0"}:void 0,o.$slots[`content::${t.name}`]?{name:"default",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`content::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"1"}:void 0]),1040)))),128))]))],2))}})}));
|
|
@@ -358,7 +358,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
358
358
|
return toReturn;
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
|
-
|
|
361
|
+
function onClick(e) {
|
|
362
362
|
var _a;
|
|
363
363
|
if (props.disabled) {
|
|
364
364
|
e.preventDefault();
|
|
@@ -369,23 +369,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
|
|
372
|
-
}
|
|
373
|
-
|
|
372
|
+
}
|
|
373
|
+
function onMouseover(e) {
|
|
374
374
|
var _a;
|
|
375
375
|
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
|
|
376
376
|
emit("mouseover", e);
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
379
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
|
|
380
|
-
}
|
|
381
|
-
|
|
380
|
+
}
|
|
381
|
+
function onMouseleave(e) {
|
|
382
382
|
var _a;
|
|
383
383
|
if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
|
|
384
384
|
emit("mouseleave", e);
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
|
|
388
|
-
}
|
|
388
|
+
}
|
|
389
389
|
return (_ctx, _cache) => {
|
|
390
390
|
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
391
391
|
ref_key: "element",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};n.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...s,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=n,d=e.getCurrentInstance(),c=e.inject(a),v=e.ref(null);o({$el:v});const{reference:f,bus:p,aria:b,expanded:m}=e.inject(u,{});e.watch((()=>v.value),(e=>{f&&(f.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(i,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==c?void 0:c.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),B=e.computed((()=>{const e={...null==b?void 0:b.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}}))
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};n.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...s,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=n,d=e.getCurrentInstance(),c=e.inject(a),v=e.ref(null);o({$el:v});const{reference:f,bus:p,aria:b,expanded:m}=e.inject(u,{});e.watch((()=>v.value),(e=>{f&&(f.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(i,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==c?void 0:c.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),B=e.computed((()=>{const e={...null==b?void 0:b.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}}));function h(e){var t;l.disabled?e.preventDefault():(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onClick)?s("click",e):null==p||p.emit("click",e)}function S(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseover)?s("mouseover",e):null==p||p.emit("mouseover",e)}function x(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseleave)?s("mouseleave",e):null==p||p.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(B),{ref_key:"element",ref:v,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
|