@volverjs/ui-vue 0.0.10-beta.34 → 0.0.10-beta.36

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 (348) hide show
  1. package/README.md +78 -77
  2. package/bin/icons.cjs +1 -1
  3. package/bin/icons.js +5 -5
  4. package/dist/Volver.d.ts +10 -10
  5. package/dist/components/VvAccordion/VvAccordion.es.js +11 -11
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +17 -17
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  9. package/dist/components/VvAction/VvAction.es.js +6 -6
  10. package/dist/components/VvAction/VvAction.umd.js +1 -1
  11. package/dist/components/VvAlert/VvAlert.es.js +23 -21
  12. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  13. package/dist/components/VvAlert/index.d.ts +2 -2
  14. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +351 -349
  15. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  16. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
  17. package/dist/components/VvAlertGroup/index.d.ts +1 -1
  18. package/dist/components/VvAvatar/VvAvatar.es.js +4 -1
  19. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  20. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +11 -3
  21. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +10 -10
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  24. package/dist/components/VvButton/VvButton.es.js +31 -25
  25. package/dist/components/VvButton/VvButton.umd.js +1 -1
  26. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -1
  27. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  28. package/dist/components/VvCheckbox/VvCheckbox.es.js +208 -202
  29. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  30. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +3 -3
  31. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +21 -15
  32. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  33. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  34. package/dist/components/VvCombobox/VvCombobox.es.js +454 -446
  35. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  36. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +5 -5
  37. package/dist/components/VvCombobox/index.d.ts +5 -10
  38. package/dist/components/VvDialog/VvDialog.es.js +11 -11
  39. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.es.js +29 -25
  41. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  42. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +12 -8
  43. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +11 -14
  44. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  45. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  46. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  47. package/dist/components/VvInputFile/VvInputFile.es.js +61 -55
  48. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  49. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +2 -2
  50. package/dist/components/VvInputFile/index.d.ts +6 -6
  51. package/dist/components/VvInputText/VvInputText.es.js +287 -286
  52. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  53. package/dist/components/VvInputText/VvInputText.vue.d.ts +2 -2
  54. package/dist/components/VvInputText/index.d.ts +7 -2
  55. package/dist/components/VvNav/VvNav.es.js +23 -20
  56. package/dist/components/VvNav/VvNav.umd.js +1 -1
  57. package/dist/components/VvNavItem/VvNavItem.es.js +6 -6
  58. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  59. package/dist/components/VvRadio/VvRadio.es.js +208 -202
  60. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  61. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +21 -15
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvSelect/VvSelect.es.js +22 -20
  66. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  67. package/dist/components/VvSelect/VvSelect.vue.d.ts +2 -2
  68. package/dist/components/VvTab/VvTab.es.js +29 -23
  69. package/dist/components/VvTab/VvTab.umd.js +1 -1
  70. package/dist/components/VvTextarea/VvTextarea.es.js +29 -27
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -2
  73. package/dist/components/VvTooltip/VvTooltip.es.js +4 -1
  74. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  75. package/dist/components/common/HintSlot.d.ts +3 -4
  76. package/dist/components/index.es.js +893 -876
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/alert/useAlert.d.ts +2 -2
  79. package/dist/composables/index.es.js +10 -10
  80. package/dist/composables/index.umd.js +1 -1
  81. package/dist/composables/useBlurhash.d.ts +1 -1
  82. package/dist/composables/usePersistence.d.ts +2 -1
  83. package/dist/composables/useUniqueId.d.ts +1 -1
  84. package/dist/directives/index.es.js +5 -2
  85. package/dist/directives/index.umd.js +1 -1
  86. package/dist/directives/v-contextmenu.es.js +1 -1
  87. package/dist/directives/v-contextmenu.umd.js +1 -1
  88. package/dist/directives/v-tooltip.es.js +4 -1
  89. package/dist/directives/v-tooltip.umd.js +1 -1
  90. package/dist/icons.es.js +3 -3
  91. package/dist/icons.umd.js +1 -1
  92. package/dist/index.es.js +2 -2
  93. package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
  94. package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
  95. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
  96. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
  97. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  98. package/dist/stories/Badge/Badge.test.d.ts +1 -1
  99. package/dist/stories/Combobox/Combobox.settings.d.ts +1 -1
  100. package/dist/test/options.d.ts +1 -1
  101. package/dist/test/sleep.d.ts +1 -1
  102. package/dist/types/alert.d.ts +1 -1
  103. package/dist/utils/ObjectUtilities.d.ts +7 -7
  104. package/package.json +232 -239
  105. package/src/Volver.ts +243 -243
  106. package/src/assets/icons/detailed.json +1 -1
  107. package/src/assets/icons/normal.json +1 -1
  108. package/src/assets/icons/simple.json +1 -1
  109. package/src/components/VvAccordion/VvAccordion.vue +155 -155
  110. package/src/components/VvAccordion/index.ts +62 -62
  111. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +220 -219
  112. package/src/components/VvAccordionGroup/index.ts +41 -41
  113. package/src/components/VvAction/VvAction.vue +144 -142
  114. package/src/components/VvAlert/VvAlert.vue +72 -70
  115. package/src/components/VvAlert/index.ts +147 -150
  116. package/src/components/VvAlertGroup/VvAlertGroup.vue +56 -55
  117. package/src/components/VvAlertGroup/index.ts +99 -103
  118. package/src/components/VvAvatar/VvAvatar.vue +20 -14
  119. package/src/components/VvAvatar/index.ts +5 -5
  120. package/src/components/VvAvatarGroup/VvAvatarGroup.vue +58 -53
  121. package/src/components/VvAvatarGroup/index.ts +21 -21
  122. package/src/components/VvBadge/VvBadge.vue +15 -14
  123. package/src/components/VvBadge/index.ts +2 -2
  124. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +49 -48
  125. package/src/components/VvBreadcrumb/index.ts +2 -2
  126. package/src/components/VvButton/VvButton.vue +163 -162
  127. package/src/components/VvButton/index.ts +102 -102
  128. package/src/components/VvButtonGroup/VvButtonGroup.vue +72 -72
  129. package/src/components/VvButtonGroup/index.ts +22 -22
  130. package/src/components/VvCard/VvCard.vue +30 -30
  131. package/src/components/VvCard/index.ts +2 -2
  132. package/src/components/VvCheckbox/VvCheckbox.vue +185 -180
  133. package/src/components/VvCheckbox/index.ts +44 -44
  134. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +88 -86
  135. package/src/components/VvCombobox/VvCombobox.vue +633 -623
  136. package/src/components/VvCombobox/index.ts +166 -166
  137. package/src/components/VvDialog/VvDialog.vue +131 -129
  138. package/src/components/VvDialog/index.ts +35 -35
  139. package/src/components/VvDropdown/VvDropdown.vue +464 -452
  140. package/src/components/VvDropdown/VvDropdownAction.vue +37 -39
  141. package/src/components/VvDropdown/VvDropdownItem.vue +29 -28
  142. package/src/components/VvDropdown/VvDropdownOptgroup.vue +13 -12
  143. package/src/components/VvDropdown/VvDropdownOption.vue +47 -47
  144. package/src/components/VvDropdown/index.ts +53 -53
  145. package/src/components/VvIcon/README.md +1 -1
  146. package/src/components/VvIcon/VvIcon.vue +133 -133
  147. package/src/components/VvIcon/index.ts +77 -77
  148. package/src/components/VvInputFile/VvInputFile.vue +367 -363
  149. package/src/components/VvInputFile/index.ts +125 -125
  150. package/src/components/VvInputText/VvInputClearAction.ts +50 -50
  151. package/src/components/VvInputText/VvInputPasswordAction.ts +65 -65
  152. package/src/components/VvInputText/VvInputStepAction.ts +43 -43
  153. package/src/components/VvInputText/VvInputText.vue +636 -637
  154. package/src/components/VvInputText/VvInputTextActions.ts +86 -86
  155. package/src/components/VvInputText/index.ts +198 -198
  156. package/src/components/VvNav/VvNav.vue +40 -33
  157. package/src/components/VvNav/VvNavItem.vue +12 -12
  158. package/src/components/VvNav/VvNavSeparator.vue +6 -6
  159. package/src/components/VvNav/index.ts +2 -2
  160. package/src/components/VvProgress/VvProgress.vue +27 -26
  161. package/src/components/VvProgress/index.ts +28 -28
  162. package/src/components/VvRadio/VvRadio.vue +115 -112
  163. package/src/components/VvRadio/index.ts +27 -27
  164. package/src/components/VvRadioGroup/VvRadioGroup.vue +91 -89
  165. package/src/components/VvSelect/VvSelect.vue +241 -238
  166. package/src/components/VvSelect/index.ts +62 -62
  167. package/src/components/VvTab/VvTab.vue +79 -73
  168. package/src/components/VvTab/index.ts +12 -12
  169. package/src/components/VvTextarea/VvTextarea.vue +218 -216
  170. package/src/components/VvTextarea/index.ts +35 -35
  171. package/src/components/VvTooltip/VvTooltip.vue +22 -16
  172. package/src/components/VvTooltip/index.ts +12 -12
  173. package/src/components/common/HintSlot.ts +149 -150
  174. package/src/composables/alert/useAlert.ts +74 -74
  175. package/src/composables/alert/useInjectAlert.ts +1 -1
  176. package/src/composables/alert/useProvideAlert.ts +10 -10
  177. package/src/composables/dropdown/useInjectDropdown.ts +6 -6
  178. package/src/composables/dropdown/useProvideDropdown.ts +62 -62
  179. package/src/composables/group/useInjectedGroupState.ts +41 -41
  180. package/src/composables/group/useProvideGroupState.ts +1 -2
  181. package/src/composables/useBlurhash.ts +52 -60
  182. package/src/composables/useComponentFocus.ts +9 -9
  183. package/src/composables/useComponentIcon.ts +35 -35
  184. package/src/composables/useDebouncedInput.ts +25 -25
  185. package/src/composables/useDefaults.ts +77 -76
  186. package/src/composables/useModifiers.ts +29 -29
  187. package/src/composables/useOptions.ts +45 -43
  188. package/src/composables/usePersistence.ts +70 -72
  189. package/src/composables/useTextCount.ts +44 -44
  190. package/src/composables/useUniqueId.ts +3 -2
  191. package/src/composables/useVolver.ts +1 -1
  192. package/src/constants.ts +70 -70
  193. package/src/directives/v-contextmenu.ts +34 -34
  194. package/src/directives/v-tooltip.ts +17 -17
  195. package/src/index.ts +3 -3
  196. package/src/props/index.ts +453 -453
  197. package/src/resolvers/unplugin.ts +138 -138
  198. package/src/shims.d.ts +4 -5
  199. package/src/stories/Accordion/Accordion.settings.ts +49 -49
  200. package/src/stories/Accordion/Accordion.stories.ts +21 -21
  201. package/src/stories/Accordion/Accordion.test.ts +56 -54
  202. package/src/stories/Accordion/AccordionSlots.stories.ts +13 -13
  203. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +69 -67
  204. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +37 -37
  205. package/src/stories/AccordionGroup/AccordionGroup.test.ts +49 -47
  206. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +34 -34
  207. package/src/stories/Alert/Alert.settings.ts +115 -115
  208. package/src/stories/Alert/Alert.stories.ts +30 -30
  209. package/src/stories/Alert/Alert.test.ts +78 -78
  210. package/src/stories/Alert/AlertModifiers.stories.ts +45 -45
  211. package/src/stories/Alert/AlertSlots.stories.ts +35 -35
  212. package/src/stories/AlertGroup/AlertGroup.settings.ts +104 -104
  213. package/src/stories/AlertGroup/AlertGroup.stories.ts +25 -25
  214. package/src/stories/AlertGroup/AlertGroup.test.ts +67 -67
  215. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +68 -68
  216. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +23 -23
  217. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +57 -57
  218. package/src/stories/Avatar/Avatar.settings.ts +29 -29
  219. package/src/stories/Avatar/Avatar.stories.ts +23 -23
  220. package/src/stories/Avatar/Avatar.test.ts +22 -22
  221. package/src/stories/Avatar/AvatarBadge.stories.ts +15 -15
  222. package/src/stories/Avatar/AvatarModifiers.stories.ts +61 -61
  223. package/src/stories/Avatar/AvatarSlots.stories.ts +18 -18
  224. package/src/stories/AvatarGroup/AvatarGroup.settings.ts +53 -53
  225. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +17 -17
  226. package/src/stories/AvatarGroup/AvatarGroup.test.ts +24 -24
  227. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +15 -15
  228. package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +17 -17
  229. package/src/stories/Badge/Badge.settings.ts +20 -20
  230. package/src/stories/Badge/Badge.stories.ts +23 -23
  231. package/src/stories/Badge/Badge.test.ts +8 -8
  232. package/src/stories/Badge/BadgeSlots.stories.ts +10 -10
  233. package/src/stories/Blurhash/BlurhashComposable.stories.ts +77 -76
  234. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +34 -34
  235. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +22 -22
  236. package/src/stories/Breadcrumb/Breadcrumb.test.ts +44 -43
  237. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +17 -17
  238. package/src/stories/Button/Button.settings.ts +144 -144
  239. package/src/stories/Button/Button.stories.ts +18 -18
  240. package/src/stories/Button/Button.test.ts +41 -40
  241. package/src/stories/Button/ButtonIcon.stories.ts +42 -42
  242. package/src/stories/Button/ButtonLink.stories.ts +24 -24
  243. package/src/stories/Button/ButtonLoading.stories.ts +22 -22
  244. package/src/stories/Button/ButtonModifiers.stories.ts +91 -91
  245. package/src/stories/Button/ButtonSlots.stories.ts +47 -47
  246. package/src/stories/Button/ButtonState.stories.ts +23 -23
  247. package/src/stories/Button/ButtonToggle.stories.ts +30 -30
  248. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +32 -32
  249. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +19 -19
  250. package/src/stories/ButtonGroup/ButtonGroup.test.ts +23 -22
  251. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +20 -20
  252. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +18 -18
  253. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +22 -22
  254. package/src/stories/Card/Card.settings.ts +48 -48
  255. package/src/stories/Card/Card.stories.ts +22 -22
  256. package/src/stories/Card/Card.test.ts +14 -14
  257. package/src/stories/Card/CardSlots.stories.ts +42 -42
  258. package/src/stories/Checkbox/Checkbox.settings.ts +35 -35
  259. package/src/stories/Checkbox/Checkbox.stories.ts +57 -57
  260. package/src/stories/Checkbox/Checkbox.test.ts +63 -62
  261. package/src/stories/Checkbox/CheckboxBinary.stories.ts +17 -17
  262. package/src/stories/Checkbox/CheckboxSlots.stories.ts +15 -15
  263. package/src/stories/CheckboxGroup/CheckboxGroup.settings.ts +9 -9
  264. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +50 -50
  265. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +63 -63
  266. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +34 -34
  267. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +23 -23
  268. package/src/stories/Combobox/Combobox.settings.ts +390 -390
  269. package/src/stories/Combobox/Combobox.stories.ts +107 -107
  270. package/src/stories/Combobox/Combobox.test.ts +89 -87
  271. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +24 -24
  272. package/src/stories/Combobox/ComboboxMultiple.stories.ts +22 -22
  273. package/src/stories/Combobox/ComboboxOptions.stories.ts +84 -84
  274. package/src/stories/Combobox/ComboboxSlots.stories.ts +55 -55
  275. package/src/stories/Dialog/Dialog.settings.ts +39 -39
  276. package/src/stories/Dialog/Dialog.stories.ts +28 -28
  277. package/src/stories/Dialog/Dialog.test.ts +49 -49
  278. package/src/stories/Dialog/DialogSlots.stories.ts +20 -20
  279. package/src/stories/Dropdown/Dropdown.settings.ts +62 -62
  280. package/src/stories/Dropdown/Dropdown.stories.ts +59 -59
  281. package/src/stories/Dropdown/Dropdown.test.ts +9 -9
  282. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +16 -16
  283. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +18 -18
  284. package/src/stories/Dropdown/DropdownSlots.stories.ts +49 -49
  285. package/src/stories/Icon/Icon.settings.ts +64 -64
  286. package/src/stories/Icon/Icon.stories.ts +28 -28
  287. package/src/stories/Icon/IconsCollection.stories.ts +22 -22
  288. package/src/stories/InputFile/InputFile.settings.ts +29 -29
  289. package/src/stories/InputFile/InputFile.stories.ts +54 -54
  290. package/src/stories/InputFile/InputFileDropArea.stories.ts +34 -34
  291. package/src/stories/InputFile/InputFileIconPosition.stories.ts +24 -24
  292. package/src/stories/InputFile/InputFileSlots.stories.ts +17 -17
  293. package/src/stories/InputText/InputText.settings.ts +245 -246
  294. package/src/stories/InputText/InputText.stories.ts +67 -67
  295. package/src/stories/InputText/InputText.test.ts +118 -117
  296. package/src/stories/InputText/InputTextIconPosition.stories.ts +24 -24
  297. package/src/stories/InputText/InputTextLength.stories.ts +33 -33
  298. package/src/stories/InputText/InputTextMask.stories.ts +91 -91
  299. package/src/stories/InputText/InputTextMinMax.stories.ts +29 -29
  300. package/src/stories/InputText/InputTextSlots.stories.ts +20 -20
  301. package/src/stories/InputText/InputTextType.stories.ts +70 -70
  302. package/src/stories/Nav/Nav.settings.ts +25 -25
  303. package/src/stories/Nav/Nav.stories.ts +17 -17
  304. package/src/stories/Nav/Nav.test.ts +10 -10
  305. package/src/stories/Nav/NavModifiers.stories.ts +25 -25
  306. package/src/stories/Progress/Progress.settings.ts +23 -23
  307. package/src/stories/Progress/Progress.stories.ts +23 -23
  308. package/src/stories/Progress/Progress.test.ts +4 -4
  309. package/src/stories/Radio/Radio.settings.ts +9 -9
  310. package/src/stories/Radio/Radio.stories.ts +47 -47
  311. package/src/stories/Radio/Radio.test.ts +54 -53
  312. package/src/stories/Radio/RadioSlots.stories.ts +15 -15
  313. package/src/stories/RadioGroup/RadioGroup.settings.ts +9 -9
  314. package/src/stories/RadioGroup/RadioGroup.stories.ts +50 -50
  315. package/src/stories/RadioGroup/RadioGroup.test.ts +63 -63
  316. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +34 -34
  317. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +23 -23
  318. package/src/stories/Select/Select.settings.ts +70 -70
  319. package/src/stories/Select/Select.stories.ts +66 -66
  320. package/src/stories/Select/Select.test.ts +65 -64
  321. package/src/stories/Select/SelectIconPosition.stories.ts +24 -24
  322. package/src/stories/Select/SelectOptions.stories.ts +54 -54
  323. package/src/stories/Select/SelectSlots.stories.ts +20 -20
  324. package/src/stories/Tab/Tab.settings.ts +32 -32
  325. package/src/stories/Tab/Tab.stories.ts +17 -17
  326. package/src/stories/Tab/Tab.test.ts +17 -17
  327. package/src/stories/Textarea/Textarea.settings.ts +78 -79
  328. package/src/stories/Textarea/Textarea.stories.ts +63 -63
  329. package/src/stories/Textarea/Textarea.test.ts +70 -69
  330. package/src/stories/Textarea/TextareaLength.stories.ts +33 -33
  331. package/src/stories/Textarea/TextareaSlots.stories.ts +20 -20
  332. package/src/stories/Textarea/TextareatIconPosition.stories.ts +24 -24
  333. package/src/stories/Tooltip/Tooltip.settings.ts +16 -16
  334. package/src/stories/Tooltip/Tooltip.stories.ts +18 -18
  335. package/src/stories/Tooltip/Tooltip.test.ts +53 -52
  336. package/src/stories/Tooltip/TooltipDirective.stories.ts +37 -37
  337. package/src/stories/argTypes.ts +484 -485
  338. package/src/test/expect.ts +71 -74
  339. package/src/test/options.ts +17 -16
  340. package/src/test/sleep.ts +3 -2
  341. package/src/test/types.d.ts +11 -11
  342. package/src/types/alert.ts +18 -18
  343. package/src/types/blurhash.ts +18 -18
  344. package/src/types/generic.ts +1 -2
  345. package/src/types/group.ts +21 -21
  346. package/src/types/input-file.ts +17 -17
  347. package/src/types/nav.ts +13 -13
  348. package/src/utils/ObjectUtilities.ts +192 -177
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
-
2
+
3
3
  [![volverjs](.storybook/static/volverjs-ui-vue.svg)](https://volverjs.github.io/ui-vue)
4
4
 
5
5
  ## @volverjs/ui-vue
@@ -46,12 +46,12 @@ Install the plugin in your `main.ts` file.
46
46
  ```typescript
47
47
  // main.ts
48
48
  import { createApp } from 'vue'
49
- import App from './App.vue'
50
49
 
51
50
  // import @volverjs/ui-vue plugin
52
51
  import { VolverPlugin } from '@volverjs/ui-vue'
53
52
  // import @volverjs/ui-vue icons collections
54
53
  import iconsCollections from '@volverjs/ui-vue/icons'
54
+ import App from './App.vue'
55
55
  /*
56
56
  * import @volverjs/style base style with reset and props
57
57
  * for scss support you can import the scss file
@@ -63,28 +63,28 @@ const app = createApp(App).mount('#app')
63
63
 
64
64
  // install the plugin
65
65
  app.use(VolverPlugin, {
66
- iconsCollections,
67
- /*
66
+ iconsCollections,
67
+ /*
68
68
  * if you want can import components globally
69
69
  * components: { VvButton, VvInputText }
70
70
  */
71
- components: undefined,
72
- /*
71
+ components: undefined,
72
+ /*
73
73
  * if you want can import directives globally
74
74
  * directives: { toolip: VTooltip }
75
75
  */
76
- directives: undefined,
77
- /*
76
+ directives: undefined,
77
+ /*
78
78
  * if you want can create components aliases
79
79
  * aliases: { Btn: VvButton, BtnDanger: VvButton}
80
80
  */
81
- aliases: undefined,
82
- /*
81
+ aliases: undefined,
82
+ /*
83
83
  * if you want can change default props
84
84
  * for globally imported components and aliases
85
85
  * defaults: { VvButton: { modifiers: 'secondary', BtnDanger: { modifiers: 'danger' } }
86
86
  */
87
- defaults: undefined
87
+ defaults: undefined
88
88
  })
89
89
  ```
90
90
 
@@ -129,32 +129,32 @@ import Components from 'unplugin-vue-components/vite'
129
129
  import { VolverResolver } from '@volverjs/ui-vue/resolvers/unplugin'
130
130
 
131
131
  export default defineConfig({
132
- // ...
133
- plugins: [
134
132
  // ...
135
- Components({
136
- resolvers: [
137
- VolverResolver({
138
- /*
133
+ plugins: [
134
+ // ...
135
+ Components({
136
+ resolvers: [
137
+ VolverResolver({
138
+ /*
139
139
  * enable/disable auto import of components style
140
140
  * also accept 'scss' for scss support
141
141
  * default: false
142
142
  */
143
- importStyle: false,
144
- /*
143
+ importStyle: false,
144
+ /*
145
145
  * enable/disable auto import of directives
146
146
  * default: false
147
147
  */
148
- directives: false,
149
- /*
148
+ directives: false,
149
+ /*
150
150
  * Change components prefix
151
151
  * default: 'vv'
152
152
  */
153
- prefix: 'vv'
153
+ prefix: 'vv'
154
+ })
155
+ ]
154
156
  })
155
- ]
156
- })
157
- ]
157
+ ]
158
158
  })
