@volverjs/ui-vue 0.0.11 → 0.0.13-beta.1

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 (98) hide show
  1. package/bin/icons.js +1 -93
  2. package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
  3. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +7 -2
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
  5. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -2
  6. package/dist/components/VvAction/VvAction.es.js +1 -302
  7. package/dist/components/VvAction/VvAction.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.vue.d.ts +3 -2
  9. package/dist/components/VvAlert/VvAlert.es.js +1 -527
  10. package/dist/components/VvAlert/VvAlert.vue.d.ts +3 -2
  11. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
  12. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
  13. package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
  14. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
  15. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +1 -131
  18. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  19. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
  20. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -2
  22. package/dist/components/VvButton/VvButton.es.js +1 -882
  23. package/dist/components/VvButton/VvButton.umd.js +1 -1
  24. package/dist/components/VvButton/VvButton.vue.d.ts +3 -2
  25. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
  26. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  27. package/dist/components/VvCard/VvCard.es.js +1 -152
  28. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  29. package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
  30. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
  32. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  33. package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
  34. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  35. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +16 -7
  36. package/dist/components/VvDialog/VvDialog.es.js +1 -317
  37. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -2
  38. package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
  39. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
  40. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
  42. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -4
  43. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
  47. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
  48. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  49. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
  50. package/dist/components/VvIcon/VvIcon.es.js +1 -143
  51. package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
  52. package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
  53. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  54. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +34 -4
  55. package/dist/components/VvInputFile/index.d.ts +7 -0
  56. package/dist/components/VvInputText/VvInputText.es.js +4 -2790
  57. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  58. package/dist/components/VvInputText/VvInputText.vue.d.ts +8 -3
  59. package/dist/components/VvNav/VvNav.es.js +1 -438
  60. package/dist/components/VvNav/VvNav.umd.js +1 -1
  61. package/dist/components/VvNav/VvNav.vue.d.ts +2 -2
  62. package/dist/components/VvNav/VvNavItem.vue.d.ts +2 -2
  63. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  64. package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
  65. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  66. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
  67. package/dist/components/VvProgress/VvProgress.es.js +1 -163
  68. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  69. package/dist/components/VvRadio/VvRadio.es.js +1 -661
  70. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  71. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
  72. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  73. package/dist/components/VvSelect/VvSelect.es.js +1 -1103
  74. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -7
  75. package/dist/components/VvTab/VvTab.es.js +1 -558
  76. package/dist/components/VvTab/VvTab.umd.js +1 -1
  77. package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
  78. package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
  79. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
  80. package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
  81. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
  82. package/dist/components/index.es.js +6 -8558
  83. package/dist/components/index.umd.js +1 -1
  84. package/dist/composables/index.es.js +2 -247
  85. package/dist/composables/index.umd.js +1 -1
  86. package/dist/directives/index.es.js +2 -311
  87. package/dist/directives/index.umd.js +1 -1
  88. package/dist/directives/v-contextmenu.es.js +2 -142
  89. package/dist/directives/v-contextmenu.umd.js +1 -1
  90. package/dist/directives/v-tooltip.es.js +1 -172
  91. package/dist/icons.es.js +1 -39
  92. package/dist/icons.umd.js +1 -1
  93. package/dist/index.es.js +1 -219
  94. package/dist/props/index.d.ts +7 -0
  95. package/dist/resolvers/unplugin.es.js +1 -187
  96. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
  97. package/dist/stories/Avatar/Avatar.settings.d.ts +1 -1
  98. package/package.json +47 -40
@@ -1,3 +1,5 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
1
3
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
2
4
  name: {
3
5
  type: StringConstructor;
@@ -76,11 +78,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
76
78
  reverse: boolean;
77
79
  modifiers: string | string[];
78
80
  items: import("../..").Alert[];
79
- transition: string;
80
81
  inline: "start" | "end" | "middle";
81
82
  stack: boolean;
82
83
  block: "top" | "bottom" | "center";
83
84
  position: "absolute" | "fixed";
85
+ transition: string;
84
86
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
85
87
  before?: (props: {}) => any;
86
88
  } & {
@@ -88,8 +90,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
88
90
  } & {
89
91
  after?: (props: {}) => any;
90
92
  }>;
