@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3
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/auto-imports.d.ts +289 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +16 -50
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +170 -306
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +26 -60
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
- package/dist/components/VvCheckbox/index.d.ts +10 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
- package/dist/components/VvCombobox/index.d.ts +4 -4
- package/dist/components/VvDialog/VvDialog.es.js +66 -102
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +304 -407
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvProgress/VvProgress.es.js +17 -51
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +110 -249
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
- package/dist/components/VvRadio/index.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +200 -292
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
- package/dist/components/VvTooltip/index.d.ts +18 -0
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1179 -1371
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcons.d.ts +1 -1
- package/dist/composables/useDebouncedInput.d.ts +1 -1
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useTextCount.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1211 -1404
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +27 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +0 -3
- package/src/components/VvAccordion/index.ts +1 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
- package/src/components/VvBadge/VvBadge.vue +0 -1
- package/src/components/VvButton/VvButton.vue +0 -3
- package/src/components/VvButton/index.ts +2 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
- package/src/components/VvCard/VvCard.vue +0 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
- package/src/components/VvCheckbox/index.ts +1 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
- package/src/components/VvCombobox/VvCombobox.vue +0 -7
- package/src/components/VvDialog/VvDialog.vue +1 -2
- package/src/components/VvDropdown/VvDropdown.vue +0 -4
- package/src/components/VvIcon/VvIcon.vue +0 -2
- package/src/components/VvInputText/VvInputClearAction.ts +0 -1
- package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
- package/src/components/VvInputText/VvInputStepAction.ts +0 -1
- package/src/components/VvInputText/VvInputText.vue +1 -16
- package/src/components/VvInputText/VvInputTextActions.ts +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -2
- package/src/components/VvRadio/VvRadio.vue +0 -3
- package/src/components/VvRadio/index.ts +0 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
- package/src/components/VvSelect/VvSelect.vue +1 -14
- package/src/components/VvTextarea/VvTextarea.vue +1 -15
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/components/common/HintSlot.ts +1 -11
- package/src/composables/group/types/IAccordionGroupState.ts +0 -1
- package/src/composables/group/types/IButtonGroupState.ts +0 -1
- package/src/composables/group/types/IInputGroup.ts +0 -1
- package/src/composables/group/useInjectedGroupState.ts +1 -2
- package/src/composables/group/useProvideGroupState.ts +0 -1
- package/src/composables/useComponentFocus.ts +1 -2
- package/src/composables/useComponentIcons.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useModifiers.ts +1 -2
- package/src/composables/useOptions.ts +0 -1
- package/src/composables/useTextCount.ts +1 -1
- package/src/stories/Accordion/Accordion.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Badge/Badge.stories.mdx +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.stories.mdx +1 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
- package/src/stories/Card/Card.stories.mdx +1 -1
- package/src/stories/Card/CardSlots.stories.mdx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.stories.mdx +1 -1
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/InputText/InputText.stories.mdx +1 -1
- package/src/stories/Progress/Progress.stories.mdx +1 -1
- package/src/stories/Radio/Radio.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Select/Select.stories.mdx +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -1,112 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nanoid as
|
|
3
|
-
import { iconExists as
|
|
4
|
-
|
|
5
|
-
return r ? E(e, r) === E(t, r) : B(e, t);
|
|
6
|
-
}
|
|
7
|
-
function B(e, t) {
|
|
8
|
-
if (e === t)
|
|
9
|
-
return !0;
|
|
10
|
-
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
11
|
-
const r = Array.isArray(e), c = Array.isArray(t);
|
|
12
|
-
let o, l, u;
|
|
13
|
-
if (r && c) {
|
|
14
|
-
if (l = e.length, l != t.length)
|
|
15
|
-
return !1;
|
|
16
|
-
for (o = l; o-- !== 0; )
|
|
17
|
-
if (!B(e[o], t[o]))
|
|
18
|
-
return !1;
|
|
19
|
-
return !0;
|
|
20
|
-
}
|
|
21
|
-
if (r != c)
|
|
22
|
-
return !1;
|
|
23
|
-
const v = e instanceof Date, s = t instanceof Date;
|
|
24
|
-
if (v != s)
|
|
25
|
-
return !1;
|
|
26
|
-
if (v && s)
|
|
27
|
-
return e.getTime() == t.getTime();
|
|
28
|
-
const a = e instanceof RegExp, n = t instanceof RegExp;
|
|
29
|
-
if (a != n)
|
|
30
|
-
return !1;
|
|
31
|
-
if (a && n)
|
|
32
|
-
return e.toString() == t.toString();
|
|
33
|
-
const i = Object.keys(e);
|
|
34
|
-
if (l = i.length, l !== Object.keys(t).length)
|
|
35
|
-
return !1;
|
|
36
|
-
for (o = l; o-- !== 0; )
|
|
37
|
-
if (!Object.prototype.hasOwnProperty.call(t, i[o]))
|
|
38
|
-
return !1;
|
|
39
|
-
for (o = l; o-- !== 0; )
|
|
40
|
-
if (u = i[o], !B(e[u], t[u]))
|
|
41
|
-
return !1;
|
|
42
|
-
return !0;
|
|
43
|
-
}
|
|
44
|
-
return e !== e && t !== t;
|
|
45
|
-
}
|
|
46
|
-
function E(e, t) {
|
|
47
|
-
if (e && Object.keys(e).length && t) {
|
|
48
|
-
if (t.indexOf(".") === -1)
|
|
49
|
-
return e[t];
|
|
50
|
-
{
|
|
51
|
-
const r = t.split(".");
|
|
52
|
-
let c = e;
|
|
53
|
-
for (let o = 0, l = r.length; o < l; ++o) {
|
|
54
|
-
if (e == null)
|
|
55
|
-
return null;
|
|
56
|
-
c = c[r[o]];
|
|
57
|
-
}
|
|
58
|
-
return c;
|
|
59
|
-
}
|
|
60
|
-
} else
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
function I(e, t) {
|
|
64
|
-
if (e != null && t && t.length) {
|
|
65
|
-
for (const r of t)
|
|
66
|
-
if (j(e, r))
|
|
67
|
-
return !0;
|
|
68
|
-
}
|
|
69
|
-
return !1;
|
|
70
|
-
}
|
|
71
|
-
function oe(e) {
|
|
72
|
-
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(g(e));
|
|
73
|
-
}
|
|
74
|
-
function M(e) {
|
|
75
|
-
var t, r;
|
|
76
|
-
if (e)
|
|
77
|
-
return (r = (t = e.match(
|
|
78
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
79
|
-
)) == null ? void 0 : t.join("-")) == null ? void 0 : r.toLowerCase();
|
|
80
|
-
}
|
|
81
|
-
const U = "ds";
|
|
82
|
-
function Z(e, t) {
|
|
83
|
-
const r = { [`${e}`]: !0 };
|
|
84
|
-
return {
|
|
85
|
-
bemCssClasses: d(() => Object.keys(t).reduce((o, l) => {
|
|
86
|
-
const u = g(t[l]) || !1;
|
|
87
|
-
if (!u)
|
|
88
|
-
return o;
|
|
89
|
-
if (l === "modifiers") {
|
|
90
|
-
const v = Array.isArray(u) ? u : u.split(" ");
|
|
91
|
-
return {
|
|
92
|
-
...o,
|
|
93
|
-
...v.reduce(
|
|
94
|
-
(s, a) => ({
|
|
95
|
-
...s,
|
|
96
|
-
[`${e}--${M(a)}`]: !0
|
|
97
|
-
}),
|
|
98
|
-
{}
|
|
99
|
-
)
|
|
100
|
-
};
|
|
101
|
-
} else
|
|
102
|
-
return {
|
|
103
|
-
...o,
|
|
104
|
-
[`${e}--${M(l)}`]: u
|
|
105
|
-
};
|
|
106
|
-
}, r) || {})
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
const se = {
|
|
1
|
+
import { defineComponent as I, unref as d, openBlock as g, createBlock as P, mergeProps as A, createCommentVNode as w, resolveDynamicComponent as E, withCtx as G, renderSlot as k, createElementBlock as O, toDisplayString as F, Fragment as j, createTextVNode as q } from "vue";
|
|
2
|
+
import { nanoid as U } from "nanoid";
|
|
3
|
+
import { iconExists as $, Icon as z, addIcon as H } from "@iconify/vue";
|
|
4
|
+
const M = "ds", J = {
|
|
110
5
|
color: String,
|
|
111
6
|
width: {
|
|
112
7
|
type: [String, Number]
|
|
@@ -137,101 +32,70 @@ const se = {
|
|
|
137
32
|
modifiers: {
|
|
138
33
|
type: [String, Array]
|
|
139
34
|
}
|
|
140
|
-
},
|
|
35
|
+
}, X = {
|
|
141
36
|
name: "VvIcon"
|
|
142
|
-
},
|
|
143
|
-
...
|
|
144
|
-
props:
|
|
145
|
-
setup(
|
|
146
|
-
const
|
|
147
|
-
modifiers:
|
|
148
|
-
}),
|
|
149
|
-
const
|
|
150
|
-
return
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
return
|
|
154
|
-
})) ||
|
|
37
|
+
}, B = /* @__PURE__ */ I({
|
|
38
|
+
...X,
|
|
39
|
+
props: J,
|
|
40
|
+
setup(t) {
|
|
41
|
+
const r = t, o = ref(!0), { modifiers: m } = toRefs(r), i = inject(M), { bemCssClasses: u } = useBemModifiers("vv-icon", {
|
|
42
|
+
modifiers: m
|
|
43
|
+
}), f = computed(() => r.provider || (i == null ? void 0 : i.provider)), b = computed(() => {
|
|
44
|
+
const e = r.name ?? "", n = `@${f.value}:${r.prefix}:${r.name}`;
|
|
45
|
+
return $(e) ? e : $(n) ? n : (i == null ? void 0 : i.iconsCollections.find((c) => {
|
|
46
|
+
const p = `@${f.value}:${c.prefix}:${e}`;
|
|
47
|
+
if ($(p))
|
|
48
|
+
return p;
|
|
49
|
+
})) || e;
|
|
155
50
|
});
|
|
156
|
-
function
|
|
157
|
-
let
|
|
51
|
+
function a(e) {
|
|
52
|
+
let n = null;
|
|
158
53
|
if (typeof window > "u") {
|
|
159
|
-
const { JSDOM:
|
|
160
|
-
|
|
54
|
+
const { JSDOM: y } = require("jsdom");
|
|
55
|
+
n = new y().window;
|
|
161
56
|
}
|
|
162
|
-
return (
|
|
57
|
+
return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
|
|
163
58
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
body:
|
|
168
|
-
height:
|
|
169
|
-
width:
|
|
59
|
+
function s(e) {
|
|
60
|
+
const n = a(e), c = (n == null ? void 0 : n.innerHTML.trim()) || "";
|
|
61
|
+
n && c && H(`@${f.value}:${r.prefix}:${r.name}`, {
|
|
62
|
+
body: c,
|
|
63
|
+
height: n.viewBox.baseVal.height,
|
|
64
|
+
width: n.viewBox.baseVal.width
|
|
170
65
|
});
|
|
171
66
|
}
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
}).catch((
|
|
175
|
-
throw new Error(`During fetch icon: ${
|
|
176
|
-
})) :
|
|
67
|
+
return i && (r.src && !$(`@${f.value}:${r.prefix}:${r.name}`) ? (o.value = !1, i.fetchIcon(r.src).then((e) => {
|
|
68
|
+
e && (s(e), o.value = !0);
|
|
69
|
+
}).catch((e) => {
|
|
70
|
+
throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
|
|
71
|
+
})) : r.svg && s(r.svg)), (e, n) => d(o) ? (g(), P(d(z), A({
|
|
177
72
|
key: 0,
|
|
178
|
-
class:
|
|
73
|
+
class: d(u)
|
|
179
74
|
}, {
|
|
180
|
-
inline:
|
|
181
|
-
width:
|
|
182
|
-
height:
|
|
183
|
-
horizontalFlip:
|
|
184
|
-
verticalFlip:
|
|
185
|
-
flip:
|
|
186
|
-
rotate:
|
|
187
|
-
color:
|
|
188
|
-
onLoad:
|
|
189
|
-
icon:
|
|
190
|
-
}), null, 16, ["class"])) :
|
|
75
|
+
inline: e.inline,
|
|
76
|
+
width: e.width,
|
|
77
|
+
height: e.height,
|
|
78
|
+
horizontalFlip: e.horizontalFlip,
|
|
79
|
+
verticalFlip: e.verticalFlip,
|
|
80
|
+
flip: e.flip,
|
|
81
|
+
rotate: e.rotate,
|
|
82
|
+
color: e.color,
|
|
83
|
+
onLoad: e.onLoad,
|
|
84
|
+
icon: d(b)
|
|
85
|
+
}), null, 16, ["class"])) : w("", !0);
|
|
191
86
|
}
|
|
192
|
-
}),
|
|
87
|
+
}), x = {
|
|
193
88
|
disabled: Boolean
|
|
194
|
-
},
|
|
89
|
+
}, K = {
|
|
195
90
|
modifiers: [String, Array]
|
|
196
|
-
},
|
|
91
|
+
}, Q = {
|
|
197
92
|
unselectable: { type: Boolean, default: !0 }
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return d({
|
|
205
|
-
get() {
|
|
206
|
-
return s == null ? void 0 : s.value;
|
|
207
|
-
},
|
|
208
|
-
set(a) {
|
|
209
|
-
s.value = a;
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
const v = T(l, o);
|
|
214
|
-
return d({
|
|
215
|
-
get() {
|
|
216
|
-
return v.value;
|
|
217
|
-
},
|
|
218
|
-
set(s) {
|
|
219
|
-
u && u(`update:${o}`, s);
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
return {
|
|
224
|
-
group: t,
|
|
225
|
-
isInGroup: r,
|
|
226
|
-
getGroupOrLocalRef: c
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
const fe = "VV_BUTTON_GROUP";
|
|
230
|
-
var k = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(k || {}), x = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(x || {}), m = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(m || {}), H = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(H || {});
|
|
231
|
-
const de = ["update:modelValue"], ve = {
|
|
232
|
-
...ae,
|
|
233
|
-
...ie,
|
|
234
|
-
...ue,
|
|
93
|
+
}, W = "VV_BUTTON_GROUP";
|
|
94
|
+
var S = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(S || {}), D = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(D || {}), v = /* @__PURE__ */ ((t) => (t.nuxtLink = "nuxt-link", t.routerLink = "router-link", t.a = "a", t.button = "button", t))(v || {}), N = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(N || {});
|
|
95
|
+
const Y = ["update:modelValue"], Z = {
|
|
96
|
+
...K,
|
|
97
|
+
...x,
|
|
98
|
+
...Q,
|
|
235
99
|
icon: {
|
|
236
100
|
type: [String, Object],
|
|
237
101
|
default: ""
|
|
@@ -239,7 +103,7 @@ const de = ["update:modelValue"], ve = {
|
|
|
239
103
|
iconPosition: {
|
|
240
104
|
type: String,
|
|
241
105
|
default: "left",
|
|
242
|
-
validator: (
|
|
106
|
+
validator: (t) => t in S
|
|
243
107
|
},
|
|
244
108
|
label: [String, Number],
|
|
245
109
|
loading: Boolean,
|
|
@@ -254,7 +118,7 @@ const de = ["update:modelValue"], ve = {
|
|
|
254
118
|
href: String,
|
|
255
119
|
target: {
|
|
256
120
|
type: String,
|
|
257
|
-
validator: (
|
|
121
|
+
validator: (t) => t in N
|
|
258
122
|
},
|
|
259
123
|
active: Boolean,
|
|
260
124
|
pressed: Boolean,
|
|
@@ -265,7 +129,7 @@ const de = ["update:modelValue"], ve = {
|
|
|
265
129
|
type: {
|
|
266
130
|
type: String,
|
|
267
131
|
default: "button",
|
|
268
|
-
validator: (
|
|
132
|
+
validator: (t) => t in D
|
|
269
133
|
},
|
|
270
134
|
toggle: {
|
|
271
135
|
type: Boolean,
|
|
@@ -273,160 +137,160 @@ const de = ["update:modelValue"], ve = {
|
|
|
273
137
|
},
|
|
274
138
|
modelValue: String
|
|
275
139
|
};
|
|
276
|
-
function
|
|
277
|
-
var
|
|
278
|
-
const { group:
|
|
279
|
-
iconPosition:
|
|
280
|
-
icon:
|
|
281
|
-
label:
|
|
282
|
-
pressed:
|
|
283
|
-
modifiers:
|
|
284
|
-
} =
|
|
140
|
+
function T(t, r) {
|
|
141
|
+
var _;
|
|
142
|
+
const { group: o, isInGroup: m, getGroupOrLocalRef: i } = useInjectedGroupState(W), {
|
|
143
|
+
iconPosition: u,
|
|
144
|
+
icon: f,
|
|
145
|
+
label: b,
|
|
146
|
+
pressed: a,
|
|
147
|
+
modifiers: s
|
|
148
|
+
} = toRefs(t), e = i("modelValue", t, r), n = i("disabled", t), c = i("toggle", t), p = i(
|
|
285
149
|
"unselectable",
|
|
286
|
-
|
|
287
|
-
),
|
|
288
|
-
var
|
|
289
|
-
const
|
|
290
|
-
return [...
|
|
150
|
+
t
|
|
151
|
+
), h = ((_ = o == null ? void 0 : o.value) == null ? void 0 : _.multiple) ?? ref(!1), y = computed(() => {
|
|
152
|
+
var V;
|
|
153
|
+
const L = s != null && s.value ? Array.isArray(s.value) ? s.value : [s.value] : [], C = (V = o == null ? void 0 : o.value.itemModifiers) != null && V.value ? Array.isArray(o.value.itemModifiers.value) ? o.value.itemModifiers.value : [o.value.itemModifiers.value] : [];
|
|
154
|
+
return [...L, ...C];
|
|
291
155
|
});
|
|
292
156
|
return {
|
|
293
|
-
group:
|
|
294
|
-
isInGroup:
|
|
295
|
-
modelValue:
|
|
296
|
-
disabled:
|
|
297
|
-
toggle:
|
|
298
|
-
unselectable:
|
|
299
|
-
multiple:
|
|
300
|
-
modifiers:
|
|
301
|
-
pressed:
|
|
302
|
-
iconPosition:
|
|
303
|
-
icon:
|
|
304
|
-
label:
|
|
157
|
+
group: o,
|
|
158
|
+
isInGroup: m,
|
|
159
|
+
modelValue: e,
|
|
160
|
+
disabled: n,
|
|
161
|
+
toggle: c,
|
|
162
|
+
unselectable: p,
|
|
163
|
+
multiple: h,
|
|
164
|
+
modifiers: y,
|
|
165
|
+
pressed: a,
|
|
166
|
+
iconPosition: u,
|
|
167
|
+
icon: f,
|
|
168
|
+
label: b
|
|
305
169
|
};
|
|
306
170
|
}
|
|
307
|
-
const
|
|
171
|
+
const ee = {
|
|
308
172
|
key: 1,
|
|
309
173
|
class: "vv-button__label"
|
|
310
|
-
},
|
|
174
|
+
}, te = {
|
|
311
175
|
key: 1,
|
|
312
176
|
class: "vv-button__label"
|
|
313
|
-
},
|
|
177
|
+
}, oe = {
|
|
314
178
|
name: "VvButton"
|
|
315
|
-
},
|
|
316
|
-
...
|
|
317
|
-
props:
|
|
318
|
-
emits:
|
|
319
|
-
setup(
|
|
320
|
-
const
|
|
321
|
-
modifiers:
|
|
322
|
-
iconPosition:
|
|
323
|
-
icon:
|
|
324
|
-
label:
|
|
325
|
-
modelValue:
|
|
326
|
-
disabled:
|
|
327
|
-
toggle:
|
|
328
|
-
unselectable:
|
|
329
|
-
} =
|
|
179
|
+
}, ie = /* @__PURE__ */ I({
|
|
180
|
+
...oe,
|
|
181
|
+
props: Z,
|
|
182
|
+
emits: Y,
|
|
183
|
+
setup(t, { emit: r }) {
|
|
184
|
+
const o = t, m = useAttrs(), i = useSlots(), u = (m == null ? void 0 : m.name) || U(), {
|
|
185
|
+
modifiers: f,
|
|
186
|
+
iconPosition: b,
|
|
187
|
+
icon: a,
|
|
188
|
+
label: s,
|
|
189
|
+
modelValue: e,
|
|
190
|
+
disabled: n,
|
|
191
|
+
toggle: c,
|
|
192
|
+
unselectable: p
|
|
193
|
+
} = T(o, r), h = inject(M), y = computed(() => {
|
|
330
194
|
switch (!0) {
|
|
331
|
-
case
|
|
332
|
-
return
|
|
333
|
-
case
|
|
334
|
-
return
|
|
335
|
-
case
|
|
336
|
-
return
|
|
195
|
+
case n.value:
|
|
196
|
+
return v.button;
|
|
197
|
+
case o.to !== void 0:
|
|
198
|
+
return h != null && h.nuxt ? v.nuxtLink : v.routerLink;
|
|
199
|
+
case o.href !== void 0:
|
|
200
|
+
return v.a;
|
|
337
201
|
default:
|
|
338
|
-
return
|
|
202
|
+
return v.button;
|
|
339
203
|
}
|
|
340
|
-
}),
|
|
341
|
-
modifiers:
|
|
342
|
-
active:
|
|
343
|
-
pressed:
|
|
344
|
-
disabled:
|
|
345
|
-
reverse:
|
|
346
|
-
() => [
|
|
347
|
-
|
|
204
|
+
}), _ = computed(() => c.value ? Array.isArray(e.value) ? contains(u, e.value) : equals(u, e.value) : o.pressed), { bemCssClasses: L } = useBemModifiers("vv-button", {
|
|
205
|
+
modifiers: f,
|
|
206
|
+
active: o.active,
|
|
207
|
+
pressed: _,
|
|
208
|
+
disabled: n,
|
|
209
|
+
reverse: computed(
|
|
210
|
+
() => [S.right, S.bottom].includes(
|
|
211
|
+
b.value
|
|
348
212
|
)
|
|
349
213
|
),
|
|
350
|
-
column:
|
|
351
|
-
() => [
|
|
352
|
-
|
|
214
|
+
column: computed(
|
|
215
|
+
() => [S.top, S.bottom].includes(
|
|
216
|
+
b.value
|
|
353
217
|
)
|
|
354
218
|
),
|
|
355
|
-
iconOnly:
|
|
356
|
-
() => (
|
|
219
|
+
iconOnly: computed(
|
|
220
|
+
() => (a == null ? void 0 : a.value) && !(s != null && s.value) && !i.default
|
|
357
221
|
)
|
|
358
|
-
}),
|
|
359
|
-
() => typeof (
|
|
360
|
-
),
|
|
361
|
-
const
|
|
362
|
-
class:
|
|
363
|
-
"aria-pressed":
|
|
222
|
+
}), C = computed(
|
|
223
|
+
() => typeof (a == null ? void 0 : a.value) == "string" ? { name: a == null ? void 0 : a.value } : a == null ? void 0 : a.value
|
|
224
|
+
), V = computed(() => {
|
|
225
|
+
const l = {
|
|
226
|
+
class: L.value,
|
|
227
|
+
"aria-pressed": _.value ? !0 : void 0
|
|
364
228
|
};
|
|
365
|
-
switch (
|
|
366
|
-
case
|
|
229
|
+
switch (y.value) {
|
|
230
|
+
case v.a:
|
|
367
231
|
return {
|
|
368
|
-
...
|
|
232
|
+
...l,
|
|
369
233
|
role: "button",
|
|
370
|
-
href:
|
|
371
|
-
target:
|
|
372
|
-
rel:
|
|
234
|
+
href: o.href,
|
|
235
|
+
target: o.target,
|
|
236
|
+
rel: o.rel
|
|
373
237
|
};
|
|
374
|
-
case
|
|
375
|
-
case
|
|
238
|
+
case v.routerLink:
|
|
239
|
+
case v.nuxtLink:
|
|
376
240
|
return {
|
|
377
|
-
...
|
|
241
|
+
...l,
|
|
378
242
|
role: "button",
|
|
379
|
-
to:
|
|
380
|
-
target:
|
|
243
|
+
to: o.to,
|
|
244
|
+
target: o.target
|
|
381
245
|
};
|
|
382
246
|
default:
|
|
383
247
|
return {
|
|
384
|
-
...
|
|
385
|
-
type:
|
|
386
|
-
disabled:
|
|
248
|
+
...l,
|
|
249
|
+
type: o.type,
|
|
250
|
+
disabled: n.value
|
|
387
251
|
};
|
|
388
252
|
}
|
|
389
|
-
}),
|
|
390
|
-
if (
|
|
391
|
-
if (Array.isArray(
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
(
|
|
253
|
+
}), R = () => {
|
|
254
|
+
if (c.value) {
|
|
255
|
+
if (Array.isArray(e.value)) {
|
|
256
|
+
if (contains(u, e.value)) {
|
|
257
|
+
p.value && (e.value = e.value.filter(
|
|
258
|
+
(l) => l !== u
|
|
395
259
|
));
|
|
396
260
|
return;
|
|
397
261
|
}
|
|
398
|
-
|
|
262
|
+
e.value.push(u);
|
|
399
263
|
return;
|
|
400
264
|
}
|
|
401
|
-
if (
|
|
402
|
-
|
|
265
|
+
if (equals(u, e.value) && p.value) {
|
|
266
|
+
e.value = void 0;
|
|
403
267
|
return;
|
|
404
268
|
}
|
|
405
|
-
|
|
269
|
+
e.value = u;
|
|
406
270
|
}
|
|
407
271
|
};
|
|
408
|
-
return (
|
|
409
|
-
default:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
272
|
+
return (l, ne) => (g(), P(E(d(y)), A(d(V), { onClickPassive: R }), {
|
|
273
|
+
default: G(() => [
|
|
274
|
+
k(l.$slots, "default", {}, () => [
|
|
275
|
+
l.loading ? k(l.$slots, "loading", { key: 0 }, () => [
|
|
276
|
+
l.loadingIcon ? (g(), P(B, {
|
|
413
277
|
key: 0,
|
|
414
278
|
class: "vv-button__loading-icon",
|
|
415
|
-
name:
|
|
416
|
-
}, null, 8, ["name"])) :
|
|
417
|
-
|
|
418
|
-
]) : (
|
|
419
|
-
|
|
420
|
-
|
|
279
|
+
name: l.loadingIcon
|
|
280
|
+
}, null, 8, ["name"])) : w("", !0),
|
|
281
|
+
l.loadingLabel ? (g(), O("span", ee, F(l.loadingLabel), 1)) : w("", !0)
|
|
282
|
+
]) : (g(), O(j, { key: 1 }, [
|
|
283
|
+
k(l.$slots, "before"),
|
|
284
|
+
d(a) ? (g(), P(B, A({
|
|
421
285
|
key: 0,
|
|
422
286
|
class: "vv-button__icon"
|
|
423
|
-
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
287
|
+
}, d(C)), null, 16)) : w("", !0),
|
|
288
|
+
d(s) ? (g(), O("span", te, [
|
|
289
|
+
k(l.$slots, "label", {}, () => [
|
|
290
|
+
q(F(d(s)), 1)
|
|
427
291
|
])
|
|
428
|
-
])) :
|
|
429
|
-
|
|
292
|
+
])) : w("", !0),
|
|
293
|
+
k(l.$slots, "after")
|
|
430
294
|
], 64))
|
|
431
295
|
])
|
|
432
296
|
]),
|
|
@@ -435,5 +299,5 @@ const pe = {
|
|
|
435
299
|
}
|
|
436
300
|
});
|
|
437
301
|
export {
|
|
438
|
-
|
|
302
|
+
ie as default
|
|
439
303
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,k){typeof exports=="object"&&typeof module<"u"?module.exports=k(require("vue"),require("nanoid"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","nanoid","@iconify/vue"],k):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButton=k(e.vue,e.nanoid,e.vue$1))})(this,function(e,k,v){"use strict";const P="ds",N={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]}},E={name:"VvIcon"},C=e.defineComponent({...E,props:N,setup(n){const i=n,o=ref(!0),{modifiers:g}=toRefs(i),a=inject(P),{bemCssClasses:u}=useBemModifiers("vv-icon",{modifiers:g}),p=computed(()=>i.provider||(a==null?void 0:a.provider)),h=computed(()=>{const t=i.name??"",r=`@${p.value}:${i.prefix}:${i.name}`;return v.iconExists(t)?t:v.iconExists(r)?r:(a==null?void 0:a.iconsCollections.find(d=>{const m=`@${p.value}:${d.prefix}:${t}`;if(v.iconExists(m))return m}))||t});function l(t){let r=null;if(typeof window>"u"){const{JSDOM:S}=require("jsdom");r=new S().window}return(r?new r.DOMParser:new window.DOMParser).parseFromString(t,"text/html").querySelector("svg")}function c(t){const r=l(t),d=(r==null?void 0:r.innerHTML.trim())||"";r&&d&&v.addIcon(`@${p.value}:${i.prefix}:${i.name}`,{body:d,height:r.viewBox.baseVal.height,width:r.viewBox.baseVal.width})}return a&&(i.src&&!v.iconExists(`@${p.value}:${i.prefix}:${i.name}`)?(o.value=!1,a.fetchIcon(i.src).then(t=>{t&&(c(t),o.value=!0)}).catch(t=>{throw new Error(`During fetch icon: ${t==null?void 0:t.message}`)})):i.svg&&c(i.svg)),(t,r)=>e.unref(o)?(e.openBlock(),e.createBlock(e.unref(v.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:t.rotate,color:t.color,onLoad:t.onLoad,icon:e.unref(h)}),null,16,["class"])):e.createCommentVNode("",!0)}}),O={disabled:Boolean},A={modifiers:[String,Array]},F={unselectable:{type:Boolean,default:!0}},D="VV_BUTTON_GROUP";var b=(n=>(n.left="left",n.right="right",n.top="top",n.bottom="bottom",n))(b||{}),L=(n=>(n.button="button",n.submit="submit",n.reset="reset",n))(L||{}),f=(n=>(n.nuxtLink="nuxt-link",n.routerLink="router-link",n.a="a",n.button="button",n))(f||{}),$=(n=>(n._blank="_blank",n._self="_self",n._parent="_parent",n._top="_top",n))($||{});const I=["update:modelValue"],M={...A,...O,...F,icon:{type:[String,Object],default:""},iconPosition:{type:String,default:"left",validator:n=>n in b},label:[String,Number],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:n=>n in $},active:Boolean,pressed:Boolean,rel:{type:String,default:"noopener noreferrer"},type:{type:String,default:"button",validator:n=>n in L},toggle:{type:Boolean,default:!1},modelValue:String};function q(n,i){var V;const{group:o,isInGroup:g,getGroupOrLocalRef:a}=useInjectedGroupState(D),{iconPosition:u,icon:p,label:h,pressed:l,modifiers:c}=toRefs(n),t=a("modelValue",n,i),r=a("disabled",n),d=a("toggle",n),m=a("unselectable",n),y=((V=o==null?void 0:o.value)==null?void 0:V.multiple)??ref(!1),S=computed(()=>{var _;const w=c!=null&&c.value?Array.isArray(c.value)?c.value:[c.value]:[],B=(_=o==null?void 0:o.value.itemModifiers)!=null&&_.value?Array.isArray(o.value.itemModifiers.value)?o.value.itemModifiers.value:[o.value.itemModifiers.value]:[];return[...w,...B]});return{group:o,isInGroup:g,modelValue:t,disabled:r,toggle:d,unselectable:m,multiple:y,modifiers:S,pressed:l,iconPosition:u,icon:p,label:h}}const R={key:1,class:"vv-button__label"},j={key:1,class:"vv-button__label"},G={name:"VvButton"};return e.defineComponent({...G,props:M,emits:I,setup(n,{emit:i}){const o=n,g=useAttrs(),a=useSlots(),u=(g==null?void 0:g.name)||k.nanoid(),{modifiers:p,iconPosition:h,icon:l,label:c,modelValue:t,disabled:r,toggle:d,unselectable:m}=q(o,i),y=inject(P),S=computed(()=>{switch(!0){case r.value:return f.button;case o.to!==void 0:return y!=null&&y.nuxt?f.nuxtLink:f.routerLink;case o.href!==void 0:return f.a;default:return f.button}}),V=computed(()=>d.value?Array.isArray(t.value)?contains(u,t.value):equals(u,t.value):o.pressed),{bemCssClasses:w}=useBemModifiers("vv-button",{modifiers:p,active:o.active,pressed:V,disabled:r,reverse:computed(()=>[b.right,b.bottom].includes(h.value)),column:computed(()=>[b.top,b.bottom].includes(h.value)),iconOnly:computed(()=>(l==null?void 0:l.value)&&!(c!=null&&c.value)&&!a.default)}),B=computed(()=>typeof(l==null?void 0:l.value)=="string"?{name:l==null?void 0:l.value}:l==null?void 0:l.value),_=computed(()=>{const s={class:w.value,"aria-pressed":V.value?!0:void 0};switch(S.value){case f.a:return{...s,role:"button",href:o.href,target:o.target,rel:o.rel};case f.routerLink:case f.nuxtLink:return{...s,role:"button",to:o.to,target:o.target};default:return{...s,type:o.type,disabled:r.value}}}),U=()=>{if(d.value){if(Array.isArray(t.value)){if(contains(u,t.value)){m.value&&(t.value=t.value.filter(s=>s!==u));return}t.value.push(u);return}if(equals(u,t.value)&&m.value){t.value=void 0;return}t.value=u}};return(s,z)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(S)),e.mergeProps(e.unref(_),{onClickPassive:U}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[s.loading?e.renderSlot(s.$slots,"loading",{key:0},()=>[s.loadingIcon?(e.openBlock(),e.createBlock(C,{key:0,class:"vv-button__loading-icon",name:s.loadingIcon},null,8,["name"])):e.createCommentVNode("",!0),s.loadingLabel?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(s.loadingLabel),1)):e.createCommentVNode("",!0)]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(s.$slots,"before"),e.unref(l)?(e.openBlock(),e.createBlock(C,e.mergeProps({key:0,class:"vv-button__icon"},e.unref(B)),null,16)):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("span",j,[e.renderSlot(s.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)])])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"after")],64))])]),_:3},16))}})});
|