@volverjs/ui-vue 0.0.13 → 0.0.15

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 (343) hide show
  1. package/dist/Volver.d.ts +121 -0
  2. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +68 -0
  3. package/dist/components/VvAccordion/index.d.ts +47 -0
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +98 -0
  5. package/dist/components/VvAccordionGroup/index.d.ts +54 -0
  6. package/dist/components/VvAction/VvAction.es.js +26 -26
  7. package/dist/components/VvAction/VvAction.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.vue.d.ts +110 -0
  9. package/dist/components/VvAction/index.d.ts +2 -0
  10. package/dist/components/VvAlert/VvAlert.es.js +43 -44
  11. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  12. package/dist/components/VvAlert/VvAlert.vue.d.ts +124 -0
  13. package/dist/components/VvAlert/index.d.ts +104 -0
  14. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -55
  15. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  16. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +97 -0
  17. package/dist/components/VvAlertGroup/index.d.ts +47 -0
  18. package/dist/components/VvAvatar/VvAvatar.vue.d.ts +24 -0
  19. package/dist/components/VvAvatar/index.d.ts +10 -0
  20. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +50 -0
  21. package/dist/components/VvAvatarGroup/index.d.ts +28 -0
  22. package/dist/components/VvBadge/VvBadge.vue.d.ts +24 -0
  23. package/dist/components/VvBadge/index.d.ts +7 -0
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +34 -34
  25. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  26. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +39 -0
  27. package/dist/components/VvBreadcrumb/index.d.ts +8 -0
  28. package/dist/components/VvButton/VvButton.es.js +186 -187
  29. package/dist/components/VvButton/VvButton.umd.js +1 -1
  30. package/dist/components/VvButton/VvButton.vue.d.ts +221 -0
  31. package/dist/components/VvButton/index.d.ts +131 -0
  32. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +84 -0
  33. package/dist/components/VvButtonGroup/index.d.ts +37 -0
  34. package/dist/components/VvCard/VvCard.vue.d.ts +30 -0
  35. package/dist/components/VvCard/index.d.ts +7 -0
  36. package/dist/components/VvCheckbox/VvCheckbox.es.js +215 -217
  37. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  38. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +187 -0
  39. package/dist/components/VvCheckbox/index.d.ts +94 -0
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +235 -237
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  42. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +212 -0
  43. package/dist/components/VvCheckboxGroup/index.d.ts +2 -0
  44. package/dist/components/VvCombobox/VvCombobox.es.js +810 -813
  45. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  46. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +346 -0
  47. package/dist/components/VvCombobox/index.d.ts +694 -0
  48. package/dist/components/VvDialog/VvDialog.vue.d.ts +73 -0
  49. package/dist/components/VvDialog/index.d.ts +45 -0
  50. package/dist/components/VvDropdown/VvDropdown.es.js +4 -4
  51. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  52. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +258 -0
  53. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +118 -0
  54. package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +22 -0
  55. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +22 -0
  56. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +82 -0
  57. package/dist/components/VvDropdown/index.d.ts +120 -0
  58. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +50 -50
  59. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  60. package/dist/components/VvIcon/VvIcon.es.js +30 -31
  61. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  62. package/dist/components/VvIcon/VvIcon.vue.d.ts +6 -0
  63. package/dist/components/VvIcon/index.d.ts +86 -0
  64. package/dist/components/VvInputFile/VvInputFile.es.js +415 -418
  65. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  66. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +361 -0
  67. package/dist/components/VvInputFile/index.d.ts +204 -0
  68. package/dist/components/VvInputText/VvInputText.es.js +595 -588
  69. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  70. package/dist/components/VvInputText/VvInputText.vue.d.ts +524 -0
  71. package/dist/components/VvInputText/VvInputTextActions.d.ts +4 -0
  72. package/dist/components/VvInputText/index.d.ts +313 -0
  73. package/dist/components/VvNav/VvNav.es.js +63 -63
  74. package/dist/components/VvNav/VvNav.umd.js +1 -1
  75. package/dist/components/VvNav/VvNav.vue.d.ts +48 -0
  76. package/dist/components/VvNav/VvNavItem.vue.d.ts +14 -0
  77. package/dist/components/VvNav/VvNavSeparator.vue.d.ts +3 -0
  78. package/dist/components/VvNav/index.d.ts +11 -0
  79. package/dist/components/VvNavItem/VvNavItem.es.js +41 -41
  80. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  81. package/dist/components/VvProgress/VvProgress.vue.d.ts +38 -0
  82. package/dist/components/VvProgress/index.d.ts +33 -0
  83. package/dist/components/VvRadio/VvRadio.es.js +222 -224
  84. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  85. package/dist/components/VvRadio/VvRadio.vue.d.ts +179 -0
  86. package/dist/components/VvRadio/index.d.ts +80 -0
  87. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +234 -236
  88. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  89. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +212 -0
  90. package/dist/components/VvRadioGroup/index.d.ts +2 -0
  91. package/dist/components/VvSelect/VvSelect.es.js +200 -203
  92. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  93. package/dist/components/VvSelect/VvSelect.vue.d.ts +183 -0
  94. package/dist/components/VvSelect/index.d.ts +298 -0
  95. package/dist/components/VvTab/VvTab.es.js +35 -35
  96. package/dist/components/VvTab/VvTab.umd.js +1 -1
  97. package/dist/components/VvTab/VvTab.vue.d.ts +64 -0
  98. package/dist/components/VvTab/index.d.ts +19 -0
  99. package/dist/components/VvTextarea/VvTextarea.es.js +341 -344
  100. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  101. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +384 -0
  102. package/dist/components/VvTextarea/index.d.ts +190 -0
  103. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +37 -0
  104. package/dist/components/VvTooltip/index.d.ts +19 -0
  105. package/dist/components/VvVirtualScroll/VvVirtualScroll.vue.d.ts +51 -0
  106. package/dist/components/common/HintSlot.d.ts +57 -0
  107. package/dist/components/common/VvInputClearAction.d.ts +52 -0
  108. package/dist/components/common/VvInputPasswordAction.d.ts +71 -0
  109. package/dist/components/common/VvInputStepAction.d.ts +50 -0
  110. package/dist/components/index.d.ts +34 -0
  111. package/dist/components/index.es.js +1965 -1958
  112. package/dist/components/index.umd.js +1 -1
  113. package/dist/composables/alert/useAlerInject.d.ts +4 -0
  114. package/dist/composables/alert/useAlert.d.ts +92 -0
  115. package/dist/composables/alert/useAlertProvide.d.ts +10 -0
  116. package/dist/composables/dropdown/useDropdownContextmenu.d.ts +18 -0
  117. package/dist/composables/dropdown/useDropdownInject.d.ts +12 -0
  118. package/dist/composables/dropdown/useDropdownProvide.d.ts +40 -0
  119. package/dist/composables/dropdown/useDropdownVirtualElement.d.ts +17 -0
  120. package/dist/composables/group/useGroupStateInject.d.ts +9 -0
  121. package/dist/composables/group/useGroupStateProvide.d.ts +6 -0
  122. package/dist/composables/index.d.ts +5 -0
  123. package/dist/composables/index.es.js +34 -34
  124. package/dist/composables/index.umd.js +2 -2
  125. package/dist/composables/useBlurhash.d.ts +7 -0
  126. package/dist/composables/useComponentFocus.d.ts +4 -0
  127. package/dist/composables/useComponentIcon.d.ts +11 -0
  128. package/dist/composables/useDebouncedInput.d.ts +5 -0
  129. package/dist/composables/useDefaults.d.ts +2 -0
  130. package/dist/composables/useModifiers.d.ts +2 -0
  131. package/dist/composables/useOptions.d.ts +8 -0
  132. package/dist/composables/usePersistence.d.ts +3 -0
  133. package/dist/composables/useTextCount.d.ts +10 -0
  134. package/dist/composables/useUniqueId.d.ts +2 -0
  135. package/dist/composables/useVirtualScroll.d.ts +35 -0
  136. package/dist/composables/useVolver.d.ts +4 -0
  137. package/dist/constants.d.ts +104 -0
  138. package/dist/directives/index.d.ts +3 -0
  139. package/dist/directives/index.es.js +22 -22
  140. package/dist/directives/index.umd.js +1 -1
  141. package/dist/directives/v-contextmenu.d.ts +3 -0
  142. package/dist/directives/v-contextmenu.es.js +13 -13
  143. package/dist/directives/v-contextmenu.umd.js +1 -1
  144. package/dist/directives/v-tooltip.d.ts +3 -0
  145. package/dist/icons.d.ts +1889 -0
  146. package/dist/index.d.ts +10 -0
  147. package/dist/index.es.js +19 -19
  148. package/dist/index.umd.js +1 -1
  149. package/dist/json-render/catalog.d.ts +395 -0
  150. package/dist/json-render/components.d.ts +111 -0
  151. package/dist/json-render/definitions.d.ts +697 -0
  152. package/dist/json-render/index.d.ts +55 -0
  153. package/dist/json-render/index.es.js +1877 -1870
  154. package/dist/json-render/index.umd.js +1 -1
  155. package/dist/json-render/registry.d.ts +34 -0
  156. package/dist/props/index.d.ts +959 -0
  157. package/dist/resolvers/unplugin.d.ts +38 -0
  158. package/dist/resolvers/unplugin.es.js +28 -28
  159. package/dist/resolvers/unplugin.umd.js +1 -1
  160. package/dist/stories/Accordion/Accordion.settings.d.ts +9 -0
  161. package/dist/stories/Accordion/Accordion.stories.d.ts +7 -0
  162. package/dist/stories/Accordion/Accordion.test.d.ts +2 -0
  163. package/dist/stories/Accordion/AccordionSlots.stories.d.ts +7 -0
  164. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +13 -0
  165. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +9 -0
  166. package/dist/stories/AccordionGroup/AccordionGroup.test.d.ts +2 -0
  167. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1788 -0
  168. package/dist/stories/Alert/Alert.settings.d.ts +4 -0
  169. package/dist/stories/Alert/Alert.stories.d.ts +9 -0
  170. package/dist/stories/Alert/Alert.test.d.ts +2 -0
  171. package/dist/stories/Alert/AlertModifiers.stories.d.ts +13 -0
  172. package/dist/stories/Alert/AlertSlots.stories.d.ts +10 -0
  173. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +14 -0
  174. package/dist/stories/AlertGroup/AlertGroup.stories.d.ts +8 -0
  175. package/dist/stories/AlertGroup/AlertGroup.test.d.ts +2 -0
  176. package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +14 -0
  177. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +8 -0
  178. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +4 -0
  179. package/dist/stories/Avatar/Avatar.settings.d.ts +5 -0
  180. package/dist/stories/Avatar/Avatar.stories.d.ts +7 -0
  181. package/dist/stories/Avatar/Avatar.test.d.ts +2 -0
  182. package/dist/stories/Avatar/AvatarBadge.stories.d.ts +6 -0
  183. package/dist/stories/Avatar/AvatarModifiers.stories.d.ts +13 -0
  184. package/dist/stories/Avatar/AvatarSlots.stories.d.ts +6 -0
  185. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +14 -0
  186. package/dist/stories/AvatarGroup/AvatarGroup.stories.d.ts +6 -0
  187. package/dist/stories/AvatarGroup/AvatarGroup.test.d.ts +2 -0
  188. package/dist/stories/AvatarGroup/AvatarGroupModifiers.stories.d.ts +7 -0
  189. package/dist/stories/AvatarGroup/AvatarGroupSlotDefault.stories.d.ts +6 -0
  190. package/dist/stories/Badge/Badge.settings.d.ts +5 -0
  191. package/dist/stories/Badge/Badge.stories.d.ts +7 -0
  192. package/dist/stories/Badge/Badge.test.d.ts +2 -0
  193. package/dist/stories/Badge/BadgeSlots.stories.d.ts +6 -0
  194. package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
  195. package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +13 -0
  196. package/dist/stories/Breadcrumb/Breadcrumb.stories.d.ts +7 -0
  197. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +2 -0
  198. package/dist/stories/Breadcrumb/BreadcrumbSlots.stories.d.ts +6 -0
  199. package/dist/stories/Button/Button.settings.d.ts +4 -0
  200. package/dist/stories/Button/Button.stories.d.ts +6 -0
  201. package/dist/stories/Button/Button.test.d.ts +2 -0
  202. package/dist/stories/Button/ButtonIcon.stories.d.ts +10 -0
  203. package/dist/stories/Button/ButtonLink.stories.d.ts +7 -0
  204. package/dist/stories/Button/ButtonLoading.stories.d.ts +8 -0
  205. package/dist/stories/Button/ButtonModifiers.stories.d.ts +17 -0
  206. package/dist/stories/Button/ButtonSlots.stories.d.ts +9 -0
  207. package/dist/stories/Button/ButtonState.stories.d.ts +8 -0
  208. package/dist/stories/Button/ButtonToggle.stories.d.ts +9 -0
  209. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +5 -0
  210. package/dist/stories/ButtonGroup/ButtonGroup.stories.d.ts +6 -0
  211. package/dist/stories/ButtonGroup/ButtonGroup.test.d.ts +2 -0
  212. package/dist/stories/ButtonGroup/ButtonGroupModifiers.stories.d.ts +8 -0
  213. package/dist/stories/ButtonGroup/ButtonGroupSlots.stories.d.ts +6 -0
  214. package/dist/stories/ButtonGroup/ButtonGroupToggle.stories.d.ts +8 -0
  215. package/dist/stories/Card/Card.settings.d.ts +6 -0
  216. package/dist/stories/Card/Card.stories.d.ts +6 -0
  217. package/dist/stories/Card/Card.test.d.ts +2 -0
  218. package/dist/stories/Card/CardSlots.stories.d.ts +9 -0
  219. package/dist/stories/Checkbox/Checkbox.settings.d.ts +15 -0
  220. package/dist/stories/Checkbox/Checkbox.stories.d.ts +13 -0
  221. package/dist/stories/Checkbox/Checkbox.test.d.ts +2 -0
  222. package/dist/stories/Checkbox/CheckboxBinary.stories.d.ts +7 -0
  223. package/dist/stories/Checkbox/CheckboxSlots.stories.d.ts +7 -0
  224. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +12 -0
  225. package/dist/stories/CheckboxGroup/CheckboxGroup.stories.d.ts +12 -0
  226. package/dist/stories/CheckboxGroup/CheckboxGroup.test.d.ts +2 -0
  227. package/dist/stories/CheckboxGroup/CheckboxGroupOptions.stories.d.ts +8 -0
  228. package/dist/stories/CheckboxGroup/CheckboxGroupSlots.stories.d.ts +7 -0
  229. package/dist/stories/Combobox/Combobox.settings.d.ts +4 -0
  230. package/dist/stories/Combobox/Combobox.stories.d.ts +24 -0
  231. package/dist/stories/Combobox/Combobox.test.d.ts +2 -0
  232. package/dist/stories/Combobox/ComboboxIconPosition.stories.d.ts +8 -0
  233. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +9 -0
  234. package/dist/stories/Combobox/ComboboxOptions.stories.d.ts +11 -0
  235. package/dist/stories/Combobox/ComboboxSlots.stories.d.ts +10 -0
  236. package/dist/stories/Dialog/Dialog.settings.d.ts +10 -0
  237. package/dist/stories/Dialog/Dialog.stories.d.ts +7 -0
  238. package/dist/stories/Dialog/Dialog.test.d.ts +2 -0
  239. package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
  240. package/dist/stories/Dialog/DialogSlots.stories.d.ts +8 -0
  241. package/dist/stories/Dropdown/Dropdown.settings.d.ts +5 -0
  242. package/dist/stories/Dropdown/Dropdown.stories.d.ts +9 -0
  243. package/dist/stories/Dropdown/Dropdown.test.d.ts +2 -0
  244. package/dist/stories/Dropdown/DropdownContextmenuDirective.stories.d.ts +6 -0
  245. package/dist/stories/Dropdown/DropdownMultilevel.stories.d.ts +6 -0
  246. package/dist/stories/Dropdown/DropdownSlots.stories.d.ts +8 -0
  247. package/dist/stories/Icon/Icon.settings.d.ts +7 -0
  248. package/dist/stories/Icon/Icon.stories.d.ts +8 -0
  249. package/dist/stories/Icon/IconsCollection.stories.d.ts +6 -0
  250. package/dist/stories/InputFile/InputFile.settings.d.ts +6 -0
  251. package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
  252. package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
  253. package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
  254. package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
  255. package/dist/stories/InputText/InputText.settings.d.ts +11 -0
  256. package/dist/stories/InputText/InputText.stories.d.ts +16 -0
  257. package/dist/stories/InputText/InputText.test.d.ts +5 -0
  258. package/dist/stories/InputText/InputTextIconPosition.stories.d.ts +8 -0
  259. package/dist/stories/InputText/InputTextIso.stories.d.ts +10 -0
  260. package/dist/stories/InputText/InputTextLength.stories.d.ts +10 -0
  261. package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
  262. package/dist/stories/InputText/InputTextMinMax.stories.d.ts +9 -0
  263. package/dist/stories/InputText/InputTextSlots.stories.d.ts +8 -0
  264. package/dist/stories/InputText/InputTextSuggestions.stories.d.ts +8 -0
  265. package/dist/stories/InputText/InputTextType.stories.d.ts +18 -0
  266. package/dist/stories/Nav/Nav.settings.d.ts +4 -0
  267. package/dist/stories/Nav/Nav.stories.d.ts +6 -0
  268. package/dist/stories/Nav/Nav.test.d.ts +2 -0
  269. package/dist/stories/Nav/NavModifiers.stories.d.ts +9 -0
  270. package/dist/stories/Progress/Progress.settings.d.ts +7 -0
  271. package/dist/stories/Progress/Progress.stories.d.ts +7 -0
  272. package/dist/stories/Progress/Progress.test.d.ts +2 -0
  273. package/dist/stories/Radio/Radio.settings.d.ts +12 -0
  274. package/dist/stories/Radio/Radio.stories.d.ts +11 -0
  275. package/dist/stories/Radio/Radio.test.d.ts +2 -0
  276. package/dist/stories/Radio/RadioSlots.stories.d.ts +7 -0
  277. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +12 -0
  278. package/dist/stories/RadioGroup/RadioGroup.stories.d.ts +12 -0
  279. package/dist/stories/RadioGroup/RadioGroup.test.d.ts +2 -0
  280. package/dist/stories/RadioGroup/RadioGroupOptions.stories.d.ts +8 -0
  281. package/dist/stories/RadioGroup/RadioGroupSlots.stories.d.ts +7 -0
  282. package/dist/stories/Select/Select.settings.d.ts +8 -0
  283. package/dist/stories/Select/Select.stories.d.ts +16 -0
  284. package/dist/stories/Select/Select.test.d.ts +2 -0
  285. package/dist/stories/Select/SelectIconPosition.stories.d.ts +8 -0
  286. package/dist/stories/Select/SelectOptions.stories.d.ts +9 -0
  287. package/dist/stories/Select/SelectSlots.stories.d.ts +8 -0
  288. package/dist/stories/Tab/Tab.settings.d.ts +4 -0
  289. package/dist/stories/Tab/Tab.stories.d.ts +6 -0
  290. package/dist/stories/Tab/Tab.test.d.ts +2 -0
  291. package/dist/stories/Textarea/Textarea.settings.d.ts +9 -0
  292. package/dist/stories/Textarea/Textarea.stories.d.ts +14 -0
  293. package/dist/stories/Textarea/Textarea.test.d.ts +2 -0
  294. package/dist/stories/Textarea/TextareaLength.stories.d.ts +10 -0
  295. package/dist/stories/Textarea/TextareaSlots.stories.d.ts +8 -0
  296. package/dist/stories/Textarea/TextareatIconPosition.stories.d.ts +8 -0
  297. package/dist/stories/Tooltip/Tooltip.settings.d.ts +5 -0
  298. package/dist/stories/Tooltip/Tooltip.stories.d.ts +6 -0
  299. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  300. package/dist/stories/Tooltip/TooltipDirective.stories.d.ts +10 -0
  301. package/dist/stories/VirtualScroll/VirtualScroll.settings.d.ts +5 -0
  302. package/dist/stories/VirtualScroll/VirtualScroll.stories.d.ts +7 -0
  303. package/dist/stories/VirtualScroll/VirtualScroll.test.d.ts +2 -0
  304. package/dist/stories/VirtualScroll/VirtualScrollWithComposable.stories.d.ts +4 -0
  305. package/dist/stories/argTypes.d.ts +56 -0
  306. package/dist/test/expect.d.ts +18 -0
  307. package/dist/test/options.d.ts +1 -0
  308. package/dist/test/sleep.d.ts +1 -0
  309. package/dist/types/alert.d.ts +15 -0
  310. package/dist/types/blurhash.d.ts +12 -0
  311. package/dist/types/floating-ui.d.ts +15 -0
  312. package/dist/types/generic.d.ts +4 -0
  313. package/dist/types/group.d.ts +59 -0
  314. package/dist/types/index.d.ts +7 -0
  315. package/dist/types/input-file.d.ts +9 -0
  316. package/dist/types/nav.d.ts +17 -0
  317. package/dist/utils/DateUtilities.d.ts +14 -0
  318. package/dist/utils/DomUtilities.d.ts +1 -0
  319. package/dist/utils/FileUtilities.d.ts +14 -0
  320. package/dist/utils/ObjectUtilities.d.ts +76 -0
  321. package/dist/workers/blurhash.d.ts +1 -0
  322. package/package.json +3 -2
  323. package/src/Volver.ts +8 -6
  324. package/src/components/VvAction/index.ts +1 -3
  325. package/src/components/VvButton/VvButton.vue +1 -1
  326. package/src/components/VvCheckboxGroup/index.ts +1 -3
  327. package/src/components/VvCombobox/VvCombobox.vue +3 -3
  328. package/src/components/VvDropdown/VvDropdown.vue +8 -8
  329. package/src/components/VvIcon/VvIcon.vue +3 -6
  330. package/src/components/VvInputFile/VvInputFile.vue +6 -6
  331. package/src/components/VvInputText/VvInputText.vue +95 -78
  332. package/src/components/VvRadioGroup/index.ts +1 -3
  333. package/src/composables/useBlurhash.ts +1 -1
  334. package/src/composables/useDebouncedInput.ts +1 -1
  335. package/src/composables/useDefaults.ts +55 -44
  336. package/src/composables/useModifiers.ts +1 -1
  337. package/src/index.ts +2 -2
  338. package/src/resolvers/unplugin.ts +6 -6
  339. package/src/types/alert.ts +1 -1
  340. package/src/types/nav.ts +1 -1
  341. package/src/utils/DateUtilities.ts +3 -3
  342. package/src/utils/DomUtilities.ts +7 -1
  343. package/src/utils/ObjectUtilities.ts +60 -59
