@volverjs/ui-vue 0.0.3 → 0.0.4
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/LICENSE +1 -1
- package/README.md +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/package.json +60 -34
- package/src/Volver.ts +12 -5
- 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/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.stories.mdx +2 -1
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { iconExists as D, Icon as
|
|
3
|
-
|
|
1
|
+
import { inject as ye, computed as u, unref as c, defineComponent as T, ref as x, toRefs as C, openBlock as b, createBlock as M, mergeProps as N, createCommentVNode as B, h as be, watch as ee, useSlots as me, createElementBlock as S, normalizeClass as he, toDisplayString as q, createElementVNode as H, renderSlot as Y, normalizeProps as G, guardReactiveProps as Q, withDirectives as Se, isRef as Be, Fragment as _e, renderList as Oe, vModelSelect as Ie, createVNode as Ve } from "vue";
|
|
2
|
+
import { iconExists as D, Icon as je, addIcon as $e } from "@iconify/vue";
|
|
3
|
+
import { toReactive as Pe, useFocus as we, useElementVisibility as Ae } from "@vueuse/core";
|
|
4
|
+
import { nanoid as Fe } from "nanoid";
|
|
5
|
+
const ke = {
|
|
4
6
|
/**
|
|
5
7
|
* Color
|
|
6
8
|
*/
|
|
@@ -93,91 +95,132 @@ const me = {
|
|
|
93
95
|
modifiers: {
|
|
94
96
|
type: [String, Array]
|
|
95
97
|
}
|
|
96
|
-
}
|
|
98
|
+
};
|
|
99
|
+
var _ = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(_ || {}), te = /* @__PURE__ */ ((e) => (e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e))(te || {}), P = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(P || {}), K = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(K || {}), re = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(re || {});
|
|
100
|
+
const De = Symbol.for("volver");
|
|
101
|
+
function Ee() {
|
|
102
|
+
return ye(De);
|
|
103
|
+
}
|
|
104
|
+
function oe(e, t, r) {
|
|
105
|
+
return u(() => {
|
|
106
|
+
const n = {
|
|
107
|
+
[e]: !0
|
|
108
|
+
}, i = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
|
|
109
|
+
return i && Array.isArray(i) && i.forEach((d) => {
|
|
110
|
+
n[`${e}--${d}`] = !0;
|
|
111
|
+
}), r && Object.keys(r.value).forEach((d) => {
|
|
112
|
+
n[`${e}--${d}`] = c(r.value[d]);
|
|
113
|
+
}), n;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const Ne = {
|
|
97
117
|
name: "VvIcon"
|
|
98
|
-
},
|
|
99
|
-
...
|
|
100
|
-
props:
|
|
118
|
+
}, X = /* @__PURE__ */ T({
|
|
119
|
+
...Ne,
|
|
120
|
+
props: ke,
|
|
101
121
|
setup(e) {
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
return D(
|
|
105
|
-
(
|
|
106
|
-
const
|
|
107
|
-
if (D(
|
|
108
|
-
return
|
|
122
|
+
const t = e, r = x(!0), n = Ee(), { modifiers: i } = C(t), d = oe("vv-icon", i), a = u(() => t.provider || (n == null ? void 0 : n.provider)), m = u(() => {
|
|
123
|
+
const o = t.name ?? "", l = `@${a.value}:${t.prefix}:${t.name}`;
|
|
124
|
+
return D(o) ? o : D(l) ? l : (n == null ? void 0 : n.iconsCollections.find(
|
|
125
|
+
(g) => {
|
|
126
|
+
const v = `@${a.value}:${g.prefix}:${o}`;
|
|
127
|
+
if (D(v))
|
|
128
|
+
return v;
|
|
109
129
|
}
|
|
110
|
-
)) ||
|
|
130
|
+
)) || o;
|
|
111
131
|
});
|
|
112
|
-
function
|
|
113
|
-
let
|
|
132
|
+
function s(o) {
|
|
133
|
+
let l = null;
|
|
114
134
|
if (typeof window > "u") {
|
|
115
|
-
const { JSDOM:
|
|
116
|
-
|
|
135
|
+
const { JSDOM: h } = require("jsdom");
|
|
136
|
+
l = new h().window;
|
|
117
137
|
}
|
|
118
|
-
return (
|
|
138
|
+
return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(o, "text/html").querySelector("svg");
|
|
119
139
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
body:
|
|
140
|
+
function p(o) {
|
|
141
|
+
const l = s(o), g = (l == null ? void 0 : l.innerHTML.trim()) || "";
|
|
142
|
+
l && g && $e(`@${a.value}:${t.prefix}:${t.name}`, {
|
|
143
|
+
body: g,
|
|
124
144
|
// Set height and width from svg content
|
|
125
|
-
height:
|
|
126
|
-
width:
|
|
145
|
+
height: l.viewBox.baseVal.height,
|
|
146
|
+
width: l.viewBox.baseVal.width
|
|
127
147
|
});
|
|
128
148
|
}
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}).catch((
|
|
132
|
-
throw new Error(`During fetch icon: ${
|
|
133
|
-
})) :
|
|
149
|
+
return n && (t.src && !D(`@${a.value}:${t.prefix}:${t.name}`) ? (r.value = !1, n.fetchIcon(t.src).then((o) => {
|
|
150
|
+
o && (p(o), r.value = !0);
|
|
151
|
+
}).catch((o) => {
|
|
152
|
+
throw new Error(`During fetch icon: ${o == null ? void 0 : o.message}`);
|
|
153
|
+
})) : t.svg && p(t.svg)), (o, l) => c(r) ? (b(), M(c(je), N({
|
|
134
154
|
key: 0,
|
|
135
|
-
class:
|
|
155
|
+
class: c(d)
|
|
136
156
|
}, {
|
|
137
|
-
inline:
|
|
138
|
-
width:
|
|
139
|
-
height:
|
|
140
|
-
horizontalFlip:
|
|
141
|
-
verticalFlip:
|
|
142
|
-
flip:
|
|
143
|
-
rotate:
|
|
144
|
-
color:
|
|
145
|
-
onLoad:
|
|
146
|
-
icon:
|
|
147
|
-
}), null, 16, ["class"])) :
|
|
157
|
+
inline: o.inline,
|
|
158
|
+
width: o.width,
|
|
159
|
+
height: o.height,
|
|
160
|
+
horizontalFlip: o.horizontalFlip,
|
|
161
|
+
verticalFlip: o.verticalFlip,
|
|
162
|
+
flip: o.flip,
|
|
163
|
+
rotate: o.rotate,
|
|
164
|
+
color: o.color,
|
|
165
|
+
onLoad: o.onLoad,
|
|
166
|
+
icon: c(m)
|
|
167
|
+
}), null, 16, ["class"])) : B("", !0);
|
|
148
168
|
}
|
|
149
169
|
});
|
|
150
|
-
function
|
|
151
|
-
|
|
170
|
+
function Z(e, t) {
|
|
171
|
+
if (e && Object.keys(e).length && t) {
|
|
172
|
+
if (t.indexOf(".") === -1)
|
|
173
|
+
return e[t];
|
|
174
|
+
{
|
|
175
|
+
const r = t.split(".");
|
|
176
|
+
let n = e;
|
|
177
|
+
for (let i = 0, d = r.length; i < d; ++i) {
|
|
178
|
+
if (e == null)
|
|
179
|
+
return null;
|
|
180
|
+
n = n[r[i]];
|
|
181
|
+
}
|
|
182
|
+
return n;
|
|
183
|
+
}
|
|
184
|
+
} else
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
function ne(e) {
|
|
188
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(c(e));
|
|
189
|
+
}
|
|
190
|
+
function Ce(e) {
|
|
191
|
+
return typeof e == "string" || e instanceof String;
|
|
152
192
|
}
|
|
153
|
-
function
|
|
193
|
+
function E(e) {
|
|
194
|
+
return Array.isArray(e) ? e.filter((t) => Ce(t)).join(" ") : e;
|
|
195
|
+
}
|
|
196
|
+
function ze(e, t) {
|
|
154
197
|
const {
|
|
155
198
|
invalid: r,
|
|
156
|
-
valid:
|
|
157
|
-
hint:
|
|
158
|
-
loading:
|
|
159
|
-
} =
|
|
160
|
-
hintLabel:
|
|
161
|
-
modelValue:
|
|
162
|
-
valid:
|
|
163
|
-
validLabel:
|
|
164
|
-
invalid:
|
|
165
|
-
invalidLabel:
|
|
166
|
-
...
|
|
167
|
-
} =
|
|
168
|
-
() => !!(
|
|
169
|
-
),
|
|
170
|
-
() => !!(
|
|
171
|
-
),
|
|
172
|
-
() => !!(
|
|
173
|
-
),
|
|
174
|
-
() =>
|
|
199
|
+
valid: n,
|
|
200
|
+
hint: i,
|
|
201
|
+
loading: d
|
|
202
|
+
} = t, {
|
|
203
|
+
hintLabel: a,
|
|
204
|
+
modelValue: m,
|
|
205
|
+
valid: s,
|
|
206
|
+
validLabel: p,
|
|
207
|
+
invalid: o,
|
|
208
|
+
invalidLabel: l,
|
|
209
|
+
...g
|
|
210
|
+
} = C(e), v = Z(g, "loading"), y = Z(g, "loadingLabel"), h = u(() => o.value ? !!(o.value && r || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !ne(l)) : !1), w = u(
|
|
211
|
+
() => !!(a && a.value || i)
|
|
212
|
+
), I = u(
|
|
213
|
+
() => !!(p && p.value || n)
|
|
214
|
+
), A = u(
|
|
215
|
+
() => !!(v != null && v.value && d || v != null && v.value && (y != null && y.value))
|
|
216
|
+
), V = u(
|
|
217
|
+
() => w.value || I.value || h.value || A.value
|
|
175
218
|
);
|
|
176
219
|
return {
|
|
177
|
-
hasInvalid:
|
|
178
|
-
hasHint:
|
|
179
|
-
hasValid:
|
|
180
|
-
hasLoading:
|
|
220
|
+
hasInvalid: h,
|
|
221
|
+
hasHint: w,
|
|
222
|
+
hasValid: I,
|
|
223
|
+
hasLoading: A,
|
|
181
224
|
HintSlot: {
|
|
182
225
|
name: "HintSlot",
|
|
183
226
|
props: {
|
|
@@ -186,31 +229,31 @@ function ye(e, s) {
|
|
|
186
229
|
default: () => ({})
|
|
187
230
|
}
|
|
188
231
|
},
|
|
189
|
-
setup(
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
hintLabel:
|
|
193
|
-
modelValue:
|
|
194
|
-
valid:
|
|
195
|
-
validLabel:
|
|
196
|
-
invalid:
|
|
197
|
-
invalidLabel:
|
|
198
|
-
loading:
|
|
199
|
-
loadingLabel:
|
|
200
|
-
...
|
|
232
|
+
setup(j) {
|
|
233
|
+
const F = u(() => {
|
|
234
|
+
const O = Pe({
|
|
235
|
+
hintLabel: a,
|
|
236
|
+
modelValue: m,
|
|
237
|
+
valid: s,
|
|
238
|
+
validLabel: p,
|
|
239
|
+
invalid: o,
|
|
240
|
+
invalidLabel: l,
|
|
241
|
+
loading: v,
|
|
242
|
+
loadingLabel: y,
|
|
243
|
+
...j.params
|
|
201
244
|
});
|
|
202
|
-
return
|
|
245
|
+
return o != null && o.value ? (r == null ? void 0 : r(O)) || E(l == null ? void 0 : l.value) || (a == null ? void 0 : a.value) : s != null && s.value ? (n == null ? void 0 : n(O)) || E(p == null ? void 0 : p.value) || (a == null ? void 0 : a.value) : v != null && v.value ? (d == null ? void 0 : d(O)) || E(y == null ? void 0 : y.value) || (a == null ? void 0 : a.value) : (i == null ? void 0 : i(O)) || E(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
|
|
203
246
|
});
|
|
204
247
|
return {
|
|
205
|
-
isVisible:
|
|
206
|
-
hasInvalid:
|
|
207
|
-
hasValid:
|
|
208
|
-
hintContent:
|
|
248
|
+
isVisible: V,
|
|
249
|
+
hasInvalid: h,
|
|
250
|
+
hasValid: I,
|
|
251
|
+
hintContent: F
|
|
209
252
|
};
|
|
210
253
|
},
|
|
211
254
|
render() {
|
|
212
255
|
if (this.isVisible)
|
|
213
|
-
return
|
|
256
|
+
return be(
|
|
214
257
|
"small",
|
|
215
258
|
{
|
|
216
259
|
role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
|
|
@@ -221,34 +264,95 @@ function ye(e, s) {
|
|
|
221
264
|
}
|
|
222
265
|
};
|
|
223
266
|
}
|
|
224
|
-
|
|
225
|
-
|
|
267
|
+
const qe = {
|
|
268
|
+
/**
|
|
269
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
270
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
271
|
+
*/
|
|
272
|
+
to: {
|
|
273
|
+
type: [String, Object]
|
|
274
|
+
},
|
|
275
|
+
/**
|
|
276
|
+
* Anchor href
|
|
277
|
+
*/
|
|
278
|
+
href: String,
|
|
279
|
+
/**
|
|
280
|
+
* Anchor target
|
|
281
|
+
*/
|
|
282
|
+
target: {
|
|
283
|
+
type: String,
|
|
284
|
+
validator: (e) => Object.values(re).includes(e)
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* Anchor rel
|
|
288
|
+
*/
|
|
289
|
+
rel: {
|
|
290
|
+
type: String,
|
|
291
|
+
default: "noopener noreferrer"
|
|
292
|
+
}
|
|
293
|
+
}, He = {
|
|
294
|
+
/**
|
|
295
|
+
* Valid status
|
|
296
|
+
*/
|
|
226
297
|
valid: Boolean,
|
|
298
|
+
/**
|
|
299
|
+
* Valid label
|
|
300
|
+
*/
|
|
227
301
|
validLabel: [String, Array]
|
|
228
|
-
},
|
|
302
|
+
}, Me = {
|
|
303
|
+
/**
|
|
304
|
+
* Invalid status
|
|
305
|
+
*/
|
|
229
306
|
invalid: Boolean,
|
|
307
|
+
/**
|
|
308
|
+
* Invalid label
|
|
309
|
+
*/
|
|
230
310
|
invalidLabel: [String, Array]
|
|
231
|
-
},
|
|
311
|
+
}, Ke = {
|
|
312
|
+
/**
|
|
313
|
+
* Loading status
|
|
314
|
+
*/
|
|
232
315
|
loading: Boolean,
|
|
233
|
-
|
|
234
|
-
|
|
316
|
+
/**
|
|
317
|
+
* Loading label
|
|
318
|
+
*/
|
|
319
|
+
loadingLabel: {
|
|
320
|
+
type: String,
|
|
321
|
+
default: "Loading..."
|
|
322
|
+
}
|
|
323
|
+
}, le = {
|
|
235
324
|
/**
|
|
236
325
|
* Whether the form control is disabled
|
|
237
326
|
*/
|
|
238
327
|
disabled: Boolean
|
|
239
|
-
},
|
|
328
|
+
}, Re = {
|
|
329
|
+
/**
|
|
330
|
+
* Whether the item is active
|
|
331
|
+
*/
|
|
332
|
+
active: Boolean
|
|
333
|
+
}, Le = {
|
|
334
|
+
/**
|
|
335
|
+
* Whether the item is pressed
|
|
336
|
+
*/
|
|
337
|
+
pressed: Boolean
|
|
338
|
+
}, ae = {
|
|
339
|
+
/**
|
|
340
|
+
* The item label
|
|
341
|
+
*/
|
|
342
|
+
label: [String, Number]
|
|
343
|
+
}, Ue = {
|
|
240
344
|
/**
|
|
241
345
|
* The value is not editable
|
|
242
346
|
*/
|
|
243
347
|
readonly: Boolean
|
|
244
|
-
},
|
|
348
|
+
}, Je = {
|
|
245
349
|
/**
|
|
246
350
|
* Component BEM modifiers
|
|
247
351
|
*/
|
|
248
352
|
modifiers: [String, Array]
|
|
249
|
-
},
|
|
353
|
+
}, We = {
|
|
250
354
|
hintLabel: { type: String, default: "" }
|
|
251
|
-
},
|
|
355
|
+
}, Ye = {
|
|
252
356
|
/**
|
|
253
357
|
* List of options, can be string[] or object[]
|
|
254
358
|
*/
|
|
@@ -268,7 +372,7 @@ const he = {
|
|
|
268
372
|
* Used when options are objects: key to use for option disabled
|
|
269
373
|
*/
|
|
270
374
|
disabledKey: { type: [String, Function], default: "disabled" }
|
|
271
|
-
},
|
|
375
|
+
}, Ge = {
|
|
272
376
|
/**
|
|
273
377
|
* VvIcon name or props
|
|
274
378
|
* @see VVIcon
|
|
@@ -279,69 +383,82 @@ const he = {
|
|
|
279
383
|
*/
|
|
280
384
|
iconPosition: {
|
|
281
385
|
type: String,
|
|
282
|
-
default:
|
|
283
|
-
validation: (e) => Object.values(
|
|
386
|
+
default: P.before,
|
|
387
|
+
validation: (e) => Object.values(P).includes(e)
|
|
284
388
|
}
|
|
285
|
-
},
|
|
389
|
+
}, Qe = {
|
|
286
390
|
/**
|
|
287
391
|
* Global attribute tabindex
|
|
288
392
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
289
393
|
*/
|
|
290
394
|
tabindex: { type: [String, Number], default: 0 }
|
|
291
|
-
},
|
|
395
|
+
}, Xe = {
|
|
292
396
|
/**
|
|
293
397
|
* If true the label will be floating
|
|
294
398
|
*/
|
|
295
399
|
floating: Boolean
|
|
296
|
-
},
|
|
400
|
+
}, Ze = {
|
|
297
401
|
/**
|
|
298
402
|
* If true the input will be unselectable
|
|
299
403
|
*/
|
|
300
404
|
unselectable: { type: Boolean, default: !0 }
|
|
301
|
-
},
|
|
405
|
+
}, Te = {
|
|
302
406
|
/**
|
|
303
407
|
* Global attribute id
|
|
304
408
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
305
409
|
*/
|
|
306
410
|
id: [String, Number]
|
|
307
411
|
};
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
...
|
|
412
|
+
_.bottom;
|
|
413
|
+
const xe = {
|
|
414
|
+
...Te,
|
|
311
415
|
/**
|
|
312
416
|
* Input / Textarea name
|
|
313
417
|
* Name of the form control. Submitted with the form as part of a name/value pair
|
|
314
418
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name
|
|
315
419
|
*/
|
|
316
420
|
name: { type: String, required: !0 }
|
|
317
|
-
},
|
|
421
|
+
}, et = {
|
|
318
422
|
/**
|
|
319
423
|
* Global attribute autofocus
|
|
320
424
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
|
|
321
425
|
*/
|
|
322
426
|
autofocus: Boolean
|
|
323
|
-
},
|
|
427
|
+
}, tt = {
|
|
324
428
|
/**
|
|
325
429
|
* Global attribute autocomplete
|
|
326
430
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
327
431
|
*/
|
|
328
432
|
autocomplete: { type: String, default: "off" }
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
...
|
|
332
|
-
...
|
|
333
|
-
|
|
334
|
-
...
|
|
335
|
-
...
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
...
|
|
343
|
-
...
|
|
344
|
-
...
|
|
433
|
+
};
|
|
434
|
+
({
|
|
435
|
+
...le,
|
|
436
|
+
...ae,
|
|
437
|
+
...Le,
|
|
438
|
+
...Re,
|
|
439
|
+
...qe,
|
|
440
|
+
/**
|
|
441
|
+
* Button type
|
|
442
|
+
*/
|
|
443
|
+
type: K.button
|
|
444
|
+
});
|
|
445
|
+
const rt = {
|
|
446
|
+
...xe,
|
|
447
|
+
...et,
|
|
448
|
+
...tt,
|
|
449
|
+
...Qe,
|
|
450
|
+
...He,
|
|
451
|
+
...Me,
|
|
452
|
+
...We,
|
|
453
|
+
...Ke,
|
|
454
|
+
...le,
|
|
455
|
+
...Ue,
|
|
456
|
+
...Je,
|
|
457
|
+
...Ye,
|
|
458
|
+
...Ge,
|
|
459
|
+
...Xe,
|
|
460
|
+
...Ze,
|
|
461
|
+
...ae,
|
|
345
462
|
/**
|
|
346
463
|
* This Boolean attribute indicates that multiple options can be selected in the list.
|
|
347
464
|
* If it is not specified, then only one option can be selected at a time.
|
|
@@ -368,140 +485,178 @@ const De = {
|
|
|
368
485
|
type: [String, Number, Boolean, Object, Array],
|
|
369
486
|
default: void 0
|
|
370
487
|
},
|
|
371
|
-
/**
|
|
372
|
-
* <label> value for the select
|
|
373
|
-
*/
|
|
374
|
-
label: String,
|
|
375
488
|
/**
|
|
376
489
|
* Select placeholder
|
|
377
490
|
*/
|
|
378
491
|
placeholder: String
|
|
379
|
-
},
|
|
492
|
+
}, ot = ["update:modelValue", "focus", "blur"], nt = (e) => u(() => String((e == null ? void 0 : e.value) || Fe()));
|
|
493
|
+
function lt(e, t) {
|
|
494
|
+
const { focused: r } = we(e);
|
|
495
|
+
return ee(r, (n) => {
|
|
496
|
+
t(n ? "focus" : "blur", c(e));
|
|
497
|
+
}), {
|
|
498
|
+
focused: r
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function at(e, t) {
|
|
502
|
+
const r = u(
|
|
503
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === P.before)
|
|
504
|
+
), n = u(
|
|
505
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === P.after)
|
|
506
|
+
), i = u(
|
|
507
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === _.left)
|
|
508
|
+
), d = u(
|
|
509
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === _.right)
|
|
510
|
+
), a = u(
|
|
511
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === _.top)
|
|
512
|
+
), m = u(
|
|
513
|
+
() => Boolean((e == null ? void 0 : e.value) && t.value === _.bottom)
|
|
514
|
+
);
|
|
515
|
+
return {
|
|
516
|
+
hasIcon: u(() => typeof (e == null ? void 0 : e.value) == "string" ? { name: e == null ? void 0 : e.value } : e == null ? void 0 : e.value),
|
|
517
|
+
hasIconLeft: i,
|
|
518
|
+
hasIconRight: d,
|
|
519
|
+
hasIconTop: a,
|
|
520
|
+
hasIconBottom: m,
|
|
521
|
+
hasIconBefore: r,
|
|
522
|
+
hasIconAfter: n
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
function st(e) {
|
|
526
|
+
const { options: t, labelKey: r, valueKey: n, disabledKey: i } = C(e);
|
|
527
|
+
return {
|
|
528
|
+
options: t,
|
|
529
|
+
getOptionLabel: (s) => typeof s != "object" && s !== null ? s : typeof r.value == "function" ? r.value(s) : s[r.value],
|
|
530
|
+
getOptionValue: (s) => typeof s != "object" && s !== null ? s : typeof n.value == "function" ? n.value(s) : s[n.value],
|
|
531
|
+
getOptionDisabled: (s) => typeof s != "object" && s !== null ? !1 : typeof i.value == "function" ? i.value(s) : s[i.value]
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
const ut = ["for"], it = { class: "vv-select__wrapper" }, ct = {
|
|
380
535
|
key: 0,
|
|
381
536
|
class: "vv-select__input-before"
|
|
382
|
-
},
|
|
537
|
+
}, dt = { class: "vv-select__inner" }, ft = ["id"], vt = ["disabled", "hidden"], pt = ["disabled", "value"], gt = {
|
|
383
538
|
key: 1,
|
|
384
539
|
class: "vv-select__input-after"
|
|
385
|
-
},
|
|
540
|
+
}, yt = {
|
|
386
541
|
name: "VvSelect"
|
|
387
|
-
},
|
|
388
|
-
...
|
|
389
|
-
props:
|
|
390
|
-
emits:
|
|
391
|
-
setup(e, { emit:
|
|
392
|
-
const r = e,
|
|
393
|
-
id:
|
|
394
|
-
modifiers:
|
|
395
|
-
disabled:
|
|
396
|
-
readonly:
|
|
397
|
-
loading:
|
|
398
|
-
icon:
|
|
399
|
-
iconPosition:
|
|
400
|
-
invalid:
|
|
401
|
-
valid:
|
|
402
|
-
floating:
|
|
403
|
-
multiple:
|
|
404
|
-
} =
|
|
405
|
-
|
|
406
|
-
|
|
542
|
+
}, Bt = /* @__PURE__ */ T({
|
|
543
|
+
...yt,
|
|
544
|
+
props: rt,
|
|
545
|
+
emits: ot,
|
|
546
|
+
setup(e, { emit: t }) {
|
|
547
|
+
const r = e, n = me(), i = x(), { HintSlot: d, hasHint: a, hasInvalid: m } = ze(r, n), {
|
|
548
|
+
id: s,
|
|
549
|
+
modifiers: p,
|
|
550
|
+
disabled: o,
|
|
551
|
+
readonly: l,
|
|
552
|
+
loading: g,
|
|
553
|
+
icon: v,
|
|
554
|
+
iconPosition: y,
|
|
555
|
+
invalid: h,
|
|
556
|
+
valid: w,
|
|
557
|
+
floating: I,
|
|
558
|
+
multiple: A
|
|
559
|
+
} = C(r), V = nt(s), j = u(() => `${V.value}-hint`), { focused: F } = lt(i, t), O = Ae(i);
|
|
560
|
+
ee(O, (f) => {
|
|
561
|
+
f && r.autofocus && (F.value = !0);
|
|
407
562
|
});
|
|
408
|
-
const { hasIcon:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
),
|
|
563
|
+
const { hasIcon: R, hasIconBefore: L, hasIconAfter: U } = at(
|
|
564
|
+
v,
|
|
565
|
+
y
|
|
566
|
+
), se = u(() => !ne(r.modelValue)), J = u(() => r.disabled || r.readonly), ue = u(() => J.value ? -1 : r.tabindex), ie = u(() => {
|
|
412
567
|
if (r.invalid === !0)
|
|
413
568
|
return !0;
|
|
414
569
|
if (r.valid === !0)
|
|
415
570
|
return !1;
|
|
416
|
-
}),
|
|
571
|
+
}), ce = oe(
|
|
417
572
|
"vv-select",
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
valid:
|
|
421
|
-
invalid:
|
|
422
|
-
loading:
|
|
423
|
-
disabled:
|
|
424
|
-
readonly:
|
|
425
|
-
"icon-before":
|
|
426
|
-
"icon-after":
|
|
427
|
-
dirty:
|
|
428
|
-
focus:
|
|
429
|
-
floating:
|
|
430
|
-
multiple:
|
|
573
|
+
p,
|
|
574
|
+
u(() => ({
|
|
575
|
+
valid: w.value,
|
|
576
|
+
invalid: h.value,
|
|
577
|
+
loading: g.value,
|
|
578
|
+
disabled: o.value,
|
|
579
|
+
readonly: l.value,
|
|
580
|
+
"icon-before": L.value,
|
|
581
|
+
"icon-after": U.value,
|
|
582
|
+
dirty: se.value,
|
|
583
|
+
focus: F.value,
|
|
584
|
+
floating: I.value,
|
|
585
|
+
multiple: A.value
|
|
431
586
|
}))
|
|
432
|
-
),
|
|
587
|
+
), de = u(() => ({
|
|
433
588
|
name: r.name,
|
|
434
|
-
tabindex:
|
|
435
|
-
disabled:
|
|
589
|
+
tabindex: ue.value,
|
|
590
|
+
disabled: J.value,
|
|
436
591
|
required: r.required,
|
|
437
592
|
size: r.size,
|
|
438
593
|
autocomplete: r.autocomplete,
|
|
439
594
|
multiple: r.multiple,
|
|
440
|
-
"aria-invalid":
|
|
441
|
-
"aria-describedby": !
|
|
442
|
-
"aria-errormessage":
|
|
443
|
-
})),
|
|
595
|
+
"aria-invalid": ie.value,
|
|
596
|
+
"aria-describedby": !m.value && a.value ? j.value : void 0,
|
|
597
|
+
"aria-errormessage": m.value ? j.value : void 0
|
|
598
|
+
})), W = u(() => ({
|
|
444
599
|
valid: r.valid,
|
|
445
600
|
invalid: r.invalid,
|
|
446
601
|
modelValue: r.modelValue
|
|
447
|
-
})), { getOptionLabel:
|
|
602
|
+
})), { getOptionLabel: fe, getOptionValue: ve, getOptionDisabled: pe } = st(r), z = u({
|
|
448
603
|
get: () => r.modelValue,
|
|
449
|
-
set: (
|
|
450
|
-
Array.isArray(
|
|
604
|
+
set: (f) => {
|
|
605
|
+
Array.isArray(f) && (f = f.filter((k) => k !== void 0)), t("update:modelValue", f);
|
|
451
606
|
}
|
|
452
607
|
});
|
|
453
|
-
return (
|
|
454
|
-
class:
|
|
608
|
+
return (f, k) => (b(), S("div", {
|
|
609
|
+
class: he(c(ce))
|
|
455
610
|
}, [
|
|
456
|
-
|
|
611
|
+
f.label ? (b(), S("label", {
|
|
457
612
|
key: 0,
|
|
458
|
-
for:
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
])) :
|
|
464
|
-
|
|
465
|
-
|
|
613
|
+
for: c(V)
|
|
614
|
+
}, q(f.label), 9, ut)) : B("", !0),
|
|
615
|
+
H("div", it, [
|
|
616
|
+
f.$slots.before ? (b(), S("div", ct, [
|
|
617
|
+
Y(f.$slots, "before", G(Q(c(W))))
|
|
618
|
+
])) : B("", !0),
|
|
619
|
+
H("div", dt, [
|
|
620
|
+
c(L) ? (b(), M(X, N({
|
|
466
621
|
key: 0,
|
|
467
622
|
class: "vv-select__icon"
|
|
468
|
-
},
|
|
469
|
-
|
|
470
|
-
id:
|
|
623
|
+
}, c(R)), null, 16)) : B("", !0),
|
|
624
|
+
Se(H("select", N({
|
|
625
|
+
id: c(V),
|
|
471
626
|
ref_key: "select",
|
|
472
|
-
ref:
|
|
473
|
-
"onUpdate:modelValue":
|
|
474
|
-
},
|
|
475
|
-
|
|
627
|
+
ref: i,
|
|
628
|
+
"onUpdate:modelValue": k[0] || (k[0] = ($) => Be(z) ? z.value = $ : null)
|
|
629
|
+
}, c(de)), [
|
|
630
|
+
f.placeholder ? (b(), S("option", {
|
|
476
631
|
key: 0,
|
|
477
632
|
value: void 0,
|
|
478
|
-
disabled: !
|
|
479
|
-
hidden: !
|
|
480
|
-
},
|
|
481
|
-
(
|
|
482
|
-
key:
|
|
483
|
-
disabled:
|
|
484
|
-
value:
|
|
485
|
-
},
|
|
486
|
-
], 16,
|
|
487
|
-
[
|
|
633
|
+
disabled: !f.unselectable,
|
|
634
|
+
hidden: !f.unselectable
|
|
635
|
+
}, q(f.placeholder), 9, vt)) : B("", !0),
|
|
636
|
+
(b(!0), S(_e, null, Oe(f.options, ($, ge) => (b(), S("option", {
|
|
637
|
+
key: ge,
|
|
638
|
+
disabled: c(pe)($),
|
|
639
|
+
value: c(ve)($)
|
|
640
|
+
}, q(c(fe)($)), 9, pt))), 128))
|
|
641
|
+
], 16, ft), [
|
|
642
|
+
[Ie, c(z)]
|
|
488
643
|
]),
|
|
489
|
-
|
|
644
|
+
c(U) ? (b(), M(X, N({
|
|
490
645
|
key: 1,
|
|
491
646
|
class: "vv-select__icon vv-select__icon-after"
|
|
492
|
-
},
|
|
647
|
+
}, c(R)), null, 16)) : B("", !0)
|
|
493
648
|
]),
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
])) :
|
|
649
|
+
f.$slots.after ? (b(), S("div", gt, [
|
|
650
|
+
Y(f.$slots, "after", G(Q(c(W))))
|
|
651
|
+
])) : B("", !0)
|
|
497
652
|
]),
|
|
498
|
-
|
|
499
|
-
id:
|
|
653
|
+
Ve(c(d), {
|
|
654
|
+
id: c(j),
|
|
500
655
|
class: "vv-select__hint"
|
|
501
656
|
}, null, 8, ["id"])
|
|
502
657
|
], 2));
|
|
503
658
|
}
|
|
504
659
|
});
|
|
505
660
|
export {
|
|
506
|
-
|
|
661
|
+
Bt as default
|
|
507
662
|
};
|