@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31

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 (294) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +106 -10
  3. package/auto-imports.d.ts +7 -2
  4. package/bin/icons.cjs +1 -1
  5. package/bin/icons.js +22 -15
  6. package/dist/Volver.d.ts +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
  8. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  9. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
  10. package/dist/components/VvAccordion/index.d.ts +8 -9
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  13. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
  14. package/dist/components/VvAccordionGroup/index.d.ts +14 -6
  15. package/dist/components/VvAction/VvAction.es.js +78 -27
  16. package/dist/components/VvAction/VvAction.umd.js +1 -1
  17. package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
  18. package/dist/components/VvAction/index.d.ts +25 -9
  19. package/dist/components/VvAlert/VvAlert.es.js +204 -171
  20. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  21. package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
  22. package/dist/components/VvAlert/index.d.ts +17 -9
  23. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
  24. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  25. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
  26. package/dist/components/VvAlertGroup/index.d.ts +6 -14
  27. package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
  28. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  29. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
  30. package/dist/components/VvAvatar/index.d.ts +4 -1
  31. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +118 -48
  32. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  33. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
  34. package/dist/components/VvAvatarGroup/index.d.ts +4 -1
  35. package/dist/components/VvBadge/VvBadge.es.js +78 -28
  36. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  37. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
  38. package/dist/components/VvBadge/index.d.ts +4 -1
  39. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
  40. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  41. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
  42. package/dist/components/VvBreadcrumb/index.d.ts +6 -10
  43. package/dist/components/VvButton/VvButton.es.js +291 -252
  44. package/dist/components/VvButton/VvButton.umd.js +1 -1
  45. package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
  46. package/dist/components/VvButton/index.d.ts +51 -29
  47. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
  48. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  49. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
  50. package/dist/components/VvButtonGroup/index.d.ts +8 -2
  51. package/dist/components/VvCard/VvCard.es.js +86 -36
  52. package/dist/components/VvCard/VvCard.umd.js +1 -1
  53. package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
  54. package/dist/components/VvCard/index.d.ts +4 -1
  55. package/dist/components/VvCheckbox/VvCheckbox.es.js +177 -120
  56. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  57. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
  58. package/dist/components/VvCheckbox/index.d.ts +47 -14
  59. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
  60. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  61. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
  62. package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
  63. package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
  64. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  65. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
  66. package/dist/components/VvCombobox/index.d.ts +62 -26
  67. package/dist/components/VvDialog/VvDialog.es.js +140 -153
  68. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  69. package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
  70. package/dist/components/VvDropdown/VvDropdown.es.js +138 -71
  71. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  72. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
  73. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
  74. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
  75. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
  76. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
  77. package/dist/components/VvDropdown/index.d.ts +52 -10
  78. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
  79. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  80. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
  81. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  82. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
  83. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  84. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
  85. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  86. package/dist/components/VvIcon/VvIcon.es.js +23 -96
  87. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  88. package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
  89. package/dist/components/VvIcon/index.d.ts +33 -48
  90. package/dist/components/VvInputFile/VvInputFile.es.js +1777 -0
  91. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
  92. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
  93. package/dist/components/VvInputFile/index.d.ts +200 -0
  94. package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
  95. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
  96. package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
  97. package/dist/components/VvInputText/VvInputText.es.js +1237 -324
  98. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  99. package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
  100. package/dist/components/VvInputText/index.d.ts +99 -29
  101. package/dist/components/VvNav/VvNav.es.js +135 -56
  102. package/dist/components/VvNav/VvNav.umd.js +1 -1
  103. package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
  104. package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
  105. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
  106. package/dist/components/VvNav/index.d.ts +5 -2
  107. package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
  108. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  109. package/dist/components/VvProgress/VvProgress.es.js +72 -26
  110. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  111. package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
  112. package/dist/components/VvProgress/index.d.ts +4 -1
  113. package/dist/components/VvRadio/VvRadio.es.js +160 -103
  114. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  115. package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
  116. package/dist/components/VvRadio/index.d.ts +50 -17
  117. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
  118. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  119. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
  120. package/dist/components/VvRadioGroup/index.d.ts +45 -12
  121. package/dist/components/VvSelect/VvSelect.es.js +251 -238
  122. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  123. package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
  124. package/dist/components/VvSelect/index.d.ts +48 -14
  125. package/dist/components/VvTab/VvTab.es.js +191 -75
  126. package/dist/components/VvTab/VvTab.umd.js +1 -1
  127. package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
  128. package/dist/components/VvTab/index.d.ts +4 -1
  129. package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
  130. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  131. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
  132. package/dist/components/VvTextarea/index.d.ts +68 -19
  133. package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
  134. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  135. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
  136. package/dist/components/VvTooltip/index.d.ts +5 -2
  137. package/dist/components/common/HintSlot.d.ts +1 -1
  138. package/dist/components/index.d.ts +10 -0
  139. package/dist/components/index.es.js +3534 -1650
  140. package/dist/components/index.umd.js +1 -1
  141. package/dist/composables/alert/useAlert.d.ts +99 -4
  142. package/dist/composables/alert/useInjectAlert.d.ts +1 -6
  143. package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
  144. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
  145. package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
  146. package/dist/composables/group/useProvideGroupState.d.ts +3 -3
  147. package/dist/composables/index.d.ts +1 -0
  148. package/dist/composables/index.es.js +92 -3
  149. package/dist/composables/index.umd.js +1 -1
  150. package/dist/composables/useBlurhash.d.ts +7 -0
  151. package/dist/composables/useComponentIcon.d.ts +9 -8
  152. package/dist/composables/usePersistence.d.ts +2 -0
  153. package/dist/composables/useVolver.d.ts +1 -1
  154. package/dist/constants.d.ts +34 -32
  155. package/dist/directives/index.d.ts +3 -5
  156. package/dist/directives/index.es.js +99 -43
  157. package/dist/directives/index.umd.js +1 -1
  158. package/dist/directives/v-tooltip.es.js +97 -38
  159. package/dist/directives/v-tooltip.umd.js +1 -1
  160. package/dist/icons.es.js +267 -267
  161. package/dist/icons.umd.js +1 -1
  162. package/dist/index.d.ts +3 -1
  163. package/dist/index.es.js +90 -16
  164. package/dist/index.umd.js +1 -1
  165. package/dist/props/index.d.ts +272 -81
  166. package/dist/resolvers/unplugin.d.ts +6 -1
  167. package/dist/resolvers/unplugin.es.js +87 -10
  168. package/dist/resolvers/unplugin.umd.js +1 -1
  169. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
  170. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
  171. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
  172. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  173. package/dist/stories/Button/Button.settings.d.ts +0 -1
  174. package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
  175. package/dist/stories/Icon/Icon.settings.d.ts +1 -0
  176. package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
  177. package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
  178. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  179. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  180. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  181. package/dist/stories/Tab/Tab.settings.d.ts +2 -15
  182. package/dist/test/expect.d.ts +1 -1
  183. package/dist/types/alert.d.ts +9 -7
  184. package/dist/types/blurhash.d.ts +12 -0
  185. package/dist/types/generic.d.ts +1 -2
  186. package/dist/types/group.d.ts +37 -15
  187. package/dist/types/index.d.ts +7 -0
  188. package/dist/types/input-file.d.ts +16 -0
  189. package/dist/types/nav.d.ts +2 -2
  190. package/dist/utils/ObjectUtilities.d.ts +0 -1
  191. package/dist/workers/blurhash.d.ts +1 -0
  192. package/package.json +78 -78
  193. package/src/Volver.ts +31 -20
  194. package/src/assets/icons/detailed.json +1 -1
  195. package/src/assets/icons/normal.json +1 -1
  196. package/src/assets/icons/simple.json +1 -1
  197. package/src/components/VvAccordion/VvAccordion.vue +121 -58
  198. package/src/components/VvAccordion/index.ts +8 -23
  199. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
  200. package/src/components/VvAccordionGroup/index.ts +6 -6
  201. package/src/components/VvAction/VvAction.vue +17 -5
  202. package/src/components/VvAlert/index.ts +14 -9
  203. package/src/components/VvAlertGroup/index.ts +3 -15
  204. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  205. package/src/components/VvBreadcrumb/index.ts +2 -8
  206. package/src/components/VvButton/VvButton.vue +17 -7
  207. package/src/components/VvButton/index.ts +9 -16
  208. package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
  209. package/src/components/VvCheckbox/index.ts +2 -2
  210. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
  211. package/src/components/VvCombobox/VvCombobox.vue +15 -12
  212. package/src/components/VvCombobox/index.ts +4 -0
  213. package/src/components/VvDropdown/VvDropdown.vue +11 -2
  214. package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
  215. package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
  216. package/src/components/VvDropdown/index.ts +35 -1
  217. package/src/components/VvIcon/VvIcon.vue +2 -2
  218. package/src/components/VvIcon/index.ts +35 -48
  219. package/src/components/VvInputFile/VvInputFile.vue +395 -0
  220. package/src/components/VvInputFile/index.ts +135 -0
  221. package/src/components/VvInputText/VvInputClearAction.ts +10 -6
  222. package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
  223. package/src/components/VvInputText/VvInputText.vue +141 -33
  224. package/src/components/VvInputText/index.ts +31 -16
  225. package/src/components/VvNav/VvNav.vue +4 -2
  226. package/src/components/VvRadio/index.ts +5 -5
  227. package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
  228. package/src/components/VvSelect/VvSelect.vue +5 -8
  229. package/src/components/VvTab/VvTab.vue +5 -1
  230. package/src/components/VvTextarea/VvTextarea.vue +6 -9
  231. package/src/components/index.ts +10 -0
  232. package/src/composables/alert/useAlert.ts +12 -9
  233. package/src/composables/dropdown/useProvideDropdown.ts +4 -4
  234. package/src/composables/group/useInjectedGroupState.ts +20 -16
  235. package/src/composables/group/useProvideGroupState.ts +10 -15
  236. package/src/composables/index.ts +1 -0
  237. package/src/composables/useBlurhash.ts +76 -0
  238. package/src/composables/useComponentIcon.ts +15 -14
  239. package/src/composables/usePersistence.ts +76 -0
  240. package/src/composables/useUniqueId.ts +2 -2
  241. package/src/constants.ts +47 -32
  242. package/src/directives/index.ts +3 -6
  243. package/src/directives/v-tooltip.ts +19 -10
  244. package/src/index.ts +3 -1
  245. package/src/props/index.ts +108 -31
  246. package/src/resolvers/unplugin.ts +24 -14
  247. package/src/stories/Accordion/Accordion.test.ts +1 -1
  248. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
  249. package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
  250. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
  251. package/src/stories/Alert/Alert.test.ts +1 -1
  252. package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
  253. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
  254. package/src/stories/Avatar/Avatar.test.ts +1 -1
  255. package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
  256. package/src/stories/Badge/Badge.test.ts +1 -1
  257. package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
  258. package/src/stories/Button/Button.settings.ts +1 -4
  259. package/src/stories/Button/Button.test.ts +1 -1
  260. package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
  261. package/src/stories/Card/Card.test.ts +1 -1
  262. package/src/stories/Checkbox/Checkbox.test.ts +1 -1
  263. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
  264. package/src/stories/Combobox/Combobox.settings.ts +8 -0
  265. package/src/stories/Combobox/Combobox.test.ts +1 -1
  266. package/src/stories/Dialog/Dialog.test.ts +2 -2
  267. package/src/stories/Dropdown/Dropdown.test.ts +1 -1
  268. package/src/stories/Icon/Icon.settings.ts +3 -3
  269. package/src/stories/InputFile/InputFile.settings.ts +36 -0
  270. package/src/stories/InputFile/InputFile.stories.ts +89 -0
  271. package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
  272. package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
  273. package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
  274. package/src/stories/InputText/InputText.test.ts +1 -1
  275. package/src/stories/Nav/Nav.test.ts +1 -1
  276. package/src/stories/Progress/Progress.test.ts +1 -1
  277. package/src/stories/Radio/Radio.test.ts +1 -1
  278. package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
  279. package/src/stories/Select/Select.test.ts +1 -1
  280. package/src/stories/Tab/Tab.settings.ts +2 -2
  281. package/src/stories/Tab/Tab.test.ts +1 -1
  282. package/src/stories/Textarea/Textarea.test.ts +1 -1
  283. package/src/stories/Tooltip/Tooltip.test.ts +1 -1
  284. package/src/stories/argTypes.ts +1 -1
  285. package/src/test/expect.ts +2 -4
  286. package/src/types/alert.ts +11 -7
  287. package/src/types/blurhash.ts +21 -0
  288. package/src/types/generic.ts +3 -3
  289. package/src/types/group.ts +22 -14
  290. package/src/types/index.ts +7 -0
  291. package/src/types/input-file.ts +18 -0
  292. package/src/types/nav.ts +2 -3
  293. package/src/utils/ObjectUtilities.ts +0 -11
  294. package/src/workers/blurhash.ts +9 -0
