@volverjs/ui-vue 0.0.6-beta.3 → 0.0.6-beta.5

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.
Files changed (73) hide show
  1. package/README.md +1 -0
  2. package/dist/components/VvAccordion/VvAccordion.es.js +18 -1
  3. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  5. package/dist/components/VvAccordion/index.d.ts +2 -2
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +22 -2
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +6 -58
  9. package/dist/components/VvAccordionGroup/index.d.ts +3 -29
  10. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -28
  11. package/dist/components/VvAvatarGroup/index.d.ts +1 -14
  12. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -28
  13. package/dist/components/VvBreadcrumb/index.d.ts +1 -14
  14. package/dist/components/VvButton/VvButton.es.js +51 -20
  15. package/dist/components/VvButton/VvButton.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.vue.d.ts +27 -2
  17. package/dist/components/VvButton/index.d.ts +25 -2
  18. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +10 -4
  19. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  20. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +7 -59
  21. package/dist/components/VvButtonGroup/index.d.ts +3 -29
  22. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  23. package/dist/components/VvCard/index.d.ts +1 -1
  24. package/dist/components/VvCombobox/VvCombobox.es.js +1 -1
  25. package/dist/components/VvDialog/VvDialog.es.js +1 -1
  26. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  27. package/dist/components/VvIcon/index.d.ts +1 -1
  28. package/dist/components/VvInputText/VvInputText.es.js +1 -1
  29. package/dist/components/VvNav/VvNav.es.js +15 -7
  30. package/dist/components/VvNav/VvNav.umd.js +1 -1
  31. package/dist/components/VvNav/VvNav.vue.d.ts +2 -28
  32. package/dist/components/VvNav/index.d.ts +2 -14
  33. package/dist/components/VvSelect/VvSelect.es.js +1 -1
  34. package/dist/components/VvTab/VvTab.es.js +505 -0
  35. package/dist/components/VvTab/VvTab.umd.js +1 -0
  36. package/dist/components/VvTab/VvTab.vue.d.ts +26 -0
  37. package/dist/components/VvTab/index.d.ts +10 -0
  38. package/dist/components/VvTextarea/VvTextarea.es.js +1 -1
  39. package/dist/components/index.es.js +83 -26
  40. package/dist/components/index.umd.js +1 -1
  41. package/dist/icons.es.js +3 -3
  42. package/dist/icons.umd.js +1 -1
  43. package/dist/stories/Button/Button.settings.d.ts +25 -0
  44. package/dist/stories/Tab/Tab.settings.d.ts +37 -0
  45. package/dist/stories/Tab/Tab.test.d.ts +2 -0
  46. package/package.json +12 -4
  47. package/src/assets/icons/detailed.json +1 -1
  48. package/src/assets/icons/normal.json +1 -1
  49. package/src/assets/icons/simple.json +1 -1
  50. package/src/components/VvAccordion/index.ts +21 -4
  51. package/src/components/VvAccordionGroup/index.ts +6 -3
  52. package/src/components/VvAvatarGroup/index.ts +2 -2
  53. package/src/components/VvBreadcrumb/index.ts +1 -1
  54. package/src/components/VvButton/VvButton.vue +9 -6
  55. package/src/components/VvButton/index.ts +44 -21
  56. package/src/components/VvButtonGroup/VvButtonGroup.vue +2 -2
  57. package/src/components/VvButtonGroup/index.ts +14 -2
  58. package/src/components/VvCard/index.ts +1 -1
  59. package/src/components/VvCombobox/index.ts +2 -2
  60. package/src/components/VvIcon/index.ts +1 -1
  61. package/src/components/VvNav/VvNav.vue +18 -8
  62. package/src/components/VvNav/index.ts +2 -1
  63. package/src/components/VvTab/VvTab.vue +53 -0
  64. package/src/components/VvTab/index.ts +13 -0
  65. package/src/components/common/HintSlot.ts +3 -3
  66. package/src/props/index.ts +2 -2
  67. package/src/stories/Button/Button.settings.ts +21 -0
  68. package/src/stories/Button/Button.stories.mdx +3 -3
  69. package/src/stories/Button/ButtonToggle.stories.mdx +62 -0
  70. package/src/stories/Tab/Tab.settings.ts +41 -0
  71. package/src/stories/Tab/Tab.stories.mdx +65 -0
  72. package/src/stories/Tab/Tab.test.ts +37 -0
  73. package/src/types/group.d.ts +5 -3
