infinity-forge 2.4.2 → 2.4.4

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 (354) hide show
  1. package/dist/sites/components/default-pages/blog/components/blog-item/index.d.ts +1 -1
  2. package/dist/sites/components/default-pages/blog/components/blog-item/index.js +3 -3
  3. package/dist/sites/components/default-pages/blog/components/blog-item/intefaces.d.ts +1 -1
  4. package/dist/sites/components/default-pages/blog/components/blog-item/share/index.js +2 -2
  5. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +1 -1
  6. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +2 -2
  7. package/dist/sites/components/default-pages/blog/components/featured-blog/index.d.ts +1 -1
  8. package/dist/sites/components/default-pages/blog/components/featured-blog/index.js +2 -2
  9. package/dist/sites/components/default-pages/blog/components/featured-blog/interfaces.d.ts +2 -2
  10. package/dist/sites/components/default-pages/blog/components/side-box-categories/index.d.ts +2 -2
  11. package/dist/sites/components/default-pages/blog/components/side-box-categories/index.js +2 -2
  12. package/dist/sites/components/default-pages/blog/components/side-box-categories/interfaces.d.ts +1 -1
  13. package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.d.ts +1 -1
  14. package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.js +3 -3
  15. package/dist/sites/components/default-pages/blog/components/title-blog/index.js +2 -2
  16. package/dist/system/domain/protocols/http/errors/http-errors/index.d.ts +7 -7
  17. package/dist/system/domain/protocols/http/errors/http-errors/index.js +7 -7
  18. package/dist/system/domain/protocols/http/errors/system-errors-model/index.d.ts +1 -1
  19. package/dist/system/domain/protocols/http/errors/system-errors-model/index.js +1 -1
  20. package/dist/system/domain/use-cases/auth/admin/index.js +18 -0
  21. package/dist/system/presentation/components/data/avatar/index.js +59 -0
  22. package/dist/system/presentation/components/data/buttons/index.d.ts +1 -0
  23. package/dist/system/presentation/components/data/buttons/index.js +18 -0
  24. package/dist/system/presentation/components/data/buttons/sidebar-button/index.js +3 -3
  25. package/dist/system/presentation/components/data/chat/card-message/index.d.ts +1 -1
  26. package/dist/system/presentation/components/data/chat/card-message/index.js +3 -3
  27. package/dist/system/presentation/components/data/chat/index.d.ts +2 -0
  28. package/dist/system/presentation/components/data/chat/index.js +38 -0
  29. package/dist/system/presentation/components/data/chat/interfaces.d.ts +8 -0
  30. package/dist/system/presentation/components/data/chat/loader/index.js +1 -1
  31. package/dist/system/presentation/components/data/detail-card/component.d.ts +2 -0
  32. package/dist/system/presentation/components/data/detail-card/component.js +42 -0
  33. package/dist/system/presentation/components/data/detail-card/index.d.ts +2 -0
  34. package/dist/system/presentation/components/data/detail-card/index.js +19 -0
  35. package/dist/system/presentation/components/data/detail-card/interfaces.d.ts +19 -0
  36. package/dist/system/presentation/components/data/highlight-icon/index.d.ts +2 -0
  37. package/dist/system/presentation/components/data/highlight-icon/index.js +40 -0
  38. package/dist/system/presentation/components/data/highlight-icon/interfaces.d.ts +8 -0
  39. package/dist/system/presentation/components/data/highlight-text/index.d.ts +2 -0
  40. package/dist/system/presentation/components/data/highlight-text/index.js +43 -0
  41. package/dist/system/presentation/components/data/input-search/index.d.ts +2 -0
  42. package/dist/system/presentation/components/data/input-search/index.js +39 -0
  43. package/dist/system/presentation/components/data/logo/index.js +34 -0
  44. package/dist/system/presentation/components/data/menu/component.js +17 -0
  45. package/dist/system/presentation/components/data/menu/components/index.d.ts +1 -1
  46. package/dist/system/presentation/components/data/menu/components/index.js +1 -1
  47. package/dist/system/presentation/components/data/menu/components/menu-item/index.js +3 -3
  48. package/dist/system/presentation/components/data/menu/index.d.ts +2 -0
  49. package/dist/system/presentation/components/data/menu/index.js +19 -0
  50. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +5 -5
  51. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +1 -1
  52. package/dist/system/presentation/components/data/menu/modes/index.d.ts +2 -2
  53. package/dist/system/presentation/components/data/menu/modes/index.js +2 -2
  54. package/dist/system/presentation/components/data/menu/modes/opened/index.js +3 -3
  55. package/dist/system/presentation/components/data/menu/modes/opened/styles.js +1 -1
  56. package/dist/system/presentation/components/data/notifications/card/index.d.ts +1 -1
  57. package/dist/system/presentation/components/data/notifications/card/index.js +2 -2
  58. package/dist/system/presentation/components/data/notifications/index.js +155 -0
  59. package/dist/system/presentation/components/data/page-wrapper/index.d.ts +2 -0
  60. package/dist/system/presentation/components/data/page-wrapper/index.js +35 -0
  61. package/dist/system/presentation/components/data/page-wrapper/interfaces.d.ts +7 -0
  62. package/dist/system/presentation/components/data/popover/index.d.ts +2 -0
  63. package/dist/system/presentation/components/data/profile-infos/index.d.ts +2 -0
  64. package/dist/system/presentation/components/data/profile-infos/index.js +48 -0
  65. package/dist/system/presentation/components/data/profile-infos/interfaces.d.ts +6 -0
  66. package/dist/system/presentation/components/data/profile-infos/profile/index.d.ts +1 -1
  67. package/dist/system/presentation/components/data/profile-infos/profile/index.js +3 -3
  68. package/dist/system/presentation/components/data/select-workspace/component.d.ts +4 -0
  69. package/dist/system/presentation/components/data/select-workspace/component.js +69 -0
  70. package/dist/system/presentation/components/data/select-workspace/component.js.map +1 -0
  71. package/dist/system/presentation/components/data/select-workspace/index.d.ts +3 -0
  72. package/dist/system/presentation/components/data/select-workspace/index.js +20 -0
  73. package/dist/system/presentation/components/data/select-workspace/index.js.map +1 -1
  74. package/dist/system/presentation/components/data/tab/component.d.ts +2 -0
  75. package/dist/system/presentation/components/data/tab/component.js +67 -0
  76. package/dist/system/presentation/components/data/tab/index.d.ts +2 -0
  77. package/dist/system/presentation/components/data/tab/index.js +19 -0
  78. package/dist/system/presentation/components/data/tab/interfaces.d.ts +29 -0
  79. package/dist/system/presentation/components/data/tab/tab-item/index.d.ts +1 -1
  80. package/dist/system/presentation/components/data/tab/tab-item/index.js +2 -2
  81. package/dist/system/presentation/components/data/tab/tab-item/styles.d.ts +1 -1
  82. package/dist/system/presentation/components/layout/header/components/index.d.ts +2 -2
  83. package/dist/system/presentation/components/layout/header/components/index.js +2 -2
  84. package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +1 -1
  85. package/dist/system/presentation/components/layout/header/components/menu-right/index.js +5 -5
  86. package/dist/system/presentation/components/layout/header/components/menu-right/index.js.map +1 -1
  87. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +1 -1
  88. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +3 -3
  89. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +3 -3
  90. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +1 -1
  91. package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +4 -4
  92. package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +3 -3
  93. package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +4 -4
  94. package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js.map +1 -1
  95. package/dist/system/presentation/components/layout/header/components/menu-right/settings/index.js +3 -3
  96. package/dist/system/presentation/components/layout/header/components/search-modal/index.js +4 -4
  97. package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +3 -3
  98. package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +2 -2
  99. package/dist/system/presentation/components/layout/header/index.d.ts +2 -0
  100. package/dist/system/presentation/components/layout/header/index.js +25 -0
  101. package/dist/system/presentation/components/layout/header/version-01/index.d.ts +1 -1
  102. package/dist/system/presentation/components/layout/header/version-01/index.js +4 -4
  103. package/dist/system/presentation/components/pages/menus/index.d.ts +1 -0
  104. package/dist/system/presentation/components/pages/menus/index.js +18 -0
  105. package/dist/system/presentation/components/pages/menus/page.js +40 -0
  106. package/dist/system/presentation/components/pages/menus/table/columns.d.ts +2 -2
  107. package/dist/system/presentation/components/pages/menus/table/columns.js +1 -1
  108. package/dist/system/presentation/components/pages/menus/table/create.d.ts +2 -2
  109. package/dist/system/presentation/components/pages/menus/table/create.js +2 -2
  110. package/dist/system/presentation/components/pages/menus/table/delete.js +2 -2
  111. package/dist/system/presentation/components/pages/menus/table/edit.d.ts +2 -2
  112. package/dist/system/presentation/components/pages/menus/table/edit.js +2 -2
  113. package/dist/system/presentation/components/pages/menus/table/icon/index.js +1 -1
  114. package/dist/system/presentation/components/pages/menus/table/index.d.ts +4 -4
  115. package/dist/system/presentation/components/pages/menus/table/index.js +4 -4
  116. package/dist/system/presentation/components/pages/users/index.d.ts +1 -0
  117. package/dist/system/presentation/components/pages/users/index.js +18 -0
  118. package/dist/system/presentation/components/pages/users/page.js +40 -0
  119. package/dist/system/presentation/components/pages/users/table/columns.d.ts +2 -2
  120. package/dist/system/presentation/components/pages/users/table/create.d.ts +2 -2
  121. package/dist/system/presentation/components/pages/users/table/create.js +2 -2
  122. package/dist/system/presentation/components/pages/users/table/delete.js +2 -2
  123. package/dist/system/presentation/components/pages/users/table/edit.d.ts +2 -2
  124. package/dist/system/presentation/components/pages/users/table/edit.js +2 -2
  125. package/dist/system/presentation/components/pages/users/table/index.d.ts +4 -4
  126. package/dist/system/presentation/components/pages/users/table/index.js +4 -4
  127. package/dist/system/presentation/context/auth/components/index.d.ts +2 -0
  128. package/dist/system/presentation/context/auth/components/index.js +19 -0
  129. package/dist/system/presentation/context/auth/components/login/form-login/index.js +2 -2
  130. package/dist/system/presentation/context/auth/components/login/index.js +4 -4
  131. package/dist/system/presentation/context/auth/components/private-page/index.d.ts +1 -1
  132. package/dist/system/presentation/context/auth/components/private-page/index.js +3 -3
  133. package/dist/system/presentation/hooks/notifications/use-load-all/index.d.ts +1 -0
  134. package/dist/system/presentation/hooks/notifications/use-load-all/index.js +63 -0
  135. package/dist/system/presentation/hooks/notifications/use-load-no-read/index.d.ts +2 -0
  136. package/dist/system/presentation/hooks/notifications/use-load-no-read/index.js +60 -0
  137. package/dist/system/presentation/hooks/ui/use-table/component.d.ts +8 -0
  138. package/dist/system/presentation/hooks/ui/use-table/component.js +26 -0
  139. package/dist/system/presentation/hooks/ui/use-table/components/index.d.ts +1 -1
  140. package/dist/system/presentation/hooks/ui/use-table/components/index.js +1 -1
  141. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +1 -1
  142. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +2 -2
  143. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +1 -1
  144. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +2 -2
  145. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +1 -1
  146. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +2 -2
  147. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +1 -1
  148. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +2 -2
  149. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +1 -1
  150. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +3 -3
  151. package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +1 -1
  152. package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +10 -10
  153. package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +2 -2
  154. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +1 -1
  155. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +3 -3
  156. package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +2 -2
  157. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +1 -1
  158. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +2 -2
  159. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +1 -1
  160. package/dist/system/presentation/hooks/ui/use-table/index.d.ts +4 -0
  161. package/dist/system/presentation/hooks/ui/use-table/index.js +21 -0
  162. package/dist/system/presentation/hooks/ui/use-table/interfaces.d.ts +92 -0
  163. package/dist/system/presentation/hooks/ui/use-table/query/get-query-arguments-table.d.ts +1 -1
  164. package/dist/system/presentation/hooks/ui/use-table/query/hook.d.ts +1 -1
  165. package/dist/system/presentation/hooks/ui/use-table/query/hook.js +1 -1
  166. package/dist/system/presentation/hooks/ui/use-table/query/index.d.ts +2 -2
  167. package/dist/system/presentation/hooks/ui/use-table/query/index.js +2 -2
  168. package/dist/ui/components/carousel/carousel-lib/components-shared/get-changed-params.js +51 -0
  169. package/dist/ui/components/carousel/carousel-lib/components-shared/get-element-params.js +148 -0
  170. package/dist/ui/components/carousel/carousel-lib/components-shared/get-params.js +61 -0
  171. package/dist/ui/components/carousel/carousel-lib/components-shared/mount-swiper.js +24 -0
  172. package/dist/ui/components/carousel/carousel-lib/components-shared/update-swiper.js +208 -0
  173. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/getBreakpoint.js +1 -1
  174. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.d.ts +2 -2
  175. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.js +2 -2
  176. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/setBreakpoint.js +1 -1
  177. package/dist/ui/components/carousel/carousel-lib/core/classes/index.d.ts +2 -2
  178. package/dist/ui/components/carousel/carousel-lib/core/classes/index.js +2 -2
  179. package/dist/ui/components/carousel/carousel-lib/core/core.js +654 -0
  180. package/dist/ui/components/carousel/carousel-lib/core/events/index.js +9 -9
  181. package/dist/ui/components/carousel/carousel-lib/core/events/onLoad.js +1 -1
  182. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchEnd.js +1 -1
  183. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchMove.js +2 -2
  184. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchStart.js +3 -3
  185. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.d.ts +2 -2
  186. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.js +2 -2
  187. package/dist/ui/components/carousel/carousel-lib/core/loop/index.d.ts +3 -3
  188. package/dist/ui/components/carousel/carousel-lib/core/loop/index.js +3 -3
  189. package/dist/ui/components/carousel/carousel-lib/core/loop/loopCreate.js +1 -1
  190. package/dist/ui/components/carousel/carousel-lib/core/loop/loopFix.js +1 -1
  191. package/dist/ui/components/carousel/carousel-lib/core/moduleExtendParams.js +42 -0
  192. package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
  193. package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
  194. package/dist/ui/components/carousel/carousel-lib/core/slide/index.d.ts +7 -7
  195. package/dist/ui/components/carousel/carousel-lib/core/slide/index.js +7 -7
  196. package/dist/ui/components/carousel/carousel-lib/core/slide/slideTo.js +1 -1
  197. package/dist/ui/components/carousel/carousel-lib/core/slide/slideToClickedSlide.js +1 -1
  198. package/dist/ui/components/carousel/carousel-lib/core/transition/index.d.ts +3 -3
  199. package/dist/ui/components/carousel/carousel-lib/core/transition/index.js +3 -3
  200. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionEnd.js +1 -1
  201. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionStart.js +1 -1
  202. package/dist/ui/components/carousel/carousel-lib/core/translate/getTranslate.js +1 -1
  203. package/dist/ui/components/carousel/carousel-lib/core/translate/index.d.ts +5 -5
  204. package/dist/ui/components/carousel/carousel-lib/core/translate/index.js +5 -5
  205. package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +1 -1
  206. package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +9 -9
  207. package/dist/ui/components/carousel/carousel-lib/core/update/index.js +9 -9
  208. package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +1 -1
  209. package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +1 -1
  210. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +1 -1
  211. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +1 -1
  212. package/dist/ui/components/carousel/carousel-lib/modules/autoplay.js +336 -0
  213. package/dist/ui/components/carousel/carousel-lib/modules/effect-fade.js +63 -0
  214. package/dist/ui/components/carousel/carousel-lib/modules/free-mode.js +247 -0
  215. package/dist/ui/components/carousel/carousel-lib/modules/index.d.ts +6 -0
  216. package/dist/ui/components/carousel/carousel-lib/modules/index.js +23 -0
  217. package/dist/ui/components/carousel/carousel-lib/modules/navigation.js +223 -0
  218. package/dist/ui/components/carousel/carousel-lib/modules/pagination.js +514 -0
  219. package/dist/ui/components/carousel/carousel-lib/modules/virtual.js +379 -0
  220. package/dist/ui/components/carousel/carousel-lib/react/swiper-slide.js +88 -0
  221. package/dist/ui/components/carousel/carousel-lib/react/swiper.js +210 -0
  222. package/dist/ui/components/carousel/carousel-lib/shared/create-element-if-not-defined.js +22 -0
  223. package/dist/ui/components/carousel/carousel-lib/shared/create-shadow.js +15 -0
  224. package/dist/ui/components/carousel/carousel-lib/shared/effect-target.js +13 -0
  225. package/dist/ui/components/carousel/carousel-lib/shared/effect-virtual-transition-end.js +47 -0
  226. package/dist/ui/components/carousel/carousel-lib/shared/get-browser.js +43 -0
  227. package/dist/ui/components/carousel/carousel-lib/shared/get-device.js +69 -0
  228. package/dist/ui/components/carousel/carousel-lib/shared/get-support.js +25 -0
  229. package/dist/ui/components/carousel/carousel-lib/shared/utils.js +372 -0
  230. package/dist/ui/components/carousel/carousel-lib/ssr-window/document.js +65 -0
  231. package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.d.ts +4 -0
  232. package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.js +15 -0
  233. package/dist/ui/components/carousel/carousel-lib/ssr-window/window.js +71 -0
  234. package/dist/ui/components/carousel/carousel-lib/types/index.d.ts +5 -0
  235. package/dist/ui/components/carousel/carousel-lib/types/index.js +27 -0
  236. package/dist/ui/components/carousel/carousel-lib/types/swiper-events.d.ts +162 -0
  237. package/dist/ui/components/form/handler/custom-submit/index.d.ts +17 -0
  238. package/dist/ui/components/form/handler/custom-submit/index.js +25 -0
  239. package/dist/ui/components/form/handler/dynamic_form_handler/component.d.ts +2 -0
  240. package/dist/ui/components/form/handler/dynamic_form_handler/component.js +117 -0
  241. package/dist/ui/components/form/handler/dynamic_form_handler/index.d.ts +2 -0
  242. package/dist/ui/components/form/handler/dynamic_form_handler/index.js +19 -0
  243. package/dist/ui/components/form/handler/dynamic_form_handler/interfaces.d.ts +28 -0
  244. package/dist/ui/components/form/handler/form-handler/generate-schemas.js +111 -0
  245. package/dist/ui/components/form/handler/form-handler/index.d.ts +2 -0
  246. package/dist/ui/components/form/handler/form-handler/index.js +241 -0
  247. package/dist/ui/components/form/handler/form-handler/use-schemas.d.ts +2 -0
  248. package/dist/ui/components/form/handler/form-handler/use-schemas.js +115 -0
  249. package/dist/ui/components/form/handler/form-handler/use-send-file.d.ts +5 -0
  250. package/dist/ui/components/form/handler/form-handler/use-send-file.js +209 -0
  251. package/dist/ui/components/form/handler/i18n/capture-i18n-errors/index.d.ts +1 -1
  252. package/dist/ui/components/form/handler/i18n/index.d.ts +2 -0
  253. package/dist/ui/components/form/handler/i18n/index.js +4 -4
  254. package/dist/ui/components/form/input-cep/use-cep/hook.d.ts +2 -2
  255. package/dist/ui/components/form/input-cep/use-cep/hook.js +1 -1
  256. package/dist/ui/components/form/input-cep/use-cep/index.d.ts +2 -2
  257. package/dist/ui/components/form/input-cep/use-cep/index.js +2 -2
  258. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
  259. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
  260. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
  261. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
  262. package/dist/ui/components/form/input-cep/use-cep/providers/index.d.ts +1 -1
  263. package/dist/ui/components/form/input-cep/use-cep/providers/index.js +1 -1
  264. package/dist/ui/components/form/input-control/error/index.js +1 -1
  265. package/dist/ui/components/form/input-control/label/index.js +1 -1
  266. package/dist/ui/components/form/input-control/loader-input/index.js +2 -2
  267. package/dist/ui/components/form/input-currency/components/CurrencyInput.js +1 -1
  268. package/dist/ui/components/form/input-currency/components/index.d.ts +1 -1
  269. package/dist/ui/components/form/input-currency/components/index.js +1 -1
  270. package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +1 -1
  271. package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +4 -4
  272. package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +1 -1
  273. package/dist/ui/components/form/input-currency/components/utils/formatValue.js +2 -2
  274. package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +1 -1
  275. package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +1 -1
  276. package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -8
  277. package/dist/ui/components/form/input-currency/components/utils/index.js +8 -8
  278. package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +1 -1
  279. package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +1 -1
  280. package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +1 -1
  281. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.d.ts +1 -1
  282. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +3 -3
  283. package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +1 -1
  284. package/dist/ui/components/form/input-date-picker/calendar/days/index.js +2 -2
  285. package/dist/ui/components/form/input-date-picker/calendar/index.d.ts +1 -1
  286. package/dist/ui/components/form/input-date-picker/calendar/index.js +4 -4
  287. package/dist/ui/components/form/input-date-picker/calendar/interface.d.ts +2 -2
  288. package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +1 -1
  289. package/dist/ui/components/form/input-date-picker/calendar/months/index.js +2 -2
  290. package/dist/ui/components/form/input-date-picker/calendar/styles.d.ts +1 -1
  291. package/dist/ui/components/form/input-date-picker/mock/index.d.ts +1 -1
  292. package/dist/ui/components/form/input-date-picker/mock/index.js +1 -1
  293. package/dist/ui/components/form/input-file/hooks/index.d.ts +4 -4
  294. package/dist/ui/components/form/input-file/hooks/index.js +4 -4
  295. package/dist/ui/components/form/input-file/hooks/use-components-file.d.ts +2 -2
  296. package/dist/ui/components/form/input-file/hooks/use-components-file.js +2 -2
  297. package/dist/ui/components/form/input-file/hooks/use-file-elements.d.ts +1 -1
  298. package/dist/ui/components/form/input-file/hooks/use-file-elements.js +2 -2
  299. package/dist/ui/components/form/input-file/hooks/use-file.d.ts +2 -2
  300. package/dist/ui/components/form/input-file/hooks/use-file.js +2 -2
  301. package/dist/ui/components/form/input-file/hooks/use-rendered-file.d.ts +1 -1
  302. package/dist/ui/components/form/input-file/hooks/use-rendered-file.js +1 -1
  303. package/dist/ui/components/form/input-file/render-files/component.d.ts +1 -1
  304. package/dist/ui/components/form/input-file/render-files/component.js +2 -2
  305. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
  306. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
  307. package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +2 -2
  308. package/dist/ui/components/form/input-file/render-files/file-item/index.js +3 -3
  309. package/dist/ui/components/form/input-file/render-files/index.d.ts +3 -3
  310. package/dist/ui/components/form/input-file/render-files/index.js +3 -3
  311. package/dist/ui/components/form/input-file/render-files/interfaces.d.ts +2 -2
  312. package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
  313. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
  314. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
  315. package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -5
  316. package/dist/ui/components/form/input-mask/lib/core/index.js +4 -4
  317. package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
  318. package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +2 -2
  319. package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +2 -2
  320. package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -5
  321. package/dist/ui/components/form/input-mask/lib/mask/index.js +3 -3
  322. package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +1 -1
  323. package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +1 -1
  324. package/dist/ui/components/form/input-mask/lib/mask/useMask.js +7 -7
  325. package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
  326. package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
  327. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
  328. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
  329. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
  330. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
  331. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +2 -2
  332. package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
  333. package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +1 -1
  334. package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +1 -1
  335. package/dist/ui/components/form/input-mask/lib/mask/utils.js +5 -5
  336. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +2 -2
  337. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +2 -2
  338. package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -4
  339. package/dist/ui/components/form/input-mask/lib/number-format/index.js +2 -2
  340. package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +1 -1
  341. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +1 -1
  342. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +6 -6
  343. package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
  344. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
  345. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
  346. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
  347. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
  348. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +2 -2
  349. package/dist/ui/components/form/input-seo/input-meta-image/index.d.ts +1 -1
  350. package/dist/ui/components/form/input-seo/input-meta-image/index.js +2 -2
  351. package/dist/ui/components/menu-mobile/components/nav-links/index.d.ts +1 -1
  352. package/dist/ui/components/menu-mobile/components/nav-links/index.js +3 -3
  353. package/dist/ui/components/menu-mobile/components/nav-links/interfaces.d.ts +1 -1
  354. package/package.json +75 -75
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
72
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
+ if (ar || !(i in from)) {
75
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
76
+ ar[i] = from[i];
77
+ }
78
+ }
79
+ return to.concat(ar || Array.prototype.slice.call(from));
80
+ };
81
+ var __importDefault = (this && this.__importDefault) || function (mod) {
82
+ return (mod && mod.__esModule) ? mod : { "default": mod };
83
+ };
84
+ Object.defineProperty(exports, "__esModule", { value: true });
85
+ var jsx_runtime_1 = require("react/jsx-runtime");
86
+ var react_1 = require("react");
87
+ var yup = __importStar(require("yup"));
88
+ var lodash_1 = __importDefault(require("lodash"));
89
+ var formik_1 = require("formik");
90
+ var ui_1 = require("../../../../../ui/index.js");
91
+ var system_1 = require("../../../../../system/index.js");
92
+ var use_schemas_1 = require("./use-schemas.js");
93
+ var use_send_file_1 = require("./use-send-file.js");
94
+ var custom_submit_1 = require("../custom-submit/index.js");
95
+ var S = __importStar(require("../styles.js"));
96
+ function FormElement(_a) {
97
+ var i18n = _a.i18n, button = _a.button, schema = _a.schema, children = _a.children, onFinish = _a.onFinish, onSucess = _a.onSucess, debugMode = _a.debugMode, fileFields = _a.fileFields, autoComplete = _a.autoComplete, customSubmit = _a.customSubmit, onChangeForm = _a.onChangeForm, customAction = _a.customAction, decimalFields = _a.decimalFields, defaultSchemas = _a.defaultSchemas, isStickyButtons = _a.isStickyButtons, _b = _a.cleanFieldsOnSubmit, cleanFieldsOnSubmit = _b === void 0 ? true : _b, _c = _a.disableEnterKeySubmitForm, disableEnterKeySubmitForm = _c === void 0 ? false : _c;
98
+ var _d = (0, react_1.useState)({ state: '', message: '' }), stateForm = _d[0], setStateForm = _d[1];
99
+ var sendFiles = (0, use_send_file_1.useSendFile)({ fileFields: fileFields, debugMode: debugMode });
100
+ var validateSchemas = (0, use_schemas_1.useSchemas)({ schema: schema, defaultSchemas: defaultSchemas, i18n: i18n });
101
+ var _e = (0, formik_1.useFormikContext)(), values = _e.values, setErrors = _e.setErrors, setFieldError = _e.setFieldError, setFieldValue = _e.setFieldValue;
102
+ function onSubmit(action) {
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ var payload_1, hasFileFields, response, err_1, errors_1, validationErrors_1;
105
+ var _a;
106
+ return __generator(this, function (_b) {
107
+ switch (_b.label) {
108
+ case 0:
109
+ _b.trys.push([0, 7, 8, 9]);
110
+ if (debugMode) {
111
+ console.log('values', values);
112
+ }
113
+ setErrors({});
114
+ setStateForm({ state: 'loading', message: '' });
115
+ return [4 /*yield*/, validateSchemas()];
116
+ case 1:
117
+ _b.sent();
118
+ payload_1 = lodash_1.default.cloneDeep(values);
119
+ if (decimalFields && decimalFields.length > 0) {
120
+ payload_1 = Object.keys(payload_1).reduce(function (reducer, key) {
121
+ var _a, _b;
122
+ if (decimalFields.find(function (field) { return field === key; })) {
123
+ reducer[key] = parseFloat(((_a = String(payload_1[key])) === null || _a === void 0 ? void 0 : _a.includes(','))
124
+ ? (_b = payload_1[key]) === null || _b === void 0 ? void 0 : _b.replaceAll(/\./g, '').replace(',', '.')
125
+ : payload_1[key]);
126
+ }
127
+ else {
128
+ reducer[key] = payload_1[key];
129
+ }
130
+ return reducer;
131
+ }, {});
132
+ }
133
+ hasFileFields = (fileFields === null || fileFields === void 0 ? void 0 : fileFields.fields) && ((_a = fileFields === null || fileFields === void 0 ? void 0 : fileFields.fields) === null || _a === void 0 ? void 0 : _a.length) > 0;
134
+ if (hasFileFields) {
135
+ fileFields === null || fileFields === void 0 ? void 0 : fileFields.fields.forEach(function (field) {
136
+ payload_1[field] = undefined;
137
+ });
138
+ }
139
+ if (debugMode) {
140
+ console.log('PAYLOAD_FORMATTED', payload_1);
141
+ }
142
+ if (!(onSucess && !action)) return [3 /*break*/, 4];
143
+ return [4 /*yield*/, onSucess(payload_1, { setFieldError: setFieldError, setFieldValue: setFieldValue })];
144
+ case 2:
145
+ response = _b.sent();
146
+ if (debugMode) {
147
+ console.log('response', response);
148
+ }
149
+ if (!hasFileFields) return [3 /*break*/, 4];
150
+ return [4 /*yield*/, sendFiles({ response: response, valuesForm: values })];
151
+ case 3:
152
+ _b.sent();
153
+ _b.label = 4;
154
+ case 4:
155
+ onFinish && onFinish(payload_1);
156
+ !action && setStateForm({ state: 'send', message: '' });
157
+ if (!action) return [3 /*break*/, 6];
158
+ return [4 /*yield*/, action(payload_1, setStateForm)];
159
+ case 5:
160
+ _b.sent();
161
+ _b.label = 6;
162
+ case 6:
163
+ if (cleanFieldsOnSubmit) {
164
+ Object.keys(values).forEach(function (key) {
165
+ setFieldValue(key, undefined);
166
+ });
167
+ }
168
+ return [3 /*break*/, 9];
169
+ case 7:
170
+ err_1 = _b.sent();
171
+ if (debugMode) {
172
+ console.log('error', err_1);
173
+ console.log('instanceoferror', typeof err_1);
174
+ }
175
+ if (err_1 instanceof yup.ValidationError) {
176
+ errors_1 = err_1.inner.reduce(function (reducer, error) {
177
+ if (reducer && Object.keys(reducer).find(function (r) { return r === error.path; })) {
178
+ return reducer;
179
+ }
180
+ reducer[error.path] = error.message;
181
+ return reducer;
182
+ }, {});
183
+ Object.keys(errors_1).forEach(function (key) {
184
+ console.log(errors_1, key, errors_1[key]);
185
+ setFieldError(key, errors_1[key]);
186
+ });
187
+ setStateForm({ state: 'default', message: '' });
188
+ return [2 /*return*/];
189
+ }
190
+ if (err_1 instanceof system_1.BadRequestError || err_1 instanceof system_1.ConflictError) {
191
+ setStateForm({ state: 'error', message: err_1.error.message });
192
+ return [2 /*return*/];
193
+ }
194
+ if (err_1 instanceof system_1.ValidationError) {
195
+ setStateForm({ state: 'default', message: '' });
196
+ validationErrors_1 = err_1.errors;
197
+ Object.keys(validationErrors_1).forEach(function (key) {
198
+ setFieldError(key, validationErrors_1[key].errors[0]);
199
+ });
200
+ }
201
+ return [3 /*break*/, 9];
202
+ case 8:
203
+ setStateForm(function (state) {
204
+ if (state.state === 'loading') {
205
+ return { message: '', state: 'default' };
206
+ }
207
+ return state;
208
+ });
209
+ return [7 /*endfinally*/];
210
+ case 9: return [2 /*return*/];
211
+ }
212
+ });
213
+ });
214
+ }
215
+ function handleSubmit(action) {
216
+ return __awaiter(this, void 0, void 0, function () {
217
+ return __generator(this, function (_a) {
218
+ switch (_a.label) {
219
+ case 0: return [4 /*yield*/, onSubmit(action)];
220
+ case 1:
221
+ _a.sent();
222
+ return [2 /*return*/];
223
+ }
224
+ });
225
+ });
226
+ }
227
+ var handleKeyDown = function (e) {
228
+ if (!disableEnterKeySubmitForm && e.key === 'Enter' && stateForm.state !== 'loading') {
229
+ e.preventDefault();
230
+ onSubmit();
231
+ }
232
+ };
233
+ (0, react_1.useEffect)(function () {
234
+ onChangeForm && onChangeForm.callbackResult(values);
235
+ }, __spreadArray([values], ((onChangeForm === null || onChangeForm === void 0 ? void 0 : onChangeForm.additionalDependencies) || []), true));
236
+ return ((0, jsx_runtime_1.jsx)(formik_1.Form, { autoComplete: autoComplete, children: (0, jsx_runtime_1.jsxs)(S.FormHandler, { onKeyDown: handleKeyDown, children: [stateForm.state === 'error' && (0, jsx_runtime_1.jsx)("span", { className: 'error-form', children: stateForm.message }), (0, jsx_runtime_1.jsx)("div", { className: 'conntent_form_infinity_forge', children: children }), (0, jsx_runtime_1.jsxs)("div", { className: "form-button ".concat(isStickyButtons ? 'sticky' : ''), children: [customAction && (0, jsx_runtime_1.jsx)(customAction.Component, __assign({}, (customAction.props || {}), { setFieldValue: setFieldValue })), button && ((0, jsx_runtime_1.jsx)(ui_1.Button, __assign({}, button, { type: 'button', onClick: function () { return handleSubmit(); }, loading: stateForm.state === 'loading' }))), customSubmit &&
237
+ customSubmit.length > 0 &&
238
+ customSubmit.map(function (custom, index) { return ((0, jsx_runtime_1.jsx)(custom_submit_1.CustomSubmitButton, __assign({}, custom, { stateForm: stateForm, onSubmit: handleSubmit }), index)); })] })] }) }));
239
+ }
240
+ exports.default = FormElement;
241
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import { IFormHandler } from '../interfaces.js';
2
+ export declare function useSchemas(props: Partial<IFormHandler>): () => Promise<void>;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
72
+ Object.defineProperty(exports, "__esModule", { value: true });
73
+ exports.useSchemas = void 0;
74
+ var formik_1 = require("formik");
75
+ var yup = __importStar(require("yup"));
76
+ var generate_schemas_1 = require("./generate-schemas.js");
77
+ function useSchemas(props) {
78
+ var values = (0, formik_1.useFormikContext)().values;
79
+ function validateSchemas() {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var hasSchema, allDefaultSchemas, schemaI18n, schemaObject;
82
+ var _a, _b;
83
+ return __generator(this, function (_c) {
84
+ switch (_c.label) {
85
+ case 0:
86
+ hasSchema = props.schema || props.defaultSchemas || ((_a = props.i18n) === null || _a === void 0 ? void 0 : _a.schema) || {};
87
+ if (!hasSchema) return [3 /*break*/, 3];
88
+ return [4 /*yield*/, (0, generate_schemas_1.generateSchemasByDemand)(props.defaultSchemas)];
89
+ case 1:
90
+ allDefaultSchemas = _c.sent();
91
+ schemaI18n = {};
92
+ if ((_b = props.i18n) === null || _b === void 0 ? void 0 : _b.schema) {
93
+ schemaI18n = {
94
+ i18n: yup
95
+ .object()
96
+ .shape(props.i18n.languages.reduce(function (reducer, language) {
97
+ var _a;
98
+ return (__assign(__assign({}, reducer), (_a = {}, _a[language.symbol] = yup.object().shape(props.i18n.schema), _a)));
99
+ }, {})),
100
+ };
101
+ }
102
+ schemaObject = __assign(__assign(__assign({}, allDefaultSchemas), (props.schema || {})), schemaI18n);
103
+ return [4 /*yield*/, yup.object().shape(schemaObject).validate(values, { abortEarly: false })];
104
+ case 2:
105
+ _c.sent();
106
+ _c.label = 3;
107
+ case 3: return [2 /*return*/];
108
+ }
109
+ });
110
+ });
111
+ }
112
+ return validateSchemas;
113
+ }
114
+ exports.useSchemas = useSchemas;
115
+ //# sourceMappingURL=use-schemas.js.map
@@ -0,0 +1,5 @@
1
+ import { IFormHandler } from '../interfaces.js';
2
+ export declare function useSendFile(props: Partial<IFormHandler>): ({ response, valuesForm }: {
3
+ response: any;
4
+ valuesForm: any;
5
+ }) => Promise<void>;
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.useSendFile = void 0;
49
+ var formik_1 = require("formik");
50
+ var sites_1 = require("../../../../../sites/index.js");
51
+ var system_1 = require("../../../../../system/index.js");
52
+ function useSendFile(props) {
53
+ var _a = (0, formik_1.useFormikContext)(), values = _a.values, setFieldError = _a.setFieldError, initialValues = _a.initialValues, setFieldValue = _a.setFieldValue;
54
+ function sendFiles(_a) {
55
+ return __awaiter(this, arguments, void 0, function (_b) {
56
+ var keyFile, id, _i, _c, field, value, _d, _e, file, fileId, hasUniqueFields, formData, response_1, _f, _g, mobile, formData;
57
+ var _this = this;
58
+ var _h;
59
+ var response = _b.response, valuesForm = _b.valuesForm;
60
+ return __generator(this, function (_j) {
61
+ switch (_j.label) {
62
+ case 0:
63
+ keyFile = ((_h = props.fileFields) === null || _h === void 0 ? void 0 : _h.keyRef) || 'id';
64
+ if (props.debugMode) {
65
+ console.log('keyfile', keyFile);
66
+ console.log('response + keyfile', response[keyFile]);
67
+ }
68
+ id = response[keyFile];
69
+ if (!id) {
70
+ throw new system_1.BadRequestError({
71
+ message: 'Não foi possível processar a resposta para salvar as imagens.',
72
+ code: '400',
73
+ });
74
+ }
75
+ if (props.debugMode) {
76
+ console.log(props.fileFields.fields);
77
+ console.log('initialData', initialValues);
78
+ }
79
+ if (initialValues && !props.fileFields.unique) {
80
+ props.fileFields.fields.forEach(function (field) { return __awaiter(_this, void 0, void 0, function () {
81
+ var initialValue, currentValue, isUniqueFile, currentMobileFiles_1, initialMobileFiles, excludedFiles, excludedMobileFiles, excluded, _i, _a, item;
82
+ var _b, _c, _d, _e, _f, _g;
83
+ return __generator(this, function (_h) {
84
+ switch (_h.label) {
85
+ case 0:
86
+ initialValue = (_b = initialValues[field]) !== null && _b !== void 0 ? _b : [];
87
+ currentValue = (_c = valuesForm[field]) !== null && _c !== void 0 ? _c : [];
88
+ if (!initialValue)
89
+ return [2 /*return*/];
90
+ isUniqueFile = (_e = (_d = props.fileFields) === null || _d === void 0 ? void 0 : _d.uniqueFields) === null || _e === void 0 ? void 0 : _e.includes(field);
91
+ if (!!isUniqueFile) return [3 /*break*/, 4];
92
+ currentMobileFiles_1 = currentValue
93
+ .map(function (current) { return current.mobile; })
94
+ .flatMap(function (item) { return item; })
95
+ .filter(Boolean);
96
+ initialMobileFiles = initialValue
97
+ .map(function (initial) { return initial.mobile; })
98
+ .flatMap(function (item) { return item; })
99
+ .filter(Boolean);
100
+ excludedFiles = (_f = initialValue.filter(function (initial) { return !currentValue.find(function (current) { return current.id === initial.id; }); })) !== null && _f !== void 0 ? _f : [];
101
+ excludedMobileFiles = (_g = initialMobileFiles.filter(function (initial) { return !currentMobileFiles_1.find(function (current) { return current.id === initial.id; }); })) !== null && _g !== void 0 ? _g : [];
102
+ excluded = __spreadArray(__spreadArray([], excludedFiles, true), excludedMobileFiles, true).filter(Boolean);
103
+ _i = 0, _a = excluded;
104
+ _h.label = 1;
105
+ case 1:
106
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
107
+ item = _a[_i];
108
+ return [4 /*yield*/, (0, sites_1.api)({
109
+ url: "metadata/".concat(item.id),
110
+ method: 'delete',
111
+ })];
112
+ case 2:
113
+ _h.sent();
114
+ _h.label = 3;
115
+ case 3:
116
+ _i++;
117
+ return [3 /*break*/, 1];
118
+ case 4: return [2 /*return*/];
119
+ }
120
+ });
121
+ }); });
122
+ }
123
+ _i = 0, _c = props.fileFields.fields;
124
+ _j.label = 1;
125
+ case 1:
126
+ if (!(_i < _c.length)) return [3 /*break*/, 10];
127
+ field = _c[_i];
128
+ value = valuesForm[field];
129
+ if (!value) return [3 /*break*/, 9];
130
+ if (!Array.isArray(value)) return [3 /*break*/, 9];
131
+ _d = 0, _e = value;
132
+ _j.label = 2;
133
+ case 2:
134
+ if (!(_d < _e.length)) return [3 /*break*/, 9];
135
+ file = _e[_d];
136
+ fileId = String(file.id);
137
+ hasUniqueFields = props.fileFields.uniqueFields && props.fileFields.uniqueFields.length > 0;
138
+ if (!file.file) return [3 /*break*/, 4];
139
+ formData = new FormData();
140
+ formData.append('entityId', id);
141
+ formData.append('entityType', field + props.fileFields.ref);
142
+ formData.append('files', file.file);
143
+ return [4 /*yield*/, (0, sites_1.api)({
144
+ method: 'post',
145
+ url: "metadata?unique=".concat(hasUniqueFields
146
+ ? props.fileFields.uniqueFields.includes(field)
147
+ : props.fileFields.unique === undefined
148
+ ? true
149
+ : props.fileFields.unique),
150
+ body: formData,
151
+ headers: {
152
+ 'Content-Type': 'multipart/form-data; boundary=something',
153
+ },
154
+ })];
155
+ case 3:
156
+ response_1 = _j.sent();
157
+ fileId = response_1.id;
158
+ _j.label = 4;
159
+ case 4:
160
+ if (!Array.isArray(file.mobile)) return [3 /*break*/, 8];
161
+ _f = 0, _g = file.mobile;
162
+ _j.label = 5;
163
+ case 5:
164
+ if (!(_f < _g.length)) return [3 /*break*/, 8];
165
+ mobile = _g[_f];
166
+ if (!mobile.file) return [3 /*break*/, 7];
167
+ formData = new FormData();
168
+ formData.append('entityId', fileId);
169
+ formData.append('entityType', field + props.fileFields.ref);
170
+ formData.append('files', mobile.file);
171
+ return [4 /*yield*/, (0, sites_1.api)({
172
+ method: 'post',
173
+ url: "metadata?unique=".concat(hasUniqueFields
174
+ ? props.fileFields.uniqueFields.includes(field)
175
+ : props.fileFields.unique === undefined
176
+ ? true
177
+ : props.fileFields.unique),
178
+ body: formData,
179
+ headers: {
180
+ 'Content-Type': 'multipart/form-data; boundary=something',
181
+ },
182
+ })];
183
+ case 6:
184
+ _j.sent();
185
+ _j.label = 7;
186
+ case 7:
187
+ _f++;
188
+ return [3 /*break*/, 5];
189
+ case 8:
190
+ _d++;
191
+ return [3 /*break*/, 2];
192
+ case 9:
193
+ _i++;
194
+ return [3 /*break*/, 1];
195
+ case 10:
196
+ if (!props.fileFields.onUpload) return [3 /*break*/, 12];
197
+ return [4 /*yield*/, props.fileFields.onUpload(values, response, { setFieldError: setFieldError, setFieldValue: setFieldValue })];
198
+ case 11:
199
+ _j.sent();
200
+ _j.label = 12;
201
+ case 12: return [2 /*return*/];
202
+ }
203
+ });
204
+ });
205
+ }
206
+ return sendFiles;
207
+ }
208
+ exports.useSendFile = useSendFile;
209
+ //# sourceMappingURL=use-send-file.js.map
@@ -1,4 +1,4 @@
1
- import { TabContentProps } from "../../../../../../system";
1
+ import { TabContentProps } from "../../../../../../system/index.js";
2
2
  export declare function CaptureI18nErrors({ languages, changeTab }: {
3
3
  languages: {
4
4
  symbol: string;
@@ -0,0 +1,2 @@
1
+ import { IFormHandler } from '../interfaces.js';
2
+ export declare function FormI18n(props: IFormHandler): import("react/jsx-runtime").JSX.Element;
@@ -17,10 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.FormI18n = void 0;
18
18
  var jsx_runtime_1 = require("react/jsx-runtime");
19
19
  var formik_1 = require("formik");
20
- var ui_1 = require("../../../../../ui");
21
- var system_1 = require("../../../../../system");
22
- var form_handler_1 = __importDefault(require("../form-handler"));
23
- var capture_i18n_errors_1 = require("./capture-i18n-errors");
20
+ var ui_1 = require("../../../../../ui/index.js");
21
+ var system_1 = require("../../../../../system/index.js");
22
+ var form_handler_1 = __importDefault(require("../form-handler/index.js"));
23
+ var capture_i18n_errors_1 = require("./capture-i18n-errors/index.js");
24
24
  function FormI18n(props) {
25
25
  var _a;
26
26
  var languages = (0, ui_1.useI18n)().languages;
@@ -1,5 +1,5 @@
1
- import { InputCepProps } from '../interfaces';
1
+ import { InputCepProps } from '../interfaces.js';
2
2
  export declare function useCep<T = any>(props: InputCepProps<T>): {
3
3
  getCep: (zipCode: any) => Promise<T>;
4
- fields: import("../interfaces").FieldsProviderCep<T>;
4
+ fields: import("../interfaces.js").FieldsProviderCep<T>;
5
5
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCep = void 0;
4
- var providers_1 = require("./providers");
4
+ var providers_1 = require("./providers/index.js");
5
5
  function useCep(props) {
6
6
  switch (props.providerType) {
7
7
  case 'ibge':
@@ -1,2 +1,2 @@
1
- export * from './hook';
2
- export * from './providers';
1
+ export * from './hook.js';
2
+ export * from './providers/index.js';
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hook"), exports);
18
- __exportStar(require("./providers"), exports);
17
+ __exportStar(require("./hook.js"), exports);
18
+ __exportStar(require("./providers/index.js"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { FieldsProviderCep, InputCepProps } from '../../../../../../../ui';
1
+ import { FieldsProviderCep, InputCepProps } from '../../../../../../../ui/index.js';
2
2
  export declare function useCepIBGE<T = any>({ fields }: InputCepProps<T>): {
3
3
  getCep: (zipCode: any) => Promise<T>;
4
4
  fields: FieldsProviderCep<T>;