@@ -1,18 +1,6 @@
1
- import { ModifiersProps } from '@/props'
2
1
  import type { ExtractPropTypes } from 'vue'
3
-
4
- export type AlertItem = {
5
- id: string | number
6
- title?: string
7
- icon?: string | Record<string, unknown>
8
- content?: string
9
- footer?: string
10
- modifiers?: string | string[]
11
- dismissable?: boolean
12
- autoClose?: number
13
- closeLabel?: string
14
- role?: 'alert' | 'alertdialog'
15
- }
2
+ import type { Alert } from '@/types'
3
+ import { ModifiersProps } from '@/props'
16
4
 
17
5
  export const VvAlertGroupProps = {
18
6
  ...ModifiersProps,
@@ -21,7 +9,7 @@ export const VvAlertGroupProps = {
21
9
  required: true,
22
10
  },
23
11
  items: {
24
- type: Array as PropType<AlertItem[]>,
12
+ type: Array as PropType<Alert[]>,
25
13
  default: () => [],
26
14
  },
27
15
  stack: {
@@ -7,46 +7,47 @@
7
7
  <script setup lang="ts">
8
8
  import { useModifiers } from '../../composables/useModifiers'
9
9
  import { VvBreadcrumbProps } from '.'
10
+ import VvAction from '../VvAction/VvAction.vue'
10
11
 
11
12
  const props = defineProps(VvBreadcrumbProps)
12
13
  const { modifiers } = toRefs(props)
13
14
  const bemCssClasses = useModifiers('vv-breadcrumb', modifiers)
15
+ const length = computed(() => props.routes?.length ?? 0)
16
+
17
+ const isLast = (index: number) => index === length.value - 1
14
18
  </script>
15
19
 
16
20
  <template>
17
21
  <nav :class="bemCssClasses" aria-label="breadcrumbs">
18
22
  <ol class="vv-breadcrumb__list">
19
23
  <li
20
- v-for="(route, index) in routes"
21
- :key="`${route.label}-${index}`"
22
- :class="{
23
- 'vv-breadcrumb__item': index < Number(routes?.length) - 1,
24
- 'vv-breadcrumb__item-active':
25
- index === Number(routes?.length) - 1,
26
- }"
24
+ v-for="({ label, ...route }, index) in routes"
25
+ :key="`${label}-${index}`"
26
+ :class="
27
+ !isLast(index)
28
+ ? 'vv-breadcrumb__item'
29
+ : 'vv-breadcrumb__item-active'
30
+ "
27
31
  itemprop="itemListElement"
28
32
  itemtype="https://schema.org/ListItem"
29
33
  itemscope
30
34
  >
31
- <Component
32
- :is="route.to ? 'router-link' : route.href ? 'a' : 'span'"
35
+ <VvAction
33
36
  v-bind="route"
34
- :class="{
35
- 'vv-breadcrumb__link':
36
- index < Number(routes?.length) - 1,
37
- }"
38
- :aria-current="
39
- index === Number(routes?.length) - 1
40
- ? 'page'
41
- : undefined
37
+ :class="
38
+ !isLast(index)
39
+ ? 'vv-breadcrumb__link'
40
+ : 'vv-breadcrumb__label'
42
41
  "