@@ -20,6 +20,8 @@ import {
20
20
  } from '../VvInputText'
21
21
  import VvInputTextActionsFactory from '../VvInputText/VvInputTextActions'
22
22
 
23
+ type SuggestionValue = string | number | Date
24
+
23
25
  // props, emit, slots and attrs
24
26
  const props = defineProps(VvInputTextProps)
25
27
 
@@ -117,80 +119,14 @@ const { el, mask, typed, masked, unmasked } = useIMask(
117
119
  }
118
120
  emit('update:masked', masked.value)
119
121
  if (type.value === INPUT_TYPES.NUMBER) {
120
- if (MASK_NUMBER_REGEX.test(unmasked.value)) {
121
- if (
122
- localModelValue.value === null
123
- || localModelValue.value === undefined
124
- ) {
125
- return
126
- }
127
- localModelValue.value = undefined
128
- return
129
- }
130
- if (NEGATIVE_ZERO_REGEX.test(unmasked.value)) {
131
- localModelValue.value = 0
132
- return
133
- }
134
- if (typeof typed.value !== 'number') {
135
- localModelValue.value = Number(typed.value)
136
- return
137
- }
138
- localModelValue.value = typed.value
122
+ handleNumberAccept()
139
123
  return
140
124
  }
141
125
  if (type.value === INPUT_TYPES.DATETIME_LOCAL
142
126
  || type.value === INPUT_TYPES.DATE
143
127
  || type.value === INPUT_TYPES.TIME
144
128
  || type.value === INPUT_TYPES.MONTH) {
145
- if (!typed.value) {
146
- if (!localModelValue.value) {
147
- return
148
- }
149
- if (modelValueDate.value) {
150
- localModelValue.value = undefined
151
- return
152
- }
153
- localModelValue.value = ''
154
- return
155
- }
156
- if (!(typed.value instanceof Date) && !modelValueDate.value && !modelValueDateIsoString.value) {
157
- localModelValue.value = typed.value
158
- return
159
- }
160
-
161
- let date = typed.value
162
- if (!(date instanceof Date)) {
163
- date = getDateFromInputValue(typed.value, type.value)
164
- }
165
- if (modelValueDate.value || modelValueDateIsoString.value) {
166
- const toReturn = new Date(modelValueDate.value || modelValueDateIsoString.value as string)
167
- if (type.value === INPUT_TYPES.DATETIME_LOCAL
168
- || type.value === INPUT_TYPES.DATE
169
- || type.value === INPUT_TYPES.MONTH) {
170
- toReturn.setFullYear(date.getFullYear())
171
- toReturn.setMonth(date.getMonth())
172
- }
173
- if (type.value === INPUT_TYPES.DATETIME_LOCAL
174
- || type.value === INPUT_TYPES.DATE) {
175
- toReturn.setDate(date.getDate())
176
- }
177
- if (type.value === INPUT_TYPES.DATETIME_LOCAL
178
- || type.value === INPUT_TYPES.TIME) {
179
- toReturn.setHours(date.getHours())
180
- toReturn.setMinutes(date.getMinutes())
181
- toReturn.setSeconds(date.getSeconds())
182
- }
183
- if (modelValueDate.value instanceof Date) {
184
- if (localModelValue.value?.getTime() === toReturn.getTime()) {
185
- return
186
- }
187
- localModelValue.value = toReturn
188
- return
189
- }
190
- localModelValue.value = toReturn.toISOString()
191
- return
192
- }
193
- localModelValue.value = getInputValueFromDate(date, type.value, hasSeconds.value)
129
+ handleDateAccept()
194
130
  return
195
131
  }
