@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.21

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 (258) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +98 -3
  3. package/auto-imports.d.ts +6 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +23 -16
  6. package/dist/Volver.d.ts +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.es.js +70 -14
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
  10. package/dist/components/VvAccordion/index.d.ts +4 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +117 -38
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
  14. package/dist/components/VvAccordionGroup/index.d.ts +4 -1
  15. package/dist/components/VvAction/VvAction.es.js +58 -13
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
  18. package/dist/components/VvAction/index.d.ts +25 -4
  19. package/dist/components/VvAlert/VvAlert.es.js +195 -152
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
  22. package/dist/components/VvAlert/index.d.ts +9 -5
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +240 -174
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
  26. package/dist/components/VvAlertGroup/index.d.ts +6 -2
  27. package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
  28. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  29. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
  30. package/dist/components/VvAvatar/index.d.ts +4 -1
  31. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
  32. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  33. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  34. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  35. package/dist/components/VvBadge/VvBadge.es.js +73 -17
  36. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  37. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
  38. package/dist/components/VvBadge/index.d.ts +4 -1
  39. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +259 -49
  40. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  41. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
  42. package/dist/components/VvBreadcrumb/index.d.ts +6 -10
  43. package/dist/components/VvButton/VvButton.es.js +187 -141
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
  46. package/dist/components/VvButton/index.d.ts +41 -14
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +69 -16
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
  50. package/dist/components/VvButtonGroup/index.d.ts +8 -2
  51. package/dist/components/VvCard/VvCard.es.js +84 -25
  52. package/dist/components/VvCard/VvCard.umd.js +1 -1
  53. package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
  54. package/dist/components/VvCard/index.d.ts +4 -1
  55. package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -22
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
  58. package/dist/components/VvCheckbox/index.d.ts +45 -12
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +180 -67
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +758 -531
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
  66. package/dist/components/VvCombobox/index.d.ts +53 -22
  67. package/dist/components/VvDialog/VvDialog.es.js +136 -141
  68. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  69. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  70. package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
  71. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  72. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
  73. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
  74. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
  75. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  76. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
  77. package/dist/components/VvDropdown/index.d.ts +16 -11
  78. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +82 -22
  79. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  80. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  81. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
  82. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  83. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
  84. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  85. package/dist/components/VvIcon/VvIcon.es.js +23 -96
  86. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  87. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  88. package/dist/components/VvIcon/index.d.ts +33 -48
  89. package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
  90. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  91. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
  92. package/dist/components/VvInputFile/index.d.ts +179 -0
  93. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  94. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  95. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  96. package/dist/components/VvInputText/VvInputText.es.js +331 -293
  97. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  98. package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
  99. package/dist/components/VvInputText/index.d.ts +71 -29
  100. package/dist/components/VvNav/VvNav.es.js +151 -73
  101. package/dist/components/VvNav/VvNav.umd.js +1 -1
  102. package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
  103. package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
  104. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +2 -0
  105. package/dist/components/VvNav/index.d.ts +5 -13
  106. package/dist/components/VvNavItem/VvNavItem.es.js +436 -0
  107. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
  108. package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
  109. package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
  110. package/dist/components/VvProgress/VvProgress.es.js +65 -14
  111. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  112. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  113. package/dist/components/VvProgress/index.d.ts +4 -1
  114. package/dist/components/VvRadio/VvRadio.es.js +89 -21
  115. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  116. package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
  117. package/dist/components/VvRadio/index.d.ts +44 -11
  118. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +180 -66
  119. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  120. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
  121. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  122. package/dist/components/VvSelect/VvSelect.es.js +248 -226
  123. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  124. package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
  125. package/dist/components/VvSelect/index.d.ts +48 -14
  126. package/dist/components/VvTab/VvTab.es.js +256 -110
  127. package/dist/components/VvTab/VvTab.umd.js +1 -1
  128. package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
  129. package/dist/components/VvTab/index.d.ts +13 -4
  130. package/dist/components/VvTextarea/VvTextarea.es.js +229 -212
  131. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  132. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
  133. package/dist/components/VvTextarea/index.d.ts +68 -19
  134. package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
  135. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  136. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
  137. package/dist/components/VvTooltip/index.d.ts +4 -1
  138. package/dist/components/common/HintSlot.d.ts +1 -1
  139. package/dist/components/index.d.ts +10 -0
  140. package/dist/components/index.es.js +2902 -1329
  141. package/dist/components/index.umd.js +1 -1
  142. package/dist/composables/alert/useAlert.d.ts +37 -4
  143. package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
  144. package/dist/composables/index.d.ts +1 -0
  145. package/dist/composables/index.es.js +88 -1
  146. package/dist/composables/index.umd.js +1 -1
  147. package/dist/composables/useBlurhash.d.ts +7 -0
  148. package/dist/composables/useComponentIcon.d.ts +9 -8
  149. package/dist/composables/useVolver.d.ts +1 -1
  150. package/dist/directives/index.d.ts +3 -5
  151. package/dist/directives/index.es.js +92 -31
  152. package/dist/directives/index.umd.js +1 -1
  153. package/dist/directives/v-tooltip.es.js +90 -26
  154. package/dist/directives/v-tooltip.umd.js +1 -1
  155. package/dist/icons.es.js +210 -210
  156. package/dist/icons.umd.js +1 -1
  157. package/dist/index.d.ts +3 -1
  158. package/dist/index.es.js +81 -16
  159. package/dist/index.umd.js +1 -1
  160. package/dist/props/index.d.ts +287 -73
  161. package/dist/resolvers/unplugin.d.ts +6 -1
  162. package/dist/resolvers/unplugin.es.js +78 -10
  163. package/dist/resolvers/unplugin.umd.js +1 -1
  164. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
  165. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
  166. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  167. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  168. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  169. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  170. package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
  171. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  172. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  173. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  174. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  175. package/dist/stories/Tab/Tab.settings.d.ts +4 -37
  176. package/dist/types/alert.d.ts +13 -0
  177. package/dist/types/blurhash.d.ts +12 -0
  178. package/dist/types/floating-ui.d.ts +6 -0
  179. package/dist/types/generic.d.ts +4 -0
  180. package/dist/types/group.d.ts +37 -0
  181. package/dist/types/index.d.ts +7 -0
  182. package/dist/types/input-file.d.ts +16 -0
  183. package/dist/types/nav.d.ts +18 -0
  184. package/dist/utils/ObjectUtilities.d.ts +0 -1
  185. package/dist/workers/blurhash.d.ts +1 -0
  186. package/package.json +97 -80
  187. package/src/Volver.ts +31 -20
  188. package/src/assets/icons/detailed.json +1 -1
  189. package/src/assets/icons/normal.json +1 -1
  190. package/src/assets/icons/simple.json +1 -1
  191. package/src/components/VvAccordion/VvAccordion.vue +2 -2
  192. package/src/components/VvAction/VvAction.vue +5 -2
  193. package/src/components/VvAlert/index.ts +1 -3
  194. package/src/components/VvAlertGroup/index.ts +2 -1
  195. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  196. package/src/components/VvBreadcrumb/index.ts +2 -8
  197. package/src/components/VvButton/VvButton.vue +6 -6
  198. package/src/components/VvButton/index.ts +2 -4
  199. package/src/components/VvCombobox/VvCombobox.vue +24 -16
  200. package/src/components/VvCombobox/index.ts +4 -0
  201. package/src/components/VvIcon/VvIcon.vue +2 -2
  202. package/src/components/VvIcon/index.ts +35 -48
  203. package/src/components/VvInputFile/VvInputFile.vue +365 -0
  204. package/src/components/VvInputFile/index.ts +116 -0
  205. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  206. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  207. package/src/components/VvInputText/VvInputText.vue +17 -18
  208. package/src/components/VvInputText/index.ts +7 -15
  209. package/src/components/VvNav/VvNav.vue +30 -50
  210. package/src/components/VvNav/VvNavItem.vue +18 -0
  211. package/src/components/VvNav/VvNavSeparator.vue +11 -0
  212. package/src/components/VvNav/index.ts +2 -15
  213. package/src/components/VvSelect/VvSelect.vue +5 -8
  214. package/src/components/VvTab/VvTab.vue +63 -35
  215. package/src/components/VvTab/index.ts +10 -4
  216. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  217. package/src/components/index.ts +10 -0
  218. package/src/composables/index.ts +1 -0
  219. package/src/composables/useBlurhash.ts +76 -0
  220. package/src/composables/useComponentIcon.ts +15 -14
  221. package/src/composables/useUniqueId.ts +2 -2
  222. package/src/directives/index.ts +3 -6
  223. package/src/directives/v-tooltip.ts +19 -10
  224. package/src/index.ts +3 -1
  225. package/src/props/index.ts +115 -27
  226. package/src/resolvers/unplugin.ts +24 -14
  227. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  228. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  229. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  230. package/src/stories/Icon/Icon.settings.ts +3 -3
  231. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  232. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  233. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  234. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  235. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  236. package/src/stories/Nav/Nav.settings.ts +3 -4
  237. package/src/stories/Nav/Nav.test.ts +4 -15
  238. package/src/stories/Tab/Tab.settings.ts +9 -9
  239. package/src/stories/Tab/Tab.stories.ts +2 -2
  240. package/src/stories/Tab/Tab.test.ts +6 -14
  241. package/src/stories/argTypes.ts +1 -1
  242. package/src/types/blurhash.ts +21 -0
  243. package/src/types/generic.ts +6 -0
  244. package/src/types/index.ts +7 -0
  245. package/src/types/input-file.ts +18 -0
  246. package/src/types/nav.ts +20 -0
  247. package/src/utils/ObjectUtilities.ts +0 -11
  248. package/src/workers/blurhash.ts +9 -0
  249. package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
  250. package/dist/components/VvNav/VvNavSeparator.d.ts +0 -2
  251. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
  252. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
  253. package/src/components/VvNav/VvNavItemTitle.vue +0 -11
  254. package/src/components/VvNav/VvNavSeparator.ts +0 -8
  255. package/src/types/generic.d.ts +0 -6
  256. /package/src/types/{alert.d.ts → alert.ts} +0 -0
  257. /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
  258. /package/src/types/{group.d.ts → group.ts} +0 -0
