infinity-forge 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) 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/featured-blog/index.d.ts +1 -1
  5. package/dist/sites/components/default-pages/blog/components/featured-blog/index.js +2 -2
  6. package/dist/sites/components/default-pages/blog/components/featured-blog/interfaces.d.ts +2 -2
  7. package/dist/sites/components/default-pages/blog/components/side-box-categories/index.d.ts +2 -2
  8. package/dist/sites/components/default-pages/blog/components/side-box-categories/index.js +2 -2
  9. package/dist/sites/components/default-pages/blog/components/side-box-categories/interfaces.d.ts +1 -1
  10. package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.d.ts +1 -1
  11. package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.js +3 -3
  12. package/dist/sites/components/default-pages/blog/components/title-blog/index.js +2 -2
  13. package/dist/system/domain/protocols/http/errors/http-errors/index.d.ts +7 -7
  14. package/dist/system/domain/protocols/http/errors/http-errors/index.js +7 -7
  15. package/dist/system/domain/protocols/http/errors/system-errors-model/index.d.ts +1 -1
  16. package/dist/system/domain/protocols/http/errors/system-errors-model/index.js +1 -1
  17. package/dist/system/domain/use-cases/auth/admin/index.js +0 -18
  18. package/dist/system/presentation/components/data/avatar/index.js +0 -59
  19. package/dist/system/presentation/components/data/buttons/index.d.ts +0 -1
  20. package/dist/system/presentation/components/data/buttons/index.js +0 -18
  21. package/dist/system/presentation/components/data/buttons/sidebar-button/index.js +3 -3
  22. package/dist/system/presentation/components/data/chat/card-message/index.d.ts +1 -1
  23. package/dist/system/presentation/components/data/chat/card-message/index.js +3 -3
  24. package/dist/system/presentation/components/data/chat/index.d.ts +0 -2
  25. package/dist/system/presentation/components/data/chat/index.js +0 -38
  26. package/dist/system/presentation/components/data/chat/interfaces.d.ts +0 -8
  27. package/dist/system/presentation/components/data/chat/loader/index.js +1 -1
  28. package/dist/system/presentation/components/data/detail-card/component.d.ts +0 -2
  29. package/dist/system/presentation/components/data/detail-card/component.js +0 -42
  30. package/dist/system/presentation/components/data/detail-card/index.d.ts +0 -2
  31. package/dist/system/presentation/components/data/detail-card/index.js +0 -19
  32. package/dist/system/presentation/components/data/detail-card/interfaces.d.ts +0 -19
  33. package/dist/system/presentation/components/data/highlight-icon/index.d.ts +0 -2
  34. package/dist/system/presentation/components/data/highlight-icon/index.js +0 -40
  35. package/dist/system/presentation/components/data/highlight-icon/interfaces.d.ts +0 -8
  36. package/dist/system/presentation/components/data/highlight-text/index.d.ts +0 -2
  37. package/dist/system/presentation/components/data/highlight-text/index.js +0 -43
  38. package/dist/system/presentation/components/data/input-search/index.d.ts +0 -2
  39. package/dist/system/presentation/components/data/input-search/index.js +0 -39
  40. package/dist/system/presentation/components/data/logo/index.js +0 -34
  41. package/dist/system/presentation/components/data/menu/component.js +0 -17
  42. package/dist/system/presentation/components/data/menu/components/index.d.ts +1 -1
  43. package/dist/system/presentation/components/data/menu/components/index.js +1 -1
  44. package/dist/system/presentation/components/data/menu/index.d.ts +0 -2
  45. package/dist/system/presentation/components/data/menu/index.js +0 -19
  46. package/dist/system/presentation/components/data/menu/modes/index.d.ts +2 -2
  47. package/dist/system/presentation/components/data/menu/modes/index.js +2 -2
  48. package/dist/system/presentation/components/data/notifications/card/index.d.ts +1 -1
  49. package/dist/system/presentation/components/data/notifications/card/index.js +2 -2
  50. package/dist/system/presentation/components/data/notifications/index.js +0 -155
  51. package/dist/system/presentation/components/data/page-wrapper/index.d.ts +0 -2
  52. package/dist/system/presentation/components/data/page-wrapper/index.js +0 -35
  53. package/dist/system/presentation/components/data/page-wrapper/interfaces.d.ts +0 -7
  54. package/dist/system/presentation/components/data/popover/index.d.ts +0 -2
  55. package/dist/system/presentation/components/data/profile-infos/index.d.ts +0 -2
  56. package/dist/system/presentation/components/data/profile-infos/index.js +0 -48
  57. package/dist/system/presentation/components/data/profile-infos/interfaces.d.ts +0 -6
  58. package/dist/system/presentation/components/data/profile-infos/profile/index.d.ts +1 -1
  59. package/dist/system/presentation/components/data/profile-infos/profile/index.js +3 -3
  60. package/dist/system/presentation/components/data/select-workspace/index.d.ts +0 -4
  61. package/dist/system/presentation/components/data/select-workspace/index.js +0 -69
  62. package/dist/system/presentation/components/data/tab/component.d.ts +0 -2
  63. package/dist/system/presentation/components/data/tab/component.js +0 -67
  64. package/dist/system/presentation/components/data/tab/index.d.ts +0 -2
  65. package/dist/system/presentation/components/data/tab/index.js +0 -19
  66. package/dist/system/presentation/components/data/tab/interfaces.d.ts +0 -29
  67. package/dist/system/presentation/components/data/tab/tab-item/index.d.ts +5 -0
  68. package/dist/system/presentation/components/data/tab/tab-item/index.js +46 -0
  69. package/dist/system/presentation/components/data/tab/tab-item/styles.d.ts +8 -0
  70. package/dist/system/presentation/components/layout/header/components/index.d.ts +2 -0
  71. package/dist/system/presentation/components/layout/header/components/index.js +19 -0
  72. package/dist/system/presentation/components/layout/header/index.d.ts +0 -2
  73. package/dist/system/presentation/components/layout/header/index.js +0 -25
  74. package/dist/system/presentation/components/layout/header/version-01/index.d.ts +2 -0
  75. package/dist/system/presentation/components/layout/header/version-01/index.js +45 -0
  76. package/dist/system/presentation/components/pages/menus/index.d.ts +0 -1
  77. package/dist/system/presentation/components/pages/menus/index.js +0 -18
  78. package/dist/system/presentation/components/pages/menus/page.js +0 -40
  79. package/dist/system/presentation/components/pages/menus/table/columns.d.ts +3 -0
  80. package/dist/system/presentation/components/pages/menus/table/columns.js +21 -0
  81. package/dist/system/presentation/components/pages/menus/table/create.d.ts +3 -0
  82. package/dist/system/presentation/components/pages/menus/table/create.js +72 -0
  83. package/dist/system/presentation/components/pages/menus/table/delete.js +71 -0
  84. package/dist/system/presentation/components/pages/menus/table/edit.d.ts +3 -0
  85. package/dist/system/presentation/components/pages/menus/table/edit.js +78 -0
  86. package/dist/system/presentation/components/pages/menus/table/index.d.ts +4 -0
  87. package/dist/system/presentation/components/pages/menus/table/index.js +21 -0
  88. package/dist/system/presentation/components/pages/users/index.d.ts +0 -1
  89. package/dist/system/presentation/components/pages/users/index.js +0 -18
  90. package/dist/system/presentation/components/pages/users/page.js +0 -40
  91. package/dist/system/presentation/components/pages/users/table/columns.d.ts +3 -0
  92. package/dist/system/presentation/components/pages/users/table/create.d.ts +3 -0
  93. package/dist/system/presentation/components/pages/users/table/create.js +75 -0
  94. package/dist/system/presentation/components/pages/users/table/delete.js +74 -0
  95. package/dist/system/presentation/components/pages/users/table/edit.d.ts +3 -0
  96. package/dist/system/presentation/components/pages/users/table/edit.js +83 -0
  97. package/dist/system/presentation/components/pages/users/table/index.d.ts +4 -0
  98. package/dist/system/presentation/components/pages/users/table/index.js +21 -0
  99. package/dist/system/presentation/context/auth/components/index.d.ts +0 -2
  100. package/dist/system/presentation/context/auth/components/index.js +0 -19
  101. package/dist/system/presentation/context/auth/components/login/index.js +38 -0
  102. package/dist/system/presentation/context/auth/components/private-page/index.d.ts +2 -0
  103. package/dist/system/presentation/context/auth/components/private-page/index.js +141 -0
  104. package/dist/system/presentation/hooks/notifications/use-load-all/index.d.ts +0 -1
  105. package/dist/system/presentation/hooks/notifications/use-load-all/index.js +0 -63
  106. package/dist/system/presentation/hooks/notifications/use-load-no-read/index.d.ts +0 -2
  107. package/dist/system/presentation/hooks/notifications/use-load-no-read/index.js +0 -60
  108. package/dist/system/presentation/hooks/ui/use-table/component.d.ts +0 -8
  109. package/dist/system/presentation/hooks/ui/use-table/component.js +0 -26
  110. package/dist/system/presentation/hooks/ui/use-table/components/index.d.ts +1 -0
  111. package/dist/system/presentation/hooks/ui/use-table/components/index.js +18 -0
  112. package/dist/system/presentation/hooks/ui/use-table/index.d.ts +0 -4
  113. package/dist/system/presentation/hooks/ui/use-table/index.js +0 -21
  114. package/dist/system/presentation/hooks/ui/use-table/interfaces.d.ts +0 -92
  115. package/dist/system/presentation/hooks/ui/use-table/query/get-query-arguments-table.d.ts +2 -0
  116. package/dist/system/presentation/hooks/ui/use-table/query/hook.d.ts +5 -0
  117. package/dist/system/presentation/hooks/ui/use-table/query/hook.js +52 -0
  118. package/dist/system/presentation/hooks/ui/use-table/query/index.d.ts +2 -0
  119. package/dist/system/presentation/hooks/ui/use-table/query/index.js +19 -0
  120. package/dist/ui/components/carousel/carousel-lib/components-shared/get-changed-params.js +0 -51
  121. package/dist/ui/components/carousel/carousel-lib/components-shared/get-element-params.js +0 -148
  122. package/dist/ui/components/carousel/carousel-lib/components-shared/get-params.js +0 -61
  123. package/dist/ui/components/carousel/carousel-lib/components-shared/mount-swiper.js +0 -24
  124. package/dist/ui/components/carousel/carousel-lib/components-shared/update-swiper.js +0 -208
  125. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/getBreakpoint.js +35 -0
  126. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.d.ts +7 -0
  127. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.js +9 -0
  128. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/setBreakpoint.js +94 -0
  129. package/dist/ui/components/carousel/carousel-lib/core/classes/index.d.ts +7 -0
  130. package/dist/ui/components/carousel/carousel-lib/core/classes/index.js +9 -0
  131. package/dist/ui/components/carousel/carousel-lib/core/core.js +0 -654
  132. package/dist/ui/components/carousel/carousel-lib/core/events/index.js +77 -0
  133. package/dist/ui/components/carousel/carousel-lib/core/events/onLoad.js +14 -0
  134. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchEnd.js +194 -0
  135. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchMove.js +314 -0
  136. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchStart.js +154 -0
  137. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.d.ts +7 -0
  138. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.js +12 -0
  139. package/dist/ui/components/carousel/carousel-lib/core/loop/index.d.ts +9 -0
  140. package/dist/ui/components/carousel/carousel-lib/core/loop/index.js +14 -0
  141. package/dist/ui/components/carousel/carousel-lib/core/loop/loopCreate.js +57 -0
  142. package/dist/ui/components/carousel/carousel-lib/core/loop/loopFix.js +230 -0
  143. package/dist/ui/components/carousel/carousel-lib/core/moduleExtendParams.js +0 -42
  144. package/dist/ui/components/carousel/carousel-lib/core/slide/index.d.ts +17 -0
  145. package/dist/ui/components/carousel/carousel-lib/core/slide/index.js +22 -0
  146. package/dist/ui/components/carousel/carousel-lib/core/slide/slideTo.js +160 -0
  147. package/dist/ui/components/carousel/carousel-lib/core/slide/slideToClickedSlide.js +46 -0
  148. package/dist/ui/components/carousel/carousel-lib/core/transition/index.d.ts +9 -0
  149. package/dist/ui/components/carousel/carousel-lib/core/transition/index.js +14 -0
  150. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionEnd.js +18 -0
  151. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionStart.js +19 -0
  152. package/dist/ui/components/carousel/carousel-lib/core/translate/getTranslate.js +21 -0
  153. package/dist/ui/components/carousel/carousel-lib/core/translate/index.d.ts +13 -0
  154. package/dist/ui/components/carousel/carousel-lib/core/translate/index.js +18 -0
  155. package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +81 -0
  156. package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +21 -0
  157. package/dist/ui/components/carousel/carousel-lib/core/update/index.js +26 -0
  158. package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +125 -0
  159. package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +45 -0
  160. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +306 -0
  161. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +69 -0
  162. package/dist/ui/components/carousel/carousel-lib/modules/autoplay.js +0 -336
  163. package/dist/ui/components/carousel/carousel-lib/modules/effect-fade.js +0 -63
  164. package/dist/ui/components/carousel/carousel-lib/modules/free-mode.js +0 -247
  165. package/dist/ui/components/carousel/carousel-lib/modules/index.d.ts +0 -6
  166. package/dist/ui/components/carousel/carousel-lib/modules/index.js +0 -23
  167. package/dist/ui/components/carousel/carousel-lib/modules/navigation.js +0 -223
  168. package/dist/ui/components/carousel/carousel-lib/modules/pagination.js +0 -514
  169. package/dist/ui/components/carousel/carousel-lib/modules/virtual.js +0 -379
  170. package/dist/ui/components/carousel/carousel-lib/react/swiper-slide.js +0 -88
  171. package/dist/ui/components/carousel/carousel-lib/react/swiper.js +0 -210
  172. package/dist/ui/components/carousel/carousel-lib/shared/create-element-if-not-defined.js +0 -22
  173. package/dist/ui/components/carousel/carousel-lib/shared/create-shadow.js +0 -15
  174. package/dist/ui/components/carousel/carousel-lib/shared/effect-target.js +0 -13
  175. package/dist/ui/components/carousel/carousel-lib/shared/effect-virtual-transition-end.js +0 -47
  176. package/dist/ui/components/carousel/carousel-lib/shared/get-browser.js +0 -43
  177. package/dist/ui/components/carousel/carousel-lib/shared/get-device.js +0 -69
  178. package/dist/ui/components/carousel/carousel-lib/shared/get-support.js +0 -25
  179. package/dist/ui/components/carousel/carousel-lib/shared/utils.js +0 -372
  180. package/dist/ui/components/carousel/carousel-lib/ssr-window/document.js +0 -65
  181. package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.d.ts +0 -4
  182. package/dist/ui/components/carousel/carousel-lib/ssr-window/ssr-window.js +0 -15
  183. package/dist/ui/components/carousel/carousel-lib/ssr-window/window.js +0 -71
  184. package/dist/ui/components/carousel/carousel-lib/types/index.d.ts +0 -5
  185. package/dist/ui/components/carousel/carousel-lib/types/index.js +0 -27
  186. package/dist/ui/components/carousel/carousel-lib/types/swiper-events.d.ts +0 -162
  187. package/dist/ui/components/form/handler/custom-submit/index.d.ts +0 -17
  188. package/dist/ui/components/form/handler/custom-submit/index.js +0 -25
  189. package/dist/ui/components/form/handler/dynamic_form_handler/component.d.ts +0 -2
  190. package/dist/ui/components/form/handler/dynamic_form_handler/component.js +0 -117
  191. package/dist/ui/components/form/handler/dynamic_form_handler/index.d.ts +0 -2
  192. package/dist/ui/components/form/handler/dynamic_form_handler/index.js +0 -19
  193. package/dist/ui/components/form/handler/dynamic_form_handler/interfaces.d.ts +0 -28
  194. package/dist/ui/components/form/handler/form-handler/generate-schemas.js +0 -111
  195. package/dist/ui/components/form/handler/form-handler/index.d.ts +0 -2
  196. package/dist/ui/components/form/handler/form-handler/index.js +0 -241
  197. package/dist/ui/components/form/handler/form-handler/use-schemas.d.ts +0 -2
  198. package/dist/ui/components/form/handler/form-handler/use-schemas.js +0 -115
  199. package/dist/ui/components/form/handler/form-handler/use-send-file.d.ts +0 -5
  200. package/dist/ui/components/form/handler/form-handler/use-send-file.js +0 -209
  201. package/dist/ui/components/form/handler/i18n/index.d.ts +0 -2
  202. package/dist/ui/components/form/handler/i18n/index.js +4 -4
  203. package/dist/ui/components/form/input-cep/use-cep/hook.d.ts +2 -2
  204. package/dist/ui/components/form/input-cep/use-cep/hook.js +1 -1
  205. package/dist/ui/components/form/input-cep/use-cep/index.d.ts +2 -2
  206. package/dist/ui/components/form/input-cep/use-cep/index.js +2 -2
  207. package/dist/ui/components/form/input-control/error/index.js +1 -1
  208. package/dist/ui/components/form/input-control/label/index.js +1 -1
  209. package/dist/ui/components/form/input-control/loader-input/index.js +2 -2
  210. package/dist/ui/components/form/input-currency/components/CurrencyInput.js +1 -1
  211. package/dist/ui/components/form/input-currency/components/index.d.ts +1 -1
  212. package/dist/ui/components/form/input-currency/components/index.js +1 -1
  213. package/dist/ui/components/form/input-date-picker/calendar/index.d.ts +1 -1
  214. package/dist/ui/components/form/input-date-picker/calendar/index.js +4 -4
  215. package/dist/ui/components/form/input-date-picker/calendar/interface.d.ts +2 -2
  216. package/dist/ui/components/form/input-date-picker/calendar/styles.d.ts +1 -1
  217. package/dist/ui/components/form/input-date-picker/mock/index.d.ts +1 -1
  218. package/dist/ui/components/form/input-date-picker/mock/index.js +1 -1
  219. package/dist/ui/components/form/input-file/hooks/index.d.ts +4 -4
  220. package/dist/ui/components/form/input-file/hooks/index.js +4 -4
  221. package/dist/ui/components/form/input-file/hooks/use-components-file.d.ts +2 -2
  222. package/dist/ui/components/form/input-file/hooks/use-components-file.js +2 -2
  223. package/dist/ui/components/form/input-file/hooks/use-file-elements.d.ts +1 -1
  224. package/dist/ui/components/form/input-file/hooks/use-file-elements.js +2 -2
  225. package/dist/ui/components/form/input-file/hooks/use-file.d.ts +2 -2
  226. package/dist/ui/components/form/input-file/hooks/use-file.js +2 -2
  227. package/dist/ui/components/form/input-file/hooks/use-rendered-file.d.ts +1 -1
  228. package/dist/ui/components/form/input-file/hooks/use-rendered-file.js +1 -1
  229. package/dist/ui/components/form/input-file/render-files/component.d.ts +1 -1
  230. package/dist/ui/components/form/input-file/render-files/component.js +2 -2
  231. package/dist/ui/components/form/input-file/render-files/index.d.ts +3 -3
  232. package/dist/ui/components/form/input-file/render-files/index.js +3 -3
  233. package/dist/ui/components/form/input-file/render-files/interfaces.d.ts +2 -2
  234. package/dist/ui/components/form/input-seo/input-meta-image/index.d.ts +1 -1
  235. package/dist/ui/components/form/input-seo/input-meta-image/index.js +2 -2
  236. package/dist/ui/components/menu-mobile/components/nav-links/index.d.ts +1 -1
  237. package/dist/ui/components/menu-mobile/components/nav-links/index.js +3 -3
  238. package/dist/ui/components/menu-mobile/components/nav-links/interfaces.d.ts +1 -1
  239. package/package.json +1 -1
