@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,148 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nanoid as
|
|
3
|
-
|
|
4
|
-
return e ? _(r, e) === _(t, e) : C(r, t);
|
|
5
|
-
}
|
|
6
|
-
function C(r, t) {
|
|
7
|
-
if (r === t)
|
|
8
|
-
return !0;
|
|
9
|
-
if (r && t && typeof r == "object" && typeof t == "object") {
|
|
10
|
-
const e = Array.isArray(r), s = Array.isArray(t);
|
|
11
|
-
let n, u, l;
|
|
12
|
-
if (e && s) {
|
|
13
|
-
if (u = r.length, u != t.length)
|
|
14
|
-
return !1;
|
|
15
|
-
for (n = u; n-- !== 0; )
|
|
16
|
-
if (!C(r[n], t[n]))
|
|
17
|
-
return !1;
|
|
18
|
-
return !0;
|
|
19
|
-
}
|
|
20
|
-
if (e != s)
|
|
21
|
-
return !1;
|
|
22
|
-
const i = r instanceof Date, d = t instanceof Date;
|
|
23
|
-
if (i != d)
|
|
24
|
-
return !1;
|
|
25
|
-
if (i && d)
|
|
26
|
-
return r.getTime() == t.getTime();
|
|
27
|
-
const f = r instanceof RegExp, g = t instanceof RegExp;
|
|
28
|
-
if (f != g)
|
|
29
|
-
return !1;
|
|
30
|
-
if (f && g)
|
|
31
|
-
return r.toString() == t.toString();
|
|
32
|
-
const m = Object.keys(r);
|
|
33
|
-
if (u = m.length, u !== Object.keys(t).length)
|
|
34
|
-
return !1;
|
|
35
|
-
for (n = u; n-- !== 0; )
|
|
36
|
-
if (!Object.prototype.hasOwnProperty.call(t, m[n]))
|
|
37
|
-
return !1;
|
|
38
|
-
for (n = u; n-- !== 0; )
|
|
39
|
-
if (l = m[n], !C(r[l], t[l]))
|
|
40
|
-
return !1;
|
|
41
|
-
return !0;
|
|
42
|
-
}
|
|
43
|
-
return r !== r && t !== t;
|
|
44
|
-
}
|
|
45
|
-
function _(r, t) {
|
|
46
|
-
if (r && Object.keys(r).length && t) {
|
|
47
|
-
if (t.indexOf(".") === -1)
|
|
48
|
-
return r[t];
|
|
49
|
-
{
|
|
50
|
-
const e = t.split(".");
|
|
51
|
-
let s = r;
|
|
52
|
-
for (let n = 0, u = e.length; n < u; ++n) {
|
|
53
|
-
if (r == null)
|
|
54
|
-
return null;
|
|
55
|
-
s = s[e[n]];
|
|
56
|
-
}
|
|
57
|
-
return s;
|
|
58
|
-
}
|
|
59
|
-
} else
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
function P(r, t) {
|
|
63
|
-
let e = -1;
|
|
64
|
-
if (t) {
|
|
65
|
-
for (let s = 0; s < t.length; s++)
|
|
66
|
-
if (A(t[s], r)) {
|
|
67
|
-
e = s;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return e;
|
|
72
|
-
}
|
|
73
|
-
function h(r, t) {
|
|
74
|
-
if (r != null && t && t.length) {
|
|
75
|
-
for (const e of t)
|
|
76
|
-
if (A(r, e))
|
|
77
|
-
return !0;
|
|
78
|
-
}
|
|
79
|
-
return !1;
|
|
80
|
-
}
|
|
81
|
-
function F(r, t) {
|
|
82
|
-
const e = P(r, t);
|
|
83
|
-
return e > -1 ? t.filter((s, n) => n !== e) : t;
|
|
84
|
-
}
|
|
85
|
-
function S(r) {
|
|
86
|
-
var t, e;
|
|
87
|
-
if (r)
|
|
88
|
-
return (e = (t = r.match(
|
|
89
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
90
|
-
)) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
|
|
91
|
-
}
|
|
92
|
-
function I(r, t) {
|
|
93
|
-
const e = { [`${r}`]: !0 };
|
|
94
|
-
return {
|
|
95
|
-
bemCssClasses: B(() => Object.keys(t).reduce((n, u) => {
|
|
96
|
-
const l = a(t[u]) || !1;
|
|
97
|
-
if (!l)
|
|
98
|
-
return n;
|
|
99
|
-
if (u === "modifiers") {
|
|
100
|
-
const i = Array.isArray(l) ? l : l.split(" ");
|
|
101
|
-
return {
|
|
102
|
-
...n,
|
|
103
|
-
...i.reduce(
|
|
104
|
-
(d, f) => ({
|
|
105
|
-
...d,
|
|
106
|
-
[`${r}--${S(f)}`]: !0
|
|
107
|
-
}),
|
|
108
|
-
{}
|
|
109
|
-
)
|
|
110
|
-
};
|
|
111
|
-
} else
|
|
112
|
-
return {
|
|
113
|
-
...n,
|
|
114
|
-
[`${r}--${S(u)}`]: l
|
|
115
|
-
};
|
|
116
|
-
}, e) || {})
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function K(r) {
|
|
120
|
-
const { options: t, labelKey: e, valueKey: s } = N(r);
|
|
121
|
-
return {
|
|
122
|
-
options: t,
|
|
123
|
-
getOptionLabel: (l) => typeof l != "object" && l !== null ? l : typeof e.value == "function" ? e.value(l) : l[e.value],
|
|
124
|
-
getOptionValue: (l) => typeof l != "object" && l !== null ? l : typeof s.value == "function" ? s.value(l) : l[s.value]
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const M = {
|
|
1
|
+
import { defineComponent as N, openBlock as s, createElementBlock as i, unref as l, normalizeClass as S, createElementVNode as m, toDisplayString as f, createCommentVNode as v, Fragment as C, renderList as w, withModifiers as A, createTextVNode as B } from "vue";
|
|
2
|
+
import { nanoid as D } from "nanoid";
|
|
3
|
+
const O = {
|
|
128
4
|
disabled: Boolean
|
|
129
|
-
},
|
|
5
|
+
}, P = {
|
|
130
6
|
modifiers: [String, Array]
|
|
131
|
-
},
|
|
7
|
+
}, $ = {
|
|
132
8
|
options: {
|
|
133
9
|
type: Array,
|
|
134
10
|
default: () => []
|
|
135
11
|
},
|
|
136
12
|
labelKey: { type: [String, Function], default: "label" },
|
|
137
13
|
valueKey: { type: [String, Function], default: "value" }
|
|
138
|
-
},
|
|
14
|
+
}, F = {
|
|
139
15
|
id: [String, Number],
|
|
140
16
|
name: { type: String, required: !0 }
|
|
141
|
-
},
|
|
142
|
-
...
|
|
143
|
-
|
|
144
|
-
...
|
|
145
|
-
...
|
|
17
|
+
}, R = {
|
|
18
|
+
...F,
|
|
19
|
+
...$,
|
|
20
|
+
...O,
|
|
21
|
+
...P,
|
|
146
22
|
modelValue: {
|
|
147
23
|
type: [String, Number, Boolean, Object, Array]
|
|
148
24
|
},
|
|
@@ -150,78 +26,78 @@ const M = {
|
|
|
150
26
|
multiple: Boolean,
|
|
151
27
|
maxValues: [Number, String],
|
|
152
28
|
unselectable: { type: Boolean, default: !0 }
|
|
153
|
-
},
|
|
29
|
+
}, q = ["id"], x = {
|
|
154
30
|
key: 0,
|
|
155
31
|
role: "option"
|
|
156
|
-
},
|
|
32
|
+
}, I = ["aria-selected"], L = ["for", "onClick"], M = ["id", "type", "value", "checked", "disabled", "name"], E = {
|
|
157
33
|
name: "VvDropdown"
|
|
158
|
-
},
|
|
159
|
-
...
|
|
160
|
-
props:
|
|
34
|
+
}, T = /* @__PURE__ */ N({
|
|
35
|
+
...E,
|
|
36
|
+
props: R,
|
|
161
37
|
emits: ["update:modelValue"],
|
|
162
|
-
setup(
|
|
163
|
-
const
|
|
164
|
-
modifiers:
|
|
165
|
-
disabled:
|
|
38
|
+
setup(b, { emit: V }) {
|
|
39
|
+
const t = b, d = computed(() => String(t.id || D())), { modifiers: y, disabled: c } = toRefs(t), { getOptionLabel: g, getOptionValue: a } = useOptions(t), { bemCssClasses: h } = useBemModifiers("vv-dropdown", {
|
|
40
|
+
modifiers: y,
|
|
41
|
+
disabled: c
|
|
166
42
|
});
|
|
167
|
-
function
|
|
168
|
-
return Array.isArray(
|
|
43
|
+
function p(e) {
|
|
44
|
+
return Array.isArray(t.modelValue) ? contains(e, t.modelValue) || contains(a(e), t.modelValue) : equals(e, t.modelValue) || equals(a(e), t.modelValue);
|
|
169
45
|
}
|
|
170
|
-
function
|
|
171
|
-
return typeof
|
|
46
|
+
function _(e) {
|
|
47
|
+
return typeof e == "string" || e.disabled === void 0 ? c.value : e.disabled;
|
|
172
48
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
49
|
+
function k(e) {
|
|
50
|
+
var n;
|
|
51
|
+
if (t.disabled)
|
|
176
52
|
return;
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
179
|
-
if (Array.isArray(
|
|
180
|
-
if (
|
|
53
|
+
let r = e;
|
|
54
|
+
if (t.multiple)
|
|
55
|
+
if (Array.isArray(t.modelValue)) {
|
|
56
|
+
if (t.maxValues !== void 0 && t.maxValues >= 0 && ((n = t.modelValue) == null ? void 0 : n.length) >= t.maxValues && !contains(e, t.modelValue))
|
|
181
57
|
return;
|
|
182
|
-
|
|
58
|
+
r = contains(e, t.modelValue) ? removeFromList(e, t.modelValue) : [...t.modelValue, e];
|
|
183
59
|
} else
|
|
184
|
-
|
|
60
|
+
r = [e];
|
|
185
61
|
else
|
|
186
|
-
|
|
187
|
-
|
|
62
|
+
t.unselectable && e === t.modelValue && (r = void 0);
|
|
63
|
+
V("update:modelValue", r);
|
|
188
64
|
}
|
|
189
|
-
return (
|
|
190
|
-
var
|
|
191
|
-
return
|
|
192
|
-
id:
|
|
193
|
-
class:
|
|
65
|
+
return (e, r) => {
|
|
66
|
+
var n;
|
|
67
|
+
return s(), i("ul", {
|
|
68
|
+
id: l(d),
|
|
69
|
+
class: S(l(h)),
|
|
194
70
|
role: "listbox"
|
|
195
71
|
}, [
|
|
196
|
-
(
|
|
197
|
-
|
|
72
|
+
(n = e.options) != null && n.length ? v("", !0) : (s(), i("li", x, [
|
|
73
|
+
m("label", null, f(e.labelNoResults), 1)
|
|
198
74
|
])),
|
|
199
|
-
(
|
|
200
|
-
key:
|
|
75
|
+
(s(!0), i(C, null, w(e.options, (o, u) => (s(), i("li", {
|
|
76
|
+
key: u,
|
|
201
77
|
role: "option",
|
|
202
|
-
"aria-selected":
|
|
78
|
+
"aria-selected": p(o)
|
|
203
79
|
}, [
|
|
204
|
-
|
|
205
|
-
for: `dropdown-${
|
|
206
|
-
onClick:
|
|
80
|
+
m("label", {
|
|
81
|
+
for: `dropdown-${u}-${l(d)}`,
|
|
82
|
+
onClick: A((K) => k(l(a)(o)), ["prevent"])
|
|
207
83
|
}, [
|
|
208
|
-
|
|
209
|
-
id: `dropdown-${
|
|
210
|
-
type:
|
|
211
|
-
value: a
|
|
212
|
-
checked:
|
|
213
|
-
disabled:
|
|
214
|
-
name:
|
|
84
|
+
m("input", {
|
|
85
|
+
id: `dropdown-${u}-${l(d)}`,
|
|
86
|
+
type: e.multiple ? "checkbox" : "radio",
|
|
87
|
+
value: l(a)(o),
|
|
88
|
+
checked: p(o),
|
|
89
|
+
disabled: _(o),
|
|
90
|
+
name: e.name,
|
|
215
91
|
tabindex: "-1",
|
|
216
92
|
"aria-hidden": "true"
|
|
217
|
-
}, null, 8,
|
|
218
|
-
|
|
219
|
-
], 8,
|
|
220
|
-
], 8,
|
|
221
|
-
], 10,
|
|
93
|
+
}, null, 8, M),
|
|
94
|
+
B(" " + f(l(g)(o)), 1)
|
|
95
|
+
], 8, L)
|
|
96
|
+
], 8, I))), 128))
|
|
97
|
+
], 10, q);
|
|
222
98
|
};
|
|
223
99
|
}
|
|
224
100
|
});
|
|
225
101
|
export {
|
|
226
|
-
|
|
102
|
+
T as default
|
|
227
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue"),require("nanoid")):typeof define=="function"&&define.amd?define(["vue","nanoid"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.VvDropdown=l(e.vue,e.nanoid))})(this,function(e,l){"use strict";const m={...{id:[String,Number],name:{type:String,required:!0}},...{options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"}},...{disabled:Boolean},...{modifiers:[String,Array]},modelValue:{type:[String,Number,Boolean,Object,Array]},labelNoResults:{type:String,default:"No results"},multiple:Boolean,maxValues:[Number,String],unselectable:{type:Boolean,default:!0}},p=["id"],f={key:0,role:"option"},V=["aria-selected"],b=["for","onClick"],y=["id","type","value","checked","disabled","name"],h={name:"VvDropdown"};return e.defineComponent({...h,props:m,emits:["update:modelValue"],setup(g,{emit:k}){const t=g,a=computed(()=>String(t.id||l.nanoid())),{modifiers:_,disabled:u}=toRefs(t),{getOptionLabel:B,getOptionValue:i}=useOptions(t),{bemCssClasses:N}=useBemModifiers("vv-dropdown",{modifiers:_,disabled:u});function c(o){return Array.isArray(t.modelValue)?contains(o,t.modelValue)||contains(i(o),t.modelValue):equals(o,t.modelValue)||equals(i(o),t.modelValue)}function S(o){return typeof o=="string"||o.disabled===void 0?u.value:o.disabled}function C(o){var s;if(t.disabled)return;let r=o;if(t.multiple)if(Array.isArray(t.modelValue)){if(t.maxValues!==void 0&&t.maxValues>=0&&((s=t.modelValue)==null?void 0:s.length)>=t.maxValues&&!contains(o,t.modelValue))return;r=contains(o,t.modelValue)?removeFromList(o,t.modelValue):[...t.modelValue,o]}else r=[o];else t.unselectable&&o===t.modelValue&&(r=void 0);k("update:modelValue",r)}return(o,r)=>{var s;return e.openBlock(),e.createElementBlock("ul",{id:e.unref(a),class:e.normalizeClass(e.unref(N)),role:"listbox"},[(s=o.options)!=null&&s.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",f,[e.createElementVNode("label",null,e.toDisplayString(o.labelNoResults),1)])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,(n,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,role:"option","aria-selected":c(n)},[e.createElementVNode("label",{for:`dropdown-${d}-${e.unref(a)}`,onClick:e.withModifiers(O=>C(e.unref(i)(n)),["prevent"])},[e.createElementVNode("input",{id:`dropdown-${d}-${e.unref(a)}`,type:o.multiple?"checkbox":"radio",value:e.unref(i)(n),checked:c(n),disabled:S(n),name:o.name,tabindex:"-1","aria-hidden":"true"},null,8,y),e.createTextVNode(" "+e.toDisplayString(e.unref(B)(n)),1)],8,b)],8,V))),128))],10,p)}}})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Option } from '@/types/generic';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: (
|
|
4
|
+
type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
|
|
5
5
|
};
|
|
6
6
|
labelNoResults: {
|
|
7
7
|
type: StringConstructor;
|
|
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
34
|
};
|
|
35
35
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
36
|
modelValue: {
|
|
37
|
-
type: (
|
|
37
|
+
type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
|
|
38
38
|
};
|
|
39
39
|
labelNoResults: {
|
|
40
40
|
type: StringConstructor;
|
|
@@ -3,7 +3,7 @@ export declare const VvDropdownProps: {
|
|
|
3
3
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
4
4
|
*/
|
|
5
5
|
modelValue: {
|
|
6
|
-
type: (
|
|
6
|
+
type: (StringConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor)[];
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Label of "no results" options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { iconExists as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, unref as s, openBlock as w, createBlock as S, mergeProps as $, createCommentVNode as y } from "vue";
|
|
2
|
+
import { iconExists as a, Icon as F, addIcon as B } from "@iconify/vue";
|
|
3
|
+
const b = "ds", I = {
|
|
4
4
|
color: String,
|
|
5
5
|
width: {
|
|
6
6
|
type: [String, Number]
|
|
@@ -31,80 +31,45 @@ const V = "ds", D = {
|
|
|
31
31
|
modifiers: {
|
|
32
32
|
type: [String, Array]
|
|
33
33
|
}
|
|
34
|
-
}
|
|
35
|
-
function h(i) {
|
|
36
|
-
var r, s;
|
|
37
|
-
if (i)
|
|
38
|
-
return (s = (r = i.match(
|
|
39
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
40
|
-
)) == null ? void 0 : r.join("-")) == null ? void 0 : s.toLowerCase();
|
|
41
|
-
}
|
|
42
|
-
function L(i, r) {
|
|
43
|
-
const s = { [`${i}`]: !0 };
|
|
44
|
-
return {
|
|
45
|
-
bemCssClasses: g(() => Object.keys(r).reduce((o, a) => {
|
|
46
|
-
const t = f(r[a]) || !1;
|
|
47
|
-
if (!t)
|
|
48
|
-
return o;
|
|
49
|
-
if (a === "modifiers") {
|
|
50
|
-
const d = Array.isArray(t) ? t : t.split(" ");
|
|
51
|
-
return {
|
|
52
|
-
...o,
|
|
53
|
-
...d.reduce(
|
|
54
|
-
(m, l) => ({
|
|
55
|
-
...m,
|
|
56
|
-
[`${i}--${h(l)}`]: !0
|
|
57
|
-
}),
|
|
58
|
-
{}
|
|
59
|
-
)
|
|
60
|
-
};
|
|
61
|
-
} else
|
|
62
|
-
return {
|
|
63
|
-
...o,
|
|
64
|
-
[`${i}--${h(a)}`]: t
|
|
65
|
-
};
|
|
66
|
-
}, s) || {})
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const M = {
|
|
34
|
+
}, P = {
|
|
70
35
|
name: "VvIcon"
|
|
71
|
-
},
|
|
72
|
-
...
|
|
73
|
-
props:
|
|
74
|
-
setup(
|
|
75
|
-
const
|
|
76
|
-
modifiers:
|
|
77
|
-
}),
|
|
78
|
-
const e =
|
|
79
|
-
return
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
36
|
+
}, E = /* @__PURE__ */ h({
|
|
37
|
+
...P,
|
|
38
|
+
props: I,
|
|
39
|
+
setup(u) {
|
|
40
|
+
const o = u, c = ref(!0), { modifiers: f } = toRefs(o), r = inject(b), { bemCssClasses: m } = useBemModifiers("vv-icon", {
|
|
41
|
+
modifiers: f
|
|
42
|
+
}), i = computed(() => o.provider || (r == null ? void 0 : r.provider)), d = computed(() => {
|
|
43
|
+
const e = o.name ?? "", n = `@${i.value}:${o.prefix}:${o.name}`;
|
|
44
|
+
return a(e) ? e : a(n) ? n : (r == null ? void 0 : r.iconsCollections.find((t) => {
|
|
45
|
+
const l = `@${i.value}:${t.prefix}:${e}`;
|
|
46
|
+
if (a(l))
|
|
47
|
+
return l;
|
|
83
48
|
})) || e;
|
|
84
49
|
});
|
|
85
|
-
function
|
|
50
|
+
function g(e) {
|
|
86
51
|
let n = null;
|
|
87
52
|
if (typeof window > "u") {
|
|
88
|
-
const { JSDOM:
|
|
89
|
-
n = new
|
|
53
|
+
const { JSDOM: v } = require("jsdom");
|
|
54
|
+
n = new v().window;
|
|
90
55
|
}
|
|
91
56
|
return (n ? new n.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
|
|
92
57
|
}
|
|
93
|
-
function
|
|
94
|
-
const n =
|
|
95
|
-
n &&
|
|
96
|
-
body:
|
|
58
|
+
function p(e) {
|
|
59
|
+
const n = g(e), t = (n == null ? void 0 : n.innerHTML.trim()) || "";
|
|
60
|
+
n && t && B(`@${i.value}:${o.prefix}:${o.name}`, {
|
|
61
|
+
body: t,
|
|
97
62
|
height: n.viewBox.baseVal.height,
|
|
98
63
|
width: n.viewBox.baseVal.width
|
|
99
64
|
});
|
|
100
65
|
}
|
|
101
|
-
return
|
|
102
|
-
e && (
|
|
66
|
+
return r && (o.src && !a(`@${i.value}:${o.prefix}:${o.name}`) ? (c.value = !1, r.fetchIcon(o.src).then((e) => {
|
|
67
|
+
e && (p(e), c.value = !0);
|
|
103
68
|
}).catch((e) => {
|
|
104
69
|
throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
|
|
105
|
-
})) :
|
|
70
|
+
})) : o.svg && p(o.svg)), (e, n) => s(c) ? (w(), S(s(F), $({
|
|
106
71
|
key: 0,
|
|
107
|
-
class:
|
|
72
|
+
class: s(m)
|
|
108
73
|
}, {
|
|
109
74
|
inline: e.inline,
|
|
110
75
|
width: e.width,
|
|
@@ -115,10 +80,10 @@ const M = {
|
|
|
115
80
|
rotate: e.rotate,
|
|
116
81
|
color: e.color,
|
|
117
82
|
onLoad: e.onLoad,
|
|
118
|
-
icon:
|
|
119
|
-
}), null, 16, ["class"])) :
|
|
83
|
+
icon: s(d)
|
|
84
|
+
}), null, 16, ["class"])) : y("", !0);
|
|
120
85
|
}
|
|
121
86
|
});
|
|
122
87
|
export {
|
|
123
|
-
|
|
88
|
+
E as default
|
|
124
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,
|
|
1
|
+
(function(n,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],r):(n=typeof globalThis<"u"?globalThis:n||self,n.VvIcon=r(n.vue,n.vue$1))})(this,function(n,r){"use strict";const d="ds",u={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]}},p={name:"VvIcon"};return n.defineComponent({...p,props:u,setup(m){const o=m,l=ref(!0),{modifiers:g}=toRefs(o),t=inject(d),{bemCssClasses:h}=useBemModifiers("vv-icon",{modifiers:g}),c=computed(()=>o.provider||(t==null?void 0:t.provider)),v=computed(()=>{const e=o.name??"",i=`@${c.value}:${o.prefix}:${o.name}`;return r.iconExists(e)?e:r.iconExists(i)?i:(t==null?void 0:t.iconsCollections.find(s=>{const a=`@${c.value}:${s.prefix}:${e}`;if(r.iconExists(a))return a}))||e});function w(e){let i=null;if(typeof window>"u"){const{JSDOM:S}=require("jsdom");i=new S().window}return(i?new i.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}function f(e){const i=w(e),s=(i==null?void 0:i.innerHTML.trim())||"";i&&s&&r.addIcon(`@${c.value}:${o.prefix}:${o.name}`,{body:s,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return t&&(o.src&&!r.iconExists(`@${c.value}:${o.prefix}:${o.name}`)?(l.value=!1,t.fetchIcon(o.src).then(e=>{e&&(f(e),l.value=!0)}).catch(e=>{throw new Error(`During fetch icon: ${e==null?void 0:e.message}`)})):o.svg&&f(o.svg)),(e,i)=>n.unref(l)?(n.openBlock(),n.createBlock(n.unref(r.Icon),n.mergeProps({key:0,class:n.unref(h)},{inline:e.inline,width:e.width,height:e.height,horizontalFlip:e.horizontalFlip,verticalFlip:e.verticalFlip,flip:e.flip,rotate:e.rotate,color:e.color,onLoad:e.onLoad,icon:n.unref(v)}),null,16,["class"])):n.createCommentVNode("",!0)}})});
|