@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 D, computed as d, unref as i, defineComponent as E, ref as S, toRefs as F, openBlock as g, createBlock as C, mergeProps as _, createCommentVNode as $, Transition as I, toHandlers as P, withCtx as z, withDirectives as L, createElementVNode as f, createElementBlock as V, renderSlot as y, createTextVNode as M, toDisplayString as A, createVNode as q, vShow as H } from "vue";
|
|
2
|
+
import { iconExists as v, Icon as R, addIcon as W } from "@iconify/vue";
|
|
3
|
+
import { useVModel as J, onClickOutside as K, onKeyStroke as Y } from "@vueuse/core";
|
|
4
|
+
const G = {
|
|
4
5
|
/**
|
|
5
6
|
* Color
|
|
6
7
|
*/
|
|
@@ -93,46 +94,64 @@ const T = {
|
|
|
93
94
|
modifiers: {
|
|
94
95
|
type: [String, Array]
|
|
95
96
|
}
|
|
96
|
-
}
|
|
97
|
+
};
|
|
98
|
+
var w = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(w || {}), N = /* @__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))(N || {}), B = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(B || {}), O = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(O || {}), j = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(j || {});
|
|
99
|
+
const Q = Symbol.for("volver");
|
|
100
|
+
function T() {
|
|
101
|
+
return D(Q);
|
|
102
|
+
}
|
|
103
|
+
function U(e, r, a) {
|
|
104
|
+
return d(() => {
|
|
105
|
+
const n = {
|
|
106
|
+
[e]: !0
|
|
107
|
+
}, l = typeof (r == null ? void 0 : r.value) == "string" ? r.value.split(" ") : r == null ? void 0 : r.value;
|
|
108
|
+
return l && Array.isArray(l) && l.forEach((s) => {
|
|
109
|
+
n[`${e}--${s}`] = !0;
|
|
110
|
+
}), a && Object.keys(a.value).forEach((s) => {
|
|
111
|
+
n[`${e}--${s}`] = i(a.value[s]);
|
|
112
|
+
}), n;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const X = {
|
|
97
116
|
name: "VvIcon"
|
|
98
|
-
},
|
|
99
|
-
...
|
|
100
|
-
props:
|
|
117
|
+
}, Z = /* @__PURE__ */ E({
|
|
118
|
+
...X,
|
|
119
|
+
props: G,
|
|
101
120
|
setup(e) {
|
|
102
|
-
const r = e,
|
|
103
|
-
const t = r.name ?? "", o = `@${
|
|
104
|
-
return
|
|
105
|
-
(
|
|
106
|
-
const h = `@${
|
|
107
|
-
if (
|
|
121
|
+
const r = e, a = S(!0), n = T(), { modifiers: l } = F(r), s = U("vv-icon", l), u = d(() => r.provider || (n == null ? void 0 : n.provider)), m = d(() => {
|
|
122
|
+
const t = r.name ?? "", o = `@${u.value}:${r.prefix}:${r.name}`;
|
|
123
|
+
return v(t) ? t : v(o) ? o : (n == null ? void 0 : n.iconsCollections.find(
|
|
124
|
+
(c) => {
|
|
125
|
+
const h = `@${u.value}:${c.prefix}:${t}`;
|
|
126
|
+
if (v(h))
|
|
108
127
|
return h;
|
|
109
128
|
}
|
|
110
129
|
)) || t;
|
|
111
130
|
});
|
|
112
|
-
function
|
|
131
|
+
function b(t) {
|
|
113
132
|
let o = null;
|
|
114
133
|
if (typeof window > "u") {
|
|
115
|
-
const { JSDOM:
|
|
116
|
-
o = new
|
|
134
|
+
const { JSDOM: k } = require("jsdom");
|
|
135
|
+
o = new k().window;
|
|
117
136
|
}
|
|
118
137
|
return (o ? new o.DOMParser() : new window.DOMParser()).parseFromString(t, "text/html").querySelector("svg");
|
|
119
138
|
}
|
|
120
|
-
function
|
|
121
|
-
const o =
|
|
122
|
-
o &&
|
|
123
|
-
body:
|
|
139
|
+
function p(t) {
|
|
140
|
+
const o = b(t), c = (o == null ? void 0 : o.innerHTML.trim()) || "";
|
|
141
|
+
o && c && W(`@${u.value}:${r.prefix}:${r.name}`, {
|
|
142
|
+
body: c,
|
|
124
143
|
// Set height and width from svg content
|
|
125
144
|
height: o.viewBox.baseVal.height,
|
|
126
145
|
width: o.viewBox.baseVal.width
|
|
127
146
|
});
|
|
128
147
|
}
|
|
129
|
-
return n && (r.src && !
|
|
130
|
-
t && (
|
|
148
|
+
return n && (r.src && !v(`@${u.value}:${r.prefix}:${r.name}`) ? (a.value = !1, n.fetchIcon(r.src).then((t) => {
|
|
149
|
+
t && (p(t), a.value = !0);
|
|
131
150
|
}).catch((t) => {
|
|
132
151
|
throw new Error(`During fetch icon: ${t == null ? void 0 : t.message}`);
|
|
133
|
-
})) : r.svg &&
|
|
152
|
+
})) : r.svg && p(r.svg)), (t, o) => i(a) ? (g(), C(i(R), _({
|
|
134
153
|
key: 0,
|
|
135
|
-
class:
|
|
154
|
+
class: i(s)
|
|
136
155
|
}, {
|
|
137
156
|
inline: t.inline,
|
|
138
157
|
width: t.width,
|
|
@@ -143,13 +162,58 @@ const T = {
|
|
|
143
162
|
rotate: t.rotate,
|
|
144
163
|
color: t.color,
|
|
145
164
|
onLoad: t.onLoad,
|
|
146
|
-
icon:
|
|
147
|
-
}), null, 16, ["class"])) :
|
|
165
|
+
icon: i(m)
|
|
166
|
+
}), null, 16, ["class"])) : $("", !0);
|
|
148
167
|
}
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
168
|
+
}), x = {
|
|
169
|
+
/**
|
|
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
|
+
*/
|
|
173
|
+
to: {
|
|
174
|
+
type: [String, Object]
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* Anchor href
|
|
178
|
+
*/
|
|
179
|
+
href: String,
|
|
180
|
+
/**
|
|
181
|
+
* Anchor target
|
|
182
|
+
*/
|
|
183
|
+
target: {
|
|
184
|
+
type: String,
|
|
185
|
+
validator: (e) => Object.values(j).includes(e)
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Anchor rel
|
|
189
|
+
*/
|
|
190
|
+
rel: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "noopener noreferrer"
|
|
193
|
+
}
|
|
194
|
+
}, ee = {
|
|
195
|
+
/**
|
|
196
|
+
* Whether the form control is disabled
|
|
197
|
+
*/
|
|
198
|
+
disabled: Boolean
|
|
199
|
+
}, te = {
|
|
200
|
+
/**
|
|
201
|
+
* Whether the item is active
|
|
202
|
+
*/
|
|
203
|
+
active: Boolean
|
|
204
|
+
}, oe = {
|
|
205
|
+
/**
|
|
206
|
+
* Whether the item is pressed
|
|
207
|
+
*/
|
|
208
|
+
pressed: Boolean
|
|
209
|
+
}, re = {
|
|
210
|
+
/**
|
|
211
|
+
* The item label
|
|
212
|
+
*/
|
|
213
|
+
label: [String, Number]
|
|
214
|
+
};
|
|
215
|
+
B.before;
|
|
216
|
+
const ne = {
|
|
153
217
|
/**
|
|
154
218
|
* Global attribute id
|
|
155
219
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
@@ -157,8 +221,19 @@ const H = {
|
|
|
157
221
|
id: [String, Number]
|
|
158
222
|
};
|
|
159
223
|
w.bottom;
|
|
160
|
-
|
|
161
|
-
...
|
|
224
|
+
({
|
|
225
|
+
...ee,
|
|
226
|
+
...re,
|
|
227
|
+
...oe,
|
|
228
|
+
...te,
|
|
229
|
+
...x,
|
|
230
|
+
/**
|
|
231
|
+
* Button type
|
|
232
|
+
*/
|
|
233
|
+
type: O.button
|
|
234
|
+
});
|
|
235
|
+
const ae = ["open", "close", "update:modelValue"], le = {
|
|
236
|
+
...ne,
|
|
162
237
|
/**
|
|
163
238
|
* Dialog title
|
|
164
239
|
*/
|
|
@@ -179,71 +254,71 @@ const P = ["open", "close", "update:modelValue"], W = {
|
|
|
179
254
|
* Close dialog on click outside
|
|
180
255
|
*/
|
|
181
256
|
autoClose: { type: Boolean, default: !0 }
|
|
182
|
-
},
|
|
257
|
+
}, se = {
|
|
183
258
|
key: 0,
|
|
184
259
|
class: "vv-dialog__header"
|
|
185
|
-
},
|
|
260
|
+
}, ie = { class: "vv-dialog__content" }, ue = {
|
|
186
261
|
key: 1,
|
|
187
262
|
class: "vv-dialog__footer"
|
|
188
|
-
},
|
|
263
|
+
}, ce = {
|
|
189
264
|
name: "VvDialog"
|
|
190
|
-
},
|
|
191
|
-
...
|
|
192
|
-
props:
|
|
193
|
-
emits:
|
|
265
|
+
}, ge = /* @__PURE__ */ E({
|
|
266
|
+
...ce,
|
|
267
|
+
props: le,
|
|
268
|
+
emits: ae,
|
|
194
269
|
setup(e, { emit: r }) {
|
|
195
|
-
const
|
|
196
|
-
const { id: o } =
|
|
270
|
+
const a = e, n = J(a, "modelValue", r), l = S(!0), s = S(null), u = d(() => {
|
|
271
|
+
const { id: o } = a;
|
|
197
272
|
return {
|
|
198
273
|
id: o,
|
|
199
|
-
open:
|
|
274
|
+
open: l.value
|
|
200
275
|
};
|
|
201
|
-
}),
|
|
276
|
+
}), m = d(() => a.size ? ["vv-dialog", `vv-dialog--${a.size}`] : "vv-dialog"), b = d(() => `vv-dialog--${a.transition}`), p = {
|
|
202
277
|
"before-enter": () => {
|
|
203
|
-
|
|
278
|
+
l.value = !0, r("open");
|
|
204
279
|
},
|
|
205
280
|
"after-leave": () => {
|
|
206
|
-
|
|
281
|
+
l.value = !1, r("close");
|
|
207
282
|
}
|
|
208
283
|
};
|
|
209
|
-
|
|
210
|
-
|
|
284
|
+
K(s, () => {
|
|
285
|
+
a.autoClose && (n.value = !1);
|
|
211
286
|
});
|
|
212
287
|
function t() {
|
|
213
288
|
n.value = !1;
|
|
214
289
|
}
|
|
215
|
-
return
|
|
290
|
+
return Y("Escape", (o) => {
|
|
216
291
|
n.value && (o.preventDefault(), t());
|
|
217
|
-
}), (o,
|
|
218
|
-
default:
|
|
219
|
-
|
|
292
|
+
}), (o, c) => (g(), C(I, _({ name: i(b) }, P(p)), {
|
|
293
|
+
default: z(() => [
|
|
294
|
+
L(f("dialog", _(i(u), { class: i(m) }), [
|
|
220
295
|
f("article", {
|
|
221
296
|
ref_key: "modalWrapper",
|
|
222
|
-
ref:
|
|
297
|
+
ref: s,
|
|
223
298
|
class: "vv-dialog__wrapper"
|
|
224
299
|
}, [
|
|
225
|
-
o.$slots.header || o.title ? (g(),
|
|
226
|
-
|
|
227
|
-
|
|
300
|
+
o.$slots.header || o.title ? (g(), V("header", se, [
|
|
301
|
+
y(o.$slots, "header", {}, () => [
|
|
302
|
+
M(A(o.title) + " ", 1),
|
|
228
303
|
f("button", {
|
|
229
304
|
type: "button",
|
|
230
305
|
"aria-label": "Close",
|
|
231
306
|
class: "vv-dialog__close",
|
|
232
307
|
onClickPassive: t
|
|
233
308
|
}, [
|
|
234
|
-
|
|
309
|
+
q(Z, { name: "close" })
|
|
235
310
|
], 32)
|
|
236
311
|
])
|
|
237
|
-
])) :
|
|
238
|
-
f("div",
|
|
239
|
-
|
|
312
|
+
])) : $("", !0),
|
|
313
|
+
f("div", ie, [
|
|
314
|
+
y(o.$slots, "default")
|
|
240
315
|
]),
|
|
241
|
-
o.$slots.footer ? (g(),
|
|
242
|
-
|
|
243
|
-
])) :
|
|
316
|
+
o.$slots.footer ? (g(), V("footer", ue, [
|
|
317
|
+
y(o.$slots, "footer")
|
|
318
|
+
])) : $("", !0)
|
|
244
319
|
], 512)
|
|
245
320
|
], 16), [
|
|
246
|
-
[
|
|
321
|
+
[H, i(n)]
|
|
247
322
|
])
|
|
248
323
|
]),
|
|
249
324
|
_: 3
|
|
@@ -251,5 +326,5 @@ const P = ["open", "close", "update:modelValue"], W = {
|
|
|
251
326
|
}
|
|
252
327
|
});
|
|
253
328
|
export {
|
|
254
|
-
|
|
329
|
+
ge as default
|
|
255
330
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],s):(e=typeof globalThis<"u"?globalThis:e||self,e.VvDialog=s(e.vue,e.vue$1))})(this,function(e,s){"use strict";const
|
|
1
|
+
(function(e,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue"),require("@iconify/vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue","@vueuse/core"],s):(e=typeof globalThis<"u"?globalThis:e||self,e.VvDialog=s(e.vue,e.vue$1,e.core))})(this,function(e,s,u){"use strict";const B={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]}};var g=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(g||{}),v=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(v||{}),m=(t=>(t.before="before",t.after="after",t))(m||{}),b=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(b||{}),_=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(_||{});const V=Symbol.for("volver");function w(){return e.inject(V)}function E(t,r,a){return e.computed(()=>{const i={[t]:!0},l=typeof(r==null?void 0:r.value)=="string"?r.value.split(" "):r==null?void 0:r.value;return l&&Array.isArray(l)&&l.forEach(c=>{i[`${t}--${c}`]=!0}),a&&Object.keys(a.value).forEach(c=>{i[`${t}--${c}`]=e.unref(a.value[c])}),i})}const $={name:"VvIcon"},N=e.defineComponent({...$,props:B,setup(t){const r=t,a=e.ref(!0),i=w(),{modifiers:l}=e.toRefs(r),c=E("vv-icon",l),d=e.computed(()=>r.provider||(i==null?void 0:i.provider)),h=e.computed(()=>{const o=r.name??"",n=`@${d.value}:${r.prefix}:${r.name}`;return s.iconExists(o)?o:s.iconExists(n)?n:(i==null?void 0:i.iconsCollections.find(f=>{const S=`@${d.value}:${f.prefix}:${o}`;if(s.iconExists(S))return S}))||o});function y(o){let n=null;if(typeof window>"u"){const{JSDOM:A}=require("jsdom");n=new A().window}return(n?new n.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function p(o){const n=y(o),f=(n==null?void 0:n.innerHTML.trim())||"";n&&f&&s.addIcon(`@${d.value}:${r.prefix}:${r.name}`,{body:f,height:n.viewBox.baseVal.height,width:n.viewBox.baseVal.width})}return i&&(r.src&&!s.iconExists(`@${d.value}:${r.prefix}:${r.name}`)?(a.value=!1,i.fetchIcon(r.src).then(o=>{o&&(p(o),a.value=!0)}).catch(o=>{throw new Error(`During fetch icon: ${o==null?void 0:o.message}`)})):r.svg&&p(r.svg)),(o,n)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(s.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:o.inline,width:o.width,height:o.height,horizontalFlip:o.horizontalFlip,verticalFlip:o.verticalFlip,flip:o.flip,rotate:o.rotate,color:o.color,onLoad:o.onLoad,icon:e.unref(h)}),null,16,["class"])):e.createCommentVNode("",!0)}}),O={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(_).includes(t)},rel:{type:String,default:"noopener noreferrer"}},k={disabled:Boolean},C={active:Boolean},j={pressed:Boolean},D={label:[String,Number]};m.before;const P={id:[String,Number]};g.bottom,{...k,...D,...j,...C,...O,type:b.button};const F=["open","close","update:modelValue"],I={...P,title:String,modelValue:Boolean,transition:{type:String,default:"fade-block"},size:String,autoClose:{type:Boolean,default:!0}},z={key:0,class:"vv-dialog__header"},L={class:"vv-dialog__content"},q={key:1,class:"vv-dialog__footer"},M={name:"VvDialog"};return e.defineComponent({...M,props:I,emits:F,setup(t,{emit:r}){const a=t,i=u.useVModel(a,"modelValue",r),l=e.ref(!0),c=e.ref(null),d=e.computed(()=>{const{id:n}=a;return{id:n,open:l.value}}),h=e.computed(()=>a.size?["vv-dialog",`vv-dialog--${a.size}`]:"vv-dialog"),y=e.computed(()=>`vv-dialog--${a.transition}`),p={"before-enter":()=>{l.value=!0,r("open")},"after-leave":()=>{l.value=!1,r("close")}};u.onClickOutside(c,()=>{a.autoClose&&(i.value=!1)});function o(){i.value=!1}return u.onKeyStroke("Escape",n=>{i.value&&(n.preventDefault(),o())}),(n,f)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(y)},e.toHandlers(p)),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("dialog",e.mergeProps(e.unref(d),{class:e.unref(h)}),[e.createElementVNode("article",{ref_key:"modalWrapper",ref:c,class:"vv-dialog__wrapper"},[n.$slots.header||n.title?(e.openBlock(),e.createElementBlock("header",z,[e.renderSlot(n.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(n.title)+" ",1),e.createElementVNode("button",{type:"button","aria-label":"Close",class:"vv-dialog__close",onClickPassive:o},[e.createVNode(N,{name:"close"})],32)])])):e.createCommentVNode("",!0),e.createElementVNode("div",L,[e.renderSlot(n.$slots,"default")]),n.$slots.footer?(e.openBlock(),e.createElementBlock("footer",q,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)],512)],16),[[e.vShow,e.unref(i)]])]),_:3},16,["name"]))}})});
|