@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,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { iconExists as
|
|
3
|
-
|
|
1
|
+
import { inject as V, computed as g, unref as p, defineComponent as G, ref as D, toRefs as z, openBlock as k, createBlock as j, mergeProps as w, createCommentVNode as I, watch as ee, resolveDynamicComponent as te, withCtx as K, renderSlot as $, createTextVNode as U, toDisplayString as N, toRef as ne, useAttrs as re, useSlots as oe, createElementBlock as L, Fragment as se } from "vue";
|
|
2
|
+
import { iconExists as B, Icon as le, addIcon as ae } from "@iconify/vue";
|
|
3
|
+
import { nanoid as ie } from "nanoid";
|
|
4
|
+
const ue = {
|
|
4
5
|
/**
|
|
5
6
|
* Color
|
|
6
7
|
*/
|
|
@@ -93,352 +94,534 @@ const oe = {
|
|
|
93
94
|
modifiers: {
|
|
94
95
|
type: [String, Array]
|
|
95
96
|
}
|
|
96
|
-
}
|
|
97
|
+
};
|
|
98
|
+
var S = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(S || {}), Y = /* @__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))(Y || {}), C = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(C || {}), R = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(R || {}), h = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(h || {}), W = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(W || {});
|
|
99
|
+
const ce = Symbol.for("volver"), fe = Symbol.for("buttonGroup"), de = Symbol.for("dropdownTrigger"), ve = Symbol.for("dropdownAction");
|
|
100
|
+
function H() {
|
|
101
|
+
return V(ce);
|
|
102
|
+
}
|
|
103
|
+
function Q(e, t, o) {
|
|
104
|
+
return g(() => {
|
|
105
|
+
const r = {
|
|
106
|
+
[e]: !0
|
|
107
|
+
}, s = typeof (t == null ? void 0 : t.value) == "string" ? t.value.split(" ") : t == null ? void 0 : t.value;
|
|
108
|
+
return s && Array.isArray(s) && s.forEach((i) => {
|
|
109
|
+
r[`${e}--${i}`] = !0;
|
|
110
|
+
}), o && Object.keys(o.value).forEach((i) => {
|
|
111
|
+
r[`${e}--${i}`] = p(o.value[i]);
|
|
112
|
+
}), r;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const pe = {
|
|
97
116
|
name: "VvIcon"
|
|
98
|
-
},
|
|
99
|
-
...
|
|
100
|
-
props:
|
|
117
|
+
}, T = /* @__PURE__ */ G({
|
|
118
|
+
...pe,
|
|
119
|
+
props: ue,
|
|
101
120
|
setup(e) {
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
(
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
121
|
+
const t = e, o = D(!0), r = H(), { modifiers: s } = z(t), i = Q("vv-icon", s), v = g(() => t.provider || (r == null ? void 0 : r.provider)), f = g(() => {
|
|
122
|
+
const n = t.name ?? "", l = `@${v.value}:${t.prefix}:${t.name}`;
|
|
123
|
+
return B(n) ? n : B(l) ? l : (r == null ? void 0 : r.iconsCollections.find(
|
|
124
|
+
(m) => {
|
|
125
|
+
const b = `@${v.value}:${m.prefix}:${n}`;
|
|
126
|
+
if (B(b))
|
|
127
|
+
return b;
|
|
109
128
|
}
|
|
110
|
-
)) ||
|
|
129
|
+
)) || n;
|
|
111
130
|
});
|
|
112
|
-
function
|
|
113
|
-
let
|
|
131
|
+
function d(n) {
|
|
132
|
+
let l = null;
|
|
114
133
|
if (typeof window > "u") {
|
|
115
|
-
const { JSDOM:
|
|
116
|
-
|
|
134
|
+
const { JSDOM: O } = require("jsdom");
|
|
135
|
+
l = new O().window;
|
|
117
136
|
}
|
|
118
|
-
return (
|
|
137
|
+
return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(n, "text/html").querySelector("svg");
|
|
119
138
|
}
|
|
120
|
-
function a(
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
body:
|
|
139
|
+
function a(n) {
|
|
140
|
+
const l = d(n), m = (l == null ? void 0 : l.innerHTML.trim()) || "";
|
|
141
|
+
l && m && ae(`@${v.value}:${t.prefix}:${t.name}`, {
|
|
142
|
+
body: m,
|
|
124
143
|
// Set height and width from svg content
|
|
125
|
-
height:
|
|
126
|
-
width:
|
|
144
|
+
height: l.viewBox.baseVal.height,
|
|
145
|
+
width: l.viewBox.baseVal.width
|
|
127
146
|
});
|
|
128
147
|
}
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}).catch((
|
|
132
|
-
throw new Error(`During fetch icon: ${
|
|
133
|
-
})) :
|
|
148
|
+
return r && (t.src && !B(`@${v.value}:${t.prefix}:${t.name}`) ? (o.value = !1, r.fetchIcon(t.src).then((n) => {
|
|
149
|
+
n && (a(n), o.value = !0);
|
|
150
|
+
}).catch((n) => {
|
|
151
|
+
throw new Error(`During fetch icon: ${n == null ? void 0 : n.message}`);
|
|
152
|
+
})) : t.svg && a(t.svg)), (n, l) => p(o) ? (k(), j(p(le), w({
|
|
134
153
|
key: 0,
|
|
135
|
-
class:
|
|
154
|
+
class: p(i)
|
|
136
155
|
}, {
|
|
137
|
-
inline:
|
|
138
|
-
width:
|
|
139
|
-
height:
|
|
140
|
-
horizontalFlip:
|
|
141
|
-
verticalFlip:
|
|
142
|
-
flip:
|
|
143
|
-
rotate:
|
|
144
|
-
color:
|
|
145
|
-
onLoad:
|
|
146
|
-
icon:
|
|
156
|
+
inline: n.inline,
|
|
157
|
+
width: n.width,
|
|
158
|
+
height: n.height,
|
|
159
|
+
horizontalFlip: n.horizontalFlip,
|
|
160
|
+
verticalFlip: n.verticalFlip,
|
|
161
|
+
flip: n.flip,
|
|
162
|
+
rotate: n.rotate,
|
|
163
|
+
color: n.color,
|
|
164
|
+
onLoad: n.onLoad,
|
|
165
|
+
icon: p(f)
|
|
147
166
|
}), null, 16, ["class"])) : I("", !0);
|
|
148
167
|
}
|
|
149
|
-
})
|
|
150
|
-
var p = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(p || {}), G = /* @__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))(G || {}), M = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(M || {});
|
|
151
|
-
const ne = Symbol.for("buttonGroup"), ae = {
|
|
152
|
-
/**
|
|
153
|
-
* Whether the form control is disabled
|
|
154
|
-
*/
|
|
155
|
-
disabled: Boolean
|
|
156
|
-
}, le = {
|
|
157
|
-
/**
|
|
158
|
-
* Component BEM modifiers
|
|
159
|
-
*/
|
|
160
|
-
modifiers: [String, Array]
|
|
161
|
-
};
|
|
162
|
-
M.before;
|
|
163
|
-
const se = {
|
|
164
|
-
/**
|
|
165
|
-
* If true the input will be unselectable
|
|
166
|
-
*/
|
|
167
|
-
unselectable: { type: Boolean, default: !0 }
|
|
168
|
-
}, ie = {
|
|
168
|
+
}), ge = {
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
171
|
-
* @see https://
|
|
170
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
171
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
172
172
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
var R = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(R || {}), v = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(v || {}), z = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(z || {});
|
|
177
|
-
const ue = ["update:modelValue"], ce = {
|
|
178
|
-
...ie,
|
|
179
|
-
...le,
|
|
180
|
-
...ae,
|
|
181
|
-
...se,
|
|
173
|
+
to: {
|
|
174
|
+
type: [String, Object]
|
|
175
|
+
},
|
|
182
176
|
/**
|
|
183
|
-
*
|
|
177
|
+
* Anchor href
|
|
184
178
|
*/
|
|
185
|
-
|
|
179
|
+
href: String,
|
|
186
180
|
/**
|
|
187
|
-
*
|
|
181
|
+
* Anchor target
|
|
188
182
|
*/
|
|
189
|
-
|
|
183
|
+
target: {
|
|
190
184
|
type: String,
|
|
191
|
-
|
|
192
|
-
validator: (e) => Object.values(p).includes(e)
|
|
185
|
+
validator: (e) => Object.values(W).includes(e)
|
|
193
186
|
},
|
|
194
187
|
/**
|
|
195
|
-
*
|
|
188
|
+
* Anchor rel
|
|
196
189
|
*/
|
|
197
|
-
|
|
190
|
+
rel: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "noopener noreferrer"
|
|
193
|
+
}
|
|
194
|
+
}, me = {
|
|
198
195
|
/**
|
|
199
196
|
* Loading status
|
|
200
197
|
*/
|
|
201
198
|
loading: Boolean,
|
|
202
|
-
/**
|
|
203
|
-
* Loading icon
|
|
204
|
-
*/
|
|
205
|
-
loadingIcon: { type: String, default: "eos-icons:bubble-loading" },
|
|
206
199
|
/**
|
|
207
200
|
* Loading label
|
|
208
201
|
*/
|
|
209
202
|
loadingLabel: {
|
|
210
203
|
type: String,
|
|
211
204
|
default: "Loading..."
|
|
212
|
-
}
|
|
205
|
+
}
|
|
206
|
+
}, ye = {
|
|
213
207
|
/**
|
|
214
|
-
*
|
|
215
|
-
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
208
|
+
* Whether the form control is disabled
|
|
216
209
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
210
|
+
disabled: Boolean
|
|
211
|
+
}, be = {
|
|
220
212
|
/**
|
|
221
|
-
*
|
|
213
|
+
* Whether the item is active
|
|
222
214
|
*/
|
|
223
|
-
|
|
215
|
+
active: Boolean
|
|
216
|
+
}, he = {
|
|
224
217
|
/**
|
|
225
|
-
*
|
|
218
|
+
* Whether the item is pressed
|
|
226
219
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
validator: (e) => Object.values(z).includes(e)
|
|
230
|
-
},
|
|
231
|
-
active: Boolean,
|
|
220
|
+
pressed: Boolean
|
|
221
|
+
}, Se = {
|
|
232
222
|
/**
|
|
233
|
-
*
|
|
223
|
+
* The item label
|
|
234
224
|
*/
|
|
235
|
-
|
|
225
|
+
label: [String, Number]
|
|
226
|
+
}, Oe = {
|
|
236
227
|
/**
|
|
237
|
-
*
|
|
228
|
+
* Component BEM modifiers
|
|
238
229
|
*/
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
230
|
+
modifiers: [String, Array]
|
|
231
|
+
};
|
|
232
|
+
C.before;
|
|
233
|
+
const ke = {
|
|
234
|
+
/**
|
|
235
|
+
* If true the input will be unselectable
|
|
236
|
+
*/
|
|
237
|
+
unselectable: { type: Boolean, default: !0 }
|
|
238
|
+
}, _e = {
|
|
239
|
+
/**
|
|
240
|
+
* Global attribute id
|
|
241
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
242
|
+
*/
|
|
243
|
+
id: [String, Number]
|
|
244
|
+
};
|
|
245
|
+
S.bottom;
|
|
246
|
+
const X = {
|
|
247
|
+
...ye,
|
|
248
|
+
...Se,
|
|
249
|
+
...he,
|
|
250
|
+
...be,
|
|
251
|
+
...ge,
|
|
243
252
|
/**
|
|
244
253
|
* Button type
|
|
245
254
|
*/
|
|
246
255
|
type: {
|
|
247
256
|
type: String,
|
|
248
|
-
default:
|
|
257
|
+
default: R.button,
|
|
249
258
|
validator: (e) => Object.values(R).includes(e)
|
|
259
|
+
}
|
|
260
|
+
}, $e = ["click", "mouseover", "mouseleave"], Ie = X;
|
|
261
|
+
function je() {
|
|
262
|
+
return V(de, {});
|
|
263
|
+
}
|
|
264
|
+
function Pe() {
|
|
265
|
+
return V(ve, {});
|
|
266
|
+
}
|
|
267
|
+
const Ae = {
|
|
268
|
+
name: "VvAction"
|
|
269
|
+
}, Be = /* @__PURE__ */ G({
|
|
270
|
+
...Ae,
|
|
271
|
+
props: Ie,
|
|
272
|
+
emits: $e,
|
|
273
|
+
setup(e, { expose: t, emit: o }) {
|
|
274
|
+
const r = e, s = H(), i = D(null);
|
|
275
|
+
t({ $el: i });
|
|
276
|
+
const {
|
|
277
|
+
reference: v,
|
|
278
|
+
bus: f,
|
|
279
|
+
aria: d,
|
|
280
|
+
expanded: a
|
|
281
|
+
} = je();
|
|
282
|
+
ee(
|
|
283
|
+
() => i.value,
|
|
284
|
+
(u) => {
|
|
285
|
+
v && (v.value = u);
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
const n = g(() => r.pressed || (a == null ? void 0 : a.value)), { role: l } = Pe(), m = g(() => {
|
|
289
|
+
switch (!0) {
|
|
290
|
+
case r.disabled:
|
|
291
|
+
return h.button;
|
|
292
|
+
case r.to !== void 0:
|
|
293
|
+
return s != null && s.nuxt ? h.nuxtLink : h.routerLink;
|
|
294
|
+
case r.href !== void 0:
|
|
295
|
+
return h.a;
|
|
296
|
+
default:
|
|
297
|
+
return h.button;
|
|
298
|
+
}
|
|
299
|
+
}), b = g(() => {
|
|
300
|
+
const u = {
|
|
301
|
+
...d == null ? void 0 : d.value,
|
|
302
|
+
"aria-pressed": n.value ? !0 : void 0,
|
|
303
|
+
role: l
|
|
304
|
+
};
|
|
305
|
+
switch (m.value) {
|
|
306
|
+
case h.a:
|
|
307
|
+
return {
|
|
308
|
+
...u,
|
|
309
|
+
href: r.href,
|
|
310
|
+
target: r.target,
|
|
311
|
+
rel: r.rel
|
|
312
|
+
};
|
|
313
|
+
case h.routerLink:
|
|
314
|
+
case h.nuxtLink:
|
|
315
|
+
return {
|
|
316
|
+
...u,
|
|
317
|
+
to: r.to,
|
|
318
|
+
target: r.target
|
|
319
|
+
};
|
|
320
|
+
default:
|
|
321
|
+
return {
|
|
322
|
+
...u,
|
|
323
|
+
type: r.type,
|
|
324
|
+
disabled: r.disabled
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
}), _ = (u) => {
|
|
328
|
+
if (r.disabled) {
|
|
329
|
+
u.preventDefault();
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
f == null || f.emit("click", u), o("click", u);
|
|
333
|
+
}, O = (u) => {
|
|
334
|
+
f == null || f.emit("mouseover", u), o("mouseover", u);
|
|
335
|
+
}, y = (u) => {
|
|
336
|
+
f == null || f.emit("mouseleave", u), o("mouseleave", u);
|
|
337
|
+
};
|
|
338
|
+
return (u, P) => (k(), j(te(p(m)), w(p(b), {
|
|
339
|
+
ref_key: "element",
|
|
340
|
+
ref: i,
|
|
341
|
+
class: {
|
|
342
|
+
active: u.active,
|
|
343
|
+
pressed: p(n),
|
|
344
|
+
disabled: u.disabled
|
|
345
|
+
},
|
|
346
|
+
onClickPassive: _,
|
|
347
|
+
onMouseoverPassive: O,
|
|
348
|
+
onMouseleavePassive: y
|
|
349
|
+
}), {
|
|
350
|
+
default: K(() => [
|
|
351
|
+
$(u.$slots, "default", {}, () => [
|
|
352
|
+
U(N(u.label), 1)
|
|
353
|
+
])
|
|
354
|
+
]),
|
|
355
|
+
_: 3
|
|
356
|
+
}, 16, ["class"]));
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
function M(e, t, o) {
|
|
360
|
+
return o ? q(e, o) === q(t, o) : F(e, t);
|
|
361
|
+
}
|
|
362
|
+
function F(e, t) {
|
|
363
|
+
if (e === t)
|
|
364
|
+
return !0;
|
|
365
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
366
|
+
const o = Array.isArray(e), r = Array.isArray(t);
|
|
367
|
+
let s, i, v;
|
|
368
|
+
if (o && r) {
|
|
369
|
+
if (i = e.length, i != t.length)
|
|
370
|
+
return !1;
|
|
371
|
+
for (s = i; s-- !== 0; )
|
|
372
|
+
if (!F(e[s], t[s]))
|
|
373
|
+
return !1;
|
|
374
|
+
return !0;
|
|
375
|
+
}
|
|
376
|
+
if (o != r)
|
|
377
|
+
return !1;
|
|
378
|
+
const f = e instanceof Date, d = t instanceof Date;
|
|
379
|
+
if (f != d)
|
|
380
|
+
return !1;
|
|
381
|
+
if (f && d)
|
|
382
|
+
return e.getTime() == t.getTime();
|
|
383
|
+
const a = e instanceof RegExp, n = t instanceof RegExp;
|
|
384
|
+
if (a != n)
|
|
385
|
+
return !1;
|
|
386
|
+
if (a && n)
|
|
387
|
+
return e.toString() == t.toString();
|
|
388
|
+
const l = Object.keys(e);
|
|
389
|
+
if (i = l.length, i !== Object.keys(t).length)
|
|
390
|
+
return !1;
|
|
391
|
+
for (s = i; s-- !== 0; )
|
|
392
|
+
if (!Object.prototype.hasOwnProperty.call(t, l[s]))
|
|
393
|
+
return !1;
|
|
394
|
+
for (s = i; s-- !== 0; )
|
|
395
|
+
if (v = l[s], !F(e[v], t[v]))
|
|
396
|
+
return !1;
|
|
397
|
+
return !0;
|
|
398
|
+
}
|
|
399
|
+
return e !== e && t !== t;
|
|
400
|
+
}
|
|
401
|
+
function q(e, t) {
|
|
402
|
+
if (e && Object.keys(e).length && t) {
|
|
403
|
+
if (t.indexOf(".") === -1)
|
|
404
|
+
return e[t];
|
|
405
|
+
{
|
|
406
|
+
const o = t.split(".");
|
|
407
|
+
let r = e;
|
|
408
|
+
for (let s = 0, i = o.length; s < i; ++s) {
|
|
409
|
+
if (e == null)
|
|
410
|
+
return null;
|
|
411
|
+
r = r[o[s]];
|
|
412
|
+
}
|
|
413
|
+
return r;
|
|
414
|
+
}
|
|
415
|
+
} else
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
function J(e, t) {
|
|
419
|
+
if (e != null && t && t.length) {
|
|
420
|
+
for (const o of t)
|
|
421
|
+
if (M(e, o))
|
|
422
|
+
return !0;
|
|
423
|
+
}
|
|
424
|
+
return !1;
|
|
425
|
+
}
|
|
426
|
+
function we(e) {
|
|
427
|
+
return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(p(e));
|
|
428
|
+
}
|
|
429
|
+
function Ve(e) {
|
|
430
|
+
const t = V(e, void 0), o = g(() => !we(t));
|
|
431
|
+
function r(s, i, v) {
|
|
432
|
+
if (t != null && t.value) {
|
|
433
|
+
const d = p(t.value)[s];
|
|
434
|
+
return g({
|
|
435
|
+
get() {
|
|
436
|
+
return d == null ? void 0 : d.value;
|
|
437
|
+
},
|
|
438
|
+
set(a) {
|
|
439
|
+
d.value = a;
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
const f = ne(i, s);
|
|
444
|
+
return g({
|
|
445
|
+
get() {
|
|
446
|
+
return f.value;
|
|
447
|
+
},
|
|
448
|
+
set(d) {
|
|
449
|
+
v && v(`update:${s}`, d);
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
return {
|
|
454
|
+
group: t,
|
|
455
|
+
isInGroup: o,
|
|
456
|
+
getGroupOrLocalRef: r
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
const De = ["update:modelValue"], Ee = {
|
|
460
|
+
...X,
|
|
461
|
+
..._e,
|
|
462
|
+
...Oe,
|
|
463
|
+
...ke,
|
|
464
|
+
...me,
|
|
465
|
+
/**
|
|
466
|
+
* Button icon
|
|
467
|
+
*/
|
|
468
|
+
icon: [String, Object],
|
|
469
|
+
/**
|
|
470
|
+
* Button icon position
|
|
471
|
+
*/
|
|
472
|
+
iconPosition: {
|
|
473
|
+
type: String,
|
|
474
|
+
default: S.left,
|
|
475
|
+
validator: (e) => Object.values(S).includes(e)
|
|
250
476
|
},
|
|
477
|
+
/**
|
|
478
|
+
* Loading icon
|
|
479
|
+
*/
|
|
480
|
+
loadingIcon: { type: String, default: "eos-icons:bubble-loading" },
|
|
251
481
|
toggle: {
|
|
252
482
|
type: Boolean,
|
|
253
483
|
default: !1
|
|
254
484
|
},
|
|
255
485
|
modelValue: String
|
|
256
486
|
};
|
|
257
|
-
function
|
|
258
|
-
var
|
|
259
|
-
const { group:
|
|
260
|
-
id:
|
|
261
|
-
iconPosition:
|
|
262
|
-
icon:
|
|
263
|
-
label:
|
|
487
|
+
function Le(e, t) {
|
|
488
|
+
var u;
|
|
489
|
+
const { group: o, isInGroup: r, getGroupOrLocalRef: s } = Ve(fe), {
|
|
490
|
+
id: i,
|
|
491
|
+
iconPosition: v,
|
|
492
|
+
icon: f,
|
|
493
|
+
label: d,
|
|
264
494
|
pressed: a,
|
|
265
|
-
modifiers:
|
|
266
|
-
} =
|
|
495
|
+
modifiers: n
|
|
496
|
+
} = z(e), l = s("modelValue", e, t), m = s("disabled", e), b = s("toggle", e), _ = s(
|
|
267
497
|
"unselectable",
|
|
268
498
|
e
|
|
269
|
-
),
|
|
270
|
-
var
|
|
271
|
-
const
|
|
272
|
-
return [
|
|
499
|
+
), O = ((u = o == null ? void 0 : o.value) == null ? void 0 : u.multiple) ?? D(!1), y = g(() => {
|
|
500
|
+
var A;
|
|
501
|
+
const P = n != null && n.value ? Array.isArray(n.value) ? n.value : n.value.split(" ") : [], E = (A = o == null ? void 0 : o.value.itemModifiers) != null && A.value ? Array.isArray(o.value.itemModifiers.value) ? o.value.itemModifiers.value : o.value.itemModifiers.value.split(" ") : [];
|
|
502
|
+
return [...P, ...E];
|
|
273
503
|
});
|
|
274
504
|
return {
|
|
275
505
|
// group props
|
|
276
|
-
group:
|
|
277
|
-
isInGroup:
|
|
278
|
-
modelValue:
|
|
279
|
-
disabled:
|
|
280
|
-
toggle:
|
|
281
|
-
unselectable:
|
|
282
|
-
multiple:
|
|
506
|
+
group: o,
|
|
507
|
+
isInGroup: r,
|
|
508
|
+
modelValue: l,
|
|
509
|
+
disabled: m,
|
|
510
|
+
toggle: b,
|
|
511
|
+
unselectable: _,
|
|
512
|
+
multiple: O,
|
|
283
513
|
// local props
|
|
284
|
-
id:
|
|
285
|
-
modifiers:
|
|
514
|
+
id: i,
|
|
515
|
+
modifiers: y,
|
|
286
516
|
pressed: a,
|
|
287
|
-
iconPosition:
|
|
288
|
-
icon:
|
|
289
|
-
label:
|
|
517
|
+
iconPosition: v,
|
|
518
|
+
icon: f,
|
|
519
|
+
label: d
|
|
290
520
|
};
|
|
291
521
|
}
|
|
292
|
-
const
|
|
522
|
+
const Ne = (e) => g(() => String((e == null ? void 0 : e.value) || ie())), Ce = {
|
|
293
523
|
key: 1,
|
|
294
524
|
class: "vv-button__label"
|
|
295
|
-
},
|
|
525
|
+
}, Re = {
|
|
296
526
|
key: 1,
|
|
297
527
|
class: "vv-button__label"
|
|
298
|
-
},
|
|
528
|
+
}, Me = {
|
|
299
529
|
name: "VvButton"
|
|
300
|
-
},
|
|
301
|
-
...
|
|
302
|
-
props:
|
|
303
|
-
emits:
|
|
304
|
-
setup(e, { expose:
|
|
305
|
-
const
|
|
306
|
-
id:
|
|
307
|
-
modifiers:
|
|
308
|
-
iconPosition:
|
|
530
|
+
}, Je = /* @__PURE__ */ G({
|
|
531
|
+
...Me,
|
|
532
|
+
props: Ee,
|
|
533
|
+
emits: De,
|
|
534
|
+
setup(e, { expose: t, emit: o }) {
|
|
535
|
+
const r = e, s = re(), i = oe(), {
|
|
536
|
+
id: v,
|
|
537
|
+
modifiers: f,
|
|
538
|
+
iconPosition: d,
|
|
309
539
|
icon: a,
|
|
310
|
-
label:
|
|
311
|
-
modelValue:
|
|
312
|
-
disabled:
|
|
313
|
-
toggle:
|
|
314
|
-
unselectable:
|
|
315
|
-
} =
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
} = useInjectedDropdownTrigger();
|
|
322
|
-
watch(
|
|
323
|
-
() => $.value,
|
|
324
|
-
(r) => {
|
|
325
|
-
V && (V.value = r);
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
const { role: U } = useInjectedDropdownAction(), N = computed(() => {
|
|
329
|
-
switch (!0) {
|
|
330
|
-
case u.value:
|
|
331
|
-
return v.button;
|
|
332
|
-
case n.to !== void 0:
|
|
333
|
-
return S != null && S.nuxt ? v.nuxtLink : v.routerLink;
|
|
334
|
-
case n.href !== void 0:
|
|
335
|
-
return v.a;
|
|
336
|
-
default:
|
|
337
|
-
return v.button;
|
|
338
|
-
}
|
|
339
|
-
}), A = computed(() => g.value ? Array.isArray(o.value) ? contains(f.value, o.value) : equals(f.value, o.value) : n.pressed), J = useBemModifiers(
|
|
540
|
+
label: n,
|
|
541
|
+
modelValue: l,
|
|
542
|
+
disabled: m,
|
|
543
|
+
toggle: b,
|
|
544
|
+
unselectable: _
|
|
545
|
+
} = Le(r, o), O = Ne(v), y = g(() => (s == null ? void 0 : s.name) || O.value), u = D(null), P = g(() => {
|
|
546
|
+
var c;
|
|
547
|
+
return (c = u.value) == null ? void 0 : c.$el;
|
|
548
|
+
});
|
|
549
|
+
t({ $el: P });
|
|
550
|
+
const E = g(() => b.value ? Array.isArray(l.value) ? J(y.value, l.value) : M(y.value, l.value) : r.pressed), A = Q(
|
|
340
551
|
"vv-button",
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
iconOnly: Boolean((a == null ? void 0 : a.value) && !(t != null && t.value) && !k.default)
|
|
552
|
+
f,
|
|
553
|
+
g(() => ({
|
|
554
|
+
reverse: [S.right, S.bottom].includes(d.value),
|
|
555
|
+
column: [S.top, S.bottom].includes(d.value),
|
|
556
|
+
"icon-only": Boolean(
|
|
557
|
+
(a == null ? void 0 : a.value) && !(n != null && n.value) && !i.default
|
|
558
|
+
)
|
|
349
559
|
}))
|
|
350
|
-
),
|
|
560
|
+
), Z = g(
|
|
351
561
|
() => typeof (a == null ? void 0 : a.value) == "string" ? { name: a == null ? void 0 : a.value } : a == null ? void 0 : a.value
|
|
352
|
-
),
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
};
|
|
359
|
-
switch (N.value) {
|
|
360
|
-
case v.a:
|
|
361
|
-
return {
|
|
362
|
-
...r,
|
|
363
|
-
role: r.role ?? "button",
|
|
364
|
-
href: n.href,
|
|
365
|
-
target: n.target,
|
|
366
|
-
rel: n.rel
|
|
367
|
-
};
|
|
368
|
-
case v.routerLink:
|
|
369
|
-
case v.nuxtLink:
|
|
370
|
-
return {
|
|
371
|
-
...r,
|
|
372
|
-
role: r.role ?? "button",
|
|
373
|
-
to: n.to,
|
|
374
|
-
target: n.target
|
|
375
|
-
};
|
|
376
|
-
default:
|
|
377
|
-
return {
|
|
378
|
-
...r,
|
|
379
|
-
type: n.type,
|
|
380
|
-
disabled: u.value
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
}), W = (r) => {
|
|
384
|
-
if (i == null || i.emit("click", r), g.value) {
|
|
385
|
-
if (Array.isArray(o.value)) {
|
|
386
|
-
if (contains(f.value, o.value)) {
|
|
387
|
-
O.value && (o.value = o.value.filter(
|
|
388
|
-
(D) => D !== f.value
|
|
562
|
+
), x = () => {
|
|
563
|
+
if (b.value) {
|
|
564
|
+
if (Array.isArray(l.value)) {
|
|
565
|
+
if (J(y.value, l.value)) {
|
|
566
|
+
_.value && (l.value = l.value.filter(
|
|
567
|
+
(c) => c !== y.value
|
|
389
568
|
));
|
|
390
569
|
return;
|
|
391
570
|
}
|
|
392
|
-
|
|
571
|
+
l.value.push(y.value);
|
|
393
572
|
return;
|
|
394
573
|
}
|
|
395
|
-
if (
|
|
396
|
-
|
|
574
|
+
if (M(y.value, l.value) && _.value) {
|
|
575
|
+
l.value = void 0;
|
|
397
576
|
return;
|
|
398
577
|
}
|
|
399
|
-
|
|
578
|
+
l.value = y.value;
|
|
400
579
|
}
|
|
401
|
-
}, Y = (r) => {
|
|
402
|
-
i == null || i.emit("mouseover", r);
|
|
403
|
-
}, x = (r) => {
|
|
404
|
-
i == null || i.emit("mouseleave", r);
|
|
405
580
|
};
|
|
406
|
-
return (
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
581
|
+
return (c, Fe) => (k(), j(Be, w({
|
|
582
|
+
disabled: p(m),
|
|
583
|
+
pressed: p(E),
|
|
584
|
+
active: c.active,
|
|
585
|
+
type: c.type,
|
|
586
|
+
to: c.to,
|
|
587
|
+
href: c.href,
|
|
588
|
+
target: c.target,
|
|
589
|
+
rel: c.rel
|
|
590
|
+
}, {
|
|
591
|
+
id: p(O),
|
|
592
|
+
ref_key: "element",
|
|
593
|
+
ref: u,
|
|
594
|
+
class: p(A),
|
|
595
|
+
onClick: x
|
|
413
596
|
}), {
|
|
414
|
-
default:
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
597
|
+
default: K(() => [
|
|
598
|
+
$(c.$slots, "default", {}, () => [
|
|
599
|
+
c.loading ? $(c.$slots, "loading", { key: 0 }, () => [
|
|
600
|
+
c.loadingIcon ? (k(), j(T, {
|
|
418
601
|
key: 0,
|
|
419
602
|
class: "vv-button__loading-icon",
|
|
420
|
-
name:
|
|
603
|
+
name: c.loadingIcon
|
|
421
604
|
}, null, 8, ["name"])) : I("", !0),
|
|
422
|
-
|
|
423
|
-
]) : (
|
|
424
|
-
|
|
425
|
-
|
|
605
|
+
c.loadingLabel ? (k(), L("span", Ce, N(c.loadingLabel), 1)) : I("", !0)
|
|
606
|
+
]) : (k(), L(se, { key: 1 }, [
|
|
607
|
+
$(c.$slots, "before"),
|
|
608
|
+
p(a) ? (k(), j(T, w({
|
|
426
609
|
key: 0,
|
|
427
610
|
class: "vv-button__icon"
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
611
|
+
}, p(Z)), null, 16)) : I("", !0),
|
|
612
|
+
p(n) ? (k(), L("span", Re, [
|
|
613
|
+
$(c.$slots, "label", {}, () => [
|
|
614
|
+
U(N(p(n)), 1)
|
|
432
615
|
])
|
|
433
616
|
])) : I("", !0),
|
|
434
|
-
|
|
617
|
+
$(c.$slots, "after")
|
|
435
618
|
], 64))
|
|
436
619
|
])
|
|
437
620
|
]),
|
|
438
621
|
_: 3
|
|
439
|
-
}, 16, ["id"]));
|
|
622
|
+
}, 16, ["id", "class"]));
|
|
440
623
|
}
|
|
441
624
|
});
|
|
442
625
|
export {
|
|
443
|
-
|
|
626
|
+
Je as default
|
|
444
627
|
};
|