@estuary-solutions/rn-core-ui 0.0.3

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 (304) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +743 -0
  3. package/dist/Accordion/Accordion.d.ts +5 -0
  4. package/dist/Accordion/Accordion.d.ts.map +1 -0
  5. package/dist/Accordion/Accordion.js +19 -0
  6. package/dist/Accordion/AccordionContext.d.ts +7 -0
  7. package/dist/Accordion/AccordionContext.d.ts.map +1 -0
  8. package/dist/Accordion/AccordionContext.js +3 -0
  9. package/dist/Accordion/AccordionGroup.d.ts +7 -0
  10. package/dist/Accordion/AccordionGroup.d.ts.map +1 -0
  11. package/dist/Accordion/AccordionGroup.js +32 -0
  12. package/dist/Accordion/AccordionItem.d.ts +5 -0
  13. package/dist/Accordion/AccordionItem.d.ts.map +1 -0
  14. package/dist/Accordion/AccordionItem.js +12 -0
  15. package/dist/Accordion/AccordionTree.d.ts +6 -0
  16. package/dist/Accordion/AccordionTree.d.ts.map +1 -0
  17. package/dist/Accordion/AccordionTree.js +4 -0
  18. package/dist/Accordion/AccordionTreeInternal.d.ts +5 -0
  19. package/dist/Accordion/AccordionTreeInternal.d.ts.map +1 -0
  20. package/dist/Accordion/AccordionTreeInternal.js +36 -0
  21. package/dist/Accordion/AccordionTreeWithGroup.d.ts +8 -0
  22. package/dist/Accordion/AccordionTreeWithGroup.d.ts.map +1 -0
  23. package/dist/Accordion/AccordionTreeWithGroup.js +11 -0
  24. package/dist/Accordion/index.d.ts +5 -0
  25. package/dist/Accordion/index.d.ts.map +1 -0
  26. package/dist/Accordion/index.js +4 -0
  27. package/dist/Accordion/types/AccordionTypes.d.ts +65 -0
  28. package/dist/Accordion/types/AccordionTypes.d.ts.map +1 -0
  29. package/dist/Accordion/types/AccordionTypes.js +1 -0
  30. package/dist/Avatars/Avatar.d.ts +20 -0
  31. package/dist/Avatars/Avatar.d.ts.map +1 -0
  32. package/dist/Avatars/Avatar.js +63 -0
  33. package/dist/Badges/Badge.d.ts +25 -0
  34. package/dist/Badges/Badge.d.ts.map +1 -0
  35. package/dist/Badges/Badge.js +75 -0
  36. package/dist/Breadcrumbs/Breadcrumb.d.ts +13 -0
  37. package/dist/Breadcrumbs/Breadcrumb.d.ts.map +1 -0
  38. package/dist/Breadcrumbs/Breadcrumb.js +63 -0
  39. package/dist/Button/Button.d.ts +7 -0
  40. package/dist/Button/Button.d.ts.map +1 -0
  41. package/dist/Button/Button.js +62 -0
  42. package/dist/Button/ButtonGradient.d.ts +5 -0
  43. package/dist/Button/ButtonGradient.d.ts.map +1 -0
  44. package/dist/Button/ButtonGradient.js +61 -0
  45. package/dist/Button/index.d.ts +4 -0
  46. package/dist/Button/index.d.ts.map +1 -0
  47. package/dist/Button/index.js +3 -0
  48. package/dist/Button/types/ButtonGradientTypes.d.ts +80 -0
  49. package/dist/Button/types/ButtonGradientTypes.d.ts.map +1 -0
  50. package/dist/Button/types/ButtonGradientTypes.js +1 -0
  51. package/dist/Button/types/ButtonTypes.d.ts +65 -0
  52. package/dist/Button/types/ButtonTypes.d.ts.map +1 -0
  53. package/dist/Button/types/ButtonTypes.js +1 -0
  54. package/dist/Buttons/Button.d.ts +23 -0
  55. package/dist/Buttons/Button.d.ts.map +1 -0
  56. package/dist/Buttons/Button.js +66 -0
  57. package/dist/Cards/Card.d.ts +22 -0
  58. package/dist/Cards/Card.d.ts.map +1 -0
  59. package/dist/Cards/Card.js +26 -0
  60. package/dist/Cards/CardActionArea.d.ts +13 -0
  61. package/dist/Cards/CardActionArea.d.ts.map +1 -0
  62. package/dist/Cards/CardActionArea.js +30 -0
  63. package/dist/Cards/CardActions.d.ts +14 -0
  64. package/dist/Cards/CardActions.d.ts.map +1 -0
  65. package/dist/Cards/CardActions.js +41 -0
  66. package/dist/Cards/CardContent.d.ts +13 -0
  67. package/dist/Cards/CardContent.d.ts.map +1 -0
  68. package/dist/Cards/CardContent.js +19 -0
  69. package/dist/Cards/CardHeader.d.ts +16 -0
  70. package/dist/Cards/CardHeader.d.ts.map +1 -0
  71. package/dist/Cards/CardHeader.js +61 -0
  72. package/dist/Cards/CardMedia.d.ts +23 -0
  73. package/dist/Cards/CardMedia.d.ts.map +1 -0
  74. package/dist/Cards/CardMedia.js +16 -0
  75. package/dist/Cards/Paper.d.ts +13 -0
  76. package/dist/Cards/Paper.d.ts.map +1 -0
  77. package/dist/Cards/Paper.js +42 -0
  78. package/dist/DraggableFlatList/CellDecorators.d.ts +21 -0
  79. package/dist/DraggableFlatList/CellDecorators.d.ts.map +1 -0
  80. package/dist/DraggableFlatList/CellDecorators.js +66 -0
  81. package/dist/DraggableFlatList/CellRendererComponent.d.ts +20 -0
  82. package/dist/DraggableFlatList/CellRendererComponent.d.ts.map +1 -0
  83. package/dist/DraggableFlatList/CellRendererComponent.js +146 -0
  84. package/dist/DraggableFlatList/DraggableFlatList.d.ts +9 -0
  85. package/dist/DraggableFlatList/DraggableFlatList.d.ts.map +1 -0
  86. package/dist/DraggableFlatList/DraggableFlatList.js +282 -0
  87. package/dist/DraggableFlatList/DraggableFlatList.web.d.ts +4 -0
  88. package/dist/DraggableFlatList/DraggableFlatList.web.d.ts.map +1 -0
  89. package/dist/DraggableFlatList/DraggableFlatList.web.js +248 -0
  90. package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts +9 -0
  91. package/dist/DraggableFlatList/NestableDraggableFlatList.d.ts.map +1 -0
  92. package/dist/DraggableFlatList/NestableDraggableFlatList.js +66 -0
  93. package/dist/DraggableFlatList/NestableScrollContainer.d.ts +5 -0
  94. package/dist/DraggableFlatList/NestableScrollContainer.d.ts.map +1 -0
  95. package/dist/DraggableFlatList/NestableScrollContainer.js +28 -0
  96. package/dist/DraggableFlatList/PlaceholderItem.d.ts +8 -0
  97. package/dist/DraggableFlatList/PlaceholderItem.d.ts.map +1 -0
  98. package/dist/DraggableFlatList/PlaceholderItem.js +44 -0
  99. package/dist/DraggableFlatList/RowItem.d.ts +13 -0
  100. package/dist/DraggableFlatList/RowItem.d.ts.map +1 -0
  101. package/dist/DraggableFlatList/RowItem.js +45 -0
  102. package/dist/DraggableFlatList/ScrollOffsetListener.d.ts +8 -0
  103. package/dist/DraggableFlatList/ScrollOffsetListener.d.ts.map +1 -0
  104. package/dist/DraggableFlatList/ScrollOffsetListener.js +13 -0
  105. package/dist/Flex/Flex.d.ts +12 -0
  106. package/dist/Flex/Flex.d.ts.map +1 -0
  107. package/dist/Flex/Flex.js +28 -0
  108. package/dist/Flex/Flex.types.d.ts +10 -0
  109. package/dist/Flex/Flex.types.d.ts.map +1 -0
  110. package/dist/Flex/Flex.types.js +1 -0
  111. package/dist/Flex/index.d.ts +4 -0
  112. package/dist/Flex/index.d.ts.map +1 -0
  113. package/dist/Flex/index.js +3 -0
  114. package/dist/LICENSE +20 -0
  115. package/dist/README.md +743 -0
  116. package/dist/SvgIcon/SvgIcon.d.ts +9 -0
  117. package/dist/SvgIcon/SvgIcon.d.ts.map +1 -0
  118. package/dist/SvgIcon/SvgIcon.js +39 -0
  119. package/dist/SvgIcon/components/IconAlertCircle.d.ts +4 -0
  120. package/dist/SvgIcon/components/IconAlertCircle.d.ts.map +1 -0
  121. package/dist/SvgIcon/components/IconAlertCircle.js +6 -0
  122. package/dist/SvgIcon/components/IconAngleLeft.d.ts +4 -0
  123. package/dist/SvgIcon/components/IconAngleLeft.d.ts.map +1 -0
  124. package/dist/SvgIcon/components/IconAngleLeft.js +6 -0
  125. package/dist/SvgIcon/components/IconAngleRight.d.ts +4 -0
  126. package/dist/SvgIcon/components/IconAngleRight.d.ts.map +1 -0
  127. package/dist/SvgIcon/components/IconAngleRight.js +6 -0
  128. package/dist/SvgIcon/components/IconCheckBox.d.ts +4 -0
  129. package/dist/SvgIcon/components/IconCheckBox.d.ts.map +1 -0
  130. package/dist/SvgIcon/components/IconCheckBox.js +6 -0
  131. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts +4 -0
  132. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.d.ts.map +1 -0
  133. package/dist/SvgIcon/components/IconCheckBoxOutlineBlank.js +6 -0
  134. package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts +4 -0
  135. package/dist/SvgIcon/components/IconCheckBoxWithBg.d.ts.map +1 -0
  136. package/dist/SvgIcon/components/IconCheckBoxWithBg.js +6 -0
  137. package/dist/SvgIcon/components/IconChevronDown.d.ts +4 -0
  138. package/dist/SvgIcon/components/IconChevronDown.d.ts.map +1 -0
  139. package/dist/SvgIcon/components/IconChevronDown.js +6 -0
  140. package/dist/SvgIcon/components/IconChevronUp.d.ts +4 -0
  141. package/dist/SvgIcon/components/IconChevronUp.d.ts.map +1 -0
  142. package/dist/SvgIcon/components/IconChevronUp.js +6 -0
  143. package/dist/SvgIcon/components/IconHome.d.ts +4 -0
  144. package/dist/SvgIcon/components/IconHome.d.ts.map +1 -0
  145. package/dist/SvgIcon/components/IconHome.js +6 -0
  146. package/dist/SvgIcon/components/IconPerson.d.ts +4 -0
  147. package/dist/SvgIcon/components/IconPerson.d.ts.map +1 -0
  148. package/dist/SvgIcon/components/IconPerson.js +6 -0
  149. package/dist/SvgIcon/components/IconPlayCircle.d.ts +4 -0
  150. package/dist/SvgIcon/components/IconPlayCircle.d.ts.map +1 -0
  151. package/dist/SvgIcon/components/IconPlayCircle.js +9 -0
  152. package/dist/SvgIcon/components/IconPlus.d.ts +4 -0
  153. package/dist/SvgIcon/components/IconPlus.d.ts.map +1 -0
  154. package/dist/SvgIcon/components/IconPlus.js +6 -0
  155. package/dist/SvgIcon/components/index.d.ts +13 -0
  156. package/dist/SvgIcon/components/index.d.ts.map +1 -0
  157. package/dist/SvgIcon/components/index.js +12 -0
  158. package/dist/SvgIcon/types/SvgIconTypes.d.ts +46 -0
  159. package/dist/SvgIcon/types/SvgIconTypes.d.ts.map +1 -0
  160. package/dist/SvgIcon/types/SvgIconTypes.js +1 -0
  161. package/dist/TextFields/TextField.d.ts +34 -0
  162. package/dist/TextFields/TextField.d.ts.map +1 -0
  163. package/dist/TextFields/TextField.js +400 -0
  164. package/dist/TextFields/index.d.ts +2 -0
  165. package/dist/TextFields/index.d.ts.map +1 -0
  166. package/dist/TextFields/index.js +1 -0
  167. package/dist/Texts/Text.d.ts +21 -0
  168. package/dist/Texts/Text.d.ts.map +1 -0
  169. package/dist/Texts/Text.js +49 -0
  170. package/dist/constants/DraggableFlatList/constants.d.ts +28 -0
  171. package/dist/constants/DraggableFlatList/constants.d.ts.map +1 -0
  172. package/dist/constants/DraggableFlatList/constants.js +25 -0
  173. package/dist/constants/DraggableFlatList/types.d.ts +65 -0
  174. package/dist/constants/DraggableFlatList/types.d.ts.map +1 -0
  175. package/dist/constants/DraggableFlatList/types.js +1 -0
  176. package/dist/constants/DraggableFlatList/types.web.d.ts +7 -0
  177. package/dist/constants/DraggableFlatList/types.web.d.ts.map +1 -0
  178. package/dist/constants/DraggableFlatList/types.web.js +1 -0
  179. package/dist/constants/consts.d.ts +16 -0
  180. package/dist/constants/consts.d.ts.map +1 -0
  181. package/dist/constants/consts.js +15 -0
  182. package/dist/constants/index.d.ts +3 -0
  183. package/dist/constants/index.d.ts.map +1 -0
  184. package/dist/constants/index.js +2 -0
  185. package/dist/constants/types.d.ts +22 -0
  186. package/dist/constants/types.d.ts.map +1 -0
  187. package/dist/constants/types.js +21 -0
  188. package/dist/context/DraggableFlatList/animatedValueContext.d.ts +29 -0
  189. package/dist/context/DraggableFlatList/animatedValueContext.d.ts.map +1 -0
  190. package/dist/context/DraggableFlatList/animatedValueContext.js +154 -0
  191. package/dist/context/DraggableFlatList/cellContext.d.ts +10 -0
  192. package/dist/context/DraggableFlatList/cellContext.d.ts.map +1 -0
  193. package/dist/context/DraggableFlatList/cellContext.js +18 -0
  194. package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts +13 -0
  195. package/dist/context/DraggableFlatList/draggableFlatListContext.d.ts.map +1 -0
  196. package/dist/context/DraggableFlatList/draggableFlatListContext.js +19 -0
  197. package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts +23 -0
  198. package/dist/context/DraggableFlatList/nestableScrollContainerContext.d.ts.map +1 -0
  199. package/dist/context/DraggableFlatList/nestableScrollContainerContext.js +36 -0
  200. package/dist/context/DraggableFlatList/propsContext.d.ts +9 -0
  201. package/dist/context/DraggableFlatList/propsContext.d.ts.map +1 -0
  202. package/dist/context/DraggableFlatList/propsContext.js +25 -0
  203. package/dist/context/DraggableFlatList/refContext.d.ts +20 -0
  204. package/dist/context/DraggableFlatList/refContext.d.ts.map +1 -0
  205. package/dist/context/DraggableFlatList/refContext.js +55 -0
  206. package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts +2 -0
  207. package/dist/hooks/DraggableFlatList/useAutoScroll.d.ts.map +1 -0
  208. package/dist/hooks/DraggableFlatList/useAutoScroll.js +77 -0
  209. package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts +9 -0
  210. package/dist/hooks/DraggableFlatList/useCellTranslate.d.ts.map +1 -0
  211. package/dist/hooks/DraggableFlatList/useCellTranslate.js +72 -0
  212. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts +12 -0
  213. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.d.ts.map +1 -0
  214. package/dist/hooks/DraggableFlatList/useNestedAutoScroll.js +77 -0
  215. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts +15 -0
  216. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.d.ts.map +1 -0
  217. package/dist/hooks/DraggableFlatList/useOnCellActiveAnimation.js +29 -0
  218. package/dist/hooks/DraggableFlatList/useStableCallback.d.ts +2 -0
  219. package/dist/hooks/DraggableFlatList/useStableCallback.d.ts.map +1 -0
  220. package/dist/hooks/DraggableFlatList/useStableCallback.js +11 -0
  221. package/dist/hooks/useTheme.d.ts +17 -0
  222. package/dist/hooks/useTheme.d.ts.map +1 -0
  223. package/dist/hooks/useTheme.js +12 -0
  224. package/dist/index.d.ts +23 -0
  225. package/dist/index.d.ts.map +1 -0
  226. package/dist/index.js +22 -0
  227. package/dist/themes/colors.d.ts +9 -0
  228. package/dist/themes/colors.d.ts.map +1 -0
  229. package/dist/themes/colors.js +201 -0
  230. package/dist/themes/elevationOverlay.d.ts +2 -0
  231. package/dist/themes/elevationOverlay.d.ts.map +1 -0
  232. package/dist/themes/elevationOverlay.js +12 -0
  233. package/dist/themes/fontSize.d.ts +23 -0
  234. package/dist/themes/fontSize.d.ts.map +1 -0
  235. package/dist/themes/fontSize.js +22 -0
  236. package/dist/themes/index.d.ts +5 -0
  237. package/dist/themes/index.d.ts.map +1 -0
  238. package/dist/themes/index.js +4 -0
  239. package/dist/themes/types/colorTypes.d.ts +665 -0
  240. package/dist/themes/types/colorTypes.d.ts.map +1 -0
  241. package/dist/themes/types/colorTypes.js +1 -0
  242. package/dist/utils/DraggableFlatList/typedMemo.d.ts +2 -0
  243. package/dist/utils/DraggableFlatList/typedMemo.d.ts.map +1 -0
  244. package/dist/utils/DraggableFlatList/typedMemo.js +2 -0
  245. package/dist/utils/cleanTagHTML.d.ts +22 -0
  246. package/dist/utils/cleanTagHTML.d.ts.map +1 -0
  247. package/dist/utils/cleanTagHTML.js +36 -0
  248. package/dist/utils/colors/color.d.ts +2 -0
  249. package/dist/utils/colors/color.d.ts.map +1 -0
  250. package/dist/utils/colors/color.js +6 -0
  251. package/dist/utils/colors/elevation.d.ts +7 -0
  252. package/dist/utils/colors/elevation.d.ts.map +1 -0
  253. package/dist/utils/colors/elevation.js +29 -0
  254. package/dist/utils/colors/index.d.ts +9 -0
  255. package/dist/utils/colors/index.d.ts.map +1 -0
  256. package/dist/utils/colors/index.js +7 -0
  257. package/dist/utils/converter.d.ts +47 -0
  258. package/dist/utils/converter.d.ts.map +1 -0
  259. package/dist/utils/converter.js +54 -0
  260. package/dist/utils/debounce.d.ts +36 -0
  261. package/dist/utils/debounce.d.ts.map +1 -0
  262. package/dist/utils/debounce.js +54 -0
  263. package/dist/utils/filters.d.ts +3 -0
  264. package/dist/utils/filters.d.ts.map +1 -0
  265. package/dist/utils/filters.js +10 -0
  266. package/dist/utils/fixedDistance.d.ts +16 -0
  267. package/dist/utils/fixedDistance.d.ts.map +1 -0
  268. package/dist/utils/fixedDistance.js +17 -0
  269. package/dist/utils/formatMoney.d.ts +30 -0
  270. package/dist/utils/formatMoney.d.ts.map +1 -0
  271. package/dist/utils/formatMoney.js +33 -0
  272. package/dist/utils/getOS.d.ts +6 -0
  273. package/dist/utils/getOS.d.ts.map +1 -0
  274. package/dist/utils/getOS.js +6 -0
  275. package/dist/utils/index.d.ts +13 -0
  276. package/dist/utils/index.d.ts.map +1 -0
  277. package/dist/utils/index.js +12 -0
  278. package/dist/utils/limitedString.d.ts +15 -0
  279. package/dist/utils/limitedString.d.ts.map +1 -0
  280. package/dist/utils/limitedString.js +19 -0
  281. package/dist/utils/resolutions.d.ts +65 -0
  282. package/dist/utils/resolutions.d.ts.map +1 -0
  283. package/dist/utils/resolutions.js +79 -0
  284. package/dist/utils/scale.d.ts +141 -0
  285. package/dist/utils/scale.d.ts.map +1 -0
  286. package/dist/utils/scale.js +141 -0
  287. package/documents/build.js +102 -0
  288. package/documents/buildFromRoot.js +49 -0
  289. package/documents/buildFromSample.js +40 -0
  290. package/documents/buildV2.js +98 -0
  291. package/documents/copyPackageToExample.js +31 -0
  292. package/example/RNCoreUISample/.eslintrc.js +10 -0
  293. package/example/RNCoreUISample/.prettierrc.js +7 -0
  294. package/example/RNCoreUISample/App.js +26 -0
  295. package/example/RNCoreUISample/README.md +104 -0
  296. package/example/RNCoreUISample/android/app/debug.keystore +0 -0
  297. package/example/RNCoreUISample/babel.config.js +29 -0
  298. package/example/RNCoreUISample/documents/storybook/manager.js +5 -0
  299. package/example/RNCoreUISample/fix_node_modules.js +12 -0
  300. package/example/RNCoreUISample/index.js +20 -0
  301. package/example/RNCoreUISample/jest.config.js +3 -0
  302. package/example/RNCoreUISample/metro.config.js +30 -0
  303. package/package.json +101 -0
  304. package/src/constants/DraggableFlatList/draggable.d.ts +12 -0
