@volverjs/ui-vue 0.0.3 → 0.0.5-beta.1

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 (236) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +54 -15
  3. package/auto-imports.d.ts +12 -3
  4. package/bin/icons.cjs +1 -73
  5. package/dist/Volver.d.ts +23 -11
  6. package/dist/components/VvAccordion/VvAccordion.es.js +180 -74
  7. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  8. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  9. package/dist/components/VvAccordion/index.d.ts +8 -3
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +280 -122
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  13. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  14. package/dist/components/VvAction/VvAction.es.js +338 -0
  15. package/dist/components/VvAction/VvAction.umd.js +1 -0
  16. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  17. package/dist/components/VvAction/index.d.ts +24 -0
  18. package/dist/components/VvBadge/VvBadge.es.js +251 -22
  19. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  20. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  21. package/dist/components/VvBadge/index.d.ts +1 -1
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +280 -62
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  25. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  26. package/dist/components/VvButton/VvButton.es.js +720 -261
  27. package/dist/components/VvButton/VvButton.umd.js +1 -1
  28. package/dist/components/VvButton/VvButton.vue.d.ts +54 -54
  29. package/dist/components/VvButton/index.d.ts +30 -75
  30. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +296 -49
  31. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  32. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  33. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  34. package/dist/components/VvCard/VvCard.es.js +60 -28
  35. package/dist/components/VvCard/VvCard.umd.js +1 -1
  36. package/dist/components/VvCheckbox/VvCheckbox.es.js +630 -172
  37. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  38. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  39. package/dist/components/VvCheckbox/index.d.ts +6 -6
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +736 -228
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  42. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +9 -9
  43. package/dist/components/VvCheckboxGroup/index.d.ts +4 -4
  44. package/dist/components/VvCombobox/VvCombobox.es.js +1673 -768
  45. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  46. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +159 -61
  47. package/dist/components/VvCombobox/index.d.ts +54 -23
  48. package/dist/components/VvDialog/VvDialog.es.js +426 -115
  49. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  50. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  51. package/dist/components/VvDialog/index.d.ts +4 -1
  52. package/dist/components/VvDropdown/VvDropdown.es.js +504 -190
  53. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  54. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +114 -42
  55. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  56. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  57. package/dist/components/VvDropdown/index.d.ts +35 -14
  58. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +454 -0
  59. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  60. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +48 -18
  61. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  62. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +361 -0
  63. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  64. package/dist/components/VvIcon/VvIcon.es.js +116 -52
  65. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  66. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  67. package/dist/components/VvIcon/index.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  69. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  70. package/dist/components/VvInputText/VvInputText.es.js +1054 -376
  71. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  72. package/dist/components/VvInputText/VvInputText.vue.d.ts +107 -20
  73. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  74. package/dist/components/VvInputText/index.d.ts +67 -3
  75. package/dist/components/VvProgress/VvProgress.es.js +254 -23
  76. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  77. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  78. package/dist/components/VvProgress/index.d.ts +1 -1
  79. package/dist/components/VvRadio/VvRadio.es.js +568 -137
  80. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  81. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  82. package/dist/components/VvRadio/index.d.ts +6 -6
  83. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +674 -193
  84. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  85. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +9 -9
  86. package/dist/components/VvRadioGroup/index.d.ts +4 -4
  87. package/dist/components/VvSelect/VvSelect.es.js +703 -251
  88. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  89. package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -17
  90. package/dist/components/VvSelect/index.d.ts +8 -8
  91. package/dist/components/VvTextarea/VvTextarea.es.js +747 -272
  92. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  93. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -14
  94. package/dist/components/VvTextarea/index.d.ts +7 -7
  95. package/dist/components/VvTooltip/VvTooltip.es.js +252 -24
  96. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  97. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  98. package/dist/components/VvTooltip/index.d.ts +2 -2
  99. package/dist/components/index.es.js +3676 -2007
  100. package/dist/components/index.umd.js +1 -1
  101. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  102. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  103. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  104. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  105. package/dist/composables/useComponentFocus.d.ts +1 -1
  106. package/dist/composables/useComponentIcon.d.ts +7 -7
  107. package/dist/composables/useDebouncedInput.d.ts +4 -1
  108. package/dist/composables/useDefaults.d.ts +2 -0
  109. package/dist/composables/useModifiers.d.ts +1 -1
  110. package/dist/composables/useOptions.d.ts +2 -2
  111. package/dist/composables/useTextCount.d.ts +3 -3
  112. package/dist/composables/useUniqueId.d.ts +1 -1
  113. package/dist/composables/useVolver.d.ts +1 -1
  114. package/dist/constants.d.ts +30 -0
  115. package/dist/directives/index.es.js +288 -0
  116. package/dist/directives/index.umd.js +1 -0
  117. package/dist/directives/v-tooltip.es.js +285 -0
  118. package/dist/directives/v-tooltip.umd.js +1 -0
  119. package/dist/icons.es.js +38 -23
  120. package/dist/icons.umd.js +1 -1
  121. package/dist/index.d.ts +0 -1
  122. package/dist/index.es.js +115 -3269
  123. package/dist/index.umd.js +1 -1
  124. package/dist/props/index.d.ts +215 -23
  125. package/dist/resolvers/unplugin.d.ts +14 -8
  126. package/dist/resolvers/unplugin.es.js +94 -33
  127. package/dist/resolvers/unplugin.umd.js +1 -1
  128. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  129. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  130. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  131. package/dist/stories/argTypes.d.ts +1 -1
  132. package/package.json +167 -63
  133. package/src/Volver.ts +60 -26
  134. package/src/assets/icons/detailed.json +1 -1
  135. package/src/assets/icons/normal.json +1 -1
  136. package/src/assets/icons/simple.json +1 -1
  137. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  138. package/src/components/VvAccordion/index.ts +12 -4
  139. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  140. package/src/components/VvAccordionGroup/index.ts +8 -0
  141. package/src/components/VvAction/VvAction.vue +144 -0
  142. package/src/components/VvAction/index.ts +5 -0
  143. package/src/components/VvBadge/VvBadge.vue +2 -2
  144. package/src/components/VvBadge/index.ts +1 -1
  145. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  146. package/src/components/VvButton/VvButton.vue +41 -124
  147. package/src/components/VvButton/index.ts +16 -88
  148. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  149. package/src/components/VvButtonGroup/index.ts +1 -1
  150. package/src/components/VvCard/VvCard.vue +2 -2
  151. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  152. package/src/components/VvCheckbox/index.ts +11 -7
  153. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  154. package/src/components/VvCheckboxGroup/index.ts +1 -1
  155. package/src/components/VvCombobox/VvCombobox.vue +85 -57
  156. package/src/components/VvCombobox/index.ts +12 -10
  157. package/src/components/VvDialog/VvDialog.vue +28 -11
  158. package/src/components/VvDialog/index.ts +5 -2
  159. package/src/components/VvDropdown/VvDropdown.vue +6 -5
  160. package/src/components/VvDropdown/VvDropdownAction.vue +46 -0
  161. package/src/components/VvDropdown/VvDropdownOption.vue +72 -0
  162. package/src/components/VvDropdown/index.ts +6 -11
  163. package/src/components/VvIcon/VvIcon.vue +3 -3
  164. package/src/components/VvIcon/index.ts +3 -3
  165. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  166. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  167. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  168. package/src/components/VvInputText/VvInputText.vue +128 -35
  169. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  170. package/src/components/VvInputText/index.ts +62 -1
  171. package/src/components/VvProgress/VvProgress.vue +2 -2
  172. package/src/components/VvProgress/index.ts +1 -1
  173. package/src/components/VvRadio/VvRadio.vue +3 -7
  174. package/src/components/VvRadio/index.ts +11 -7
  175. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  176. package/src/components/VvRadioGroup/index.ts +1 -1
  177. package/src/components/VvSelect/VvSelect.vue +4 -4
  178. package/src/components/VvSelect/index.ts +3 -5
  179. package/src/components/VvTextarea/VvTextarea.vue +4 -4
  180. package/src/components/VvTextarea/index.ts +1 -1
  181. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  182. package/src/components/VvTooltip/index.ts +3 -3
  183. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  184. package/src/composables/dropdown/useProvideDropdown.ts +9 -11
  185. package/src/composables/group/useInjectedGroupState.ts +1 -1
  186. package/src/composables/group/useProvideGroupState.ts +1 -1
  187. package/src/composables/useComponentIcon.ts +1 -1
  188. package/src/composables/useDebouncedInput.ts +10 -3
  189. package/src/composables/useDefaults.ts +89 -0
  190. package/src/composables/useModifiers.ts +8 -9
  191. package/src/composables/useOptions.ts +1 -1
  192. package/src/composables/useVolver.ts +2 -2
  193. package/src/constants.ts +36 -0
  194. package/src/directives/index.ts +1 -1
  195. package/src/directives/v-tooltip.ts +2 -2
  196. package/src/index.ts +0 -2
  197. package/src/props/index.ts +111 -19
  198. package/src/resolvers/unplugin.ts +96 -49
  199. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  200. package/src/stories/Accordion/Accordion.test.ts +21 -15
  201. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  202. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  203. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  204. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +3 -2
  205. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  206. package/src/stories/Button/Button.stories.mdx +4 -2
  207. package/src/stories/Button/Button.test.ts +3 -1
  208. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  209. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  210. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  211. package/src/stories/Card/Card.stories.mdx +2 -1
  212. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  213. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  214. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  215. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  216. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  217. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  218. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  219. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  220. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  221. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  222. package/src/stories/Icon/Icon.stories.mdx +2 -1
  223. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  224. package/src/stories/InputText/InputText.settings.ts +53 -0
  225. package/src/stories/InputText/InputText.stories.mdx +42 -1
  226. package/src/stories/InputText/InputText.test.ts +5 -2
  227. package/src/stories/Progress/Progress.stories.mdx +2 -1
  228. package/src/stories/Radio/Radio.stories.mdx +2 -1
  229. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  230. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  231. package/src/stories/Select/Select.stories.mdx +2 -1
  232. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  233. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  234. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
  235. package/src/stories/argTypes.ts +2 -2
  236. package/src/types/group.d.ts +5 -0