@@ -28,18 +28,24 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
28
28
  default: string;
29
29
  };
30
30
  icon: {
31
- type: (ObjectConstructor | StringConstructor)[];
31
+ type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
32
+ default: undefined;
32
33
  };
33
34
  iconPosition: {
34
35
  type: globalThis.PropType<"before" | "after">;
35
36
  default: import("../../constants").Position;
36
37
  validation: (value: import("../../constants").Position) => boolean;
37
38
  };
38
- modifiers: globalThis.PropType<string | string[]>;
39
+ modifiers: {
40
+ type: globalThis.PropType<string | string[]>;
41
+ default: undefined;
42
+ };
39
43
  id: (StringConstructor | NumberConstructor)[];
40
44
  }, {
41
45
  close: () => void;
42
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
46
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
+ [x: string]: (...args: any[]) => void;
48
+ }, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
43
49
  dismissable: {
44
50
  type: BooleanConstructor;
45
51
  default: boolean;
@@ -69,22 +75,26 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
69
75
  default: string;
70
76
  };
71
77
  icon: {
72
- type: (ObjectConstructor | StringConstructor)[];
78
+ type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
79
+ default: undefined;
73
80
  };
74
81
  iconPosition: {
75
82
  type: globalThis.PropType<"before" | "after">;
76
83
  default: import("../../constants").Position;
77
84
  validation: (value: import("../../constants").Position) => boolean;
78
85
  };
