@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
@@ -1,6 +1,41 @@
1
- import { computed as p, unref as i, defineComponent as b, toRefs as d, openBlock as v, createElementBlock as y, normalizeClass as g, renderSlot as S, createTextVNode as j, toDisplayString as O, h as B, render as _ } from "vue";
2
- var l = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom", t))(l || {}), f = /* @__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))(f || {}), s = /* @__PURE__ */ ((t) => (t.before = "before", t.after = "after", t))(s || {}), u = /* @__PURE__ */ ((t) => (t.button = "button", t.submit = "submit", t.reset = "reset", t))(u || {}), c = /* @__PURE__ */ ((t) => (t._blank = "_blank", t._self = "_self", t._parent = "_parent", t._top = "_top", t))(c || {});
3
- const m = {
1
+ import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, h, render } 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 LinkProps = {
4
39
  /**
5
40
  * The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
6
41
  * @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
@@ -17,7 +52,7 @@ const m = {
17
52
  */
18
53
  target: {
19
54
  type: String,
20
- validator: (t) => Object.values(c).includes(t)
55
+ validator: (value) => Object.values(AnchorTarget).includes(value)
21
56
  },
22
57
  /**
23
58
  * Anchor rel
@@ -26,101 +61,235 @@ const m = {
26
61
  type: String,
27
62
  default: "noopener noreferrer"
28
63
  }
29
- }, h = {
64
+ };
65
+ const DisabledProps = {
30
66
  /**
31
67
  * Whether the form control is disabled
32
68
  */
33
69
  disabled: Boolean
34
- }, E = {
70
+ };
71
+ const ActiveProps = {
35
72
  /**
36
73
  * Whether the item is active
37
74
  */
38
75
  active: Boolean
39
- }, k = {
76
+ };
77
+ const PressedProps = {
40
78
  /**
41
79
  * Whether the item is pressed
42
80
  */
43
81
  pressed: Boolean
44
- }, C = {
82
+ };
83
+ const LabelProps = {
45
84
  /**
46
85
  * The item label
47
86
  */
48
87
  label: [String, Number]
49
- }, $ = {
88
+ };
89
+ const ModifiersProps = {
50
90
  /**
51
91
  * Component BEM modifiers
52
92
  */
53
93
  modifiers: [String, Array]
54
94
  };
