@volverjs/ui-vue 0.0.5 → 0.0.6-beta.15

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 (478) hide show
  1. package/README.md +3 -4
  2. package/auto-imports.d.ts +11 -0
  3. package/dist/Volver.d.ts +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +238 -5
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +8 -8
  7. package/dist/components/VvAccordion/index.d.ts +3 -6
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +243 -10
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +10 -62
  11. package/dist/components/VvAccordionGroup/index.d.ts +4 -33
  12. package/dist/components/VvAction/VvAction.es.js +12 -8
  13. package/dist/components/VvAction/VvAction.umd.js +1 -1
  14. package/dist/components/VvAction/VvAction.vue.d.ts +4 -4
  15. package/dist/components/VvAction/index.d.ts +1 -1
  16. package/dist/components/VvAlert/VvAlert.es.js +661 -0
  17. package/dist/components/VvAlert/VvAlert.umd.js +1 -0
  18. package/dist/components/VvAlert/VvAlert.vue.d.ts +104 -0
  19. package/dist/components/VvAlert/index.d.ts +95 -0
  20. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +799 -0
  21. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -0
  22. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +89 -0
  23. package/dist/components/VvAlertGroup/index.d.ts +55 -0
  24. package/dist/components/VvAvatar/VvAvatar.es.js +279 -0
  25. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -0
  26. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +15 -0
  27. package/dist/components/VvAvatar/index.d.ts +7 -0
  28. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +363 -0
  29. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -0
  30. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +42 -0
  31. package/dist/components/VvAvatarGroup/index.d.ts +25 -0
  32. package/dist/components/VvBadge/VvBadge.es.js +3 -3
  33. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  34. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -3
  35. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +5 -31
  36. package/dist/components/VvBreadcrumb/index.d.ts +1 -14
  37. package/dist/components/VvButton/VvButton.es.js +90 -49
  38. package/dist/components/VvButton/VvButton.umd.js +1 -1
  39. package/dist/components/VvButton/VvButton.vue.d.ts +38 -13
  40. package/dist/components/VvButton/index.d.ts +27 -4
  41. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +13 -7
  42. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  43. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -62
  44. package/dist/components/VvButtonGroup/index.d.ts +3 -29
  45. package/dist/components/VvCard/VvCard.es.js +221 -2
  46. package/dist/components/VvCard/VvCard.umd.js +1 -1
  47. package/dist/components/VvCard/VvCard.vue.d.ts +7 -7
  48. package/dist/components/VvCard/index.d.ts +1 -1
  49. package/dist/components/VvCheckbox/VvCheckbox.es.js +154 -101
  50. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  51. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +47 -11
  52. package/dist/components/VvCheckbox/index.d.ts +9 -4
  53. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -104
  54. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  55. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +44 -8
  56. package/dist/components/VvCheckboxGroup/index.d.ts +8 -3
  57. package/dist/components/VvCombobox/VvCombobox.es.js +272 -175
  58. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  59. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +73 -37
  60. package/dist/components/VvCombobox/index.d.ts +13 -7
  61. package/dist/components/VvDialog/VvDialog.es.js +45 -34
  62. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  63. package/dist/components/VvDialog/VvDialog.vue.d.ts +7 -7
  64. package/dist/components/VvDialog/index.d.ts +2 -2
  65. package/dist/components/VvDropdown/VvDropdown.es.js +39 -25
  66. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  67. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +24 -20
  68. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +4 -4
  69. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
  70. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
  71. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +4 -4
  72. package/dist/components/VvDropdown/index.d.ts +2 -2
  73. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -11
  74. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  75. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +9 -5
  76. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  77. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +3 -3
  78. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +12 -8
  79. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  80. package/dist/components/VvIcon/VvIcon.es.js +26 -20
  81. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  82. package/dist/components/VvIcon/VvIcon.vue.d.ts +3 -3
  83. package/dist/components/VvIcon/index.d.ts +3 -3
  84. package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
  85. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
  86. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  87. package/dist/components/VvInputText/VvInputText.es.js +166 -142
  88. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  89. package/dist/components/VvInputText/VvInputText.vue.d.ts +46 -22
  90. package/dist/components/VvInputText/index.d.ts +5 -5
  91. package/dist/components/VvNav/VvNav.es.js +454 -0
  92. package/dist/components/VvNav/VvNav.umd.js +1 -0
  93. package/dist/components/VvNav/VvNav.vue.d.ts +21 -0
  94. package/dist/components/VvNav/index.d.ts +19 -0
  95. package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +19 -0
  96. package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +1 -0
  97. package/dist/components/VvNavItemTitle/VvNavItemTitle.vue.d.ts +6 -0
  98. package/dist/components/VvNavSeparator/VvNavSeparator.d.ts +2 -0
  99. package/dist/components/VvProgress/VvProgress.es.js +3 -3
  100. package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
  101. package/dist/components/VvRadio/VvRadio.es.js +154 -101
  102. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  103. package/dist/components/VvRadio/VvRadio.vue.d.ts +47 -11
  104. package/dist/components/VvRadio/index.d.ts +9 -4
  105. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -104
  106. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  107. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +44 -8
  108. package/dist/components/VvRadioGroup/index.d.ts +8 -3
  109. package/dist/components/VvSelect/VvSelect.es.js +167 -141
  110. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  111. package/dist/components/VvSelect/VvSelect.vue.d.ts +42 -18
  112. package/dist/components/VvSelect/index.d.ts +4 -4
  113. package/dist/components/VvTab/VvTab.es.js +509 -0
  114. package/dist/components/VvTab/VvTab.umd.js +1 -0
  115. package/dist/components/VvTab/VvTab.vue.d.ts +26 -0
  116. package/dist/components/VvTab/index.d.ts +10 -0
  117. package/dist/components/VvTextarea/VvTextarea.es.js +164 -140
  118. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  119. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +40 -16
  120. package/dist/components/VvTextarea/index.d.ts +3 -3
  121. package/dist/components/VvTooltip/VvTooltip.es.js +3 -3
  122. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
  123. package/dist/components/common/HintSlot.d.ts +38 -12
  124. package/dist/components/index.es.js +1336 -981
  125. package/dist/components/index.umd.js +1 -1
  126. package/dist/composables/alert/useInjectAlert.d.ts +9 -0
  127. package/dist/composables/alert/useProvideAlert.d.ts +10 -0
  128. package/dist/composables/dropdown/useInjectDropdown.d.ts +17 -16
  129. package/dist/composables/dropdown/useProvideDropdown.d.ts +7 -3
  130. package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
  131. package/dist/composables/useOptions.d.ts +2 -2
  132. package/dist/composables/useVolver.d.ts +1 -2
  133. package/dist/constants.d.ts +33 -4
  134. package/dist/directives/index.d.ts +2 -2
  135. package/dist/directives/index.es.js +3 -3
  136. package/dist/directives/v-tooltip.es.js +3 -3
  137. package/dist/icons.es.js +3 -3
  138. package/dist/icons.umd.js +1 -1
  139. package/dist/props/index.d.ts +38 -16
  140. package/dist/resolvers/unplugin.es.js +6 -3
  141. package/dist/resolvers/unplugin.umd.js +1 -1
  142. package/dist/stories/Accordion/Accordion.settings.d.ts +18 -17
  143. package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
  144. package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
  145. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +23 -4
  146. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +134 -0
  147. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +894 -0
  148. package/dist/stories/Alert/Alert.settings.d.ts +105 -0
  149. package/dist/stories/Alert/Alert.stories.d.ts +9 -0
  150. package/dist/stories/Alert/Alert.test.d.ts +2 -0
  151. package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
  152. package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
  153. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +97 -0
  154. package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
  155. package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
  156. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
  157. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
  158. package/dist/stories/Avatar/Avatar.settings.d.ts +5 -0
  159. package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
  160. package/dist/stories/Avatar/Avatar.test.d.ts +2 -0
  161. package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
  162. package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
  163. package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
  164. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +50 -0
  165. package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
  166. package/dist/stories/AvatarGroup/AvatarGroup.test.d.ts +2 -0
  167. package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
  168. package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
  169. package/dist/stories/Badge/Badge.settings.d.ts +0 -3
  170. package/dist/stories/Badge/Badge.stories.d.ts +7 -0
  171. package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
  172. package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
  173. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
  174. package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
  175. package/dist/stories/Button/Button.settings.d.ts +17 -9
  176. package/dist/stories/Button/Button.stories.d.ts +6 -0
  177. package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
  178. package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
  179. package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
  180. package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
  181. package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
  182. package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
  183. package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
  184. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +0 -4
  185. package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
  186. package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
  187. package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
  188. package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
  189. package/dist/stories/Card/Card.settings.d.ts +0 -3
  190. package/dist/stories/Card/Card.stories.d.ts +6 -0
  191. package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
  192. package/dist/stories/Checkbox/Checkbox.settings.d.ts +1 -21
  193. package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
  194. package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
  195. package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
  196. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -27
  197. package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
  198. package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
  199. package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
  200. package/dist/stories/Combobox/Combobox.settings.d.ts +2 -54
  201. package/dist/stories/Combobox/Combobox.stories.d.ts +21 -0
  202. package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
  203. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +8 -0
  204. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +9 -0
  205. package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
  206. package/dist/stories/Dialog/Dialog.settings.d.ts +1 -1
  207. package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
  208. package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
  209. package/dist/stories/Dropdown/Dropdown.settings.d.ts +1 -1
  210. package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
  211. package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
  212. package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
  213. package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
  214. package/dist/stories/Icon/Icon.settings.d.ts +1 -3
  215. package/dist/stories/Icon/Icon.stories.d.ts +8 -0
  216. package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
  217. package/dist/stories/InputText/InputText.settings.d.ts +1 -74
  218. package/dist/stories/InputText/InputText.stories.d.ts +15 -0
  219. package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
  220. package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
  221. package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
  222. package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
  223. package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
  224. package/dist/stories/Nav/Nav.settings.d.ts +30 -0
  225. package/dist/stories/Nav/Nav.stories.d.ts +6 -0
  226. package/dist/stories/Nav/Nav.test.d.ts +2 -0
  227. package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
  228. package/dist/stories/Progress/Progress.settings.d.ts +0 -6
  229. package/dist/stories/Progress/Progress.stories.d.ts +7 -0
  230. package/dist/stories/Radio/Radio.settings.d.ts +1 -19
  231. package/dist/stories/Radio/Radio.stories.d.ts +11 -0
  232. package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
  233. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -27
  234. package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
  235. package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
  236. package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
  237. package/dist/stories/Select/Select.settings.d.ts +1 -47
  238. package/dist/stories/Select/Select.stories.d.ts +15 -0
  239. package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
  240. package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
  241. package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
  242. package/dist/stories/Tab/Tab.settings.d.ts +37 -0
  243. package/dist/stories/Tab/Tab.stories.d.ts +6 -0
  244. package/dist/stories/Tab/Tab.test.d.ts +2 -0
  245. package/dist/stories/Textarea/Textarea.settings.d.ts +1 -43
  246. package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
  247. package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
  248. package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
  249. package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
  250. package/dist/stories/Tooltip/Tooltip.settings.d.ts +2 -39
  251. package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
  252. package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
  253. package/dist/stories/argTypes.d.ts +5 -125
  254. package/dist/test/expect.d.ts +3 -0
  255. package/package.json +112 -56
  256. package/src/assets/icons/detailed.json +1 -1
  257. package/src/assets/icons/normal.json +1 -1
  258. package/src/assets/icons/simple.json +1 -1
  259. package/src/components/VvAccordion/index.ts +22 -7
  260. package/src/components/VvAccordionGroup/index.ts +8 -6
  261. package/src/components/VvAction/VvAction.vue +1 -1
  262. package/src/components/VvAlert/VvAlert.vue +54 -0
  263. package/src/components/VvAlert/index.ts +162 -0
  264. package/src/components/VvAlertGroup/VvAlertGroup.vue +34 -0
  265. package/src/components/VvAlertGroup/index.ts +122 -0
  266. package/src/components/VvAvatar/VvAvatar.vue +21 -0
  267. package/src/components/VvAvatar/index.ts +9 -0
  268. package/src/components/VvAvatarGroup/VvAvatarGroup.vue +65 -0
  269. package/src/components/VvAvatarGroup/index.ts +28 -0
  270. package/src/components/VvBreadcrumb/index.ts +1 -1
  271. package/src/components/VvButton/VvButton.vue +9 -6
  272. package/src/components/VvButton/index.ts +44 -21
  273. package/src/components/VvButtonGroup/VvButtonGroup.vue +2 -2
  274. package/src/components/VvButtonGroup/index.ts +14 -2
  275. package/src/components/VvCard/index.ts +3 -1
  276. package/src/components/VvCheckbox/VvCheckbox.vue +23 -2
  277. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +15 -2
  278. package/src/components/VvCombobox/VvCombobox.vue +41 -24
  279. package/src/components/VvCombobox/index.ts +11 -5
  280. package/src/components/VvDialog/VvDialog.vue +11 -7
  281. package/src/components/VvDialog/index.ts +2 -2
  282. package/src/components/VvDropdown/VvDropdown.vue +23 -5
  283. package/src/components/VvDropdown/VvDropdownItem.vue +2 -2
  284. package/src/components/VvIcon/VvIcon.vue +37 -34
  285. package/src/components/VvIcon/index.ts +3 -3
  286. package/src/components/VvInputText/VvInputText.vue +26 -9
  287. package/src/components/VvNav/VvNav.vue +66 -0
  288. package/src/components/VvNav/index.ts +21 -0
  289. package/src/components/VvNavItemTitle/VvNavItemTitle.vue +11 -0
  290. package/src/components/VvNavSeparator/VvNavSeparator.ts +8 -0
  291. package/src/components/VvRadio/VvRadio.vue +23 -2
  292. package/src/components/VvRadioGroup/VvRadioGroup.vue +15 -2
  293. package/src/components/VvSelect/VvSelect.vue +26 -9
  294. package/src/components/VvTab/VvTab.vue +53 -0
  295. package/src/components/VvTab/index.ts +13 -0
  296. package/src/components/VvTextarea/VvTextarea.vue +26 -9
  297. package/src/components/common/HintSlot.ts +129 -170
  298. package/src/composables/alert/useInjectAlert.ts +8 -0
  299. package/src/composables/alert/useProvideAlert.ts +23 -0
  300. package/src/composables/dropdown/useInjectDropdown.ts +3 -28
  301. package/src/composables/dropdown/useProvideDropdown.ts +14 -15
  302. package/src/composables/useOptions.ts +9 -7
  303. package/src/composables/useVolver.ts +1 -2
  304. package/src/constants.ts +42 -4
  305. package/src/props/index.ts +7 -5
  306. package/src/resolvers/unplugin.ts +6 -3
  307. package/src/stories/Accordion/Accordion.settings.ts +18 -7
  308. package/src/stories/Accordion/Accordion.stories.ts +45 -0
  309. package/src/stories/Accordion/AccordionSlots.stories.ts +29 -0
  310. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +22 -0
  311. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +62 -0
  312. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +53 -0
  313. package/src/stories/Alert/Alert.settings.ts +110 -0
  314. package/src/stories/Alert/Alert.stories.ts +60 -0
  315. package/src/stories/Alert/Alert.test.ts +95 -0
  316. package/src/stories/Alert/AlertModifiers.stories.ts +77 -0
  317. package/src/stories/Alert/AlertSlots.stories.ts +74 -0
  318. package/src/stories/AlertGroup/AlertGroup.settings.ts +110 -0
  319. package/src/stories/AlertGroup/AlertGroup.stories.ts +50 -0
  320. package/src/stories/AlertGroup/AlertGroup.test.ts +76 -0
  321. package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +103 -0
  322. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +67 -0
  323. package/src/stories/Avatar/Avatar.settings.ts +37 -0
  324. package/src/stories/Avatar/Avatar.stories.ts +42 -0
  325. package/src/stories/Avatar/Avatar.test.ts +34 -0
  326. package/src/stories/Avatar/AvatarBadge.stories.ts +36 -0
  327. package/src/stories/Avatar/AvatarModifiers.stories.ts +100 -0
  328. package/src/stories/Avatar/AvatarSlots.stories.ts +34 -0
  329. package/src/stories/AvatarGroup/AvatarGroup.settings.ts +60 -0
  330. package/src/stories/AvatarGroup/AvatarGroup.stories.ts +35 -0
  331. package/src/stories/AvatarGroup/AvatarGroup.test.ts +36 -0
  332. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +31 -0
  333. package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +39 -0
  334. package/src/stories/Badge/Badge.stories.ts +43 -0
  335. package/src/stories/Badge/BadgeSlots.stories.ts +23 -0
  336. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +41 -0
  337. package/src/stories/Breadcrumb/Breadcrumb.test.ts +1 -1
  338. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +37 -0
  339. package/src/stories/Button/Button.settings.ts +14 -2
  340. package/src/stories/Button/Button.stories.ts +38 -0
  341. package/src/stories/Button/ButtonIcon.stories.ts +67 -0
  342. package/src/stories/Button/ButtonLink.stories.ts +40 -0
  343. package/src/stories/Button/ButtonLoading.stories.ts +41 -0
  344. package/src/stories/Button/ButtonModifiers.stories.ts +158 -0
  345. package/src/stories/Button/ButtonSlots.stories.ts +87 -0
  346. package/src/stories/Button/ButtonState.stories.ts +42 -0
  347. package/src/stories/Button/ButtonToggle.stories.ts +52 -0
  348. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +39 -0
  349. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +39 -0
  350. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +38 -0
  351. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +41 -0
  352. package/src/stories/Card/Card.stories.ts +46 -0
  353. package/src/stories/Card/CardSlots.stories.ts +81 -0
  354. package/src/stories/Checkbox/Checkbox.settings.ts +0 -2
  355. package/src/stories/Checkbox/Checkbox.stories.ts +97 -0
  356. package/src/stories/Checkbox/CheckboxBinary.stories.ts +33 -0
  357. package/src/stories/Checkbox/CheckboxSlots.stories.ts +31 -0
  358. package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +87 -0
  359. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +53 -0
  360. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +47 -0
  361. package/src/stories/Combobox/Combobox.settings.ts +3 -23
  362. package/src/stories/Combobox/Combobox.stories.ts +176 -0
  363. package/src/stories/Combobox/Combobox.test.ts +2 -2
  364. package/src/stories/Combobox/ComboboxIconPosition.stories.ts +43 -0
  365. package/src/stories/Combobox/ComboboxMultiple.stories.ts +41 -0
  366. package/src/stories/Combobox/ComboboxOptions.stories.ts +78 -0
  367. package/src/stories/Combobox/ComboboxSlots.stories.ts +104 -0
  368. package/src/stories/Dialog/Dialog.settings.ts +1 -1
  369. package/src/stories/Dialog/Dialog.stories.ts +51 -0
  370. package/src/stories/Dialog/Dialog.test.ts +2 -2
  371. package/src/stories/Dialog/DialogSlots.stories.ts +39 -0
  372. package/src/stories/Dropdown/Dropdown.stories.ts +107 -0
  373. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +49 -0
  374. package/src/stories/Dropdown/DropdownMultilevel.stories.ts +61 -0
  375. package/src/stories/Dropdown/DropdownSlots.stories.ts +95 -0
  376. package/src/stories/Icon/Icon.settings.ts +1 -0
  377. package/src/stories/Icon/Icon.stories.ts +48 -0
  378. package/src/stories/Icon/IconsCollection.stories.ts +53 -0
  379. package/src/stories/InputText/InputText.settings.ts +3 -39
  380. package/src/stories/InputText/InputText.stories.ts +121 -0
  381. package/src/stories/InputText/InputTextIconPosition.stories.ts +43 -0
  382. package/src/stories/InputText/InputTextLength.stories.ts +58 -0
  383. package/src/stories/InputText/InputTextMinMax.stories.ts +51 -0
  384. package/src/stories/InputText/InputTextSlots.stories.ts +39 -0
  385. package/src/stories/InputText/InputTextType.stories.ts +119 -0
  386. package/src/stories/Nav/Nav.settings.ts +34 -0
  387. package/src/stories/Nav/Nav.stories.ts +33 -0
  388. package/src/stories/Nav/Nav.test.ts +32 -0
  389. package/src/stories/Nav/NavModifiers.stories.ts +47 -0
  390. package/src/stories/Progress/Progress.settings.ts +0 -3
  391. package/src/stories/Progress/Progress.stories.ts +41 -0
  392. package/src/stories/Radio/Radio.stories.ts +81 -0
  393. package/src/stories/Radio/RadioSlots.stories.ts +31 -0
  394. package/src/stories/RadioGroup/RadioGroup.stories.ts +88 -0
  395. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +53 -0
  396. package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +47 -0
  397. package/src/stories/Select/Select.settings.ts +0 -5
  398. package/src/stories/Select/Select.stories.ts +113 -0
  399. package/src/stories/Select/SelectIconPosition.stories.ts +43 -0
  400. package/src/stories/Select/SelectOptions.stories.ts +77 -0
  401. package/src/stories/Select/SelectSlots.stories.ts +39 -0
  402. package/src/stories/Tab/Tab.settings.ts +41 -0
  403. package/src/stories/Tab/Tab.stories.ts +70 -0
  404. package/src/stories/Tab/Tab.test.ts +37 -0
  405. package/src/stories/Textarea/Textarea.settings.ts +0 -8
  406. package/src/stories/Textarea/Textarea.stories.ts +107 -0
  407. package/src/stories/Textarea/TextareaLength.stories.ts +58 -0
  408. package/src/stories/Textarea/TextareaSlots.stories.ts +39 -0
  409. package/src/stories/Textarea/TextareatIconPosition.stories.ts +43 -0
  410. package/src/stories/Tooltip/Tooltip.settings.ts +4 -4
  411. package/src/stories/Tooltip/Tooltip.stories.ts +40 -0
  412. package/src/stories/Tooltip/TooltipDirective.stories.ts +68 -0
  413. package/src/stories/argTypes.ts +5 -59
  414. package/src/test/expect.ts +15 -0
  415. package/src/types/group.d.ts +5 -3
  416. package/src/stories/Accordion/Accordion.stories.mdx +0 -45
  417. package/src/stories/Accordion/AccordionSlots.stories.mdx +0 -58
  418. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +0 -58
  419. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +0 -59
  420. package/src/stories/Badge/Badge.stories.mdx +0 -51
  421. package/src/stories/Badge/BadgeSlots.stories.mdx +0 -20
  422. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +0 -50
  423. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +0 -43
  424. package/src/stories/Button/Button.stories.mdx +0 -35
  425. package/src/stories/Button/ButtonIcon.stories.mdx +0 -153
  426. package/src/stories/Button/ButtonLink.stories.mdx +0 -72
  427. package/src/stories/Button/ButtonLoading.stories.mdx +0 -108
  428. package/src/stories/Button/ButtonModifiers.stories.mdx +0 -257
  429. package/src/stories/Button/ButtonSlots.stories.mdx +0 -116
  430. package/src/stories/Button/ButtonState.stories.mdx +0 -66
  431. package/src/stories/Button/ButtonToggle.stories.mdx +0 -50
  432. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +0 -37
  433. package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.mdx +0 -52
  434. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +0 -37
  435. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +0 -73
  436. package/src/stories/Card/Card.stories.mdx +0 -40
  437. package/src/stories/Card/CardSlots.stories.mdx +0 -98
  438. package/src/stories/Checkbox/Checkbox.stories.mdx +0 -164
  439. package/src/stories/Checkbox/CheckboxBinary.stories.mdx +0 -68
  440. package/src/stories/Checkbox/CheckboxSlots.stories.mdx +0 -46
  441. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +0 -135
  442. package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.mdx +0 -100
  443. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +0 -68
  444. package/src/stories/Combobox/Combobox.stories.mdx +0 -324
  445. package/src/stories/Combobox/ComboboxIconPosition.stories.mdx +0 -78
  446. package/src/stories/Combobox/ComboboxMultiple.stories.mdx +0 -73
  447. package/src/stories/Combobox/ComboboxOptions.stories.mdx +0 -135
  448. package/src/stories/Combobox/ComboboxSlots.stories.mdx +0 -153
  449. package/src/stories/Dialog/Dialog.stories.mdx +0 -56
  450. package/src/stories/Dialog/DialogSlots.stories.mdx +0 -63
  451. package/src/stories/Dropdown/Dropdown.stories.mdx +0 -124
  452. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +0 -41
  453. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +0 -56
  454. package/src/stories/Dropdown/DropdownSlots.stories.mdx +0 -114
  455. package/src/stories/Icon/Icon.stories.mdx +0 -91
  456. package/src/stories/Icon/IconsCollection.stories.mdx +0 -69
  457. package/src/stories/InputText/InputText.stories.mdx +0 -211
  458. package/src/stories/InputText/InputTextIconPosition.stories.mdx +0 -78
  459. package/src/stories/InputText/InputTextLength.stories.mdx +0 -110
  460. package/src/stories/InputText/InputTextMinMax.stories.mdx +0 -112
  461. package/src/stories/InputText/InputTextSlots.stories.mdx +0 -69
  462. package/src/stories/InputText/InputTextType.stories.mdx +0 -259
  463. package/src/stories/Progress/Progress.stories.mdx +0 -30
  464. package/src/stories/Radio/Radio.stories.mdx +0 -128
  465. package/src/stories/Radio/RadioSlots.stories.mdx +0 -46
  466. package/src/stories/RadioGroup/RadioGroup.stories.mdx +0 -135
  467. package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +0 -100
  468. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +0 -68
  469. package/src/stories/Select/Select.stories.mdx +0 -196
  470. package/src/stories/Select/SelectIconPosition.stories.mdx +0 -78
  471. package/src/stories/Select/SelectOptions.stories.mdx +0 -135
  472. package/src/stories/Select/SelectSlots.stories.mdx +0 -48
  473. package/src/stories/Textarea/Textarea.stories.mdx +0 -187
  474. package/src/stories/Textarea/TextareaLength.stories.mdx +0 -110
  475. package/src/stories/Textarea/TextareaSlots.stories.mdx +0 -69
  476. package/src/stories/Textarea/TextareatIconPosition.stories.mdx +0 -78
  477. package/src/stories/Tooltip/Tooltip.stories.mdx +0 -102
  478. package/src/stories/Tooltip/TooltipDirective.stories.mdx +0 -99
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.core,e.nanoid)}(this,(function(e,l,n){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{});const o=Symbol.for("checkGroup"),i={valid:Boolean,validLabel:[String,Array]},r={invalid:Boolean,invalidLabel:[String,Array]},d={disabled:Boolean},v=(Boolean,Boolean,{label:[String,Number]}),s={readonly:Boolean},c={modifiers:[String,Array]},f={hintLabel:{type:String,default:""}};t.before;const p={tabindex:{type:[String,Number],default:0}},m={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...{...m,name:{type:String,required:!0}},...p,...i,...r,...f,...d,...s,...c,...v,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function h(e,l,n){return n?g(e,n)===g(l,n):y(e,l)}function y(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const n=Array.isArray(e),a=Array.isArray(l);let t,u,o;if(n&&a){if(u=e.length,u!=l.length)return!1;for(t=u;0!=t--;)if(!y(e[t],l[t]))return!1;return!0}if(n!=a)return!1;const i=e instanceof Date,r=l instanceof Date;if(i!=r)return!1;if(i&&r)return e.getTime()==l.getTime();const d=e instanceof RegExp,v=l instanceof RegExp;if(d!=v)return!1;if(d&&v)return e.toString()==l.toString();const s=Object.keys(e);if(u=s.length,u!==Object.keys(l).length)return!1;for(t=u;0!=t--;)if(!Object.prototype.hasOwnProperty.call(l,s[t]))return!1;for(t=u;0!=t--;)if(o=s[t],!y(e[o],l[o]))return!1;return!0}return e!=e&&l!=l}function g(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const n=l.split(".");let a=e;for(let l=0,t=n.length;l<t;++l){if(null==e)return null;a=a[n[l]]}return a}}return null}function S(l){return null==(n=e.unref(l))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length;var n}u.button;const A={...b,...c,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function B(l,n){const{group:a,isInGroup:t,getGroupOrLocalRef:u}=function(l){const n=e.inject(l,void 0),a=e.computed((()=>!S(n)));return{group:n,isInGroup:a,getGroupOrLocalRef:function(l,a,t){if(null==n?void 0:n.value){const a=e.unref(n.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const u=e.toRef(a,l);return e.computed({get:()=>u.value,set(e){t&&t(`update:${l}`,e)}})}}}(o),{id:i,switch:r,indeterminate:d}=e.toRefs(l),v=u("modelValue",l,n),s=u("valid",l),c=u("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:a,isInGroup:t,modelValue:v,valid:s,invalid:c,readonly:f,disabled:p}}function V(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const k=["for"],x=["id","name","disabled","value","tabindex","aria-invalid"];return e.defineComponent({name:"VvCheckbox",props:A,emits:["click","update:modelValue","change","blur"],setup(a,{emit:t}){const u=a,o=e.useSlots(),{id:i,disabled:r,readonly:d,valid:v,invalid:s,propsSwitch:c,modelValue:f,indeterminate:p,isInGroup:m}=B(u,t),b=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(i),y=e.computed((()=>L.value?-1:u.tabindex)),A=e.ref(),j=e.computed((()=>void 0!==u.uncheckedValue&&!m.value)),L=e.computed((()=>r.value||d.value)),O=e.computed((()=>!0===s.value||!0!==v.value&&void 0)),w=e.computed((()=>j.value?f.value===u.value:Array.isArray(f.value)?function(e,l){if(null!=e&&l&&l.length)for(const n of l)if(h(e,n))return!0;return!1}(u.value,f.value):h(u.value,f.value))),R=e.computed((()=>!!p.value||!(w.value||!j.value||u.uncheckedValue===f.value))),N=e.computed((()=>{if(!j.value)return!["string","number","boolean"].includes(typeof u.value)||u.value})),C=e.computed({get:()=>w.value,set(e){if(j.value)f.value=e?u.value:u.uncheckedValue;else if(Array.isArray(f.value)||m.value){const l=new Set(Array.isArray(f.value)?f.value:void 0!==f.value?[f.value]:[]);e?l.add(u.value):l.delete(u.value),f.value=[...l]}else f.value=e?u.value:void 0;t("change",e)}}),{modifiers:E}=e.toRefs(u),G=function(l,n,a){return e.computed((()=>{const t={[l]:!0},u="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(t[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((n=>{t[`${l}--${n}`]=e.unref(a.value[n])})),t}))}("vv-checkbox",E,e.computed((()=>({switch:c.value,valid:v.value,invalid:s.value,disabled:r.value,readonly:d.value,indeterminate:p.value}))));e.watchEffect((()=>{j.value&&Array.isArray(f.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>R.value),(e=>{A.value.indeterminate=!!e})),e.onMounted((()=>{R.value&&(A.value.indeterminate=!0)}));const{HintSlot:I}=function(n,a){const{invalid:t,valid:u,hint:o,loading:i}=a,{hintLabel:r,modelValue:d,valid:v,validLabel:s,invalid:c,invalidLabel:f,...p}=e.toRefs(n),m=g(p,"loading"),b=g(p,"loadingLabel"),h=e.computed((()=>!(!c.value||(!c.value||!t)&&!((null==f?void 0:f.value)&&Array.isArray(f.value)&&f.value.length>0)&&(!(null==f?void 0:f.value)||S(f))))),y=e.computed((()=>!!(r&&r.value||o))),A=e.computed((()=>!!(s&&s.value||u))),B=e.computed((()=>!!((null==m?void 0:m.value)&&i||(null==m?void 0:m.value)&&(null==b?void 0:b.value)))),k=e.computed((()=>y.value||A.value||h.value||B.value));return{hasInvalid:h,hasHint:y,hasValid:A,hasLoading:B,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(n){const a=e.computed((()=>{const e=l.toReactive({hintLabel:r,modelValue:d,valid:v,validLabel:s,invalid:c,invalidLabel:f,loading:m,loadingLabel:b,...n.params});return(null==c?void 0:c.value)?(null==t?void 0:t(e))||V(null==f?void 0:f.value)||(null==r?void 0:r.value):(null==v?void 0:v.value)?(null==u?void 0:u(e))||V(null==s?void 0:s.value)||(null==r?void 0:r.value):(null==m?void 0:m.value)?(null==i?void 0:i(e))||V(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==o?void 0:o(e))||V(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:k,hasInvalid:h,hasValid:A,hintContent:a}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}(u,o);return(l,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(G)),for:e.unref(b)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:A,"onUpdate:modelValue":n[0]||(n[0]=l=>e.isRef(C)?C.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(L),value:e.unref(N),tabindex:e.unref(y),"aria-invalid":e.unref(O)},null,8,x),[[e.vModelCheckbox,e.unref(C)]]),e.renderSlot(l.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(I),{class:"vv-checkbox__hint",params:{value:e.unref(f)}},null,8,["params"])],10,k))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckbox=l(e.vue,e.nanoid)}(this,(function(e,l){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const o=Symbol.for("checkGroup"),i={valid:Boolean,validLabel:[String,Array]},r={invalid:Boolean,invalidLabel:[String,Array]},u={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},d={disabled:Boolean},s=(Boolean,Boolean,{label:[String,Number]}),v={readonly:Boolean},c={modifiers:[String,Array]},f={hintLabel:{type:String,default:""}};t.before;const h={tabindex:{type:[String,Number],default:0}},b={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const p={...{...b,name:{type:String,required:!0}},...h,...i,...r,...f,...d,...v,...c,...s,...u,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]};function m(e,l,a){return a?y(e,a)===y(l,a):g(e,l)}function g(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const a=Array.isArray(e),t=Array.isArray(l);let n,o,i;if(a&&t){if(o=e.length,o!=l.length)return!1;for(n=o;0!=n--;)if(!g(e[n],l[n]))return!1;return!0}if(a!=t)return!1;const r=e instanceof Date,u=l instanceof Date;if(r!=u)return!1;if(r&&u)return e.getTime()==l.getTime();const d=e instanceof RegExp,s=l instanceof RegExp;if(d!=s)return!1;if(d&&s)return e.toString()==l.toString();const v=Object.keys(e);if(o=v.length,o!==Object.keys(l).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(l,v[n]))return!1;for(n=o;0!=n--;)if(i=v[n],!g(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function y(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const a=l.split(".");let t=e;for(let l=0,n=a.length;l<n;++l){if(null==e)return null;t=t[a[l]]}return t}}return null}function S(l){const a=e.inject(l,void 0),t=e.computed((()=>{return l=a,!(null==(t=e.unref(l))||""===t||Array.isArray(t)&&0===t.length||!(t instanceof Date)&&"object"==typeof t&&0===Object.keys(t).length);var l,t}));return{group:a,isInGroup:t,getGroupOrLocalRef:function(l,t,n){if(null==a?void 0:a.value){const t=e.unref(a.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const o=e.toRef(t,l);return e.computed({get:()=>o.value,set(e){n&&n(`update:${l}`,e)}})}}}n.button;const L={...p,...c,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function B(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}const k=["for"],O=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"];return e.defineComponent({name:"VvCheckbox",props:L,emits:["click","update:modelValue","change","blur"],setup(a,{emit:t}){const n=a,i=e.useSlots(),{id:r,disabled:u,readonly:d,valid:s,invalid:v,propsSwitch:c,modelValue:f,indeterminate:h,isInGroup:b}=function(l,a){const{group:t,isInGroup:n,getGroupOrLocalRef:i}=S(o),{id:r,switch:u,indeterminate:d}=e.toRefs(l),s=i("modelValue",l,a),v=i("valid",l),c=i("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==t?void 0:t.value)?void 0:e.readonly.value))})),h=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))}));return{id:r,propsSwitch:u,indeterminate:d,group:t,isInGroup:n,modelValue:s,valid:v,invalid:c,readonly:f,disabled:h}}(n,t),p=(a=>e.computed((()=>String((null==a?void 0:a.value)||l.nanoid()))))(r),g=e.computed((()=>`${p.value}-hint`)),y=e.computed((()=>x.value?-1:n.tabindex)),L=e.ref(),V=e.computed((()=>void 0!==n.uncheckedValue&&!b.value)),x=e.computed((()=>u.value||d.value)),A=e.computed((()=>!0===v.value||!0!==s.value&&void 0)),$=e.computed((()=>V.value?f.value===n.value:Array.isArray(f.value)?function(e,l){if(null!=e&&l&&l.length)for(const a of l)if(m(e,a))return!0;return!1}(n.value,f.value):m(n.value,f.value))),w=e.computed((()=>!!h.value||!($.value||!V.value||n.uncheckedValue===f.value))),j=e.computed((()=>{if(!V.value)return!["string","number","boolean"].includes(typeof n.value)||n.value})),R=e.computed({get:()=>$.value,set(e){if(V.value)f.value=e?n.value:n.uncheckedValue;else if(Array.isArray(f.value)||b.value){const l=new Set(Array.isArray(f.value)?f.value:void 0!==f.value?[f.value]:[]);e?l.add(n.value):l.delete(n.value),f.value=[...l]}else f.value=e?n.value:void 0;t("change",e)}}),{modifiers:C}=e.toRefs(n),I=function(l,a,t){return e.computed((()=>{const n={[l]:!0},o="string"==typeof(null==a?void 0:a.value)?a.value.split(" "):null==a?void 0:a.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(n[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((a=>{n[`${l}--${a}`]=e.unref(t.value[a])})),n}))}("vv-checkbox",C,e.computed((()=>({switch:c.value,valid:s.value,invalid:v.value,disabled:u.value,readonly:d.value,indeterminate:h.value}))));e.watchEffect((()=>{V.value&&Array.isArray(f.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>w.value),(e=>{L.value.indeterminate=!!e})),e.onMounted((()=>{w.value&&(L.value.indeterminate=!0)}));const{HintSlot:N,hasHintLabelOrSlot:P,hasInvalidLabelOrSlot:E,hintSlotScope:G}=function(l,a){const t=e.computed((()=>B(l.invalidLabel))),n=e.computed((()=>B(l.validLabel))),o=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(a.loading||o.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(a.invalid||t.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(a.valid||n.value)))),s=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(a.hint||i.value))),v=e.computed((()=>u.value||d.value||r.value||s.value)),c=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:v,invalidLabel:t,validLabel:n,loadingLabel:o,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:s}),render(){var l,a,t,n,o,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(l=this.$slots).loading)?void 0:a.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(n=(t=this.$slots).invalid)?void 0:n.call(t))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(o=this.$slots).valid)?void 0:i.call(o))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:u,hasHintLabelOrSlot:s,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:c,HintSlot:f}}(n,i);return(l,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(I)),for:e.unref(p)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(p),ref_key:"input",ref:L,"onUpdate:modelValue":a[0]||(a[0]=l=>e.isRef(R)?R.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(x),value:e.unref(j),tabindex:e.unref(y),"aria-invalid":e.unref(A),"aria-describedby":e.unref(P)?e.unref(g):void 0,"aria-errormessage":e.unref(E)?e.unref(g):void 0},null,8,O),[[e.vModelCheckbox,e.unref(R)]]),e.renderSlot(l.$slots,"default",{value:e.unref(f)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(N),{id:e.unref(g),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"3"}:void 0]),1032,["id"])],10,k))}})}));
@@ -4,7 +4,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
4
4
  switch: BooleanConstructor;
