@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2

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 (215) hide show
  1. package/README.md +2 -2
  2. package/auto-imports.d.ts +12 -3
  3. package/bin/icons.cjs +1 -73
  4. package/dist/Volver.d.ts +19 -11
  5. package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  8. package/dist/components/VvAccordion/index.d.ts +8 -3
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  12. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  13. package/dist/components/VvAction/VvAction.es.js +276 -98
  14. package/dist/components/VvAction/VvAction.umd.js +1 -1
  15. package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
  16. package/dist/components/VvAction/index.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +213 -44
  18. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  19. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  20. package/dist/components/VvBadge/index.d.ts +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  24. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  25. package/dist/components/VvButton/VvButton.es.js +646 -360
  26. package/dist/components/VvButton/VvButton.umd.js +1 -1
  27. package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
  28. package/dist/components/VvButton/index.d.ts +13 -13
  29. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
  30. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  31. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  32. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  33. package/dist/components/VvCard/VvCard.es.js +57 -38
  34. package/dist/components/VvCard/VvCard.umd.js +1 -1
  35. package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
  36. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  37. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  38. package/dist/components/VvCheckbox/index.d.ts +5 -5
  39. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  42. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  43. package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
  44. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  45. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
  46. package/dist/components/VvCombobox/index.d.ts +41 -10
  47. package/dist/components/VvDialog/VvDialog.es.js +387 -141
  48. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  49. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  50. package/dist/components/VvDialog/index.d.ts +4 -1
  51. package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
  52. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  53. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
  54. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
  55. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  56. package/dist/components/VvDropdown/index.d.ts +40 -11
  57. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
  58. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  59. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
  60. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  61. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
  62. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  63. package/dist/components/VvIcon/VvIcon.es.js +113 -65
  64. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  65. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  66. package/dist/components/VvIcon/index.d.ts +2 -2
  67. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  69. package/dist/components/VvInputText/VvInputText.es.js +986 -462
  70. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  71. package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
  72. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  73. package/dist/components/VvInputText/index.d.ts +66 -13
  74. package/dist/components/VvProgress/VvProgress.es.js +216 -45
  75. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  76. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  77. package/dist/components/VvProgress/index.d.ts +1 -1
  78. package/dist/components/VvRadio/VvRadio.es.js +499 -238
  79. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  80. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  81. package/dist/components/VvRadio/index.d.ts +5 -5
  82. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
  83. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  84. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  85. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  86. package/dist/components/VvSelect/VvSelect.es.js +631 -324
  87. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  88. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  89. package/dist/components/VvSelect/index.d.ts +3 -3
  90. package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
  91. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  92. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
  93. package/dist/components/VvTextarea/index.d.ts +4 -4
  94. package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
  95. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  96. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  97. package/dist/components/VvTooltip/index.d.ts +2 -2
  98. package/dist/components/index.es.js +3522 -2231
  99. package/dist/components/index.umd.js +1 -1
  100. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  101. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  102. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  103. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  104. package/dist/composables/useComponentFocus.d.ts +1 -1
  105. package/dist/composables/useComponentIcon.d.ts +7 -7
  106. package/dist/composables/useDebouncedInput.d.ts +4 -1
  107. package/dist/composables/useDefaults.d.ts +2 -0
  108. package/dist/composables/useModifiers.d.ts +1 -1
  109. package/dist/composables/useOptions.d.ts +2 -2
  110. package/dist/composables/useTextCount.d.ts +3 -3
  111. package/dist/composables/useUniqueId.d.ts +1 -1
  112. package/dist/composables/useVolver.d.ts +1 -1
  113. package/dist/directives/index.d.ts +1 -0
  114. package/dist/directives/index.es.js +264 -55
  115. package/dist/directives/index.umd.js +1 -1
  116. package/dist/directives/v-contextmenu.d.ts +3 -0
  117. package/dist/directives/v-contextmenu.es.js +42 -0
  118. package/dist/directives/v-contextmenu.umd.js +1 -0
  119. package/dist/directives/v-tooltip.es.js +222 -53
  120. package/dist/directives/v-tooltip.umd.js +1 -1
  121. package/dist/icons.d.ts +3 -1
  122. package/dist/icons.es.js +40 -23
  123. package/dist/icons.umd.js +1 -1
  124. package/dist/index.d.ts +0 -1
  125. package/dist/index.es.js +112 -3607
  126. package/dist/index.umd.js +1 -1
  127. package/dist/props/index.d.ts +50 -18
  128. package/dist/resolvers/unplugin.d.ts +7 -1
  129. package/dist/resolvers/unplugin.es.js +77 -37
  130. package/dist/resolvers/unplugin.umd.js +1 -1
  131. package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
  132. package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
  133. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  134. package/dist/stories/argTypes.d.ts +13 -1
  135. package/package.json +126 -40
  136. package/src/Volver.ts +49 -22
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  141. package/src/components/VvAccordion/index.ts +12 -4
  142. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  143. package/src/components/VvAccordionGroup/index.ts +8 -0
  144. package/src/components/VvAction/VvAction.vue +7 -7
  145. package/src/components/VvAction/index.ts +1 -1
  146. package/src/components/VvBadge/VvBadge.vue +2 -2
  147. package/src/components/VvBadge/index.ts +1 -1
  148. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  149. package/src/components/VvButton/VvButton.vue +11 -11
  150. package/src/components/VvButton/index.ts +10 -9
  151. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  152. package/src/components/VvButtonGroup/index.ts +1 -1
  153. package/src/components/VvCard/VvCard.vue +2 -2
  154. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  155. package/src/components/VvCheckbox/index.ts +11 -7
  156. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  157. package/src/components/VvCheckboxGroup/index.ts +1 -1
  158. package/src/components/VvCombobox/VvCombobox.vue +44 -26
  159. package/src/components/VvCombobox/index.ts +1 -1
  160. package/src/components/VvDialog/VvDialog.vue +28 -11
  161. package/src/components/VvDialog/index.ts +5 -2
  162. package/src/components/VvDropdown/VvDropdown.vue +7 -5
  163. package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
  164. package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
  165. package/src/components/VvDropdown/index.ts +3 -3
  166. package/src/components/VvIcon/VvIcon.vue +3 -3
  167. package/src/components/VvIcon/index.ts +3 -3
  168. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  169. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  170. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  171. package/src/components/VvInputText/VvInputText.vue +130 -37
  172. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  173. package/src/components/VvInputText/index.ts +62 -1
  174. package/src/components/VvProgress/VvProgress.vue +2 -2
  175. package/src/components/VvProgress/index.ts +1 -1
  176. package/src/components/VvRadio/VvRadio.vue +3 -7
  177. package/src/components/VvRadio/index.ts +11 -7
  178. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  179. package/src/components/VvRadioGroup/index.ts +1 -1
  180. package/src/components/VvSelect/VvSelect.vue +4 -4
  181. package/src/components/VvSelect/index.ts +1 -1
  182. package/src/components/VvTextarea/VvTextarea.vue +6 -6
  183. package/src/components/VvTextarea/index.ts +1 -1
  184. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  185. package/src/components/VvTooltip/index.ts +3 -3
  186. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  187. package/src/composables/dropdown/useProvideDropdown.ts +2 -2
  188. package/src/composables/group/useInjectedGroupState.ts +1 -1
  189. package/src/composables/group/useProvideGroupState.ts +1 -1
  190. package/src/composables/useComponentIcon.ts +1 -1
  191. package/src/composables/useDebouncedInput.ts +10 -3
  192. package/src/composables/useDefaults.ts +89 -0
  193. package/src/composables/useModifiers.ts +4 -2
  194. package/src/composables/useOptions.ts +1 -1
  195. package/src/composables/useVolver.ts +2 -2
  196. package/src/directives/index.ts +3 -1
  197. package/src/directives/v-contextmenu.ts +40 -0
  198. package/src/directives/v-tooltip.ts +2 -2
  199. package/src/icons.ts +1 -1
  200. package/src/index.ts +0 -2
  201. package/src/props/index.ts +20 -10
  202. package/src/resolvers/unplugin.ts +15 -1
  203. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  204. package/src/stories/Accordion/Accordion.test.ts +21 -15
  205. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  206. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  207. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  208. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  209. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
  210. package/src/stories/InputText/InputText.settings.ts +53 -0
  211. package/src/stories/InputText/InputText.stories.mdx +40 -0
  212. package/src/stories/InputText/InputText.test.ts +5 -2
  213. package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
  214. package/src/stories/argTypes.ts +12 -2
  215. package/src/types/group.d.ts +5 -0