@@ -14,7 +14,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
14
14
  type: BooleanConstructor;
15
15
  default: boolean;
16
16
  };
17
- modelValue: StringConstructor;
17
+ value: {
18
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
19
+ default: undefined;
20
+ };
21
+ uncheckedValue: {
22
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
23
+ default: undefined;
24
+ };
25
+ modelValue: {
26
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
27
+ default: undefined;
28
+ };
18
29
  loading: BooleanConstructor;
19
30
  loadingLabel: {
20
31
  type: StringConstructor;
@@ -64,7 +75,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
64
75
  type: BooleanConstructor;
65
76
  default: boolean;
66
77
  };
67
- modelValue: StringConstructor;
78
+ value: {
79
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
80
+ default: undefined;
81
+ };
82
+ uncheckedValue: {
83
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
84
+ default: undefined;
85
+ };
86
+ modelValue: {
87
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
88
+ default: undefined;
89
+ };
68
90
  loading: BooleanConstructor;
69
91
  loadingLabel: {
70
92
  type: StringConstructor;
@@ -100,14 +122,17 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
100
122
  }>> & {
101
123
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
102
124
  }, {
125
+ modelValue: string | number | boolean;
103
126
  disabled: boolean;
104
127
  type: "button" | "submit" | "reset";
128
+ value: string | number | boolean;
105
129
  rel: string;
106
130
  active: boolean;
107
131
  pressed: boolean;
108
132
  iconPosition: "left" | "right" | "top" | "bottom";
109
133
  loadingIcon: string;
110
134
  toggle: boolean;
135
+ uncheckedValue: string | number | boolean;
111
136
  loading: boolean;
112
137
  loadingLabel: string;
113
138
  unselectable: boolean;
@@ -22,11 +22,34 @@ export declare const VvButtonProps: {
22
22
  type: StringConstructor;
23
23
  default: string;
24
24
  };
25
+ /**
26
+ * Enable button toggle
27
+ */
25
28
  toggle: {
26
29
  type: BooleanConstructor;
27
30
  default: boolean;
28
31
  };
29
- modelValue: StringConstructor;
32
+ /**
33
+ * Button toggle value
34
+ */
35
+ value: {
36
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
37
+ default: undefined;
38
+ };
39
+ /**
40
+ * Value associated with the unchecked state
41
+ */
42
+ uncheckedValue: {
43
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
44
+ default: undefined;
45
+ };
46
+ /**
47
+ * Button toggle model value
48
+ */
49
+ modelValue: {
50
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
51
+ default: undefined;
52
+ };
30
53
  loading: BooleanConstructor;
31
54
  loadingLabel: {
32
55
  type: StringConstructor;
@@ -67,7 +90,7 @@ export type VvButtonPropsTypes = ExtractPropTypes<typeof VvButtonProps>;
67
90
  export declare function useGroupProps(props: VvButtonPropsTypes, emit: (event: (typeof VvButtonEvents)[number], value: unknown) => void): {
68
91
  group: Ref<ButtonGroupState> | undefined;
69
92
  isInGroup: globalThis.ComputedRef<boolean>;
70
- modelValue: Ref<string | string[] | undefined>;
93
+ modelValue: Ref<string | number | boolean | (string | number | boolean)[] | undefined>;
71
94
  toggle: Ref<boolean>;
72
95
  unselectable: Ref<boolean>;
73
96
  multiple: globalThis.ComputedRef<boolean>;
@@ -232,10 +232,16 @@ const VvButtonGroupProps = {
232
232
  /**
233
233
  * String or String[] of css classes (modifiers) that will be provided to each button'
234
234
  */
235
- itemModifiers: { type: [String, Array], default: void 0 },
235
+ itemModifiers: {
236
+ type: [String, Array],
237
+ default: ""
238
+ },
236
239
  toggle: { type: Boolean, default: false },
237
240
  multiple: { type: Boolean, default: false },
238
- modelValue: { type: [String, Array], default: void 0 }
241
+ modelValue: {
242
+ type: [String, Number, Boolean, Array],
243
+ default: void 0
244
+ }
239
245
  };
240
246
  const VvButtonGroupEvents = ["update:modelValue"];
241
247
  function useProvideGroupState(groupState) {
@@ -304,7 +310,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
304
310
  },
305
311
  set: (newValue) => {
306
312
  if (newValue !== void 0 && (Array.isArray(props.modelValue) || multiple.value) && !Array.isArray(newValue)) {
307
- newValue = [newValue];
313
+ return emit("update:modelValue", [newValue]);
308
314
  }
309
315
  return emit("update:modelValue", newValue);
310
316
  }
@@ -316,7 +322,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
316
322
  toggle,
317
323
  multiple,
318
324
  unselectable,
319
- itemModifiers
325
+ modifiers: itemModifiers
320
326
  });
321
327
  const bemCssClasses = useModifiers("vv-button-group", modifiers);
322
328
  return (_ctx, _cache) => {
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{});const r=Symbol.for("buttonGroup"),u={disabled:Boolean},a=(Boolean,Boolean,{modifiers:[String,Array]});t.before;const n={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button;const i={...a,...u,...n,itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:i,emits:["update:modelValue"],setup(o,{emit:t}){const l=o,{disabled:u,toggle:a,modifiers:n,multiple:i,unselectable:s,itemModifiers:d}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const f=e.computed({get:()=>i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue,set:e=>(void 0===e||!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)||(e=[e]),t("update:modelValue",e))});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:r,modelValue:f,disabled:u,toggle:a,multiple:i,unselectable:s,itemModifiers:d});const m=function(o,t,l){return e.computed((()=>{const r={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((t=>{r[`${o}--${t}`]=e.unref(l.value[t])})),r}))}("vv-button-group",n);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)),role:"group"},[e.renderSlot(o.$slots,"default")],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{});const r=Symbol.for("buttonGroup"),u={disabled:Boolean},a=(Boolean,Boolean,{modifiers:[String,Array]});t.before;const n={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button;const i={...a,...u,...n,itemModifiers:{type:[String,Array],default:""},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:i,emits:["update:modelValue"],setup(o,{emit:t}){const l=o,{disabled:u,toggle:a,modifiers:n,multiple:i,unselectable:s,itemModifiers:d}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const f=e.computed({get:()=>i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue,set:e=>void 0===e||!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)?t("update:modelValue",e):t("update:modelValue",[e])});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:r,modelValue:f,disabled:u,toggle:a,multiple:i,unselectable:s,modifiers:d});const m=function(o,t,l){return e.computed((()=>{const r={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((t=>{r[`${o}--${t}`]=e.unref(l.value[t])})),r}))}("vv-button-group",n);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)),role:"group"},[e.renderSlot(o.$slots,"default")],2))}})}));
@@ -1,20 +1,7 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  itemModifiers: {
3
- type: (StringConstructor | {
4
- (arrayLength: number): string[];
5
- (...items: string[]): string[];
6
- new (arrayLength: number): string[];
7
- new (...items: string[]): string[];
8
- isArray(arg: any): arg is any[];
9
- readonly prototype: any[];
10
- from<T>(arrayLike: ArrayLike<T>): T[];
11
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
12
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
13
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
14
- of<T_4>(...items: T_4[]): T_4[];
15
- readonly [Symbol.species]: ArrayConstructor;
16
- })[];
17
- default: undefined;
3
+ type: globalThis.PropType<string | string[]>;
4
+ default: string;
18
5
  };
