@volverjs/ui-vue 0.0.9 → 0.0.10-beta.10
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/README.md +64 -1
- package/auto-imports.d.ts +1 -1
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +34 -19
- package/dist/components/VvAccordion/VvAccordion.es.js +33 -4
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -4
- package/dist/components/VvAccordion/index.d.ts +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +75 -27
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -5
- package/dist/components/VvAction/VvAction.es.js +26 -4
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +17 -4
- package/dist/components/VvAction/index.d.ts +5 -0
- package/dist/components/VvAlert/VvAlert.es.js +96 -45
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +4 -4
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +136 -66
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +4 -4
- package/dist/components/VvAvatar/VvAvatar.es.js +22 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +79 -28
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +39 -8
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +224 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +14 -3
- package/dist/components/VvBreadcrumb/index.d.ts +2 -9
- package/dist/components/VvButton/VvButton.es.js +70 -25
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +25 -9
- package/dist/components/VvButton/index.d.ts +5 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -6
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -6
- package/dist/components/VvCard/VvCard.es.js +47 -16
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +35 -7
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +8 -8
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +106 -51
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +635 -400
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +112 -112
- package/dist/components/VvCombobox/index.d.ts +32 -32
- package/dist/components/VvDialog/VvDialog.es.js +65 -27
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +87 -46
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +203 -189
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +12 -0
- package/dist/components/VvDropdown/index.d.ts +32 -32
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +46 -12
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +28 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +40 -8
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +149 -99
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/index.d.ts +8 -2
- package/dist/components/VvNav/VvNav.es.js +115 -63
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +31 -12
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/index.d.ts +1 -12
- package/dist/components/VvNavItem/VvNavItem.es.js +413 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +33 -6
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +35 -7
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +8 -8
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +106 -51
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +159 -99
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +1 -1
- package/dist/components/VvTab/VvTab.es.js +214 -99
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +40 -11
- package/dist/components/VvTab/index.d.ts +9 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +123 -77
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +10 -10
- package/dist/components/VvTooltip/VvTooltip.es.js +40 -9
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1593 -1012
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +60 -23
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +58 -18
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +19 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +58 -34
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +50 -15
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +332 -83
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +1 -0
- package/dist/stories/InputText/InputTextMask.stories.d.ts +1 -1
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/nav.d.ts +17 -0
- package/package.json +61 -52
- package/src/Volver.ts +22 -16
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvCombobox/VvCombobox.vue +32 -33
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvInputText/VvInputText.vue +2 -2
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +1 -1
- package/src/composables/useOptions.ts +2 -2
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +1 -4
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +27 -3
- package/src/stories/Button/ButtonModifiers.stories.ts +4 -14
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Combobox/ComboboxOptions.stories.ts +18 -0
- package/src/stories/InputText/InputTextMask.stories.ts +1 -1
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +5 -0
- package/src/types/nav.ts +19 -0
- package/src/utils/ObjectUtilities.ts +3 -2
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +0 -0
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString,
|
|
1
|
+
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
3
|
Strategy2["absolute"] = "absolute";
|
|
4
4
|
Strategy2["fixed"] = "fixed";
|
|
@@ -93,6 +93,12 @@ const ActiveProps = {
|
|
|
93
93
|
*/
|
|
94
94
|
active: Boolean
|
|
95
95
|
};
|
|
96
|
+
const CurrentProps = {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the item is current
|
|
99
|
+
*/
|
|
100
|
+
current: Boolean
|
|
101
|
+
};
|
|
96
102
|
const PressedProps = {
|
|
97
103
|
/**
|
|
98
104
|
* Whether the item is pressed
|
|
@@ -223,6 +229,7 @@ const ActionProps = {
|
|
|
223
229
|
...LabelProps,
|
|
224
230
|
...PressedProps,
|
|
225
231
|
...ActiveProps,
|
|
232
|
+
...CurrentProps,
|
|
226
233
|
...LinkProps,
|
|
227
234
|
/**
|
|
228
235
|
* Button type
|
|
@@ -238,16 +245,25 @@ const ActionProps = {
|
|
|
238
245
|
ariaLabel: {
|
|
239
246
|
type: String,
|
|
240
247
|
default: void 0
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* Default tag for the action
|
|
251
|
+
*/
|
|
252
|
+
defaultTag: {
|
|
253
|
+
type: String,
|
|
254
|
+
default: ActionTag.button
|
|
241
255
|
}
|
|
242
256
|
};
|
|
243
|
-
const
|
|
244
|
-
...ModifiersProps,
|
|
257
|
+
const NavProps = {
|
|
245
258
|
items: {
|
|
246
259
|
type: Array,
|
|
247
|
-
required: true,
|
|
248
260
|
default: () => []
|
|
249
261
|
}
|
|
250
262
|
};
|
|
263
|
+
const VvNavProps = {
|
|
264
|
+
...ModifiersProps,
|
|
265
|
+
...NavProps
|
|
266
|
+
};
|
|
251
267
|
const VvNavEvents = ["click"];
|
|
252
268
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
253
269
|
const VvActionProps = ActionProps;
|
|
@@ -260,11 +276,11 @@ function useInjectedDropdownTrigger() {
|
|
|
260
276
|
function useInjectedDropdownAction() {
|
|
261
277
|
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
262
278
|
}
|
|
263
|
-
const __default__ = {
|
|
279
|
+
const __default__$1 = {
|
|
264
280
|
name: "VvAction"
|
|
265
281
|
};
|
|
266
|
-
const _sfc_main$
|
|
267
|
-
...__default__,
|
|
282
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
283
|
+
...__default__$1,
|
|
268
284
|
props: VvActionProps,
|
|
269
285
|
emits: VvActionEvents,
|
|
270
286
|
setup(__props, { expose: __expose, emit }) {
|
|
@@ -299,7 +315,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
299
315
|
case props.href !== void 0:
|
|
300
316
|
return ActionTag.a;
|
|
301
317
|
default:
|
|
302
|
-
return
|
|
318
|
+
return props.defaultTag;
|
|
303
319
|
}
|
|
304
320
|
});
|
|
305
321
|
const hasProps = computed(() => {
|
|
@@ -324,12 +340,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
324
340
|
to: props.to,
|
|
325
341
|
target: props.target
|
|
326
342
|
};
|
|
327
|
-
|
|
343
|
+
case ActionTag.button:
|
|
328
344
|
return {
|
|
329
345
|
...toReturn,
|
|
330
346
|
type: props.type,
|
|
331
347
|
disabled: props.disabled
|
|
332
348
|
};
|
|
349
|
+
default:
|
|
350
|
+
return toReturn;
|
|
333
351
|
}
|
|
334
352
|
});
|
|
335
353
|
const onClick = (e) => {
|
|
@@ -355,7 +373,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
355
373
|
class: {
|
|
356
374
|
active: _ctx.active,
|
|
357
375
|
pressed: unref(pressed),
|
|
358
|
-
disabled: _ctx.disabled
|
|
376
|
+
disabled: _ctx.disabled,
|
|
377
|
+
current: _ctx.current
|
|
359
378
|
},
|
|
360
379
|
onClickPassive: onClick,
|
|
361
380
|
onMouseoverPassive: onMouseover,
|
|
@@ -363,14 +382,49 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
363
382
|
}), {
|
|
364
383
|
default: withCtx(() => [
|
|
365
384
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
366
|
-
createTextVNode(
|
|
385
|
+
createTextVNode(
|
|
386
|
+
toDisplayString(_ctx.label),
|
|
387
|
+
1
|
|
388
|
+
/* TEXT */
|
|
389
|
+
)
|
|
367
390
|
])
|
|
368
391
|
]),
|
|
369
392
|
_: 3
|
|
393
|
+
/* FORWARDED */
|
|
370
394
|
}, 16, ["class"]);
|
|
371
395
|
};
|
|
372
396
|
}
|
|
373
397
|
});
|
|
398
|
+
const _hoisted_1$1 = {
|
|
399
|
+
class: "vv-nav__item",
|
|
400
|
+
role: "presentation"
|
|
401
|
+
};
|
|
402
|
+
const __default__ = {
|
|
403
|
+
name: "VvNavItem",
|
|
404
|
+
inheritAttrs: false
|
|
405
|
+
};
|
|
406
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
407
|
+
...__default__,
|
|
408
|
+
setup(__props) {
|
|
409
|
+
return (_ctx, _cache) => {
|
|
410
|
+
return openBlock(), createElementBlock("li", _hoisted_1$1, [
|
|
411
|
+
createVNode(
|
|
412
|
+
_sfc_main$2,
|
|
413
|
+
mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
|
|
414
|
+
{
|
|
415
|
+
default: withCtx(() => [
|
|
416
|
+
renderSlot(_ctx.$slots, "default")
|
|
417
|
+
]),
|
|
418
|
+
_: 3
|
|
419
|
+
/* FORWARDED */
|
|
420
|
+
},
|
|
421
|
+
16
|
|
422
|
+
/* FULL_PROPS */
|
|
423
|
+
)
|
|
424
|
+
]);
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
});
|
|
374
428
|
function useModifiers(prefix, modifiers, others) {
|
|
375
429
|
return computed(() => {
|
|
376
430
|
const toReturn = {
|
|
@@ -394,67 +448,65 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
394
448
|
return toReturn;
|
|
395
449
|
});
|
|
396
450
|
}
|
|
397
|
-
const _hoisted_1 =
|
|
398
|
-
class: "vv-nav__menu",
|
|
399
|
-
role: "menu",
|
|
400
|
-
"aria-busy": "true"
|
|
401
|
-
};
|
|
451
|
+
const _hoisted_1 = ["onClick"];
|
|
402
452
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
403
453
|
__name: "VvNav",
|
|
404
454
|
props: VvNavProps,
|
|
405
455
|
emits: VvNavEvents,
|
|
406
456
|
setup(__props, { emit }) {
|
|
407
457
|
const props = __props;
|
|
408
|
-
const { modifiers
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
});
|
|
419
|
-
function onClick(item) {
|
|
420
|
-
if (!item.disabled) {
|
|
458
|
+
const { modifiers } = toRefs(props);
|
|
459
|
+
const onClick = (event) => {
|
|
460
|
+
var _a;
|
|
461
|
+
const target = event.target;
|
|
462
|
+
if (target == null ? void 0 : target.dataset.index) {
|
|
463
|
+
const index = parseInt(target.dataset.index);
|
|
464
|
+
const item = (_a = props.items) == null ? void 0 : _a[index];
|
|
465
|
+
if (!item || (item == null ? void 0 : item.disabled)) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
421
468
|
emit("click", item);
|
|
422
|
-
activeItem.value = item.id;
|
|
423
469
|
}
|
|
424
|
-
}
|
|
470
|
+
};
|
|
471
|
+
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
425
472
|
return (_ctx, _cache) => {
|
|
426
|
-
return openBlock(), createElementBlock(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
473
|
+
return openBlock(), createElementBlock(
|
|
474
|
+
"nav",
|
|
475
|
+
{
|
|
476
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
477
|
+
},
|
|
478
|
+
[
|
|
479
|
+
createElementVNode("ul", {
|
|
480
|
+
class: "vv-nav__menu",
|
|
481
|
+
role: "menu",
|
|
482
|
+
"aria-busy": "true",
|
|
483
|
+
onClick: withModifiers(onClick, ["stop"])
|
|
484
|
+
}, [
|
|
485
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
486
|
+
(openBlock(true), createElementBlock(
|
|
487
|
+
Fragment,
|
|
488
|
+
null,
|
|
489
|
+
renderList(_ctx.items, ({ on = {}, ...item }, index) => {
|
|
490
|
+
return openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
491
|
+
key: index,
|
|
492
|
+
"data-index": index
|
|
493
|
+
}, item, toHandlers(on)), {
|
|
494
|
+
default: withCtx(() => [
|
|
495
|
+
renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps({ item, index })))
|
|
496
|
+
]),
|
|
497
|
+
_: 2
|
|
498
|
+
/* DYNAMIC */
|
|
499
|
+
}, 1040, ["data-index"]);
|
|
500
|
+
}),
|
|
501
|
+
128
|
|
502
|
+
/* KEYED_FRAGMENT */
|
|
503
|
+
))
|
|
504
|
+
])
|
|
505
|
+
], 8, _hoisted_1)
|
|
506
|
+
],
|
|
507
|
+
2
|
|
508
|
+
/* CLASS */
|
|
509
|
+
);
|
|
458
510
|
};
|
|
459
511
|
}
|
|
460
512
|
});
|
|
@@ -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.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNav=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),s=Symbol.for("dropdownAction"),u={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},v={current:Boolean},f={pressed:Boolean},p={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}},k={...m,...{items:{type:Array,default:()=>[]}}},g=b;const y=e.defineComponent({name:"VvAction",props:g,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,u=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:v,aria:f,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const m=e.computed((()=>l.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),g=e.computed((()=>{const e={...null==f?void 0:f.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),y=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),n("click",e))},B=e=>{null==v||v.emit("mouseover",e),n("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(g),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:y,onMouseoverPassive:B,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},_=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.createVNode(y,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});const h=["onClick"];return e.defineComponent({__name:"VvNav",props:k,emits:["click"],setup(t,{emit:o}){const n=t,{modifiers:r}=e.toRefs(n),l=e=>{var t;const r=e.target;if(null==r?void 0:r.dataset.index){const e=parseInt(r.dataset.index),l=null==(t=n.items)?void 0:t[e];if(!l||(null==l?void 0:l.disabled))return;o("click",l)}},a=function(t,o,n){return e.computed((()=>{const r={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{r[`${t}--${o}`]=e.unref(n.value[o])})),r}))}("vv-nav",r);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},...n},r)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:r,"data-index":r},n,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:n,index:r})))])),_:2},1040,["data-index"])))),128))]))],8,h)],2))}})}));
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
2
|
items: {
|
|
4
|
-
type: globalThis.PropType<NavItem[]>;
|
|
5
|
-
required: boolean;
|
|
3
|
+
type: globalThis.PropType<import("../..").NavItem[]>;
|
|
6
4
|
default: () => never[];
|
|
7
5
|
};
|
|
8
6
|
modifiers: globalThis.PropType<string | string[]>;
|
|
9
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
[x: string]: (...args: any[]) => void;
|
|
9
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
10
|
items: {
|
|
11
|
-
type: globalThis.PropType<NavItem[]>;
|
|
12
|
-
required: boolean;
|
|
11
|
+
type: globalThis.PropType<import("../..").NavItem[]>;
|
|
13
12
|
default: () => never[];
|
|
14
13
|
};
|
|
15
14
|
modifiers: globalThis.PropType<string | string[]>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}, {
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
}>>, {
|
|
16
|
+
items: import("../..").NavItem[];
|
|
17
|
+
}, {}>, {
|
|
18
|
+
default?(_: {}): any;
|
|
19
|
+
item?(_: {
|
|
20
|
+
item: {
|
|
21
|
+
label: string;
|
|
22
|
+
ariaLabel?: string | undefined;
|
|
23
|
+
title?: string | undefined;
|
|
24
|
+
to?: string | Record<string, unknown> | undefined;
|
|
25
|
+
href?: string | undefined;
|
|
26
|
+
target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
|
|
27
|
+
rel?: string | undefined;
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
current?: boolean | undefined;
|
|
30
|
+
class?: string | string[] | undefined;
|
|
31
|
+
};
|
|
32
|
+
index: number;
|
|
33
|
+
}): any;
|
|
34
|
+
}>;
|
|
21
35
|
export default _default;
|
|
36
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export type NavItem = {
|
|
2
|
-
id?: string;
|
|
3
|
-
title: string;
|
|
4
|
-
to?: string | {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
href?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
on?: Record<string, () => void>;
|
|
10
|
-
};
|
|
11
1
|
export declare const VvNavProps: {
|
|
12
2
|
items: {
|
|
13
|
-
type: globalThis.PropType<NavItem[]>;
|
|
14
|
-
required: boolean;
|
|
3
|
+
type: globalThis.PropType<import("../..").NavItem[]>;
|
|
15
4
|
default: () => never[];
|
|
16
5
|
};
|
|
17
6
|
modifiers: globalThis.PropType<string | string[]>;
|