@@ -1,7 +1,7 @@
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 = {
1
+ import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, Transition, toHandlers, withCtx, withDirectives, createElementVNode, createElementBlock, renderSlot, createTextVNode, toDisplayString, createVNode, vShow } from "vue";
2
+ import { iconExists, Icon, addIcon } from "@iconify/vue";
3
+ import { onClickOutside, onKeyStroke } from "@vueuse/core";
4
+ const VvIconProps = {
5
5
  /**
6
6
  * Color
7
7
  */
@@ -25,7 +25,7 @@ const G = {
25
25
  */
26
26
  name: {
27
27
  type: String,
28
- required: !0
28
+ required: true
29
29
  },
30
30
  /**
31
31
  * By default 'vv'
@@ -95,77 +95,160 @@ const G = {
95
95
  type: [String, Array]
96
96
  }
97
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);
98
+ var Side = /* @__PURE__ */ ((Side2) => {
99
+ Side2["left"] = "left";
100
+ Side2["right"] = "right";
101
+ Side2["top"] = "top";
102
+ Side2["bottom"] = "bottom";
103
+ return Side2;
104
+ })(Side || {});
105
+ var Placement = /* @__PURE__ */ ((Placement2) => {
106
+ Placement2["topStart"] = "top-start";
107
+ Placement2["topEnd"] = "top-end";
108
+ Placement2["bottomStart"] = "bottom-start";
109
+ Placement2["bottomEnd"] = "bottom-end";
110
+ Placement2["leftStart"] = "left-start";
111
+ Placement2["leftEnd"] = "left-end";
112
+ Placement2["rightStart"] = "right-start";
113
+ Placement2["rightEnd"] = "right-end";
114
+ return Placement2;
115
+ })(Placement || {});
116
+ var Position = /* @__PURE__ */ ((Position2) => {
117
+ Position2["before"] = "before";
118
+ Position2["after"] = "after";
119
+ return Position2;
120
+ })(Position || {});
121
+ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
122
+ ButtonType2["button"] = "button";
123
+ ButtonType2["submit"] = "submit";
124
+ ButtonType2["reset"] = "reset";
125
+ return ButtonType2;
126
+ })(ButtonType || {});
127
+ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
128
+ AnchorTarget2["_blank"] = "_blank";
129
+ AnchorTarget2["_self"] = "_self";
130
+ AnchorTarget2["_parent"] = "_parent";
131
+ AnchorTarget2["_top"] = "_top";
132
+ return AnchorTarget2;
133
+ })(AnchorTarget || {});
134
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
135
+ function useVolver() {
136
+ return inject(INJECTION_KEY_VOLVER);
102
137
  }
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;
138
+ function useModifiers(prefix, modifiers, others) {
139
+ return computed(() => {
140
+ const toReturn = {
141
+ [prefix]: true
142
+ };
143
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
144
+ if (modifiersArray) {
145
+ if (Array.isArray(modifiersArray)) {
146
+ modifiersArray.forEach((modifier) => {
147
+ if (modifier) {
148
+ toReturn[`${prefix}--${modifier}`] = true;
149
+ }
150
+ });
151
+ }
152
+ }
153
+ if (others) {
154
+ Object.keys(others.value).forEach((key) => {
155
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
156
+ });
157
+ }
158
+ return toReturn;
113
159
  });
114
160
  }