19
6
  toggle: {
20
7
  type: BooleanConstructor;
@@ -25,20 +12,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
25
12
  default: boolean;
26
13
  };
27
14
  modelValue: {
28
- type: (StringConstructor | {
29
- (arrayLength: number): string[];
30
- (...items: string[]): string[];
31
- new (arrayLength: number): string[];
32
- new (...items: string[]): string[];
33
- isArray(arg: any): arg is any[];
34
- readonly prototype: any[];
35
- from<T>(arrayLike: ArrayLike<T>): T[];
36
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
37
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
38
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
39
- of<T_4>(...items: T_4[]): T_4[];
40
- readonly [Symbol.species]: ArrayConstructor;
41
- })[];
15
+ type: globalThis.PropType<string | number | boolean | (string | number | boolean)[] | undefined>;
42
16
  default: undefined;
43
17
  };
44
18
  unselectable: {
@@ -49,21 +23,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
49
23
  modifiers: globalThis.PropType<string | string[]>;
50
24
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
51
25
  itemModifiers: {
52
- type: (StringConstructor | {
53
- (arrayLength: number): string[];
54
- (...items: string[]): string[];
55
- new (arrayLength: number): string[];
56
- new (...items: string[]): string[];
57
- isArray(arg: any): arg is any[];
58
- readonly prototype: any[];
59
- from<T>(arrayLike: ArrayLike<T>): T[];
60
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
61
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
62
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
63
- of<T_4>(...items: T_4[]): T_4[];
64
- readonly [Symbol.species]: ArrayConstructor;
65
- })[];
66
- default: undefined;
26
+ type: globalThis.PropType<string | string[]>;
27
+ default: string;
67
28
  };
68
29
  toggle: {
69
30
  type: BooleanConstructor;
@@ -74,20 +35,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
74
35
  default: boolean;
75
36
  };
76
37
  modelValue: {
77
- type: (StringConstructor | {
78
- (arrayLength: number): string[];
79
- (...items: string[]): string[];
80
- new (arrayLength: number): string[];
81
- new (...items: string[]): string[];
82
- isArray(arg: any): arg is any[];
83
- readonly prototype: any[];
84
- from<T>(arrayLike: ArrayLike<T>): T[];
85
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
86
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
87
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
88
- of<T_4>(...items: T_4[]): T_4[];
89
- readonly [Symbol.species]: ArrayConstructor;
90
- })[];
38
+ type: globalThis.PropType<string | number | boolean | (string | number | boolean)[] | undefined>;
91
39
  default: undefined;
92
40
  };
93
41
  unselectable: {
@@ -99,7 +47,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
99
47
  }>> & {
100
48
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
101
49
  }, {
102
- modelValue: string | string[];
50
+ modelValue: string | number | boolean | (string | number | boolean)[] | undefined;
103
51
  disabled: boolean;
104
52
  itemModifiers: string | string[];
105
53
  toggle: boolean;
@@ -3,21 +3,8 @@ export declare const VvButtonGroupProps: {
3
3
  * String or String[] of css classes (modifiers) that will be provided to each button'
4
4
  */
5
5
  itemModifiers: {
6
- type: (StringConstructor | {
7
- (arrayLength: number): string[];
8
- (...items: string[]): string[];
9
- new (arrayLength: number): string[];
10
- new (...items: string[]): string[];
11
- isArray(arg: any): arg is any[];
12
- readonly prototype: any[];
13
- from<T>(arrayLike: ArrayLike<T>): T[];
14
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
15
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
16
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
17
- of<T_4>(...items: T_4[]): T_4[];
18
- readonly [Symbol.species]: ArrayConstructor;
19
- })[];
20
- default: undefined;
6
+ type: globalThis.PropType<string | string[]>;
7
+ default: string;
21
8
  };
22
9
  toggle: {
23
10
  type: BooleanConstructor;
@@ -28,20 +15,7 @@ export declare const VvButtonGroupProps: {
28
15
  default: boolean;
29
16
  };
30
17
  modelValue: {
31
- type: (StringConstructor | {
32
- (arrayLength: number): string[];
33
- (...items: string[]): string[];
34
- new (arrayLength: number): string[];
35
- new (...items: string[]): string[];
36
- isArray(arg: any): arg is any[];
37
- readonly prototype: any[];
38
- from<T>(arrayLike: ArrayLike<T>): T[];
39
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
40
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
41
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
42
- of<T_4>(...items: T_4[]): T_4[];
43
- readonly [Symbol.species]: ArrayConstructor;
44
- })[];
18
+ type: globalThis.PropType<string | number | boolean | (string | number | boolean)[] | undefined>;
45
19
  default: undefined;
46
20
  };
47
21
  unselectable: {
@@ -1,9 +1,9 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  title: StringConstructor;
3
- modifiers: (StringConstructor | ArrayConstructor)[];
3
+ modifiers: globalThis.PropType<string | string[]>;
4
4
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
5
5
  title: StringConstructor;
6
- modifiers: (StringConstructor | ArrayConstructor)[];
6
+ modifiers: globalThis.PropType<string | string[]>;
7
7
  }>>, {}>, {
8
8
  header: (_: {}) => any;
9
9
  default: (_: {}) => any;
@@ -1,4 +1,4 @@
1
1
  export declare const VvCardProps: {
2
2
  title: StringConstructor;
3
- modifiers: (StringConstructor | ArrayConstructor)[];
3
+ modifiers: globalThis.PropType<string | string[]>;
4
4
  };
@@ -573,7 +573,7 @@ const VvIconProps = {
573
573
  svg: String,
574
574
  /**
575
575
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
576
- * @values string | Array<string>
576
+ * @values string | string[]
577
577
  */
578
578
  modifiers: {
579
579
  type: [String, Array]
@@ -89,7 +89,7 @@ const VvIconProps = {
89
89
  svg: String,
90
90
  /**
91
91
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
92
- * @values string | Array<string>
92
+ * @values string | string[]
93
93
  */
94
94
  modifiers: {
95
95
  type: [String, Array]
@@ -88,7 +88,7 @@ const VvIconProps = {
88
88
  svg: String,
89
89
  /**
90
90
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
91
- * @values string | Array<string>
91
+ * @values string | string[]
92
92
  */
93
93
  modifiers: {
94
94
  type: [String, Array]
@@ -93,7 +93,7 @@ export declare const VvIconProps: {
93
93
  svg: StringConstructor;
94
94
  /**
95
95
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
96
- * @values string | Array<string>
96
+ * @values string | string[]
97
97
  */
98
98
  modifiers: {
99
99
  type: PropType<string | string[]>;
@@ -223,7 +223,7 @@ const VvIconProps = {
223
223
  svg: String,
224
224
  /**
225
225
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
226
- * @values string | Array<string>
226
+ * @values string | string[]
227
227
  */
228
228
  modifiers: {
229
229
  type: [String, Array]
@@ -392,13 +392,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
392
392
  emits: VvNavEvents,
393
393
  setup(__props, { emit }) {
394
394
  const props = __props;
395
- const { modifiers } = toRefs(props);
395
+ const { modifiers, items } = toRefs(props);
396
396
  const activeItem = ref(null);
397
397
  const bemCssClasses = useModifiers("vv-nav", modifiers);
398
- function onClick(item, id) {
398
+ const localItems = computed(() => {
399
+ return items.value.map((item, index) => {
400
+ return {
401
+ ...item,
402
+ id: item.id || `nav-item_${index}`
403
+ };
404
+ });
405
+ });
406
+ function onClick(item) {
399
407
  if (!item.disabled) {
400
408
  emit("click", item);
401
- activeItem.value = id;
409
+ activeItem.value = item.id;
402
410
  }
403
411
  }
404
412
  return (_ctx, _cache) => {
@@ -406,9 +414,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
406
414
  class: normalizeClass(unref(bemCssClasses))
407
415
  }, [
408
416
  createElementVNode("ul", _hoisted_1, [
409
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (navItem, index) => {
417
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(localItems), (navItem) => {
410
418
  return openBlock(), createElementBlock("li", {
411
- key: `nav-item_${index}`,
419
+ key: navItem.id,
412
420
  class: "vv-nav__item",
413
421
  role: "presentation"
414
422
  }, [
@@ -419,11 +427,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
419
427
  tabindex: 0
420
428
  }, {
421
429
  class: [{
422
- current: unref(activeItem) == `nav-item_${index}`,
430
+ current: unref(activeItem) == navItem.id,
423
431
  disabled: navItem.disabled
424
432
  }, "vv-nav__item-label"]
425
433
  }, toHandlers(navItem.on || {}), {
426
- onClick: ($event) => onClick(navItem, `nav-item_${index}`)
434
+ onClick: ($event) => onClick(navItem)
427
435
  }), {
428
436
  default: withCtx(() => [
429
437
  createTextVNode(toDisplayString(navItem.title), 1)
@@ -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||{}),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"}},c={disabled:Boolean},d={active:Boolean},v={pressed:Boolean},f={label:[String,Number]},m={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const p={...c,...f,...v,...d,...u,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)}},b={...m,items:{type:Array,required:!0,default:()=>[]}},k=p;const y=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,u=e.inject(a),c=e.ref(null);o({$el:c});const{reference:d,bus:v,aria:f,expanded:m}=e.inject(i,{});e.watch((()=>c.value),(e=>{d&&(d.value=e)}));const p=e.computed((()=>l.pressed||(null==m?void 0:m.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,"aria-pressed":!!p.value||void 0,role:b};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))},_=e=>{null==v||v.emit("mouseover",e),n("mouseover",e)},B=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:c,class:{active:t.active,pressed:e.unref(p),disabled:t.disabled},onClickPassive:g,onMouseoverPassive:_,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const g={class:"vv-nav__menu",role:"menu","aria-busy":"true"};return e.defineComponent({__name:"VvNav",props:b,emits:["click"],setup(t,{emit:o}){const n=t,{modifiers:r}=e.toRefs(n),l=e.ref(null),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,n)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(a))},[e.createElementVNode("ul",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,((t,n)=>(e.openBlock(),e.createElementBlock("li",{key:`nav-item_${n}`,class:"vv-nav__item",role:"presentation"},[e.createVNode(y,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(l)==`nav-item_${n}`,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on||{}),{onClick:e=>{return a=`nav-item_${n}`,void((r=t).disabled||(o("click",r),l.value=a));var r,a}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}})}));
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||{}),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||{}),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={pressed:Boolean},f={label:[String,Number]},p={modifiers:[String,Array]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const m={...d,...f,...v,...c,...u,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)}},b={...p,items:{type:Array,required:!0,default:()=>[]}},k=m;const y=e.defineComponent({name:"VvAction",props:k,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){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 n.button;case void 0!==l.to:return(null==u?void 0:u.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return n.button}})),y=e.computed((()=>{const e={...null==f?void 0:f.value,"aria-pressed":!!m.value||void 0,role:b};switch(k.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.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),r("click",e))},_=e=>{null==v||v.emit("mouseover",e),r("mouseover",e)},B=e=>{null==v||v.emit("mouseleave",e),r("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},onClickPassive:g,onMouseoverPassive:_,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const g={class:"vv-nav__menu",role:"menu","aria-busy":"true"};return e.defineComponent({__name:"VvNav",props:b,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n,items:l}=e.toRefs(r),a=e.ref(null),i=function(t,o,r){return e.computed((()=>{const n={[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&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-nav",n),s=e.computed((()=>l.value.map(((e,t)=>({...e,id:e.id||`nav-item_${t}`})))));return(t,r)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createElementBlock("li",{key:t.id,class:"vv-nav__item",role:"presentation"},[e.createVNode(y,e.mergeProps({disabled:t.disabled,to:t.to,href:t.href,tabindex:0},{class:[{current:e.unref(a)==t.id,disabled:t.disabled},"vv-nav__item-label"]},e.toHandlers(t.on||{}),{onClick:e=>{var r;(r=t).disabled||(o("click",r),a.value=r.id)}}),{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1040,["class","onClick"])])))),128))])],2))}})}));
@@ -1,40 +1,14 @@
1
1
  import { type NavItem } from '@/components/VvNav';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  items: {
4
- type: {
5
- (arrayLength: number): NavItem[];
6
- (...items: NavItem[]): NavItem[];
7
- new (arrayLength: number): NavItem[];
8
- new (...items: NavItem[]): NavItem[];
9
- isArray(arg: any): arg is any[];
10
- readonly prototype: any[];
11
- from<T>(arrayLike: ArrayLike<T>): T[];
12
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
13
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
14
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
15
- of<T_4>(...items: T_4[]): T_4[];
16
- readonly [Symbol.species]: ArrayConstructor;
17
- };
4
+ type: globalThis.PropType<NavItem[]>;
18
5
  required: boolean;
19
6
  default: () => never[];
20
7
  };
21
8
  modifiers: globalThis.PropType<string | string[]>;
22
9
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
10
  items: {
24
- type: {
25
- (arrayLength: number): NavItem[];
26
- (...items: NavItem[]): NavItem[];
27
- new (arrayLength: number): NavItem[];
28
- new (...items: NavItem[]): NavItem[];
29
- isArray(arg: any): arg is any[];
30
- readonly prototype: any[];
31
- from<T>(arrayLike: ArrayLike<T>): T[];
32
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
33
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
34
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
35
- of<T_4>(...items: T_4[]): T_4[];
36
- readonly [Symbol.species]: ArrayConstructor;
37
- };
11
+ type: globalThis.PropType<NavItem[]>;
38
12
  required: boolean;
39
13
  default: () => never[];
40
14
  };
@@ -1,4 +1,5 @@
1
1
  export type NavItem = {
2
+ id?: string;
2
3
  title: string;
3
4
  to?: string | {
4
5
  [key: string]: unknown;
@@ -9,20 +10,7 @@ export type NavItem = {
9
10
  };
10
11
  export declare const VvNavProps: {
11
12
  items: {
12
- type: {
13
- (arrayLength: number): NavItem[];
14
- (...items: NavItem[]): NavItem[];
15
- new (arrayLength: number): NavItem[];
16
- new (...items: NavItem[]): NavItem[];
17
- isArray(arg: any): arg is any[];
18
- readonly prototype: any[];
19
- from<T>(arrayLike: ArrayLike<T>): T[];
20
- from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
21
- from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
22
- from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
23
- of<T_4>(...items: T_4[]): T_4[];
24
- readonly [Symbol.species]: ArrayConstructor;
25
- };
13
+ type: globalThis.PropType<NavItem[]>;
26
14
  required: boolean;
27
15
  default: () => never[];
28
16
  };
@@ -90,7 +90,7 @@ const VvIconProps = {
90
90
  svg: String,
91
91
  /**
92
92
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
93
- * @values string | Array<string>
93
+ * @values string | string[]
94
94
  */
95
95
  modifiers: {
96
96
  type: [String, Array]