79
- modifiers: globalThis.PropType<string | string[]>;
86
+ modifiers: {
87
+ type: globalThis.PropType<string | string[]>;
88
+ default: undefined;
89
+ };
80
90
  id: (StringConstructor | NumberConstructor)[];
81
- }>> & {
82
- [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
83
- }, {
91
+ }>>, {
92
+ modifiers: string | string[];
84
93
  title: string;
85
94
  content: string;
86
95
  footer: string;
87
96
  role: "alert" | "alertdialog";
97
+ icon: string | import("../VvIcon").VvIconProps;
88
98
  dismissable: boolean;
89
99
  autoClose: number;
90
100
  closeLabel: string;
@@ -67,24 +67,28 @@ export declare const VvAlertProps: {
67
67
  default: string;
68
68
  };
69
69
  icon: {
70
- type: (ObjectConstructor | StringConstructor)[];
70
+ type: PropType<string | import("../VvIcon").VvIconProps>;
71
+ default: undefined;
71
72
  };
72
73
  iconPosition: {
73
74
  type: PropType<"before" | "after">;
74
75
  default: import("../../constants").Position;
75
76
  validation: (value: import("../../constants").Position) => boolean;
76
77
  };
77
- modifiers: PropType<string | string[]>;
78
+ modifiers: {
79
+ type: PropType<string | string[]>;
80
+ default: undefined;
81
+ };
78
82
  id: (StringConstructor | NumberConstructor)[];
79
83
  };
80
84
  export declare const VvAlertEvents: string[];
81
85
  export declare const useVvAlert: (props: Readonly<ExtractPropTypes<typeof VvAlertProps>>, emit: (event: string, ...args: unknown[]) => void) => {
82
86
  close: () => void;
83
- hasIcon: globalThis.ComputedRef<Record<string, any> | undefined>;
87
+ hasIcon: globalThis.ComputedRef<import("../VvIcon").VvIconProps | undefined>;
84
88
  hasTitleId: globalThis.ComputedRef<string>;
85
89
  hasProps: globalThis.ComputedRef<{
86
- onMouseover: (event: Event, ...args: unknown[]) => any;
87
- onMouseleave: (event: Event, ...args: unknown[]) => any;
90
+ onMouseover: () => void;
91
+ onMouseleave: () => void;
88
92
  class: Record<string, boolean>;
89
93
  style: {
90
94
  '--alert-duration': string;
@@ -1,7 +1,7 @@
1
- import { provide, computed, unref, inject, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
1
+ import { provide, computed, unref, inject, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
2
2
  import mitt from "mitt";
3
3
  import { iconExists, Icon, addIcon } from "@iconify/vue";
4
- import { nanoid } from "nanoid";
4
+ import { uid } from "uid";
5
5
  var Strategy = /* @__PURE__ */ ((Strategy2) => {
6
6
  Strategy2["absolute"] = "absolute";
7
7
  Strategy2["fixed"] = "fixed";
@@ -36,6 +36,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
36
36
  ButtonType2["reset"] = "reset";
37
37
  return ButtonType2;
38
38
  })(ButtonType || {});
39
+ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
40
+ ActionTag2["nuxtLink"] = "nuxt-link";
41
+ ActionTag2["routerLink"] = "router-link";
42
+ ActionTag2["a"] = "a";
43
+ ActionTag2["button"] = "button";
44
+ return ActionTag2;
45
+ })(ActionTag || {});
39
46
  var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
40
47
  AnchorTarget2["_blank"] = "_blank";
41
48
  AnchorTarget2["_self"] = "_self";
@@ -64,6 +71,7 @@ const LinkProps = {
64
71
  */
65
72
  target: {
66
73
  type: String,
74
+ default: void 0,
67
75
  validator: (value) => Object.values(AnchorTarget).includes(value)
68
76
  },
69
77
  /**
@@ -78,38 +86,65 @@ const DisabledProps = {
78
86
  /**
79
87
  * Whether the form control is disabled
80
88
  */
81
- disabled: Boolean
89
+ disabled: {
90
+ type: Boolean,
91
+ default: false
92
+ }
82
93
  };
83
94
  const ActiveProps = {
84
95
  /**
85
96
  * Whether the item is active
86
97
  */
87
- active: Boolean
98
+ active: {
99
+ type: Boolean,
100
+ default: false
101
+ }
102
+ };
103
+ const CurrentProps = {
104
+ /**
105
+ * Whether the item is current
106
+ */
107
+ current: {
108
+ type: Boolean,
109
+ default: false
110
+ }
88
111
  };
89
112
  const PressedProps = {
90
113
  /**
91
114
  * Whether the item is pressed
92
115
  */
93
- pressed: Boolean
116
+ pressed: {
117
+ type: Boolean,
118
+ default: false
119
+ }
94
120
  };
95
121
  const LabelProps = {
96
122
  /**
97
123
  * The item label
98
124
  */
99
- label: [String, Number]
125
+ label: {
126
+ type: [String, Number],
127
+ default: void 0
128
+ }
100
129
  };
101
130
  const ModifiersProps = {
102
131
  /**
103
132
  * Component BEM modifiers
104
133
  */
105
- modifiers: [String, Array]
134
+ modifiers: {
135
+ type: [String, Array],
136
+ default: void 0
137
+ }
106
138
  };
107
139
  const IconProps = {
108
140
  /**
109
141
  * VvIcon name or props
110
142
  * @see VVIcon
111
143
  */
112
- icon: { type: [String, Object] },
144
+ icon: {
145
+ type: [String, Object],
146
+ default: void 0
147
+ },
113
148
  /**
114
149
  * VvIcon position
115
150
  */
@@ -147,7 +182,8 @@ const IdProps = {
147
182
  * Dropdown show / hide transition name
148
183
  */
149
184
  transitionName: {
150
- type: String
185
+ type: String,
186
+ default: void 0
151
187
  },
152
188
  /**
153
189
  * Offset of the dropdown from the trigger
@@ -215,7 +251,8 @@ const IdProps = {
215
251
  * Set dropdown width to the same as the trigger
216
252
  */
217
253
  triggerWidth: {
218
- type: Boolean
254
+ type: Boolean,
255
+ default: false
219
256
  }
220
257
  });
221
258
  ({
@@ -223,6 +260,7 @@ const IdProps = {
223
260
  ...LabelProps,
224
261
  ...PressedProps,
225
262
  ...ActiveProps,
263
+ ...CurrentProps,
226
264
  ...LinkProps,
227
265
  /**
228
266
  * Button type
@@ -238,6 +276,13 @@ const IdProps = {
238
276
  ariaLabel: {
239
277
  type: String,
240
278
  default: void 0
279
+ },
280
+ /**
281
+ * Default tag for the action
282
+ */
283
+ defaultTag: {
284
+ type: String,
285
+ default: ActionTag.button
241
286
  }
242
287
  });
243
288
  function useProvideAlertGroup({
@@ -375,99 +420,9 @@ const useVvAlertGroup = (props, emit) => {
375
420
  }))
376
421
  };
377
422
  };
378
- const VvIconProps = {
379
- /**
380
- * Color
381
- */
382
- color: String,
383
- /**
384
- * Width
385
- */
386
- width: {
387
- type: [String, Number]
388
- },
389
- /**
390
- * Height
391
- */
392
- height: {
393
- type: [String, Number]
394
- },
395
- /**
396
- * Icon name
397
- * Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
398
- * https://docs.iconify.design/api/providers.html#provider-in-icon-name
399
- */
400
- name: {
401
- type: String,
402
- required: true
403
- },
404
- /**
405
- * By default 'vv'
406
- * If custom collection is not added with "addCollection" DS class method, this prop could not be used
407
- * Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
408
- */
409
- provider: {
410
- type: String
411
- },
412
- /**
413
- * The name of icon set.
414
- * Icon default options prefix: simple | normal | detailed
415
- */
416
- prefix: {
417
- type: String,
418
- default: "normal"
419
- },
420
- /**
421
- * Url remote SVG icon
422
- */
423
- src: String,
424
- /**
425
- * Horizontal flip
426
- */
427
- horizontalFlip: Boolean,
428
- /**
429
- * Vertical flip
430
- */
431
- verticalFlip: Boolean,
432
- /**
433
- * String alternative to "horizontalFlip" and "verticalFlip".
434
- * Example: https://docs.iconify.design/icon-components/vue/transform.html
435
- */
436
- flip: String,
437
- /**
438
- * Icon render mode
439
- * 'style' = 'bg' or 'mask', depending on icon content
440
- * 'bg' = span with style using `background`
441
- * 'mask' = span with style using `mask`
442
- * 'svg' = svg
443
- * Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
444
- */
445
- mode: String,
446
- /**
447
- * Toggles inline or block mode
448
- * Example https://docs.iconify.design/icon-components/vue/inline.html
449
- */
450
- inline: Boolean,
451
- /**
452
- * rotates icon
453
- * Example https://docs.iconify.design/icon-components/vue/transform.html
454
- */
455
- rotate: [Number, String],
456
- /**
457
- * A callback that is called when icon data has been loaded
458
- */
459
- onLoad: Function,
460
- /**
461
- * SVG icon string
462
- */
463
- svg: String,
464
- /**
465
- * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
466
- * @values string | string[]
467
- */
468
- modifiers: {
469
- type: [String, Array]
470
- }
423
+ const VvIconPropsDefaults = {
424
+ prefix: "normal"
425
+ /* normal */
471
426
  };
472
427
  function useVolver() {
473
428
  return inject(INJECTION_KEY_VOLVER);
@@ -477,7 +432,24 @@ const __default__$2 = {
477
432
  };
478
433
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
479
434
  ...__default__$2,
480
- props: VvIconProps,
435
+ props: /* @__PURE__ */ mergeDefaults({
436
+ name: {},
437
+ color: {},
438
+ width: {},
439
+ height: {},
440
+ provider: {},
441
+ prefix: {},
442
+ src: {},
443
+ horizontalFlip: { type: Boolean },
444
+ verticalFlip: { type: Boolean },
445
+ flip: {},
446
+ mode: {},
447
+ inline: { type: Boolean },
448
+ rotate: {},
449
+ onLoad: { type: Function },
450
+ svg: {},
451
+ modifiers: {}
452
+ }, VvIconPropsDefaults),
481
453
  setup(__props) {
482
454
  const props = __props;
483
455
  const hasRotate = computed(() => {
@@ -564,14 +536,49 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
564
536
  color: _ctx.color,
565
537
  onLoad: _ctx.onLoad,
566
538
  icon: unref(icon)
567
- }), null, 16, ["class"])) : createCommentVNode("", true);
539
+ }), null, 16, ["class"])) : createCommentVNode("v-if", true);
568
540
  };