55
- s.before;
56
- l.bottom;
57
95
  ({
58
- ...h,
59
- ...C,
60
- ...k,
61
- ...E,
62
- ...m,
96
+ /**
97
+ * VvIcon name or props
98
+ * @see VVIcon
99
+ */
100
+ icon: { type: [String, Object] },
101
+ /**
102
+ * VvIcon position
103
+ */
104
+ iconPosition: {
105
+ type: String,
106
+ default: Position.before,
107
+ validation: (value) => Object.values(Position).includes(value)
108
+ }
109
+ });
110
+ ({
111
+ /**
112
+ * Dropdown placement
113
+ */
114
+ placement: {
115
+ type: String,
116
+ default: Side.bottom,
117
+ validator: (value) => {
118
+ return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
119
+ }
120
+ },
121
+ /**
122
+ * Dropdown strategy
123
+ */
124
+ strategy: {
125
+ type: String,
126
+ default: "absolute",
127
+ validator: (value) => {
128
+ return ["fixed", "absolute"].includes(value);
129
+ }
130
+ },
131
+ /**
132
+ * Dropdown show / hide transition name
133
+ */
134
+ transitionName: {
135
+ type: String
136
+ },
137
+ /**
138
+ * Offset of the dropdown from the trigger
139
+ * @see https://floating-ui.com/docs/offset
140
+ */
141
+ offset: {
142
+ type: [Number, String, Object],
143
+ default: 0
144
+ },
145
+ /**
146
+ * Move dropdown to the side if there is no space in the default position
147
+ * @see https://floating-ui.com/docs/shift
148
+ */
149
+ shift: {
150
+ type: [Boolean, Object],
151
+ default: false
152
+ },
153
+ /**
154
+ * Flip dropdown position if there is no space in the default position
155
+ * @see https://floating-ui.com/docs/flip
156
+ */
157
+ flip: {
158
+ type: [Boolean, Object],
159
+ default: true
160
+ },
161
+ /**
162
+ * Size of the dropdown
163
+ * @see https://floating-ui.com/docs/size
164
+ */
165
+ size: {
166
+ type: [Boolean, Object],
167
+ default: () => ({ padding: 10 })
168
+ },
169
+ /**
170
+ * Automatically change the position of the dropdown
171
+ * @see https://floating-ui.com/docs/autoPlacement
172
+ */
173
+ autoPlacement: {
174
+ type: [Boolean, Object],
175
+ default: false
176
+ },
177
+ /**
178
+ * Add arrow to the dropdown
179
+ * @see https://floating-ui.com/docs/arrow
180
+ */
181
+ arrow: {
182
+ type: Boolean,
183
+ default: false
184
+ },
185
+ /**
186
+ * Close dropdown on click outside
187
+ */
188
+ autoClose: {
189
+ type: Boolean,
190
+ default: true
191
+ },
192
+ /**
193
+ * Autofocus first item on dropdown open
194
+ */
195
+ autofocusFirst: {
196
+ type: Boolean,
197
+ default: true
198
+ },
199
+ /**
200
+ * Set dropdown width to the same as the trigger
201
+ */
202
+ triggerWidth: {
203
+ type: Boolean
204
+ }
205
+ });
206
+ ({
207
+ ...DisabledProps,
208
+ ...LabelProps,
209
+ ...PressedProps,
210
+ ...ActiveProps,
211
+ ...LinkProps,
63
212
  /**
64
213
  * Button type
65
214
  */
66
- type: u.button
215
+ type: {
216
+ type: String,
217
+ default: ButtonType.button,
218
+ validator: (value) => Object.values(ButtonType).includes(value)
219
+ }
67
220
  });