5
5
  modifiers: globalThis.PropType<string | string[]>;
6
6
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
7
- modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
7
+ modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
8
+ loading: BooleanConstructor;
9
+ loadingLabel: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
8
13
  label: (StringConstructor | NumberConstructor)[];
9
14
  readonly: BooleanConstructor;
10
15
  disabled: BooleanConstructor;
@@ -13,9 +18,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
13
18
  default: string;
14
19
  };
15
20
  invalid: BooleanConstructor;
16
- invalidLabel: (StringConstructor | ArrayConstructor)[];
21
+ invalidLabel: (ArrayConstructor | StringConstructor)[];
17
22
  valid: BooleanConstructor;
18
- validLabel: (StringConstructor | ArrayConstructor)[];
23
+ validLabel: (ArrayConstructor | StringConstructor)[];
19
24
  tabindex: {
20
25
  type: (StringConstructor | NumberConstructor)[];
21
26
  default: number;
@@ -31,7 +36,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
31
36
  switch: BooleanConstructor;
32
37
  modifiers: globalThis.PropType<string | string[]>;
33
38
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
34
- modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
39
+ modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
40
+ loading: BooleanConstructor;
41
+ loadingLabel: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
35
45
  label: (StringConstructor | NumberConstructor)[];
36
46
  readonly: BooleanConstructor;
37
47
  disabled: BooleanConstructor;
@@ -40,9 +50,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
40
50
  default: string;
41
51
  };