115
- const X = {
161
+ const __default__$1 = {
116
162
  name: "VvIcon"
117
- }, Z = /* @__PURE__ */ E({
118
- ...X,
119
- props: G,
120
- setup(e) {
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))
127
- return h;
128
- }
129
- )) || t;
163
+ };
164
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
165
+ ...__default__$1,
166
+ props: VvIconProps,
167
+ setup(__props) {
168
+ const props = __props;
169
+ const show = ref(true);
170
+ const volver = useVolver();
171
+ const { modifiers } = toRefs(props);
172
+ const bemCssClasses = useModifiers("vv-icon", modifiers);
173
+ const provider = computed(() => {
174
+ return props.provider || (volver == null ? void 0 : volver.iconsProvider);
175
+ });
176
+ const icon = computed(() => {
177
+ const _name = props.name ?? "";
178
+ const iconName = `@${provider.value}:${props.prefix}:${props.name}`;
179
+ if (iconExists(_name)) {
180
+ return _name;
181
+ } else if (iconExists(iconName)) {
182
+ return iconName;
183
+ } else {
184
+ return (volver == null ? void 0 : volver.iconsCollections.find(
185
+ (iconsCollection) => {
186
+ const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
187
+ if (iconExists(icon2)) {
188
+ return icon2;
189
+ }
190
+ }
191
+ )) || _name;
192
+ }
130
193
  });
131
- function b(t) {
132
- let o = null;
133
- if (typeof window > "u") {
134
- const { JSDOM: k } = require("jsdom");
135
- o = new k().window;
194
+ function getSvgContent(svg) {
195
+ let dom = null;
196
+ if (typeof window === "undefined") {
197
+ const { JSDOM } = require("jsdom");
198
+ dom = new JSDOM().window;
136
199
  }
137
- return (o ? new o.DOMParser() : new window.DOMParser()).parseFromString(t, "text/html").querySelector("svg");
200
+ const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
201
+ const svgDomString = domParser.parseFromString(svg, "text/html");
202
+ const svgEl = svgDomString.querySelector("svg");
203
+ return svgEl;
138
204
  }
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,
143
- // Set height and width from svg content
144
- height: o.viewBox.baseVal.height,
145
- width: o.viewBox.baseVal.width
146
- });
205
+ function addIconFromSvg(svg) {
206
+ const svgContentEl = getSvgContent(svg);
207
+ const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
208
+ if (svgContentEl && svgContent) {
209
+ addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
210
+ body: svgContent,
211
+ // Set height and width from svg content
212
+ height: svgContentEl.viewBox.baseVal.height,
213
+ width: svgContentEl.viewBox.baseVal.width
214
+ });
215
+ }
147
216
  }
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);
150
- }).catch((t) => {
151
- throw new Error(`During fetch icon: ${t == null ? void 0 : t.message}`);
152
- })) : r.svg && p(r.svg)), (t, o) => i(a) ? (g(), C(i(R), _({
153
- key: 0,
154
- class: i(s)
155
- }, {
156
- inline: t.inline,
157
- width: t.width,
158
- height: t.height,
159
- horizontalFlip: t.horizontalFlip,
160
- verticalFlip: t.verticalFlip,
161
- flip: t.flip,
162
- rotate: t.rotate,
163
- color: t.color,
164
- onLoad: t.onLoad,
165
- icon: i(m)
166
- }), null, 16, ["class"])) : $("", !0);
217
+ if (volver) {
218
+ if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
219
+ show.value = false;
220
+ volver.fetchIcon(props.src).then((svg) => {
221
+ if (svg) {
222
+ addIconFromSvg(svg);
223
+ show.value = true;
224
+ }
225
+ }).catch((e) => {
226
+ throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
227
+ });
228
+ } else if (props.svg) {
229
+ addIconFromSvg(props.svg);
230
+ }
231
+ }
232
+ return (_ctx, _cache) => {
233
+ return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
234
+ key: 0,
235
+ class: unref(bemCssClasses)
236
+ }, {
237
+ inline: _ctx.inline,
238
+ width: _ctx.width,
239
+ height: _ctx.height,
240
+ horizontalFlip: _ctx.horizontalFlip,
241
+ verticalFlip: _ctx.verticalFlip,
242
+ flip: _ctx.flip,
243
+ rotate: _ctx.rotate,
244
+ color: _ctx.color,
245
+ onLoad: _ctx.onLoad,
246
+ icon: unref(icon)
247
+ }), null, 16, ["class"])) : createCommentVNode("", true);
248
+ };
167
249
  }
