@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2

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 (215) hide show
  1. package/README.md +2 -2
  2. package/auto-imports.d.ts +12 -3
  3. package/bin/icons.cjs +1 -73
  4. package/dist/Volver.d.ts +19 -11
  5. package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  8. package/dist/components/VvAccordion/index.d.ts +8 -3
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  12. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  13. package/dist/components/VvAction/VvAction.es.js +276 -98
  14. package/dist/components/VvAction/VvAction.umd.js +1 -1
  15. package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
  16. package/dist/components/VvAction/index.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +213 -44
  18. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  19. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  20. package/dist/components/VvBadge/index.d.ts +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  24. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  25. package/dist/components/VvButton/VvButton.es.js +646 -360
  26. package/dist/components/VvButton/VvButton.umd.js +1 -1
  27. package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
  28. package/dist/components/VvButton/index.d.ts +13 -13
  29. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
  30. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  31. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  32. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  33. package/dist/components/VvCard/VvCard.es.js +57 -38
  34. package/dist/components/VvCard/VvCard.umd.js +1 -1
  35. package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
  36. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  37. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  38. package/dist/components/VvCheckbox/index.d.ts +5 -5
  39. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  42. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  43. package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
  44. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  45. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
  46. package/dist/components/VvCombobox/index.d.ts +41 -10
  47. package/dist/components/VvDialog/VvDialog.es.js +387 -141
  48. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  49. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  50. package/dist/components/VvDialog/index.d.ts +4 -1
  51. package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
  52. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  53. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
  54. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
  55. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  56. package/dist/components/VvDropdown/index.d.ts +40 -11
  57. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
  58. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  59. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
  60. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  61. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
  62. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  63. package/dist/components/VvIcon/VvIcon.es.js +113 -65
  64. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  65. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  66. package/dist/components/VvIcon/index.d.ts +2 -2
  67. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  69. package/dist/components/VvInputText/VvInputText.es.js +986 -462
  70. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  71. package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
  72. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  73. package/dist/components/VvInputText/index.d.ts +66 -13
  74. package/dist/components/VvProgress/VvProgress.es.js +216 -45
  75. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  76. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  77. package/dist/components/VvProgress/index.d.ts +1 -1
  78. package/dist/components/VvRadio/VvRadio.es.js +499 -238
  79. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  80. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  81. package/dist/components/VvRadio/index.d.ts +5 -5
  82. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
  83. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  84. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  85. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  86. package/dist/components/VvSelect/VvSelect.es.js +631 -324
  87. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  88. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  89. package/dist/components/VvSelect/index.d.ts +3 -3
  90. package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
  91. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  92. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
  93. package/dist/components/VvTextarea/index.d.ts +4 -4
  94. package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
  95. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  96. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  97. package/dist/components/VvTooltip/index.d.ts +2 -2
  98. package/dist/components/index.es.js +3522 -2231
  99. package/dist/components/index.umd.js +1 -1
  100. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  101. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  102. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  103. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  104. package/dist/composables/useComponentFocus.d.ts +1 -1
  105. package/dist/composables/useComponentIcon.d.ts +7 -7
  106. package/dist/composables/useDebouncedInput.d.ts +4 -1
  107. package/dist/composables/useDefaults.d.ts +2 -0
  108. package/dist/composables/useModifiers.d.ts +1 -1
  109. package/dist/composables/useOptions.d.ts +2 -2
  110. package/dist/composables/useTextCount.d.ts +3 -3
  111. package/dist/composables/useUniqueId.d.ts +1 -1
  112. package/dist/composables/useVolver.d.ts +1 -1
  113. package/dist/directives/index.d.ts +1 -0
  114. package/dist/directives/index.es.js +264 -55
  115. package/dist/directives/index.umd.js +1 -1
  116. package/dist/directives/v-contextmenu.d.ts +3 -0
  117. package/dist/directives/v-contextmenu.es.js +42 -0
  118. package/dist/directives/v-contextmenu.umd.js +1 -0
  119. package/dist/directives/v-tooltip.es.js +222 -53
  120. package/dist/directives/v-tooltip.umd.js +1 -1
  121. package/dist/icons.d.ts +3 -1
  122. package/dist/icons.es.js +40 -23
  123. package/dist/icons.umd.js +1 -1
  124. package/dist/index.d.ts +0 -1
  125. package/dist/index.es.js +112 -3607
  126. package/dist/index.umd.js +1 -1
  127. package/dist/props/index.d.ts +50 -18
  128. package/dist/resolvers/unplugin.d.ts +7 -1
  129. package/dist/resolvers/unplugin.es.js +77 -37
  130. package/dist/resolvers/unplugin.umd.js +1 -1
  131. package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
  132. package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
  133. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  134. package/dist/stories/argTypes.d.ts +13 -1
  135. package/package.json +126 -40
  136. package/src/Volver.ts +49 -22
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  141. package/src/components/VvAccordion/index.ts +12 -4
  142. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  143. package/src/components/VvAccordionGroup/index.ts +8 -0
  144. package/src/components/VvAction/VvAction.vue +7 -7
  145. package/src/components/VvAction/index.ts +1 -1
  146. package/src/components/VvBadge/VvBadge.vue +2 -2
  147. package/src/components/VvBadge/index.ts +1 -1
  148. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  149. package/src/components/VvButton/VvButton.vue +11 -11
  150. package/src/components/VvButton/index.ts +10 -9
  151. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  152. package/src/components/VvButtonGroup/index.ts +1 -1
  153. package/src/components/VvCard/VvCard.vue +2 -2
  154. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  155. package/src/components/VvCheckbox/index.ts +11 -7
  156. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  157. package/src/components/VvCheckboxGroup/index.ts +1 -1
  158. package/src/components/VvCombobox/VvCombobox.vue +44 -26
  159. package/src/components/VvCombobox/index.ts +1 -1
  160. package/src/components/VvDialog/VvDialog.vue +28 -11
  161. package/src/components/VvDialog/index.ts +5 -2
  162. package/src/components/VvDropdown/VvDropdown.vue +7 -5
  163. package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
  164. package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
  165. package/src/components/VvDropdown/index.ts +3 -3
  166. package/src/components/VvIcon/VvIcon.vue +3 -3
  167. package/src/components/VvIcon/index.ts +3 -3
  168. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  169. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  170. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  171. package/src/components/VvInputText/VvInputText.vue +130 -37
  172. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  173. package/src/components/VvInputText/index.ts +62 -1
  174. package/src/components/VvProgress/VvProgress.vue +2 -2
  175. package/src/components/VvProgress/index.ts +1 -1
  176. package/src/components/VvRadio/VvRadio.vue +3 -7
  177. package/src/components/VvRadio/index.ts +11 -7
  178. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  179. package/src/components/VvRadioGroup/index.ts +1 -1
  180. package/src/components/VvSelect/VvSelect.vue +4 -4
  181. package/src/components/VvSelect/index.ts +1 -1
  182. package/src/components/VvTextarea/VvTextarea.vue +6 -6
  183. package/src/components/VvTextarea/index.ts +1 -1
  184. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  185. package/src/components/VvTooltip/index.ts +3 -3
  186. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  187. package/src/composables/dropdown/useProvideDropdown.ts +2 -2
  188. package/src/composables/group/useInjectedGroupState.ts +1 -1
  189. package/src/composables/group/useProvideGroupState.ts +1 -1
  190. package/src/composables/useComponentIcon.ts +1 -1
  191. package/src/composables/useDebouncedInput.ts +10 -3
  192. package/src/composables/useDefaults.ts +89 -0
  193. package/src/composables/useModifiers.ts +4 -2
  194. package/src/composables/useOptions.ts +1 -1
  195. package/src/composables/useVolver.ts +2 -2
  196. package/src/directives/index.ts +3 -1
  197. package/src/directives/v-contextmenu.ts +40 -0
  198. package/src/directives/v-tooltip.ts +2 -2
  199. package/src/icons.ts +1 -1
  200. package/src/index.ts +0 -2
  201. package/src/props/index.ts +20 -10
  202. package/src/resolvers/unplugin.ts +15 -1
  203. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  204. package/src/stories/Accordion/Accordion.test.ts +21 -15
  205. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  206. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  207. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  208. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  209. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
  210. package/src/stories/InputText/InputText.settings.ts +53 -0
  211. package/src/stories/InputText/InputText.stories.mdx +40 -0
  212. package/src/stories/InputText/InputText.test.ts +5 -2
  213. package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
  214. package/src/stories/argTypes.ts +12 -2
  215. package/src/types/group.d.ts +5 -0