@@ -1,77 +1,324 @@
1
- import { defineComponent as b, openBlock as y, createElementBlock as g, normalizeClass as v, unref as B, renderSlot as O } from "vue";
2
- var a = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(a || {}), s = /* @__PURE__ */ ((t) => (t.topStart = "top-start", t.topEnd = "top-end", t.bottomStart = "bottom-start", t.bottomEnd = "bottom-end", t.leftStart = "left-start", t.leftEnd = "left-end", t.rightStart = "right-start", t.rightEnd = "right-end", t))(s || {}), l = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(l || {});
3
- const S = Symbol.for("buttonGroup"), V = {
1
+ import { isRef, provide, computed, unref, defineComponent, toRefs, watchEffect, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
+ var Side = /* @__PURE__ */ ((Side2) => {
3
+ Side2["left"] = "left";
4
+ Side2["right"] = "right";
5
+ Side2["top"] = "top";
6
+ Side2["bottom"] = "bottom";
7
+ return Side2;
8
+ })(Side || {});
9
+ var Placement = /* @__PURE__ */ ((Placement2) => {
10
+ Placement2["topStart"] = "top-start";
11
+ Placement2["topEnd"] = "top-end";
12
+ Placement2["bottomStart"] = "bottom-start";
13
+ Placement2["bottomEnd"] = "bottom-end";
14
+ Placement2["leftStart"] = "left-start";
15
+ Placement2["leftEnd"] = "left-end";
16
+ Placement2["rightStart"] = "right-start";
17
+ Placement2["rightEnd"] = "right-end";
18
+ return Placement2;
19
+ })(Placement || {});
20
+ var Position = /* @__PURE__ */ ((Position2) => {
21
+ Position2["before"] = "before";
22
+ Position2["after"] = "after";
23
+ return Position2;
24
+ })(Position || {});
25
+ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
26
+ ButtonType2["button"] = "button";
27
+ ButtonType2["submit"] = "submit";
28
+ ButtonType2["reset"] = "reset";
29
+ return ButtonType2;
30
+ })(ButtonType || {});
31
+ var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
32
+ AnchorTarget2["_blank"] = "_blank";
33
+ AnchorTarget2["_self"] = "_self";
34
+ AnchorTarget2["_parent"] = "_parent";
35
+ AnchorTarget2["_top"] = "_top";
36
+ return AnchorTarget2;
37
+ })(AnchorTarget || {});
38
+ const INJECTION_KEY_BUTTON_GROUP = Symbol.for("buttonGroup");
39
+ const LinkProps = {
40
+ /**
41
+ * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
42
+ * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
43
+ */
44
+ to: {
45
+ type: [String, Object]
46
+ },
47
+ /**
48
+ * Anchor href
49
+ */
50
+ href: String,
51
+ /**
52
+ * Anchor target
53
+ */
54
+ target: {
55
+ type: String,
56
+ validator: (value) => Object.values(AnchorTarget).includes(value)
57
+ },
58
+ /**
59
+ * Anchor rel
60
+ */
61
+ rel: {
62
+ type: String,
63
+ default: "noopener noreferrer"
64
+ }
65
+ };
66
+ const DisabledProps = {
4
67
  /**
5
68
  * Whether the form control is disabled
6
69
  */
7
70
  disabled: Boolean
8
- }, h = {
71
+ };
72
+ const ActiveProps = {
73
+ /**
74
+ * Whether the item is active
75
+ */
76
+ active: Boolean
77
+ };
78
+ const PressedProps = {
79
+ /**
80
+ * Whether the item is pressed
81
+ */
82
+ pressed: Boolean
83
+ };
84
+ const LabelProps = {
85
+ /**
86
+ * The item label
87
+ */
88
+ label: [String, Number]
89
+ };
90
+ const ModifiersProps = {
9
91
  /**
10
92
  * Component BEM modifiers
11
93
  */
12
94
  modifiers: [String, Array]
13
95
  };
