@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.21
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/LICENSE +1 -1
- package/README.md +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +70 -14
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +117 -38
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +58 -13
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +195 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +240 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +73 -17
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +259 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +187 -141
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +69 -16
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +84 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -22
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +180 -67
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +758 -531
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +136 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +82 -22
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
- package/dist/components/VvInputFile/index.d.ts +179 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +331 -293
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
- package/dist/components/VvInputText/index.d.ts +71 -29
- package/dist/components/VvNav/VvNav.es.js +151 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +436 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +180 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +248 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +256 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +229 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2902 -1329
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +210 -210
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +97 -80
- package/src/Volver.ts +31 -20
- 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 +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +365 -0
- package/src/components/VvInputFile/index.ts +116 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +17 -18
- package/src/components/VvInputText/index.ts +7 -15
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
label: string;
|
|
3
|
-
to?: string | {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
};
|
|
6
|
-
title?: string;
|
|
7
|
-
href?: string;
|
|
8
|
-
}
|
|
1
|
+
import type { NavItem } from '../../types';
|
|
9
2
|
export declare const VvBreadcrumbProps: {
|
|
10
|
-
routes: globalThis.PropType<
|
|
11
|
-
modifiers:
|
|
3
|
+
routes: globalThis.PropType<NavItem[]>;
|
|
4
|
+
modifiers: {
|
|
5
|
+
type: globalThis.PropType<string | string[]>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
12
8
|
};
|
|
@@ -1,99 +1,9 @@
|
|
|
1
|
-
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment } from "vue";
|
|
1
|
+
import { inject, computed, unref, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, toRef, useAttrs, useSlots, createElementBlock, Fragment } from "vue";
|
|
2
2
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
color: String,
|
|
9
|
-
/**
|
|
10
|
-
* Width
|
|
11
|
-
*/
|
|
12
|
-
width: {
|
|
13
|
-
type: [String, Number]
|
|
14
|
-
},
|
|
15
|
-
/**
|
|
16
|
-
* Height
|
|
17
|
-
*/
|
|
18
|
-
height: {
|
|
19
|
-
type: [String, Number]
|
|
20
|
-
},
|
|
21
|
-
/**
|
|
22
|
-
* Icon name
|
|
23
|
-
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
24
|
-
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
25
|
-
*/
|
|
26
|
-
name: {
|
|
27
|
-
type: String,
|
|
28
|
-
required: true
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* By default 'vv'
|
|
32
|
-
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
33
|
-
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
34
|
-
*/
|
|
35
|
-
provider: {
|
|
36
|
-
type: String
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* The name of icon set.
|
|
40
|
-
* Icon default options prefix: simple | normal | detailed
|
|
41
|
-
*/
|
|
42
|
-
prefix: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "normal"
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Url remote SVG icon
|
|
48
|
-
*/
|
|
49
|
-
src: String,
|
|
50
|
-
/**
|
|
51
|
-
* Horizontal flip
|
|
52
|
-
*/
|
|
53
|
-
horizontalFlip: Boolean,
|
|
54
|
-
/**
|
|
55
|
-
* Vertical flip
|
|
56
|
-
*/
|
|
57
|
-
verticalFlip: Boolean,
|
|
58
|
-
/**
|
|
59
|
-
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
60
|
-
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
61
|
-
*/
|
|
62
|
-
flip: String,
|
|
63
|
-
/**
|
|
64
|
-
* Icon render mode
|
|
65
|
-
* 'style' = 'bg' or 'mask', depending on icon content
|
|
66
|
-
* 'bg' = span with style using `background`
|
|
67
|
-
* 'mask' = span with style using `mask`
|
|
68
|
-
* 'svg' = svg
|
|
69
|
-
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
70
|
-
*/
|
|
71
|
-
mode: String,
|
|
72
|
-
/**
|
|
73
|
-
* Toggles inline or block mode
|
|
74
|
-
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
75
|
-
*/
|
|
76
|
-
inline: Boolean,
|
|
77
|
-
/**
|
|
78
|
-
* rotates icon
|
|
79
|
-
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
80
|
-
*/
|
|
81
|
-
rotate: [Number, String],
|
|
82
|
-
/**
|
|
83
|
-
* A callback that is called when icon data has been loaded
|
|
84
|
-
*/
|
|
85
|
-
onLoad: Function,
|
|
86
|
-
/**
|
|
87
|
-
* SVG icon string
|
|
88
|
-
*/
|
|
89
|
-
svg: String,
|
|
90
|
-
/**
|
|
91
|
-
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
92
|
-
* @values string | string[]
|
|
93
|
-
*/
|
|
94
|
-
modifiers: {
|
|
95
|
-
type: [String, Array]
|
|
96
|
-
}
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
const VvIconPropsDefaults = {
|
|
5
|
+
prefix: "normal"
|
|
6
|
+
/* normal */
|
|
97
7
|
};
|
|
98
8
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
99
9
|
Strategy2["absolute"] = "absolute";
|
|
@@ -182,7 +92,24 @@ const __default__$2 = {
|
|
|
182
92
|
};
|
|
183
93
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
184
94
|
...__default__$2,
|
|
185
|
-
props:
|
|
95
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
96
|
+
name: {},
|
|
97
|
+
color: {},
|
|
98
|
+
width: {},
|
|
99
|
+
height: {},
|
|
100
|
+
provider: {},
|
|
101
|
+
prefix: {},
|
|
102
|
+
src: {},
|
|
103
|
+
horizontalFlip: { type: Boolean },
|
|
104
|
+
verticalFlip: { type: Boolean },
|
|
105
|
+
flip: {},
|
|
106
|
+
mode: {},
|
|
107
|
+
inline: { type: Boolean },
|
|
108
|
+
rotate: {},
|
|
109
|
+
onLoad: { type: Function },
|
|
110
|
+
svg: {},
|
|
111
|
+
modifiers: {}
|
|
112
|
+
}, VvIconPropsDefaults),
|
|
186
113
|
setup(__props) {
|
|
187
114
|
const props = __props;
|
|
188
115
|
const hasRotate = computed(() => {
|
|
@@ -269,7 +196,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
269
196
|
color: _ctx.color,
|
|
270
197
|
onLoad: _ctx.onLoad,
|
|
271
198
|
icon: unref(icon)
|
|
272
|
-
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
199
|
+
}), null, 16, ["class"])) : createCommentVNode("v-if", true);
|
|
273
200
|
};
|
|
274
201
|
}
|
|
275
202
|
});
|
|
@@ -290,6 +217,7 @@ const LinkProps = {
|
|
|
290
217
|
*/
|
|
291
218
|
target: {
|
|
292
219
|
type: String,
|
|
220
|
+
default: void 0,
|
|
293
221
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
294
222
|
},
|
|
295
223
|
/**
|
|
@@ -304,7 +232,10 @@ const LoadingProps = {
|
|
|
304
232
|
/**
|
|
305
233
|
* Loading status
|
|
306
234
|
*/
|
|
307
|
-
loading:
|
|
235
|
+
loading: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: false
|
|
238
|
+
},
|
|
308
239
|
/**
|
|
309
240
|
* Loading label
|
|
310
241
|
*/
|
|
@@ -317,38 +248,65 @@ const DisabledProps = {
|
|
|
317
248
|
/**
|
|
318
249
|
* Whether the form control is disabled
|
|
319
250
|
*/
|
|
320
|
-
disabled:
|
|
251
|
+
disabled: {
|
|
252
|
+
type: Boolean,
|
|
253
|
+
default: false
|
|
254
|
+
}
|
|
321
255
|
};
|
|
322
256
|
const ActiveProps = {
|
|
323
257
|
/**
|
|
324
258
|
* Whether the item is active
|
|
325
259
|
*/
|
|
326
|
-
active:
|
|
260
|
+
active: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: false
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const CurrentProps = {
|
|
266
|
+
/**
|
|
267
|
+
* Whether the item is current
|
|
268
|
+
*/
|
|
269
|
+
current: {
|
|
270
|
+
type: Boolean,
|
|
271
|
+
default: false
|
|
272
|
+
}
|
|
327
273
|
};
|
|
328
274
|
const PressedProps = {
|
|
329
275
|
/**
|
|
330
276
|
* Whether the item is pressed
|
|
331
277
|
*/
|
|
332
|
-
pressed:
|
|
278
|
+
pressed: {
|
|
279
|
+
type: Boolean,
|
|
280
|
+
default: false
|
|
281
|
+
}
|
|
333
282
|
};
|
|
334
283
|
const LabelProps = {
|
|
335
284
|
/**
|
|
336
285
|
* The item label
|
|
337
286
|
*/
|
|
338
|
-
label:
|
|
287
|
+
label: {
|
|
288
|
+
type: [String, Number],
|
|
289
|
+
default: void 0
|
|
290
|
+
}
|
|
339
291
|
};
|
|
340
292
|
const ModifiersProps = {
|
|
341
293
|
/**
|
|
342
294
|
* Component BEM modifiers
|
|
343
295
|
*/
|
|
344
|
-
modifiers:
|
|
296
|
+
modifiers: {
|
|
297
|
+
type: [String, Array],
|
|
298
|
+
default: void 0
|
|
299
|
+
}
|
|
345
300
|
};
|
|
346
|
-
|
|
301
|
+
const IconProps = {
|
|
347
302
|
/**
|
|
348
303
|
* VvIcon name or props
|
|
349
304
|
* @see VVIcon
|
|
350
305
|
*/
|
|
351
|
-
icon: {
|
|
306
|
+
icon: {
|
|
307
|
+
type: [String, Object],
|
|
308
|
+
default: void 0
|
|
309
|
+
},
|
|
352
310
|
/**
|
|
353
311
|
* VvIcon position
|
|
354
312
|
*/
|
|
@@ -357,7 +315,7 @@ const ModifiersProps = {
|
|
|
357
315
|
default: Position.before,
|
|
358
316
|
validation: (value) => Object.values(Position).includes(value)
|
|
359
317
|
}
|
|
360
|
-
}
|
|
318
|
+
};
|
|
361
319
|
const UnselectableProps = {
|
|
362
320
|
/**
|
|
363
321
|
* If true the input will be unselectable
|
|
@@ -392,7 +350,8 @@ const IdProps = {
|
|
|
392
350
|
* Dropdown show / hide transition name
|
|
393
351
|
*/
|
|
394
352
|
transitionName: {
|
|
395
|
-
type: String
|
|
353
|
+
type: String,
|
|
354
|
+
default: void 0
|
|
396
355
|
},
|
|
397
356
|
/**
|
|
398
357
|
* Offset of the dropdown from the trigger
|
|
@@ -460,7 +419,8 @@ const IdProps = {
|
|
|
460
419
|
* Set dropdown width to the same as the trigger
|
|
461
420
|
*/
|
|
462
421
|
triggerWidth: {
|
|
463
|
-
type: Boolean
|
|
422
|
+
type: Boolean,
|
|
423
|
+
default: false
|
|
464
424
|
}
|
|
465
425
|
});
|
|
466
426
|
const ActionProps = {
|
|
@@ -468,6 +428,7 @@ const ActionProps = {
|
|
|
468
428
|
...LabelProps,
|
|
469
429
|
...PressedProps,
|
|
470
430
|
...ActiveProps,
|
|
431
|
+
...CurrentProps,
|
|
471
432
|
...LinkProps,
|
|
472
433
|
/**
|
|
473
434
|
* Button type
|
|
@@ -483,6 +444,13 @@ const ActionProps = {
|
|
|
483
444
|
ariaLabel: {
|
|
484
445
|
type: String,
|
|
485
446
|
default: void 0
|
|
447
|
+
},
|
|
448
|
+
/**
|
|
449
|
+
* Default tag for the action
|
|
450
|
+
*/
|
|
451
|
+
defaultTag: {
|
|
452
|
+
type: String,
|
|
453
|
+
default: ActionTag.button
|
|
486
454
|
}
|
|
487
455
|
};
|
|
488
456
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -500,8 +468,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
500
468
|
...__default__$1,
|
|
501
469
|
props: VvActionProps,
|
|
502
470
|
emits: VvActionEvents,
|
|
503
|
-
setup(__props, { expose: __expose, emit }) {
|
|
471
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
504
472
|
const props = __props;
|
|
473
|
+
const emit = __emit;
|
|
505
474
|
const volver = useVolver();
|
|
506
475
|
const element = ref(null);
|
|
507
476
|
__expose({ $el: element });
|
|
@@ -532,7 +501,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
532
501
|
case props.href !== void 0:
|
|
533
502
|
return ActionTag.a;
|
|
534
503
|
default:
|
|
535
|
-
return
|
|
504
|
+
return props.defaultTag;
|
|
536
505
|
}
|
|
537
506
|
});
|
|
538
507
|
const hasProps = computed(() => {
|
|
@@ -557,12 +526,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
557
526
|
to: props.to,
|
|
558
527
|
target: props.target
|
|
559
528
|
};
|
|
560
|
-
|
|
529
|
+
case ActionTag.button:
|
|
561
530
|
return {
|
|
562
531
|
...toReturn,
|
|
563
532
|
type: props.type,
|
|
564
533
|
disabled: props.disabled
|
|
565
534
|
};
|
|
535
|
+
default:
|
|
536
|
+
return toReturn;
|
|
566
537
|
}
|
|
567
538
|
});
|
|
568
539
|
const onClick = (e) => {
|
|
@@ -588,18 +559,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
588
559
|
class: {
|
|
589
560
|
active: _ctx.active,
|
|
590
561
|
pressed: unref(pressed),
|
|
591
|
-
disabled: _ctx.disabled
|
|
562
|
+
disabled: _ctx.disabled,
|
|
563
|
+
current: _ctx.current
|
|
592
564
|
},
|
|
593
565
|
onClickPassive: onClick,
|
|
594
566
|
onMouseoverPassive: onMouseover,
|
|
595
567
|
onMouseleavePassive: onMouseleave
|
|
596
568
|
}), {
|
|
597
569
|
default: withCtx(() => [
|
|
570
|
+
createCommentVNode(" @slot Default slot "),
|
|
598
571
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
599
|
-
createTextVNode(
|
|
572
|
+
createTextVNode(
|
|
573
|
+
toDisplayString(_ctx.label),
|
|
574
|
+
1
|
|
575
|
+
/* TEXT */
|
|
576
|
+
)
|
|
600
577
|
])
|
|
601
578
|
]),
|
|
602
579
|
_: 3
|
|
580
|
+
/* FORWARDED */
|
|
603
581
|
}, 16, ["class"]);
|
|
604
582
|
};
|
|
605
583
|
}
|
|
@@ -725,10 +703,7 @@ const VvButtonProps = {
|
|
|
725
703
|
...ModifiersProps,
|
|
726
704
|
...UnselectableProps,
|
|
727
705
|
...LoadingProps,
|
|
728
|
-
|
|
729
|
-
* Button icon
|
|
730
|
-
*/
|
|
731
|
-
icon: [String, Object],
|
|
706
|
+
...IconProps,
|
|
732
707
|
/**
|
|
733
708
|
* Button icon position
|
|
734
709
|
*/
|
|
@@ -822,7 +797,42 @@ function useGroupProps(props, emit) {
|
|
|
822
797
|
label
|
|
823
798
|
};
|
|
824
799
|
}
|
|
825
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
800
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
801
|
+
function useComponentIcon(icon, iconPosition) {
|
|
802
|
+
const hasIcon = computed(() => {
|
|
803
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
804
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
805
|
+
}
|
|
806
|
+
return icon == null ? void 0 : icon.value;
|
|
807
|
+
});
|
|
808
|
+
const hasIconBefore = computed(
|
|
809
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
810
|
+
);
|
|
811
|
+
const hasIconAfter = computed(
|
|
812
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
813
|
+
);
|
|
814
|
+
const hasIconLeft = computed(
|
|
815
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
816
|
+
);
|
|
817
|
+
const hasIconRight = computed(
|
|
818
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
819
|
+
);
|
|
820
|
+
const hasIconTop = computed(
|
|
821
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
822
|
+
);
|
|
823
|
+
const hasIconBottom = computed(
|
|
824
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
825
|
+
);
|
|
826
|
+
return {
|
|
827
|
+
hasIcon,
|
|
828
|
+
hasIconLeft,
|
|
829
|
+
hasIconRight,
|
|
830
|
+
hasIconTop,
|
|
831
|
+
hasIconBottom,
|
|
832
|
+
hasIconBefore,
|
|
833
|
+
hasIconAfter
|
|
834
|
+
};
|
|
835
|
+
}
|
|
826
836
|
const _hoisted_1 = {
|
|
827
837
|
key: 1,
|
|
828
838
|
class: "vv-button__label"
|
|
@@ -838,10 +848,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
838
848
|
...__default__,
|
|
839
849
|
props: VvButtonProps,
|
|
840
850
|
emits: VvButtonEvents,
|
|
841
|
-
setup(__props, { expose: __expose, emit }) {
|
|
851
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
842
852
|
const props = __props;
|
|
843
853
|
const attrs = useAttrs();
|
|
844
854
|
const slots = useSlots();
|
|
855
|
+
const emit = __emit;
|
|
845
856
|
const {
|
|
846
857
|
id,
|
|
847
858
|
modifiers,
|
|
@@ -885,9 +896,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
885
896
|
)
|
|
886
897
|
}))
|
|
887
898
|
);
|
|
888
|
-
const
|
|
889
|
-
() => typeof (icon == null ? void 0 : icon.value) === "string" ? { name: icon == null ? void 0 : icon.value } : icon == null ? void 0 : icon.value
|
|
890
|
-
);
|
|
899
|
+
const { hasIcon } = useComponentIcon(icon);
|
|
891
900
|
const toggleValue = computed(() => {
|
|
892
901
|
return props.value !== void 0 ? props.value : name.value;
|
|
893
902
|
});
|
|
@@ -931,30 +940,67 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
931
940
|
onClick
|
|
932
941
|
}), {
|
|
933
942
|
default: withCtx(() => [
|
|
943
|
+
createCommentVNode(" @slot Default slot "),
|
|
934
944
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
945
|
+
createCommentVNode(" #region loading "),
|
|
946
|
+
_ctx.loading ? (openBlock(), createElementBlock(
|
|
947
|
+
Fragment,
|
|
948
|
+
{ key: 0 },
|
|
949
|
+
[
|
|
950
|
+
createCommentVNode(" @slot Slot for loading content "),
|
|
951
|
+
renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
952
|
+
_ctx.loadingIcon ? (openBlock(), createBlock(_sfc_main$2, {
|
|
953
|
+
key: 0,
|
|
954
|
+
class: "vv-button__loading-icon",
|
|
955
|
+
name: _ctx.loadingIcon
|
|
956
|
+
}, null, 8, ["name"])) : createCommentVNode("v-if", true),
|
|
957
|
+
_ctx.loadingLabel ? (openBlock(), createElementBlock(
|
|
958
|
+
"span",
|
|
959
|
+
_hoisted_1,
|
|
960
|
+
toDisplayString(_ctx.loadingLabel),
|
|
961
|
+
1
|
|
962
|
+
/* TEXT */
|
|
963
|
+
)) : createCommentVNode("v-if", true)
|
|
951
964
|
])
|
|
952
|
-
]
|
|
953
|
-
|
|
954
|
-
|
|
965
|
+
],
|
|
966
|
+
64
|
|
967
|
+
/* STABLE_FRAGMENT */
|
|
968
|
+
)) : (openBlock(), createElementBlock(
|
|
969
|
+
Fragment,
|
|
970
|
+
{ key: 1 },
|
|
971
|
+
[
|
|
972
|
+
createCommentVNode(" #endregion "),
|
|
973
|
+
createCommentVNode(" #region button "),
|
|
974
|
+
createCommentVNode(" @slot Before label and icon "),
|
|
975
|
+
renderSlot(_ctx.$slots, "before"),
|
|
976
|
+
unref(hasIcon) ? (openBlock(), createBlock(
|
|
977
|
+
_sfc_main$2,
|
|
978
|
+
mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-button__icon" }),
|
|
979
|
+
null,
|
|
980
|
+
16
|
|
981
|
+
/* FULL_PROPS */
|
|
982
|
+
)) : createCommentVNode("v-if", true),
|
|
983
|
+
unref(label) ? (openBlock(), createElementBlock("span", _hoisted_2, [
|
|
984
|
+
createCommentVNode(" @slot Use this slot for button label "),
|
|
985
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
986
|
+
createTextVNode(
|
|
987
|
+
toDisplayString(unref(label)),
|
|
988
|
+
1
|
|
989
|
+
/* TEXT */
|
|
990
|
+
)
|
|
991
|
+
])
|
|
992
|
+
])) : createCommentVNode("v-if", true),
|
|
993
|
+
createCommentVNode(" @slot After label and icon "),
|
|
994
|
+
renderSlot(_ctx.$slots, "after")
|
|
995
|
+
],
|
|
996
|
+
64
|
|
997
|
+
/* STABLE_FRAGMENT */
|
|
998
|
+
)),
|
|
999
|
+
createCommentVNode(" #endregion ")
|
|
955
1000
|
])
|
|
956
1001
|
]),
|
|
957
1002
|
_: 3
|
|
1003
|
+
/* FORWARDED */
|
|
958
1004
|
}, 16, ["id", "class"]);
|
|
959
1005
|
};
|
|
960
1006
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","nanoid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.nanoid)}(this,(function(e,t,o){"use strict";const n={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const s=Symbol.for("volver"),c=Symbol.for("buttonGroup"),d=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(s)}function p(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}const m=e.defineComponent({name:"VvIcon",props:n,setup(o){const n=o,r=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),l=e.ref(!0),i=v(),{modifiers:a}=e.toRefs(n),u=p("vv-icon",a),s=e.computed((()=>n.provider||(null==i?void 0:i.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${s.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const r=null==i?void 0:i.iconsCollections.find((o=>{const n=`@${s.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return r?`@${s.value}:${r.prefix}:${e}`:e}));function d(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==o?void 0:o.innerHTML.trim())||"";o&&r&&t.addIcon(`@${s.value}:${n.prefix}:${n.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return i&&n.src&&!t.iconExists(`@${s.value}:${n.prefix}:${n.name}`)&&(l.value=!1,i.fetchIcon(n.src).then((e=>{e&&(d(e),l.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&d(n.svg),(o,n)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(r),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},y={disabled:Boolean},h={active:Boolean},S={pressed:Boolean},k={label:[String,Number]},B={modifiers:[String,Array]};l.before;const $={unselectable:{type:Boolean,default:!0}},x={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const w={...y,...k,...S,...h,...g,type:{type:String,default:i.button,validator:e=>Object.values(i).includes(e)},ariaLabel:{type:String,default:void 0}},A=w;const L=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const r=t,l=v(),i=e.ref(null);o({$el:i});const{reference:u,bus:s,aria:c,expanded:p}=e.inject(d,{});e.watch((()=>i.value),(e=>{u&&(u.value=e)}));const m=e.computed((()=>r.pressed||(null==p?void 0:p.value))),{role:g}=e.inject(f,{}),b=e.computed((()=>{switch(!0){case r.disabled:return a.button;case void 0!==r.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==r.href:return a.a;default:return a.button}})),y=e.computed((()=>{const e={...null==c?void 0:c.value,ariaPressed:!!m.value||void 0,ariaLabel:r.ariaLabel,role:null==g?void 0:g.value};switch(b.value){case a.a:return{...e,href:r.href,target:r.target,rel:r.rel};case a.routerLink:case a.nuxtLink:return{...e,to:r.to,target:r.target};default:return{...e,type:r.type,disabled:r.disabled}}})),h=e=>{r.disabled?e.preventDefault():(null==s||s.emit("click",e),n("click",e))},S=e=>{null==s||s.emit("mouseover",e),n("mouseover",e)},k=e=>{null==s||s.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(b)),e.mergeProps(e.unref(y),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:k}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function j(e,t,o){return o?_(e,o)===_(t,o):V(e,t)}function V(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let r,l,i;if(o&&n){if(l=e.length,l!=t.length)return!1;for(r=l;0!=r--;)if(!V(e[r],t[r]))return!1;return!0}if(o!=n)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const s=e instanceof RegExp,c=t instanceof RegExp;if(s!=c)return!1;if(s&&c)return e.toString()==t.toString();const d=Object.keys(e);if(l=d.length,l!==Object.keys(t).length)return!1;for(r=l;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,d[r]))return!1;for(r=l;0!=r--;)if(i=d[r],!V(e[i],t[i]))return!1;return!0}return e!=e&&t!=t}function _(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,r=o.length;t<r;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function O(e,t){if(null!=e&&t&&t.length)for(const o of t)if(j(e,o))return!0;return!1}function P(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,r){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const l=e.toRef(n,t);return e.computed({get:()=>l.value,set(e){r&&r(`update:${t}`,e)}})}}}const N={...w,...x,...B,...$,...b,icon:[String,Object],iconPosition:{type:String,default:r.left,validator:e=>Object.values(r).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const C={key:1,class:"vv-button__label"},E={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:N,emits:["update:modelValue"],setup(t,{expose:n,emit:l}){const i=t,a=e.useAttrs(),u=e.useSlots(),{id:s,modifiers:d,iconPosition:f,icon:v,label:g,modelValue:b,disabled:y,toggle:h,unselectable:S}=function(t,o){const{group:n,isInGroup:r,getGroupOrLocalRef:l}=P(c),{id:i,iconPosition:a,icon:u,label:s,pressed:d}=e.toRefs(t),f=l("modelValue",t,o),v=l("toggle",t),p=l("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const r=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>r.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>r.add(e)))),Array.from(r)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:r,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:i,pressed:d,iconPosition:a,icon:u,label:s}}(i,l),k=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(s),B=e.computed((()=>(null==a?void 0:a.name)||k.value)),$=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=$.value)?void 0:e.$el}))});const x=e.computed((()=>h.value?Array.isArray(b.value)?O(B.value,b.value):j(B.value,b.value):i.pressed)),w=p("vv-button",d,e.computed((()=>({reverse:[r.right,r.bottom].includes(f.value),column:[r.top,r.bottom].includes(f.value),"icon-only":Boolean((null==v?void 0:v.value)&&!(null==g?void 0:g.value)&&!u.default)})))),A=e.computed((()=>"string"==typeof(null==v?void 0:v.value)?{name:null==v?void 0:v.value}:null==v?void 0:v.value)),V=e.computed((()=>void 0!==i.value?i.value:B.value)),_=()=>{if(h.value){if(Array.isArray(b.value))return O(V.value,b.value)?void(S.value&&(b.value=b.value.filter((e=>e!==V.value)))):void b.value.push(V.value);if(V.value===b.value&&S.value)return void(b.value=i.uncheckedValue);b.value=V.value}};return(t,o)=>(e.openBlock(),e.createBlock(L,e.mergeProps({disabled:e.unref(y),pressed:e.unref(x),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref(k),ref_key:"element",ref:$,class:e.unref(w),onClick:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[t.loading?e.renderSlot(t.$slots,"loading",{key:0},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"before"),e.unref(v)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(A)),null,16)):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after")],64))]))])),_:3},16,["id","class"]))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButton=t(e.vue,e.vue$1,e.uid)}(this,(function(e,t,o){"use strict";const n={prefix:"normal"};var 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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{}),u=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(u||{});const d=Symbol.for("volver"),c=Symbol.for("buttonGroup"),s=Symbol.for("dropdownTrigger"),f=Symbol.for("dropdownAction");function v(){return e.inject(d)}function p(t,o,n){return e.computed((()=>{const l={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{l[`${t}--${o}`]=e.unref(n.value[o])})),l}))}const m=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},n),setup(o){const n=o,l=e.computed((()=>"string"==typeof n.rotate?parseFloat(n.rotate):n.rotate)),r=e.ref(!0),a=v(),{modifiers:i}=e.toRefs(n),u=p("vv-icon",i),d=e.computed((()=>n.provider||(null==a?void 0:a.iconsProvider))),c=e.computed((()=>{const e=n.name??"",o=`@${d.value}:${n.prefix}:${e}`;if(t.iconExists(o))return o;const l=null==a?void 0:a.iconsCollections.find((o=>{const n=`@${d.value}:${o.prefix}:${e}`;return t.iconExists(n)}));return l?`@${d.value}:${l.prefix}:${e}`:e}));function s(e){const o=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),l=(null==o?void 0:o.innerHTML.trim())||"";o&&l&&t.addIcon(`@${d.value}:${n.prefix}:${n.name}`,{body:l,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return a&&n.src&&!t.iconExists(`@${d.value}:${n.prefix}:${n.name}`)&&(r.value=!1,a.fetchIcon(n.src).then((e=>{e&&(s(e),r.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),n.svg&&s(n.svg),(o,n)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(t.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:e.unref(l),color:o.color,onLoad:o.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),g={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(u).includes(e)},rel:{type:String,default:"noopener noreferrer"}},b={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},h={active:{type:Boolean,default:!1}},k={current:{type:Boolean,default:!1}},B={pressed:{type:Boolean,default:!1}},S={label:{type:[String,Number],default:void 0}},$={modifiers:{type:[String,Array],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:r.before,validation:e=>Object.values(r).includes(e)}},V={unselectable:{type:Boolean,default:!0}},w={id:[String,Number]};l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const C={...y,...S,...B,...h,...k,...g,type:{type:String,default:a.button,validator:e=>Object.values(a).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:i.button}},A=C;const L=e.defineComponent({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,r=n,a=v(),u=e.ref(null);o({$el:u});const{reference:d,bus:c,aria:p,expanded:m}=e.inject(s,{});e.watch((()=>u.value),(e=>{d&&(d.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:b}=e.inject(f,{}),y=e.computed((()=>{switch(!0){case l.disabled:return i.button;case void 0!==l.to:return(null==a?void 0:a.nuxt)?i.nuxtLink:i.routerLink;case void 0!==l.href:return i.a;default:return l.defaultTag}})),h=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(y.value){case i.a:return{...e,href:l.href,target:l.target,rel:l.rel};case i.routerLink:case i.nuxtLink:return{...e,to:l.to,target:l.target};case i.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),k=e=>{l.disabled?e.preventDefault():(null==c||c.emit("click",e),r("click",e))},B=e=>{null==c||c.emit("mouseover",e),r("mouseover",e)},S=e=>{null==c||c.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),e.mergeProps(e.unref(h),{ref_key:"element",ref:u,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:k,onMouseoverPassive:B,onMouseleavePassive:S}),{default:e.withCtx((()=>[e.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});function N(e,t,o){return o?_(e,o)===_(t,o):j(e,t)}function j(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const o=Array.isArray(e),n=Array.isArray(t);let l,r,a;if(o&&n){if(r=e.length,r!=t.length)return!1;for(l=r;0!=l--;)if(!j(e[l],t[l]))return!1;return!0}if(o!=n)return!1;const i=e instanceof Date,u=t instanceof Date;if(i!=u)return!1;if(i&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,c=t instanceof RegExp;if(d!=c)return!1;if(d&&c)return e.toString()==t.toString();const s=Object.keys(e);if(r=s.length,r!==Object.keys(t).length)return!1;for(l=r;0!=l--;)if(!Object.prototype.hasOwnProperty.call(t,s[l]))return!1;for(l=r;0!=l--;)if(a=s[l],!j(e[a],t[a]))return!1;return!0}return e!=e&&t!=t}function _(e,t){if(e&&Object.keys(e).length&&t){if(-1===t.indexOf("."))return e[t];{const o=t.split(".");let n=e;for(let t=0,l=o.length;t<l;++t){if(null==e)return null;n=n[o[t]]}return n}}return null}function O(e,t){if(null!=e&&t&&t.length)for(const o of t)if(N(e,o))return!0;return!1}function I(t){const o=e.inject(t,void 0),n=e.computed((()=>{return t=o,!(null==(n=e.unref(t))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length);var t,n}));return{group:o,isInGroup:n,getGroupOrLocalRef:function(t,n,l){if(null==o?void 0:o.value){const n=e.unref(o.value)[t];return e.computed({get:()=>null==n?void 0:n.value,set(e){n.value=e}})}const r=e.toRef(n,t);return e.computed({get:()=>r.value,set(e){l&&l(`update:${t}`,e)}})}}}const P={...C,...w,...$,...V,...b,...x,iconPosition:{type:String,default:l.left,validator:e=>Object.values(l).includes(e)},loadingIcon:{type:String,default:"eos-icons:bubble-loading"},toggle:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:void 0},uncheckedValue:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0}};const E={key:1,class:"vv-button__label"},D={key:1,class:"vv-button__label"};return e.defineComponent({name:"VvButton",props:P,emits:["update:modelValue"],setup(t,{expose:n,emit:a}){const i=t,u=e.useAttrs(),d=e.useSlots(),s=a,{id:f,modifiers:v,iconPosition:g,icon:b,label:y,modelValue:h,disabled:k,toggle:B,unselectable:S}=function(t,o){const{group:n,isInGroup:l,getGroupOrLocalRef:r}=I(c),{id:a,iconPosition:i,icon:u,label:d,pressed:s}=e.toRefs(t),f=r("modelValue",t,o),v=r("toggle",t),p=r("unselectable",t),m=e.computed((()=>(null==n?void 0:n.value.multiple.value)??!1)),g=e.computed((()=>{let e=t.modifiers,o=null==n?void 0:n.value.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),o&&(Array.isArray(o)||(o=o.split(" ")),o.forEach((e=>l.add(e)))),Array.from(l)})),b=e.computed((()=>{var e;return Boolean(t.disabled||(null==(e=null==n?void 0:n.value)?void 0:e.disabled.value))}));return{group:n,isInGroup:l,modelValue:f,toggle:v,unselectable:p,multiple:m,modifiers:g,disabled:b,id:a,pressed:s,iconPosition:i,icon:u,label:d}}(i,s),$=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(f),x=e.computed((()=>(null==u?void 0:u.name)||$.value)),V=e.ref(null);n({$el:e.computed((()=>{var e;return null==(e=V.value)?void 0:e.$el}))});const w=e.computed((()=>B.value?Array.isArray(h.value)?O(x.value,h.value):N(x.value,h.value):i.pressed)),C=p("vv-button",v,e.computed((()=>({reverse:[l.right,l.bottom].includes(g.value),column:[l.top,l.bottom].includes(g.value),"icon-only":Boolean((null==b?void 0:b.value)&&!(null==y?void 0:y.value)&&!d.default)})))),{hasIcon:A}=function(t,o){const n=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==o?void 0:o.value)===r.before?n.value:void 0)),i=e.computed((()=>(null==o?void 0:o.value)===r.after?n.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===l.left?n.value:void 0)),d=e.computed((()=>(null==o?void 0:o.value)===l.right?n.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===l.top?n.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===l.bottom?n.value:void 0));return{hasIcon:n,hasIconLeft:u,hasIconRight:d,hasIconTop:c,hasIconBottom:s,hasIconBefore:a,hasIconAfter:i}}(b),j=e.computed((()=>void 0!==i.value?i.value:x.value)),_=()=>{if(B.value){if(Array.isArray(h.value))return O(j.value,h.value)?void(S.value&&(h.value=h.value.filter((e=>e!==j.value)))):void h.value.push(j.value);if(j.value===h.value&&S.value)return void(h.value=i.uncheckedValue);h.value=j.value}};return(t,o)=>(e.openBlock(),e.createBlock(L,e.mergeProps({disabled:e.unref(k),pressed:e.unref(w),active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel,ariaLabel:t.ariaLabel},{id:e.unref($),ref_key:"element",ref:V,class:e.unref(C),onClick:_}),{default:e.withCtx((()=>[e.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createCommentVNode(" #region loading "),t.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" @slot Slot for loading content "),e.renderSlot(t.$slots,"loading",{},(()=>[t.loadingIcon?(e.openBlock(),e.createBlock(m,{key:0,class:"vv-button__loading-icon",name:t.loadingIcon},null,8,["name"])):e.createCommentVNode("v-if",!0),t.loadingLabel?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(t.loadingLabel),1)):e.createCommentVNode("v-if",!0)]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" #endregion "),e.createCommentVNode(" #region button "),e.createCommentVNode(" @slot Before label and icon "),e.renderSlot(t.$slots,"before"),e.unref(A)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(A),{class:"vv-button__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("span",D,[e.createCommentVNode(" @slot Use this slot for button label "),e.renderSlot(t.$slots,"label",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot After label and icon "),e.renderSlot(t.$slots,"after")],64)),e.createCommentVNode(" #endregion ")]))])),_:3},16,["id","class"]))}})}));
|