@@ -6,11 +6,7 @@
6
6
 
7
7
  <script setup lang="ts">
8
8
  import { nanoid } from 'nanoid'
9
- import {
10
- VvAccordionEvents,
11
- VvAccordionProps,
12
- useGroupProps,
13
- } from '@/components/VvAccordion'
9
+ import { VvAccordionEvents, VvAccordionProps, useGroupProps } from '.'
14
10
 
15
11
  // props, attrs and emit
16
12
  const props = defineProps(VvAccordionProps)
@@ -29,23 +25,28 @@
29
25
  collapse,
30
26
  modelValue,
31
27
  isInGroup,
28
+ not,
32
29
  } = useGroupProps(props, emit)
33
30
  const localModelValue = ref(false)
34
31
  const isOpen = computed({
35
32
  get: () => {
33
+ let toReturn = modelValue.value as boolean
36
34
  if (isInGroup.value) {
37
35
  if (collapse.value && Array.isArray(modelValue.value)) {
38
- return modelValue.value.includes(accordionName.value)
36
+ toReturn = modelValue.value.includes(accordionName.value)
37
+ } else {
38
+ toReturn = modelValue.value === accordionName.value
39
39
  }
40
- return modelValue.value === accordionName.value
40
+ } else if (modelValue.value === undefined) {
41
+ // localModelValue is used when the accordion is not in a group
42
+ toReturn = localModelValue.value
41
43
  }
42
- // localModelValue is used when the accordion is not in a group
43
- if (modelValue.value === undefined) {
44
- return localModelValue.value
45
- }
46
- return modelValue.value as boolean
44
+ return not.value ? !toReturn : toReturn
47
45
  },
48
46
  set: (newValue) => {
47
+ if (not.value) {
48
+ newValue = !newValue
49
+ }
49
50
  if (isInGroup.value) {
50
51
  if (collapse.value && Array.isArray(modelValue.value)) {
51
52
  if (newValue) {
@@ -73,7 +74,7 @@
73
74
  })
74
75
 
75
76
  // styles
76
- const bemCssClasses = useBemModifiers(
77
+ const bemCssClasses = useModifiers(
77
78
  'vv-accordion',
78
79
  modifiers,
79
80
  computed(() => ({
@@ -86,25 +87,21 @@
86
87
  </script>
87
88
 
88
89
  <template>
89
- <details
90
- :id="accordionName"
91
- :class="bemCssClasses"
92
- :open="isOpen"
93
- @click.prevent="onClick()"
94
- >
90
+ <details :id="accordionName" :class="bemCssClasses" :open="isOpen">
95
91
  <summary
96
92
  :aria-controls="accordionName"
97
93
  :aria-expanded="isOpen"
98
- class="vv-collapse__summary"
94
+ class="vv-accordion__summary"
95
+ @click.prevent="onClick()"
99
96
  >
100
97
  <!-- @slot Slot for title -->
101
98
  <slot name="summary" v-bind="{ open: isOpen }">
102
99
  {{ title }}
103
100
  </slot>
104
101
  </summary>
105
- <div :aria-hidden="!isOpen" class="vv-collapse__content">
102
+ <div :aria-hidden="!isOpen" class="vv-accordion__content">
106
103
  <!-- @slot Slot for content -->
107
- <slot name="details" v-bind="{ open: isOpen }">
104
+ <slot name="default" v-bind="{ open: isOpen }">
108
105
  {{ content }}
109
106
  </slot>
110
107
  </div>
@@ -1,6 +1,6 @@
1
1
  import type { ExtractPropTypes, Ref } from 'vue'
2
- import type { AccordionGroupState } from '@/types/group'
3
- import { INJECTION_KEY_ACCORDION_GROUP } from '@/constants'
2
+ import type { AccordionGroupState } from '../../types/group'
3
+ import { INJECTION_KEY_ACCORDION_GROUP } from '../../constants'
4
4
 
5
5
  export const VvAccordionProps = {
6
6
  /**
@@ -30,6 +30,10 @@ export const VvAccordionProps = {
30
30
  * If true, the accordion will be disabled
31
31
  */
32
32
  disabled: Boolean,
33
+ /**
34
+ * If true, the accordion will be opened by default
35
+ */
36
+ not: Boolean,
33
37
  }
34
38
 
35
39
  export const VvAccordionEvents = ['update:modelValue']
@@ -52,20 +56,24 @@ export function useGroupProps(
52
56
 
53
57
  // group props
54
58
  const modelValue = getGroupOrLocalRef('modelValue', props, emit)
55
- const disabled = getGroupOrLocalRef('disabled', props) as Ref<boolean>
59
+ const not = getGroupOrLocalRef('not', props) as Ref<boolean>
56
60
  const collapse = getGroupOrLocalRef('collapse', props) as Ref<boolean>
57
61
  const modifiers = getGroupOrLocalRef('modifiers', props) as Ref<
58
62
  Array<string> | string
59
63
  >
64
+ const disabled = computed(() =>
65
+ Boolean(props.disabled || group?.value?.disabled.value),
66
+ )
60
67
 
61
68
  return {
62
69
  // group props
63
70
  modelValue,
64
- disabled,
71
+ not,
65
72
  isInGroup,
66
73
  group,
67
74
  collapse,
68
75
  modifiers,
76
+ disabled,
69
77
  // local props
70
78
  title,
71
79
  content,
@@ -6,20 +6,17 @@
6
6
 
7
7
  <script setup lang="ts">
8
8
  import type { Ref } from 'vue'
9
- import type { AccordionGroupState } from '@/types/group'
10
- import { INJECTION_KEY_ACCORDION_GROUP } from '@/constants'
11
- import VvAccordion from '@/components/VvAccordion/VvAccordion.vue'
12
- import {
13
- VvAccordionGroupProps,
14
- VvAccordionGroupEvents,
15
- } from '@/components/VvAccordionGroup/'
9
+ import type { AccordionGroupState } from '../../types/group'
10
+ import { INJECTION_KEY_ACCORDION_GROUP } from '../../constants'
11
+ import VvAccordion from '../VvAccordion/VvAccordion.vue'
12
+ import { VvAccordionGroupProps, VvAccordionGroupEvents } from '.'
16
13
 
17
14
  // props and emit
18
15
  const props = defineProps(VvAccordionGroupProps)
19
16
  const emit = defineEmits(VvAccordionGroupEvents)
20
17
 
21
18
  // data
22
- const { disabled, collapse, modifiers, itemModifiers, items } =
19
+ const { disabled, collapse, modifiers, itemModifiers, items, not } =
23
20
  toRefs(props)
24
21
  watchEffect(() => {
25
22
  if (typeof props.modelValue === 'string' && collapse.value) {
@@ -29,7 +26,18 @@
29
26
  )
30
27
  }
31
28
  })
32
- const localModelValue: Ref<string[]> = ref([])
29
+ let localModelValue: Ref<string[]> = ref([])
30
+ watch(
31
+ () => props.storeKey,
32
+ (newKey) => {
33
+ if (newKey) {
34
+ localModelValue = useStorage(newKey, localModelValue.value)
35
+ } else {
36
+ localModelValue = ref([])
37
+ }
38
+ },
39
+ { immediate: true },
40
+ )
33
41
  const modelValue = computed({
34
42
  get: () => {
35
43
  if (props.modelValue !== undefined) {
@@ -67,10 +75,11 @@
67
75
  disabled,
68
76
  collapse,
69
77
  modifiers: itemModifiers,
78
+ not,
70
79
  })
71
80
 
72
81
  // styles
73
- const bemCssClasses = useBemModifiers(
82
+ const bemCssClasses = useModifiers(
74
83
  'vv-accordion-group',
75
84
  modifiers,
76
85
  computed(() => ({
@@ -35,6 +35,14 @@ export const VvAccordionGroupProps = {
35
35
  * If true, the accordion items will be disabled
36
36
  */
37
37
  disabled: Boolean,
38
+ /**
39
+ * If true, the accordion items will be opened by default
40
+ */
41
+ not: Boolean,
42
+ /**
43
+ * Enable local storage persistence
44
+ */
45
+ storeKey: String,
38
46
  }
39
47
 
40
48
  export const VvAccordionGroupEvents = ['update:modelValue']
@@ -5,12 +5,12 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import { VvActionProps, VvActionEvents } from '@/components/VvAction'
9
- import { ActionTag } from '@/constants'
8
+ import { VvActionProps, VvActionEvents } from '.'
9
+ import { ActionTag } from '../../constants'
10
10
 
11
- // props and emits
11
+ // props and emit
12
12
  const props = defineProps(VvActionProps)
13
- const emits = defineEmits(VvActionEvents)
13
+ const emit = defineEmits(VvActionEvents)
14
14
 
15
15
  // inject plugin
16
16
  const volver = useVolver()
@@ -102,7 +102,7 @@
102
102
  return
103
103
  }
104
104
  dropdownEventBus?.emit('click', e)
105
- emits('click', e)
105
+ emit('click', e)
106
106
  }
107
107
 
108
108
  /**
@@ -110,7 +110,7 @@
110
110
  */
111
111
  const onMouseover = (e: Event) => {
112
112
  dropdownEventBus?.emit('mouseover', e)
113
- emits('mouseover', e)
113
+ emit('mouseover', e)
114
114
  }
115
115
 
116
116
  /**
@@ -118,7 +118,7 @@
118
118
  */
119
119
  const onMouseleave = (e: Event) => {
120
120
  dropdownEventBus?.emit('mouseleave', e)
121
- emits('mouseleave', e)
121
+ emit('mouseleave', e)
122
122
  }
123
123
  </script>
124
124
 
@@ -1,4 +1,4 @@
1
- import { ActionProps } from '@/props'
1
+ import { ActionProps } from '../../props'
2
2
 
3
3
  export const VvActionEvents = ['click', 'mouseover', 'mouseleave']
4
4
 
@@ -5,11 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import { VvBadgeProps } from '@/components/VvBadge'
8
+ import { VvBadgeProps } from '.'
9
9
 
10
10
  const props = defineProps(VvBadgeProps)
11
11
  const { modifiers } = toRefs(props)
12
- const bemCssClasses = useBemModifiers('vv-badge', modifiers)
12
+ const bemCssClasses = useModifiers('vv-badge', modifiers)
13
13
  </script>
14
14
 
15
15
  <template>
@@ -1,4 +1,4 @@
1
- import { ModifiersProps } from '@/props'
1
+ import { ModifiersProps } from '../../props'
2
2
 
3
3
  export const VvBadgeProps = {
4
4
  ...ModifiersProps,
@@ -5,12 +5,12 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import { useBemModifiers } from '@/composables/useModifiers'
9
- import { VvBreadcrumbProps } from '@/components/VvBreadcrumb'
8
+ import { useModifiers } from '../../composables/useModifiers'
9
+ import { VvBreadcrumbProps } from '.'
10
10
 
11
11
  const props = defineProps(VvBreadcrumbProps)
12
12
  const { modifiers } = toRefs(props)
13
- const bemCssClasses = useBemModifiers('vv-breadcrumb', modifiers)
13
+ const bemCssClasses = useModifiers('vv-breadcrumb', modifiers)
14
14
  </script>
15
15
 
16
16
  <template>
@@ -5,14 +5,10 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import VvIcon from '@/components/VvIcon/VvIcon.vue'
9
- import VvAction from '@/components/VvAction/VvAction.vue'
10
- import {
11
- VvButtonEvents,
12
- VvButtonProps,
13
- useGroupProps,
14
- } from '@/components/VvButton'
15
- import { Side } from '@/constants'
8
+ import VvIcon from '../VvIcon/VvIcon.vue'
9
+ import VvAction from '../VvAction/VvAction.vue'
10
+ import { VvButtonEvents, VvButtonProps, useGroupProps } from '.'
11
+ import { Side } from '../../constants'
16
12
 
17
13
  // props, attrs, slots and emit
18
14
  const props = defineProps(VvButtonProps)
@@ -58,12 +54,16 @@
58
54
  * @description Define component classes with BEM style.
59
55
  * @returns {Array} The component classes.
60
56
  */
61
- const bemCssClasses = useBemModifiers(
57
+ const bemCssClasses = useModifiers(
62
58
  'vv-button',
63
59
  modifiers,
64
60
  computed(() => ({
65
- reverse: [Side.right, Side.bottom].includes(iconPosition.value),
66
- column: [Side.top, Side.bottom].includes(iconPosition.value),
61
+ reverse: [Side.right, Side.bottom].includes(
62
+ iconPosition.value as Side,
63
+ ),
64
+ column: [Side.top, Side.bottom].includes(
65
+ iconPosition.value as Side,
66
+ ),
67
67
  'icon-only': Boolean(
68
68
  icon?.value && !label?.value && !slots.default,
69
69
  ),
@@ -1,13 +1,13 @@
1
1
  import type { Ref, PropType, ExtractPropTypes } from 'vue'
2
- import type { ButtonGroupState } from '@/types/group'
2
+ import type { ButtonGroupState } from '../../types/group'
3
3
  import {
4
4
  ActionProps,
5
5
  IdProps,
6
6
  LoadingProps,
7
7
  ModifiersProps,
8
8
  UnselectableProps,
9
- } from '@/props'
10
- import { INJECTION_KEY_BUTTON_GROUP, Side } from '@/constants'
9
+ } from '../../props'
10
+ import { INJECTION_KEY_BUTTON_GROUP, Side } from '../../constants'
11
11
 
12
12
  export const VvButtonEvents = ['update:modelValue']
13
13
 
@@ -25,7 +25,7 @@ export const VvButtonProps = {
25
25
  * Button icon position
26
26
  */
27
27
  iconPosition: {
28
- type: String as PropType<Side>,
28
+ type: String as PropType<`${Side}`>,
29
29
  default: Side.left,
30
30
  validator: (value: Side) => Object.values(Side).includes(value),
31
31
  },
@@ -66,14 +66,12 @@ export function useGroupProps(
66
66
  const modelValue = getGroupOrLocalRef('modelValue', props, emit) as Ref<
67
67
  string | Array<string> | undefined
68
68
  >
69
- const disabled = getGroupOrLocalRef('disabled', props) as Ref<boolean>
70
69
  const toggle = getGroupOrLocalRef('toggle', props) as Ref<boolean>
71
70
  const unselectable = getGroupOrLocalRef(
72
71
  'unselectable',
73
72
  props,
74
73
  ) as Ref<boolean>
75
- const multiple = group?.value?.multiple ?? ref(false)
76
-
74
+ const multiple = computed(() => group?.value.multiple.value ?? false)
77
75
  const modifiers = computed(() => {
78
76
  const localValue = localModifiers?.value
79
77
  ? Array.isArray(localModifiers.value)
@@ -87,19 +85,22 @@ export function useGroupProps(
87
85
  : []
88
86
  return [...localValue, ...groupValue]
89
87
  })
88
+ const disabled = computed(() =>
89
+ Boolean(props.disabled || group?.value?.disabled.value),
90
+ )
90
91
 
91
92
  return {
92
93
  // group props
93
94
  group,
94
95
  isInGroup,
95
96
  modelValue,
96
- disabled,
97
97
  toggle,
98
98
  unselectable,
99
99
  multiple,
100
+ modifiers,
101
+ disabled,
100
102
  // local props
101
103
  id,
102
- modifiers,
103
104
  pressed,
104
105
  iconPosition,
105
106
  icon,
@@ -5,12 +5,9 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import type { ButtonGroupState } from '@/types/group'
9
- import { INJECTION_KEY_BUTTON_GROUP } from '@/constants'
10
- import {
11
- VvButtonGroupProps,
12
- VvButtonGroupEvents,
13
- } from '@/components/VvButtonGroup'
8
+ import type { ButtonGroupState } from '../../types/group'
9
+ import { INJECTION_KEY_BUTTON_GROUP } from '../../constants'
10
+ import { VvButtonGroupProps, VvButtonGroupEvents } from '.'
14
11
 
15
12
  // emit and props
16
13
  const emit = defineEmits(VvButtonGroupEvents)
@@ -66,7 +63,7 @@
66
63
  })
67
64
 
68
65
  // style
69
- const bemCssClasses = useBemModifiers('vv-button-group', modifiers)
66
+ const bemCssClasses = useModifiers('vv-button-group', modifiers)
70
67
  </script>
71
68
 
72
69
  <template>
@@ -1,4 +1,4 @@
1
- import { DisabledProps, ModifiersProps, UnselectableProps } from '@/props'
1
+ import { DisabledProps, ModifiersProps, UnselectableProps } from '../../props'
2
2
 
3
3
  export const VvButtonGroupProps = {
4
4
  ...ModifiersProps,
@@ -5,14 +5,14 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import { VvCardProps } from '@/components/VvCard'
8
+ import { VvCardProps } from '.'
9
9
 
10
10
  // props and attrs
11
11
  const props = defineProps(VvCardProps)
12
12
 
13
13
  // styles
14
14
  const { modifiers } = toRefs(props)
15
- const bemCssClasses = useBemModifiers('vv-card', modifiers)
15
+ const bemCssClasses = useModifiers('vv-card', modifiers)
16
16
  </script>
17
17
 
18
18
  <template>
@@ -5,12 +5,8 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import {
9
- VvCheckboxProps,
10
- VvCheckboxEvents,
11
- useGroupProps,
12
- } from '@/components/VvCheckbox'
13
- import { HintSlotFactory } from '@/components/common/HintSlot'
8
+ import { VvCheckboxProps, VvCheckboxEvents, useGroupProps } from '.'
9
+ import { HintSlotFactory } from '../common/HintSlot'
14
10
 
15
11
  // props, emits and slots
16
12
  const props = defineProps(VvCheckboxProps)
@@ -108,7 +104,7 @@
108
104
 
109
105
  // styles
110
106
  const { modifiers } = toRefs(props)
111
- const bemCssClasses = useBemModifiers(
107
+ const bemCssClasses = useModifiers(
112
108
  'vv-checkbox',
113
109
  modifiers,
114
110
  computed(() => ({
@@ -1,7 +1,7 @@
1
1
  import type { ExtractPropTypes, Ref } from 'vue'
2
- import type { InputGroupState } from '@/types/group'
3
- import { CheckboxRadioProps, ModifiersProps } from '@/props'
4
- import { INJECTION_KEY_CHECK_GROUP } from '@/constants'
2
+ import type { InputGroupState } from '../../types/group'
3
+ import { CheckboxRadioProps, ModifiersProps } from '../../props'
4
+ import { INJECTION_KEY_CHECK_GROUP } from '../../constants'
5
5
 
6
6
  export const VvCheckboxProps = {
7
7
  ...CheckboxRadioProps,
@@ -39,10 +39,14 @@ export function useGroupProps(
39
39
 
40
40
  // global props
41
41
  const modelValue = getGroupOrLocalRef('modelValue', props, emit)
42
- const readonly = getGroupOrLocalRef('readonly', props) as Ref<boolean>
43
- const disabled = getGroupOrLocalRef('disabled', props) as Ref<boolean>
44
42
  const valid = getGroupOrLocalRef('valid', props) as Ref<boolean>
45
43
  const invalid = getGroupOrLocalRef('invalid', props) as Ref<boolean>
44
+ const readonly = computed(() =>
45
+ Boolean(props.readonly || group?.value?.disabled.value),
46
+ )
47
+ const disabled = computed(() =>
48
+ Boolean(props.disabled || group?.value?.disabled.value),
49
+ )
46
50
 
47
51
  return {
48
52
  // local props
@@ -53,9 +57,9 @@ export function useGroupProps(
53
57
  group,
54
58
  isInGroup,
55
59
  modelValue,
56
- readonly,
57
- disabled,
58
60
  valid,
59
61
  invalid,
62
+ readonly,
63
+ disabled,
60
64
  }
61
65
  }
@@ -5,15 +5,12 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import type { Option } from '@/types/generic'
9
- import type { InputGroupState } from '@/types/group'
10
- import { INJECTION_KEY_CHECK_GROUP } from '@/constants'
11
- import { HintSlotFactory } from '@/components/common/HintSlot'
12
- import VvCheckbox from '@/components/VvCheckbox/VvCheckbox.vue'
13
- import {
14
- VvCheckboxGroupProps,
15
- VvCheckboxGroupEvents,
16
- } from '@/components/VvCheckboxGroup'
8
+ import type { Option } from '../../types/generic'
9
+ import type { InputGroupState } from '../../types/group'
10
+ import { INJECTION_KEY_CHECK_GROUP } from '../../constants'
11
+ import { HintSlotFactory } from '../common/HintSlot'
12
+ import VvCheckbox from '../VvCheckbox/VvCheckbox.vue'
13
+ import { VvCheckboxGroupProps, VvCheckboxGroupEvents } from '.'
17
14
 
18
15
  // props, emit and slots
19
16
  const props = defineProps(VvCheckboxGroupProps)
@@ -38,7 +35,7 @@
38
35
  const { getOptionLabel, getOptionValue } = useOptions(props)
39
36
 
40
37
  // stypes
41
- const bemCssClasses = useBemModifiers(
38
+ const bemCssClasses = useModifiers(
42
39
  'vv-checkbox-group',
43
40
  modifiers,
44
41
  computed(() => ({
@@ -1,4 +1,4 @@
1
- import { CheckboxRadioGroupProps } from '@/props'
1
+ import { CheckboxRadioGroupProps } from '../../props'
2
2
 
3
3
  export const VvCheckboxGroupProps = CheckboxRadioGroupProps
4
4