@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,749 @@
|
|
|
1
|
+
import {defaultStr,defaultObj,defaultBool,isNumber,isDecimal,isFunction,defaultVal,defaultNumber,isNonNullString} from "$utils";
|
|
2
|
+
import { TextInput} from "react-native-paper";
|
|
3
|
+
import { TextInput as RNTextInput,KeyboardAvoidingView,StyleSheet} from "react-native";
|
|
4
|
+
import React from "$react";
|
|
5
|
+
import theme,{Colors,DISABLED_OPACITY,READONLY_OPACITY} from "$theme";
|
|
6
|
+
import PropTypes from "prop-types";
|
|
7
|
+
import HelperText from "$ecomponents/HelperText";
|
|
8
|
+
import Icon,{COPY_ICON} from "$ecomponents/Icon";
|
|
9
|
+
import Label from "$ecomponents/Label";
|
|
10
|
+
import {isAndroid as _isAndroid,isMobileNative,isIos as _isIos,isWeb as _isWeb} from "$cplatform";
|
|
11
|
+
import {isMobileMedia,isDesktopMedia} from "$cplatform/dimensions";
|
|
12
|
+
import {keyboardTypes,FONT_SIZE,parseDecimal,HEIGHT,outlinedMode,modes,flatMode,normalMode,shadowMode} from "./utils";
|
|
13
|
+
import {copyTextToClipboard} from "$capp/clipboard/utils";
|
|
14
|
+
import Surface from "$ecomponents/Surface";
|
|
15
|
+
import View from "$ecomponents/View";
|
|
16
|
+
const PADDING_HORIZONTAL_FLAT_MODE = 2;
|
|
17
|
+
|
|
18
|
+
export const LINE_HEIGHT = 10;
|
|
19
|
+
|
|
20
|
+
const EnterKey = "Enter".toLowerCase();
|
|
21
|
+
const BackSpaceKey = "Backspace".toLowerCase();
|
|
22
|
+
|
|
23
|
+
export * from "./utils";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
//const isNative = isNativeMobile();
|
|
27
|
+
const isAndroid = _isAndroid() //|| isAndroidMobileBrowser();
|
|
28
|
+
const isWeb = _isWeb();
|
|
29
|
+
const isIos = _isIos();
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
34
|
+
let {defaultValue,color,validType,validRule,placeholder,outlined,placeholderColor,
|
|
35
|
+
label,labelProps,labelStyle,fontSize,containerProps,selection,roundness,
|
|
36
|
+
autoCapitalize,disabled,editable,readOnly,elevation,divider,render,
|
|
37
|
+
leftContainerProps,left,right,rightContainerProps,rows,
|
|
38
|
+
emptyValue,usePlaceholderWhenEmpty,
|
|
39
|
+
numberOfLines,mode,selectionColor,activeOutlineColor,multiline
|
|
40
|
+
,underlineColor,alwaysUseLabel,activeUnderlineColor,autoHeight,multiple,keyboardType,setRef,type,error,
|
|
41
|
+
style,maxLength,length,affixStyle,affix,helperText, upperCase,
|
|
42
|
+
upper,onChangeText,onChange,onMount,onUnmount,
|
|
43
|
+
format ,
|
|
44
|
+
enableCopy,
|
|
45
|
+
fieldToCopy,
|
|
46
|
+
selectFieldToCopy,
|
|
47
|
+
isFilter,
|
|
48
|
+
context : customContext,
|
|
49
|
+
formatValue : customFormatValue,
|
|
50
|
+
useReadOnlyOpacity,
|
|
51
|
+
children : customChildren,
|
|
52
|
+
testID,
|
|
53
|
+
contentContainerProps,
|
|
54
|
+
contentProps,
|
|
55
|
+
lower,
|
|
56
|
+
dynamicBackgroundColor,
|
|
57
|
+
lowerCase,
|
|
58
|
+
...props} = componentProps;
|
|
59
|
+
upper = defaultBool(upper,upperCase,false);
|
|
60
|
+
lower = defaultBool(lower,lowerCase,false);
|
|
61
|
+
testID = defaultStr(testID,'RN_TextField');
|
|
62
|
+
type = defaultStr(type).toLowerCase();
|
|
63
|
+
if(lower){
|
|
64
|
+
autoCapitalize = "none";
|
|
65
|
+
}
|
|
66
|
+
format = defaultStr(format).toLowerCase();
|
|
67
|
+
const canValueBeDecimal = (type =='number' || type =='decimal');
|
|
68
|
+
const isMoneyFormat = format == 'currency' || format =='money' ?true : false;
|
|
69
|
+
const canValueBeFormattable = customFormatValue === false ? false : (typeof customFormatValue ==='function' || canValueBeDecimal || isMoneyFormat || format == 'number');
|
|
70
|
+
emptyValue = defaultVal(emptyValue,canValueBeFormattable?"0":"");
|
|
71
|
+
const formatValue = customFormatValue === false ? x=> x : (val)=>{
|
|
72
|
+
if(val === undefined || val === null){
|
|
73
|
+
val = canValueBeDecimal ? 0 : '';
|
|
74
|
+
}
|
|
75
|
+
if(canValueBeDecimal || (format !='custom')){
|
|
76
|
+
val = parseDecimal(val,type);
|
|
77
|
+
}
|
|
78
|
+
let r = val;
|
|
79
|
+
if(isDecimal(val)){
|
|
80
|
+
if(isMoneyFormat){
|
|
81
|
+
val = val.formatMoney();
|
|
82
|
+
} else {
|
|
83
|
+
val = val.formatNumber()
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if(typeof(customFormatValue) == 'function'){
|
|
87
|
+
r = customFormatValue({value:r,isFilter,formattedValue:val,context:customContext,inputRef})
|
|
88
|
+
if(isNonNullString(r)){
|
|
89
|
+
val = r;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return val;
|
|
93
|
+
}
|
|
94
|
+
const parseValueToDecimal = canValueBeFormattable ? (x) => parseDecimal(x,type,true) : x => x;
|
|
95
|
+
type = defaultStr(type,"text").toLowerCase();
|
|
96
|
+
if(type =="pass") type = "password";
|
|
97
|
+
const ref = React.useRef(null);
|
|
98
|
+
disabled = defaultBool(disabled,false);
|
|
99
|
+
editable = defaultBool(editable,true);
|
|
100
|
+
readOnly = defaultBool(readOnly,false);
|
|
101
|
+
if(readOnly){
|
|
102
|
+
editable = false;
|
|
103
|
+
}
|
|
104
|
+
const isEditable = !disabled && !readOnly && editable !== false;
|
|
105
|
+
keyboardType = defaultStr(keyboardType).toLowerCase();
|
|
106
|
+
let hasFountKeyboardType = false;
|
|
107
|
+
if(isNonNullString(keyboardType)){
|
|
108
|
+
if(!keyboardTypes[keyboardType]){
|
|
109
|
+
for(let i in keyboardTypes){
|
|
110
|
+
if(keyboardType === keyboardTypes[i]){
|
|
111
|
+
hasFountKeyboardType = true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if(!hasFountKeyboardType && (!keyboardType || !keyboardTypes[keyboardType])){
|
|
117
|
+
if(canValueBeDecimal){
|
|
118
|
+
keyboardType = keyboardTypes.decimal;
|
|
119
|
+
} else if(type == "email"){
|
|
120
|
+
keyboardType = keyboardTypes.email;
|
|
121
|
+
} else if(type =="phone" || type =="tel"){
|
|
122
|
+
keyboardType = keyboardTypes.phone;
|
|
123
|
+
} else if(!keyboardTypes[type]){
|
|
124
|
+
keyboardType = keyboardTypes.default;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const isSecureText = type =="password"?true : false;
|
|
128
|
+
const [secureTextEntry,setSecureTextEntry] = React.useStateIfMounted(isSecureText);
|
|
129
|
+
const prevSecureTextEntry = React.usePrevious(secureTextEntry);
|
|
130
|
+
containerProps = defaultObj(containerProps);
|
|
131
|
+
mode = defaultStr(mode,theme.textFieldMode);
|
|
132
|
+
if(!modes[mode]){
|
|
133
|
+
mode = theme.textFieldMode;
|
|
134
|
+
}
|
|
135
|
+
const isOutlinedMode = mode === outlinedMode ? true : false;
|
|
136
|
+
const isShadowMode = mode ==shadowMode ? true : false;
|
|
137
|
+
const isNormalMode = mode == normalMode ? true : false;
|
|
138
|
+
const isFlatMode = mode == flatMode ? true : false;
|
|
139
|
+
|
|
140
|
+
const [inputState, setInputState] = React.useStateIfMounted({
|
|
141
|
+
focused : false,
|
|
142
|
+
touched: false,
|
|
143
|
+
});
|
|
144
|
+
const isFocused = inputState.focused;
|
|
145
|
+
const callOnChangeRef = React.useRef(false);
|
|
146
|
+
const toCase = (t) => {
|
|
147
|
+
if(isNumber(t)) t+="";
|
|
148
|
+
if(t === emptyValue){
|
|
149
|
+
t = "";
|
|
150
|
+
}
|
|
151
|
+
if((upper !== true && lower !== true) || isAndroid) return typeof t =='string'? t : "";
|
|
152
|
+
return isNonNullString(t)? (upper ? t.toUpperCase() : lower ? t.toLowerCase():t) : ""
|
|
153
|
+
};
|
|
154
|
+
const [text, _setText] = React.useStateIfMounted(toCase(defaultValue));
|
|
155
|
+
const previousText = React.usePrevious(text);
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
const callOnChange = (value,previousValue)=>{
|
|
159
|
+
const nV = value || text;
|
|
160
|
+
value = parseValueToDecimal(nV);
|
|
161
|
+
previousValue = parseValueToDecimal(previousValue || previousText);
|
|
162
|
+
const arg = {value,previousValue,context:ref.current};
|
|
163
|
+
if(typeof onChangeText =='function'){
|
|
164
|
+
onChangeText(value);
|
|
165
|
+
}
|
|
166
|
+
if(typeof onChange =='function'){
|
|
167
|
+
onChange(arg);
|
|
168
|
+
}
|
|
169
|
+
callOnChangeRef.current = false;
|
|
170
|
+
}
|
|
171
|
+
React.useEffect(()=>{
|
|
172
|
+
if(!callOnChangeRef.current || previousText === text) return;
|
|
173
|
+
callOnChange();
|
|
174
|
+
},[text])
|
|
175
|
+
const setText = function(text1,force){
|
|
176
|
+
text1 = toCase(text1);
|
|
177
|
+
if(force!== true && text1 === text) return;
|
|
178
|
+
callOnChangeRef.current = true;
|
|
179
|
+
_setText(text1);
|
|
180
|
+
}
|
|
181
|
+
React.useEffect(()=>{
|
|
182
|
+
defaultValue = toCase(defaultValue);
|
|
183
|
+
if(defaultValue === toCase(emptyValue)){
|
|
184
|
+
defaultValue = "";
|
|
185
|
+
}
|
|
186
|
+
if(defaultValue ===text || parseValueToDecimal(defaultValue) === parsedValue) return;
|
|
187
|
+
_setText(defaultValue);
|
|
188
|
+
},[defaultValue])
|
|
189
|
+
React.useEffect(()=>{
|
|
190
|
+
if(typeof onMount =='function'){
|
|
191
|
+
onMount({context:ref,defaultValue,displayText,parsedValue,value:text})
|
|
192
|
+
}
|
|
193
|
+
return ()=>{
|
|
194
|
+
ref.current = undefined;
|
|
195
|
+
if(typeof onUnmount =='function'){
|
|
196
|
+
onUnmount({context:ref});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},[])
|
|
200
|
+
React.useEffect(()=>{
|
|
201
|
+
if(prevSecureTextEntry !== secureTextEntry && ref && ref.current){
|
|
202
|
+
if(ref.current.focus) {
|
|
203
|
+
ref.current.focus();
|
|
204
|
+
} else {
|
|
205
|
+
if(ref.current.forceFocus){
|
|
206
|
+
ref.current.forceFocus();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},[secureTextEntry])
|
|
211
|
+
underlineColor = Colors.isValid(underlineColor)? underlineColor : Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
|
212
|
+
activeUnderlineColor = Colors.isValid(activeUnderlineColor)? activeUnderlineColor : theme.colors.primaryOnSurface;
|
|
213
|
+
numberOfLines = isNumber(numberOfLines) && numberOfLines > 0 ? numberOfLines : isNumber(rows) && rows > 0 ? rows : undefined;
|
|
214
|
+
contentContainerProps = defaultObj(contentContainerProps);
|
|
215
|
+
contentProps = defaultObj(contentProps);
|
|
216
|
+
leftContainerProps = defaultObj(leftContainerProps);
|
|
217
|
+
rightContainerProps = defaultObj(rightContainerProps);
|
|
218
|
+
const pointerEvents = isEditable?"auto":'none';
|
|
219
|
+
const upperStyle = text && (upper || lower) && !isAndroid ? {textTransform:upper?'uppercase':'lowercase'} : null;
|
|
220
|
+
const opacity = disabled ? DISABLED_OPACITY : (useReadOnlyOpacity !== false && !error && (readOnly || editable === false)) ? READONLY_OPACITY : undefined;
|
|
221
|
+
const disabledStyle = opacity ? {opacity} : undefined;
|
|
222
|
+
if((editable === false || disabled === true) ){
|
|
223
|
+
selection = defaultObj(selection);
|
|
224
|
+
if(!isNumber(selection.start)){
|
|
225
|
+
selection.start = 0;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
selectionColor = Colors.isValid(selectionColor)? selectionColor : theme.colors.secondaryOnSurface;
|
|
229
|
+
const flattenStyle = StyleSheet.flatten([styles.input,styles.textInput,props.style,styles.w100,style,upperStyle]);
|
|
230
|
+
fontSize = defaultNumber(fontSize,flattenStyle.fontSize,FONT_SIZE);
|
|
231
|
+
labelProps = defaultObj(labelProps);
|
|
232
|
+
const alphaColor = isShadowMode || isNormalMode ? theme.colors.text : Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
|
233
|
+
const disabledColor = disabled && Colors.isValid(theme.colors.disabled)?theme.colors.disabled : alphaColor;
|
|
234
|
+
let labelColor = error ? theme.colors.error : !isEditable ? disabledColor : isFocused ? activeUnderlineColor : alphaColor;
|
|
235
|
+
if(labelColor ==='transparent'){
|
|
236
|
+
labelColor = theme.colors.secondaryOnSurface;
|
|
237
|
+
}
|
|
238
|
+
if (disabled) {
|
|
239
|
+
placeholderColor = theme.colors.disabled;
|
|
240
|
+
} else {
|
|
241
|
+
placeholderColor = Colors.isValid(theme.colors.placeholder)?theme.colors.placeholder : undefined;
|
|
242
|
+
}
|
|
243
|
+
if(isFocused || error){
|
|
244
|
+
placeholderColor = labelColor;
|
|
245
|
+
}
|
|
246
|
+
const defaultBackgroundColor = theme.surfaceBackgroundColor;
|
|
247
|
+
let backgroundColor = Colors.isValid(flattenStyle.backgroundColor)? flattenStyle.backgroundColor : defaultBackgroundColor;
|
|
248
|
+
if(backgroundColor ==='transparent' && dynamicBackgroundColor !== false){
|
|
249
|
+
backgroundColor = defaultBackgroundColor;
|
|
250
|
+
}
|
|
251
|
+
let labelText = React.isValidElement(label,true)?React.getTextContent(label):"";
|
|
252
|
+
placeholder = defaultStr(placeholder,labelText);
|
|
253
|
+
const parsedValue = canValueBeDecimal ? parseValueToDecimal(text):text;
|
|
254
|
+
const formattedValue = formatValue(text);
|
|
255
|
+
let displayText = isFocused ? (parsedValue+"") : formattedValue;
|
|
256
|
+
if((isFocused || usePlaceholderWhenEmpty) && displayText ==emptyValue){
|
|
257
|
+
displayText = "";
|
|
258
|
+
}
|
|
259
|
+
displayText +="";
|
|
260
|
+
if(typeof parsedValue =='number' && text){
|
|
261
|
+
if(text.endsWith(".")){
|
|
262
|
+
displayText = (parsedValue+"").rtrim(".")+".";
|
|
263
|
+
}
|
|
264
|
+
if(text.endsWith(",")){
|
|
265
|
+
displayText = (parsedValue+"").rtrim(",")+",";
|
|
266
|
+
}
|
|
267
|
+
if(isFocused && (text.contains('.') || text.contains(',') || text.contains("00"))){
|
|
268
|
+
displayText = text;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
let hasLabel = label && (isShadowMode || isNormalMode || alwaysUseLabel || text || (isFocused || (!usePlaceholderWhenEmpty && canValueBeFormattable)))? true : labelText !== placeholder;
|
|
272
|
+
const innerRef = (el)=>{
|
|
273
|
+
ref.current = el;
|
|
274
|
+
React.setRef(inputRef,el,setRef);
|
|
275
|
+
};
|
|
276
|
+
validType = defaultStr(validType,validRule).toLowerCase();
|
|
277
|
+
multiline = isFilter ? false : defaultBool(multiline,multiple,!!numberOfLines);
|
|
278
|
+
let inputColor = (isFocused || error) ? labelColor : Colors.isValid(color)?color : theme.colors.text;
|
|
279
|
+
if(!isFocused && !displayText && !error){
|
|
280
|
+
inputColor = placeholderColor;
|
|
281
|
+
}
|
|
282
|
+
if(!isEditable){
|
|
283
|
+
//inputColor = disabledColor;
|
|
284
|
+
}
|
|
285
|
+
const isMob = isMobileMedia();
|
|
286
|
+
const borderWidth = outlined !== false ? (isFocused ? 2: 1):0;
|
|
287
|
+
const _height = typeof flattenStyle.height == 'number' && flattenStyle.height > 20 ? flattenStyle.height : HEIGHT;
|
|
288
|
+
const tHeight = _height;//isShadowMode ? (_height+(isMobileNative()?10:0)) : isNormalMode ? (_height-10) : _height;
|
|
289
|
+
const heightRef = React.useRef(tHeight);
|
|
290
|
+
//const lineHeightRef = React.useRef(0);
|
|
291
|
+
roundness = typeof roundness =='number'? roundness : undefined;
|
|
292
|
+
const borderRadius = isShadowMode ? (roundness || Math.max(tHeight/3,10)) : isOutlinedMode ? (roundness || 10) : 0;
|
|
293
|
+
const borderColor = isFocused || error || disabled ? labelColor : Colors.setAlpha(theme.colors.text,0.2)
|
|
294
|
+
const currentDefaultValue = alwaysUseLabel && displayText == emptyValue ? "" : displayText;
|
|
295
|
+
const withAutoHeight = typeof autoHeight === 'boolean'? autoHeight : false;
|
|
296
|
+
const height = withAutoHeight || multiline ? undefined : tHeight;
|
|
297
|
+
const inputStyle2 = withAutoHeight || multiline ? {minHeight : heightRef.current} : null;
|
|
298
|
+
const inputProps= {
|
|
299
|
+
caretHidden : false,
|
|
300
|
+
ellipsizeMode : "head",
|
|
301
|
+
testID : testID+"_Input",
|
|
302
|
+
keyboardAppearance : theme.isDark()? 'dark': 'default',
|
|
303
|
+
...props,
|
|
304
|
+
innerRef,
|
|
305
|
+
placeholder : (isFocused || isShadowMode || isNormalMode) && labelText ? "":placeholder,
|
|
306
|
+
placeholderTextColor : error ? theme.colors.error : placeholderColor,
|
|
307
|
+
selectionColor,
|
|
308
|
+
onKeyPress : (e)=>{
|
|
309
|
+
if(props.onKeyPress){
|
|
310
|
+
props.onKeyPress(e);
|
|
311
|
+
}
|
|
312
|
+
if(!isFocused){
|
|
313
|
+
setInputState({...inputState,focused:true,touched:true});
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
onBlur : (e)=>{
|
|
317
|
+
setInputState({...inputState,touched: true,focused:false})
|
|
318
|
+
const txt = defaultStr(text).trim();
|
|
319
|
+
if((txt.length <=1 && !error)){
|
|
320
|
+
if(validType.contains("unique") || validType.contains("required")){
|
|
321
|
+
callOnChange(txt);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if(props.onBlur){
|
|
325
|
+
props.onBlur(e);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
onFocus : (e)=>{
|
|
329
|
+
setInputState({...inputState,touched: true,focused:true});
|
|
330
|
+
if(props.onFocus){
|
|
331
|
+
props.onFocus(e);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
disabled,
|
|
336
|
+
editable : isEditable,
|
|
337
|
+
error : !!error,
|
|
338
|
+
mode,
|
|
339
|
+
underlineColor,
|
|
340
|
+
activeUnderlineColor,
|
|
341
|
+
multiline,
|
|
342
|
+
style : [
|
|
343
|
+
flattenStyle,
|
|
344
|
+
{
|
|
345
|
+
backgroundColor : 'transparent',
|
|
346
|
+
color : !error && !isFocused && Colors.isValid(flattenStyle.color)?flattenStyle.color : inputColor,
|
|
347
|
+
fontSize,
|
|
348
|
+
textAlignVertical: 'center',//multiline ? 'top' : 'center',
|
|
349
|
+
overflow : 'hidden',
|
|
350
|
+
},
|
|
351
|
+
isWeb && { outline: 'none'},
|
|
352
|
+
disabledStyle,
|
|
353
|
+
{height},
|
|
354
|
+
inputStyle2,
|
|
355
|
+
isNormalMode && styles.inputNormalMode,
|
|
356
|
+
isShadowMode && styles.inputShadowMode,
|
|
357
|
+
multiline && {paddingTop : 7},
|
|
358
|
+
],
|
|
359
|
+
pointerEvents,
|
|
360
|
+
secureTextEntry,
|
|
361
|
+
keyboardType,
|
|
362
|
+
autoCapitalize : upper?(isAndroid?'characters':"none"):autoCapitalize,
|
|
363
|
+
value : currentDefaultValue,
|
|
364
|
+
realValue : text,
|
|
365
|
+
formattedValue,
|
|
366
|
+
displayText,
|
|
367
|
+
parsedValue,
|
|
368
|
+
numberOfLines,
|
|
369
|
+
onChange : ({ nativeEvent: {target, text:text2} }) => {
|
|
370
|
+
if(canValueBeDecimal && (text2 && !text2.isNumber() && !text2.endsWith(".") && !text2.endsWith(","))) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
if(canValueBeDecimal && isFocused && (text2 ==='.'|| text2 =='.')){
|
|
374
|
+
text2 = "0"+text2;
|
|
375
|
+
}
|
|
376
|
+
if(multiline){
|
|
377
|
+
const minHeight = Math.max(tHeight,target.scrollHeight);
|
|
378
|
+
if( tHeight < minHeight) {
|
|
379
|
+
heightRef.current = minHeight;
|
|
380
|
+
if(!isFocused && innerRef.current?.setNativeProps){
|
|
381
|
+
innerRef.current.setNativeProps({style:{minHeight}})
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if(toCase(text2) !== text){
|
|
386
|
+
setText(text2,true);
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
selection,
|
|
390
|
+
}
|
|
391
|
+
const isDesktop = isDesktopMedia();
|
|
392
|
+
const iconProps = {style:{color:inputColor},color:inputColor};
|
|
393
|
+
right = typeof right ==='function'?right(iconProps) : right;
|
|
394
|
+
left = typeof left =='function'? left(iconProps) : left;
|
|
395
|
+
let hasRight = React.isValidElement(right),hasLeft = React.isValidElement(left);
|
|
396
|
+
enableCopy = enableCopy !== false ? true : false;
|
|
397
|
+
fieldToCopy = defaultStr(fieldToCopy).toLowerCase().trim();
|
|
398
|
+
if(isEditable || isFilter || defaultStr(contentContainerProps.pointerEvents).toLowerCase().contains("none")){
|
|
399
|
+
enableCopy = false;
|
|
400
|
+
}
|
|
401
|
+
if(enableCopy){
|
|
402
|
+
let valueToCopy = canValueBeDecimal ? parsedValue : displayText;
|
|
403
|
+
if(fieldToCopy.contains("real")){
|
|
404
|
+
valueToCopy = text;
|
|
405
|
+
}
|
|
406
|
+
valueToCopy +="";
|
|
407
|
+
right = <>
|
|
408
|
+
{React.isValidElement(right)? right:null}
|
|
409
|
+
{valueToCopy?<Icon
|
|
410
|
+
{...iconProps}
|
|
411
|
+
title = {"Copier la valeur ["+valueToCopy+"] dans le presse papier"}
|
|
412
|
+
icon = {COPY_ICON}
|
|
413
|
+
onPress = {(e)=>{
|
|
414
|
+
/*if(selectFieldToCopy){
|
|
415
|
+
return DialogProvider.open({
|
|
416
|
+
title : 'Valeur à copier',
|
|
417
|
+
fullScreen : false,
|
|
418
|
+
content : <SimpleSelect
|
|
419
|
+
label = {"Valeur"}
|
|
420
|
+
items = {{
|
|
421
|
+
parsedValue,
|
|
422
|
+
displayText,
|
|
423
|
+
text,
|
|
424
|
+
}}
|
|
425
|
+
itemValue = {({item,index})=>item}
|
|
426
|
+
onChange = {({item,value})=>{
|
|
427
|
+
DialogProvider.close();
|
|
428
|
+
return copyTextToClipboard(item);
|
|
429
|
+
}}
|
|
430
|
+
/>,
|
|
431
|
+
actions : [{
|
|
432
|
+
text : 'Annuler',
|
|
433
|
+
secondary : true,
|
|
434
|
+
onPress : DialogProvider.close
|
|
435
|
+
}]
|
|
436
|
+
})
|
|
437
|
+
}*/
|
|
438
|
+
copyTextToClipboard(valueToCopy);
|
|
439
|
+
}}
|
|
440
|
+
/>:null}
|
|
441
|
+
</>
|
|
442
|
+
}
|
|
443
|
+
hasRight = hasRight || React.isValidElement(right)? true : false;
|
|
444
|
+
affix = isFilter || multiline ? false : typeof affix =='boolean'? affix : true;
|
|
445
|
+
let affixContent = null;
|
|
446
|
+
if(isSecureText && !disabled){
|
|
447
|
+
right = <Icon
|
|
448
|
+
{...iconProps}
|
|
449
|
+
disabled = {!isEditable}
|
|
450
|
+
forceTextInputFocus={false}
|
|
451
|
+
accessibilityLabel ={!secureTextEntry?"Cliquez pour masquer le contenu":"Cliquez pour afficher le contenu"}
|
|
452
|
+
icon={secureTextEntry?'eye-off':'eye'}
|
|
453
|
+
onPress={()=>{
|
|
454
|
+
setSecureTextEntry(!secureTextEntry);
|
|
455
|
+
}}
|
|
456
|
+
/>
|
|
457
|
+
hasRight = true;
|
|
458
|
+
} else {
|
|
459
|
+
if(isFocused && !disabled){
|
|
460
|
+
if(!canValueBeDecimal){
|
|
461
|
+
let aff = isNonNullString(text)? text.length.formatNumber(): "";
|
|
462
|
+
if(isNumber(maxLength) && aff){
|
|
463
|
+
aff += ((isNumber(length)?"-":"/")+maxLength.formatNumber());
|
|
464
|
+
}
|
|
465
|
+
affixContent = <Label disabled={!isEditable} children={defaultStr(affix,aff)} style={[styles.affix,multiline && styles.affixMultiline,{color:theme.colors.primaryOnSurface},iconProps.style,affixStyle,!hasRight && !isFlatMode && styles.affixOnly]} />;
|
|
466
|
+
if(affix){
|
|
467
|
+
right = hasRight ? <>{affixContent}{right}</> : affixContent;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
} else affix = undefined;
|
|
471
|
+
}
|
|
472
|
+
elevation = defaultNumber(contentContainerProps.elevation,elevation,isShadowMode?4:0);
|
|
473
|
+
const paddingVertical = (hasRight || hasLeft)? isMob?5 : 0 : 10;
|
|
474
|
+
const contentContainerStyle = isOutlinedMode ? {
|
|
475
|
+
borderColor,
|
|
476
|
+
borderWidth,
|
|
477
|
+
borderRadius,
|
|
478
|
+
} : isShadowMode ? {
|
|
479
|
+
marginHorizontal : 0,
|
|
480
|
+
paddingLeft : 10,
|
|
481
|
+
paddingRight : 0,
|
|
482
|
+
marginVertical : 0,
|
|
483
|
+
borderColor,// : 'transparent',
|
|
484
|
+
borderRadius,
|
|
485
|
+
borderWidth,
|
|
486
|
+
backgroundColor,
|
|
487
|
+
} : isNormalMode ?{
|
|
488
|
+
borderColor,
|
|
489
|
+
borderRadius : 0,
|
|
490
|
+
paddingHorizontal : 10,
|
|
491
|
+
borderWidth : borderWidth,
|
|
492
|
+
} : {
|
|
493
|
+
borderColor,
|
|
494
|
+
//paddingLeft : 0,
|
|
495
|
+
borderBottomWidth : divider !== false ? borderWidth : 0,
|
|
496
|
+
paddingHorizontal : PADDING_HORIZONTAL_FLAT_MODE,
|
|
497
|
+
}
|
|
498
|
+
contentContainerStyle.backgroundColor = backgroundColor;
|
|
499
|
+
if(!height){
|
|
500
|
+
contentContainerStyle.paddingVertical = paddingVertical;
|
|
501
|
+
}
|
|
502
|
+
const children = typeof customChildren =='function'? customChildren(iconProps) : customChildren;
|
|
503
|
+
return (
|
|
504
|
+
<View testID={testID+"_Container"} {...containerProps} style={[styles.container,containerProps.style]}>
|
|
505
|
+
{hasLabel? <Label
|
|
506
|
+
ellipsizeMode = {"tail"}
|
|
507
|
+
numberOfLines = {1}
|
|
508
|
+
testID={testID+"_Label"}
|
|
509
|
+
{...labelProps}
|
|
510
|
+
disabled={!isEditable && !isOutlinedMode ? true : false}
|
|
511
|
+
style={[
|
|
512
|
+
styles.label,
|
|
513
|
+
isOutlinedMode ? styles.labelOutlined : styles.labelFlat,
|
|
514
|
+
labelProps.style,
|
|
515
|
+
(isFocused) && styles.focusedLabel,
|
|
516
|
+
isFlatMode && (isFocused) && {fontSize},
|
|
517
|
+
isFlatMode && {paddingHorizontal : PADDING_HORIZONTAL_FLAT_MODE},
|
|
518
|
+
isNormalMode || isShadowMode && {fontSize},
|
|
519
|
+
{color:labelColor},
|
|
520
|
+
isOutlinedMode && {paddingHorizontal:5,backgroundColor},
|
|
521
|
+
isShadowMode && styles.labelShadow,
|
|
522
|
+
isNormalMode && styles.labelNormal,
|
|
523
|
+
labelStyle,
|
|
524
|
+
]}
|
|
525
|
+
>
|
|
526
|
+
{label}
|
|
527
|
+
</Label> : null}
|
|
528
|
+
<>
|
|
529
|
+
<Surface testID={testID+"_ContentContainer"} pointerEvents={pointerEvents} {...contentContainerProps} elevation={elevation} style={[styles.contentContainer,!left? styles.paddingLeft:null,styles.row,contentContainerStyle,contentContainerProps.style]}>
|
|
530
|
+
{left ? (<View testID={testID+"_Left"} {...leftContainerProps} style={[styles.AdornmentContainer,styles.leftAdornment,leftContainerProps.style,disabledStyle]}>
|
|
531
|
+
{left}
|
|
532
|
+
</View>) : null}
|
|
533
|
+
<KeyboardAvoidingView testID={testID+"_Content"} {...contentProps} style={[styles.inputWrapper,contentProps.style,disabledStyle]}>
|
|
534
|
+
{
|
|
535
|
+
typeof render ==="function"? render(inputProps):
|
|
536
|
+
<RNTextInput
|
|
537
|
+
{...inputProps}
|
|
538
|
+
ref = {innerRef}
|
|
539
|
+
/>
|
|
540
|
+
}
|
|
541
|
+
</KeyboardAvoidingView>
|
|
542
|
+
{right ? (<View testID={testID+"_Right"} {...rightContainerProps} style={[styles.AdornmentContainer,styles.rightAdornment,rightContainerProps.style,disabledStyle]}>
|
|
543
|
+
{right}
|
|
544
|
+
</View>) : null}
|
|
545
|
+
</Surface>
|
|
546
|
+
<View testID={testID+"_Children"} style={[styles.children,disabledStyle]}>
|
|
547
|
+
{React.isValidElement(children)? children : null}
|
|
548
|
+
</View>
|
|
549
|
+
{<View testID={testID+"_AffixContainer"} style={styles.affixContainer}>
|
|
550
|
+
{multiline && !error && !helperText ? affixContent:null}
|
|
551
|
+
<HelperText style={[isDesktop && styles.helperTextAbsolute]} testID={testID+"_HelperText"} error={error} disabled={!isEditable}>{helperText}</HelperText>
|
|
552
|
+
</View>}
|
|
553
|
+
</>
|
|
554
|
+
</View>
|
|
555
|
+
);
|
|
556
|
+
});
|
|
557
|
+
TextFieldComponent.displayName = "TextFieldComponent";
|
|
558
|
+
export default TextFieldComponent;
|
|
559
|
+
const styles = StyleSheet.create({
|
|
560
|
+
children : {
|
|
561
|
+
width : '100%',
|
|
562
|
+
flexDirection:'column',
|
|
563
|
+
flexWrap : 'wrap'
|
|
564
|
+
},
|
|
565
|
+
container: {
|
|
566
|
+
width: "100%",
|
|
567
|
+
marginVertical : 8,
|
|
568
|
+
padding : 0,
|
|
569
|
+
alignSelf : 'center',
|
|
570
|
+
justifyContent : 'center',
|
|
571
|
+
alignItems : 'flex-start'
|
|
572
|
+
},
|
|
573
|
+
row : {
|
|
574
|
+
flexDirection:'row',
|
|
575
|
+
},
|
|
576
|
+
contentContainer : {
|
|
577
|
+
width : '100%',
|
|
578
|
+
position : 'relative',
|
|
579
|
+
paddingVertical : 0,
|
|
580
|
+
paddingHorizontal : 0,
|
|
581
|
+
marginHorizontal : 0,
|
|
582
|
+
marginVertical : 0,
|
|
583
|
+
justifyContent : 'center',
|
|
584
|
+
alignSelf : 'center',
|
|
585
|
+
alignItems : 'center',
|
|
586
|
+
},
|
|
587
|
+
paddingLeft : {
|
|
588
|
+
paddingLeft : 10,
|
|
589
|
+
},
|
|
590
|
+
input : {
|
|
591
|
+
paddingVertical : 0,
|
|
592
|
+
marginVertical : 0,
|
|
593
|
+
marginHorizontal : 0,
|
|
594
|
+
paddingHorizontal : 0,
|
|
595
|
+
maxWidth : '100%'
|
|
596
|
+
},
|
|
597
|
+
label: {
|
|
598
|
+
//...StyleSheet.absoluteFill,
|
|
599
|
+
paddingHorizontal : 0,
|
|
600
|
+
position : 'absolute',
|
|
601
|
+
zIndex : 10,
|
|
602
|
+
top : -6,
|
|
603
|
+
left:0,
|
|
604
|
+
},
|
|
605
|
+
labelShadow : {
|
|
606
|
+
position:'relative',
|
|
607
|
+
marginBottom : 2,
|
|
608
|
+
marginHorizontal:10,
|
|
609
|
+
fontWeight : '400',
|
|
610
|
+
top : 0,
|
|
611
|
+
left : 0,
|
|
612
|
+
},
|
|
613
|
+
labelNormal : {
|
|
614
|
+
position:'relative',
|
|
615
|
+
marginBottom : 2,
|
|
616
|
+
marginHorizontal:2,
|
|
617
|
+
top : 0,
|
|
618
|
+
left : 0,
|
|
619
|
+
},
|
|
620
|
+
labelOutlined : {
|
|
621
|
+
top : -10,
|
|
622
|
+
left : 5,
|
|
623
|
+
},
|
|
624
|
+
labelFlat : {
|
|
625
|
+
},
|
|
626
|
+
inputWrapper : {
|
|
627
|
+
flex:1,
|
|
628
|
+
flexGrow:1
|
|
629
|
+
},
|
|
630
|
+
affix : {
|
|
631
|
+
paddingHorizontal:0,
|
|
632
|
+
marginHorizontal : 0,
|
|
633
|
+
marginLeft : 5,
|
|
634
|
+
fontSize:15
|
|
635
|
+
},
|
|
636
|
+
affixMultiline : {
|
|
637
|
+
position : 'absolute',
|
|
638
|
+
right : 0,
|
|
639
|
+
top : 0,
|
|
640
|
+
},
|
|
641
|
+
affixContainer : {
|
|
642
|
+
position : 'relative',
|
|
643
|
+
width : '100%',
|
|
644
|
+
},
|
|
645
|
+
helperTextAbsolute : {
|
|
646
|
+
position : 'absolute',
|
|
647
|
+
left : 0,
|
|
648
|
+
top : 0,
|
|
649
|
+
flexWrap : 'wrap',
|
|
650
|
+
},
|
|
651
|
+
affixOnly : {
|
|
652
|
+
marginRight:7
|
|
653
|
+
},
|
|
654
|
+
leftAdornment : {
|
|
655
|
+
flexGrow : 0,
|
|
656
|
+
alignSelf : 'center',
|
|
657
|
+
justifyContent : 'flex-start'
|
|
658
|
+
},
|
|
659
|
+
rightAdornment : {
|
|
660
|
+
flexGrow : 0,
|
|
661
|
+
alignSelf : 'center',
|
|
662
|
+
justifyContent : 'flex-end'
|
|
663
|
+
},
|
|
664
|
+
w100 : {
|
|
665
|
+
width : '100%'
|
|
666
|
+
},
|
|
667
|
+
AdornmentContainer : {
|
|
668
|
+
alignSelf : 'center',
|
|
669
|
+
alignItems : 'center',
|
|
670
|
+
justifyContent : 'center',
|
|
671
|
+
flexDirection : 'row',
|
|
672
|
+
margin : 0,
|
|
673
|
+
padding : 0,
|
|
674
|
+
},
|
|
675
|
+
inputShadowMode: {
|
|
676
|
+
paddingHorizontal : 0,
|
|
677
|
+
marginRight : 10,
|
|
678
|
+
minHeight : 37,
|
|
679
|
+
marginHorizontal : 0,
|
|
680
|
+
marginVertical:0,
|
|
681
|
+
paddingVertical:0,
|
|
682
|
+
},
|
|
683
|
+
inputNormalMode : {
|
|
684
|
+
paddingHorizontal : 10,
|
|
685
|
+
minHeight : 37,
|
|
686
|
+
marginHorizontal : 0,
|
|
687
|
+
marginVertical:0,
|
|
688
|
+
paddingVertical:0,
|
|
689
|
+
},
|
|
690
|
+
})
|
|
691
|
+
|
|
692
|
+
TextFieldComponent.propTypes = {
|
|
693
|
+
...defaultObj(TextInput.propTypes),
|
|
694
|
+
children : PropTypes.oneOfType([
|
|
695
|
+
PropTypes.node,
|
|
696
|
+
PropTypes.func,
|
|
697
|
+
]),
|
|
698
|
+
useReadOnlyOpacity : PropTypes.bool,
|
|
699
|
+
selectFieldToCopy : PropTypes.bool,
|
|
700
|
+
enableCopy : PropTypes.bool, //si l' on pourra copier le contenu du champ textuel
|
|
701
|
+
fieldToCopy : PropTypes.string, /// la valeur à copier : displayValue, value, parsedValue
|
|
702
|
+
//la fonction permettant de formatter la valeur, pour les valeurs formattables
|
|
703
|
+
formatValue : PropTypes.oneOfType([
|
|
704
|
+
PropTypes.func,
|
|
705
|
+
PropTypes.bool,///si booléan alors la valeur ne pourra pas être formattable;
|
|
706
|
+
]),
|
|
707
|
+
format : PropTypes.oneOfType([
|
|
708
|
+
PropTypes.string,
|
|
709
|
+
PropTypes.func,
|
|
710
|
+
]),
|
|
711
|
+
left : PropTypes.oneOfType([
|
|
712
|
+
PropTypes.func,
|
|
713
|
+
PropTypes.node,
|
|
714
|
+
]),
|
|
715
|
+
right : PropTypes.oneOfType([
|
|
716
|
+
PropTypes.func,
|
|
717
|
+
PropTypes.node,
|
|
718
|
+
]),
|
|
719
|
+
autoHeight : PropTypes.bool,///si la taille sera automatique
|
|
720
|
+
alwaysUseLabel : PropTypes.bool,//si l'on utilisera toujours le label quel qu'en soit le cas
|
|
721
|
+
containerProps : PropTypes.object,//les props du container au composant TextField
|
|
722
|
+
contentContainerProps : PropTypes.object,///les props du container parent direct au text input
|
|
723
|
+
contentProps : PropTypes.object,///les props du container immédia à l'input
|
|
724
|
+
rightContainerProps : PropTypes.object,
|
|
725
|
+
leftContainerProps : PropTypes.object,
|
|
726
|
+
defaultValue : PropTypes.oneOfType([
|
|
727
|
+
PropTypes.number,
|
|
728
|
+
PropTypes.string,
|
|
729
|
+
]),
|
|
730
|
+
upper : PropTypes.bool,
|
|
731
|
+
upperCase : PropTypes.bool,
|
|
732
|
+
lower : PropTypes.bool,
|
|
733
|
+
lowerCase : PropTypes.bool,
|
|
734
|
+
outlined : PropTypes.bool,//si le textField prendra en compte le outline
|
|
735
|
+
roundness : PropTypes.number,///l'épaisseur du border radius, lorsque le mode est de type outlined
|
|
736
|
+
usePlaceholderWhenEmpty : PropTypes.bool,//si la valeur du placeholder sera utilée, lorsque la valeur du champ de type formatable est nulle ou égale à la valeur vide
|
|
737
|
+
emptyValue : PropTypes.oneOfType([
|
|
738
|
+
PropTypes.string,
|
|
739
|
+
PropTypes.number,
|
|
740
|
+
]),///la valeur par défaut considérée comme vide ou nulle
|
|
741
|
+
/*** si un contenu de droite sera affiché, ie, le nombre d'éléments du champ de texte lorsqu'on remplit sera affiché */
|
|
742
|
+
affix : PropTypes.oneOfType([
|
|
743
|
+
PropTypes.bool,
|
|
744
|
+
PropTypes.string,
|
|
745
|
+
]),
|
|
746
|
+
///le style à afficher sur l'affix
|
|
747
|
+
affixStyle : PropTypes.object,
|
|
748
|
+
};
|
|
749
|
+
|