@fto-consult/expo-ui 3.4.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/bin/index.js +99 -99
  2. package/package.json +3 -3
  3. package/src/components/{AutoResizer/index.js → AutoSizer/AutoResizer.js} +0 -0
  4. package/src/components/AutoSizer/Vertical.js +88 -0
  5. package/src/components/AutoSizer/index.js +3 -0
  6. package/src/components/Countries/resources/countries-normalized.json +1987 -1987
  7. package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
  8. package/src/components/Countries/resources/countries.sql +243 -243
  9. package/src/components/Datagrid/Accordion/index.js +1 -3
  10. package/src/components/Datagrid/Common/Common.js +6 -0
  11. package/src/components/Datagrid/SWRDatagrid.js +2 -0
  12. package/src/components/Datagrid/Table/index.js +5 -10
  13. package/src/components/ScrollView/index copy.js +38 -0
  14. package/src/components/ScrollView/index.back.js +84 -0
  15. package/src/components/ScrollView/index.js +24 -68
  16. package/src/components/ScrollView/index.withWeb.js +83 -0
  17. package/src/components/Table/AbsoluteScrollView.js +13 -3
  18. package/src/components/Table/{List.js → List/List.js} +1 -1
  19. package/src/components/Table/{List.native.js → List/List.native.js} +0 -0
  20. package/src/components/Table/List/index.js +15 -0
  21. package/src/components/Table/index.js +1 -2
  22. package/src/layouts/Screen/TableData.js +7 -3
  23. package/src/layouts/Screen/utils.js +5 -2
  24. package/electron/dist/asset-manifest.json +0 -221
  25. package/electron/dist/favicon-16.png +0 -0
  26. package/electron/dist/favicon-32.png +0 -0
  27. package/electron/dist/favicon.ico +0 -0
  28. package/electron/dist/fonts/AntDesign.ttf +0 -0
  29. package/electron/dist/fonts/FontAwesome5_Brands.ttf +0 -0
  30. package/electron/dist/fonts/FontAwesome5_Solid.ttf +0 -0
  31. package/electron/dist/fonts/Fontisto.ttf +0 -0
  32. package/electron/dist/fonts/Foundation.ttf +0 -0
  33. package/electron/dist/fonts/Ionicons.ttf +0 -0
  34. package/electron/dist/fonts/MaterialCommunityIcons.ttf +0 -0
  35. package/electron/dist/fonts/MaterialIcons.ttf +0 -0
  36. package/electron/dist/fonts/SimpleLineIcons.ttf +0 -0
  37. package/electron/dist/index.html +0 -1
  38. package/electron/dist/manifest.json +0 -35
  39. package/electron/dist/pwa/apple-touch-icon/apple-touch-icon-180.png +0 -0
  40. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1125x2436.png +0 -0
  41. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2208.png +0 -0
  42. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2688.png +0 -0
  43. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1536x2048.png +0 -0
  44. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2224.png +0 -0
  45. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2388.png +0 -0
  46. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-2048x2732.png +0 -0
  47. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-640x1136.png +0 -0
  48. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-750x1334.png +0 -0
  49. package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-828x1792.png +0 -0
  50. package/electron/dist/pwa/chrome-icon/chrome-icon-144.png +0 -0
  51. package/electron/dist/pwa/chrome-icon/chrome-icon-192.png +0 -0
  52. package/electron/dist/pwa/chrome-icon/chrome-icon-512.png +0 -0
  53. package/electron/dist/serve.json +0 -13
  54. package/electron/dist/static/js/2.e3d2de23.chunk.js +0 -2
  55. package/electron/dist/static/js/2.e3d2de23.chunk.js.LICENSE.txt +0 -118
  56. package/electron/dist/static/js/app.6a0a3d72.chunk.js +0 -1
  57. package/electron/dist/static/js/runtime~app.318494c4.js +0 -1
  58. package/electron/dist/static/media/ad.897c877d.png +0 -0
  59. package/electron/dist/static/media/add_photo.255dd6dd.png +0 -0
  60. package/electron/dist/static/media/af.9d0ab233.png +0 -0
  61. package/electron/dist/static/media/ag.152f8fb1.png +0 -0
  62. package/electron/dist/static/media/ai.81342ed3.png +0 -0
  63. package/electron/dist/static/media/al.3ba17dc1.png +0 -0
  64. package/electron/dist/static/media/ao.ff6d0e82.png +0 -0
  65. package/electron/dist/static/media/ar.a157e7e8.png +0 -0
  66. package/electron/dist/static/media/as.af7d5792.png +0 -0
  67. package/electron/dist/static/media/au.d8b2590e.png +0 -0
  68. package/electron/dist/static/media/aw.27c4c0ae.png +0 -0
  69. package/electron/dist/static/media/ax.568ed280.png +0 -0
  70. package/electron/dist/static/media/az.bb76a7dc.png +0 -0
  71. package/electron/dist/static/media/ba.0e3d844b.png +0 -0
  72. package/electron/dist/static/media/bb.4466d275.png +0 -0
  73. package/electron/dist/static/media/bd.56c6c3f7.png +0 -0
  74. package/electron/dist/static/media/bf.fb7bf643.png +0 -0
  75. package/electron/dist/static/media/bi.82121bd1.png +0 -0
  76. package/electron/dist/static/media/bl.c4f6b8c1.png +0 -0
  77. package/electron/dist/static/media/black-gradient-rotated.693a1835.png +0 -0
  78. package/electron/dist/static/media/bm.2b05930c.png +0 -0
  79. package/electron/dist/static/media/bn.fa1d112b.png +0 -0
  80. package/electron/dist/static/media/br.0bdb59a4.png +0 -0
  81. package/electron/dist/static/media/bs.cf3fb4b9.png +0 -0
  82. package/electron/dist/static/media/bt.f7bc1b24.png +0 -0
  83. package/electron/dist/static/media/by.aa680616.png +0 -0
  84. package/electron/dist/static/media/bz.94f967a4.png +0 -0
  85. package/electron/dist/static/media/ca.83c317eb.png +0 -0
  86. package/electron/dist/static/media/cc.7adb7e83.png +0 -0
  87. package/electron/dist/static/media/cd.829a5467.png +0 -0
  88. package/electron/dist/static/media/cf.05804c68.png +0 -0
  89. package/electron/dist/static/media/cg.6142b05b.png +0 -0
  90. package/electron/dist/static/media/ck.e6517d3a.png +0 -0
  91. package/electron/dist/static/media/cl.fedf287b.png +0 -0
  92. package/electron/dist/static/media/cm.13460532.png +0 -0
  93. package/electron/dist/static/media/cn.cb27a726.png +0 -0
  94. package/electron/dist/static/media/color-wheel.233ad67a.png +0 -0
  95. package/electron/dist/static/media/cu.c87a4974.png +0 -0
  96. package/electron/dist/static/media/cv.df006f17.png +0 -0
  97. package/electron/dist/static/media/cw.5600a05a.png +0 -0
  98. package/electron/dist/static/media/cx.3a1ed4dd.png +0 -0
  99. package/electron/dist/static/media/cy.cf9ba1fd.png +0 -0
  100. package/electron/dist/static/media/cz.52a635d1.png +0 -0
  101. package/electron/dist/static/media/dj.97fab2d0.png +0 -0
  102. package/electron/dist/static/media/dm.cffeea69.png +0 -0
  103. package/electron/dist/static/media/do.4446e007.png +0 -0
  104. package/electron/dist/static/media/dz.2a4f02c8.png +0 -0
  105. package/electron/dist/static/media/ec.de3c8959.png +0 -0
  106. package/electron/dist/static/media/eg.995e438f.png +0 -0
  107. package/electron/dist/static/media/eh.df6ab877.png +0 -0
  108. package/electron/dist/static/media/er.c9c33d69.png +0 -0
  109. package/electron/dist/static/media/es.02bde626.png +0 -0
  110. package/electron/dist/static/media/et.97067753.png +0 -0
  111. package/electron/dist/static/media/fj.d9ffe455.png +0 -0
  112. package/electron/dist/static/media/fk.56b62350.png +0 -0
  113. package/electron/dist/static/media/fm.a7a0ab08.png +0 -0
  114. package/electron/dist/static/media/fo.8c98723b.png +0 -0
  115. package/electron/dist/static/media/gb.e2dc562c.png +0 -0
  116. package/electron/dist/static/media/gd.e018fcab.png +0 -0
  117. package/electron/dist/static/media/ge.a23ea813.png +0 -0
  118. package/electron/dist/static/media/gf.46575309.png +0 -0
  119. package/electron/dist/static/media/gg.b6dec865.png +0 -0
  120. package/electron/dist/static/media/gh.791206c9.png +0 -0
  121. package/electron/dist/static/media/gi.691dc59f.png +0 -0
  122. package/electron/dist/static/media/gp.9f13aec5.png +0 -0
  123. package/electron/dist/static/media/gq.ac167f44.png +0 -0
  124. package/electron/dist/static/media/gt.ac025893.png +0 -0
  125. package/electron/dist/static/media/gu.f6b1f79f.png +0 -0
  126. package/electron/dist/static/media/gw.c1155330.png +0 -0
  127. package/electron/dist/static/media/gy.8807a5cd.png +0 -0
  128. package/electron/dist/static/media/hk.ace33e25.png +0 -0
  129. package/electron/dist/static/media/hn.a9dbb8c7.png +0 -0
  130. package/electron/dist/static/media/hr.154eb536.png +0 -0
  131. package/electron/dist/static/media/ht.f2777c6f.png +0 -0
  132. package/electron/dist/static/media/il.1e46d4c0.png +0 -0
  133. package/electron/dist/static/media/im.0cd40434.png +0 -0
  134. package/electron/dist/static/media/in.7b42511c.png +0 -0
  135. package/electron/dist/static/media/io.a66fbed7.png +0 -0
  136. package/electron/dist/static/media/iq.95e38849.png +0 -0
  137. package/electron/dist/static/media/ir.63bb306b.png +0 -0
  138. package/electron/dist/static/media/je.9bb61268.png +0 -0
  139. package/electron/dist/static/media/jm.cb108953.png +0 -0
  140. package/electron/dist/static/media/jo.68d39a37.png +0 -0
  141. package/electron/dist/static/media/jp.c7ac0358.png +0 -0
  142. package/electron/dist/static/media/ke.43bc8ed5.png +0 -0
  143. package/electron/dist/static/media/kg.44ff839a.png +0 -0
  144. package/electron/dist/static/media/kh.f2be65a8.png +0 -0
  145. package/electron/dist/static/media/ki.a5251ff4.png +0 -0
  146. package/electron/dist/static/media/km.e3509f11.png +0 -0
  147. package/electron/dist/static/media/kn.2aa7e9f4.png +0 -0
  148. package/electron/dist/static/media/kp.bafa6d30.png +0 -0
  149. package/electron/dist/static/media/kr.eddab993.png +0 -0
  150. package/electron/dist/static/media/ks.482617ea.png +0 -0
  151. package/electron/dist/static/media/kw.c9acc015.png +0 -0
  152. package/electron/dist/static/media/ky.b28eed47.png +0 -0
  153. package/electron/dist/static/media/kz.705cf40b.png +0 -0
  154. package/electron/dist/static/media/la.eaa60883.png +0 -0
  155. package/electron/dist/static/media/lb.f12e48b3.png +0 -0
  156. package/electron/dist/static/media/lc.c3040f1b.png +0 -0
  157. package/electron/dist/static/media/li.9ff57114.png +0 -0
  158. package/electron/dist/static/media/lk.668fa761.png +0 -0
  159. package/electron/dist/static/media/lr.08a3ba29.png +0 -0
  160. package/electron/dist/static/media/ls.4bcf7705.png +0 -0
  161. package/electron/dist/static/media/ly.42eee630.png +0 -0
  162. package/electron/dist/static/media/ma.728f368e.png +0 -0
  163. package/electron/dist/static/media/md.c58d4da5.png +0 -0
  164. package/electron/dist/static/media/me.61434fc0.png +0 -0
  165. package/electron/dist/static/media/mh.84081090.png +0 -0
  166. package/electron/dist/static/media/mk.4c61eb33.png +0 -0
  167. package/electron/dist/static/media/mm.6d9513ec.png +0 -0
  168. package/electron/dist/static/media/mn.2919ee2b.png +0 -0
  169. package/electron/dist/static/media/mo.5097fc81.png +0 -0
  170. package/electron/dist/static/media/mp.92d6f5ae.png +0 -0
  171. package/electron/dist/static/media/mq.3dcb40dd.png +0 -0
  172. package/electron/dist/static/media/mr.49624c44.png +0 -0
  173. package/electron/dist/static/media/ms.6278c883.png +0 -0
  174. package/electron/dist/static/media/mt.6791f29d.png +0 -0
  175. package/electron/dist/static/media/mv.db8c2815.png +0 -0
  176. package/electron/dist/static/media/mw.bfe46c8a.png +0 -0
  177. package/electron/dist/static/media/mx.4143a6ea.png +0 -0
  178. package/electron/dist/static/media/my.3a9e0a16.png +0 -0
  179. package/electron/dist/static/media/mz.a9a7cad4.png +0 -0
  180. package/electron/dist/static/media/na.fb15ec16.png +0 -0
  181. package/electron/dist/static/media/nc.ca80861c.png +0 -0
  182. package/electron/dist/static/media/ne.66306a2b.png +0 -0
  183. package/electron/dist/static/media/nf.2087392a.png +0 -0
  184. package/electron/dist/static/media/ni.8a8af9c4.png +0 -0
  185. package/electron/dist/static/media/np.fcb697b2.png +0 -0
  186. package/electron/dist/static/media/nr.3df193fa.png +0 -0
  187. package/electron/dist/static/media/nu.36adcc05.png +0 -0
  188. package/electron/dist/static/media/nz.3f54cdbc.png +0 -0
  189. package/electron/dist/static/media/om.b705fe37.png +0 -0
  190. package/electron/dist/static/media/pa.c6eac52a.png +0 -0
  191. package/electron/dist/static/media/pf.fc525a54.png +0 -0
  192. package/electron/dist/static/media/pg.e74ec337.png +0 -0
  193. package/electron/dist/static/media/ph.07b69cb2.png +0 -0
  194. package/electron/dist/static/media/pk.2e6f6e4d.png +0 -0
  195. package/electron/dist/static/media/placeholder.b393bdf6.png +0 -0
  196. package/electron/dist/static/media/pm.a07b0fe5.png +0 -0
  197. package/electron/dist/static/media/pr.2a745d06.png +0 -0
  198. package/electron/dist/static/media/ps.dc835d4b.png +0 -0
  199. package/electron/dist/static/media/pt.1dac29ce.png +0 -0
  200. package/electron/dist/static/media/pw.39ee4879.png +0 -0
  201. package/electron/dist/static/media/py.79fe22b8.png +0 -0
  202. package/electron/dist/static/media/re.d61c1475.png +0 -0
  203. package/electron/dist/static/media/rs.98e0ba03.png +0 -0
  204. package/electron/dist/static/media/rw.a062e5ed.png +0 -0
  205. package/electron/dist/static/media/sa.d8b4fac4.png +0 -0
  206. package/electron/dist/static/media/sb.22cdaa99.png +0 -0
  207. package/electron/dist/static/media/sc.bfa8934e.png +0 -0
  208. package/electron/dist/static/media/sd.c17685b4.png +0 -0
  209. package/electron/dist/static/media/sg.d63e1e98.png +0 -0
  210. package/electron/dist/static/media/sh.3e4eba58.png +0 -0
  211. package/electron/dist/static/media/si.1aef990c.png +0 -0
  212. package/electron/dist/static/media/sk.744710e9.png +0 -0
  213. package/electron/dist/static/media/sm.2add86d0.png +0 -0
  214. package/electron/dist/static/media/sn.cd1d239a.png +0 -0
  215. package/electron/dist/static/media/so.59e58870.png +0 -0
  216. package/electron/dist/static/media/sr.4f2004a0.png +0 -0
  217. package/electron/dist/static/media/ss.4af3b81d.png +0 -0
  218. package/electron/dist/static/media/st.d51dc713.png +0 -0
  219. package/electron/dist/static/media/sv.7ae84ee8.png +0 -0
  220. package/electron/dist/static/media/sx.be650d49.png +0 -0
  221. package/electron/dist/static/media/sy.aff3aad3.png +0 -0
  222. package/electron/dist/static/media/sz.2d1d3b4d.png +0 -0
  223. package/electron/dist/static/media/tc.a260af55.png +0 -0
  224. package/electron/dist/static/media/tg.8f3da96a.png +0 -0
  225. package/electron/dist/static/media/tj.f75888d4.png +0 -0
  226. package/electron/dist/static/media/tk.565e8b1a.png +0 -0
  227. package/electron/dist/static/media/tl.e2a54e11.png +0 -0
  228. package/electron/dist/static/media/tm.c4300af4.png +0 -0
  229. package/electron/dist/static/media/tn.75753d15.png +0 -0
  230. package/electron/dist/static/media/tr.82e5dc1c.png +0 -0
  231. package/electron/dist/static/media/tt.987092e9.png +0 -0
  232. package/electron/dist/static/media/tv.9230640c.png +0 -0
  233. package/electron/dist/static/media/tw.c4a9d7d9.png +0 -0
  234. package/electron/dist/static/media/tz.1efa60a0.png +0 -0
  235. package/electron/dist/static/media/ug.a77c73ae.png +0 -0
  236. package/electron/dist/static/media/us.e2479214.png +0 -0
  237. package/electron/dist/static/media/uy.861eca98.png +0 -0
  238. package/electron/dist/static/media/uz.01ff6d78.png +0 -0
  239. package/electron/dist/static/media/va.27433401.png +0 -0
  240. package/electron/dist/static/media/vc.2cca122b.png +0 -0
  241. package/electron/dist/static/media/ve.af5a8b6b.png +0 -0
  242. package/electron/dist/static/media/vg.04a0bb4c.png +0 -0
  243. package/electron/dist/static/media/vi.23080fa1.png +0 -0
  244. package/electron/dist/static/media/vn.c4418522.png +0 -0
  245. package/electron/dist/static/media/vu.a9b9829b.png +0 -0
  246. package/electron/dist/static/media/wf.c9a34a89.png +0 -0
  247. package/electron/dist/static/media/ws.155d3921.png +0 -0
  248. package/electron/dist/static/media/za.45fc2a3d.png +0 -0
  249. package/electron/dist/static/media/zm.2a5e46b1.png +0 -0
  250. package/electron/dist/static/media/zw.44f54d41.png +0 -0