42
+ :aria-current="isLast(index) ? 'page' : undefined"
43
43
  itemprop="item"
44
+ default-tag="span"
44
45
  >
45
46
  <!-- @slot Slot for label -->
46
47
  <slot name="label" v-bind="{ route, index }">
47
- {{ route.label }}
48
+ {{ label }}
48
49
  </slot>
49
- </Component>
50
+ </VvAction>
50
51
  <meta itemprop="position" :content="`${index + 1}`" />
51
52
  </li>
52
53
  </ol>
@@ -1,13 +1,7 @@
1
1
  import { ModifiersProps } from '../../props'
2
-
3
- export interface Route {
4
- label: string
5
- to?: string | { [key: string]: unknown }
6
- title?: string
7
- href?: string
8
- }
2
+ import type { NavItem } from '../../types'
9
3
 
10
4
  export const VvBreadcrumbProps = {
11
5
  ...ModifiersProps,
12
- routes: Array as PropType<Route[]>,
6
+ routes: Array as PropType<NavItem[]>,
13
7
  }
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  export default {
3
3
  name: 'VvButton',
4
+ inheritAttrs: false,
4
5
  }
5
6
  </script>
6
7
 
@@ -74,9 +75,7 @@
74
75
  * @description Define icon attributes.
75
76
  * @returns {Object} The icon attributes.
