@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,6 +1,6 @@
1
- import { inject as S, computed as g, unref as l, defineComponent as w, ref as $, toRefs as y, openBlock as b, createBlock as F, mergeProps as B, createCommentVNode as E } from "vue";
2
- import { iconExists as p, Icon as I, addIcon as V } from "@iconify/vue";
3
- const C = {
1
+ import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode } from "vue";
2
+ import { iconExists, Icon, addIcon } from "@iconify/vue";
3
+ const VvIconProps = {
4
4
  /**
5
5
  * Color
6
6
  */
@@ -24,7 +24,7 @@ const C = {
24
24
  */
25
25
  name: {
26
26
  type: String,
27
- required: !0
27
+ required: true
28
28
  },
29
29
  /**
30
30
  * By default 'vv'
@@ -93,76 +93,124 @@ const C = {
93
93
  modifiers: {
94
94
  type: [String, Array]
95
95
  }
96
- }, N = Symbol.for("volver");
97
- function D() {
98
- return S(N);
96
+ };
97
+ const INJECTION_KEY_VOLVER = Symbol.for("volver");
98
+ function useVolver() {
99
+ return inject(INJECTION_KEY_VOLVER);
99
100
  }
100
- function O(a, n, o) {
101
- return g(() => {
102
- const t = {
103
- [a]: !0
104
- }, s = typeof (n == null ? void 0 : n.value) == "string" ? n.value.split(" ") : n == null ? void 0 : n.value;
105
- return s && Array.isArray(s) && s.forEach((i) => {
106
- t[`${a}--${i}`] = !0;
107
- }), o && Object.keys(o.value).forEach((i) => {
108
- t[`${a}--${i}`] = l(o.value[i]);
109
- }), t;
101
+ function useModifiers(prefix, modifiers, others) {
102
+ return computed(() => {
103
+ const toReturn = {
104
+ [prefix]: true
105
+ };
106
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
107
+ if (modifiersArray) {
108
+ if (Array.isArray(modifiersArray)) {
109
+ modifiersArray.forEach((modifier) => {
110
+ if (modifier) {
111
+ toReturn[`${prefix}--${modifier}`] = true;
112
+ }
113
+ });
114
+ }
115
+ }
116
+ if (others) {
117
+ Object.keys(others.value).forEach((key) => {
118
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
119
+ });
120
+ }
121
+ return toReturn;
110
122
  });
111
123
  }
112
- const P = {
124
+ const __default__ = {
113
125
  name: "VvIcon"
114
- }, k = /* @__PURE__ */ w({
115
- ...P,
116
- props: C,
117
- setup(a) {
118
- const n = a, o = $(!0), t = D(), { modifiers: s } = y(n), i = O("vv-icon", s), u = g(() => n.provider || (t == null ? void 0 : t.provider)), m = g(() => {
119
- const e = n.name ?? "", r = `@${u.value}:${n.prefix}:${n.name}`;
120
- return p(e) ? e : p(r) ? r : (t == null ? void 0 : t.iconsCollections.find(
121
- (c) => {
122
- const f = `@${u.value}:${c.prefix}:${e}`;
123
- if (p(f))
124
- return f;
125
- }
126
- )) || e;
126
+ };
127
+ const _sfc_main = /* @__PURE__ */ defineComponent({
128
+ ...__default__,
129
+ props: VvIconProps,
130
+ setup(__props) {
131
+ const props = __props;
132
+ const show = ref(true);
133
+ const volver = useVolver();
134
+ const { modifiers } = toRefs(props);
135
+ const bemCssClasses = useModifiers("vv-icon", modifiers);
136
+ const provider = computed(() => {
137
+ return props.provider || (volver == null ? void 0 : volver.iconsProvider);
127
138
  });
128
- function d(e) {
129
- let r = null;
130
- if (typeof window > "u") {
131
- const { JSDOM: h } = require("jsdom");
132
- r = new h().window;
139
+ const icon = computed(() => {
140
+ const _name = props.name ?? "";
141
+ const iconName = `@${provider.value}:${props.prefix}:${props.name}`;
142
+ if (iconExists(_name)) {
143
+ return _name;
144
+ } else if (iconExists(iconName)) {
145
+ return iconName;
146
+ } else {
147
+ return (volver == null ? void 0 : volver.iconsCollections.find(
148
+ (iconsCollection) => {
149
+ const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
150
+ if (iconExists(icon2)) {
151
+ return icon2;
152
+ }
153
+ }
154
+ )) || _name;
133
155
  }
134
- return (r ? new r.DOMParser() : new window.DOMParser()).parseFromString(e, "text/html").querySelector("svg");
156
+ });
157
+ function getSvgContent(svg) {
158
+ let dom = null;
159
+ if (typeof window === "undefined") {
160
+ const { JSDOM } = require("jsdom");
161
+ dom = new JSDOM().window;
162
+ }
163
+ const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
164
+ const svgDomString = domParser.parseFromString(svg, "text/html");
165
+ const svgEl = svgDomString.querySelector("svg");
166
+ return svgEl;
135
167
  }
136
- function v(e) {
137
- const r = d(e), c = (r == null ? void 0 : r.innerHTML.trim()) || "";
138
- r && c && V(`@${u.value}:${n.prefix}:${n.name}`, {
139
- body: c,
140
- // Set height and width from svg content
141
- height: r.viewBox.baseVal.height,
142
- width: r.viewBox.baseVal.width
143
- });
168
+ function addIconFromSvg(svg) {
169
+ const svgContentEl = getSvgContent(svg);
170
+ const svgContent = (svgContentEl == null ? void 0 : svgContentEl.innerHTML.trim()) || "";
171
+ if (svgContentEl && svgContent) {
172
+ addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
173
+ body: svgContent,
174
+ // Set height and width from svg content
175
+ height: svgContentEl.viewBox.baseVal.height,
176
+ width: svgContentEl.viewBox.baseVal.width
177
+ });
178
+ }
179
+ }
180
+ if (volver) {
181
+ if (props.src && !iconExists(`@${provider.value}:${props.prefix}:${props.name}`)) {
182
+ show.value = false;
183
+ volver.fetchIcon(props.src).then((svg) => {
184
+ if (svg) {
185
+ addIconFromSvg(svg);
186
+ show.value = true;
187
+ }
188
+ }).catch((e) => {
189
+ throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
190
+ });
191
+ } else if (props.svg) {
192
+ addIconFromSvg(props.svg);
193
+ }
144
194
  }
145
- return t && (n.src && !p(`@${u.value}:${n.prefix}:${n.name}`) ? (o.value = !1, t.fetchIcon(n.src).then((e) => {
146
- e && (v(e), o.value = !0);
147
- }).catch((e) => {
148
- throw new Error(`During fetch icon: ${e == null ? void 0 : e.message}`);
149
- })) : n.svg && v(n.svg)), (e, r) => l(o) ? (b(), F(l(I), B({
150
- key: 0,
151
- class: l(i)
152
- }, {
153
- inline: e.inline,
154
- width: e.width,
155
- height: e.height,
156
- horizontalFlip: e.horizontalFlip,
157
- verticalFlip: e.verticalFlip,
158
- flip: e.flip,
159
- rotate: e.rotate,
160
- color: e.color,
161
- onLoad: e.onLoad,
162
- icon: l(m)
163
- }), null, 16, ["class"])) : E("", !0);
195
+ return (_ctx, _cache) => {
196
+ return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
197
+ key: 0,
198
+ class: unref(bemCssClasses)
199
+ }, {
200
+ inline: _ctx.inline,
201
+ width: _ctx.width,
202
+ height: _ctx.height,
203
+ horizontalFlip: _ctx.horizontalFlip,
204
+ verticalFlip: _ctx.verticalFlip,
205
+ flip: _ctx.flip,
206
+ rotate: _ctx.rotate,
207
+ color: _ctx.color,
208
+ onLoad: _ctx.onLoad,
209
+ icon: unref(icon)
210
+ }), null, 16, ["class"])) : createCommentVNode("", true);
211
+ };
164
212
  }
165
213
  });
166
214
  export {
167
- k as default
215
+ _sfc_main as default
168
216
  };
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue"),require("@iconify/vue")):typeof define=="function"&&define.amd?define(["vue","@iconify/vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.VvIcon=i(e.vue,e.vue$1))})(this,function(e,i){"use strict";const g={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]}},m=Symbol.for("volver");function h(){return e.inject(m)}function y(a,t,s){return e.computed(()=>{const r={[a]:!0},l=typeof(t==null?void 0:t.value)=="string"?t.value.split(" "):t==null?void 0:t.value;return l&&Array.isArray(l)&&l.forEach(c=>{r[`${a}--${c}`]=!0}),s&&Object.keys(s.value).forEach(c=>{r[`${a}--${c}`]=e.unref(s.value[c])}),r})}const S={name:"VvIcon"};return e.defineComponent({...S,props:g,setup(a){const t=a,s=e.ref(!0),r=h(),{modifiers:l}=e.toRefs(t),c=y("vv-icon",l),f=e.computed(()=>t.provider||(r==null?void 0:r.provider)),w=e.computed(()=>{const n=t.name??"",o=`@${f.value}:${t.prefix}:${t.name}`;return i.iconExists(n)?n:i.iconExists(o)?o:(r==null?void 0:r.iconsCollections.find(u=>{const p=`@${f.value}:${u.prefix}:${n}`;if(i.iconExists(p))return p}))||n});function v(n){let o=null;if(typeof window>"u"){const{JSDOM:$}=require("jsdom");o=new $().window}return(o?new o.DOMParser:new window.DOMParser).parseFromString(n,"text/html").querySelector("svg")}function d(n){const o=v(n),u=(o==null?void 0:o.innerHTML.trim())||"";o&&u&&i.addIcon(`@${f.value}:${t.prefix}:${t.name}`,{body:u,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return r&&(t.src&&!i.iconExists(`@${f.value}:${t.prefix}:${t.name}`)?(s.value=!1,r.fetchIcon(t.src).then(n=>{n&&(d(n),s.value=!0)}).catch(n=>{throw new Error(`During fetch icon: ${n==null?void 0:n.message}`)})):t.svg&&d(t.svg)),(n,o)=>e.unref(s)?(e.openBlock(),e.createBlock(e.unref(i.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:n.inline,width:n.width,height:n.height,horizontalFlip:n.horizontalFlip,verticalFlip:n.verticalFlip,flip:n.flip,rotate:n.rotate,color:n.color,onLoad:n.onLoad,icon:e.unref(w)}),null,16,["class"])):e.createCommentVNode("",!0)}})});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("vue"),require("@iconify/vue")):"function"==typeof define&&define.amd?define(["vue","@iconify/vue"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).VvIcon=n(e.vue,e.vue$1)}(this,(function(e,n){"use strict";const i={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]}},o=Symbol.for("volver");return e.defineComponent({name:"VvIcon",props:i,setup(i){const r=i,t=e.ref(!0),l=e.inject(o),{modifiers:u}=e.toRefs(r),c=function(n,i,o){return e.computed((()=>{const r={[n]:!0},t="string"==typeof(null==i?void 0:i.value)?i.value.split(" "):null==i?void 0:i.value;return t&&Array.isArray(t)&&t.forEach((e=>{e&&(r[`${n}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((i=>{r[`${n}--${i}`]=e.unref(o.value[i])})),r}))}("vv-icon",u),a=e.computed((()=>r.provider||(null==l?void 0:l.iconsProvider))),s=e.computed((()=>{const e=r.name??"",i=`@${a.value}:${r.prefix}:${r.name}`;return n.iconExists(e)?e:n.iconExists(i)?i:(null==l?void 0:l.iconsCollections.find((i=>{const o=`@${a.value}:${i.prefix}:${e}`;if(n.iconExists(o))return o})))||e}));function f(e){const i=function(e){let n=null;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");n=(new e).window}return(n?new n.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),o=(null==i?void 0:i.innerHTML.trim())||"";i&&o&&n.addIcon(`@${a.value}:${r.prefix}:${r.name}`,{body:o,height:i.viewBox.baseVal.height,width:i.viewBox.baseVal.width})}return l&&(r.src&&!n.iconExists(`@${a.value}:${r.prefix}:${r.name}`)?(t.value=!1,l.fetchIcon(r.src).then((e=>{e&&(f(e),t.value=!0)})).catch((e=>{throw new Error(`During fetch icon: ${null==e?void 0:e.message}`)}))):r.svg&&f(r.svg)),(i,o)=>e.unref(t)?(e.openBlock(),e.createBlock(e.unref(n.Icon),e.mergeProps({key:0,class:e.unref(c)},{inline:i.inline,width:i.width,height:i.height,horizontalFlip:i.horizontalFlip,verticalFlip:i.verticalFlip,flip:i.flip,rotate:i.rotate,color:i.color,onLoad:i.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("",!0)}})}));
@@ -14,20 +14,20 @@ declare const _default: import("vue").DefineComponent<{
14
14
  type: StringConstructor;
15
15
  };
16
16
  prefix: {
17
- type: import("vue").PropType<import("@/components/VvIcon").PREFIX>;
17
+ type: globalThis.PropType<string>;
18
18
  default: string;
19
19
  };
20
20
  src: StringConstructor;
21
21
  horizontalFlip: BooleanConstructor;
22
22
  verticalFlip: BooleanConstructor;
23
23
  flip: StringConstructor;
24
- mode: import("vue").PropType<import("@iconify/vue").IconifyRenderMode>;
24
+ mode: globalThis.PropType<import("@iconify/vue").IconifyRenderMode>;
25
25
  inline: BooleanConstructor;
26
26
  rotate: (StringConstructor | NumberConstructor)[];
27
27
  onLoad: FunctionConstructor;
28
28
  svg: StringConstructor;
29
29
  modifiers: {
30
- type: import("vue").PropType<string | string[]>;
30
+ type: globalThis.PropType<string | string[]>;
31
31
  };
32
32
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
33
  color: StringConstructor;
@@ -45,23 +45,23 @@ declare const _default: import("vue").DefineComponent<{
45
45
  type: StringConstructor;
46
46
  };
47
47
  prefix: {
48
- type: import("vue").PropType<import("@/components/VvIcon").PREFIX>;
48
+ type: globalThis.PropType<string>;
49
49
  default: string;
50
50
  };
51
51
  src: StringConstructor;
52
52
  horizontalFlip: BooleanConstructor;
53
53
  verticalFlip: BooleanConstructor;
54
54
  flip: StringConstructor;
55
- mode: import("vue").PropType<import("@iconify/vue").IconifyRenderMode>;
55
+ mode: globalThis.PropType<import("@iconify/vue").IconifyRenderMode>;
56
56
  inline: BooleanConstructor;
57
57
  rotate: (StringConstructor | NumberConstructor)[];
58
58
  onLoad: FunctionConstructor;
59
59
  svg: StringConstructor;
60
60
  modifiers: {
61
- type: import("vue").PropType<string | string[]>;
61
+ type: globalThis.PropType<string | string[]>;
62
62
  };
63
63
  }>>, {
64
- prefix: import("@/components/VvIcon").PREFIX;
64
+ prefix: string;
65
65
  horizontalFlip: boolean;
66
66
  verticalFlip: boolean;
67
67
  inline: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import type { IconifyRenderMode } from '@iconify/vue';
3
- export declare enum PREFIX {
3
+ export declare enum IconPrefix {
4
4
  simple = "simple",
5
5
  normal = "normal",
6
6
  detailed = "detailed"
@@ -44,7 +44,7 @@ export declare const VvIconProps: {
44
44
  * Icon default options prefix: simple | normal | detailed
45
45
  */
46
46
  prefix: {
47
- type: PropType<PREFIX>;
47
+ type: PropType<string>;
48
48
  default: string;
49
49
  };
50
50
  /**
@@ -20,8 +20,8 @@ declare const _default: import("vue").DefineComponent<{
20
20
  default: "eye-off";
21
21
  };
22
22
  }, {
23
- active: import("vue").Ref<boolean>;
24
- activeIcon: import("vue").ComputedRef<string>;
23
+ active: globalThis.Ref<boolean>;
24
+ activeIcon: globalThis.ComputedRef<string>;
25
25
  onClick: (e: Event) => void;
26
26
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "toggle-password"[], "toggle-password", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  disabled: {
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  default: string;
13
13
  };
14
14
  }, {
15
- isUp: import("vue").ComputedRef<boolean>;
15
+ isUp: globalThis.ComputedRef<boolean>;
16
16
  onClick: (e: Event) => void;
17
17
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("step-up" | "step-down")[], "step-up" | "step-down", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  disabled: {