@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.
Files changed (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -1,6 +1,7 @@
1
- import { defineComponent as _, unref as a, openBlock as g, createBlock as V, mergeProps as S, createCommentVNode as y, Transition as D, toHandlers as N, withCtx as k, withDirectives as E, createElementVNode as f, createElementBlock as B, renderSlot as b, createTextVNode as F, toDisplayString as j, createVNode as I, vShow as z } from "vue";
2
- import { iconExists as p, Icon as M, addIcon as L } from "@iconify/vue";
3
- const T = {
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
- }, q = {
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
- }, A = /* @__PURE__ */ _({
99
- ...q,
100
- props: T,
117
+ }, Z = /* @__PURE__ */ E({
118
+ ...X,
119
+ props: G,
101
120
  setup(e) {
102
- const r = e, i = ref(!0), n = useVolver(), { modifiers: d } = toRefs(r), u = useBemModifiers("vv-icon", d), s = computed(() => r.provider || (n == null ? void 0 : n.provider)), v = computed(() => {
103
- const t = r.name ?? "", o = `@${s.value}:${r.prefix}:${r.name}`;
104
- return p(t) ? t : p(o) ? o : (n == null ? void 0 : n.iconsCollections.find(
105
- (l) => {
106
- const h = `@${s.value}:${l.prefix}:${t}`;
107
- if (p(h))
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 m(t) {
131
+ function b(t) {
113
132
  let o = null;
114
133
  if (typeof window > "u") {
115
- const { JSDOM: O } = require("jsdom");
116
- o = new O().window;
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 c(t) {
121
- const o = m(t), l = (o == null ? void 0 : o.innerHTML.trim()) || "";
122
- o && l && L(`@${s.value}:${r.prefix}:${r.name}`, {
123
- body: l,
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 && !p(`@${s.value}:${r.prefix}:${r.name}`) ? (i.value = !1, n.fetchIcon(r.src).then((t) => {
130
- t && (c(t), i.value = !0);
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 && c(r.svg)), (t, o) => a(i) ? (g(), V(a(M), S({
152
+ })) : r.svg && p(r.svg)), (t, o) => i(a) ? (g(), C(i(R), _({
134
153
  key: 0,
135
- class: a(u)
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: a(v)
147
- }), null, 16, ["class"])) : y("", !0);
165
+ icon: i(m)
166
+ }), null, 16, ["class"])) : $("", !0);
148
167
  }
149
- });
150
- var w = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(w || {}), C = /* @__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))(C || {}), $ = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))($ || {});
151
- $.before;
152
- const H = {
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
- const P = ["open", "close", "update:modelValue"], W = {
161
- ...H,
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
- }, J = {
257
+ }, se = {
183
258
  key: 0,
184
259
  class: "vv-dialog__header"
185
- }, K = { class: "vv-dialog__content" }, R = {
260
+ }, ie = { class: "vv-dialog__content" }, ue = {
186
261
  key: 1,
187
262
  class: "vv-dialog__footer"
188
- }, G = {
263
+ }, ce = {
189
264
  name: "VvDialog"
190
- }, Y = /* @__PURE__ */ _({
191
- ...G,
192
- props: W,
193
- emits: P,
265
+ }, ge = /* @__PURE__ */ E({
266
+ ...ce,
267
+ props: le,
268
+ emits: ae,
194
269
  setup(e, { emit: r }) {
195
- const i = e, n = useVModel(i, "modelValue", r), d = ref(!0), u = ref(null), s = computed(() => {
196
- const { id: o } = i;
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: d.value
274
+ open: l.value
200
275
  };
201
- }), v = computed(() => i.size ? ["vv-dialog", `vv-dialog--${i.size}`] : "vv-dialog"), m = computed(() => `vv-dialog--${i.transition}`), c = {
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
- d.value = !0, r("open");
278
+ l.value = !0, r("open");
204
279
  },
205
280
  "after-leave": () => {
206
- d.value = !1, r("close");
281
+ l.value = !1, r("close");
207
282
  }
208
283
  };
209
- onClickOutside(u, () => {
210
- i.autoClose && (n.value = !1);
284
+ K(s, () => {
285
+ a.autoClose && (n.value = !1);
211
286
  });
212
287
  function t() {
213
288
  n.value = !1;
214
289
  }
215
- return onKeyStroke("Escape", (o) => {
290
+ return Y("Escape", (o) => {
216
291
  n.value && (o.preventDefault(), t());
217
- }), (o, l) => (g(), V(D, S({ name: a(m) }, N(c)), {
218
- default: k(() => [
219
- E(f("dialog", S(a(s), { class: a(v) }), [
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: u,
297
+ ref: s,
223
298
  class: "vv-dialog__wrapper"
224
299
  }, [
225
- o.$slots.header || o.title ? (g(), B("header", J, [
226
- b(o.$slots, "header", {}, () => [
227
- F(j(o.title) + " ", 1),
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
- I(A, { name: "close" })
309
+ q(Z, { name: "close" })
235
310
  ], 32)
236
311
  ])
237
- ])) : y("", !0),
238
- f("div", K, [
239
- b(o.$slots, "default")
312
+ ])) : $("", !0),
313
+ f("div", ie, [
314
+ y(o.$slots, "default")
240
315
  ]),
241
- o.$slots.footer ? (g(), B("footer", R, [
242
- b(o.$slots, "footer")
243
- ])) : y("", !0)
316
+ o.$slots.footer ? (g(), V("footer", ue, [
317
+ y(o.$slots, "footer")
318
+ ])) : $("", !0)
244
319
  ], 512)
245
320
  ], 16), [
246
- [z, a(n)]
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
- Y as default
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 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]}},v={name:"VvIcon"},w=e.defineComponent({...v,props:b,setup(t){const r=t,a=ref(!0),i=useVolver(),{modifiers:d}=toRefs(r),f=useBemModifiers("vv-icon",d),l=computed(()=>r.provider||(i==null?void 0:i.provider)),g=computed(()=>{const o=r.name??"",n=`@${l.value}:${r.prefix}:${r.name}`;return s.iconExists(o)?o:s.iconExists(n)?n:(i==null?void 0:i.iconsCollections.find(c=>{const y=`@${l.value}:${c.prefix}:${o}`;if(s.iconExists(y))return y}))||o});function h(o){let n=null;if(typeof window>"u"){const{JSDOM:k}=require("jsdom");n=new k().window}return(n?new n.DOMParser:new window.DOMParser).parseFromString(o,"text/html").querySelector("svg")}function p(o){const n=h(o),c=(n==null?void 0:n.innerHTML.trim())||"";n&&c&&s.addIcon(`@${l.value}:${r.prefix}:${r.name}`,{body:c,height:n.viewBox.baseVal.height,width:n.viewBox.baseVal.width})}return i&&(r.src&&!s.iconExists(`@${l.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(f)},{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(g)}),null,16,["class"])):e.createCommentVNode("",!0)}});var u=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(u||{}),S=(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))(S||{}),m=(t=>(t.before="before",t.after="after",t))(m||{});m.before;const B={id:[String,Number]};u.bottom;const V=["open","close","update:modelValue"],_={...B,title:String,modelValue:Boolean,transition:{type:String,default:"fade-block"},size:String,autoClose:{type:Boolean,default:!0}},E={key:0,class:"vv-dialog__header"},$={class:"vv-dialog__content"},C={key:1,class:"vv-dialog__footer"},N={name:"VvDialog"};return e.defineComponent({...N,props:_,emits:V,setup(t,{emit:r}){const a=t,i=useVModel(a,"modelValue",r),d=ref(!0),f=ref(null),l=computed(()=>{const{id:n}=a;return{id:n,open:d.value}}),g=computed(()=>a.size?["vv-dialog",`vv-dialog--${a.size}`]:"vv-dialog"),h=computed(()=>`vv-dialog--${a.transition}`),p={"before-enter":()=>{d.value=!0,r("open")},"after-leave":()=>{d.value=!1,r("close")}};onClickOutside(f,()=>{a.autoClose&&(i.value=!1)});function o(){i.value=!1}return onKeyStroke("Escape",n=>{i.value&&(n.preventDefault(),o())}),(n,c)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(h)},e.toHandlers(p)),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("dialog",e.mergeProps(e.unref(l),{class:e.unref(g)}),[e.createElementVNode("article",{ref_key:"modalWrapper",ref:f,class:"vv-dialog__wrapper"},[n.$slots.header||n.title?(e.openBlock(),e.createElementBlock("header",E,[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(w,{name:"close"})],32)])])):e.createCommentVNode("",!0),e.createElementVNode("div",$,[e.renderSlot(n.$slots,"default")]),n.$slots.footer?(e.openBlock(),e.createElementBlock("footer",C,[e.renderSlot(n.$slots,"footer")])):e.createCommentVNode("",!0)],512)],16),[[e.vShow,e.unref(i)]])]),_:3},16,["name"]))}})});
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"]))}})});