76
77
  */
77
- const hasIconProps = computed(() =>
78
- typeof icon?.value === 'string' ? { name: icon?.value } : icon?.value,
79
- )
78
+ const { hasIcon } = useComponentIcon(icon)
80
79
 
81
80
  /**
82
81
  * @description Catch click event
@@ -84,6 +83,14 @@
84
83
  const toggleValue = computed(() => {
85
84
  return props.value !== undefined ? props.value : name.value
86
85
  })
86
+ const hasListeners = computed(() => {
87
+ if (!toggle.value) {
88
+ return undefined
89
+ }
90
+ return {
91
+ onClick,
92
+ }
93
+ })
87
94
  const onClick = () => {
88
95
  if (toggle.value) {
89
96
  if (Array.isArray(modelValue.value)) {
@@ -110,6 +117,8 @@
110
117
  <template>
111
118
  <VvAction
112
119
  v-bind="{
120
+ ...attrs,
121
+ ...hasListeners,
113
122
  disabled,
114
123
  pressed,
115
124
  active,
@@ -123,7 +132,6 @@
123
132
  :id="hasId"
124
133
  ref="element"
125
134
  :class="bemCssClasses"
126
- @click="onClick"
127
135
  >
128
136
  <!-- @slot Default slot -->
129
137
  <slot>
@@ -146,9 +154,11 @@
146
154
  <template v-else>
147
155
  <!-- @slot Before label and icon -->
148
156
  <slot name="before" />
149
- <template v-if="icon">
150
- <VvIcon class="vv-button__icon" v-bind="hasIconProps" />
151
- </template>
157
+ <VvIcon
158
+ v-if="hasIcon"
159
+ v-bind="hasIcon"
160
+ class="vv-button__icon"
161
+ />
152
162
  <span v-if="label" class="vv-button__label">
153
163
  <!-- @slot Use this slot for button label -->
154
164
  <slot name="label">
@@ -1,4 +1,4 @@
1
- import type { Ref, PropType, ExtractPropTypes } from 'vue'
1
+ import type { PropType, ExtractPropTypes } from 'vue'
2
2
  import type { ButtonGroupState } from '../../types/group'
3
3
  import {
4
4
  ActionProps,
@@ -6,6 +6,7 @@ import {
6
6
  LoadingProps,
7
7
  ModifiersProps,
8
8
  UnselectableProps,
9
+ IconProps,
9
10
  } from '../../props'
10
11
  import { INJECTION_KEY_BUTTON_GROUP, Side } from '../../constants'
11
12
 
@@ -17,10 +18,7 @@ export const VvButtonProps = {
17
18
  ...ModifiersProps,
18
19
  ...UnselectableProps,
19
20
  ...LoadingProps,
20
- /**
21
- * Button icon
22
- */
23
- icon: [String, Object],
21
+ ...IconProps,
24
22
  /**
25
23
  * Button icon position
26
24
  */
