@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,78 @@
|
|
|
1
|
+
import {defaultStr,isObj} from "$utils";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import {FadeIn,FadeInRight,FadeInLeft,FadeInUp,FadeInDown,SlideInRight,SlideInLeft,SlideInUp,SlideInDown} from "react-native-reanimated";
|
|
4
|
+
import {FadeOut,FadeOutRight,FadeOutLeft,FadeOutUp,FadeOutDown,SlideOutRight,SlideOutLeft,SlideOutUp,SlideOutDown} from "react-native-reanimated";
|
|
5
|
+
|
|
6
|
+
export const InAnimations = {FadeIn,FadeInRight,FadeInLeft,FadeInUp,FadeInDown,SlideInRight,SlideInLeft,SlideInUp,SlideInDown};
|
|
7
|
+
export const OutAnimations = {FadeOut,FadeOutRight,FadeOutLeft,FadeOutUp,FadeOutDown,SlideOutRight,SlideOutLeft,SlideOutUp,SlideOutDown};
|
|
8
|
+
|
|
9
|
+
/*** les types d'animations pris en compte */
|
|
10
|
+
export const supportedTypes = {
|
|
11
|
+
fade : 'fade', slide : 'slide'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/***
|
|
15
|
+
* @param inOrOut {string : in |out}, spécifie si c'est une animation entrante ou non
|
|
16
|
+
* @param type {string}, le type de l'animation exemple : fade | slide
|
|
17
|
+
* @param position {string}, la position de l'animation ('','up','left','right','down')
|
|
18
|
+
* lorque la position n'est pas définie, les seules animations supportées sont fadeIn et FadeOut
|
|
19
|
+
*/
|
|
20
|
+
export function getInOrOutAnimation (inOrOut,type,position){
|
|
21
|
+
inOrOut = defaultStr(inOrOut,'in').toLowerCase();
|
|
22
|
+
if(inOrOut !== 'in' && inOrOut !=='out'){
|
|
23
|
+
inOrOut = 'in';
|
|
24
|
+
}
|
|
25
|
+
const isIn = inOrOut == 'in'? true : false;
|
|
26
|
+
type = defaultStr(type,'fade').trim().toLowerCase();
|
|
27
|
+
if(!supportedTypes[type]){
|
|
28
|
+
type = supportedTypes.fade;
|
|
29
|
+
}
|
|
30
|
+
let animationName = type.ucFirst()+inOrOut.ucFirst();
|
|
31
|
+
position = defaultStr(position).trim().toLowerCase();
|
|
32
|
+
if(position){
|
|
33
|
+
const a = animationName+position.ucFirst();
|
|
34
|
+
if(isIn){
|
|
35
|
+
return InAnimations[a] || undefined;
|
|
36
|
+
}
|
|
37
|
+
return OutAnimations[a] || undefined;
|
|
38
|
+
}
|
|
39
|
+
return isIn ? FadeIn : FadeOut;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/*** retourne un composant react-native-animated en fonction du type passé en paramètre
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export const getInAnimation = (type,position)=>{
|
|
46
|
+
return getInOrOutAnimation('in',type,position);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const getOutAnimation = (type,position)=>{
|
|
50
|
+
return getInOrOutAnimation('out',type,position);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**** retourne un objet constitué des animations à utiliser en entrant et en sortant
|
|
54
|
+
* @param type {string} le type de l'animation
|
|
55
|
+
* @param position {string} la position de l'animation
|
|
56
|
+
*/
|
|
57
|
+
export const getAnimations = (type,position) =>{
|
|
58
|
+
return {
|
|
59
|
+
entering : getInAnimation(type,position),
|
|
60
|
+
exiting : getOutAnimation(type,position),
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const animationTypePropTypes = PropTypes.oneOf([
|
|
65
|
+
'none','slide', 'fade'
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
export const animationPositionPropTypes = PropTypes.oneOf([
|
|
69
|
+
"","up","right","left","down",
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export const animationsPropTypes = {
|
|
74
|
+
animationType : animationTypePropTypes,
|
|
75
|
+
animationPosition : animationPositionPropTypes,
|
|
76
|
+
animationDuration : PropTypes.number,
|
|
77
|
+
animationDelay : PropTypes.number,
|
|
78
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "$react";
|
|
2
|
+
import { Animated} from "react-native";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import {translateByAppearFrom,inputRangeByAppearFrom,animationType,outputRangeByAppearFrom,initialPositionByAppearFrom} from "./utils";
|
|
5
|
+
|
|
6
|
+
const OpacityAnimationComponent = React.forwardRef(({ delay,children,style, animationPosition,animationDuration,enteringCallback,exitingCallback,...viewProps},ref) => {
|
|
7
|
+
if(!animationPosition || !initialPositionByAppearFrom[animationPosition]){
|
|
8
|
+
animationPosition = 'up';
|
|
9
|
+
}
|
|
10
|
+
const [animatedValue] = React.useState(new Animated.Value(initialPositionByAppearFrom[animationPosition]));
|
|
11
|
+
const animate = () => {
|
|
12
|
+
Animated.timing(animatedValue, {
|
|
13
|
+
toValue: 0,
|
|
14
|
+
duration: animationDuration,
|
|
15
|
+
useNativeDriver: true,
|
|
16
|
+
}).start((args)=>{
|
|
17
|
+
if(enteringCallback){
|
|
18
|
+
enteringCallback(args);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const timeout = setTimeout(animate, delay);
|
|
24
|
+
return () => {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
animate();
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
const inputRange = inputRangeByAppearFrom[animationPosition];
|
|
31
|
+
const outputRange = outputRangeByAppearFrom[animationPosition];
|
|
32
|
+
const opacity = animatedValue.interpolate({
|
|
33
|
+
inputRange,
|
|
34
|
+
outputRange,
|
|
35
|
+
});
|
|
36
|
+
const transform = [{ [translateByAppearFrom[animationPosition]]: animatedValue }];
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Animated.View ref={ref} {...viewProps} style={[style,{ opacity, transform }]}>
|
|
40
|
+
{children}
|
|
41
|
+
</Animated.View>
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
OpacityAnimationComponent.propTypes = {
|
|
46
|
+
delay: PropTypes.number,
|
|
47
|
+
enteringCallback : PropTypes.func,
|
|
48
|
+
animationPosition: PropTypes.oneOf([
|
|
49
|
+
'left','down',"right","up"
|
|
50
|
+
]),
|
|
51
|
+
animationDuration: PropTypes.number
|
|
52
|
+
}
|
|
53
|
+
export default OpacityAnimationComponent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
const INITIAL_POSITION_POSITIVE = 20;
|
|
3
|
+
const INITIAL_POSITION_NEGATIVE = -INITIAL_POSITION_POSITIVE;
|
|
4
|
+
|
|
5
|
+
const initialPositionByAppearFrom = {
|
|
6
|
+
["left"]: INITIAL_POSITION_NEGATIVE,
|
|
7
|
+
["up"]: INITIAL_POSITION_NEGATIVE,
|
|
8
|
+
["right"]: INITIAL_POSITION_POSITIVE,
|
|
9
|
+
["down"]: INITIAL_POSITION_POSITIVE,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const inputRangeByAppearFrom = {
|
|
13
|
+
["left"]: [INITIAL_POSITION_NEGATIVE, 0],
|
|
14
|
+
["up"]: [INITIAL_POSITION_NEGATIVE, 0],
|
|
15
|
+
["right"]: [0, INITIAL_POSITION_POSITIVE],
|
|
16
|
+
["down"]: [0, INITIAL_POSITION_POSITIVE],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const outputRangeByAppearFrom = {
|
|
20
|
+
["left"]: [0, 1],
|
|
21
|
+
["up"]: [0, 1],
|
|
22
|
+
["right"]: [1, 0],
|
|
23
|
+
["down"]: [1, 0],
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const translateByAppearFrom = {
|
|
27
|
+
["left"]: "translateX",
|
|
28
|
+
["up"]: "translateY",
|
|
29
|
+
["right"]: "translateX",
|
|
30
|
+
["down"]: "translateY",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
inputRangeByAppearFrom,
|
|
35
|
+
outputRangeByAppearFrom,
|
|
36
|
+
translateByAppearFrom,
|
|
37
|
+
initialPositionByAppearFrom,
|
|
38
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from '$react';
|
|
2
|
+
import {Platform,StyleSheet,TouchableWithoutFeedback,View} from 'react-native';
|
|
3
|
+
import Label from "$ecomponents/Label";
|
|
4
|
+
import theme,{Colors,StyleProp} from "$theme";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import {defaultObj,defaultStr} from "$utils";
|
|
7
|
+
import {isIos,isAndroid,isWeb} from "$cplatform";
|
|
8
|
+
|
|
9
|
+
const AppbarContent = React.forwardRef(({
|
|
10
|
+
color: titleColor,
|
|
11
|
+
subtitle,
|
|
12
|
+
subtitleProps,
|
|
13
|
+
subtitleStyle,
|
|
14
|
+
onPress,
|
|
15
|
+
style,
|
|
16
|
+
titleProps,
|
|
17
|
+
titleRef,
|
|
18
|
+
titleStyle,
|
|
19
|
+
title,
|
|
20
|
+
testID,
|
|
21
|
+
containerProps,
|
|
22
|
+
...rest
|
|
23
|
+
},ref) => {
|
|
24
|
+
|
|
25
|
+
const titleTextColor = titleColor ? titleColor : theme.colors.primaryText;
|
|
26
|
+
titleProps = defaultObj(titleProps);
|
|
27
|
+
subtitleProps = defaultObj(subtitleProps);
|
|
28
|
+
testID = defaultStr(testID,"RN_AppBarContentComponent")
|
|
29
|
+
subtitle = subtitle === false ? null : subtitle;
|
|
30
|
+
const subtitleColor = Colors.setAlpha(titleTextColor,0.7);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<TouchableWithoutFeedback testID={testID+"_Container"} {...defaultObj(containerProps)} onPress={onPress} disabled={!onPress}>
|
|
34
|
+
<View
|
|
35
|
+
pointerEvents="box-none"
|
|
36
|
+
style={[styles.container, style]}
|
|
37
|
+
{...rest}
|
|
38
|
+
testID = {testID}
|
|
39
|
+
ref = {ref}
|
|
40
|
+
>
|
|
41
|
+
<Label
|
|
42
|
+
ref={titleRef}
|
|
43
|
+
testID = {testID+"_Title"}
|
|
44
|
+
{...titleProps}
|
|
45
|
+
style={[
|
|
46
|
+
{
|
|
47
|
+
color: titleTextColor,
|
|
48
|
+
...(isIos()? theme.fonts.regular: theme.fonts.medium),
|
|
49
|
+
},
|
|
50
|
+
isWeb() && theme.styles.webFontFamilly,
|
|
51
|
+
titleProps.style,
|
|
52
|
+
titleStyle,
|
|
53
|
+
]}
|
|
54
|
+
numberOfLines={1}
|
|
55
|
+
accessible
|
|
56
|
+
// @ts-ignore Type '"heading"' is not assignable to type ...
|
|
57
|
+
accessibilityRole={Platform.OS === 'web' ? 'heading' : 'header'}
|
|
58
|
+
>
|
|
59
|
+
{title}
|
|
60
|
+
</Label>
|
|
61
|
+
{subtitle ? (
|
|
62
|
+
<Label
|
|
63
|
+
testID = {testID+"_Subtitle"}
|
|
64
|
+
{...subtitleProps}
|
|
65
|
+
style={[styles.subtitle, { color: subtitleColor }, subtitleProps.style, subtitleStyle]}
|
|
66
|
+
numberOfLines={1}
|
|
67
|
+
>
|
|
68
|
+
{subtitle}
|
|
69
|
+
</Label>
|
|
70
|
+
) : null}
|
|
71
|
+
</View>
|
|
72
|
+
</TouchableWithoutFeedback>
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
AppbarContent.displayName = 'Appbar.Content';
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
container: {
|
|
80
|
+
flex: 1,
|
|
81
|
+
paddingHorizontal: 5,
|
|
82
|
+
justifyContent : 'center',
|
|
83
|
+
alignItems : 'flex-start',
|
|
84
|
+
},
|
|
85
|
+
title: {
|
|
86
|
+
fontSize: Platform.OS === 'ios' ? 17 : 20,
|
|
87
|
+
},
|
|
88
|
+
subtitle: {
|
|
89
|
+
fontSize: Platform.OS === 'ios' ? 11 : 14,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export default AppbarContent;
|
|
94
|
+
const titleType = PropTypes.oneOfType([
|
|
95
|
+
PropTypes.string,
|
|
96
|
+
PropTypes.node,
|
|
97
|
+
PropTypes.bool,
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
AppbarContent.propTypes = {
|
|
101
|
+
/**
|
|
102
|
+
* Custom StyleProp for the text.
|
|
103
|
+
*/
|
|
104
|
+
StyleProp: PropTypes.string,
|
|
105
|
+
/**
|
|
106
|
+
* Text for the title.
|
|
107
|
+
*/
|
|
108
|
+
title: titleType,
|
|
109
|
+
/**
|
|
110
|
+
* Style for the title.
|
|
111
|
+
*/
|
|
112
|
+
titleStyle: StyleProp,
|
|
113
|
+
/**
|
|
114
|
+
* Reference for the title.
|
|
115
|
+
*/
|
|
116
|
+
titleRef : PropTypes.any,
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Deprecated in v5.x
|
|
119
|
+
* Text for the subtitle.
|
|
120
|
+
*/
|
|
121
|
+
subtitle : titleType,
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Deprecated in v5.x
|
|
124
|
+
* Style for the subtitle.
|
|
125
|
+
*/
|
|
126
|
+
subtitleStyle: StyleProp,
|
|
127
|
+
/**
|
|
128
|
+
* Function to execute on press.
|
|
129
|
+
*/
|
|
130
|
+
onPress : PropTypes.func,
|
|
131
|
+
style : StyleProp
|
|
132
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import React from "$react"
|
|
2
|
+
import { Appbar} from 'react-native-paper';
|
|
3
|
+
import {defaultObj,defaultVal,defaultStr} from "$utils";
|
|
4
|
+
import APP from "$capp/instance"
|
|
5
|
+
import {isSplitedActions,renderSplitedActions,splitActions,TITLE_FONT_SIZE} from "./utils";
|
|
6
|
+
import theme,{Colors,flattenStyle} from "$theme";
|
|
7
|
+
import {StyleSheet} from "react-native";
|
|
8
|
+
import {goBack as navGoBack} from "$enavigation/utils";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import { Dimensions,TouchableWithoutFeedback} from "react-native";
|
|
11
|
+
import { useNavigation,useRoute,useScreenOptions } from "$enavigation/utils";
|
|
12
|
+
import Content from "./Content";
|
|
13
|
+
import Icon from "$ecomponents/Icon";
|
|
14
|
+
import {Elevations} from "$ecomponents/Surface";
|
|
15
|
+
|
|
16
|
+
export * from "./utils";
|
|
17
|
+
|
|
18
|
+
export const GO_BACK_EVENT = "STACK_NAVIGATOR_GO_BACK";
|
|
19
|
+
/*** usage
|
|
20
|
+
* @param title {string|Element|null|false} si l'on passe en paramètre la valeur nulle ou false du titre, alors le titre sera ignoré, sinon, le titre
|
|
21
|
+
* sera soit l'une des valeur passée en paramètre, soit l'une des valeurs prises depuis les options du Screen composant, soit le nom de l'application
|
|
22
|
+
* @param backAction {Apppbar.BackAction}, Element réact rendant l'action BackButton, voir @https://callstack.github.io/react-native-paper/appbar-action.html
|
|
23
|
+
* @param backActionProps {Object} les props à passer au BackAction, voir : https://callstack.github.io/react-native-paper/appbar-action.html
|
|
24
|
+
* @param contentProps : les props à paser au content de l'appBar
|
|
25
|
+
* @param titleProps {object}, les props du titre
|
|
26
|
+
@param subtitleProps {object}, les props du subtitle
|
|
27
|
+
@param actionProps : les props à passer aux différentes actions de l'appBar,
|
|
28
|
+
* @param menuProps : les props à passer au menu au cas où les actions de l'appBar son segmentés avec certaines qui sont découpées dans un menu more
|
|
29
|
+
|
|
30
|
+
*/
|
|
31
|
+
const isNullOrE = x => x === null || x === false;
|
|
32
|
+
|
|
33
|
+
const AppBarComponent = React.forwardRef((props,ref)=> {
|
|
34
|
+
let { bindResizeEvent,elevation,isMainDrawer,
|
|
35
|
+
drawerId,handleDrawerStateEvent,drawerMinimized,isStackNavigation,onMount,
|
|
36
|
+
onUnmount,drawerType,options,allowDrawer,back,menuProps,appBarType,
|
|
37
|
+
drawerRef,beforeGoBack,title,subtitle,titleProps,backAction,backActionProps,
|
|
38
|
+
subtitleProps,testID,
|
|
39
|
+
onBackActionPress : customOnBackActionPress,actions,backActionRef,route,
|
|
40
|
+
...appBarProps} = props;
|
|
41
|
+
const customOptions = options;
|
|
42
|
+
route = defaultObj(route,useRoute());
|
|
43
|
+
options = defaultObj(options,useScreenOptions());
|
|
44
|
+
const navigation = useNavigation();
|
|
45
|
+
const isDark = theme.isDark();
|
|
46
|
+
const primaryText = isDark? theme.colors.surfaceText : theme.colors.primaryText,
|
|
47
|
+
backgroundColor = isDark? theme.colors.surface : theme.colors.primary;
|
|
48
|
+
const anchorStyle = {color:primaryText};
|
|
49
|
+
const params = defaultObj(route.params);
|
|
50
|
+
appBarProps = Object.assign({},appBarProps);
|
|
51
|
+
const getCallAgs = ()=>{
|
|
52
|
+
options = defaultObj(options,useScreenOptions());
|
|
53
|
+
return {navigation,
|
|
54
|
+
canGoBack:typeof navigation.canGoBack=='function'?navigation.canGoBack:x=>false,
|
|
55
|
+
back : options.back,
|
|
56
|
+
route,params,
|
|
57
|
+
props,
|
|
58
|
+
isAppBar : true,
|
|
59
|
+
options:defaultObj(customOptions,useScreenOptions),
|
|
60
|
+
route,routeName:route.name,
|
|
61
|
+
beforeGoBack : defaultFunc(beforeGoBack,x=>true)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const goBack = (force)=>{
|
|
65
|
+
return navGoBack({...appBarProps,goBack:undefined,...getCallAgs(),force});
|
|
66
|
+
}
|
|
67
|
+
title = defaultVal(title,params.title,APP.getName());
|
|
68
|
+
backActionProps = Object.assign({},backActionProps);
|
|
69
|
+
|
|
70
|
+
let BackActionComponent = backAction === false ? null : React.isComponent(backAction)? backAction : back ? Appbar.BackAction : Icon ;
|
|
71
|
+
backActionProps.color = backActionProps.color && Colors.isValid(backActionProps.color)? backActionProps.color : anchorStyle.color;
|
|
72
|
+
|
|
73
|
+
let {onPress} = backActionProps;
|
|
74
|
+
const onBackActionPress = (e,source)=>{
|
|
75
|
+
const args = {...React.getOnPressArgs(e),...getCallAgs(),goBack};
|
|
76
|
+
if(typeof onPress =="function" && onPress(args) === false){
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if(typeof customOnBackActionPress =='function' && customOnBackActionPress(args) === false) return;
|
|
80
|
+
goBack();
|
|
81
|
+
}
|
|
82
|
+
backAction = React.isValidElement(backAction)? backAction : null;
|
|
83
|
+
if(!backAction && BackActionComponent){
|
|
84
|
+
backAction = <BackActionComponent back={options.back} ref={backActionRef} {...backActionProps} onPress={onBackActionPress} />
|
|
85
|
+
} else if(backAction){
|
|
86
|
+
backAction = <TouchableWithoutFeedback
|
|
87
|
+
{...backActionProps}
|
|
88
|
+
ref = {backActionRef}
|
|
89
|
+
onPress={onBackActionPress}
|
|
90
|
+
children = {backAction}
|
|
91
|
+
/>
|
|
92
|
+
}
|
|
93
|
+
const [context] = React.useState({});
|
|
94
|
+
actions = typeof actions =='function'? actions(getCallAgs()) : actions;
|
|
95
|
+
const dimensions = Dimensions.get("window");
|
|
96
|
+
const [layout,setLayout] = React.useStateIfMounted({
|
|
97
|
+
width : dimensions.width,
|
|
98
|
+
height : dimensions.height,
|
|
99
|
+
})
|
|
100
|
+
context.forceUpdate = ()=>{
|
|
101
|
+
return setLayout({...Dimensions.get("window")});
|
|
102
|
+
}
|
|
103
|
+
const splitedActions = isSplitedActions(actions)? actions: splitActions({...appBarProps,windowWidth:layout.width,canGoBack:back || options.back?true:false,isAppBarAction:true,onBackActionPress,goBack,route,navigation,actions});
|
|
104
|
+
const onPageResize = bindResizeEvent !== false ? (e)=>{
|
|
105
|
+
if(!e || !e.nativeEvent || !e.nativeEvent.layout) return null;
|
|
106
|
+
const {width,height} = e.nativeEvent.layout;
|
|
107
|
+
if(Math.abs(layout.width-width)<50) return;
|
|
108
|
+
setLayout({width,height});
|
|
109
|
+
} : undefined;
|
|
110
|
+
|
|
111
|
+
elevation = typeof elevation === 'number'? elevation : undefined;
|
|
112
|
+
const elevStyle = elevation && Elevations[elevation];
|
|
113
|
+
titleProps = defaultObj(titleProps);
|
|
114
|
+
React.setRef(ref,context);
|
|
115
|
+
testID = defaultStr(testID,"RN_AppBarComponent")
|
|
116
|
+
return (
|
|
117
|
+
<Appbar.Header elevation={elevation} {...appBarProps} testID={testID} style={[styles.header,{backgroundColor},elevStyle,appBarProps.style]} onLayout={onPageResize}>
|
|
118
|
+
{backAction}
|
|
119
|
+
<Content {...defaultObj(appBarProps.contentProps)}
|
|
120
|
+
title={title}
|
|
121
|
+
titleProps = {{...titleProps,style:[styles.title,{color:primaryText},titleProps.style]}}
|
|
122
|
+
subtitle = {defaultVal(subtitle,params.subtitle,options.subtitle)}
|
|
123
|
+
subtitleProps = {subtitleProps}
|
|
124
|
+
/>
|
|
125
|
+
{renderSplitedActions(splitedActions,{
|
|
126
|
+
...defaultObj(menuProps,appBarProps.menuProps),
|
|
127
|
+
anchorProps : {
|
|
128
|
+
style : anchorStyle,
|
|
129
|
+
color : anchorStyle.color,
|
|
130
|
+
}
|
|
131
|
+
})}
|
|
132
|
+
</Appbar.Header>
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
AppBarComponent.displayName = "AppBarComponent";
|
|
137
|
+
|
|
138
|
+
export default AppBarComponent;
|
|
139
|
+
|
|
140
|
+
const styles = StyleSheet.create({
|
|
141
|
+
title : {
|
|
142
|
+
fontSize : TITLE_FONT_SIZE,
|
|
143
|
+
fontWeight : 'bold'
|
|
144
|
+
},
|
|
145
|
+
header : {
|
|
146
|
+
paddingHorizontal : 5,
|
|
147
|
+
paddingRight : 10,
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
AppBarComponent.GO_BACK_EVENT = GO_BACK_EVENT;
|
|
152
|
+
|
|
153
|
+
AppBarComponent.propTypes = {
|
|
154
|
+
...defaultObj(Appbar.propTypes),
|
|
155
|
+
title : PropTypes.string,
|
|
156
|
+
subtitle : PropTypes.oneOfType([
|
|
157
|
+
PropTypes.string,
|
|
158
|
+
PropTypes.bool,
|
|
159
|
+
PropTypes.node,
|
|
160
|
+
]),
|
|
161
|
+
backActionProps : PropTypes.oneOfType([
|
|
162
|
+
PropTypes.object,
|
|
163
|
+
]),
|
|
164
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {isPlainObj,defaultFunc,defaultStr,isObjOrArray,isObj,defaultObj} from "$utils";
|
|
2
|
+
import {getWindowSizes,isMobileOrTabletMedia,isMobileMedia} from "$cdimensions";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import Button from "$ecomponents/Button";
|
|
5
|
+
import React from "$react";
|
|
6
|
+
import theme from "$theme"
|
|
7
|
+
import Action from "$ecomponents/Form/Action";
|
|
8
|
+
import Menu from "$ecomponents/Menu";
|
|
9
|
+
import Icon,{ MORE_ICON } from "$ecomponents/Icon";
|
|
10
|
+
|
|
11
|
+
export const ACTION_ICON_SIZE = 30;
|
|
12
|
+
|
|
13
|
+
export const TITLE_FONT_SIZE = 16;
|
|
14
|
+
|
|
15
|
+
export const getMaxActions = (windowWidth) => {
|
|
16
|
+
let iWidth = typeof windowWidth =='number' && windowWidth > 200 ? windowWidth : getWindowSizes().width;
|
|
17
|
+
return iWidth >= 3000 ? 8 : iWidth >= 2500? 7 : iWidth >= 2000 ? 6 : iWidth >= 1600 ? 5 : iWidth >= 1300 ? 4 : iWidth >= 800 ? 2 : iWidth >= 600 ? 1 : 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const isSplitedActions = (actions)=> isObj(actions) && Array.isArray(actions.actions) && Array.isArray(actions.menus);
|
|
21
|
+
|
|
22
|
+
const renderAction = ({action,isAlert,actionProps,opts,isAppBarAction,isAppBarActionStyle,key,ActionComponent,isMobile}) => {
|
|
23
|
+
let {Component,isFormAction,...rest} = action;
|
|
24
|
+
actionProps = defaultObj(actionProps);
|
|
25
|
+
rest = Object.assign({},rest);
|
|
26
|
+
rest.accessibilityLabel = defaultStr(rest.accessibilityLabel,rest.title,rest.text,rest.label,rest.children);
|
|
27
|
+
const color = theme.colors.primaryText;
|
|
28
|
+
rest.style = {...defaultObj(StyleSheet.flatten(actionProps.style)),elevation:0,...defaultObj(StyleSheet.flatten(rest.style))};
|
|
29
|
+
if(isAppBarActionStyle !== false && (isAppBarAction || opts.isAppBarAction)){
|
|
30
|
+
rest.color = defaultVal(color);
|
|
31
|
+
rest.style.color = defaultVal(rest.style.color,color)
|
|
32
|
+
}
|
|
33
|
+
if(isAppBarAction && isMobile){
|
|
34
|
+
rest.tooltip = defaultVal(rest.title,rest.label,rest.text);
|
|
35
|
+
delete rest.title;
|
|
36
|
+
delete rest.label;
|
|
37
|
+
delete rest.text;
|
|
38
|
+
ActionComponent = Icon;
|
|
39
|
+
} else {
|
|
40
|
+
ActionComponent = Component || ActionComponent;
|
|
41
|
+
if(!isAlert && rest.style.marginRight === undefined){
|
|
42
|
+
rest.style.marginRight = 10;
|
|
43
|
+
}
|
|
44
|
+
if(opts.isFullScreenDialog ===false){
|
|
45
|
+
rest.mode = rest.mode !== undefined ? rest.mode : actionProps.mode !==undefined ? actionProps.mode : 'contained';
|
|
46
|
+
}
|
|
47
|
+
rest.children = defaultVal(rest.children,rest.label,rest.text,rest.accessibilityLabel);
|
|
48
|
+
}
|
|
49
|
+
if(isFormAction){
|
|
50
|
+
actionProps.componentProps = defaultObj(actionProps.componentProps)
|
|
51
|
+
actionProps.componentProps.Component = ActionComponent;
|
|
52
|
+
ActionComponent = Action;
|
|
53
|
+
}
|
|
54
|
+
key = key || action.key;
|
|
55
|
+
return <ActionComponent {...actionProps} isAppBarAction={isAppBarAction} key = {key} {...rest}/>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*** cette fonction a pour but de prendre les actions qui irons sur la barre de navigation
|
|
59
|
+
* puis les subdivisenst en fonction de la taille, en une parties des actions directement visible dans le resultat actions
|
|
60
|
+
* et une autre partie qui sera rendu visible par un menu, accessible via un menu moreVert
|
|
61
|
+
* ///alwaysSplitOnMobile : PropoTypes.bool
|
|
62
|
+
* @param alwaysSplitOnMobile {boolean}, si les actions serton toujours éclatées en un menu d'action en environnement mobile, quel qu'en soit le nombre d'actions trouvées
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export const splitActions = (args)=>{
|
|
66
|
+
let {actions,actionProps,alwaysSplitOnMobile,actionMutator,isAlert,onAlertRequestClose,maxActions,isAppBarActionStyle,cancelButton,...opts} = defaultObj(args)
|
|
67
|
+
if(isSplitedActions(actions)) {
|
|
68
|
+
return actions;
|
|
69
|
+
}
|
|
70
|
+
if(!isObjOrArray(actions)){
|
|
71
|
+
return {actions:[],menus:[]};
|
|
72
|
+
}
|
|
73
|
+
actionMutator = defaultFunc(actionMutator,({action,actions})=> action);
|
|
74
|
+
if(isAlert){
|
|
75
|
+
onAlertRequestClose = defaultFunc(onAlertRequestClose);
|
|
76
|
+
}
|
|
77
|
+
opts = defaultObj(opts);
|
|
78
|
+
const isMobile = isMobileOrTabletMedia();
|
|
79
|
+
const isAppBarAction = opts.isAppBarAction && isMobile ? true : false;
|
|
80
|
+
const ActionComponent = isAppBarAction ? Icon : Button;
|
|
81
|
+
let menus = []
|
|
82
|
+
let _actions = [];
|
|
83
|
+
let countActions = 0;
|
|
84
|
+
if(maxActions !== 0 && typeof maxActions =='number'){
|
|
85
|
+
maxActions = maxActions > 0 ? Math.trunc(maxActions): getMaxActions(opts.windowWidth);
|
|
86
|
+
} else if(maxActions !=0){
|
|
87
|
+
maxActions = getMaxActions(opts.windowWidth);
|
|
88
|
+
}
|
|
89
|
+
for(let i in actions){
|
|
90
|
+
let act = actions[i];
|
|
91
|
+
let cEl = null;
|
|
92
|
+
if(!React.isValidElement(act)&& isPlainObj(act)){
|
|
93
|
+
let {label,perm,text,...action} = act;
|
|
94
|
+
if(typeof perm =='function' && perm(args) === false){
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
action = {...defaultObj(action)};
|
|
98
|
+
if(isAppBarAction && !action.icon) {
|
|
99
|
+
console.log("not icon found for appbar action ",action," you must specity icon for this action");
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
action.key = defaultVal(action.key,i)
|
|
103
|
+
action.text = defaultVal(text,label)
|
|
104
|
+
action.isAlert = isAlert;
|
|
105
|
+
const _action = actionMutator({action,key:action.key,actions});
|
|
106
|
+
if(isObj(_action)){
|
|
107
|
+
if(!_action.divider && !_action.text && !_action.label && !_action.title && !_action.icon && !_action.Component) continue;
|
|
108
|
+
const {onPress} = _action;
|
|
109
|
+
_action.onPress = (args)=>{
|
|
110
|
+
args = {...opts,...React.getOnPressArgs(args),isAlert};
|
|
111
|
+
if(isAlert){
|
|
112
|
+
args.closeAlert = args.closeDialog = onAlertRequestClose;
|
|
113
|
+
}
|
|
114
|
+
if(onPress){
|
|
115
|
+
return onPress(args);
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
cEl = _action;
|
|
120
|
+
countActions++;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if(cEl){
|
|
124
|
+
if(countActions >= maxActions+1) countActions = maxActions+1;
|
|
125
|
+
if((countActions <= maxActions && maxActions >1)){
|
|
126
|
+
_actions.push(renderAction({actionProps,isAlert,isAppBarAction,isAppBarActionStyle,opts,action:cEl,isMenuItem:false,isMobile,ActionComponent}));
|
|
127
|
+
} else {
|
|
128
|
+
menus.push({...cEl,isMenuItem:true});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if(isPlainObj(cancelButton) && !React.isValidElement(cancelButton)){
|
|
133
|
+
let {label,perm,text,...action} = cancelButton;
|
|
134
|
+
let canAddCancelBtn = typeof perm =='function' ? perm(args) : true;
|
|
135
|
+
if(canAddCancelBtn && (text||label)){
|
|
136
|
+
action = {...defaultObj(action)};
|
|
137
|
+
action.label = defaultVal(label,text)
|
|
138
|
+
action.key = defaultStr(action.key,'cancel-btn-action');
|
|
139
|
+
action.isAction = false;
|
|
140
|
+
action.isAlert = isAlert;
|
|
141
|
+
action = actionMutator({action,isAlert,isCancelButton:true,key:action.key});
|
|
142
|
+
if(isObj(action)){
|
|
143
|
+
const {onPress} = action;
|
|
144
|
+
action.onPress = (args)=>{
|
|
145
|
+
args = {...opts,...React.getOnPressArgs(args),isAlert};
|
|
146
|
+
if(isAlert){
|
|
147
|
+
args.closeAlert = args.closeDialog = onAlertRequestClose;
|
|
148
|
+
}
|
|
149
|
+
if(onPress){
|
|
150
|
+
return onPress(args);
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if(menus.length && countActions > 1){
|
|
155
|
+
menus.push({...action,isMenuItem:true});
|
|
156
|
+
} else {
|
|
157
|
+
_actions.push(<Button testID={'RN_AppBarCancelButton'} {...action} key={action.key}/>)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
alwaysSplitOnMobile = isMobileMedia()? alwaysSplitOnMobile : false;
|
|
163
|
+
if(menus.length === 1 && (alwaysSplitOnMobile !== true)){
|
|
164
|
+
menus[0].isMenuItem = false;
|
|
165
|
+
_actions.push(renderAction({actionProps,isAlert,action:menus[0],isAppBarAction,isAppBarActionStyle,opts,isMobile,itemsLength:1,key:"menu-action-"+menus[0].key,ActionComponent}));
|
|
166
|
+
menus = [];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
actions : _actions,
|
|
171
|
+
menus
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const renderSplitedActions = (splitedActions,menuProps)=>{
|
|
176
|
+
menuProps = defaultObj(menuProps);
|
|
177
|
+
const {withBottomSheet,BottomSheetComponent,...rest} = menuProps;
|
|
178
|
+
const MenuComponent = withBottomSheet && React.isComponent(BottomSheetComponent) ? BottomSheetComponent : Menu;
|
|
179
|
+
const rest2 = {},anchorProps = {
|
|
180
|
+
...defaultObj(menuProps.anchorProps),
|
|
181
|
+
icon : MORE_ICON,
|
|
182
|
+
};
|
|
183
|
+
if(withBottomSheet){
|
|
184
|
+
rest2.anchor = (props)=>{
|
|
185
|
+
return <Icon
|
|
186
|
+
{...anchorProps}
|
|
187
|
+
{...props}
|
|
188
|
+
/>
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return isSplitedActions(splitedActions) && (splitedActions.actions.length || splitedActions.menus.length) ? <>
|
|
192
|
+
{splitedActions.actions}
|
|
193
|
+
{splitedActions.menus.length ?
|
|
194
|
+
<MenuComponent
|
|
195
|
+
testID = {"RN_AppBarMenuAnchor"}
|
|
196
|
+
{...defaultObj(rest)}
|
|
197
|
+
{...rest2}
|
|
198
|
+
anchorProps = {anchorProps}
|
|
199
|
+
items = {splitedActions.menus}
|
|
200
|
+
/>
|
|
201
|
+
: null}
|
|
202
|
+
</> : null;
|
|
203
|
+
}
|
|
204
|
+
|