91
- declare const _default: typeof __VLS_export;
92
- export default _default;
93
93
  type __VLS_WithSlots<T, S> = T & {
94
94
  new (): {
95
95
  $slots: S;
@@ -1,132 +1 @@
1
- import { computed, defineComponent, toRefs, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createCommentVNode } from "vue";
2
- var StorageType = /* @__PURE__ */ ((StorageType2) => {
3
- StorageType2["local"] = "local";
4
- StorageType2["session"] = "session";
5
- return StorageType2;
6
- })(StorageType || {});
7
- var Side = /* @__PURE__ */ ((Side2) => {
8
- Side2["left"] = "left";
9
- Side2["right"] = "right";
10
- Side2["top"] = "top";
11
- Side2["bottom"] = "bottom";
12
- return Side2;
13
- })(Side || {});
14
- var Position = /* @__PURE__ */ ((Position2) => {
15
- Position2["before"] = "before";
16
- Position2["after"] = "after";
17
- return Position2;
18
- })(Position || {});
19
- var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
20
- ButtonType2["button"] = "button";
21
- ButtonType2["submit"] = "submit";
22
- ButtonType2["reset"] = "reset";
23
- return ButtonType2;
24
- })(ButtonType || {});
25
- var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
26
- ActionTag2["nuxtLink"] = "nuxt-link";
27
- ActionTag2["routerLink"] = "router-link";
28
- ActionTag2["a"] = "a";
29
- ActionTag2["button"] = "button";
30
- return ActionTag2;
31
- })(ActionTag || {});
32
- const ModifiersProps = {
33
- /**
34
- * Component BEM modifiers
35
- */
36
- modifiers: {
37
- type: [String, Array],
38
- default: void 0
39
- }
40
- };
41
- ({
42
- /**
43
- * VvIcon position
44
- */
45
- iconPosition: {
46
- default: Position.before
47
- }
48
- });
49
- ({
50
- /**
51
- * Dropdown placement
52
- */
53
- placement: {
54
- default: Side.bottom
55
- }
56
- });
57
- ({
58
- /**
59
- * Button type
60
- */
61
- type: {
62
- default: ButtonType.button
63
- },
64
- /**
65
- * Default tag for the action
66
- */
67
- defaultTag: {
68
- default: ActionTag.button
69
- }
70
- });
71
- ({
72
- storageType: {
73
- default: StorageType.local
74
- }
75
- });
76
- const VvAvatarProps = {
77
- ...ModifiersProps,
78
- /**
79
- * Image src for avatar
80
- */
81
- imgSrc: String
82
- };
83
- function useModifiers(prefix, modifiers, others) {
84
- return computed(() => {
85
- const toReturn = {
86
- [prefix]: true
87
- };
88
- const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
89
- if (modifiersArray) {
90
- if (Array.isArray(modifiersArray)) {
91
- modifiersArray.forEach((modifier) => {
92
- if (modifier) {
93
- toReturn[`${prefix}--${modifier}`] = true;
94
- }
95
- });
96
- }
97
- }
98
- return toReturn;
99
- });
100
- }
101
- const _hoisted_1 = ["role", "aria-label"];
102
- const _hoisted_2 = ["src"];
103
- const __default__ = {
104
- name: "VvAvatar"
105
- };
106
- const _sfc_main = /* @__PURE__ */ defineComponent({
107
- ...__default__,
108
- props: VvAvatarProps,
109
- setup(__props) {
110
- const props = __props;
111
- const { modifiers } = toRefs(props);
112
- const bemCssClasses = useModifiers("vv-avatar", modifiers);
113
- return (_ctx, _cache) => {
114
- return openBlock(), createElementBlock("span", {
115
- class: normalizeClass(unref(bemCssClasses)),
116
- role: _ctx.imgSrc ? void 0 : "img",
117
- "aria-label": _ctx.imgSrc ? void 0 : "avatar"
118
- }, [
119
- renderSlot(_ctx.$slots, "default", {}, () => [
120
- _ctx.imgSrc ? (openBlock(), createElementBlock("img", {
121
- key: 0,
122
- src: _ctx.imgSrc,
123
- alt: "avatar"
124
- }, null, 8, _hoisted_2)) : createCommentVNode("v-if", true)
125
- ])
126
- ], 10, _hoisted_1);
127
- };
128
- }
129
- });
130
- export {
131
- _sfc_main as default
132
- };
1
+ import{computed as t,defineComponent as r,toRefs as o,createElementBlock as a,openBlock as e,normalizeClass as i,unref as n,renderSlot as s,createCommentVNode as l}from"vue";var u=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(u||{}),c=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(c||{}),f=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(f||{}),m=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(m||{}),b=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(b||{});const v={modifiers:{type:[String,Array],default:void 0}};f.before,c.bottom,m.button,b.button,u.local;const g={...v,imgSrc:String};const p=["role","aria-label"],d=["src"],S=/* @__PURE__ */r({name:"VvAvatar",props:g,setup(r){const u=r,{modifiers:c}=o(u),f=function(r,o){return t(()=>{const t={[r]:!0},a="string"==typeof o?.value?o.value.split(" "):o?.value;return a&&Array.isArray(a)&&a.forEach(o=>{o&&(t[`${r}--${o}`]=!0)}),t})}("vv-avatar",c);return(t,r)=>(e(),a("span",{class:i(n(f)),role:t.imgSrc?void 0:"img","aria-label":t.imgSrc?void 0:"avatar"},[s(t.$slots,"default",{},()=>[t.imgSrc?(e(),a("img",{key:0,src:t.imgSrc,alt:"avatar"},null,8,d)):l("v-if",!0)])],10,p))}});export{S as default};
@@ -1,3 +1,5 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
1
3
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
2
4
  imgSrc: StringConstructor;