569
541
  }
570
542
  });
571
543
  function useInjectedAlertGroup() {
572
544
  return inject(INJECTION_KEY_ALERT_GROUP, {});
573
545
  }
574
- const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || nanoid()));
546
+ const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
547
+ function useComponentIcon(icon, iconPosition) {
548
+ const hasIcon = computed(() => {
549
+ if (typeof (icon == null ? void 0 : icon.value) === "string") {
550
+ return { name: icon == null ? void 0 : icon.value };
551
+ }
552
+ return icon == null ? void 0 : icon.value;
553
+ });
554
+ const hasIconBefore = computed(
555
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
556
+ );
557
+ const hasIconAfter = computed(
558
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
559
+ );
560
+ const hasIconLeft = computed(
561
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
562
+ );
563
+ const hasIconRight = computed(
564
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
565
+ );
566
+ const hasIconTop = computed(
567
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
568
+ );
569
+ const hasIconBottom = computed(
570
+ () => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
571
+ );
572
+ return {
573
+ hasIcon,
574
+ hasIconLeft,
575
+ hasIconRight,
576
+ hasIconTop,
577
+ hasIconBottom,
578
+ hasIconBefore,
579
+ hasIconAfter
580
+ };
581
+ }
575
582
  const VvAlertProps = {
576
583
  ...IdProps,
577
584
  ...ModifiersProps,
@@ -648,9 +655,7 @@ const useVvAlert = (props, emit) => {
648
655
  const { bus } = useInjectedAlertGroup();
649
656
  const hasId = useUniqueId(computed(() => props.id));
650
657
  const hasTitleId = computed(() => `${hasId.value}-title`);
651
- const hasIcon = computed(
652
- () => typeof props.icon === "string" ? { name: props.icon } : props.icon
653
- );
658
+ const { hasIcon } = useComponentIcon(computed(() => props.icon));
654
659
  const hasClass = useModifiers(
655
660
  "vv-alert",
656
661
  computed(() => props.modifiers),
@@ -719,7 +724,13 @@ const _hoisted_1 = {
719
724
  };
720
725
  const _hoisted_2 = ["id"];
721
726
  const _hoisted_3 = ["aria-label"];
722
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "vv-alert__close-mask" }, null, -1);
727
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode(
728
+ "div",
729
+ { class: "vv-alert__close-mask" },
730
+ null,
731
+ -1
732
+ /* HOISTED */
733
+ );
723
734
  const _hoisted_5 = [
724
735
  _hoisted_4
725
736
  ];
@@ -738,52 +749,84 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
738
749
  ...__default__$1,
739
750
  props: VvAlertProps,
740
751
  emits: VvAlertEvents,
741
- setup(__props, { expose: __expose, emit }) {
752
+ setup(__props, { expose: __expose, emit: __emit }) {
742
753
  const props = __props;
754
+ const emit = __emit;
743
755
  const { hasProps, hasTitleId, hasIcon, close } = useVvAlert(props, emit);
744
756
  __expose({ close });
745
757
  return (_ctx, _cache) => {
746
- return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
747
- _ctx.$slots.header || _ctx.$slots.title || _ctx.$slots.close || _ctx.$slots["title::before"] || _ctx.$slots["title::after"] || _ctx.title || _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("div", _hoisted_1, [
748
- unref(hasIcon) ? (openBlock(), createBlock(_sfc_main$2, mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }), null, 16)) : createCommentVNode("", true),
749
- renderSlot(_ctx.$slots, "header", {}, () => [
750
- renderSlot(_ctx.$slots, "title::before"),
751
- _ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("strong", {
752
- key: 0,
753
- id: unref(hasTitleId),
754
- class: "vv-alert__title"
755
- }, [
756
- renderSlot(_ctx.$slots, "title", {}, () => [
757
- createTextVNode(toDisplayString(_ctx.title), 1)
758
- ])
759
- ], 8, _hoisted_2)) : createCommentVNode("", true),
760
- renderSlot(_ctx.$slots, "title::after")
761
- ]),
762
- renderSlot(_ctx.$slots, "close", normalizeProps(guardReactiveProps({ close: unref(close) })), () => [
763
- _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
764
- key: 0,
765
- class: "vv-alert__close",
766
- type: "button",
767
- "aria-label": _ctx.closeLabel,
768
- onClick: _cache[0] || (_cache[0] = withModifiers(
769
- //@ts-ignore
770
- (...args) => unref(close) && unref(close)(...args),
771
- ["stop"]
772
- ))
773
- }, _hoisted_5, 8, _hoisted_3)) : createCommentVNode("", true)
774
- ])
775
- ])) : createCommentVNode("", true),
776
- _ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6, [
777
- renderSlot(_ctx.$slots, "default", {}, () => [
778
- createTextVNode(toDisplayString(_ctx.content), 1)
779
- ])
780
- ])) : createCommentVNode("", true),
781
- _ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [
782
- renderSlot(_ctx.$slots, "footer", {}, () => [
783
- createTextVNode(toDisplayString(_ctx.footer), 1)
784
- ])
785
- ])) : createCommentVNode("", true)
786
- ], 16);
758
+ return openBlock(), createElementBlock(
759
+ "div",
760
+ normalizeProps(guardReactiveProps(unref(hasProps))),
761
+ [
762
+ _ctx.$slots.header || _ctx.$slots.title || _ctx.$slots.close || _ctx.$slots["title::before"] || _ctx.$slots["title::after"] || _ctx.title || _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("div", _hoisted_1, [
763
+ unref(hasIcon) ? (openBlock(), createBlock(
764
+ _sfc_main$2,
765
+ mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }),
766
+ null,
767
+ 16
768
+ /* FULL_PROPS */
769
+ )) : createCommentVNode("v-if", true),
770
+ createCommentVNode(" @slot Header slot "),
771
+ renderSlot(_ctx.$slots, "header", {}, () => [
772
+ createCommentVNode(" @slot Before title slot "),
773
+ renderSlot(_ctx.$slots, "title::before"),
774
+ _ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("strong", {
775
+ key: 0,
776
+ id: unref(hasTitleId),
777
+ class: "vv-alert__title"
778
+ }, [
779
+ createCommentVNode(" @slot Title slot "),
780
+ renderSlot(_ctx.$slots, "title", {}, () => [
781
+ createTextVNode(
782
+ toDisplayString(_ctx.title),
783
+ 1
784
+ /* TEXT */
785
+ )
786
+ ])
787
+ ], 8, _hoisted_2)) : createCommentVNode("v-if", true),
788
+ createCommentVNode(" @slot After title slot "),
789
+ renderSlot(_ctx.$slots, "title::after")
790
+ ]),
791
+ createCommentVNode(" @slot Close button slot "),
792
+ renderSlot(_ctx.$slots, "close", normalizeProps(guardReactiveProps({ close: unref(close) })), () => [
793
+ _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
794
+ key: 0,
795
+ class: "vv-alert__close",
796
+ type: "button",
797
+ "aria-label": _ctx.closeLabel,
798
+ onClick: _cache[0] || (_cache[0] = withModifiers(
799
+ //@ts-ignore
800
+ (...args) => unref(close) && unref(close)(...args),
801
+ ["stop"]
802
+ ))
803
+ }, _hoisted_5, 8, _hoisted_3)) : createCommentVNode("v-if", true)
804
+ ])
805
+ ])) : createCommentVNode("v-if", true),
806
+ _ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6, [
807
+ createCommentVNode(" @slot Content slot "),
808
+ renderSlot(_ctx.$slots, "default", {}, () => [
809
+ createTextVNode(
810
+ toDisplayString(_ctx.content),
811
+ 1
812
+ /* TEXT */
813
+ )
814
+ ])
815
+ ])) : createCommentVNode("v-if", true),
816
+ _ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [
817
+ createCommentVNode(" @slot Footer slot "),
818
+ renderSlot(_ctx.$slots, "footer", {}, () => [
819
+ createTextVNode(
820
+ toDisplayString(_ctx.footer),
821
+ 1
822
+ /* TEXT */
823
+ )
824
+ ])
825
+ ])) : createCommentVNode("v-if", true)
826
+ ],
827
+ 16
828
+ /* FULL_PROPS */
829
+ );
787
830
  };
