rn-custom-ui 1.0.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 (332) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +477 -0
  3. package/lib/module/assets/images/close.png +0 -0
  4. package/lib/module/components/CustomCheckbox/index.js +99 -0
  5. package/lib/module/components/CustomCheckbox/index.js.map +1 -0
  6. package/lib/module/components/CustomCheckbox/styles.js +213 -0
  7. package/lib/module/components/CustomCheckbox/styles.js.map +1 -0
  8. package/lib/module/components/CustomCheckbox/types.js +4 -0
  9. package/lib/module/components/CustomCheckbox/types.js.map +1 -0
  10. package/lib/module/components/closeButton/index.js +45 -0
  11. package/lib/module/components/closeButton/index.js.map +1 -0
  12. package/lib/module/components/closeButton/types.js +4 -0
  13. package/lib/module/components/closeButton/types.js.map +1 -0
  14. package/lib/module/components/customButton/index.js +176 -0
  15. package/lib/module/components/customButton/index.js.map +1 -0
  16. package/lib/module/components/customButton/styles.js +282 -0
  17. package/lib/module/components/customButton/styles.js.map +1 -0
  18. package/lib/module/components/customButton/types.js +4 -0
  19. package/lib/module/components/customButton/types.js.map +1 -0
  20. package/lib/module/components/customDropDown/DropDownBottomSheet.js +57 -0
  21. package/lib/module/components/customDropDown/DropDownBottomSheet.js.map +1 -0
  22. package/lib/module/components/customDropDown/DropDownList.js +51 -0
  23. package/lib/module/components/customDropDown/DropDownList.js.map +1 -0
  24. package/lib/module/components/customDropDown/DropDownListItem.js +38 -0
  25. package/lib/module/components/customDropDown/DropDownListItem.js.map +1 -0
  26. package/lib/module/components/customDropDown/DropDownListModal.js +63 -0
  27. package/lib/module/components/customDropDown/DropDownListModal.js.map +1 -0
  28. package/lib/module/components/customDropDown/index.js +143 -0
  29. package/lib/module/components/customDropDown/index.js.map +1 -0
  30. package/lib/module/components/customDropDown/styles.js +189 -0
  31. package/lib/module/components/customDropDown/styles.js.map +1 -0
  32. package/lib/module/components/customDropDown/types.js +4 -0
  33. package/lib/module/components/customDropDown/types.js.map +1 -0
  34. package/lib/module/components/customDropDown/utils.js +17 -0
  35. package/lib/module/components/customDropDown/utils.js.map +1 -0
  36. package/lib/module/components/customList/ListEmpty.js +33 -0
  37. package/lib/module/components/customList/ListEmpty.js.map +1 -0
  38. package/lib/module/components/customList/ListFooterLoader.js +14 -0
  39. package/lib/module/components/customList/ListFooterLoader.js.map +1 -0
  40. package/lib/module/components/customList/defaultKeyExtractor.js +9 -0
  41. package/lib/module/components/customList/defaultKeyExtractor.js.map +1 -0
  42. package/lib/module/components/customList/getFlashList.js +19 -0
  43. package/lib/module/components/customList/getFlashList.js.map +1 -0
  44. package/lib/module/components/customList/index.js +117 -0
  45. package/lib/module/components/customList/index.js.map +1 -0
  46. package/lib/module/components/customList/styles.js +45 -0
  47. package/lib/module/components/customList/styles.js.map +1 -0
  48. package/lib/module/components/customList/types.js +4 -0
  49. package/lib/module/components/customList/types.js.map +1 -0
  50. package/lib/module/components/customModal/ModalFooter.js +44 -0
  51. package/lib/module/components/customModal/ModalFooter.js.map +1 -0
  52. package/lib/module/components/customModal/index.js +132 -0
  53. package/lib/module/components/customModal/index.js.map +1 -0
  54. package/lib/module/components/customModal/styles.js +123 -0
  55. package/lib/module/components/customModal/styles.js.map +1 -0
  56. package/lib/module/components/customModal/types.js +4 -0
  57. package/lib/module/components/customModal/types.js.map +1 -0
  58. package/lib/module/components/customModal/useCustomModal.js +23 -0
  59. package/lib/module/components/customModal/useCustomModal.js.map +1 -0
  60. package/lib/module/components/customNumberPad/NumberPadKey.js +39 -0
  61. package/lib/module/components/customNumberPad/NumberPadKey.js.map +1 -0
  62. package/lib/module/components/customNumberPad/index.js +156 -0
  63. package/lib/module/components/customNumberPad/index.js.map +1 -0
  64. package/lib/module/components/customNumberPad/styles.js +131 -0
  65. package/lib/module/components/customNumberPad/styles.js.map +1 -0
  66. package/lib/module/components/customNumberPad/types.js +4 -0
  67. package/lib/module/components/customNumberPad/types.js.map +1 -0
  68. package/lib/module/components/customNumberPad/useNumberPadInput.js +44 -0
  69. package/lib/module/components/customNumberPad/useNumberPadInput.js.map +1 -0
  70. package/lib/module/components/customNumberPad/utils.js +38 -0
  71. package/lib/module/components/customNumberPad/utils.js.map +1 -0
  72. package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js +66 -0
  73. package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js.map +1 -0
  74. package/lib/module/components/customSlideTabs/TabBarItem.js +61 -0
  75. package/lib/module/components/customSlideTabs/TabBarItem.js.map +1 -0
  76. package/lib/module/components/customSlideTabs/TabScene.js +88 -0
  77. package/lib/module/components/customSlideTabs/TabScene.js.map +1 -0
  78. package/lib/module/components/customSlideTabs/index.js +277 -0
  79. package/lib/module/components/customSlideTabs/index.js.map +1 -0
  80. package/lib/module/components/customSlideTabs/styles.js +132 -0
  81. package/lib/module/components/customSlideTabs/styles.js.map +1 -0
  82. package/lib/module/components/customSlideTabs/tabBarScroll.js +65 -0
  83. package/lib/module/components/customSlideTabs/tabBarScroll.js.map +1 -0
  84. package/lib/module/components/customSlideTabs/types.js +4 -0
  85. package/lib/module/components/customSlideTabs/types.js.map +1 -0
  86. package/lib/module/components/loading/index.js +34 -0
  87. package/lib/module/components/loading/index.js.map +1 -0
  88. package/lib/module/customFunctions/array.js +61 -0
  89. package/lib/module/customFunctions/array.js.map +1 -0
  90. package/lib/module/customFunctions/async.js +62 -0
  91. package/lib/module/customFunctions/async.js.map +1 -0
  92. package/lib/module/customFunctions/date.js +109 -0
  93. package/lib/module/customFunctions/date.js.map +1 -0
  94. package/lib/module/customFunctions/general.js +29 -0
  95. package/lib/module/customFunctions/general.js.map +1 -0
  96. package/lib/module/customFunctions/id.js +20 -0
  97. package/lib/module/customFunctions/id.js.map +1 -0
  98. package/lib/module/customFunctions/index.js +29 -0
  99. package/lib/module/customFunctions/index.js.map +1 -0
  100. package/lib/module/customFunctions/number.js +94 -0
  101. package/lib/module/customFunctions/number.js.map +1 -0
  102. package/lib/module/customFunctions/object.js +39 -0
  103. package/lib/module/customFunctions/object.js.map +1 -0
  104. package/lib/module/customFunctions/string.js +63 -0
  105. package/lib/module/customFunctions/string.js.map +1 -0
  106. package/lib/module/customFunctions/types.js +2 -0
  107. package/lib/module/customFunctions/types.js.map +1 -0
  108. package/lib/module/customFunctions/validation.js +34 -0
  109. package/lib/module/customFunctions/validation.js.map +1 -0
  110. package/lib/module/customHooks/errors.js +61 -0
  111. package/lib/module/customHooks/errors.js.map +1 -0
  112. package/lib/module/customHooks/fetchJson.js +36 -0
  113. package/lib/module/customHooks/fetchJson.js.map +1 -0
  114. package/lib/module/customHooks/index.js +10 -0
  115. package/lib/module/customHooks/index.js.map +1 -0
  116. package/lib/module/customHooks/internal.js +49 -0
  117. package/lib/module/customHooks/internal.js.map +1 -0
  118. package/lib/module/customHooks/types.js +2 -0
  119. package/lib/module/customHooks/types.js.map +1 -0
  120. package/lib/module/customHooks/useApi.js +91 -0
  121. package/lib/module/customHooks/useApi.js.map +1 -0
  122. package/lib/module/customHooks/useLazyApi.js +80 -0
  123. package/lib/module/customHooks/useLazyApi.js.map +1 -0
  124. package/lib/module/customHooks/useMutation.js +69 -0
  125. package/lib/module/customHooks/useMutation.js.map +1 -0
  126. package/lib/module/customHooks/usePaginatedApi.js +127 -0
  127. package/lib/module/customHooks/usePaginatedApi.js.map +1 -0
  128. package/lib/module/customHooks/usePollingApi.js +37 -0
  129. package/lib/module/customHooks/usePollingApi.js.map +1 -0
  130. package/lib/module/index.js +13 -0
  131. package/lib/module/index.js.map +1 -0
  132. package/lib/module/multiply.js +6 -0
  133. package/lib/module/multiply.js.map +1 -0
  134. package/lib/module/package.json +1 -0
  135. package/lib/typescript/package.json +1 -0
  136. package/lib/typescript/src/components/CustomCheckbox/index.d.ts +5 -0
  137. package/lib/typescript/src/components/CustomCheckbox/index.d.ts.map +1 -0
  138. package/lib/typescript/src/components/CustomCheckbox/styles.d.ts +67 -0
  139. package/lib/typescript/src/components/CustomCheckbox/styles.d.ts.map +1 -0
  140. package/lib/typescript/src/components/CustomCheckbox/types.d.ts +28 -0
  141. package/lib/typescript/src/components/CustomCheckbox/types.d.ts.map +1 -0
  142. package/lib/typescript/src/components/closeButton/index.d.ts +4 -0
  143. package/lib/typescript/src/components/closeButton/index.d.ts.map +1 -0
  144. package/lib/typescript/src/components/closeButton/types.d.ts +8 -0
  145. package/lib/typescript/src/components/closeButton/types.d.ts.map +1 -0
  146. package/lib/typescript/src/components/customButton/index.d.ts +5 -0
  147. package/lib/typescript/src/components/customButton/index.d.ts.map +1 -0
  148. package/lib/typescript/src/components/customButton/styles.d.ts +231 -0
  149. package/lib/typescript/src/components/customButton/styles.d.ts.map +1 -0
  150. package/lib/typescript/src/components/customButton/types.d.ts +46 -0
  151. package/lib/typescript/src/components/customButton/types.d.ts.map +1 -0
  152. package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts +18 -0
  153. package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts.map +1 -0
  154. package/lib/typescript/src/components/customDropDown/DropDownList.d.ts +17 -0
  155. package/lib/typescript/src/components/customDropDown/DropDownList.d.ts.map +1 -0
  156. package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts +15 -0
  157. package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts.map +1 -0
  158. package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts +19 -0
  159. package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts.map +1 -0
  160. package/lib/typescript/src/components/customDropDown/index.d.ts +5 -0
  161. package/lib/typescript/src/components/customDropDown/index.d.ts.map +1 -0
  162. package/lib/typescript/src/components/customDropDown/styles.d.ts +190 -0
  163. package/lib/typescript/src/components/customDropDown/styles.d.ts.map +1 -0
  164. package/lib/typescript/src/components/customDropDown/types.d.ts +37 -0
  165. package/lib/typescript/src/components/customDropDown/types.d.ts.map +1 -0
  166. package/lib/typescript/src/components/customDropDown/utils.d.ts +4 -0
  167. package/lib/typescript/src/components/customDropDown/utils.d.ts.map +1 -0
  168. package/lib/typescript/src/components/customList/ListEmpty.d.ts +10 -0
  169. package/lib/typescript/src/components/customList/ListEmpty.d.ts.map +1 -0
  170. package/lib/typescript/src/components/customList/ListFooterLoader.d.ts +3 -0
  171. package/lib/typescript/src/components/customList/ListFooterLoader.d.ts.map +1 -0
  172. package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts +2 -0
  173. package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts.map +1 -0
  174. package/lib/typescript/src/components/customList/getFlashList.d.ts +6 -0
  175. package/lib/typescript/src/components/customList/getFlashList.d.ts.map +1 -0
  176. package/lib/typescript/src/components/customList/index.d.ts +11 -0
  177. package/lib/typescript/src/components/customList/index.d.ts.map +1 -0
  178. package/lib/typescript/src/components/customList/styles.d.ts +42 -0
  179. package/lib/typescript/src/components/customList/styles.d.ts.map +1 -0
  180. package/lib/typescript/src/components/customList/types.d.ts +33 -0
  181. package/lib/typescript/src/components/customList/types.d.ts.map +1 -0
  182. package/lib/typescript/src/components/customModal/ModalFooter.d.ts +12 -0
  183. package/lib/typescript/src/components/customModal/ModalFooter.d.ts.map +1 -0
  184. package/lib/typescript/src/components/customModal/index.d.ts +6 -0
  185. package/lib/typescript/src/components/customModal/index.d.ts.map +1 -0
  186. package/lib/typescript/src/components/customModal/styles.d.ts +83 -0
  187. package/lib/typescript/src/components/customModal/styles.d.ts.map +1 -0
  188. package/lib/typescript/src/components/customModal/types.d.ts +36 -0
  189. package/lib/typescript/src/components/customModal/types.d.ts.map +1 -0
  190. package/lib/typescript/src/components/customModal/useCustomModal.d.ts +8 -0
  191. package/lib/typescript/src/components/customModal/useCustomModal.d.ts.map +1 -0
  192. package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts +23 -0
  193. package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts.map +1 -0
  194. package/lib/typescript/src/components/customNumberPad/index.d.ts +7 -0
  195. package/lib/typescript/src/components/customNumberPad/index.d.ts.map +1 -0
  196. package/lib/typescript/src/components/customNumberPad/styles.d.ts +37 -0
  197. package/lib/typescript/src/components/customNumberPad/styles.d.ts.map +1 -0
  198. package/lib/typescript/src/components/customNumberPad/types.d.ts +47 -0
  199. package/lib/typescript/src/components/customNumberPad/types.d.ts.map +1 -0
  200. package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts +16 -0
  201. package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts.map +1 -0
  202. package/lib/typescript/src/components/customNumberPad/utils.d.ts +4 -0
  203. package/lib/typescript/src/components/customNumberPad/utils.d.ts.map +1 -0
  204. package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts +16 -0
  205. package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts.map +1 -0
  206. package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts +23 -0
  207. package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts.map +1 -0
  208. package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts +21 -0
  209. package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts.map +1 -0
  210. package/lib/typescript/src/components/customSlideTabs/index.d.ts +5 -0
  211. package/lib/typescript/src/components/customSlideTabs/index.d.ts.map +1 -0
  212. package/lib/typescript/src/components/customSlideTabs/styles.d.ts +130 -0
  213. package/lib/typescript/src/components/customSlideTabs/styles.d.ts.map +1 -0
  214. package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts +15 -0
  215. package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts.map +1 -0
  216. package/lib/typescript/src/components/customSlideTabs/types.d.ts +68 -0
  217. package/lib/typescript/src/components/customSlideTabs/types.d.ts.map +1 -0
  218. package/lib/typescript/src/components/loading/index.d.ts +7 -0
  219. package/lib/typescript/src/components/loading/index.d.ts.map +1 -0
  220. package/lib/typescript/src/customFunctions/array.d.ts +7 -0
  221. package/lib/typescript/src/customFunctions/array.d.ts.map +1 -0
  222. package/lib/typescript/src/customFunctions/async.d.ts +9 -0
  223. package/lib/typescript/src/customFunctions/async.d.ts.map +1 -0
  224. package/lib/typescript/src/customFunctions/date.d.ts +18 -0
  225. package/lib/typescript/src/customFunctions/date.d.ts.map +1 -0
  226. package/lib/typescript/src/customFunctions/general.d.ts +7 -0
  227. package/lib/typescript/src/customFunctions/general.d.ts.map +1 -0
  228. package/lib/typescript/src/customFunctions/id.d.ts +4 -0
  229. package/lib/typescript/src/customFunctions/id.d.ts.map +1 -0
  230. package/lib/typescript/src/customFunctions/index.d.ts +26 -0
  231. package/lib/typescript/src/customFunctions/index.d.ts.map +1 -0
  232. package/lib/typescript/src/customFunctions/number.d.ts +15 -0
  233. package/lib/typescript/src/customFunctions/number.d.ts.map +1 -0
  234. package/lib/typescript/src/customFunctions/object.d.ts +6 -0
  235. package/lib/typescript/src/customFunctions/object.d.ts.map +1 -0
  236. package/lib/typescript/src/customFunctions/string.d.ts +20 -0
  237. package/lib/typescript/src/customFunctions/string.d.ts.map +1 -0
  238. package/lib/typescript/src/customFunctions/types.d.ts +22 -0
  239. package/lib/typescript/src/customFunctions/types.d.ts.map +1 -0
  240. package/lib/typescript/src/customFunctions/validation.d.ts +11 -0
  241. package/lib/typescript/src/customFunctions/validation.d.ts.map +1 -0
  242. package/lib/typescript/src/customHooks/errors.d.ts +16 -0
  243. package/lib/typescript/src/customHooks/errors.d.ts.map +1 -0
  244. package/lib/typescript/src/customHooks/fetchJson.d.ts +5 -0
  245. package/lib/typescript/src/customHooks/fetchJson.d.ts.map +1 -0
  246. package/lib/typescript/src/customHooks/index.d.ts +9 -0
  247. package/lib/typescript/src/customHooks/index.d.ts.map +1 -0
  248. package/lib/typescript/src/customHooks/internal.d.ts +12 -0
  249. package/lib/typescript/src/customHooks/internal.d.ts.map +1 -0
  250. package/lib/typescript/src/customHooks/types.d.ts +49 -0
  251. package/lib/typescript/src/customHooks/types.d.ts.map +1 -0
  252. package/lib/typescript/src/customHooks/useApi.d.ts +13 -0
  253. package/lib/typescript/src/customHooks/useApi.d.ts.map +1 -0
  254. package/lib/typescript/src/customHooks/useLazyApi.d.ts +14 -0
  255. package/lib/typescript/src/customHooks/useLazyApi.d.ts.map +1 -0
  256. package/lib/typescript/src/customHooks/useMutation.d.ts +15 -0
  257. package/lib/typescript/src/customHooks/useMutation.d.ts.map +1 -0
  258. package/lib/typescript/src/customHooks/usePaginatedApi.d.ts +19 -0
  259. package/lib/typescript/src/customHooks/usePaginatedApi.d.ts.map +1 -0
  260. package/lib/typescript/src/customHooks/usePollingApi.d.ts +13 -0
  261. package/lib/typescript/src/customHooks/usePollingApi.d.ts.map +1 -0
  262. package/lib/typescript/src/index.d.ts +11 -0
  263. package/lib/typescript/src/index.d.ts.map +1 -0
  264. package/lib/typescript/src/multiply.d.ts +2 -0
  265. package/lib/typescript/src/multiply.d.ts.map +1 -0
  266. package/package.json +181 -0
  267. package/src/assets/images/close.png +0 -0
  268. package/src/components/CustomCheckbox/index.tsx +143 -0
  269. package/src/components/CustomCheckbox/styles.ts +146 -0
  270. package/src/components/CustomCheckbox/types.ts +33 -0
  271. package/src/components/closeButton/index.tsx +40 -0
  272. package/src/components/closeButton/types.ts +13 -0
  273. package/src/components/customButton/index.tsx +288 -0
  274. package/src/components/customButton/styles.ts +247 -0
  275. package/src/components/customButton/types.ts +71 -0
  276. package/src/components/customDropDown/DropDownBottomSheet.tsx +70 -0
  277. package/src/components/customDropDown/DropDownList.tsx +88 -0
  278. package/src/components/customDropDown/DropDownListItem.tsx +74 -0
  279. package/src/components/customDropDown/DropDownListModal.tsx +86 -0
  280. package/src/components/customDropDown/index.tsx +213 -0
  281. package/src/components/customDropDown/styles.ts +184 -0
  282. package/src/components/customDropDown/types.ts +48 -0
  283. package/src/components/customDropDown/utils.ts +24 -0
  284. package/src/components/customList/ListEmpty.tsx +36 -0
  285. package/src/components/customList/ListFooterLoader.tsx +11 -0
  286. package/src/components/customList/defaultKeyExtractor.ts +7 -0
  287. package/src/components/customList/getFlashList.ts +26 -0
  288. package/src/components/customList/index.tsx +142 -0
  289. package/src/components/customList/styles.ts +43 -0
  290. package/src/components/customList/types.ts +60 -0
  291. package/src/components/customModal/ModalFooter.tsx +57 -0
  292. package/src/components/customModal/index.tsx +166 -0
  293. package/src/components/customModal/styles.ts +131 -0
  294. package/src/components/customModal/types.ts +48 -0
  295. package/src/components/customModal/useCustomModal.ts +25 -0
  296. package/src/components/customNumberPad/NumberPadKey.tsx +81 -0
  297. package/src/components/customNumberPad/index.tsx +204 -0
  298. package/src/components/customNumberPad/styles.ts +146 -0
  299. package/src/components/customNumberPad/types.ts +53 -0
  300. package/src/components/customNumberPad/useNumberPadInput.ts +56 -0
  301. package/src/components/customNumberPad/utils.ts +54 -0
  302. package/src/components/customSlideTabs/AnimatedTabIndicator.tsx +103 -0
  303. package/src/components/customSlideTabs/TabBarItem.tsx +118 -0
  304. package/src/components/customSlideTabs/TabScene.tsx +136 -0
  305. package/src/components/customSlideTabs/index.tsx +385 -0
  306. package/src/components/customSlideTabs/styles.ts +136 -0
  307. package/src/components/customSlideTabs/tabBarScroll.ts +92 -0
  308. package/src/components/customSlideTabs/types.ts +87 -0
  309. package/src/components/loading/index.tsx +34 -0
  310. package/src/customFunctions/array.ts +83 -0
  311. package/src/customFunctions/async.ts +85 -0
  312. package/src/customFunctions/date.ts +158 -0
  313. package/src/customFunctions/general.ts +35 -0
  314. package/src/customFunctions/id.ts +25 -0
  315. package/src/customFunctions/index.ts +91 -0
  316. package/src/customFunctions/number.ts +139 -0
  317. package/src/customFunctions/object.ts +59 -0
  318. package/src/customFunctions/string.ts +119 -0
  319. package/src/customFunctions/types.ts +25 -0
  320. package/src/customFunctions/validation.ts +49 -0
  321. package/src/customHooks/errors.ts +87 -0
  322. package/src/customHooks/fetchJson.ts +49 -0
  323. package/src/customHooks/index.ts +20 -0
  324. package/src/customHooks/internal.ts +67 -0
  325. package/src/customHooks/types.ts +71 -0
  326. package/src/customHooks/useApi.ts +107 -0
  327. package/src/customHooks/useLazyApi.ts +92 -0
  328. package/src/customHooks/useMutation.ts +97 -0
  329. package/src/customHooks/usePaginatedApi.ts +168 -0
  330. package/src/customHooks/usePollingApi.ts +48 -0
  331. package/src/index.tsx +63 -0
  332. package/src/multiply.tsx +3 -0
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet } from 'react-native';
4
+ export const styles = StyleSheet.create({
5
+ container: {
6
+ flex: 1
7
+ },
8
+ tabBar: {
9
+ flexGrow: 0,
10
+ position: 'relative',
11
+ overflow: 'hidden'
12
+ },
13
+ tabBarContent: {
14
+ paddingHorizontal: 12,
15
+ gap: 8
16
+ },
17
+ tabItem: {
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ paddingHorizontal: 14,
21
+ paddingVertical: 10,
22
+ minWidth: 88,
23
+ zIndex: 1
24
+ },
25
+ tabItemTransparent: {
26
+ backgroundColor: 'transparent'
27
+ },
28
+ tabItemActive: {
29
+ backgroundColor: '#E7F1FF',
30
+ borderRadius: 10
31
+ },
32
+ tabContent: {
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ gap: 8
36
+ },
37
+ tabImage: {
38
+ width: 18,
39
+ height: 18,
40
+ opacity: 0.7
41
+ },
42
+ tabImageActive: {
43
+ opacity: 1
44
+ },
45
+ tabText: {
46
+ fontSize: 13,
47
+ fontWeight: '600',
48
+ color: '#6C757D',
49
+ textTransform: 'uppercase',
50
+ letterSpacing: 0.4
51
+ },
52
+ tabTextActive: {
53
+ color: '#0D6EFD'
54
+ },
55
+ underline: {
56
+ marginTop: 8,
57
+ height: 3,
58
+ width: '100%',
59
+ borderRadius: 2,
60
+ backgroundColor: '#0D6EFD'
61
+ },
62
+ indicatorPill: {
63
+ position: 'absolute',
64
+ top: 6,
65
+ bottom: 6,
66
+ borderRadius: 10,
67
+ backgroundColor: '#E7F1FF',
68
+ zIndex: 0
69
+ },
70
+ indicatorUnderline: {
71
+ position: 'absolute',
72
+ bottom: 0,
73
+ height: 3,
74
+ borderRadius: 2,
75
+ backgroundColor: '#0D6EFD',
76
+ zIndex: 2
77
+ },
78
+ badge: {
79
+ minWidth: 18,
80
+ height: 18,
81
+ borderRadius: 9,
82
+ paddingHorizontal: 5,
83
+ alignItems: 'center',
84
+ justifyContent: 'center',
85
+ backgroundColor: '#DC3545'
86
+ },
87
+ badgeText: {
88
+ fontSize: 10,
89
+ fontWeight: '700',
90
+ color: '#FFFFFF'
91
+ },
92
+ pager: {
93
+ flex: 1
94
+ },
95
+ scene: {
96
+ flex: 1
97
+ },
98
+ scenePlaceholder: {
99
+ flex: 1,
100
+ alignItems: 'center',
101
+ justifyContent: 'center',
102
+ padding: 20
103
+ },
104
+ scenePlaceholderText: {
105
+ fontSize: 14,
106
+ color: '#6C757D'
107
+ },
108
+ sceneHeader: {
109
+ gap: 4,
110
+ marginBottom: 12
111
+ },
112
+ sceneHeading: {
113
+ fontSize: 20,
114
+ fontWeight: '700',
115
+ color: '#212529'
116
+ },
117
+ sceneSubtitle: {
118
+ fontSize: 14,
119
+ color: '#6C757D',
120
+ lineHeight: 20
121
+ }
122
+ });
123
+ export const defaultTheme = {
124
+ tabItem: styles.tabItem,
125
+ tabItemActive: styles.tabItemActive,
126
+ tabImage: styles.tabImage,
127
+ tabImageActive: styles.tabImageActive,
128
+ tabText: styles.tabText,
129
+ tabTextActive: styles.tabTextActive,
130
+ underline: styles.underline
131
+ };
132
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","styles","create","container","flex","tabBar","flexGrow","position","overflow","tabBarContent","paddingHorizontal","gap","tabItem","alignItems","justifyContent","paddingVertical","minWidth","zIndex","tabItemTransparent","backgroundColor","tabItemActive","borderRadius","tabContent","flexDirection","tabImage","width","height","opacity","tabImageActive","tabText","fontSize","fontWeight","color","textTransform","letterSpacing","tabTextActive","underline","marginTop","indicatorPill","top","bottom","indicatorUnderline","badge","badgeText","pager","scene","scenePlaceholder","padding","scenePlaceholderText","sceneHeader","marginBottom","sceneHeading","sceneSubtitle","lineHeight","defaultThe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S;IAChBqB,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,OAAO,MAAMC,YAAY,GAAG;EAC1B1C,OAAO,EAAEX,MAAM,CAACW,OAAoB;EACpCQ,aAAa,EAAEnB,MAAM,CAACmB,aAA0B;EAChDI,QAAQ,EAAEvB,MAAM,CAACuB,QAAsB;EACvCI,cAAc,EAAE3B,MAAM,CAAC2B,cAA4B;EACnDC,OAAO,EAAE5B,MAAM,CAAC4B,OAAoB;EACpCM,aAAa,EAAElC,MAAM,CAACkC,aAA0B;EAChDC,SAAS,EAAEnC,MAAM,CAACmC;AACpB,CAAC","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ export const TAB_BAR_HORIZONTAL_PADDING = 12;
4
+ export const TAB_BAR_ITEM_GAP = 8;
5
+ export const buildTabLayoutMetrics = widths => {
6
+ let offset = TAB_BAR_HORIZONTAL_PADDING;
7
+ return widths.map(width => {
8
+ const safeWidth = width ?? 0;
9
+ const metric = {
10
+ offset,
11
+ width: safeWidth
12
+ };
13
+ offset += safeWidth + TAB_BAR_ITEM_GAP;
14
+ return metric;
15
+ });
16
+ };
17
+ export const getMaxTabScrollOffset = (metrics, tabBarWidth) => {
18
+ if (metrics.length === 0 || tabBarWidth <= 0) {
19
+ return 0;
20
+ }
21
+ const lastMetric = metrics[metrics.length - 1];
22
+ const contentWidth = lastMetric.offset + lastMetric.width + TAB_BAR_HORIZONTAL_PADDING;
23
+ return Math.max(0, contentWidth - tabBarWidth);
24
+ };
25
+ export const getCenteredTabScrollOffset = (index, metrics, tabBarWidth) => {
26
+ const layout = metrics[index];
27
+ if (!layout?.width || tabBarWidth <= 0) {
28
+ return null;
29
+ }
30
+ const tabCenter = layout.offset + layout.width / 2;
31
+ const maxOffset = getMaxTabScrollOffset(metrics, tabBarWidth);
32
+ return Math.min(maxOffset, Math.max(0, tabCenter - tabBarWidth / 2));
33
+ };
34
+ export const getCenteredTabScrollOffsetFromProgress = (progress, metrics, tabBarWidth) => {
35
+ const {
36
+ left,
37
+ width
38
+ } = getIndicatorAtProgress(progress, metrics);
39
+ if (width <= 0 || tabBarWidth <= 0) {
40
+ return null;
41
+ }
42
+ const tabCenter = left + width / 2;
43
+ const maxOffset = getMaxTabScrollOffset(metrics, tabBarWidth);
44
+ return Math.min(maxOffset, Math.max(0, tabCenter - tabBarWidth / 2));
45
+ };
46
+ export const getIndicatorAtProgress = (progress, metrics) => {
47
+ if (metrics.length === 0) {
48
+ return {
49
+ left: TAB_BAR_HORIZONTAL_PADDING,
50
+ width: 0
51
+ };
52
+ }
53
+ const maxIndex = metrics.length - 1;
54
+ const clampedProgress = Math.max(0, Math.min(progress, maxIndex));
55
+ const baseIndex = Math.min(Math.floor(clampedProgress), maxIndex);
56
+ const nextIndex = Math.min(baseIndex + 1, maxIndex);
57
+ const blend = clampedProgress - baseIndex;
58
+ const current = metrics[baseIndex];
59
+ const next = metrics[nextIndex];
60
+ return {
61
+ left: current.offset + (next.offset - current.offset) * blend,
62
+ width: current.width + (next.width - current.width) * blend
63
+ };
64
+ };
65
+ //# sourceMappingURL=tabBarScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TAB_BAR_HORIZONTAL_PADDING","TAB_BAR_ITEM_GAP","buildTabLayoutMetrics","widths","offset","map","width","safeWidth","metric","getMaxTabScrollOffset","metrics","tabBarWidth","length","lastMetric","contentWidth","Math","max","getCenteredTabScrollOffset","index","layout","tabCenter","maxOffset","min","getCenteredTabScrollOffsetFromProgress","progress","left","getIndicatorAtProgress","maxIndex","clampedProgress","baseIndex","floor","nextIndex","blend","current","next"],"sourceRoot":"../../../../src","sources":["components/customSlideTabs/tabBarScroll.ts"],"mappings":";;AAAA,OAAO,MAAMA,0BAA0B,GAAG,EAAE;AAC5C,OAAO,MAAMC,gBAAgB,GAAG,CAAC;AAOjC,OAAO,MAAMC,qBAAqB,GAChCC,MAAiC,IACX;EACtB,IAAIC,MAAM,GAAGJ,0BAA0B;EAEvC,OAAOG,MAAM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AAEQ,OAAO,CAAC7B,MAAM,GAAG,CAAC8B,IAAI,CAAC9B,MAAM,GAAG6B,OAAO,CAAC7B,MAAM,IAAI4B,KAAK;IAC7D1B,KAAK,EAAE2B,OAAO,CAAC3B,KAAK,GAAG,CAAC4B,IAAI,CAAC5B,KAAK,GAAG2B,OAAO,CAAC3B,KAAK,IAAI0B;EACxD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/customSlideTabs/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import { ActivityIndicator, StyleSheet, View } from 'react-native';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const Loader = ({
6
+ small = false,
7
+ color = 'white'
8
+ }) => {
9
+ return /*#__PURE__*/_jsx(View, {
10
+ style: styles.container,
11
+ children: small ? /*#__PURE__*/_jsx(ActivityIndicator, {
12
+ color: color,
13
+ size: 'small'
14
+ }) : /*#__PURE__*/_jsx(ActivityIndicator, {
15
+ color: color,
16
+ size: 'large'
17
+ })
18
+ });
19
+ };
20
+ export default Loader;
21
+ const styles = StyleSheet.create({
22
+ container: {
23
+ position: 'absolute',
24
+ top: 0,
25
+ bottom: 0,
26
+ right: 0,
27
+ left: 0,
28
+ backgroundColor: '#00000061',
29
+ justifyContent: 'center',
30
+ alignItems: 'center',
31
+ zIndex: 1
32
+ }
33
+ });
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ActivityIndicator","StyleSheet","View","jsx","_jsx","Loader","small","color","style","styles","container","children","size","create","position","top","bottom","right","left","backgroundColor","justifyContent","alignItems","zIndex"],"sourceRoot":"../../../../src","sources":["components/loading/index.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOnE,MAAMC,MAAM,GAAGA,CAAC;EAAEC,KAAK,GAAG,KAAK;EAAEC,KAAK,GAAG;AAAe,CAAC,KAAK;EAC5D,oBACEH,IAAA,CAACF,IAAI;IAACM,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,EAC3BL,KAAK,gBACJF,IAAA,CAACJ,iBAAiB;MAACO,KAAK,EAAEA,KAAM;MAACK,IAAI,EAAE;IAAQ,CAAE,CAAC,gBAElDR,IAAA,CAACJ,iBAAiB;MAACO,KAAK,EAAEA,KAAM;MAACK,IAAI,EAAE;IAAQ,CAAE;EAClD,CACG,CAAC;AAEX,CAAC;AAED,eAAeP,MAAM;AAErB,MAAMI,MAAM,GAAGR,UAAU,CAACY,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,CAAC;IACRC,IAAI,EAAE,CAAC;IACPC,eAAe,EAAE,WAAW;IAC5BC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ export const groupBy = (items, getKey) => {
4
+ return items.reduce((acc, item) => {
5
+ const key = getKey(item);
6
+ if (!acc[key]) {
7
+ acc[key] = [];
8
+ }
9
+ acc[key].push(item);
10
+ return acc;
11
+ }, {});
12
+ };
13
+ export const chunk = (items, size) => {
14
+ if (size <= 0) {
15
+ return [];
16
+ }
17
+ const chunks = [];
18
+ for (let index = 0; index < items.length; index += size) {
19
+ chunks.push(items.slice(index, index + size));
20
+ }
21
+ return chunks;
22
+ };
23
+ export const sortBy = (items, selector, direction = 'asc') => {
24
+ const multiplier = direction === 'asc' ? 1 : -1;
25
+ return [...items].sort((left, right) => {
26
+ const leftValue = selector(left);
27
+ const rightValue = selector(right);
28
+ if (leftValue < rightValue) {
29
+ return -1 * multiplier;
30
+ }
31
+ if (leftValue > rightValue) {
32
+ return 1 * multiplier;
33
+ }
34
+ return 0;
35
+ });
36
+ };
37
+ export const uniqueBy = (items, selector) => {
38
+ const seen = new Set();
39
+ const result = [];
40
+ for (const item of items) {
41
+ const key = selector(item);
42
+ if (!seen.has(key)) {
43
+ seen.add(key);
44
+ result.push(item);
45
+ }
46
+ }
47
+ return result;
48
+ };
49
+ export const flatten = items => items.flat();
50
+ export const shuffle = items => {
51
+ const copy = [...items];
52
+ for (let index = copy.length - 1; index > 0; index -= 1) {
53
+ const randomIndex = Math.floor(Math.random() * (index + 1));
54
+ const current = copy[index];
55
+ const swap = copy[randomIndex];
56
+ copy[index] = swap;
57
+ copy[randomIndex] = current;
58
+ }
59
+ return copy;
60
+ };
61
+ //# sourceMappingURL=array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["groupBy","items","getKey","reduce","acc","item","key","push","chunk","size","chunks","index","length","slice","sortBy","selector","direction","multiplier","sort","left","right","leftValue","rightValue","uniqueBy","seen","Set","result","has","add","flatten","flat","shuffle","copy","randomIndex","Math","floor","random","current","swap"],"sourceRoot":"../../../src","sources":["customFunctions/array.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAGA,CACrBC,KAAU,EACVC,MAAsB,KACH;EACnB,OAAOD,KAAK,CAACE,MAAM,CACjB,CAACC,GAAG,EAAEC,IAAI,KAAK;IACb,MAAMC,GAAG,GAAGJ,MAAM,CAACG,IAAI,CAAC;IACxB,IAAI,CAACD,GAAG,CAACE,GAAG,CAAC,EAAE;MACbF,GAAG,CAACE,GAAG,CAAC,GAAG,EAAE;IACf;IACAF,GAAG,CAACE,GAAG,CAAC,CAACC,IAAI,CAACF,IAAI,CAAC;IACnB,OAAOD,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH,CAAC;AAED,OAAO,MAAMI,KAAK,GAAGA,CAAIP,KA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AE;MAClBkB,IAAI,CAACI,GAAG,CAACtB,GAAG,CAAC;MACboB,MAAM,CAACnB,IAAI,CAACF,IAAI,CAAC;IACnB;EACF;EAEA,OAAOqB,MAAM;AACf,CAAC;AAED,OAAO,MAAMG,OAAO,GAAO5B,KAAqB,IAAUA,KAAK,CAAC6B,IAAI,CAAC,CAAQ;AAE7E,OAAO,MAAMC,OAAO,GAAO9B,KAAU,IAAU;EAC7C,MAAM+B,IAAI,GAAG,CAAC,GAAG/B,KAAK,CAAC;EAEvB,KAAK,IAAIU,KAAK,GAAGqB,IAAI,CAACpB,MAAM,GAAG,CAAC,EAAED,KAAK,GAAG,CAAC,EAAEA,KAAK,IAAI,CAAC,EAAE;IACvD,MAAMsB,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,IAAIzB,KAAK,GAAG,CAAC,CAAC,CAAC;IAC3D,MAAM0B,OAAO,GAAGL,IAAI,CAACrB,KAAK,CAAM;IAChC,MAAM2B,IAAI,GAAGN,IAAI,CAACC,WAAW,CAAM;IACnCD,IAAI,CAACrB,KAAK,CAAC,GAAG2B,IAAI;IAClBN,IAAI,CAACC,WAAW,CAAC,GAAGI,OAAO;EAC7B;EAEA,OAAOL,IAAI;AACb,CAAC","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ export const sleep = ms => new Promise(resolve => {
4
+ setTimeout(resolve, ms);
5
+ });
6
+ export const debounce = (fn, delayMs) => {
7
+ let timeoutId;
8
+ const debounced = (...args) => {
9
+ if (timeoutId) {
10
+ clearTimeout(timeoutId);
11
+ }
12
+ timeoutId = setTimeout(() => {
13
+ fn(...args);
14
+ }, delayMs);
15
+ };
16
+ debounced.cancel = () => {
17
+ if (timeoutId) {
18
+ clearTimeout(timeoutId);
19
+ timeoutId = undefined;
20
+ }
21
+ };
22
+ return debounced;
23
+ };
24
+ export const throttle = (fn, intervalMs) => {
25
+ let lastCall = 0;
26
+ let timeoutId;
27
+ return (...args) => {
28
+ const now = Date.now();
29
+ const remaining = intervalMs - (now - lastCall);
30
+ if (remaining <= 0) {
31
+ if (timeoutId) {
32
+ clearTimeout(timeoutId);
33
+ timeoutId = undefined;
34
+ }
35
+ lastCall = now;
36
+ fn(...args);
37
+ return;
38
+ }
39
+ if (!timeoutId) {
40
+ timeoutId = setTimeout(() => {
41
+ lastCall = Date.now();
42
+ timeoutId = undefined;
43
+ fn(...args);
44
+ }, remaining);
45
+ }
46
+ };
47
+ };
48
+ export const tryParseJson = (value, fallback = null) => {
49
+ try {
50
+ return JSON.parse(value);
51
+ } catch {
52
+ return fallback;
53
+ }
54
+ };
55
+ export const safeStringify = (value, space = 2, fallback = '') => {
56
+ try {
57
+ return JSON.stringify(value, null, space);
58
+ } catch {
59
+ return fallback;
60
+ }
61
+ };
62
+ //# sourceMappingURL=async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sleep","ms","Promise","resolve","setTimeout","debounce","fn","delayMs","timeoutId","debounced","args","clearTimeout","cancel","undefined","throttle","intervalMs","lastCall","now","Date","remaining","tryParseJson","value","fallback","JSON","parse","safeStringify","space","stringify"],"sourceRoot":"../../../src","sources":["customFunctions/async.ts"],"mappings":";;AAAA,OAAO,MAAMA,KAAK,GAAIC,EAAU,IAC9B,IAAIC,OAAO,CAAEC,OAAO,IAAK;EACvBC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC;AACzB,CAAC,CAAC;AAEJ,OAAO,MAAMI,QAAQ,GAAGA,CACtBC,EAAK,EACLC,OAAe,KACZ;EACH,IAAIC,SAAoD;EAExD,MAAMC,SAAS,GAAGA,CAAC,GAAGC,IAAmB,KAAK;IAC5C,IAAIF,SAAS,EAAE;MACbG,YAAY,CAACH,SAAS,CAAC;IACzB;IAEAA,SAAS,GAAGJ,UAAU,CAAC,MAAM;MAC3BE,EAAE,CAAC,GAAGI,IAAI,CAAC;IACb,CAAC,EAAEH,OAAO,CAAC;EACb,CAAC;EAEDE,SAAS,CA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AAI,EAAEK,KAAK,CAAC;EAC3C,CAAC,CAAC,MAAM;IACN,OAAOJ,QAAQ;EACjB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ export const formatDateYYYYMMDD = (date = new Date()) => {
4
+ const year = date.getFullYear();
5
+ const month = String(date.getMonth() + 1).padStart(2, '0');
6
+ const day = String(date.getDate()).padStart(2, '0');
7
+ return `${year}-${month}-${day}`;
8
+ };
9
+ export const getIsoTimeWithoutMilliseconds = (date = new Date()) => `${date.toISOString().split('.')[0]}Z`;
10
+ export const isOlderThanHours = (timestamp, hours = 24) => {
11
+ const diffMs = Math.abs(Date.now() - Number(timestamp));
12
+ const diffHours = diffMs / (1000 * 60 * 60);
13
+ return diffHours >= hours;
14
+ };
15
+ export const formatTimestampTo12Hour = timestampMs => {
16
+ const date = new Date(Number(timestampMs));
17
+ let hours = date.getHours();
18
+ const minutes = String(date.getMinutes()).padStart(2, '0');
19
+ const seconds = String(date.getSeconds()).padStart(2, '0');
20
+ const meridiem = hours >= 12 ? 'pm' : 'am';
21
+ hours %= 12;
22
+ if (hours === 0) {
23
+ hours = 12;
24
+ }
25
+ return `${hours}:${minutes}:${seconds} ${meridiem}`;
26
+ };
27
+ export const formatDateTimeLocalized = (date = new Date(), options = {}) => {
28
+ const englishLocale = options.englishLocale ?? 'en-GB';
29
+ const frenchLocale = options.frenchLocale ?? 'fr-FR';
30
+ const englishDate = new Intl.DateTimeFormat(englishLocale, {
31
+ day: 'numeric',
32
+ month: 'short',
33
+ year: 'numeric',
34
+ hour: 'numeric',
35
+ minute: '2-digit',
36
+ hour12: true
37
+ }).format(date);
38
+ const frenchDate = new Intl.DateTimeFormat(frenchLocale, {
39
+ day: 'numeric',
40
+ month: 'long',
41
+ year: 'numeric',
42
+ hour: 'numeric',
43
+ minute: '2-digit',
44
+ hour12: false
45
+ }).format(date);
46
+ return {
47
+ englishDate,
48
+ frenchDate
49
+ };
50
+ };
51
+ export const parseCompactDateTime = dateString => {
52
+ const year = dateString.slice(0, 4);
53
+ const month = dateString.slice(4, 6);
54
+ const day = dateString.slice(6, 8);
55
+ const hour = dateString.slice(8, 10);
56
+ const minute = dateString.slice(10, 12);
57
+ const second = dateString.slice(12, 14);
58
+ return `${year}-${month}-${day}T${hour}:${minute}:${second}`;
59
+ };
60
+ export const generateCompactTimestampId = (hoursOffset = 0) => {
61
+ const date = new Date();
62
+ if (hoursOffset !== 0) {
63
+ date.setHours(date.getHours() + hoursOffset);
64
+ }
65
+ return date.toISOString().replace(/[-:]/g, '').replace('T', '').slice(0, 15);
66
+ };
67
+ export const addDays = (date, days) => {
68
+ const next = new Date(date);
69
+ next.setDate(next.getDate() + days);
70
+ return next;
71
+ };
72
+ export const differenceInDays = (from, to) => {
73
+ const msPerDay = 1000 * 60 * 60 * 24;
74
+ const start = new Date(from.getFullYear(), from.getMonth(), from.getDate());
75
+ const end = new Date(to.getFullYear(), to.getMonth(), to.getDate());
76
+ return Math.round((end.getTime() - start.getTime()) / msPerDay);
77
+ };
78
+ export const differenceInMinutes = (from, to) => {
79
+ const start = new Date(from).getTime();
80
+ const end = new Date(to).getTime();
81
+ return Math.round((end - start) / (1000 * 60));
82
+ };
83
+ export const isSameDay = (left, right) => {
84
+ const a = new Date(left);
85
+ const b = new Date(right);
86
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
87
+ };
88
+ export const isToday = date => isSameDay(date, new Date());
89
+ export const formatRelativeTime = (date, now = Date.now()) => {
90
+ const diffMinutes = differenceInMinutes(date, now);
91
+ const absMinutes = Math.abs(diffMinutes);
92
+ const isPast = diffMinutes > 0;
93
+ if (absMinutes < 1) {
94
+ return 'just now';
95
+ }
96
+ if (absMinutes < 60) {
97
+ const label = `${absMinutes} min`;
98
+ return isPast ? `${label} ago` : `in ${label}`;
99
+ }
100
+ const absHours = Math.round(absMinutes / 60);
101
+ if (absHours < 24) {
102
+ const label = `${absHours} hour${absHours === 1 ? '' : 's'}`;
103
+ return isPast ? `${label} ago` : `in ${label}`;
104
+ }
105
+ const absDays = Math.round(absHours / 24);
106
+ const label = `${absDays} day${absDays === 1 ? '' : 's'}`;
107
+ return isPast ? `${label} ago` : `in ${label}`;
108
+ };
109
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["formatDateYYYYMMDD","date","Date","year","getFullYear","month","String","getMonth","padStart","day","getDate","getIsoTimeWithoutMilliseconds","toISOString","split","isOlderThanHours","timestamp","hours","diffMs","Math","abs","now","Number","diffHours","formatTimestampTo12Hour","timestampMs","getHours","minutes","getMinutes","seconds","getSeconds","meridiem","formatDateTimeLocalized","options","englishLocale","frenchLocale","englishDate","Intl","DateTimeFormat","hour","minute","hour12","format","frenchDate","parseCompactDateTime","dateString","slice","second","generateCompactTimestampId","hoursOffset","setHours","replace","addDays","days","next","setDate","differenceInDays","from","to","msPerDay","start","end","round","getTime","differenceInMinutes","isSameDay","left","right","a","b","isToday","formatRelativeTime","diffMinutes","absMinutes","isPast","label","absHours","absDays"],"sourceRoot":"../../../src","sources":["customFunctions/date.ts"],"mappings":";;AAEA,OAAO,MAAMA,kBAAkB,GAAGA,CAACC,IAAU,GAAG,IAAIC,IAAI,CAAC,CAAC,KAAa;EACrE,MAAMC,IAAI,GAAGF,IAAI,CAACG,WAAW,CAAC,CAAC;EAC/B,MAAMC,KAAK,GAAGC,MAAM,CAACL,IAAI,CAACM,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAC1D,MAAMC,GAAG,GAAGH,MAAM,CAACL,IAAI,CAACS,OAAO,CAAC,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEnD,OAAO,GAAGL,IAAI,IAAIE,KAAK,IAAII,GAAG,EAAE;AAClC,CAAC;AAED,OAAO,MAAME,6BAA6B,GAAGA,CAC3CV,IAAU,GAAG,IAAIC,IAAI,CAA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MoD,UAAU,GAAGtD,IAAI,CAACC,GAAG,CAACoD,WAAW,CAAC;EACxC,MAAME,MAAM,GAAGF,WAAW,GAAG,CAAC;EAE9B,IAAIC,UAAU,GAAG,CAAC,EAAE;IAClB,OAAO,UAAU;EACnB;EAEA,IAAIA,UAAU,GAAG,EAAE,EAAE;IACnB,MAAME,KAAK,GAAG,GAAGF,UAAU,MAAM;IACjC,OAAOC,MAAM,GAAG,GAAGC,KAAK,MAAM,GAAG,MAAMA,KAAK,EAAE;EAChD;EAEA,MAAMC,QAAQ,GAAGzD,IAAI,CAAC2C,KAAK,CAACW,UAAU,GAAG,EAAE,CAAC;EAC5C,IAAIG,QAAQ,GAAG,EAAE,EAAE;IACjB,MAAMD,KAAK,GAAG,GAAGC,QAAQ,QAAQA,QAAQ,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE;IAC5D,OAAOF,MAAM,GAAG,GAAGC,KAAK,MAAM,GAAG,MAAMA,KAAK,EAAE;EAChD;EAEA,MAAME,OAAO,GAAG1D,IAAI,CAAC2C,KAAK,CAACc,QAAQ,GAAG,EAAE,CAAC;EACzC,MAAMD,KAAK,GAAG,GAAGE,OAAO,OAAOA,OAAO,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE;EACzD,OAAOH,MAAM,GAAG,GAAGC,KAAK,MAAM,GAAG,MAAMA,KAAK,EAAE;AAChD,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ export const logger = ({
4
+ msg = '',
5
+ data
6
+ }) => {
7
+ console.log(`------------------------${msg}------------------------`);
8
+ console.log(data);
9
+ console.log('------------------------------------------------------');
10
+ };
11
+ export const isNullish = value => value === null || value === undefined;
12
+ export const isEmpty = value => {
13
+ if (isNullish(value)) {
14
+ return true;
15
+ }
16
+ if (typeof value === 'string') {
17
+ return value.trim().length === 0;
18
+ }
19
+ if (Array.isArray(value)) {
20
+ return value.length === 0;
21
+ }
22
+ if (typeof value === 'object') {
23
+ return Object.keys(value).length === 0;
24
+ }
25
+ return false;
26
+ };
27
+ export const isDefined = value => value !== null && value !== undefined;
28
+ export const noop = () => {};
29
+ //# sourceMappingURL=general.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["logger","msg","data","console","log","isNullish","value","undefined","isEmpty","trim","length","Array","isArray","Object","keys","isDefined","noop"],"sourceRoot":"../../../src","sources":["customFunctions/general.ts"],"mappings":";;AAEA,OAAO,MAAMA,MAAM,GAAGA,CAAC;EAAEC,GAAG,GAAG,EAAE;EAAEC;AAAoB,CAAC,KAAK;EAC3DC,OAAO,CAACC,GAAG,CAAC,2BAA2BH,GAAG,0BAA0B,CAAC;EACrEE,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC;EACjBC,OAAO,CAACC,GAAG,CAAC,wDAAwD,CAAC;AACvE,CAAC;AAED,OAAO,MAAMC,SAAS,GAAIC,KAAc,IACtCA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS;AAEvC,OAAO,MAAMC,OAAO,GAAIF,KAAc,IAAc;EAClD,IAAID,SAAS,CAACC,KAAK,CAAC,EAAE;IACpB,OAAO,IAAI;EACb;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOA,KAAK,CAACG,IAAI,CAAC,CAAC,CAACC,MAAM,KAAK,CAAC;EAClC;EAEA,IAAIC,KAAK,CAACC,OAAO,CAACN,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACI,MAAM,KAAK,CAAC;EAC3B;EAEA,IAAI,OAAOJ,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOO,MAAM,CAACC,IAAI,CAACR,KAAK,CAAC,CAACI,MAAM,KAAK,CAAC;EACxC;EAEA,OAAO,KAAK;AACd,CAAC;AAED,OAAO,MAAMK,SAAS,GAAOT,KAA2B,IACtDA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS;AAEvC,OAAO,MAAMS,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ const ALPHANUMERIC_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789';
4
+ export const generateRandomAlphanumeric = (length = 10) => {
5
+ let id = '';
6
+ for (let i = 0; i < length; i += 1) {
7
+ id += ALPHANUMERIC_CHARS.charAt(Math.floor(Math.random() * ALPHANUMERIC_CHARS.length));
8
+ }
9
+ return id;
10
+ };
11
+ export const generateSessionId = (randomLength = 29) => {
12
+ const prefix = Date.now();
13
+ return `${prefix}_${generateRandomAlphanumeric(randomLength)}`;
14
+ };
15
+ export const generateUuid = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, char => {
16
+ const random = Math.floor(Math.random() * 16);
17
+ const value = char === 'x' ? random : random & 0x3 | 0x8;
18
+ return value.toString(16);
19
+ });
20
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ALPHANUMERIC_CHARS","generateRandomAlphanumeric","length","id","i","charAt","Math","floor","random","generateSessionId","randomLength","prefix","Date","now","generateUuid","replace","char","value","toString"],"sourceRoot":"../../../src","sources":["customFunctions/id.ts"],"mappings":";;AAAA,MAAMA,kBAAkB,GAAG,sCAAsC;AAEjE,OAAO,MAAMC,0BAA0B,GAAGA,CAACC,MAAM,GAAG,EAAE,KAAa;EACjE,IAAIC,EAAE,GAAG,EAAE;EAEX,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,EAAEE,CAAC,IAAI,CAAC,EAAE;IAClCD,EAAE,IAAIH,kBAAkB,CAACK,MAAM,CAC7BC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAGR,kBAAkB,CAACE,MAAM,CACtD,CAAC;EACH;EAEA,OAAOC,EAAE;AACX,CAAC;AAED,OAAO,MAAMM,iBAAiB,GAAGA,CAACC,YAAY,GAAG,EAAE,KAAa;EAC9D,MAAMC,MAAM,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACzB,OAAO,GAAGF,MAAM,IAAIV,0BAA0B,CAACS,YAAY,CAAC,EAAE;AAChE,CAAC;AAED,OAAO,MAAMI,YAAY,GAAGA,CAAA,KAC1B,sCAAsC,CAACC,OAAO,CAAC,OAAO,EAAGC,IAAI,IAAK;EAChE,MAAMR,MAAM,GAAGF,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;EAC7C,MAAMS,KAAK,GAAGD,IAAI,KAAK,GAAG,GAAGR,MAAM,GAAIA,MAAM,GAAG,GAAG,GAAI,GAAG;EAC1D,OAAOS,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC;AAC3B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ export { chunk, flatten, groupBy, shuffle, sortBy, uniqueBy } from "./array.js";
4
+ export { debounce, safeStringify, sleep, throttle, tryParseJson } from "./async.js";
5
+ export { addDays, differenceInDays, differenceInMinutes, formatDateYYYYMMDD, formatDateTimeLocalized, formatRelativeTime, formatTimestampTo12Hour, generateCompactTimestampId, getIsoTimeWithoutMilliseconds, isOlderThanHours, isSameDay, isToday, parseCompactDateTime } from "./date.js";
6
+ export { isDefined, isEmpty, isNullish, logger, noop } from "./general.js";
7
+ export { generateRandomAlphanumeric, generateSessionId, generateUuid } from "./id.js";
8
+ export { average, clamp, formatBytes, formatCurrency, formatDiscountAmount, formatNumberWithCommas, formatPercentage, generateRandomNumberString, parseNumberSafe, percentage, randomInt, roundToDecimals, sum } from "./number.js";
9
+ export { deepClone, getNestedValue, isPlainObject, omit, pick } from "./object.js";
10
+ export { camelToTitle, capitalizeFirst, capitalizeWords, findItemByProperty, getLocalizedSplitText, initialsFromName, maskString, normalizeWhitespace, removeDuplicateStrings, removeDuplicates, slugify, truncate } from "./string.js";
11
+ export { encodePlusInEmail, isNumeric, isStrongPassword, isValidEmail, isValidPhone, isValidUrl } from "./validation.js";
12
+
13
+ // Backward-friendly aliases mapped from the original app helpers
14
+ export { isOlderThanHours as isUpdateAppSession } from "./date.js";
15
+ export { capitalizeFirst as getFirstCap } from "./string.js";
16
+ export { formatCurrency as getFrAmount } from "./number.js";
17
+ export { formatDateYYYYMMDD as getFormattedDate } from "./date.js";
18
+ export { getIsoTimeWithoutMilliseconds as getCurrentTime } from "./date.js";
19
+ export { generateCompactTimestampId as getUniqueId } from "./date.js";
20
+ export { formatTimestampTo12Hour as getLastScannedTime } from "./date.js";
21
+ export { formatDateTimeLocalized as getPrintDate } from "./date.js";
22
+ export { parseCompactDateTime as formatToEST } from "./date.js";
23
+ export { generateRandomAlphanumeric as paymentServiceId } from "./id.js";
24
+ export { generateSessionId as generateAppSessionId } from "./id.js";
25
+ export { generateSessionId as generateUserSessionId } from "./id.js";
26
+ export { generateUuid as generateCartSessionId } from "./id.js";
27
+ export { findItemByProperty as getCurrentScreen } from "./string.js";
28
+ export { getLocalizedSplitText as getTextByLanguage } from "./string.js";
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chunk","flatten","groupBy","shuffle","sortBy","uniqueBy","debounce","safeStringify","sleep","throttle","tryParseJson","addDays","differenceInDays","differenceInMinutes","formatDateYYYYMMDD","formatDateTimeLocalized","formatRelativeTime","formatTimestampTo12Hour","generateCompactTimestampId","getIsoTimeWithoutMilliseconds","isOlderThanHours","isSameDay","isToday","parseCompactDateTime","isDefined","isEmpty","isNullish","logger","noop","generateRandomAlphanumeric","generateSessionId","generateUuid","average","clamp","formatBytes","formatCurrency","formatDiscountAmount","formatNumberWithCommas","formatPercentage","generateRandomNumberString","parseNumberSafe","percentage","randomInt","roundToDecimals","sum","deepClone","getNestedValue","isPlainObject","omit","pick","camelToTitle","capitalizeFirst","capitalizeWords","findItemByProperty","getLocalizedSplitText","initialsFromName","maskString","normalizeWhitespace","removeDuplicateStrings","removeDuplicates","slugify","truncate","encodePlusInEmail","isNumeric","isStrongPassword","isValidEmail","isValidPhone","isValidUrl","isUpdateAppSession","getFirstCap","getFrAmount","getFormattedDate","getCurrentTime","getUniqueId","getLastScannedTime","getPrintDate","formatToEST","paymentServiceId","generateAppSessionId","generateUserSessionId","generateCartSessionId","getCurrentScreen","getTextByLanguage"],"sourceRoot":"../../../src","sources":["customFunctions/index.ts"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,YAAS;AAC5E,SACEC,QAAQ,EACRC,aAAa,EACbC,KAAK,EACLC,QAAQ,EACRC,YAAY,QACP,YAAS;AAChB,SACEC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACnBC,kBAAkB,EAClBC,uBAAuB,EACvBC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,gBAAgB,EAChBC,SAAS,EACTC,OAAO,EACPC,oBAAoB,QACf,WAAQ;AACf,SAASC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAEC,MAAM,EAAEC,IAAI,QAAQ,cAAW;AACvE,SACEC,0BAA0B,EAC1BC,iBAAiB,EACjBC,YAAY,QACP,SAAM;AACb,SACEC,OAAO,EACPC,KAAK,EACLC,WAAW,EACXC,cAAc,EACdC,oBAAoB,EACpBC,sBAAsB,EACtBC,gBAAgB,EAChBC,0BAA0B,EAC1BC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,eAAe,EACfC,GAAG,QACE,aAAU;AACjB,SAASC,SAAS,EAAEC,cAAc,EAAEC,aAAa,EAAEC,IAAI,EAAEC,IAAI,QAAQ,aAAU;AAC/E,SACEC,YAAY,EACZC,eAAe,EACfC,eAAe,EACfC,kBAAkB,EAClBC,qBAAqB,EACrBC,gBAAgB,EAChBC,UAAU,EACVC,mBAAmB,EACnBC,sBAAsB,EACtBC,gBAAgB,EAChBC,OAAO,EACPC,QAAQ,QACH,aA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