3
5
  modifiers: {
@@ -15,8 +17,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
15
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
16
18
  default?: (props: {}) => any;
17
19
  }>;
18
- declare const _default: typeof __VLS_export;
19
- export default _default;
20
20
  type __VLS_WithSlots<T, S> = T & {
21
21
  new (): {
22
22
  $slots: S;
@@ -1,250 +1 @@
1
- import { computed, defineComponent, toRefs, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createCommentVNode, useId, createBlock, Fragment, renderList, mergeProps, withCtx, toDisplayString, createTextVNode } from "vue";
2
- var StorageType = /* @__PURE__ */ ((StorageType2) => {
3
- StorageType2["local"] = "local";
4
- StorageType2["session"] = "session";
5
- return StorageType2;
6
- })(StorageType || {});
7
- var Side = /* @__PURE__ */ ((Side2) => {
8
- Side2["left"] = "left";
9
- Side2["right"] = "right";
10
- Side2["top"] = "top";
11
- Side2["bottom"] = "bottom";
12
- return Side2;
13
- })(Side || {});
14
- var Position = /* @__PURE__ */ ((Position2) => {
15
- Position2["before"] = "before";
16
- Position2["after"] = "after";
17
- return Position2;
18
- })(Position || {});
19
- var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
20
- ButtonType2["button"] = "button";
21
- ButtonType2["submit"] = "submit";
22
- ButtonType2["reset"] = "reset";
23
- return ButtonType2;
24
- })(ButtonType || {});
25
- var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
26
- ActionTag2["nuxtLink"] = "nuxt-link";
27
- ActionTag2["routerLink"] = "router-link";
28
- ActionTag2["a"] = "a";
29
- ActionTag2["button"] = "button";
30
- return ActionTag2;
31
- })(ActionTag || {});
32
- const ModifiersProps = {
33
- /**
34
- * Component BEM modifiers
35
- */
36
- modifiers: {
37
- type: [String, Array],
38
- default: void 0
39
- }
40
- };
41
- ({
42
- /**
43
- * VvIcon position
44
- */
45
- iconPosition: {
46
- default: Position.before
47
- }
48
- });
49
- ({
50
- /**
51
- * Dropdown placement
52
- */
53
- placement: {
54
- default: Side.bottom
55
- }
56
- });
57
- ({
58
- /**
59
- * Button type
60
- */
61
- type: {
62
- default: ButtonType.button
63
- },
64
- /**
65
- * Default tag for the action
66
- */
67
- defaultTag: {
68
- default: ActionTag.button
69
- }
70
- });
71
- ({
72
- storageType: {
73
- default: StorageType.local
74
- }
75
- });
76
- const VvAvatarProps = {
77
- ...ModifiersProps,
78
- /**
79
- * Image src for avatar
80
- */
81
- imgSrc: String
82
- };
83
- function useModifiers(prefix, modifiers, others) {
84
- return computed(() => {
85
- const toReturn = {
86
- [prefix]: true
87
- };
88
- const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
89
- if (modifiersArray) {
90
- if (Array.isArray(modifiersArray)) {
91
- modifiersArray.forEach((modifier) => {
92
- if (modifier) {
93
- toReturn[`${prefix}--${modifier}`] = true;
94
- }
95
- });
96
- }
97
- }
98
- return toReturn;
99
- });
100
- }
101
- const _hoisted_1$1 = ["role", "aria-label"];
102
- const _hoisted_2 = ["src"];
103
- const __default__$1 = {
104
- name: "VvAvatar"
105
- };
106
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
107
- ...__default__$1,
108
- props: VvAvatarProps,
109
- setup(__props) {
110
- const props = __props;
111
- const { modifiers } = toRefs(props);
112
- const bemCssClasses = useModifiers("vv-avatar", modifiers);
113
- return (_ctx, _cache) => {
114
- return openBlock(), createElementBlock("span", {
115
- class: normalizeClass(unref(bemCssClasses)),
116
- role: _ctx.imgSrc ? void 0 : "img",
117
- "aria-label": _ctx.imgSrc ? void 0 : "avatar"
118
- }, [
119
- renderSlot(_ctx.$slots, "default", {}, () => [
120
- _ctx.imgSrc ? (openBlock(), createElementBlock("img", {
121
- key: 0,
122
- src: _ctx.imgSrc,
123
- alt: "avatar"
124
- }, null, 8, _hoisted_2)) : createCommentVNode("v-if", true)
125
- ])
126
- ], 10, _hoisted_1$1);
127
- };
128
- }
129
- });
130
- const VvAvatarGroupProps = {
131
- ...ModifiersProps,
132
- /**
133
- * avatar items
134
- */
135
- items: {
136
- type: Array,
137
- default: () => [],
138
- required: true
139
- },
140
- toShow: {
141
- type: Number,
142
- default: 3
143
- },
144
- totalItems: {
145
- type: Number
146
- },
147
- avatarModifiers: [String, Array]
148
- };
149
- function useUniqueId(id) {
150
- return computed(() => String(useId()));
151
- }
152
- const _hoisted_1 = { key: 0 };
153
- const __default__ = {
154
- name: "VvAvatarGroup"
155
- };
156
- const _sfc_main = /* @__PURE__ */ defineComponent({
157
- ...__default__,
158
- props: VvAvatarGroupProps,
159
- setup(__props) {
160
- const props = __props;
161
- const { modifiers, items, toShow, totalItems, avatarModifiers } = toRefs(props);
162
- const bemCssClasses = useModifiers("vv-avatar-group", modifiers);
163
- const stringModifiers = computed(() => {
164
- if (avatarModifiers?.value && Array.isArray(avatarModifiers?.value)) {
165
- return avatarModifiers.value.join(" ");
166
- }
167
- return avatarModifiers?.value || "";
168
- });
169
- const avatarItems = computed(() => {
170
- return items.value.slice(0, toShow.value).map((item) => {
171
- let modifiers2 = [];
172
- let itemModifiers = [];
173
- if (avatarModifiers?.value) {
174
- modifiers2 = Array.isArray(avatarModifiers?.value) ? avatarModifiers?.value : [avatarModifiers?.value];
175
- }
176
- if (item.modifiers) {
177
- itemModifiers = Array.isArray(item.modifiers) ? item.modifiers : [item.modifiers];
178
- }
179
- return {
180
- ...item,
181
- key: item.key || useUniqueId().value,
182
- modifiers: [...modifiers2, ...itemModifiers]
183
- };
184
- });
185
- });
186
- return (_ctx, _cache) => {
187
- return openBlock(), createElementBlock(
188
- "span",
189
- {
190
- class: normalizeClass(unref(bemCssClasses))
191
- },
192
- [
193
- renderSlot(_ctx.$slots, "default", {}, () => [
194
- (openBlock(true), createElementBlock(
195
- Fragment,
196
- null,
197
- renderList(unref(avatarItems), (avatarItem) => {
198
- return openBlock(), createBlock(
199
- _sfc_main$1,
200
- mergeProps({
201
- key: avatarItem.key
202
- }, { ref_for: true }, {
203
- modifiers: avatarItem.modifiers,
204
- imgSrc: avatarItem.imgSrc
205
- }),
206
- {
207
- default: withCtx(() => [
208
- avatarItem.text ? (openBlock(), createElementBlock(
209
- "span",
210
- _hoisted_1,
211
- toDisplayString(avatarItem.text),
212
- 1
213
- /* TEXT */
214
- )) : createCommentVNode("v-if", true)
215
- ]),
216
- _: 2
217
- /* DYNAMIC */
218
- },
219
- 1040
220
- /* FULL_PROPS, DYNAMIC_SLOTS */
221
- );
222
- }),
223
- 128
224
- /* KEYED_FRAGMENT */
225
- )),
226
- (unref(totalItems) || unref(items).length) > unref(toShow) ? (openBlock(), createBlock(_sfc_main$1, {
227
- key: 0,
228
- modifiers: `${unref(stringModifiers)} surface bordered`
229
- }, {
230
- default: withCtx(() => [
231
- createTextVNode(
232
- toDisplayString(`+${(unref(totalItems) || unref(items).length) - unref(toShow)}`),
233
- 1
234
- /* TEXT */
235
- )
236
- ]),
237
- _: 1
238
- /* STABLE */
239
- }, 8, ["modifiers"])) : createCommentVNode("v-if", true)
240
- ])
241
- ],
242
- 2
243
- /* CLASS */
244
- );
245
- };
246
- }
247
- });
248
- export {
249
- _sfc_main as default
250
- };
1
+ import{computed as r,defineComponent as e,toRefs as t,createElementBlock as a,openBlock as i,normalizeClass as o,unref as s,renderSlot as l,createCommentVNode as u,useId as n,createBlock as f,Fragment as m,renderList as v,mergeProps as d,withCtx as c,toDisplayString as y,createTextVNode as p}from"vue";var b=/* @__PURE__ */(r=>(r.local="local",r.session="session",r))(b||{}),g=/* @__PURE__ */(r=>(r.left="left",r.right="right",r.top="top",r.bottom="bottom",r))(g||{}),A=/* @__PURE__ */(r=>(r.before="before",r.after="after",r))(A||{}),S=/* @__PURE__ */(r=>(r.button="button",r.submit="submit",r.reset="reset",r))(S||{}),k=/* @__PURE__ */(r=>(r.nuxtLink="nuxt-link",r.routerLink="router-link",r.a="a",r.button="button",r))(k||{});const h={modifiers:{type:[String,Array],default:void 0}};A.before,g.bottom,S.button,k.button,b.local;const x={...h,imgSrc:String};function $(e,t,a){return r(()=>{const r={[e]:!0},a="string"==typeof t?.value?t.value.split(" "):t?.value;return a&&Array.isArray(a)&&a.forEach(t=>{t&&(r[`${e}--${t}`]=!0)}),r})}const _=["role","aria-label"],w=["src"],I=/* @__PURE__ */e({name:"VvAvatar",props:x,setup(r){const e=r,{modifiers:n}=t(e),f=$("vv-avatar",n);return(r,e)=>(i(),a("span",{class:o(s(f)),role:r.imgSrc?void 0:"img","aria-label":r.imgSrc?void 0:"avatar"},[l(r.$slots,"default",{},()=>[r.imgSrc?(i(),a("img",{key:0,src:r.imgSrc,alt:"avatar"},null,8,w)):u("v-if",!0)])],10,_))}}),L={...h,items:{type:Array,default:()=>[],required:!0},toShow:{type:Number,default:3},totalItems:{type:Number},avatarModifiers:[String,Array]};const M={key:0},N=/* @__PURE__ */e({name:"VvAvatarGroup",props:L,setup(e){const b=e,{modifiers:g,items:A,toShow:S,totalItems:k,avatarModifiers:h}=t(b),x=$("vv-avatar-group",g),_=r(()=>h?.value&&Array.isArray(h?.value)?h.value.join(" "):h?.value||""),w=r(()=>A.value.slice(0,S.value).map(e=>{let t=[],a=[];return h?.value&&(t=Array.isArray(h?.value)?h?.value:[h?.value]),e.modifiers&&(a=Array.isArray(e.modifiers)?e.modifiers:[e.modifiers]),{...e,key:e.key||r(()=>String(n())).value,modifiers:[...t,...a]}}));return(r,e)=>(i(),a("span",{class:o(s(x))},[l(r.$slots,"default",{},()=>[(i(!0),a(m,null,v(s(w),r=>(i(),f(I,d({key:r.key},{ref_for:!0},{modifiers:r.modifiers,imgSrc:r.imgSrc}),{default:c(()=>[r.text?(i(),a("span",M,y(r.text),1)):u("v-if",!0)]),_:2},1040))),128)),(s(k)||s(A).length)>s(S)?(i(),f(I,{key:0,modifiers:`${s(_)} surface bordered`},{default:c(()=>[p(y("+"+((s(k)||s(A).length)-s(S))),1)]),_:1},8,["modifiers"])):u("v-if",!0)])],2))}});export{N as default};
@@ -1,3 +1,5 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
1
3
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
2
4
  items: {
3
5
  type: PropType<import("@/components/VvAvatarGroup").AvatarItem[]>;
@@ -41,8 +43,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
41
43
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
42
44
  default?: (props: {}) => any;
43
45
  }>;