42
52
  invalid: BooleanConstructor;
43
- invalidLabel: (StringConstructor | ArrayConstructor)[];
53
+ invalidLabel: (ArrayConstructor | StringConstructor)[];
44
54
  valid: BooleanConstructor;
45
- validLabel: (StringConstructor | ArrayConstructor)[];
55
+ validLabel: (ArrayConstructor | StringConstructor)[];
46
56
  tabindex: {
47
57
  type: (StringConstructor | NumberConstructor)[];
48
58
  default: number;
@@ -57,16 +67,42 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
57
67
  }, {
58
68
  disabled: boolean;
59
69
  switch: boolean;
70
+ tabindex: string | number;
71
+ loading: boolean;
72
+ loadingLabel: string;
60
73
  indeterminate: boolean;
61
74
  readonly: boolean;
62
75
  hintLabel: string;
63
76
  invalid: boolean;
64
77
  valid: boolean;
65
- tabindex: string | number;
66
- }>, {
67
- default: (_: {
68
- value: string | number | boolean | Record<string, any> | undefined;
69
- }) => any;
78
+ }, {}>, {
79
+ default?(_: {
80
+ value: any;
81
+ }): any;
82
+ hint?(_: {
83
+ modelValue: any;
84
+ valid: boolean;
85
+ invalid: boolean;
86
+ loading: boolean;
87
+ }): any;
88
+ loading?(_: {
89
+ modelValue: any;
90
+ valid: boolean;
91
+ invalid: boolean;
92
+ loading: boolean;
93
+ }): any;
94
+ valid?(_: {
95
+ modelValue: any;
96
+ valid: boolean;
97
+ invalid: boolean;
98
+ loading: boolean;
99
+ }): any;
100
+ invalid?(_: {
101
+ modelValue: any;
102
+ valid: boolean;
103
+ invalid: boolean;
104
+ loading: boolean;
105
+ }): any;
70
106
  }>;