@@ -0,0 +1,84 @@
1
+ import React from '$react';
2
+ import { ScrollView,Dimensions} from 'react-native';
3
+ import PropTypes from "prop-types";
4
+ import View from "$ecomponents/View";
5
+ import theme from "$theme";
6
+ import {defaultStr,defaultObj,defaultNumber} from "$utils";
7
+ import APP from "$capp/instance";
8
+ import ActivityIndicator from "$ecomponents/ActivityIndicator";
9
+ const ScrollViewComponent = React.forwardRef(({withAutoSizer,containerProps,maxHeight,minHeight,testID:customTestID,children:cChildren,...rest},ref) => {
10
+ const testID = defaultStr(customTestID,'RN_ScrollViewComponent');
11
+ const autoSizeRef = React.useRef(withAutoSizer);
12
+ if(!autoSizeRef.current || rest.horizontal === true || rest.vertical === false){
13
+ return <ScrollView testID={testID} ref={ref} {...rest} children={cChildren}/>
14
+ }
15
+ containerProps = defaultObj(containerProps)
16
+ const hasUpdateLayoutRef = React.useRef(false);
17
+ const isKeyboardOpenRef = React.useRef(false);
18
+ const layoutRef = React.useRef(null);
19
+ const [layout,setLayout] = React.useState(Dimensions.get("window"));
20
+ const {height} = layout;
21
+ const hasInitializedRef = React.useRef(false);
22
+ const children = React.useStableMemo(()=>cChildren,[cChildren]);
23
+ const updateLayout = ()=>{
24
+ return new Promise((resolve)=>{
25
+ hasUpdateLayoutRef.current = true;
26
+ if(layoutRef.current && layoutRef.current.measureInWindow){
27
+ layoutRef.current.measureInWindow((x, y, width, height) => {
28
+ const r = {...Dimensions.get("window"),layout:{ x, y, width, height }};
29
+ setLayout(r);
30
+ hasInitializedRef.current = true;
31
+ resolve(r);
32
+ });
33
+ } else {
34
+ setLayout(Dimensions.get("window"))
35
+ }
36
+ })
37
+ }
38
+ React.useEffect(()=>{
39
+ const onKeyboardToggle = ({visible})=>{
40
+ isKeyboardOpenRef.current = visible;
41
+ };
42
+ const onResizePage = ()=>{
43
+ setTimeout(()=>{
44
+ if(isKeyboardOpenRef.current) return;
45
+ updateLayout();
46
+ },300);
47
+ }
48
+ APP.on(APP.EVENTS.RESIZE_PAGE,onResizePage);
49
+ APP.on(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle)
50
+ return ()=>{
51
+ APP.off(APP.EVENTS.RESIZE_PAGE,onResizePage);
52
+ APP.off(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle);
53
+ }
54
+ },[]);
55
+ const hasUpdateLayout = hasUpdateLayoutRef.current;
56
+ const cStyle ={width:'100%',maxHeight:Math.max(height-100,250)};
57
+ const contentLayout = defaultObj(layout.layout);
58
+ cStyle.minHeight = Math.min(Math.max(layout.height-defaultNumber(contentLayout.y),250));
59
+ const contentContainerStyle = ([cStyle,rest.contentContainerStyle]);
60
+ const fStyle = !hasUpdateLayout && {flex:1,maxWidth:layout.width - defaultNumber(contentLayout.x)};
61
+ return <View ref={layoutRef} onLayout={()=>{
62
+ if(!hasInitializedRef.current){
63
+ updateLayout();
64
+ }
65
+ }} {...containerProps} style={[theme.styles.w100,containerProps.style,fStyle]} testID={testID+"_ScrollViewContainer"}>
66
+ <ScrollView
67
+ ref={ref} {...rest}
68
+ testID={testID}
69
+ children={hasUpdateLayout?children : <ActivityIndicator size={'large'}
70
+ style={[{flex:1}]}/>}
71
+ contentContainerStyle = {[contentContainerStyle,fStyle]}
72
+ />
73
+ </View>
74
+ });
75
+
76
+ ScrollViewComponent.displayName = "ScrollViewComponent";
77
+ export default ScrollViewComponent;
78
+
79
+ ScrollViewComponent.propTypes = {
80
+ ...defaultObj(ScrollView.propTypes),
81
+ withAutoSizer : PropTypes.bool,//si la taille du scrollView sera withAutoSizer
82
+ maxHeight : PropTypes.number,
83
+ minHeight : PropTypes.number,
84
+ }
@@ -1,76 +1,33 @@
1
1
  import React from '$react';
