@volverjs/ui-vue 0.0.1-beta.12 → 0.0.1-beta.16

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 (431) hide show
  1. package/bin/icons.cjs +73 -0
  2. package/bin/icons.js +75 -0
  3. package/dist/Volver.d.ts +15 -2
  4. package/dist/components/VvAccordion/VvAccordion.es.js +133 -236
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +32 -97
  7. package/dist/components/VvAccordion/index.d.ts +46 -0
  8. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +199 -277
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +44 -151
  11. package/dist/components/VvAccordionGroup/{VvAccordionGroup.d.ts → index.d.ts} +9 -13
  12. package/dist/components/VvBadge/VvBadge.es.js +42 -151
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -53
  15. package/dist/components/VvBadge/{VvBadge.d.ts → index.d.ts} +0 -0
  16. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +55 -168
  17. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  18. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +24 -104
  19. package/dist/components/VvBreadcrumb/{VvBreadcrumb.d.ts → index.d.ts} +1 -1
  20. package/dist/components/VvButton/VvButton.es.js +298 -312
  21. package/dist/components/VvButton/VvButton.umd.js +1 -1
  22. package/dist/components/VvButton/VvButton.vue.d.ts +91 -163
  23. package/dist/components/VvButton/{VvButton.d.ts → index.d.ts} +46 -9
  24. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +59 -172
  25. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  26. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +30 -125
  27. package/dist/components/VvButtonGroup/{VvButtonGroup.d.ts → index.d.ts} +0 -0
  28. package/dist/components/VvCard/VvCard.es.js +55 -166
  29. package/dist/components/VvCard/VvCard.umd.js +1 -1
  30. package/dist/components/VvCard/VvCard.vue.d.ts +16 -61
  31. package/dist/components/VvCard/{VvCard.d.ts → index.d.ts} +1 -1
  32. package/dist/components/VvCheckbox/VvCheckbox.es.js +344 -0
  33. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -0
  34. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +87 -0
  35. package/dist/components/VvCheckbox/index.d.ts +86 -0
  36. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +415 -0
  37. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -0
  38. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +113 -0
  39. package/dist/components/{VvCheckGroup/VvCheckGroup.d.ts → VvCheckboxGroup/index.d.ts} +10 -10
  40. package/dist/components/VvDialog/VvDialog.es.js +108 -230
  41. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  42. package/dist/components/VvDialog/VvDialog.vue.d.ts +28 -132
  43. package/dist/components/VvDialog/{VvDialog.d.ts → index.d.ts} +2 -6
  44. package/dist/components/VvDropdown/VvDropdown.es.js +167 -186
  45. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  46. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +34 -136
  47. package/dist/components/VvDropdown/{VvDropdown.d.ts → index.d.ts} +7 -3
  48. package/dist/components/VvIcon/VvIcon.es.js +62 -174
  49. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  50. package/dist/components/VvIcon/VvIcon.vue.d.ts +36 -150
  51. package/dist/components/VvIcon/{VvIcon.d.ts → index.d.ts} +9 -0
  52. package/dist/components/VvInputText/VvInputClearAction.d.ts +36 -0
  53. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +56 -0
  54. package/dist/components/VvInputText/VvInputStepAction.d.ts +37 -0
  55. package/dist/components/VvInputText/VvInputText.es.js +586 -577
  56. package/dist/components/VvInputText/VvInputText.umd.js +1 -2
  57. package/dist/components/VvInputText/VvInputText.vue.d.ts +187 -275
  58. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  59. package/dist/components/VvInputText/index.d.ts +175 -0
  60. package/dist/components/VvNativeSelect/VvNativeSelect.es.js +299 -347
  61. package/dist/components/VvNativeSelect/VvNativeSelect.umd.js +1 -2
  62. package/dist/components/VvNativeSelect/VvNativeSelect.vue.d.ts +78 -190
  63. package/dist/components/VvNativeSelect/{VvNativeSelect.d.ts → index.d.ts} +35 -8
  64. package/dist/components/VvProgress/VvProgress.es.js +45 -162
  65. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  66. package/dist/components/VvProgress/VvProgress.vue.d.ts +17 -103
  67. package/dist/components/VvProgress/{VvProgress.d.ts → index.d.ts} +1 -7
  68. package/dist/components/VvRadio/VvRadio.es.js +292 -267
  69. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  70. package/dist/components/VvRadio/VvRadio.vue.d.ts +52 -122
  71. package/dist/components/VvRadio/index.d.ts +64 -0
  72. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +342 -380
  73. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -2
  74. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +58 -213
  75. package/dist/components/VvRadioGroup/{VvRadioGroup.d.ts → index.d.ts} +2 -2
  76. package/dist/components/VvSelect/VvSelect.es.js +556 -510
  77. package/dist/components/VvSelect/VvSelect.umd.js +1 -2
  78. package/dist/components/VvSelect/VvSelect.vue.d.ts +75 -240
  79. package/dist/components/VvSelect/{VvSelect.d.ts → index.d.ts} +12 -5
  80. package/dist/components/VvTextarea/VvTextarea.es.js +372 -481
  81. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -2
  82. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +103 -299
  83. package/dist/components/VvTextarea/{VvTextarea.d.ts → index.d.ts} +36 -13
  84. package/dist/components/common/HintSlot.d.ts +10 -4
  85. package/dist/components/index.d.ts +13 -6
  86. package/dist/components/index.es.js +2070 -895
  87. package/dist/components/index.umd.js +1 -2
  88. package/dist/composables/debouncedInput/useDebouncedInput.d.ts +2 -2
  89. package/dist/composables/focus/useComponentFocus.d.ts +3 -3
  90. package/dist/composables/group/types/IAccordionGroupState.d.ts +1 -3
  91. package/dist/composables/group/types/IGroupState.d.ts +2 -2
  92. package/dist/composables/group/useInjectedGroupState.d.ts +4 -4
  93. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  94. package/dist/composables/icons/useComponentIcons.d.ts +2 -2
  95. package/dist/composables/textLimit/useTextLimit.d.ts +0 -3
  96. package/dist/constants.d.ts +4 -4
  97. package/dist/icons.d.ts +1881 -0
  98. package/dist/icons.es.js +4 -6
  99. package/dist/icons.umd.js +1 -1
  100. package/dist/index.es.js +2113 -932
  101. package/dist/index.umd.js +1 -2
  102. package/dist/props/index.d.ts +9 -3
  103. package/dist/resolvers/unplugin.d.ts +27 -0
  104. package/dist/resolvers/unplugin.es.js +40 -0
  105. package/dist/resolvers/unplugin.umd.js +1 -0
  106. package/dist/stories/Accordion/Accordion.test.d.ts +4 -0
  107. package/dist/stories/Badge/Badge.test.d.ts +2 -0
  108. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +2 -0
  109. package/dist/stories/Button/Button.test.d.ts +3 -8
  110. package/dist/stories/Card/Card.test.d.ts +3 -0
  111. package/dist/stories/Dialog/Dialog.test.d.ts +2 -0
  112. package/dist/stories/Dropdown/Dropdown.test.d.ts +2 -0
  113. package/dist/stories/Icon/IconList.vue.d.ts +1 -43
  114. package/dist/stories/InputText/InputText.test.d.ts +6 -0
  115. package/dist/stories/Radio/Radio.test.d.ts +3 -0
  116. package/dist/stories/RadioGroup/RadioGroup.test.d.ts +8 -0
  117. package/dist/stories/Select/Select.test.d.ts +3 -0
  118. package/dist/stories/Textarea/Textarea.test.d.ts +8 -0
  119. package/dist/stories/utils.d.ts +1 -3
  120. package/dist/test/sleep.d.ts +1 -0
  121. package/dist/utils/ObjectUtilities.d.ts +82 -95
  122. package/env.d.ts +1 -0
  123. package/package.json +102 -68
  124. package/src/Volver.ts +32 -3
  125. package/src/assets/icons/detailed.json +1 -1
  126. package/src/assets/icons/normal.json +1 -1
  127. package/src/assets/icons/simple.json +1 -1
  128. package/src/components/VvAccordion/VvAccordion.vue +80 -76
  129. package/src/components/VvAccordion/index.ts +69 -0
  130. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +77 -41
  131. package/src/components/VvAccordionGroup/{VvAccordionGroup.ts → index.ts} +8 -12
  132. package/src/components/VvBadge/VvBadge.vue +14 -10
  133. package/src/components/VvBadge/{VvBadge.ts → index.ts} +0 -0
  134. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +18 -19
  135. package/src/components/VvBreadcrumb/{VvBreadcrumb.ts → index.ts} +1 -1
  136. package/src/components/VvButton/VvButton.vue +123 -113
  137. package/src/components/VvButton/index.ts +147 -0
  138. package/src/components/VvButtonGroup/VvButtonGroup.vue +21 -17
  139. package/src/components/VvButtonGroup/{VvButtonGroup.ts → index.ts} +0 -0
  140. package/src/components/VvCard/VvCard.vue +20 -22
  141. package/src/components/VvCard/{VvCard.ts → index.ts} +0 -0
  142. package/src/components/VvCheckbox/VvCheckbox.vue +124 -0
  143. package/src/components/VvCheckbox/index.ts +94 -0
  144. package/src/components/{VvCheckGroup/VvCheckGroup.vue → VvCheckboxGroup/VvCheckboxGroup.vue} +49 -54
  145. package/src/components/{VvCheckGroup/VvCheckGroup.ts → VvCheckboxGroup/index.ts} +9 -9
  146. package/src/components/VvDialog/VvDialog.vue +47 -50
  147. package/src/components/VvDialog/index.ts +10 -0
  148. package/src/components/VvDropdown/VvDropdown.vue +61 -40
  149. package/src/components/VvDropdown/{VvDropdown.ts → index.ts} +8 -4
  150. package/src/components/VvIcon/VvIcon.vue +31 -25
  151. package/src/components/VvIcon/{VvIcon.ts → index.ts} +9 -0
  152. package/src/components/VvInputText/VvInputClearAction.ts +53 -0
  153. package/src/components/VvInputText/VvInputPasswordAction.ts +70 -0
  154. package/src/components/VvInputText/VvInputStepAction.ts +49 -0
  155. package/src/components/VvInputText/VvInputText.vue +168 -170
  156. package/src/components/VvInputText/VvInputTextActions.ts +54 -108
  157. package/src/components/VvInputText/index.ts +135 -0
  158. package/src/components/VvNativeSelect/VvNativeSelect.vue +130 -68
  159. package/src/components/VvNativeSelect/{VvNativeSelect.ts → index.ts} +26 -7
  160. package/src/components/VvProgress/VvProgress.vue +25 -26
  161. package/src/components/VvProgress/{VvProgress.ts → index.ts} +4 -7
  162. package/src/components/VvRadio/VvRadio.vue +81 -108
  163. package/src/components/VvRadio/index.ts +78 -0
  164. package/src/components/VvRadioGroup/VvRadioGroup.vue +45 -45
  165. package/src/components/VvRadioGroup/{VvRadioGroup.ts → index.ts} +1 -1
  166. package/src/components/VvSelect/VvSelect.vue +90 -69
  167. package/src/components/VvSelect/{VvSelect.ts → index.ts} +12 -5
  168. package/src/components/VvTextarea/VvTextarea.vue +121 -128
  169. package/src/components/VvTextarea/{VvTextarea.ts → index.ts} +31 -11
  170. package/src/components/common/HintSlot.ts +157 -136
  171. package/src/components/index.ts +13 -6
  172. package/src/composables/debouncedInput/useDebouncedInput.ts +21 -15
  173. package/src/composables/focus/useComponentFocus.ts +6 -8
  174. package/src/composables/group/types/IAccordionGroupState.ts +1 -3
  175. package/src/composables/group/types/IGroupState.ts +2 -2
  176. package/src/composables/group/useInjectedGroupState.ts +20 -30
  177. package/src/composables/group/useProvideGroupState.ts +1 -2
  178. package/src/composables/icons/useComponentIcons.ts +2 -3
  179. package/src/composables/options/useOptions.ts +3 -0
  180. package/src/composables/textLimit/useTextLimit.ts +1 -4
  181. package/src/composables/useModifiers.ts +13 -15
  182. package/src/constants.ts +5 -7
  183. package/src/directives/{.README → .gitkeep} +0 -0
  184. package/src/icons.ts +7 -0
  185. package/src/index.ts +0 -1
  186. package/src/props/index.ts +7 -1
  187. package/src/resolvers/unplugin.ts +103 -0
  188. package/src/shims.d.ts +11 -0
  189. package/src/stories/Accordion/Accordion.stories.mdx +10 -9
  190. package/src/stories/Accordion/Accordion.test.ts +37 -0
  191. package/src/stories/Accordion/AccordionSlots.stories.mdx +40 -25
  192. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +10 -16
  193. package/src/stories/AccordionGroup/{accordionGroupTest.js → AccordionGroup.test.js} +15 -17
  194. package/src/stories/AccordionGroup/AccordionGroupCollapse.stories.mdx +38 -0
  195. package/src/stories/AccordionGroup/{AccordionItems.stories.mdx → AccordionGroupItems.stories.mdx} +7 -13
  196. package/src/stories/Badge/Badge.stories.mdx +8 -8
  197. package/src/stories/Badge/Badge.test.ts +16 -0
  198. package/src/stories/Badge/BadgeColor.stories.mdx +6 -7
  199. package/src/stories/Badge/BadgeDot.stories.mdx +4 -3
  200. package/src/stories/Badge/BadgeModifiers.stories.mdx +7 -6
  201. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +15 -7
  202. package/src/stories/Breadcrumb/Breadcrumb.test.ts +49 -0
  203. package/src/stories/Breadcrumb/BreadcrumbMultiline.stories.mdx +15 -7
  204. package/src/stories/Button/Button.stories.mdx +16 -17
  205. package/src/stories/Button/Button.test.ts +8 -12
  206. package/src/stories/Button/ButtonActive.stories.mdx +2 -1
  207. package/src/stories/Button/ButtonBadge.stories.mdx +2 -2
  208. package/src/stories/Button/ButtonDisabled.stories.mdx +1 -1
  209. package/src/stories/Button/ButtonIcon.stories.mdx +6 -3
  210. package/src/stories/Button/ButtonIconPosition.stories.mdx +1 -1
  211. package/src/stories/Button/ButtonLink.stories.mdx +1 -19
  212. package/src/stories/Button/ButtonLoading.stories.mdx +4 -4
  213. package/src/stories/Button/ButtonModifiers.stories.mdx +1 -1
  214. package/src/stories/Button/ButtonPressed.stories.mdx +31 -0
  215. package/src/stories/Button/ButtonSlots.stories.mdx +1 -1
  216. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +5 -6
  217. package/src/stories/ButtonGroup/{ButtonGroupTest.js → ButtonGroup.test.js} +6 -28
  218. package/src/stories/ButtonGroup/ButtonGroupAction.stories.mdx +5 -6
  219. package/src/stories/ButtonGroup/ButtonGroupActionQuiet.stories.mdx +3 -4
  220. package/src/stories/ButtonGroup/ButtonGroupBlock.stories.mdx +3 -4
  221. package/src/stories/ButtonGroup/ButtonGroupCompact.stories.mdx +3 -4
  222. package/src/stories/ButtonGroup/ButtonGroupRounded.stories.mdx +3 -4
  223. package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +11 -12
  224. package/src/stories/ButtonGroup/ButtonGroupVertical.stories.mdx +3 -4
  225. package/src/stories/Card/Card.stories.mdx +7 -5
  226. package/src/stories/Card/Card.test.ts +26 -0
  227. package/src/stories/Card/CardSlots.stories.mdx +5 -5
  228. package/src/stories/Card/CardVariant.stories.mdx +5 -4
  229. package/src/stories/Checkbox/Checkbox.stories.mdx +51 -0
  230. package/src/stories/Checkbox/Checkbox.test.js +115 -0
  231. package/src/stories/Checkbox/CheckboxBinary.stories.mdx +76 -0
  232. package/src/stories/{Check/CheckDisabled.stories.mdx → Checkbox/CheckboxDisabled.stories.mdx} +7 -7
  233. package/src/stories/Checkbox/CheckboxError.stories.mdx +43 -0
  234. package/src/stories/Checkbox/CheckboxHintLabel.stories.mdx +35 -0
  235. package/src/stories/{Check/CheckReadonly.stories.mdx → Checkbox/CheckboxReadonly.stories.mdx} +6 -8
  236. package/src/stories/Checkbox/CheckboxSlots.stories.mdx +69 -0
  237. package/src/stories/{Check/CheckSwitch.stories.mdx → Checkbox/CheckboxSwitch.stories.mdx} +8 -8
  238. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +69 -0
  239. package/src/stories/CheckboxGroup/CheckboxGroupDisabled.stories.mdx +26 -0
  240. package/src/stories/CheckboxGroup/CheckboxGroupError.stories.mdx +28 -0
  241. package/src/stories/CheckboxGroup/CheckboxGroupHintLabel.stories.mdx +27 -0
  242. package/src/stories/CheckboxGroup/CheckboxGroupLabel.stories.mdx +26 -0
  243. package/src/stories/{CheckGroup/CheckGroupOptionLabel.stories.mdx → CheckboxGroup/CheckboxGroupOptionLabel.stories.mdx} +14 -11
  244. package/src/stories/{CheckGroup/CheckGroupOptionValue.stories.mdx → CheckboxGroup/CheckboxGroupOptionValue.stories.mdx} +13 -10
  245. package/src/stories/{CheckGroup/CheckGroupOptions.stories.mdx → CheckboxGroup/CheckboxGroupOptions.stories.mdx} +8 -8
  246. package/src/stories/CheckboxGroup/CheckboxGroupReadonly.stories.mdx +26 -0
  247. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +152 -0
  248. package/src/stories/CheckboxGroup/CheckboxGroupValid.stories.mdx +28 -0
  249. package/src/stories/CheckboxGroup/CheckboxGroupVertical.stories.mdx +26 -0
  250. package/src/stories/Dialog/Dialog.stories.mdx +5 -5
  251. package/src/stories/Dialog/Dialog.test.ts +26 -0
  252. package/src/stories/Dialog/DialogAutoClose.stories.mdx +1 -1
  253. package/src/stories/Dialog/DialogSize.stories.mdx +1 -1
  254. package/src/stories/Dropdown/Dropdown.stories.mdx +11 -7
  255. package/src/stories/Dropdown/Dropdown.test.ts +80 -0
  256. package/src/stories/Dropdown/DropdownDisabled.stories.mdx +9 -2
  257. package/src/stories/Dropdown/DropdownLabelNoResults.stories.mdx +2 -2
  258. package/src/stories/Dropdown/DropdownMaxValues.stories.mdx +4 -2
  259. package/src/stories/Dropdown/DropdownMultiple.stories.mdx +4 -2
  260. package/src/stories/Dropdown/DropdownOptions.stories.mdx +4 -4
  261. package/src/stories/Dropdown/DropdownUseObject.stories.mdx +4 -2
  262. package/src/stories/Icon/Icon.stories.mdx +8 -8
  263. package/src/stories/Icon/{IconTest.js → Icon.test.js} +2 -5
  264. package/src/stories/Icon/IconList.vue +5 -6
  265. package/src/stories/Icon/IconPrefix.stories.mdx +2 -2
  266. package/src/stories/Icon/IconRemote.stories.mdx +2 -2
  267. package/src/stories/Icon/IconsList.stories.mdx +2 -18
  268. package/src/stories/InputText/InputText.stories.mdx +25 -19
  269. package/src/stories/InputText/InputText.test.ts +156 -0
  270. package/src/stories/InputText/InputTextAutocomplete.stories.mdx +9 -2
  271. package/src/stories/InputText/InputTextAutofocus.stories.mdx +6 -3
  272. package/src/stories/InputText/InputTextDisabled.stories.mdx +10 -2
  273. package/src/stories/InputText/InputTextError.stories.mdx +10 -2
  274. package/src/stories/InputText/InputTextFloating.stories.mdx +10 -3
  275. package/src/stories/InputText/InputTextHintLabel.stories.mdx +10 -2
  276. package/src/stories/InputText/InputTextIcon.stories.mdx +6 -2
  277. package/src/stories/InputText/InputTextIconPosition.stories.mdx +10 -3
  278. package/src/stories/InputText/InputTextLabel.stories.mdx +8 -2
  279. package/src/stories/InputText/InputTextLoading.stories.mdx +10 -2
  280. package/src/stories/InputText/InputTextMax.stories.mdx +10 -3
  281. package/src/stories/InputText/InputTextMaxLength.stories.mdx +22 -5
  282. package/src/stories/InputText/InputTextMin.stories.mdx +10 -3
  283. package/src/stories/InputText/InputTextMinLength.stories.mdx +9 -2
  284. package/src/stories/InputText/InputTextPlaceholder.stories.mdx +8 -2
  285. package/src/stories/InputText/InputTextReadonly.stories.mdx +6 -2
  286. package/src/stories/InputText/InputTextSlots.stories.mdx +4 -5
  287. package/src/stories/InputText/InputTextStep.stories.mdx +9 -3
  288. package/src/stories/InputText/InputTextType.stories.mdx +110 -13
  289. package/src/stories/InputText/InputTextValid.stories.mdx +10 -2
  290. package/src/stories/NativeSelect/NativeSelect.stories.mdx +15 -11
  291. package/src/stories/NativeSelect/NativeSelect.test.js +151 -0
  292. package/src/stories/NativeSelect/NativeSelectDisabled.stories.mdx +6 -7
  293. package/src/stories/NativeSelect/NativeSelectError.stories.mdx +7 -3
  294. package/src/stories/NativeSelect/NativeSelectHintLabel.stories.mdx +7 -3
  295. package/src/stories/NativeSelect/NativeSelectIconLeftRight.stories.mdx +14 -12
  296. package/src/stories/NativeSelect/NativeSelectLoading.stories.mdx +7 -3
  297. package/src/stories/NativeSelect/NativeSelectOptions.stories.mdx +44 -38
  298. package/src/stories/NativeSelect/NativeSelectReadonly.stories.mdx +19 -11
  299. package/src/stories/NativeSelect/NativeSelectUseObject.stories.mdx +26 -30
  300. package/src/stories/NativeSelect/NativeSelectValid.stories.mdx +7 -3
  301. package/src/stories/NativeSelect/NativeSelectValueKey.stories.mdx +30 -30
  302. package/src/stories/Progress/Progress.stories.mdx +8 -11
  303. package/src/stories/Progress/{ProgressTest.js → Progress.test.js} +4 -10
  304. package/src/stories/Progress/ProgressDeterminate.stories.mdx +3 -6
  305. package/src/stories/Radio/Radio.stories.mdx +11 -17
  306. package/src/stories/Radio/Radio.test.ts +52 -0
  307. package/src/stories/Radio/RadioDisabled.stories.mdx +4 -7
  308. package/src/stories/Radio/RadioError.stories.mdx +8 -28
  309. package/src/stories/Radio/RadioHintLabel.stories.mdx +6 -7
  310. package/src/stories/Radio/RadioSlots.stories.mdx +21 -7
  311. package/src/stories/RadioGroup/RadioGroup.stories.mdx +20 -27
  312. package/src/stories/RadioGroup/RadioGroup.test.ts +139 -0
  313. package/src/stories/RadioGroup/RadioGroupDisabled.stories.mdx +6 -8
  314. package/src/stories/RadioGroup/RadioGroupError.stories.mdx +9 -11
  315. package/src/stories/RadioGroup/RadioGroupHintLabel.stories.mdx +8 -10
  316. package/src/stories/RadioGroup/RadioGroupLabel.stories.mdx +6 -8
  317. package/src/stories/RadioGroup/RadioGroupOptionLabel.stories.mdx +11 -13
  318. package/src/stories/RadioGroup/RadioGroupOptionValue.stories.mdx +9 -11
  319. package/src/stories/RadioGroup/RadioGroupOptions.stories.mdx +7 -9
  320. package/src/stories/RadioGroup/RadioGroupReadonly.stories.mdx +6 -8
  321. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +39 -62
  322. package/src/stories/RadioGroup/RadioGroupValid.stories.mdx +9 -11
  323. package/src/stories/RadioGroup/RadioGroupVertical.stories.mdx +6 -8
  324. package/src/stories/Select/Select.stories.mdx +32 -29
  325. package/src/stories/Select/Select.test.ts +104 -0
  326. package/src/stories/Select/SelectDisabled.stories.mdx +3 -3
  327. package/src/stories/Select/SelectMaxValues.stories.mdx +3 -3
  328. package/src/stories/Select/SelectMultiple.stories.mdx +5 -6
  329. package/src/stories/Select/SelectNative.stories.mdx +6 -8
  330. package/src/stories/Select/SelectOptions.stories.mdx +4 -4
  331. package/src/stories/Select/SelectSearchable.stories.mdx +13 -12
  332. package/src/stories/Select/SelectSeparator.stories.mdx +3 -3
  333. package/src/stories/Select/SelectUseObject.stories.mdx +3 -3
  334. package/src/stories/Textarea/Textarea.stories.mdx +6 -10
  335. package/src/stories/Textarea/Textarea.test.ts +204 -0
  336. package/src/stories/Textarea/TextareaAutoclear.stories.mdx +3 -2
  337. package/src/stories/Textarea/TextareaAutocomplete.stories.mdx +3 -2
  338. package/src/stories/Textarea/TextareaAutofocus.stories.mdx +3 -2
  339. package/src/stories/Textarea/TextareaDebounce.stories.mdx +7 -6
  340. package/src/stories/Textarea/TextareaDisabled.stories.mdx +9 -3
  341. package/src/stories/Textarea/TextareaError.stories.mdx +7 -2
  342. package/src/stories/Textarea/TextareaErrorLabel.stories.mdx +12 -2
  343. package/src/stories/Textarea/TextareaFloating.stories.mdx +7 -2
  344. package/src/stories/Textarea/TextareaHintLabel.stories.mdx +7 -2
  345. package/src/stories/Textarea/TextareaIcon.stories.mdx +3 -2
  346. package/src/stories/Textarea/TextareaIconPosition.stories.mdx +4 -2
  347. package/src/stories/Textarea/TextareaId.stories.mdx +3 -2
  348. package/src/stories/Textarea/TextareaLabel.stories.mdx +3 -2
  349. package/src/stories/Textarea/TextareaLimit.stories.mdx +5 -2
  350. package/src/stories/Textarea/TextareaLoading.stories.mdx +7 -2
  351. package/src/stories/Textarea/TextareaLoadingLabel.stories.mdx +9 -3
  352. package/src/stories/Textarea/TextareaMaxLength.stories.mdx +5 -4
  353. package/src/stories/Textarea/TextareaMinLength.stories.mdx +3 -2
  354. package/src/stories/Textarea/TextareaModifiers.stories.mdx +10 -2
  355. package/src/stories/Textarea/TextareaName.stories.mdx +3 -2
  356. package/src/stories/Textarea/TextareaPlaceholder.stories.mdx +4 -3
  357. package/src/stories/Textarea/TextareaReadonly.stories.mdx +8 -3
  358. package/src/stories/Textarea/TextareaRequired.stories.mdx +3 -2
  359. package/src/stories/Textarea/TextareaResizable.stories.mdx +7 -2
  360. package/src/stories/Textarea/TextareaRowsCols.stories.mdx +4 -2
  361. package/src/stories/Textarea/TextareaSlots.stories.mdx +7 -8
  362. package/src/stories/Textarea/TextareaValid.stories.mdx +7 -1
  363. package/src/stories/Textarea/TextareaValidLabel.stories.mdx +14 -4
  364. package/src/stories/utils.ts +1 -1
  365. package/src/stories/volver-ui-vue.stories.mdx +1 -1
  366. package/src/test/expect.ts +3 -1
  367. package/src/test/sleep.ts +2 -0
  368. package/src/test/types.d.ts +14 -1
  369. package/src/types/{.README → .gitkeep} +0 -0
  370. package/src/utils/ObjectUtilities.ts +247 -241
  371. package/dist/components/VvAccordion/VvAccordion.d.ts +0 -32
  372. package/dist/components/VvAccordion/useAccordionProps.d.ts +0 -16
  373. package/dist/components/VvButton/useButtonGroupProps.d.ts +0 -18
  374. package/dist/components/VvCheck/VvCheck.d.ts +0 -47
  375. package/dist/components/VvCheck/VvCheck.es.js +0 -318
  376. package/dist/components/VvCheck/VvCheck.umd.js +0 -1
  377. package/dist/components/VvCheck/VvCheck.vue.d.ts +0 -165
  378. package/dist/components/VvCheck/useCheckProps.d.ts +0 -16
  379. package/dist/components/VvCheckGroup/VvCheckGroup.es.js +0 -451
  380. package/dist/components/VvCheckGroup/VvCheckGroup.umd.js +0 -2
  381. package/dist/components/VvCheckGroup/VvCheckGroup.vue.d.ts +0 -272
  382. package/dist/components/VvDialog/constants.d.ts +0 -5
  383. package/dist/components/VvInputText/VvInputText.d.ts +0 -73
  384. package/dist/components/VvInputText/constants.d.ts +0 -55
  385. package/dist/components/VvRadio/VvRadio.d.ts +0 -22
  386. package/dist/components/VvRadio/useRadioProps.d.ts +0 -15
  387. package/dist/components/VvTextarea/constants.d.ts +0 -19
  388. package/dist/stories/RadioGroup/RadioOption.test.d.ts +0 -4
  389. package/dist/stories/RadioGroup/RadioProperty.test.d.ts +0 -12
  390. package/dist/stories/RadioGroup/RadioSlots.test.d.ts +0 -6
  391. package/src/assets/icons/index.js +0 -7
  392. package/src/components/VvAccordion/VvAccordion.ts +0 -34
  393. package/src/components/VvAccordion/useAccordionProps.ts +0 -45
  394. package/src/components/VvButton/VvButton.ts +0 -87
  395. package/src/components/VvButton/useButtonGroupProps.ts +0 -43
  396. package/src/components/VvCheck/VvCheck.ts +0 -48
  397. package/src/components/VvCheck/VvCheck.vue +0 -147
  398. package/src/components/VvCheck/useCheckProps.ts +0 -41
  399. package/src/components/VvDialog/VvDialog.ts +0 -17
  400. package/src/components/VvDialog/constants.ts +0 -5
  401. package/src/components/VvInputText/VvInputText.ts +0 -66
  402. package/src/components/VvInputText/constants.ts +0 -34
  403. package/src/components/VvRadio/VvRadio.ts +0 -25
  404. package/src/components/VvRadio/useRadioProps.ts +0 -40
  405. package/src/components/VvTextarea/constants.ts +0 -14
  406. package/src/stories/Accordion/AccordionBordered.stories.mdx +0 -26
  407. package/src/stories/Accordion/AccordionIconRight.stories.mdx +0 -32
  408. package/src/stories/Accordion/accordionTest.js +0 -36
  409. package/src/stories/AccordionGroup/Accordion.stories.mdx +0 -42
  410. package/src/stories/Badge/BadgeTest.js +0 -21
  411. package/src/stories/Button/ButtonSelected.stories.mdx +0 -30
  412. package/src/stories/Check/Check.stories.mdx +0 -62
  413. package/src/stories/Check/CheckBinary.stories.mdx +0 -75
  414. package/src/stories/Check/CheckError.stories.mdx +0 -64
  415. package/src/stories/Check/CheckErrorTests.js +0 -74
  416. package/src/stories/Check/CheckHintLabel.stories.mdx +0 -30
  417. package/src/stories/Check/CheckPropertyTest.js +0 -102
  418. package/src/stories/Check/CheckSlots.stories.mdx +0 -51
  419. package/src/stories/CheckGroup/CheckGroup.stories.mdx +0 -69
  420. package/src/stories/CheckGroup/CheckGroupDisabled.stories.mdx +0 -26
  421. package/src/stories/CheckGroup/CheckGroupError.stories.mdx +0 -28
  422. package/src/stories/CheckGroup/CheckGroupHintLabel.stories.mdx +0 -27
  423. package/src/stories/CheckGroup/CheckGroupLabel.stories.mdx +0 -26
  424. package/src/stories/CheckGroup/CheckGroupReadonly.stories.mdx +0 -26
  425. package/src/stories/CheckGroup/CheckGroupSlots.stories.mdx +0 -152
  426. package/src/stories/CheckGroup/CheckGroupValid.stories.mdx +0 -28
  427. package/src/stories/CheckGroup/CheckGroupVertical.stories.mdx +0 -26
  428. package/src/stories/RadioGroup/RadioOption.test.ts +0 -45
  429. package/src/stories/RadioGroup/RadioProperty.test.ts +0 -87
  430. package/src/stories/RadioGroup/RadioSlots.test.ts +0 -29
  431. package/src/stories/stories.scss +0 -13
