@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,438 +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
|
-
const ModifiersProps = {
|
|
109
|
-
/**
|
|
110
|
-
* Component BEM modifiers
|
|
111
|
-
*/
|
|
112
|
-
modifiers: {
|
|
113
|
-
type: [String, Array],
|
|
114
|
-
default: void 0
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
({
|
|
118
|
-
/**
|
|
119
|
-
* VvIcon position
|
|
120
|
-
*/
|
|
121
|
-
iconPosition: {
|
|
122
|
-
default: Position.before
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
({
|
|
126
|
-
/**
|
|
127
|
-
* Dropdown placement
|
|
128
|
-
*/
|
|
129
|
-
placement: {
|
|
130
|
-
default: Side.bottom
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
const ActionProps = {
|
|
134
|
-
...DisabledProps,
|
|
135
|
-
...LabelProps,
|
|
136
|
-
...PressedProps,
|
|
137
|
-
...ActiveProps,
|
|
138
|
-
...CurrentProps,
|
|
139
|
-
...LinkProps,
|
|
140
|
-
/**
|
|
141
|
-
* Button type
|
|
142
|
-
*/
|
|
143
|
-
type: {
|
|
144
|
-
type: String,
|
|
145
|
-
default: ButtonType.button,
|
|
146
|
-
validator: (value) => Object.values(ButtonType).includes(value)
|
|
147
|
-
},
|
|
148
|
-
/**
|
|
149
|
-
* Button aria-label
|
|
150
|
-
*/
|
|
151
|
-
ariaLabel: {
|
|
152
|
-
type: String,
|
|
153
|
-
default: void 0
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Default tag for the action
|
|
157
|
-
*/
|
|
158
|
-
defaultTag: {
|
|
159
|
-
type: String,
|
|
160
|
-
default: ActionTag.button
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const NavProps = {
|
|
164
|
-
items: {
|
|
165
|
-
type: Array,
|
|
166
|
-
default: () => []
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
({
|
|
170
|
-
storageType: {
|
|
171
|
-
default: StorageType.local
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
const VvNavProps = {
|
|
175
|
-
...ModifiersProps,
|
|
176
|
-
...NavProps
|
|
177
|
-
};
|
|
178
|
-
const VvNavEvents = ["click"];
|
|
179
|
-
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
180
|
-
const VvActionProps = ActionProps;
|
|
181
|
-
function useVolver() {
|
|
182
|
-
return inject(INJECTION_KEY_VOLVER, void 0);
|
|
183
|
-
}
|
|
184
|
-
function useInjectedDropdownTrigger() {
|
|
185
|
-
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
186
|
-
}
|
|
187
|
-
function useInjectedDropdownAction() {
|
|
188
|
-
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
189
|
-
}
|
|
190
|
-
const __default__$2 = {
|
|
191
|
-
name: "VvAction"
|
|
192
|
-
};
|
|
193
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
194
|
-
...__default__$2,
|
|
195
|
-
props: VvActionProps,
|
|
196
|
-
emits: VvActionEvents,
|
|
197
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
198
|
-
const props = __props;
|
|
199
|
-
const emit = __emit;
|
|
200
|
-
const instance = getCurrentInstance();
|
|
201
|
-
const volver = useVolver();
|
|
202
|
-
const element = ref(null);
|
|
203
|
-
__expose({ $el: element });
|
|
204
|
-
const {
|
|
205
|
-
reference: dropdownTriggerReference,
|
|
206
|
-
bus: dropdownEventBus,
|
|
207
|
-
aria: dropdownAria,
|
|
208
|
-
expanded: dropdownExpanded
|
|
209
|
-
} = useInjectedDropdownTrigger();
|
|
210
|
-
watch(
|
|
211
|
-
() => element.value,
|
|
212
|
-
(newValue) => {
|
|
213
|
-
if (dropdownTriggerReference) {
|
|
214
|
-
dropdownTriggerReference.value = newValue;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
const pressed = computed(() => {
|
|
219
|
-
return props.pressed || dropdownExpanded?.value;
|
|
220
|
-
});
|
|
221
|
-
const { role } = useInjectedDropdownAction();
|
|
222
|
-
const hasTag = computed(() => {
|
|
223
|
-
switch (true) {
|
|
224
|
-
case props.disabled:
|
|
225
|
-
return ActionTag.button;
|
|
226
|
-
case props.to !== void 0:
|
|
227
|
-
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
228
|
-
case props.href !== void 0:
|
|
229
|
-
return ActionTag.a;
|
|
230
|
-
default:
|
|
231
|
-
return props.defaultTag;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
const hasProps = computed(() => {
|
|
235
|
-
const toReturn = {
|
|
236
|
-
...dropdownAria?.value,
|
|
237
|
-
ariaPressed: pressed.value ? true : void 0,
|
|
238
|
-
ariaLabel: props.ariaLabel,
|
|
239
|
-
role: role?.value
|
|
240
|
-
};
|
|
241
|
-
switch (hasTag.value) {
|
|
242
|
-
case ActionTag.a:
|
|
243
|
-
return {
|
|
244
|
-
...toReturn,
|
|
245
|
-
href: props.href,
|
|
246
|
-
target: props.target,
|
|
247
|
-
rel: props.rel
|
|
248
|
-
};
|
|
249
|
-
case ActionTag.routerLink:
|
|
250
|
-
case ActionTag.nuxtLink:
|
|
251
|
-
return {
|
|
252
|
-
...toReturn,
|
|
253
|
-
to: props.to,
|
|
254
|
-
target: props.target
|
|
255
|
-
};
|
|
256
|
-
case ActionTag.button:
|
|
257
|
-
return {
|
|
258
|
-
...toReturn,
|
|
259
|
-
type: props.type,
|
|
260
|
-
disabled: props.disabled
|
|
261
|
-
};
|
|
262
|
-
default:
|
|
263
|
-
return toReturn;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
function onClick(e) {
|
|
267
|
-
if (props.disabled) {
|
|
268
|
-
e.preventDefault();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
if (instance?.vnode.props?.onClick) {
|
|
272
|
-
emit("click", e);
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
dropdownEventBus?.emit("click", e);
|
|
276
|
-
}
|
|
277
|
-
function onMouseover(e) {
|
|
278
|
-
if (instance?.vnode.props?.onMouseover) {
|
|
279
|
-
emit("mouseover", e);
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
dropdownEventBus?.emit("mouseover", e);
|
|
283
|
-
}
|
|
284
|
-
function onMouseleave(e) {
|
|
285
|
-
if (instance?.vnode.props?.onMouseleave) {
|
|
286
|
-
emit("mouseleave", e);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
dropdownEventBus?.emit("mouseleave", e);
|
|
290
|
-
}
|
|
291
|
-
return (_ctx, _cache) => {
|
|
292
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
293
|
-
ref_key: "element",
|
|
294
|
-
ref: element,
|
|
295
|
-
class: {
|
|
296
|
-
active: _ctx.active,
|
|
297
|
-
pressed: unref(pressed),
|
|
298
|
-
disabled: _ctx.disabled,
|
|
299
|
-
current: _ctx.current
|
|
300
|
-
},
|
|
301
|
-
onClickPassive: onClick,
|
|
302
|
-
onMouseoverPassive: onMouseover,
|
|
303
|
-
onMouseleavePassive: onMouseleave
|
|
304
|
-
}), {
|
|
305
|
-
default: withCtx(() => [
|
|
306
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
307
|
-
createTextVNode(
|
|
308
|
-
toDisplayString(_ctx.label),
|
|
309
|
-
1
|
|
310
|
-
/* TEXT */
|
|
311
|
-
)
|
|
312
|
-
])
|
|
313
|
-
]),
|
|
314
|
-
_: 3
|
|
315
|
-
/* FORWARDED */
|
|
316
|
-
}, 16, ["class"]);
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
const _hoisted_1 = {
|
|
321
|
-
class: "vv-nav__item",
|
|
322
|
-
role: "presentation"
|
|
323
|
-
};
|
|
324
|
-
const __default__$1 = {
|
|
325
|
-
name: "VvNavItem",
|
|
326
|
-
inheritAttrs: false
|
|
327
|
-
};
|
|
328
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
329
|
-
...__default__$1,
|
|
330
|
-
setup(__props) {
|
|
331
|
-
return (_ctx, _cache) => {
|
|
332
|
-
return openBlock(), createElementBlock("li", _hoisted_1, [
|
|
333
|
-
renderSlot(_ctx.$slots, "before"),
|
|
334
|
-
createVNode(
|
|
335
|
-
_sfc_main$2,
|
|
336
|
-
mergeProps(_ctx.$attrs, {
|
|
337
|
-
class: "vv-nav__item-label",
|
|
338
|
-
role: "menuitem"
|
|
339
|
-
}),
|
|
340
|
-
{
|
|
341
|
-
default: withCtx(() => [
|
|
342
|
-
renderSlot(_ctx.$slots, "default")
|
|
343
|
-
]),
|
|
344
|
-
_: 3
|
|
345
|
-
/* FORWARDED */
|
|
346
|
-
},
|
|
347
|
-
16
|
|
348
|
-
/* FULL_PROPS */
|
|
349
|
-
),
|
|
350
|
-
renderSlot(_ctx.$slots, "after")
|
|
351
|
-
]);
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
function useModifiers(prefix, modifiers, others) {
|
|
356
|
-
return computed(() => {
|
|
357
|
-
const toReturn = {
|
|
358
|
-
[prefix]: true
|
|
359
|
-
};
|
|
360
|
-
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
361
|
-
if (modifiersArray) {
|
|
362
|
-
if (Array.isArray(modifiersArray)) {
|
|
363
|
-
modifiersArray.forEach((modifier) => {
|
|
364
|
-
if (modifier) {
|
|
365
|
-
toReturn[`${prefix}--${modifier}`] = true;
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
return toReturn;
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
const __default__ = {
|
|
374
|
-
name: "VvNav"
|
|
375
|
-
};
|
|
376
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
377
|
-
...__default__,
|
|
378
|
-
props: VvNavProps,
|
|
379
|
-
emits: VvNavEvents,
|
|
380
|
-
setup(__props, { emit: __emit }) {
|
|
381
|
-
const props = __props;
|
|
382
|
-
const emit = __emit;
|
|
383
|
-
const { modifiers } = toRefs(props);
|
|
384
|
-
function onClick(event) {
|
|
385
|
-
const target = event.target;
|
|
386
|
-
if (target?.dataset.index) {
|
|
387
|
-
const index = Number.parseInt(target.dataset.index);
|
|
388
|
-
const item = props.items?.[index];
|
|
389
|
-
if (!item || item?.disabled) {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
emit("click", item);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
396
|
-
return (_ctx, _cache) => {
|
|
397
|
-
return openBlock(), createElementBlock(
|
|
398
|
-
"nav",
|
|
399
|
-
{
|
|
400
|
-
class: normalizeClass(unref(bemCssClasses))
|
|
401
|
-
},
|
|
402
|
-
[
|
|
403
|
-
createElementVNode("ul", {
|
|
404
|
-
class: "vv-nav__menu",
|
|
405
|
-
role: "menu",
|
|
406
|
-
onClick: withModifiers(onClick, ["stop"])
|
|
407
|
-
}, [
|
|
408
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
409
|
-
(openBlock(true), createElementBlock(
|
|
410
|
-
Fragment,
|
|
411
|
-
null,
|
|
412
|
-
renderList(_ctx.items, ({ on = {}, data, ...item }, index) => {
|
|
413
|
-
return openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
414
|
-
key: index,
|
|
415
|
-
"data-index": index
|
|
416
|
-
}, { ref_for: true }, item, toHandlers(on)), {
|
|
417
|
-
default: withCtx(() => [
|
|
418
|
-
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, { item, data, index }))
|
|
419
|
-
]),
|
|
420
|
-
_: 2
|
|
421
|
-
/* DYNAMIC */
|
|
422
|
-
}, 1040, ["data-index"]);
|
|
423
|
-
}),
|
|
424
|
-
128
|
|
425
|
-
/* KEYED_FRAGMENT */
|
|
426
|
-
))
|
|
427
|
-
])
|
|
428
|
-
])
|
|
429
|
-
],
|
|
430
|
-
2
|
|
431
|
-
/* CLASS */
|
|
432
|
-
);
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
export {
|
|
437
|
-
_sfc_main as default
|
|
438
|
-
};
|
|
1
|
+
import{inject as e,defineComponent as t,getCurrentInstance as r,ref as o,watch as a,computed as n,resolveComponent as s,createBlock as l,openBlock as i,resolveDynamicComponent as u,unref as d,mergeProps as c,withCtx as v,renderSlot as f,createTextVNode as p,toDisplayString as m,createElementBlock as b,createVNode as y,toRefs as g,normalizeClass as k,createElementVNode as x,withModifiers as S,Fragment as _,renderList as h,toHandlers as $}from"vue";var L=/* @__PURE__ */(e=>(e.local="local",e.session="session",e))(L||{}),A=/* @__PURE__ */(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(A||{}),w=/* @__PURE__ */(e=>(e.before="before",e.after="after",e))(w||{}),B=/* @__PURE__ */(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(B||{}),M=/* @__PURE__ */(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(M||{});const N=/* @__PURE__ */Symbol.for("volver"),P=/* @__PURE__ */Symbol.for("dropdownTrigger"),C=/* @__PURE__ */Symbol.for("dropdownAction"),T={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},V={disabled:{type:Boolean,default:!1}},j={active:{type:Boolean,default:!1}},E={current:{type:Boolean,default:!1}},I={pressed:{type:Boolean,default:!1}},O={label:{type:[String,Number],default:void 0}},D={modifiers:{type:[String,Array],default:void 0}};w.before,A.bottom;const q={...V,...O,...I,...j,...E,...T,type:{type:String,default:B.button,validator:e=>Object.values(B).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:M.button}},z={items:{type:Array,default:()=>[]}};L.local;const F={...D,...z};const G=/* @__PURE__ */t({name:"VvAction",props:q,emits:["click","mouseover","mouseleave"],setup(t,{expose:b,emit:y}){const g=t,k=y,x=r(),S=e(N,void 0),_=o(null);b({$el:_});const{reference:h,bus:$,aria:L,expanded:A}=e(P,{});a(()=>_.value,e=>{h&&(h.value=e)});const w=n(()=>g.pressed||A?.value),{role:B}=e(C,{}),T=n(()=>{switch(!0){case g.disabled:return M.button;case void 0!==g.to:return S?.nuxt?s(M.nuxtLink):M.routerLink;case void 0!==g.href:return M.a;default:return g.defaultTag}}),V=n(()=>{const e={...L?.value,ariaPressed:!!w.value||void 0,ariaLabel:g.ariaLabel,role:B?.value};switch(T.value){case M.a:return{...e,href:g.href,target:g.target,rel:g.rel};case M.routerLink:case M.nuxtLink:return{...e,to:g.to,target:g.target};case M.button:return{...e,type:g.type,disabled:g.disabled};default:return e}});function j(e){g.disabled?e.preventDefault():x?.vnode.props?.onClick?k("click",e):$?.emit("click",e)}function E(e){x?.vnode.props?.onMouseover?k("mouseover",e):$?.emit("mouseover",e)}function I(e){x?.vnode.props?.onMouseleave?k("mouseleave",e):$?.emit("mouseleave",e)}return(e,t)=>(i(),l(u(d(T)),c(d(V),{ref_key:"rootEl",ref:_,class:{active:e.active,pressed:d(w),disabled:e.disabled,current:e.current},onClickPassive:j,onMouseoverPassive:E,onMouseleavePassive:I}),{default:v(()=>[f(e.$slots,"default",{},()=>[p(m(e.label),1)])]),_:3},16,["class"]))}}),H={class:"vv-nav__item",role:"presentation"},J=/* @__PURE__ */t({name:"VvNavItem",inheritAttrs:!1,setup:e=>(e,t)=>(i(),b("li",H,[f(e.$slots,"before"),y(G,c(e.$attrs,{class:"vv-nav__item-label",role:"menuitem"}),{default:v(()=>[f(e.$slots,"default")]),_:3},16),f(e.$slots,"after")]))});const K=/* @__PURE__ */t({name:"VvNav",props:F,emits:["click"],setup(e,{emit:t}){const r=e,o=t,{modifiers:a}=g(r);function s(e){const t=e.target;if(t?.dataset.index){const e=Number.parseInt(t.dataset.index),a=r.items?.[e];if(!a||a?.disabled)return;o("click",a)}}const u=function(e,t){return n(()=>{const r={[e]:!0},o="string"==typeof t?.value?t.value.split(" "):t?.value;return o&&Array.isArray(o)&&o.forEach(t=>{t&&(r[`${e}--${t}`]=!0)}),r})}("vv-nav",a);return(e,t)=>(i(),b("nav",{class:k(d(u))},[x("ul",{class:"vv-nav__menu",role:"menu",onClick:S(s,["stop"])},[f(e.$slots,"default",{},()=>[(i(!0),b(_,null,h(e.items,({on:t={},data:r,...o},a)=>(i(),l(J,c({key:a,"data-index":a},{ref_for:!0},o,$(t)),{default:v(()=>[f(e.$slots,"item",c({ref_for:!0},{item:o,data:r,index:a}))]),_:2},1040,["data-index"]))),128))])])],2))}});export{K 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).VvNav=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"),s=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),u={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}},m={modifiers:{type:[String,Array],default:void 0}};r.before,o.bottom;const b={...d,...v,...p,...c,...f,...u,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}},g={items:{type:Array,default:()=>[]}};t.local;const y={...m,...g},k=b;const S=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=r,d=e.getCurrentInstance(),c=e.inject(l,void 0),f=e.ref(null);o({$el:f});const{reference:p,bus:v,aria:m,expanded:b}=e.inject(s,{});e.watch(()=>f.value,e=>{p&&(p.value=e)});const g=e.computed(()=>n.pressed||b?.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}}),S=e.computed(()=>{const e={...m?.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 h(e){n.disabled?e.preventDefault():d?.vnode.props?.onClick?u("click",e):v?.emit("click",e)}function x(e){d?.vnode.props?.onMouseover?u("mouseover",e):v?.emit("mouseover",e)}function B(e){d?.vnode.props?.onMouseleave?u("mouseleave",e):v?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(S),{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).VvNav=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"),s=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),u={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}},m={modifiers:{type:[String,Array],default:void 0}};r.before,o.bottom;const b={...d,...v,...p,...c,...f,...u,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}},g={items:{type:Array,default:()=>[]}};t.local;const y={...m,...g},k=b;const S=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,u=r,d=e.getCurrentInstance(),c=e.inject(l,void 0),f=e.ref(null);o({$el:f});const{reference:p,bus:v,aria:m,expanded:b}=e.inject(s,{});e.watch(()=>f.value,e=>{p&&(p.value=e)});const g=e.computed(()=>n.pressed||b?.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}}),S=e.computed(()=>{const e={...m?.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 h(e){n.disabled?e.preventDefault():d?.vnode.props?.onClick?u("click",e):v?.emit("click",e)}function x(e){d?.vnode.props?.onMouseover?u("mouseover",e):v?.emit("mouseover",e)}function B(e){d?.vnode.props?.onMouseleave?u("mouseleave",e):v?.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(S),{ref_key:"rootEl",ref:f,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:x,onMouseleavePassive:B}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}}),h={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.renderSlot(t.$slots,"before"),e.createVNode(S,e.mergeProps(t.$attrs,{class:"vv-nav__item-label",role:"menuitem"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16),e.renderSlot(t.$slots,"after")]))});return e.defineComponent({name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,n=o,{modifiers:a}=e.toRefs(r);function l(e){const t=e.target;if(t?.dataset.index){const e=Number.parseInt(t.dataset.index),o=r.items?.[e];if(!o||o?.disabled)return;n("click",o)}}const s=function(t,o){return e.computed(()=>{const e={[t]:!0},r="string"==typeof o?.value?o.value.split(" "):o?.value;return r&&Array.isArray(r)&&r.forEach(o=>{o&&(e[`${t}--${o}`]=!0)}),e})}("vv-nav",a);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(s))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,({on:o={},data:r,...n},a)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:a,"data-index":a},{ref_for:!0},n,e.toHandlers(o)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"item",e.mergeProps({ref_for:!0},{item:n,data:r,index:a}))]),_:2},1040,["data-index"]))),128))])])],2))}})});
|
|
@@ -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
|
items: {
|
|
3
5
|
type: PropType<import("../../index.js").NavItem[]>;
|
|
@@ -39,8 +41,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
39
41
|
index: number;
|
|
40
42
|
}) => any;
|
|
41
43
|
}>;
|
|
42
|
-
declare const _default: typeof __VLS_export;
|
|
43
|
-
export default _default;
|
|
44
44
|
type __VLS_WithSlots<T, S> = T & {
|
|
45
45
|
new (): {
|
|
46
46
|
$slots: S;
|
|
@@ -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<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
2
4
|
before?: (props: {}) => any;
|
|
3
5
|
} & {
|
|
@@ -5,8 +7,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}
|
|
|
5
7
|
} & {
|
|
6
8
|
after?: (props: {}) => any;
|
|
7
9
|
}>;
|
|
8
|
-
declare const _default: typeof __VLS_export;
|
|
9
|
-
export default _default;
|
|
10
10
|
type __VLS_WithSlots<T, S> = T & {
|
|
11
11
|
new (): {
|
|
12
12
|
$slots: S;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
1
|
declare const _default: typeof __VLS_export;
|
|
3
2
|
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|