@volverjs/ui-vue 0.0.11 → 0.0.13-beta.1

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 (98) hide show
  1. package/bin/icons.js +1 -93
  2. package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
  3. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +7 -2
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
  5. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -2
  6. package/dist/components/VvAction/VvAction.es.js +1 -302
  7. package/dist/components/VvAction/VvAction.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.vue.d.ts +3 -2
  9. package/dist/components/VvAlert/VvAlert.es.js +1 -527
  10. package/dist/components/VvAlert/VvAlert.vue.d.ts +3 -2
  11. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
  12. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
  13. package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
  14. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
  15. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
  16. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +1 -131
  18. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  19. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
  20. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -2
  22. package/dist/components/VvButton/VvButton.es.js +1 -882
  23. package/dist/components/VvButton/VvButton.umd.js +1 -1
  24. package/dist/components/VvButton/VvButton.vue.d.ts +3 -2
  25. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
  26. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  27. package/dist/components/VvCard/VvCard.es.js +1 -152
  28. package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
  29. package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
  30. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
  32. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  33. package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
  34. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  35. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +16 -7
  36. package/dist/components/VvDialog/VvDialog.es.js +1 -317
  37. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -2
  38. package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
  39. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
  40. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
  41. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
  42. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -4
  43. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
  47. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
  48. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  49. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
  50. package/dist/components/VvIcon/VvIcon.es.js +1 -143
  51. package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
  52. package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
  53. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  54. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +34 -4
  55. package/dist/components/VvInputFile/index.d.ts +7 -0
  56. package/dist/components/VvInputText/VvInputText.es.js +4 -2790
  57. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  58. package/dist/components/VvInputText/VvInputText.vue.d.ts +8 -3
  59. package/dist/components/VvNav/VvNav.es.js +1 -438
  60. package/dist/components/VvNav/VvNav.umd.js +1 -1
  61. package/dist/components/VvNav/VvNav.vue.d.ts +2 -2
  62. package/dist/components/VvNav/VvNavItem.vue.d.ts +2 -2
  63. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  64. package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
  65. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  66. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
  67. package/dist/components/VvProgress/VvProgress.es.js +1 -163
  68. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  69. package/dist/components/VvRadio/VvRadio.es.js +1 -661
  70. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  71. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
  72. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  73. package/dist/components/VvSelect/VvSelect.es.js +1 -1103
  74. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -7
  75. package/dist/components/VvTab/VvTab.es.js +1 -558
  76. package/dist/components/VvTab/VvTab.umd.js +1 -1
  77. package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
  78. package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
  79. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
  80. package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
  81. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
  82. package/dist/components/index.es.js +6 -8558
  83. package/dist/components/index.umd.js +1 -1
  84. package/dist/composables/index.es.js +2 -247
  85. package/dist/composables/index.umd.js +1 -1
  86. package/dist/directives/index.es.js +2 -311
  87. package/dist/directives/index.umd.js +1 -1
  88. package/dist/directives/v-contextmenu.es.js +2 -142
  89. package/dist/directives/v-contextmenu.umd.js +1 -1
  90. package/dist/directives/v-tooltip.es.js +1 -172
  91. package/dist/icons.es.js +1 -39
  92. package/dist/icons.umd.js +1 -1
  93. package/dist/index.es.js +1 -219
  94. package/dist/props/index.d.ts +7 -0
  95. package/dist/resolvers/unplugin.es.js +1 -187
  96. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
  97. package/dist/stories/Avatar/Avatar.settings.d.ts +1 -1
  98. package/package.json +47 -40