159
159
  ```
160
160
 
@@ -168,27 +168,27 @@ Used to show alert messages and notifications
168
168
 
169
169
  ```typescript
170
170
  export type AlertModifier =
171
- | 'success'
172
- | 'info'
173
- | 'warning'
174
- | 'danger'
175
- | 'brand'
176
- | 'accent'
177
- | string
171
+ | 'success'
172
+ | 'info'
173
+ | 'warning'
174
+ | 'danger'
175
+ | 'brand'
176
+ | 'accent'
177
+ | string
178
178
  ```
179
179
 
180
180
  ```typescript
181
181
  export type Alert = {
182
- id: string | number
183
- title?: string
184
- icon?: string | VvIconProps
185
- content?: string
186
- footer?: string
187
- modifiers?: AlertModifier | AlertModifier[]
188
- dismissable?: boolean
189
- autoClose?: number
190
- closeLabel?: string
191
- role?: AlertRole
182
+ id: string | number
183
+ title?: string
184
+ icon?: string | VvIconProps
185
+ content?: string
186
+ footer?: string
187
+ modifiers?: AlertModifier | AlertModifier[]
188
+ dismissable?: boolean
189
+ autoClose?: number
190
+ closeLabel?: string
191
+ role?: AlertRole
192
192
  }
193
193
  ```
194
194
 
@@ -200,10 +200,10 @@ import { useAlert } from '@volverjs/ui-vue/composables'
200
200
  const { addAlert, removeAlert, alerts } = useAlert()
201
201
 
202
202
  function showSuccess() {
203
- addAlert({
204
- title: 'Success!',
205
- modifiers: 'success'
206
- })
203
+ addAlert({
204
+ title: 'Success!',
205
+ modifiers: 'success'
206
+ })
207
207
  }
208
208
  ```
