@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, createCommentVNode } 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,25 +245,40 @@ 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
|
};
|
|
251
|
-
const
|
|
252
|
-
const VvNavProps = {
|
|
263
|
+
const VvTabProps = {
|
|
253
264
|
...ModifiersProps,
|
|
265
|
+
navModifiers: {
|
|
266
|
+
type: [String, Array]
|
|
267
|
+
},
|
|
268
|
+
modelValue: {
|
|
269
|
+
type: String,
|
|
270
|
+
default: ""
|
|
271
|
+
},
|
|
254
272
|
items: {
|
|
255
273
|
type: Array,
|
|
256
|
-
required: true,
|
|
257
274
|
default: () => []
|
|
258
275
|
}
|
|
259
276
|
};
|
|
277
|
+
const VvTabEvents = ["update:modelValue"];
|
|
278
|
+
const VvNavProps = {
|
|
279
|
+
...ModifiersProps,
|
|
280
|
+
...NavProps
|
|
281
|
+
};
|
|
260
282
|
const VvNavEvents = ["click"];
|
|
261
283
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
262
284
|
const VvActionProps = ActionProps;
|
|
@@ -269,11 +291,11 @@ function useInjectedDropdownTrigger() {
|
|
|
269
291
|
function useInjectedDropdownAction() {
|
|
270
292
|
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
271
293
|
}
|
|
272
|
-
const __default__ = {
|
|
294
|
+
const __default__$1 = {
|
|
273
295
|
name: "VvAction"
|
|
274
296
|
};
|
|
275
|
-
const _sfc_main$
|
|
276
|
-
...__default__,
|
|
297
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
298
|
+
...__default__$1,
|
|
277
299
|
props: VvActionProps,
|
|
278
300
|
emits: VvActionEvents,
|
|
279
301
|
setup(__props, { expose: __expose, emit }) {
|
|
@@ -308,7 +330,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
308
330
|
case props.href !== void 0:
|
|
309
331
|
return ActionTag.a;
|
|
310
332
|
default:
|
|
311
|
-
return
|
|
333
|
+
return props.defaultTag;
|
|
312
334
|
}
|
|
313
335
|
});
|
|
314
336
|
const hasProps = computed(() => {
|
|
@@ -333,12 +355,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
333
355
|
to: props.to,
|
|
334
356
|
target: props.target
|
|
335
357
|
};
|
|
336
|
-
|
|
358
|
+
case ActionTag.button:
|
|
337
359
|
return {
|
|
338
360
|
...toReturn,
|
|
339
361
|
type: props.type,
|
|
340
362
|
disabled: props.disabled
|
|
341
363
|
};
|
|
364
|
+
default:
|
|
365
|
+
return toReturn;
|
|
342
366
|
}
|
|
343
367
|
});
|
|
344
368
|
const onClick = (e) => {
|
|
@@ -364,7 +388,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
364
388
|
class: {
|
|
365
389
|
active: _ctx.active,
|
|
366
390
|
pressed: unref(pressed),
|
|
367
|
-
disabled: _ctx.disabled
|
|
391
|
+
disabled: _ctx.disabled,
|
|
392
|
+
current: _ctx.current
|
|
368
393
|
},
|
|
369
394
|
onClickPassive: onClick,
|
|
370
395
|
onMouseoverPassive: onMouseover,
|
|
@@ -372,14 +397,49 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
372
397
|
}), {
|
|
373
398
|
default: withCtx(() => [
|
|
374
399
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
375
|
-
createTextVNode(
|
|
400
|
+
createTextVNode(
|
|
401
|
+
toDisplayString(_ctx.label),
|
|
402
|
+
1
|
|
403
|
+
/* TEXT */
|
|
404
|
+
)
|
|
376
405
|
])
|
|
377
406
|
]),
|
|
378
407
|
_: 3
|
|
408
|
+
/* FORWARDED */
|
|
379
409
|
}, 16, ["class"]);
|
|
380
410
|
};
|
|
381
411
|
}
|
|
382
412
|
});
|
|
413
|
+
const _hoisted_1$1 = {
|
|
414
|
+
class: "vv-nav__item",
|
|
415
|
+
role: "presentation"
|
|
416
|
+
};
|
|
417
|
+
const __default__ = {
|
|
418
|
+
name: "VvNavItem",
|
|
419
|
+
inheritAttrs: false
|
|
420
|
+
};
|
|
421
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
422
|
+
...__default__,
|
|
423
|
+
setup(__props) {
|
|
424
|
+
return (_ctx, _cache) => {
|
|
425
|
+
return openBlock(), createElementBlock("li", _hoisted_1$1, [
|
|
426
|
+
createVNode(
|
|
427
|
+
_sfc_main$3,
|
|
428
|
+
mergeProps(_ctx.$attrs, { class: "vv-nav__item-label" }),
|
|
429
|
+
{
|
|
430
|
+
default: withCtx(() => [
|
|
431
|
+
renderSlot(_ctx.$slots, "default")
|
|
432
|
+
]),
|
|
433
|
+
_: 3
|
|
434
|
+
/* FORWARDED */
|
|
435
|
+
},
|
|
436
|
+
16
|
|
437
|
+
/* FULL_PROPS */
|
|
438
|
+
)
|
|
439
|
+
]);
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
});
|
|
383
443
|
function useModifiers(prefix, modifiers, others) {
|
|
384
444
|
return computed(() => {
|
|
385
445
|
const toReturn = {
|
|
@@ -403,71 +463,68 @@ function useModifiers(prefix, modifiers, others) {
|
|
|
403
463
|
return toReturn;
|
|
404
464
|
});
|
|
405
465
|
}
|
|
406
|
-
const _hoisted_1
|
|
407
|
-
class: "vv-nav__menu",
|
|
408
|
-
role: "menu",
|
|
409
|
-
"aria-busy": "true"
|
|
410
|
-
};
|
|
466
|
+
const _hoisted_1 = ["onClick"];
|
|
411
467
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
412
468
|
__name: "VvNav",
|
|
413
469
|
props: VvNavProps,
|
|
414
470
|
emits: VvNavEvents,
|
|
415
471
|
setup(__props, { emit }) {
|
|
416
472
|
const props = __props;
|
|
417
|
-
const { modifiers
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
});
|
|
428
|
-
function onClick(item) {
|
|
429
|
-
if (!item.disabled) {
|
|
473
|
+
const { modifiers } = toRefs(props);
|
|
474
|
+
const onClick = (event) => {
|
|
475
|
+
var _a;
|
|
476
|
+
const target = event.target;
|
|
477
|
+
if (target == null ? void 0 : target.dataset.index) {
|
|
478
|
+
const index = parseInt(target.dataset.index);
|
|
479
|
+
const item = (_a = props.items) == null ? void 0 : _a[index];
|
|
480
|
+
if (!item || (item == null ? void 0 : item.disabled)) {
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
430
483
|
emit("click", item);
|
|
431
|
-
activeItem.value = item.id;
|
|
432
484
|
}
|
|
433
|
-
}
|
|
485
|
+
};
|
|
486
|
+
const bemCssClasses = useModifiers("vv-nav", modifiers);
|
|
434
487
|
return (_ctx, _cache) => {
|
|
435
|
-
return openBlock(), createElementBlock(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
488
|
+
return openBlock(), createElementBlock(
|
|
489
|
+
"nav",
|
|
490
|
+
{
|
|
491
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
492
|
+
},
|
|
493
|
+
[
|
|
494
|
+
createElementVNode("ul", {
|
|
495
|
+
class: "vv-nav__menu",
|
|
496
|
+
role: "menu",
|
|
497
|
+
"aria-busy": "true",
|
|
498
|
+
onClick: withModifiers(onClick, ["stop"])
|
|
499
|
+
}, [
|
|
500
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
501
|
+
(openBlock(true), createElementBlock(
|
|
502
|
+
Fragment,
|
|
503
|
+
null,
|
|
504
|
+
renderList(_ctx.items, ({ on = {}, ...item }, index) => {
|
|
505
|
+
return openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
506
|
+
key: index,
|
|
507
|
+
"data-index": index
|
|
508
|
+
}, item, toHandlers(on)), {
|
|
509
|
+
default: withCtx(() => [
|
|
510
|
+
renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps({ item, index })))
|
|
511
|
+
]),
|
|
512
|
+
_: 2
|
|
513
|
+
/* DYNAMIC */
|
|
514
|
+
}, 1040, ["data-index"]);
|
|
515
|
+
}),
|
|
516
|
+
128
|
|
517
|
+
/* KEYED_FRAGMENT */
|
|
518
|
+
))
|
|
519
|
+
])
|
|
520
|
+
], 8, _hoisted_1)
|
|
521
|
+
],
|
|
522
|
+
2
|
|
523
|
+
/* CLASS */
|
|
524
|
+
);
|
|
467
525
|
};
|
|
468
526
|
}
|
|
469
527
|
});
|
|
470
|
-
const _hoisted_1 = ["id"];
|
|
471
528
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
472
529
|
__name: "VvTab",
|
|
473
530
|
props: VvTabProps,
|
|
@@ -475,41 +532,99 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
475
532
|
setup(__props, { emit }) {
|
|
476
533
|
const props = __props;
|
|
477
534
|
const { modifiers, items } = toRefs(props);
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
};
|
|
486
|
-
});
|
|
535
|
+
const tabKeys = computed(() => {
|
|
536
|
+
return items.value.reduce((acc, item) => {
|
|
537
|
+
if (item.tab) {
|
|
538
|
+
acc.push(item.tab);
|
|
539
|
+
}
|
|
540
|
+
return acc;
|
|
541
|
+
}, []);
|
|
487
542
|
});
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
543
|
+
const localModelValue = ref();
|
|
544
|
+
const activeTabKey = computed({
|
|
545
|
+
get: () => {
|
|
546
|
+
var _a;
|
|
547
|
+
return props.modelValue || localModelValue.value || ((_a = tabKeys.value) == null ? void 0 : _a[0]);
|
|
548
|
+
},
|
|
549
|
+
set: (newValue) => {
|
|
550
|
+
localModelValue.value = newValue;
|
|
551
|
+
emit("update:modelValue", newValue);
|
|
492
552
|
}
|
|
493
|
-
}
|
|
553
|
+
});
|
|
554
|
+
const hasNavModifiers = computed(() => {
|
|
555
|
+
var _a;
|
|
556
|
+
return [
|
|
557
|
+
"tabs",
|
|
558
|
+
...Array.isArray(props.navModifiers) ? props.navModifiers : ((_a = props.navModifiers) == null ? void 0 : _a.split(" ")) ?? []
|
|
559
|
+
];
|
|
560
|
+
});
|
|
561
|
+
const onNavClick = (item) => {
|
|
562
|
+
if (item.tab) {
|
|
563
|
+
activeTabKey.value = item.tab;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
const navItems = computed(
|
|
567
|
+
() => props.items.map((item) => ({
|
|
568
|
+
current: item.tab === activeTabKey.value,
|
|
569
|
+
...item
|
|
570
|
+
}))
|
|
571
|
+
);
|
|
572
|
+
const bemCssClasses = useModifiers("vv-tab", modifiers);
|
|
494
573
|
return (_ctx, _cache) => {
|
|
495
|
-
return openBlock(), createElementBlock(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
574
|
+
return openBlock(), createElementBlock(
|
|
575
|
+
"div",
|
|
576
|
+
{
|
|
577
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
578
|
+
},
|
|
579
|
+
[
|
|
580
|
+
createVNode(
|
|
581
|
+
_sfc_main$1,
|
|
582
|
+
mergeProps({
|
|
583
|
+
items: unref(navItems),
|
|
584
|
+
modifiers: unref(hasNavModifiers)
|
|
585
|
+
}, { onClick: onNavClick }),
|
|
586
|
+
{
|
|
587
|
+
item: withCtx(({ item, index }) => [
|
|
588
|
+
renderSlot(_ctx.$slots, "nav-item", normalizeProps(guardReactiveProps({ item, index })))
|
|
589
|
+
]),
|
|
590
|
+
_: 3
|
|
591
|
+
/* FORWARDED */
|
|
592
|
+
},
|
|
593
|
+
16
|
|
594
|
+
/* FULL_PROPS */
|
|
595
|
+
),
|
|
596
|
+
(openBlock(true), createElementBlock(
|
|
597
|
+
Fragment,
|
|
598
|
+
null,
|
|
599
|
+
renderList(unref(items), (item, index) => {
|
|
600
|
+
return openBlock(), createElementBlock(
|
|
601
|
+
Fragment,
|
|
602
|
+
{ key: index },
|
|
603
|
+
[
|
|
604
|
+
item.tab ? (openBlock(), createElementBlock(
|
|
605
|
+
"article",
|
|
606
|
+
{
|
|
607
|
+
key: 0,
|
|
608
|
+
class: normalizeClass([{ target: unref(activeTabKey) === item.tab }, "vv-tab__panel"])
|
|
609
|
+
},
|
|
610
|
+
[
|
|
611
|
+
renderSlot(_ctx.$slots, `panel::${item.tab}`)
|
|
612
|
+
],
|
|
613
|
+
2
|
|
614
|
+
/* CLASS */
|
|
615
|
+
)) : createCommentVNode("v-if", true)
|
|
616
|
+
],
|
|
617
|
+
64
|
|
618
|
+
/* STABLE_FRAGMENT */
|
|
619
|
+
);
|
|
620
|
+
}),
|
|
621
|
+
128
|
|
622
|
+
/* KEYED_FRAGMENT */
|
|
623
|
+
))
|
|
624
|
+
],
|
|
625
|
+
2
|
|
626
|
+
/* CLASS */
|
|
627
|
+
);
|
|
513
628
|
};
|
|
514
629
|
}
|
|
515
630
|
});
|
|
@@ -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).VvTab=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).VvTab=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||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const l=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(a).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},m={current:Boolean},v={pressed:Boolean},p={label:[String,Number]},f={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...m,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}},k={items:{type:Array,default:()=>[]}},g={...f,navModifiers:{type:[String,Array]},modelValue:{type:String,default:""},items:{type:Array,default:()=>[]}},y={...f,...k},B=b;const _=e.defineComponent({name:"VvAction",props:B,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const a=t,u=e.inject(l),d=e.ref(null);o({$el:d});const{reference:c,bus:m,aria:v,expanded:p}=e.inject(i,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const f=e.computed((()=>a.pressed||(null==p?void 0:p.value))),{role:b}=e.inject(s,{}),k=e.computed((()=>{switch(!0){case a.disabled:return n.button;case void 0!==a.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==a.href:return n.a;default:return a.defaultTag}})),g=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!f.value||void 0,ariaLabel:a.ariaLabel,role:null==b?void 0:b.value};switch(k.value){case n.a:return{...e,href:a.href,target:a.target,rel:a.rel};case n.routerLink:case n.nuxtLink:return{...e,to:a.to,target:a.target};case n.button:return{...e,type:a.type,disabled:a.disabled};default:return e}})),y=e=>{a.disabled?e.preventDefault():(null==m||m.emit("click",e),r("click",e))},B=e=>{null==m||m.emit("mouseover",e),r("mouseover",e)},_=e=>{null==m||m.emit("mouseleave",e),r("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(f),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"]))}}),h={class:"vv-nav__item",role:"presentation"},x=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",h,[e.createVNode(_,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});function S(t,o,r){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}const C=["onClick"],V=e.defineComponent({__name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),a=e=>{var t;const n=e.target;if(null==n?void 0:n.dataset.index){const e=parseInt(n.dataset.index),a=null==(t=r.items)?void 0:t[e];if(!a||(null==a?void 0:a.disabled))return;o("click",a)}},l=S("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(l))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(a,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},...r},n)=>(e.openBlock(),e.createBlock(x,e.mergeProps({key:n,"data-index":n},r,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:r,index:n})))])),_:2},1040,["data-index"])))),128))]))],8,C)],2))}});return e.defineComponent({__name:"VvTab",props:g,emits:["update:modelValue"],setup(t,{emit:o}){const r=t,{modifiers:n,items:a}=e.toRefs(r),l=e.computed((()=>a.value.reduce(((e,t)=>(t.tab&&e.push(t.tab),e)),[]))),i=e.ref(),s=e.computed({get:()=>{var e;return r.modelValue||i.value||(null==(e=l.value)?void 0:e[0])},set:e=>{i.value=e,o("update:modelValue",e)}}),u=e.computed((()=>{var e;return["tabs",...Array.isArray(r.navModifiers)?r.navModifiers:(null==(e=r.navModifiers)?void 0:e.split(" "))??[]]})),d=e=>{e.tab&&(s.value=e.tab)},c=e.computed((()=>r.items.map((e=>({current:e.tab===s.value,...e}))))),m=S("vv-tab",n);return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m))},[e.createVNode(V,e.mergeProps({items:e.unref(c),modifiers:e.unref(u)},{onClick:d}),{item:e.withCtx((({item:o,index:r})=>[e.renderSlot(t.$slots,"nav-item",e.normalizeProps(e.guardReactiveProps({item:o,index:r})))])),_:3},16),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),((o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[o.tab?(e.openBlock(),e.createElementBlock("article",{key:0,class:e.normalizeClass([{target:e.unref(s)===o.tab},"vv-tab__panel"])},[e.renderSlot(t.$slots,`panel::${o.tab}`)],2)):e.createCommentVNode("v-if",!0)],64)))),128))],2))}})}));
|
|
@@ -1,23 +1,52 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NavItemTab } from '@/types/nav';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
navModifiers: {
|
|
4
|
+
type: globalThis.PropType<string | string[]>;
|
|
5
|
+
};
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
3
10
|
items: {
|
|
4
|
-
type: globalThis.PropType<
|
|
5
|
-
required: boolean;
|
|
11
|
+
type: globalThis.PropType<NavItemTab[]>;
|
|
6
12
|
default: () => never[];
|
|
7
13
|
};
|
|
8
14
|
modifiers: globalThis.PropType<string | string[]>;
|
|
9
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
15
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
[x: string]: (...args: any[]) => void;
|
|
17
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
navModifiers: {
|
|
19
|
+
type: globalThis.PropType<string | string[]>;
|
|
20
|
+
};
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
10
25
|
items: {
|
|
11
|
-
type: globalThis.PropType<
|
|
12
|
-
required: boolean;
|
|
26
|
+
type: globalThis.PropType<NavItemTab[]>;
|
|
13
27
|
default: () => never[];
|
|
14
28
|
};
|
|
15
29
|
modifiers: globalThis.PropType<string | string[]>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
}>>, {
|
|
31
|
+
modelValue: string;
|
|
32
|
+
items: NavItemTab[];
|
|
33
|
+
}, {}>, Partial<Record<string, (_: {}) => any>> & {
|
|
34
|
+
"nav-item"?(_: {
|
|
35
|
+
item: {
|
|
36
|
+
label: string;
|
|
37
|
+
ariaLabel?: string | undefined;
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
to?: string | Record<string, unknown> | undefined;
|
|
40
|
+
href?: string | undefined;
|
|
41
|
+
target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
|
|
42
|
+
rel?: string | undefined;
|
|
43
|
+
disabled?: boolean | undefined;
|
|
44
|
+
current?: boolean | undefined;
|
|
45
|
+
class?: string | string[] | undefined;
|
|
46
|
+
};
|
|
47
|
+
index: number;
|
|
48
|
+
}): any;
|
|
49
|
+
}>;
|
|
21
50
|
export default _default;
|
|
22
51
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
52
|
new (): {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NavItemTab } from '@/types/nav';
|
|
2
2
|
export declare const VvTabProps: {
|
|
3
|
+
navModifiers: {
|
|
4
|
+
type: globalThis.PropType<string | string[]>;
|
|
5
|
+
};
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
3
10
|
items: {
|
|
4
|
-
type: globalThis.PropType<
|
|
5
|
-
required: boolean;
|
|
11
|
+
type: globalThis.PropType<NavItemTab[]>;
|
|
6
12
|
default: () => never[];
|
|
7
13
|
};
|
|
8
14
|
modifiers: globalThis.PropType<string | string[]>;
|