@fto-consult/expo-ui 1.0.4
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.
- package/assets/adaptive-icon.png +0 -0
- package/assets/add_photo.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.alias.js +32 -0
- package/babel.config.js +18 -0
- package/circular-dependencies.js +24 -0
- package/compiler.config.js +28 -0
- package/expo.metro.config.js +27 -0
- package/index.js +21 -0
- package/metro.config.js +1 -0
- package/package.json +60 -0
- package/src/App.js +65 -0
- package/src/Preferences.js +5 -0
- package/src/auth/Login.js +254 -0
- package/src/auth/index.js +3 -0
- package/src/components/ActivityIndicator/index.js +9 -0
- package/src/components/Animations/Animation/index.js +95 -0
- package/src/components/Animations/Animation/utils.js +78 -0
- package/src/components/Animations/OpacityAnimation/index.js +53 -0
- package/src/components/Animations/OpacityAnimation/utils.js +38 -0
- package/src/components/Animations/index.js +6 -0
- package/src/components/AppBar/Content.js +132 -0
- package/src/components/AppBar/index.js +164 -0
- package/src/components/AppBar/utils.js +204 -0
- package/src/components/AutoLink/index.js +45 -0
- package/src/components/Avatar/AutoHeightImage/AnimatableImage.js +22 -0
- package/src/components/Avatar/AutoHeightImage/ImagePolyfill.js +33 -0
- package/src/components/Avatar/AutoHeightImage/cache.js +75 -0
- package/src/components/Avatar/AutoHeightImage/helpers.js +2 -0
- package/src/components/Avatar/AutoHeightImage/index.js +97 -0
- package/src/components/Avatar/Image.js +115 -0
- package/src/components/Avatar/Text.js +74 -0
- package/src/components/Avatar/index.js +89 -0
- package/src/components/BackToTop/index.js +89 -0
- package/src/components/Badge/index.js +141 -0
- package/src/components/Badge/index1.js +34 -0
- package/src/components/BottomSheet/Content.js +19 -0
- package/src/components/BottomSheet/Menu.js +126 -0
- package/src/components/BottomSheet/Provider.js +58 -0
- package/src/components/BottomSheet/Sheet.js +434 -0
- package/src/components/BottomSheet/index.js +8 -0
- package/src/components/BottomSheet/utils.js +30 -0
- package/src/components/Br/index.js +4 -0
- package/src/components/Br/index.web.js +3 -0
- package/src/components/Browser/index.js +4 -0
- package/src/components/Button/index.js +465 -0
- package/src/components/CardView/index.android.js +55 -0
- package/src/components/CardView/index.ios.js +36 -0
- package/src/components/CardView/index.web.js +3 -0
- package/src/components/Chart/appexchart.3.5.text +14 -0
- package/src/components/Chart/index.js +22 -0
- package/src/components/Chart/index.native.js +61 -0
- package/src/components/Chart/utils.js +0 -0
- package/src/components/Checkbox/index.js +178 -0
- package/src/components/Chip/index.js +350 -0
- package/src/components/Color/ColorPicker.js +724 -0
- package/src/components/Color/assets/black-gradient-rotated.png +0 -0
- package/src/components/Color/assets/black-gradient.png +0 -0
- package/src/components/Color/assets/color-wheel.png +0 -0
- package/src/components/Color/index.js +158 -0
- package/src/components/ContentLoader/BarChar.js +19 -0
- package/src/components/ContentLoader/Circle.js +3 -0
- package/src/components/ContentLoader/Circle.web.js +3 -0
- package/src/components/ContentLoader/Datagrid.js +28 -0
- package/src/components/ContentLoader/Form.js +39 -0
- package/src/components/ContentLoader/Loader/RLoader/index.js +3 -0
- package/src/components/ContentLoader/Loader/RLoader/index.web.js +3 -0
- package/src/components/ContentLoader/Loader/index.js +20 -0
- package/src/components/ContentLoader/PieChart.js +22 -0
- package/src/components/ContentLoader/Placeholder/Placeholder.js +52 -0
- package/src/components/ContentLoader/Placeholder/PlaceholderLine.js +59 -0
- package/src/components/ContentLoader/Placeholder/PlaceholderMedia.js +47 -0
- package/src/components/ContentLoader/Placeholder/animations/Fade.js +58 -0
- package/src/components/ContentLoader/Placeholder/animations/Loader.js +24 -0
- package/src/components/ContentLoader/Placeholder/animations/Progressive.js +62 -0
- package/src/components/ContentLoader/Placeholder/animations/Raw.js +4 -0
- package/src/components/ContentLoader/Placeholder/animations/Shine.js +56 -0
- package/src/components/ContentLoader/Placeholder/animations/ShineOverlay.js +56 -0
- package/src/components/ContentLoader/Placeholder/animations/context.js +4 -0
- package/src/components/ContentLoader/Placeholder/index.js +12 -0
- package/src/components/ContentLoader/Placeholder/tokens.js +9 -0
- package/src/components/ContentLoader/Profile.js +27 -0
- package/src/components/ContentLoader/Rect.js +3 -0
- package/src/components/ContentLoader/Rect.web.js +3 -0
- package/src/components/ContentLoader/Skeleton.js +145 -0
- package/src/components/ContentLoader/Table.js +69 -0
- package/src/components/ContentLoader/TaskList.js +27 -0
- package/src/components/ContentLoader/index copy.js +148 -0
- package/src/components/ContentLoader/index.js +151 -0
- package/src/components/ContentLoader/utils.js +8 -0
- package/src/components/CountUp/index.js +67 -0
- package/src/components/Countries/SelectCountry.js +65 -0
- package/src/components/Countries/index.js +5 -0
- package/src/components/Countries/resources/countries.json +1746 -0
- package/src/components/Countries/resources/flags/images/ad.png +0 -0
- package/src/components/Countries/resources/flags/images/ae.png +0 -0
- package/src/components/Countries/resources/flags/images/af.png +0 -0
- package/src/components/Countries/resources/flags/images/ag.png +0 -0
- package/src/components/Countries/resources/flags/images/ai.png +0 -0
- package/src/components/Countries/resources/flags/images/al.png +0 -0
- package/src/components/Countries/resources/flags/images/am.png +0 -0
- package/src/components/Countries/resources/flags/images/ao.png +0 -0
- package/src/components/Countries/resources/flags/images/ar.png +0 -0
- package/src/components/Countries/resources/flags/images/as.png +0 -0
- package/src/components/Countries/resources/flags/images/at.png +0 -0
- package/src/components/Countries/resources/flags/images/au.png +0 -0
- package/src/components/Countries/resources/flags/images/aw.png +0 -0
- package/src/components/Countries/resources/flags/images/ax.png +0 -0
- package/src/components/Countries/resources/flags/images/az.png +0 -0
- package/src/components/Countries/resources/flags/images/ba.png +0 -0
- package/src/components/Countries/resources/flags/images/bb.png +0 -0
- package/src/components/Countries/resources/flags/images/bd.png +0 -0
- package/src/components/Countries/resources/flags/images/be.png +0 -0
- package/src/components/Countries/resources/flags/images/bf.png +0 -0
- package/src/components/Countries/resources/flags/images/bg.png +0 -0
- package/src/components/Countries/resources/flags/images/bh.png +0 -0
- package/src/components/Countries/resources/flags/images/bi.png +0 -0
- package/src/components/Countries/resources/flags/images/bj.png +0 -0
- package/src/components/Countries/resources/flags/images/bl.png +0 -0
- package/src/components/Countries/resources/flags/images/bm.png +0 -0
- package/src/components/Countries/resources/flags/images/bn.png +0 -0
- package/src/components/Countries/resources/flags/images/bo.png +0 -0
- package/src/components/Countries/resources/flags/images/bq.png +0 -0
- package/src/components/Countries/resources/flags/images/br.png +0 -0
- package/src/components/Countries/resources/flags/images/bs.png +0 -0
- package/src/components/Countries/resources/flags/images/bt.png +0 -0
- package/src/components/Countries/resources/flags/images/bw.png +0 -0
- package/src/components/Countries/resources/flags/images/by.png +0 -0
- package/src/components/Countries/resources/flags/images/bz.png +0 -0
- package/src/components/Countries/resources/flags/images/ca.png +0 -0
- package/src/components/Countries/resources/flags/images/cc.png +0 -0
- package/src/components/Countries/resources/flags/images/cd.png +0 -0
- package/src/components/Countries/resources/flags/images/cf.png +0 -0
- package/src/components/Countries/resources/flags/images/cg.png +0 -0
- package/src/components/Countries/resources/flags/images/ch.png +0 -0
- package/src/components/Countries/resources/flags/images/ci.png +0 -0
- package/src/components/Countries/resources/flags/images/ck.png +0 -0
- package/src/components/Countries/resources/flags/images/cl.png +0 -0
- package/src/components/Countries/resources/flags/images/cm.png +0 -0
- package/src/components/Countries/resources/flags/images/cn.png +0 -0
- package/src/components/Countries/resources/flags/images/co.png +0 -0
- package/src/components/Countries/resources/flags/images/cr.png +0 -0
- package/src/components/Countries/resources/flags/images/cu.png +0 -0
- package/src/components/Countries/resources/flags/images/cv.png +0 -0
- package/src/components/Countries/resources/flags/images/cw.png +0 -0
- package/src/components/Countries/resources/flags/images/cx.png +0 -0
- package/src/components/Countries/resources/flags/images/cy.png +0 -0
- package/src/components/Countries/resources/flags/images/cz.png +0 -0
- package/src/components/Countries/resources/flags/images/de.png +0 -0
- package/src/components/Countries/resources/flags/images/dj.png +0 -0
- package/src/components/Countries/resources/flags/images/dk.png +0 -0
- package/src/components/Countries/resources/flags/images/dm.png +0 -0
- package/src/components/Countries/resources/flags/images/do.png +0 -0
- package/src/components/Countries/resources/flags/images/dz.png +0 -0
- package/src/components/Countries/resources/flags/images/ec.png +0 -0
- package/src/components/Countries/resources/flags/images/ee.png +0 -0
- package/src/components/Countries/resources/flags/images/eg.png +0 -0
- package/src/components/Countries/resources/flags/images/eh.png +0 -0
- package/src/components/Countries/resources/flags/images/er.png +0 -0
- package/src/components/Countries/resources/flags/images/es.png +0 -0
- package/src/components/Countries/resources/flags/images/et.png +0 -0
- package/src/components/Countries/resources/flags/images/fi.png +0 -0
- package/src/components/Countries/resources/flags/images/fj.png +0 -0
- package/src/components/Countries/resources/flags/images/fk.png +0 -0
- package/src/components/Countries/resources/flags/images/fm.png +0 -0
- package/src/components/Countries/resources/flags/images/fo.png +0 -0
- package/src/components/Countries/resources/flags/images/fr.png +0 -0
- package/src/components/Countries/resources/flags/images/ga.png +0 -0
- package/src/components/Countries/resources/flags/images/gb.png +0 -0
- package/src/components/Countries/resources/flags/images/gd.png +0 -0
- package/src/components/Countries/resources/flags/images/ge.png +0 -0
- package/src/components/Countries/resources/flags/images/gf.png +0 -0
- package/src/components/Countries/resources/flags/images/gg.png +0 -0
- package/src/components/Countries/resources/flags/images/gh.png +0 -0
- package/src/components/Countries/resources/flags/images/gi.png +0 -0
- package/src/components/Countries/resources/flags/images/gm.png +0 -0
- package/src/components/Countries/resources/flags/images/gn.png +0 -0
- package/src/components/Countries/resources/flags/images/gp.png +0 -0
- package/src/components/Countries/resources/flags/images/gq.png +0 -0
- package/src/components/Countries/resources/flags/images/gr.png +0 -0
- package/src/components/Countries/resources/flags/images/gt.png +0 -0
- package/src/components/Countries/resources/flags/images/gu.png +0 -0
- package/src/components/Countries/resources/flags/images/gw.png +0 -0
- package/src/components/Countries/resources/flags/images/gy.png +0 -0
- package/src/components/Countries/resources/flags/images/hk.png +0 -0
- package/src/components/Countries/resources/flags/images/hn.png +0 -0
- package/src/components/Countries/resources/flags/images/hr.png +0 -0
- package/src/components/Countries/resources/flags/images/ht.png +0 -0
- package/src/components/Countries/resources/flags/images/hu.png +0 -0
- package/src/components/Countries/resources/flags/images/id.png +0 -0
- package/src/components/Countries/resources/flags/images/ie.png +0 -0
- package/src/components/Countries/resources/flags/images/il.png +0 -0
- package/src/components/Countries/resources/flags/images/im.png +0 -0
- package/src/components/Countries/resources/flags/images/in.png +0 -0
- package/src/components/Countries/resources/flags/images/io.png +0 -0
- package/src/components/Countries/resources/flags/images/iq.png +0 -0
- package/src/components/Countries/resources/flags/images/ir.png +0 -0
- package/src/components/Countries/resources/flags/images/is.png +0 -0
- package/src/components/Countries/resources/flags/images/it.png +0 -0
- package/src/components/Countries/resources/flags/images/je.png +0 -0
- package/src/components/Countries/resources/flags/images/jm.png +0 -0
- package/src/components/Countries/resources/flags/images/jo.png +0 -0
- package/src/components/Countries/resources/flags/images/jp.png +0 -0
- package/src/components/Countries/resources/flags/images/ke.png +0 -0
- package/src/components/Countries/resources/flags/images/kg.png +0 -0
- package/src/components/Countries/resources/flags/images/kh.png +0 -0
- package/src/components/Countries/resources/flags/images/ki.png +0 -0
- package/src/components/Countries/resources/flags/images/km.png +0 -0
- package/src/components/Countries/resources/flags/images/kn.png +0 -0
- package/src/components/Countries/resources/flags/images/kp.png +0 -0
- package/src/components/Countries/resources/flags/images/kr.png +0 -0
- package/src/components/Countries/resources/flags/images/ks.png +0 -0
- package/src/components/Countries/resources/flags/images/kw.png +0 -0
- package/src/components/Countries/resources/flags/images/ky.png +0 -0
- package/src/components/Countries/resources/flags/images/kz.png +0 -0
- package/src/components/Countries/resources/flags/images/la.png +0 -0
- package/src/components/Countries/resources/flags/images/lb.png +0 -0
- package/src/components/Countries/resources/flags/images/lc.png +0 -0
- package/src/components/Countries/resources/flags/images/li.png +0 -0
- package/src/components/Countries/resources/flags/images/lk.png +0 -0
- package/src/components/Countries/resources/flags/images/lr.png +0 -0
- package/src/components/Countries/resources/flags/images/ls.png +0 -0
- package/src/components/Countries/resources/flags/images/lt.png +0 -0
- package/src/components/Countries/resources/flags/images/lu.png +0 -0
- package/src/components/Countries/resources/flags/images/lv.png +0 -0
- package/src/components/Countries/resources/flags/images/ly.png +0 -0
- package/src/components/Countries/resources/flags/images/ma.png +0 -0
- package/src/components/Countries/resources/flags/images/mc.png +0 -0
- package/src/components/Countries/resources/flags/images/md.png +0 -0
- package/src/components/Countries/resources/flags/images/me.png +0 -0
- package/src/components/Countries/resources/flags/images/mf.png +0 -0
- package/src/components/Countries/resources/flags/images/mg.png +0 -0
- package/src/components/Countries/resources/flags/images/mh.png +0 -0
- package/src/components/Countries/resources/flags/images/mk.png +0 -0
- package/src/components/Countries/resources/flags/images/ml.png +0 -0
- package/src/components/Countries/resources/flags/images/mm.png +0 -0
- package/src/components/Countries/resources/flags/images/mn.png +0 -0
- package/src/components/Countries/resources/flags/images/mo.png +0 -0
- package/src/components/Countries/resources/flags/images/mp.png +0 -0
- package/src/components/Countries/resources/flags/images/mq.png +0 -0
- package/src/components/Countries/resources/flags/images/mr.png +0 -0
- package/src/components/Countries/resources/flags/images/ms.png +0 -0
- package/src/components/Countries/resources/flags/images/mt.png +0 -0
- package/src/components/Countries/resources/flags/images/mu.png +0 -0
- package/src/components/Countries/resources/flags/images/mv.png +0 -0
- package/src/components/Countries/resources/flags/images/mw.png +0 -0
- package/src/components/Countries/resources/flags/images/mx.png +0 -0
- package/src/components/Countries/resources/flags/images/my.png +0 -0
- package/src/components/Countries/resources/flags/images/mz.png +0 -0
- package/src/components/Countries/resources/flags/images/na.png +0 -0
- package/src/components/Countries/resources/flags/images/nc.png +0 -0
- package/src/components/Countries/resources/flags/images/ne.png +0 -0
- package/src/components/Countries/resources/flags/images/nf.png +0 -0
- package/src/components/Countries/resources/flags/images/ng.png +0 -0
- package/src/components/Countries/resources/flags/images/ni.png +0 -0
- package/src/components/Countries/resources/flags/images/nl.png +0 -0
- package/src/components/Countries/resources/flags/images/no.png +0 -0
- package/src/components/Countries/resources/flags/images/np.png +0 -0
- package/src/components/Countries/resources/flags/images/nr.png +0 -0
- package/src/components/Countries/resources/flags/images/nu.png +0 -0
- package/src/components/Countries/resources/flags/images/nz.png +0 -0
- package/src/components/Countries/resources/flags/images/om.png +0 -0
- package/src/components/Countries/resources/flags/images/pa.png +0 -0
- package/src/components/Countries/resources/flags/images/pe.png +0 -0
- package/src/components/Countries/resources/flags/images/pf.png +0 -0
- package/src/components/Countries/resources/flags/images/pg.png +0 -0
- package/src/components/Countries/resources/flags/images/ph.png +0 -0
- package/src/components/Countries/resources/flags/images/pk.png +0 -0
- package/src/components/Countries/resources/flags/images/pl.png +0 -0
- package/src/components/Countries/resources/flags/images/pm.png +0 -0
- package/src/components/Countries/resources/flags/images/pr.png +0 -0
- package/src/components/Countries/resources/flags/images/ps.png +0 -0
- package/src/components/Countries/resources/flags/images/pt.png +0 -0
- package/src/components/Countries/resources/flags/images/pw.png +0 -0
- package/src/components/Countries/resources/flags/images/py.png +0 -0
- package/src/components/Countries/resources/flags/images/qa.png +0 -0
- package/src/components/Countries/resources/flags/images/re.png +0 -0
- package/src/components/Countries/resources/flags/images/ro.png +0 -0
- package/src/components/Countries/resources/flags/images/rs.png +0 -0
- package/src/components/Countries/resources/flags/images/ru.png +0 -0
- package/src/components/Countries/resources/flags/images/rw.png +0 -0
- package/src/components/Countries/resources/flags/images/sa.png +0 -0
- package/src/components/Countries/resources/flags/images/sb.png +0 -0
- package/src/components/Countries/resources/flags/images/sc.png +0 -0
- package/src/components/Countries/resources/flags/images/sd.png +0 -0
- package/src/components/Countries/resources/flags/images/se.png +0 -0
- package/src/components/Countries/resources/flags/images/sg.png +0 -0
- package/src/components/Countries/resources/flags/images/sh.png +0 -0
- package/src/components/Countries/resources/flags/images/si.png +0 -0
- package/src/components/Countries/resources/flags/images/sj.png +0 -0
- package/src/components/Countries/resources/flags/images/sk.png +0 -0
- package/src/components/Countries/resources/flags/images/sl.png +0 -0
- package/src/components/Countries/resources/flags/images/sm.png +0 -0
- package/src/components/Countries/resources/flags/images/sn.png +0 -0
- package/src/components/Countries/resources/flags/images/so.png +0 -0
- package/src/components/Countries/resources/flags/images/sr.png +0 -0
- package/src/components/Countries/resources/flags/images/ss.png +0 -0
- package/src/components/Countries/resources/flags/images/st.png +0 -0
- package/src/components/Countries/resources/flags/images/sv.png +0 -0
- package/src/components/Countries/resources/flags/images/sx.png +0 -0
- package/src/components/Countries/resources/flags/images/sy.png +0 -0
- package/src/components/Countries/resources/flags/images/sz.png +0 -0
- package/src/components/Countries/resources/flags/images/tc.png +0 -0
- package/src/components/Countries/resources/flags/images/td.png +0 -0
- package/src/components/Countries/resources/flags/images/tg.png +0 -0
- package/src/components/Countries/resources/flags/images/th.png +0 -0
- package/src/components/Countries/resources/flags/images/tj.png +0 -0
- package/src/components/Countries/resources/flags/images/tk.png +0 -0
- package/src/components/Countries/resources/flags/images/tl.png +0 -0
- package/src/components/Countries/resources/flags/images/tm.png +0 -0
- package/src/components/Countries/resources/flags/images/tn.png +0 -0
- package/src/components/Countries/resources/flags/images/to.png +0 -0
- package/src/components/Countries/resources/flags/images/tr.png +0 -0
- package/src/components/Countries/resources/flags/images/tt.png +0 -0
- package/src/components/Countries/resources/flags/images/tv.png +0 -0
- package/src/components/Countries/resources/flags/images/tw.png +0 -0
- package/src/components/Countries/resources/flags/images/tz.png +0 -0
- package/src/components/Countries/resources/flags/images/ua.png +0 -0
- package/src/components/Countries/resources/flags/images/ug.png +0 -0
- package/src/components/Countries/resources/flags/images/us.png +0 -0
- package/src/components/Countries/resources/flags/images/uy.png +0 -0
- package/src/components/Countries/resources/flags/images/uz.png +0 -0
- package/src/components/Countries/resources/flags/images/va.png +0 -0
- package/src/components/Countries/resources/flags/images/vc.png +0 -0
- package/src/components/Countries/resources/flags/images/ve.png +0 -0
- package/src/components/Countries/resources/flags/images/vg.png +0 -0
- package/src/components/Countries/resources/flags/images/vi.png +0 -0
- package/src/components/Countries/resources/flags/images/vn.png +0 -0
- package/src/components/Countries/resources/flags/images/vu.png +0 -0
- package/src/components/Countries/resources/flags/images/wf.png +0 -0
- package/src/components/Countries/resources/flags/images/ws.png +0 -0
- package/src/components/Countries/resources/flags/images/ye.png +0 -0
- package/src/components/Countries/resources/flags/images/yt.png +0 -0
- package/src/components/Countries/resources/flags/images/za.png +0 -0
- package/src/components/Countries/resources/flags/images/zm.png +0 -0
- package/src/components/Countries/resources/flags/images/zw.png +0 -0
- package/src/components/Countries/resources/flags/index.js +255 -0
- package/src/components/Countries/utils.js +28 -0
- package/src/components/Datagrid/Accordion/AppleSwipeable.js +123 -0
- package/src/components/Datagrid/Accordion/Filters.js +186 -0
- package/src/components/Datagrid/Accordion/GmailSwipeable.js +85 -0
- package/src/components/Datagrid/Accordion/Row.js +295 -0
- package/src/components/Datagrid/Accordion/index.js +719 -0
- package/src/components/Datagrid/Accordion/utils.js +22 -0
- package/src/components/Datagrid/Actions/Header.js +58 -0
- package/src/components/Datagrid/Actions/index.js +104 -0
- package/src/components/Datagrid/Checkbox.js +40 -0
- package/src/components/Datagrid/Common/Common.js +1866 -0
- package/src/components/Datagrid/Common/TableData.js +245 -0
- package/src/components/Datagrid/Common/factory.js +9 -0
- package/src/components/Datagrid/Common/index.js +7 -0
- package/src/components/Datagrid/Common/session.js +20 -0
- package/src/components/Datagrid/Common/setQueryLimit.js +32 -0
- package/src/components/Datagrid/Footer/Footer.js +86 -0
- package/src/components/Datagrid/Footer/index.js +93 -0
- package/src/components/Datagrid/List.js +2 -0
- package/src/components/Datagrid/RenderType.js +53 -0
- package/src/components/Datagrid/RenderTypes/index.native.js +1 -0
- package/src/components/Datagrid/RenderTypes/index.web.js +10 -0
- package/src/components/Datagrid/RenderTypes/utils.js +5 -0
- package/src/components/Datagrid/Table/Cell.js +45 -0
- package/src/components/Datagrid/Table/Datatable.js +232 -0
- package/src/components/Datagrid/Table/index.js +446 -0
- package/src/components/Datagrid/Table/renderTable.js +664 -0
- package/src/components/Datagrid/factory.js +12 -0
- package/src/components/Datagrid/getComponent.js +26 -0
- package/src/components/Datagrid/index.js +43 -0
- package/src/components/Datagrid/utils.js +185 -0
- package/src/components/Date/DatePickerModal/index.js +10 -0
- package/src/components/Date/DatePickerModal/index.native.js +22 -0
- package/src/components/Date/PickerInput/TextInputMask.js +106 -0
- package/src/components/Date/PickerInput/index.js +253 -0
- package/src/components/Date/Time.js +154 -0
- package/src/components/Date/TimePickerModal/index.js +3 -0
- package/src/components/Date/TimePickerModal/index.native.js +21 -0
- package/src/components/Date/dictionary.js +26 -0
- package/src/components/Date/index.js +11 -0
- package/src/components/Date/utils.common.js +3 -0
- package/src/components/Date/utils.common.native.js +0 -0
- package/src/components/Date/utils.js +209 -0
- package/src/components/Dialog/AppBarDialog.js +41 -0
- package/src/components/Dialog/Dialog.js +377 -0
- package/src/components/Dialog/DialogActions.js +69 -0
- package/src/components/Dialog/DialogFooter.js +36 -0
- package/src/components/Dialog/DialogTitle.js +47 -0
- package/src/components/Dialog/DropdownAlert/Queue.js +28 -0
- package/src/components/Dialog/DropdownAlert/Utils.js +36 -0
- package/src/components/Dialog/DropdownAlert/assets/cancel.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/cancel@2x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/cancel@3x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/error.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/error@2x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/error@3x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/info.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/info@2x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/info@3x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/success.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/success@2x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/success@3x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/warn.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/warn@2x.png +0 -0
- package/src/components/Dialog/DropdownAlert/assets/warn@3x.png +0 -0
- package/src/components/Dialog/DropdownAlert/index.js +685 -0
- package/src/components/Dialog/Provider.js +75 -0
- package/src/components/Dialog/confirm/Alert/Alert.old/Alert.web.js +360 -0
- package/src/components/Dialog/confirm/Alert/Alert.old/index.js +2 -0
- package/src/components/Dialog/confirm/Alert/index.js +43 -0
- package/src/components/Dialog/confirm/index.js +12 -0
- package/src/components/Dialog/confirm/showConfirmOrAlertOrPrompt.js +145 -0
- package/src/components/Dialog/dialogs.js +70 -0
- package/src/components/Dialog/index.js +17 -0
- package/src/components/Dialog/showConfirmOrAlertOrPrompt.js +90 -0
- package/src/components/Dialog/style.css +103 -0
- package/src/components/Dialog/utils.js +33 -0
- package/src/components/Divider/index.js +44 -0
- package/src/components/Drawer/DrawerHeader.js +70 -0
- package/src/components/Drawer/DrawerItems/DrawerItem.js +88 -0
- package/src/components/Drawer/DrawerItems/DrawerSection.js +34 -0
- package/src/components/Drawer/DrawerItems/ExpandableItem.js +44 -0
- package/src/components/Drawer/DrawerItems/_DrawerItem.js +173 -0
- package/src/components/Drawer/DrawerItems/index.js +155 -0
- package/src/components/Drawer/DrawerItems/utils.js +107 -0
- package/src/components/Drawer/DrawerLayout/index.js +476 -0
- package/src/components/Drawer/NavigationView.js +90 -0
- package/src/components/Drawer/Provider.js +6 -0
- package/src/components/Drawer/index.js +455 -0
- package/src/components/Drawer/session.js +28 -0
- package/src/components/Drawer/utils.js +39 -0
- package/src/components/Dropdown/index.js +1317 -0
- package/src/components/Dropdown/utils.js +19 -0
- package/src/components/ErrorBoundary/ErrorMessage.js +107 -0
- package/src/components/ErrorBoundary/Provider.js +68 -0
- package/src/components/ErrorBoundary/index.js +64 -0
- package/src/components/Expandable/Item.js +159 -0
- package/src/components/Expandable/index.js +229 -0
- package/src/components/Fab/Fab.js +46 -0
- package/src/components/Fab/Group.js +143 -0
- package/src/components/Fab/GroupComponent.js +384 -0
- package/src/components/Fab/index.js +8 -0
- package/src/components/FadeInOut/index.js +70 -0
- package/src/components/Filter/filterTextTypes.js +1 -0
- package/src/components/Filter/index.js +570 -0
- package/src/components/Filter/session.js +18 -0
- package/src/components/Filter/utils.js +289 -0
- package/src/components/Form/Action.js +112 -0
- package/src/components/Form/Fields/Checkbox.js +29 -0
- package/src/components/Form/Fields/Color.js +21 -0
- package/src/components/Form/Fields/Date.js +24 -0
- package/src/components/Form/Fields/Field.js +1048 -0
- package/src/components/Form/Fields/Html.js +21 -0
- package/src/components/Form/Fields/IdField.js +131 -0
- package/src/components/Form/Fields/Image.js +65 -0
- package/src/components/Form/Fields/PieceField.js +143 -0
- package/src/components/Form/Fields/Radio.js +31 -0
- package/src/components/Form/Fields/SelectCountry.js +12 -0
- package/src/components/Form/Fields/SelectField.js +147 -0
- package/src/components/Form/Fields/SelectStructData.js +24 -0
- package/src/components/Form/Fields/SelectTableData.js +24 -0
- package/src/components/Form/Fields/SelectTheme.js +11 -0
- package/src/components/Form/Fields/Slider.js +32 -0
- package/src/components/Form/Fields/Switch.js +34 -0
- package/src/components/Form/Fields/Tel.js +21 -0
- package/src/components/Form/Fields/TextField.js +44 -0
- package/src/components/Form/Fields/Time.js +28 -0
- package/src/components/Form/Fields/index.js +52 -0
- package/src/components/Form/Fields/selectPromptField.js +59 -0
- package/src/components/Form/Fields/sprintf.js +42 -0
- package/src/components/Form/Fields/sprintfSelectors.js +117 -0
- package/src/components/Form/Fields/utils.js +8 -0
- package/src/components/Form/Form.js +221 -0
- package/src/components/Form/FormData/Dialog.js +116 -0
- package/src/components/Form/FormData/DialogProvider.js +117 -0
- package/src/components/Form/FormData/FormData.js +403 -0
- package/src/components/Form/FormData/FormDataActions.js +155 -0
- package/src/components/Form/FormData/componentsTypes.js +117 -0
- package/src/components/Form/FormData/index.js +15 -0
- package/src/components/Form/FormData/utils.js +111 -0
- package/src/components/Form/KeyboardAvoidingView.js +23 -0
- package/src/components/Form/KeyboardEventHandler/index.js +115 -0
- package/src/components/Form/KeyboardEventHandler/keyEvents.js +139 -0
- package/src/components/Form/KeyboardEventHandler/readMe.md +1 -0
- package/src/components/Form/List/List.js +794 -0
- package/src/components/Form/List/index.js +2 -0
- package/src/components/Form/index.js +14 -0
- package/src/components/Form/utils/FormsManager.js +101 -0
- package/src/components/Form/utils/index.js +8 -0
- package/src/components/Form/utils/keyboardEvents.js +8 -0
- package/src/components/Form/utils/keyboardShortcuts.js +57 -0
- package/src/components/Grid/Cell.js +108 -0
- package/src/components/Grid/Col.js +30 -0
- package/src/components/Grid/Grid.js +35 -0
- package/src/components/Grid/Row.js +30 -0
- package/src/components/Grid/index.js +11 -0
- package/src/components/Hashtag/index.js +119 -0
- package/src/components/HeavyScreen/index.js +52 -0
- package/src/components/HeavyScreen/utils.js +36 -0
- package/src/components/HelperText/index.js +36 -0
- package/src/components/Html/AutoSizedImage.js +56 -0
- package/src/components/Html/HtmlToElement.js +173 -0
- package/src/components/Html/View.js +166 -0
- package/src/components/Icon/Checkbox.js +83 -0
- package/src/components/Icon/CrossFadeIcon.js +133 -0
- package/src/components/Icon/Icon.js +52 -0
- package/src/components/Icon/IconButton.js +155 -0
- package/src/components/Icon/MaterialCommunityIcon.js +93 -0
- package/src/components/Icon/index.js +10 -0
- package/src/components/Icon/utils.js +15 -0
- package/src/components/Image/Editor/index copy.js +42 -0
- package/src/components/Image/Editor/index.js +52 -0
- package/src/components/Image/index.js +309 -0
- package/src/components/InlineIndicator/Select.js +58 -0
- package/src/components/InlineIndicator/index.js +156 -0
- package/src/components/Label/index.js +104 -0
- package/src/components/Link/Browser.js +17 -0
- package/src/components/Link/getUrlCallback.js +10 -0
- package/src/components/Link/index.js +38 -0
- package/src/components/List/BigList.js +44 -0
- package/src/components/List/Common.js +233 -0
- package/src/components/List/FlashList.js +29 -0
- package/src/components/List/FlatList.js +34 -0
- package/src/components/List/RecyclerView.js +83 -0
- package/src/components/List/index.js +12 -0
- package/src/components/List/utils.js +23 -0
- package/src/components/Logo/Logo.js +98 -0
- package/src/components/Logo/Progress.js +21 -0
- package/src/components/Logo/index.js +3 -0
- package/src/components/Menu/Item.js +203 -0
- package/src/components/Menu/Menu.js +590 -0
- package/src/components/Menu/index.js +118 -0
- package/src/components/Menu/utils.js +81 -0
- package/src/components/Modal/index.js +212 -0
- package/src/components/NewLine/index.js +4 -0
- package/src/components/NewLine/index.web.js +3 -0
- package/src/components/Paragraph/index.js +32 -0
- package/src/components/PasswordText/index.js +29 -0
- package/src/components/PhoneInput/PhoneNumber.js +121 -0
- package/src/components/PhoneInput/country.js +54 -0
- package/src/components/PhoneInput/index.js +217 -0
- package/src/components/PhoneInput/numberType.json +14 -0
- package/src/components/PhoneInput/styles.js +52 -0
- package/src/components/Portal/index.js +5 -0
- package/src/components/Preloader/index.js +227 -0
- package/src/components/Progress/LoadingDots.js +126 -0
- package/src/components/Progress/index.js +18 -0
- package/src/components/Radio/index.js +164 -0
- package/src/components/ReadMoreText/index.js +120 -0
- package/src/components/ScrollView/index.js +34 -0
- package/src/components/Signature/Panel.js +246 -0
- package/src/components/Signature/index.js +69 -0
- package/src/components/SimpleSelect/index.js +483 -0
- package/src/components/Slider/Slider.js +770 -0
- package/src/components/Slider/index.js +144 -0
- package/src/components/Slider/styles.js +39 -0
- package/src/components/SplashScreen/index.js +194 -0
- package/src/components/SplashScreen/styles.js +74 -0
- package/src/components/StatusBar/Component/index.js +5 -0
- package/src/components/StatusBar/Component/index.web.js +88 -0
- package/src/components/StatusBar/index.js +7 -0
- package/src/components/Surface/Elevations.js +218 -0
- package/src/components/Surface/index.js +22 -0
- package/src/components/Swipeable/Swipe.js +225 -0
- package/src/components/Swipeable/SwipeableGesture.js +77 -0
- package/src/components/Swipeable/index.js +5 -0
- package/src/components/Swiper/Controls.js +277 -0
- package/src/components/Swiper/index.js +463 -0
- package/src/components/Swiper/nodeType.js +8 -0
- package/src/components/Swiper/renderNode.js +21 -0
- package/src/components/Switch/index.js +172 -0
- package/src/components/Tab/TabContent.js +72 -0
- package/src/components/Tab/TabItem.js +112 -0
- package/src/components/Tab/TabItems.js +246 -0
- package/src/components/Tab/index.js +114 -0
- package/src/components/Table/index.js +383 -0
- package/src/components/TextField/Affix.js +18 -0
- package/src/components/TextField/index.js +749 -0
- package/src/components/TextField/utils.js +64 -0
- package/src/components/Tooltip/Popover/index.js +254 -0
- package/src/components/Tooltip/Popover/index.web.js +60 -0
- package/src/components/Tooltip/index.js +42 -0
- package/src/components/TouchableRipple/index.js +0 -0
- package/src/components/View/index.js +49 -0
- package/src/components/WebView/Component/index.native.js +2 -0
- package/src/components/WebView/Component/index.web.js +154 -0
- package/src/components/WebView/Component/postMock.html +21 -0
- package/src/components/WebView/index.js +79 -0
- package/src/index.js +166 -0
- package/src/layouts/AppBar/index.js +59 -0
- package/src/layouts/AppBar/utils.js +12 -0
- package/src/layouts/Fab/actions.js +5 -0
- package/src/layouts/Fab/index.js +60 -0
- package/src/layouts/Fab/utils.js +25 -0
- package/src/layouts/Footer/index.js +8 -0
- package/src/layouts/Screen/FormData/FormData.js +103 -0
- package/src/layouts/Screen/FormData/List.js +83 -0
- package/src/layouts/Screen/FormData/index.js +3 -0
- package/src/layouts/Screen/Screen.js +173 -0
- package/src/layouts/Screen/index.js +11 -0
- package/src/media/Assets/index.js +6 -0
- package/src/media/Assets/utils.js +28 -0
- package/src/media/camera.js +1 -0
- package/src/media/camera.native.js +4 -0
- package/src/media/camera.web.js +9 -0
- package/src/media/file-system/index.js +20 -0
- package/src/media/file-system/utils/index.js +32 -0
- package/src/media/file-system/utils/utils.js +0 -0
- package/src/media/file-system/utils.native/index.js +1 -0
- package/src/media/index.js +137 -0
- package/src/navigation/Drawer/ProfilAvatar/defaultAvatar.js +1 -0
- package/src/navigation/Drawer/ProfilAvatar/index.js +142 -0
- package/src/navigation/Drawer/ProfilAvatar/style.css +18 -0
- package/src/navigation/Drawer/index.js +81 -0
- package/src/navigation/Drawer/items/SidebarFeedsItems.js +0 -0
- package/src/navigation/Drawer/items/SyncDataItem.js +20 -0
- package/src/navigation/Drawer/items/index.js +23 -0
- package/src/navigation/Drawer/items/items.js +31 -0
- package/src/navigation/Drawer/utils.js +18 -0
- package/src/navigation/index.js +45 -0
- package/src/navigation/utils.js +1 -0
- package/src/screens/Auth/index.js +31 -0
- package/src/screens/Auth/routes.js +9 -0
- package/src/screens/Auth/utils.js +5 -0
- package/src/screens/index.js +201 -0
- package/src/screens/mainScreens.js +4 -0
- package/src/screens/utils.js +13 -0
- package/webpack.config.js +31 -0
- package/workflows/release-package.yml +33 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as Linking from 'expo-linking';
|
|
2
|
+
import { Pressable } from 'react-native';
|
|
3
|
+
import {isValidUrl,isValidEmail,defaultStr,isSms} from "$utils";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import Browser from "$ecomponents/Browser";
|
|
6
|
+
|
|
7
|
+
export default function AutolinkComponent({onPress,withBrowser,mailto,email,tel,phone,sms,url,href,...props}){
|
|
8
|
+
url = defaultStr(url,href);
|
|
9
|
+
phone = defaultStr(phone,tel).trim();
|
|
10
|
+
const isPhone = phone ? true : false;
|
|
11
|
+
const isUrl = isValidUrl(url);
|
|
12
|
+
email = defaultStr(email,mailto);
|
|
13
|
+
const isEmail = isValidEmail(email);
|
|
14
|
+
return <Pressable
|
|
15
|
+
testID={"RN_AutoLinkComponent"}
|
|
16
|
+
{...props}
|
|
17
|
+
onPress = {(e)=>{
|
|
18
|
+
if(onPress && onPress(e) === false) return;
|
|
19
|
+
if(isUrl){
|
|
20
|
+
if(withBrowser !== false){
|
|
21
|
+
return Browser.openURL(url);
|
|
22
|
+
}
|
|
23
|
+
return Linking.openURL(url);
|
|
24
|
+
}
|
|
25
|
+
if(isEmail){
|
|
26
|
+
return Linking.openURL('mailto:'+email);
|
|
27
|
+
}
|
|
28
|
+
if(isPhone){
|
|
29
|
+
Linking.openURL((sms?"sms:":"tel:")+phone);
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
AutolinkComponent.propTypes = {
|
|
36
|
+
onPress : PropTypes.func,
|
|
37
|
+
phone : PropTypes.string,//le numéro à utiliser
|
|
38
|
+
tel : PropTypes.string,
|
|
39
|
+
sms :PropTypes.bool, //si l'application sms sera ouverte au numéro passé en paramètre
|
|
40
|
+
email : PropTypes.string, //si l'on doit envoyer un mail à l'adresse sur laquelle on a cliqué
|
|
41
|
+
mailto : PropTypes.string, ///alias à email
|
|
42
|
+
url : PropTypes.string,
|
|
43
|
+
href : PropTypes.string, ///si ca ouvrira une url
|
|
44
|
+
withBrowser : PropTypes.bool,///si l'on ouvrira l'url avec le navigateur
|
|
45
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, Image, ImageBackground } from 'react-native';
|
|
3
|
+
|
|
4
|
+
function AnimatableImage(props) {
|
|
5
|
+
const { animated, children, ...rest } = props;
|
|
6
|
+
|
|
7
|
+
const ImageComponent = children
|
|
8
|
+
? ImageBackground
|
|
9
|
+
: animated
|
|
10
|
+
? Animated.Image
|
|
11
|
+
: Image;
|
|
12
|
+
|
|
13
|
+
return <ImageComponent {...rest}>{children}</ImageComponent>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
AnimatableImage.propTypes = Image.propTypes | Animated.Image.propTypes;
|
|
17
|
+
|
|
18
|
+
AnimatableImage.defaultProps = {
|
|
19
|
+
animated: false
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default AnimatableImage;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Platform, Image } from 'react-native';
|
|
3
|
+
import AnimatableImage from './AnimatableImage';
|
|
4
|
+
|
|
5
|
+
const isAndroid = () => Platform.OS === 'android';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* An extension of the Image class which fixes an Android bug where remote images wouldn't fire the
|
|
9
|
+
* Image#onError() callback when the image failed to load due to a 404 response.
|
|
10
|
+
*
|
|
11
|
+
* This component should only be used for loading remote images, not local resources.
|
|
12
|
+
*/
|
|
13
|
+
function ImagePolyfill(props) {
|
|
14
|
+
const { source, onError, ...rest } = props;
|
|
15
|
+
|
|
16
|
+
const verifyImage = () => {
|
|
17
|
+
const { uri } = source;
|
|
18
|
+
Image.prefetch(uri).catch((e) => onError(e));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (source && source.uri && onError && isAndroid()) {
|
|
23
|
+
verifyImage();
|
|
24
|
+
}
|
|
25
|
+
}, [source, onError]);
|
|
26
|
+
|
|
27
|
+
return <AnimatableImage source={source} {...rest} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ImagePolyfill.propTypes = AnimatableImage.propTypes;
|
|
31
|
+
ImagePolyfill.defaultProps = AnimatableImage.defaultProps;
|
|
32
|
+
|
|
33
|
+
export default ImagePolyfill;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Image } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* store with
|
|
5
|
+
* key: image
|
|
6
|
+
* value: {
|
|
7
|
+
* width: 100,
|
|
8
|
+
* height: 100,
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
const cache = new Map();
|
|
12
|
+
|
|
13
|
+
const getImageSizeFromCache = (image) => {
|
|
14
|
+
if (typeof image === 'number') {
|
|
15
|
+
return cache.get(image);
|
|
16
|
+
} else {
|
|
17
|
+
return cache.get(image.uri);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const loadImageSize = (image) => {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
//number indicates import X or require(X) was used (i.e. local file)
|
|
24
|
+
if (typeof image === 'number') {
|
|
25
|
+
const { width, height } = Image.resolveAssetSource(image);
|
|
26
|
+
resolve({ width, height });
|
|
27
|
+
} else {
|
|
28
|
+
Image.getSize(
|
|
29
|
+
image.uri,
|
|
30
|
+
(width, height) => {
|
|
31
|
+
// success
|
|
32
|
+
resolve({ width, height });
|
|
33
|
+
},
|
|
34
|
+
reject
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const getImageSizeFitWidthFromCache = (image, toWidth, maxHeight) => {
|
|
41
|
+
const size = getImageSizeFromCache(image);
|
|
42
|
+
if (size) {
|
|
43
|
+
const { width, height } = size;
|
|
44
|
+
if (!width || !height) return { width: 0, height: 0 };
|
|
45
|
+
const scaledHeight = (toWidth * height) / width;
|
|
46
|
+
return {
|
|
47
|
+
width: toWidth,
|
|
48
|
+
height: scaledHeight > maxHeight ? maxHeight : scaledHeight
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getImageSizeMaybeFromCache = async (image) => {
|
|
55
|
+
let size = getImageSizeFromCache(image);
|
|
56
|
+
if (!size) {
|
|
57
|
+
size = await loadImageSize(image);
|
|
58
|
+
if (typeof image === 'number') {
|
|
59
|
+
cache.set(image, size);
|
|
60
|
+
} else {
|
|
61
|
+
cache.set(image.uri, size);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return size;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const getImageSizeFitWidth = async (image, toWidth, maxHeight) => {
|
|
68
|
+
const { width, height } = await getImageSizeMaybeFromCache(image);
|
|
69
|
+
if (!width || !height) return { width: 0, height: 0 };
|
|
70
|
+
const scaledHeight = (toWidth * height) / width;
|
|
71
|
+
return {
|
|
72
|
+
width: toWidth,
|
|
73
|
+
height: scaledHeight > maxHeight ? maxHeight : scaledHeight
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
///@see : https://github.com/vivaxy/react-native-auto-height-image
|
|
2
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
+
import ImagePolyfill from './ImagePolyfill';
|
|
4
|
+
import AnimatableImage from './AnimatableImage';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { ActivityIndicator } from 'react-native-paper';
|
|
7
|
+
import theme from "$theme";
|
|
8
|
+
import View from "$ecomponents/View";
|
|
9
|
+
import {defaultStr} from "$utils";
|
|
10
|
+
|
|
11
|
+
import { getImageSizeFitWidth, getImageSizeFitWidthFromCache } from './cache';
|
|
12
|
+
import { NOOP, DEFAULT_HEIGHT } from './helpers';
|
|
13
|
+
|
|
14
|
+
const {...ImagePropTypes } = AnimatableImage.propTypes;
|
|
15
|
+
|
|
16
|
+
function AutoHeightImage(props) {
|
|
17
|
+
const {
|
|
18
|
+
onHeightChange,
|
|
19
|
+
source,
|
|
20
|
+
width,
|
|
21
|
+
style,
|
|
22
|
+
maxHeight,
|
|
23
|
+
onError,
|
|
24
|
+
testID:cTestID,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
27
|
+
const [height, setHeight] = useState(
|
|
28
|
+
getImageSizeFitWidthFromCache(source, width, maxHeight).height ||
|
|
29
|
+
DEFAULT_HEIGHT
|
|
30
|
+
);
|
|
31
|
+
const mountedRef = useRef(false);
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
mountedRef.current = true;
|
|
35
|
+
return function () {
|
|
36
|
+
mountedRef.current = false;
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
useEffect(
|
|
41
|
+
function () {
|
|
42
|
+
(async function () {
|
|
43
|
+
try {
|
|
44
|
+
const { height: newHeight } = await getImageSizeFitWidth(
|
|
45
|
+
source,
|
|
46
|
+
width,
|
|
47
|
+
maxHeight
|
|
48
|
+
);
|
|
49
|
+
if (mountedRef.current) {
|
|
50
|
+
// might trigger `onHeightChange` with same `height` value
|
|
51
|
+
// dedupe maybe?
|
|
52
|
+
setHeight(newHeight);
|
|
53
|
+
onHeightChange(newHeight);
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
56
|
+
if(onError){
|
|
57
|
+
onError(e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
},
|
|
62
|
+
[source, onHeightChange, width, maxHeight]
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// StyleSheet.create will cache styles, not what we want
|
|
66
|
+
const imageStyles = { width, height };
|
|
67
|
+
const testID = defaultStr(cTestID,"RN_AutoHeightImageComponent")
|
|
68
|
+
// Since it only makes sense to use polyfill with remote images
|
|
69
|
+
const ImageComponent = source.uri ? ImagePolyfill : AnimatableImage;
|
|
70
|
+
return (<View testID={testID+"_Container"} style={{flexDirection:'row'}}>
|
|
71
|
+
<ImageComponent
|
|
72
|
+
testID = {testID}
|
|
73
|
+
source={source}
|
|
74
|
+
style={[imageStyles, style]}
|
|
75
|
+
onError={onError}
|
|
76
|
+
{...rest}
|
|
77
|
+
/>
|
|
78
|
+
{!mountedRef.current ? <ActivityIndicator testID={testID+"_ActivityIndicator"} color={theme.colors.primary}/> : null}
|
|
79
|
+
</View>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
AutoHeightImage.propTypes = {
|
|
84
|
+
...ImagePropTypes,
|
|
85
|
+
width: PropTypes.number.isRequired,
|
|
86
|
+
maxHeight: PropTypes.number,
|
|
87
|
+
onHeightChange: PropTypes.func,
|
|
88
|
+
animated: PropTypes.bool
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
AutoHeightImage.defaultProps = {
|
|
92
|
+
maxHeight: Infinity,
|
|
93
|
+
onHeightChange: NOOP,
|
|
94
|
+
animated: false
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default AutoHeightImage;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from '$react';
|
|
2
|
+
import {Image,StyleSheet,TouchableOpacity} from 'react-native';
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { StyleProp } from '$theme';
|
|
5
|
+
import {defaultStr,isNumber,defaultNumber} from "$utils";
|
|
6
|
+
import AutoHeightImage from "./AutoHeightImage";
|
|
7
|
+
|
|
8
|
+
export const SIZE = 64;
|
|
9
|
+
|
|
10
|
+
export const MIN_SIZE = 30;
|
|
11
|
+
const isV = x=> isNumber(x) && x ? true : false;
|
|
12
|
+
|
|
13
|
+
const AvatarImage = React.forwardRef(({
|
|
14
|
+
size = SIZE,
|
|
15
|
+
source,
|
|
16
|
+
style,
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
onError,
|
|
20
|
+
onLayout,
|
|
21
|
+
onLoad,
|
|
22
|
+
onLoadEnd,
|
|
23
|
+
onLoadStart,
|
|
24
|
+
onProgress,
|
|
25
|
+
testID,
|
|
26
|
+
imageProps,
|
|
27
|
+
rounded,
|
|
28
|
+
...rest
|
|
29
|
+
},ref) => {
|
|
30
|
+
imageProps = defaultObj(imageProps);
|
|
31
|
+
testID = defaultStr(testID,'RN_AvatarImageComponent');
|
|
32
|
+
const isRounded = rounded !== false ? true : false;
|
|
33
|
+
let borderRadius = 0;
|
|
34
|
+
const flattenedStyle = StyleSheet.flatten(style) || {};
|
|
35
|
+
width = width || flattenedStyle.width;
|
|
36
|
+
height = height || flattenedStyle.height;
|
|
37
|
+
if(isRounded && isV(size)){
|
|
38
|
+
width = height = size;
|
|
39
|
+
borderRadius = size / 2;
|
|
40
|
+
}
|
|
41
|
+
const hasImage = isV(width) && isV(height) && (isRounded || width === height);
|
|
42
|
+
const C = hasImage ? Image : AutoHeightImage;
|
|
43
|
+
if(!isV(width)){
|
|
44
|
+
width = defaultNumber(height,MIN_SIZE);
|
|
45
|
+
}
|
|
46
|
+
const cProps = !hasImage? {width,height} : {};
|
|
47
|
+
return (
|
|
48
|
+
<TouchableOpacity
|
|
49
|
+
ref = {ref}
|
|
50
|
+
testID = {testID}
|
|
51
|
+
style={[
|
|
52
|
+
isRounded && {
|
|
53
|
+
width,
|
|
54
|
+
height,
|
|
55
|
+
borderRadius,
|
|
56
|
+
},
|
|
57
|
+
flattenedStyle,
|
|
58
|
+
]}
|
|
59
|
+
{...rest}
|
|
60
|
+
>
|
|
61
|
+
{typeof source === 'function' && source({ size })}
|
|
62
|
+
{typeof source !== 'function' && (
|
|
63
|
+
<C
|
|
64
|
+
testID={testID+"_Image"}
|
|
65
|
+
source={source}
|
|
66
|
+
{...cProps}
|
|
67
|
+
{...imageProps}
|
|
68
|
+
style={[
|
|
69
|
+
hasImage && { width,height,borderRadius},
|
|
70
|
+
//!hasImage && width && {width},
|
|
71
|
+
]}
|
|
72
|
+
onError={onError}
|
|
73
|
+
onLayout={onLayout}
|
|
74
|
+
onLoad={onLoad}
|
|
75
|
+
onLoadEnd={onLoadEnd}
|
|
76
|
+
onLoadStart={onLoadStart}
|
|
77
|
+
onProgress={onProgress}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
85
|
+
|
|
86
|
+
AvatarImage.propTypes = {
|
|
87
|
+
rounded : PropTypes.bool,
|
|
88
|
+
source: PropTypes.oneOfType([
|
|
89
|
+
PropTypes.number,
|
|
90
|
+
PropTypes.string,
|
|
91
|
+
PropTypes.object,
|
|
92
|
+
PropTypes.func,
|
|
93
|
+
]),
|
|
94
|
+
/**
|
|
95
|
+
* Size of the avatar.
|
|
96
|
+
*/
|
|
97
|
+
size : PropTypes.number,
|
|
98
|
+
style : StyleProp,
|
|
99
|
+
onError : PropTypes.func,
|
|
100
|
+
onLayout : PropTypes.func,
|
|
101
|
+
onLoad : PropTypes.func,
|
|
102
|
+
onLoadEnd : PropTypes.func,
|
|
103
|
+
onLoadStart : PropTypes.func,
|
|
104
|
+
onProgress : PropTypes.func,
|
|
105
|
+
width : PropTypes.oneOfType([
|
|
106
|
+
//PropTypes.string,
|
|
107
|
+
PropTypes.number,
|
|
108
|
+
]),
|
|
109
|
+
height : PropTypes.oneOfType([
|
|
110
|
+
//PropTypes.string,
|
|
111
|
+
PropTypes.number,
|
|
112
|
+
])
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default AvatarImage;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from '$react';
|
|
2
|
+
import {Text,StyleSheet} from 'react-native';
|
|
3
|
+
import View from "$ecomponents/View";
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import {Colors,StylePropTypes} from "$theme";
|
|
6
|
+
import {defaultStr,defaultNumber} from "$utils";
|
|
7
|
+
|
|
8
|
+
const defaultSize = 64;
|
|
9
|
+
|
|
10
|
+
const AvatarTextComponent = (props) => {
|
|
11
|
+
const {
|
|
12
|
+
label : customLabel,
|
|
13
|
+
size : customSize,
|
|
14
|
+
containerProps : customContainerProps,
|
|
15
|
+
color : customColor,
|
|
16
|
+
labelStyle,
|
|
17
|
+
children,
|
|
18
|
+
style : customStyle,
|
|
19
|
+
} = props;
|
|
20
|
+
const containerProps = defaultObj(customContainerProps);
|
|
21
|
+
const size = defaultNumber(customSize,defaultSize);
|
|
22
|
+
const style = Object.assign({},StyleSheet.flatten(customStyle));
|
|
23
|
+
let label = defaultStr(customLabel,children);
|
|
24
|
+
if(!label) return null;
|
|
25
|
+
label = label.trim();
|
|
26
|
+
const color = Colors.isValid(customColor)? customColor : Colors.isValid(style.color)? style.color : undefined;
|
|
27
|
+
const words = label.split(" ");
|
|
28
|
+
let l = "";
|
|
29
|
+
for(let i in words){
|
|
30
|
+
if(l.length == 2) break;
|
|
31
|
+
if(words[i]){
|
|
32
|
+
words[i] = words[i].trim()
|
|
33
|
+
if(words[i][0]){
|
|
34
|
+
l+= words[i][0].toUpperCase();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const textContainerStyle = {
|
|
39
|
+
marginTop: -(size / 20),
|
|
40
|
+
height: size,
|
|
41
|
+
width: size,
|
|
42
|
+
};
|
|
43
|
+
return (
|
|
44
|
+
<View pointerEvents='none' {...containerProps} style={[styles.container,style,containerProps.style,textContainerStyle,{borderRadius:size/2}]}>
|
|
45
|
+
{ <Text
|
|
46
|
+
style={[{
|
|
47
|
+
color: color,
|
|
48
|
+
fontSize: size / 2.5,
|
|
49
|
+
}, labelStyle]}
|
|
50
|
+
adjustsFontSizeToFit={true}
|
|
51
|
+
>
|
|
52
|
+
{l}
|
|
53
|
+
</Text>}
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
AvatarTextComponent.propTypes = {
|
|
59
|
+
label: PropTypes.string,
|
|
60
|
+
size: PropTypes.number,
|
|
61
|
+
color: PropTypes.string,
|
|
62
|
+
labelStyle: PropTypes.object,
|
|
63
|
+
style: StylePropTypes,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const styles = StyleSheet.create({
|
|
67
|
+
container : {
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
export default AvatarTextComponent;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Avatar } from "react-native-paper";
|
|
2
|
+
import {Colors} from "$theme";
|
|
3
|
+
import {defaultDecimal,isNumber,defaultVal,isValid,defaultStr,defaultObj} from "$utils";
|
|
4
|
+
import {StyleSheet} from "react-native";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import Text from "./Text";
|
|
7
|
+
import theme from "$theme";
|
|
8
|
+
import AvatarImage from "./Image";
|
|
9
|
+
|
|
10
|
+
const defaultSize = 40;
|
|
11
|
+
|
|
12
|
+
/*** for more documentation
|
|
13
|
+
* @see : https://callstack.github.io/react-native-paper/avatar-text.html
|
|
14
|
+
* @see : https://callstack.github.io/react-native-paper/avatar-image.html
|
|
15
|
+
* @see : https://callstack.github.io/react-native-paper/avatar-icon.html
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
const AvatarComponent = React.forwardRef((props,ref)=>{
|
|
19
|
+
let Component = undefined;
|
|
20
|
+
let {image,icon,testID,color,src,useSuffix,suffix,size,children,label,source,text,...rest} = props;
|
|
21
|
+
label = defaultVal(label,text,children);
|
|
22
|
+
if(typeof label =='number') label = label+"";
|
|
23
|
+
rest = defaultObj(rest);
|
|
24
|
+
size = defaultDecimal(size,defaultSize)
|
|
25
|
+
let cProps = {size};
|
|
26
|
+
if(source || image || src){
|
|
27
|
+
Component = AvatarImage;
|
|
28
|
+
cProps.source = source || {uri:src};
|
|
29
|
+
} else if(icon){
|
|
30
|
+
Component = Avatar.Icon;
|
|
31
|
+
cProps.icon = icon;
|
|
32
|
+
} else if(label){
|
|
33
|
+
cProps.label = label;
|
|
34
|
+
cProps.pointerEvents = "none";
|
|
35
|
+
cProps.labelStyle = StyleSheet.flatten(cProps.labelStyle) || {};
|
|
36
|
+
Component = Text;
|
|
37
|
+
}
|
|
38
|
+
if(!Component){
|
|
39
|
+
console.error("Error on avatar, components not defined using props",props,label);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if(React.isValidElement(icon)){
|
|
43
|
+
return icon
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let style = StyleSheet.flatten([styles.container,cProps.style,rest.style,styles.center]);
|
|
47
|
+
const hasColor = Colors.isValid(color);
|
|
48
|
+
color = hasColor? color : Colors.isValid(style.color) ? style.color : undefined;
|
|
49
|
+
if((!color || useSuffix) && isNumber(suffix)){
|
|
50
|
+
style = [style,{...cProps,...Colors.getAvatarStyleFromSuffix(suffix)}];
|
|
51
|
+
} else if(hasColor){
|
|
52
|
+
style.backgroundColor = color;
|
|
53
|
+
style.color = Colors.getContrast(color);
|
|
54
|
+
}
|
|
55
|
+
return <Component
|
|
56
|
+
{...rest}
|
|
57
|
+
{...cProps}
|
|
58
|
+
ref={ref}
|
|
59
|
+
testID = {defaultStr(testID,"RN_AvatarComponent")}
|
|
60
|
+
style = {style}
|
|
61
|
+
size= {size}
|
|
62
|
+
/>
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
AvatarComponent.displayName = "AvatarComponent";
|
|
66
|
+
|
|
67
|
+
export default theme.withStyles(AvatarComponent,{
|
|
68
|
+
displayName : "AvatarComponent",
|
|
69
|
+
mode : "contained",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
container : {
|
|
74
|
+
paddingVertical : 0,
|
|
75
|
+
marginVertical : 0,
|
|
76
|
+
},
|
|
77
|
+
center : {
|
|
78
|
+
justifyContent : 'center',
|
|
79
|
+
paddingHorizontal:0,
|
|
80
|
+
paddingVertical : 0,
|
|
81
|
+
alignItems : 'center',
|
|
82
|
+
alignSelf:'center'
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
AvatarComponent.Text = Text;
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
export {Text};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import Fab from "$ecomponents/Fab";
|
|
2
|
+
import {isObj,defaultStr,defaultVal,defaultObj} from "$utils";
|
|
3
|
+
import React from "$react";
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
|
|
7
|
+
const SCREEN_INDENT = 20;
|
|
8
|
+
export const isNativeScrollEvent = (nativeEvent)=>!isObj(nativeEvent) || !isObj(nativeEvent.layoutMeasurement) || !isObj(nativeEvent.contentOffset) ? false : true;
|
|
9
|
+
export const canBackToTop = (nativeEvent,check) => {
|
|
10
|
+
if(check !== false && !isNativeScrollEvent(nativeEvent)) return false;
|
|
11
|
+
const {layoutMeasurement, contentOffset, contentSize} = nativeEvent;
|
|
12
|
+
return contentOffset.y >= layoutMeasurement.height+SCREEN_INDENT ? true : false ||
|
|
13
|
+
layoutMeasurement.height + contentOffset.y >= contentSize.height - SCREEN_INDENT ? true : false;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const toggleVisibility = (scrollEvent)=>{
|
|
17
|
+
const event = isObj(scrollEvent) && isNativeScrollEvent(scrollEvent.nativeEvent)? scrollEvent.nativeEvent : isNativeScrollEvent(scrollEvent)? scrollEvent : undefined;
|
|
18
|
+
if(!event) return undefined;
|
|
19
|
+
return canBackToTop(event,false);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const BackToTopComponent = React.forwardRef((props,ref)=>{
|
|
23
|
+
const isMounted = React.useIsMounted();
|
|
24
|
+
const {onPress,accessibilityLabel,onBackToTop,onVisibilityChange,position,icon,...rProps} = props;
|
|
25
|
+
const rest = defaultObj(rProps);
|
|
26
|
+
const [state,setState] = React.useStateIfMounted({
|
|
27
|
+
visible : false,
|
|
28
|
+
});
|
|
29
|
+
const open = ()=>{
|
|
30
|
+
if(!isMounted() || state.visible)return;
|
|
31
|
+
setState({...state,visible:true});
|
|
32
|
+
}
|
|
33
|
+
const close = ()=>{
|
|
34
|
+
if(!isMounted() || !state.visible)return;
|
|
35
|
+
setState({...state,visible:false});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const context = {open,close,
|
|
39
|
+
toggleVisibility:(event)=>{
|
|
40
|
+
if(!isMounted()) return;
|
|
41
|
+
let v = toggleVisibility(event);
|
|
42
|
+
if(typeof v =='boolean' && v !== state.visible){
|
|
43
|
+
return v ? open() : close();
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
React.useEffect(()=>{
|
|
50
|
+
if(onVisibilityChange){
|
|
51
|
+
onVisibilityChange({context,visible});
|
|
52
|
+
}
|
|
53
|
+
},[state.visible])
|
|
54
|
+
const style = defaultStr(position).toLowerCase() =='right' ? {
|
|
55
|
+
right: 0
|
|
56
|
+
} : {left : 0};
|
|
57
|
+
React.setRef(ref,context);
|
|
58
|
+
React.useEffect(()=>{
|
|
59
|
+
React.setRef(ref,context);
|
|
60
|
+
},[])
|
|
61
|
+
return !state.visible ? null : <Fab
|
|
62
|
+
{...rest}
|
|
63
|
+
accessibilityLabel = {defaultStr(rest.accessibilityLabel,'Retour en haut')}
|
|
64
|
+
onPress = {(e)=>{
|
|
65
|
+
React.stopEventPropagation(e);
|
|
66
|
+
if(onPress){
|
|
67
|
+
onPress({...context,event:e});
|
|
68
|
+
} else if(onBackToTop){
|
|
69
|
+
onBackToTop({...context,e});
|
|
70
|
+
}
|
|
71
|
+
}}
|
|
72
|
+
icon = {defaultVal(icon,'arrow-up')}
|
|
73
|
+
style = {[rest.style,style]}
|
|
74
|
+
/>
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
BackToTopComponent.propTypes = {
|
|
80
|
+
...Fab.propTypes,
|
|
81
|
+
onBackToTop : PropTypes.func,
|
|
82
|
+
onPress : PropTypes.func,
|
|
83
|
+
/*** lorque la visibilité du boutton change si isVisible est positif, alors le contenu est scrollToTopé*/
|
|
84
|
+
onVisibilityChange : PropTypes.func,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default BackToTopComponent;
|
|
88
|
+
|
|
89
|
+
BackToTopComponent.displayName = "BackToTopComponent";
|