68
- const N = {
69
- ...$,
221
+ const VvTooltipProps = {
222
+ ...ModifiersProps,
70
223
  /**
71
224
  * Define the tooltip position
72
225
  * @default Side.bottom
73
226
  */
74
227
  position: {
75
228
  type: String,
76
- default: l.bottom
229
+ default: Side.bottom
77
230
  },
78
231
  value: {
79
232
  type: String
80
233
  }
81
234
  };
82
- function M(t, e, o) {
83
- return p(() => {
84
- const a = {
85
- [t]: !0
86
- }, r = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
87
- return r && Array.isArray(r) && r.forEach((n) => {
88
- a[`${t}--${n}`] = !0;
89
- }), o && Object.keys(o.value).forEach((n) => {
90
- a[`${t}--${n}`] = i(o.value[n]);
91
- }), a;
235
+ function useModifiers(prefix, modifiers, others) {
236
+ return computed(() => {
237
+ const toReturn = {
238
+ [prefix]: true
239
+ };
240
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
241
+ if (modifiersArray) {
242
+ if (Array.isArray(modifiersArray)) {
243
+ modifiersArray.forEach((modifier) => {
244
+ if (modifier) {
245
+ toReturn[`${prefix}--${modifier}`] = true;
246
+ }
247
+ });
248
+ }
249
+ }
250
+ if (others) {
251
+ Object.keys(others.value).forEach((key) => {
252
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
253
+ });
254
+ }
255
+ return toReturn;
92
256
  });
93
257
  }
94
- const V = /* @__PURE__ */ b({
258
+ const _sfc_main = /* @__PURE__ */ defineComponent({
95
259
  __name: "VvTooltip",
96
- props: N,
97
- setup(t) {
98
- const e = t, { modifiers: o } = d(e), a = M(
260
+ props: VvTooltipProps,
261
+ setup(__props) {
262
+ const props = __props;
263
+ const { modifiers } = toRefs(props);
264
+ const bemCssClasses = useModifiers(
99
265
  "vv-tooltip",
100
- o,
101
- p(() => ({
102
- [e.position]: !0
266
+ modifiers,
267
+ computed(() => ({
268
+ [props.position]: true
103
269
  }))
104
270
  );
105
- return (r, n) => (v(), y("span", {
106
- class: g(i(a)),
107
- role: "tooltip",
108
- inert: ""
109
- }, [
110
- S(r.$slots, "default", {}, () => [
111
- j(O(r.value), 1)
112
- ])
113
- ], 2));
271
+ return (_ctx, _cache) => {
272
+ return openBlock(), createElementBlock("span", {
273
+ class: normalizeClass(unref(bemCssClasses)),
274
+ role: "tooltip",
275
+ inert: ""
276
+ }, [
277
+ renderSlot(_ctx.$slots, "default", {}, () => [
278
+ createTextVNode(toDisplayString(_ctx.value), 1)
279
+ ])
280
+ ], 2);
281
+ };
114
282
  }
115
- }), A = {
116
- beforeMount(t, e) {
117
- const o = B(V, {
118
- value: e.value,
119
- position: e.arg
283
+ });
284
+ const tooltip = {
285
+ beforeMount(el, binding) {
286
+ const tooltip2 = h(_sfc_main, {
287
+ value: binding.value,
288
+ position: binding.arg
120
289
  });
121
- _(o, t);
290
+ render(tooltip2, el);
122
291
  }
123
292
  };
124
293
  export {
125
- A as default
294
+ tooltip as default
126
295
  };
@@ -1 +1 @@
1
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(e=typeof globalThis<"u"?globalThis:e||self,e["v-tooltip"]=r(e.vue))})(this,function(e){"use strict";var r=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(r||{}),u=(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))(u||{}),i=(t=>(t.before="before",t.after="after",t))(i||{}),p=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(p||{}),f=(t=>(t._blank="_blank",t._self="_self",t._parent="_parent",t._top="_top",t))(f||{});const d={to:{type:[String,Object]},href:String,target:{type:String,validator:t=>Object.values(f).includes(t)},rel:{type:String,default:"noopener noreferrer"}},c={disabled:Boolean},b={active:Boolean},y={pressed:Boolean},g={label:[String,Number]},v={modifiers:[String,Array]};i.before,r.bottom,{...c,...g,...y,...b,...d,type:p.button};const S={...v,position:{type:String,default:r.bottom},value:{type:String}};function j(t,o,n){return e.computed(()=>{const s={[t]:!0},a=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return a&&Array.isArray(a)&&a.forEach(l=>{s[`${t}--${l}`]=!0}),n&&Object.keys(n.value).forEach(l=>{s[`${t}--${l}`]=e.unref(n.value[l])}),s})}const m=e.defineComponent({__name:"VvTooltip",props:S,setup(t){const o=t,{modifiers:n}=e.toRefs(o),s=j("vv-tooltip",n,e.computed(()=>({[o.position]:!0})));return(a,l)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(s)),role:"tooltip",inert:""},[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2))}});return{beforeMount(t,o){const n=e.h(m,{value:o.value,position:o.arg});e.render(n,t)}}});
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)["v-tooltip"]=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||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{});Boolean,Boolean,Boolean;const r={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button;const l={...r,position:{type:String,default:o.bottom},value:{type:String}};const i=e.defineComponent({__name:"VvTooltip",props:l,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-tooltip",n,e.computed((()=>({[t.position]:!0}))));return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r)),role:"tooltip",inert:""},[e.renderSlot(o.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]))],2))}});return{beforeMount(o,t){const n=e.h(i,{value:t.value,position:t.arg});e.render(n,o)}}}));
package/dist/icons.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import normal from './assets/icons/normal.json';
2
+ import detailed from './assets/icons/detailed.json';
3
+ import simple from './assets/icons/simple.json';
2
4
  declare const _default: ({
3
5
  prefix: string;
4
6
  lastModified: number;
@@ -1887,4 +1889,4 @@ declare const _default: ({
1887
1889
  };
1888
1890
  })[];
1889
1891
  export default _default;
1890
- export { normal };
1892
+ export { normal, detailed, simple };
package/dist/icons.es.js CHANGED
@@ -1,5 +1,6 @@
1
- const r = "normal";
2
- const t = {
1
+ const prefix$2 = "normal";
2
+ const lastModified$2 = 1679406106;
3
+ const icons$3 = {
3
4
  add: {
4
5
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4 12h16m-8-8v16"/>'
5
6
  },
@@ -602,13 +603,19 @@ const t = {
602
603
  "zoom-out": {
603
604
  body: '<g stroke="currentColor" stroke-miterlimit="10" stroke-width="2"><path fill="currentColor" stroke-linecap="round" d="m15 15 6 6"/><g fill="none" transform="translate(3 3)"><circle cx="7" cy="7" r="7" stroke="none"/><circle cx="7" cy="7" r="6"/></g><path fill="none" stroke-linecap="round" d="M8 10h4"/></g>'
604
605
  }
605
- }, o = 24, e = 24, l = {
606
- prefix: r,
607
- lastModified: 1675449599,
608
- icons: t,
609
- width: o,
610
- height: e
611
- }, n = "detailed", i = 1675449599, a = {
606
+ };
607
+ const width$1 = 24;
608
+ const height$1 = 24;
609
+ const normal = {
610
+ prefix: prefix$2,
611
+ lastModified: lastModified$2,
612
+ icons: icons$3,
613
+ width: width$1,
614
+ height: height$1
615
+ };
616
+ const prefix$1 = "detailed";
617
+ const lastModified$1 = 1679406106;
618
+ const icons$2 = {
612
619
  add: {
613
620
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4 15.999h24m-12-12v24"/>'
614
621
  },
@@ -1209,13 +1216,19 @@ const t = {
1209
1216
  "zoom-out": {
1210
1217
  body: '<g stroke="currentColor" stroke-miterlimit="10" stroke-width="2"><path fill="currentColor" stroke-linecap="round" d="m18 18 10 10"/><g fill="none" transform="translate(3 3)"><circle cx="9" cy="9" r="9" stroke="none"/><circle cx="9" cy="9" r="8"/></g></g><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M9 11.999h6"/>'
1211
1218
  }
1212
- }, c = 32, h = 32, s = {
1213
- prefix: n,
1214
- lastModified: i,
1215
- icons: a,
1216
- width: c,
1217
- height: h
1218
- }, d = "simple", k = 1675449599, m = {
1219
+ };
1220
+ const width = 32;
1221
+ const height = 32;
1222
+ const detailed = {
1223
+ prefix: prefix$1,
1224
+ lastModified: lastModified$1,
1225
+ icons: icons$2,
1226
+ width,
1227
+ height
1228
+ };
1229
+ const prefix = "simple";
1230
+ const lastModified = 1679406106;
1231
+ const icons$1 = {
1219
1232
  add: {
1220
1233
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" d="M.5 8h15M8 .5v15"/>'
1221
1234
  },
@@ -1881,12 +1894,16 @@ const t = {
1881
1894
  "zoom-out": {
1882
1895
  body: '<g stroke="currentColor" stroke-miterlimit="10"><path fill="currentColor" stroke-linecap="round" d="m9 9 6 6"/><g fill="none"><circle cx="5.5" cy="5.5" r="5.5" stroke="none"/><circle cx="5.5" cy="5.5" r="5"/></g></g><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" d="M2.5 5.5h6"/>'
1883
1896
  }
1884
- }, g = {
1885
- prefix: d,
1886
- lastModified: k,
1887
- icons: m
1888
- }, u = [l, s, g];
1897
+ };
1898
+ const simple = {
1899
+ prefix,
1900
+ lastModified,
1901
+ icons: icons$1
1902
+ };
1903
+ const icons = [normal, detailed, simple];
1889
1904
  export {
1890
- u as default,
1891
- l as normal
1905
+ icons as default,
1906
+ detailed,
1907
+ normal,
1908
+ simple
1892
1909
  };