168
- }), x = {
250
+ });
251
+ const LinkProps = {
169
252
  /**
170
253
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
171
254
  * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
@@ -182,7 +265,7 @@ const X = {
182
265
  */
183
266
  target: {
184
267
  type: String,
185
- validator: (e) => Object.values(j).includes(e)
268
+ validator: (value) => Object.values(AnchorTarget).includes(value)
186
269
  },
187
270
  /**
188
271
  * Anchor rel
@@ -191,49 +274,167 @@ const X = {
191
274
  type: String,
192
275
  default: "noopener noreferrer"
193
276
  }
194
- }, ee = {
277
+ };
278
+ const DisabledProps = {
195
279
  /**
196
280
  * Whether the form control is disabled
197
281
  */
198
282
  disabled: Boolean
199
- }, te = {
283
+ };
284
+ const ActiveProps = {
200
285
  /**
201
286
  * Whether the item is active
202
287
  */
203
288
  active: Boolean
204
- }, oe = {
289
+ };
290
+ const PressedProps = {
205
291
  /**
206
292
  * Whether the item is pressed
207
293
  */
208
294
  pressed: Boolean
209
- }, re = {
295
+ };
296
+ const LabelProps = {
210
297
  /**
211
298
  * The item label
212
299
  */
213
300
  label: [String, Number]
214
301
  };