71
107
  export default _default;
72
108
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -15,7 +15,12 @@ export declare const VvCheckboxProps: {
15
15
  switch: BooleanConstructor;
16
16
  modifiers: globalThis.PropType<string | string[]>;
17
17
  value: (StringConstructor | BooleanConstructor | NumberConstructor)[];
18
- modelValue: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
18
+ modelValue: (ObjectConstructor | StringConstructor | BooleanConstructor | NumberConstructor)[];
19
+ loading: BooleanConstructor;
20
+ loadingLabel: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
19
24
  label: (StringConstructor | NumberConstructor)[];
20
25
  readonly: BooleanConstructor;
21
26
  disabled: BooleanConstructor;
@@ -24,9 +29,9 @@ export declare const VvCheckboxProps: {
24
29
  default: string;
25
30
  };
26
31
  invalid: BooleanConstructor;
27
- invalidLabel: (StringConstructor | ArrayConstructor)[];
32
+ invalidLabel: (ArrayConstructor | StringConstructor)[];
28
33
  valid: BooleanConstructor;
29
- validLabel: (StringConstructor | ArrayConstructor)[];
34
+ validLabel: (ArrayConstructor | StringConstructor)[];
30
35
  tabindex: {
31
36
  type: (StringConstructor | NumberConstructor)[];
32
37
  default: number;
@@ -48,7 +53,7 @@ export declare function useGroupProps(props: VvCheckboxPropsTypes, emit: (event:
48
53
  indeterminate: Ref<boolean>;
49
54
  group: Ref<InputGroupState> | undefined;
50
55
  isInGroup: globalThis.ComputedRef<boolean>;
51
- modelValue: import("vue").WritableComputedRef<unknown>;
56
+ modelValue: import("vue").WritableComputedRef<any>;
52
57
  valid: Ref<boolean>;
53
58
  invalid: Ref<boolean>;
54
59
  readonly: globalThis.ComputedRef<boolean>;
@@ -1,6 +1,6 @@
1
- import { unref, toRefs, computed, h, inject, toRef, defineComponent, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, isRef, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
2
- import { toReactive, useVModel } from "@vueuse/core";
1
+ import { unref, computed, defineComponent, h, inject, toRef, toRefs, useSlots, ref, watchEffect, watch, onMounted, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, isRef, vModelCheckbox, renderSlot, createTextVNode, toDisplayString, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, provide, createCommentVNode, Fragment, renderList, createBlock, mergeProps } from "vue";
3
2
  import { nanoid } from "nanoid";
3
+ import { useVModel } from "@vueuse/core";
4
4
  var Side = /* @__PURE__ */ ((Side2) => {
5
5
  Side2["left"] = "left";
6
6
  Side2["right"] = "right";
@@ -123,111 +123,114 @@ function isEmpty(value) {
123
123
  function isString(value) {
124
124
  return typeof value === "string" || value instanceof String;
125
125
  }
126
- function joinLines(errors) {
127
- if (Array.isArray(errors)) {
128
- return errors.filter((e) => isString(e)).join(" ");
126
+ function joinLines(items) {
127
+ if (Array.isArray(items)) {
128
+ return items.filter((item) => isString(item)).join(" ");
129
129
  }
130
- return errors;
130
+ return items;
131
131
  }
132
- function HintSlotFactory(parentProps, parentSlots) {
133
- const {
134
- invalid: invalidSlot,
135
- valid: validSlot,
136
- hint: hintSlot,
137
- loading: loadingSlot
138
- } = parentSlots;
139
- const {
140
- hintLabel,
141
- modelValue,
142
- valid,
143
- validLabel,
144
- invalid,
145
- invalidLabel,
146
- ...otherProps
147
- } = toRefs(parentProps);
148
- const loading = resolveFieldData(otherProps, "loading");
149
- const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
150
- const hasInvalid = computed(() => {
151
- if (!invalid.value) {
152
- return false;
153
- }
154
- if (invalid.value && invalidSlot) {
155
- return true;
156
- }
157
- if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
158
- return true;
159
- }
160
- if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
161
- return true;
162
- }
163
- return false;
164
- });
165
- const hasHint = computed(
166
- () => !!(hintLabel && hintLabel.value || hintSlot)
132
+ function HintSlotFactory(props, slots) {
133
+ const invalidLabel = computed(() => joinLines(props.invalidLabel));
134
+ const validLabel = computed(() => joinLines(props.validLabel));
135
+ const loadingLabel = computed(() => props.loadingLabel);
136
+ const hintLabel = computed(() => props.hintLabel);
137
+ const hasLoadingLabelOrSlot = computed(
138
+ () => Boolean(props.loading && (slots.loading || loadingLabel.value))
167
139
  );
168
- const hasValid = computed(
169
- () => !!(validLabel && validLabel.value || validSlot)
140
+ const hasInvalidLabelOrSlot = computed(
141
+ () => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
170
142
  );
171
- const hasLoading = computed(
172
- () => !!((loading == null ? void 0 : loading.value) && loadingSlot || (loading == null ? void 0 : loading.value) && (loadingLabel == null ? void 0 : loadingLabel.value))
143
+ const hasValidLabelOrSlot = computed(
144
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
145
+ );
146
+ const hasHintLabelOrSlot = computed(
147
+ () => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
173
148
  );
174
149
  const isVisible = computed(
175
- () => hasHint.value || hasValid.value || hasInvalid.value || hasLoading.value
150
+ () => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
176
151
  );
177
- return {
178
- hasInvalid,
179
- hasHint,
180
- hasValid,
181
- hasLoading,
182
- HintSlot: {
183
- name: "HintSlot",
184
- props: {
185
- params: {
186
- type: Object,
187
- default: () => ({})
152
+ const hintSlotScope = computed(() => ({
153
+ modelValue: props.modelValue,
154
+ valid: props.valid,
155
+ invalid: props.invalid,
156
+ loading: props.loading
157
+ }));
158
+ const HintSlot = defineComponent({
159
+ name: "HintSlot",
160
+ props: {
161
+ tag: {
162
+ type: String,
163
+ default: "small"
164
+ }
165
+ },
166
+ setup() {
167
+ return {
168
+ isVisible,
169
+ invalidLabel,
170
+ validLabel,
171
+ loadingLabel,
172
+ hintLabel,
173
+ hasInvalidLabelOrSlot,
174
+ hasValidLabelOrSlot,
175
+ hasLoadingLabelOrSlot,
176
+ hasHintLabelOrSlot
177
+ };
178
+ },
179
+ render() {
180
+ var _a, _b, _c, _d, _e, _f, _g, _h;
181
+ if (this.isVisible) {
182
+ let role;
183
+ if (this.hasInvalidLabelOrSlot) {
184
+ role = "alert";
188
185
  }
189
- },
190
- setup(props) {
191
- const hintContent = computed(() => {
192
- const slotProps = toReactive({
193
- hintLabel,
194
- modelValue,
195
- valid,
196
- validLabel,
197
- invalid,
198
- invalidLabel,
199
- loading,
200
- loadingLabel,
201
- ...props.params
202
- });
203
- if (invalid == null ? void 0 : invalid.value) {
204
- return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
205
- }
206
- if (valid == null ? void 0 : valid.value)
207
- return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
208
- if (loading == null ? void 0 : loading.value)
209
- return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
210
- return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
211
- });
212
- return {
213
- isVisible,
214
- hasInvalid,
215
- hasValid,
216
- hintContent
217
- };
218
- },
219
- render() {
220
- if (this.isVisible) {
186
+ if (this.hasValidLabelOrSlot) {
187
+ role = "status";
188
+ }
189
+ if (this.hasLoadingLabelOrSlot) {
190
+ return h(
191
+ this.tag,
192
+ {
193
+ role
194
+ },
195
+ ((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
196
+ );
197
+ }
198
+ if (this.hasInvalidLabelOrSlot) {
199
+ return h(
200
+ this.tag,
201
+ {
202
+ role
203
+ },
204
+ ((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
205
+ );
206
+ }
207
+ if (this.hasValidLabelOrSlot) {
221
208
  return h(
222
- "small",
209
+ this.tag,
223
210
  {
224
- role: this.hasInvalid ? "alert" : this.hasValid ? "status" : void 0
211
+ role
225
212
  },
226
- this.hintContent
213
+ ((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
227
214
  );
228
215
  }
216
+ return h(
217
+ this.tag,
218
+ {
219
+ role
220
+ },
221
+ ((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
222
+ );
229
223
  }
224
+ return null;
230
225
  }
226
+ });
227
+ return {
228
+ hasInvalidLabelOrSlot,
229
+ hasHintLabelOrSlot,
230
+ hasValidLabelOrSlot,
231
+ hasLoadingLabelOrSlot,
232
+ hintSlotScope,
233
+ HintSlot
231
234
  };
232
235
  }
233
236
  const LinkProps = {
@@ -277,6 +280,19 @@ const InvalidProps = {
277
280
  */
278
281
  invalidLabel: [String, Array]
279
282
  };
283
+ const LoadingProps = {
284
+ /**
285
+ * Loading status
286
+ */
287
+ loading: Boolean,
288
+ /**
289
+ * Loading label
290
+ */
291
+ loadingLabel: {
292
+ type: String,
293
+ default: "Loading..."
294
+ }
295
+ };
280
296
  const DisabledProps = {
281
297
  /**
282
298
  * Whether the form control is disabled
@@ -442,11 +458,11 @@ const IdProps = {
442
458
  default: false
443
459
  },
444
460
  /**
445
- * Close dropdown on click outside
461
+ * Keep open dropdown on click outside
446
462
  */
447
- autoClose: {
463
+ keepOpen: {
448
464
  type: Boolean,
449
- default: true
465
+ default: false
450
466
  },
451
467
  /**
452
468
  * Autofocus first item on dropdown open
@@ -481,6 +497,7 @@ const CheckboxRadioProps = {
481
497
  ...ReadonlyProps,
482
498
  ...ModifiersProps,
483
499
  ...LabelProps,
500
+ ...LoadingProps,
484
501
  /**
485
502
  * Input value
486
503
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
@@ -500,6 +517,7 @@ const CheckboxRadioGroupProps = {
500
517
  ...ReadonlyProps,
501
518
  ...ModifiersProps,
502
519
  ...LabelProps,
520
+ ...LoadingProps,
503
521
  /**
504
522
  * Input value
505
523
  */
@@ -635,7 +653,7 @@ function useModifiers(prefix, modifiers, others) {
635
653
  });
636
654
  }
637
655
  const _hoisted_1$1 = ["for"];
638
- const _hoisted_2$1 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
656
+ const _hoisted_2$1 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
639
657
  const __default__$1 = {
640
658
  name: "VvCheckbox"
641
659
  };
@@ -658,6 +676,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
658
676
  isInGroup
659
677
  } = useGroupProps(props, emit);
660
678
  const hasId = useUniqueId(id);
679
+ const hasHintId = computed(() => `${hasId.value}-hint`);
661
680
  const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
662
681
  const input = ref();
663
682
  const isBinary = computed(
@@ -752,7 +771,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
752
771
  input.value.indeterminate = true;
753
772
  }
754
773
  });
755
- const { HintSlot } = HintSlotFactory(props, slots);
774
+ const {
775
+ HintSlot,
776
+ hasHintLabelOrSlot,
777
+ hasInvalidLabelOrSlot,
778
+ hintSlotScope
779
+ } = HintSlotFactory(props, slots);
756
780
  return (_ctx, _cache) => {
757
781
  return openBlock(), createElementBlock("label", {
758
782
  class: normalizeClass(unref(bemCssClasses)),
@@ -769,7 +793,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
769
793
  disabled: unref(isDisabled),
770
794
  value: unref(hasValue),
771
795
  tabindex: unref(tabindex),
772
- "aria-invalid": unref(isInvalid)
796
+ "aria-invalid": unref(isInvalid),
797
+ "aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
798
+ "aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
773
799
  }, null, 8, _hoisted_2$1), [
774
800
  [vModelCheckbox, unref(localModelValue)]
775
801
  ]),
@@ -777,9 +803,38 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
777
803
  createTextVNode(toDisplayString(_ctx.label), 1)
778
804
  ]),
779
805
  createVNode(unref(HintSlot), {
780
- class: "vv-checkbox__hint",
781
- params: { value: unref(modelValue) }
782
- }, null, 8, ["params"])
806
+ id: unref(hasHintId),
807
+ class: "vv-checkbox__hint"
808
+ }, createSlots({ _: 2 }, [
809
+ _ctx.$slots.hint ? {
810
+ name: "hint",
811
+ fn: withCtx(() => [
812
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
813
+ ]),
814
+ key: "0"
815
+ } : void 0,
816
+ _ctx.$slots.loading ? {
817
+ name: "loading",
818
+ fn: withCtx(() => [
819
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
820
+ ]),
821
+ key: "1"
822
+ } : void 0,
823
+ _ctx.$slots.valid ? {
824
+ name: "valid",
825
+ fn: withCtx(() => [
826
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
827
+ ]),
828
+ key: "2"
829
+ } : void 0,
830
+ _ctx.$slots.invalid ? {
831
+ name: "invalid",
832
+ fn: withCtx(() => [
833
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
834
+ ]),
835
+ key: "3"
836
+ } : void 0
837
+ ]), 1032, ["id"])
783
838
  ], 10, _hoisted_1$1);
784
839
  };
785
840
  }
@@ -801,7 +856,9 @@ function useOptions(props) {
801
856
  const getOptionLabel = (option) => {
802
857
  if (typeof option !== "object" && option !== null)
803
858
  return option;
804
- return typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value];
859
+ return String(
860
+ typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value]
861
+ );
805
862
  };
806
863
  const getOptionValue = (option) => {
807
864
  if (typeof option !== "object" && option !== null)
@@ -868,7 +925,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
868
925
  value: getOptionValue(option)
869
926
  };
870
927
  };
871
- const { HintSlot } = HintSlotFactory(props, slots);
928
+ const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
872
929
  return (_ctx, _cache) => {
873
930
  return openBlock(), createElementBlock("fieldset", {
874
931
  class: normalizeClass(unref(bemCssClasses))
@@ -882,7 +939,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
882
939
  return openBlock(), createBlock(_sfc_main$1, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
883
940
  }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
884
941
  ]),
885
- createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" })
942
+ createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }, createSlots({ _: 2 }, [
943
+ _ctx.$slots.hint ? {
944
+ name: "hint",
945
+ fn: withCtx(() => [
946
+ renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
947
+ ]),
948
+ key: "0"
949
+ } : void 0,
950
+ _ctx.$slots.loading ? {
951
+ name: "loading",
952
+ fn: withCtx(() => [
953
+ renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
954
+ ]),
955
+ key: "1"
956
+ } : void 0,
957
+ _ctx.$slots.valid ? {
958
+ name: "valid",
959
+ fn: withCtx(() => [
960
+ renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
961
+ ]),
962
+ key: "2"
963
+ } : void 0,
964
+ _ctx.$slots.invalid ? {
965
+ name: "invalid",
966
+ fn: withCtx(() => [
967
+ renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
968
+ ]),
969
+ key: "3"
970
+ } : void 0
971
+ ]), 1024)
886
972
  ], 2);
887
973
  };
888
974
  }
@@ -1 +1 @@
1
- !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("@vueuse/core"),require("nanoid")):"function"==typeof define&&define.amd?define(["vue","@vueuse/core","nanoid"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=l(e.vue,e.core,e.nanoid)}(this,(function(e,l,n){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),o=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(o||{});const u=Symbol.for("checkGroup");function i(e,l,n){return n?d(e,n)===d(l,n):r(e,l)}function r(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const n=Array.isArray(e),t=Array.isArray(l);let a,o,u;if(n&&t){if(o=e.length,o!=l.length)return!1;for(a=o;0!=a--;)if(!r(e[a],l[a]))return!1;return!0}if(n!=t)return!1;const i=e instanceof Date,d=l instanceof Date;if(i!=d)return!1;if(i&&d)return e.getTime()==l.getTime();const v=e instanceof RegExp,c=l instanceof RegExp;if(v!=c)return!1;if(v&&c)return e.toString()==l.toString();const s=Object.keys(e);if(o=s.length,o!==Object.keys(l).length)return!1;for(a=o;0!=a--;)if(!Object.prototype.hasOwnProperty.call(l,s[a]))return!1;for(a=o;0!=a--;)if(u=s[a],!r(e[u],l[u]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const n=l.split(".");let t=e;for(let l=0,a=n.length;l<a;++l){if(null==e)return null;t=t[n[l]]}return t}}return null}function v(l){return null==(n=e.unref(l))||""===n||Array.isArray(n)&&0===n.length||!(n instanceof Date)&&"object"==typeof n&&0===Object.keys(n).length;var n}function c(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function s(n,t){const{invalid:a,valid:o,hint:u,loading:i}=t,{hintLabel:r,modelValue:s,valid:f,validLabel:p,invalid:m,invalidLabel:b,...y}=e.toRefs(n),g=d(y,"loading"),h=d(y,"loadingLabel"),k=e.computed((()=>!!m.value&&(!(!m.value||!a)||(!!((null==b?void 0:b.value)&&Array.isArray(b.value)&&b.value.length>0)||!(!(null==b?void 0:b.value)||v(b)))))),S=e.computed((()=>!!(r&&r.value||u))),V=e.computed((()=>!!(p&&p.value||o))),B=e.computed((()=>!!((null==g?void 0:g.value)&&i||(null==g?void 0:g.value)&&(null==h?void 0:h.value)))),A=e.computed((()=>S.value||V.value||k.value||B.value));return{hasInvalid:k,hasHint:S,hasValid:V,hasLoading:B,HintSlot:{name:"HintSlot",props:{params:{type:Object,default:()=>({})}},setup(n){const t=e.computed((()=>{const e=l.toReactive({hintLabel:r,modelValue:s,valid:f,validLabel:p,invalid:m,invalidLabel:b,loading:g,loadingLabel:h,...n.params});return(null==m?void 0:m.value)?(null==a?void 0:a(e))||c(null==b?void 0:b.value)||(null==r?void 0:r.value):(null==f?void 0:f.value)?(null==o?void 0:o(e))||c(null==p?void 0:p.value)||(null==r?void 0:r.value):(null==g?void 0:g.value)?(null==i?void 0:i(e))||c(null==h?void 0:h.value)||(null==r?void 0:r.value):(null==u?void 0:u(e))||c(null==r?void 0:r.value)||(null==r?void 0:r.value)}));return{isVisible:A,hasInvalid:k,hasValid:V,hintContent:t}},render(){if(this.isVisible)return e.h("small",{role:this.hasInvalid?"alert":this.hasValid?"status":void 0},this.hintContent)}}}}const f={valid:Boolean,validLabel:[String,Array]},p={invalid:Boolean,invalidLabel:[String,Array]},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},g={modifiers:[String,Array]},h={hintLabel:{type:String,default:""}},k={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};a.before;const S={tabindex:{type:[String,Number],default:0}},V={id:[String,Number]};t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const B={...{...V,name:{type:String,required:!0}},...S,...f,...p,...h,...m,...y,...g,...b,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},A={...f,...p,...k,...h,...m,...y,...g,...b,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};o.button;const x={...B,...g,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function O(l,n){const{group:t,isInGroup:a,getGroupOrLocalRef:o}=function(l){const n=e.inject(l,void 0),t=e.computed((()=>!v(n)));return{group:n,isInGroup:t,getGroupOrLocalRef:function(l,t,a){if(null==n?void 0:n.value){const t=e.unref(n.value)[l];return e.computed({get:()=>null==t?void 0:t.value,set(e){t.value=e}})}const o=e.toRef(t,l);return e.computed({get:()=>o.value,set(e){a&&a(`update:${l}`,e)}})}}}(u),{id:i,switch:r,indeterminate:d}=e.toRefs(l),c=o("modelValue",l,n),s=o("valid",l),f=o("invalid",l),p=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==t?void 0:t.value)?void 0:e.readonly.value))})),m=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==t?void 0:t.value)?void 0:e.disabled.value))}));return{id:i,propsSwitch:r,indeterminate:d,group:t,isInGroup:a,modelValue:c,valid:s,invalid:f,readonly:p,disabled:m}}function j(l,n,t){return e.computed((()=>{const a={[l]:!0},o="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return o&&Array.isArray(o)&&o.forEach((e=>{e&&(a[`${l}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${l}--${n}`]=e.unref(t.value[n])})),a}))}const L=["for"],C=["id","name","disabled","value","tabindex","aria-invalid"],w=e.defineComponent({name:"VvCheckbox",props:x,emits:["click","update:modelValue","change","blur"],setup(l,{emit:t}){const a=l,o=e.useSlots(),{id:u,disabled:r,readonly:d,valid:v,invalid:c,propsSwitch:f,modelValue:p,indeterminate:m,isInGroup:b}=O(a,t),y=(l=>e.computed((()=>String((null==l?void 0:l.value)||n.nanoid()))))(u),g=e.computed((()=>S.value?-1:a.tabindex)),h=e.ref(),k=e.computed((()=>void 0!==a.uncheckedValue&&!b.value)),S=e.computed((()=>r.value||d.value)),V=e.computed((()=>!0===c.value||!0!==v.value&&void 0)),B=e.computed((()=>k.value?p.value===a.value:Array.isArray(p.value)?function(e,l){if(null!=e&&l&&l.length)for(const n of l)if(i(e,n))return!0;return!1}(a.value,p.value):i(a.value,p.value))),A=e.computed((()=>!!m.value||!(B.value||!k.value||a.uncheckedValue===p.value))),x=e.computed((()=>{if(!k.value)return!["string","number","boolean"].includes(typeof a.value)||a.value})),w=e.computed({get:()=>B.value,set(e){if(k.value)p.value=e?a.value:a.uncheckedValue;else if(Array.isArray(p.value)||b.value){const l=new Set(Array.isArray(p.value)?p.value:void 0!==p.value?[p.value]:[]);e?l.add(a.value):l.delete(a.value),p.value=[...l]}else p.value=e?a.value:void 0;t("change",e)}}),{modifiers:N}=e.toRefs(a),R=j("vv-checkbox",N,e.computed((()=>({switch:f.value,valid:v.value,invalid:c.value,disabled:r.value,readonly:d.value,indeterminate:m.value}))));e.watchEffect((()=>{k.value&&Array.isArray(p.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>A.value),(e=>{h.value.indeterminate=!!e})),e.onMounted((()=>{A.value&&(h.value.indeterminate=!0)}));const{HintSlot:E}=s(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(R)),for:e.unref(y)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(y),ref_key:"input",ref:h,"onUpdate:modelValue":n[0]||(n[0]=l=>e.isRef(w)?w.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(S),value:e.unref(x),tabindex:e.unref(g),"aria-invalid":e.unref(V)},null,8,C),[[e.vModelCheckbox,e.unref(w)]]),e.renderSlot(l.$slots,"default",{value:e.unref(p)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(E),{class:"vv-checkbox__hint",params:{value:e.unref(p)}},null,8,["params"])],10,L))}}),N=A;const R=["textContent"],E={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:N,emits:["update:modelValue","change"],setup(n,{emit:t}){const a=n,o=e.useSlots(),i=l.useVModel(a,"modelValue",t),{disabled:r,readonly:d,vertical:v,valid:c,invalid:f,modifiers:p}=e.toRefs(a);!function(l){if(Object.keys(l).some((n=>"key"!==n&&!e.isRef(l[n]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:u,modelValue:i,disabled:r,readonly:d,valid:c,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:n,labelKey:t,valueKey:a,disabledKey:o}=e.toRefs(l);return{options:n,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:"function"==typeof t.value?t.value(e):e[t.value],getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof a.value?a.value(e):e[a.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof o.value?o.value(e):e[o.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(a),y=j("vv-checkbox-group",p,e.computed((()=>({disabled:r.value,readonly:d.value,horizontal:!v.value,valid:c.value,invalid:f.value})))),{HintSlot:g}=s(a,o);return(l,n)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(y))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,R)):e.createCommentVNode("",!0),e.createElementVNode("div",E,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,n)=>(e.openBlock(),e.createBlock(w,e.mergeProps({key:n},((e,l)=>({id:`${a.name}_opt${l}`,name:a.name,label:m(e),value:b(e)}))(l,n)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(g),{class:"vv-checkbox-group__hint"})],2))}})}));
1
+ !function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l(require("vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core"],l):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCheckboxGroup=l(e.vue,e.nanoid,e.core)}(this,(function(e,l,t){"use strict";var a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});const i=Symbol.for("checkGroup");function r(e,l,t){return t?d(e,t)===d(l,t):u(e,l)}function u(e,l){if(e===l)return!0;if(e&&l&&"object"==typeof e&&"object"==typeof l){const t=Array.isArray(e),a=Array.isArray(l);let o,n,i;if(t&&a){if(n=e.length,n!=l.length)return!1;for(o=n;0!=o--;)if(!u(e[o],l[o]))return!1;return!0}if(t!=a)return!1;const r=e instanceof Date,d=l instanceof Date;if(r!=d)return!1;if(r&&d)return e.getTime()==l.getTime();const s=e instanceof RegExp,v=l instanceof RegExp;if(s!=v)return!1;if(s&&v)return e.toString()==l.toString();const c=Object.keys(e);if(n=c.length,n!==Object.keys(l).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(l,c[o]))return!1;for(o=n;0!=o--;)if(i=c[o],!u(e[i],l[i]))return!1;return!0}return e!=e&&l!=l}function d(e,l){if(e&&Object.keys(e).length&&l){if(-1===l.indexOf("."))return e[l];{const t=l.split(".");let a=e;for(let l=0,o=t.length;l<o;++l){if(null==e)return null;a=a[t[l]]}return a}}return null}function s(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(l=e)||l instanceof String;var l})).join(" "):e}function v(l,t){const a=e.computed((()=>s(l.invalidLabel))),o=e.computed((()=>s(l.validLabel))),n=e.computed((()=>l.loadingLabel)),i=e.computed((()=>l.hintLabel)),r=e.computed((()=>Boolean(l.loading&&(t.loading||n.value)))),u=e.computed((()=>!r.value&&Boolean(l.invalid&&(t.invalid||a.value)))),d=e.computed((()=>!r.value&&!u.value&&Boolean(l.valid&&(t.valid||o.value)))),v=e.computed((()=>!r.value&&!u.value&&!d.value&&Boolean(t.hint||i.value))),c=e.computed((()=>u.value||d.value||r.value||v.value)),f=e.computed((()=>({modelValue:l.modelValue,valid:l.valid,invalid:l.invalid,loading:l.loading}))),p=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:c,invalidLabel:a,validLabel:o,loadingLabel:n,hintLabel:i,hasInvalidLabelOrSlot:u,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hasHintLabelOrSlot:v}),render(){var l,t,a,o,n,i,r,u;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(t=(l=this.$slots).loading)?void 0:t.call(l))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(o=(a=this.$slots).invalid)?void 0:o.call(a))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:u,hasHintLabelOrSlot:v,hasValidLabelOrSlot:d,hasLoadingLabelOrSlot:r,hintSlotScope:f,HintSlot:p}}const c={valid:Boolean,validLabel:[String,Array]},f={invalid:Boolean,invalidLabel:[String,Array]},p={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},m={disabled:Boolean},b=(Boolean,Boolean,{label:[String,Number]}),h={readonly:Boolean},g={modifiers:[String,Array]},y={hintLabel:{type:String,default:""}},S={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}};o.before;const k={tabindex:{type:[String,Number],default:0}},L={id:[String,Number]};a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const B={...{...L,name:{type:String,required:!0}},...k,...c,...f,...y,...m,...h,...g,...b,...p,value:[String,Number,Boolean],modelValue:[Object,Number,Boolean,String]},V={...c,...f,...S,...y,...m,...h,...g,...b,...p,modelValue:[String,Array,Boolean,Number,Symbol],name:{type:String,required:!0},vertical:Boolean};function O(l){const t=e.inject(l,void 0),a=e.computed((()=>{return l=t,!(null==(a=e.unref(l))||""===a||Array.isArray(a)&&0===a.length||!(a instanceof Date)&&"object"==typeof a&&0===Object.keys(a).length);var l,a}));return{group:t,isInGroup:a,getGroupOrLocalRef:function(l,a,o){if(null==t?void 0:t.value){const a=e.unref(t.value)[l];return e.computed({get:()=>null==a?void 0:a.value,set(e){a.value=e}})}const n=e.toRef(a,l);return e.computed({get:()=>n.value,set(e){o&&o(`update:${l}`,e)}})}}}n.button;const x={...B,...g,indeterminate:Boolean,uncheckedValue:[String,Number,Boolean],switch:Boolean};function $(l,t,a){return e.computed((()=>{const o={[l]:!0},n="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(o[`${l}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{o[`${l}--${t}`]=e.unref(a.value[t])})),o}))}const A=["for"],w=["id","name","disabled","value","tabindex","aria-invalid","aria-describedby","aria-errormessage"],C=e.defineComponent({name:"VvCheckbox",props:x,emits:["click","update:modelValue","change","blur"],setup(t,{emit:a}){const o=t,n=e.useSlots(),{id:u,disabled:d,readonly:s,valid:c,invalid:f,propsSwitch:p,modelValue:m,indeterminate:b,isInGroup:h}=function(l,t){const{group:a,isInGroup:o,getGroupOrLocalRef:n}=O(i),{id:r,switch:u,indeterminate:d}=e.toRefs(l),s=n("modelValue",l,t),v=n("valid",l),c=n("invalid",l),f=e.computed((()=>{var e;return Boolean(l.readonly||(null==(e=null==a?void 0:a.value)?void 0:e.readonly.value))})),p=e.computed((()=>{var e;return Boolean(l.disabled||(null==(e=null==a?void 0:a.value)?void 0:e.disabled.value))}));return{id:r,propsSwitch:u,indeterminate:d,group:a,isInGroup:o,modelValue:s,valid:v,invalid:c,readonly:f,disabled:p}}(o,a),g=(t=>e.computed((()=>String((null==t?void 0:t.value)||l.nanoid()))))(u),y=e.computed((()=>`${g.value}-hint`)),S=e.computed((()=>B.value?-1:o.tabindex)),k=e.ref(),L=e.computed((()=>void 0!==o.uncheckedValue&&!h.value)),B=e.computed((()=>d.value||s.value)),V=e.computed((()=>!0===f.value||!0!==c.value&&void 0)),x=e.computed((()=>L.value?m.value===o.value:Array.isArray(m.value)?function(e,l){if(null!=e&&l&&l.length)for(const t of l)if(r(e,t))return!0;return!1}(o.value,m.value):r(o.value,m.value))),C=e.computed((()=>!!b.value||!(x.value||!L.value||o.uncheckedValue===m.value))),R=e.computed((()=>{if(!L.value)return!["string","number","boolean"].includes(typeof o.value)||o.value})),j=e.computed({get:()=>x.value,set(e){if(L.value)m.value=e?o.value:o.uncheckedValue;else if(Array.isArray(m.value)||h.value){const l=new Set(Array.isArray(m.value)?m.value:void 0!==m.value?[m.value]:[]);e?l.add(o.value):l.delete(o.value),m.value=[...l]}else m.value=e?o.value:void 0;a("change",e)}}),{modifiers:P}=e.toRefs(o),N=$("vv-checkbox",P,e.computed((()=>({switch:p.value,valid:c.value,invalid:f.value,disabled:d.value,readonly:s.value,indeterminate:b.value}))));e.watchEffect((()=>{L.value&&Array.isArray(m.value)&&console.warn("[VvCheckbox] The model value is an array but the component is in binary mode.")})),e.watch((()=>C.value),(e=>{k.value.indeterminate=!!e})),e.onMounted((()=>{C.value&&(k.value.indeterminate=!0)}));const{HintSlot:E,hasHintLabelOrSlot:_,hasInvalidLabelOrSlot:z,hintSlotScope:G}=v(o,n);return(l,t)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(e.unref(N)),for:e.unref(g)},[e.withDirectives(e.createElementVNode("input",{id:e.unref(g),ref_key:"input",ref:k,"onUpdate:modelValue":t[0]||(t[0]=l=>e.isRef(j)?j.value=l:null),type:"checkbox",class:"vv-checkbox__input",name:l.name,disabled:e.unref(B),value:e.unref(R),tabindex:e.unref(S),"aria-invalid":e.unref(V),"aria-describedby":e.unref(_)?e.unref(y):void 0,"aria-errormessage":e.unref(z)?e.unref(y):void 0},null,8,w),[[e.vModelCheckbox,e.unref(j)]]),e.renderSlot(l.$slots,"default",{value:e.unref(m)},(()=>[e.createTextVNode(e.toDisplayString(l.label),1)])),e.createVNode(e.unref(E),{id:e.unref(y),class:"vv-checkbox__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(G))))])),key:"3"}:void 0]),1032,["id"])],10,A))}}),R=V;const j=["textContent"],P={class:"vv-checkbox-group__wrapper"};return e.defineComponent({name:"VvCheckboxGroup",props:R,emits:["update:modelValue","change"],setup(l,{emit:a}){const o=l,n=e.useSlots(),r=t.useVModel(o,"modelValue",a),{disabled:u,readonly:d,vertical:s,valid:c,invalid:f,modifiers:p}=e.toRefs(o);!function(l){if(Object.keys(l).some((t=>"key"!==t&&!e.isRef(l[t]))))throw Error("One or more groupState props aren't ref.");e.provide(l.key,e.computed((()=>l)))}({key:i,modelValue:r,disabled:u,readonly:d,valid:c,invalid:f});const{getOptionLabel:m,getOptionValue:b}=function(l){const{options:t,labelKey:a,valueKey:o,disabledKey:n}=e.toRefs(l);return{options:t,getOptionLabel:e=>"object"!=typeof e&&null!==e?e:String("function"==typeof a.value?a.value(e):e[a.value]),getOptionValue:e=>"object"!=typeof e&&null!==e?e:"function"==typeof o.value?o.value(e):e[o.value],getOptionDisabled:e=>("object"==typeof e||null===e)&&("function"==typeof n.value?n.value(e):e[n.value]),getOptionGrouped:e=>"object"!=typeof e&&null!==e?[]:e.options||[]}}(o),h=$("vv-checkbox-group",p,e.computed((()=>({disabled:u.value,readonly:d.value,horizontal:!s.value,valid:c.value,invalid:f.value})))),{HintSlot:g,hintSlotScope:y}=v(o,n);return(l,t)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(e.unref(h))},[l.label?(e.openBlock(),e.createElementBlock("legend",{key:0,textContent:e.toDisplayString(l.label)},null,8,j)):e.createCommentVNode("",!0),e.createElementVNode("div",P,[l.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,((l,t)=>(e.openBlock(),e.createBlock(C,e.mergeProps({key:t},((e,l)=>({id:`${o.name}_opt${l}`,name:o.name,label:m(e),value:b(e)}))(l,t)),null,16)))),128)):e.renderSlot(l.$slots,"default",{key:1})]),e.createVNode(e.unref(g),{class:"vv-checkbox-group__hint"},e.createSlots({_:2},[l.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"0"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"1"}:void 0,l.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"2"}:void 0,l.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(l.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(y))))])),key:"3"}:void 0]),1024)],2))}})}));