2
- import { ScrollView,Dimensions } from 'react-native';
2
+ import { ScrollView} from 'react-native';
3
3
  import PropTypes from "prop-types";
4
- import View from "$ecomponents/View";
5
- import theme from "$theme";
6
4
  import {defaultStr,defaultObj} from "$utils";
7
- import APP from "$capp/instance";
8
- import {isWeb as isw} from "$cplatform";
9
- const ScrollViewComponent = React.forwardRef(({virtualized,vertical,horizontal,contentProps,containerProps,mediaQueryUpdateNativeProps,testID:customTestID,children:cChildren,screenIndent:sIndent,...rest},ref) => {
10
- const testID = defaultStr(customTestID,'RN_ScrollViewComponent');
11
- containerProps = defaultObj(containerProps)
12
- if(horizontal === true || vertical === false){
13
- return <ScrollView horizontal testID={testID} ref={ref} {...rest} children={cChildren}/>
14
- }
15
- const isWeb = isw();
16
- const isKeyboardOpenRef = React.useRef(false);
17
- const layoutRef = React.useRef(null);
18
- const [layout,setLayout] = React.useState(Dimensions.get("window"));
19
- const {height} = layout;
20
- const hasInitializedRef = React.useRef(false);
21
- const children = React.useStableMemo(()=>cChildren,[cChildren]);
22
- const updateLayout = ()=>{
23
- return new Promise((resolve)=>{
24
- if(layoutRef.current && layoutRef.current.measureInWindow){
25
- layoutRef.current.measureInWindow((x, y, width, height) => {
26
- const r = {...Dimensions.get("window"),layout:{ x, y, width, height }};
27
- setLayout(r);
28
- hasInitializedRef.current = true;
29
- resolve(r);
30
- });
31
- }
32
- })
33
- }
34
- React.useEffect(()=>{
35
- const onKeyboardToggle = ({visible})=>{
36
- isKeyboardOpenRef.current = visible;
37
- };
38
- const onResizePage = ()=>{
39
- setTimeout(()=>{
40
- if(isKeyboardOpenRef.current) return;
41
- updateLayout();
42
- },300);
43
- }
44
- APP.on(APP.EVENTS.RESIZE_PAGE,onResizePage);
45
- APP.on(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle)
46
- return ()=>{
47
- APP.off(APP.EVENTS.RESIZE_PAGE,onResizePage);
48
- APP.off(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle);
49
- }
50
- },[]);
5
+ import {Vertical as AutoSizeVertical} from "$ecomponents/AutoSizer";
51
6
 
52
- const cStyle = {maxHeight:Math.max(height-100,250),width:'100%'};
53
- if(isObj(layout.layout) && typeof layout.layout.y =='number' && layout.layout.y>=10){
54
- const {layout : {x,y}} = layout;
55
- const minHeight = height - y;
56
- if(minHeight> 0){
57
- cStyle.minHeight = minHeight;
58
- }
7
+ const ScrollViewComponent = React.forwardRef(({withAutoSizer,autoSizerProps,testID,...rest},ref) => {
8
+ testID = defaultStr(testID,'RN_ScrollViewComponent');
9
+ const autoSize = React.useRef(withAutoSizer).current;
10
+ if(!autoSize || rest.horizontal === true || rest.vertical === false){
11
+ return <ScrollView testID={testID} ref={ref} {...rest}/>
59
12
  }
60
- const contentContainerStyle = [cStyle,rest.contentContainerStyle,isWeb && {display:'block'}];
61
- return <View ref={layoutRef} onLayout={()=>{
62
- if(!hasInitializedRef.current){
63
- updateLayout();
64
- }
65
- }} {...containerProps} style={[theme.styles.w100,containerProps.style]} testID={testID+"_ScrollViewContainer"}>
13
+ autoSizerProps = defaultObj(autoSizerProps);
14
+ const autoSizerRef = React.useRef(null);
15
+ return <AutoSizeVertical ref={autoSizerRef} isScrollView {...autoSizerProps} testID={testID+"_ScrollViewContainer"}>
66
16
  <ScrollView
67
17
  ref={ref} {...rest}
68
- vertical = {vertical}
69
18
  testID={testID}
70
- children={children}
71
- contentContainerStyle = {contentContainerStyle}
19
+ onContentSizeChange = {(a,b,c,d)=>{
20
+ if(rest.onContentSizeChange && rest.onContentSizeChange(a,b,c,d)===false) return;
21
+ return;
22
+ if(autoSizerRef.current && autoSizerRef.current.updateLayout){
23
+ console.log("updating layout ",autoSizerRef.current);
24
+ autoSizerRef.current.updateLayout();
25
+ }
26
+ }}
27
+ style = {[{flex:1}]}
28
+ contentContainerStyle = {[{flex:1,height:'100%'},rest.contentContainerStyle]}
72
29
  />
73
- </View>
30
+ </AutoSizeVertical>
74
31
  });
75
32
 
76
33
  ScrollViewComponent.displayName = "ScrollViewComponent";
@@ -78,8 +35,7 @@ export default ScrollViewComponent;
78
35
 
79
36
  ScrollViewComponent.propTypes = {
80
37
  ...defaultObj(ScrollView.propTypes),
81
- horizontal : PropTypes.bool,
82
- vertical : PropTypes.bool,
83
- virtualized : PropTypes.bool,
84
- contentProps : PropTypes.object,
38
+ withAutoSizer : PropTypes.bool,//si le contenu du scrollView sera wrap par le composant AutoSizer
39
+ maxHeight : PropTypes.number,
40
+ minHeight : PropTypes.number,
85
41
  }
@@ -0,0 +1,83 @@
1
+ import React from '$react';
2
+ import { ScrollView,Dimensions } from 'react-native';
3
+ import PropTypes from "prop-types";
4
+ import View from "$ecomponents/View";
5
+ import theme from "$theme";
6
+ import {defaultStr,defaultObj} from "$utils";
7
+ import APP from "$capp/instance";
8
+ import {isWeb as isw} from "$cplatform";
9
+ const ScrollViewComponent = React.forwardRef(({containerProps,withAutoSizer,testID,...rest},ref) => {
10
+ testID = defaultStr(testID,'RN_ScrollViewComponent');
11
+ const autoSize = React.useRef(withAutoSizer).current;
12
+ if(!autoSize || rest.horizontal === true || rest.vertical === false){
13
+ return <ScrollView testID={testID} ref={ref} {...rest}/>
14
+ }
15
+ containerProps = defaultObj(containerProps)
16
+ const isWeb = isw();
17
+ const isKeyboardOpenRef = React.useRef(false);
18
+ const layoutRef = React.useRef(null);
19
+ const [layout,setLayout] = React.useState(Dimensions.get("window"));
20
+ const {height} = layout;
21
+ const hasInitializedRef = React.useRef(false);
22
+ const children = React.useStableMemo(()=>rest.children,[rest.children]);
23
+ const updateLayout = ()=>{
24
+ return new Promise((resolve)=>{
25
+ if(layoutRef.current && layoutRef.current.measureInWindow){
26
+ layoutRef.current.measureInWindow((x, y, width, height) => {
27
+ const r = {...Dimensions.get("window"),layout:{ x, y, width, height }};
28
+ setLayout(r);
29
+ hasInitializedRef.current = true;
30
+ resolve(r);
31
+ });
32
+ }
33
+ })
34
+ }
35
+ React.useEffect(()=>{
36
+ const onKeyboardToggle = ({visible})=>{
37
+ isKeyboardOpenRef.current = visible;
38
+ };
39
+ const onResizePage = ()=>{
40
+ setTimeout(()=>{
41
+ if(isKeyboardOpenRef.current) return;
42
+ updateLayout();
43
+ },300);
44
+ }
45
+ APP.on(APP.EVENTS.RESIZE_PAGE,onResizePage);
46
+ APP.on(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle)
47
+ return ()=>{
48
+ APP.off(APP.EVENTS.RESIZE_PAGE,onResizePage);
49
+ APP.off(APP.EVENTS.KEYBOARD_DID_TOGGLE,onKeyboardToggle);
50
+ }
51
+ },[]);
52
+
53
+ const cStyle = {maxHeight:Math.max(height-100,250),width:'100%'};
54
+ if(isObj(layout.layout) && typeof layout.layout.y =='number' && layout.layout.y>=10){
55
+ const {layout : {x,y}} = layout;
56
+ const minHeight = height - y;
57
+ if(minHeight> 0){
58
+ cStyle.minHeight = minHeight;
59
+ }
60
+ }
61
+ const contentContainerStyle = [cStyle,rest.contentContainerStyle];
62
+ return <View ref={layoutRef} onLayout={()=>{
63
+ if(!hasInitializedRef.current){
64
+ updateLayout();
65
+ }
66
+ }} {...containerProps} style={[theme.styles.w100,containerProps.style]} testID={testID+"_ScrollViewContainer"}>
67
+ <ScrollView
68
+ ref={ref}
69
+ {...rest}
70
+ testID={testID}
71
+ children={children}
72
+ contentContainerStyle = {contentContainerStyle}
73
+ />
74
+ </View>
75
+ });
76
+
77
+ ScrollViewComponent.displayName = "ScrollViewComponent";
78
+ export default ScrollViewComponent;
79
+
80
+ ScrollViewComponent.propTypes = {
81
+ ...defaultObj(ScrollView.propTypes),
82
+ withAutoSizer : PropTypes.bool,
83
+ }
@@ -49,8 +49,9 @@ const AbsoluteScrollView = React.forwardRef(({testID,contentProps,listRef,contai
49
49
  args = defaultObj(args);
50
50
  if(isObj(args.contentOffset) && isObj(args.contentSize)){
51
51
  const {x} = args.contentOffset;
52
+ const {width:contentWidth} = args.contentSize;
52
53
  const {width} = Dimensions.get("window");
53
- const visible = x >= width-10 ? false : true;
54
+ const visible = x >= width-10 && (contentWidth-x)<10 ? false : true;
54
55
  if(state.visible != visible){
55
56
  return setState({...state,visible});
56
57
  }
@@ -67,13 +68,22 @@ const AbsoluteScrollView = React.forwardRef(({testID,contentProps,listRef,contai
67
68
  React.useEffect(()=>{
68
69
  toggleVisible();
69
70
  },[styles])
71
+ let canBeVisible = true;
72
+ if(isObj(styles.content) && isObj(styles.contentContainer)){
73
+ if(typeof styles.content.height =='number' && typeof styles.contentContainer.height =='number'){
74
+ if(styles.content.height -10 <= styles.contentContainer.height){
75
+ canBeVisible = false;
76
+ }
77
+ }
78
+ }
79
+ const hidden = (!canBeVisible || !visible || !layoutVisible) ;
70
80
  return <Portal>
71
- {<View testID={testID+"_Containter"} {...containerProps} style={[mainStyles.container,containerProps.style,styles.container,{left:win.width-10},(!visible || !layoutVisible) &&{display:'none',width:0,opacity:0}]}>
81
+ {<View testID={testID+"_Containter"} {...containerProps} style={[mainStyles.container,containerProps.style,styles.container,{left:win.width-10},hidden &&{display:'none',width:0,opacity:0}]}>
72
82
  <ScrollView
73
83
  {...props}
74
84
  ref = {scrollViewRef}
75
85
  testID={testID}
76
- contentContainerStyle = {[props.contentContainerStyle,mainStyles.contentContainer,styles.containerContainer]}
86
+ contentContainerStyle = {[props.contentContainerStyle,mainStyles.contentContainer,styles.contentContainer]}
77
87
  vertical
78
88
  >
79
89
  <View
@@ -96,7 +96,7 @@ const VirtuosoListComponent = React.forwardRef(({items,onRender,testID,renderIte
96
96
  }
97
97
  },[]);
98
98
  React.useOnRender(onRender,Math.max(Array.isArray(items) && items.length/10 || 0,500))
99
- return <View {...containerProps} {...props} style={[{flex:1},containerProps.style,style,{minWidth:'100%',maxWidth:'100%'}]} onLayout={onLayout} testID={testID}>
99
+ return <View {...containerProps} {...props} style={[{flex:1},containerProps.style,style,{minWidth:'100%',height:'100%',maxWidth:'100%'}]} onLayout={onLayout} testID={testID}>
100
100
  <Virtuoso
101
101
  {...r2}
102
102
  style = {listStyle}
@@ -0,0 +1,15 @@
1
+ import React from "$react";
2
+ import {Vertical as AutoSizeVertical} from "$ecomponents/AutoSizer";
3
+ import List from "./List";
4
+ import {defaultStr,defaultObj} from "$utils";
5
+ const AutoSizeVerticalList = React.forwardRef(({testID,autoSizerProps,...props},ref)=>{
6
+ testID = defaultStr(testID,"RN_AutoSizeVerticalListComponent")
7
+ autoSizerProps = defaultObj(autoSizerProps);
8
+ return <AutoSizeVertical testID={testID+"_AutoSizerVertical"} {...autoSizerProps} >
9
+ <List {...props} ref={ref}/>
10
+ </AutoSizeVertical>
11
+ })
12
+
13
+ AutoSizeVerticalList.displayName = "AutoSizeVerticalListComponent";
14
+
15
+ export default AutoSizeVerticalList;
@@ -7,7 +7,6 @@ import Label from "$ecomponents/Label";
7
7
  import { StyleSheet,View as RNView,ScrollView,Dimensions} from "react-native";
8
8
  import { getRowStyle } from "$ecomponents/Datagrid/utils";
9
9
  import {isMobileNative} from "$cplatform";
10
- import {isMobileMedia} from "$dimensions";
11
10
  import theme from "$theme";
12
11
  import AbsoluteScrollView from "./AbsoluteScrollView";
13
12
  import Cell from "./Cell";
@@ -357,7 +356,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
357
356
  testID = {testID}
358
357
  prepareItems = {false}
359
358
  items = {items}
360
- contentContainerStyle = {[styles.contentContainer,{width:listWidth,minWidth:totalWidths,position:'absolute',right:'0'}]}
359
+ contentContainerStyle = {[styles.contentContainer,{width:listWidth,minWidth:totalWidths}]}
361
360
  style = {[styles.datagrid,{width:listWidth,minWidth:totalWidths}]}
362
361
  keyExtractor = {typeof getRowKey =='function'? getRowKey : React.getKey}
363
362
  onScroll = {getOnScrollCb([absoluteScrollViewRef],(args)=>{
@@ -394,7 +394,11 @@ export default class TableDataScreenComponent extends FormDataScreen{
394
394
  const isMobile = isMobileOrTabletMedia();
395
395
  const contentProps = restProps.contentProps;
396
396
  const elevation = restProps.elevation;
397
- const renderingTabsProps = {tabs,data:this.getCurrentData(),isMobile,sessionName:this.INITIAL_STATE.sessionName,props:restProps,tabProps,tabsProps,context,tabKey};
397
+ const renderingTabsProps = {tabs,data:this.getCurrentData(),tabsPropsMutator:({tabs,tabsProps})=>{
398
+ if(!isMobileOrTabletMedia()){
399
+ tabsProps.withScrollView = false;
400
+ }
401
+ },isMobile,sessionName:this.INITIAL_STATE.sessionName,props:restProps,tabProps,tabsProps,context,tabKey};
398
402
  const hasTabs = Object.size(tabs,true);
399
403
  let mainContent = undefined;
400
404
  testID = defaultStr(testID,"RN_TableDataScreenItem_"+restProps.tableName);
@@ -417,7 +421,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
417
421
  mainContent = ct;
418
422
  } else {
419
423
  mainContent = <View {...contentProps} testID={testID+"_ContentContainer"} style={[styles.container,styles.noPadding]}>
420
- <ScrollView testID={testID+"_MainContentScrollView"} contentProps={{style:theme.styles.p1}}>
424
+ <ScrollView withAutoSizer testID={testID+"_MainContentScrollView"} contentProps={{style:theme.styles.p1}}>
421
425
  <Surface elevation={elevation} testID={testID+"_ContentHeader"} style={[styles.screenContent,theme.styles.p1,header?styles.screenContentWithHeader:null]}>
422
426
  {header}
423
427
  {content}
@@ -443,7 +447,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
443
447
  appBarProps.elevation = 0;
444
448
  restProps.elevation = 0;
445
449
  }
446
- return <ScreenContainer {...restProps} appBarProps = {appBarProps} testID={testID}>
450
+ return <ScreenContainer {...restProps} withScrollView={false} appBarProps = {appBarProps} testID={testID}>
447
451
  {this.wrapRenderingContent(mainContent,{testID})}
448
452
  </ScreenContainer>
449
453
  }
@@ -8,13 +8,13 @@ import {getTableDataRouteName} from "$enavigation/utils";
8
8
  //@seee : https://github.com/typeorm/typeorm/blob/master/src/entity-schema/EntitySchemaColumnOptions.ts
9
9
  export const generatedColumnsProperties = ["createDate","updateDate","deleteDate","createBy","updateBy","deleteBy"]
10
10
 
11
- export const renderTabsContent = ({tabs,context,data,sessionName,isMobile,props,firstTab,tabKey,tabProps,tabsProps})=>{
11
+ export const renderTabsContent = ({tabs,context,data,sessionName,tabsPropsMutator,isMobile,props,firstTab,tabKey,tabProps,tabsProps})=>{
12
12
  let tabsArr = [],hasFirstTab = false;
13
13
  if(React.isValidElement(firstTab)){
14
14
  tabsArr.push(firstTab);
15
15
  hasFirstTab = true;
16
16
  }
17
- tabsProps = Object.assign({},tabsProps);
17
+ tabsProps = Object.clone(tabsProps);
18
18
  tabsProps.centered = false;
19
19
  tabKey = typeof tabKey =='string' || typeof tabKey =='number'? tabKey : 'first-tab-key';
20
20
  let idx = tabsArr.length-1;
@@ -52,6 +52,9 @@ export const renderTabsContent = ({tabs,context,data,sessionName,isMobile,props,
52
52
  })
53
53
  }
54
54
  if(tabsArr.length> (hasFirstTab ? 1 : 0)){
55
+ if(typeof tabsPropsMutator =='function' && tabsPropsMutator({tabsProps,tabs:tabsArr,hasFirstTab}) === false){
56
+ return null;
57
+ }
55
58
  return <Tab testID={testID}
56
59
  {...tabsProps}
57
60
  onChange={(args)=>{