196
132
  if (!localModelValue.value && !unmasked.value) {
@@ -200,7 +136,88 @@ const { el, mask, typed, masked, unmasked } = useIMask(
200
136
  },
201
137
  },
202
138
  )
203
- function updateMaskValue(newValue: string | number | Date | undefined | null) {
139
+
140
+ function handleNumberAccept() {
141
+ if (MASK_NUMBER_REGEX.test(unmasked.value)) {
142
+ if (
143
+ localModelValue.value === null
144
+ || localModelValue.value === undefined
145
+ ) {
146
+ return
147
+ }
148
+ localModelValue.value = undefined
149
+ return
150
+ }
151
+ if (NEGATIVE_ZERO_REGEX.test(unmasked.value)) {
152
+ localModelValue.value = 0
153
+ return
154
+ }
155
+ if (typeof typed.value !== 'number') {
156
+ localModelValue.value = Number(typed.value)
157
+ return
158
+ }
159
+ localModelValue.value = typed.value
160
+ }
161
+
162
+ function mergeDateIntoModelValue(date: Date) {
163
+ const toReturn = new Date(modelValueDate.value || modelValueDateIsoString.value as string)
164
+ if (type.value === INPUT_TYPES.DATETIME_LOCAL
165
+ || type.value === INPUT_TYPES.DATE
166
+ || type.value === INPUT_TYPES.MONTH) {
167
+ toReturn.setFullYear(date.getFullYear())
168
+ toReturn.setMonth(date.getMonth())
169
+ }
170
+ if (type.value === INPUT_TYPES.DATETIME_LOCAL
171
+ || type.value === INPUT_TYPES.DATE) {
172
+ toReturn.setDate(date.getDate())
173
+ }
174
+ if (type.value === INPUT_TYPES.DATETIME_LOCAL
175
+ || type.value === INPUT_TYPES.TIME) {
176
+ toReturn.setHours(date.getHours())
177
+ toReturn.setMinutes(date.getMinutes())
178
+ toReturn.setSeconds(date.getSeconds())
179
+ }
180
+ if (modelValueDate.value instanceof Date) {
181
+ if (localModelValue.value?.getTime() === toReturn.getTime()) {
182
+ return
183
+ }
184
+ localModelValue.value = toReturn
185
+ return
186
+ }
187
+ localModelValue.value = toReturn.toISOString()
188
+ }
189
+
190
+ function handleDateAccept() {
191
+ // onAccept only calls this for date-like input types
192
+ const dateType = type.value as 'date' | 'time' | 'month' | 'datetime-local'
193
+ if (!typed.value) {
194
+ if (!localModelValue.value) {
195
+ return
196
+ }
197
+ if (modelValueDate.value) {
198
+ localModelValue.value = undefined
199
+ return
200
+ }
201
+ localModelValue.value = ''
202
+ return
203
+ }
204
+ if (!(typed.value instanceof Date) && !modelValueDate.value && !modelValueDateIsoString.value) {
205
+ localModelValue.value = typed.value
206
+ return
207
+ }
208
+
209
+ let date = typed.value
210
+ if (!(date instanceof Date)) {
211
+ date = getDateFromInputValue(typed.value, dateType)
212
+ }
213
+ if (modelValueDate.value || modelValueDateIsoString.value) {
214
+ mergeDateIntoModelValue(date)
215
+ return
216
+ }
217
+ localModelValue.value = getInputValueFromDate(date, dateType, hasSeconds.value)
218
+ }
219
+
220
+ function updateMaskValue(newValue: SuggestionValue | undefined | null) {
204
221
  // Handle empty values
205
222
  if (newValue === undefined || newValue === null) {
206
223
  typed.value = ''
@@ -439,13 +456,13 @@ const isInvalid = computed(() => {
439
456
 
440
457
  // suggestions
441
458
  const storageKey = computed(() => props.storageKey ?? (volver?.experimentalFeatures.forceInputSuggestions ? props.name : undefined))
442
- const storageSuggestions = usePersistence<Set<string | number | Date>>(
459
+ const storageSuggestions = usePersistence<Set<SuggestionValue>>(
443
460
  storageKey,
444
461
  storageType,
445
462
  new Set(),
446
463
  )
447
464
  const allSuggestions = computed(() => {
448
- const merged = new Map<string | number | Date, { isFromStorage: boolean }>()
465
+ const merged = new Map<SuggestionValue, { isFromStorage: boolean }>()
449
466
 
450
467
  // Add storage suggestions
451
468
  if (storageSuggestions.value) {
@@ -483,12 +500,12 @@ const hasSuggestions = computed(
483
500
  () =>
484
501
  allSuggestions.value.size > 0,
485
502
  )
486
- function onSuggestionSelect(suggestion: string | number | Date) {
503
+ function onSuggestionSelect(suggestion: SuggestionValue) {
487
504
  localModelValue.value = suggestion
488
505
  suggestionsDropdownEl.value?.hide()
489
506
  emit('suggestion:selected', suggestion)
490
507
  }
491
- function onSuggestionRemove(suggestion: string | number | Date) {
508
+ function onSuggestionRemove(suggestion: SuggestionValue) {
492
509
  // Only remove from storage if it came from storage
493
510
  if (allSuggestions.value.get(suggestion)?.isFromStorage) {
494
511
  storageSuggestions.value?.delete(suggestion)
@@ -588,8 +605,8 @@ const hasAttrs = computed(() => {
588
605
  max = '9999-12-31'
589
606
  }
590
607
  toReturn.step = props.step
591
- toReturn.max = max !== undefined ? String(max) : undefined
592
- toReturn.min = props.min !== undefined ? String(props.min) : undefined
608
+ toReturn.max = max === undefined ? undefined : String(max)
609
+ toReturn.min = props.min === undefined ? undefined : String(props.min)
593
610
  }
594
611
 
595
612
  // Text-like types with placeholder
@@ -657,9 +674,9 @@ const hasStyle = computed(() => {
657
674
  return undefined
658
675
  }
659
676
  return {
660
- width: localModelValue.value !== undefined
661
- ? `${String(localModelValue.value).length + 1}ch`
662
- : undefined,
677
+ width: localModelValue.value === undefined
678
+ ? undefined
679
+ : `${String(localModelValue.value).length + 1}ch`,
663
680
  }
664
681
  })
665
682
 
@@ -1,5 +1,3 @@
1
- import { CheckboxRadioGroupProps } from '../../props'
2
-
3
- export const VvRadioGroupProps = CheckboxRadioGroupProps
1
+ export { CheckboxRadioGroupProps as VvRadioGroupProps } from '../../props'
4
2
 
5
3
  export const VvRadioGroupEvents = ['update:modelValue', 'change']
@@ -16,7 +16,7 @@ function loadImage(src: string): Promise<CanvasImageSource> {
16
16
  return new Promise((resolve, reject) => {
17
17
  const img = new Image()
18
18
  img.onload = () => resolve(img)
19
- img.onerror = (...args) => reject(args)
19
+ img.onerror = () => reject(new Error(`Failed to load image: ${src}`))
20
20
  img.src = src
21
21
  })
22
22
  }
@@ -26,7 +26,7 @@ export function useDebouncedInput(
26
26
  }
27
27
  timeout = setTimeout(() => {
28
28
  emit('update:modelValue', setter(value))
29
- }, ms as number)
29
+ }, ms)
30
30
  },
31
31
  })
32
32
  }
@@ -10,6 +10,53 @@ type VueProp
10
10
  | BooleanConstructor
11
11
  | PropType<unknown>
12
12
 
13
+ type PropDefinition
14
+ = | VueProp
15
+ | VueProp[]
16
+ | { type: VueProp | VueProp[], default?: unknown }
17
+
18
+ /**
19
+ * Returns the value a prop should take: either the provided `propValue` or the
20
+ * `componentDefault` when `propValue` still matches the prop definition default.
21
+ * The three checks are intentionally independent (an array definition satisfies
22
+ * both `Array.isArray` and `typeof === 'object'`).
23
+ */
24
+ function resolveDefaultedProp(
25
+ definition: PropDefinition,
26
+ propValue: unknown,
27
+ componentDefault: unknown,
28
+ ): unknown {
29
+ let value = propValue
30
+ // array of types
31
+ if (Array.isArray(definition) && definition.length) {
32
+ const typeFunction = definition[0] as <T>() => T
33
+ if (typeFunction() === propValue) {
34
+ value = componentDefault
35
+ }
36
+ }
37
+ // single type
38
+ if (typeof definition === 'function') {
39
+ const typeFunction = definition as <T>() => T
40
+ if (typeFunction() === propValue) {
41
+ value = componentDefault
42
+ }
43
+ }
44
+ // object with type and default
45
+ if (typeof definition === 'object') {
46
+ let defaultValue = (definition as { default: unknown }).default
47
+ if (typeof defaultValue === 'function') {
48
+ defaultValue = defaultValue()
49
+ }
50
+ const matches = typeof defaultValue === 'object'
51
+ ? JSON.stringify(defaultValue) === JSON.stringify(propValue)
52
+ : defaultValue === propValue
53
+ if (matches) {
54
+ value = componentDefault
55
+ }
56
+ }
57
+ return value
58
+ }
59
+
13
60
  export function useDefaults<Definition>(
14
61
  componentName: string,
15
62
  propsDefinition: Definition,
@@ -18,7 +65,7 @@ export function useDefaults<Definition>(
18
65
  const volver = useVolver()
19
66
 
20
67
  const volverComponentDefaults = computed(() => {
21
- if (!volver || !volver.defaults.value?.[componentName]) {
68
+ if (!volver?.defaults.value?.[componentName]) {
22
69
  return undefined
23
70
  }
24
71
  return volver.defaults.value[componentName]
@@ -38,49 +85,13 @@ export function useDefaults<Definition>(
38
85
  const simplifiedProps = props as Record<string, unknown>
39
86
  return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
40
87
  const propValue = simplifiedProps[key]
41
- acc[key] = propValue
42
- if (key in componentDefaults) {
43
- // array of types
44
- if (Array.isArray(simplifiedPropsDefinition[key])) {
45
- const typeArray = simplifiedPropsDefinition[
46
- key
47
- ] as VueProp[]
48
- if (typeArray.length) {
49
- const typeFunction = typeArray[0] as <T>() => T
50
- if (typeFunction === propValue) {
51
- acc[key] = componentDefaults[key]
52
- }
53
- }
54
- }
55
- // single type
56
- if (typeof simplifiedPropsDefinition[key] === 'function') {
57
- const typeFunction = simplifiedPropsDefinition[key] as <
58
- T,
59
- >() => T
60
- if (typeFunction() === propValue) {
61
- acc[key] = componentDefaults[key]
62
- }
63
- }
64
- // object with type and default
65
- if (typeof simplifiedPropsDefinition[key] === 'object') {
66
- let defaultValue = (
67
- simplifiedPropsDefinition[key] as { default: unknown }
68
- ).default
69
- if (typeof defaultValue === 'function') {
70
- defaultValue = defaultValue()
71
- }
72
- if (typeof defaultValue === 'object') {
73
- if (
74
- JSON.stringify(defaultValue)
75
- === JSON.stringify(propValue)
76
- ) {
77
- acc[key] = componentDefaults[key]
78
- }
79
- } else if (defaultValue === propValue) {
80
- acc[key] = componentDefaults[key]
81
- }
82
- }
83
- }
88
+ acc[key] = key in componentDefaults
89
+ ? resolveDefaultedProp(
90
+ simplifiedPropsDefinition[key],
91
+ propValue,
92
+ componentDefaults[key],
93
+ )
94
+ : propValue
84
95
  return acc
85
96
  }, {} as Record<string, unknown>) as Readonly<
86
97
  ExtractPropTypes<Definition>
@@ -2,7 +2,7 @@ import type { Ref } from 'vue'
2
2
 
3
3
  export function useModifiers(
4
4
  prefix: string,
5
- modifiers?: Ref<string | string[] | unknown | unknown[] | undefined>,
5
+ modifiers?: Ref<unknown>,
6
6
  others?: Ref<Record<string, boolean>>,
7
7
  ) {
8
8
  return computed(() => {
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { Volver, VolverOptions } from './Volver'
1
+ import type { Volver } from './Volver'
2
2
  import VolverPlugin from './Volver'
3
3
 
4
4
  export { VolverPlugin }
5
5
  export * from './types'
6
- export type { Volver, VolverOptions }
6
+ export type { Volver, VolverOptions } from './Volver'
7
7
 
8
8
  // https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
9
9
  // Add custom property and extend vue type definition
@@ -35,12 +35,12 @@ export interface VolverResolverOptions {
35
35
  cherryPick?: boolean
36
36
  }
37
37
 
38
- const STYLE_EXCLUDE = ['vv-icon', 'vv-action']
38
+ const STYLE_EXCLUDE = new Set(['vv-icon', 'vv-action'])
39
39
  const VOLVER_PREFIX = 'vv'
40
- const DIRECTIVES = ['v-tooltip', 'v-contextmenu']
40
+ const DIRECTIVES = new Set(['v-tooltip', 'v-contextmenu'])
41
41
 
42
42
  export function getStyleNames(kebabName: string) {
43
- if (STYLE_EXCLUDE.includes(kebabName)) {
43
+ if (STYLE_EXCLUDE.has(kebabName)) {
44
44
  return undefined
45
45
  }
46
46
  if (kebabName === 'vv-dropdown') {
@@ -125,7 +125,7 @@ export function VolverResolver({
125
125
  `${VOLVER_PREFIX}-`,
126
126
  )
127
127
 
128
- if (ignore && ignore.includes(kebabName)) {
128
+ if (ignore?.includes(kebabName)) {
129
129
  return
130
130
  }
131
131
 
@@ -153,11 +153,11 @@ export function VolverResolver({
153
153
  const kebabName = `v-${kebabCase(name)}`
154
154
 
155
155
  // filter directive
156
- if (!DIRECTIVES.includes(kebabName)) {
156
+ if (!DIRECTIVES.has(kebabName)) {
157
157
  return
158
158
  }
159
159
 
160
- if (ignore && ignore.includes(kebabName)) {
160
+ if (ignore?.includes(kebabName)) {
161
161
  return
162
162
  }
163
163
 
@@ -8,7 +8,7 @@ export type AlertModifier
8
8
  | 'danger'
9
9
  | 'brand'
10
10
  | 'accent'
11
- | string
11
+ | (string & {})
12
12
 
13
13
  export type Alert = {
14
14
  id: string | number
package/src/types/nav.ts CHANGED
@@ -9,7 +9,7 @@ export type NavItem = {
9
9
  disabled?: boolean
10
10
  current?: boolean
11
11
  class?: string | string[]
12
- on?: Record<'click' | string, () => void>
12
+ on?: Record<'click' | (string & {}), () => void>
13
13
  data?: Record<string, unknown>
14
14
  }
15
15
 
@@ -12,14 +12,14 @@ const padTwoDigits = (num: number) => num.toString().padStart(2, '0')
12
12
  * @param dateString
13
13
  * @returns True if valid ISO date string
14
14
  * @example
15
- * isDateIsoString('2021-12-31T23:59:59') // true
15
+ * isDateIsoString('2021-12-31T23:59:59.000Z') // true
16
16
  */
17
- const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:?\d{2})?$/
17
+ // Canonical UTC form, matching what `Date.prototype.toISOString()` produces.
18
+ const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
18
19
  export function isDateIsoString(dateString: unknown) {
19
20
  if (typeof dateString !== 'string') {
20
21
  return false
21
22
  }
22
- // Support both with/without milliseconds and timezone variations
23
23
  if (!ISO_DATE_REGEX.test(dateString)) {
24
24
  return false
25
25
  }
@@ -2,9 +2,15 @@ export function findScrollContainer(element: HTMLElement | null) {
2
2
  if (!element) {
3
3
  return undefined
4
4
  }
5
+ if (
6
+ typeof globalThis.getComputedStyle !== 'function'
7
+ || typeof document === 'undefined'
8
+ ) {
9
+ return undefined
10
+ }
5
11
  let parent = element.parentElement
6
12
  while (parent) {
7
- const { overflow } = window.getComputedStyle(parent)
13
+ const { overflow } = globalThis.getComputedStyle(parent)
8
14
  if (overflow.split(' ').every(item => item === 'auto' || item === 'scroll')) {
9
15
  return parent
10
16
  }
@@ -22,67 +22,69 @@ export function equals(obj1: any, obj2: any, field?: string) {
22
22
  * @returns {boolean}
23
23
  */
24
24
 
25
- export function deepEquals(a: any, b: any) {
26
- if (a === b)
27
- return true
25
+ function deepEqualsArray(a: any[], b: any[]) {
26
+ if (a.length !== b.length)
27
+ return false
28
+ for (let i = a.length; i-- !== 0;) {
29
+ if (!deepEquals(a[i], b[i]))
30
+ return false
31
+ }
32
+ return true
33
+ }
28
34
 
29
- if (a && b && typeof a == 'object' && typeof b == 'object') {
30
- const arrA = Array.isArray(a)
31
- const arrB = Array.isArray(b)
32
- let i, length, key
33
-
34
- if (arrA && arrB) {
35
- length = a.length
36
- if (length !== b.length)
37
- return false
38
- for (i = length; i-- !== 0;) {
39
- if (!deepEquals(a[i], b[i]))
40
- return false
41
- }
35
+ function deepEqualsObject(a: any, b: any) {
36
+ const keys = Object.keys(a)
37
+ const { length } = keys
42
38
 
43
- return true
44
- }
39
+ if (length !== Object.keys(b).length)
40
+ return false
45
41
 
46
- if (arrA !== arrB)
42
+ for (let i = length; i-- !== 0;) {
43
+ if (!Object.hasOwn(b, keys[i]))
47
44
  return false
45
+ }
48
46
 
49
- const dateA = a instanceof Date
50
- const dateB = b instanceof Date
51
-
52
- if (dateA !== dateB)
47
+ for (let i = length; i-- !== 0;) {
48
+ const key = keys[i]
49
+ if (!deepEquals(a[key], b[key]))
53
50
  return false
54
- if (dateA && dateB)
55
- return a.getTime() === b.getTime()
51
+ }
56
52
 
57
- const regexpA = a instanceof RegExp
58
- const regexpB = b instanceof RegExp
53
+ return true
54
+ }
59
55
 
60
- if (regexpA !== regexpB)
61
- return false
62
- if (regexpA && regexpB)
63
- return a.toString() === b.toString()
56
+ export function deepEquals(a: any, b: any) {
57
+ if (a === b)
58
+ return true
64
59
 
65
- const keys = Object.keys(a)
60
+ if (!a || !b || typeof a !== 'object' || typeof b !== 'object')
61
+ return Number.isNaN(a) && Number.isNaN(b)
66
62
 
67
- length = keys.length
63
+ const arrA = Array.isArray(a)
64
+ const arrB = Array.isArray(b)
68
65
 
69
- if (length !== Object.keys(b).length)
70
- return false
66
+ if (arrA !== arrB)
67
+ return false
68
+ if (arrA && arrB)
69
+ return deepEqualsArray(a, b)
71
70
 
72
- for (i = length; i-- !== 0;) {
73
- if (!Object.hasOwn(b, keys[i]))
74
- return false
75
- }
71
+ const dateA = a instanceof Date
72
+ const dateB = b instanceof Date
76
73
 
77
- for (i = length; i-- !== 0;) {
78
- key = keys[i]
79
- if (!deepEquals(a[key], b[key]))
80
- return false
81
- }
74
+ if (dateA !== dateB)
75
+ return false
76
+ if (dateA && dateB)
77
+ return a.getTime() === b.getTime()
82
78
 
83
- return true
84
- }
85
- return Number.isNaN(a) && Number.isNaN(b)
79
+ const regexpA = a instanceof RegExp
80
+ const regexpB = b instanceof RegExp
81
+
82
+ if (regexpA !== regexpB)
83
+ return false
84
+ if (regexpA && regexpB)
85
+ return a.toString() === b.toString()
86
+
87
+ return deepEqualsObject(a, b)
86
88
  }
87
89
 
88
90
  /**
@@ -95,20 +97,19 @@ export function resolveFieldData(data: Record<string, unknown>, field: string) {
95
97
  if (data && Object.keys(data).length && field) {
96
98
  if (!field.includes('.')) {
97
99
  return data[field]
98
- } else {
99
- const fields = field.split('.')
100
- let value = data
101
-
102
- for (let i = 0, len = fields.length; i < len; ++i) {
103
- if (data == null) {
104
- return null
105
- }
100
+ }
101
+ const fields = field.split('.')
102
+ let value = data
106
103
 
107
- value = value[fields[i]] as Record<string, unknown>
104
+ for (let i = 0, len = fields.length; i < len; ++i) {
105
+ if (value == null) {
106
+ return null
108
107
  }
109
108
 
110
- return value
109
+ value = value[fields[i]] as Record<string, unknown>
111
110
  }
111
+
112
+ return value
112
113
  } else {
113
114
  return null
114
115
  }
@@ -120,7 +121,7 @@ export function resolveFieldData(data: Record<string, unknown>, field: string) {
120
121
  */
121
122
 
122
123
  export function isFunction(obj: any) {
123
- return !!(obj && obj.constructor && obj.call && obj.apply)
124
+ return !!(obj?.constructor && obj.call && obj.apply)
124
125
  }
125
126
 
126
127
  /**
@@ -151,7 +152,7 @@ export function findIndexInList<Type = unknown>(value: Type, list: Type[]) {
151
152
  * @returns {boolean} the index
152
153
  */
153
154
  export function contains<Type = unknown>(value: Type, list: Type[]) {
154
- if (value != null && list && list.length) {
155
+ if (value != null && list?.length) {
155
156
  for (const val of list) {
156
157
  if (equals(value, val)) {
157
158
  return true