215
- B.before;
216
- const ne = {
302
+ ({
303
+ /**
304
+ * VvIcon name or props
305
+ * @see VVIcon
306
+ */
307
+ icon: { type: [String, Object] },
308
+ /**
309
+ * VvIcon position
310
+ */
311
+ iconPosition: {
312
+ type: String,
313
+ default: Position.before,
314
+ validation: (value) => Object.values(Position).includes(value)
315
+ }
316
+ });
317
+ const IdProps = {
217
318
  /**
218
319
  * Global attribute id
219
320
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
220
321
  */
221
322
  id: [String, Number]
222
323
  };
223
- w.bottom;
224
324
  ({
225
- ...ee,
226
- ...re,
227
- ...oe,
228
- ...te,
229
- ...x,
325
+ /**
326
+ * Dropdown placement
327
+ */
328
+ placement: {
329
+ type: String,
330
+ default: Side.bottom,
331
+ validator: (value) => {
332
+ return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
333
+ }
334
+ },
335
+ /**
336
+ * Dropdown strategy
337
+ */
338
+ strategy: {
339
+ type: String,
340
+ default: "absolute",
341
+ validator: (value) => {
342
+ return ["fixed", "absolute"].includes(value);
343
+ }
344
+ },
345
+ /**
346
+ * Dropdown show / hide transition name
347
+ */
348
+ transitionName: {
349
+ type: String
350
+ },
351
+ /**
352
+ * Offset of the dropdown from the trigger
353
+ * @see https://floating-ui.com/docs/offset
354
+ */
355
+ offset: {
356
+ type: [Number, String, Object],
357
+ default: 0
358
+ },
359
+ /**
360
+ * Move dropdown to the side if there is no space in the default position
361
+ * @see https://floating-ui.com/docs/shift
362
+ */
363
+ shift: {
364
+ type: [Boolean, Object],
365
+ default: false
366
+ },
367
+ /**
368
+ * Flip dropdown position if there is no space in the default position
369
+ * @see https://floating-ui.com/docs/flip
370
+ */
371
+ flip: {
372
+ type: [Boolean, Object],
373
+ default: true
374
+ },
375
+ /**
376
+ * Size of the dropdown
377
+ * @see https://floating-ui.com/docs/size
378
+ */
379
+ size: {
380
+ type: [Boolean, Object],
381
+ default: () => ({ padding: 10 })
382
+ },
383
+ /**
384
+ * Automatically change the position of the dropdown
385
+ * @see https://floating-ui.com/docs/autoPlacement
386
+ */
387
+ autoPlacement: {
388
+ type: [Boolean, Object],
389
+ default: false
390
+ },
391
+ /**
392
+ * Add arrow to the dropdown
393
+ * @see https://floating-ui.com/docs/arrow
394
+ */
395
+ arrow: {
396
+ type: Boolean,
397
+ default: false
398
+ },
399
+ /**
400
+ * Close dropdown on click outside
401
+ */
402
+ autoClose: {
403
+ type: Boolean,
404
+ default: true
405
+ },
406
+ /**
407
+ * Autofocus first item on dropdown open
408
+ */
409
+ autofocusFirst: {
410
+ type: Boolean,
411
+ default: true
412
+ },
413
+ /**
414
+ * Set dropdown width to the same as the trigger
415
+ */
416
+ triggerWidth: {
417
+ type: Boolean
418
+ }
419
+ });
420
+ ({
421
+ ...DisabledProps,
422
+ ...LabelProps,
423
+ ...PressedProps,
424
+ ...ActiveProps,
425
+ ...LinkProps,
230
426
  /**
231
427
  * Button type
232
428
  */
233
- type: O.button
429
+ type: {
430
+ type: String,
431
+ default: ButtonType.button,
432
+ validator: (value) => Object.values(ButtonType).includes(value)
433
+ }
234
434
  });
235
- const ae = ["open", "close", "update:modelValue"], le = {
236
- ...ne,
435
+ const VvDialogEvents = ["open", "close", "update:modelValue"];
436
+ const VvDialogProps = {
437
+ ...IdProps,
237
438
  /**
238
439
  * Dialog title
239
440
  */
@@ -241,7 +442,10 @@ const ae = ["open", "close", "update:modelValue"], le = {
241
442
  /**
242
443
  * Show / hide dialog programmatically
243
444
  */
244
- modelValue: Boolean,
445
+ modelValue: {
446
+ type: Boolean,
447
+ default: void 0
448
+ },
245
449
  /**
246
450
  * Dialog transition
247
451
  */
@@ -253,78 +457,120 @@ const ae = ["open", "close", "update:modelValue"], le = {
253
457
  /**
254
458
  * Close dialog on click outside
255
459
  */
256
- autoClose: { type: Boolean, default: !0 }
257
- }, se = {
460
+ autoClose: { type: Boolean, default: true }
461
+ };
462
+ const _hoisted_1 = {
258
463
  key: 0,
259
464
  class: "vv-dialog__header"
260
- }, ie = { class: "vv-dialog__content" }, ue = {
465
+ };
466
+ const _hoisted_2 = { class: "vv-dialog__content" };
467
+ const _hoisted_3 = {
261
468
  key: 1,
262
469
  class: "vv-dialog__footer"
263
- }, ce = {
470
+ };
471
+ const __default__ = {
264
472
  name: "VvDialog"
265
- }, ge = /* @__PURE__ */ E({
266
- ...ce,
267
- props: le,
268
- emits: ae,
269
- setup(e, { emit: r }) {
270
- const a = e, n = J(a, "modelValue", r), l = S(!0), s = S(null), u = d(() => {
271
- const { id: o } = a;
473
+ };
474
+ const _sfc_main = /* @__PURE__ */ defineComponent({
475
+ ...__default__,
476
+ props: VvDialogProps,
477
+ emits: VvDialogEvents,
478
+ setup(__props, { expose, emit }) {
479
+ const props = __props;
480
+ const localModelValue = ref(false);
481
+ const modelValue = computed({
482
+ get() {
483
+ return props.modelValue ?? localModelValue.value;
484
+ },
485
+ set(value) {
486
+ if (props.modelValue === void 0) {
487
+ localModelValue.value = value;
488
+ }
489
+ emit("update:modelValue", value);
490
+ }
491
+ });
492
+ const htmlAttrIsOpen = ref(true);
493
+ const modalWrapper = ref(null);
494
+ const dialogAttrs = computed(() => {
495
+ const { id } = props;
272
496
  return {
273
- id: o,
274
- open: l.value
497
+ id,
498
+ open: htmlAttrIsOpen.value
275
499
  };
276
- }), m = d(() => a.size ? ["vv-dialog", `vv-dialog--${a.size}`] : "vv-dialog"), b = d(() => `vv-dialog--${a.transition}`), p = {
500
+ });
501
+ const dialogClass = computed(() => {
502
+ if (!props.size) {
503
+ return "vv-dialog";
504
+ }
505
+ return ["vv-dialog", `vv-dialog--${props.size}`];
506
+ });
507
+ const transitioName = computed(() => `vv-dialog--${props.transition}`);
508
+ const dialogTransitionHandlers = {
277
509
  "before-enter": () => {
278
- l.value = !0, r("open");
510
+ htmlAttrIsOpen.value = true;
511
+ emit("open");
279
512
  },
280
513
  "after-leave": () => {
281
- l.value = !1, r("close");
514
+ htmlAttrIsOpen.value = false;
515
+ emit("close");
282
516
  }
283
517
  };
284
- K(s, () => {
285
- a.autoClose && (n.value = !1);
518
+ onClickOutside(modalWrapper, () => {
519
+ if (props.autoClose) {
520
+ modelValue.value = false;
521
+ }
286
522
  });
287
- function t() {
288
- n.value = !1;
523
+ function close() {
524
+ modelValue.value = false;
525
+ }
526
+ function open() {
527
+ modelValue.value = true;
289
528
  }
290
- return Y("Escape", (o) => {
291
- n.value && (o.preventDefault(), t());
292
- }), (o, c) => (g(), C(I, _({ name: i(b) }, P(p)), {
293
- default: z(() => [
294
- L(f("dialog", _(i(u), { class: i(m) }), [
295
- f("article", {
296
- ref_key: "modalWrapper",
297
- ref: s,
298
- class: "vv-dialog__wrapper"
299
- }, [
300
- o.$slots.header || o.title ? (g(), V("header", se, [
301
- y(o.$slots, "header", {}, () => [
302
- M(A(o.title) + " ", 1),
303
- f("button", {
304
- type: "button",
305
- "aria-label": "Close",
306
- class: "vv-dialog__close",
307
- onClickPassive: t
308
- }, [
309
- q(Z, { name: "close" })
310
- ], 32)
311
- ])
312
- ])) : $("", !0),
313
- f("div", ie, [
314
- y(o.$slots, "default")
315
- ]),
316
- o.$slots.footer ? (g(), V("footer", ue, [
317
- y(o.$slots, "footer")
318
- ])) : $("", !0)
319
- ], 512)
320
- ], 16), [
321
- [H, i(n)]
322
- ])
323
- ]),
324
- _: 3
325
- }, 16, ["name"]));
529
+ expose({ close, open });
530
+ onKeyStroke("Escape", (e) => {
531
+ if (modelValue.value) {
532
+ e.preventDefault();
533
+ close();
534
+ }
535
+ });
536
+ return (_ctx, _cache) => {
537
+ return openBlock(), createBlock(Transition, mergeProps({ name: unref(transitioName) }, toHandlers(dialogTransitionHandlers)), {
538
+ default: withCtx(() => [
539
+ withDirectives(createElementVNode("dialog", mergeProps(unref(dialogAttrs), { class: unref(dialogClass) }), [
540
+ createElementVNode("article", {
541
+ ref_key: "modalWrapper",
542
+ ref: modalWrapper,
543
+ class: "vv-dialog__wrapper"
544
+ }, [
545
+ _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
546
+ renderSlot(_ctx.$slots, "header", {}, () => [
547
+ createTextVNode(toDisplayString(_ctx.title) + " ", 1),
548
+ createElementVNode("button", {
549
+ type: "button",
550
+ "aria-label": "Close",
551
+ class: "vv-dialog__close",
552
+ onClickPassive: close
553
+ }, [
554
+ createVNode(_sfc_main$1, { name: "close" })
555
+ ], 32)
556
+ ])
557
+ ])) : createCommentVNode("", true),
558
+ createElementVNode("div", _hoisted_2, [
559
+ renderSlot(_ctx.$slots, "default")
560
+ ]),
561
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
562
+ renderSlot(_ctx.$slots, "footer")
563
+ ])) : createCommentVNode("", true)
564
+ ], 512)
565
+ ], 16), [
566
+ [vShow, unref(modelValue)]
567
+ ])
568
+ ]),
569
+ _: 3
570
+ }, 16, ["name"]);
571
+ };
326
572
  }
327
573
  });
328
574
  export {
329
- ge as default
575
+ _sfc_main as default
330
576
  };
@@ -1 +1 @@
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"]))}})});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iconify/vue"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDialog=o(e.vue,e.vue$1,e.core)}(this,(function(e,o,t){"use strict";const n={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 r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{});const a=Symbol.for("volver");const s=e.defineComponent({name:"VvIcon",props:n,setup(t){const n=t,r=e.ref(!0),l=e.inject(a),{modifiers:i}=e.toRefs(n),s=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-icon",i),u=e.computed((()=>n.provider||(null==l?void 0:l.iconsProvider))),c=e.computed((()=>{const e=n.name??"",t=`@${u.value}:${n.prefix}:${n.name}`;return o.iconExists(e)?e:o.iconExists(t)?t:(null==l?void 0:l.iconsCollections.find((t=>{const n=`@${u.value}:${t.prefix}:${e}`;if(o.iconExists(n))return n})))||e}));function d(e){const t=function(e){let o=null;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");o=(new e).window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==t?void 0:t.innerHTML.trim())||"";t&&r&&o.addIcon(`@${u.value}:${n.prefix}:${n.name}`,{body:r,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return l&&(n.src&&!o.iconExists(`@${u.value}:${n.prefix}:${n.name}`)?(r.value=!1,l.fetchIcon(n.src).then((e=>{e&&(d(e),r.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):n.svg&&d(n.svg)),(t,n)=>e.unref(r)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(s)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:t.rotate,color:t.color,onLoad:t.onLoad,icon:e.unref(c)}),null,16,["class"])):e.createCommentVNode("",!0)}});Boolean,Boolean,Boolean;l.before;const u={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,i.button;const c={...u,title:String,modelValue:{type:Boolean,default:void 0},transition:{type:String,default:"fade-block"},size:String,autoClose:{type:Boolean,default:!0}},d={key:0,class:"vv-dialog__header"},f={class:"vv-dialog__content"},v={key:1,class:"vv-dialog__footer"};return e.defineComponent({name:"VvDialog",props:c,emits:["open","close","update:modelValue"],setup(o,{expose:n,emit:r}){const l=o,i=e.ref(!1),a=e.computed({get:()=>l.modelValue??i.value,set(e){void 0===l.modelValue&&(i.value=e),r("update:modelValue",e)}}),u=e.ref(!0),c=e.ref(null),p=e.computed((()=>{const{id:e}=l;return{id:e,open:u.value}})),m=e.computed((()=>l.size?["vv-dialog",`vv-dialog--${l.size}`]:"vv-dialog")),g=e.computed((()=>`vv-dialog--${l.transition}`)),h={"before-enter":()=>{u.value=!0,r("open")},"after-leave":()=>{u.value=!1,r("close")}};function y(){a.value=!1}return t.onClickOutside(c,(()=>{l.autoClose&&(a.value=!1)})),n({close:y,open:function(){a.value=!0}}),t.onKeyStroke("Escape",(e=>{a.value&&(e.preventDefault(),y())})),(o,t)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(g)},e.toHandlers(h)),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("dialog",e.mergeProps(e.unref(p),{class:e.unref(m)}),[e.createElementVNode("article",{ref_key:"modalWrapper",ref:c,class:"vv-dialog__wrapper"},[o.$slots.header||o.title?(e.openBlock(),e.createElementBlock("header",d,[e.renderSlot(o.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(o.title)+" ",1),e.createElementVNode("button",{type:"button","aria-label":"Close",class:"vv-dialog__close",onClickPassive:y},[e.createVNode(s,{name:"close"})],32)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",f,[e.renderSlot(o.$slots,"default")]),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",v,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],512)],16),[[e.vShow,e.unref(a)]])])),_:3},16,["name"]))}})}));