@volverjs/ui-vue 0.0.1-beta.11 → 0.0.1-beta.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/dist/components/VvBadge/VvBadge.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +165 -12
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +4 -4
- package/dist/components/VvBreadcrumb/VvBreadcrumb.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +4 -4
- package/dist/components/VvButton/VvButton.d.ts +2 -33
- package/dist/components/VvButton/VvButton.es.js +183 -198
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -44
- package/dist/components/VvButton/useButtonGroupProps.d.ts +1 -6
- package/dist/components/VvButtonGroup/VvButtonGroup.d.ts +2 -26
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +68 -78
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +9 -69
- package/dist/components/VvDropdown/VvDropdown.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +4 -4
- package/dist/components/VvInputText/VvInputText.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvProgress/VvProgress.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.d.ts +5 -1
- package/dist/components/VvSelect/VvSelect.es.js +395 -207
- package/dist/components/VvSelect/VvSelect.umd.js +2 -2
- package/dist/components/VvSelect/VvSelect.vue.d.ts +12 -5
- package/dist/components/VvTextarea/VvTextarea.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/index.es.js +579 -610
- package/dist/components/index.umd.js +2 -2
- package/dist/composables/group/types/IButtonGroupState.d.ts +4 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +553 -585
- package/dist/index.umd.js +2 -2
- package/dist/props/index.d.ts +2 -1
- package/dist/stories/RadioGroup/RadioOption.test.d.ts +4 -0
- package/dist/stories/RadioGroup/RadioProperty.test.d.ts +1 -1
- package/dist/stories/RadioGroup/RadioSlots.test.d.ts +6 -0
- package/package.json +2 -2
- 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/VvBadge/VvBadge.ts +4 -2
- package/src/components/VvBadge/VvBadge.vue +8 -3
- package/src/components/VvButton/VvButton.ts +4 -34
- package/src/components/VvButton/VvButton.vue +3 -12
- package/src/components/VvButton/useButtonGroupProps.ts +3 -11
- package/src/components/VvButtonGroup/VvButtonGroup.ts +4 -17
- package/src/components/VvButtonGroup/VvButtonGroup.vue +5 -16
- package/src/components/VvSelect/VvSelect.ts +5 -1
- package/src/components/VvSelect/VvSelect.vue +7 -1
- package/src/composables/group/types/IButtonGroupState.ts +4 -0
- package/src/props/index.ts +3 -1
- package/src/stories/Badge/BadgeColor.stories.mdx +4 -4
- package/src/stories/Badge/BadgeModifiers.stories.mdx +65 -0
- package/src/stories/Button/ButtonActive.stories.mdx +27 -0
- package/src/stories/Button/ButtonDisabled.stories.mdx +28 -0
- package/src/stories/Button/ButtonIconPosition.stories.mdx +0 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +103 -46
- package/src/stories/Button/ButtonSelected.stories.mdx +30 -0
- package/src/stories/ButtonGroup/ButtonGroupAction.stories.mdx +2 -2
- package/src/stories/ButtonGroup/ButtonGroupActionQuiet.stories.mdx +2 -2
- package/src/stories/ButtonGroup/ButtonGroupBlock.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupRounded.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupHintLabel.stories.mdx +6 -6
- package/src/stories/RadioGroup/RadioGroupLabel.stories.mdx +7 -2
- package/src/stories/RadioGroup/RadioGroupOptionLabel.stories.mdx +7 -19
- package/src/stories/RadioGroup/RadioGroupOptionValue.stories.mdx +7 -19
- package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +3 -17
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +10 -9
- package/src/stories/RadioGroup/RadioOption.test.ts +45 -0
- package/src/stories/RadioGroup/RadioProperty.test.ts +4 -4
- package/src/stories/RadioGroup/RadioSlots.test.ts +29 -0
- package/src/stories/Select/SelectNative.stories.mdx +45 -0
- package/src/stories/stories.scss +5 -27
- package/src/stories/Button/ButtonVariant.stories.mdx +0 -205
- package/src/stories/Button/test.js +0 -41
- package/src/stories/Radio/RadioTest.js +0 -90
- package/src/stories/RadioGroup/RadioOptionsTest.js +0 -78
- package/src/stories/RadioGroup/RadioPropertyTest.js +0 -131
- package/src/stories/RadioGroup/RadioSlotsTest.js +0 -20
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { v4 as
|
|
3
|
-
import { iconExists as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { computed as d, unref as m, defineComponent as D, ref as G, toRefs as I, inject as P, openBlock as y, createBlock as A, mergeProps as B, createCommentVNode as _, toRef as M, useAttrs as U, useSlots as T, resolveDynamicComponent as Z, withCtx as z, renderSlot as k, createElementBlock as $, toDisplayString as L, Fragment as H, createTextVNode as J } from "vue";
|
|
2
|
+
import { v4 as X } from "uuid";
|
|
3
|
+
import { iconExists as w, Icon as K, addIcon as Q } from "@iconify/vue";
|
|
4
|
+
const W = {
|
|
5
|
+
disabled: Boolean
|
|
6
|
+
}, Y = {
|
|
7
|
+
modifiers: [String, Array]
|
|
8
|
+
};
|
|
9
|
+
var S = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(S || {}), b = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(b || {}), R = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(R || {});
|
|
10
|
+
const ee = {
|
|
11
|
+
...Y,
|
|
12
|
+
...W,
|
|
6
13
|
icon: String,
|
|
7
14
|
iconPosition: {
|
|
8
15
|
type: String,
|
|
9
16
|
default: "left",
|
|
10
|
-
validator: (e) => e in
|
|
17
|
+
validator: (e) => e in S
|
|
11
18
|
},
|
|
12
19
|
label: String,
|
|
13
20
|
loading: Boolean,
|
|
@@ -22,55 +29,48 @@ const te = {
|
|
|
22
29
|
href: String,
|
|
23
30
|
target: {
|
|
24
31
|
type: String,
|
|
25
|
-
validator: (e) => e in
|
|
32
|
+
validator: (e) => e in R
|
|
26
33
|
},
|
|
27
|
-
block: Boolean,
|
|
28
34
|
active: Boolean,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
actionQuiet: Boolean,
|
|
34
|
-
selected: Boolean,
|
|
35
|
-
modifiers: [Array, String]
|
|
36
|
-
}, h = {
|
|
37
|
-
equals(e, t, n) {
|
|
38
|
-
return n ? this.resolveFieldData(e, n) === this.resolveFieldData(t, n) : this.deepEquals(e, t);
|
|
35
|
+
selected: Boolean
|
|
36
|
+
}, v = {
|
|
37
|
+
equals(e, t, r) {
|
|
38
|
+
return r ? this.resolveFieldData(e, r) === this.resolveFieldData(t, r) : this.deepEquals(e, t);
|
|
39
39
|
},
|
|
40
40
|
deepEquals(e, t) {
|
|
41
41
|
if (e === t)
|
|
42
42
|
return !0;
|
|
43
43
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
44
|
+
const r = Array.isArray(e), o = Array.isArray(t);
|
|
45
|
+
let n, l, i;
|
|
46
|
+
if (r && o) {
|
|
47
47
|
if (l = e.length, l != t.length)
|
|
48
48
|
return !1;
|
|
49
|
-
for (
|
|
50
|
-
if (!this.deepEquals(e[
|
|
49
|
+
for (n = l; n-- !== 0; )
|
|
50
|
+
if (!this.deepEquals(e[n], t[n]))
|
|
51
51
|
return !1;
|
|
52
52
|
return !0;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (r != o)
|
|
55
55
|
return !1;
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
56
|
+
const a = e instanceof Date, c = t instanceof Date;
|
|
57
|
+
if (a != c)
|
|
58
58
|
return !1;
|
|
59
|
-
if (
|
|
59
|
+
if (a && c)
|
|
60
60
|
return e.getTime() == t.getTime();
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
const f = e instanceof RegExp, s = t instanceof RegExp;
|
|
62
|
+
if (f != s)
|
|
63
63
|
return !1;
|
|
64
|
-
if (
|
|
64
|
+
if (f && s)
|
|
65
65
|
return e.toString() == t.toString();
|
|
66
|
-
const
|
|
67
|
-
if (l =
|
|
66
|
+
const u = Object.keys(e);
|
|
67
|
+
if (l = u.length, l !== Object.keys(t).length)
|
|
68
68
|
return !1;
|
|
69
|
-
for (
|
|
70
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
69
|
+
for (n = l; n-- !== 0; )
|
|
70
|
+
if (!Object.prototype.hasOwnProperty.call(t, u[n]))
|
|
71
71
|
return !1;
|
|
72
|
-
for (
|
|
73
|
-
if (
|
|
72
|
+
for (n = l; n-- !== 0; )
|
|
73
|
+
if (i = u[n], !this.deepEquals(e[i], t[i]))
|
|
74
74
|
return !1;
|
|
75
75
|
return !0;
|
|
76
76
|
}
|
|
@@ -81,12 +81,12 @@ const te = {
|
|
|
81
81
|
if (t.indexOf(".") === -1)
|
|
82
82
|
return e[t];
|
|
83
83
|
{
|
|
84
|
-
const
|
|
84
|
+
const r = t.split(".");
|
|
85
85
|
let o = e;
|
|
86
|
-
for (let
|
|
86
|
+
for (let n = 0, l = r.length; n < l; ++n) {
|
|
87
87
|
if (e == null)
|
|
88
88
|
return null;
|
|
89
|
-
o = o[n
|
|
89
|
+
o = o[r[n]];
|
|
90
90
|
}
|
|
91
91
|
return o;
|
|
92
92
|
}
|
|
@@ -97,20 +97,20 @@ const te = {
|
|
|
97
97
|
return !!(e && e.constructor && e.call && e.apply);
|
|
98
98
|
},
|
|
99
99
|
findIndexInList(e, t) {
|
|
100
|
-
let
|
|
100
|
+
let r = -1;
|
|
101
101
|
if (t) {
|
|
102
102
|
for (let o = 0; o < t.length; o++)
|
|
103
103
|
if (this.equals(t[o], e)) {
|
|
104
|
-
|
|
104
|
+
r = o;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
return
|
|
108
|
+
return r;
|
|
109
109
|
},
|
|
110
110
|
contains(e, t) {
|
|
111
111
|
if (e != null && t && t.length) {
|
|
112
|
-
for (const
|
|
113
|
-
if (this.equals(e,
|
|
112
|
+
for (const r of t)
|
|
113
|
+
if (this.equals(e, r))
|
|
114
114
|
return !0;
|
|
115
115
|
}
|
|
116
116
|
return !1;
|
|
@@ -123,36 +123,36 @@ const te = {
|
|
|
123
123
|
},
|
|
124
124
|
pickBy(e, t) {
|
|
125
125
|
return Object.fromEntries(
|
|
126
|
-
Object.entries(e).filter(([
|
|
126
|
+
Object.entries(e).filter(([r]) => t(r))
|
|
127
127
|
);
|
|
128
128
|
},
|
|
129
129
|
removeFromList(e, t) {
|
|
130
|
-
const
|
|
131
|
-
return
|
|
130
|
+
const r = this.findIndexInList(e, t);
|
|
131
|
+
return r > -1 ? t.filter((o, n) => n !== r) : t;
|
|
132
132
|
},
|
|
133
133
|
isString(e) {
|
|
134
134
|
return typeof e == "string" || e instanceof String;
|
|
135
135
|
},
|
|
136
136
|
propsToObject(e) {
|
|
137
|
-
return Object.keys(e).reduce((t,
|
|
138
|
-
var o,
|
|
139
|
-
return this.isFunction(e[
|
|
137
|
+
return Object.keys(e).reduce((t, r) => {
|
|
138
|
+
var o, n, l, i, a;
|
|
139
|
+
return this.isFunction(e[r]) ? t[r] = e[r]() : Array.isArray(e[r]) ? t[r] = e[r][0]() : (o = e[r]) != null && o.type && (Array.isArray(e[r].type) ? t[r] = ((n = e[r]) == null ? void 0 : n.default) || ((l = e[r]) == null ? void 0 : l.type[0]()) : t[r] = ((i = e[r]) == null ? void 0 : i.default) || ((a = e[r]) == null ? void 0 : a.type())), t;
|
|
140
140
|
}, {});
|
|
141
141
|
},
|
|
142
|
-
filterArray(e, t,
|
|
143
|
-
return e.filter((o) => t.some((
|
|
144
|
-
o[
|
|
145
|
-
r
|
|
142
|
+
filterArray(e, t, r) {
|
|
143
|
+
return e.filter((o) => t.some((n) => typeof n == "string" ? o[r] == n : this.equals(
|
|
144
|
+
o[r],
|
|
145
|
+
n[r]
|
|
146
146
|
)));
|
|
147
147
|
},
|
|
148
148
|
kebabCase(e) {
|
|
149
|
-
var t,
|
|
149
|
+
var t, r;
|
|
150
150
|
if (e)
|
|
151
|
-
return (
|
|
151
|
+
return (r = (t = e.match(
|
|
152
152
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
153
|
-
)) == null ? void 0 : t.join("-")) == null ? void 0 :
|
|
153
|
+
)) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, te = "ds", re = {
|
|
156
156
|
color: String,
|
|
157
157
|
width: {
|
|
158
158
|
type: [String, Number]
|
|
@@ -184,22 +184,22 @@ const te = {
|
|
|
184
184
|
type: [String, Array]
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
function
|
|
188
|
-
const
|
|
187
|
+
function q(e, t) {
|
|
188
|
+
const r = { [`${e}`]: !0 };
|
|
189
189
|
return {
|
|
190
|
-
bemCssClasses:
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
return
|
|
190
|
+
bemCssClasses: d(() => Object.keys(t).reduce((n, l) => {
|
|
191
|
+
const i = m(t[l]) || !1;
|
|
192
|
+
if (!i)
|
|
193
|
+
return n;
|
|
194
194
|
if (l === "modifiers") {
|
|
195
|
-
const
|
|
195
|
+
const a = Array.isArray(i) ? i : [i];
|
|
196
196
|
return {
|
|
197
|
-
...
|
|
198
|
-
...
|
|
199
|
-
(c,
|
|
197
|
+
...n,
|
|
198
|
+
...a.reduce(
|
|
199
|
+
(c, f) => ({
|
|
200
200
|
...c,
|
|
201
|
-
[`${e}--${
|
|
202
|
-
|
|
201
|
+
[`${e}--${v.kebabCase(
|
|
202
|
+
f
|
|
203
203
|
)}`]: !0
|
|
204
204
|
}),
|
|
205
205
|
{}
|
|
@@ -207,207 +207,192 @@ function V(e, t) {
|
|
|
207
207
|
};
|
|
208
208
|
} else
|
|
209
209
|
return {
|
|
210
|
-
...
|
|
211
|
-
[`${e}--${
|
|
210
|
+
...n,
|
|
211
|
+
[`${e}--${v.kebabCase(l)}`]: i
|
|
212
212
|
};
|
|
213
|
-
},
|
|
213
|
+
}, r) || {})
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const j = /* @__PURE__ */ D({
|
|
217
217
|
__name: "VvIcon",
|
|
218
218
|
props: re,
|
|
219
219
|
setup(e) {
|
|
220
|
-
const t = e,
|
|
220
|
+
const t = e, r = G(!0), { modifiers: o } = I(t), n = P(te), { bemCssClasses: l } = q("vv-icon", {
|
|
221
221
|
modifiers: o
|
|
222
|
-
}),
|
|
223
|
-
const s = t.name || "",
|
|
224
|
-
return
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
return
|
|
222
|
+
}), i = d(() => t.provider || (n == null ? void 0 : n.provider)), a = d(() => {
|
|
223
|
+
const s = t.name || "", u = `@${i.value}:${t.prefix}:${t.name}`;
|
|
224
|
+
return w(s) ? s : w(u) ? u : (n == null ? void 0 : n.iconsCollections.find((p) => {
|
|
225
|
+
const h = `@${i.value}:${p.prefix}:${s}`;
|
|
226
|
+
if (w(h))
|
|
227
|
+
return h;
|
|
228
228
|
})) || s;
|
|
229
229
|
});
|
|
230
230
|
function c(s) {
|
|
231
|
-
let
|
|
231
|
+
let u = null;
|
|
232
232
|
if (typeof window > "u") {
|
|
233
|
-
const { JSDOM:
|
|
234
|
-
|
|
233
|
+
const { JSDOM: C } = require("jsdom");
|
|
234
|
+
u = new C().window;
|
|
235
235
|
}
|
|
236
|
-
return (
|
|
236
|
+
return (u ? new u.DOMParser() : new window.DOMParser()).parseFromString(s, "text/html").querySelector("svg");
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
body:
|
|
242
|
-
height:
|
|
243
|
-
width:
|
|
238
|
+
function f(s) {
|
|
239
|
+
const u = c(s), p = (u == null ? void 0 : u.innerHTML.trim()) || "";
|
|
240
|
+
u && p && Q(`@${i.value}:${t.prefix}:${t.name}`, {
|
|
241
|
+
body: p,
|
|
242
|
+
height: u.viewBox.baseVal.height,
|
|
243
|
+
width: u.viewBox.baseVal.width
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
return
|
|
247
|
-
s && (
|
|
246
|
+
return n && (t.src ? (r.value = !1, n.fetchIcon(t.src).then((s) => {
|
|
247
|
+
s && (f(s), r.value = !0);
|
|
248
248
|
}).catch((s) => {
|
|
249
249
|
throw new Error(`During fetch icon: ${s == null ? void 0 : s.message}`);
|
|
250
|
-
})) : t.svg &&
|
|
250
|
+
})) : t.svg && f(t.svg)), (s, u) => r.value ? (y(), A(m(K), B({
|
|
251
251
|
key: 0,
|
|
252
|
-
class:
|
|
252
|
+
class: m(l)
|
|
253
253
|
}, {
|
|
254
254
|
...s.$props,
|
|
255
|
-
provider:
|
|
256
|
-
icon:
|
|
257
|
-
}), null, 16, ["class"])) :
|
|
255
|
+
provider: m(i),
|
|
256
|
+
icon: m(a)
|
|
257
|
+
}), null, 16, ["class"])) : _("", !0);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
function
|
|
261
|
-
const t =
|
|
262
|
-
function o(
|
|
260
|
+
function ne(e) {
|
|
261
|
+
const t = P(e, void 0), r = d(() => v.isNotEmpty(t));
|
|
262
|
+
function o(n, l, i) {
|
|
263
263
|
if (t != null && t.value) {
|
|
264
|
-
const
|
|
265
|
-
return
|
|
264
|
+
const a = m(t.value)[n];
|
|
265
|
+
return d({
|
|
266
266
|
get() {
|
|
267
|
-
return
|
|
267
|
+
return a == null ? void 0 : a.value;
|
|
268
268
|
},
|
|
269
269
|
set(c) {
|
|
270
|
-
|
|
270
|
+
a.value = c;
|
|
271
271
|
}
|
|
272
272
|
});
|
|
273
273
|
} else {
|
|
274
|
-
const
|
|
275
|
-
return
|
|
274
|
+
const a = M(l, n);
|
|
275
|
+
return d({
|
|
276
276
|
get() {
|
|
277
|
-
return
|
|
277
|
+
return a.value;
|
|
278
278
|
},
|
|
279
279
|
set(c) {
|
|
280
|
-
|
|
280
|
+
i && i(`update:${n}`, c);
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
return {
|
|
286
286
|
group: t,
|
|
287
|
-
isInGroup:
|
|
287
|
+
isInGroup: r,
|
|
288
288
|
getGroupOrLocalRef: o
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
const
|
|
291
|
+
const oe = Symbol("VV_BUTTON_GROUP");
|
|
292
292
|
function se(e) {
|
|
293
|
-
const { group: t, isInGroup:
|
|
293
|
+
const { group: t, isInGroup: r, getGroupOrLocalRef: o } = ne(oe), { iconPosition: n, icon: l, label: i, selected: a } = I(e), c = o("modelValue", e), f = o("disabled", e), s = o("toggle", e), u = o("modifiers", e);
|
|
294
294
|
return {
|
|
295
|
-
modelValue:
|
|
296
|
-
disabled:
|
|
297
|
-
toggle:
|
|
298
|
-
isInGroup:
|
|
295
|
+
modelValue: c,
|
|
296
|
+
disabled: f,
|
|
297
|
+
toggle: s,
|
|
298
|
+
isInGroup: r,
|
|
299
299
|
group: t,
|
|
300
|
-
modifiers:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
rounded: p,
|
|
306
|
-
fullBleed: l,
|
|
307
|
-
iconPosition: a,
|
|
308
|
-
icon: u,
|
|
309
|
-
label: c
|
|
300
|
+
modifiers: u,
|
|
301
|
+
selected: a,
|
|
302
|
+
iconPosition: n,
|
|
303
|
+
icon: l,
|
|
304
|
+
label: i
|
|
310
305
|
};
|
|
311
306
|
}
|
|
312
|
-
const
|
|
307
|
+
const ie = {
|
|
313
308
|
key: 1,
|
|
314
309
|
class: "vv-button__label"
|
|
315
|
-
},
|
|
310
|
+
}, le = {
|
|
316
311
|
key: 1,
|
|
317
312
|
class: "vv-button__label"
|
|
318
|
-
},
|
|
313
|
+
}, fe = /* @__PURE__ */ D({
|
|
319
314
|
__name: "VvButton",
|
|
320
|
-
props:
|
|
315
|
+
props: ee,
|
|
321
316
|
setup(e) {
|
|
322
|
-
const t = e,
|
|
323
|
-
modifiers:
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
modelValue: g,
|
|
333
|
-
disabled: p,
|
|
334
|
-
toggle: S,
|
|
335
|
-
isInGroup: $
|
|
336
|
-
} = se(t), L = f(() => {
|
|
317
|
+
const t = e, r = U(), o = T(), n = (r == null ? void 0 : r.name) || X(), {
|
|
318
|
+
modifiers: l,
|
|
319
|
+
iconPosition: i,
|
|
320
|
+
icon: a,
|
|
321
|
+
label: c,
|
|
322
|
+
modelValue: f,
|
|
323
|
+
disabled: s,
|
|
324
|
+
toggle: u,
|
|
325
|
+
isInGroup: p
|
|
326
|
+
} = se(t), h = d(() => {
|
|
337
327
|
switch (!0) {
|
|
338
|
-
case
|
|
339
|
-
return
|
|
328
|
+
case s.value:
|
|
329
|
+
return b.button;
|
|
340
330
|
case t.to !== void 0:
|
|
341
|
-
return
|
|
331
|
+
return b.routerLink;
|
|
342
332
|
case t.href !== void 0:
|
|
343
|
-
return
|
|
333
|
+
return b.a;
|
|
344
334
|
default:
|
|
345
|
-
return
|
|
335
|
+
return b.button;
|
|
346
336
|
}
|
|
347
|
-
}),
|
|
348
|
-
modifiers:
|
|
349
|
-
active:
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
fullBleed: v,
|
|
356
|
-
disabled: p,
|
|
357
|
-
reverse: f(
|
|
358
|
-
() => [_.right, _.bottom].includes(
|
|
359
|
-
s.value
|
|
337
|
+
}), E = d(() => u.value ? Array.isArray(f.value) ? v.contains(n, f.value) : v.equals(n, f.value) : t.active), C = d(() => u.value ? Array.isArray(f.value) ? v.contains(n, f.value) : v.equals(n, f.value) : t.selected), { bemCssClasses: F } = q("vv-button", {
|
|
338
|
+
modifiers: l,
|
|
339
|
+
active: E,
|
|
340
|
+
selected: C,
|
|
341
|
+
disabled: s,
|
|
342
|
+
reverse: d(
|
|
343
|
+
() => [S.right, S.bottom].includes(
|
|
344
|
+
i.value
|
|
360
345
|
)
|
|
361
346
|
),
|
|
362
|
-
column:
|
|
363
|
-
() => [
|
|
364
|
-
|
|
347
|
+
column: d(
|
|
348
|
+
() => [S.top, S.bottom].includes(
|
|
349
|
+
i.value
|
|
365
350
|
)
|
|
366
351
|
),
|
|
367
|
-
iconOnly:
|
|
368
|
-
}),
|
|
369
|
-
...
|
|
370
|
-
"aria-label": t.label ||
|
|
371
|
-
"aria-disabled":
|
|
352
|
+
iconOnly: d(() => (a == null ? void 0 : a.value) && !(c != null && c.value) && !o.default)
|
|
353
|
+
}), V = d(() => ({
|
|
354
|
+
...x.value,
|
|
355
|
+
"aria-label": t.label || r["aria-label"],
|
|
356
|
+
"aria-disabled": s.value,
|
|
372
357
|
role: "button",
|
|
373
|
-
class:
|
|
358
|
+
class: F.value,
|
|
374
359
|
to: t.to
|
|
375
|
-
})),
|
|
376
|
-
const
|
|
377
|
-
let
|
|
378
|
-
return
|
|
360
|
+
})), x = d(() => {
|
|
361
|
+
const g = h.value === b.a;
|
|
362
|
+
let O = {};
|
|
363
|
+
return g && (O = s.value ? {
|
|
379
364
|
href: "javascript:;"
|
|
380
365
|
} : {
|
|
381
366
|
target: t.target,
|
|
382
367
|
href: t.href
|
|
383
|
-
}),
|
|
368
|
+
}), O;
|
|
384
369
|
});
|
|
385
|
-
function
|
|
386
|
-
|
|
370
|
+
function N() {
|
|
371
|
+
p.value && (f.value = n);
|
|
387
372
|
}
|
|
388
|
-
return (
|
|
389
|
-
default:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
373
|
+
return (g, O) => (y(), A(Z(m(h)), B(m(V), { onClickPassive: N }), {
|
|
374
|
+
default: z(() => [
|
|
375
|
+
k(g.$slots, "default", {}, () => [
|
|
376
|
+
g.loading ? k(g.$slots, "loading", { key: 0 }, () => [
|
|
377
|
+
g.loadingIcon ? (y(), A(j, {
|
|
393
378
|
key: 0,
|
|
394
379
|
class: "vv-button__loading-icon",
|
|
395
|
-
name:
|
|
396
|
-
}, null, 8, ["name"])) :
|
|
397
|
-
|
|
398
|
-
]) : (
|
|
399
|
-
|
|
400
|
-
|
|
380
|
+
name: g.loadingIcon
|
|
381
|
+
}, null, 8, ["name"])) : _("", !0),
|
|
382
|
+
g.loadingLabel ? (y(), $("span", ie, L(g.loadingLabel), 1)) : _("", !0)
|
|
383
|
+
]) : (y(), $(H, { key: 1 }, [
|
|
384
|
+
k(g.$slots, "before"),
|
|
385
|
+
m(a) ? (y(), A(j, {
|
|
401
386
|
key: 0,
|
|
402
387
|
class: "vv-button__icon",
|
|
403
|
-
name:
|
|
404
|
-
}, null, 8, ["name"])) :
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
388
|
+
name: m(a)
|
|
389
|
+
}, null, 8, ["name"])) : _("", !0),
|
|
390
|
+
m(c) ? (y(), $("span", le, [
|
|
391
|
+
k(g.$slots, "label", {}, () => [
|
|
392
|
+
J(L(m(c)), 1)
|
|
408
393
|
])
|
|
409
|
-
])) :
|
|
410
|
-
|
|
394
|
+
])) : _("", !0),
|
|
395
|
+
k(g.$slots, "after")
|
|
411
396
|
], 64))
|
|
412
397
|
])
|
|
413
398
|
]),
|
|
@@ -416,5 +401,5 @@ const le = {
|
|
|
416
401
|
}
|
|
417
402
|
});
|
|
418
403
|
export {
|
|
419
|
-
|
|
404
|
+
fe as default
|
|
420
405
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,
|
|
1
|
+
(function(n,S){typeof exports=="object"&&typeof module<"u"?module.exports=S(require("vue"),require("uuid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","uuid","@iconify/vue"],S):(n=typeof globalThis<"u"?globalThis:n||self,n.VvButton=S(n.vue,n.uuid,n.vue$1))})(this,function(n,S,k){"use strict";const w={disabled:Boolean},$={modifiers:[String,Array]};var y=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(y||{}),h=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(h||{}),A=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(A||{});const j={...$,...w,icon:String,iconPosition:{type:String,default:"left",validator:e=>e in y},label:String,loading:Boolean,loadingIcon:{type:String,default:"eos-icons:bubble-loading"},loadingLabel:{type:String,default:"Loading..."},to:{type:[String,Object]},href:String,target:{type:String,validator:e=>e in A},active:Boolean,selected:Boolean},p={equals(e,t,r){return r?this.resolveFieldData(e,r)===this.resolveFieldData(t,r):this.deepEquals(e,t)},deepEquals(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){const r=Array.isArray(e),s=Array.isArray(t);let o,c,l;if(r&&s){if(c=e.length,c!=t.length)return!1;for(o=c;o--!==0;)if(!this.deepEquals(e[o],t[o]))return!1;return!0}if(r!=s)return!1;const a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();const d=e instanceof RegExp,i=t instanceof RegExp;if(d!=i)return!1;if(d&&i)return e.toString()==t.toString();const f=Object.keys(e);if(c=f.length,c!==Object.keys(t).length)return!1;for(o=c;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,f[o]))return!1;for(o=c;o--!==0;)if(l=f[o],!this.deepEquals(e[l],t[l]))return!1;return!0}return e!==e&&t!==t},resolveFieldData(e,t){if(e&&Object.keys(e).length&&t){if(t.indexOf(".")===-1)return e[t];{const r=t.split(".");let s=e;for(let o=0,c=r.length;o<c;++o){if(e==null)return null;s=s[r[o]]}return s}}else return null},isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},findIndexInList(e,t){let r=-1;if(t){for(let s=0;s<t.length;s++)if(this.equals(t[s],e)){r=s;break}}return r},contains(e,t){if(e!=null&&t&&t.length){for(const r of t)if(this.equals(e,r))return!0}return!1},isEmpty(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0},isNotEmpty(e){return!this.isEmpty(e)},pickBy(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>t(r)))},removeFromList(e,t){const r=this.findIndexInList(e,t);return r>-1?t.filter((s,o)=>o!==r):t},isString(e){return typeof e=="string"||e instanceof String},propsToObject(e){return Object.keys(e).reduce((t,r)=>{var s,o,c,l,a;return this.isFunction(e[r])?t[r]=e[r]():Array.isArray(e[r])?t[r]=e[r][0]():(s=e[r])!=null&&s.type&&(Array.isArray(e[r].type)?t[r]=((o=e[r])==null?void 0:o.default)||((c=e[r])==null?void 0:c.type[0]()):t[r]=((l=e[r])==null?void 0:l.default)||((a=e[r])==null?void 0:a.type())),t},{})},filterArray(e,t,r){return e.filter(s=>t.some(o=>typeof o=="string"?s[r]==o:this.equals(s[r],o[r])))},kebabCase(e){var t,r;if(e)return(r=(t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:t.join("-"))==null?void 0:r.toLowerCase()}},L="ds",V={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};function B(e,t){const r={[`${e}`]:!0};return{bemCssClasses:n.computed(()=>Object.keys(t).reduce((o,c)=>{const l=n.unref(t[c])||!1;if(!l)return o;if(c==="modifiers"){const a=Array.isArray(l)?l:[l];return{...o,...a.reduce((u,d)=>({...u,[`${e}--${p.kebabCase(d)}`]:!0}),{})}}else return{...o,[`${e}--${p.kebabCase(c)}`]:l}},r)||{})}}const O=n.defineComponent({__name:"VvIcon",props:V,setup(e){const t=e,r=n.ref(!0),{modifiers:s}=n.toRefs(t),o=n.inject(L),{bemCssClasses:c}=B("vv-icon",{modifiers:s}),l=n.computed(()=>t.provider||(o==null?void 0:o.provider)),a=n.computed(()=>{const i=t.name||"",f=`@${l.value}:${t.prefix}:${t.name}`;return k.iconExists(i)?i:k.iconExists(f)?f:(o==null?void 0:o.iconsCollections.find(g=>{const b=`@${l.value}:${g.prefix}:${i}`;if(k.iconExists(b))return b}))||i});function u(i){let f=null;if(typeof window>"u"){const{JSDOM:_}=require("jsdom");f=new _().window}return(f?new f.DOMParser:new window.DOMParser).parseFromString(i,"text/html").querySelector("svg")}function d(i){const f=u(i),g=(f==null?void 0:f.innerHTML.trim())||"";f&&g&&k.addIcon(`@${l.value}:${t.prefix}:${t.name}`,{body:g,height:f.viewBox.baseVal.height,width:f.viewBox.baseVal.width})}return o&&(t.src?(r.value=!1,o.fetchIcon(t.src).then(i=>{i&&(d(i),r.value=!0)}).catch(i=>{throw new Error(`During fetch icon: ${i==null?void 0:i.message}`)})):t.svg&&d(t.svg)),(i,f)=>r.value?(n.openBlock(),n.createBlock(n.unref(k.Icon),n.mergeProps({key:0,class:n.unref(c)},{...i.$props,provider:n.unref(l),icon:n.unref(a)}),null,16,["class"])):n.createCommentVNode("",!0)}});function q(e){const t=n.inject(e,void 0),r=n.computed(()=>p.isNotEmpty(t));function s(o,c,l){if(t!=null&&t.value){const a=n.unref(t.value)[o];return n.computed({get(){return a==null?void 0:a.value},set(u){a.value=u}})}else{const a=n.toRef(c,o);return n.computed({get(){return a.value},set(u){l&&l(`update:${o}`,u)}})}}return{group:t,isInGroup:r,getGroupOrLocalRef:s}}const D=Symbol("VV_BUTTON_GROUP");function P(e){const{group:t,isInGroup:r,getGroupOrLocalRef:s}=q(D),{iconPosition:o,icon:c,label:l,selected:a}=n.toRefs(e),u=s("modelValue",e),d=s("disabled",e),i=s("toggle",e),f=s("modifiers",e);return{modelValue:u,disabled:d,toggle:i,isInGroup:r,group:t,modifiers:f,selected:a,iconPosition:o,icon:c,label:l}}const I={key:1,class:"vv-button__label"},R={key:1,class:"vv-button__label"};return n.defineComponent({__name:"VvButton",props:j,setup(e){const t=e,r=n.useAttrs(),s=n.useSlots(),o=(r==null?void 0:r.name)||S.v4(),{modifiers:c,iconPosition:l,icon:a,label:u,modelValue:d,disabled:i,toggle:f,isInGroup:g}=P(t),b=n.computed(()=>{switch(!0){case i.value:return h.button;case t.to!==void 0:return h.routerLink;case t.href!==void 0:return h.a;default:return h.button}}),E=n.computed(()=>f.value?Array.isArray(d.value)?p.contains(o,d.value):p.equals(o,d.value):t.active),_=n.computed(()=>f.value?Array.isArray(d.value)?p.contains(o,d.value):p.equals(o,d.value):t.selected),{bemCssClasses:x}=B("vv-button",{modifiers:c,active:E,selected:_,disabled:i,reverse:n.computed(()=>[y.right,y.bottom].includes(l.value)),column:n.computed(()=>[y.top,y.bottom].includes(l.value)),iconOnly:n.computed(()=>(a==null?void 0:a.value)&&!(u!=null&&u.value)&&!s.default)}),F=n.computed(()=>({...N.value,"aria-label":t.label||r["aria-label"],"aria-disabled":i.value,role:"button",class:x.value,to:t.to})),N=n.computed(()=>{const m=b.value===h.a;let C={};return m&&(C=i.value?{href:"javascript:;"}:{target:t.target,href:t.href}),C});function G(){g.value&&(d.value=o)}return(m,C)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(b)),n.mergeProps(n.unref(F),{onClickPassive:G}),{default:n.withCtx(()=>[n.renderSlot(m.$slots,"default",{},()=>[m.loading?n.renderSlot(m.$slots,"loading",{key:0},()=>[m.loadingIcon?(n.openBlock(),n.createBlock(O,{key:0,class:"vv-button__loading-icon",name:m.loadingIcon},null,8,["name"])):n.createCommentVNode("",!0),m.loadingLabel?(n.openBlock(),n.createElementBlock("span",I,n.toDisplayString(m.loadingLabel),1)):n.createCommentVNode("",!0)]):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.renderSlot(m.$slots,"before"),n.unref(a)?(n.openBlock(),n.createBlock(O,{key:0,class:"vv-button__icon",name:n.unref(a)},null,8,["name"])):n.createCommentVNode("",!0),n.unref(u)?(n.openBlock(),n.createElementBlock("span",R,[n.renderSlot(m.$slots,"label",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(u)),1)])])):n.createCommentVNode("",!0),n.renderSlot(m.$slots,"after")],64))])]),_:3},16))}})});
|