14
- l.before;
15
- const _ = {
96
+ ({
97
+ /**
98
+ * VvIcon name or props
99
+ * @see VVIcon
100
+ */
101
+ icon: { type: [String, Object] },
102
+ /**
103
+ * VvIcon position
104
+ */
105
+ iconPosition: {
106
+ type: String,
107
+ default: Position.before,
108
+ validation: (value) => Object.values(Position).includes(value)
109
+ }
110
+ });
111
+ const UnselectableProps = {
16
112
  /**
17
113
  * If true the input will be unselectable
18
114
  */
19
- unselectable: { type: Boolean, default: !0 }
115
+ unselectable: { type: Boolean, default: true }
20
116
  };
21
- a.bottom;
22
- const j = {
23
- ...h,
24
- ...V,
25
- ..._,
117
+ ({
118
+ /**
119
+ * Dropdown placement
120
+ */
121
+ placement: {
122
+ type: String,
123
+ default: Side.bottom,
124
+ validator: (value) => {
125
+ return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
126
+ }
127
+ },
128
+ /**
129
+ * Dropdown show / hide transition name
130
+ */
131
+ transitionName: {
132
+ type: String
133
+ },
134
+ /**
135
+ * Offset of the dropdown from the trigger
136
+ * @see https://floating-ui.com/docs/offset
137
+ */
138
+ offset: {
139
+ type: [Number, String, Object],
140
+ default: 0
141
+ },
142
+ /**
143
+ * Move dropdown to the side if there is no space in the default position
144
+ * @see https://floating-ui.com/docs/shift
145
+ */
146
+ shift: {
147
+ type: [Boolean, Object],
148
+ default: false
149
+ },
150
+ /**
151
+ * Flip dropdown position if there is no space in the default position
152
+ * @see https://floating-ui.com/docs/flip
153
+ */
154
+ flip: {
155
+ type: [Boolean, Object],
156
+ default: true
157
+ },
158
+ /**
159
+ * Size of the dropdown
160
+ * @see https://floating-ui.com/docs/size
161
+ */
162
+ size: {
163
+ type: [Boolean, Object],
164
+ default: () => ({ padding: 10 })
165
+ },
166
+ /**
167
+ * Automatically change the position of the dropdown
168
+ * @see https://floating-ui.com/docs/autoPlacement
169
+ */
170
+ autoPlacement: {
171
+ type: [Boolean, Object],
172
+ default: false
173
+ },
174
+ /**
175
+ * Add arrow to the dropdown
176
+ * @see https://floating-ui.com/docs/arrow
177
+ */
178
+ arrow: {
179
+ type: Boolean,
180
+ default: false
181
+ },
182
+ /**
183
+ * Close dropdown on click outside
184
+ */
185
+ autoClose: {
186
+ type: Boolean,
187
+ default: true
188
+ },
189
+ /**
190
+ * Autofocus first item on dropdown open
191
+ */
192
+ autofocusFirst: {
193
+ type: Boolean,
194
+ default: true
195
+ },
196
+ /**
197
+ * Set dropdown width to the same as the trigger
198
+ */
199
+ triggerWidth: {
200
+ type: Boolean
201
+ }
202
+ });
203
+ ({
204
+ ...DisabledProps,
205
+ ...LabelProps,
206
+ ...PressedProps,
207
+ ...ActiveProps,
208
+ ...LinkProps,
209
+ /**
210
+ * Button type
211
+ */
212
+ type: {
213
+ type: String,
214
+ default: ButtonType.button,
215
+ validator: (value) => Object.values(ButtonType).includes(value)
216
+ }
217
+ });
218
+ const VvButtonGroupProps = {
219
+ ...ModifiersProps,
220
+ ...DisabledProps,
221
+ ...UnselectableProps,
26
222
  /**
27
223
  * String or String[] of css classes (modifiers) that will be provided to each button'
28
224
  */
29
225
  itemModifiers: { type: [String, Array], default: void 0 },
30
- toggle: { type: Boolean, default: !1 },
31
- multiple: { type: Boolean, default: !1 },
226
+ toggle: { type: Boolean, default: false },
227
+ multiple: { type: Boolean, default: false },
32
228
  modelValue: { type: [String, Array], default: void 0 }
33
- }, A = ["update:modelValue"], E = {
229
+ };
230
+ const VvButtonGroupEvents = ["update:modelValue"];
231
+ function useProvideGroupState(groupState) {
232
+ if (Object.keys(groupState).some(
233
+ (k) => k !== "key" && !isRef(groupState[k])
234
+ ))
235
+ throw Error("One or more groupState props aren't ref.");
236
+ provide(
237
+ groupState.key,
238
+ computed(() => groupState)
239
+ );
240
+ }
241
+ function useModifiers(prefix, modifiers, others) {
242
+ return computed(() => {
243
+ const toReturn = {
244
+ [prefix]: true
245
+ };
246
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
247
+ if (modifiersArray) {
248
+ if (Array.isArray(modifiersArray)) {
249
+ modifiersArray.forEach((modifier) => {
250
+ if (modifier) {
251
+ toReturn[`${prefix}--${modifier}`] = true;
252
+ }
253
+ });
254
+ }
255
+ }
256
+ if (others) {
257
+ Object.keys(others.value).forEach((key) => {
258
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
259
+ });
260
+ }
261
+ return toReturn;
262
+ });
263
+ }
264
+ const __default__ = {
34
265
  name: "VvButtonGroup"
35
- }, N = /* @__PURE__ */ b({
36
- ...E,
37
- props: j,
38
- emits: A,
39
- setup(t, { emit: u }) {
40
- const e = t, {
41
- disabled: n,
42
- toggle: i,
43
- modifiers: d,
44
- multiple: r,
45
- unselectable: f,
46
- itemModifiers: p
47
- } = toRefs(e);
266
+ };
267
+ const _sfc_main = /* @__PURE__ */ defineComponent({
268
+ ...__default__,
269
+ props: VvButtonGroupProps,
270
+ emits: VvButtonGroupEvents,
271
+ setup(__props, { emit }) {
272
+ const props = __props;
273
+ const {
274
+ disabled,
275
+ toggle,
276
+ modifiers,
277
+ multiple,
278
+ unselectable,
279
+ itemModifiers
280
+ } = toRefs(props);
48
281
  watchEffect(() => {
49
- typeof e.modelValue == "string" && r.value && console.warn(
50
- "[VvButtonGroup]: modelValue is a string but multiple is true."
51
- );
282
+ if (typeof props.modelValue === "string" && multiple.value) {
283
+ console.warn(
284
+ `[VvButtonGroup]: modelValue is a string but multiple is true.`
285
+ );
286
+ }
52
287
  });
53
- const c = computed({
54
- get: () => r.value ? e.modelValue : Array.isArray(e.modelValue) ? e.modelValue[0] : e.modelValue,
55
- set: (o) => (o !== void 0 && (Array.isArray(e.modelValue) || r.value) && !Array.isArray(o) && (o = [o]), u("update:modelValue", o))
288
+ const modelValue = computed({
289
+ get: () => {
290
+ if (!multiple.value) {
291
+ return Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
292
+ }
293
+ return props.modelValue;
294
+ },
295
+ set: (newValue) => {
296
+ if (newValue !== void 0 && (Array.isArray(props.modelValue) || multiple.value) && !Array.isArray(newValue)) {
297
+ newValue = [newValue];
298
+ }
299
+ return emit("update:modelValue", newValue);
300
+ }
56
301
  });
57
302
  useProvideGroupState({
58
- key: S,
59
- modelValue: c,
60
- disabled: n,
61
- toggle: i,
62
- multiple: r,
63
- unselectable: f,
64
- itemModifiers: p
303
+ key: INJECTION_KEY_BUTTON_GROUP,
304
+ modelValue,
305
+ disabled,
306
+ toggle,
307
+ multiple,
308
+ unselectable,
309
+ itemModifiers
65
310
  });
66
- const m = useBemModifiers("vv-button-group", d);
67
- return (o, G) => (y(), g("div", {
68
- class: v(B(m)),
69
- role: "group"
70
- }, [
71
- O(o.$slots, "default")
72
- ], 2));
311
+ const bemCssClasses = useModifiers("vv-button-group", modifiers);
312
+ return (_ctx, _cache) => {
313
+ return openBlock(), createElementBlock("div", {
314
+ class: normalizeClass(unref(bemCssClasses)),
315
+ role: "group"
316
+ }, [
317
+ renderSlot(_ctx.$slots, "default")
318
+ ], 2);
319
+ };
73
320
  }
74
321
  });
75
322
  export {
76
- N as default
323
+ _sfc_main as default
77
324
  };
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButtonGroup=o(e.vue))})(this,function(e){"use strict";var o=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(o||{}),s=(t=>(t.topStart="top-start",t.topEnd="top-end",t.bottomStart="bottom-start",t.bottomEnd="bottom-end",t.leftStart="left-start",t.leftEnd="left-end",t.rightStart="right-start",t.rightEnd="right-end",t))(s||{}),n=(t=>(t.before="before",t.after="after",t))(n||{});const u=Symbol.for("buttonGroup"),i={disabled:Boolean},d={modifiers:[String,Array]};n.before;const f={unselectable:{type:Boolean,default:!0}};o.bottom;const p={...d,...i,...f,itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}},c=["update:modelValue"],m={name:"VvButtonGroup"};return e.defineComponent({...m,props:p,emits:c,setup(t,{emit:y}){const r=t,{disabled:b,toggle:g,modifiers:v,multiple:a,unselectable:B,itemModifiers:h}=toRefs(r);watchEffect(()=>{typeof r.modelValue=="string"&&a.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")});const O=computed({get:()=>a.value?r.modelValue:Array.isArray(r.modelValue)?r.modelValue[0]:r.modelValue,set:l=>(l!==void 0&&(Array.isArray(r.modelValue)||a.value)&&!Array.isArray(l)&&(l=[l]),y("update:modelValue",l))});useProvideGroupState({key:u,modelValue:O,disabled:b,toggle:g,multiple:a,unselectable:B,itemModifiers:h});const S=useBemModifiers("vv-button-group",v);return(l,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S)),role:"group"},[e.renderSlot(l.$slots,"default")],2))}})});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{});const r=Symbol.for("buttonGroup"),u={disabled:Boolean},a=(Boolean,Boolean,{modifiers:[String,Array]});t.before;const n={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button;const i={...a,...u,...n,itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:i,emits:["update:modelValue"],setup(o,{emit:t}){const l=o,{disabled:u,toggle:a,modifiers:n,multiple:i,unselectable:s,itemModifiers:d}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const f=e.computed({get:()=>i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue,set:e=>(void 0===e||!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)||(e=[e]),t("update:modelValue",e))});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:r,modelValue:f,disabled:u,toggle:a,multiple:i,unselectable:s,itemModifiers:d});const m=function(o,t,l){return e.computed((()=>{const r={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((t=>{r[`${o}--${t}`]=e.unref(l.value[t])})),r}))}("vv-button-group",n);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)),role:"group"},[e.renderSlot(o.$slots,"default")],2))}})}));
@@ -46,7 +46,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
46
46
  default: boolean;
47
47
  };
48
48
  disabled: BooleanConstructor;
49
- modifiers: import("vue").PropType<string | string[]>;
49
+ modifiers: globalThis.PropType<string | string[]>;
50
50
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
51
51
  itemModifiers: {
52
52
  type: (StringConstructor | {
@@ -95,7 +95,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
95
95
  default: boolean;
96
96
  };
97
97
  disabled: BooleanConstructor;
98
- modifiers: import("vue").PropType<string | string[]>;
98
+ modifiers: globalThis.PropType<string | string[]>;
99
99
  }>> & {
100
100
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
101
101
  }, {
@@ -49,6 +49,6 @@ export declare const VvButtonGroupProps: {
49
49
  default: boolean;
50
50
  };
51
51
  disabled: BooleanConstructor;
52
- modifiers: import("vue").PropType<string | string[]>;
52
+ modifiers: globalThis.PropType<string | string[]>;
53
53
  };
54
54
  export declare const VvButtonGroupEvents: string[];
@@ -1,41 +1,73 @@
1
- import { defineComponent as i, openBlock as s, createElementBlock as t, normalizeClass as c, unref as f, renderSlot as o, createTextVNode as m, toDisplayString as p, createCommentVNode as r } from "vue";
2
- const u = {
1
+ import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ const VvCardProps = {
3
3
  title: String,
4
4
  modifiers: [String, Array]
5
- }, v = {
5
+ };
6
+ function useModifiers(prefix, modifiers, others) {
7
+ return computed(() => {
8
+ const toReturn = {
9
+ [prefix]: true
10
+ };
11
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
12
+ if (modifiersArray) {
13
+ if (Array.isArray(modifiersArray)) {
14
+ modifiersArray.forEach((modifier) => {
15
+ if (modifier) {
16
+ toReturn[`${prefix}--${modifier}`] = true;
17
+ }
18
+ });
19
+ }
20
+ }
21
+ if (others) {
22
+ Object.keys(others.value).forEach((key) => {
23
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
24
+ });
25
+ }
26
+ return toReturn;
27
+ });
28
+ }
29
+ const _hoisted_1 = {
6
30
  key: 0,
7
31
  class: "vv-card__header"
8
- }, _ = {
32
+ };
33
+ const _hoisted_2 = {
9
34
  key: 1,
10
35
  class: "vv-card__content"
11
- }, h = {
36
+ };
37
+ const _hoisted_3 = {
12
38
  key: 2,
13
39
  class: "vv-card__footer"
14
- }, C = {
40
+ };
41
+ const __default__ = {
15
42
  name: "VvCard"
16
- }, y = /* @__PURE__ */ i({
17
- ...C,
18
- props: u,
19
- setup(n) {
20
- const a = n, { modifiers: l } = toRefs(a), d = useBemModifiers("vv-card", l);
21
- return (e, $) => (s(), t("article", {
22
- class: c(f(d))
23
- }, [
24
- e.$slots.header || e.title ? (s(), t("header", v, [
25
- o(e.$slots, "header", {}, () => [
26
- m(p(e.title), 1)
27
- ])
28
- ])) : r("", !0),
29
- o(e.$slots, "default"),
30
- e.$slots.content ? (s(), t("div", _, [
31
- o(e.$slots, "content")
32
- ])) : r("", !0),
33
- e.$slots.footer ? (s(), t("footer", h, [
34
- o(e.$slots, "footer")
35
- ])) : r("", !0)
36
- ], 2));
43
+ };
44
+ const _sfc_main = /* @__PURE__ */ defineComponent({
45
+ ...__default__,
46
+ props: VvCardProps,
47
+ setup(__props) {
48
+ const props = __props;
49
+ const { modifiers } = toRefs(props);
50
+ const bemCssClasses = useModifiers("vv-card", modifiers);
51
+ return (_ctx, _cache) => {
52
+ return openBlock(), createElementBlock("article", {
53
+ class: normalizeClass(unref(bemCssClasses))
54
+ }, [
55
+ _ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
56
+ renderSlot(_ctx.$slots, "header", {}, () => [
57
+ createTextVNode(toDisplayString(_ctx.title), 1)
58
+ ])
59
+ ])) : createCommentVNode("", true),
60
+ renderSlot(_ctx.$slots, "default"),
61
+ _ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_2, [
62
+ renderSlot(_ctx.$slots, "content")
63
+ ])) : createCommentVNode("", true),
64
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
65
+ renderSlot(_ctx.$slots, "footer")
66
+ ])) : createCommentVNode("", true)
67
+ ], 2);
68
+ };
37
69
  }
38
70
  });
39
71
  export {
40
- y as default
72
+ _sfc_main as default
41
73
  };
@@ -1 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.VvCard=o(e.vue))})(this,function(e){"use strict";const o={title:String,modifiers:[String,Array]},s={key:0,class:"vv-card__header"},n={key:1,class:"vv-card__content"},r={key:2,class:"vv-card__footer"},d={name:"VvCard"};return e.defineComponent({...d,props:o,setup(l){const c=l,{modifiers:i}=toRefs(c),a=useBemModifiers("vv-card",i);return(t,m)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(a))},[t.$slots.header||t.title?(e.openBlock(),e.createElementBlock("header",s,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),t.$slots.content?(e.openBlock(),e.createElementBlock("div",n,[e.renderSlot(t.$slots,"content")])):e.createCommentVNode("",!0),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",r,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)],2))}})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvCard=t(e.vue)}(this,(function(e){"use strict";const t={title:String,modifiers:[String,Array]};const o={key:0,class:"vv-card__header"},r={key:1,class:"vv-card__content"},n={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:t,setup(t){const l=t,{modifiers:s}=e.toRefs(l),c=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-card",s);return(t,l)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(c))},[t.$slots.header||t.title?(e.openBlock(),e.createElementBlock("header",o,[e.renderSlot(t.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),t.$slots.content?(e.openBlock(),e.createElementBlock("div",r,[e.renderSlot(t.$slots,"content")])):e.createCommentVNode("",!0),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",n,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)],2))}})}));