@volverjs/ui-vue 0.0.11 → 0.0.12
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/bin/icons.js +1 -93
- package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
- package/dist/components/VvAction/VvAction.es.js +1 -302
- package/dist/components/VvAlert/VvAlert.es.js +1 -527
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
- package/dist/components/VvBadge/VvBadge.es.js +1 -131
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
- package/dist/components/VvButton/VvButton.es.js +1 -882
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
- package/dist/components/VvCard/VvCard.es.js +1 -152
- package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
- package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -1
- package/dist/components/VvDialog/VvDialog.es.js +1 -317
- package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +9 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
- package/dist/components/VvIcon/VvIcon.es.js +1 -143
- package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
- package/dist/components/VvInputText/VvInputText.es.js +4 -2790
- package/dist/components/VvNav/VvNav.es.js +1 -438
- package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
- package/dist/components/VvProgress/VvProgress.es.js +1 -163
- package/dist/components/VvRadio/VvRadio.es.js +1 -661
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
- package/dist/components/VvSelect/VvSelect.es.js +1 -1103
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -1
- package/dist/components/VvTab/VvTab.es.js +1 -558
- package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
- package/dist/components/index.es.js +6 -8558
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +2 -247
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +2 -311
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +2 -142
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -172
- package/dist/icons.es.js +1 -39
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1 -219
- package/dist/resolvers/unplugin.es.js +1 -187
- package/package.json +33 -33
|
@@ -1,132 +1 @@
|
|
|
1
|
-
import {
|
|
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,250 +1 @@
|
|
|
1
|
-
import {
|
|
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,131 +1 @@
|
|
|
1
|
-
import
|
|
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};
|