@volverjs/ui-vue 0.0.10 → 0.0.12
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 +2 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +3 -2
- package/dist/components/VvAction/VvAction.es.js +1 -302
- package/dist/components/VvAction/VvAction.vue.d.ts +2 -1
- package/dist/components/VvAlert/VvAlert.es.js +1 -527
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +2 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +2 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -131
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -1
- 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 +2 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -1
- package/dist/components/VvCard/VvCard.es.js +1 -152
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -1
- 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 +263 -317
- package/dist/components/VvDialog/VvDialog.es.js +1 -317
- package/dist/components/VvDialog/VvDialog.vue.d.ts +2 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -1
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +5 -4
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +10 -2
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
- 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.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -1
- 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 +2 -1
- 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 +2 -1
- package/dist/components/VvNav/VvNav.es.js +1 -438
- package/dist/components/VvNav/VvNav.vue.d.ts +2 -1
- package/dist/components/VvNav/VvNavItem.vue.d.ts +2 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
- 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 -1
- package/dist/components/VvRadio/VvRadio.es.js +1 -661
- package/dist/components/VvRadio/VvRadio.vue.d.ts +3 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -1
- package/dist/components/VvSelect/VvSelect.es.js +1 -1103
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +130 -71
- package/dist/components/VvTab/VvTab.es.js +1 -558
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -1
- 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/resolvers/unplugin.es.js +1 -187
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +14 -14
- package/package.json +37 -37
|
@@ -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=Symbol.for("volver"),M=Symbol.for("dropdownTrigger"),P=Symbol.for("dropdownAction"),T={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},j={disabled:{type:Boolean,default:!1}},C={active:{type:Boolean,default:!1}},E={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={...j,...V,...O,...C,...E,...T,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 T=e(()=>y.pressed||A?.value),{role:j}=t(P,{}),C=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}}),E=e(()=>{const e={...$?.value,ariaPressed:!!T.value||void 0,ariaLabel:y.ariaLabel,role:j?.value};switch(C.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(C)),d(c(E),{ref_key:"element",ref:L,class:{active:e.active,pressed:c(T),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,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
2
|
routes: PropType<import("../..").NavItem[]>;
|
|
3
3
|
modifiers: {
|
|
4
4
|
type: PropType<string | string[]>;
|
|
@@ -30,6 +30,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<globalThis
|
|
|
30
30
|
data?: Record<string, unknown>;
|
|
31
31
|
}) => any;
|
|
32
32
|
}>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
33
34
|
export default _default;
|
|
34
35
|
type __VLS_WithSlots<T, S> = T & {
|
|
35
36
|
new (): {
|