44
- declare const _default: typeof __VLS_export;
45
- export default _default;
46
46
  type __VLS_WithSlots<T, S> = T & {
47
47
  new (): {
48
48
  $slots: S;
@@ -1,131 +1 @@
1
- import { computed, defineComponent, toRefs, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString } from "vue";
2
- var StorageType = /* @__PURE__ */ ((StorageType2) => {
3
- StorageType2["local"] = "local";
4
- StorageType2["session"] = "session";
5
- return StorageType2;
6
- })(StorageType || {});
7
- var Side = /* @__PURE__ */ ((Side2) => {
8
- Side2["left"] = "left";
9
- Side2["right"] = "right";
10
- Side2["top"] = "top";
11
- Side2["bottom"] = "bottom";
12
- return Side2;
13
- })(Side || {});
14
- var Position = /* @__PURE__ */ ((Position2) => {
15
- Position2["before"] = "before";
16
- Position2["after"] = "after";
17
- return Position2;
18
- })(Position || {});
19
- var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
20
- ButtonType2["button"] = "button";
21
- ButtonType2["submit"] = "submit";
22
- ButtonType2["reset"] = "reset";
23
- return ButtonType2;
24
- })(ButtonType || {});
25
- var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
26
- ActionTag2["nuxtLink"] = "nuxt-link";
27
- ActionTag2["routerLink"] = "router-link";
28
- ActionTag2["a"] = "a";
29
- ActionTag2["button"] = "button";
30
- return ActionTag2;
31
- })(ActionTag || {});
32
- const ModifiersProps = {
33
- /**
34
- * Component BEM modifiers
35
- */
36
- modifiers: {
37
- type: [String, Array],
38
- default: void 0
39
- }
40
- };
41
- ({
42
- /**
43
- * VvIcon position
44
- */
45
- iconPosition: {
46
- default: Position.before
47
- }
48
- });
49
- ({
50
- /**
51
- * Dropdown placement
52
- */
53
- placement: {
54
- default: Side.bottom
55
- }
56
- });
57
- ({
58
- /**
59
- * Button type
60
- */
61
- type: {
62
- default: ButtonType.button
63
- },
64
- /**
65
- * Default tag for the action
66
- */
67
- defaultTag: {
68
- default: ActionTag.button
69
- }
70
- });
71
- ({
72
- storageType: {
73
- default: StorageType.local
74
- }
75
- });
76
- const VvBadgeProps = {
77
- ...ModifiersProps,
78
- value: [String, Number]
79
- };
80
- function useModifiers(prefix, modifiers, others) {
81
- return computed(() => {
82
- const toReturn = {
83
- [prefix]: true
84
- };
85
- const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
86
- if (modifiersArray) {
87
- if (Array.isArray(modifiersArray)) {
88
- modifiersArray.forEach((modifier) => {
89
- if (modifier) {
90
- toReturn[`${prefix}--${modifier}`] = true;
91
- }
92
- });
93
- }
94
- }
95
- return toReturn;
96
- });
97
- }
98
- const __default__ = {
99
- name: "VvBadge"
100
- };
101
- const _sfc_main = /* @__PURE__ */ defineComponent({
102
- ...__default__,
103
- props: VvBadgeProps,
104
- setup(__props) {
105
- const props = __props;
106
- const { modifiers } = toRefs(props);
107
- const bemCssClasses = useModifiers("vv-badge", modifiers);
108
- return (_ctx, _cache) => {
109
- return openBlock(), createElementBlock(
110
- "span",
111
- {
112
- class: normalizeClass(unref(bemCssClasses))
113
- },
114
- [
115
- renderSlot(_ctx.$slots, "default", {}, () => [
116
- createTextVNode(
117
- toDisplayString(_ctx.value),
118
- 1
119
- /* TEXT */
120
- )
121
- ])
122
- ],
123
- 2
124
- /* CLASS */
125
- );
126
- };
127
- }
128
- });
129
- export {
130
- _sfc_main as default
131
- };
1
+ import{computed as t,defineComponent as e,toRefs as o,createElementBlock as r,openBlock as n,normalizeClass as s,unref as u,renderSlot as a,createTextVNode as i,toDisplayString as l}from"vue";var b=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(b||{}),f=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(f||{}),m=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(m||{}),p=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(p||{}),v=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(v||{});const c={modifiers:{type:[String,Array],default:void 0}};m.before,f.bottom,p.button,v.button,b.local;const d=/* @__PURE__ */e({name:"VvBadge",props:{...c,value:[String,Number]},setup(e){const b=e,{modifiers:f}=o(b),m=function(e,o){return t(()=>{const t={[e]:!0},r="string"==typeof o?.value?o.value.split(" "):o?.value;return r&&Array.isArray(r)&&r.forEach(o=>{o&&(t[`${e}--${o}`]=!0)}),t})}("vv-badge",f);return(t,e)=>(n(),r("span",{class:s(u(m))},[a(t.$slots,"default",{},()=>[i(l(t.value),1)])],2))}});export{d as default};
@@ -1,3 +1,5 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
1
3
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
2
4
  value: (StringConstructor | NumberConstructor)[];
3
5
  modifiers: {
@@ -15,8 +17,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
15
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
16
18
  default?: (props: {}) => any;
17
19
  }>;
18
- declare const _default: typeof __VLS_export;
19
- export default _default;
20
20
  type __VLS_WithSlots<T, S> = T & {
21
21
  new (): {
22
22
  $slots: S;