209
209
 
@@ -240,41 +240,42 @@ const imageUrl = ref('')
240
240
  const image = ref()
241
241
 
242
242
  watch(
243
- file,
244
- async (newValue) => {
245
- if (newValue?.size) {
246
- this.imageUrl = URL.createObjectURL(newValue)
247
- this.image = await this.loadImage(this.imageUrl)
248
- this.blurhash = await this.encode(newValue)
249
- } else {
250
- this.image = null
251
- this.imageUrl = ''
252
- this.blurhash = ''
253
- }
254
- },
255
- { immediate: true }
243
+ file,
244
+ async (newValue) => {
245
+ if (newValue?.size) {
246
+ this.imageUrl = URL.createObjectURL(newValue)
247
+ this.image = await this.loadImage(this.imageUrl)
248
+ this.blurhash = await this.encode(newValue)
249
+ }
250
+ else {
251
+ this.image = null
252
+ this.imageUrl = ''
253
+ this.blurhash = ''
254
+ }
255
+ },
256
+ { immediate: true }
256
257
  )
257
258
 
258
259
  watch(blurhash, async (newValue) => {
259
- if (this.image) {
260
- const blurhashDecoded = await this.decode(
261
- newValue,
262
- this.image.width,
263
- this.image.height
264
- )
265
-
266
- if (this.canvas) {
267
- this.canvas.width = this.image.width
268
- this.canvas.height = this.image.height
269
- const ctx = this.canvas.getContext('2d')
270
- const imageData = ctx.createImageData(
271
- this.canvas.width,
272
- this.canvas.height
273
- )
274
- imageData.data.set(blurhashDecoded)
275
- ctx.putImageData(imageData, 0, 0)
260
+ if (this.image) {
261
+ const blurhashDecoded = await this.decode(
262
+ newValue,
263
+ this.image.width,
264
+ this.image.height
265
+ )
266
+
267
+ if (this.canvas) {
268
+ this.canvas.width = this.image.width
269
+ this.canvas.height = this.image.height
270
+ const ctx = this.canvas.getContext('2d')
271
+ const imageData = ctx.createImageData(
272
+ this.canvas.width,
273
+ this.canvas.height
274
+ )
275
+ imageData.data.set(blurhashDecoded)
276
+ ctx.putImageData(imageData, 0, 0)
277
+ }
276
278
  }
277
- }
278
279
  })
279
280
  ```
280
281
 
package/bin/icons.cjs CHANGED
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("fs"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("path"),require("@iconify/utils"),require("chokidar")):"function"==typeof define&&define.amd?define(["exports","fs","yargs","yargs/helpers","@iconify/tools","path","@iconify/utils","chokidar"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["generate-icons"]={},e.fileSystem,e.yargs,e.helpers,e.tools,e.path,e.utils,e.chokidar)}(this,(function(e,r,o,i,t,n,s,c){"use strict";function a(e,o="iconify",i={}){return r.readdirSync(e).forEach((function(t){r.statSync(e+"/"+t).isDirectory()?i=a(e+"/"+t,t,i):t.includes(".svg")&&(i[o]?i[o].push(n.join(e,"/",t)):i[o]=[n.join(e,"/",t)])})),i}function l(e,o,i){const c=a(e,i);Object.keys(c).length?Object.keys(c).forEach((e=>{!async function(e,o,i){const c=t.blankIconSet(e);for(const n of o)try{const e=await r.promises.readFile(n,{encoding:"utf-8"}),o=new t.SVG(e);await t.cleanupSVG(o),await t.parseColors(o,{defaultColor:"currentColor",callback:(e,r,o)=>!o||t.isEmptyColor(o)?r:"currentColor"}),await t.runSVGO(o);const i=n.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");c.fromSVG(i,o)}catch(f){console.error(f)}const a=c.export();try{s.validateIconSet(a)}catch(f){throw new Error(`Icon set is not valid: ${null==f?void 0:f.message}`)}const l=`${i}/${a.prefix}.json`;r.mkdirSync(n.dirname(l),{recursive:!0}),r.writeFileSync(l,JSON.stringify(a))}(e,c[e],o),console.info(`Icons generated in: ${o}/${e}.json\n`)})):console.error(`There are no files in ${e}`)}const f=o(i.hideBin(process.argv)).argv,d=f.srcPath,u=f.destPath||d;d&&u||(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit()),f.watch?(l(d,u,f.prefix),c.watch(d,{ignoreInitial:!0}).on("add",(()=>{l(d,u,f.prefix)})).on("change",(()=>{l(d,u,f.prefix)}))):l(d,u,f.prefix),e.createIconifyJsonFiles=l,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("node:fs"),require("node:path"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("@iconify/utils"),require("chokidar")):"function"==typeof define&&define.amd?define(["exports","node:fs","node:path","yargs","yargs/helpers","@iconify/tools","@iconify/utils","chokidar"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["generate-icons"]={},e.fileSystem,e.path,e.yargs,e.helpers,e.tools,e.utils,e.chokidar)}(this,(function(e,o,r,n,i,t,s,c){"use strict";function a(e,n="iconify",i={}){return o.readdirSync(e).forEach((t=>{o.statSync(`${e}/${t}`).isDirectory()?i=a(`${e}/${t}`,t,i):t.includes(".svg")&&(i[n]?i[n].push(r.join(e,"/",t)):i[n]=[r.join(e,"/",t)])})),i}function l(e,n,i){const c=a(e,i);Object.keys(c).length?Object.keys(c).forEach((e=>{!async function(e,n,i){const c=t.blankIconSet(e);for(const r of n)try{const e=await o.promises.readFile(r,{encoding:"utf-8"}),n=new t.SVG(e);await t.cleanupSVG(n),await t.parseColors(n,{defaultColor:"currentColor",callback:(e,o,r)=>!r||t.isEmptyColor(r)?o:"currentColor"}),await t.runSVGO(n);const i=r.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");c.fromSVG(i,n)}catch(f){console.error(f)}const a=c.export();try{s.validateIconSet(a)}catch(f){throw new Error(`Icon set is not valid: ${null==f?void 0:f.message}`)}const l=`${i}/${a.prefix}.json`;o.mkdirSync(r.dirname(l),{recursive:!0}),o.writeFileSync(l,JSON.stringify(a))}(e,c[e],n),console.info(`Icons generated in: ${n}/${e}.json\n`)})):console.error(`There are no files in ${e}`)}const f=n(i.hideBin(process.argv)).argv,d=f.srcPath,u=f.destPath||d;d&&u||(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit()),f.watch?(l(d,u,f.prefix),c.watch(d,{ignoreInitial:!0}).on("add",(()=>{l(d,u,f.prefix)})).on("change",(()=>{l(d,u,f.prefix)}))):l(d,u,f.prefix),e.createIconifyJsonFiles=l,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/bin/icons.js CHANGED
@@ -1,15 +1,15 @@
1
- import fileSystem from "fs";
1
+ import fileSystem from "node:fs";
2
+ import path from "node:path";
2
3
  import yargs from "yargs";
3
4
  import { hideBin } from "yargs/helpers";
4
5
  import { blankIconSet, SVG, cleanupSVG, parseColors, isEmptyColor, runSVGO } from "@iconify/tools";
5
- import path from "path";
6
6
  import { validateIconSet } from "@iconify/utils";
7
7
  import chokidar from "chokidar";
8
8
  function getAllFiles(dirPath, prefix = "iconify", objectFiles = {}) {
9
9
  const files = fileSystem.readdirSync(dirPath);
10
- files.forEach(function(file) {
11
- if (fileSystem.statSync(dirPath + "/" + file).isDirectory()) {
12
- objectFiles = getAllFiles(dirPath + "/" + file, file, objectFiles);
10
+ files.forEach((file) => {
11
+ if (fileSystem.statSync(`${dirPath}/${file}`).isDirectory()) {
12
+ objectFiles = getAllFiles(`${dirPath}/${file}`, file, objectFiles);
13
13
  } else {
14
14
  if (file.includes(".svg")) {
15
15
  objectFiles[prefix] ? objectFiles[prefix].push(path.join(dirPath, "/", file)) : objectFiles[prefix] = [path.join(dirPath, "/", file)];
package/dist/Volver.d.ts CHANGED
@@ -45,33 +45,33 @@ export type VolverOptions = {
45
45
  };
46
46
  export interface VolverInterface {
47
47
  /**
48
- * @param {String} src Icon source path (url)
48
+ * @param {string} src Icon source path (url)
49
49
  * @param {RequestInit} options
50
50
  * @returns {Promise<string | undefined>} String SVG if exist
51
51
  */
52
- fetchIcon(src: string, options?: RequestInit): Promise<string | undefined>;
52
+ fetchIcon: (src: string, options?: RequestInit) => Promise<string | undefined>;
53
53
  /**
54
54
  * Add iconify collection to library
55
55
  * @see https://docs.iconify.design/icon-components/vue/add-collection.html
56
56
  * @param {IconifyJSON} collection
57
- * @param {String} providerName Optional provider name
57
+ * @param {string} providerName Optional provider name
58
58
  */
59
- addCollection(collection: IconifyJSON, providerName?: string): boolean;
59
+ addCollection: (collection: IconifyJSON, providerName?: string) => boolean;
60
60
  /**
61
61
  * Add icon to collection
62
62
  * @see https://docs.iconify.design/icon-components/vue/add-icon.html
63
- * @param {String} name
63
+ * @param {string} name
64
64
  * @param {IconifyIcon} data
65
- * @returns {Boolean} true on success, false if something is wrong with data
65
+ * @returns {boolean} true on success, false if something is wrong with data
66
66
  */
67
- addIcon(name: string, data: IconifyIcon): boolean;
67
+ addIcon: (name: string, data: IconifyIcon) => boolean;
68
68
  /**
69
69
  * Add custom config for icons provider
70
- * @param {String} provider
70
+ * @param {string} provider
71
71
  * @param {PartialIconifyAPIConfig} customConfig
72
- * @returns {Boolean} true on success, false if something is wrong with data
72
+ * @returns {boolean} true on success, false if something is wrong with data
73
73
  */
74
- addIconsAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig): boolean;
74
+ addIconsAPIProvider: (provider: string, customConfig: PartialIconifyAPIConfig) => boolean;
75
75
  /**
76
76
  * Current provider
77
77
  */
@@ -411,8 +411,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
411
411
  emits: VvAccordionEvents,
412
412
  setup(__props, { expose: __expose, emit: __emit }) {
413
413
  const props = __props;
414
- const attrs = useAttrs();
415
414
  const emit = __emit;
415
+ const attrs = useAttrs();
416
416
  const modelValue = useVModel(props, "modelValue", emit);
417
417
  const accordionName = computed(
418
418
  () => props.name || (attrs == null ? void 0 : attrs.id) || uid()
@@ -438,7 +438,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
438
438
  }
439
439
  isExpanded.value = value;
440
440
  });
441
- const onClick = () => {
441
+ function onClick() {
442
442
  if (disabled.value) {
443
443
  return;
444
444
  }
@@ -450,7 +450,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
450
450
  return;
451
451
  }
452
452
  isExpanded.value = !isExpanded.value;
453
- };
453
+ }
454
454
  watch(
455
455
  accordionName,
456
456
  (newValue, oldValue) => {
@@ -470,19 +470,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
470
470
  bus.emit("unregister", { name: accordionName.value });
471
471
  }
472
472
  });
473
- const expand = () => {
473
+ function expand() {
474
474
  if (isExpanded.value) {
475
475
  return;
476
476
  }
477
477
  onClick();
478
- };
479
- const collapse = () => {
478
+ }
479
+ function collapse() {
480
480
  if (!isExpanded.value) {
481
481
  return;
482
482
  }
483
483
  onClick();
484
- };
485
- const groupExpand = (name) => {
484
+ }
485
+ function groupExpand(name) {
486
486
  if (!bus) {
487
487
  console.warn(
488
488
  `[VvAccordion]: You are trying to expand accordion group of "${accordionName.value}" but it is not in a group`
@@ -490,8 +490,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
490
490
  return;
491
491
  }
492
492
  bus.emit("expand", { name });
493
- };
494
- const groupCollapse = (name) => {
493
+ }
494
+ function groupCollapse(name) {
495
495
  if (!bus) {
496
496
  console.warn(
497
497
  `[VvAccordion]: You are trying to collapse accordion group of "${accordionName.value}" but it is not in a group`
@@ -499,7 +499,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
499
499
  return;
500
500
  }
501
501
  bus == null ? void 0 : bus.emit("collapse", { name });
502
- };
502
+ }
503
503
  __expose({
504
504
  isExpanded,
505
505
  expand,
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const i=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,l.button,t.local;const s={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o){const{group:n,isInGroup:t}=function(o){const n=e.inject(o,void 0),t=e.computed((()=>void 0!==n));return{group:n,isInGroup:t,getGroupOrLocalRef:function(o,t,a){const r=null==n?void 0:n[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const u=e.toRef(t,o);return e.computed({get:()=>u.value,set(e){a&&a(`update:${o}`,e)}})}}}(i),a=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value)))),r=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>a.add(e)))),Array.from(a)}));return{isInGroup:t,group:n,modifiers:r,disabled:a,bus:null==n?void 0:n.bus}}const p=["id","open"],m=["aria-controls","aria-expanded"],f=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(t,{expose:a,emit:r}){const u=t,l=e.useAttrs(),i=r,d=n.useVModel(u,"modelValue",i),s=e.computed((()=>u.name||(null==l?void 0:l.id)||o.uid())),{title:v,content:g,not:b}=e.toRefs(u),{isInGroup:y,modifiers:x,disabled:B,bus:h}=c(u),A=e.ref(!1);e.watch(d,(e=>{"boolean"==typeof e&&(A.value=b.value?!e:e)}),{immediate:!0}),e.watch(A,(e=>{d.value=b.value?!e:e})),null==h||h.on("toggle",(({name:e,value:o})=>{e===s.value&&(A.value=o)}));const E=()=>{B.value||(y.value?null==h||h.emit("toggle",{name:s.value,value:!A.value}):A.value=!A.value)};e.watch(s,((e,o)=>{h&&(o&&o!==e&&h.emit("unregister",{name:o}),h.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{h&&h.emit("unregister",{name:s.value})}));const V=()=>{A.value||E()},S=()=>{A.value&&E()},$=e=>{h?h.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${s.value}" but it is not in a group`)},k=e=>{h?null==h||h.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${s.value}" but it is not in a group`)};a({isExpanded:A,expand:V,collapse:S,groupExpand:$,groupCollapse:k});const w=function(o,n,t){return e.computed((()=>{const a={[o]:!0},r="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${o}--${n}`]=e.unref(t.value[n])})),a}))}("vv-accordion",x,e.computed((()=>({disabled:B.value}))));return(o,n)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(w)),open:e.unref(A)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(A),class:"vv-accordion__summary",onClick:n[0]||(n[0]=e.withModifiers((e=>E()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)]))],8,m),e.createElementVNode("div",{"aria-hidden":!e.unref(A),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,f)],10,p))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const i=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,l.button,t.local;const s={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o){const{group:n,isInGroup:t}=function(o){const n=e.inject(o,void 0),t=e.computed((()=>void 0!==n));return{group:n,isInGroup:t,getGroupOrLocalRef:function(o,t,a){const r=null==n?void 0:n[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const u=e.toRef(t,o);return e.computed({get:()=>u.value,set(e){a&&a(`update:${o}`,e)}})}}}(i),a=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value)))),r=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>a.add(e)))),Array.from(a)}));return{isInGroup:t,group:n,modifiers:r,disabled:a,bus:null==n?void 0:n.bus}}const p=["id","open"],f=["aria-controls","aria-expanded"],m=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(t,{expose:a,emit:r}){const u=t,l=r,i=e.useAttrs(),d=n.useVModel(u,"modelValue",l),s=e.computed((()=>u.name||(null==i?void 0:i.id)||o.uid())),{title:v,content:g,not:b}=e.toRefs(u),{isInGroup:y,modifiers:x,disabled:B,bus:h}=c(u),A=e.ref(!1);function E(){B.value||(y.value?null==h||h.emit("toggle",{name:s.value,value:!A.value}):A.value=!A.value)}function V(){A.value||E()}function S(){A.value&&E()}function $(e){h?h.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${s.value}" but it is not in a group`)}function k(e){h?null==h||h.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${s.value}" but it is not in a group`)}e.watch(d,(e=>{"boolean"==typeof e&&(A.value=b.value?!e:e)}),{immediate:!0}),e.watch(A,(e=>{d.value=b.value?!e:e})),null==h||h.on("toggle",(({name:e,value:o})=>{e===s.value&&(A.value=o)})),e.watch(s,((e,o)=>{h&&(o&&o!==e&&h.emit("unregister",{name:o}),h.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{h&&h.emit("unregister",{name:s.value})})),a({isExpanded:A,expand:V,collapse:S,groupExpand:$,groupCollapse:k});const w=function(o,n,t){return e.computed((()=>{const a={[o]:!0},r="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${o}--${n}`]=e.unref(t.value[n])})),a}))}("vv-accordion",x,e.computed((()=>({disabled:B.value}))));return(o,n)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(w)),open:e.unref(A)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(A),class:"vv-accordion__summary",onClick:n[0]||(n[0]=e.withModifiers((e=>E()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)]))],8,f),e.createElementVNode("div",{"aria-hidden":!e.unref(A),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,m)],10,p))}})}));
@@ -412,8 +412,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
412
412
  emits: VvAccordionEvents,
413
413
  setup(__props, { expose: __expose, emit: __emit }) {
414
414
  const props = __props;
415
- const attrs = useAttrs();
416
415
  const emit = __emit;
416
+ const attrs = useAttrs();
417
417
  const modelValue = useVModel(props, "modelValue", emit);
418
418
  const accordionName = computed(
419
419
  () => props.name || (attrs == null ? void 0 : attrs.id) || uid()
@@ -439,7 +439,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
439
439
  }
440
440
  isExpanded.value = value;
441
441
  });
442
- const onClick = () => {
442
+ function onClick() {
443
443
  if (disabled.value) {
444
444
  return;
445
445
  }
@@ -451,7 +451,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
451
451
  return;
452
452
  }
453
453
  isExpanded.value = !isExpanded.value;
454
- };
454
+ }
455
455
  watch(
456
456
  accordionName,
457
457
  (newValue, oldValue) => {
@@ -471,19 +471,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
471
471
  bus.emit("unregister", { name: accordionName.value });
472
472
  }
473
473
  });
474
- const expand = () => {
474
+ function expand() {
475
475
  if (isExpanded.value) {
476
476
  return;
477
477
  }
478
478
  onClick();
479
- };
480
- const collapse = () => {
479
+ }
480
+ function collapse() {
481
481
  if (!isExpanded.value) {
482
482
  return;
483
483
  }
484
484
  onClick();
485
- };
486
- const groupExpand = (name) => {
485
+ }
486
+ function groupExpand(name) {
487
487
  if (!bus) {
488
488
  console.warn(
489
489
  `[VvAccordion]: You are trying to expand accordion group of "${accordionName.value}" but it is not in a group`
@@ -491,8 +491,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
491
491
  return;
492
492
  }
493
493
  bus.emit("expand", { name });
494
- };
495
- const groupCollapse = (name) => {
494
+ }
495
+ function groupCollapse(name) {
496
496
  if (!bus) {
497
497
  console.warn(
498
498
  `[VvAccordion]: You are trying to collapse accordion group of "${accordionName.value}" but it is not in a group`
@@ -500,7 +500,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
500
500
  return;
501
501
  }
502
502
  bus == null ? void 0 : bus.emit("collapse", { name });
503
- };
503
+ }
504
504
  __expose({
505
505
  isExpanded,
506
506
  expand,
@@ -602,7 +602,7 @@ const VvAccordionGroupProps = {
602
602
  not: Boolean
603
603
  };
604
604
  const VvAccordionGroupEvents = ["update:modelValue"];
605
- const usePersistence = (storageKey, storageType = StorageType.local, defaultValue) => {
605
+ function usePersistence(storageKey, storageType = StorageType.local, defaultValue) {
606
606
  const localValue = ref();
607
607
  if (defaultValue) {
608
608
  localValue.value = defaultValue;
@@ -661,7 +661,7 @@ const usePersistence = (storageKey, storageType = StorageType.local, defaultValu
661
661
  localValue.value = value;
662
662
  }
663
663
  });
664
- };
664
+ }
665
665
  function useProvideGroupState(key, groupState) {
666
666
  provide(key, groupState);
667
667
  }
@@ -794,7 +794,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
794
794
  newValue.delete(name);
795
795
  expandedAccordions.value = newValue;
796
796
  });
797
- const expand = (name) => {
797
+ function expand(name) {
798
798
  if (typeof name === "string") {
799
799
  bus.emit("toggle", { name, value: true });
800
800
  return;
@@ -808,9 +808,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
808
808
  for (const item of accordionNames) {
809
809
  bus.emit("toggle", { name: item, value: true });
810
810
  }
811
- };
811
+ }
812
812
  bus.on("expand", ({ name }) => expand(name));
813
- const collapse = (name) => {
813
+ function collapse(name) {
814
814
  if (typeof name === "string") {
815
815
  bus.emit("toggle", { name, value: false });
816
816
  return;
@@ -824,7 +824,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
824
824
  for (const item of accordionNames) {
825
825
  bus.emit("toggle", { name: item, value: false });
826
826
  }
827
- };
827
+ }
828
828
  bus.on("collapse", ({ name }) => collapse(name));
829
829
  __expose({ expandedAccordions, expand, collapse });
830
830
  const bemCssClasses = useModifiers(
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,i.button;const c={storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String};const m={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function v(o){const{group:t,isInGroup:a}=function(o){const t=e.inject(o,void 0),a=e.computed((()=>void 0!==t));return{group:t,isInGroup:a,getGroupOrLocalRef:function(o,a,n){const l=null==t?void 0:t[o];if(l)return e.computed({get:()=>l.value,set(e){l.value=e}});const r=e.toRef(a,o);return e.computed({get:()=>r.value,set(e){n&&n(`update:${o}`,e)}})}}}(s),n=e.computed((()=>Boolean(o.disabled||(null==t?void 0:t.disabled.value)))),l=e.computed((()=>{let e=o.modifiers,a=null==t?void 0:t.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach((e=>n.add(e)))),Array.from(n)}));return{isInGroup:a,group:t,modifiers:l,disabled:n,bus:null==t?void 0:t.bus}}function p(o,t,a){return e.computed((()=>{const n={[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&&(n[`${o}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${o}--${t}`]=e.unref(a.value[t])})),n}))}const f=["id","open"],g=["aria-controls","aria-expanded"],y=["aria-hidden"],b=e.defineComponent({name:"VvAccordion",props:m,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const r=o,u=e.useAttrs(),i=l,s=a.useVModel(r,"modelValue",i),d=e.computed((()=>r.name||(null==u?void 0:u.id)||t.uid())),{title:c,content:m,not:b}=e.toRefs(r),{isInGroup:S,modifiers:x,disabled:A,bus:B}=v(r),h=e.ref(!1);e.watch(s,(e=>{"boolean"==typeof e&&(h.value=b.value?!e:e)}),{immediate:!0}),e.watch(h,(e=>{s.value=b.value?!e:e})),null==B||B.on("toggle",(({name:e,value:o})=>{e===d.value&&(h.value=o)}));const V=()=>{A.value||(S.value?null==B||B.emit("toggle",{name:d.value,value:!h.value}):h.value=!h.value)};e.watch(d,((e,o)=>{B&&(o&&o!==e&&B.emit("unregister",{name:o}),B.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{B&&B.emit("unregister",{name:d.value})}));const w=()=>{h.value||V()},k=()=>{h.value&&V()},$=e=>{B?B.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${d.value}" but it is not in a group`)},E=e=>{B?null==B||B.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${d.value}" but it is not in a group`)};n({isExpanded:h,expand:w,collapse:k,groupExpand:$,groupCollapse:E});const C=p("vv-accordion",x,e.computed((()=>({disabled:A.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(d),class:e.normalizeClass(e.unref(C)),open:e.unref(h)},[e.createElementVNode("summary",{"aria-controls":e.unref(d),"aria-expanded":e.unref(h),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((e=>V()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]))],8,g),e.createElementVNode("div",{"aria-hidden":!e.unref(h),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,y)],10,f))}}),S={...d,...c,modelValue:{type:[String,Array],default:void 0},items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean};return e.defineComponent({name:"VvAccordionGroup",props:S,emits:["update:modelValue"],setup(t,{expose:l,emit:r}){const u=t,i=r,{disabled:d,modifiers:c,itemModifiers:m,items:v,storageKey:f,storageType:g}=e.toRefs(u);e.watchEffect((()=>{"string"==typeof u.modelValue&&u.collapse&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));const y=e.reactive(new Set),S=((o,t=n.local,l)=>{const r=e.ref();let u;return l&&(r.value=l),o&&e.watch(o,((o,l)=>{const i=e.unref(t)===n.session?sessionStorage:localStorage;l&&l!==o&&i.removeItem(l),u=o?a.useStorage(o,(null==u?void 0:u.value)??r.value,i):void 0}),{immediate:!0}),e.isRef(t)&&e.watch(t,((e,t)=>{if(null==o?void 0:o.value){if(e){const t=e===n.session?sessionStorage:localStorage;u=a.useStorage(o.value,(null==u?void 0:u.value)??r.value,t)}t&&t!==e&&(t===n.session?sessionStorage:localStorage).removeItem(o.value)}})),e.computed({get:()=>(null==u?void 0:u.value)??r.value,set:e=>{u?u.value=e:r.value=e}})})(f,g,[]),x=e.computed({get:()=>null!==u.modelValue&&void 0!==u.modelValue?u.modelValue:S.value,set:e=>{i("update:modelValue",e),S.value=e}}),A=e.computed({get:()=>{if(void 0===x.value)return new Set;let e=new Set;return u.not?"string"==typeof x.value?e=new Set([...y].filter((e=>e!==x.value))):Array.isArray(x.value)&&(e=new Set([...y].filter((e=>!x.value.includes(e))))):"string"==typeof x.value?e=new Set([x.value]):Array.isArray(x.value)&&(e=new Set(x.value)),e},set:e=>{u.not?x.value=[...y].filter((o=>!e.has(o))):u.collapse?x.value=[...e]:x.value=e.values().next().value}});e.onMounted((()=>{u.not&&void 0===x.value&&(x.value=u.collapse?[]:[...y.values()].splice(1,y.size)),e.nextTick((()=>{for(const e of y)B.emit("toggle",{name:e,value:A.value.has(e)})}))}));const B=o();var h,V;h=s,V={disabled:d,modifiers:m,bus:B},e.provide(h,V),B.on("register",(({name:e})=>{y.add(e)})),B.on("unregister",(({name:e})=>{y.delete(e)})),B.on("toggle",(({name:e,value:o})=>{const t=new Set(A.value);if(o){if(!u.collapse){for(const o of t)o!==e&&B.emit("toggle",{name:o,value:!1});t.clear()}return t.add(e),void(A.value=t)}t.delete(e),A.value=t}));const w=e=>{if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!0});else for(const o of y)B.emit("toggle",{name:o,value:!0});else B.emit("toggle",{name:e,value:!0})};B.on("expand",(({name:e})=>w(e)));const k=e=>{if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!1});else for(const o of y)B.emit("toggle",{name:o,value:!1});else B.emit("toggle",{name:e,value:!1})};B.on("collapse",(({name:e})=>k(e))),l({expandedAccordions:A,expand:w,collapse:k});const $=p("vv-accordion-group",c,e.computed((()=>({disabled:d.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($))},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({expandedAccordions:e.unref(A),expand:w,collapse:k})),(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(t=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:t.title,ref_for:!0},{name:t.name,title:t.title,content:t.content}),e.createSlots({_:2},[o.$slots[`summary::${t.name}`]?{name:"summary",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`summary::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"0"}:void 0,o.$slots[`content::${t.name}`]?{name:"default",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`content::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"1"}:void 0]),1040)))),128))]))],2))}})}));
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,i.button;const c={storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String};const m={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function v(o){const{group:t,isInGroup:a}=function(o){const t=e.inject(o,void 0),a=e.computed((()=>void 0!==t));return{group:t,isInGroup:a,getGroupOrLocalRef:function(o,a,n){const l=null==t?void 0:t[o];if(l)return e.computed({get:()=>l.value,set(e){l.value=e}});const r=e.toRef(a,o);return e.computed({get:()=>r.value,set(e){n&&n(`update:${o}`,e)}})}}}(s),n=e.computed((()=>Boolean(o.disabled||(null==t?void 0:t.disabled.value)))),l=e.computed((()=>{let e=o.modifiers,a=null==t?void 0:t.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach((e=>n.add(e)))),Array.from(n)}));return{isInGroup:a,group:t,modifiers:l,disabled:n,bus:null==t?void 0:t.bus}}function p(o,t,a){return e.computed((()=>{const n={[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&&(n[`${o}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${o}--${t}`]=e.unref(a.value[t])})),n}))}const f=["id","open"],g=["aria-controls","aria-expanded"],y=["aria-hidden"],b=e.defineComponent({name:"VvAccordion",props:m,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const r=o,u=l,i=e.useAttrs(),s=a.useVModel(r,"modelValue",u),d=e.computed((()=>r.name||(null==i?void 0:i.id)||t.uid())),{title:c,content:m,not:b}=e.toRefs(r),{isInGroup:S,modifiers:x,disabled:A,bus:B}=v(r),h=e.ref(!1);function V(){A.value||(S.value?null==B||B.emit("toggle",{name:d.value,value:!h.value}):h.value=!h.value)}function w(){h.value||V()}function k(){h.value&&V()}function $(e){B?B.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${d.value}" but it is not in a group`)}function E(e){B?null==B||B.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${d.value}" but it is not in a group`)}e.watch(s,(e=>{"boolean"==typeof e&&(h.value=b.value?!e:e)}),{immediate:!0}),e.watch(h,(e=>{s.value=b.value?!e:e})),null==B||B.on("toggle",(({name:e,value:o})=>{e===d.value&&(h.value=o)})),e.watch(d,((e,o)=>{B&&(o&&o!==e&&B.emit("unregister",{name:o}),B.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{B&&B.emit("unregister",{name:d.value})})),n({isExpanded:h,expand:w,collapse:k,groupExpand:$,groupCollapse:E});const C=p("vv-accordion",x,e.computed((()=>({disabled:A.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(d),class:e.normalizeClass(e.unref(C)),open:e.unref(h)},[e.createElementVNode("summary",{"aria-controls":e.unref(d),"aria-expanded":e.unref(h),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((e=>V()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]))],8,g),e.createElementVNode("div",{"aria-hidden":!e.unref(h),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,y)],10,f))}}),S={...d,...c,modelValue:{type:[String,Array],default:void 0},items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean};return e.defineComponent({name:"VvAccordionGroup",props:S,emits:["update:modelValue"],setup(t,{expose:l,emit:r}){const u=t,i=r,{disabled:d,modifiers:c,itemModifiers:m,items:v,storageKey:f,storageType:g}=e.toRefs(u);e.watchEffect((()=>{"string"==typeof u.modelValue&&u.collapse&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));const y=e.reactive(new Set),S=function(o,t=n.local,l){const r=e.ref();let u;return l&&(r.value=l),o&&e.watch(o,((o,l)=>{const i=e.unref(t)===n.session?sessionStorage:localStorage;l&&l!==o&&i.removeItem(l),u=o?a.useStorage(o,(null==u?void 0:u.value)??r.value,i):void 0}),{immediate:!0}),e.isRef(t)&&e.watch(t,((e,t)=>{if(null==o?void 0:o.value){if(e){const t=e===n.session?sessionStorage:localStorage;u=a.useStorage(o.value,(null==u?void 0:u.value)??r.value,t)}t&&t!==e&&(t===n.session?sessionStorage:localStorage).removeItem(o.value)}})),e.computed({get:()=>(null==u?void 0:u.value)??r.value,set:e=>{u?u.value=e:r.value=e}})}(f,g,[]),x=e.computed({get:()=>null!==u.modelValue&&void 0!==u.modelValue?u.modelValue:S.value,set:e=>{i("update:modelValue",e),S.value=e}}),A=e.computed({get:()=>{if(void 0===x.value)return new Set;let e=new Set;return u.not?"string"==typeof x.value?e=new Set([...y].filter((e=>e!==x.value))):Array.isArray(x.value)&&(e=new Set([...y].filter((e=>!x.value.includes(e))))):"string"==typeof x.value?e=new Set([x.value]):Array.isArray(x.value)&&(e=new Set(x.value)),e},set:e=>{u.not?x.value=[...y].filter((o=>!e.has(o))):u.collapse?x.value=[...e]:x.value=e.values().next().value}});e.onMounted((()=>{u.not&&void 0===x.value&&(x.value=u.collapse?[]:[...y.values()].splice(1,y.size)),e.nextTick((()=>{for(const e of y)B.emit("toggle",{name:e,value:A.value.has(e)})}))}));const B=o();var h,V;function w(e){if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!0});else for(const o of y)B.emit("toggle",{name:o,value:!0});else B.emit("toggle",{name:e,value:!0})}function k(e){if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!1});else for(const o of y)B.emit("toggle",{name:o,value:!1});else B.emit("toggle",{name:e,value:!1})}h=s,V={disabled:d,modifiers:m,bus:B},e.provide(h,V),B.on("register",(({name:e})=>{y.add(e)})),B.on("unregister",(({name:e})=>{y.delete(e)})),B.on("toggle",(({name:e,value:o})=>{const t=new Set(A.value);if(o){if(!u.collapse){for(const o of t)o!==e&&B.emit("toggle",{name:o,value:!1});t.clear()}return t.add(e),void(A.value=t)}t.delete(e),A.value=t})),B.on("expand",(({name:e})=>w(e))),B.on("collapse",(({name:e})=>k(e))),l({expandedAccordions:A,expand:w,collapse:k});const $=p("vv-accordion-group",c,e.computed((()=>({disabled:d.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($))},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({expandedAccordions:e.unref(A),expand:w,collapse:k})),(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(t=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:t.title,ref_for:!0},{name:t.name,title:t.title,content:t.content}),e.createSlots({_:2},[o.$slots[`summary::${t.name}`]?{name:"summary",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`summary::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"0"}:void 0,o.$slots[`content::${t.name}`]?{name:"default",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`content::${t.name}`,e.mergeProps({ref_for:!0},a))])),key:"1"}:void 0]),1040)))),128))]))],2))}})}));
@@ -358,7 +358,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
358
358
  return toReturn;