788
831
  }
789
832
  });
@@ -794,8 +837,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
794
837
  ...__default__,
795
838
  props: VvAlertGroupProps,
796
839
  emits: VvAlertGroupEvents,
797
- setup(__props, { emit }) {
840
+ setup(__props, { emit: __emit }) {
798
841
  const props = __props;
842
+ const emit = __emit;
799
843
  const { hasProps, hasTransition } = useVvAlertGroup(props, emit);
800
844
  const alertGroupTransitionHandlers = {
801
845
  "before-enter": () => {
@@ -824,27 +868,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
824
868
  }
825
869
  };
826
870
  return (_ctx, _cache) => {
827
- return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(hasProps))), [
828
- renderSlot(_ctx.$slots, "before"),
829
- createVNode(TransitionGroup, mergeProps({
830
- tag: "div",
831
- role: "group",
832
- name: unref(hasTransition),
833
- class: "vv-alert-group__list"
834
- }, toHandlers(alertGroupTransitionHandlers)), {
835
- default: withCtx(() => [
836
- renderSlot(_ctx.$slots, "default", {}, () => [
837
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item) => {
838
- return openBlock(), createBlock(_sfc_main$1, mergeProps(item, {
839
- key: item.id
840
- }), null, 16);
841
- }), 128))
842
- ])
843
- ]),
844
- _: 3
845
- }, 16, ["name"]),
846
- renderSlot(_ctx.$slots, "after")
847
- ], 16);
871
+ return openBlock(), createElementBlock(
872
+ "div",
873
+ normalizeProps(guardReactiveProps(unref(hasProps))),
874
+ [
875
+ createCommentVNode(" @slot The slot before alert list "),
876
+ renderSlot(_ctx.$slots, "before"),
877
+ createVNode(TransitionGroup, mergeProps({
878
+ tag: "div",
879
+ role: "group",
880
+ name: unref(hasTransition),
881
+ class: "vv-alert-group__list"
882
+ }, toHandlers(alertGroupTransitionHandlers)), {
883
+ default: withCtx(() => [
884
+ createCommentVNode(" @slot The slot for alert list "),
885
+ renderSlot(_ctx.$slots, "default", {}, () => [
886
+ (openBlock(true), createElementBlock(
887
+ Fragment,
888
+ null,
889
+ renderList(_ctx.items, (item) => {
890
+ return openBlock(), createBlock(
891
+ _sfc_main$1,
892
+ mergeProps(item, {
893
+ key: item.id
894
+ }),
895
+ null,
896
+ 16
897
+ /* FULL_PROPS */
898
+ );
899
+ }),
900
+ 128
901
+ /* KEYED_FRAGMENT */
902
+ ))
903
+ ])
904
+ ]),
905
+ _: 3
906
+ /* FORWARDED */
907
+ }, 16, ["name"]),
908
+ createCommentVNode(" @slot The slot after alert list "),
909
+ renderSlot(_ctx.$slots, "after")
910
+ ],
911
+ 16
912
+ /* FULL_PROPS */
913
+ );
848
914
  };
849
915
  }
850
916
  });