@tecsinapse/react-native-kit 1.20.0 → 1.22.0-beta.13

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 (415) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/atoms/Avatar/Avatar.d.ts +2 -1
  3. package/dist/components/atoms/Avatar/Avatar.js +34 -20
  4. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  5. package/dist/components/atoms/Avatar/index.d.ts +1 -1
  6. package/dist/components/atoms/Badge/Badge.js +58 -29
  7. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  8. package/dist/components/atoms/Badge/index.d.ts +2 -1
  9. package/dist/components/atoms/BottomNavigator/BottomNavigator.js +71 -39
  10. package/dist/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
  11. package/dist/components/atoms/BottomNavigator/Item.js +68 -31
  12. package/dist/components/atoms/BottomNavigator/Item.js.map +1 -1
  13. package/dist/components/atoms/BottomNavigator/index.d.ts +3 -2
  14. package/dist/components/atoms/BottomNavigator/styled.js +25 -42
  15. package/dist/components/atoms/BottomNavigator/styled.js.map +1 -1
  16. package/dist/components/atoms/Button/Button.js +55 -23
  17. package/dist/components/atoms/Button/Button.js.map +1 -1
  18. package/dist/components/atoms/Button/States/Error.d.ts +1 -1
  19. package/dist/components/atoms/Button/States/Error.js +34 -22
  20. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  21. package/dist/components/atoms/Button/States/Loading.d.ts +1 -1
  22. package/dist/components/atoms/Button/States/Loading.js +34 -22
  23. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  24. package/dist/components/atoms/Button/States/Success.d.ts +1 -1
  25. package/dist/components/atoms/Button/States/Success.js +34 -22
  26. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  27. package/dist/components/atoms/Button/index.d.ts +2 -1
  28. package/dist/components/atoms/GroupButton/GroupButtonOption.js +34 -21
  29. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  30. package/dist/components/atoms/Header/Header.js +75 -32
  31. package/dist/components/atoms/Header/Header.js.map +1 -1
  32. package/dist/components/atoms/Header/index.d.ts +2 -1
  33. package/dist/components/atoms/Header/styled.js +14 -15
  34. package/dist/components/atoms/Header/styled.js.map +1 -1
  35. package/dist/components/atoms/Input/Input.js +133 -89
  36. package/dist/components/atoms/Input/Input.js.map +1 -1
  37. package/dist/components/atoms/Input/index.d.ts +2 -1
  38. package/dist/components/atoms/Input/styled.js +12 -14
  39. package/dist/components/atoms/Input/styled.js.map +1 -1
  40. package/dist/components/atoms/InputMask/InputMask.js +135 -87
  41. package/dist/components/atoms/InputMask/InputMask.js.map +1 -1
  42. package/dist/components/atoms/InputMask/index.d.ts +2 -1
  43. package/dist/components/atoms/InputMask/styled.js +15 -17
  44. package/dist/components/atoms/InputMask/styled.js.map +1 -1
  45. package/dist/components/atoms/Modal/ModalGroupManager.js +47 -29
  46. package/dist/components/atoms/Modal/ModalGroupManager.js.map +1 -1
  47. package/dist/components/atoms/Modal/ModalLifecycleHandler.js +94 -87
  48. package/dist/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
  49. package/dist/components/atoms/Modal/ui/BaseModalView.js +106 -105
  50. package/dist/components/atoms/Modal/ui/BaseModalView.js.map +1 -1
  51. package/dist/components/atoms/Modal/ui/styled.js +19 -21
  52. package/dist/components/atoms/Modal/ui/styled.js.map +1 -1
  53. package/dist/components/atoms/Modal/useLazyModalManager.js +22 -23
  54. package/dist/components/atoms/Modal/useLazyModalManager.js.map +1 -1
  55. package/dist/components/atoms/Modal/useModalManager.js +14 -19
  56. package/dist/components/atoms/Modal/useModalManager.js.map +1 -1
  57. package/dist/components/atoms/Modal/useModalRemoteControl.js +10 -12
  58. package/dist/components/atoms/Modal/useModalRemoteControl.js.map +1 -1
  59. package/dist/components/atoms/Skeleton/Pulse.js +20 -22
  60. package/dist/components/atoms/Skeleton/Pulse.js.map +1 -1
  61. package/dist/components/atoms/Skeleton/Skeleton.js +77 -55
  62. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
  63. package/dist/components/atoms/Skeleton/Wave.js +36 -40
  64. package/dist/components/atoms/Skeleton/Wave.js.map +1 -1
  65. package/dist/components/atoms/Skeleton/animation.js +29 -29
  66. package/dist/components/atoms/Skeleton/animation.js.map +1 -1
  67. package/dist/components/atoms/Skeleton/index.d.ts +2 -1
  68. package/dist/components/atoms/Skeleton/styled.js +12 -18
  69. package/dist/components/atoms/Skeleton/styled.js.map +1 -1
  70. package/dist/components/atoms/SnappingSlider/SnappingSlider.js +76 -36
  71. package/dist/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
  72. package/dist/components/atoms/SnappingSlider/index.d.ts +2 -1
  73. package/dist/components/atoms/Tag/Tag.js +45 -25
  74. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  75. package/dist/components/atoms/Tag/index.d.ts +2 -1
  76. package/dist/components/atoms/Text/Text.js +38 -15
  77. package/dist/components/atoms/Text/Text.js.map +1 -1
  78. package/dist/components/atoms/Text/index.d.ts +2 -1
  79. package/dist/components/atoms/Text/styled.js +16 -19
  80. package/dist/components/atoms/Text/styled.js.map +1 -1
  81. package/dist/components/atoms/TextArea/TextArea.js +122 -74
  82. package/dist/components/atoms/TextArea/TextArea.js.map +1 -1
  83. package/dist/components/atoms/TextArea/index.d.ts +2 -1
  84. package/dist/components/atoms/TextArea/styled.js +9 -9
  85. package/dist/components/atoms/TextArea/styled.js.map +1 -1
  86. package/dist/components/molecules/Calendar/Calendar.js +54 -25
  87. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  88. package/dist/components/molecules/DatePicker/DatePicker.js +67 -42
  89. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  90. package/dist/components/molecules/DatePicker/index.d.ts +2 -1
  91. package/dist/components/molecules/DatePicker/styled.js +10 -11
  92. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  93. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +61 -34
  94. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  95. package/dist/components/molecules/DateTimePicker/index.d.ts +2 -1
  96. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +54 -25
  97. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  98. package/dist/components/molecules/Grid/Grid.js +79 -42
  99. package/dist/components/molecules/Grid/Grid.js.map +1 -1
  100. package/dist/components/molecules/Grid/Item/Item.js +90 -56
  101. package/dist/components/molecules/Grid/Item/Item.js.map +1 -1
  102. package/dist/components/molecules/IconTextButton/IconTextButton.js +70 -42
  103. package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
  104. package/dist/components/molecules/IconTextButton/TextComponent.js +38 -26
  105. package/dist/components/molecules/IconTextButton/TextComponent.js.map +1 -1
  106. package/dist/components/molecules/IconTextButton/index.d.ts +2 -1
  107. package/dist/components/molecules/IconTextButton/styled.js +22 -31
  108. package/dist/components/molecules/IconTextButton/styled.js.map +1 -1
  109. package/dist/components/molecules/InputPassword/InputPassword.js +60 -37
  110. package/dist/components/molecules/InputPassword/InputPassword.js.map +1 -1
  111. package/dist/components/molecules/InputPassword/index.d.ts +2 -1
  112. package/dist/components/molecules/LabeledSwitch/LabelComponent.js +58 -29
  113. package/dist/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -1
  114. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js +70 -41
  115. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
  116. package/dist/components/molecules/LabeledSwitch/index.d.ts +2 -1
  117. package/dist/components/molecules/LabeledSwitch/styled.js +18 -20
  118. package/dist/components/molecules/LabeledSwitch/styled.js.map +1 -1
  119. package/dist/components/molecules/Select/Modal.js +206 -133
  120. package/dist/components/molecules/Select/Modal.js.map +1 -1
  121. package/dist/components/molecules/Select/Select.js +217 -135
  122. package/dist/components/molecules/Select/Select.js.map +1 -1
  123. package/dist/components/molecules/Select/index.d.ts +2 -1
  124. package/dist/components/molecules/Select/styled.js +54 -83
  125. package/dist/components/molecules/Select/styled.js.map +1 -1
  126. package/dist/components/molecules/Snackbar/Snackbar.d.ts +1 -1
  127. package/dist/components/molecules/Snackbar/Snackbar.js +52 -28
  128. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  129. package/dist/components/molecules/Snackbar/index.d.ts +2 -1
  130. package/dist/components/molecules/Snackbar/styled.js +11 -14
  131. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  132. package/dist/index.d.ts +38 -19
  133. package/dist/index.js +80 -191
  134. package/dist/index.js.map +1 -1
  135. package/dist/utils/date.js +31 -19
  136. package/dist/utils/date.js.map +1 -1
  137. package/esm/components/atoms/Avatar/Avatar.d.ts +4 -0
  138. package/esm/components/atoms/Avatar/Avatar.js +31 -0
  139. package/esm/components/atoms/Avatar/Avatar.js.map +1 -0
  140. package/esm/components/atoms/Avatar/index.d.ts +1 -0
  141. package/esm/components/atoms/Badge/Badge.d.ts +8 -0
  142. package/esm/components/atoms/Badge/Badge.js +56 -0
  143. package/esm/components/atoms/Badge/Badge.js.map +1 -0
  144. package/esm/components/atoms/Badge/index.d.ts +2 -0
  145. package/esm/components/atoms/BottomNavigator/BottomNavigator.d.ts +13 -0
  146. package/esm/components/atoms/BottomNavigator/BottomNavigator.js +61 -0
  147. package/esm/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -0
  148. package/esm/components/atoms/BottomNavigator/Item.d.ts +19 -0
  149. package/esm/components/atoms/BottomNavigator/Item.js +58 -0
  150. package/esm/components/atoms/BottomNavigator/Item.js.map +1 -0
  151. package/esm/components/atoms/BottomNavigator/index.d.ts +3 -0
  152. package/esm/components/atoms/BottomNavigator/styled.d.ts +11 -0
  153. package/esm/components/atoms/BottomNavigator/styled.js +31 -0
  154. package/esm/components/atoms/BottomNavigator/styled.js.map +1 -0
  155. package/esm/components/atoms/Button/Button.d.ts +6 -0
  156. package/esm/components/atoms/Button/Button.js +57 -0
  157. package/esm/components/atoms/Button/Button.js.map +1 -0
  158. package/esm/components/atoms/Button/States/Error.d.ts +4 -0
  159. package/esm/components/atoms/Button/States/Error.js +31 -0
  160. package/esm/components/atoms/Button/States/Error.js.map +1 -0
  161. package/esm/components/atoms/Button/States/Loading.d.ts +4 -0
  162. package/esm/components/atoms/Button/States/Loading.js +31 -0
  163. package/esm/components/atoms/Button/States/Loading.js.map +1 -0
  164. package/esm/components/atoms/Button/States/Success.d.ts +4 -0
  165. package/esm/components/atoms/Button/States/Success.js +31 -0
  166. package/esm/components/atoms/Button/States/Success.js.map +1 -0
  167. package/esm/components/atoms/Button/States/index.d.ts +3 -0
  168. package/esm/components/atoms/Button/index.d.ts +3 -0
  169. package/esm/components/atoms/GroupButton/GroupButtonOption.d.ts +2 -0
  170. package/esm/components/atoms/GroupButton/GroupButtonOption.js +31 -0
  171. package/esm/components/atoms/GroupButton/GroupButtonOption.js.map +1 -0
  172. package/esm/components/atoms/GroupButton/index.d.ts +1 -0
  173. package/esm/components/atoms/Header/Header.d.ts +12 -0
  174. package/esm/components/atoms/Header/Header.js +62 -0
  175. package/esm/components/atoms/Header/Header.js.map +1 -0
  176. package/esm/components/atoms/Header/index.d.ts +2 -0
  177. package/esm/components/atoms/Header/styled.d.ts +8 -0
  178. package/esm/components/atoms/Header/styled.js +19 -0
  179. package/esm/components/atoms/Header/styled.js.map +1 -0
  180. package/esm/components/atoms/Input/Input.d.ts +9 -0
  181. package/esm/components/atoms/Input/Input.js +133 -0
  182. package/esm/components/atoms/Input/Input.js.map +1 -0
  183. package/esm/components/atoms/Input/index.d.ts +2 -0
  184. package/esm/components/atoms/Input/styled.d.ts +1 -0
  185. package/esm/components/atoms/Input/styled.js +13 -0
  186. package/esm/components/atoms/Input/styled.js.map +1 -0
  187. package/esm/components/atoms/InputMask/InputMask.d.ts +8 -0
  188. package/esm/components/atoms/InputMask/InputMask.js +134 -0
  189. package/esm/components/atoms/InputMask/InputMask.js.map +1 -0
  190. package/esm/components/atoms/InputMask/index.d.ts +2 -0
  191. package/esm/components/atoms/InputMask/styled.d.ts +5 -0
  192. package/esm/components/atoms/InputMask/styled.js +16 -0
  193. package/esm/components/atoms/InputMask/styled.js.map +1 -0
  194. package/esm/components/atoms/Modal/ModalGroupManager.d.ts +4 -0
  195. package/esm/components/atoms/Modal/ModalGroupManager.js +48 -0
  196. package/esm/components/atoms/Modal/ModalGroupManager.js.map +1 -0
  197. package/esm/components/atoms/Modal/ModalLifecycleHandler.d.ts +24 -0
  198. package/esm/components/atoms/Modal/ModalLifecycleHandler.js +101 -0
  199. package/esm/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -0
  200. package/esm/components/atoms/Modal/index.d.ts +7 -0
  201. package/esm/components/atoms/Modal/ui/BaseModalView.d.ts +3 -0
  202. package/esm/components/atoms/Modal/ui/BaseModalView.js +143 -0
  203. package/esm/components/atoms/Modal/ui/BaseModalView.js.map +1 -0
  204. package/esm/components/atoms/Modal/ui/styled.d.ts +6 -0
  205. package/esm/components/atoms/Modal/ui/styled.js +24 -0
  206. package/esm/components/atoms/Modal/ui/styled.js.map +1 -0
  207. package/esm/components/atoms/Modal/ui/types.d.ts +10 -0
  208. package/esm/components/atoms/Modal/useLazyModalManager.d.ts +8 -0
  209. package/esm/components/atoms/Modal/useLazyModalManager.js +33 -0
  210. package/esm/components/atoms/Modal/useLazyModalManager.js.map +1 -0
  211. package/esm/components/atoms/Modal/useModalManager.d.ts +6 -0
  212. package/esm/components/atoms/Modal/useModalManager.js +24 -0
  213. package/esm/components/atoms/Modal/useModalManager.js.map +1 -0
  214. package/esm/components/atoms/Modal/useModalRemoteControl.d.ts +4 -0
  215. package/esm/components/atoms/Modal/useModalRemoteControl.js +18 -0
  216. package/esm/components/atoms/Modal/useModalRemoteControl.js.map +1 -0
  217. package/esm/components/atoms/Skeleton/Pulse.d.ts +2 -0
  218. package/esm/components/atoms/Skeleton/Pulse.js +32 -0
  219. package/esm/components/atoms/Skeleton/Pulse.js.map +1 -0
  220. package/esm/components/atoms/Skeleton/Skeleton.d.ts +12 -0
  221. package/esm/components/atoms/Skeleton/Skeleton.js +87 -0
  222. package/esm/components/atoms/Skeleton/Skeleton.js.map +1 -0
  223. package/esm/components/atoms/Skeleton/Wave.d.ts +2 -0
  224. package/esm/components/atoms/Skeleton/Wave.js +50 -0
  225. package/esm/components/atoms/Skeleton/Wave.js.map +1 -0
  226. package/esm/components/atoms/Skeleton/animation.d.ts +3 -0
  227. package/esm/components/atoms/Skeleton/animation.js +45 -0
  228. package/esm/components/atoms/Skeleton/animation.js.map +1 -0
  229. package/esm/components/atoms/Skeleton/index.d.ts +2 -0
  230. package/esm/components/atoms/Skeleton/styled.d.ts +7 -0
  231. package/esm/components/atoms/Skeleton/styled.js +13 -0
  232. package/esm/components/atoms/Skeleton/styled.js.map +1 -0
  233. package/esm/components/atoms/Skeleton/types.d.ts +12 -0
  234. package/esm/components/atoms/SnappingSlider/SnappingSlider.d.ts +10 -0
  235. package/esm/components/atoms/SnappingSlider/SnappingSlider.js +79 -0
  236. package/esm/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -0
  237. package/esm/components/atoms/SnappingSlider/index.d.ts +2 -0
  238. package/esm/components/atoms/Tag/Tag.d.ts +7 -0
  239. package/esm/components/atoms/Tag/Tag.js +47 -0
  240. package/esm/components/atoms/Tag/Tag.js.map +1 -0
  241. package/esm/components/atoms/Tag/index.d.ts +2 -0
  242. package/esm/components/atoms/Text/Text.d.ts +5 -0
  243. package/esm/components/atoms/Text/Text.js +38 -0
  244. package/esm/components/atoms/Text/Text.js.map +1 -0
  245. package/esm/components/atoms/Text/index.d.ts +2 -0
  246. package/esm/components/atoms/Text/styled.d.ts +10 -0
  247. package/esm/components/atoms/Text/styled.js +20 -0
  248. package/esm/components/atoms/Text/styled.js.map +1 -0
  249. package/esm/components/atoms/TextArea/TextArea.d.ts +5 -0
  250. package/esm/components/atoms/TextArea/TextArea.js +129 -0
  251. package/esm/components/atoms/TextArea/TextArea.js.map +1 -0
  252. package/esm/components/atoms/TextArea/index.d.ts +2 -0
  253. package/esm/components/atoms/TextArea/styled.d.ts +4 -0
  254. package/esm/components/atoms/TextArea/styled.js +8 -0
  255. package/esm/components/atoms/TextArea/styled.js.map +1 -0
  256. package/esm/components/molecules/Calendar/Calendar.d.ts +1 -0
  257. package/esm/components/molecules/Calendar/Calendar.js +50 -0
  258. package/esm/components/molecules/Calendar/Calendar.js.map +1 -0
  259. package/esm/components/molecules/Calendar/index.d.ts +1 -0
  260. package/esm/components/molecules/DatePicker/DatePicker.d.ts +3 -0
  261. package/esm/components/molecules/DatePicker/DatePicker.js +76 -0
  262. package/esm/components/molecules/DatePicker/DatePicker.js.map +1 -0
  263. package/esm/components/molecules/DatePicker/index.d.ts +2 -0
  264. package/esm/components/molecules/DatePicker/styled.d.ts +4 -0
  265. package/esm/components/molecules/DatePicker/styled.js +9 -0
  266. package/esm/components/molecules/DatePicker/styled.js.map +1 -0
  267. package/esm/components/molecules/DateTimePicker/DateTimePicker.d.ts +4 -0
  268. package/esm/components/molecules/DateTimePicker/DateTimePicker.js +66 -0
  269. package/esm/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -0
  270. package/esm/components/molecules/DateTimePicker/index.d.ts +2 -0
  271. package/esm/components/molecules/DateTimeSelector/DateTimeSelector.d.ts +3 -0
  272. package/esm/components/molecules/DateTimeSelector/DateTimeSelector.js +50 -0
  273. package/esm/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -0
  274. package/esm/components/molecules/DateTimeSelector/index.d.ts +1 -0
  275. package/esm/components/molecules/Grid/Grid.d.ts +5 -0
  276. package/esm/components/molecules/Grid/Grid.js +88 -0
  277. package/esm/components/molecules/Grid/Grid.js.map +1 -0
  278. package/esm/components/molecules/Grid/Item/Item.d.ts +7 -0
  279. package/esm/components/molecules/Grid/Item/Item.js +106 -0
  280. package/esm/components/molecules/Grid/Item/Item.js.map +1 -0
  281. package/esm/components/molecules/Grid/Item/index.d.ts +1 -0
  282. package/esm/components/molecules/Grid/index.d.ts +2 -0
  283. package/esm/components/molecules/IconTextButton/IconTextButton.d.ts +6 -0
  284. package/esm/components/molecules/IconTextButton/IconTextButton.js +72 -0
  285. package/esm/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
  286. package/esm/components/molecules/IconTextButton/TextComponent.d.ts +12 -0
  287. package/esm/components/molecules/IconTextButton/TextComponent.js +40 -0
  288. package/esm/components/molecules/IconTextButton/TextComponent.js.map +1 -0
  289. package/esm/components/molecules/IconTextButton/index.d.ts +2 -0
  290. package/esm/components/molecules/IconTextButton/styled.d.ts +2 -0
  291. package/esm/components/molecules/IconTextButton/styled.js +28 -0
  292. package/esm/components/molecules/IconTextButton/styled.js.map +1 -0
  293. package/esm/components/molecules/InputPassword/InputPassword.d.ts +6 -0
  294. package/esm/components/molecules/InputPassword/InputPassword.js +54 -0
  295. package/esm/components/molecules/InputPassword/InputPassword.js.map +1 -0
  296. package/esm/components/molecules/InputPassword/index.d.ts +2 -0
  297. package/esm/components/molecules/LabeledSwitch/LabelComponent.d.ts +13 -0
  298. package/esm/components/molecules/LabeledSwitch/LabelComponent.js +59 -0
  299. package/esm/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -0
  300. package/esm/components/molecules/LabeledSwitch/LabeledSwitch.d.ts +8 -0
  301. package/esm/components/molecules/LabeledSwitch/LabeledSwitch.js +76 -0
  302. package/esm/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -0
  303. package/esm/components/molecules/LabeledSwitch/index.d.ts +2 -0
  304. package/esm/components/molecules/LabeledSwitch/styled.d.ts +9 -0
  305. package/esm/components/molecules/LabeledSwitch/styled.js +24 -0
  306. package/esm/components/molecules/LabeledSwitch/styled.js.map +1 -0
  307. package/esm/components/molecules/Select/Modal.d.ts +7 -0
  308. package/esm/components/molecules/Select/Modal.js +230 -0
  309. package/esm/components/molecules/Select/Modal.js.map +1 -0
  310. package/esm/components/molecules/Select/Select.d.ts +24 -0
  311. package/esm/components/molecules/Select/Select.js +240 -0
  312. package/esm/components/molecules/Select/Select.js.map +1 -0
  313. package/esm/components/molecules/Select/index.d.ts +2 -0
  314. package/esm/components/molecules/Select/styled.d.ts +41 -0
  315. package/esm/components/molecules/Select/styled.js +78 -0
  316. package/esm/components/molecules/Select/styled.js.map +1 -0
  317. package/esm/components/molecules/Snackbar/Snackbar.d.ts +9 -0
  318. package/esm/components/molecules/Snackbar/Snackbar.js +51 -0
  319. package/esm/components/molecules/Snackbar/Snackbar.js.map +1 -0
  320. package/esm/components/molecules/Snackbar/index.d.ts +2 -0
  321. package/esm/components/molecules/Snackbar/styled.d.ts +4 -0
  322. package/esm/components/molecules/Snackbar/styled.js +10 -0
  323. package/esm/components/molecules/Snackbar/styled.js.map +1 -0
  324. package/esm/index.d.ts +44 -0
  325. package/esm/index.js +35 -0
  326. package/esm/index.js.map +1 -0
  327. package/esm/utils/date.d.ts +1 -0
  328. package/esm/utils/date.js +16 -0
  329. package/esm/utils/date.js.map +1 -0
  330. package/package.json +8 -5
  331. package/rollup.config.js +39 -0
  332. package/src/components/atoms/Avatar/Avatar.tsx +3 -1
  333. package/src/components/atoms/Avatar/index.ts +1 -1
  334. package/src/components/atoms/Badge/index.ts +2 -1
  335. package/src/components/atoms/BottomNavigator/index.ts +3 -5
  336. package/src/components/atoms/Button/States/Error.tsx +1 -1
  337. package/src/components/atoms/Button/States/Loading.tsx +1 -1
  338. package/src/components/atoms/Button/States/Success.tsx +1 -1
  339. package/src/components/atoms/Button/index.ts +2 -1
  340. package/src/components/atoms/Header/index.ts +2 -1
  341. package/src/components/atoms/Input/index.ts +2 -1
  342. package/src/components/atoms/InputMask/index.ts +2 -1
  343. package/src/components/atoms/Skeleton/index.ts +2 -1
  344. package/src/components/atoms/SnappingSlider/index.ts +2 -4
  345. package/src/components/atoms/Tag/index.ts +2 -1
  346. package/src/components/atoms/Text/index.ts +2 -1
  347. package/src/components/atoms/TextArea/index.ts +2 -1
  348. package/src/components/molecules/DatePicker/index.ts +2 -1
  349. package/src/components/molecules/DateTimePicker/index.ts +2 -1
  350. package/src/components/molecules/IconTextButton/index.ts +2 -4
  351. package/src/components/molecules/InputPassword/index.ts +2 -4
  352. package/src/components/molecules/LabeledSwitch/index.ts +2 -4
  353. package/src/components/molecules/Select/Modal.tsx +1 -1
  354. package/src/components/molecules/Select/Select.tsx +3 -2
  355. package/src/components/molecules/Select/index.ts +2 -1
  356. package/src/components/molecules/Snackbar/Snackbar.tsx +1 -1
  357. package/src/components/molecules/Snackbar/index.ts +2 -1
  358. package/src/index.ts +37 -46
  359. package/tsconfig.build.esm.json +10 -0
  360. package/dist/components/atoms/Avatar/index.js +0 -9
  361. package/dist/components/atoms/Avatar/index.js.map +0 -1
  362. package/dist/components/atoms/Badge/index.js +0 -14
  363. package/dist/components/atoms/Badge/index.js.map +0 -1
  364. package/dist/components/atoms/BottomNavigator/index.js +0 -18
  365. package/dist/components/atoms/BottomNavigator/index.js.map +0 -1
  366. package/dist/components/atoms/Button/States/index.js +0 -19
  367. package/dist/components/atoms/Button/States/index.js.map +0 -1
  368. package/dist/components/atoms/Button/index.js +0 -16
  369. package/dist/components/atoms/Button/index.js.map +0 -1
  370. package/dist/components/atoms/GroupButton/index.js +0 -11
  371. package/dist/components/atoms/GroupButton/index.js.map +0 -1
  372. package/dist/components/atoms/Header/index.js +0 -14
  373. package/dist/components/atoms/Header/index.js.map +0 -1
  374. package/dist/components/atoms/Input/index.js +0 -14
  375. package/dist/components/atoms/Input/index.js.map +0 -1
  376. package/dist/components/atoms/InputMask/index.js +0 -14
  377. package/dist/components/atoms/InputMask/index.js.map +0 -1
  378. package/dist/components/atoms/Modal/index.js +0 -60
  379. package/dist/components/atoms/Modal/index.js.map +0 -1
  380. package/dist/components/atoms/Modal/ui/types.js +0 -4
  381. package/dist/components/atoms/Modal/ui/types.js.map +0 -1
  382. package/dist/components/atoms/Skeleton/index.js +0 -14
  383. package/dist/components/atoms/Skeleton/index.js.map +0 -1
  384. package/dist/components/atoms/Skeleton/types.js +0 -4
  385. package/dist/components/atoms/Skeleton/types.js.map +0 -1
  386. package/dist/components/atoms/SnappingSlider/index.js +0 -14
  387. package/dist/components/atoms/SnappingSlider/index.js.map +0 -1
  388. package/dist/components/atoms/Tag/index.js +0 -14
  389. package/dist/components/atoms/Tag/index.js.map +0 -1
  390. package/dist/components/atoms/Text/index.js +0 -14
  391. package/dist/components/atoms/Text/index.js.map +0 -1
  392. package/dist/components/atoms/TextArea/index.js +0 -14
  393. package/dist/components/atoms/TextArea/index.js.map +0 -1
  394. package/dist/components/molecules/Calendar/index.js +0 -9
  395. package/dist/components/molecules/Calendar/index.js.map +0 -1
  396. package/dist/components/molecules/DatePicker/index.js +0 -10
  397. package/dist/components/molecules/DatePicker/index.js.map +0 -1
  398. package/dist/components/molecules/DateTimePicker/index.js +0 -10
  399. package/dist/components/molecules/DateTimePicker/index.js.map +0 -1
  400. package/dist/components/molecules/DateTimeSelector/index.js +0 -9
  401. package/dist/components/molecules/DateTimeSelector/index.js.map +0 -1
  402. package/dist/components/molecules/Grid/Item/index.js +0 -14
  403. package/dist/components/molecules/Grid/Item/index.js.map +0 -1
  404. package/dist/components/molecules/Grid/index.js +0 -15
  405. package/dist/components/molecules/Grid/index.js.map +0 -1
  406. package/dist/components/molecules/IconTextButton/index.js +0 -14
  407. package/dist/components/molecules/IconTextButton/index.js.map +0 -1
  408. package/dist/components/molecules/InputPassword/index.js +0 -14
  409. package/dist/components/molecules/InputPassword/index.js.map +0 -1
  410. package/dist/components/molecules/LabeledSwitch/index.js +0 -14
  411. package/dist/components/molecules/LabeledSwitch/index.js.map +0 -1
  412. package/dist/components/molecules/Select/index.js +0 -14
  413. package/dist/components/molecules/Select/index.js.map +0 -1
  414. package/dist/components/molecules/Snackbar/index.js +0 -14
  415. package/dist/components/molecules/Snackbar/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","names":["Component","options","keyExtractor","labelExtractor","hideSearchBar","searchBarPlaceholder","focused","type","value","onSelect","onSearch","selectModalTitle","selectModalTitleComponent","confirmButtonText","loading","close","closeOnPick","others","selectedValues","setSelectedValues","React","useState","searchArg","setSearchArg","useDebouncedState","ModalComponent","useMemo","getStyledModal","getStatusBarHeight","_closeOnPick","useEffect","getData","useCallback","map","option","index","_checked","find","data","handlePressItem","newArr","found","push","handleConfirm","optionBuilder","item","anyChecked","filter","length","dataLengthChanged","memoizedFlatlist","titleTextModal","maxWidth","RFValue","headerContent","onPress","icon","name","fontColor","text","MemoizedOption","label","Modal"],"sources":["../../../../src/components/molecules/Select/Modal.tsx"],"sourcesContent":["import {\n Checkbox,\n getStatusBarHeight,\n RadioButton,\n RFValue,\n useDebouncedState,\n} from '@tecsinapse/react-core';\nimport * as React from 'react';\nimport { FlatList, ListRenderItemInfo, View } from 'react-native';\nimport { Button } from '../../atoms/Button';\nimport { Header } from '../../atoms/Header';\nimport { Input } from '../../atoms/Input';\nimport { IBaseModal, ModalView } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { SelectNativeProps } from './Select';\nimport {\n FetchIndicator,\n getStyledModal,\n ListItem,\n ModalFooter,\n SearchBarContainer,\n SelectIcon,\n TextTitleModal,\n} from './styled';\n\ninterface LoadingProps {\n loading?: boolean;\n}\n\nconst Component = <Data, Type extends 'single' | 'multi'>({\n options,\n keyExtractor,\n labelExtractor,\n hideSearchBar,\n searchBarPlaceholder,\n focused,\n type,\n value,\n onSelect,\n onSearch,\n selectModalTitle,\n selectModalTitleComponent,\n confirmButtonText,\n loading,\n close,\n closeOnPick,\n ...others\n}: SelectNativeProps<Data, Type> & LoadingProps & IBaseModal): JSX.Element => {\n const [selectedValues, setSelectedValues] = React.useState<Data[]>([]);\n const [searchArg, setSearchArg] = useDebouncedState<string>('', onSearch);\n const ModalComponent = React.useMemo(\n () => getStyledModal(getStatusBarHeight(true)),\n []\n );\n const _closeOnPick = closeOnPick && type === 'single';\n\n // Resets the temporary state to the initial state whenever the\n // modal is reopened or the value changes\n React.useEffect(() => {\n setSelectedValues(\n (value ? (type === 'multi' ? value : [value]) : []) as Data[]\n );\n }, [value, focused, setSelectedValues]);\n\n const getData = React.useCallback(\n (options: Data[]) => {\n return options?.map((option, index) => ({\n ...option,\n _checked:\n type === 'multi'\n ? !!selectedValues.find(\n value =>\n keyExtractor(option, index) == keyExtractor(value, index)\n )\n : keyExtractor((selectedValues[0] || {}) as Data, index) ==\n keyExtractor(option, index),\n }));\n },\n [keyExtractor, selectedValues, type]\n );\n\n const data = React.useMemo(\n () => (typeof options !== 'function' ? getData(options) : []),\n [options, getData]\n );\n\n const handlePressItem = React.useCallback(\n (option: Data) => {\n setSelectedValues(selectedValues => {\n if (type === 'multi') {\n const newArr: Data[] = [];\n let found = false;\n for (const value of selectedValues) {\n if (keyExtractor(value) != keyExtractor(option)) newArr.push(value);\n else found = true;\n }\n if (!found) newArr.push(option);\n return newArr;\n }\n return keyExtractor((selectedValues[0] || {}) as Data) ===\n keyExtractor(option)\n ? []\n : [option];\n });\n },\n [selectedValues, setSelectedValues, keyExtractor, type]\n );\n\n React.useEffect(() => {\n if (_closeOnPick && selectedValues[0] && selectedValues[0] !== value) {\n handleConfirm();\n }\n }, [selectedValues[0], value, closeOnPick]);\n\n const handleConfirm = React.useCallback(() => {\n // TS Workaround since TS won't infer the ternary operator's result type correctly\n type OnSelectArg = Parameters<typeof onSelect>[0];\n onSelect(\n (type === 'single' ? selectedValues[0] : selectedValues) as OnSelectArg\n );\n close?.();\n }, [selectedValues]);\n\n const optionBuilder = React.useCallback(\n ({ item }: ListRenderItemInfo<Data & { _checked: boolean }>) => (\n <MemoizedOption\n item={item}\n type={type}\n handlePressItem={handlePressItem}\n labelExtractor={labelExtractor}\n />\n ),\n []\n );\n\n const anyChecked = data.filter(item => item._checked).length;\n const dataLengthChanged = data.length;\n\n const memoizedFlatlist = React.useMemo(\n () => (\n <FlatList\n data={data}\n keyExtractor={keyExtractor}\n fadingEdgeLength={200}\n renderItem={optionBuilder}\n />\n ),\n [selectedValues, anyChecked, dataLengthChanged]\n );\n\n const titleTextModal = selectModalTitle ? (\n <TextTitleModal\n typography=\"h4\"\n fontWeight=\"bold\"\n numberOfLines={3}\n style={{ maxWidth: RFValue(250) }}\n >\n {selectModalTitle}\n </TextTitleModal>\n ) : null;\n\n const headerContent = selectModalTitleComponent\n ? selectModalTitleComponent\n : titleTextModal;\n\n return (\n <ModalView {...others} BoxComponent={ModalComponent} showCloseBar={false}>\n <Header\n rightButton={{\n onPress: close,\n icon: {\n name: 'close',\n type: 'material-community',\n fontColor: 'light',\n },\n }}\n >\n {headerContent}\n </Header>\n\n {!hideSearchBar && (\n <SearchBarContainer>\n <Input\n placeholder={searchBarPlaceholder}\n value={searchArg}\n onChange={text => setSearchArg(text)}\n leftComponent={\n <SelectIcon name=\"search\" type=\"ionicon\" size=\"centi\" />\n }\n />\n </SearchBarContainer>\n )}\n\n {loading && (\n <FetchIndicator animating={true} color={'grey'} size={'large'} />\n )}\n\n {memoizedFlatlist}\n\n {!_closeOnPick && (\n <ModalFooter>\n <Button\n variant={'filled'}\n color={'primary'}\n onPress={handleConfirm}\n disabled={loading}\n >\n <Text fontColor={'light'} fontWeight=\"bold\">\n {confirmButtonText}\n </Text>\n </Button>\n </ModalFooter>\n )}\n </ModalView>\n );\n};\n\ninterface IOption<T> {\n item: T & { _checked: boolean };\n type: 'single' | 'multi';\n labelExtractor: (option: T) => string;\n handlePressItem: (option: T) => void;\n}\n\nconst MemoizedOption = <T,>({\n handlePressItem,\n labelExtractor,\n item,\n type,\n}: IOption<T>): JSX.Element => {\n return React.useMemo(() => {\n const label = labelExtractor(item);\n return (\n <ListItem onPress={() => handlePressItem(item)}>\n <View pointerEvents={'none'}>\n {type === 'multi' ? (\n <Checkbox\n color={'primary'}\n labelPosition={'right'}\n checked={item._checked}\n >\n <Text fontWeight={item._checked ? 'bold' : 'regular'}>\n {label}\n </Text>\n </Checkbox>\n ) : (\n <RadioButton\n color={'primary'}\n labelPosition={'right'}\n checked={item._checked}\n >\n <Text fontWeight={item._checked ? 'bold' : 'regular'}>\n {label}\n </Text>\n </RadioButton>\n )}\n </View>\n </ListItem>\n );\n }, [item._checked]);\n};\n\nexport const Modal = Component;\n"],"mappings":";;;;;AAAA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAcA,MAAMA,SAAS,GAAG,CAAwC;EACxDC,OADwD;EAExDC,YAFwD;EAGxDC,cAHwD;EAIxDC,aAJwD;EAKxDC,oBALwD;EAMxDC,OANwD;EAOxDC,IAPwD;EAQxDC,KARwD;EASxDC,QATwD;EAUxDC,QAVwD;EAWxDC,gBAXwD;EAYxDC,yBAZwD;EAaxDC,iBAbwD;EAcxDC,OAdwD;EAexDC,KAfwD;EAgBxDC,WAhBwD;EAiBxD,GAAGC;AAjBqD,CAAxC,KAkB4D;EAC5E,MAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsCC,KAAK,CAACC,QAAN,CAAuB,EAAvB,CAA5C;EACA,MAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4B,IAAAC,4BAAA,EAA0B,EAA1B,EAA8Bd,QAA9B,CAAlC;EACA,MAAMe,cAAc,GAAGL,KAAK,CAACM,OAAN,CACrB,MAAM,IAAAC,sBAAA,EAAe,IAAAC,6BAAA,EAAmB,IAAnB,CAAf,CADe,EAErB,EAFqB,CAAvB;;EAIA,MAAMC,YAAY,GAAGb,WAAW,IAAIT,IAAI,KAAK,QAA7C;;EAIAa,KAAK,CAACU,SAAN,CAAgB,MAAM;IACpBX,iBAAiB,CACdX,KAAK,GAAID,IAAI,KAAK,OAAT,GAAmBC,KAAnB,GAA2B,CAACA,KAAD,CAA/B,GAA0C,EADjC,CAAjB;EAGD,CAJD,EAIG,CAACA,KAAD,EAAQF,OAAR,EAAiBa,iBAAjB,CAJH;EAMA,MAAMY,OAAO,GAAGX,KAAK,CAACY,WAAN,CACb/B,OAAD,IAAqB;IACnB,OAAOA,OAAP,oBAAOA,OAAO,CAAEgC,GAAT,CAAa,CAACC,MAAD,EAASC,KAAT,MAAoB,EAC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AE,OAAjB;IAA0B,UAAU,EAAC;EAArC,GACGD,iBADH,CANF,CADF,CAlCJ,CADF;AAkDD,CA1LD;;AAmMA,MAAM+C,cAAc,GAAG,CAAK;EAC1BrB,eAD0B;EAE1BpC,cAF0B;EAG1B0C,IAH0B;EAI1BtC;AAJ0B,CAAL,KAKQ;EAC7B,OAAOa,KAAK,CAACM,OAAN,CAAc,MAAM;IACzB,MAAMmC,KAAK,GAAG1D,cAAc,CAAC0C,IAAD,CAA5B;IACA,OACE,oBAAC,gBAAD;MAAU,OAAO,EAAE,MAAMN,eAAe,CAACM,IAAD;IAAxC,GACE,oBAAC,iBAAD;MAAM,aAAa,EAAE;IAArB,GACGtC,IAAI,KAAK,OAAT,GACC,oBAAC,mBAAD;MACE,KAAK,EAAE,SADT;MAEE,aAAa,EAAE,OAFjB;MAGE,OAAO,EAAEsC,IAAI,CAACT;IAHhB,GAKE,oBAAC,UAAD;MAAM,UAAU,EAAES,IAAI,CAACT,QAAL,GAAgB,MAAhB,GAAyB;IAA3C,GACGyB,KADH,CALF,CADD,GAWC,oBAAC,sBAAD;MACE,KAAK,EAAE,SADT;MAEE,aAAa,EAAE,OAFjB;MAGE,OAAO,EAAEhB,IAAI,CAACT;IAHhB,GAKE,oBAAC,UAAD;MAAM,UAAU,EAAES,IAAI,CAACT,QAAL,GAAgB,MAAhB,GAAyB;IAA3C,GACGyB,KADH,CALF,CAZJ,CADF,CADF;EA2BD,CA7BM,EA6BJ,CAAChB,IAAI,CAACT,QAAN,CA7BI,CAAP;AA8BD,CApCD;;AAsCO,MAAM0B,KAAK,GAAG9D,SAAd"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../src/components/molecules/Select/Modal.tsx"],"sourcesContent":["import {\n Checkbox,\n getStatusBarHeight,\n RadioButton,\n RFValue,\n useDebouncedState,\n} from '@tecsinapse/react-core';\nimport * as React from 'react';\nimport { FlatList, ListRenderItemInfo, View } from 'react-native';\nimport { Button } from '../../atoms/Button';\nimport { Header } from '../../atoms/Header';\nimport { Input } from '../../atoms/Input';\nimport { IBaseModal, ModalView } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { SelectNativeProps } from './Select';\nimport {\n FetchIndicator,\n getStyledModal,\n ListItem,\n ModalFooter,\n SearchBarContainer,\n SelectIcon,\n TextTitleModal,\n} from './styled';\n\ninterface LoadingProps {\n loading?: boolean;\n}\n\nconst Component = <Data, Type extends 'single' | 'multi'>({\n options,\n keyExtractor,\n labelExtractor,\n hideSearchBar,\n searchBarPlaceholder,\n focused,\n type,\n value,\n onSelect,\n onSearch,\n selectModalTitle,\n selectModalTitleComponent,\n confirmButtonText,\n loading,\n close,\n closeOnPick,\n ...others\n}: SelectNativeProps<Data, Type> & LoadingProps & IBaseModal): JSX.Element => {\n const [selectedValues, setSelectedValues] = React.useState<Data[]>([]);\n const [searchArg, setSearchArg] = useDebouncedState<string>('', onSearch);\n const ModalComponent = React.useMemo(\n () => getStyledModal(getStatusBarHeight(true)),\n []\n );\n const _closeOnPick = closeOnPick && type === 'single';\n\n // Resets the temporary state to the initial state whenever the\n // modal is reopened or the value changes\n React.useEffect(() => {\n setSelectedValues(\n (value ? (type === 'multi' ? value : [value]) : []) as Data[]\n );\n }, [value, focused, setSelectedValues]);\n\n const getData = React.useCallback(\n (options: Data[]) => {\n return options?.map((option, index) => ({\n ...option,\n _checked:\n type === 'multi'\n ? !!selectedValues.find(\n value =>\n keyExtractor(option, index) == keyExtractor(value, index)\n )\n : keyExtractor((selectedValues[0] || {}) as Data, index) ==\n keyExtractor(option, index),\n }));\n },\n [keyExtractor, selectedValues, type]\n );\n\n const data = React.useMemo(\n () => (typeof options !== 'function' ? getData(options) : []),\n [options, getData]\n );\n\n const handlePressItem = React.useCallback(\n (option: Data) => {\n setSelectedValues(selectedValues => {\n if (type === 'multi') {\n const newArr: Data[] = [];\n let found = false;\n for (const value of selectedValues) {\n if (keyExtractor(value) != keyExtractor(option)) newArr.push(value);\n else found = true;\n }\n if (!found) newArr.push(option);\n return newArr;\n }\n return keyExtractor((selectedValues[0] || {}) as Data) ===\n keyExtractor(option)\n ? []\n : [option];\n });\n },\n [selectedValues, setSelectedValues, keyExtractor, type]\n );\n\n React.useEffect(() => {\n if (_closeOnPick && selectedValues[0] && selectedValues[0] !== value) {\n handleConfirm();\n }\n }, [selectedValues[0], value, closeOnPick]);\n\n const handleConfirm = React.useCallback(() => {\n // TS Workaround since TS won't infer the ternary operator's result type correctly\n type OnSelectArg = Parameters<typeof onSelect>[0];\n onSelect(\n (type === 'single' ? selectedValues[0] : selectedValues) as OnSelectArg\n );\n close?.();\n }, [selectedValues]);\n\n const optionBuilder = React.useCallback(\n ({ item }: ListRenderItemInfo<Data & { _checked: boolean }>) => (\n <MemoizedOption\n item={item}\n type={type}\n handlePressItem={handlePressItem}\n labelExtractor={labelExtractor}\n />\n ),\n []\n );\n\n const anyChecked = data.filter(item => item._checked).length;\n const dataLengthChanged = data.length;\n\n const memoizedFlatlist = React.useMemo(\n () => (\n <FlatList\n data={data}\n keyExtractor={keyExtractor}\n fadingEdgeLength={200}\n renderItem={optionBuilder}\n />\n ),\n [selectedValues, anyChecked, dataLengthChanged]\n );\n\n const titleTextModal = selectModalTitle ? (\n <TextTitleModal\n typography=\"h4\"\n fontWeight=\"bold\"\n numberOfLines={3}\n style={{ maxWidth: RFValue(250) }}\n >\n {selectModalTitle}\n </TextTitleModal>\n ) : null;\n\n const headerContent = selectModalTitleComponent\n ? selectModalTitleComponent\n : titleTextModal;\n\n return (\n <ModalView {...others} BoxComponent={ModalComponent} showCloseBar={false}>\n <Header\n rightButton={{\n onPress: close,\n icon: {\n name: 'close',\n type: 'material-community',\n fontColor: 'light',\n },\n }}\n >\n {headerContent}\n </Header>\n\n {!hideSearchBar && (\n <SearchBarContainer>\n <Input\n placeholder={searchBarPlaceholder}\n value={searchArg}\n onChange={setSearchArg}\n leftComponent={\n <SelectIcon name=\"search\" type=\"ionicon\" size=\"centi\" />\n }\n />\n </SearchBarContainer>\n )}\n\n {loading && (\n <FetchIndicator animating={true} color={'grey'} size={'large'} />\n )}\n\n {memoizedFlatlist}\n\n {!_closeOnPick && (\n <ModalFooter>\n <Button\n variant={'filled'}\n color={'primary'}\n onPress={handleConfirm}\n disabled={loading}\n >\n <Text fontColor={'light'} fontWeight=\"bold\">\n {confirmButtonText}\n </Text>\n </Button>\n </ModalFooter>\n )}\n </ModalView>\n );\n};\n\ninterface IOption<T> {\n item: T & { _checked: boolean };\n type: 'single' | 'multi';\n labelExtractor: (option: T) => string;\n handlePressItem: (option: T) => void;\n}\n\nconst MemoizedOption = <T,>({\n handlePressItem,\n labelExtractor,\n item,\n type,\n}: IOption<T>): JSX.Element => {\n return React.useMemo(() => {\n const label = labelExtractor(item);\n return (\n <ListItem onPress={() => handlePressItem(item)}>\n <View pointerEvents={'none'}>\n {type === 'multi' ? (\n <Checkbox\n color={'primary'}\n labelPosition={'right'}\n checked={item._checked}\n >\n <Text fontWeight={item._checked ? 'bold' : 'regular'}>\n {label}\n </Text>\n </Checkbox>\n ) : (\n <RadioButton\n color={'primary'}\n labelPosition={'right'}\n checked={item._checked}\n >\n <Text fontWeight={item._checked ? 'bold' : 'regular'}>\n {label}\n </Text>\n </RadioButton>\n )}\n </View>\n </ListItem>\n );\n }, [item._checked]);\n};\n\nexport const Modal = Component;\n"],"names":["React","useDebouncedState","getStyledModal","getStatusBarHeight","options","value","selectedValues","FlatList","TextTitleModal","RFValue","ModalView","SearchBarContainer","SelectIcon","FetchIndicator","ModalFooter","Button","ListItem","View","Checkbox","RadioButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,CAAwC,EAkBoB,KAAA;AAlBpB,EACxD,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,OAA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iB,gBAAA,EAAA;AAAA,MAAK,aAAe,EAAA,MAAA;AAAA,KAClB,EAAA,IAAA,KAAS,0BACPjB,gBAAA,CAAA,aAAA,CAAAkB,kBAAA,EAAA;AAAA,MACC,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,OAAA;AAAA,MACf,SAAS,IAAK,CAAA,QAAA;AAAA,KAAA,kBAEblB,gBAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MAAK,UAAA,EAAY,IAAK,CAAA,QAAA,GAAW,MAAS,GAAA,SAAA;AAAA,KACxC,EAAA,KACH,CACF,CAAA,mBAECA,gBAAA,CAAA,aAAA,CAAAmB,qBAAA,EAAA;AAAA,MACC,KAAO,EAAA,SAAA;AAAA,MACP,aAAe,EAAA,OAAA;AAAA,MACf,SAAS,IAAK,CAAA,QAAA;AAAA,KAAA,kBAEbnB,gBAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,MAAK,UAAA,EAAY,IAAK,CAAA,QAAA,GAAW,MAAS,GAAA,SAAA;AAAA,KACxC,EAAA,KACH,CACF,CAEJ,CACF,CAAA,CAAA;AAAA,GAED,EAAA,CAAC,IAAK,CAAA,QAAQ,CAAC,CAAA,CAAA;AACpB,CAAA,CAAA;AAEO,MAAM,KAAQ,GAAA;;;;"}
@@ -1,179 +1,261 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
- exports.__esModule = true;
4
- exports.default = void 0;
3
+ var reactCore = require('@tecsinapse/react-core');
4
+ var React = require('react');
5
+ require('../../atoms/Modal/ModalGroupManager.js');
6
+ require('react-native');
7
+ require('react-native-safe-area-context');
8
+ require('../../atoms/Modal/ui/styled.js');
9
+ require('uuid');
10
+ var useLazyModalManager = require('../../atoms/Modal/useLazyModalManager.js');
11
+ var Text = require('../../atoms/Text/Text.js');
12
+ var Modal = require('./Modal.js');
13
+ var styled = require('./styled.js');
5
14
 
6
- var _reactCore = require("@tecsinapse/react-core");
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _Modal = require("../../atoms/Modal");
11
-
12
- var _Text = require("../../atoms/Text");
13
-
14
- var _Modal2 = require("./Modal");
15
-
16
- var _styled = require("./styled");
17
-
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
-
20
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ function _interopNamespace(e) {
16
+ if (e && e.__esModule) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ n["default"] = e;
30
+ return Object.freeze(n);
31
+ }
21
32
 
22
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
33
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
23
34
 
24
- function Select({
25
- value,
26
- options,
27
- keyExtractor,
28
- groupKeyExtractor,
29
- onSelect,
30
- type,
31
- labelExtractor,
32
- placeholder,
33
- onFocus,
34
- onBlur,
35
- disabled,
36
- onSearch,
37
- selectModalTitle,
38
- selectModalTitleComponent,
39
- searchBarPlaceholder,
40
- hideSearchBar,
41
- confirmButtonText,
42
- rightComponent,
43
- variant = 'default',
44
- hintComponent,
45
- hint,
46
- style,
47
- controlComponent,
48
- closeOnPick = type === 'single',
49
- label,
50
- numberOfLines,
51
- ...rest
52
- }) {
53
- const {
54
- focused,
55
- handleBlur,
56
- handleFocus
57
- } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
58
- const [selectOptions, setSelectOptions] = (0, React.useState)([]);
59
- const modal = (0, _Modal.useLazyModalManager)();
60
- const [loading, setLoading] = (0, React.useState)(false);
35
+ var __defProp = Object.defineProperty;
36
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
37
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
38
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
39
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
40
+ var __spreadValues = (a, b) => {
41
+ for (var prop in b || (b = {}))
42
+ if (__hasOwnProp.call(b, prop))
43
+ __defNormalProp(a, prop, b[prop]);
44
+ if (__getOwnPropSymbols)
45
+ for (var prop of __getOwnPropSymbols(b)) {
46
+ if (__propIsEnum.call(b, prop))
47
+ __defNormalProp(a, prop, b[prop]);
48
+ }
49
+ return a;
50
+ };
51
+ var __objRest = (source, exclude) => {
52
+ var target = {};
53
+ for (var prop in source)
54
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
55
+ target[prop] = source[prop];
56
+ if (source != null && __getOwnPropSymbols)
57
+ for (var prop of __getOwnPropSymbols(source)) {
58
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
59
+ target[prop] = source[prop];
60
+ }
61
+ return target;
62
+ };
63
+ function Select(_a) {
64
+ var _b = _a, {
65
+ value,
66
+ options,
67
+ keyExtractor,
68
+ groupKeyExtractor,
69
+ onSelect,
70
+ type,
71
+ labelExtractor,
72
+ placeholder,
73
+ onFocus,
74
+ onBlur,
75
+ disabled,
76
+ onSearch,
77
+ selectModalTitle,
78
+ selectModalTitleComponent,
79
+ searchBarPlaceholder,
80
+ hideSearchBar,
81
+ confirmButtonText,
82
+ rightComponent,
83
+ variant = "default",
84
+ hintComponent,
85
+ hint,
86
+ style,
87
+ controlComponent,
88
+ closeOnPick = type === "single",
89
+ label,
90
+ numberOfLines
91
+ } = _b, rest = __objRest(_b, [
92
+ "value",
93
+ "options",
94
+ "keyExtractor",
95
+ "groupKeyExtractor",
96
+ "onSelect",
97
+ "type",
98
+ "labelExtractor",
99
+ "placeholder",
100
+ "onFocus",
101
+ "onBlur",
102
+ "disabled",
103
+ "onSearch",
104
+ "selectModalTitle",
105
+ "selectModalTitleComponent",
106
+ "searchBarPlaceholder",
107
+ "hideSearchBar",
108
+ "confirmButtonText",
109
+ "rightComponent",
110
+ "variant",
111
+ "hintComponent",
112
+ "hint",
113
+ "style",
114
+ "controlComponent",
115
+ "closeOnPick",
116
+ "label",
117
+ "numberOfLines"
118
+ ]);
119
+ const { focused, handleBlur, handleFocus } = reactCore.useInputFocus(
120
+ onFocus,
121
+ onBlur,
122
+ !disabled
123
+ );
124
+ const [selectOptions, setSelectOptions] = React.useState([]);
125
+ const modal = useLazyModalManager.useLazyModalManager();
126
+ const [loading, setLoading] = React.useState(false);
61
127
  const onlyLabel = label && !placeholder;
62
- const hasValue = type === 'single' ? !!value : (value || []).length > 0;
63
-
128
+ const hasValue = type === "single" ? !!value : (value || []).length > 0;
64
129
  const _placeholder = onlyLabel ? label : placeholder;
65
-
66
- const _label = hasValue ? label : undefined;
67
-
68
- (0, React.useEffect)(() => {
69
- if (typeof options !== 'function') {
130
+ const _label = hasValue ? label : void 0;
131
+ React.useEffect(() => {
132
+ if (typeof options !== "function") {
70
133
  setSelectOptions(options);
71
134
  }
72
135
  }, [options]);
73
- const handleLazyFocus = React.useCallback(async () => {
74
- if (typeof options === 'function') {
136
+ const handleLazyFocus = React__namespace.useCallback(async () => {
137
+ if (typeof options === "function" && !onSearch) {
75
138
  setLoading(true);
76
-
77
139
  try {
78
140
  const result = await options();
79
-
80
141
  if (result) {
81
- if (value && !result.find(v => keyExtractor(value) === keyExtractor(v))) {
142
+ if (value && !result.find((v) => keyExtractor(value) === keyExtractor(v))) {
82
143
  setSelectOptions([value, ...result]);
83
- } else setSelectOptions(result);
144
+ } else
145
+ setSelectOptions(result);
84
146
  }
85
- } catch (e) {} finally {
147
+ } catch (e) {
148
+ } finally {
86
149
  setLoading(false);
87
150
  }
88
151
  }
89
152
  }, [options, value, setSelectOptions]);
90
- const handleOnSearch = React.useCallback(async searchInput => {
91
- if (searchInput !== undefined && onSearch) {
92
- setLoading(true);
93
-
94
- try {
95
- const result = await onSearch(searchInput);
96
-
97
- if (result) {
98
- if (type === 'single') {
99
- if (value && !result.find(v => keyExtractor(value) === keyExtractor(v))) {
100
- setSelectOptions([value, ...result]);
101
- } else setSelectOptions(result);
102
- } else {
103
- if (value.length > 0) {
104
- const selectedValues = value.filter(v => !result.find(current => keyExtractor(v) === keyExtractor(current))) || [];
105
- setSelectOptions([...selectedValues, ...result]);
153
+ const handleOnSearch = React__namespace.useCallback(
154
+ async (searchInput) => {
155
+ if (searchInput !== void 0 && onSearch) {
156
+ setLoading(true);
157
+ modal.requestUpdate();
158
+ try {
159
+ const result = await onSearch(searchInput);
160
+ if (result) {
161
+ if (type === "single") {
162
+ if (value && !result.find(
163
+ (v) => keyExtractor(value) === keyExtractor(v)
164
+ )) {
165
+ setSelectOptions([value, ...result]);
166
+ } else
167
+ setSelectOptions(result);
106
168
  } else {
107
- setSelectOptions(result);
169
+ if (value == null ? void 0 : value.length) {
170
+ const selectedValues = value.filter(
171
+ (v) => !result.find(
172
+ (current) => keyExtractor(v) === keyExtractor(current)
173
+ )
174
+ ) || [];
175
+ setSelectOptions([...selectedValues, ...result]);
176
+ } else {
177
+ setSelectOptions(result);
178
+ }
108
179
  }
109
180
  }
181
+ } catch (e) {
182
+ } finally {
183
+ modal.requestUpdate();
184
+ setLoading(false);
110
185
  }
111
- } catch (e) {} finally {
112
- modal.requestUpdate();
113
- setLoading(false);
114
186
  }
115
- }
116
- }, [options, value, keyExtractor]);
117
- const getDisplayValue = React.useCallback(() => {
187
+ },
188
+ [options, value, keyExtractor]
189
+ );
190
+ const getDisplayValue = React__namespace.useCallback(() => {
118
191
  if (Array.isArray(value)) {
119
- if (value.length === 0) return _placeholder;else {
120
- const options = selectOptions.length > 0 ? selectOptions : value;
121
- return options == null ? void 0 : options.reduce((acc, option, index) => value.find(key => keyExtractor(option, index) == keyExtractor(key, index)) ? acc + labelExtractor(option) + ', ' : acc, '').slice(0, -2);
192
+ if (value.length === 0)
193
+ return _placeholder;
194
+ else {
195
+ const options2 = selectOptions.length > 0 ? selectOptions : value;
196
+ return options2 == null ? void 0 : options2.reduce(
197
+ (acc, option, index) => value.find(
198
+ (key) => keyExtractor(option, index) == keyExtractor(key, index)
199
+ ) ? acc + labelExtractor(option) + ", " : acc,
200
+ ""
201
+ ).slice(0, -2);
122
202
  }
123
203
  } else {
124
- if (!value) return _placeholder;
125
- const selectedOption = selectOptions == null ? void 0 : selectOptions.find((option, index) => keyExtractor(option, index) == keyExtractor(value, index));
126
- return labelExtractor(selectedOption ?? value);
204
+ if (!value)
205
+ return _placeholder;
206
+ const selectedOption = selectOptions == null ? void 0 : selectOptions.find(
207
+ (option, index) => keyExtractor(option, index) == keyExtractor(value, index)
208
+ );
209
+ return labelExtractor(selectedOption != null ? selectedOption : value);
127
210
  }
128
211
  }, [_placeholder, value, selectOptions]);
129
- modal.sync(React.createElement(_Modal2.Modal, {
130
- options: selectOptions || [],
131
- focused: true,
132
- keyExtractor: keyExtractor,
133
- labelExtractor: labelExtractor,
134
- groupKeyExtractor: groupKeyExtractor,
135
- searchBarPlaceholder: searchBarPlaceholder,
136
- type: type,
137
- onSelect: onSelect,
138
- value: value,
139
- hideSearchBar: hideSearchBar,
140
- onSearch: handleOnSearch,
141
- selectModalTitle: selectModalTitle,
142
- selectModalTitleComponent: selectModalTitleComponent,
143
- confirmButtonText: confirmButtonText,
144
- loading: loading,
145
- onClose: handleBlur,
146
- closeOnPick: closeOnPick
147
- }));
148
-
212
+ modal.sync(
213
+ /* @__PURE__ */ React__namespace.createElement(Modal.Modal, {
214
+ options: selectOptions || [],
215
+ focused: true,
216
+ keyExtractor,
217
+ labelExtractor,
218
+ groupKeyExtractor,
219
+ searchBarPlaceholder,
220
+ type,
221
+ onSelect,
222
+ value,
223
+ hideSearchBar,
224
+ onSearch: handleOnSearch,
225
+ selectModalTitle,
226
+ selectModalTitleComponent,
227
+ confirmButtonText,
228
+ loading,
229
+ onClose: handleBlur,
230
+ closeOnPick
231
+ })
232
+ );
149
233
  const handlePressInput = async () => {
150
234
  modal.show();
151
235
  handleFocus();
152
236
  await handleLazyFocus();
153
237
  };
154
-
155
- return React.createElement(React.Fragment, null, controlComponent ? controlComponent(handlePressInput, getDisplayValue() || '') : React.createElement(_reactCore.HintInputContainer, _extends({
238
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, controlComponent ? controlComponent(handlePressInput, getDisplayValue() || "") : /* @__PURE__ */ React__namespace.createElement(reactCore.HintInputContainer, __spreadValues({
156
239
  viewStyle: style,
157
240
  onPress: handlePressInput,
158
- focused: focused,
159
- disabled: disabled,
160
- LabelComponent: _Text.Text,
161
- variant: variant,
162
- hint: hint,
163
- hintComponent: hintComponent,
241
+ focused,
242
+ disabled,
243
+ LabelComponent: Text,
244
+ variant,
245
+ hint,
246
+ hintComponent,
164
247
  label: _label,
165
- rightComponent: React.createElement(React.Fragment, null, React.createElement(_styled.SelectIcon, {
248
+ rightComponent: /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(styled.SelectIcon, {
166
249
  name: "chevron-down",
167
250
  type: "ionicon",
168
251
  size: "centi"
169
252
  }), rightComponent)
170
- }, rest), React.createElement(_styled.StyledSelectionText, {
171
- numberOfLines: numberOfLines,
253
+ }, rest), /* @__PURE__ */ React__namespace.createElement(styled.StyledSelectionText, {
254
+ numberOfLines,
172
255
  fontWeight: "bold",
173
- disabled: disabled
174
- }, getDisplayValue() || ' ')));
256
+ disabled
257
+ }, getDisplayValue() || " ")));
175
258
  }
176
259
 
177
- var _default = Select;
178
- exports.default = _default;
179
- //# sourceMappingURL=Select.js.map
260
+ module.exports = Select;
261
+ //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["Select","value","options","keyExtractor","groupKeyExtractor","onSelect","type","labelExtractor","placeholder","onFocus","onBlur","disabled","onSearch","selectModalTitle","selectModalTitleComponent","searchBarPlaceholder","hideSearchBar","confirmButtonText","rightComponent","variant","hintComponent","hint","style","controlComponent","closeOnPick","label","numberOfLines","rest","focused","handleBlur","handleFocus","useInputFocus","selectOptions","setSelectOptions","useState","modal","useLazyModalManager","loading","setLoading","onlyLabel","hasValue","length","_placeholder","_label","undefined","useEffect","handleLazyFocus","React","useCallback","result","find","v","e","handleOnSearch","searchInput","selectedValues","filter","current","requestUpdate","getDisplayValue","Array","isArray","reduce","acc","option","index","key","slice","selectedOption","sync","handlePressInput","show","Text"],"sources":["../../../../src/components/molecules/Select/Select.tsx"],"sourcesContent":["import {\n HintInputContainer,\n InputContainerProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { Modal } from './Modal';\nimport { SelectIcon, StyledSelectionText } from './styled';\n\nexport interface SelectNativeProps<Data, Type extends 'single' | 'multi'>\n extends Omit<InputContainerProps, 'value' | 'onChange' | 'onChangeText'> {\n options: ((searchInput?: string) => Promise<Data[]>) | Data[];\n onSelect: (\n option: Type extends 'single' ? Data | undefined : Data[]\n ) => never | void;\n value: Type extends 'single' ? Data | null | undefined : Data[];\n type: Type;\n\n keyExtractor: (t: Data, index?: number) => string;\n labelExtractor: (t: Data) => string;\n groupKeyExtractor?: (t: Data) => string;\n\n hideSearchBar?: boolean;\n placeholder?: string;\n onFocus?: () => void | never;\n onBlur?: () => void | never;\n onSearch?:\n | ((searchArg: string) => void)\n | ((searchInput?: string) => Promise<Data[]>)\n | never;\n searchBarPlaceholder?: string;\n confirmButtonText?: string;\n selectModalTitle?: string;\n selectModalTitleComponent?: JSX.Element;\n closeOnPick?: boolean;\n controlComponent?: (\n onPress: () => void,\n displayValue?: string\n ) => JSX.Element;\n numberOfLines?: number;\n}\n\nfunction Select<Data, Type extends 'single' | 'multi'>({\n /** Select props */\n value,\n options,\n keyExtractor,\n groupKeyExtractor,\n onSelect,\n type,\n labelExtractor,\n placeholder,\n onFocus,\n onBlur,\n disabled,\n onSearch,\n selectModalTitle,\n selectModalTitleComponent,\n searchBarPlaceholder,\n hideSearchBar,\n confirmButtonText,\n rightComponent,\n variant = 'default',\n hintComponent,\n hint,\n style,\n controlComponent,\n closeOnPick = type === 'single',\n label,\n numberOfLines,\n ...rest\n}: SelectNativeProps<Data, Type>): JSX.Element {\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n const [selectOptions, setSelectOptions] = useState<Data[]>([]);\n const modal = useLazyModalManager();\n\n // TODO: Add Skeleton to modal height when loading is true\n const [loading, setLoading] = useState<boolean>(false);\n\n const onlyLabel = label && !placeholder;\n const hasValue =\n type === 'single' ? !!value : ((value || []) as []).length > 0;\n const _placeholder = onlyLabel ? label : placeholder;\n const _label = hasValue ? label : undefined;\n\n useEffect(() => {\n if (typeof options !== 'function') {\n setSelectOptions(options);\n }\n }, [options]);\n\n const handleLazyFocus = React.useCallback(async () => {\n if (typeof options === 'function') {\n setLoading(true);\n try {\n const result = await options();\n if (result) {\n if (\n value &&\n !result.find(v => keyExtractor(value as Data) === keyExtractor(v))\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n }\n } catch (e) {\n // TODO: Catch error\n } finally {\n setLoading(false);\n }\n }\n }, [options, value, setSelectOptions]);\n\n const handleOnSearch = React.useCallback(\n async (searchInput: string | undefined) => {\n if (searchInput !== undefined && onSearch) {\n setLoading(true);\n try {\n const result = await onSearch(searchInput);\n if (result) {\n if (type === 'single') {\n if (\n value &&\n !result.find(\n v => keyExtractor(value as Data) === keyExtractor(v)\n )\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n } else {\n if ((value as Data[]).length > 0) {\n const selectedValues =\n (value as Data[]).filter(\n v =>\n !result.find(\n current =>\n keyExtractor(v as Data) === keyExtractor(current)\n )\n ) || [];\n setSelectOptions([...selectedValues, ...result]);\n } else {\n setSelectOptions(result);\n }\n }\n }\n } catch (e) {\n // TODO: Catch error\n } finally {\n modal.requestUpdate();\n setLoading(false);\n }\n }\n },\n [options, value, keyExtractor]\n );\n\n const getDisplayValue = React.useCallback(() => {\n if (Array.isArray(value)) {\n if (value.length === 0) return _placeholder;\n else {\n const options =\n selectOptions.length > 0 ? selectOptions : (value as Data[]);\n return options\n ?.reduce(\n (acc, option, index) =>\n value.find(\n key => keyExtractor(option, index) == keyExtractor(key, index)\n )\n ? acc + labelExtractor(option) + ', '\n : acc,\n ''\n )\n .slice(0, -2);\n }\n } else {\n if (!value) return _placeholder;\n const selectedOption = selectOptions?.find(\n (option, index) =>\n keyExtractor(option, index) == keyExtractor(value as Data, index)\n );\n return labelExtractor(selectedOption ?? (value as Data));\n }\n }, [_placeholder, value, selectOptions]);\n\n modal.sync(\n <Modal\n options={selectOptions || []}\n focused={true}\n keyExtractor={keyExtractor}\n labelExtractor={labelExtractor}\n groupKeyExtractor={groupKeyExtractor}\n searchBarPlaceholder={searchBarPlaceholder}\n type={type}\n onSelect={onSelect}\n value={value}\n hideSearchBar={hideSearchBar}\n onSearch={handleOnSearch}\n selectModalTitle={selectModalTitle}\n selectModalTitleComponent={selectModalTitleComponent}\n confirmButtonText={confirmButtonText}\n loading={loading}\n onClose={handleBlur}\n closeOnPick={closeOnPick}\n />\n );\n\n const handlePressInput = async () => {\n modal.show();\n handleFocus();\n await handleLazyFocus();\n };\n\n return (\n <>\n {controlComponent ? (\n controlComponent(handlePressInput, getDisplayValue() || '')\n ) : (\n <HintInputContainer\n viewStyle={style}\n onPress={handlePressInput}\n focused={focused}\n disabled={disabled}\n LabelComponent={Text}\n variant={variant}\n hint={hint}\n hintComponent={hintComponent}\n label={_label}\n rightComponent={\n <>\n <SelectIcon name=\"chevron-down\" type=\"ionicon\" size=\"centi\" />\n {rightComponent}\n </>\n }\n {...rest}\n >\n <StyledSelectionText\n numberOfLines={numberOfLines}\n fontWeight=\"bold\"\n disabled={disabled}\n >\n {getDisplayValue() || ' '}\n </StyledSelectionText>\n </HintInputContainer>\n )}\n </>\n );\n}\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAmCA,SAASA,MAAT,CAAuD;EAErDC,KAFqD;EAGrDC,OAHqD;EAIrDC,YAJqD;EAKrDC,iBALqD;EAMrDC,QANqD;EAOrDC,IAPqD;EAQrDC,cARqD;EASrDC,WATqD;EAUrDC,OAVqD;EAWrDC,MAXqD;EAYrDC,QAZqD;EAarDC,QAbqD;EAcrDC,gBAdqD;EAerDC,yBAfqD;EAgBrDC,oBAhBqD;EAiBrDC,aAjBqD;EAkBrDC,iBAlBqD;EAmBrDC,cAnBqD;EAoBrDC,OAAO,GAAG,SApB2C;EAqBrDC,aArBqD;EAsBrDC,IAtBqD;EAuBrDC,KAvBqD;EAwBrDC,gBAxBqD;EAyBrDC,WAAW,GAAGlB,IAAI,KAAK,QAzB8B;EA0BrDmB,KA1BqD;EA2BrDC,aA3BqD;EA4BrD,GAAGC;AA5BkD,CAAvD,EA6B+C;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GE,QAAQ,EAAEf;EAHZ,GAKGgD,eAAe,MAAM,GALxB,CAlBF,CAJJ,CADF;AAkCD;;eAEc3D,M"}
1
+ {"version":3,"file":"Select.js","sources":["../../../../src/components/molecules/Select/Select.tsx"],"sourcesContent":["import {\n HintInputContainer,\n InputContainerProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { useLazyModalManager } from '../../atoms/Modal';\nimport { Text } from '../../atoms/Text';\nimport { Modal } from './Modal';\nimport { SelectIcon, StyledSelectionText } from './styled';\n\nexport interface SelectNativeProps<Data, Type extends 'single' | 'multi'>\n extends Omit<InputContainerProps, 'value' | 'onChange' | 'onChangeText'> {\n options: ((searchInput?: string) => Promise<Data[]>) | Data[];\n onSelect: (\n option: Type extends 'single' ? Data | undefined : Data[]\n ) => never | void;\n value: Type extends 'single' ? Data | null | undefined : Data[];\n type: Type;\n\n keyExtractor: (t: Data, index?: number) => string;\n labelExtractor: (t: Data) => string;\n groupKeyExtractor?: (t: Data) => string;\n\n hideSearchBar?: boolean;\n placeholder?: string;\n onFocus?: () => void | never;\n onBlur?: () => void | never;\n onSearch?:\n | ((searchArg: string) => void)\n | ((searchInput?: string) => Promise<Data[]>)\n | never;\n searchBarPlaceholder?: string;\n confirmButtonText?: string;\n selectModalTitle?: string;\n selectModalTitleComponent?: JSX.Element;\n closeOnPick?: boolean;\n controlComponent?: (\n onPress: () => void,\n displayValue?: string\n ) => JSX.Element;\n numberOfLines?: number;\n}\n\nfunction Select<Data, Type extends 'single' | 'multi'>({\n /** Select props */\n value,\n options,\n keyExtractor,\n groupKeyExtractor,\n onSelect,\n type,\n labelExtractor,\n placeholder,\n onFocus,\n onBlur,\n disabled,\n onSearch,\n selectModalTitle,\n selectModalTitleComponent,\n searchBarPlaceholder,\n hideSearchBar,\n confirmButtonText,\n rightComponent,\n variant = 'default',\n hintComponent,\n hint,\n style,\n controlComponent,\n closeOnPick = type === 'single',\n label,\n numberOfLines,\n ...rest\n}: SelectNativeProps<Data, Type>): JSX.Element {\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n const [selectOptions, setSelectOptions] = useState<Data[]>([]);\n const modal = useLazyModalManager();\n\n // TODO: Add Skeleton to modal height when loading is true\n const [loading, setLoading] = useState<boolean>(false);\n\n const onlyLabel = label && !placeholder;\n const hasValue =\n type === 'single' ? !!value : ((value || []) as []).length > 0;\n const _placeholder = onlyLabel ? label : placeholder;\n const _label = hasValue ? label : undefined;\n\n useEffect(() => {\n if (typeof options !== 'function') {\n setSelectOptions(options);\n }\n }, [options]);\n\n const handleLazyFocus = React.useCallback(async () => {\n if (typeof options === 'function' && !onSearch) {\n setLoading(true);\n try {\n const result = await options();\n if (result) {\n if (\n value &&\n !result.find(v => keyExtractor(value as Data) === keyExtractor(v))\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n }\n } catch (e) {\n // TODO: Catch error\n } finally {\n setLoading(false);\n }\n }\n }, [options, value, setSelectOptions]);\n\n const handleOnSearch = React.useCallback(\n async (searchInput: string | undefined) => {\n if (searchInput !== undefined && onSearch) {\n setLoading(true);\n modal.requestUpdate();\n try {\n const result = await onSearch(searchInput);\n if (result) {\n if (type === 'single') {\n if (\n value &&\n !result.find(\n v => keyExtractor(value as Data) === keyExtractor(v)\n )\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n } else {\n if ((value as Data[])?.length) {\n const selectedValues =\n (value as Data[]).filter(\n v =>\n !result.find(\n current =>\n keyExtractor(v as Data) === keyExtractor(current)\n )\n ) || [];\n setSelectOptions([...selectedValues, ...result]);\n } else {\n setSelectOptions(result);\n }\n }\n }\n } catch (e) {\n // TODO: Catch error\n } finally {\n modal.requestUpdate();\n setLoading(false);\n }\n }\n },\n [options, value, keyExtractor]\n );\n\n const getDisplayValue = React.useCallback(() => {\n if (Array.isArray(value)) {\n if (value.length === 0) return _placeholder;\n else {\n const options =\n selectOptions.length > 0 ? selectOptions : (value as Data[]);\n return options\n ?.reduce(\n (acc, option, index) =>\n value.find(\n key => keyExtractor(option, index) == keyExtractor(key, index)\n )\n ? acc + labelExtractor(option) + ', '\n : acc,\n ''\n )\n .slice(0, -2);\n }\n } else {\n if (!value) return _placeholder;\n const selectedOption = selectOptions?.find(\n (option, index) =>\n keyExtractor(option, index) == keyExtractor(value as Data, index)\n );\n return labelExtractor(selectedOption ?? (value as Data));\n }\n }, [_placeholder, value, selectOptions]);\n\n modal.sync(\n <Modal\n options={selectOptions || []}\n focused={true}\n keyExtractor={keyExtractor}\n labelExtractor={labelExtractor}\n groupKeyExtractor={groupKeyExtractor}\n searchBarPlaceholder={searchBarPlaceholder}\n type={type}\n onSelect={onSelect}\n value={value}\n hideSearchBar={hideSearchBar}\n onSearch={handleOnSearch}\n selectModalTitle={selectModalTitle}\n selectModalTitleComponent={selectModalTitleComponent}\n confirmButtonText={confirmButtonText}\n loading={loading}\n onClose={handleBlur}\n closeOnPick={closeOnPick}\n />\n );\n\n const handlePressInput = async () => {\n modal.show();\n handleFocus();\n await handleLazyFocus();\n };\n\n return (\n <>\n {controlComponent ? (\n controlComponent(handlePressInput, getDisplayValue() || '')\n ) : (\n <HintInputContainer\n viewStyle={style}\n onPress={handlePressInput}\n focused={focused}\n disabled={disabled}\n LabelComponent={Text}\n variant={variant}\n hint={hint}\n hintComponent={hintComponent}\n label={_label}\n rightComponent={\n <>\n <SelectIcon name=\"chevron-down\" type=\"ionicon\" size=\"centi\" />\n {rightComponent}\n </>\n }\n {...rest}\n >\n <StyledSelectionText\n numberOfLines={numberOfLines}\n fontWeight=\"bold\"\n disabled={disabled}\n >\n {getDisplayValue() || ' '}\n </StyledSelectionText>\n </HintInputContainer>\n )}\n </>\n );\n}\n\nexport default Select;\n"],"names":["useInputFocus","useState","useLazyModalManager","useEffect","React","options","Modal","HintInputContainer","SelectIcon","StyledSelectionText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,IAAA;AAAA,IACA,aAAA;AAAA,IACA,KAAO,EAAA,MAAA;AAAA,IACP,cAAA,kGAEKH,gBAAA,CAAA,aAAA,CAAAI,iBAAA,EAAA;AAAA,MAAW,IAAK,EAAA,cAAA;AAAA,MAAe,IAAK,EAAA,SAAA;AAAA,MAAU,IAAK,EAAA,OAAA;AAAA,KAAQ,GAC3D,cACH,CAAA;AAAA,GAAA,EAEE,uBAEHJ,gBAAA,CAAA,aAAA,CAAAK,0BAAA,EAAA;AAAA,IACC,aAAA;AAAA,IACA,UAAW,EAAA,MAAA;AAAA,IACX,QAAA;AAAA,GAAA,EAEC,eAAgB,EAAA,IAAK,GACxB,CACF,CAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -1 +1,2 @@
1
- export { default as Select, SelectNativeProps } from './Select';
1
+ export { default as Select } from './Select';
2
+ export type { SelectNativeProps } from './Select';