@@ -1,241 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- import { IFormHandler } from '../interfaces.js';
2
- export declare function useSchemas(props: Partial<IFormHandler>): () => Promise<void>;
@@ -1,115 +0,0 @@
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
@@ -1,5 +0,0 @@
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>;
@@ -1,209 +0,0 @@
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,2 +0,0 @@
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/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");
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");
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.js';
1
+ import { InputCepProps } from '../interfaces';
2
2
  export declare function useCep<T = any>(props: InputCepProps<T>): {
3
3
  getCep: (zipCode: any) => Promise<T>;
4
- fields: import("../interfaces.js").FieldsProviderCep<T>;
4
+ fields: import("../interfaces").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/index.js");
4
+ var providers_1 = require("./providers");
5
5
  function useCep(props) {
6
6
  switch (props.providerType) {
7
7
  case 'ibge':
@@ -1,2 +1,2 @@
1
- export * from './hook.js';
2
- export * from './providers/index.js';
1
+ export * from './hook';
2
+ export * from './providers';
@@ -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.js"), exports);
18
- __exportStar(require("./providers/index.js"), exports);
17
+ __exportStar(require("./hook"), exports);
18
+ __exportStar(require("./providers"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ErrorMessage = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
- var S = __importStar(require("./styles.js"));
28
+ var S = __importStar(require("./styles"));
29
29
  function ErrorMessage(_a) {
30
30
  var error = _a.error;
31
31
  return ((0, jsx_runtime_1.jsx)(S.ErrorMessage, { className: 'error-message', children: (0, jsx_runtime_1.jsx)("span", { className: 'font-12-medium', children: error }) }));