@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.3
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/dist/components/VvAccordion/VvAccordion.es.js +7 -0
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +1 -1
- package/dist/components/VvAction/VvAction.es.js +9 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +3 -0
- package/dist/components/VvAction/index.d.ts +1 -0
- package/dist/components/VvAlert/VvAlert.es.js +7 -0
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +7 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +7 -0
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +9 -1
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +6 -3
- package/dist/components/VvButton/index.d.ts +1 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvCard/VvCard.es.js +7 -0
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +7 -0
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +7 -0
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +16 -2
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +37 -37
- package/dist/components/VvCombobox/index.d.ts +13 -11
- package/dist/components/VvDialog/VvDialog.es.js +7 -0
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +7 -0
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +31 -31
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +3 -0
- package/dist/components/VvDropdown/index.d.ts +10 -10
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvInputText/VvInputClearAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +7 -0
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvNav/VvNav.es.js +69 -56
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +12 -8
- 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 +392 -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 +7 -0
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +7 -0
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +7 -0
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +7 -0
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +7 -7
- package/dist/components/VvTab/VvTab.es.js +127 -87
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +19 -6
- package/dist/components/VvTab/index.d.ts +9 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +7 -0
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +246 -200
- package/dist/components/index.umd.js +1 -1
- package/dist/directives/index.es.js +7 -0
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +7 -0
- 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/props/index.d.ts +29 -12
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +5 -5
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +31 -31
- package/dist/stories/Tab/Tab.settings.d.ts +3 -23
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +5 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/nav.d.ts +17 -0
- package/package.json +41 -33
- 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/VvAction/VvAction.vue +1 -0
- package/src/components/VvCombobox/VvCombobox.vue +11 -4
- package/src/components/VvNav/VvNav.vue +29 -51
- 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/VvTab/VvTab.vue +60 -36
- package/src/components/VvTab/index.ts +10 -4
- package/src/props/index.ts +19 -3
- 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 +8 -8
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/types/nav.ts +19 -0
- 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/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/{generic.d.ts → generic.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -243,7 +243,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
243
243
|
}>> & {
|
|
244
244
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
245
245
|
}, {
|
|
246
|
+
readonly: boolean;
|
|
246
247
|
disabled: boolean;
|
|
248
|
+
valid: boolean;
|
|
249
|
+
invalid: boolean;
|
|
250
|
+
multiple: boolean;
|
|
247
251
|
floating: boolean;
|
|
248
252
|
type: import("../VvInputText").InputType;
|
|
249
253
|
tabindex: string | number;
|
|
@@ -252,11 +256,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
252
256
|
autofocus: boolean;
|
|
253
257
|
loading: boolean;
|
|
254
258
|
loadingLabel: string;
|
|
255
|
-
multiple: boolean;
|
|
256
|
-
readonly: boolean;
|
|
257
259
|
hintLabel: string;
|
|
258
|
-
invalid: boolean;
|
|
259
|
-
valid: boolean;
|
|
260
260
|
autocomplete: string;
|
|
261
261
|
step: string | number;
|
|
262
262
|
iconShowPassword: string;
|
|
@@ -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 } 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
|
|
@@ -240,14 +247,16 @@ const ActionProps = {
|
|
|
240
247
|
default: void 0
|
|
241
248
|
}
|
|
242
249
|
};
|
|
243
|
-
const
|
|
244
|
-
...ModifiersProps,
|
|
250
|
+
const NavProps = {
|
|
245
251
|
items: {
|
|
246
252
|
type: Array,
|
|
247
|
-
required: true,
|
|
248
253
|
default: () => []
|
|
249
254
|
}
|
|
250
255
|
};
|
|
256
|
+
const VvNavProps = {
|
|
257
|
+
...ModifiersProps,
|
|
258
|
+
...NavProps
|
|
259
|
+
};
|
|
251
260
|
const VvNavEvents = ["click"];
|
|
252
261
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
253
262
|
const VvActionProps = ActionProps;
|
|
@@ -260,11 +269,11 @@ function useInjectedDropdownTrigger() {
|
|
|
260
269
|
function useInjectedDropdownAction() {
|
|
261
270
|
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
262
271
|
}
|
|
263
|
-
const __default__ = {
|
|
272
|
+
const __default__$1 = {
|
|
264
273
|
name: "VvAction"
|
|
265
274
|
};
|
|
266
|
-
const _sfc_main$
|
|
267
|
-
...__default__,
|
|
275
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
276
|
+
...__default__$1,
|
|
268
277
|
props: VvActionProps,
|
|
269
278
|
emits: VvActionEvents,
|
|
270
279
|
setup(__props, { expose: __expose, emit }) {
|
|
@@ -355,7 +364,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
355
364
|
class: {
|
|
356
365
|
active: _ctx.active,
|
|
357
366
|
pressed: unref(pressed),
|
|
358
|
-
disabled: _ctx.disabled
|
|
367
|
+
disabled: _ctx.disabled,
|
|
368
|
+
current: _ctx.current
|
|
359
369
|
},
|
|
360
370
|
onClickPassive: onClick,
|
|
361
371
|
onMouseoverPassive: onMouseover,
|
|
@@ -371,6 +381,29 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
371
381
|
};
|
|
372
382
|
}
|
|
373
383
|
});
|
|
384
|
+
const _hoisted_1$1 = {
|
|
385
|
+
class: "vv-nav__item",
|
|
386
|
+
role: "presentation"
|
|
387
|
+
};
|
|
388
|
+
const __default__ = {
|
|
389
|
+
name: "VvNavItem",
|
|
390
|
+
inheritAttrs: false
|
|
391
|
+
};
|
|
392
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
393
|
+
...__default__,
|
|
394
|
+
setup(__props) {
|
|
395
|
+
return (_ctx, _cache) => {
|
|
396
|
+
return openBlock(), createElementBlock("li", _hoisted_1$1, [
|
|
397
|
+
createVNode(_sfc_main$2, mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }), {
|
|
398
|
+
default: withCtx(() => [
|
|
399
|
+
renderSlot(_ctx.$slots, "default")
|
|
400
|
+
]),
|
|
401
|
+
_: 3
|
|
402
|
+
}, 16)
|
|
403
|
+
]);
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
});
|
|
374
407
|
function useModifiers(prefix, modifiers, others) {
|
|
375
408
|
return computed(() => {
|
|
376
409
|
const toReturn = {
|
|
@@ -394,66 +427,46 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
394
427
|
return toReturn;
|
|
395
428
|
});
|
|
396
429
|
}
|
|
397
|
-
const _hoisted_1 =
|
|
398
|
-
class: "vv-nav__menu",
|
|
399
|
-
role: "menu",
|
|
400
|
-
"aria-busy": "true"
|
|
401
|
-
};
|
|
430
|
+
const _hoisted_1 = ["onClick"];
|
|
402
431
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
403
432
|
__name: "VvNav",
|
|
404
433
|
props: VvNavProps,
|
|
405
434
|
emits: VvNavEvents,
|
|
406
435
|
setup(__props, { emit }) {
|
|
407
436
|
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) {
|
|
437
|
+
const { modifiers } = toRefs(props);
|
|
438
|
+
const onClick = (event) => {
|
|
439
|
+
var _a;
|
|
440
|
+
const target = event.target;
|
|
441
|
+
if (target == null ? void 0 : target.dataset.index) {
|
|
442
|
+
const index = parseInt(target.dataset.index);
|
|
443
|
+
const item = (_a = props.items) == null ? void 0 : _a[index];
|
|
444
|
+
if (!item || (item == null ? void 0 : item.disabled)) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
421
447
|
emit("click", item);
|
|
422
|
-
activeItem.value = item.id;
|
|
423
448
|
}
|
|
424
|
-
}
|
|
449
|
+
};
|
|
450
|
+
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
425
451
|
return (_ctx, _cache) => {
|
|
426
452
|
return openBlock(), createElementBlock("nav", {
|
|
427
453
|
class: normalizeClass(unref(bemCssClasses))
|
|
428
454
|
}, [
|
|
429
|
-
createElementVNode("ul",
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
disabled: navItem.disabled
|
|
445
|
-
}, "vv-nav__item-label"]
|
|
446
|
-
}, toHandlers(navItem.on), {
|
|
447
|
-
onClick: ($event) => onClick(navItem)
|
|
448
|
-
}), {
|
|
449
|
-
default: withCtx(() => [
|
|
450
|
-
createTextVNode(toDisplayString(navItem.title), 1)
|
|
451
|
-
]),
|
|
452
|
-
_: 2
|
|
453
|
-
}, 1040, ["class", "onClick"])
|
|
454
|
-
]);
|
|
455
|
-
}), 128))
|
|
456
|
-
])
|
|
455
|
+
createElementVNode("ul", {
|
|
456
|
+
class: "vv-nav__menu",
|
|
457
|
+
role: "menu",
|
|
458
|
+
"aria-busy": "true",
|
|
459
|
+
onClick: withModifiers(onClick, ["stop"])
|
|
460
|
+
}, [
|
|
461
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
462
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, ({ on = {}, ...item }, index) => {
|
|
463
|
+
return openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
464
|
+
key: index,
|
|
465
|
+
"data-index": index
|
|
466
|
+
}, item, toHandlers(on)), null, 16, ["data-index"]);
|
|
467
|
+
}), 128))
|
|
468
|
+
])
|
|
469
|
+
], 8, _hoisted_1)
|
|
457
470
|
], 2);
|
|
458
471
|
};
|
|
459
472
|
}
|
|
@@ -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}},k={...m,...{items:{type:Array,default:()=>[]}}},y=b;const g=e.defineComponent({name:"VvAction",props:y,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 r.button}})),y=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};default:return{...e,type:l.type,disabled:l.disabled}}})),g=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(y),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:g,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(g,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:t={},...o},n)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:n,"data-index":n},o,e.toHandlers(t)),null,16,["data-index"])))),128))]))],8,h)],2))}})}));
|
|
@@ -1,21 +1,25 @@
|
|
|
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("../../types/nav").NavItem[]>;
|
|
6
4
|
default: () => never[];
|
|
7
5
|
};
|
|
8
6
|
modifiers: globalThis.PropType<string | string[]>;
|
|
9
7
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
8
|
items: {
|
|
11
|
-
type: globalThis.PropType<NavItem[]>;
|
|
12
|
-
required: boolean;
|
|
9
|
+
type: globalThis.PropType<import("../../types/nav").NavItem[]>;
|
|
13
10
|
default: () => never[];
|
|
14
11
|
};
|
|
15
12
|
modifiers: globalThis.PropType<string | string[]>;
|
|
16
13
|
}>> & {
|
|
17
14
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
18
15
|
}, {
|
|
19
|
-
items: NavItem[];
|
|
20
|
-
}, {}
|
|
16
|
+
items: import("../../types/nav").NavItem[];
|
|
17
|
+
}, {}>, {
|
|
18
|
+
default?(_: {}): any;
|
|
19
|
+
}>;
|
|
21
20
|
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -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("../../types/nav").NavItem[]>;
|
|
15
4
|
default: () => never[];
|
|
16
5
|
};
|
|
17
6
|
modifiers: globalThis.PropType<string | string[]>;
|