@@ -79,19 +77,14 @@ export function useGroupProps(
79
77
  const { id, iconPosition, icon, label, pressed } = toRefs(props)
80
78
 
81
79
  // group props
82
- const modelValue = getGroupOrLocalRef('modelValue', props, emit) as Ref<
83
- string | number | boolean | (string | number | boolean)[] | undefined
84
- >
85
- const toggle = getGroupOrLocalRef('toggle', props) as Ref<boolean>
86
- const unselectable = getGroupOrLocalRef(
87
- 'unselectable',
88
- props,
89
- ) as Ref<boolean>
90
- const multiple = computed(() => group?.value.multiple.value ?? false)
80
+ const modelValue = getGroupOrLocalRef('modelValue', props, emit)
81
+ const toggle = getGroupOrLocalRef('toggle', props)
82
+ const unselectable = getGroupOrLocalRef('unselectable', props)
83
+ const multiple = computed(() => group?.multiple.value ?? false)
91
84
  // merge local and group modifiers
92
85
  const modifiers = computed(() => {
93
86
  let localModifiers = props.modifiers
94
- let groupModifiers = group?.value.modifiers.value
87
+ let groupModifiers = group?.modifiers.value
95
88
 
96
89
  const toReturn = new Set<string>()
97
90
  if (localModifiers) {
@@ -109,7 +102,7 @@ export function useGroupProps(
109
102
  return Array.from(toReturn)
110
103
  })
111
104
  const disabled = computed(() =>
112
- Boolean(props.disabled || group?.value?.disabled.value),
105
+ Boolean(props.disabled || group?.disabled.value),
113
106
  )
114
107
 
115
108
  return {
@@ -52,8 +52,7 @@
52
52
  })
53
53
 
54
54
  // provide
55
- useProvideGroupState<ButtonGroupState>({
56
- key: INJECTION_KEY_BUTTON_GROUP,
55
+ useProvideGroupState<ButtonGroupState>(INJECTION_KEY_BUTTON_GROUP, {
57
56
  modelValue,
58
57
  disabled,
59
58
  toggle,
@@ -42,10 +42,10 @@ export function useGroupProps(
42
42
  const valid = getGroupOrLocalRef('valid', props) as Ref<boolean>
43
43
  const invalid = getGroupOrLocalRef('invalid', props) as Ref<boolean>
44
44
  const readonly = computed(() =>
45
- Boolean(props.readonly || group?.value?.readonly.value),
45
+ Boolean(props.readonly || group?.readonly.value),
46
46
  )
47
47
  const disabled = computed(() =>
48
- Boolean(props.disabled || group?.value?.disabled.value),
48
+ Boolean(props.disabled || group?.disabled.value),
49
49
  )
50
50
 
51
51
  return {
@@ -29,8 +29,7 @@
29
29
  const { disabled, readonly, vertical, valid, invalid, modifiers } =
30
30
  toRefs(props)
31
31
 
32
- useProvideGroupState<InputGroupState>({
33
- key: INJECTION_KEY_CHECK_GROUP,
32
+ useProvideGroupState<InputGroupState>(INJECTION_KEY_CHECK_GROUP, {
34
33
  modelValue,
35
34
  disabled,
36
35
  readonly,
@@ -87,9 +87,13 @@
87
87
  searchText,
88
88
  computed(() => Number(props.debounceSearch)),
89
89
  )
90
- watch(debouncedSearchText, () =>
91
- emit('change:search', debouncedSearchText.value),
92
- )
90
+ watch(debouncedSearchText, () => {
91
+ emit('update:search', debouncedSearchText.value)
92
+ /**
93
+ * @deprecated change:search should not be used, use update:search instead
94
+ */
95
+ emit('change:search', debouncedSearchText.value)
96
+ })
93
97
 
94
98
  // expanded
95
99
  const expanded = ref(false)
@@ -147,10 +151,7 @@
147
151
  const dropdownEl = ref()
148
152
 
149
153
  // icons
150
- const { hasIcon, hasIconBefore, hasIconAfter } = useComponentIcon(
151
- icon,
152
- iconPosition,
153
- )
154
+ const { hasIconBefore, hasIconAfter } = useComponentIcon(icon, iconPosition)
154
155
 
155
156
  // dirty
156
157
  const isDirty = computed(() => !isEmpty(props.modelValue))
@@ -168,12 +169,12 @@
168
169
  disabled: disabled.value,
169
170
  loading: isLoading.value,
170
171
  readonly: readonly.value,
171
- 'icon-before': Boolean(hasIconBefore.value),
172
- 'icon-after': Boolean(hasIconAfter.value),
172
+ 'icon-before': hasIconBefore.value !== undefined,
173
+ 'icon-after': hasIconAfter.value !== undefined,
173
174
  valid: valid.value,
174
175
  invalid: invalid.value,
175
176
  dirty: isDirty.value,
176
- focus: focused.value,
177
+ focus: focused.value || focusedWithin.value || expanded.value,
177
178
  floating: floating.value,
178
179
  badges: props.badges,
179
180
  })),
@@ -425,8 +426,8 @@
425
426
  <div class="vv-select__inner">
426
427
  <VvIcon
427
428
  v-if="hasIconBefore"
429
+ v-bind="hasIconBefore"
428
430
  class="vv-select__icon"
429
- v-bind="hasIcon"
430
431
  />
431
432
  <div
432
433
  ref="inputEl"
@@ -489,8 +490,8 @@
489
490
  </div>
490
491
  <VvIcon
491
492
  v-if="hasIconAfter"
493
+ v-bind="hasIconAfter"
492
494
  class="vv-select__icon vv-select__icon-after"
493
- v-bind="hasIcon"
494
495
  />
495
496
  </div>
496
497
  <div v-if="$slots.after" class="vv-select__input-after">
@@ -525,6 +526,7 @@
525
526
  }"
526
527
  :key="i"
527
528
  class="vv-dropdown-option"
529
+ focus-on-hover
528
530
  @click.passive="onInput(item)"
529
531
  >
530
532
  <!-- @slot Slot for option customization -->
@@ -555,6 +557,7 @@
555
557
  propsDefaults.selectedHintLabel,
556
558
  }"
557
559
  class="vv-dropdown-option"
560
+ focus-on-hover
558
561
  @click.passive="onInput(option)"
559
562
  >
560
563
  <!-- @slot Slot for option customization -->
@@ -20,6 +20,10 @@ import type { Option } from '../../types/generic'
20
20
 
21
21
  export const VvComboboxEvents = [
22
22
  'update:modelValue',
23
+ 'update:search',
24
+ /**
25
+ * @deprecated change:search should not be used, use update:search instead
26
+ */
23
27
  'change:search',
24
28
  'focus',
25
29
  'blur',
@@ -299,9 +299,7 @@
299
299
  })
300
300
  bus.on('click', toggle)
301
301
 
302
- // provide top dropdown item
303
302
  const { role, modifiers } = toRefs(props)
304
- const { itemRole } = useProvideDropdownItem({ role, expanded })
305
303
 
306
304
  // styles
307
305
  const bemCssClasses = useModifiers(
@@ -376,6 +374,17 @@
376
374
  })
377
375
  }
378
376
 
377
+ // hover
378
+ const hovered = useElementHover(floatingEl)
379
+
380
+ // provide top dropdown item
381
+ const { itemRole } = useProvideDropdownItem({
382
+ role,
383
+ expanded,
384
+ focused,
385
+ hovered,
386
+ })
387
+
379
388
  // keyboard
380
389
  onKeyStroke('Escape', (e) => {
381
390
  if (expanded.value) {
@@ -5,6 +5,9 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
+ import { VvDropdownItemProps } from '.'
9
+
10
+ const props = defineProps(VvDropdownItemProps)
8
11
  const { role, expanded } = useInjectedDropdownItem()
9
12
  const element = ref(null)
10
13
  useProvideDropdownAction({ expanded })
@@ -14,7 +17,7 @@
14
17
 
15
18
  // focus item on hover
16
19
  watch(hovered, (newValue) => {
17
- if (newValue) {
20
+ if (newValue && props.focusOnHover) {
18
21
  focused.value = true
19
22
  }
20
23
  })
@@ -5,30 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
+ import { VvDropdownOptionProps } from '.'
8
9
  import VvDropdownItem from './VvDropdownItem.vue'
9
- import {
10
- DisabledProps,
11
- ModifiersProps,
12
- SelectedProps,
13
- UnselectableProps,
14
- } from '../../props'
15
10
 
16
11
  // props
17
- const props = defineProps({
18
- ...DisabledProps,
19
- ...SelectedProps,
20
- ...UnselectableProps,
21
- ...ModifiersProps,
22
- deselectHintLabel: {
23
- type: String,
24
- },
25
- selectHintLabel: {
26
- type: String,
27
- },
28
- selectedHintLabel: {
29
- type: String,
30
- },
31
- })
12
+ const props = defineProps(VvDropdownOptionProps)
32
13
 
33
14
  // style
34
15
  const { modifiers } = toRefs(props)
@@ -52,6 +33,7 @@
52
33
  if (!props.disabled) {
53
34
  return props.selectHintLabel
54
35
  }
36
+ return ''
55
37
  })
56
38
  </script>
57
39
 
@@ -61,6 +43,7 @@
61
43
  :tabindex="disabled ? -1 : 0"
62
44
  :aria-selected="selected"
63
45
  :aria-disabled="disabled"
46
+ :focus-on-hover="focusOnHover"
64
47
  >
65
48
  <slot />
66
49
  <span class="vv-dropdown-option__hint" :title="hintLabel">
@@ -1,5 +1,12 @@
1
1
  import type { PropType } from 'vue'
2
- import { DropdownProps, IdProps, ModifiersProps } from '../../props'
2
+ import {
3
+ DropdownProps,
4
+ IdProps,
5
+ DisabledProps,
6
+ ModifiersProps,
7
+ SelectedProps,
8
+ UnselectableProps,
9
+ } from '../../props'
3
10
  import { DropdownRole } from '../../constants'
4
11
 
5
12
  export const VvDropdownProps = {
@@ -30,3 +37,30 @@ export const VvDropdownProps = {
30
37
  Object.values(DropdownRole).includes(value),
31
38
  },
32
39
  }
40
+
41
+ export const VvDropdownItemProps = {
42
+ focusOnHover: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ }
47
+
48
+ export const VvDropdownOptionProps = {
49
+ ...DisabledProps,
50
+ ...SelectedProps,
51
+ ...UnselectableProps,
52
+ ...ModifiersProps,
53
+ deselectHintLabel: {
54
+ type: String,
55
+ },
56
+ selectHintLabel: {
57
+ type: String,
58
+ },
59
+ selectedHintLabel: {
60
+ type: String,
61
+ },
62
+ focusOnHover: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ }
@@ -6,10 +6,10 @@
6
6
 
7
7
  <script setup lang="ts">
8
8
  import { Icon, addIcon, iconExists } from '@iconify/vue'
9
- import { VvIconProps } from '.'
9
+ import { type VvIconProps, VvIconPropsDefaults } from '.'
10
10
 
11
11
  // props
12
- const props = defineProps(VvIconProps)
12
+ const props = withDefaults(defineProps<VvIconProps>(), VvIconPropsDefaults)
13
13
 
14
14
  const hasRotate = computed(() => {
15
15
  if (typeof props.rotate === 'string') {
@@ -1,71 +1,56 @@
1
- import type { PropType } from 'vue'
2
1
  import type { IconifyIconOnLoad, IconifyRenderMode } from '@iconify/vue'
3
2
 
3
+ export const ACTION_ICONS = {
4
+ showPassword: 'eye-on',
5
+ hidePassword: 'eye-off',
6
+ showDatePicker: 'calendar',
7
+ showTimePicker: 'time',
8
+ showColorPicker: 'color',
9
+ clear: 'close',
10
+ add: 'add',
11
+ remove: 'trash',
12
+ edit: 'edit',
13
+ download: 'download',
14
+ } as const
15
+
4
16
  export enum IconPrefix {
5
17
  simple = 'simple',
6
18
  normal = 'normal',
7
19
  detailed = 'detailed',
8
20
  }
9
21
 
10
- export const VvIconProps = {
11
- /**
12
- * Color
13
- */
14
- color: String,
15
- /**
16
- * Width
17
- */
18
- width: {
19
- type: [String, Number],
20
- },
21
- /**
22
- * Height
23
- */
24
- height: {
25
- type: [String, Number],
26
- },
22
+ export type VvIconProps = {
27
23
  /**
28
24
  * Icon name
29
25
  * Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
30
26
  * https://docs.iconify.design/api/providers.html#provider-in-icon-name
31
27
  */
32
- name: {
33
- type: String,
34
- required: true,
35
- },
28
+ name: string
29
+ color?: string
30
+ width?: string | number
31
+ height?: string | number
36
32
  /**
37
- * By default 'vv'
38
33
  * If custom collection is not added with "addCollection" DS class method, this prop could not be used
39
34
  * Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
40
35
  */
41
- provider: {
42
- type: String,
43
- },
36
+ provider?: string
44
37
  /**
38
+ * @default 'normal'
45
39
  * The name of icon set.
46
40
  * Icon default options prefix: simple | normal | detailed
47
41
  */
48
- prefix: {
49
- type: String as PropType<`${IconPrefix}` | string>,
50
- default: 'normal',
51
- },
42
+ prefix?: IconPrefix | string
52
43
  /**
53
44
  * Url remote SVG icon
54
45
  */
55
- src: String,
56
- /**
57
- * Horizontal flip
58
- */
59
- horizontalFlip: Boolean,
60
- /**
61
- * Vertical flip
62
- */
63
- verticalFlip: Boolean,
46
+ src?: string
47
+ horizontalFlip?: boolean
48
+ verticalFlip?: boolean
64
49
  /**
65
50
  * String alternative to "horizontalFlip" and "verticalFlip".
66
51
  * Example: https://docs.iconify.design/icon-components/vue/transform.html
67
52
  */
68
- flip: String,
53
+ flip?: string
69
54
  /**
70
55
  * Icon render mode
71
56
  * 'style' = 'bg' or 'mask', depending on icon content
@@ -74,30 +59,32 @@ export const VvIconProps = {
74
59
  * 'svg' = svg
75
60
  * Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
76
61
  */
77
- mode: String as PropType<`${IconifyRenderMode}`>,
62
+ mode?: IconifyRenderMode
78
63
  /**
79
64
  * Toggles inline or block mode
80
65
  * Example https://docs.iconify.design/icon-components/vue/inline.html
81
66
  */
82
- inline: Boolean,
67
+ inline?: boolean
83
68
  /**
84
69
  * rotates icon
85
70
  * Example https://docs.iconify.design/icon-components/vue/transform.html
86
71
  */
87
- rotate: [Number, String],
72
+ rotate?: number | string
88
73
  /**
89
74
  * A callback that is called when icon data has been loaded
90
75
  */
91
- onLoad: Function as PropType<IconifyIconOnLoad>,
76
+ onLoad?: IconifyIconOnLoad
92
77
  /**
93
78
  * SVG icon string
94
79
  */
95
- svg: String,
80
+ svg?: string
96
81
  /**
97
82
  * Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
98
83
  * @values string | string[]
99
84
  */
100
- modifiers: {
101
- type: [String, Array] as PropType<string | string[]>,
102
- },
85
+ modifiers?: string | string[]
86
+ }
87
+
88
+ export const VvIconPropsDefaults = {
89
+ prefix: IconPrefix.normal,
103
90
  }