@volverjs/ui-vue 0.0.11 → 0.0.13-beta.1
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/bin/icons.js +1 -93
- package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +7 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -2
- package/dist/components/VvAction/VvAction.es.js +1 -302
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +3 -2
- package/dist/components/VvAlert/VvAlert.es.js +1 -527
- package/dist/components/VvAlert/VvAlert.vue.d.ts +3 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +1 -131
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -2
- package/dist/components/VvButton/VvButton.es.js +1 -882
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +3 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvCard/VvCard.es.js +1 -152
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +16 -7
- package/dist/components/VvDialog/VvDialog.es.js +1 -317
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -2
- package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
- package/dist/components/VvIcon/VvIcon.es.js +1 -143
- package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
- package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +34 -4
- package/dist/components/VvInputFile/index.d.ts +7 -0
- package/dist/components/VvInputText/VvInputText.es.js +4 -2790
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +8 -3
- package/dist/components/VvNav/VvNav.es.js +1 -438
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +2 -2
- package/dist/components/VvNav/VvNavItem.vue.d.ts +2 -2
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
- package/dist/components/VvProgress/VvProgress.es.js +1 -163
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvRadio/VvRadio.es.js +1 -661
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +1 -1103
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -7
- package/dist/components/VvTab/VvTab.es.js +1 -558
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
- package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
- package/dist/components/index.es.js +6 -8558
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +2 -247
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +2 -311
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +2 -142
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -172
- package/dist/icons.es.js +1 -39
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1 -219
- package/dist/props/index.d.ts +7 -0
- package/dist/resolvers/unplugin.es.js +1 -187
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
- package/dist/stories/Avatar/Avatar.settings.d.ts +1 -1
- package/package.json +47 -40
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
1
3
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
4
|
modelValue: {
|
|
3
5
|
type: PropType<string | string[] | undefined>;
|
|
@@ -25,8 +27,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
25
27
|
default: undefined;
|
|
26
28
|
};
|
|
27
29
|
}>, {
|
|
30
|
+
/** Expanded accordions names */
|
|
28
31
|
expandedAccordions: globalThis.WritableComputedRef<Set<string>, Set<string>>;
|
|
32
|
+
/** Expand accordion by name, expand all if no name is provided */
|
|
29
33
|
expand: (name?: string | string[]) => void;
|
|
34
|
+
/** Collapse accordion by name, collapse all if no name is provided */
|
|
30
35
|
collapse: (name?: string | string[]) => void;
|
|
31
36
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
32
37
|
modelValue: {
|
|
@@ -86,8 +91,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
86
91
|
collapse: (name?: string | string[]) => void;
|
|
87
92
|
}) => any;
|
|
88
93
|
}>;
|
|
89
|
-
declare const _default: typeof __VLS_export;
|
|
90
|
-
export default _default;
|
|
91
94
|
type __VLS_WithSlots<T, S> = T & {
|
|
92
95
|
new (): {
|
|
93
96
|
$slots: S;
|
|
@@ -1,302 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
3
|
-
StorageType2["local"] = "local";
|
|
4
|
-
StorageType2["session"] = "session";
|
|
5
|
-
return StorageType2;
|
|
6
|
-
})(StorageType || {});
|
|
7
|
-
var Side = /* @__PURE__ */ ((Side2) => {
|
|
8
|
-
Side2["left"] = "left";
|
|
9
|
-
Side2["right"] = "right";
|
|
10
|
-
Side2["top"] = "top";
|
|
11
|
-
Side2["bottom"] = "bottom";
|
|
12
|
-
return Side2;
|
|
13
|
-
})(Side || {});
|
|
14
|
-
var Position = /* @__PURE__ */ ((Position2) => {
|
|
15
|
-
Position2["before"] = "before";
|
|
16
|
-
Position2["after"] = "after";
|
|
17
|
-
return Position2;
|
|
18
|
-
})(Position || {});
|
|
19
|
-
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
20
|
-
ButtonType2["button"] = "button";
|
|
21
|
-
ButtonType2["submit"] = "submit";
|
|
22
|
-
ButtonType2["reset"] = "reset";
|
|
23
|
-
return ButtonType2;
|
|
24
|
-
})(ButtonType || {});
|
|
25
|
-
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
26
|
-
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
27
|
-
ActionTag2["routerLink"] = "router-link";
|
|
28
|
-
ActionTag2["a"] = "a";
|
|
29
|
-
ActionTag2["button"] = "button";
|
|
30
|
-
return ActionTag2;
|
|
31
|
-
})(ActionTag || {});
|
|
32
|
-
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
33
|
-
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for(
|
|
34
|
-
"dropdownTrigger"
|
|
35
|
-
);
|
|
36
|
-
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for(
|
|
37
|
-
"dropdownAction"
|
|
38
|
-
);
|
|
39
|
-
const LinkProps = {
|
|
40
|
-
/**
|
|
41
|
-
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
42
|
-
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
43
|
-
*/
|
|
44
|
-
to: {
|
|
45
|
-
type: [String, Object]
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Anchor href
|
|
49
|
-
*/
|
|
50
|
-
href: String,
|
|
51
|
-
/**
|
|
52
|
-
* Anchor target
|
|
53
|
-
*/
|
|
54
|
-
target: String,
|
|
55
|
-
/**
|
|
56
|
-
* Anchor rel
|
|
57
|
-
*/
|
|
58
|
-
rel: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "noopener noreferrer"
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const DisabledProps = {
|
|
64
|
-
/**
|
|
65
|
-
* Whether the form control is disabled
|
|
66
|
-
*/
|
|
67
|
-
disabled: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const ActiveProps = {
|
|
73
|
-
/**
|
|
74
|
-
* Whether the item is active
|
|
75
|
-
*/
|
|
76
|
-
active: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: false
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const CurrentProps = {
|
|
82
|
-
/**
|
|
83
|
-
* Whether the item is current
|
|
84
|
-
*/
|
|
85
|
-
current: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const PressedProps = {
|
|
91
|
-
/**
|
|
92
|
-
* Whether the item is pressed
|
|
93
|
-
*/
|
|
94
|
-
pressed: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const LabelProps = {
|
|
100
|
-
/**
|
|
101
|
-
* The item label
|
|
102
|
-
*/
|
|
103
|
-
label: {
|
|
104
|
-
type: [String, Number],
|
|
105
|
-
default: void 0
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
({
|
|
109
|
-
/**
|
|
110
|
-
* VvIcon position
|
|
111
|
-
*/
|
|
112
|
-
iconPosition: {
|
|
113
|
-
default: Position.before
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
({
|
|
117
|
-
/**
|
|
118
|
-
* Dropdown placement
|
|
119
|
-
*/
|
|
120
|
-
placement: {
|
|
121
|
-
default: Side.bottom
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
const ActionProps = {
|
|
125
|
-
...DisabledProps,
|
|
126
|
-
...LabelProps,
|
|
127
|
-
...PressedProps,
|
|
128
|
-
...ActiveProps,
|
|
129
|
-
...CurrentProps,
|
|
130
|
-
...LinkProps,
|
|
131
|
-
/**
|
|
132
|
-
* Button type
|
|
133
|
-
*/
|
|
134
|
-
type: {
|
|
135
|
-
type: String,
|
|
136
|
-
default: ButtonType.button,
|
|
137
|
-
validator: (value) => Object.values(ButtonType).includes(value)
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Button aria-label
|
|
141
|
-
*/
|
|
142
|
-
ariaLabel: {
|
|
143
|
-
type: String,
|
|
144
|
-
default: void 0
|
|
145
|
-
},
|
|
146
|
-
/**
|
|
147
|
-
* Default tag for the action
|
|
148
|
-
*/
|
|
149
|
-
defaultTag: {
|
|
150
|
-
type: String,
|
|
151
|
-
default: ActionTag.button
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
({
|
|
155
|
-
storageType: {
|
|
156
|
-
default: StorageType.local
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
160
|
-
const VvActionProps = ActionProps;
|
|
161
|
-
function useVolver() {
|
|
162
|
-
return inject(INJECTION_KEY_VOLVER, void 0);
|
|
163
|
-
}
|
|
164
|
-
function useInjectedDropdownTrigger() {
|
|
165
|
-
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
166
|
-
}
|
|
167
|
-
function useInjectedDropdownAction() {
|
|
168
|
-
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
169
|
-
}
|
|
170
|
-
const __default__ = {
|
|
171
|
-
name: "VvAction"
|
|
172
|
-
};
|
|
173
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
174
|
-
...__default__,
|
|
175
|
-
props: VvActionProps,
|
|
176
|
-
emits: VvActionEvents,
|
|
177
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
178
|
-
const props = __props;
|
|
179
|
-
const emit = __emit;
|
|
180
|
-
const instance = getCurrentInstance();
|
|
181
|
-
const volver = useVolver();
|
|
182
|
-
const element = ref(null);
|
|
183
|
-
__expose({ $el: element });
|
|
184
|
-
const {
|
|
185
|
-
reference: dropdownTriggerReference,
|
|
186
|
-
bus: dropdownEventBus,
|
|
187
|
-
aria: dropdownAria,
|
|
188
|
-
expanded: dropdownExpanded
|
|
189
|
-
} = useInjectedDropdownTrigger();
|
|
190
|
-
watch(
|
|
191
|
-
() => element.value,
|
|
192
|
-
(newValue) => {
|
|
193
|
-
if (dropdownTriggerReference) {
|
|
194
|
-
dropdownTriggerReference.value = newValue;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
const pressed = computed(() => {
|
|
199
|
-
return props.pressed || dropdownExpanded?.value;
|
|
200
|
-
});
|
|
201
|
-
const { role } = useInjectedDropdownAction();
|
|
202
|
-
const hasTag = computed(() => {
|
|
203
|
-
switch (true) {
|
|
204
|
-
case props.disabled:
|
|
205
|
-
return ActionTag.button;
|
|
206
|
-
case props.to !== void 0:
|
|
207
|
-
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
208
|
-
case props.href !== void 0:
|
|
209
|
-
return ActionTag.a;
|
|
210
|
-
default:
|
|
211
|
-
return props.defaultTag;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
const hasProps = computed(() => {
|
|
215
|
-
const toReturn = {
|
|
216
|
-
...dropdownAria?.value,
|
|
217
|
-
ariaPressed: pressed.value ? true : void 0,
|
|
218
|
-
ariaLabel: props.ariaLabel,
|
|
219
|
-
role: role?.value
|
|
220
|
-
};
|
|
221
|
-
switch (hasTag.value) {
|
|
222
|
-
case ActionTag.a:
|
|
223
|
-
return {
|
|
224
|
-
...toReturn,
|
|
225
|
-
href: props.href,
|
|
226
|
-
target: props.target,
|
|
227
|
-
rel: props.rel
|
|
228
|
-
};
|
|
229
|
-
case ActionTag.routerLink:
|
|
230
|
-
case ActionTag.nuxtLink:
|
|
231
|
-
return {
|
|
232
|
-
...toReturn,
|
|
233
|
-
to: props.to,
|
|
234
|
-
target: props.target
|
|
235
|
-
};
|
|
236
|
-
case ActionTag.button:
|
|
237
|
-
return {
|
|
238
|
-
...toReturn,
|
|
239
|
-
type: props.type,
|
|
240
|
-
disabled: props.disabled
|
|
241
|
-
};
|
|
242
|
-
default:
|
|
243
|
-
return toReturn;
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
function onClick(e) {
|
|
247
|
-
if (props.disabled) {
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (instance?.vnode.props?.onClick) {
|
|
252
|
-
emit("click", e);
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
dropdownEventBus?.emit("click", e);
|
|
256
|
-
}
|
|
257
|
-
function onMouseover(e) {
|
|
258
|
-
if (instance?.vnode.props?.onMouseover) {
|
|
259
|
-
emit("mouseover", e);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
dropdownEventBus?.emit("mouseover", e);
|
|
263
|
-
}
|
|
264
|
-
function onMouseleave(e) {
|
|
265
|
-
if (instance?.vnode.props?.onMouseleave) {
|
|
266
|
-
emit("mouseleave", e);
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
dropdownEventBus?.emit("mouseleave", e);
|
|
270
|
-
}
|
|
271
|
-
return (_ctx, _cache) => {
|
|
272
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
273
|
-
ref_key: "element",
|
|
274
|
-
ref: element,
|
|
275
|
-
class: {
|
|
276
|
-
active: _ctx.active,
|
|
277
|
-
pressed: unref(pressed),
|
|
278
|
-
disabled: _ctx.disabled,
|
|
279
|
-
current: _ctx.current
|
|
280
|
-
},
|
|
281
|
-
onClickPassive: onClick,
|
|
282
|
-
onMouseoverPassive: onMouseover,
|
|
283
|
-
onMouseleavePassive: onMouseleave
|
|
284
|
-
}), {
|
|
285
|
-
default: withCtx(() => [
|
|
286
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
287
|
-
createTextVNode(
|
|
288
|
-
toDisplayString(_ctx.label),
|
|
289
|
-
1
|
|
290
|
-
/* TEXT */
|
|
291
|
-
)
|
|
292
|
-
])
|
|
293
|
-
]),
|
|
294
|
-
_: 3
|
|
295
|
-
/* FORWARDED */
|
|
296
|
-
}, 16, ["class"]);
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
export {
|
|
301
|
-
_sfc_main as default
|
|
302
|
-
};
|
|
1
|
+
import{inject as e,defineComponent as t,getCurrentInstance as o,ref as r,watch as a,computed as n,resolveComponent as l,createBlock as u,openBlock as s,resolveDynamicComponent as i,unref as d,mergeProps as c,withCtx as v,renderSlot as f,createTextVNode as b,toDisplayString as p}from"vue";var m=/* @__PURE__ */(e=>(e.local="local",e.session="session",e))(m||{}),g=/* @__PURE__ */(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(g||{}),y=/* @__PURE__ */(e=>(e.before="before",e.after="after",e))(y||{}),k=/* @__PURE__ */(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(k||{}),S=/* @__PURE__ */(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(S||{});const L=/* @__PURE__ */Symbol.for("volver"),h=/* @__PURE__ */Symbol.for("dropdownTrigger"),x=/* @__PURE__ */Symbol.for("dropdownAction"),w={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},B={disabled:{type:Boolean,default:!1}},M={active:{type:Boolean,default:!1}},P={current:{type:Boolean,default:!1}},T={pressed:{type:Boolean,default:!1}},j={label:{type:[String,Number],default:void 0}};y.before,g.bottom;const A={...B,...j,...T,...M,...P,...w,type:{type:String,default:k.button,validator:e=>Object.values(k).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:S.button}};m.local;const C=/* @__PURE__ */t({name:"VvAction",props:A,emits:["click","mouseover","mouseleave"],setup(t,{expose:m,emit:g}){const y=t,k=g,w=o(),B=e(L,void 0),M=r(null);m({$el:M});const{reference:P,bus:T,aria:j,expanded:A}=e(h,{});a(()=>M.value,e=>{P&&(P.value=e)});const C=n(()=>y.pressed||A?.value),{role:O}=e(x,{}),$=n(()=>{switch(!0){case y.disabled:return S.button;case void 0!==y.to:return B?.nuxt?l(S.nuxtLink):S.routerLink;case void 0!==y.href:return S.a;default:return y.defaultTag}}),_=n(()=>{const e={...j?.value,ariaPressed:!!C.value||void 0,ariaLabel:y.ariaLabel,role:O?.value};switch($.value){case S.a:return{...e,href:y.href,target:y.target,rel:y.rel};case S.routerLink:case S.nuxtLink:return{...e,to:y.to,target:y.target};case S.button:return{...e,type:y.type,disabled:y.disabled};default:return e}});function D(e){y.disabled?e.preventDefault():w?.vnode.props?.onClick?k("click",e):T?.emit("click",e)}function E(e){w?.vnode.props?.onMouseover?k("mouseover",e):T?.emit("mouseover",e)}function N(e){w?.vnode.props?.onMouseleave?k("mouseleave",e):T?.emit("mouseleave",e)}return(e,t)=>(s(),u(i(d($)),c(d(_),{ref_key:"rootEl",ref:M,class:{active:e.active,pressed:d(C),disabled:e.disabled,current:e.current},onClickPassive:D,onMouseoverPassive:E,onMouseleavePassive:N}),{default:v(()=>[f(e.$slots,"default",{},()=>[b(p(e.label),1)])]),_:3},16,["class"]))}});export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},p={pressed:{type:Boolean,default:!1}},v={label:{type:[String,Number],default:void 0}};r.before,o.bottom;const b={...d,...v,...p,...c,...f,...s,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,s=r,d=e.getCurrentInstance(),c=e.inject(l,void 0),f=e.ref(null);o({$el:f});const{reference:p,bus:v,aria:b,expanded:m}=e.inject(u,{});e.watch(()=>f.value,e=>{p&&(p.value=e)});const g=e.computed(()=>n.pressed||m?.value),{role:y}=e.inject(i,{}),k=e.computed(()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return c?.nuxt?e.resolveComponent(a.nuxtLink):a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}}),h=e.computed(()=>{const e={...b?.value,ariaPressed:!!g.value||void 0,ariaLabel:n.ariaLabel,role:y?.value};switch(k.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}});function S(e){n.disabled?e.preventDefault():d?.vnode.props?.onClick?s("click",e):v?.emit("click",e)}function x(e){d?.vnode.props?.onMouseover?s("mouseover",e):v?.emit("mouseover",e)}function L(e){d?.vnode.props?.onMouseleave?s("mouseleave",e):v?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(h),{ref_key:"
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},p={pressed:{type:Boolean,default:!1}},v={label:{type:[String,Number],default:void 0}};r.before,o.bottom;const b={...d,...v,...p,...c,...f,...s,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,s=r,d=e.getCurrentInstance(),c=e.inject(l,void 0),f=e.ref(null);o({$el:f});const{reference:p,bus:v,aria:b,expanded:m}=e.inject(u,{});e.watch(()=>f.value,e=>{p&&(p.value=e)});const g=e.computed(()=>n.pressed||m?.value),{role:y}=e.inject(i,{}),k=e.computed(()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return c?.nuxt?e.resolveComponent(a.nuxtLink):a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}}),h=e.computed(()=>{const e={...b?.value,ariaPressed:!!g.value||void 0,ariaLabel:n.ariaLabel,role:y?.value};switch(k.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}});function S(e){n.disabled?e.preventDefault():d?.vnode.props?.onClick?s("click",e):v?.emit("click",e)}function x(e){d?.vnode.props?.onMouseover?s("mouseover",e):v?.emit("mouseover",e)}function L(e){d?.vnode.props?.onMouseleave?s("mouseleave",e):v?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(h),{ref_key:"rootEl",ref:f,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:S,onMouseoverPassive:x,onMouseleavePassive:L}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}})});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ActionTag } from '../../constants';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
2
4
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
3
5
|
type: {
|
|
4
6
|
type: PropType<`${import("../../constants").ButtonType}`>;
|
|
@@ -43,6 +45,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
43
45
|
default: boolean;
|
|
44
46
|
};
|
|
45
47
|
}>, {
|
|
48
|
+
/** Reference to the root element */
|
|
46
49
|
$el: globalThis.Ref<HTMLElement | null, HTMLElement | null>;
|
|
47
50
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
48
51
|
type: {
|
|
@@ -100,8 +103,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
100
103
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
101
104
|
default?: (props: {}) => any;
|
|
102
105
|
}>;
|
|
103
|
-
declare const _default: typeof __VLS_export;
|
|
104
|
-
export default _default;
|
|
105
106
|
type __VLS_WithSlots<T, S> = T & {
|
|
106
107
|
new (): {
|
|
107
108
|
$slots: S;
|