@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,19 @@
|
|
|
1
|
+
import {isMobileOrTabletMedia} from "$cplatform/dimensions";
|
|
2
|
+
import {isNativeMobile} from "$cplatform";
|
|
3
|
+
|
|
4
|
+
export const matchOperators = /[|\\{}()[\]^$+*?.]/g;
|
|
5
|
+
|
|
6
|
+
export const SEARCH_TIMEOUT = 1500;
|
|
7
|
+
|
|
8
|
+
export const MAX_AUTO_FOCUS_ITEMS = 10;
|
|
9
|
+
|
|
10
|
+
export const getSearchTimeout = (itemCount)=>{
|
|
11
|
+
if(typeof itemCount !=='number') return SEARCH_TIMEOUT;
|
|
12
|
+
return itemCount <= (isMobileOrTabletMedia()? 100 : 1000) ? 0 : SEARCH_TIMEOUT;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**** voir si le champ de recherche du composant peut être autofocus enf onction du nombre d'items et du type d'environnement */
|
|
16
|
+
export const canAutoFocusSearchField = ({visible,items})=>{
|
|
17
|
+
const count = typeof items =='number'? items : typeof (items) === 'object' ? Object.size(items) : 0;
|
|
18
|
+
return visible && (!isNativeMobile() || count > MAX_AUTO_FOCUS_ITEMS) ? true : false;
|
|
19
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import Types from 'prop-types';
|
|
3
|
+
import {StyleSheet,View,TouchableOpacity,useWindowDimensions} from "react-native";
|
|
4
|
+
import ScrollView from "$ecomponents/ScrollView";
|
|
5
|
+
import {Paragraph,Button,List } from "react-native-paper";
|
|
6
|
+
import Portal from "$ecomponents/Portal";
|
|
7
|
+
import theme from "$theme";
|
|
8
|
+
import {navigationRef,sanitizeName} from "$enavigation/utils";
|
|
9
|
+
import {isMobileNative} from "$cplatform";
|
|
10
|
+
import Expandable from "$ecomponents/Expandable";
|
|
11
|
+
import Label from "$ecomponents/Label";
|
|
12
|
+
|
|
13
|
+
const homeRoute = sanitizeName("Home");
|
|
14
|
+
import {isWeb} from "$cplatform";
|
|
15
|
+
|
|
16
|
+
const ErrorMessage = React.forwardRef(function(props,ref){
|
|
17
|
+
const { error,resetError,onGoBack, info } = props
|
|
18
|
+
const goToHome = ()=> {
|
|
19
|
+
if(navigationRef){
|
|
20
|
+
navigationRef.navigate(homeRoute);
|
|
21
|
+
if(typeof onGoBack =='function'){
|
|
22
|
+
onGoBack();
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if(!error || !info || !error.toString) return null;
|
|
28
|
+
const pointerEvents = 'auto';
|
|
29
|
+
const {width,height} = useWindowDimensions();
|
|
30
|
+
return <Portal>
|
|
31
|
+
<View ref={ref} testID='RN_ErrorBoundary_Container' pointerEvents={pointerEvents} style={[styles.container,isWeb()?{position:'fixed'}:null,{backgroundColor:theme.colors.surface,width,height}]}>
|
|
32
|
+
<View style={styles.content} pointerEvents={pointerEvents}>
|
|
33
|
+
<Label style={styles.title}>Oops!</Label>
|
|
34
|
+
<Label style={styles.subtitle}>{'Une erreur est survenue'}</Label>
|
|
35
|
+
<Label style={styles.error}>{error.toString()}</Label>
|
|
36
|
+
<Button mode="contained" pointerEvents={pointerEvents} iconProps={{marginVertical:0,paddingVertical:0}} icon='home-variant' style={{backgroundColor:theme.colors.primary,marginHorizontal:10}} labelStyle={{color:theme.colors.primaryLabel}} onPress={goToHome}>
|
|
37
|
+
Retour à l'accueil
|
|
38
|
+
</Button>
|
|
39
|
+
<Expandable title="Plus de détail sur l'erreur">
|
|
40
|
+
<View style={{maxHeight:height}}>
|
|
41
|
+
<ScrollView style={{flex:1}} contentContainerStyle={{flex:1,flexGrow:1,paddingBottom:30,maxHeight:Math.max(height-200,200)}} testID='RN_ErrorBoundary_ScrollView'>
|
|
42
|
+
<Paragraph testID='RN_ErrorBoundary_StackDetails' style={[styles.componentStack,{color:theme.colors.text}]}>
|
|
43
|
+
{info.componentStack}
|
|
44
|
+
</Paragraph>
|
|
45
|
+
</ScrollView>
|
|
46
|
+
</View>
|
|
47
|
+
</Expandable>
|
|
48
|
+
</View>
|
|
49
|
+
</View>
|
|
50
|
+
</Portal>
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
ErrorMessage.displayName = "ErroBoundaryMessageComponent";
|
|
54
|
+
|
|
55
|
+
ErrorMessage.propTypes = {
|
|
56
|
+
error: Types.object,//.isRequired,
|
|
57
|
+
info: Types.shape({
|
|
58
|
+
componentStack: Types.string.isRequired
|
|
59
|
+
}),//.isRequired,
|
|
60
|
+
customStyles: Types.shape({
|
|
61
|
+
container: Types.object,
|
|
62
|
+
errorMessage: Types.object,
|
|
63
|
+
componentStack: Types.object,
|
|
64
|
+
browserInfo: Types.object,
|
|
65
|
+
arrow: Types.object
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
container: {
|
|
71
|
+
backgroundColor: '#fafafa',
|
|
72
|
+
flex: 1,
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
...StyleSheet.absoluteFillObject,
|
|
75
|
+
paddingHorizontal : 16,
|
|
76
|
+
top : 0,
|
|
77
|
+
left : 0,
|
|
78
|
+
paddingVertical : 16,
|
|
79
|
+
},
|
|
80
|
+
content : {
|
|
81
|
+
flex : 1,
|
|
82
|
+
},
|
|
83
|
+
title: {
|
|
84
|
+
fontSize: 48,
|
|
85
|
+
fontWeight: '300',
|
|
86
|
+
paddingBottom: 16,
|
|
87
|
+
},
|
|
88
|
+
subtitle: {
|
|
89
|
+
fontSize: 32,
|
|
90
|
+
fontWeight: '800',
|
|
91
|
+
},
|
|
92
|
+
error: {
|
|
93
|
+
paddingVertical:16
|
|
94
|
+
},
|
|
95
|
+
button: {
|
|
96
|
+
backgroundColor: '#2196f3',
|
|
97
|
+
borderRadius: 50,
|
|
98
|
+
padding: 16
|
|
99
|
+
},
|
|
100
|
+
buttonLabel: {
|
|
101
|
+
fontWeight: '600',
|
|
102
|
+
textAlign: 'center'
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
export default ErrorMessage
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import ErrorMessage from "./ErrorMessage";
|
|
2
|
+
import Portal from "$ecomponents/Portal";
|
|
3
|
+
let providerRef = null;
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import useForceRender from "$react/useForceRender";
|
|
6
|
+
import setRef from "$react/setRef";
|
|
7
|
+
|
|
8
|
+
const providerState = {};
|
|
9
|
+
|
|
10
|
+
export const createProviderRef = (cb)=>{
|
|
11
|
+
const ref = React.useRef(null);
|
|
12
|
+
React.useEffect(()=>{
|
|
13
|
+
if(typeof cb =='function'){
|
|
14
|
+
cb(ref.current);
|
|
15
|
+
} else if(cb !== false) {
|
|
16
|
+
providerRef = ref.current;
|
|
17
|
+
}
|
|
18
|
+
},[ref.current])
|
|
19
|
+
return ref;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const getProviderRef = ()=> providerRef;
|
|
23
|
+
|
|
24
|
+
const Provider = React.forwardRef((_props,innerRef)=>{
|
|
25
|
+
const ref = innerRef || createProviderRef();
|
|
26
|
+
const propRef = React.useRef(_props);
|
|
27
|
+
const forceRender = useForceRender();
|
|
28
|
+
const messageRef = React.useRef(null);
|
|
29
|
+
const [context] = React.useState({
|
|
30
|
+
open : (props)=>{
|
|
31
|
+
if(typeof props =='object' && props){
|
|
32
|
+
propRef.current = props;
|
|
33
|
+
forceRender();
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
isOpen : x=> {
|
|
37
|
+
console.log("checking message ref",messageRef.current);
|
|
38
|
+
return messageRef.current && messageRef.current.setNativeProps ? true : false
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
setRef(ref,context);
|
|
42
|
+
|
|
43
|
+
return <Portal>
|
|
44
|
+
<ErrorMessage {...propRef.current} ref={el=>{
|
|
45
|
+
messageRef.current = el;
|
|
46
|
+
setRef(propRef.current.messageRef);
|
|
47
|
+
}}/>
|
|
48
|
+
</Portal>
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
Provider.displayName = "ErrorBoundaryProvider";
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export default Provider;
|
|
55
|
+
|
|
56
|
+
export const isOpen = ()=>{
|
|
57
|
+
const ref = getProviderRef();
|
|
58
|
+
if(ref && typeof ref.isOpen =='function') return ref.isOpen();
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
export const isClosed = x=> !isOpen();
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const open = (props)=>{
|
|
65
|
+
const ref = getProviderRef();
|
|
66
|
+
if(ref && typeof ref.open =='function') return ref.open(props);
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Types from 'prop-types'
|
|
3
|
+
import ErrorMessage from './ErrorMessage'
|
|
4
|
+
import {open,close} from "$preloader";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ErrorBoundary extends React.Component {
|
|
8
|
+
state = {
|
|
9
|
+
error: null,
|
|
10
|
+
info: null,
|
|
11
|
+
hasError: false
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
componentDidCatch (error, info) {
|
|
15
|
+
close();
|
|
16
|
+
this.setState({
|
|
17
|
+
hasError : true,
|
|
18
|
+
error,info
|
|
19
|
+
},()=>{
|
|
20
|
+
const args = {context:this,error, info: info.componentStack,stack:info.componentStack};
|
|
21
|
+
if (typeof this.props.onError === 'function') {
|
|
22
|
+
this.props.onError(args);
|
|
23
|
+
} else if(typeof this.props.onCatch =='function'){
|
|
24
|
+
this.props.onCatch(args);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
resetError(){
|
|
29
|
+
this.setState({ hasError: false })
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render () {
|
|
33
|
+
const { error, info, hasError } = this.state
|
|
34
|
+
const { render, customStyles } = this.props
|
|
35
|
+
if (hasError) {
|
|
36
|
+
if (typeof (render) === 'function') {
|
|
37
|
+
return render(error, info)
|
|
38
|
+
} else {
|
|
39
|
+
return (
|
|
40
|
+
<ErrorMessage
|
|
41
|
+
error={error}
|
|
42
|
+
info={info}
|
|
43
|
+
resetError={this.resetError}
|
|
44
|
+
customStyles={customStyles}
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return this.props.children
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ErrorBoundary.propTypes = {
|
|
55
|
+
render: Types.func,
|
|
56
|
+
customStyles: Types.shape({
|
|
57
|
+
container: Types.object,
|
|
58
|
+
errorMessage: Types.object,
|
|
59
|
+
componentStack: Types.object,
|
|
60
|
+
arrow: Types.object
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default ErrorBoundary
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import color from 'color';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {defaultObj,defaultStr} from "$utils";
|
|
4
|
+
import Label from "$ecomponents/Label"
|
|
5
|
+
import theme from "$theme";
|
|
6
|
+
import View from "$ecomponents/View";
|
|
7
|
+
import {
|
|
8
|
+
StyleSheet,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
|
|
11
|
+
import {TouchableRipple,withTheme} from "react-native-paper";
|
|
12
|
+
|
|
13
|
+
const ExpandableItem = ({left,right,title,description,
|
|
14
|
+
onPress,
|
|
15
|
+
style,
|
|
16
|
+
titleStyle,
|
|
17
|
+
titleNumberOfLines = 1,
|
|
18
|
+
descriptionNumberOfLines = 2,
|
|
19
|
+
titleEllipsizeMode,
|
|
20
|
+
descriptionEllipsizeMode,
|
|
21
|
+
descriptionStyle,
|
|
22
|
+
leftProps,
|
|
23
|
+
rightProps,
|
|
24
|
+
titleProps,
|
|
25
|
+
contentProp,
|
|
26
|
+
containerProps,
|
|
27
|
+
descriptionProps,
|
|
28
|
+
testID,
|
|
29
|
+
...rest
|
|
30
|
+
}) => {
|
|
31
|
+
leftProps = defaultObj(leftProps);
|
|
32
|
+
rightProps = defaultObj(rightProps);
|
|
33
|
+
titleProps = defaultObj(titleProps);
|
|
34
|
+
contentProp = defaultObj(contentProp);
|
|
35
|
+
containerProps = defaultObj(containerProps);
|
|
36
|
+
descriptionProps = defaultObj(descriptionProps);
|
|
37
|
+
testID = defaultStr(testID,"RN_ExpandableItemComponent")
|
|
38
|
+
const renderDescription = (descriptionColor,description) => {
|
|
39
|
+
return typeof description === 'function' ? (description({
|
|
40
|
+
selectable: false,
|
|
41
|
+
ellipsizeMode: descriptionEllipsizeMode,
|
|
42
|
+
color: descriptionColor,
|
|
43
|
+
fontSize: styles.description.fontSize,
|
|
44
|
+
})
|
|
45
|
+
) : (
|
|
46
|
+
<Label
|
|
47
|
+
selectable={false}
|
|
48
|
+
numberOfLines={descriptionNumberOfLines}
|
|
49
|
+
ellipsizeMode={descriptionEllipsizeMode}
|
|
50
|
+
testID = {testID+"_Description"}
|
|
51
|
+
{...descriptionProps}
|
|
52
|
+
style={[
|
|
53
|
+
styles.description,
|
|
54
|
+
{ color: descriptionColor },
|
|
55
|
+
descriptionStyle,
|
|
56
|
+
descriptionProps.style
|
|
57
|
+
]}
|
|
58
|
+
>
|
|
59
|
+
{description}
|
|
60
|
+
</Label>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const renderTitle = () => {
|
|
65
|
+
const titleColor = color(theme.colors.text).alpha(0.87).rgb().string();
|
|
66
|
+
|
|
67
|
+
return typeof title === 'function' ? (
|
|
68
|
+
title({
|
|
69
|
+
selectable: false,
|
|
70
|
+
ellipsizeMode: titleEllipsizeMode,
|
|
71
|
+
color: titleColor,
|
|
72
|
+
fontSize: styles.title.fontSize,
|
|
73
|
+
})
|
|
74
|
+
) : (
|
|
75
|
+
<Label
|
|
76
|
+
selectable={false}
|
|
77
|
+
ellipsizeMode={titleEllipsizeMode}
|
|
78
|
+
numberOfLines={titleNumberOfLines}
|
|
79
|
+
testID = {testID+'_Title'}
|
|
80
|
+
{...titleProps}
|
|
81
|
+
style={[styles.title, { color: titleColor }, titleStyle,titleProps.style]}
|
|
82
|
+
>
|
|
83
|
+
{title}
|
|
84
|
+
</Label>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const descriptionColor = color(theme.colors.text).alpha(theme.ALPHA).rgb().string();
|
|
89
|
+
left = typeof left =='function'? left ({
|
|
90
|
+
color: descriptionColor,
|
|
91
|
+
style: description
|
|
92
|
+
? styles.iconMarginLeft
|
|
93
|
+
: {
|
|
94
|
+
...styles.iconMarginLeft,
|
|
95
|
+
...styles.marginVerticalNone,
|
|
96
|
+
},
|
|
97
|
+
}) : React.isValidElement(left)? left : null;
|
|
98
|
+
right = typeof right =='function'? right ({
|
|
99
|
+
color: descriptionColor,
|
|
100
|
+
style: description
|
|
101
|
+
? styles.iconMarginRight
|
|
102
|
+
: {
|
|
103
|
+
...styles.iconMarginRight,
|
|
104
|
+
...styles.marginVerticalNone,
|
|
105
|
+
},
|
|
106
|
+
}): React.isValidElement(right)? right : null;
|
|
107
|
+
|
|
108
|
+
return (<TouchableRipple
|
|
109
|
+
{...rest}
|
|
110
|
+
testID = {testID}
|
|
111
|
+
style={[styles.container, style]}
|
|
112
|
+
onPress={onPress}
|
|
113
|
+
>
|
|
114
|
+
<View testID={testID+'_Container'} {...containerProps} style={[styles.row,containerProps.style]}>
|
|
115
|
+
{left ? <View testID={testID+'_Left'} {...leftProps} style={[leftProps.style]}>
|
|
116
|
+
{left}
|
|
117
|
+
</View>: null}
|
|
118
|
+
<View testID={testID+'_Content'} {...contentProp} style={[styles.item, styles.content,contentProp.style]}>
|
|
119
|
+
{renderTitle()}
|
|
120
|
+
{description ? renderDescription(descriptionColor, description): null}
|
|
121
|
+
</View>
|
|
122
|
+
{right ? <View testID={testID+'_Right'} {...rightProps} style={[rightProps.style]}>
|
|
123
|
+
{right}
|
|
124
|
+
</View>
|
|
125
|
+
: null}
|
|
126
|
+
</View>
|
|
127
|
+
</TouchableRipple>);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
ExpandableItem.displayName = 'ExpandableItem';
|
|
131
|
+
|
|
132
|
+
const styles = StyleSheet.create({
|
|
133
|
+
container: {
|
|
134
|
+
padding: 8,
|
|
135
|
+
},
|
|
136
|
+
row: {
|
|
137
|
+
flexDirection: 'row',
|
|
138
|
+
alignItems : 'center',
|
|
139
|
+
justifyContent : "center",
|
|
140
|
+
},
|
|
141
|
+
title: {
|
|
142
|
+
fontSize: 16,
|
|
143
|
+
},
|
|
144
|
+
description: {
|
|
145
|
+
fontSize: 14,
|
|
146
|
+
},
|
|
147
|
+
marginVerticalNone: { marginVertical: 0 },
|
|
148
|
+
iconMarginLeft: { marginLeft: 0, marginRight: 16 },
|
|
149
|
+
iconMarginRight: { marginRight: 0 },
|
|
150
|
+
item: {
|
|
151
|
+
marginVertical: 6,
|
|
152
|
+
paddingLeft: 8,
|
|
153
|
+
},
|
|
154
|
+
content: {
|
|
155
|
+
flex: 1,
|
|
156
|
+
justifyContent: 'center',
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
export default ExpandableItem;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {Colors} from "$theme";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import View from "$ecomponents/View";
|
|
4
|
+
import {StyleSheet,TouchableWithoutFeedback} from 'react-native';
|
|
5
|
+
import {withTheme,TouchableRipple} from "react-native-paper"
|
|
6
|
+
import Label from "$ecomponents/Label";
|
|
7
|
+
import Icon from "$ecomponents/Icon"
|
|
8
|
+
import {defaultObj,isNonNullString,defaultStr} from "$utils";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import Item from "./Item";
|
|
11
|
+
import Surface from "$ecomponents/Surface";
|
|
12
|
+
import theme from "$theme";
|
|
13
|
+
|
|
14
|
+
const ExpandableComponent = React.forwardRef(({
|
|
15
|
+
left,
|
|
16
|
+
right,
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
children,
|
|
20
|
+
titleStyle,
|
|
21
|
+
descriptionStyle,
|
|
22
|
+
titleNumberOfLines = 1,
|
|
23
|
+
descriptionNumberOfLines = 2,
|
|
24
|
+
testID,
|
|
25
|
+
onPress,
|
|
26
|
+
onLongPress,
|
|
27
|
+
expanded: expandedProp,
|
|
28
|
+
accessibilityLabel,
|
|
29
|
+
expandedIcon,
|
|
30
|
+
expandIconProps,
|
|
31
|
+
unexpandedIcon,
|
|
32
|
+
leftProps,
|
|
33
|
+
titleProps,
|
|
34
|
+
noPadding,
|
|
35
|
+
rightProps,
|
|
36
|
+
descriptionProps,
|
|
37
|
+
contentProps,
|
|
38
|
+
centerProps,
|
|
39
|
+
contentContainerProps,
|
|
40
|
+
showExpandIcon,
|
|
41
|
+
icon,
|
|
42
|
+
containerProps,
|
|
43
|
+
autoMountChildren = false,
|
|
44
|
+
expandIconPosition,
|
|
45
|
+
...props
|
|
46
|
+
},ref) => {
|
|
47
|
+
props = defaultObj(props);
|
|
48
|
+
leftProps = defaultObj(leftProps)
|
|
49
|
+
rightProps = defaultObj(rightProps);
|
|
50
|
+
titleProps = defaultObj(titleProps);
|
|
51
|
+
contentProps = defaultObj(contentProps);
|
|
52
|
+
centerProps = defaultObj(centerProps),
|
|
53
|
+
contentContainerProps = defaultObj(contentContainerProps);
|
|
54
|
+
descriptionProps = defaultObj(descriptionProps);
|
|
55
|
+
containerProps = defaultObj(containerProps);
|
|
56
|
+
expandIconPosition = defaultStr(expandIconPosition,"right").toLowerCase().trim();
|
|
57
|
+
const isIconPositionLeft = expandIconPosition =='left'? true : false;
|
|
58
|
+
const isControlled = typeof expandedProp =='boolean'? true : false;
|
|
59
|
+
const [expanded, setExpanded] = React.useState(isControlled ? expandedProp : false);
|
|
60
|
+
const handlePressAction = (e) => {
|
|
61
|
+
onPress?.({...React.getOnPressArgs(e),expanded:!expanded,checked:!expanded});
|
|
62
|
+
if (!isControlled) {
|
|
63
|
+
setExpanded((expanded) => !expanded);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
if(isControlled){
|
|
67
|
+
React.useEffect(()=>{
|
|
68
|
+
if(typeof expandedProp =='boolean' && expandedProp !== expanded){
|
|
69
|
+
setExpanded(expandedProp)
|
|
70
|
+
}
|
|
71
|
+
},[expandedProp])
|
|
72
|
+
}
|
|
73
|
+
const titleColor = Colors.toAlpha(theme.colors.text,0.87);
|
|
74
|
+
const descriptionColor = Colors.toAlpha(theme.colors.text,theme.ALPHA);
|
|
75
|
+
const isExpanded = expanded ? true : false;
|
|
76
|
+
titleProps.style = [styles.title,{color: isExpanded ? theme.colors.primary : titleColor},titleStyle,titleProps.style]
|
|
77
|
+
const eProps = {color: isExpanded ? theme.colors.primary : descriptionColor}
|
|
78
|
+
left = typeof left =='function'? left(eProps) : React.isValidElement(left)? left : null;
|
|
79
|
+
right = typeof right =="function" ? right(eProps) : React.isValidElement(right)? right : null;
|
|
80
|
+
if((isNonNullString(icon) || isObj(icon)) && !left){
|
|
81
|
+
icon = isNonNullString(icon)? {icon} : icon;
|
|
82
|
+
left = <Icon {...eProps} {...icon} />
|
|
83
|
+
}
|
|
84
|
+
if(!React.isValidElement(left)){
|
|
85
|
+
left = null;
|
|
86
|
+
}
|
|
87
|
+
if(!React.isValidElement(right)){
|
|
88
|
+
right = null;
|
|
89
|
+
}
|
|
90
|
+
testID = defaultStr(testID,"RN_ExpandableComponent");
|
|
91
|
+
const expandIcon = showExpandIcon !== false ? <Icon
|
|
92
|
+
color={titleColor}
|
|
93
|
+
size={24}
|
|
94
|
+
{...defaultObj(expandIconProps)}
|
|
95
|
+
icon = {isExpanded ? defaultVal(expandedIcon,"chevron-up") : defaultVal(unexpandedIcon,"chevron-down")}
|
|
96
|
+
onPress = {handlePressAction}
|
|
97
|
+
/>:null;
|
|
98
|
+
return ( <View testID={testID+"_ExpandableContainer"} {...containerProps}>
|
|
99
|
+
<Surface {...props} ref={ref} testID={testID}>
|
|
100
|
+
<TouchableWithoutFeedback
|
|
101
|
+
delayPressIn={0}
|
|
102
|
+
borderless = {false}
|
|
103
|
+
accessibilityTraits="button"
|
|
104
|
+
accessibilityComponentType="button"
|
|
105
|
+
accessibilityRole="button"
|
|
106
|
+
style={[styles.container,props.style]}
|
|
107
|
+
onPress={handlePressAction}
|
|
108
|
+
onLongPress={onLongPress}
|
|
109
|
+
accessibilityState={{ expanded: isExpanded }}
|
|
110
|
+
accessibilityLabel={accessibilityLabel}
|
|
111
|
+
testID={testID+"_Container"}
|
|
112
|
+
>
|
|
113
|
+
<View testID={testID+'_ContentContainer'} {...contentContainerProps} style={[styles.row,theme.styles.cursorPointer,contentContainerProps.style]} pointerEvents1="none">
|
|
114
|
+
{left || (expandIcon && isIconPositionLeft)
|
|
115
|
+
? <View testID={testID+'_Left'} {...leftProps} style={[styles.left]}>
|
|
116
|
+
{isIconPositionLeft ? expandIcon : null}
|
|
117
|
+
{left}
|
|
118
|
+
</View>
|
|
119
|
+
: null}
|
|
120
|
+
<View testID={testID+'_Center'} {...centerProps} style={[styles.item, styles.content,styles.center,centerProps.style]}>
|
|
121
|
+
{isNonNullString(title)? <Label
|
|
122
|
+
selectable={false}
|
|
123
|
+
numberOfLines={titleNumberOfLines}
|
|
124
|
+
{...titleProps}
|
|
125
|
+
>
|
|
126
|
+
{title}
|
|
127
|
+
</Label> : React.isValidElement(title)? title : null}
|
|
128
|
+
{isNonNullString(description) ? (
|
|
129
|
+
<Label
|
|
130
|
+
testID={testID+'_Description'}
|
|
131
|
+
selectable={false}
|
|
132
|
+
numberOfLines={descriptionNumberOfLines}
|
|
133
|
+
{...descriptionProps}
|
|
134
|
+
style={[
|
|
135
|
+
styles.description,
|
|
136
|
+
{
|
|
137
|
+
color: descriptionColor,
|
|
138
|
+
},
|
|
139
|
+
descriptionStyle,
|
|
140
|
+
descriptionProps.style,
|
|
141
|
+
]}
|
|
142
|
+
>
|
|
143
|
+
{description}
|
|
144
|
+
</Label>
|
|
145
|
+
) : null}
|
|
146
|
+
</View>
|
|
147
|
+
<View testID={testID+'_Right'} {...rightProps} style={[styles.item, description ? styles.multiline : undefined,styles.row,rightProps.style]}>
|
|
148
|
+
{right}
|
|
149
|
+
{!isIconPositionLeft ? expandIcon:null}
|
|
150
|
+
</View>
|
|
151
|
+
</View>
|
|
152
|
+
</TouchableWithoutFeedback>
|
|
153
|
+
{(autoMountChildren !== false || isExpanded) ? <View testID={testID+'_Content'} {...contentProps}
|
|
154
|
+
style={[styles.children,contentProps.style,!isExpanded && {opacity:0,height:0}]}>
|
|
155
|
+
{children}
|
|
156
|
+
</View> : null}
|
|
157
|
+
</Surface>
|
|
158
|
+
</View>
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
ExpandableComponent.displayName = 'ExpandableComponent';
|
|
163
|
+
|
|
164
|
+
const styles = StyleSheet.create({
|
|
165
|
+
center : {
|
|
166
|
+
justifyContent : 'flex-start',
|
|
167
|
+
},
|
|
168
|
+
container: {
|
|
169
|
+
padding: 8,
|
|
170
|
+
},
|
|
171
|
+
left : {
|
|
172
|
+
flexDirection : 'row',
|
|
173
|
+
alignItems : 'center',
|
|
174
|
+
justifyContent : 'flex-start',
|
|
175
|
+
},
|
|
176
|
+
row: {
|
|
177
|
+
flexDirection: 'row',
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
justifyContent:'center'
|
|
180
|
+
},
|
|
181
|
+
multiline: {
|
|
182
|
+
height: 40,
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
},
|
|
186
|
+
title: {
|
|
187
|
+
fontSize: 16,
|
|
188
|
+
paddingHorizontal:10,
|
|
189
|
+
},
|
|
190
|
+
description: {
|
|
191
|
+
fontSize: 14,
|
|
192
|
+
},
|
|
193
|
+
item: {
|
|
194
|
+
margin:0,
|
|
195
|
+
},
|
|
196
|
+
child: {
|
|
197
|
+
paddingLeft: 64,
|
|
198
|
+
},
|
|
199
|
+
content: {
|
|
200
|
+
flex: 1,
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
},
|
|
203
|
+
children : {
|
|
204
|
+
marginLeft : 8,
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
ExpandableComponent.propTypes = {
|
|
209
|
+
left : PropTypes.oneOfType([
|
|
210
|
+
PropTypes.func,
|
|
211
|
+
PropTypes.node,
|
|
212
|
+
]),
|
|
213
|
+
right : PropTypes.oneOfType([
|
|
214
|
+
PropTypes.func,
|
|
215
|
+
PropTypes.node,
|
|
216
|
+
]),
|
|
217
|
+
expandIconPosition : PropTypes.oneOf([
|
|
218
|
+
'left','right'
|
|
219
|
+
]),
|
|
220
|
+
autoMountChildren : PropTypes.bool,///si les enfants du composant seront montés mais masqués et lorsqu'on cliquera sur toggle ceux-ci seront affichés
|
|
221
|
+
leftProps : PropTypes.object, ///les props à paser à la vue qui rend le contenu gouche
|
|
222
|
+
rightProps : PropTypes.object, ///les props à passer à la vue qui rend le contenu droit
|
|
223
|
+
descriptionProps : PropTypes.object,///les props à passer à la valeur de la description de l'expandable
|
|
224
|
+
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
ExpandableComponent.Item = Item;
|
|
228
|
+
|
|
229
|
+
export default ExpandableComponent;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FAB } from 'react-native-paper';
|
|
2
|
+
import {defaultObj} from "$utils";
|
|
3
|
+
import React from "$react";
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import theme,{Colors} from "$theme";
|
|
7
|
+
|
|
8
|
+
const FabComponent = React.forwardRef((props,ref)=>{
|
|
9
|
+
const {primary,secondary,style:customStyle,color:customColor,...restP} = props;
|
|
10
|
+
const rest = defaultObj(restP);
|
|
11
|
+
const style = Object.assign({},StyleSheet.flatten(customStyle));
|
|
12
|
+
let color = Colors.isValid(customColor)? customColor : undefined;
|
|
13
|
+
let backgroundColor = Colors.isValid(style.backgroundColor)? style.backgroundColor : undefined;
|
|
14
|
+
if(!backgroundColor || primary){
|
|
15
|
+
backgroundColor = theme.colors.primary;
|
|
16
|
+
color = theme.colors.primaryText;
|
|
17
|
+
} else if(secondary){
|
|
18
|
+
backgroundColor = theme.colors.secondary;
|
|
19
|
+
color = theme.colors.secondaryText;
|
|
20
|
+
}
|
|
21
|
+
return <FAB
|
|
22
|
+
//small
|
|
23
|
+
testID='RN_FabComponent'
|
|
24
|
+
{...rest}
|
|
25
|
+
color = {color}
|
|
26
|
+
style = {[styles.fab,style,{backgroundColor}]}
|
|
27
|
+
/>
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
FabComponent.propTTypes = {
|
|
31
|
+
...defaultObj(FAB.propTypes),
|
|
32
|
+
color : PropTypes.string,
|
|
33
|
+
primary : PropTypes.bool,
|
|
34
|
+
secondary : PropTypes.bool,
|
|
35
|
+
}
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
fab : {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
margin: 15,
|
|
40
|
+
bottom : 0,
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export default FabComponent;
|
|
45
|
+
|
|
46
|
+
FabComponent.displayName = "FabComponent";
|