@@ -0,0 +1,400 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React from 'react';
14
+ import { View, TextInput, StyleSheet, Animated, Easing, } from 'react-native';
15
+ import { colors, fontSize } from '../themes';
16
+ import { WEB } from '../utils';
17
+ import Text from '../Texts/Text';
18
+ const DEFAULT_ROWS = 3;
19
+ const DEFAULT_MARGIN_TOP = 6;
20
+ const DEFAULT_PADDING = 12;
21
+ const DISABLED_COLOR = colors.disabled;
22
+ const FOCUSED_COLOR = colors.primary;
23
+ const ERROR_COLOR = colors.error;
24
+ const DEFAULT_COLOR = colors.gray_D1D2D4;
25
+ const MIN_HEIGHT = 48;
26
+ const TextField = (_a) => {
27
+ var { label, labelMinSize = fontSize._12, labelSize = fontSize._14, applyTopLabel = true, labelBackground, value, defaultValue, onChangeText, error, errorColor, focusedColor, helperText, helperTextColor, helperTextStyle, renderStartIcon, renderEndIcon, multiline = false, rows = DEFAULT_ROWS, maxRows, editable = true, containerStyle, inputContainerStyle, style, onFocus, onBlur } = _a, rest = __rest(_a, ["label", "labelMinSize", "labelSize", "applyTopLabel", "labelBackground", "value", "defaultValue", "onChangeText", "error", "errorColor", "focusedColor", "helperText", "helperTextColor", "helperTextStyle", "renderStartIcon", "renderEndIcon", "multiline", "rows", "maxRows", "editable", "containerStyle", "inputContainerStyle", "style", "onFocus", "onBlur"]);
28
+ const [internalValue, setInternalValue] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
29
+ const [focused, setFocused] = React.useState(false);
30
+ const [containerWidth, setContainerWidth] = React.useState(0);
31
+ const [containerHeight, setContainerHeight] = React.useState(0);
32
+ const [labelHeight, setLabelHeight] = React.useState(0);
33
+ const [helperHeight, setHelperHeight] = React.useState(0);
34
+ const [contentHeight, setContentHeight] = React.useState(null);
35
+ const [startIconWidth, setStartIconWidth] = React.useState(0);
36
+ const [endIconWidth, setEndIconWidth] = React.useState(0);
37
+ const [webInputHeight, setWebInputHeight] = React.useState();
38
+ const inputRef = React.useRef(null); //Handling dragging on Web
39
+ const isApplyStartIcon = typeof renderStartIcon === 'function';
40
+ const isApplyEndIcon = typeof renderEndIcon === 'function';
41
+ const labelMaxWidth = containerWidth -
42
+ (isApplyStartIcon ? startIconWidth : 0) -
43
+ (isApplyEndIcon ? endIconWidth : 0) -
44
+ DEFAULT_PADDING * 2;
45
+ const isControlled = value !== undefined;
46
+ const textValue = isControlled ? value : internalValue;
47
+ const hasError = Boolean(error);
48
+ const errorMessage = typeof error === 'string' ? error : undefined;
49
+ const floatAnim = React.useRef(new Animated.Value(textValue ? 1 : 0)).current;
50
+ const handleChange = React.useCallback((text) => {
51
+ if (!isControlled) {
52
+ setInternalValue(text);
53
+ }
54
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
55
+ }, [isControlled, onChangeText]);
56
+ const handleHideTopLabel = () => {
57
+ if (applyTopLabel) {
58
+ return undefined;
59
+ }
60
+ return floatAnim.interpolate({
61
+ inputRange: [0, 1],
62
+ outputRange: [1, 0],
63
+ });
64
+ };
65
+ const resolvePaddingSide = (rawStyle, isTop) => {
66
+ const style = StyleSheet.flatten(rawStyle);
67
+ const side = isTop ? 'paddingTop' : 'paddingBottom';
68
+ if (typeof (style === null || style === void 0 ? void 0 : style.paddingVertical) === 'number') {
69
+ return style.paddingVertical;
70
+ }
71
+ if (typeof (style === null || style === void 0 ? void 0 : style.padding) === 'number') {
72
+ return style.padding;
73
+ }
74
+ if (typeof (style === null || style === void 0 ? void 0 : style[side]) === 'number') {
75
+ return style[side];
76
+ }
77
+ return 0;
78
+ };
79
+ const resolvePadding = (userStyle, fallbackStyle, isTop) => {
80
+ const userPadding = resolvePaddingSide(userStyle, isTop);
81
+ if (userPadding !== 0)
82
+ return userPadding;
83
+ return resolvePaddingSide(fallbackStyle, isTop);
84
+ };
85
+ const calculatePadding = (isTop) => {
86
+ const containerPadding = resolvePadding(containerStyle, styles.container, isTop);
87
+ const inputPadding = resolvePadding(inputContainerStyle, styles.inputContainer, isTop);
88
+ const textInputPadding = resolvePadding(style, styles.input, isTop);
89
+ return containerPadding + inputPadding + textInputPadding;
90
+ };
91
+ const getInsetY = (alignVertical) => {
92
+ switch (alignVertical) {
93
+ case 'center':
94
+ return containerHeight / 2 - labelHeight;
95
+ case 'bottom':
96
+ return containerHeight - helperHeight - DEFAULT_MARGIN_TOP - labelHeight - calculatePadding(false);
97
+ case 'top':
98
+ default:
99
+ return calculatePadding(true);
100
+ }
101
+ };
102
+ const resolveTextAlignVertical = () => {
103
+ var _a;
104
+ const textInputStyle = StyleSheet.flatten(style);
105
+ if (WEB) { //Web only support textAlignVertical top
106
+ return 'top';
107
+ }
108
+ return (_a = textInputStyle === null || textInputStyle === void 0 ? void 0 : textInputStyle.textAlignVertical) !== null && _a !== void 0 ? _a : 'top';
109
+ };
110
+ const textAlignVertical = resolveTextAlignVertical();
111
+ const multilineStyle = React.useMemo(() => {
112
+ if (!multiline || !contentHeight) {
113
+ return null;
114
+ }
115
+ const padding = resolvePadding(style, styles.input, true) +
116
+ resolvePadding(style, styles.input, false);
117
+ return {
118
+ minHeight: rows ? rows * (contentHeight - (WEB ? padding * 1.9 : padding / 1.3)) : undefined,
119
+ maxHeight: maxRows ? maxRows * (contentHeight - padding / 1.1) : undefined, // maxHeight not work for auto add new line with maxRows on Web. Use height instead.
120
+ };
121
+ }, [multiline, rows, maxRows, contentHeight]);
122
+ const multilineWebStyle = React.useMemo(() => {
123
+ if (!multiline || !WEB || !contentHeight || !webInputHeight) {
124
+ return null;
125
+ }
126
+ const padding = resolvePadding(style, styles.input, true) +
127
+ resolvePadding(style, styles.input, false);
128
+ const minHeight = rows ? rows * (contentHeight - padding * 1.9) : 0;
129
+ const maxHeight = maxRows ? maxRows * (contentHeight - padding * 1.9) : 0;
130
+ if (webInputHeight > maxHeight) {
131
+ return {
132
+ height: maxHeight
133
+ };
134
+ }
135
+ if (webInputHeight > minHeight && webInputHeight <= maxHeight) {
136
+ return {
137
+ height: webInputHeight
138
+ };
139
+ }
140
+ return null;
141
+ }, [multiline, rows, maxRows, contentHeight, webInputHeight]);
142
+ const labelInsetY = React.useMemo(() => getInsetY(textAlignVertical), [
143
+ textAlignVertical,
144
+ style,
145
+ inputContainerStyle,
146
+ containerStyle,
147
+ containerHeight,
148
+ helperHeight,
149
+ labelHeight
150
+ ]);
151
+ const renderBackgroundLabel = () => {
152
+ if (labelBackground) {
153
+ return labelBackground;
154
+ }
155
+ if (!editable) {
156
+ return DISABLED_COLOR;
157
+ }
158
+ return colors.white;
159
+ };
160
+ const renderLabelColor = () => {
161
+ if (hasError) {
162
+ if (errorColor) {
163
+ return errorColor;
164
+ }
165
+ return ERROR_COLOR;
166
+ }
167
+ if (focused) {
168
+ if (focusedColor) {
169
+ return focusedColor;
170
+ }
171
+ return FOCUSED_COLOR;
172
+ }
173
+ return DEFAULT_COLOR;
174
+ };
175
+ const renderInputBorderColor = () => {
176
+ if (hasError) {
177
+ if (errorColor) {
178
+ return errorColor;
179
+ }
180
+ return ERROR_COLOR;
181
+ }
182
+ if (focused) {
183
+ if (focusedColor) {
184
+ return focusedColor;
185
+ }
186
+ return FOCUSED_COLOR;
187
+ }
188
+ return DEFAULT_COLOR;
189
+ };
190
+ const renderHelperTextColor = () => {
191
+ if (helperTextColor) {
192
+ return helperTextColor;
193
+ }
194
+ if (hasError) {
195
+ if (errorColor) {
196
+ return errorColor;
197
+ }
198
+ return ERROR_COLOR;
199
+ }
200
+ if (!editable) {
201
+ return DEFAULT_COLOR;
202
+ }
203
+ return colors.black;
204
+ };
205
+ const labelViewStyle = {
206
+ position: 'absolute',
207
+ left: isApplyStartIcon ? startIconWidth + DEFAULT_PADDING : DEFAULT_PADDING,
208
+ top: applyTopLabel ? floatAnim.interpolate({
209
+ inputRange: [0, 1],
210
+ outputRange: [labelInsetY, -labelMinSize / 1.5],
211
+ }) : labelInsetY,
212
+ maxWidth: labelMaxWidth,
213
+ overflow: 'hidden',
214
+ backgroundColor: renderBackgroundLabel(),
215
+ paddingHorizontal: DEFAULT_PADDING,
216
+ opacity: handleHideTopLabel(),
217
+ borderRadius: 5
218
+ };
219
+ const labelStyle = {
220
+ fontSize: applyTopLabel ? floatAnim.interpolate({
221
+ inputRange: [0, 1],
222
+ outputRange: [labelSize, labelMinSize],
223
+ }) : labelSize,
224
+ color: renderLabelColor(),
225
+ };
226
+ React.useEffect(() => {
227
+ Animated.timing(floatAnim, {
228
+ toValue: focused || textValue ? 1 : 0,
229
+ duration: 180,
230
+ easing: Easing.out(Easing.ease),
231
+ useNativeDriver: false,
232
+ }).start();
233
+ }, [focused, textValue, floatAnim]);
234
+ React.useEffect(() => {
235
+ if (!WEB || !multiline) {
236
+ return;
237
+ }
238
+ const el = inputRef.current;
239
+ if (!el) {
240
+ return;
241
+ }
242
+ let isDragging = false;
243
+ let startY = 0;
244
+ let startScrollTop = 0;
245
+ const onMouseDown = (e) => {
246
+ isDragging = true;
247
+ startY = e.clientY;
248
+ startScrollTop = el.scrollTop;
249
+ };
250
+ const onMouseMove = (e) => {
251
+ if (!isDragging) {
252
+ return;
253
+ }
254
+ el.scrollTop = startScrollTop - (e.clientY - startY);
255
+ };
256
+ const onMouseUp = () => {
257
+ isDragging = false;
258
+ };
259
+ el.addEventListener('mousedown', onMouseDown);
260
+ window.addEventListener('mousemove', onMouseMove);
261
+ window.addEventListener('mouseup', onMouseUp);
262
+ return () => {
263
+ el.removeEventListener('mousedown', onMouseDown);
264
+ window.removeEventListener('mousemove', onMouseMove);
265
+ window.removeEventListener('mouseup', onMouseUp);
266
+ };
267
+ }, [multiline]);
268
+ const multilineStyleSignature = React.useMemo(() => {
269
+ if (!style)
270
+ return '';
271
+ const s = Array.isArray(style)
272
+ ? Object.assign({}, ...style)
273
+ : style;
274
+ return [
275
+ s.minHeight,
276
+ s.maxHeight,
277
+ s.paddingTop,
278
+ s.paddingBottom,
279
+ s.lineHeight,
280
+ s.fontSize,
281
+ ].join('|');
282
+ }, [style]);
283
+ React.useEffect(() => {
284
+ let timeoutID;
285
+ if (contentHeight) {
286
+ handleChange('');
287
+ timeoutID = setTimeout(() => setContentHeight(null), 1000); //Wait until the text change for onContentSizeChange get the init height before reset multilineStyle
288
+ }
289
+ return () => {
290
+ if (timeoutID) {
291
+ clearTimeout(timeoutID);
292
+ }
293
+ };
294
+ }, [multilineStyleSignature]);
295
+ return (_jsxs(View, { onLayout: e => {
296
+ var _a, _b, _c, _d;
297
+ setContainerWidth((_b = (_a = e === null || e === void 0 ? void 0 : e.nativeEvent) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.width);
298
+ setContainerHeight((_d = (_c = e === null || e === void 0 ? void 0 : e.nativeEvent) === null || _c === void 0 ? void 0 : _c.layout) === null || _d === void 0 ? void 0 : _d.height);
299
+ }, style: [styles.container, containerStyle], children: [_jsxs(View, { style: [
300
+ styles.inputContainer,
301
+ { borderColor: renderInputBorderColor() },
302
+ !editable && styles.disabled,
303
+ inputContainerStyle,
304
+ ], children: [label && (_jsx(Animated.View, { pointerEvents: 'none', onLayout: e => {
305
+ var _a, _b;
306
+ setLabelHeight((_b = (_a = e === null || e === void 0 ? void 0 : e.nativeEvent) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.height);
307
+ }, style: labelViewStyle, children: _jsx(Animated.Text, { numberOfLines: 1, ellipsizeMode: "tail", style: labelStyle, children: label }) })), isApplyStartIcon && (_jsx(View, { style: styles.iconStart, onLayout: e => {
308
+ setStartIconWidth(e.nativeEvent.layout.width);
309
+ }, children: renderStartIcon({
310
+ focused: focused,
311
+ hasError: hasError,
312
+ editable: editable,
313
+ }) })), _jsx(TextInput, Object.assign({}, rest, { ref: inputRef, style: [
314
+ styles.input,
315
+ multiline && styles.multiline,
316
+ multilineStyle,
317
+ multilineWebStyle,
318
+ WEB && !editable && styles.webDisabled,
319
+ !editable && styles.inputDisabled,
320
+ style,
321
+ ], value: textValue, onChangeText: handleChange, editable: editable, multiline: multiline, onFocus: e => {
322
+ if (!editable) {
323
+ return;
324
+ }
325
+ setFocused(true);
326
+ onFocus && onFocus(e);
327
+ }, onBlur: e => {
328
+ setFocused(false);
329
+ onBlur && onBlur(e);
330
+ }, onContentSizeChange: e => {
331
+ if (multiline && WEB) {
332
+ setWebInputHeight(e.nativeEvent.contentSize.height);
333
+ }
334
+ if (!multiline || contentHeight) {
335
+ return;
336
+ }
337
+ setContentHeight(e.nativeEvent.contentSize.height);
338
+ } })), isApplyEndIcon && (_jsx(View, { style: styles.iconEnd, onLayout: e => {
339
+ var _a, _b;
340
+ setEndIconWidth((_b = (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.width);
341
+ }, children: renderEndIcon({
342
+ focused: focused,
343
+ hasError: hasError,
344
+ editable: editable,
345
+ }) }))] }), (errorMessage || helperText) && (_jsx(Text, { color: renderHelperTextColor(), onLayout: e => {
346
+ var _a, _b;
347
+ setHelperHeight((_b = (_a = e === null || e === void 0 ? void 0 : e.nativeEvent) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.height);
348
+ }, style: [styles.helperText, helperTextStyle], children: errorMessage !== null && errorMessage !== void 0 ? errorMessage : helperText }))] }));
349
+ };
350
+ const styles = StyleSheet.create({
351
+ container: {
352
+ width: '100%',
353
+ },
354
+ inputContainer: {
355
+ minHeight: MIN_HEIGHT,
356
+ borderWidth: 1,
357
+ borderColor: DEFAULT_COLOR,
358
+ borderRadius: 8,
359
+ flexDirection: 'row',
360
+ alignItems: 'center',
361
+ paddingHorizontal: DEFAULT_PADDING,
362
+ backgroundColor: colors.white,
363
+ },
364
+ focusedBorder: {
365
+ borderColor: FOCUSED_COLOR,
366
+ },
367
+ input: Object.assign({ flex: 1, fontSize: fontSize._14, color: colors.black, paddingVertical: DEFAULT_PADDING }, (WEB
368
+ ? {
369
+ outlineStyle: 'none',
370
+ overflow: 'hidden',
371
+ }
372
+ : {})),
373
+ multiline: {
374
+ textAlignVertical: 'top',
375
+ alignItems: 'flex-start'
376
+ },
377
+ iconStart: {
378
+ marginRight: DEFAULT_PADDING,
379
+ },
380
+ iconEnd: {
381
+ marginLeft: DEFAULT_PADDING,
382
+ },
383
+ helperText: {
384
+ marginTop: DEFAULT_MARGIN_TOP,
385
+ fontSize: WEB ? fontSize._10 : fontSize._12,
386
+ paddingHorizontal: DEFAULT_PADDING
387
+ },
388
+ disabled: {
389
+ backgroundColor: DISABLED_COLOR,
390
+ },
391
+ webDisabled: Object.assign({}, (WEB
392
+ ? {
393
+ cursor: 'not-allowed',
394
+ }
395
+ : {})),
396
+ inputDisabled: {
397
+ color: DEFAULT_COLOR
398
+ }
399
+ });
400
+ export default TextField;
@@ -0,0 +1,2 @@
1
+ export { default as TextField } from './TextField';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as TextField } from './TextField';
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { TextProps as RNTextProps, TextStyle, StyleProp } from 'react-native';
3
+ export interface TextProps extends RNTextProps {
4
+ style?: StyleProp<TextStyle>;
5
+ color?: string;
6
+ bold?: boolean;
7
+ italic?: boolean;
8
+ light?: boolean;
9
+ medium?: boolean;
10
+ semiBold?: boolean;
11
+ size?: number;
12
+ thin?: boolean;
13
+ children?: React.ReactNode;
14
+ }
15
+ /**
16
+ * Text component for displaying text with custom styles and loading state.
17
+ * This component also have its own view and can easily be customized.
18
+ */
19
+ declare const Text: React.FC<TextProps>;
20
+ export default Text;
21
+ //# sourceMappingURL=Text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Texts/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,IAAI,WAAW,EACxB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAyC7B,CAAC;AAQF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,49 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { StyleSheet, Text as RNText, } from 'react-native';
14
+ import { colors, fontSize } from '../themes';
15
+ /**
16
+ * Text component for displaying text with custom styles and loading state.
17
+ * This component also have its own view and can easily be customized.
18
+ */
19
+ const Text = (_a) => {
20
+ var { bold = false, color = colors.black, italic = false, light = false, medium = false, semiBold = false, size = fontSize._16, style = {}, thin = false } = _a, rest = __rest(_a, ["bold", "color", "italic", "light", "medium", "semiBold", "size", "style", "thin"]);
21
+ let textStyle = {
22
+ color,
23
+ fontSize: size,
24
+ fontStyle: italic ? 'italic' : 'normal',
25
+ fontWeight: '400'
26
+ };
27
+ if (bold) {
28
+ textStyle.fontWeight = '700';
29
+ }
30
+ if (semiBold) {
31
+ textStyle.fontWeight = '600';
32
+ }
33
+ if (medium) {
34
+ textStyle.fontWeight = '500';
35
+ }
36
+ if (light) {
37
+ textStyle.fontWeight = '300';
38
+ }
39
+ if (thin) {
40
+ textStyle.fontWeight = '100';
41
+ }
42
+ return _jsx(RNText, Object.assign({}, rest, { style: [styles.textDefault, textStyle, style] }));
43
+ };
44
+ const styles = StyleSheet.create({
45
+ textDefault: {
46
+ color: colors.black,
47
+ },
48
+ });
49
+ export default Text;
@@ -0,0 +1,28 @@
1
+ import { PanGestureHandlerProperties } from "react-native-gesture-handler";
2
+ import { WithSpringConfig } from "react-native-reanimated";
3
+ export declare const SCROLL_POSITION_TOLERANCE = 2;
4
+ export declare const DEFAULT_ANIMATION_CONFIG: WithSpringConfig;
5
+ export declare const DEFAULT_PROPS: {
6
+ autoscrollThreshold: number;
7
+ autoscrollSpeed: number;
8
+ animationConfig: {
9
+ stiffness?: number;
10
+ overshootClamping?: boolean;
11
+ restDisplacementThreshold?: number;
12
+ restSpeedThreshold?: number;
13
+ velocity?: number;
14
+ reduceMotion?: import("react-native-reanimated").ReduceMotion;
15
+ } & {
16
+ mass?: number;
17
+ damping?: number;
18
+ duration?: never;
19
+ dampingRatio?: never;
20
+ clamp?: never;
21
+ };
22
+ scrollEnabled: boolean;
23
+ dragHitSlop: PanGestureHandlerProperties["hitSlop"];
24
+ activationDistance: number;
25
+ dragItemOverflow: boolean;
26
+ };
27
+ export declare const isReanimatedV2 = true;
28
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants/DraggableFlatList/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAEL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,wBAAwB,EAAE,gBAOtC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;iBAKN,2BAA2B,CAAC,SAAS,CAAC;;;CAGzD,CAAC;AAGF,eAAO,MAAM,cAAc,OAAmB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { useSharedValue, } from "react-native-reanimated";
2
+ // Fire onScrollComplete when within this many px of target offset
3
+ export const SCROLL_POSITION_TOLERANCE = 2;
4
+ export const DEFAULT_ANIMATION_CONFIG = {
5
+ damping: 20,
6
+ mass: 0.2,
7
+ stiffness: 100,
8
+ overshootClamping: false,
9
+ restSpeedThreshold: 0.2,
10
+ restDisplacementThreshold: 0.2,
11
+ };
12
+ export const DEFAULT_PROPS = {
13
+ autoscrollThreshold: 30,
14
+ autoscrollSpeed: 100,
15
+ animationConfig: DEFAULT_ANIMATION_CONFIG,
16
+ scrollEnabled: true,
17
+ dragHitSlop: 0,
18
+ activationDistance: 0,
19
+ dragItemOverflow: false,
20
+ };
21
+ // Is there a better way to check for v2?
22
+ export const isReanimatedV2 = !!useSharedValue;
23
+ if (!isReanimatedV2) {
24
+ throw new Error("Your version of react-native-reanimated is too old for react-native-draggable-flatlist!");
25
+ }
@@ -0,0 +1,65 @@
1
+ import React from "react";
2
+ import { FlatListProps, LayoutChangeEvent, StyleProp, ViewStyle } from "react-native";
3
+ import { FlatList } from "react-native-gesture-handler";
4
+ import Animated, { AnimateProps, WithSpringConfig } from "react-native-reanimated";
5
+ import { useAnimatedValues } from "../../context/DraggableFlatList/animatedValueContext";
6
+ import { DEFAULT_PROPS } from "./constants";
7
+ export type DragEndParams<T> = {
8
+ data: T[];
9
+ from: number;
10
+ to: number;
11
+ };
12
+ type Modify<T, R> = Omit<T, keyof R> & R;
13
+ type DefaultProps = Readonly<typeof DEFAULT_PROPS>;
14
+ export type DraggableFlatListProps<T> = Modify<FlatListProps<T>, {
15
+ data: T[];
16
+ activationDistance?: number;
17
+ animationConfig?: Partial<WithSpringConfig>;
18
+ autoscrollSpeed?: number;
19
+ autoscrollThreshold?: number;
20
+ containerStyle?: StyleProp<ViewStyle>;
21
+ debug?: boolean;
22
+ dragItemOverflow?: boolean;
23
+ keyExtractor: (item: T, index: number) => string;
24
+ onDragBegin?: (index: number) => void;
25
+ onDragEnd?: (params: DragEndParams<T>) => void;
26
+ onPlaceholderIndexChange?: (placeholderIndex: number) => void;
27
+ onRelease?: (index: number) => void;
28
+ onScrollOffsetChange?: (scrollOffset: number) => void;
29
+ renderItem: RenderItem<T>;
30
+ renderPlaceholder?: RenderPlaceholder<T>;
31
+ simultaneousHandlers?: React.Ref<any> | React.Ref<any>[];
32
+ outerScrollOffset?: Animated.SharedValue<number>;
33
+ onAnimValInit?: (animVals: ReturnType<typeof useAnimatedValues>) => void;
34
+ itemEnteringAnimation?: AnimateProps<Animated.View>["entering"];
35
+ itemExitingAnimation?: AnimateProps<Animated.View>["exiting"];
36
+ itemLayoutAnimation?: AnimateProps<Animated.View>["layout"];
37
+ enableLayoutAnimationExperimental?: boolean;
38
+ onContainerLayout?: (params: {
39
+ layout: LayoutChangeEvent["nativeEvent"]["layout"];
40
+ containerRef: React.RefObject<Animated.View>;
41
+ }) => void;
42
+ } & Partial<DefaultProps>>;
43
+ export type RenderPlaceholder<T> = (params: {
44
+ item: T;
45
+ index: number;
46
+ }) => JSX.Element;
47
+ export type RenderItemParams<T> = {
48
+ item: T;
49
+ getIndex: () => number | undefined;
50
+ drag: () => void;
51
+ isActive: boolean;
52
+ };
53
+ export type RenderItem<T> = (params: RenderItemParams<T>) => React.ReactNode;
54
+ export type AnimatedFlatListType = <T>(props: Animated.AnimateProps<FlatListProps<T> & {
55
+ ref: React.Ref<FlatList<T>>;
56
+ simultaneousHandlers?: React.Ref<any> | React.Ref<any>[];
57
+ }>) => React.ReactElement;
58
+ export type CellData = {
59
+ measurements: {
60
+ size: number;
61
+ offset: number;
62
+ };
63
+ };
64
+ export {};
65
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/constants/DraggableFlatList/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { DraggableFlatListProps, RenderItemParams } from "../DraggableFlatList/types";
3
+ export interface WebDraggableFlatListProps<T> extends Omit<DraggableFlatListProps<T>, "renderItem" | "containerStyle"> {
4
+ renderItem: (params: RenderItemParams<T>) => React.ReactNode;
5
+ containerStyle?: React.CSSProperties;
6
+ }
7
+ //# sourceMappingURL=types.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.web.d.ts","sourceRoot":"","sources":["../../../src/constants/DraggableFlatList/types.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,IAAI,CACxD,sBAAsB,CAAC,CAAC,CAAC,EACzB,YAAY,GAAG,gBAAgB,CAChC;IACC,UAAU,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7D,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export declare const FORMAT_TIME_DMY_ = "DD/MM/YYYY";
2
+ export declare const FORMAT_TIME_DMY = "DD-MM-YYYY";
3
+ export declare const FORMAT_TIME = "YYYY-MM-DD HH:mm";
4
+ export declare const FORMAT_TIME_DMYHMS = "DD/MM/YYYY HH:mm:ss";
5
+ export declare const FORMAT_TIME_DMYHM = "DD/MM/YYYY HH:mm";
6
+ export declare const FORMAT_TIME_VH = "MMMM DD, YYYY HH:mm";
7
+ export declare const FORMAT_TIME_DDMMM = "DD MMM";
8
+ export declare const FORMAT_TIME_YMD = "YYYY-MM-DD";
9
+ export declare const FORMAT_TIME_FILTER = "DD/MM/YY";
10
+ export declare const FORMAT_TIME_L = "L";
11
+ export declare const FORMAT_TIME_LL = "LL";
12
+ export declare const FORMAT_TIME_LLL = "LLL";
13
+ export declare const FORMAT_TIME_LLLL = "LLLL";
14
+ export declare const FORMAT_TIME_LT = "LT";
15
+ export declare const FORMAT_TIME_LTS = "LTS";
16
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/constants/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAE9C,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AAExD,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAE7C,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,gBAAgB,SAAS,CAAC;AACvC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,eAAe,QAAQ,CAAC"}