@@ -1,143 +1 @@
1
- import { inject, computed, defineComponent, mergeDefaults, ref, toRefs, createBlock, createCommentVNode, unref, openBlock, mergeProps } from "vue";
2
- import { iconLoaded, Icon, addIcon } from "@iconify/vue";
3
- const VvIconPropsDefaults = {
4
- prefix: "normal"
5
- /* normal */
6
- };
7
- const INJECTION_KEY_VOLVER = Symbol.for("volver");
8
- function useVolver() {
9
- return inject(INJECTION_KEY_VOLVER, void 0);
10
- }
11
- function useModifiers(prefix, modifiers, others) {
12
- return computed(() => {
13
- const toReturn = {
14
- [prefix]: true
15
- };
16
- const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
17
- if (modifiersArray) {
18
- if (Array.isArray(modifiersArray)) {
19
- modifiersArray.forEach((modifier) => {
20
- if (modifier) {
21
- toReturn[`${prefix}--${modifier}`] = true;
22
- }
23
- });
24
- }
25
- }
26
- return toReturn;
27
- });
28
- }
29
- const __default__ = {
30
- name: "VvIcon"
31
- };
32
- const _sfc_main = /* @__PURE__ */ defineComponent({
33
- ...__default__,
34
- props: /* @__PURE__ */ mergeDefaults({
35
- name: {},
36
- color: {},
37
- width: {},
38
- height: {},
39
- provider: {},
40
- prefix: {},
41
- src: {},
42
- horizontalFlip: { type: Boolean },
43
- verticalFlip: { type: Boolean },
44
- flip: {},
45
- mode: {},
46
- inline: { type: Boolean },
47
- rotate: {},
48
- onLoad: { type: Function },
49
- svg: {},
50
- modifiers: {}
51
- }, VvIconPropsDefaults),
52
- setup(__props) {
53
- const props = __props;
54
- const hasRotate = computed(() => {
55
- if (typeof props.rotate === "string") {
56
- return Number.parseFloat(props.rotate);
57
- }
58
- return props.rotate;
59
- });
60
- const show = ref(true);
61
- const volver = useVolver();
62
- const { modifiers } = toRefs(props);
63
- const bemCssClasses = useModifiers("vv-icon", modifiers);
64
- const provider = computed(() => {
65
- return props.provider || volver?.iconsProvider;
66
- });
67
- const icon = computed(() => {
68
- const name = props.name ?? "";
69
- const iconName = `@${provider.value}:${props.prefix}:${name}`;
70
- if (iconLoaded(iconName)) {
71
- return iconName;
72
- }
73
- const iconsCollection = volver?.iconsCollections.find(
74
- (iconsCollection2) => {
75
- const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
76
- return iconLoaded(icon2);
77
- }
78
- );
79
- if (iconsCollection) {
80
- return `@${provider.value}:${iconsCollection.prefix}:${name}`;
81
- }
82
- return name;
83
- });
84
- function getSvgContent(svg) {
85
- let dom;
86
- if (typeof window === "undefined") {
87
- const { JSDOM } = require("jsdom");
88
- dom = new JSDOM().window;
89
- }
90
- const domParser = dom ? new dom.DOMParser() : new window.DOMParser();
91
- const svgDomString = domParser.parseFromString(svg, "text/html");
92
- const svgEl = svgDomString.querySelector("svg");
93
- return svgEl;
94
- }
95
- function addIconFromSvg(svg) {
96
- const svgContentEl = getSvgContent(svg);
97
- const svgContent = svgContentEl?.innerHTML.trim() || "";
98
- if (svgContentEl && svgContent) {
99
- addIcon(`@${provider.value}:${props.prefix}:${props.name}`, {
100
- body: svgContent,
101
- // Set height and width from svg content
102
- height: svgContentEl.viewBox.baseVal.height,
103
- width: svgContentEl.viewBox.baseVal.width
104
- });
105
- }
106
- }
107
- if (volver) {
108
- if (props.src && !iconLoaded(`@${provider.value}:${props.prefix}:${props.name}`)) {
109
- show.value = false;
110
- volver.fetchIcon(props.src).then((svg) => {
111
- if (svg) {
112
- addIconFromSvg(svg);
113
- show.value = true;
114
- }
115
- }).catch((e) => {
116
- throw new Error(`Error during fetch icon: ${e?.message}`);
117
- });
118
- }
119
- }
120
- if (props.svg) {
121
- addIconFromSvg(props.svg);
122
- }
123
- return (_ctx, _cache) => {
124
- return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
125
- key: 0,
126
- class: unref(bemCssClasses)
127
- }, {
128
- inline: __props.inline,
129
- width: __props.width,
130
- height: __props.height,
131
- horizontalFlip: __props.horizontalFlip,
132
- verticalFlip: __props.verticalFlip,
133
- flip: __props.flip,
134
- rotate: unref(hasRotate),
135
- color: __props.color,
136
- icon: unref(icon)
137
- }, { onLoad: __props.onLoad }), null, 16, ["class", "onLoad"])) : createCommentVNode("v-if", true);
138
- };
139
- }
140
- });
141
- export {
142
- _sfc_main as default
143
- };
1
+ import{inject as e,computed as o,defineComponent as r,mergeDefaults as i,ref as t,toRefs as n,createBlock as a,createCommentVNode as l,unref as s,openBlock as c,mergeProps as p}from"vue";import{iconLoaded as f,Icon as u,addIcon as v}from"@iconify/vue";const d={prefix:"normal"},h=/* @__PURE__ */Symbol.for("volver");const m=/* @__PURE__ */r({name:"VvIcon",props:/* @__PURE__ */i({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},d),setup(r){const i=r,d=o(()=>"string"==typeof i.rotate?Number.parseFloat(i.rotate):i.rotate),m=t(!0),w=e(h,void 0),{modifiers:$}=n(i),g=function(e,r){return o(()=>{const o={[e]:!0},i="string"==typeof r?.value?r.value.split(" "):r?.value;return i&&Array.isArray(i)&&i.forEach(r=>{r&&(o[`${e}--${r}`]=!0)}),o})}("vv-icon",$),y=o(()=>i.provider||w?.iconsProvider),x=o(()=>{const e=i.name??"",o=`@${y.value}:${i.prefix}:${e}`;if(f(o))return o;const r=w?.iconsCollections.find(o=>{const r=`@${y.value}:${o.prefix}:${e}`;return f(r)});return r?`@${y.value}:${r.prefix}:${e}`:e});function F(e){const o=function(e){let o;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=o?.innerHTML.trim()||"";o&&r&&v(`@${y.value}:${i.prefix}:${i.name}`,{body:r,height:o.viewBox.baseVal.height,width:o.viewBox.baseVal.width})}return w&&i.src&&!f(`@${y.value}:${i.prefix}:${i.name}`)&&(m.value=!1,w.fetchIcon(i.src).then(e=>{e&&(F(e),m.value=!0)}).catch(e=>{throw new Error(`Error during fetch icon: ${e?.message}`)})),i.svg&&F(i.svg),(e,o)=>s(m)?(c(),a(s(u),p({key:0,class:s(g)},{inline:r.inline,width:r.width,height:r.height,horizontalFlip:r.horizontalFlip,verticalFlip:r.verticalFlip,flip:r.flip,rotate:s(d),color:r.color,icon:s(x)},{onLoad:r.onLoad}),null,16,["class","onLoad"])):l("v-if",!0)}});export{m as default};
@@ -1,6 +1,6 @@
1
1
  import type { VvIconProps } from '.';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
2
4
  declare const __VLS_export: import("vue").DefineComponent<VvIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VvIconProps> & Readonly<{}>, {
3
5
  prefix: import(".").IconPrefix | string;
4
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
- declare const _default: typeof __VLS_export;
6
- export default _default;