@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,5 +1,5 @@
|
|
|
1
|
-
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx } from "vue";
|
|
2
|
-
import {
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx } from "vue";
|
|
2
|
+
import { uid } from "uid";
|
|
3
3
|
import { useToggle, useStorage } from "@vueuse/core";
|
|
4
4
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
5
5
|
Strategy2["absolute"] = "absolute";
|
|
@@ -35,6 +35,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
35
35
|
ButtonType2["reset"] = "reset";
|
|
36
36
|
return ButtonType2;
|
|
37
37
|
})(ButtonType || {});
|
|
38
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
39
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
40
|
+
ActionTag2["routerLink"] = "router-link";
|
|
41
|
+
ActionTag2["a"] = "a";
|
|
42
|
+
ActionTag2["button"] = "button";
|
|
43
|
+
return ActionTag2;
|
|
44
|
+
})(ActionTag || {});
|
|
38
45
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
39
46
|
AnchorTarget2["_blank"] = "_blank";
|
|
40
47
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -60,6 +67,7 @@ const LinkProps = {
|
|
|
60
67
|
*/
|
|
61
68
|
target: {
|
|
62
69
|
type: String,
|
|
70
|
+
default: void 0,
|
|
63
71
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
64
72
|
},
|
|
65
73
|
/**
|
|
@@ -74,38 +82,65 @@ const DisabledProps = {
|
|
|
74
82
|
/**
|
|
75
83
|
* Whether the form control is disabled
|
|
76
84
|
*/
|
|
77
|
-
disabled:
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
78
89
|
};
|
|
79
90
|
const ActiveProps = {
|
|
80
91
|
/**
|
|
81
92
|
* Whether the item is active
|
|
82
93
|
*/
|
|
83
|
-
active:
|
|
94
|
+
active: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const CurrentProps = {
|
|
100
|
+
/**
|
|
101
|
+
* Whether the item is current
|
|
102
|
+
*/
|
|
103
|
+
current: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: false
|
|
106
|
+
}
|
|
84
107
|
};
|
|
85
108
|
const PressedProps = {
|
|
86
109
|
/**
|
|
87
110
|
* Whether the item is pressed
|
|
88
111
|
*/
|
|
89
|
-
pressed:
|
|
112
|
+
pressed: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: false
|
|
115
|
+
}
|
|
90
116
|
};
|
|
91
117
|
const LabelProps = {
|
|
92
118
|
/**
|
|
93
119
|
* The item label
|
|
94
120
|
*/
|
|
95
|
-
label:
|
|
121
|
+
label: {
|
|
122
|
+
type: [String, Number],
|
|
123
|
+
default: void 0
|
|
124
|
+
}
|
|
96
125
|
};
|
|
97
126
|
const ModifiersProps = {
|
|
98
127
|
/**
|
|
99
128
|
* Component BEM modifiers
|
|
100
129
|
*/
|
|
101
|
-
modifiers:
|
|
130
|
+
modifiers: {
|
|
131
|
+
type: [String, Array],
|
|
132
|
+
default: void 0
|
|
133
|
+
}
|
|
102
134
|
};
|
|
103
135
|
({
|
|
104
136
|
/**
|
|
105
137
|
* VvIcon name or props
|
|
106
138
|
* @see VVIcon
|
|
107
139
|
*/
|
|
108
|
-
icon: {
|
|
140
|
+
icon: {
|
|
141
|
+
type: [String, Object],
|
|
142
|
+
default: void 0
|
|
143
|
+
},
|
|
109
144
|
/**
|
|
110
145
|
* VvIcon position
|
|
111
146
|
*/
|
|
@@ -136,7 +171,8 @@ const ModifiersProps = {
|
|
|
136
171
|
* Dropdown show / hide transition name
|
|
137
172
|
*/
|
|
138
173
|
transitionName: {
|
|
139
|
-
type: String
|
|
174
|
+
type: String,
|
|
175
|
+
default: void 0
|
|
140
176
|
},
|
|
141
177
|
/**
|
|
142
178
|
* Offset of the dropdown from the trigger
|
|
@@ -204,7 +240,8 @@ const ModifiersProps = {
|
|
|
204
240
|
* Set dropdown width to the same as the trigger
|
|
205
241
|
*/
|
|
206
242
|
triggerWidth: {
|
|
207
|
-
type: Boolean
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: false
|
|
208
245
|
}
|
|
209
246
|
});
|
|
210
247
|
({
|
|
@@ -212,6 +249,7 @@ const ModifiersProps = {
|
|
|
212
249
|
...LabelProps,
|
|
213
250
|
...PressedProps,
|
|
214
251
|
...ActiveProps,
|
|
252
|
+
...CurrentProps,
|
|
215
253
|
...LinkProps,
|
|
216
254
|
/**
|
|
217
255
|
* Button type
|
|
@@ -227,6 +265,13 @@ const ModifiersProps = {
|
|
|
227
265
|
ariaLabel: {
|
|
228
266
|
type: String,
|
|
229
267
|
default: void 0
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
* Default tag for the action
|
|
271
|
+
*/
|
|
272
|
+
defaultTag: {
|
|
273
|
+
type: String,
|
|
274
|
+
default: ActionTag.button
|
|
230
275
|
}
|
|
231
276
|
});
|
|
232
277
|
function isEmpty(value) {
|
|
@@ -374,11 +419,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
374
419
|
...__default__$1,
|
|
375
420
|
props: VvAccordionProps,
|
|
376
421
|
emits: VvAccordionEvents,
|
|
377
|
-
setup(__props, { emit }) {
|
|
422
|
+
setup(__props, { emit: __emit }) {
|
|
378
423
|
const props = __props;
|
|
379
424
|
const attrs = useAttrs();
|
|
425
|
+
const emit = __emit;
|
|
380
426
|
const accordionName = computed(
|
|
381
|
-
() => props.name || (attrs == null ? void 0 : attrs.id) ||
|
|
427
|
+
() => props.name || (attrs == null ? void 0 : attrs.id) || uid()
|
|
382
428
|
);
|
|
383
429
|
const {
|
|
384
430
|
modifiers,
|
|
@@ -450,16 +496,26 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
450
496
|
class: "vv-accordion__summary",
|
|
451
497
|
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
|
|
452
498
|
}, [
|
|
499
|
+
createCommentVNode(" @slot Slot for title "),
|
|
453
500
|
renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
454
|
-
createTextVNode(
|
|
501
|
+
createTextVNode(
|
|
502
|
+
toDisplayString(unref(title)),
|
|
503
|
+
1
|
|
504
|
+
/* TEXT */
|
|
505
|
+
)
|
|
455
506
|
])
|
|
456
507
|
], 8, _hoisted_2),
|
|
457
508
|
createElementVNode("div", {
|
|
458
509
|
"aria-hidden": !unref(isOpen),
|
|
459
510
|
class: "vv-accordion__content"
|
|
460
511
|
}, [
|
|
512
|
+
createCommentVNode(" @slot Slot for content "),
|
|
461
513
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
|
|
462
|
-
createTextVNode(
|
|
514
|
+
createTextVNode(
|
|
515
|
+
toDisplayString(unref(content)),
|
|
516
|
+
1
|
|
517
|
+
/* TEXT */
|
|
518
|
+
)
|
|
463
519
|
])
|
|
464
520
|
], 8, _hoisted_3)
|
|
465
521
|
], 10, _hoisted_1);
|
|
@@ -522,8 +578,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
522
578
|
...__default__,
|
|
523
579
|
props: VvAccordionGroupProps,
|
|
524
580
|
emits: VvAccordionGroupEvents,
|
|
525
|
-
setup(__props, { emit }) {
|
|
581
|
+
setup(__props, { emit: __emit }) {
|
|
526
582
|
const props = __props;
|
|
583
|
+
const emit = __emit;
|
|
527
584
|
const { disabled, collapse, modifiers, itemModifiers, items, not } = toRefs(props);
|
|
528
585
|
watchEffect(() => {
|
|
529
586
|
if (typeof props.modelValue === "string" && collapse.value) {
|
|
@@ -581,29 +638,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
581
638
|
}))
|
|
582
639
|
);
|
|
583
640
|
return (_ctx, _cache) => {
|
|
584
|
-
return openBlock(), createElementBlock(
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
641
|
+
return openBlock(), createElementBlock(
|
|
642
|
+
"div",
|
|
643
|
+
{
|
|
644
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
645
|
+
},
|
|
646
|
+
[
|
|
647
|
+
createCommentVNode(" @slot Default slot "),
|
|
648
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
649
|
+
(openBlock(true), createElementBlock(
|
|
650
|
+
Fragment,
|
|
651
|
+
null,
|
|
652
|
+
renderList(unref(items), (item) => {
|
|
653
|
+
return openBlock(), createBlock(
|
|
654
|
+
_sfc_main$1,
|
|
655
|
+
mergeProps({
|
|
656
|
+
key: item.title
|
|
657
|
+
}, {
|
|
658
|
+
name: item.name,
|
|
659
|
+
title: item.title,
|
|
660
|
+
content: item.content
|
|
661
|
+
}),
|
|
662
|
+
{
|
|
663
|
+
header: withCtx((data) => [
|
|
664
|
+
createCommentVNode(" @slot Slot for accordion header "),
|
|
665
|
+
renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
666
|
+
]),
|
|
667
|
+
details: withCtx((data) => [
|
|
668
|
+
createCommentVNode(" @slot Slot for accordion details "),
|
|
669
|
+
renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
670
|
+
]),
|
|
671
|
+
_: 2
|
|
672
|
+
/* DYNAMIC */
|
|
673
|
+
},
|
|
674
|
+
1040
|
|
675
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
676
|
+
);
|
|
677
|
+
}),
|
|
678
|
+
128
|
|
679
|
+
/* KEYED_FRAGMENT */
|
|
680
|
+
))
|
|
681
|
+
])
|
|
682
|
+
],
|
|
683
|
+
2
|
|
684
|
+
/* CLASS */
|
|
685
|
+
);
|
|
607
686
|
};
|
|
608
687
|
}
|
|
609
688
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("
|
|
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).VvAccordionGroup=o(e.vue,e.uid,e.core)}(this,(function(e,o,t){"use strict";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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{});const u=Symbol.for("accordionGroup"),i=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});function d(o){const t=e.inject(o,void 0),r=e.computed((()=>{return o=t,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:t,isInGroup:r,getGroupOrLocalRef:function(o,r,l){if(null==t?void 0:t.value){const r=e.unref(t.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const a=e.toRef(r,o);return e.computed({get:()=>a.value,set(e){l&&l(`update:${o}`,e)}})}}}l.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,a.button,n.button;const s={...i,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o,t,r){return e.computed((()=>{const l={[o]:!0},a="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{l[`${o}--${t}`]=e.unref(r.value[t])})),l}))}const m=["id","open"],v=["aria-controls","aria-expanded"],f=["aria-hidden"],p=e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(r,{emit:l}){const a=r,n=e.useAttrs(),i=l,s=e.computed((()=>a.name||(null==n?void 0:n.id)||o.uid())),{modifiers:p,title:y,content:g,disabled:b,collapse:V,modelValue:A,isInGroup:B,not:h}=function(o,t){const{group:r,isInGroup:l,getGroupOrLocalRef:a}=d(u),{title:n,content:i}=e.toRefs(o),s=a("modelValue",o,t),c=a("not",o),m=a("collapse",o),v=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),f=e.computed((()=>{let e=o.modifiers,t=null==r?void 0:r.value.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>l.add(e)))),Array.from(l)}));return{modelValue:s,not:c,isInGroup:l,group:r,collapse:m,modifiers:f,disabled:v,title:n,content:i}}(a,i),S=e.ref(!1),k=e.computed({get:()=>{let e=A.value;return B.value?e=V.value&&Array.isArray(A.value)?A.value.includes(s.value):A.value===s.value:void 0===A.value&&(e=S.value),h.value?!e:e},set:e=>{if(h.value&&(e=!e),B.value)return V.value&&Array.isArray(A.value)?e?void A.value.push(s.value):void(A.value=A.value.filter((e=>e!==s.value))):void(A.value=e?s.value:null);void 0!==A.value||"boolean"!=typeof e?A.value=e:S.value=e}}),C=c("vv-accordion",p,e.computed((()=>({disabled:b.value})))),$=t.useToggle(k);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(C)),open:e.unref(k)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(k),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref($)()),["prevent"]))},[e.createCommentVNode(" @slot Slot for title "),e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))],8,v),e.createElementVNode("div",{"aria-hidden":!e.unref(k),class:"vv-accordion__content"},[e.createCommentVNode(" @slot Slot for content "),e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,f)],10,m))}}),y={...i,modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean,storeKey:String};return e.defineComponent({name:"VvAccordionGroup",props:y,emits:["update:modelValue"],setup(o,{emit:r}){const l=o,a=r,{disabled:n,collapse:i,modifiers:d,itemModifiers:s,items:m,not:v}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));let f=e.ref([]);e.watch((()=>l.storeKey),(o=>{f=o?t.useStorage(o,f.value):e.ref([])}),{immediate:!0});const y=e.computed({get:()=>{var e;return void 0!==l.modelValue?i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue:i.value?f.value:null==(e=f.value)?void 0:e[0]},set:e=>{if(void 0!==l.modelValue)return!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)||(e=[e]),a("update:modelValue",e);f.value=Array.isArray(e)?e:[e]}});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:u,modelValue:y,disabled:n,collapse:i,modifiers:s,not:v});const g=c("vv-accordion-group",d,e.computed((()=>({disabled:n.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(g))},[e.createCommentVNode(" @slot Default slot "),e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(t=>(e.openBlock(),e.createBlock(p,e.mergeProps({key:t.title},{name:t.name,title:t.title,content:t.content}),{header:e.withCtx((r=>[e.createCommentVNode(" @slot Slot for accordion header "),e.renderSlot(o.$slots,`header::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),details:e.withCtx((r=>[e.createCommentVNode(" @slot Slot for accordion details "),e.renderSlot(o.$slots,`details::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),_:2},1040)))),128))]))],2))}})}));
|
|
@@ -12,8 +12,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
disabled: BooleanConstructor;
|
|
13
13
|
not: BooleanConstructor;
|
|
14
14
|
storeKey: StringConstructor;
|
|
15
|
-
modifiers:
|
|
16
|
-
|
|
15
|
+
modifiers: {
|
|
16
|
+
type: globalThis.PropType<string | string[]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
[x: string]: (...args: any[]) => void;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
17
22
|
modelValue: (ArrayConstructor | StringConstructor)[];
|
|
18
23
|
items: {
|
|
19
24
|
type: globalThis.PropType<import(".").VvAccordionGroupItem[]>;
|
|
@@ -27,16 +32,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
27
32
|
disabled: BooleanConstructor;
|
|
28
33
|
not: BooleanConstructor;
|
|
29
34
|
storeKey: StringConstructor;
|
|
30
|
-
modifiers:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
35
|
+
modifiers: {
|
|
36
|
+
type: globalThis.PropType<string | string[]>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
}>>, {
|
|
34
40
|
disabled: boolean;
|
|
35
|
-
|
|
41
|
+
modifiers: string | string[];
|
|
36
42
|
collapse: boolean;
|
|
43
|
+
not: boolean;
|
|
37
44
|
items: import(".").VvAccordionGroupItem[];
|
|
38
45
|
itemModifiers: string | string[];
|
|
39
|
-
}, {}>, Partial<Record
|
|
46
|
+
}, {}>, Partial<Record<`header::${string}`, (_: any) => any>> & Partial<Record<`details::${string}`, (_: any) => any>> & {
|
|
40
47
|
default?(_: {}): any;
|
|
41
48
|
}>;
|
|
42
49
|
export default _default;
|
|
@@ -41,6 +41,9 @@ export declare const VvAccordionGroupProps: {
|
|
|
41
41
|
* Enable local storage persistence
|
|
42
42
|
*/
|
|
43
43
|
storeKey: StringConstructor;
|
|
44
|
-
modifiers:
|
|
44
|
+
modifiers: {
|
|
45
|
+
type: globalThis.PropType<string | string[]>;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
45
48
|
};
|
|
46
49
|
export declare const VvAccordionGroupEvents: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
1
|
+
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
3
|
Strategy2["absolute"] = "absolute";
|
|
4
4
|
Strategy2["fixed"] = "fixed";
|
|
@@ -71,6 +71,7 @@ const LinkProps = {
|
|
|
71
71
|
*/
|
|
72
72
|
target: {
|
|
73
73
|
type: String,
|
|
74
|
+
default: void 0,
|
|
74
75
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
75
76
|
},
|
|
76
77
|
/**
|
|
@@ -85,32 +86,56 @@ const DisabledProps = {
|
|
|
85
86
|
/**
|
|
86
87
|
* Whether the form control is disabled
|
|
87
88
|
*/
|
|
88
|
-
disabled:
|
|
89
|
+
disabled: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
}
|
|
89
93
|
};
|
|
90
94
|
const ActiveProps = {
|
|
91
95
|
/**
|
|
92
96
|
* Whether the item is active
|
|
93
97
|
*/
|
|
94
|
-
active:
|
|
98
|
+
active: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const CurrentProps = {
|
|
104
|
+
/**
|
|
105
|
+
* Whether the item is current
|
|
106
|
+
*/
|
|
107
|
+
current: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false
|
|
110
|
+
}
|
|
95
111
|
};
|
|
96
112
|
const PressedProps = {
|
|
97
113
|
/**
|
|
98
114
|
* Whether the item is pressed
|
|
99
115
|
*/
|
|
100
|
-
pressed:
|
|
116
|
+
pressed: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false
|
|
119
|
+
}
|
|
101
120
|
};
|
|
102
121
|
const LabelProps = {
|
|
103
122
|
/**
|
|
104
123
|
* The item label
|
|
105
124
|
*/
|
|
106
|
-
label:
|
|
125
|
+
label: {
|
|
126
|
+
type: [String, Number],
|
|
127
|
+
default: void 0
|
|
128
|
+
}
|
|
107
129
|
};
|
|
108
130
|
({
|
|
109
131
|
/**
|
|
110
132
|
* VvIcon name or props
|
|
111
133
|
* @see VVIcon
|
|
112
134
|
*/
|
|
113
|
-
icon: {
|
|
135
|
+
icon: {
|
|
136
|
+
type: [String, Object],
|
|
137
|
+
default: void 0
|
|
138
|
+
},
|
|
114
139
|
/**
|
|
115
140
|
* VvIcon position
|
|
116
141
|
*/
|
|
@@ -141,7 +166,8 @@ const LabelProps = {
|
|
|
141
166
|
* Dropdown show / hide transition name
|
|
142
167
|
*/
|
|
143
168
|
transitionName: {
|
|
144
|
-
type: String
|
|
169
|
+
type: String,
|
|
170
|
+
default: void 0
|
|
145
171
|
},
|
|
146
172
|
/**
|
|
147
173
|
* Offset of the dropdown from the trigger
|
|
@@ -209,7 +235,8 @@ const LabelProps = {
|
|
|
209
235
|
* Set dropdown width to the same as the trigger
|
|
210
236
|
*/
|
|
211
237
|
triggerWidth: {
|
|
212
|
-
type: Boolean
|
|
238
|
+
type: Boolean,
|
|
239
|
+
default: false
|
|
213
240
|
}
|
|
214
241
|
});
|
|
215
242
|
const ActionProps = {
|
|
@@ -217,6 +244,7 @@ const ActionProps = {
|
|
|
217
244
|
...LabelProps,
|
|
218
245
|
...PressedProps,
|
|
219
246
|
...ActiveProps,
|
|
247
|
+
...CurrentProps,
|
|
220
248
|
...LinkProps,
|
|
221
249
|
/**
|
|
222
250
|
* Button type
|
|
@@ -232,6 +260,13 @@ const ActionProps = {
|
|
|
232
260
|
ariaLabel: {
|
|
233
261
|
type: String,
|
|
234
262
|
default: void 0
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Default tag for the action
|
|
266
|
+
*/
|
|
267
|
+
defaultTag: {
|
|
268
|
+
type: String,
|
|
269
|
+
default: ActionTag.button
|
|
235
270
|
}
|
|
236
271
|
};
|
|
237
272
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -252,8 +287,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
252
287
|
...__default__,
|
|
253
288
|
props: VvActionProps,
|
|
254
289
|
emits: VvActionEvents,
|
|
255
|
-
setup(__props, { expose: __expose, emit }) {
|
|
290
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
256
291
|
const props = __props;
|
|
292
|
+
const emit = __emit;
|
|
257
293
|
const volver = useVolver();
|
|
258
294
|
const element = ref(null);
|
|
259
295
|
__expose({ $el: element });
|
|
@@ -284,7 +320,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
284
320
|
case props.href !== void 0:
|
|
285
321
|
return ActionTag.a;
|
|
286
322
|
default:
|
|
287
|
-
return
|
|
323
|
+
return props.defaultTag;
|
|
288
324
|
}
|
|
289
325
|
});
|
|
290
326
|
const hasProps = computed(() => {
|
|
@@ -309,12 +345,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
309
345
|
to: props.to,
|
|
310
346
|
target: props.target
|
|
311
347
|
};
|
|
312
|
-
|
|
348
|
+
case ActionTag.button:
|
|
313
349
|
return {
|
|
314
350
|
...toReturn,
|
|
315
351
|
type: props.type,
|
|
316
352
|
disabled: props.disabled
|
|
317
353
|
};
|
|
354
|
+
default:
|
|
355
|
+
return toReturn;
|
|
318
356
|
}
|
|
319
357
|
});
|
|
320
358
|
const onClick = (e) => {
|
|
@@ -340,18 +378,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
340
378
|
class: {
|
|
341
379
|
active: _ctx.active,
|
|
342
380
|
pressed: unref(pressed),
|
|
343
|
-
disabled: _ctx.disabled
|
|
381
|
+
disabled: _ctx.disabled,
|
|
382
|
+
current: _ctx.current
|
|
344
383
|
},
|
|
345
384
|
onClickPassive: onClick,
|
|
346
385
|
onMouseoverPassive: onMouseover,
|
|
347
386
|
onMouseleavePassive: onMouseleave
|
|
348
387
|
}), {
|
|
349
388
|
default: withCtx(() => [
|
|
389
|
+
createCommentVNode(" @slot Default slot "),
|
|
350
390
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
351
|
-
createTextVNode(
|
|
391
|
+
createTextVNode(
|
|
392
|
+
toDisplayString(_ctx.label),
|
|
393
|
+
1
|
|
394
|
+
/* TEXT */
|
|
395
|
+
)
|
|
352
396
|
])
|
|
353
397
|
]),
|
|
354
398
|
_: 3
|
|
399
|
+
/* FORWARDED */
|
|
355
400
|
}, 16, ["class"]);
|
|
356
401
|
};
|
|
357
402
|
}
|
|
@@ -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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),
|
|
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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},p={pressed:{type:Boolean,default:!1}},v={label:{type:[String,Number],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...v,...p,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};return e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=r,d=e.inject(a),c=e.ref(null);o({$el:c});const{reference:f,bus:p,aria:v,expanded:b}=e.inject(u,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const m=e.computed((()=>l.pressed||(null==b?void 0:b.value))),{role:y}=e.inject(i,{}),g=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(g.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),B=e=>{l.disabled?e.preventDefault():(null==p||p.emit("click",e),s("click",e))},h=e=>{null==p||p.emit("mouseover",e),s("mouseover",e)},S=e=>{null==p||p.emit("mouseleave",e),s("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:h,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"]))}})}));
|