@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,410 +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
|
-
({
|
|
164
|
-
storageType: {
|
|
165
|
-
default: StorageType.local
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
const VvBreadcrumbProps = {
|
|
169
|
-
...ModifiersProps,
|
|
170
|
-
routes: Array
|
|
171
|
-
};
|
|
172
|
-
function useModifiers(prefix, modifiers, others) {
|
|
173
|
-
return computed(() => {
|
|
174
|
-
const toReturn = {
|
|
175
|
-
[prefix]: true
|
|
176
|
-
};
|
|
177
|
-
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
178
|
-
if (modifiersArray) {
|
|
179
|
-
if (Array.isArray(modifiersArray)) {
|
|
180
|
-
modifiersArray.forEach((modifier) => {
|
|
181
|
-
if (modifier) {
|
|
182
|
-
toReturn[`${prefix}--${modifier}`] = true;
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return toReturn;
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
191
|
-
const VvActionProps = ActionProps;
|
|
192
|
-
function useVolver() {
|
|
193
|
-
return inject(INJECTION_KEY_VOLVER, void 0);
|
|
194
|
-
}
|
|
195
|
-
function useInjectedDropdownTrigger() {
|
|
196
|
-
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
197
|
-
}
|
|
198
|
-
function useInjectedDropdownAction() {
|
|
199
|
-
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
200
|
-
}
|
|
201
|
-
const __default__$1 = {
|
|
202
|
-
name: "VvAction"
|
|
203
|
-
};
|
|
204
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
205
|
-
...__default__$1,
|
|
206
|
-
props: VvActionProps,
|
|
207
|
-
emits: VvActionEvents,
|
|
208
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
209
|
-
const props = __props;
|
|
210
|
-
const emit = __emit;
|
|
211
|
-
const instance = getCurrentInstance();
|
|
212
|
-
const volver = useVolver();
|
|
213
|
-
const element = ref(null);
|
|
214
|
-
__expose({ $el: element });
|
|
215
|
-
const {
|
|
216
|
-
reference: dropdownTriggerReference,
|
|
217
|
-
bus: dropdownEventBus,
|
|
218
|
-
aria: dropdownAria,
|
|
219
|
-
expanded: dropdownExpanded
|
|
220
|
-
} = useInjectedDropdownTrigger();
|
|
221
|
-
watch(
|
|
222
|
-
() => element.value,
|
|
223
|
-
(newValue) => {
|
|
224
|
-
if (dropdownTriggerReference) {
|
|
225
|
-
dropdownTriggerReference.value = newValue;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
const pressed = computed(() => {
|
|
230
|
-
return props.pressed || dropdownExpanded?.value;
|
|
231
|
-
});
|
|
232
|
-
const { role } = useInjectedDropdownAction();
|
|
233
|
-
const hasTag = computed(() => {
|
|
234
|
-
switch (true) {
|
|
235
|
-
case props.disabled:
|
|
236
|
-
return ActionTag.button;
|
|
237
|
-
case props.to !== void 0:
|
|
238
|
-
return volver?.nuxt ? resolveComponent(ActionTag.nuxtLink) : ActionTag.routerLink;
|
|
239
|
-
case props.href !== void 0:
|
|
240
|
-
return ActionTag.a;
|
|
241
|
-
default:
|
|
242
|
-
return props.defaultTag;
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
const hasProps = computed(() => {
|
|
246
|
-
const toReturn = {
|
|
247
|
-
...dropdownAria?.value,
|
|
248
|
-
ariaPressed: pressed.value ? true : void 0,
|
|
249
|
-
ariaLabel: props.ariaLabel,
|
|
250
|
-
role: role?.value
|
|
251
|
-
};
|
|
252
|
-
switch (hasTag.value) {
|
|
253
|
-
case ActionTag.a:
|
|
254
|
-
return {
|
|
255
|
-
...toReturn,
|
|
256
|
-
href: props.href,
|
|
257
|
-
target: props.target,
|
|
258
|
-
rel: props.rel
|
|
259
|
-
};
|
|
260
|
-
case ActionTag.routerLink:
|
|
261
|
-
case ActionTag.nuxtLink:
|
|
262
|
-
return {
|
|
263
|
-
...toReturn,
|
|
264
|
-
to: props.to,
|
|
265
|
-
target: props.target
|
|
266
|
-
};
|
|
267
|
-
case ActionTag.button:
|
|
268
|
-
return {
|
|
269
|
-
...toReturn,
|
|
270
|
-
type: props.type,
|
|
271
|
-
disabled: props.disabled
|
|
272
|
-
};
|
|
273
|
-
default:
|
|
274
|
-
return toReturn;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
function onClick(e) {
|
|
278
|
-
if (props.disabled) {
|
|
279
|
-
e.preventDefault();
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (instance?.vnode.props?.onClick) {
|
|
283
|
-
emit("click", e);
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
dropdownEventBus?.emit("click", e);
|
|
287
|
-
}
|
|
288
|
-
function onMouseover(e) {
|
|
289
|
-
if (instance?.vnode.props?.onMouseover) {
|
|
290
|
-
emit("mouseover", e);
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
dropdownEventBus?.emit("mouseover", e);
|
|
294
|
-
}
|
|
295
|
-
function onMouseleave(e) {
|
|
296
|
-
if (instance?.vnode.props?.onMouseleave) {
|
|
297
|
-
emit("mouseleave", e);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
dropdownEventBus?.emit("mouseleave", e);
|
|
301
|
-
}
|
|
302
|
-
return (_ctx, _cache) => {
|
|
303
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
304
|
-
ref_key: "element",
|
|
305
|
-
ref: element,
|
|
306
|
-
class: {
|
|
307
|
-
active: _ctx.active,
|
|
308
|
-
pressed: unref(pressed),
|
|
309
|
-
disabled: _ctx.disabled,
|
|
310
|
-
current: _ctx.current
|
|
311
|
-
},
|
|
312
|
-
onClickPassive: onClick,
|
|
313
|
-
onMouseoverPassive: onMouseover,
|
|
314
|
-
onMouseleavePassive: onMouseleave
|
|
315
|
-
}), {
|
|
316
|
-
default: withCtx(() => [
|
|
317
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
318
|
-
createTextVNode(
|
|
319
|
-
toDisplayString(_ctx.label),
|
|
320
|
-
1
|
|
321
|
-
/* TEXT */
|
|
322
|
-
)
|
|
323
|
-
])
|
|
324
|
-
]),
|
|
325
|
-
_: 3
|
|
326
|
-
/* FORWARDED */
|
|
327
|
-
}, 16, ["class"]);
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
const _hoisted_1 = { class: "vv-breadcrumb__list" };
|
|
332
|
-
const _hoisted_2 = ["content"];
|
|
333
|
-
const __default__ = {
|
|
334
|
-
name: "VvBreadcrumb"
|
|
335
|
-
};
|
|
336
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
337
|
-
...__default__,
|
|
338
|
-
props: VvBreadcrumbProps,
|
|
339
|
-
setup(__props) {
|
|
340
|
-
const props = __props;
|
|
341
|
-
const { modifiers } = toRefs(props);
|
|
342
|
-
const bemCssClasses = useModifiers("vv-breadcrumb", modifiers);
|
|
343
|
-
const length = computed(() => props.routes?.length ?? 0);
|
|
344
|
-
const isLast = (index) => index === length.value - 1;
|
|
345
|
-
return (_ctx, _cache) => {
|
|
346
|
-
return openBlock(), createElementBlock(
|
|
347
|
-
"nav",
|
|
348
|
-
{
|
|
349
|
-
class: normalizeClass(unref(bemCssClasses)),
|
|
350
|
-
"aria-label": "breadcrumbs"
|
|
351
|
-
},
|
|
352
|
-
[
|
|
353
|
-
createElementVNode("ol", _hoisted_1, [
|
|
354
|
-
(openBlock(true), createElementBlock(
|
|
355
|
-
Fragment,
|
|
356
|
-
null,
|
|
357
|
-
renderList(_ctx.routes, ({ label, ...route }, index) => {
|
|
358
|
-
return openBlock(), createElementBlock(
|
|
359
|
-
"li",
|
|
360
|
-
{
|
|
361
|
-
key: `${label}-${index}`,
|
|
362
|
-
class: normalizeClass(
|
|
363
|
-
!isLast(index) ? "vv-breadcrumb__item" : "vv-breadcrumb__item-active"
|
|
364
|
-
),
|
|
365
|
-
itemprop: "itemListElement",
|
|
366
|
-
itemtype: "https://schema.org/ListItem",
|
|
367
|
-
itemscope: ""
|
|
368
|
-
},
|
|
369
|
-
[
|
|
370
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, route, {
|
|
371
|
-
class: !isLast(index) ? "vv-breadcrumb__link" : "vv-breadcrumb__label",
|
|
372
|
-
"aria-current": isLast(index) ? "page" : void 0,
|
|
373
|
-
itemprop: "item",
|
|
374
|
-
"default-tag": "span"
|
|
375
|
-
}), {
|
|
376
|
-
default: withCtx(() => [
|
|
377
|
-
renderSlot(_ctx.$slots, "label", mergeProps({ ref_for: true }, { ...route, index, label, isLast: isLast(index) }), () => [
|
|
378
|
-
createTextVNode(
|
|
379
|
-
toDisplayString(label),
|
|
380
|
-
1
|
|
381
|
-
/* TEXT */
|
|
382
|
-
)
|
|
383
|
-
])
|
|
384
|
-
]),
|
|
385
|
-
_: 2
|
|
386
|
-
/* DYNAMIC */
|
|
387
|
-
}, 1040, ["class", "aria-current"]),
|
|
388
|
-
createElementVNode("meta", {
|
|
389
|
-
itemprop: "position",
|
|
390
|
-
content: `${index + 1}`
|
|
391
|
-
}, null, 8, _hoisted_2)
|
|
392
|
-
],
|
|
393
|
-
2
|
|
394
|
-
/* CLASS */
|
|
395
|
-
);
|
|
396
|
-
}),
|
|
397
|
-
128
|
|
398
|
-
/* KEYED_FRAGMENT */
|
|
399
|
-
))
|
|
400
|
-
])
|
|
401
|
-
],
|
|
402
|
-
2
|
|
403
|
-
/* CLASS */
|
|
404
|
-
);
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
export {
|
|
409
|
-
_sfc_main as default
|
|
410
|
-
};
|
|
1
|
+
import{computed as e,inject as t,defineComponent as r,getCurrentInstance as a,ref as o,watch as l,resolveComponent as s,createBlock as n,openBlock as u,resolveDynamicComponent as i,unref as c,mergeProps as d,withCtx as v,renderSlot as b,createTextVNode as p,toDisplayString as f,toRefs as m,createElementBlock as g,normalizeClass as y,createElementVNode as k,Fragment as _,renderList as h,createVNode as L}from"vue";var S=/* @__PURE__ */(e=>(e.local="local",e.session="session",e))(S||{}),x=/* @__PURE__ */(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(x||{}),$=/* @__PURE__ */(e=>(e.before="before",e.after="after",e))($||{}),A=/* @__PURE__ */(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(A||{}),B=/* @__PURE__ */(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(B||{});const w=/* @__PURE__ */Symbol.for("volver"),M=/* @__PURE__ */Symbol.for("dropdownTrigger"),P=/* @__PURE__ */Symbol.for("dropdownAction"),E={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},T={disabled:{type:Boolean,default:!1}},j={active:{type:Boolean,default:!1}},C={current:{type:Boolean,default:!1}},O={pressed:{type:Boolean,default:!1}},V={label:{type:[String,Number],default:void 0}},D={modifiers:{type:[String,Array],default:void 0}};$.before,x.bottom;const I={...T,...V,...O,...j,...C,...E,type:{type:String,default:A.button,validator:e=>Object.values(A).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:B.button}};S.local;const N={...D,routes:Array};const q=/* @__PURE__ */r({name:"VvAction",props:I,emits:["click","mouseover","mouseleave"],setup(r,{expose:m,emit:g}){const y=r,k=g,_=a(),h=t(w,void 0),L=o(null);m({$el:L});const{reference:S,bus:x,aria:$,expanded:A}=t(M,{});l(()=>L.value,e=>{S&&(S.value=e)});const E=e(()=>y.pressed||A?.value),{role:T}=t(P,{}),j=e(()=>{switch(!0){case y.disabled:return B.button;case void 0!==y.to:return h?.nuxt?s(B.nuxtLink):B.routerLink;case void 0!==y.href:return B.a;default:return y.defaultTag}}),C=e(()=>{const e={...$?.value,ariaPressed:!!E.value||void 0,ariaLabel:y.ariaLabel,role:T?.value};switch(j.value){case B.a:return{...e,href:y.href,target:y.target,rel:y.rel};case B.routerLink:case B.nuxtLink:return{...e,to:y.to,target:y.target};case B.button:return{...e,type:y.type,disabled:y.disabled};default:return e}});function O(e){y.disabled?e.preventDefault():_?.vnode.props?.onClick?k("click",e):x?.emit("click",e)}function V(e){_?.vnode.props?.onMouseover?k("mouseover",e):x?.emit("mouseover",e)}function D(e){_?.vnode.props?.onMouseleave?k("mouseleave",e):x?.emit("mouseleave",e)}return(e,t)=>(u(),n(i(c(j)),d(c(C),{ref_key:"rootEl",ref:L,class:{active:e.active,pressed:c(E),disabled:e.disabled,current:e.current},onClickPassive:O,onMouseoverPassive:V,onMouseleavePassive:D}),{default:v(()=>[b(e.$slots,"default",{},()=>[p(f(e.label),1)])]),_:3},16,["class"]))}}),z={class:"vv-breadcrumb__list"},F=["content"],G=/* @__PURE__ */r({name:"VvBreadcrumb",props:N,setup(t){const r=t,{modifiers:a}=m(r),o=function(t,r){return e(()=>{const e={[t]:!0},a="string"==typeof r?.value?r.value.split(" "):r?.value;return a&&Array.isArray(a)&&a.forEach(r=>{r&&(e[`${t}--${r}`]=!0)}),e})}("vv-breadcrumb",a),l=e(()=>r.routes?.length??0),s=e=>e===l.value-1;return(e,t)=>(u(),g("nav",{class:y(c(o)),"aria-label":"breadcrumbs"},[k("ol",z,[(u(!0),g(_,null,h(e.routes,({label:t,...r},a)=>(u(),g("li",{key:`${t}-${a}`,class:y(s(a)?"vv-breadcrumb__item-active":"vv-breadcrumb__item"),itemprop:"itemListElement",itemtype:"https://schema.org/ListItem",itemscope:""},[L(q,d({ref_for:!0},r,{class:s(a)?"vv-breadcrumb__label":"vv-breadcrumb__link","aria-current":s(a)?"page":void 0,itemprop:"item","default-tag":"span"}),{default:v(()=>[b(e.$slots,"label",d({ref_for:!0},{...r,index:a,label:t,isLast:s(a)}),()=>[p(f(t),1)])]),_:2},1040,["class","aria-current"]),k("meta",{itemprop:"position",content:`${a+1}`},null,8,F)],2))),128))])],2))}});export{G 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).VvBreadcrumb=t(e.vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),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"}},c={disabled:{type:Boolean,default:!1}},d={active:{type:Boolean,default:!1}},p={current:{type:Boolean,default:!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).VvBreadcrumb=t(e.vue)}(this,function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),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"}},c={disabled:{type:Boolean,default:!1}},d={active:{type:Boolean,default:!1}},p={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},m={label:{type:[String,Number],default:void 0}},v={modifiers:{type:[String,Array],default:void 0}};o.before,r.bottom;const b={...c,...m,...f,...d,...p,...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}};t.local;const g={...v,routes:Array};const y=b;const k=e.defineComponent({name:"VvAction",props:y,emits:["click","mouseover","mouseleave"],setup(t,{expose:r,emit:o}){const n=t,u=o,c=e.getCurrentInstance(),d=e.inject(l,void 0),p=e.ref(null);r({$el:p});const{reference:f,bus:m,aria:v,expanded:b}=e.inject(s,{});e.watch(()=>p.value,e=>{f&&(f.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 d?.nuxt?e.resolveComponent(a.nuxtLink):a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}}),h=e.computed(()=>{const e={...v?.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():c?.vnode.props?.onClick?u("click",e):m?.emit("click",e)}function _(e){c?.vnode.props?.onMouseover?u("mouseover",e):m?.emit("mouseover",e)}function x(e){c?.vnode.props?.onMouseleave?u("mouseleave",e):m?.emit("mouseleave",e)}return(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(h),{ref_key:"rootEl",ref:p,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:S,onMouseoverPassive:_,onMouseleavePassive:x}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),_:3},16,["class"]))}}),h={class:"vv-breadcrumb__list"},S=["content"];return e.defineComponent({name:"VvBreadcrumb",props:g,setup(t){const r=t,{modifiers:o}=e.toRefs(r),n=function(t,r){return e.computed(()=>{const e={[t]:!0},o="string"==typeof r?.value?r.value.split(" "):r?.value;return o&&Array.isArray(o)&&o.forEach(r=>{r&&(e[`${t}--${r}`]=!0)}),e})}("vv-breadcrumb",o),a=e.computed(()=>r.routes?.length??0),l=e=>e===a.value-1;return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(n)),"aria-label":"breadcrumbs"},[e.createElementVNode("ol",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routes,({label:r,...o},n)=>(e.openBlock(),e.createElementBlock("li",{key:`${r}-${n}`,class:e.normalizeClass(l(n)?"vv-breadcrumb__item-active":"vv-breadcrumb__item"),itemprop:"itemListElement",itemtype:"https://schema.org/ListItem",itemscope:""},[e.createVNode(k,e.mergeProps({ref_for:!0},o,{class:l(n)?"vv-breadcrumb__label":"vv-breadcrumb__link","aria-current":l(n)?"page":void 0,itemprop:"item","default-tag":"span"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"label",e.mergeProps({ref_for:!0},{...o,index:n,label:r,isLast:l(n)}),()=>[e.createTextVNode(e.toDisplayString(r),1)])]),_:2},1040,["class","aria-current"]),e.createElementVNode("meta",{itemprop:"position",content:`${n+1}`},null,8,S)],2))),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
|
routes: PropType<import("../..").NavItem[]>;
|
|
3
5
|
modifiers: {
|
|
@@ -30,8 +32,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
|
|
|
30
32
|
data?: Record<string, unknown>;
|
|
31
33
|
}) => any;
|
|
32
34
|
}>;
|
|
33
|
-
declare const _default: typeof __VLS_export;
|
|
34
|
-
export default _default;
|
|
35
35
|
type __VLS_WithSlots<T, S> = T & {
|
|
36
36
|
new (): {
|
|
37
37
|
$slots: S;
|