@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,570 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import DateLib from "$lib/date";
|
|
4
|
+
import {isNonNullString,defaultStr,isNullOrEmpty,debounce,uniqid} from "$utils";
|
|
5
|
+
import {regexParser,regexActions,getFilterStateValues} from "./utils";
|
|
6
|
+
import {parseDecimal} from "$ecomponents/TextField";
|
|
7
|
+
import FormDialog from "$ecomponents/Form/FormData/Dialog";
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
import {extendObj} from "$utils";
|
|
10
|
+
import {getFilterComponentProps} from "$ecomponents/Form/FormData/componentsTypes"
|
|
11
|
+
import Menu from "$ecomponents/BottomSheet/Menu";
|
|
12
|
+
import {StyleSheet,View} from "react-native";
|
|
13
|
+
import Icon from "$ecomponents/Icon";
|
|
14
|
+
import React,{Component as AppComponent} from "$react";
|
|
15
|
+
import theme from "$theme";
|
|
16
|
+
import {isMobileMedia} from "$cplatform/dimensions";
|
|
17
|
+
import { ActivityIndicator } from "react-native-paper";
|
|
18
|
+
import { getSessionData,setSessionData } from "./session";
|
|
19
|
+
|
|
20
|
+
const manualRunKey = "manual-run";
|
|
21
|
+
|
|
22
|
+
export * from "./utils";
|
|
23
|
+
|
|
24
|
+
const _actions = {
|
|
25
|
+
'$eq' : 'Egal à',
|
|
26
|
+
'$gt' : 'Supérieur à',
|
|
27
|
+
'$gte' : 'Supérieur ou égal',
|
|
28
|
+
'$lt' : 'Inférieur à',
|
|
29
|
+
'$lte' : 'Inférieur où égal à',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const _inActions = {
|
|
33
|
+
'$in' :'Est inc ds la liste', //Array of JSON values The document field must exist in the list provided.
|
|
34
|
+
'$nin' : 'N\'est pas inc ds la liste', //Array of JSON values The document field not must exist in the list provided.
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const _operators = {
|
|
39
|
+
'$and' : 'Et', //Array Matches if all the selectors in the array match.
|
|
40
|
+
'$or' : 'Ou', //Array Matches if any of the selectors in the array match. All selectors must use the same index.
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default class Filter extends AppComponent {
|
|
44
|
+
constructor(props) {
|
|
45
|
+
super(props);
|
|
46
|
+
this.clearText = this.clearText.bind(this);
|
|
47
|
+
this.fireValueChanged = this.fireValueChanged.bind(this);
|
|
48
|
+
const {Component,props:filterProps,type} = getFilterComponentProps(props);
|
|
49
|
+
Object.defineProperties(this,{
|
|
50
|
+
Component : {
|
|
51
|
+
value : Component,
|
|
52
|
+
override:false,writable:false
|
|
53
|
+
},
|
|
54
|
+
filterProps : {value:filterProps},
|
|
55
|
+
type : {
|
|
56
|
+
value : type, override : false, writable : false
|
|
57
|
+
},
|
|
58
|
+
searchFilter : {value : React.createRef(null),},
|
|
59
|
+
name : {value : defaultStr(this.props.name,uniqid("no-name-filter"))}
|
|
60
|
+
})
|
|
61
|
+
this.filterValidationTimeout = 0;
|
|
62
|
+
switch(this.type){
|
|
63
|
+
case 'select' :
|
|
64
|
+
break;
|
|
65
|
+
case 'date':
|
|
66
|
+
break;
|
|
67
|
+
case 'time':
|
|
68
|
+
break;
|
|
69
|
+
case 'switch' :
|
|
70
|
+
break;
|
|
71
|
+
case 'checkbox':
|
|
72
|
+
break;
|
|
73
|
+
default :
|
|
74
|
+
this.filterValidationTimeout = defaultNumber(this.props.timeout,1500);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
Object.defineProperties(this,{
|
|
78
|
+
fireFilterSearch : {
|
|
79
|
+
value : this.filterValidationTimeout ? debounce(this.fireValueChanged.bind(this),this.filterValidationTimeout) : this.fireValueChanged.bind(this),
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
extendObj(this.state,{
|
|
83
|
+
...this.initFiltersOp(),
|
|
84
|
+
manualRun : false,
|
|
85
|
+
});
|
|
86
|
+
this.autobind();
|
|
87
|
+
}
|
|
88
|
+
componentWillUnmount(){
|
|
89
|
+
super.componentWillUnmount();
|
|
90
|
+
}
|
|
91
|
+
toggleIgnoreCase(){
|
|
92
|
+
this.setState({ignoreCase:!this.state.ignoreCase},()=>{
|
|
93
|
+
if(!this.willRunManually()){
|
|
94
|
+
this.fireValueChanged();
|
|
95
|
+
};
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
willRunManually (){
|
|
99
|
+
return this.state.manualRun;
|
|
100
|
+
return getSessionData(manualRunKey) ? true : false
|
|
101
|
+
}
|
|
102
|
+
toggleManualRun(){
|
|
103
|
+
//setSessionData(manualRunKey,this.willRunManually()?0:1);
|
|
104
|
+
this.setState({manualRun:!this.state.manualRun},()=>{
|
|
105
|
+
if(!this.willRunManually()){
|
|
106
|
+
this.fireValueChanged(true);
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
getStateValues(){
|
|
111
|
+
return getFilterStateValues(this.state);
|
|
112
|
+
}
|
|
113
|
+
callOnValidate(arg){
|
|
114
|
+
arg = isObj(arg)? arg : {};
|
|
115
|
+
if(typeof this.props.onValidate ==='function'){
|
|
116
|
+
this.props.onValidate({...this.getStateValues(),field:this.props.name,...arg})
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
onFilterValidate(arg){
|
|
120
|
+
arg = defaultObj(arg);
|
|
121
|
+
if(JSON.stringify(this.state.defaultValue) === JSON.stringify(arg.value)){
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
this.setState({prevDefaultValue:this.state.defaultValue,defaultValue:arg.value},()=>{
|
|
125
|
+
this.callOnValidate(arg);
|
|
126
|
+
if(!isNumber(this.filterValidationTimeout)){
|
|
127
|
+
this.filterValidationTimeout = 0;
|
|
128
|
+
}
|
|
129
|
+
this.fireFilterSearch(false);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
initFiltersOp(type){
|
|
133
|
+
type = defaultStr(type,this.type).toLowerCase();
|
|
134
|
+
let operators = {..._operators};
|
|
135
|
+
let actions = {..._actions};
|
|
136
|
+
if(this.props.orOperator === false){
|
|
137
|
+
delete operators.$or;
|
|
138
|
+
}
|
|
139
|
+
if(this.props.andOperator === false){
|
|
140
|
+
delete operators.$and;
|
|
141
|
+
}
|
|
142
|
+
let action = this.props.action;
|
|
143
|
+
let operator = this.props.operator;
|
|
144
|
+
let ignoreCase = this.props.ignoreCase;
|
|
145
|
+
ignoreCase = defaultVal(ignoreCase,true);
|
|
146
|
+
let isTextFilter = false;
|
|
147
|
+
let defaultAct = '$eq';
|
|
148
|
+
if(type =="checkbox" || type == 'switch'){
|
|
149
|
+
action = '$eq';
|
|
150
|
+
} else if(type == 'select'){
|
|
151
|
+
actions = _inActions;
|
|
152
|
+
defaultAct = "$in";
|
|
153
|
+
} else if(type == 'date') {
|
|
154
|
+
actions = {$today:"Aujourd'hui",$prevWeek:"Semaine passée",$week:'Cette semaine',$month:'Ce mois',$period:"Période", ...actions}
|
|
155
|
+
} else if(type !== 'date2time' && type !== 'time' && type !== 'number' && type !== 'decimal'){
|
|
156
|
+
actions = regexActions;
|
|
157
|
+
defaultAct = '$regexcontains';
|
|
158
|
+
isTextFilter = true;
|
|
159
|
+
}
|
|
160
|
+
if(!action){
|
|
161
|
+
action = defaultAct;
|
|
162
|
+
}
|
|
163
|
+
operator = defaultVal(operator,"$and");
|
|
164
|
+
return {actions,action,ignoreCase,operator,operators,manualRun:defaultBool(this.props.manualRun,false),defaultValue:defaultVal(this.props.defaultValue),isTextFilter};
|
|
165
|
+
}
|
|
166
|
+
fireValueChanged (forceRun){
|
|
167
|
+
if(this.willRunManually() && !forceRun) return;
|
|
168
|
+
let {defaultValue:value,prevDefaultValue,action,ignoreCase,operator} = this.state;
|
|
169
|
+
const force = forceRun ===true ? true : false;
|
|
170
|
+
if(!isObjOrArray(value) && (isNullOrEmpty(value,true) || value ==='undefined') ){
|
|
171
|
+
value = undefined;
|
|
172
|
+
}
|
|
173
|
+
let originalValue = value;
|
|
174
|
+
const type = defaultStr(this.props.type).toLowerCase().trim();
|
|
175
|
+
value = parseDecimal(value,type);
|
|
176
|
+
if(action =="$today"){
|
|
177
|
+
force = true;
|
|
178
|
+
}
|
|
179
|
+
let prev = JSON.stringify(defaultObj(this.previousObj)),//{value:this.previousValue,operator:this.previousOperator,action:this.previousAction}
|
|
180
|
+
current = {value,operator,action,ignoreCase};
|
|
181
|
+
let tV = isArray(value) && value.length <= 0 ? undefined : value;
|
|
182
|
+
let isFilterInitialized = this.props.dynamicRendered || this.isFilterInitialized;
|
|
183
|
+
if(prev == "{}" && (isNullOrEmpty(tV) || value === 0) && (!isFilterInitialized) && (force !== true)) {
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
if(prev == JSON.stringify(current) && (force !== true)){
|
|
187
|
+
return this;
|
|
188
|
+
}
|
|
189
|
+
this.isFilterInitialized = true;
|
|
190
|
+
this.previousObj = current;
|
|
191
|
+
if(isFunction(this.props.onChange)){
|
|
192
|
+
let selector = {};
|
|
193
|
+
selector[this.props.field] = action;
|
|
194
|
+
let originAction = action;
|
|
195
|
+
if(isNonNullString(action)){
|
|
196
|
+
action = action.toLowerCase().trim();
|
|
197
|
+
if(action =="$today"){
|
|
198
|
+
action = "$eq";
|
|
199
|
+
} else if(action.startsWith("$") && (action.contains("week") || action.contains("month"))){
|
|
200
|
+
action = "$period";
|
|
201
|
+
}
|
|
202
|
+
if(action.startsWith("$regex")){
|
|
203
|
+
let f = regexParser[action.ltrim("$regex")];
|
|
204
|
+
if(isFunction(f)){
|
|
205
|
+
value = f(value);
|
|
206
|
+
}
|
|
207
|
+
if(isNonNullString(value) && this.state.ignoreCase){
|
|
208
|
+
value = RegExp(value.ltrim("/").rtrim("/"),'i');
|
|
209
|
+
}
|
|
210
|
+
action = "$regex";
|
|
211
|
+
}
|
|
212
|
+
if(operator == "$nin"){
|
|
213
|
+
if(isArray(value)){
|
|
214
|
+
value.push("");
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
this.props.onChange({...this.getStateValues(),value,originValue:originalValue,originalValue,field:this.props.field,action,operator,selector,originAction,context:this});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
componentDidUpdate (){
|
|
222
|
+
super.componentDidUpdate();
|
|
223
|
+
this.canBindEvent = true;
|
|
224
|
+
}
|
|
225
|
+
setIgnoreCase(ignoreCase){
|
|
226
|
+
if(!(this.searchFilter.current) ) return;
|
|
227
|
+
if(ignoreCase === this.state.ignoreCase) return;
|
|
228
|
+
this.setState({ignoreCase},()=>{
|
|
229
|
+
this.fireValueChanged();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
runAction ({value,action}){
|
|
233
|
+
this.setState({action,defaultValue:value},()=>{
|
|
234
|
+
this.callOnValidate();
|
|
235
|
+
if(isFunction(this.searchFilter.current.getValue) && this.canBindEvent){
|
|
236
|
+
this.fireValueChanged();
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
showPeriodSelector (success){
|
|
241
|
+
let split = defaultStr(this.props.defaultValue).split("=>");
|
|
242
|
+
let start = new Date().toFormat("yyyy-mm-dd"),
|
|
243
|
+
end = start;
|
|
244
|
+
if(DateLib.isValidSQLDate(split[0])){
|
|
245
|
+
start = split[0];
|
|
246
|
+
}
|
|
247
|
+
if(DateLib.isValidSQLDate(split[1])){
|
|
248
|
+
end = split[1];
|
|
249
|
+
}
|
|
250
|
+
let fContext = undefined;
|
|
251
|
+
mountDialog(<FormDialog
|
|
252
|
+
visible
|
|
253
|
+
key = {_uniqid("period-filter-date")}
|
|
254
|
+
fields = {{
|
|
255
|
+
start : {type:'date',text:'Du',defaultValue:start},
|
|
256
|
+
end : {type:'date',text:'Au',defaultValue:end}
|
|
257
|
+
}}
|
|
258
|
+
title = {"Définir une période ["+defaultStr(this.props.label,this.props.text)+"]"}
|
|
259
|
+
no = {{
|
|
260
|
+
text : 'Annuler',
|
|
261
|
+
icon : 'cancel'
|
|
262
|
+
}}
|
|
263
|
+
yes = {{
|
|
264
|
+
text : 'Définir',
|
|
265
|
+
icon : "check"
|
|
266
|
+
}}
|
|
267
|
+
onSuccess = {({data})=>{
|
|
268
|
+
if(isFunction(success)){
|
|
269
|
+
success(data.start+"=>"+data.end);
|
|
270
|
+
}
|
|
271
|
+
return true;
|
|
272
|
+
}}
|
|
273
|
+
/>)
|
|
274
|
+
}
|
|
275
|
+
setAction(action,text){
|
|
276
|
+
if(!(this.searchFilter.current)) return;
|
|
277
|
+
if(action === this.state.action && action !="$period" && action !== "$today") return;
|
|
278
|
+
let value = this.state.defaultValue;
|
|
279
|
+
let act = defaultStr(action).toLowerCase();
|
|
280
|
+
if(action == '$period'){
|
|
281
|
+
this.showPeriodSelector((d)=>{
|
|
282
|
+
this.runAction({value:d,action});
|
|
283
|
+
})
|
|
284
|
+
} else if(action =="$today"){
|
|
285
|
+
return this.runAction({value:new Date().toSQL(),action})
|
|
286
|
+
} else if(act.startsWith("$") && (act.contains("week") || act.contains("month"))){
|
|
287
|
+
let diff = undefined;
|
|
288
|
+
switch (action){
|
|
289
|
+
case "$month":
|
|
290
|
+
diff = DateLib.currentMonthDaysLimits();
|
|
291
|
+
break;
|
|
292
|
+
case "$week":
|
|
293
|
+
diff = DateLib.currentWeekDaysLimits()
|
|
294
|
+
break;
|
|
295
|
+
case "$prevWeek":
|
|
296
|
+
diff = DateLib.previousWeekDaysLimits()
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
if(diff){
|
|
300
|
+
let value = diff.first.toFormat(DateLib.SQLDateFormat) +"=>"+diff.last.toFormat(DateLib.SQLDateFormat);
|
|
301
|
+
this.runAction({value,action})
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
this.runAction({value,action});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
setOperator(op,text){
|
|
308
|
+
if(this.state.operator === op) return;
|
|
309
|
+
this.setState({operator:op},()=>{
|
|
310
|
+
this.fireValueChanged();
|
|
311
|
+
this.callOnValidate();
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
clearText(cb){
|
|
315
|
+
this.setState({
|
|
316
|
+
emptyTextIcon : false,
|
|
317
|
+
defaultValue : undefined,
|
|
318
|
+
},()=>{
|
|
319
|
+
this.callOnValidate();
|
|
320
|
+
if(isFunction(cb)){
|
|
321
|
+
cb();
|
|
322
|
+
}
|
|
323
|
+
this.fireValueChanged();
|
|
324
|
+
})
|
|
325
|
+
}
|
|
326
|
+
clearFilter(event){
|
|
327
|
+
this.setState({defaultValue:undefined,prevDefaultValue:this.state.defaultValue},()=>{
|
|
328
|
+
this.callOnValidate();
|
|
329
|
+
this.fireValueChanged(true);
|
|
330
|
+
let {onClearFilter,onResetFilter} = this.props;
|
|
331
|
+
onClearFilter = defaultVal(onClearFilter,onResetFilter);
|
|
332
|
+
if(isFunction(onClearFilter)){
|
|
333
|
+
onClearFilter.call(this,{name:this.name,field:this.name,type:this.type,context:this,props:this.props});
|
|
334
|
+
}
|
|
335
|
+
})
|
|
336
|
+
}
|
|
337
|
+
render (){
|
|
338
|
+
let {
|
|
339
|
+
filter,
|
|
340
|
+
label,
|
|
341
|
+
withLabel,
|
|
342
|
+
text,
|
|
343
|
+
tooltip,
|
|
344
|
+
dynamicRendered,
|
|
345
|
+
tooltipLabel,
|
|
346
|
+
andOperator,
|
|
347
|
+
searchIcon,
|
|
348
|
+
field,
|
|
349
|
+
style,
|
|
350
|
+
anchorProps,
|
|
351
|
+
mode,
|
|
352
|
+
inputProps,
|
|
353
|
+
moreOptions,
|
|
354
|
+
isLoading,
|
|
355
|
+
searchIconTooltip,
|
|
356
|
+
withBottomSheet,
|
|
357
|
+
render,
|
|
358
|
+
ref,
|
|
359
|
+
data,
|
|
360
|
+
testID,
|
|
361
|
+
...rest
|
|
362
|
+
} = {...this.props,...this.filterProps};
|
|
363
|
+
const type = this.type;
|
|
364
|
+
if(filter === false || ((andOperator === false && orOperator === false) || type ==='image')) return null;
|
|
365
|
+
label = defaultStr(label,text,tooltip,tooltipLabel,field)
|
|
366
|
+
const {defaultValue,actions,action,operator,operators} = this.state;
|
|
367
|
+
searchIcon = React.isValidElement(searchIcon)?searchIcon : searchIcon ? <Icon title={searchIconTooltip} icon={searchIcon}/> : null;
|
|
368
|
+
let hasFilterVal = !isNullOrEmpty(defaultValue,true);
|
|
369
|
+
rest.label = label;
|
|
370
|
+
const activeColor = theme.colors.primaryOnSurface;
|
|
371
|
+
const activeStyle = {color:activeColor};
|
|
372
|
+
const manualRun = this.willRunManually();
|
|
373
|
+
testID = defaultStr(testID,'RN_FilterComponent_'+this.name);
|
|
374
|
+
const options = {
|
|
375
|
+
go : {
|
|
376
|
+
text : 'Rechercher (Go)',
|
|
377
|
+
icon : 'magnify',
|
|
378
|
+
onPress : ()=>{
|
|
379
|
+
this.fireValueChanged(true);
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
divider:{divider:true},
|
|
383
|
+
manual : {
|
|
384
|
+
text : 'Recherche manuelle',
|
|
385
|
+
icon : manualRun ? 'check': null,
|
|
386
|
+
style : manualRun? activeStyle : null,
|
|
387
|
+
onPress : this.toggleManualRun.bind(this)
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
if(this.state.isTextFilter){
|
|
391
|
+
options.ignoreCase = {
|
|
392
|
+
text : 'Ignorer la casse',
|
|
393
|
+
icon : this.state.ignoreCase ? 'check':null,
|
|
394
|
+
style : this.state.ignoreCase ? activeStyle : null,
|
|
395
|
+
onPress : this.toggleIgnoreCase.bind(this),
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if(typeof moreOptions ==='function'){
|
|
399
|
+
moreOptions = moreOptions({context:this,type:this.type,props:rest});
|
|
400
|
+
}
|
|
401
|
+
let hasOptions = false;
|
|
402
|
+
if(typeof moreOptions =='object' && moreOptions){
|
|
403
|
+
Object.map(moreOptions,(o,i)=>{
|
|
404
|
+
if(!isObj(o)) return null;
|
|
405
|
+
const label = defaultStr(o.label,o.text);
|
|
406
|
+
if(label){
|
|
407
|
+
if(!hasOptions){
|
|
408
|
+
hasOptions = true;
|
|
409
|
+
options.moreoptsDivieer = {divider:true};
|
|
410
|
+
}
|
|
411
|
+
options["more-"+i] = o;
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
}
|
|
415
|
+
rest.name = this.name;
|
|
416
|
+
rest.validate = false;
|
|
417
|
+
rest.formName = uniqid("form-name-field-select");
|
|
418
|
+
rest.renderfilter = "true"; //pour préciser que c'est un filtre de données
|
|
419
|
+
if(isFunction(filter)){
|
|
420
|
+
rest.filter = filter;
|
|
421
|
+
}
|
|
422
|
+
rest.defaultValue = defaultValue;
|
|
423
|
+
rest.disabled = rest.readOnly = rest.affix = false;
|
|
424
|
+
rest.editable = true;
|
|
425
|
+
rest.style = [style];
|
|
426
|
+
rest.type = type;
|
|
427
|
+
const isMob = isMobileMedia() || withBottomSheet;
|
|
428
|
+
isLoading = !!isLoading;
|
|
429
|
+
rest.pointerEvents = !isLoading ? "auto" : "none";
|
|
430
|
+
if(withLabel ===false){
|
|
431
|
+
delete rest.label;
|
|
432
|
+
delete rest.text;
|
|
433
|
+
delete rest.title;
|
|
434
|
+
}
|
|
435
|
+
anchorProps = defaultObj(anchorProps);
|
|
436
|
+
rest.anchorProps = anchorProps;
|
|
437
|
+
rest.pointerEvents = "auto";
|
|
438
|
+
rest.right = isLoading ? <ActivityIndicator color={theme.colors.secondaryOnSurface} animating/> :<>
|
|
439
|
+
<Menu
|
|
440
|
+
testID = {testID+"_Menu"}
|
|
441
|
+
sheet = {withBottomSheet}
|
|
442
|
+
anchor = {(props)=><Icon {...props} {...anchorProps} primary={hasFilterVal} icon={hasFilterVal?'filter-menu':'filter-plus'}/>}
|
|
443
|
+
items = {[
|
|
444
|
+
{
|
|
445
|
+
text : !isMob ? 'Options' : ("Options de filtre ["+label+"]"),
|
|
446
|
+
icon : 'cog',
|
|
447
|
+
items : options,
|
|
448
|
+
},
|
|
449
|
+
{divider:true},
|
|
450
|
+
...[hasFilterVal /*&& type !== 'select'*/?
|
|
451
|
+
{
|
|
452
|
+
text : 'Effacer le filtre',
|
|
453
|
+
icon : 'filter-remove',
|
|
454
|
+
onPress : this.clearFilter.bind(this),
|
|
455
|
+
}
|
|
456
|
+
:null],
|
|
457
|
+
...[isMob?{
|
|
458
|
+
text : 'Opérateurs',
|
|
459
|
+
closeOnPress : false,
|
|
460
|
+
style : [styles.bold,styles.noVerticalPadding],
|
|
461
|
+
}:null],
|
|
462
|
+
...Object.mapToArray(operators,(x,i)=>{
|
|
463
|
+
return {
|
|
464
|
+
text : x+' '+ (label?label.toLowerCase():'')+' ',
|
|
465
|
+
icon : i === operator ? 'check' : null,
|
|
466
|
+
style : i === operator ? activeStyle : null,
|
|
467
|
+
onPress : (e)=>{React.stopEventPropagation(e);this.setOperator(i,x);return false;},
|
|
468
|
+
}
|
|
469
|
+
}),
|
|
470
|
+
{divider:true},
|
|
471
|
+
...[isMob?{
|
|
472
|
+
text : 'Actions',
|
|
473
|
+
closeOnPress : false,
|
|
474
|
+
style : [styles.bold,styles.noVerticalPadding],
|
|
475
|
+
}:null],
|
|
476
|
+
...Object.mapToArray(actions,(x,j)=>{
|
|
477
|
+
let checked = j === action?true : false;
|
|
478
|
+
if(checked && (isNumber(defaultValue) || isNonNullString(defaultValue))) {
|
|
479
|
+
let hasS = false;
|
|
480
|
+
let act = defaultStr(action).toLowerCase();
|
|
481
|
+
if(act =="$today"){
|
|
482
|
+
|
|
483
|
+
} else if((action =="$period" || (act.startsWith("$") && (act.contains("week") || act.contains("month"))))){
|
|
484
|
+
let sp = defaultValue.split("=>");
|
|
485
|
+
if(DateLib.isValidSQLDate(sp[0]) && DateLib.isValidSQLDate(sp[1])){
|
|
486
|
+
x = "Du "+defaultStr(DateLib.format(sp[0],DateLib.defaultDateFormat),sp[0])+" au "+defaultStr(DateLib.format(sp[1],DateLib.defaultDateFormat),sp[1]);
|
|
487
|
+
hasS = true;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if(!hasS){
|
|
492
|
+
x = x+" <"+defaultValue+">"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return {
|
|
496
|
+
label : x,
|
|
497
|
+
icon : checked ? 'check' : null,
|
|
498
|
+
style : checked ? activeStyle : null,
|
|
499
|
+
onPress : (e)=>{React.stopEventPropagation(e);this.setAction(j,x);return false}}
|
|
500
|
+
}
|
|
501
|
+
)
|
|
502
|
+
]}
|
|
503
|
+
/>
|
|
504
|
+
</>
|
|
505
|
+
rest.containerProps = defaultObj(this.props.containerProps,rest.containerProps);
|
|
506
|
+
rest.onValidate = this.onFilterValidate.bind(this);
|
|
507
|
+
const Component = this.Component;
|
|
508
|
+
return <Component
|
|
509
|
+
{...rest}
|
|
510
|
+
name = {this.name}
|
|
511
|
+
testID = {testID}
|
|
512
|
+
ref = {React.mergeRefs(this.searchFilter,ref)}
|
|
513
|
+
/>
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const styles = StyleSheet.create({
|
|
518
|
+
noVerticalPadding : {
|
|
519
|
+
//paddingVertical:0,
|
|
520
|
+
//marginVertical:0,
|
|
521
|
+
paddingTop : 5,
|
|
522
|
+
marginHorizontal : 10,
|
|
523
|
+
//height : 45,
|
|
524
|
+
},
|
|
525
|
+
bold : {
|
|
526
|
+
fontWeight :'bold'
|
|
527
|
+
}
|
|
528
|
+
})
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
/***** Les filtres prenent en paramètre :
|
|
532
|
+
*
|
|
533
|
+
* le nom d'une colonne,
|
|
534
|
+
* un opérateur et une action
|
|
535
|
+
*/
|
|
536
|
+
|
|
537
|
+
/**** lors du rendu d'un composant de type Fild, si la valeur renderFilter est définie alors l'utilisateur doit prendre en compte qu'il
|
|
538
|
+
* s'agit du rendu d'un champ de filtre
|
|
539
|
+
*/
|
|
540
|
+
|
|
541
|
+
Filter.propTypes = {
|
|
542
|
+
withLabel : PropTypes.bool,//si le rendu des filtres prendra en compte le label
|
|
543
|
+
moreOptions : PropTypes.oneOfType([
|
|
544
|
+
PropTypes.object,
|
|
545
|
+
PropTypes.array,
|
|
546
|
+
PropTypes.func
|
|
547
|
+
]),
|
|
548
|
+
dynamicRendered : PropTypes.bool,//si le filtre est rendu dynamiquement
|
|
549
|
+
isLoading : PropTypes.bool,
|
|
550
|
+
/*** si l'opérateur or sera accepté */
|
|
551
|
+
orOperator : PropTypes.bool,
|
|
552
|
+
///si l'opérateur and sera accepté
|
|
553
|
+
andOperator : PropTypes.bool,
|
|
554
|
+
/*** spécifie si la casse sera ignorée où non */
|
|
555
|
+
ignoreCase : PropTypes.bool,
|
|
556
|
+
operator : PropTypes.string, //l'opérateur par défaut : and, or,
|
|
557
|
+
action : PropTypes.oneOfType([PropTypes.string,PropTypes.bool]), //l'action par défaut : supérieur, supérieur où égal, est dans, ...
|
|
558
|
+
searchIcon : PropTypes.oneOfType([PropTypes.string,PropTypes.node]),
|
|
559
|
+
/*** l'info bulle de l'icone de recherche */
|
|
560
|
+
searchIconTooltip : PropTypes.string,
|
|
561
|
+
field : PropTypes.string.isRequired,
|
|
562
|
+
/**
|
|
563
|
+
* La foncton de rappel appelée en cas de mise à jour du champ
|
|
564
|
+
* onChange(value,{action,operator,field,value,selector})
|
|
565
|
+
*/
|
|
566
|
+
onChange : PropTypes.func,
|
|
567
|
+
/**** lorsque le contenu du filtre est réinitialisé */
|
|
568
|
+
onClearFilter : PropTypes.func,
|
|
569
|
+
onResetFilter : PropTypes.func, //idem à onClearFilter
|
|
570
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import session from "$session";
|
|
2
|
+
import {getLoggedUserCode} from "$cauth";
|
|
3
|
+
const sKey = "FILTER-ITEM-KEY";
|
|
4
|
+
const sessionKey = ()=> defaultStr(getLoggedUserCode())+"-"+sKey;
|
|
5
|
+
import {defaultObj,defaultStr,isNonNullString} from "$utils";
|
|
6
|
+
|
|
7
|
+
export const getSessionData = (key)=>{
|
|
8
|
+
const data = defaultObj(session.get(sessionKey()));
|
|
9
|
+
return isNonNullString(key)? data [key] : data;
|
|
10
|
+
}
|
|
11
|
+
export const setSessionData = (key,value)=>{
|
|
12
|
+
const data = getSessionData();
|
|
13
|
+
if(isNonNullString(key)){
|
|
14
|
+
data[key] = value;
|
|
15
|
+
return session.set(sessionKey(),data);
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|