359
359
  }
360
360
  });
361
- const onClick = (e) => {
361
+ function onClick(e) {
362
362
  var _a;
363
363
  if (props.disabled) {
364
364
  e.preventDefault();
@@ -369,23 +369,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
369
369
  return;
370
370
  }
371
371
  dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
372
- };
373
- const onMouseover = (e) => {
372
+ }
373
+ function onMouseover(e) {
374
374
  var _a;
375
375
  if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseover) {
376
376
  emit("mouseover", e);
377
377
  return;
378
378
  }
379
379
  dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
380
- };
381
- const onMouseleave = (e) => {
380
+ }
381
+ function onMouseleave(e) {
382
382
  var _a;
383
383
  if ((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onMouseleave) {
384
384
  emit("mouseleave", e);
385
385
  return;
386
386
  }
387
387
  dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
388
- };
388
+ }
389
389
  return (_ctx, _cache) => {
390
390
  return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
391
391
  ref_key: "element",
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};n.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...s,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=n,d=e.getCurrentInstance(),c=e.inject(a),v=e.ref(null);o({$el:v});const{reference:f,bus:p,aria:b,expanded:m}=e.inject(u,{});e.watch((()=>v.value),(e=>{f&&(f.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(i,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==c?void 0:c.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),B=e.computed((()=>{const e={...null==b?void 0:b.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),h=e=>{var t;l.disabled?e.preventDefault():(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onClick)?s("click",e):null==p||p.emit("click",e)},S=e=>{var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseover)?s("mouseover",e):null==p||p.emit("mouseover",e)},x=e=>{var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseleave)?s("mouseleave",e):null==p||p.emit("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(B),{ref_key:"element",ref:v,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},v={current:{type:Boolean,default:!1}},f={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};n.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...f,...c,...v,...s,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:r.button}};t.local;const m=b;return e.defineComponent({name:"VvAction",props:m,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=n,d=e.getCurrentInstance(),c=e.inject(a),v=e.ref(null);o({$el:v});const{reference:f,bus:p,aria:b,expanded:m}=e.inject(u,{});e.watch((()=>v.value),(e=>{f&&(f.value=e)}));const g=e.computed((()=>l.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(i,{}),k=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==c?void 0:c.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return l.defaultTag}})),B=e.computed((()=>{const e={...null==b?void 0:b.value,ariaPressed:!!g.value||void 0,ariaLabel:l.ariaLabel,role:null==y?void 0:y.value};switch(k.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};case r.button:return{...e,type:l.type,disabled:l.disabled};default:return e}}));function h(e){var t;l.disabled?e.preventDefault():(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onClick)?s("click",e):null==p||p.emit("click",e)}function S(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseover)?s("mouseover",e):null==p||p.emit("mouseover",e)}function x(e){var t;(null==(t=null==d?void 0:d.vnode.props)?void 0:t.onMouseleave)?s("mouseleave",e):null==p||p.emit("mouseleave",e)}return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(k)),e.mergeProps(e.unref(B),{ref_key:"element",ref:v,class:{active:t.active,pressed:e.unref(g),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:S,onMouseleavePassive:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));