@@ -1,145 +1,296 @@
1
- import { computed as d, unref as i, defineComponent as L, ref as C, toRefs as U, inject as ve, openBlock as O, createBlock as k, mergeProps as $, createCommentVNode as x, h as P, watch as ne, useSlots as ye, useAttrs as ge, onMounted as he, createElementBlock as N, toDisplayString as G, createElementVNode as J, renderSlot as V, normalizeProps as K, createVNode as M, withDirectives as Se, isRef as Ae, vModelDynamic as Ee, guardReactiveProps as be, createTextVNode as Ie } from "vue";
2
- import { iconExists as j, Icon as Oe, addIcon as Pe } from "@iconify/vue";
3
- import { toReactive as Te, useFocus as _e, refDebounced as xe, isString as Q } from "@vueuse/core";
4
- const A = {
5
- equals(t, n, e) {
6
- return e ? this.resolveFieldData(t, e) === this.resolveFieldData(n, e) : this.deepEquals(t, n);
7
- },
8
- deepEquals(t, n) {
9
- if (t === n)
10
- return !0;
11
- if (t && n && typeof t == "object" && typeof n == "object") {
12
- const e = Array.isArray(t), o = Array.isArray(n);
13
- let r, s, a;
14
- if (e && o) {
15
- if (s = t.length, s != n.length)
16
- return !1;
17
- for (r = s; r-- !== 0; )
18
- if (!this.deepEquals(t[r], n[r]))
19
- return !1;
20
- return !0;
1
+ import { unref as s, toRefs as K, computed as r, h as S, watch as Te, defineComponent as O, ref as N, inject as Pe, openBlock as w, createBlock as _, mergeProps as A, createCommentVNode as D, useSlots as Ie, onMounted as Ce, createElementBlock as q, normalizeClass as _e, toDisplayString as ie, createElementVNode as se, renderSlot as z, normalizeProps as X, createVNode as re, withDirectives as Ae, isRef as De, vModelDynamic as xe, guardReactiveProps as Oe, createTextVNode as Re } from "vue";
2
+ import { nanoid as He } from "nanoid";
3
+ import { toReactive as Ve, useFocus as ke, isString as ae } from "@vueuse/core";
4
+ import { iconExists as k, Icon as Le, addIcon as Ne } from "@iconify/vue";
5
+ function le(n, t) {
6
+ if (n && Object.keys(n).length && t) {
7
+ if (t.indexOf(".") === -1)
8
+ return n[t];
9
+ {
10
+ const e = t.split(".");
11
+ let i = n;
12
+ for (let o = 0, u = e.length; o < u; ++o) {
13
+ if (n == null)
14
+ return null;
15
+ i = i[e[o]];
21
16
  }
22
- if (e != o)
23
- return !1;
24
- const p = t instanceof Date, u = n instanceof Date;
25
- if (p != u)
26
- return !1;
27
- if (p && u)
28
- return t.getTime() == n.getTime();
29
- const S = t instanceof RegExp, l = n instanceof RegExp;
30
- if (S != l)
31
- return !1;
32
- if (S && l)
33
- return t.toString() == n.toString();
34
- const c = Object.keys(t);
35
- if (s = c.length, s !== Object.keys(n).length)
36
- return !1;
37
- for (r = s; r-- !== 0; )
38
- if (!Object.prototype.hasOwnProperty.call(n, c[r]))
39
- return !1;
40
- for (r = s; r-- !== 0; )
41
- if (a = c[r], !this.deepEquals(t[a], n[a]))
42
- return !1;
43
- return !0;
17
+ return i;
44
18
  }
45
- return t !== t && n !== n;
46
- },
47
- resolveFieldData(t, n) {
48
- if (t && Object.keys(t).length && n) {
49
- if (n.indexOf(".") === -1)
50
- return t[n];
51
- {
52
- const e = n.split(".");
53
- let o = t;
54
- for (let r = 0, s = e.length; r < s; ++r) {
55
- if (t == null)
56
- return null;
57
- o = o[e[r]];
19
+ } else
20
+ return null;
21
+ }
22
+ function x(n) {
23
+ return ((t) => t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0)(s(n));
24
+ }
25
+ function $e(n) {
26
+ return typeof n == "string" || n instanceof String;
27
+ }
28
+ function ue(n) {
29
+ var t, e;
30
+ if (n)
31
+ return (e = (t = n.match(
32
+ /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
33
+ )) == null ? void 0 : t.join("-")) == null ? void 0 : e.toLowerCase();
34
+ }
35
+ function L(n) {
36
+ return Array.isArray(n) ? n.filter((t) => $e(t)).join(" ") : n;
37
+ }
38
+ function Be(n, t) {
39
+ const {
40
+ error: e,
41
+ valid: i,
42
+ hint: o,
43
+ loading: u
44
+ } = t, {
45
+ hintLabel: a,
46
+ modelValue: b,
47
+ valid: m,
48
+ validLabel: f,
49
+ error: c,
50
+ errorLabel: l,
51
+ ...h
52
+ } = K(n), d = le(h, "loading"), v = le(h, "loadingLabel"), y = r(() => c.value ? !!(c.value && e || l != null && l.value && Array.isArray(l.value) && l.value.length > 0 || l != null && l.value && !x(l)) : !1), R = r(
53
+ () => !!(a && a.value || o)
54
+ ), C = r(
55
+ () => !!(f && f.value || i)
56
+ ), H = r(
57
+ () => !!(d != null && d.value && u || d != null && d.value && (v != null && v.value))
58
+ ), $ = r(
59
+ () => R.value || C || y.value || H.value
60
+ );
61
+ return {
62
+ hasErrors: y,
63
+ hasHint: R,
64
+ hasValid: C,
65
+ hasLoading: H,
66
+ HintSlot: {
67
+ name: "HintSlot",
68
+ props: {
69
+ params: {
70
+ type: Object,
71
+ default: () => ({})
58
72
  }
59
- return o;
73
+ },
74
+ setup(B) {
75
+ const M = r(() => {
76
+ const T = Ve({
77
+ hintLabel: a,
78
+ modelValue: b,
79
+ valid: m,
80
+ validLabel: f,
81
+ error: c,
82
+ errorLabel: l,
83
+ loading: d,
84
+ loadingLabel: v,
85
+ ...B.params
86
+ });
87
+ return c != null && c.value ? (e == null ? void 0 : e(T)) || L(l == null ? void 0 : l.value) || (a == null ? void 0 : a.value) : m != null && m.value ? (i == null ? void 0 : i(T)) || L(f == null ? void 0 : f.value) || (a == null ? void 0 : a.value) : d != null && d.value ? (u == null ? void 0 : u(T)) || L(v == null ? void 0 : v.value) || (a == null ? void 0 : a.value) : (o == null ? void 0 : o(T)) || L(a == null ? void 0 : a.value) || (a == null ? void 0 : a.value);
88
+ });
89
+ return {
90
+ isVisible: $,
91
+ hasErrors: y,
92
+ hasValid: C,
93
+ hintContent: M
94
+ };
95
+ },
96
+ render() {
97
+ if (this.isVisible)
98
+ return S(
99
+ "small",
100
+ {
101
+ role: this.hasErrors || this.hasValid ? "alert" : void 0
102
+ },
103
+ this.hintContent
104
+ );
60
105
  }
61
- } else
62
- return null;
63
- },
64
- isFunction(t) {
65
- return !!(t && t.constructor && t.call && t.apply);
66
- },
67
- findIndexInList(t, n) {
68
- let e = -1;
69
- if (n) {
70
- for (let o = 0; o < n.length; o++)
71
- if (this.equals(n[o], t)) {
72
- e = o;
73
- break;
74
- }
75
106
  }
76
- return e;
77
- },
78
- contains(t, n) {
79
- if (t != null && n && n.length) {
80
- for (const e of n)
81
- if (this.equals(t, e))
82
- return !0;
107
+ };
108
+ }
109
+ function Me(n, t, e) {
110
+ const i = r(
111
+ () => !!(n.value && t.value === "left" || e.iconLeft)
112
+ ), o = r(
113
+ () => !!(n.value && t.value === "right" || e.iconRight)
114
+ ), u = r(
115
+ () => !!(n.value && t.value === "top" || e.iconTop)
116
+ ), a = r(
117
+ () => !!(n.value && t.value === "bottom" || e.iconBottom)
118
+ );
119
+ return {
120
+ hasIconLeft: i,
121
+ hasIconRight: o,
122
+ hasIconTop: u,
123
+ hasIconBottom: a
124
+ };
125
+ }
126
+ function Ye(n, t) {
127
+ const { focused: e } = ke(n);
128
+ return Te(e, (i) => {
129
+ t(i ? "focus" : "blur", s(n));
130
+ }), {
131
+ focused: e
132
+ };
133
+ }
134
+ function Ue(n, t, e = 0) {
135
+ let i;
136
+ return typeof e == "string" && (e = parseInt(e)), r({
137
+ get: () => n == null ? void 0 : n.value,
138
+ set: (o) => {
139
+ i && clearTimeout(i), i = setTimeout(() => {
140
+ t("update:modelValue", o);
141
+ }, e);
83
142
  }
84
- return !1;
85
- },
86
- isEmpty(t) {
87
- return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && typeof t == "object" && Object.keys(t).length === 0;
88
- },
89
- isNotEmpty(t) {
90
- return !this.isEmpty(t);
91
- },
92
- pickBy(t, n) {
93
- return Object.fromEntries(
94
- Object.entries(t).filter(([e]) => n(e))
95
- );
143
+ });
144
+ }
145
+ function Fe(n, t) {
146
+ const e = r(() => {
147
+ const u = s(n);
148
+ return ae(u) ? u.length : 0;
149
+ }), i = r(() => {
150
+ const u = s(n) || "";
151
+ return !ae(u) || t.mode === !1 ? 0 : t.mode === !0 ? u.length : s(t.upperLimit) - u.length;
152
+ }), o = r(() => t.mode === !1 ? "" : t.mode === !0 && t.upperLimit && t.upperLimit > 0 ? `${i.value}/${s(t.upperLimit)}` : i.value);
153
+ return {
154
+ textLength: e,
155
+ textLimitLength: i,
156
+ formattedTextLimitLength: o
157
+ };
158
+ }
159
+ function pe(n, t) {
160
+ const e = { [`${n}`]: !0 };
161
+ return {
162
+ bemCssClasses: r(() => Object.keys(t).reduce((o, u) => {
163
+ const a = s(t[u]) || !1;
164
+ if (!a)
165
+ return o;
166
+ if (u === "modifiers") {
167
+ const b = Array.isArray(a) ? a : a.split(" ");
168
+ return {
169
+ ...o,
170
+ ...b.reduce(
171
+ (m, f) => ({
172
+ ...m,
173
+ [`${n}--${ue(f)}`]: !0
174
+ }),
175
+ {}
176
+ )
177
+ };
178
+ } else
179
+ return {
180
+ ...o,
181
+ [`${n}--${ue(u)}`]: a
182
+ };
183
+ }, e) || {})
184
+ };
185
+ }
186
+ const We = "ds", je = {
187
+ color: String,
188
+ width: {
189
+ type: [String, Number]
96
190
  },
97
- removeFromList(t, n) {
98
- const e = this.findIndexInList(t, n);
99
- return e > -1 ? n.filter((o, r) => r !== e) : n;
191
+ height: {
192
+ type: [String, Number]
100
193
  },
101
- isString(t) {
102
- return typeof t == "string" || t instanceof String;
194
+ name: {
195
+ type: String,
196
+ required: !0
103
197
  },
104
- propsToObject(t) {
105
- return Object.keys(t).reduce((n, e) => {
106
- var o, r, s, a, p;
107
- return this.isFunction(t[e]) ? n[e] = t[e]() : Array.isArray(t[e]) ? n[e] = t[e][0]() : (o = t[e]) != null && o.type && (Array.isArray(t[e].type) ? n[e] = ((r = t[e]) == null ? void 0 : r.default) || ((s = t[e]) == null ? void 0 : s.type[0]()) : n[e] = ((a = t[e]) == null ? void 0 : a.default) || ((p = t[e]) == null ? void 0 : p.type())), n;
108
- }, {});
198
+ provider: {
199
+ type: String
109
200
  },
110
- filterArray(t, n, e) {
111
- return t.filter((o) => n.some((r) => typeof r == "string" ? o[e] == r : this.equals(
112
- o[e],
113
- r[e]
114
- )));
201
+ prefix: {
202
+ type: String,
203
+ default: "normal"
115
204
  },
116
- kebabCase(t) {
117
- var n, e;
118
- if (t)
119
- return (e = (n = t.match(
120
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
121
- )) == null ? void 0 : n.join("-")) == null ? void 0 : e.toLowerCase();
205
+ src: String,
206
+ horizontalFlip: Boolean,
207
+ verticalFlip: Boolean,
208
+ flip: String,
209
+ mode: String,
210
+ inline: Boolean,
211
+ rotate: [Number, String],
212
+ onLoad: Function,
213
+ svg: String,
214
+ modifiers: {
215
+ type: [String, Array]
122
216
  }
123
- }, De = {
217
+ }, qe = {
218
+ name: "VvIcon"
219
+ }, E = /* @__PURE__ */ O({
220
+ ...qe,
221
+ props: je,
222
+ setup(n) {
223
+ const t = n, e = N(!0), { modifiers: i } = K(t), o = Pe(We), { bemCssClasses: u } = pe("vv-icon", {
224
+ modifiers: i
225
+ }), a = r(() => t.provider || (o == null ? void 0 : o.provider)), b = r(() => {
226
+ const c = t.name || "", l = `@${a.value}:${t.prefix}:${t.name}`;
227
+ return k(c) ? c : k(l) ? l : (o == null ? void 0 : o.iconsCollections.find((h) => {
228
+ const d = `@${a.value}:${h.prefix}:${c}`;
229
+ if (k(d))
230
+ return d;
231
+ })) || c;
232
+ });
233
+ function m(c) {
234
+ let l = null;
235
+ if (typeof window > "u") {
236
+ const { JSDOM: y } = require("jsdom");
237
+ l = new y().window;
238
+ }
239
+ return (l ? new l.DOMParser() : new window.DOMParser()).parseFromString(c, "text/html").querySelector("svg");
240
+ }
241
+ function f(c) {
242
+ const l = m(c), h = (l == null ? void 0 : l.innerHTML.trim()) || "";
243
+ l && h && Ne(`@${a.value}:${t.prefix}:${t.name}`, {
244
+ body: h,
245
+ height: l.viewBox.baseVal.height,
246
+ width: l.viewBox.baseVal.width
247
+ });
248
+ }
249
+ return o && (t.src && !k(`@${a.value}:${t.prefix}:${t.name}`) ? (e.value = !1, o.fetchIcon(t.src).then((c) => {
250
+ c && (f(c), e.value = !0);
251
+ }).catch((c) => {
252
+ throw new Error(`During fetch icon: ${c == null ? void 0 : c.message}`);
253
+ })) : t.svg && f(t.svg)), (c, l) => e.value ? (w(), _(s(Le), A({
254
+ key: 0,
255
+ class: s(u)
256
+ }, {
257
+ ...c.$props,
258
+ provider: s(a),
259
+ icon: s(b)
260
+ }), null, 16, ["class"])) : D("", !0);
261
+ }
262
+ }), ze = {
124
263
  valid: Boolean,
125
264
  validLabel: [String, Array]
126
- }, Ce = {
265
+ }, Xe = {
127
266
  error: Boolean,
128
267
  errorLabel: [String, Array]
129
- }, we = {
268
+ }, Ze = {
130
269
  loading: Boolean,
131
270
  loadingLabel: String
132
- }, Re = {
271
+ }, Ge = {
133
272
  modifiers: [String, Array]
134
- }, Ne = {
273
+ }, Je = {
135
274
  hintLabel: { type: String, default: "" }
136
- }, Be = {
275
+ }, Ke = {
137
276
  limit: {
138
277
  type: [Boolean, String],
139
278
  default: !1,
140
- validator: (t) => [!0, !1, "countdown"].includes(t)
279
+ validator: (n) => [!0, !1, "countdown"].includes(n)
141
280
  }
142
- }, w = {
281
+ }, Qe = {
282
+ id: [String, Number],
283
+ name: { type: String, required: !0 },
284
+ autocomplete: { type: String, default: "off" },
285
+ autofocus: Boolean,
286
+ minlength: Number,
287
+ maxlength: Number,
288
+ label: String,
289
+ placeholder: String,
290
+ required: Boolean,
291
+ disabled: Boolean,
292
+ readonly: Boolean
293
+ }, P = {
143
294
  TEXT: "text",
144
295
  PASSWORD: "password",
145
296
  DATE: "date",
@@ -152,576 +303,434 @@ const A = {
152
303
  COLOR: "color",
153
304
  SEARCH: "search",
154
305
  FILE: "file"
155
- }, H = {
306
+ }, J = {
156
307
  LEFT: "left",
157
308
  RIGHT: "right"
158
- }, q = {
159
- PASSWORD_ON: "eye-on",
160
- PASSWORD_OFF: "eye-off",
309
+ }, I = {
310
+ PASSWORD_SHOW: "eye-on",
311
+ PASSWORD_HIDE: "eye-off",
161
312
  DATE: "calendar",
162
313
  TIME: "time",
163
314
  COLOR: "color",
164
- SEARCH: "search"
165
- }, h = {
166
- TYPES: w,
167
- ICON_POSITIONS: H,
168
- TYPES_ICON: q
169
- }, ke = ["update:modelValue", "focus", "blur"], $e = {
170
- ...De,
171
- ...Ce,
172
- ...Ne,
173
- ...we,
174
- ...Re,
175
- ...Be,
176
- modelValue: null,
315
+ SEARCH: "close"
316
+ }, p = {
317
+ TYPES: P,
318
+ ICON_POSITIONS: J,
319
+ TYPES_ICON: I
320
+ }, et = ["update:modelValue", "focus", "blur", "keyup"], tt = {
321
+ ...ze,
322
+ ...Xe,
323
+ ...Je,
324
+ ...Ze,
325
+ ...Ge,
326
+ ...Ke,
327
+ ...Qe,
328
+ modelValue: {
329
+ type: [String, Number],
330
+ default: void 0
331
+ },
177
332
  type: {
178
333
  type: String,
179
- default: w.TEXT,
180
- validator: (t) => Object.values(w).includes(t)
334
+ default: P.TEXT,
335
+ validator: (n) => Object.values(P).includes(n)
181
336
  },
182
- id: String,
183
- name: { type: String, required: !0 },
184
- autocomplete: { type: String, default: "off" },
185
- autofocus: Boolean,
186
- minlength: Number,
187
- maxlength: Number,
188
337
  min: [Number, Date],
189
338
  max: [Number, Date],
190
- step: Number,
191
- label: String,
192
- disabled: Boolean,
193
- readonly: Boolean,
194
- placeholder: String,
195
- icon: { type: String, default: "" },
196
- iconPosition: {
339
+ step: { type: Number, default: 1 },
340
+ labelStepUp: {
197
341
  type: String,
198
- validation: (t) => Object.values(H).includes(t),
199
- default: H.RIGHT
342
+ default: "Increase value"
200
343
  },
201
- floating: Boolean,
202
- debounce: Number,
203
- autoclear: Boolean
204
- }, Le = "ds", Fe = {
205
- color: String,
206
- width: {
207
- type: [String, Number]
344
+ labelStepDown: {
345
+ type: String,
346
+ default: "Decrease value"
208
347
  },
209
- height: {
210
- type: [String, Number]
348
+ labelShowPassword: {
349
+ type: String,
350
+ default: "Show password"
211
351
  },
212
- name: {
352
+ labelHidePassword: {
213
353
  type: String,
214
- required: !0
354
+ default: "Hide password"
215
355
  },
216
- provider: {
217
- type: String
356
+ labelClear: {
357
+ type: String,
358
+ default: "Clear"
218
359
  },
219
- prefix: {
360
+ iconShowPassword: {
220
361
  type: String,
221
- default: "normal"
362
+ default: I.PASSWORD_SHOW
222
363
  },
223
- src: String,
224
- horizontalFlip: Boolean,
225
- verticalFlip: Boolean,
226
- flip: String,
227
- mode: String,
228
- inline: Boolean,
229
- rotate: [Number, String],
230
- onLoad: Function,
231
- svg: String,
232
- modifiers: {
233
- type: [String, Array]
234
- }
235
- };
236
- function Ve(t, n) {
237
- const e = { [`${t}`]: !0 };
238
- return {
239
- bemCssClasses: d(() => Object.keys(n).reduce((r, s) => {
240
- const a = i(n[s]) || !1;
241
- if (!a)
242
- return r;
243
- if (s === "modifiers") {
244
- const p = Array.isArray(a) ? a : [a];
245
- return {
246
- ...r,
247
- ...p.reduce(
248
- (u, S) => ({
249
- ...u,
250
- [`${t}--${A.kebabCase(
251
- S
252
- )}`]: !0
253
- }),
254
- {}
255
- )
256
- };
257
- } else
258
- return {
259
- ...r,
260
- [`${t}--${A.kebabCase(s)}`]: a
261
- };
262
- }, e) || {})
263
- };
264
- }
265
- function Me(t, n) {
266
- const e = { [`${t}`]: !0 };
267
- return Object.keys(n).reduce((o, r) => {
268
- const s = i(n[r]) || !1;
269
- if (!s)
270
- return o;
271
- if (r === "modifiers") {
272
- const a = Array.isArray(s) ? s : [s];
273
- return {
274
- ...o,
275
- ...a.reduce(
276
- (p, u) => ({
277
- ...p,
278
- [`${t}--${A.kebabCase(
279
- u
280
- )}`]: !0
281
- }),
282
- {}
283
- )
284
- };
285
- } else
286
- return {
287
- ...o,
288
- [`${t}--${A.kebabCase(r)}`]: s
289
- };
290
- }, e) || {};
291
- }
292
- const T = /* @__PURE__ */ L({
293
- __name: "VvIcon",
294
- props: Fe,
295
- setup(t) {
296
- const n = t, e = C(!0), { modifiers: o } = U(n), r = ve(Le), { bemCssClasses: s } = Ve("vv-icon", {
297
- modifiers: o
298
- }), a = d(() => n.provider || (r == null ? void 0 : r.provider)), p = d(() => {
299
- const l = n.name || "", c = `@${a.value}:${n.prefix}:${n.name}`;
300
- return j(l) ? l : j(c) ? c : (r == null ? void 0 : r.iconsCollections.find((v) => {
301
- const f = `@${a.value}:${v.prefix}:${l}`;
302
- if (j(f))
303
- return f;
304
- })) || l;
305
- });
306
- function u(l) {
307
- let c = null;
308
- if (typeof window > "u") {
309
- const { JSDOM: b } = require("jsdom");
310
- c = new b().window;
311
- }
312
- return (c ? new c.DOMParser() : new window.DOMParser()).parseFromString(l, "text/html").querySelector("svg");
313
- }
314
- function S(l) {
315
- const c = u(l), v = (c == null ? void 0 : c.innerHTML.trim()) || "";
316
- c && v && Pe(`@${a.value}:${n.prefix}:${n.name}`, {
317
- body: v,
318
- height: c.viewBox.baseVal.height,
319
- width: c.viewBox.baseVal.width
320
- });
321
- }
322
- return r && (n.src ? (e.value = !1, r.fetchIcon(n.src).then((l) => {
323
- l && (S(l), e.value = !0);
324
- }).catch((l) => {
325
- throw new Error(`During fetch icon: ${l == null ? void 0 : l.message}`);
326
- })) : n.svg && S(n.svg)), (l, c) => e.value ? (O(), k(i(Oe), $({
327
- key: 0,
328
- class: i(s)
329
- }, {
330
- ...l.$props,
331
- provider: i(a),
332
- icon: i(p)
333
- }), null, 16, ["class"])) : x("", !0);
334
- }
335
- });
336
- function B(t) {
337
- return Array.isArray(t) ? t.filter((n) => A.isString(n)).reduce((n, e) => n.length > 0 ? n + `
338
- ` + e : e, "") : t;
339
- }
340
- function je(t, n) {
341
- return {
342
- name: "HintSlot",
343
- props: {
344
- params: {
345
- type: Object,
346
- default: () => ({})
347
- }
348
- },
349
- setup(e) {
350
- const o = U(t), {
351
- error: r,
352
- valid: s,
353
- hint: a,
354
- loading: p
355
- } = n, {
356
- hintLabel: u,
357
- modelValue: S,
358
- valid: l,
359
- validLabel: c,
360
- error: v,
361
- errorLabel: f
362
- } = o, y = A.resolveFieldData(o, "loading"), b = A.resolveFieldData(
363
- o,
364
- "loadingLabel"
365
- ), I = d(() => v.value ? !!(v.value && r || (f == null ? void 0 : f.value) && Array.isArray(f.value) && f.value.length > 0 || (f == null ? void 0 : f.value) && A.isNotEmpty(f.value)) : !1), D = d(() => !!(u && u.value || a || s || c && c.value || I.value || (y == null ? void 0 : y.value) && p || (y == null ? void 0 : y.value) && (b == null ? void 0 : b.value))), R = d(() => {
366
- const _ = Te({
367
- hintLabel: u,
368
- modelValue: S,
369
- valid: l,
370
- validLabel: c,
371
- error: v,
372
- errorLabel: f,
373
- loading: y,
374
- loadingLabel: b,
375
- ...e.params
376
- });
377
- return v != null && v.value ? (r == null ? void 0 : r(_)) || B(f == null ? void 0 : f.value) || (u == null ? void 0 : u.value) : l != null && l.value ? (s == null ? void 0 : s(_)) || B(c == null ? void 0 : c.value) || (u == null ? void 0 : u.value) : y != null && y.value ? (p == null ? void 0 : p(_)) || B(b == null ? void 0 : b.value) || (u == null ? void 0 : u.value) : (a == null ? void 0 : a(_)) || B(u == null ? void 0 : u.value) || (u == null ? void 0 : u.value);
378
- });
379
- return {
380
- hasHint: D,
381
- hintContent: R
382
- };
383
- },
384
- render() {
385
- if (this.hasHint)
386
- return P(
387
- "pre",
388
- { style: { "white-space": "pre" } },
389
- this.hintContent
390
- );
391
- }
392
- };
393
- }
394
- const ee = L({
364
+ iconHidePassword: {
365
+ type: String,
366
+ default: I.PASSWORD_HIDE
367
+ },
368
+ iconClear: {
369
+ type: String,
370
+ default: I.SEARCH
371
+ },
372
+ icon: {
373
+ type: [String, Object],
374
+ default: ""
375
+ },
376
+ iconPosition: {
377
+ type: String,
378
+ validation: (n) => Object.values(J).includes(n),
379
+ default: J.RIGHT
380
+ },
381
+ floating: Boolean,
382
+ debounce: [String, Number],
383
+ tabindex: { type: [String, Number], default: 0 }
384
+ }, ce = O({
395
385
  components: {
396
- VvIcon: T
386
+ VvIcon: E
397
387
  },
398
388
  props: {
399
- disabled: Boolean
389
+ disabled: {
390
+ type: Boolean,
391
+ default: !1
392
+ },
393
+ labelShow: {
394
+ type: String,
395
+ default: "Show password"
396
+ },
397
+ labelHide: {
398
+ type: String,
399
+ default: "Hide password"
400
+ },
401
+ iconShow: {
402
+ type: String,
403
+ default: I.PASSWORD_SHOW
404
+ },
405
+ iconHide: {
406
+ type: String,
407
+ default: I.PASSWORD_HIDE
408
+ }
400
409
  },
401
- setup(t, { emit: n }) {
402
- const e = C(!1), o = d(
403
- () => e.value ? q.PASSWORD_OFF : q.PASSWORD_ON
410
+ emits: ["toggle-password"],
411
+ setup(n, { emit: t }) {
412
+ const e = N(!1), i = r(
413
+ () => e.value ? n.iconHide : n.iconShow
404
414
  );
405
- function r() {
406
- t.disabled || (e.value = !e.value, n(
407
- e.value ? "action-password-on" : "action-password-off"
408
- ));
415
+ function o(u) {
416
+ u == null || u.stopPropagation(), n.disabled || (e.value = !e.value, t("toggle-password", e.value));
409
417
  }
410
418
  return {
411
- activeIcon: o,
412
- onClick: r
419
+ active: e,
420
+ activeIcon: i,
421
+ onClick: o
413
422
  };
414
423
  },
415
424
  render() {
416
- const t = P(T, { name: this.activeIcon });
417
- return P(
425
+ const n = S(E, {
426
+ name: this.activeIcon,
427
+ class: "vv-input-text__action-icon"
428
+ });
429
+ return S(
418
430
  "button",
419
431
  {
420
432
  disabled: this.disabled,
421
- class: ["vv-input-text__action"],
433
+ class: "vv-input-text__action",
434
+ ariaLabel: this.active ? this.labelHide : this.labelShow,
435
+ type: "button",
422
436
  onClick: this.onClick
423
437
  },
424
- t
438
+ n
425
439
  );
426
440
  }
427
- }), Y = L({
441
+ }), Z = O({
428
442
  components: {
429
- VvIcon: T
443
+ VvIcon: E
430
444
  },
431
445
  props: {
432
- disabled: Boolean,
446
+ disabled: {
447
+ type: Boolean,
448
+ default: !1
449
+ },
450
+ label: {
451
+ type: String
452
+ },
433
453
  mode: {
434
454
  type: String,
435
- validator: (t) => ["up", "down"].includes(t),
455
+ validator: (n) => ["up", "down"].includes(n),
436
456
  default: "up"
437
457
  }
438
458
  },
439
- setup(t, { emit: n }) {
440
- function e() {
441
- t.disabled || n(
442
- t.mode === "up" ? "action-step-up" : "action-step-down"
443
- );
444
- }
459
+ emits: ["step-up", "step-down"],
460
+ setup(n, { emit: t }) {
461
+ const e = r(() => n.mode === "up");
445
462
  return {
446
- onClick: e
463
+ isUp: e,
464
+ onClick: (o) => {
465
+ o == null || o.stopPropagation(), n.disabled || t(e.value ? "step-up" : "step-down");
466
+ }
447
467
  };
448
468
  },
449
469
  render() {
450
- return P("button", {
470
+ return S("button", {
451
471
  class: [
452
472
  "vv-input-text__action-chevron",
453
- this.mode === "up" && "vv-input-text__action-chevron-up"
473
+ this.isUp && "vv-input-text__action-chevron-up"
454
474
  ],
455
475
  disabled: this.disabled,
476
+ ariaLabel: this.label,
456
477
  onClick: this.onClick
457
478
  });
458
479
  }
480
+ }), de = O({
481
+ components: {
482
+ VvIcon: E
483
+ },
484
+ props: {
485
+ disabled: {
486
+ type: Boolean,
487
+ default: !1
488
+ },
489
+ label: {
490
+ type: String,
491
+ default: "Clear"
492
+ },
493
+ icon: {
494
+ type: String,
495
+ default: "close"
496
+ }
497
+ },
498
+ emits: ["clear"],
499
+ setup(n, { emit: t }) {
500
+ function e(i) {
501
+ i == null || i.stopPropagation(), n.disabled || t("clear");
502
+ }
503
+ return {
504
+ onClick: e
505
+ };
506
+ },
507
+ render() {
508
+ const n = S(E, {
509
+ name: this.icon,
510
+ class: "vv-input-text__action-icon"
511
+ });
512
+ return S(
513
+ "button",
514
+ {
515
+ disabled: this.disabled,
516
+ class: "vv-input-text__action",
517
+ ariaLabel: this.label,
518
+ type: "button",
519
+ onClick: this.onClick
520
+ },
521
+ n
522
+ );
523
+ }
459
524
  });
460
- function te(t, n) {
525
+ function G(n, t) {
461
526
  return {
462
527
  name: "VvInputTextActions",
463
528
  components: {
464
- VvIcon: T,
465
- VvInputPasswordAction: ee,
466
- VvInputStepAction: Y
529
+ VvIcon: E,
530
+ VvInputPasswordAction: ce,
531
+ VvInputStepAction: Z,
532
+ VvInputClearAction: de
467
533
  },
468
534
  setup() {
469
535
  return {
470
- isDisabled: d(() => n.disabled || n.readonly)
536
+ isDisabled: r(() => t.disabled || t.readonly),
537
+ labelStepUp: t.labelStepUp,
538
+ labelStepDown: t.labelStepDown,
539
+ labelShowPassword: t.labelShowPassword,
540
+ labelHidePassword: t.labelHidePassword,
541
+ labelClear: t.labelClear,
542
+ iconShowPassword: t.iconShowPassword,
543
+ iconHidePassword: t.iconHidePassword
471
544
  };
472
545
  },
473
546
  render() {
474
547
  let e = null;
475
- switch (t) {
476
- case w.PASSWORD: {
477
- const { onActionPasswordOn: o, onActionPasswordOff: r } = this.$attrs;
548
+ switch (n) {
549
+ case P.SEARCH: {
550
+ const { onClear: i } = this.$attrs;
478
551
  e = [
479
- P(ee, {
552
+ S(de, {
480
553
  disabled: this.isDisabled,
481
- onActionPasswordOn: o,
482
- onActionPasswordOff: r
554
+ label: this.labelShowPassword,
555
+ onClear: i
483
556
  })
484
557
  ];
485
558
  break;
486
559
  }
487
- case w.NUMBER: {
488
- const { onActionStepUp: o, onActionStepDown: r } = this.$attrs;
560
+ case P.PASSWORD: {
561
+ const { onTogglePassword: i } = this.$attrs;
489
562
  e = [
490
- P(Y, {
491
- mode: "up",
492
- disabled: this.isDisabled,
493
- onActionStepUp: o,
494
- onActionStepDown: r
495
- }),
496
- P(Y, {
497
- mode: "down",
563
+ S(ce, {
498
564
  disabled: this.isDisabled,
499
- onActionStepUp: o,
500
- onActionStepDown: r
565
+ onTogglePassword: i,
566
+ labelShow: this.labelShowPassword,
567
+ labelHide: this.labelHidePassword,
568
+ iconShow: this.iconShowPassword,
569
+ iconHide: this.iconHidePassword
501
570
  })
502
571
  ];
503
572
  break;
504
573
  }
505
- default: {
506
- e = null;
574
+ case P.NUMBER: {
575
+ const { onStepUp: i, onStepDown: o } = this.$attrs;
576
+ e = [
577
+ S(Z, {
578
+ mode: "up",
579
+ disabled: this.isDisabled || t.max !== void 0 && t.modelValue === t.max,
580
+ label: this.labelStepUp,
581
+ onStepUp: i,
582
+ onStepDown: o
583
+ }),
584
+ S(Z, {
585
+ mode: "down",
586
+ disabled: this.isDisabled || t.min !== void 0 && t.modelValue === t.min,
587
+ label: this.labelStepDown,
588
+ onStepUp: i,
589
+ onStepDown: o
590
+ })
591
+ ];
507
592
  break;
508
593
  }
509
594
  }
510
- return Array.isArray(e) ? P("div", { class: "vv-input-text__actions-group" }, e) : e;
595
+ return Array.isArray(e) ? S("div", { class: "vv-input-text__actions-group" }, e) : e;
511
596
  }
512
597
  };
513
598
  }
514
- function Ye(t, n, e) {
515
- const o = d(
516
- () => !!(t.value && n.value === "left" || e.iconLeft)
517
- ), r = d(
518
- () => !!(t.value && n.value === "right" || e.iconRight)
519
- ), s = d(
520
- () => !!(t.value && n.value === "top" || e.iconTop)
521
- ), a = d(
522
- () => !!(t.value && n.value === "bottom" || e.iconBottom)
523
- );
524
- return {
525
- hasIconLeft: o,
526
- hasIconRight: r,
527
- hasIconTop: s,
528
- hasIconBottom: a
529
- };
530
- }
531
- function He(t, n) {
532
- const { focused: e } = _e(t);
533
- return ne(e, (o) => {
534
- n(o ? "focus" : "blur", t.value);
535
- }), {
536
- focused: e
537
- };
538
- }
539
- function qe(t, n, e) {
540
- const o = C(t == null ? void 0 : t.value), r = xe(
541
- o,
542
- n || 0
543
- );
544
- return ne(r, (s) => e("update:modelValue", s)), o;
545
- }
546
- function Ue(t, n) {
547
- const e = d(() => {
548
- const s = i(t);
549
- return Q(s) ? s.length : 0;
550
- }), o = d(() => {
551
- const s = i(t) || "";
552
- return !Q(s) || n.mode === !1 ? 0 : n.mode === !0 ? s.length : i(n.upperLimit) - s.length;
553
- }), r = d(() => n.mode === !1 ? "" : n.mode === !0 && n.upperLimit && n.upperLimit > 0 ? `${o.value}/${i(n.upperLimit)}` : o.value);
554
- return {
555
- textLength: e,
556
- textLimitLength: o,
557
- formattedTextLimitLength: r
558
- };
559
- }
560
- const We = ["for"], ze = { class: "vv-input-text__wrapper" }, Ze = {
561
- key: 2,
599
+ const nt = ["for"], ot = { class: "vv-input-text__wrapper" }, it = ["id", "disabled", "readonly", "required"], st = {
600
+ key: 1,
562
601
  class: "vv-input-text__limit"
563
- }, Xe = {
564
- inheritAttrs: !1
565
- }, Qe = /* @__PURE__ */ L({
566
- ...Xe,
567
- __name: "VvInputText",
568
- props: $e,
569
- emits: ke,
570
- setup(t, { emit: n }) {
571
- const e = t, o = ye(), r = ge(), s = C(), { icon: a, iconPosition: p, label: u, modelValue: S, autoclear: l, limit: c } = U(e), v = e.id || e.name, f = `${e.name}-label`, y = `${e.name}-hint`, b = d(
572
- () => e.floating && A.isEmpty(e.placeholder) ? " " : e.placeholder
573
- ), I = qe(S, e.debounce, n), D = C(!1), R = d(() => e.type === h.TYPES.PASSWORD), _ = d(() => e.type === h.TYPES.NUMBER);
574
- function re() {
575
- const g = e.max;
576
- !Z.value && I.value + 1 <= g && (s.value.stepUp(), I.value = i(s.value).value);
577
- }
578
- function oe() {
579
- const g = e.min;
580
- !Z.value && I.value - 1 <= g && (s.value.stepDown(), I.value = i(s.value).value);
581
- }
582
- const { hasIconLeft: W, hasIconRight: z } = Ye(a, p, {
583
- iconLeft: o["icon-left"],
584
- iconRight: o["icon-right"]
585
- }), F = d(() => {
602
+ }, rt = {
603
+ name: "VvInputText"
604
+ }, dt = /* @__PURE__ */ O({
605
+ ...rt,
606
+ props: tt,
607
+ emits: et,
608
+ setup(n, { emit: t }) {
609
+ const e = n, i = Ie(), o = N(), { icon: u, iconPosition: a, label: b, modelValue: m, limit: f } = K(e), c = r(() => String(e.id || He())), l = r(() => `${c.value}-hint`), h = r(
610
+ () => e.floating && x(e.placeholder) ? " " : e.placeholder
611
+ ), d = Ue(m, t, e.debounce), v = N(!1), y = r(() => e.type === p.TYPES.PASSWORD), R = () => {
612
+ v.value = !v.value;
613
+ }, C = r(
614
+ () => [p.TYPES.TIME, p.TYPES.DATETIME_LOCAL, p.TYPES.DATE].includes(
615
+ e.type
616
+ )
617
+ ), H = r(() => e.type === p.TYPES.NUMBER), $ = () => {
618
+ W.value || (o.value.stepUp(), d.value = s(o).value);
619
+ }, B = () => {
620
+ W.value || (o.value.stepDown(), d.value = s(o).value);
621
+ }, M = r(() => e.type === p.TYPES.SEARCH), T = () => {
622
+ d.value = null;
623
+ }, { hasIconLeft: Q, hasIconRight: Y } = Me(u, a, {
624
+ iconLeft: i["icon-left"],
625
+ iconRight: i["icon-right"]
626
+ }), ee = r(() => typeof u.value == "string" ? { name: u.value } : u.value), U = r(() => {
586
627
  switch (e.type) {
587
- case h.TYPES.PASSWORD:
588
- return h.TYPES_ICON.PASSWORD_OFF;
589
- case h.TYPES.COLOR:
590
- return h.TYPES_ICON.COLOR;
591
- case h.TYPES.DATE:
592
- case h.TYPES.DATETIME_LOCAL:
593
- return h.TYPES_ICON.DATE;
594
- case h.TYPES.TIME:
595
- return h.TYPES_ICON.TIME;
596
- case h.TYPES.SEARCH:
597
- return h.TYPES_ICON.SEARCH;
628
+ case p.TYPES.COLOR:
629
+ return { name: p.TYPES_ICON.COLOR };
630
+ case p.TYPES.DATE:
631
+ case p.TYPES.DATETIME_LOCAL:
632
+ return { name: p.TYPES_ICON.DATE };
633
+ case p.TYPES.TIME:
634
+ return { name: p.TYPES_ICON.TIME };
598
635
  default:
599
636
  return "";
600
637
  }
601
- }), { textLength: se, formattedTextLimitLength: ie } = Ue(I, {
638
+ }), { formattedTextLimitLength: fe } = Fe(d, {
602
639
  mode: e.limit,
603
640
  upperLimit: e.maxlength || 0
604
- }), { focused: ae } = He(s, n), Z = d(() => e.disabled || e.readonly), ue = d(() => {
605
- const g = z.value || A.isNotEmpty(F.value), m = e.floating && A.isNotEmpty(e.label), E = A.isNotEmpty(S == null ? void 0 : S.value);
606
- return [
607
- Me("vv-input-text", {
608
- modifiers: e.modifiers,
609
- readonly: e.readonly,
610
- valid: e.valid,
611
- invalid: e.error,
612
- loading: e.loading,
613
- iconLeft: W,
614
- iconRight: g,
615
- floating: m,
616
- dirty: E
617
- }),
618
- r.class
619
- ];
620
- }), le = d(() => {
621
- const { style: g } = r, m = A.pickBy(
622
- r,
623
- (E) => E.startsWith("data-")
624
- );
625
- return {
626
- style: g,
627
- ...m
628
- };
629
- }), ce = d(() => {
630
- const g = R.value && D.value ? "text" : e.type, m = A.pickBy(
631
- r,
632
- (E) => E.startsWith("aria-")
633
- );
641
+ }), { focused: F } = Ye(o, t), W = r(() => e.disabled || e.readonly), ve = r(() => W.value ? -1 : e.tabindex), te = r(() => !x(m)), me = r(() => {
642
+ if (e.error === !0)
643
+ return !0;
644
+ if (e.valid === !0)
645
+ return !1;
646
+ }), { bemCssClasses: Se } = pe("vv-input-text", {
647
+ modifiers: e.modifiers,
648
+ valid: e.valid,
649
+ invalid: e.error,
650
+ loading: e.loading,
651
+ iconLeft: Q,
652
+ iconRight: Y.value || !x(U),
653
+ floating: e.floating && !x(e.label),
654
+ dirty: te,
655
+ focus: F
656
+ }), he = r(() => {
657
+ const g = (() => y.value && v.value || C.value && !te.value && !F.value ? p.TYPES.TEXT : e.type)();
634
658
  return {
635
- id: v,
636
659
  type: g,
637
- placeholder: b.value,
660
+ placeholder: h.value,
638
661
  name: e.name,
639
662
  autocomplete: e.autocomplete,
640
- disabled: e.disabled,
641
- readonly: e.readonly,
642
663
  minlength: e.minlength,
643
664
  maxlength: e.maxlength,
644
665
  min: e.min,
645
666
  max: e.max,
646
- step: e.step,
647
- "aria-invalid": e.error,
648
- "aria-valid": !e.valid,
649
- "aria-labeledby": f,
650
- "aria-describedby": y,
651
- "aria-errormessage": y,
652
- ...m
653
- };
654
- }), X = d(() => {
655
- const { modelValue: g, valid: m, error: E } = e;
656
- return {
657
- valid: m,
658
- error: E,
659
- modelValue: g
667
+ step: g === p.TYPES.NUMBER ? e.step : void 0,
668
+ tabindex: ve.value,
669
+ "aria-invalid": me.value,
670
+ "aria-describedby": !oe.value && be.value ? l.value : void 0,
671
+ "aria-errormessage": oe.value ? l.value : void 0
660
672
  };
661
- }), de = je(e, o), fe = te(
662
- h.TYPES.PASSWORD,
673
+ }), ne = r(() => ({
674
+ valid: e.valid,
675
+ error: e.error,
676
+ modelValue: e.modelValue
677
+ })), { HintSlot: ge, hasHint: be, hasErrors: oe } = Be(e, i), ye = G(
678
+ p.TYPES.PASSWORD,
663
679
  e
664
- ), pe = te(h.TYPES.NUMBER, e);
665
- function me() {
666
- I.value = null;
667
- }
668
- return he(() => {
669
- e.autofocus && (ae.value = !0);
670
- }), (g, m) => (O(), N("div", $(i(le), { class: i(ue) }), [
671
- i(u) ? (O(), N("label", {
680
+ ), we = G(p.TYPES.NUMBER, e), Ee = G(p.TYPES.SEARCH, e);
681
+ return Ce(() => {
682
+ e.autofocus && (F.value = !0);
683
+ }), (g, V) => (w(), q("div", {
684
+ class: _e(s(Se))
685
+ }, [
686
+ s(b) ? (w(), q("label", {
672
687
  key: 0,
673
- for: i(v)
674
- }, G(i(u)), 9, We)) : x("", !0),
675
- J("div", ze, [
676
- i(W) ? V(g.$slots, "icon-left", K($({ key: 0 }, i(X))), () => [
677
- M(T, {
678
- class: "vv-input-text__icon-left",
679
- name: i(a)
680
- }, null, 8, ["name"])
681
- ]) : x("", !0),
682
- Se(J("input", $({
688
+ for: s(c),
689
+ class: "vv-input-text__label"
690
+ }, ie(s(b)), 9, nt)) : D("", !0),
691
+ se("div", ot, [
692
+ s(Q) ? z(g.$slots, "icon-left", X(A({ key: 0 }, s(ne))), () => [
693
+ re(E, A({ class: "vv-input-text__icon-left" }, s(ee)), null, 16)
694
+ ]) : D("", !0),
695
+ Ae(se("input", A({
696
+ id: s(c),
683
697
  ref_key: "input",
684
- ref: s
685
- }, i(ce), {
686
- "onUpdate:modelValue": m[0] || (m[0] = (E) => Ae(I) ? I.value = E : null),
687
- onInput: m[1] || (m[1] = (E) => n("input", E))
688
- }), null, 16), [
689
- [Ee, i(I)]
698
+ ref: o,
699
+ "onUpdate:modelValue": V[0] || (V[0] = (j) => De(d) ? d.value = j : null)
700
+ }, s(he), {
701
+ disabled: g.disabled,
702
+ readonly: g.readonly,
703
+ required: g.required,
704
+ onKeyup: V[1] || (V[1] = (j) => t("keyup", j))
705
+ }), null, 16, it), [
706
+ [xe, s(d)]
690
707
  ]),
691
- i(l) && i(se) > 0 ? (O(), N("button", {
692
- key: 1,
693
- class: "vv-button vv-button--ghost",
694
- onClick: me
695
- }, [
696
- M(T, { name: "clear-field" })
697
- ])) : x("", !0),
698
- V(g.$slots, "icon-right", K(be(i(X))), () => [
699
- i(R) ? (O(), k(i(fe), {
700
- key: 0,
701
- onActionPasswordOn: m[2] || (m[2] = (E) => D.value = !0),
702
- onActionPasswordOff: m[3] || (m[3] = (E) => D.value = !1)
703
- })) : i(_) ? (O(), k(i(pe), {
708
+ z(g.$slots, "icon-right", X(Oe(s(ne))), () => [
709
+ s(Y) || s(U) ? (w(), _(E, X(A({ key: 0 }, s(Y) ? s(ee) : s(U))), null, 16)) : s(y) ? (w(), _(s(ye), {
704
710
  key: 1,
705
- onActionStepUp: re,
706
- onActionStepDown: oe
707
- })) : i(z) || i(F) ? (O(), k(T, {
711
+ onTogglePassword: R
712
+ })) : s(H) ? (w(), _(s(we), {
708
713
  key: 2,
709
- name: i(a) || i(F)
710
- }, null, 8, ["name"])) : x("", !0)
714
+ onStepUp: $,
715
+ onStepDown: B
716
+ })) : s(M) ? (w(), _(s(Ee), {
717
+ key: 3,
718
+ onClear: T
719
+ })) : D("", !0)
711
720
  ]),
712
- i(c) ? (O(), N("span", Ze, [
713
- V(g.$slots, "limit", {}, () => [
714
- Ie(G(i(ie)), 1)
721
+ s(f) ? (w(), q("span", st, [
722
+ z(g.$slots, "limit", {}, () => [
723
+ Re(ie(s(fe)), 1)
715
724
  ])
716
- ])) : x("", !0)
725
+ ])) : D("", !0)
717
726
  ]),
718
- M(i(de), {
719
- id: y,
727
+ re(s(ge), {
728
+ id: s(l),
720
729
  class: "vv-input-text__hint"
721
- })
722
- ], 16));
730
+ }, null, 8, ["id"])
731
+ ], 2));
723
732
  }
724
733
  });
725
734
  export {
726
- Qe as default
735
+ dt as default
727
736
  };