lkd-web-kit 0.0.18 → 0.1.0

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 (256) hide show
  1. package/dist/index.d.ts +106 -1
  2. package/dist/lkd-web-kit.css +1 -0
  3. package/dist/src/components/EmptyState/index.cjs +2 -0
  4. package/dist/src/components/EmptyState/index.cjs.map +1 -0
  5. package/dist/{components → src/components}/EmptyState/index.mjs +13 -13
  6. package/dist/src/components/EmptyState/index.mjs.map +1 -0
  7. package/dist/src/components/Icon.cjs.map +1 -0
  8. package/dist/src/components/Icon.mjs.map +1 -0
  9. package/dist/src/components/InfinityLoader/index.cjs.map +1 -0
  10. package/dist/src/components/InfinityLoader/index.mjs.map +1 -0
  11. package/dist/src/components/MyDatePickerInput/CalendarIcon.cjs +2 -0
  12. package/dist/src/components/MyDatePickerInput/CalendarIcon.cjs.map +1 -0
  13. package/dist/src/components/MyDatePickerInput/CalendarIcon.mjs +62 -0
  14. package/dist/src/components/MyDatePickerInput/CalendarIcon.mjs.map +1 -0
  15. package/dist/src/components/MyDatePickerInput/index.cjs +2 -0
  16. package/dist/src/components/MyDatePickerInput/index.cjs.map +1 -0
  17. package/dist/src/components/MyDatePickerInput/index.mjs +15 -0
  18. package/dist/src/components/MyDatePickerInput/index.mjs.map +1 -0
  19. package/dist/src/components/MyDateTimePicker/index.cjs +2 -0
  20. package/dist/src/components/MyDateTimePicker/index.cjs.map +1 -0
  21. package/dist/src/components/MyDateTimePicker/index.mjs +15 -0
  22. package/dist/src/components/MyDateTimePicker/index.mjs.map +1 -0
  23. package/dist/src/components/MyNotifications/index.cjs +2 -0
  24. package/dist/src/components/MyNotifications/index.cjs.map +1 -0
  25. package/dist/src/components/MyNotifications/index.mjs +14 -0
  26. package/dist/src/components/MyNotifications/index.mjs.map +1 -0
  27. package/dist/src/components/MyNumberInput/index.cjs +2 -0
  28. package/dist/src/components/MyNumberInput/index.cjs.map +1 -0
  29. package/dist/src/components/MyNumberInput/index.mjs +13 -0
  30. package/dist/src/components/MyNumberInput/index.mjs.map +1 -0
  31. package/dist/src/components/MySelect/index.cjs +2 -0
  32. package/dist/src/components/MySelect/index.cjs.map +1 -0
  33. package/dist/src/components/MySelect/index.mjs +13 -0
  34. package/dist/src/components/MySelect/index.mjs.map +1 -0
  35. package/dist/src/components/MyTextInput/index.cjs +2 -0
  36. package/dist/src/components/MyTextInput/index.cjs.map +1 -0
  37. package/dist/src/components/MyTextInput/index.mjs +13 -0
  38. package/dist/src/components/MyTextInput/index.mjs.map +1 -0
  39. package/dist/src/components/MyTextarea/index.cjs +2 -0
  40. package/dist/src/components/MyTextarea/index.cjs.map +1 -0
  41. package/dist/src/components/MyTextarea/index.mjs +13 -0
  42. package/dist/src/components/MyTextarea/index.mjs.map +1 -0
  43. package/dist/src/components/MyTimeInput/index.cjs +2 -0
  44. package/dist/src/components/MyTimeInput/index.cjs.map +1 -0
  45. package/dist/src/components/MyTimeInput/index.mjs +13 -0
  46. package/dist/src/components/MyTimeInput/index.mjs.map +1 -0
  47. package/dist/src/components/NavItems.cjs.map +1 -0
  48. package/dist/src/components/NavItems.mjs.map +1 -0
  49. package/dist/src/components/SelectInfinity/index.cjs.map +1 -0
  50. package/dist/src/components/SelectInfinity/index.mjs.map +1 -0
  51. package/dist/src/consts/http-status.cjs.map +1 -0
  52. package/dist/src/consts/http-status.mjs.map +1 -0
  53. package/dist/src/consts/revalidate.cjs.map +1 -0
  54. package/dist/src/consts/revalidate.mjs.map +1 -0
  55. package/dist/src/contexts/NavigationHistoryContext/index.cjs.map +1 -0
  56. package/dist/{contexts → src/contexts}/NavigationHistoryContext/index.mjs +4 -4
  57. package/dist/src/contexts/NavigationHistoryContext/index.mjs.map +1 -0
  58. package/dist/src/contexts/PageDataContext/index.cjs.map +1 -0
  59. package/dist/src/contexts/PageDataContext/index.mjs.map +1 -0
  60. package/dist/src/form/Form.cjs.map +1 -0
  61. package/dist/src/form/Form.mjs.map +1 -0
  62. package/dist/src/form/FormButtonSubmit.cjs.map +1 -0
  63. package/dist/src/form/FormButtonSubmit.mjs.map +1 -0
  64. package/dist/src/form/base/FormCheckbox.cjs +2 -0
  65. package/dist/src/form/base/FormCheckbox.cjs.map +1 -0
  66. package/dist/src/form/base/FormCheckbox.mjs +15 -0
  67. package/dist/src/form/base/FormCheckbox.mjs.map +1 -0
  68. package/dist/src/form/base/FormDatePickerInput.cjs +2 -0
  69. package/dist/src/form/base/FormDatePickerInput.cjs.map +1 -0
  70. package/dist/src/form/base/FormDatePickerInput.mjs +14 -0
  71. package/dist/src/form/base/FormDatePickerInput.mjs.map +1 -0
  72. package/dist/src/form/base/FormDateTimePicker.cjs +2 -0
  73. package/dist/src/form/base/FormDateTimePicker.cjs.map +1 -0
  74. package/dist/src/form/base/FormDateTimePicker.mjs +14 -0
  75. package/dist/src/form/base/FormDateTimePicker.mjs.map +1 -0
  76. package/dist/src/form/base/FormNumberInput.cjs +2 -0
  77. package/dist/src/form/base/FormNumberInput.cjs.map +1 -0
  78. package/dist/src/form/base/FormNumberInput.mjs +14 -0
  79. package/dist/src/form/base/FormNumberInput.mjs.map +1 -0
  80. package/dist/src/form/base/FormRadioGroup.cjs +2 -0
  81. package/dist/src/form/base/FormRadioGroup.cjs.map +1 -0
  82. package/dist/src/form/base/FormRadioGroup.mjs +14 -0
  83. package/dist/src/form/base/FormRadioGroup.mjs.map +1 -0
  84. package/dist/src/form/base/FormSelect.cjs +2 -0
  85. package/dist/src/form/base/FormSelect.cjs.map +1 -0
  86. package/dist/src/form/base/FormSelect.mjs +14 -0
  87. package/dist/src/form/base/FormSelect.mjs.map +1 -0
  88. package/dist/src/form/base/FormSelectInfinity.cjs +2 -0
  89. package/dist/src/form/base/FormSelectInfinity.cjs.map +1 -0
  90. package/dist/src/form/base/FormSelectInfinity.mjs +14 -0
  91. package/dist/src/form/base/FormSelectInfinity.mjs.map +1 -0
  92. package/dist/src/form/base/FormTextArea.cjs +2 -0
  93. package/dist/src/form/base/FormTextArea.cjs.map +1 -0
  94. package/dist/src/form/base/FormTextArea.mjs +14 -0
  95. package/dist/src/form/base/FormTextArea.mjs.map +1 -0
  96. package/dist/src/form/base/FormTextInput.cjs +2 -0
  97. package/dist/src/form/base/FormTextInput.cjs.map +1 -0
  98. package/dist/src/form/base/FormTextInput.mjs +14 -0
  99. package/dist/src/form/base/FormTextInput.mjs.map +1 -0
  100. package/dist/src/form/base/FormTimeInput.cjs +2 -0
  101. package/dist/src/form/base/FormTimeInput.cjs.map +1 -0
  102. package/dist/src/form/base/FormTimeInput.mjs +22 -0
  103. package/dist/src/form/base/FormTimeInput.mjs.map +1 -0
  104. package/dist/src/form/utils/nullableInput.cjs.map +1 -0
  105. package/dist/src/form/utils/nullableInput.mjs.map +1 -0
  106. package/dist/src/form/utils/zodValidator.cjs.map +1 -0
  107. package/dist/src/form/utils/zodValidator.mjs.map +1 -0
  108. package/dist/src/hocs/withForm.cjs +2 -0
  109. package/dist/src/hocs/withForm.cjs.map +1 -0
  110. package/dist/{hocs → src/hocs}/withForm.mjs +12 -14
  111. package/dist/src/hocs/withForm.mjs.map +1 -0
  112. package/dist/src/hocs/withModalManager.cjs.map +1 -0
  113. package/dist/src/hocs/withModalManager.mjs.map +1 -0
  114. package/dist/src/hooks/useBreakpoint.cjs +2 -0
  115. package/dist/src/hooks/useBreakpoint.cjs.map +1 -0
  116. package/dist/src/hooks/useBreakpoint.mjs +9 -0
  117. package/dist/src/hooks/useBreakpoint.mjs.map +1 -0
  118. package/dist/src/hooks/useFetchNextPageOnScroll.cjs.map +1 -0
  119. package/dist/src/hooks/useFetchNextPageOnScroll.mjs.map +1 -0
  120. package/dist/src/hooks/useOnScrollProgress.cjs.map +1 -0
  121. package/dist/src/hooks/useOnScrollProgress.mjs.map +1 -0
  122. package/dist/src/hooks/useUpdateSearchParams.cjs +2 -0
  123. package/dist/src/hooks/useUpdateSearchParams.cjs.map +1 -0
  124. package/dist/src/hooks/useUpdateSearchParams.mjs +19 -0
  125. package/dist/src/hooks/useUpdateSearchParams.mjs.map +1 -0
  126. package/dist/src/index.cjs +2 -0
  127. package/dist/src/index.mjs +103 -0
  128. package/dist/src/index.mjs.map +1 -0
  129. package/dist/{mantine/breakpointsWithPx.cjs → src/mantine/breakpoints-with-px.cjs} +1 -1
  130. package/dist/src/mantine/breakpoints-with-px.cjs.map +1 -0
  131. package/dist/{mantine/breakpointsWithPx.mjs → src/mantine/breakpoints-with-px.mjs} +1 -1
  132. package/dist/src/mantine/breakpoints-with-px.mjs.map +1 -0
  133. package/dist/src/mantine/my-default-theme.cjs +2 -0
  134. package/dist/src/mantine/my-default-theme.cjs.map +1 -0
  135. package/dist/src/mantine/my-default-theme.mjs +38 -0
  136. package/dist/src/mantine/my-default-theme.mjs.map +1 -0
  137. package/dist/{mantine/toTailwindColors.cjs → src/mantine/to-tailwind-colors.cjs} +1 -1
  138. package/dist/src/mantine/to-tailwind-colors.cjs.map +1 -0
  139. package/dist/{mantine/toTailwindColors.mjs → src/mantine/to-tailwind-colors.mjs} +1 -1
  140. package/dist/src/mantine/to-tailwind-colors.mjs.map +1 -0
  141. package/dist/src/utils/array/groupBy.cjs.map +1 -0
  142. package/dist/src/utils/array/groupBy.mjs.map +1 -0
  143. package/dist/src/utils/array/shuffleArray.cjs.map +1 -0
  144. package/dist/src/utils/array/shuffleArray.mjs.map +1 -0
  145. package/dist/src/utils/formatBytes.cjs.map +1 -0
  146. package/dist/src/utils/formatBytes.mjs.map +1 -0
  147. package/dist/src/utils/isInfinityEmpty.cjs.map +1 -0
  148. package/dist/src/utils/isInfinityEmpty.mjs.map +1 -0
  149. package/dist/src/utils/ky/addBodyJsonHook.cjs.map +1 -0
  150. package/dist/src/utils/ky/addBodyJsonHook.mjs.map +1 -0
  151. package/dist/src/utils/ky/parseJson.cjs.map +1 -0
  152. package/dist/src/utils/ky/parseJson.mjs.map +1 -0
  153. package/dist/src/utils/newHref.cjs.map +1 -0
  154. package/dist/src/utils/newHref.mjs.map +1 -0
  155. package/package.json +10 -5
  156. package/dist/components/EmptyState/index.cjs +0 -2
  157. package/dist/components/EmptyState/index.cjs.map +0 -1
  158. package/dist/components/EmptyState/index.mjs.map +0 -1
  159. package/dist/components/Icon.cjs.map +0 -1
  160. package/dist/components/Icon.mjs.map +0 -1
  161. package/dist/components/InfinityLoader/index.cjs.map +0 -1
  162. package/dist/components/InfinityLoader/index.mjs.map +0 -1
  163. package/dist/components/NavItems.cjs.map +0 -1
  164. package/dist/components/NavItems.mjs.map +0 -1
  165. package/dist/components/SelectInfinity/index.cjs.map +0 -1
  166. package/dist/components/SelectInfinity/index.mjs.map +0 -1
  167. package/dist/consts/http-status.cjs.map +0 -1
  168. package/dist/consts/http-status.mjs.map +0 -1
  169. package/dist/consts/revalidate.cjs.map +0 -1
  170. package/dist/consts/revalidate.mjs.map +0 -1
  171. package/dist/contexts/NavigationHistoryContext/index.cjs.map +0 -1
  172. package/dist/contexts/NavigationHistoryContext/index.mjs.map +0 -1
  173. package/dist/contexts/PageDataContext/index.cjs.map +0 -1
  174. package/dist/contexts/PageDataContext/index.mjs.map +0 -1
  175. package/dist/form/Form.cjs.map +0 -1
  176. package/dist/form/Form.mjs.map +0 -1
  177. package/dist/form/FormButtonSubmit.cjs.map +0 -1
  178. package/dist/form/FormButtonSubmit.mjs.map +0 -1
  179. package/dist/form/utils/nullableInput.cjs.map +0 -1
  180. package/dist/form/utils/nullableInput.mjs.map +0 -1
  181. package/dist/form/utils/zodValidator.cjs.map +0 -1
  182. package/dist/form/utils/zodValidator.mjs.map +0 -1
  183. package/dist/hocs/withForm.cjs +0 -2
  184. package/dist/hocs/withForm.cjs.map +0 -1
  185. package/dist/hocs/withForm.mjs.map +0 -1
  186. package/dist/hocs/withModalManager.cjs.map +0 -1
  187. package/dist/hocs/withModalManager.mjs.map +0 -1
  188. package/dist/hooks/useFetchNextPageOnScroll.cjs.map +0 -1
  189. package/dist/hooks/useFetchNextPageOnScroll.mjs.map +0 -1
  190. package/dist/hooks/useOnScrollProgress.cjs.map +0 -1
  191. package/dist/hooks/useOnScrollProgress.mjs.map +0 -1
  192. package/dist/index.cjs +0 -2
  193. package/dist/index.mjs +0 -61
  194. package/dist/index.mjs.map +0 -1
  195. package/dist/mantine/breakpointsWithPx.cjs.map +0 -1
  196. package/dist/mantine/breakpointsWithPx.mjs.map +0 -1
  197. package/dist/mantine/toTailwindColors.cjs.map +0 -1
  198. package/dist/mantine/toTailwindColors.mjs.map +0 -1
  199. package/dist/utils/array/groupBy.cjs.map +0 -1
  200. package/dist/utils/array/groupBy.mjs.map +0 -1
  201. package/dist/utils/array/shuffleArray.cjs.map +0 -1
  202. package/dist/utils/array/shuffleArray.mjs.map +0 -1
  203. package/dist/utils/formatBytes.cjs.map +0 -1
  204. package/dist/utils/formatBytes.mjs.map +0 -1
  205. package/dist/utils/isInfinityEmpty.cjs.map +0 -1
  206. package/dist/utils/isInfinityEmpty.mjs.map +0 -1
  207. package/dist/utils/ky/addBodyJsonHook.cjs.map +0 -1
  208. package/dist/utils/ky/addBodyJsonHook.mjs.map +0 -1
  209. package/dist/utils/ky/parseJson.cjs.map +0 -1
  210. package/dist/utils/ky/parseJson.mjs.map +0 -1
  211. package/dist/utils/newHref.cjs.map +0 -1
  212. package/dist/utils/newHref.mjs.map +0 -1
  213. /package/dist/{components → src/components}/Icon.cjs +0 -0
  214. /package/dist/{components → src/components}/Icon.mjs +0 -0
  215. /package/dist/{components → src/components}/InfinityLoader/index.cjs +0 -0
  216. /package/dist/{components → src/components}/InfinityLoader/index.mjs +0 -0
  217. /package/dist/{components → src/components}/NavItems.cjs +0 -0
  218. /package/dist/{components → src/components}/NavItems.mjs +0 -0
  219. /package/dist/{components → src/components}/SelectInfinity/index.cjs +0 -0
  220. /package/dist/{components → src/components}/SelectInfinity/index.mjs +0 -0
  221. /package/dist/{consts → src/consts}/http-status.cjs +0 -0
  222. /package/dist/{consts → src/consts}/http-status.mjs +0 -0
  223. /package/dist/{consts → src/consts}/revalidate.cjs +0 -0
  224. /package/dist/{consts → src/consts}/revalidate.mjs +0 -0
  225. /package/dist/{contexts → src/contexts}/NavigationHistoryContext/index.cjs +0 -0
  226. /package/dist/{contexts → src/contexts}/PageDataContext/index.cjs +0 -0
  227. /package/dist/{contexts → src/contexts}/PageDataContext/index.mjs +0 -0
  228. /package/dist/{form → src/form}/Form.cjs +0 -0
  229. /package/dist/{form → src/form}/Form.mjs +0 -0
  230. /package/dist/{form → src/form}/FormButtonSubmit.cjs +0 -0
  231. /package/dist/{form → src/form}/FormButtonSubmit.mjs +0 -0
  232. /package/dist/{form → src/form}/utils/nullableInput.cjs +0 -0
  233. /package/dist/{form → src/form}/utils/nullableInput.mjs +0 -0
  234. /package/dist/{form → src/form}/utils/zodValidator.cjs +0 -0
  235. /package/dist/{form → src/form}/utils/zodValidator.mjs +0 -0
  236. /package/dist/{hocs → src/hocs}/withModalManager.cjs +0 -0
  237. /package/dist/{hocs → src/hocs}/withModalManager.mjs +0 -0
  238. /package/dist/{hooks → src/hooks}/useFetchNextPageOnScroll.cjs +0 -0
  239. /package/dist/{hooks → src/hooks}/useFetchNextPageOnScroll.mjs +0 -0
  240. /package/dist/{hooks → src/hooks}/useOnScrollProgress.cjs +0 -0
  241. /package/dist/{hooks → src/hooks}/useOnScrollProgress.mjs +0 -0
  242. /package/dist/{index.cjs.map → src/index.cjs.map} +0 -0
  243. /package/dist/{utils → src/utils}/array/groupBy.cjs +0 -0
  244. /package/dist/{utils → src/utils}/array/groupBy.mjs +0 -0
  245. /package/dist/{utils → src/utils}/array/shuffleArray.cjs +0 -0
  246. /package/dist/{utils → src/utils}/array/shuffleArray.mjs +0 -0
  247. /package/dist/{utils → src/utils}/formatBytes.cjs +0 -0
  248. /package/dist/{utils → src/utils}/formatBytes.mjs +0 -0
  249. /package/dist/{utils → src/utils}/isInfinityEmpty.cjs +0 -0
  250. /package/dist/{utils → src/utils}/isInfinityEmpty.mjs +0 -0
  251. /package/dist/{utils → src/utils}/ky/addBodyJsonHook.cjs +0 -0
  252. /package/dist/{utils → src/utils}/ky/addBodyJsonHook.mjs +0 -0
  253. /package/dist/{utils → src/utils}/ky/parseJson.cjs +0 -0
  254. /package/dist/{utils → src/utils}/ky/parseJson.mjs +0 -0
  255. /package/dist/{utils → src/utils}/newHref.cjs +0 -0
  256. /package/dist/{utils → src/utils}/newHref.mjs +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-status.cjs","sources":["../../src/consts/http-status.ts"],"sourcesContent":["export enum HttpStatus {\r\n Continue = 100,\r\n SwitchingProtocols = 101,\r\n Processing = 102,\r\n EarlyHints = 103,\r\n Ok = 200,\r\n Created = 201,\r\n Accepted = 202,\r\n NonAuthoritativeInformation = 203,\r\n NoContent = 204,\r\n ResetContent = 205,\r\n PartialContent = 206,\r\n MultiStatus = 207,\r\n AlreadyReported = 208,\r\n ImUsed = 226,\r\n MultipleChoices = 300,\r\n MovedPermanently = 301,\r\n Found = 302,\r\n SeeOther = 303,\r\n NotModified = 304,\r\n UseProxy = 305,\r\n TemporaryRedirect = 307,\r\n PermanentRedirect = 308,\r\n BadRequest = 400,\r\n Unauthorized = 401,\r\n PaymentRequired = 402,\r\n Forbidden = 403,\r\n NotFound = 404,\r\n MethodNotAllowed = 405,\r\n NotAcceptable = 406,\r\n ProxyAuthenticationRequired = 407,\r\n RequestTimeout = 408,\r\n Conflict = 409,\r\n Gone = 410,\r\n LengthRequired = 411,\r\n PreconditionFailed = 412,\r\n PayloadTooLarge = 413,\r\n UriTooLong = 414,\r\n UnsupportedMediaType = 415,\r\n RangeNotSatisfiable = 416,\r\n ExpectationFailed = 417,\r\n MisdirectedRequest = 421,\r\n UnprocessableEntity = 422,\r\n Locked = 423,\r\n FailedDependency = 424,\r\n TooEarly = 425,\r\n UpgradeRequired = 426,\r\n PreconditionRequired = 428,\r\n TooManyRequests = 429,\r\n RequestHeaderFieldsTooLarge = 431,\r\n UnavailableForLegalReasons = 451,\r\n InternalServerError = 500,\r\n NotImplemented = 501,\r\n BadGateway = 502,\r\n ServiceUnavailable = 503,\r\n GatewayTimeout = 504,\r\n HttpVersionNotSupported = 505,\r\n VariantAlsoNegotiates = 506,\r\n InsufficientStorage = 507,\r\n LoopDetected = 508,\r\n NotExtended = 510,\r\n NetworkAuthenticationRequired = 511,\r\n}\r\n"],"names":["HttpStatus"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-status.mjs","sources":["../../src/consts/http-status.ts"],"sourcesContent":["export enum HttpStatus {\r\n Continue = 100,\r\n SwitchingProtocols = 101,\r\n Processing = 102,\r\n EarlyHints = 103,\r\n Ok = 200,\r\n Created = 201,\r\n Accepted = 202,\r\n NonAuthoritativeInformation = 203,\r\n NoContent = 204,\r\n ResetContent = 205,\r\n PartialContent = 206,\r\n MultiStatus = 207,\r\n AlreadyReported = 208,\r\n ImUsed = 226,\r\n MultipleChoices = 300,\r\n MovedPermanently = 301,\r\n Found = 302,\r\n SeeOther = 303,\r\n NotModified = 304,\r\n UseProxy = 305,\r\n TemporaryRedirect = 307,\r\n PermanentRedirect = 308,\r\n BadRequest = 400,\r\n Unauthorized = 401,\r\n PaymentRequired = 402,\r\n Forbidden = 403,\r\n NotFound = 404,\r\n MethodNotAllowed = 405,\r\n NotAcceptable = 406,\r\n ProxyAuthenticationRequired = 407,\r\n RequestTimeout = 408,\r\n Conflict = 409,\r\n Gone = 410,\r\n LengthRequired = 411,\r\n PreconditionFailed = 412,\r\n PayloadTooLarge = 413,\r\n UriTooLong = 414,\r\n UnsupportedMediaType = 415,\r\n RangeNotSatisfiable = 416,\r\n ExpectationFailed = 417,\r\n MisdirectedRequest = 421,\r\n UnprocessableEntity = 422,\r\n Locked = 423,\r\n FailedDependency = 424,\r\n TooEarly = 425,\r\n UpgradeRequired = 426,\r\n PreconditionRequired = 428,\r\n TooManyRequests = 429,\r\n RequestHeaderFieldsTooLarge = 431,\r\n UnavailableForLegalReasons = 451,\r\n InternalServerError = 500,\r\n NotImplemented = 501,\r\n BadGateway = 502,\r\n ServiceUnavailable = 503,\r\n GatewayTimeout = 504,\r\n HttpVersionNotSupported = 505,\r\n VariantAlsoNegotiates = 506,\r\n InsufficientStorage = 507,\r\n LoopDetected = 508,\r\n NotExtended = 510,\r\n NetworkAuthenticationRequired = 511,\r\n}\r\n"],"names":["HttpStatus"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"revalidate.cjs","sources":["../../src/consts/revalidate.ts"],"sourcesContent":["export enum Revalidate {\r\n OneHour = 3600,\r\n OneDay = 86400,\r\n OneWeek = 604800,\r\n OneMonth = 2592000,\r\n OneYear = 31536000\r\n}\r\n"],"names":["Revalidate"],"mappings":"gFAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,IAAV,EAAA,UACAA,EAAAA,EAAA,OAAS,KAAT,EAAA,SACAA,EAAAA,EAAA,QAAU,MAAV,EAAA,UACAA,EAAAA,EAAA,SAAW,MAAX,EAAA,WACAA,EAAAA,EAAA,QAAU,OAAV,EAAA,UALUA,IAAAA,GAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"revalidate.mjs","sources":["../../src/consts/revalidate.ts"],"sourcesContent":["export enum Revalidate {\r\n OneHour = 3600,\r\n OneDay = 86400,\r\n OneWeek = 604800,\r\n OneMonth = 2592000,\r\n OneYear = 31536000\r\n}\r\n"],"names":["Revalidate"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAAA,EAAA,UAAU,IAAV,IAAA,WACAA,EAAAA,EAAA,SAAS,KAAT,IAAA,UACAA,EAAAA,EAAA,UAAU,MAAV,IAAA,WACAA,EAAAA,EAAA,WAAW,MAAX,IAAA,YACAA,EAAAA,EAAA,UAAU,OAAV,IAAA,WALUA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/contexts/NavigationHistoryContext/index.tsx"],"sourcesContent":["'use client';\r\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation';\r\nimport { createContext, ReactNode, useContext, useEffect, useState } from 'react';\r\n\r\n// Defining types for the context value\r\ninterface NavigationHistoryContextType {\r\n history: string[];\r\n}\r\n\r\n// Creating the context with a proper type\r\nconst NavigationHistoryContext = createContext<NavigationHistoryContextType | null>(null);\r\n\r\n// Props type for the provider component\r\ninterface NavigationHistoryProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\n/**\r\n * Proveedor de historial de navegación\r\n * Solo se encarga de registrar las rutas visitadas\r\n */\r\nexport function NavigationHistoryProvider({ children }: NavigationHistoryProviderProps) {\r\n const pathname = usePathname();\r\n const searchParams = useSearchParams();\r\n\r\n // Estado para almacenar el historial de navegación\r\n const [history, setHistory] = useState<string[]>([]);\r\n\r\n // Efecto para actualizar el historial cuando cambia la ruta o los parámetros\r\n useEffect(() => {\r\n // Creamos la URL completa (ruta + parámetros)\r\n const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;\r\n\r\n if (fullPath) {\r\n setHistory((prev) => {\r\n // Evitar duplicados consecutivos\r\n if (prev.length > 0 && prev[prev.length - 1] === fullPath) {\r\n return prev;\r\n }\r\n return [...prev, fullPath];\r\n });\r\n }\r\n }, [pathname, searchParams]);\r\n\r\n return (\r\n <NavigationHistoryContext.Provider value={{ history }}>\r\n {children}\r\n </NavigationHistoryContext.Provider>\r\n );\r\n}\r\n\r\n// Return type for the useNavigationHistory hook\r\ninterface NavigationHistoryHook {\r\n history: string[];\r\n goBack: (fallback?: string) => void;\r\n currentRoute: string | null;\r\n hasPreviousRoute: boolean;\r\n getPreviousRoute: () => string | null;\r\n}\r\n\r\nexport const QP_BACK_URL_NAME = 'backUrl';\r\n\r\n/**\r\n * Hook para usar el historial de navegación\r\n * @returns {NavigationHistoryHook} Objeto con el historial y la función goBack\r\n */\r\nexport function useNavigationHistory(): NavigationHistoryHook {\r\n const context = useContext(NavigationHistoryContext);\r\n const router = useRouter();\r\n\r\n if (!context) {\r\n throw new Error('useNavigationHistory debe usarse dentro de un NavigationHistoryProvider');\r\n }\r\n\r\n const searchParams = useSearchParams();\r\n\r\n const { history } = context;\r\n\r\n /**\r\n * Navega hacia atrás en el historial o a la ruta de fallback\r\n * @param {string} fallback - Ruta a la que ir si no hay historial previo\r\n */\r\n const goBack = (fallback?: string) => {\r\n const returnUrl = searchParams.get(QP_BACK_URL_NAME);\r\n if (returnUrl) {\r\n router.push(returnUrl);\r\n return;\r\n }\r\n\r\n if (history.length <= 1) {\r\n router.push(fallback ?? '/');\r\n return;\r\n }\r\n\r\n // Obtener las dos últimas rutas\r\n const previousRoute = history[history.length - 2];\r\n const currentRoute = history[history.length - 1];\r\n\r\n // Si hay más de 2 rutas en el historial y detectamos un patrón de bucle\r\n if (history.length >= 3 && history[history.length - 3] === currentRoute) {\r\n // Ir a una ruta segura (home) o a la ruta de fallback\r\n router.push(fallback ?? '/');\r\n return;\r\n }\r\n\r\n // Navegación normal\r\n router.push(previousRoute ?? '/');\r\n };\r\n\r\n return {\r\n history,\r\n goBack,\r\n currentRoute: history.length > 0 ? history[history.length - 1] : null,\r\n hasPreviousRoute: history.length > 1,\r\n getPreviousRoute: () => (history.length >= 2 ? history[history.length - 2] : null),\r\n };\r\n}\r\n"],"names":["NavigationHistoryContext","createContext","NavigationHistoryProvider","children","pathname","usePathname","searchParams","useSearchParams","history","setHistory","useState","useEffect","fullPath","prev","jsx","QP_BACK_URL_NAME","useNavigationHistory","context","useContext","router","useRouter","fallback","returnUrl","previousRoute","currentRoute"],"mappings":"kLAUMA,EAA2BC,gBAAmD,IAAI,EAWxE,SAAAC,EAA0B,CAAE,SAAAC,GAA4C,CACtF,MAAMC,EAAWC,EAAAA,YAAY,EACvBC,EAAeC,EAAAA,gBAAgB,EAG/B,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAmB,CAAA,CAAE,EAGnDC,OAAAA,EAAAA,UAAU,IAAM,CAER,MAAAC,EAAWN,GAAc,KAAO,GAAGF,CAAQ,IAAIE,EAAa,UAAU,GAAKF,EAE7EQ,GACFH,EAAYI,GAENA,EAAK,OAAS,GAAKA,EAAKA,EAAK,OAAS,CAAC,IAAMD,EACxCC,EAEF,CAAC,GAAGA,EAAMD,CAAQ,CAC1B,CACH,EACC,CAACR,EAAUE,CAAY,CAAC,EAGzBQ,EAAA,IAACd,EAAyB,SAAzB,CAAkC,MAAO,CAAE,QAAAQ,CAAA,EACzC,SAAAL,EACH,CAEJ,CAWO,MAAMY,EAAmB,UAMzB,SAASC,GAA8C,CACtD,MAAAC,EAAUC,aAAWlB,CAAwB,EAC7CmB,EAASC,EAAAA,UAAU,EAEzB,GAAI,CAACH,EACG,MAAA,IAAI,MAAM,yEAAyE,EAG3F,MAAMX,EAAeC,EAAAA,gBAAgB,EAE/B,CAAE,QAAAC,GAAYS,EAiCb,MAAA,CACL,QAAAT,EACA,OA7Bca,GAAsB,CAC9B,MAAAC,EAAYhB,EAAa,IAAIS,CAAgB,EACnD,GAAIO,EAAW,CACbH,EAAO,KAAKG,CAAS,EACrB,MAAA,CAGE,GAAAd,EAAQ,QAAU,EAAG,CAChBW,EAAA,KAAKE,GAAY,GAAG,EAC3B,MAAA,CAIF,MAAME,EAAgBf,EAAQA,EAAQ,OAAS,CAAC,EAC1CgB,EAAehB,EAAQA,EAAQ,OAAS,CAAC,EAG3C,GAAAA,EAAQ,QAAU,GAAKA,EAAQA,EAAQ,OAAS,CAAC,IAAMgB,EAAc,CAEhEL,EAAA,KAAKE,GAAY,GAAG,EAC3B,MAAA,CAIKF,EAAA,KAAKI,GAAiB,GAAG,CAClC,EAKE,aAAcf,EAAQ,OAAS,EAAIA,EAAQA,EAAQ,OAAS,CAAC,EAAI,KACjE,iBAAkBA,EAAQ,OAAS,EACnC,iBAAkB,IAAOA,EAAQ,QAAU,EAAIA,EAAQA,EAAQ,OAAS,CAAC,EAAI,IAC/E,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/contexts/NavigationHistoryContext/index.tsx"],"sourcesContent":["'use client';\r\nimport { usePathname, useRouter, useSearchParams } from 'next/navigation';\r\nimport { createContext, ReactNode, useContext, useEffect, useState } from 'react';\r\n\r\n// Defining types for the context value\r\ninterface NavigationHistoryContextType {\r\n history: string[];\r\n}\r\n\r\n// Creating the context with a proper type\r\nconst NavigationHistoryContext = createContext<NavigationHistoryContextType | null>(null);\r\n\r\n// Props type for the provider component\r\ninterface NavigationHistoryProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\n/**\r\n * Proveedor de historial de navegación\r\n * Solo se encarga de registrar las rutas visitadas\r\n */\r\nexport function NavigationHistoryProvider({ children }: NavigationHistoryProviderProps) {\r\n const pathname = usePathname();\r\n const searchParams = useSearchParams();\r\n\r\n // Estado para almacenar el historial de navegación\r\n const [history, setHistory] = useState<string[]>([]);\r\n\r\n // Efecto para actualizar el historial cuando cambia la ruta o los parámetros\r\n useEffect(() => {\r\n // Creamos la URL completa (ruta + parámetros)\r\n const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;\r\n\r\n if (fullPath) {\r\n setHistory((prev) => {\r\n // Evitar duplicados consecutivos\r\n if (prev.length > 0 && prev[prev.length - 1] === fullPath) {\r\n return prev;\r\n }\r\n return [...prev, fullPath];\r\n });\r\n }\r\n }, [pathname, searchParams]);\r\n\r\n return (\r\n <NavigationHistoryContext.Provider value={{ history }}>\r\n {children}\r\n </NavigationHistoryContext.Provider>\r\n );\r\n}\r\n\r\n// Return type for the useNavigationHistory hook\r\ninterface NavigationHistoryHook {\r\n history: string[];\r\n goBack: (fallback?: string) => void;\r\n currentRoute: string | null;\r\n hasPreviousRoute: boolean;\r\n getPreviousRoute: () => string | null;\r\n}\r\n\r\nexport const QP_BACK_URL_NAME = 'backUrl';\r\n\r\n/**\r\n * Hook para usar el historial de navegación\r\n * @returns {NavigationHistoryHook} Objeto con el historial y la función goBack\r\n */\r\nexport function useNavigationHistory(): NavigationHistoryHook {\r\n const context = useContext(NavigationHistoryContext);\r\n const router = useRouter();\r\n\r\n if (!context) {\r\n throw new Error('useNavigationHistory debe usarse dentro de un NavigationHistoryProvider');\r\n }\r\n\r\n const searchParams = useSearchParams();\r\n\r\n const { history } = context;\r\n\r\n /**\r\n * Navega hacia atrás en el historial o a la ruta de fallback\r\n * @param {string} fallback - Ruta a la que ir si no hay historial previo\r\n */\r\n const goBack = (fallback?: string) => {\r\n const returnUrl = searchParams.get(QP_BACK_URL_NAME);\r\n if (returnUrl) {\r\n router.push(returnUrl);\r\n return;\r\n }\r\n\r\n if (history.length <= 1) {\r\n router.push(fallback ?? '/');\r\n return;\r\n }\r\n\r\n // Obtener las dos últimas rutas\r\n const previousRoute = history[history.length - 2];\r\n const currentRoute = history[history.length - 1];\r\n\r\n // Si hay más de 2 rutas en el historial y detectamos un patrón de bucle\r\n if (history.length >= 3 && history[history.length - 3] === currentRoute) {\r\n // Ir a una ruta segura (home) o a la ruta de fallback\r\n router.push(fallback ?? '/');\r\n return;\r\n }\r\n\r\n // Navegación normal\r\n router.push(previousRoute ?? '/');\r\n };\r\n\r\n return {\r\n history,\r\n goBack,\r\n currentRoute: history.length > 0 ? history[history.length - 1] : null,\r\n hasPreviousRoute: history.length > 1,\r\n getPreviousRoute: () => (history.length >= 2 ? history[history.length - 2] : null),\r\n };\r\n}\r\n"],"names":["NavigationHistoryContext","createContext","NavigationHistoryProvider","children","pathname","usePathname","searchParams","useSearchParams","history","setHistory","useState","useEffect","fullPath","prev","jsx","QP_BACK_URL_NAME","useNavigationHistory","context","useContext","router","useRouter","fallback","returnUrl","previousRoute","currentRoute"],"mappings":";;;;AAUA,MAAMA,IAA2BC,EAAmD,IAAI;AAWxE,SAAAC,EAA0B,EAAE,UAAAC,KAA4C;AACtF,QAAMC,IAAWC,EAAY,GACvBC,IAAeC,EAAgB,GAG/B,CAACC,GAASC,CAAU,IAAIC,EAAmB,CAAA,CAAE;AAGnD,SAAAC,EAAU,MAAM;AAER,UAAAC,IAAWN,GAAc,OAAO,GAAGF,CAAQ,IAAIE,EAAa,UAAU,KAAKF;AAEjF,IAAIQ,KACFH,EAAW,CAACI,MAENA,EAAK,SAAS,KAAKA,EAAKA,EAAK,SAAS,CAAC,MAAMD,IACxCC,IAEF,CAAC,GAAGA,GAAMD,CAAQ,CAC1B;AAAA,EACH,GACC,CAACR,GAAUE,CAAY,CAAC,GAGzB,gBAAAQ,EAACd,EAAyB,UAAzB,EAAkC,OAAO,EAAE,SAAAQ,EAAA,GACzC,UAAAL,GACH;AAEJ;AAWO,MAAMY,IAAmB;AAMzB,SAASC,IAA8C;AACtD,QAAAC,IAAUC,EAAWlB,CAAwB,GAC7CmB,IAASC,EAAU;AAEzB,MAAI,CAACH;AACG,UAAA,IAAI,MAAM,yEAAyE;AAG3F,QAAMX,IAAeC,EAAgB,GAE/B,EAAE,SAAAC,MAAYS;AAiCb,SAAA;AAAA,IACL,SAAAT;AAAA,IACA,QA7Ba,CAACa,MAAsB;AAC9B,YAAAC,IAAYhB,EAAa,IAAIS,CAAgB;AACnD,UAAIO,GAAW;AACb,QAAAH,EAAO,KAAKG,CAAS;AACrB;AAAA,MAAA;AAGE,UAAAd,EAAQ,UAAU,GAAG;AAChB,QAAAW,EAAA,KAAKE,KAAY,GAAG;AAC3B;AAAA,MAAA;AAIF,YAAME,IAAgBf,EAAQA,EAAQ,SAAS,CAAC,GAC1CgB,IAAehB,EAAQA,EAAQ,SAAS,CAAC;AAG3C,UAAAA,EAAQ,UAAU,KAAKA,EAAQA,EAAQ,SAAS,CAAC,MAAMgB,GAAc;AAEhE,QAAAL,EAAA,KAAKE,KAAY,GAAG;AAC3B;AAAA,MAAA;AAIK,MAAAF,EAAA,KAAKI,KAAiB,GAAG;AAAA,IAClC;AAAA,IAKE,cAAcf,EAAQ,SAAS,IAAIA,EAAQA,EAAQ,SAAS,CAAC,IAAI;AAAA,IACjE,kBAAkBA,EAAQ,SAAS;AAAA,IACnC,kBAAkB,MAAOA,EAAQ,UAAU,IAAIA,EAAQA,EAAQ,SAAS,CAAC,IAAI;AAAA,EAC/E;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/contexts/PageDataContext/index.tsx"],"sourcesContent":["\"use client\";\r\nimport { createContext, useContext } from \"react\";\r\n\r\nconst PageData = createContext<any | undefined>(undefined);\r\n\r\ninterface PageDataProviderProps {\r\n children: React.ReactNode;\r\n value: any;\r\n}\r\n\r\nexport const PageDataProvider = ({\r\n value,\r\n children\r\n}: PageDataProviderProps) => (\r\n <PageData.Provider value={value}>{children}</PageData.Provider>\r\n);\r\nexport const usePageData = <T,>(): T => {\r\n const data = useContext(PageData);\r\n if (data === undefined) throw new Error(\"Out of context: usePageData\");\r\n\r\n return data;\r\n};\r\n"],"names":["PageData","createContext","PageDataProvider","value","children","jsx","usePageData","data","useContext"],"mappings":"qJAGMA,EAAWC,gBAA+B,MAAS,EAO5CC,EAAmB,CAAC,CAC/B,MAAAC,EACA,SAAAC,CACF,IACGC,EAAA,IAAAL,EAAS,SAAT,CAAkB,MAAAG,EAAe,SAAAC,CAAS,CAAA,EAEhCE,EAAc,IAAa,CAChC,MAAAC,EAAOC,aAAWR,CAAQ,EAChC,GAAIO,IAAS,OAAiB,MAAA,IAAI,MAAM,6BAA6B,EAE9D,OAAAA,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/contexts/PageDataContext/index.tsx"],"sourcesContent":["\"use client\";\r\nimport { createContext, useContext } from \"react\";\r\n\r\nconst PageData = createContext<any | undefined>(undefined);\r\n\r\ninterface PageDataProviderProps {\r\n children: React.ReactNode;\r\n value: any;\r\n}\r\n\r\nexport const PageDataProvider = ({\r\n value,\r\n children\r\n}: PageDataProviderProps) => (\r\n <PageData.Provider value={value}>{children}</PageData.Provider>\r\n);\r\nexport const usePageData = <T,>(): T => {\r\n const data = useContext(PageData);\r\n if (data === undefined) throw new Error(\"Out of context: usePageData\");\r\n\r\n return data;\r\n};\r\n"],"names":["PageData","createContext","PageDataProvider","value","children","jsx","usePageData","data","useContext"],"mappings":";;;AAGA,MAAMA,IAAWC,EAA+B,MAAS,GAO5CC,IAAmB,CAAC;AAAA,EAC/B,OAAAC;AAAA,EACA,UAAAC;AACF,MACG,gBAAAC,EAAAL,EAAS,UAAT,EAAkB,OAAAG,GAAe,UAAAC,EAAS,CAAA,GAEhCE,IAAc,MAAa;AAChC,QAAAC,IAAOC,EAAWR,CAAQ;AAChC,MAAIO,MAAS,OAAiB,OAAA,IAAI,MAAM,6BAA6B;AAE9D,SAAAA;AACT;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Form.cjs","sources":["../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={methods.handleSubmit(onSubmit, onSubmitError)}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box"],"mappings":"0LAiBaA,EAAO,CAAwB,CAC1C,QAAAC,EACA,SAAAC,EAAW,IAAM,CAAC,EAClB,cAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,IAACC,EAAc,aAAA,CAAA,GAAGL,EAChB,SAAAI,EAAA,IAACE,EAAA,IAAA,CACC,UAAU,OACV,SAAUN,EAAQ,aAAaC,EAAUC,CAAa,EACrD,GAAGC,CAAA,CAAA,EAER"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Form.mjs","sources":["../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={methods.handleSubmit(onSubmit, onSubmitError)}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box"],"mappings":";;;;AAiBO,MAAMA,IAAO,CAAwB;AAAA,EAC1C,SAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAc,EAAA,GAAGL,GAChB,UAAA,gBAAAI;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,UAAUN,EAAQ,aAAaC,GAAUC,CAAa;AAAA,IACrD,GAAGC;AAAA,EAAA;AAAA,GAER;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormButtonSubmit.cjs","sources":["../../src/form/FormButtonSubmit.tsx"],"sourcesContent":["'use client';\r\nimport { Button, ButtonProps, ElementProps } from '@mantine/core';\r\nimport { useFormContext } from 'react-hook-form';\r\n\r\nexport interface FormButtonSubmitProps\r\n extends ButtonProps,\r\n ElementProps<'button', keyof ButtonProps> {}\r\n\r\nexport const FormButtonSubmit = (props: FormButtonSubmitProps) => {\r\n const { formState } = useFormContext();\r\n\r\n const { isSubmitting } = formState;\r\n\r\n return (\r\n <Button\r\n // disabled={isSubmitSuccessful}\r\n loading={isSubmitting}\r\n type=\"submit\"\r\n {...props}\r\n />\r\n );\r\n};\r\n"],"names":["FormButtonSubmit","props","formState","useFormContext","isSubmitting","jsx","Button"],"mappings":"0LAQaA,EAAoBC,GAAiC,CAC1D,KAAA,CAAE,UAAAC,CAAU,EAAIC,iBAAe,EAE/B,CAAE,aAAAC,GAAiBF,EAGvB,OAAAG,EAAA,IAACC,EAAA,OAAA,CAEC,QAASF,EACT,KAAK,SACJ,GAAGH,CAAA,CACN,CAEJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormButtonSubmit.mjs","sources":["../../src/form/FormButtonSubmit.tsx"],"sourcesContent":["'use client';\r\nimport { Button, ButtonProps, ElementProps } from '@mantine/core';\r\nimport { useFormContext } from 'react-hook-form';\r\n\r\nexport interface FormButtonSubmitProps\r\n extends ButtonProps,\r\n ElementProps<'button', keyof ButtonProps> {}\r\n\r\nexport const FormButtonSubmit = (props: FormButtonSubmitProps) => {\r\n const { formState } = useFormContext();\r\n\r\n const { isSubmitting } = formState;\r\n\r\n return (\r\n <Button\r\n // disabled={isSubmitSuccessful}\r\n loading={isSubmitting}\r\n type=\"submit\"\r\n {...props}\r\n />\r\n );\r\n};\r\n"],"names":["FormButtonSubmit","props","formState","useFormContext","isSubmitting","jsx","Button"],"mappings":";;;;AAQa,MAAAA,IAAmB,CAACC,MAAiC;AAC1D,QAAA,EAAE,WAAAC,EAAU,IAAIC,EAAe,GAE/B,EAAE,cAAAC,MAAiBF;AAGvB,SAAA,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MAEC,SAASF;AAAA,MACT,MAAK;AAAA,MACJ,GAAGH;AAAA,IAAA;AAAA,EACN;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullableInput.cjs","sources":["../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from \"zod\";\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(\r\n schema: T,\r\n message = \"Campo requerido\"\r\n) => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAgB,CAC3BC,EACAC,EAAU,oBAEHD,EAAO,SAAS,EAAE,UAAU,CAACE,EAAKC,IACnCD,IAAQ,MACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,MAAO,GACP,QAAAH,CAAA,CACD,EAEMG,EAAE,EAAA,OAGJF,CACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullableInput.mjs","sources":["../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from \"zod\";\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(\r\n schema: T,\r\n message = \"Campo requerido\"\r\n) => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":";AAEO,MAAMA,IAAgB,CAC3BC,GACAC,IAAU,sBAEHD,EAAO,SAAS,EAAE,UAAU,CAACE,GAAKC,MACnCD,MAAQ,QACVC,EAAI,SAAS;AAAA,EACX,MAAMC,EAAE,aAAa;AAAA,EACrB,OAAO;AAAA,EACP,SAAAH;AAAA,CACD,GAEMG,EAAE,SAGJF,CACR;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"zodValidator.cjs","sources":["../../../src/form/utils/zodValidator.ts"],"sourcesContent":["import { ZodTypeAny } from 'zod';\r\n\r\nexport const zodValidator = (schema: ZodTypeAny) => {\r\n return (values: any) => {\r\n const result = schema.safeParse(values);\r\n if (result.success) return;\r\n\r\n const { error } = result;\r\n const firstError = error.issues[0];\r\n\r\n return firstError?.message;\r\n };\r\n};\r\n"],"names":["zodValidator","schema","values","result","error"],"mappings":"gFAEa,MAAAA,EAAgBC,GACnBC,GAAgB,CAChB,MAAAC,EAASF,EAAO,UAAUC,CAAM,EACtC,GAAIC,EAAO,QAAS,OAEd,KAAA,CAAE,MAAAC,GAAUD,EAGlB,OAFmBC,EAAM,OAAO,CAAC,GAEd,OACrB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"zodValidator.mjs","sources":["../../../src/form/utils/zodValidator.ts"],"sourcesContent":["import { ZodTypeAny } from 'zod';\r\n\r\nexport const zodValidator = (schema: ZodTypeAny) => {\r\n return (values: any) => {\r\n const result = schema.safeParse(values);\r\n if (result.success) return;\r\n\r\n const { error } = result;\r\n const firstError = error.issues[0];\r\n\r\n return firstError?.message;\r\n };\r\n};\r\n"],"names":["zodValidator","schema","values","result","error"],"mappings":"AAEa,MAAAA,IAAe,CAACC,MACpB,CAACC,MAAgB;AAChB,QAAAC,IAASF,EAAO,UAAUC,CAAM;AACtC,MAAIC,EAAO,QAAS;AAEd,QAAA,EAAE,OAAAC,MAAUD;AAGlB,SAFmBC,EAAM,OAAO,CAAC,GAEd;AACrB;"}
@@ -1,2 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react-hook-form");require("@mantine/core");const f=require("../form/utils/zodValidator.cjs");require("zod");const h=(r,a)=>{const t=e=>{const{validate:l,name:d="",placeholder:s,label:u,description:c,...n}=e;return o.jsx(b.Controller,{name:d,defaultValue:"",rules:{validate:l&&!e.disabled?f.zodValidator(l):void 0},disabled:e.disabled,...a?.(e),render:i=>{const{fieldState:{isTouched:v,error:m}}=i,F={...i,props:{...e,validate:void 0},field:{...i.field,label:u,placeholder:s,description:c,error:m?.message},...n};return o.jsx(r,{...F})}})};return t.displayName=`withForm(${r.displayName})`,t};exports.withForm=h;
2
- //# sourceMappingURL=withForm.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withForm.cjs","sources":["../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `withForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":"yPAwBa,MAAAA,EAAW,CACtBC,EACAC,IACG,CACG,MAAAC,EAA0CC,GAAU,CAClD,KAAA,CAAE,SAAAC,EAAU,KAAAC,EAAO,GAAI,YAAAC,EAAa,MAAAC,EAAO,YAAAC,EAAa,GAAGC,CAAA,EAAsBN,EAGrF,OAAAO,EAAA,IAACC,EAAA,WAAA,CACC,KAAAN,EACA,aAAc,GACd,MAAO,CACL,SAAUD,GAAY,CAACD,EAAM,SAAWS,EAAAA,aAAaR,CAAQ,EAAI,MACnE,EACA,SAAUD,EAAM,SACf,GAAGF,IAAqBE,CAAK,EAC9B,OAASU,GAAgB,CACjB,KAAA,CACJ,WAAY,CAAE,UAAAC,EAAW,MAAAC,CAAM,CAAA,EAC7BF,EAEEG,EAAa,CACjB,GAAGH,EACH,MAAO,CACL,GAAGV,EACH,SAAU,MACZ,EACA,MAAO,CACL,GAAGU,EAAY,MACf,MAAAN,EACA,YAAAD,EACA,YAAAE,EACA,MAAOO,GAAO,OAChB,EACA,GAAGN,CACL,EAEO,OAAAC,MAACV,EAAkB,CAAA,GAAGgB,CAAY,CAAA,CAAA,CAC3C,CACF,CAEJ,EAEU,OAAAd,EAAA,YAAc,YAAYF,EAAiB,WAAW,IAEzDE,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"withForm.mjs","sources":["../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `withForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":";;;;;;AAwBa,MAAAA,IAAW,CACtBC,GACAC,MACG;AACG,QAAAC,IAAyC,CAACC,MAAU;AAClD,UAAA,EAAE,UAAAC,GAAU,MAAAC,IAAO,IAAI,aAAAC,GAAa,OAAAC,GAAO,aAAAC,GAAa,GAAGC,EAAA,IAAsBN;AAGrF,WAAA,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAN;AAAA,QACA,cAAc;AAAA,QACd,OAAO;AAAA,UACL,UAAUD,KAAY,CAACD,EAAM,WAAWS,EAAaR,CAAQ,IAAI;AAAA,QACnE;AAAA,QACA,UAAUD,EAAM;AAAA,QACf,GAAGF,IAAqBE,CAAK;AAAA,QAC9B,QAAQ,CAACU,MAAgB;AACjB,gBAAA;AAAA,YACJ,YAAY,EAAE,WAAAC,GAAW,OAAAC,EAAM;AAAA,UAAA,IAC7BF,GAEEG,IAAa;AAAA,YACjB,GAAGH;AAAA,YACH,OAAO;AAAA,cACL,GAAGV;AAAA,cACH,UAAU;AAAA,YACZ;AAAA,YACA,OAAO;AAAA,cACL,GAAGU,EAAY;AAAA,cACf,OAAAN;AAAA,cACA,aAAAD;AAAA,cACA,aAAAE;AAAA,cACA,OAAOO,GAAO;AAAA,YAChB;AAAA,YACA,GAAGN;AAAA,UACL;AAEO,iBAAA,gBAAAC,EAACV,GAAkB,EAAA,GAAGgB,EAAY,CAAA;AAAA,QAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAd,EAAA,cAAc,YAAYF,EAAiB,WAAW,KAEzDE;AACT;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"withModalManager.cjs","sources":["../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `withModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":"qJASaA,EACXC,GACG,CACH,MAAMC,EAA8D,CAAC,CACnE,YAAAC,EACA,OAAAC,EACA,GAAGC,CAAA,IACC,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EAEpCC,EAAU,IAAM,CACpBF,EAAU,EAAK,EACJ,WAAA,IAAMJ,EAAY,EAAG,GAAG,EACnCE,EAAM,UAAU,CAClB,EAEAK,OAAAA,EAAAA,UAAU,IAAM,CACVN,EAAmB,WAAA,IAAMG,EAAU,EAAI,EAAG,CAAC,EAClCE,EAAA,CAAA,EACZ,CAACL,CAAM,CAAC,EAGTO,EAAA,IAACV,EAAA,CACE,GAAII,EACL,OAAQC,EACR,QAAAG,CAAA,CACF,CAEJ,EAEU,OAAAP,EAAA,YAAc,oBAAoBD,EAAiB,WAAW,IAEjEC,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"withModalManager.mjs","sources":["../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `withModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":";;;AASa,MAAAA,IAAmB,CAC9BC,MACG;AACH,QAAMC,IAA8D,CAAC;AAAA,IACnE,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MACC;AACJ,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAU,MAAM;AACpB,MAAAF,EAAU,EAAK,GACJ,WAAA,MAAMJ,EAAY,GAAG,GAAG,GACnCE,EAAM,UAAU;AAAA,IAClB;AAEA,WAAAK,EAAU,MAAM;AACd,MAAIN,IAAmB,WAAA,MAAMG,EAAU,EAAI,GAAG,CAAC,IAClCE,EAAA;AAAA,IAAA,GACZ,CAACL,CAAM,CAAC,GAGT,gBAAAO;AAAA,MAACV;AAAA,MAAA;AAAA,QACE,GAAII;AAAA,QACL,QAAQC;AAAA,QACR,SAAAG;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAP,EAAA,cAAc,oBAAoBD,EAAiB,WAAW,KAEjEC;AACT;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchNextPageOnScroll.cjs","sources":["../../src/hooks/useFetchNextPageOnScroll.ts"],"sourcesContent":["'use client';\r\nimport { InfiniteData } from '@tanstack/react-query';\r\nimport { RefObject, useEffect } from 'react';\r\nimport { InfiniteQueryHookResult } from 'react-query-kit';\r\nimport { useOnScrollProgress } from './useOnScrollProgress';\r\n\r\nexport const useFetchNextPageOnScroll = (\r\n infinity: InfiniteQueryHookResult<InfiniteData<{ data: unknown[] }, number>, Error>,\r\n elementRef?: RefObject<HTMLElement | null>,\r\n) => {\r\n useOnScrollProgress(\r\n 0.9,\r\n () => {\r\n if (infinity.hasNextPage) {\r\n infinity.fetchNextPage();\r\n }\r\n },\r\n elementRef,\r\n );\r\n\r\n useEffect(() => {\r\n const el = elementRef?.current;\r\n const scrollTarget = el ?? document.documentElement;\r\n\r\n const hasScroll = scrollTarget.scrollHeight > scrollTarget.clientHeight;\r\n\r\n if (!hasScroll && infinity.hasNextPage) {\r\n infinity.fetchNextPage();\r\n }\r\n }, [infinity.data, elementRef]);\r\n};\r\n"],"names":["useFetchNextPageOnScroll","infinity","elementRef","useOnScrollProgress","useEffect","scrollTarget"],"mappings":"6JAMaA,EAA2B,CACtCC,EACAC,IACG,CACHC,EAAA,oBACE,GACA,IAAM,CACAF,EAAS,aACXA,EAAS,cAAc,CAE3B,EACAC,CACF,EAEAE,EAAAA,UAAU,IAAM,CAER,MAAAC,EADKH,GAAY,SACI,SAAS,gBAIhC,EAFcG,EAAa,aAAeA,EAAa,eAEzCJ,EAAS,aACzBA,EAAS,cAAc,CAExB,EAAA,CAACA,EAAS,KAAMC,CAAU,CAAC,CAChC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchNextPageOnScroll.mjs","sources":["../../src/hooks/useFetchNextPageOnScroll.ts"],"sourcesContent":["'use client';\r\nimport { InfiniteData } from '@tanstack/react-query';\r\nimport { RefObject, useEffect } from 'react';\r\nimport { InfiniteQueryHookResult } from 'react-query-kit';\r\nimport { useOnScrollProgress } from './useOnScrollProgress';\r\n\r\nexport const useFetchNextPageOnScroll = (\r\n infinity: InfiniteQueryHookResult<InfiniteData<{ data: unknown[] }, number>, Error>,\r\n elementRef?: RefObject<HTMLElement | null>,\r\n) => {\r\n useOnScrollProgress(\r\n 0.9,\r\n () => {\r\n if (infinity.hasNextPage) {\r\n infinity.fetchNextPage();\r\n }\r\n },\r\n elementRef,\r\n );\r\n\r\n useEffect(() => {\r\n const el = elementRef?.current;\r\n const scrollTarget = el ?? document.documentElement;\r\n\r\n const hasScroll = scrollTarget.scrollHeight > scrollTarget.clientHeight;\r\n\r\n if (!hasScroll && infinity.hasNextPage) {\r\n infinity.fetchNextPage();\r\n }\r\n }, [infinity.data, elementRef]);\r\n};\r\n"],"names":["useFetchNextPageOnScroll","infinity","elementRef","useOnScrollProgress","useEffect","scrollTarget"],"mappings":";;;AAMa,MAAAA,IAA2B,CACtCC,GACAC,MACG;AACH,EAAAC;AAAA,IACE;AAAA,IACA,MAAM;AACJ,MAAIF,EAAS,eACXA,EAAS,cAAc;AAAA,IAE3B;AAAA,IACAC;AAAA,EACF,GAEAE,EAAU,MAAM;AAER,UAAAC,IADKH,GAAY,WACI,SAAS;AAIhC,IAAA,EAFcG,EAAa,eAAeA,EAAa,iBAEzCJ,EAAS,eACzBA,EAAS,cAAc;AAAA,EAExB,GAAA,CAACA,EAAS,MAAMC,CAAU,CAAC;AAChC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOnScrollProgress.cjs","sources":["../../src/hooks/useOnScrollProgress.ts"],"sourcesContent":["'use client';\r\nimport { RefObject, useEffect } from 'react';\r\n\r\nexport const useOnScrollProgress = (\r\n triggerPercentage: number,\r\n callback: () => void,\r\n elementRef?: RefObject<HTMLElement | null>,\r\n): void => {\r\n if (triggerPercentage < 0 || triggerPercentage > 1) {\r\n throw new Error('El porcentaje debe estar entre 0 y 1');\r\n }\r\n\r\n useEffect(() => {\r\n let hasTriggered = false;\r\n\r\n const handleScroll = () => {\r\n const el = elementRef?.current;\r\n const target = el ?? document.documentElement;\r\n\r\n const scrollHeight = target.scrollHeight - target.clientHeight;\r\n const scrollTop = el ? target.scrollTop : window.scrollY;\r\n\r\n const scrollProgress = scrollHeight > 0 ? Math.min(1, scrollTop / scrollHeight) : 0;\r\n\r\n if (!hasTriggered && scrollProgress >= triggerPercentage) {\r\n callback();\r\n hasTriggered = true;\r\n }\r\n };\r\n\r\n const scrollTarget = elementRef?.current ?? window;\r\n scrollTarget.addEventListener('scroll', handleScroll);\r\n handleScroll();\r\n\r\n return () => {\r\n scrollTarget.removeEventListener('scroll', handleScroll);\r\n };\r\n }, [triggerPercentage, callback, elementRef]);\r\n};\r\n"],"names":["useOnScrollProgress","triggerPercentage","callback","elementRef","useEffect","hasTriggered","handleScroll","el","target","scrollHeight","scrollTop","scrollProgress","scrollTarget"],"mappings":"sHAGaA,EAAsB,CACjCC,EACAC,EACAC,IACS,CACL,GAAAF,EAAoB,GAAKA,EAAoB,EACzC,MAAA,IAAI,MAAM,sCAAsC,EAGxDG,EAAAA,UAAU,IAAM,CACd,IAAIC,EAAe,GAEnB,MAAMC,EAAe,IAAM,CACzB,MAAMC,EAAKJ,GAAY,QACjBK,EAASD,GAAM,SAAS,gBAExBE,EAAeD,EAAO,aAAeA,EAAO,aAC5CE,EAAYH,EAAKC,EAAO,UAAY,OAAO,QAE3CG,EAAiBF,EAAe,EAAI,KAAK,IAAI,EAAGC,EAAYD,CAAY,EAAI,EAE9E,CAACJ,GAAgBM,GAAkBV,IAC5BC,EAAA,EACMG,EAAA,GAEnB,EAEMO,EAAeT,GAAY,SAAW,OAC/B,OAAAS,EAAA,iBAAiB,SAAUN,CAAY,EACvCA,EAAA,EAEN,IAAM,CACEM,EAAA,oBAAoB,SAAUN,CAAY,CACzD,CACC,EAAA,CAACL,EAAmBC,EAAUC,CAAU,CAAC,CAC9C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOnScrollProgress.mjs","sources":["../../src/hooks/useOnScrollProgress.ts"],"sourcesContent":["'use client';\r\nimport { RefObject, useEffect } from 'react';\r\n\r\nexport const useOnScrollProgress = (\r\n triggerPercentage: number,\r\n callback: () => void,\r\n elementRef?: RefObject<HTMLElement | null>,\r\n): void => {\r\n if (triggerPercentage < 0 || triggerPercentage > 1) {\r\n throw new Error('El porcentaje debe estar entre 0 y 1');\r\n }\r\n\r\n useEffect(() => {\r\n let hasTriggered = false;\r\n\r\n const handleScroll = () => {\r\n const el = elementRef?.current;\r\n const target = el ?? document.documentElement;\r\n\r\n const scrollHeight = target.scrollHeight - target.clientHeight;\r\n const scrollTop = el ? target.scrollTop : window.scrollY;\r\n\r\n const scrollProgress = scrollHeight > 0 ? Math.min(1, scrollTop / scrollHeight) : 0;\r\n\r\n if (!hasTriggered && scrollProgress >= triggerPercentage) {\r\n callback();\r\n hasTriggered = true;\r\n }\r\n };\r\n\r\n const scrollTarget = elementRef?.current ?? window;\r\n scrollTarget.addEventListener('scroll', handleScroll);\r\n handleScroll();\r\n\r\n return () => {\r\n scrollTarget.removeEventListener('scroll', handleScroll);\r\n };\r\n }, [triggerPercentage, callback, elementRef]);\r\n};\r\n"],"names":["useOnScrollProgress","triggerPercentage","callback","elementRef","useEffect","hasTriggered","handleScroll","el","target","scrollHeight","scrollTop","scrollProgress","scrollTarget"],"mappings":";;AAGO,MAAMA,IAAsB,CACjCC,GACAC,GACAC,MACS;AACL,MAAAF,IAAoB,KAAKA,IAAoB;AACzC,UAAA,IAAI,MAAM,sCAAsC;AAGxD,EAAAG,EAAU,MAAM;AACd,QAAIC,IAAe;AAEnB,UAAMC,IAAe,MAAM;AACzB,YAAMC,IAAKJ,GAAY,SACjBK,IAASD,KAAM,SAAS,iBAExBE,IAAeD,EAAO,eAAeA,EAAO,cAC5CE,IAAYH,IAAKC,EAAO,YAAY,OAAO,SAE3CG,IAAiBF,IAAe,IAAI,KAAK,IAAI,GAAGC,IAAYD,CAAY,IAAI;AAE9E,MAAA,CAACJ,KAAgBM,KAAkBV,MAC5BC,EAAA,GACMG,IAAA;AAAA,IAEnB,GAEMO,IAAeT,GAAY,WAAW;AAC/B,WAAAS,EAAA,iBAAiB,UAAUN,CAAY,GACvCA,EAAA,GAEN,MAAM;AACE,MAAAM,EAAA,oBAAoB,UAAUN,CAAY;AAAA,IACzD;AAAA,EACC,GAAA,CAACL,GAAmBC,GAAUC,CAAU,CAAC;AAC9C;"}
package/dist/index.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./components/EmptyState/index.cjs"),i=require("./components/InfinityLoader/index.cjs"),n=require("./components/SelectInfinity/index.cjs"),a=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),u=require("./consts/http-status.cjs"),l=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),r=require("./contexts/PageDataContext/index.cjs"),c=require("./form/Form.cjs"),d=require("./form/FormButtonSubmit.cjs"),y=require("./form/utils/zodValidator.cjs"),q=require("./form/utils/nullableInput.cjs"),m=require("./hocs/withForm.cjs"),g=require("./hocs/withModalManager.cjs");require("@mantine/core");const p=require("./hooks/useFetchNextPageOnScroll.cjs"),f=require("./hooks/useOnScrollProgress.cjs");require("next/navigation");const P=require("./mantine/breakpointsWithPx.cjs"),S=require("./mantine/toTailwindColors.cjs"),h=require("./utils/formatBytes.cjs"),B=require("./utils/ky/addBodyJsonHook.cjs"),I=require("./utils/ky/parseJson.cjs"),t=require("./utils/array/groupBy.cjs"),v=require("./utils/array/shuffleArray.cjs"),N=require("./utils/newHref.cjs"),x=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=o.EmptyState;exports.InfinityLoader=i.InfinityLoader;exports.SelectInfinity=n.SelectInfinity;exports.NavItems=a.NavItems;exports.Icon=s.Icon;exports.HttpStatus=u.HttpStatus;exports.Revalidate=l.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=r.PageDataProvider;exports.usePageData=r.usePageData;exports.Form=c.Form;exports.FormButtonSubmit=d.FormButtonSubmit;exports.zodValidator=y.zodValidator;exports.nullableInput=q.nullableInput;exports.withForm=m.withForm;exports.withModalManager=g.withModalManager;exports.useFetchNextPageOnScroll=p.useFetchNextPageOnScroll;exports.useOnScrollProgress=f.useOnScrollProgress;exports.breakpointsWithPx=P.breakpointsWithPx;exports.toTailwindColors=S.toTailwindColors;exports.formatBytes=h.formatBytes;exports.addBodyJsonHook=B.addBodyJsonHook;exports.parseJSON=I.parseJSON;exports.groupBy=t.groupBy;exports.indexBy=t.indexBy;exports.shuffleArray=v.shuffleArray;exports.newHref=N.newHref;exports.isInfinityEmpty=x.isInfinityEmpty;
2
- //# sourceMappingURL=index.cjs.map
package/dist/index.mjs DELETED
@@ -1,61 +0,0 @@
1
- import { EmptyState as m } from "./components/EmptyState/index.mjs";
2
- import { InfinityLoader as f } from "./components/InfinityLoader/index.mjs";
3
- import { SelectInfinity as x } from "./components/SelectInfinity/index.mjs";
4
- import { NavItems as n } from "./components/NavItems.mjs";
5
- import { Icon as l } from "./components/Icon.mjs";
6
- import { HttpStatus as y } from "./consts/http-status.mjs";
7
- import { Revalidate as g } from "./consts/revalidate.mjs";
8
- import { NavigationHistoryProvider as S, QP_BACK_URL_NAME as v, useNavigationHistory as B } from "./contexts/NavigationHistoryContext/index.mjs";
9
- import { PageDataProvider as N, usePageData as c } from "./contexts/PageDataContext/index.mjs";
10
- import { Form as H } from "./form/Form.mjs";
11
- import { FormButtonSubmit as F } from "./form/FormButtonSubmit.mjs";
12
- import { zodValidator as A } from "./form/utils/zodValidator.mjs";
13
- import { nullableInput as M } from "./form/utils/nullableInput.mjs";
14
- import { withForm as _ } from "./hocs/withForm.mjs";
15
- import { withModalManager as C } from "./hocs/withModalManager.mjs";
16
- import "@mantine/core";
17
- import { useFetchNextPageOnScroll as J } from "./hooks/useFetchNextPageOnScroll.mjs";
18
- import { useOnScrollProgress as R } from "./hooks/useOnScrollProgress.mjs";
19
- import "next/navigation";
20
- import { breakpointsWithPx as K } from "./mantine/breakpointsWithPx.mjs";
21
- import { toTailwindColors as T } from "./mantine/toTailwindColors.mjs";
22
- import { formatBytes as V } from "./utils/formatBytes.mjs";
23
- import { addBodyJsonHook as j } from "./utils/ky/addBodyJsonHook.mjs";
24
- import { parseJSON as G } from "./utils/ky/parseJson.mjs";
25
- import { groupBy as Y, indexBy as Z } from "./utils/array/groupBy.mjs";
26
- import { shuffleArray as oo } from "./utils/array/shuffleArray.mjs";
27
- import { newHref as to } from "./utils/newHref.mjs";
28
- import { isInfinityEmpty as mo } from "./utils/isInfinityEmpty.mjs";
29
- export {
30
- m as EmptyState,
31
- H as Form,
32
- F as FormButtonSubmit,
33
- y as HttpStatus,
34
- l as Icon,
35
- f as InfinityLoader,
36
- n as NavItems,
37
- S as NavigationHistoryProvider,
38
- N as PageDataProvider,
39
- v as QP_BACK_URL_NAME,
40
- g as Revalidate,
41
- x as SelectInfinity,
42
- j as addBodyJsonHook,
43
- K as breakpointsWithPx,
44
- V as formatBytes,
45
- Y as groupBy,
46
- Z as indexBy,
47
- mo as isInfinityEmpty,
48
- to as newHref,
49
- M as nullableInput,
50
- G as parseJSON,
51
- oo as shuffleArray,
52
- T as toTailwindColors,
53
- J as useFetchNextPageOnScroll,
54
- B as useNavigationHistory,
55
- R as useOnScrollProgress,
56
- c as usePageData,
57
- _ as withForm,
58
- C as withModalManager,
59
- A as zodValidator
60
- };
61
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpointsWithPx.cjs","sources":["../../src/mantine/breakpointsWithPx.ts"],"sourcesContent":["export const breakpointsWithPx = {\r\n xs: '576px',\r\n sm: '640px',\r\n md: '768px',\r\n lg: '1024px',\r\n xl: '1280px',\r\n ['2xl']: '1536px',\r\n};\r\n"],"names":["breakpointsWithPx"],"mappings":"gFAAO,MAAMA,EAAoB,CAC/B,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SACJ,GAAI,SACH,MAAQ,QACX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpointsWithPx.mjs","sources":["../../src/mantine/breakpointsWithPx.ts"],"sourcesContent":["export const breakpointsWithPx = {\r\n xs: '576px',\r\n sm: '640px',\r\n md: '768px',\r\n lg: '1024px',\r\n xl: '1280px',\r\n ['2xl']: '1536px',\r\n};\r\n"],"names":["breakpointsWithPx"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACH,OAAQ;AACX;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toTailwindColors.cjs","sources":["../../src/mantine/toTailwindColors.ts"],"sourcesContent":["import { MantineColorShade, DefaultMantineColor, MantineThemeColors } from '@mantine/core';\r\n\r\nexport const toTailwindColors = (colors: MantineThemeColors) =>\r\n Object.entries(colors).reduce(\r\n (acc, [key, value]) => {\r\n acc[key] = value.reduce(\r\n (acc, color, index) => {\r\n acc[index as MantineColorShade] = color;\r\n return acc;\r\n },\r\n {} as Record<MantineColorShade, string>,\r\n );\r\n\r\n return acc;\r\n },\r\n {} as Record<DefaultMantineColor, Record<MantineColorShade, string>>,\r\n );\r\n"],"names":["toTailwindColors","colors","acc","key","value","color","index"],"mappings":"gFAEO,MAAMA,EAAoBC,GAC/B,OAAO,QAAQA,CAAM,EAAE,OACrB,CAACC,EAAK,CAACC,EAAKC,CAAK,KACXF,EAAAC,CAAG,EAAIC,EAAM,OACf,CAACF,EAAKG,EAAOC,KACXJ,EAAII,CAA0B,EAAID,EAC3BH,GAET,CAAA,CACF,EAEOA,GAET,CAAA,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toTailwindColors.mjs","sources":["../../src/mantine/toTailwindColors.ts"],"sourcesContent":["import { MantineColorShade, DefaultMantineColor, MantineThemeColors } from '@mantine/core';\r\n\r\nexport const toTailwindColors = (colors: MantineThemeColors) =>\r\n Object.entries(colors).reduce(\r\n (acc, [key, value]) => {\r\n acc[key] = value.reduce(\r\n (acc, color, index) => {\r\n acc[index as MantineColorShade] = color;\r\n return acc;\r\n },\r\n {} as Record<MantineColorShade, string>,\r\n );\r\n\r\n return acc;\r\n },\r\n {} as Record<DefaultMantineColor, Record<MantineColorShade, string>>,\r\n );\r\n"],"names":["toTailwindColors","colors","acc","key","value","color","index"],"mappings":"AAEO,MAAMA,IAAmB,CAACC,MAC/B,OAAO,QAAQA,CAAM,EAAE;AAAA,EACrB,CAACC,GAAK,CAACC,GAAKC,CAAK,OACXF,EAAAC,CAAG,IAAIC,EAAM;AAAA,IACf,CAACF,GAAKG,GAAOC,OACXJ,EAAII,CAA0B,IAAID,GAC3BH;AAAAA,IAET,CAAA;AAAA,EACF,GAEOA;AAAA,EAET,CAAA;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupBy.cjs","sources":["../../../src/utils/array/groupBy.ts"],"sourcesContent":["// getKey debe retorner un string o un array de strings o NULL <- ahora retorna undefined, no coicinde con groupBy\r\nexport function indexBy<T, K, C extends string>(\r\n arr: T[],\r\n getKey: (item: T) => C | undefined\r\n): Record<C, T | undefined>;\r\nexport function indexBy<T, K, C extends string>(\r\n arr: T[],\r\n getKey: (item: T) => C | undefined,\r\n getValue: (item: T) => K\r\n): Record<C, K | undefined>;\r\nexport function indexBy<T, K>(\r\n arr: T[],\r\n getKey: (item: T) => string | undefined,\r\n getValue?: (item: T) => K\r\n) {\r\n if (getValue)\r\n return arr.reduce(\r\n (acc, item) => {\r\n const key = getKey(item);\r\n if (key === undefined) return acc;\r\n acc[key] = getValue(item);\r\n return acc;\r\n },\r\n {} as Record<string, K>\r\n );\r\n\r\n return arr.reduce(\r\n (acc, item) => {\r\n const key = getKey(item);\r\n if (key === undefined) return acc;\r\n acc[key] = item;\r\n return acc;\r\n },\r\n {} as Record<string, T>\r\n );\r\n}\r\n\r\n// falta agregar getValue como tercer parametro opcional\r\nexport const groupBy = <T extends any>(\r\n arr: T[],\r\n getKey: (item: T) => string | string[] | null\r\n) => {\r\n const groups: Record<string, T[] | undefined> = {};\r\n\r\n arr?.forEach((item) => {\r\n const key = getKey(item);\r\n\r\n if (key === null) return;\r\n\r\n if (Array.isArray(key)) {\r\n key.forEach((k) => {\r\n if (!groups[k]) groups[k] = [];\r\n\r\n groups[k]?.push(item);\r\n });\r\n\r\n return;\r\n }\r\n\r\n if (!groups[key]) groups[key] = [];\r\n\r\n groups[key]?.push(item);\r\n });\r\n\r\n return groups;\r\n};\r\n\r\nexport type IndexByResult<T> = Record<string, T | undefined>;\r\n\r\nexport type GroupByResult<T> = Record<string, T[] | undefined>;\r\n"],"names":["indexBy","arr","getKey","getValue","acc","item","key","groupBy","groups","k"],"mappings":"gFAUgB,SAAAA,EACdC,EACAC,EACAC,EACA,CACI,OAAAA,EACKF,EAAI,OACT,CAACG,EAAKC,IAAS,CACP,MAAAC,EAAMJ,EAAOG,CAAI,EACnB,OAAAC,IAAQ,SACRF,EAAAE,CAAG,EAAIH,EAASE,CAAI,GACjBD,CACT,EACA,CAAA,CACF,EAEKH,EAAI,OACT,CAACG,EAAKC,IAAS,CACP,MAAAC,EAAMJ,EAAOG,CAAI,EACnB,OAAAC,IAAQ,SACZF,EAAIE,CAAG,EAAID,GACJD,CACT,EACA,CAAA,CACF,CACF,CAGa,MAAAG,EAAU,CACrBN,EACAC,IACG,CACH,MAAMM,EAA0C,CAAC,EAE5C,OAAAP,GAAA,QAASI,GAAS,CACf,MAAAC,EAAMJ,EAAOG,CAAI,EAEvB,GAAIC,IAAQ,KAER,IAAA,MAAM,QAAQA,CAAG,EAAG,CAClBA,EAAA,QAASG,GAAM,CACZD,EAAOC,CAAC,IAAUD,EAAAC,CAAC,EAAI,CAAC,GAEtBD,EAAAC,CAAC,GAAG,KAAKJ,CAAI,CAAA,CACrB,EAED,MAAA,CAGGG,EAAOF,CAAG,IAAUE,EAAAF,CAAG,EAAI,CAAC,GAE1BE,EAAAF,CAAG,GAAG,KAAKD,CAAI,EAAA,CACvB,EAEMG,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupBy.mjs","sources":["../../../src/utils/array/groupBy.ts"],"sourcesContent":["// getKey debe retorner un string o un array de strings o NULL <- ahora retorna undefined, no coicinde con groupBy\r\nexport function indexBy<T, K, C extends string>(\r\n arr: T[],\r\n getKey: (item: T) => C | undefined\r\n): Record<C, T | undefined>;\r\nexport function indexBy<T, K, C extends string>(\r\n arr: T[],\r\n getKey: (item: T) => C | undefined,\r\n getValue: (item: T) => K\r\n): Record<C, K | undefined>;\r\nexport function indexBy<T, K>(\r\n arr: T[],\r\n getKey: (item: T) => string | undefined,\r\n getValue?: (item: T) => K\r\n) {\r\n if (getValue)\r\n return arr.reduce(\r\n (acc, item) => {\r\n const key = getKey(item);\r\n if (key === undefined) return acc;\r\n acc[key] = getValue(item);\r\n return acc;\r\n },\r\n {} as Record<string, K>\r\n );\r\n\r\n return arr.reduce(\r\n (acc, item) => {\r\n const key = getKey(item);\r\n if (key === undefined) return acc;\r\n acc[key] = item;\r\n return acc;\r\n },\r\n {} as Record<string, T>\r\n );\r\n}\r\n\r\n// falta agregar getValue como tercer parametro opcional\r\nexport const groupBy = <T extends any>(\r\n arr: T[],\r\n getKey: (item: T) => string | string[] | null\r\n) => {\r\n const groups: Record<string, T[] | undefined> = {};\r\n\r\n arr?.forEach((item) => {\r\n const key = getKey(item);\r\n\r\n if (key === null) return;\r\n\r\n if (Array.isArray(key)) {\r\n key.forEach((k) => {\r\n if (!groups[k]) groups[k] = [];\r\n\r\n groups[k]?.push(item);\r\n });\r\n\r\n return;\r\n }\r\n\r\n if (!groups[key]) groups[key] = [];\r\n\r\n groups[key]?.push(item);\r\n });\r\n\r\n return groups;\r\n};\r\n\r\nexport type IndexByResult<T> = Record<string, T | undefined>;\r\n\r\nexport type GroupByResult<T> = Record<string, T[] | undefined>;\r\n"],"names":["indexBy","arr","getKey","getValue","acc","item","key","groupBy","groups","k"],"mappings":"AAUgB,SAAAA,EACdC,GACAC,GACAC,GACA;AACI,SAAAA,IACKF,EAAI;AAAA,IACT,CAACG,GAAKC,MAAS;AACP,YAAAC,IAAMJ,EAAOG,CAAI;AACnB,aAAAC,MAAQ,WACRF,EAAAE,CAAG,IAAIH,EAASE,CAAI,IACjBD;AAAA,IACT;AAAA,IACA,CAAA;AAAA,EACF,IAEKH,EAAI;AAAA,IACT,CAACG,GAAKC,MAAS;AACP,YAAAC,IAAMJ,EAAOG,CAAI;AACnB,aAAAC,MAAQ,WACZF,EAAIE,CAAG,IAAID,IACJD;AAAA,IACT;AAAA,IACA,CAAA;AAAA,EACF;AACF;AAGa,MAAAG,IAAU,CACrBN,GACAC,MACG;AACH,QAAMM,IAA0C,CAAC;AAE5C,SAAAP,GAAA,QAAQ,CAACI,MAAS;AACf,UAAAC,IAAMJ,EAAOG,CAAI;AAEvB,QAAIC,MAAQ,MAER;AAAA,UAAA,MAAM,QAAQA,CAAG,GAAG;AAClB,QAAAA,EAAA,QAAQ,CAACG,MAAM;AACjB,UAAKD,EAAOC,CAAC,MAAUD,EAAAC,CAAC,IAAI,CAAC,IAEtBD,EAAAC,CAAC,GAAG,KAAKJ,CAAI;AAAA,QAAA,CACrB;AAED;AAAA,MAAA;AAGF,MAAKG,EAAOF,CAAG,MAAUE,EAAAF,CAAG,IAAI,CAAC,IAE1BE,EAAAF,CAAG,GAAG,KAAKD,CAAI;AAAA;AAAA,EAAA,CACvB,GAEMG;AACT;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shuffleArray.cjs","sources":["../../../src/utils/array/shuffleArray.ts"],"sourcesContent":["export const shuffleArray = <T>(array: T[]) => {\r\n const shuffledArray = [...array];\r\n let currentIndex = shuffledArray.length,\r\n randomIndex;\r\n\r\n // While there remain elements to shuffle.\r\n while (currentIndex > 0) {\r\n // Pick a remaining element.\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n\r\n // And swap it with the current element.\r\n [shuffledArray[currentIndex], shuffledArray[randomIndex]] = [\r\n shuffledArray[randomIndex],\r\n shuffledArray[currentIndex],\r\n ];\r\n }\r\n\r\n return shuffledArray;\r\n};\r\n"],"names":["shuffleArray","array","shuffledArray","currentIndex","randomIndex"],"mappings":"gFAAa,MAAAA,EAAmBC,GAAe,CACvC,MAAAC,EAAgB,CAAC,GAAGD,CAAK,EAC3B,IAAAE,EAAeD,EAAc,OAC/BE,EAGF,KAAOD,EAAe,GAEpBC,EAAc,KAAK,MAAM,KAAK,OAAA,EAAWD,CAAY,EACrDA,IAGA,CAACD,EAAcC,CAAY,EAAGD,EAAcE,CAAW,CAAC,EAAI,CAC1DF,EAAcE,CAAW,EACzBF,EAAcC,CAAY,CAC5B,EAGK,OAAAD,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shuffleArray.mjs","sources":["../../../src/utils/array/shuffleArray.ts"],"sourcesContent":["export const shuffleArray = <T>(array: T[]) => {\r\n const shuffledArray = [...array];\r\n let currentIndex = shuffledArray.length,\r\n randomIndex;\r\n\r\n // While there remain elements to shuffle.\r\n while (currentIndex > 0) {\r\n // Pick a remaining element.\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n\r\n // And swap it with the current element.\r\n [shuffledArray[currentIndex], shuffledArray[randomIndex]] = [\r\n shuffledArray[randomIndex],\r\n shuffledArray[currentIndex],\r\n ];\r\n }\r\n\r\n return shuffledArray;\r\n};\r\n"],"names":["shuffleArray","array","shuffledArray","currentIndex","randomIndex"],"mappings":"AAAa,MAAAA,IAAe,CAAIC,MAAe;AACvC,QAAAC,IAAgB,CAAC,GAAGD,CAAK;AAC3B,MAAAE,IAAeD,EAAc,QAC/BE;AAGF,SAAOD,IAAe;AAEpB,IAAAC,IAAc,KAAK,MAAM,KAAK,OAAA,IAAWD,CAAY,GACrDA,KAGA,CAACD,EAAcC,CAAY,GAAGD,EAAcE,CAAW,CAAC,IAAI;AAAA,MAC1DF,EAAcE,CAAW;AAAA,MACzBF,EAAcC,CAAY;AAAA,IAC5B;AAGK,SAAAD;AACT;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatBytes.cjs","sources":["../../src/utils/formatBytes.ts"],"sourcesContent":["export function formatBytes(bytes: number, decimals = 2) {\r\n if (!+bytes) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;\r\n}\r\n"],"names":["formatBytes","bytes","decimals","k","dm","sizes","i"],"mappings":"gFAAgB,SAAAA,EAAYC,EAAeC,EAAW,EAAG,CACnD,GAAA,CAAC,CAACD,EAAc,MAAA,UAEpB,MAAME,EAAI,KACJC,EAAKF,EAAW,EAAI,EAAIA,EACxBG,EAAQ,CAAC,QAAS,KAAM,IAAI,EAE5BC,EAAI,KAAK,MAAM,KAAK,IAAIL,CAAK,EAAI,KAAK,IAAIE,CAAC,CAAC,EAElD,MAAO,GAAG,YAAYF,EAAQ,KAAK,IAAIE,EAAGG,CAAC,GAAG,QAAQF,CAAE,CAAC,CAAC,IAAIC,EAAMC,CAAC,CAAC,EACxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatBytes.mjs","sources":["../../src/utils/formatBytes.ts"],"sourcesContent":["export function formatBytes(bytes: number, decimals = 2) {\r\n if (!+bytes) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;\r\n}\r\n"],"names":["formatBytes","bytes","decimals","k","dm","sizes","i"],"mappings":"AAAgB,SAAAA,EAAYC,GAAeC,IAAW,GAAG;AACnD,MAAA,CAAC,CAACD,EAAc,QAAA;AAEpB,QAAME,IAAI,MACJC,IAAKF,IAAW,IAAI,IAAIA,GACxBG,IAAQ,CAAC,SAAS,MAAM,IAAI,GAE5BC,IAAI,KAAK,MAAM,KAAK,IAAIL,CAAK,IAAI,KAAK,IAAIE,CAAC,CAAC;AAElD,SAAO,GAAG,YAAYF,IAAQ,KAAK,IAAIE,GAAGG,CAAC,GAAG,QAAQF,CAAE,CAAC,CAAC,IAAIC,EAAMC,CAAC,CAAC;AACxE;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isInfinityEmpty.cjs","sources":["../../src/utils/isInfinityEmpty.ts"],"sourcesContent":["import { InfiniteData } from '@tanstack/react-query';\r\n\r\nexport const isInfinityEmpty = (data: InfiniteData<{ data: unknown[] }> | undefined) =>\r\n data?.pages[0].data.length === 0;\r\n"],"names":["isInfinityEmpty","data"],"mappings":"gFAEa,MAAAA,EAAmBC,GAC9BA,GAAM,MAAM,CAAC,EAAE,KAAK,SAAW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isInfinityEmpty.mjs","sources":["../../src/utils/isInfinityEmpty.ts"],"sourcesContent":["import { InfiniteData } from '@tanstack/react-query';\r\n\r\nexport const isInfinityEmpty = (data: InfiniteData<{ data: unknown[] }> | undefined) =>\r\n data?.pages[0].data.length === 0;\r\n"],"names":["isInfinityEmpty","data"],"mappings":"AAEa,MAAAA,IAAkB,CAACC,MAC9BA,GAAM,MAAM,CAAC,EAAE,KAAK,WAAW;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"addBodyJsonHook.cjs","sources":["../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\nexport type KyError<T = unknown> = HTTPError<T> & {\r\n response: {\r\n bodyJson?: T;\r\n };\r\n};\r\n\r\nexport const addBodyJsonHook: BeforeErrorHook = async (error: KyError<unknown>) => {\r\n error.response.bodyJson = await parseJSON(error.response);\r\n return error;\r\n};\r\n"],"names":["addBodyJsonHook","error","parseJSON"],"mappings":"mHASaA,EAAmC,MAAOC,IACrDA,EAAM,SAAS,SAAW,MAAMC,EAAAA,UAAUD,EAAM,QAAQ,EACjDA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"addBodyJsonHook.mjs","sources":["../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\nexport type KyError<T = unknown> = HTTPError<T> & {\r\n response: {\r\n bodyJson?: T;\r\n };\r\n};\r\n\r\nexport const addBodyJsonHook: BeforeErrorHook = async (error: KyError<unknown>) => {\r\n error.response.bodyJson = await parseJSON(error.response);\r\n return error;\r\n};\r\n"],"names":["addBodyJsonHook","error","parseJSON"],"mappings":";AASa,MAAAA,IAAmC,OAAOC,OACrDA,EAAM,SAAS,WAAW,MAAMC,EAAUD,EAAM,QAAQ,GACjDA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseJson.cjs","sources":["../../../src/utils/ky/parseJson.ts"],"sourcesContent":["import { KyResponse } from \"ky\";\r\n\r\n// si el servidor responde vacio (no un json), entonces devuelve un objeto vacio, sino devuelve el json parseado\r\nexport const parseJSON = async (response: KyResponse) => {\r\n return response.text().then(function (text) {\r\n return text ? JSON.parse(text) : {};\r\n });\r\n};\r\n"],"names":["parseJSON","response","text"],"mappings":"gFAGa,MAAAA,EAAY,MAAOC,GACvBA,EAAS,KAAA,EAAO,KAAK,SAAUC,EAAM,CAC1C,OAAOA,EAAO,KAAK,MAAMA,CAAI,EAAI,CAAC,CAAA,CACnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseJson.mjs","sources":["../../../src/utils/ky/parseJson.ts"],"sourcesContent":["import { KyResponse } from \"ky\";\r\n\r\n// si el servidor responde vacio (no un json), entonces devuelve un objeto vacio, sino devuelve el json parseado\r\nexport const parseJSON = async (response: KyResponse) => {\r\n return response.text().then(function (text) {\r\n return text ? JSON.parse(text) : {};\r\n });\r\n};\r\n"],"names":["parseJSON","response","text"],"mappings":"AAGa,MAAAA,IAAY,OAAOC,MACvBA,EAAS,KAAA,EAAO,KAAK,SAAUC,GAAM;AAC1C,SAAOA,IAAO,KAAK,MAAMA,CAAI,IAAI,CAAC;AAAA,CACnC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"newHref.cjs","sources":["../../src/utils/newHref.ts"],"sourcesContent":["import queryString from 'query-string';\r\nimport { QP_BACK_URL_NAME } from 'src/contexts';\r\n\r\nexport type TParams = Record<string, any> | unknown;\r\n\r\nexport type TSearchParams = { [x: string]: any };\r\n\r\nexport type Args<T, S> = {\r\n params?: T;\r\n searchParams?: S & {\r\n [QP_BACK_URL_NAME]?: string;\r\n };\r\n};\r\n\r\nexport const newHref =\r\n <T extends TParams, S extends TSearchParams = TSearchParams>(\r\n fn: string | ((args: Args<T, S>) => string),\r\n ) =>\r\n (args?: Args<T, S>) => {\r\n const href =\r\n typeof fn === 'string'\r\n ? fn\r\n : fn(\r\n args ?? {\r\n params: {} as T,\r\n searchParams: {} as S,\r\n },\r\n );\r\n\r\n if (args?.searchParams) {\r\n const qs = queryString.stringify(args.searchParams, {\r\n skipEmptyString: true,\r\n skipNull: true,\r\n });\r\n\r\n return `${href}${qs ? `?${qs}` : ''}`;\r\n }\r\n\r\n return href;\r\n };\r\n"],"names":["newHref","fn","args","href","qs","queryString"],"mappings":"0JAcaA,EAETC,GAEDC,GAAsB,CACrB,MAAMC,EACJ,OAAOF,GAAO,SACVA,EACAA,EACEC,GAAQ,CACN,OAAQ,CAAC,EACT,aAAc,CAAA,CAAC,CAEnB,EAEN,GAAIA,GAAM,aAAc,CACtB,MAAME,EAAKC,EAAA,QAAY,UAAUH,EAAK,aAAc,CAClD,gBAAiB,GACjB,SAAU,EAAA,CACX,EAED,MAAO,GAAGC,CAAI,GAAGC,EAAK,IAAIA,CAAE,GAAK,EAAE,EAAA,CAG9B,OAAAD,CACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"newHref.mjs","sources":["../../src/utils/newHref.ts"],"sourcesContent":["import queryString from 'query-string';\r\nimport { QP_BACK_URL_NAME } from 'src/contexts';\r\n\r\nexport type TParams = Record<string, any> | unknown;\r\n\r\nexport type TSearchParams = { [x: string]: any };\r\n\r\nexport type Args<T, S> = {\r\n params?: T;\r\n searchParams?: S & {\r\n [QP_BACK_URL_NAME]?: string;\r\n };\r\n};\r\n\r\nexport const newHref =\r\n <T extends TParams, S extends TSearchParams = TSearchParams>(\r\n fn: string | ((args: Args<T, S>) => string),\r\n ) =>\r\n (args?: Args<T, S>) => {\r\n const href =\r\n typeof fn === 'string'\r\n ? fn\r\n : fn(\r\n args ?? {\r\n params: {} as T,\r\n searchParams: {} as S,\r\n },\r\n );\r\n\r\n if (args?.searchParams) {\r\n const qs = queryString.stringify(args.searchParams, {\r\n skipEmptyString: true,\r\n skipNull: true,\r\n });\r\n\r\n return `${href}${qs ? `?${qs}` : ''}`;\r\n }\r\n\r\n return href;\r\n };\r\n"],"names":["newHref","fn","args","href","qs","queryString"],"mappings":";AAcO,MAAMA,IACX,CACEC,MAEF,CAACC,MAAsB;AACrB,QAAMC,IACJ,OAAOF,KAAO,WACVA,IACAA;AAAA,IACEC,KAAQ;AAAA,MACN,QAAQ,CAAC;AAAA,MACT,cAAc,CAAA;AAAA,IAAC;AAAA,EAEnB;AAEN,MAAIA,GAAM,cAAc;AACtB,UAAME,IAAKC,EAAY,UAAUH,EAAK,cAAc;AAAA,MAClD,iBAAiB;AAAA,MACjB,UAAU;AAAA,IAAA,CACX;AAED,WAAO,GAAGC,CAAI,GAAGC,IAAK,IAAIA,CAAE,KAAK,EAAE;AAAA,EAAA;AAG9B,SAAAD;AACT;"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes