@hipay/hipay-material-ui 1.0.0-beta.28 → 1.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/HiCheckbox/HiCheckbox.js +3 -6
- package/HiChip/HiChip.js +9 -84
- package/HiChip/HiChipSwitch.js +0 -6
- package/HiColoredLabel/HiColoredLabel.js +5 -11
- package/HiDatePicker/HiDatePicker.js +12 -24
- package/HiDatePicker/HiDateRangePicker.js +69 -152
- package/HiDatePicker/HiDateRangeSelector.js +30 -85
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +1 -3
- package/HiDatePicker/Overlays/Overlay.js +5 -23
- package/HiDatePicker/stylesheet.js +0 -14
- package/HiForm/HiFormControl.js +30 -28
- package/HiForm/HiInput.js +21 -49
- package/HiForm/HiPasswordField.js +3 -8
- package/HiForm/HiSearchField.js +3 -9
- package/HiForm/index.js +0 -36
- package/HiLoader/HiLoader.js +9 -16
- package/HiPins/HiPins.js +5 -6
- package/HiSelect/HiSelect.js +344 -591
- package/HiSelect/HiSelectField.js +6 -8
- package/HiSelect/HiSuggestSelect.js +50 -77
- package/HiSelect/HiSuggestSelectField.js +80 -88
- package/HiSelect/SelectInput.js +37 -97
- package/HiSelectableList/HiSelectableList.js +49 -57
- package/HiSelectableList/HiSelectableListItem.js +94 -145
- package/HiTable/BodyCellBuilder.js +112 -144
- package/HiTable/BodyCells/CellAccount.js +21 -15
- package/HiTable/BodyCells/CellAccountNumber.js +220 -0
- package/HiTable/BodyCells/CellAddress.js +53 -15
- package/HiTable/BodyCells/CellCountry.js +43 -23
- package/HiTable/BodyCells/CellDate.js +64 -59
- package/HiTable/BodyCells/CellIcon.js +45 -46
- package/HiTable/BodyCells/CellImage.js +44 -54
- package/HiTable/BodyCells/CellLayout.js +24 -60
- package/HiTable/BodyCells/CellNumeric.js +28 -22
- package/HiTable/BodyCells/CellRate.js +6 -15
- package/HiTable/BodyCells/CellSentinel.js +68 -58
- package/HiTable/BodyCells/CellStatus.js +25 -30
- package/HiTable/BodyCells/CellText.js +46 -78
- package/HiTable/BodyCells/CellThirdPartySecurity.js +35 -53
- package/HiTable/BodyCells/index.js +9 -0
- package/HiTable/BodyRow.js +82 -133
- package/HiTable/ChildRow.js +9 -3
- package/HiTable/ColumnFilter.js +20 -30
- package/HiTable/HeaderCell.js +76 -97
- package/HiTable/HiStickyRow.js +16 -27
- package/HiTable/HiTable.js +111 -141
- package/HiTable/HiTableBody.js +62 -177
- package/HiTable/HiTableContextMenu.js +19 -39
- package/HiTable/HiTableFooterScroll.js +1 -1
- package/HiTable/HiTableHead.js +19 -42
- package/HiTable/OrderColumns.js +2 -6
- package/HiTable/constants.js +2 -2
- package/HiTopBar/HiTopBar.js +25 -39
- package/README.md +6 -72
- package/es/HiCheckbox/HiCheckbox.js +3 -6
- package/es/HiChip/HiChip.js +10 -96
- package/es/HiChip/HiChipSwitch.js +0 -6
- package/es/HiColoredLabel/HiColoredLabel.js +6 -11
- package/es/HiDatePicker/HiDatePicker.js +12 -19
- package/es/HiDatePicker/HiDateRangePicker.js +68 -140
- package/es/HiDatePicker/HiDateRangeSelector.js +31 -80
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +1 -3
- package/es/HiDatePicker/Overlays/Overlay.js +5 -19
- package/es/HiDatePicker/stylesheet.js +0 -14
- package/es/HiForm/HiFormControl.js +18 -24
- package/es/HiForm/HiInput.js +20 -44
- package/es/HiForm/HiPasswordField.js +3 -8
- package/es/HiForm/HiSearchField.js +3 -4
- package/es/HiForm/index.js +1 -5
- package/es/HiLoader/HiLoader.js +6 -10
- package/es/HiPins/HiPins.js +5 -4
- package/es/HiSelect/HiSelect.js +313 -547
- package/es/HiSelect/HiSelectField.js +7 -9
- package/es/HiSelect/HiSuggestSelect.js +42 -73
- package/es/HiSelect/HiSuggestSelectField.js +69 -77
- package/es/HiSelect/SelectInput.js +37 -94
- package/es/HiSelectableList/HiSelectableList.js +50 -58
- package/es/HiSelectableList/HiSelectableListItem.js +94 -137
- package/es/HiTable/BodyCellBuilder.js +113 -132
- package/es/HiTable/BodyCells/CellAccount.js +11 -9
- package/es/HiTable/BodyCells/CellAccountNumber.js +166 -0
- package/es/HiTable/BodyCells/CellAddress.js +45 -9
- package/es/HiTable/BodyCells/CellCountry.js +38 -16
- package/es/HiTable/BodyCells/CellDate.js +49 -38
- package/es/HiTable/BodyCells/CellIcon.js +32 -32
- package/es/HiTable/BodyCells/CellImage.js +43 -47
- package/es/HiTable/BodyCells/CellLayout.js +27 -60
- package/es/HiTable/BodyCells/CellNumeric.js +19 -15
- package/es/HiTable/BodyCells/CellRate.js +4 -9
- package/es/HiTable/BodyCells/CellSentinel.js +51 -41
- package/es/HiTable/BodyCells/CellStatus.js +20 -24
- package/es/HiTable/BodyCells/CellText.js +25 -52
- package/es/HiTable/BodyCells/CellThirdPartySecurity.js +26 -43
- package/es/HiTable/BodyCells/index.js +2 -0
- package/es/HiTable/BodyRow.js +77 -125
- package/es/HiTable/ChildRow.js +10 -3
- package/es/HiTable/ColumnFilter.js +14 -17
- package/es/HiTable/HeaderCell.js +82 -100
- package/es/HiTable/HiStickyRow.js +14 -21
- package/es/HiTable/HiTable.js +84 -114
- package/es/HiTable/HiTableBody.js +57 -149
- package/es/HiTable/HiTableContextMenu.js +19 -36
- package/es/HiTable/HiTableFooterScroll.js +1 -1
- package/es/HiTable/HiTableHead.js +18 -33
- package/es/HiTable/OrderColumns.js +2 -6
- package/es/HiTable/constants.js +7 -7
- package/es/HiTopBar/HiTopBar.js +22 -41
- package/es/styles/createHiMuiTheme.js +0 -13
- package/es/svg-icons/Cancel.js +0 -2
- package/es/svg-icons/index.js +1 -2
- package/es/utils/HiIconBuilder.js +6 -18
- package/es/utils/hiHelpers.js +8 -9
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +4 -13
- package/styles/createHiMuiTheme.js +0 -13
- package/svg-icons/Cancel.js +0 -2
- package/svg-icons/index.js +0 -9
- package/umd/hipay-material-ui.development.js +72568 -108171
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/HiIconBuilder.js +5 -19
- package/utils/hiHelpers.js +7 -9
- package/HI-CHANGELOG.md +0 -114
- package/HiAlertModal/HiAlertModal.js +0 -247
- package/HiAlertModal/index.js +0 -16
- package/HiBreadcrumb/HiBreadcrumb.js +0 -149
- package/HiBreadcrumb/HiStep.js +0 -159
- package/HiBreadcrumb/HiStepConnector.js +0 -207
- package/HiBreadcrumb/HiStepContent.js +0 -122
- package/HiBreadcrumb/HiStepIcon.js +0 -191
- package/HiBreadcrumb/HiStepLabel.js +0 -248
- package/HiBreadcrumb/HiStepper.js +0 -106
- package/HiBreadcrumb/index.js +0 -16
- package/HiDotsStepper/HiDot.js +0 -151
- package/HiDotsStepper/HiDotsStepper.js +0 -146
- package/HiDotsStepper/index.js +0 -16
- package/HiExpansionPanel/HiExpansionPanel.js +0 -231
- package/HiExpansionPanel/index.js +0 -16
- package/HiForm/HiAddressField.js +0 -187
- package/HiForm/HiSlider.js +0 -399
- package/HiForm/HiUpload.js +0 -280
- package/HiForm/HiUploadField.js +0 -456
- package/HiMap/HiMap.js +0 -367
- package/HiMap/HiMapExpand.js +0 -217
- package/HiMap/index.js +0 -25
- package/HiPdfReader/HiPdfReader.js +0 -282
- package/HiPdfReader/index.js +0 -16
- package/HiTable/HiTableFooter.js +0 -140
- package/es/HiAlertModal/HiAlertModal.js +0 -189
- package/es/HiAlertModal/index.js +0 -1
- package/es/HiBreadcrumb/HiBreadcrumb.js +0 -81
- package/es/HiBreadcrumb/HiStep.js +0 -94
- package/es/HiBreadcrumb/HiStepConnector.js +0 -143
- package/es/HiBreadcrumb/HiStepContent.js +0 -63
- package/es/HiBreadcrumb/HiStepIcon.js +0 -149
- package/es/HiBreadcrumb/HiStepLabel.js +0 -197
- package/es/HiBreadcrumb/HiStepper.js +0 -46
- package/es/HiBreadcrumb/index.js +0 -1
- package/es/HiDotsStepper/HiDot.js +0 -92
- package/es/HiDotsStepper/HiDotsStepper.js +0 -83
- package/es/HiDotsStepper/index.js +0 -1
- package/es/HiExpansionPanel/HiExpansionPanel.js +0 -170
- package/es/HiExpansionPanel/index.js +0 -1
- package/es/HiForm/HiAddressField.js +0 -127
- package/es/HiForm/HiSlider.js +0 -309
- package/es/HiForm/HiUpload.js +0 -194
- package/es/HiForm/HiUploadField.js +0 -368
- package/es/HiMap/HiMap.js +0 -285
- package/es/HiMap/HiMapExpand.js +0 -145
- package/es/HiMap/index.js +0 -2
- package/es/HiPdfReader/HiPdfReader.js +0 -198
- package/es/HiPdfReader/index.js +0 -1
- package/es/HiTable/HiTableFooter.js +0 -80
- package/es/svg-icons/HiBriefcaseRescue.js +0 -15
- package/hmu/images/countries/ad.svg +0 -151
- package/hmu/images/countries/ae.svg +0 -6
- package/hmu/images/countries/af.svg +0 -83
- package/hmu/images/countries/ag.svg +0 -15
- package/hmu/images/countries/ai.svg +0 -767
- package/hmu/images/countries/al.svg +0 -5
- package/hmu/images/countries/am.svg +0 -5
- package/hmu/images/countries/ao.svg +0 -13
- package/hmu/images/countries/aq.svg +0 -6
- package/hmu/images/countries/ar.svg +0 -32
- package/hmu/images/countries/as.svg +0 -33
- package/hmu/images/countries/at.svg +0 -6
- package/hmu/images/countries/au.svg +0 -9
- package/hmu/images/countries/aw.svg +0 -186
- package/hmu/images/countries/ax.svg +0 -18
- package/hmu/images/countries/az.svg +0 -8
- package/hmu/images/countries/ba.svg +0 -12
- package/hmu/images/countries/bb.svg +0 -6
- package/hmu/images/countries/bd.svg +0 -4
- package/hmu/images/countries/be.svg +0 -7
- package/hmu/images/countries/bf.svg +0 -7
- package/hmu/images/countries/bg.svg +0 -7
- package/hmu/images/countries/bh.svg +0 -11
- package/hmu/images/countries/bi.svg +0 -15
- package/hmu/images/countries/bj.svg +0 -14
- package/hmu/images/countries/bl.svg +0 -7
- package/hmu/images/countries/bm.svg +0 -99
- package/hmu/images/countries/bn.svg +0 -36
- package/hmu/images/countries/bo.svg +0 -686
- package/hmu/images/countries/bq.svg +0 -5
- package/hmu/images/countries/br.svg +0 -45
- package/hmu/images/countries/bs.svg +0 -13
- package/hmu/images/countries/bt.svg +0 -89
- package/hmu/images/countries/bv.svg +0 -13
- package/hmu/images/countries/bw.svg +0 -7
- package/hmu/images/countries/by.svg +0 -61
- package/hmu/images/countries/bz.svg +0 -146
- package/hmu/images/countries/ca.svg +0 -4
- package/hmu/images/countries/cc.svg +0 -19
- package/hmu/images/countries/cd.svg +0 -5
- package/hmu/images/countries/cf.svg +0 -15
- package/hmu/images/countries/cg.svg +0 -12
- package/hmu/images/countries/ch.svg +0 -9
- package/hmu/images/countries/ci.svg +0 -7
- package/hmu/images/countries/ck.svg +0 -9
- package/hmu/images/countries/cl.svg +0 -13
- package/hmu/images/countries/cm.svg +0 -15
- package/hmu/images/countries/cn.svg +0 -11
- package/hmu/images/countries/co.svg +0 -7
- package/hmu/images/countries/cr.svg +0 -7
- package/hmu/images/countries/cu.svg +0 -13
- package/hmu/images/countries/cv.svg +0 -13
- package/hmu/images/countries/cw.svg +0 -14
- package/hmu/images/countries/cx.svg +0 -15
- package/hmu/images/countries/cy.svg +0 -6
- package/hmu/images/countries/cz.svg +0 -12
- package/hmu/images/countries/de.svg +0 -5
- package/hmu/images/countries/dj.svg +0 -13
- package/hmu/images/countries/dk.svg +0 -5
- package/hmu/images/countries/dm.svg +0 -152
- package/hmu/images/countries/do.svg +0 -6745
- package/hmu/images/countries/dz.svg +0 -5
- package/hmu/images/countries/ec.svg +0 -141
- package/hmu/images/countries/ee.svg +0 -7
- package/hmu/images/countries/eg.svg +0 -38
- package/hmu/images/countries/eh.svg +0 -15
- package/hmu/images/countries/er.svg +0 -8
- package/hmu/images/countries/es-ct.svg +0 -4
- package/hmu/images/countries/es.svg +0 -581
- package/hmu/images/countries/et.svg +0 -14
- package/hmu/images/countries/eu.svg +0 -28
- package/hmu/images/countries/fi.svg +0 -5
- package/hmu/images/countries/fj.svg +0 -124
- package/hmu/images/countries/fk.svg +0 -90
- package/hmu/images/countries/fm.svg +0 -11
- package/hmu/images/countries/fo.svg +0 -12
- package/hmu/images/countries/fr.svg +0 -7
- package/hmu/images/countries/ga.svg +0 -7
- package/hmu/images/countries/gb-eng.svg +0 -5
- package/hmu/images/countries/gb-nir.svg +0 -137
- package/hmu/images/countries/gb-sct.svg +0 -4
- package/hmu/images/countries/gb-wls.svg +0 -9
- package/hmu/images/countries/gb.svg +0 -15
- package/hmu/images/countries/gd.svg +0 -27
- package/hmu/images/countries/ge.svg +0 -6
- package/hmu/images/countries/gf.svg +0 -5
- package/hmu/images/countries/gg.svg +0 -9
- package/hmu/images/countries/gh.svg +0 -6
- package/hmu/images/countries/gi.svg +0 -33
- package/hmu/images/countries/gl.svg +0 -4
- package/hmu/images/countries/gm.svg +0 -14
- package/hmu/images/countries/gn.svg +0 -7
- package/hmu/images/countries/gp.svg +0 -7
- package/hmu/images/countries/gq.svg +0 -23
- package/hmu/images/countries/gr.svg +0 -22
- package/hmu/images/countries/gs.svg +0 -205
- package/hmu/images/countries/gt.svg +0 -204
- package/hmu/images/countries/gu.svg +0 -39
- package/hmu/images/countries/gw.svg +0 -13
- package/hmu/images/countries/gy.svg +0 -9
- package/hmu/images/countries/hk.svg +0 -32
- package/hmu/images/countries/hm.svg +0 -9
- package/hmu/images/countries/hn.svg +0 -18
- package/hmu/images/countries/hr.svg +0 -59
- package/hmu/images/countries/ht.svg +0 -122
- package/hmu/images/countries/hu.svg +0 -7
- package/hmu/images/countries/id.svg +0 -6
- package/hmu/images/countries/ie.svg +0 -7
- package/hmu/images/countries/il.svg +0 -14
- package/hmu/images/countries/im.svg +0 -36
- package/hmu/images/countries/in.svg +0 -25
- package/hmu/images/countries/io.svg +0 -148
- package/hmu/images/countries/iq.svg +0 -10
- package/hmu/images/countries/ir.svg +0 -219
- package/hmu/images/countries/is.svg +0 -12
- package/hmu/images/countries/it.svg +0 -7
- package/hmu/images/countries/je.svg +0 -32
- package/hmu/images/countries/jm.svg +0 -8
- package/hmu/images/countries/jo.svg +0 -16
- package/hmu/images/countries/jp.svg +0 -11
- package/hmu/images/countries/ke.svg +0 -23
- package/hmu/images/countries/kg.svg +0 -15
- package/hmu/images/countries/kh.svg +0 -69
- package/hmu/images/countries/ki.svg +0 -36
- package/hmu/images/countries/km.svg +0 -16
- package/hmu/images/countries/kn.svg +0 -14
- package/hmu/images/countries/kp.svg +0 -15
- package/hmu/images/countries/kr.svg +0 -24
- package/hmu/images/countries/kw.svg +0 -13
- package/hmu/images/countries/ky.svg +0 -63
- package/hmu/images/countries/kz.svg +0 -23
- package/hmu/images/countries/la.svg +0 -12
- package/hmu/images/countries/lb.svg +0 -15
- package/hmu/images/countries/lc.svg +0 -8
- package/hmu/images/countries/li.svg +0 -43
- package/hmu/images/countries/lk.svg +0 -22
- package/hmu/images/countries/lr.svg +0 -14
- package/hmu/images/countries/ls.svg +0 -8
- package/hmu/images/countries/lt.svg +0 -7
- package/hmu/images/countries/lu.svg +0 -5
- package/hmu/images/countries/lv.svg +0 -6
- package/hmu/images/countries/ly.svg +0 -13
- package/hmu/images/countries/ma.svg +0 -4
- package/hmu/images/countries/mc.svg +0 -6
- package/hmu/images/countries/md.svg +0 -72
- package/hmu/images/countries/me.svg +0 -118
- package/hmu/images/countries/mf.svg +0 -7
- package/hmu/images/countries/mg.svg +0 -7
- package/hmu/images/countries/mh.svg +0 -7
- package/hmu/images/countries/mk.svg +0 -5
- package/hmu/images/countries/ml.svg +0 -7
- package/hmu/images/countries/mm.svg +0 -16
- package/hmu/images/countries/mn.svg +0 -13
- package/hmu/images/countries/mo.svg +0 -9
- package/hmu/images/countries/mp.svg +0 -86
- package/hmu/images/countries/mq.svg +0 -7
- package/hmu/images/countries/mr.svg +0 -6
- package/hmu/images/countries/ms.svg +0 -39
- package/hmu/images/countries/mt.svg +0 -49
- package/hmu/images/countries/mu.svg +0 -8
- package/hmu/images/countries/mv.svg +0 -6
- package/hmu/images/countries/mw.svg +0 -10
- package/hmu/images/countries/mx.svg +0 -385
- package/hmu/images/countries/my.svg +0 -15
- package/hmu/images/countries/mz.svg +0 -21
- package/hmu/images/countries/na.svg +0 -16
- package/hmu/images/countries/nc.svg +0 -7
- package/hmu/images/countries/ne.svg +0 -6
- package/hmu/images/countries/nf.svg +0 -9
- package/hmu/images/countries/ng.svg +0 -6
- package/hmu/images/countries/ni.svg +0 -131
- package/hmu/images/countries/nl.svg +0 -7
- package/hmu/images/countries/no.svg +0 -7
- package/hmu/images/countries/np.svg +0 -14
- package/hmu/images/countries/nr.svg +0 -12
- package/hmu/images/countries/nu.svg +0 -26
- package/hmu/images/countries/nz.svg +0 -41
- package/hmu/images/countries/om.svg +0 -116
- package/hmu/images/countries/pa.svg +0 -14
- package/hmu/images/countries/pe.svg +0 -279
- package/hmu/images/countries/pf.svg +0 -19
- package/hmu/images/countries/pg.svg +0 -9
- package/hmu/images/countries/ph.svg +0 -28
- package/hmu/images/countries/pk.svg +0 -15
- package/hmu/images/countries/pl.svg +0 -6
- package/hmu/images/countries/pm.svg +0 -7
- package/hmu/images/countries/pn.svg +0 -62
- package/hmu/images/countries/pr.svg +0 -13
- package/hmu/images/countries/ps.svg +0 -15
- package/hmu/images/countries/pt.svg +0 -57
- package/hmu/images/countries/pw.svg +0 -11
- package/hmu/images/countries/py.svg +0 -157
- package/hmu/images/countries/qa.svg +0 -4
- package/hmu/images/countries/re.svg +0 -7
- package/hmu/images/countries/ro.svg +0 -7
- package/hmu/images/countries/rs.svg +0 -292
- package/hmu/images/countries/ru.svg +0 -7
- package/hmu/images/countries/rw.svg +0 -13
- package/hmu/images/countries/sa.svg +0 -26
- package/hmu/images/countries/sb.svg +0 -13
- package/hmu/images/countries/sc.svg +0 -14
- package/hmu/images/countries/sd.svg +0 -13
- package/hmu/images/countries/se.svg +0 -16
- package/hmu/images/countries/sg.svg +0 -13
- package/hmu/images/countries/sh.svg +0 -74
- package/hmu/images/countries/si.svg +0 -18
- package/hmu/images/countries/sj.svg +0 -7
- package/hmu/images/countries/sk.svg +0 -9
- package/hmu/images/countries/sl.svg +0 -7
- package/hmu/images/countries/sm.svg +0 -91
- package/hmu/images/countries/sn.svg +0 -8
- package/hmu/images/countries/so.svg +0 -11
- package/hmu/images/countries/sr.svg +0 -6
- package/hmu/images/countries/ss.svg +0 -8
- package/hmu/images/countries/st.svg +0 -16
- package/hmu/images/countries/sv.svg +0 -618
- package/hmu/images/countries/sx.svg +0 -56
- package/hmu/images/countries/sy.svg +0 -6
- package/hmu/images/countries/sz.svg +0 -45
- package/hmu/images/countries/tc.svg +0 -67
- package/hmu/images/countries/td.svg +0 -7
- package/hmu/images/countries/tf.svg +0 -15
- package/hmu/images/countries/tg.svg +0 -14
- package/hmu/images/countries/th.svg +0 -7
- package/hmu/images/countries/tj.svg +0 -22
- package/hmu/images/countries/tk.svg +0 -5
- package/hmu/images/countries/tl.svg +0 -13
- package/hmu/images/countries/tm.svg +0 -213
- package/hmu/images/countries/tn.svg +0 -13
- package/hmu/images/countries/to.svg +0 -10
- package/hmu/images/countries/tr.svg +0 -8
- package/hmu/images/countries/tt.svg +0 -5
- package/hmu/images/countries/tv.svg +0 -27
- package/hmu/images/countries/tw.svg +0 -14
- package/hmu/images/countries/tz.svg +0 -13
- package/hmu/images/countries/ua.svg +0 -6
- package/hmu/images/countries/ug.svg +0 -30
- package/hmu/images/countries/um.svg +0 -23
- package/hmu/images/countries/un.svg +0 -16
- package/hmu/images/countries/us.svg +0 -12
- package/hmu/images/countries/uy.svg +0 -28
- package/hmu/images/countries/uz.svg +0 -30
- package/hmu/images/countries/va.svg +0 -483
- package/hmu/images/countries/vc.svg +0 -8
- package/hmu/images/countries/ve.svg +0 -26
- package/hmu/images/countries/vg.svg +0 -133
- package/hmu/images/countries/vi.svg +0 -31
- package/hmu/images/countries/vn.svg +0 -11
- package/hmu/images/countries/vu.svg +0 -18
- package/hmu/images/countries/wf.svg +0 -7
- package/hmu/images/countries/ws.svg +0 -7
- package/hmu/images/countries/ye.svg +0 -7
- package/hmu/images/countries/yt.svg +0 -7
- package/hmu/images/countries/za.svg +0 -17
- package/hmu/images/countries/zm.svg +0 -27
- package/hmu/images/countries/zw.svg +0 -21
- package/hmu/images/hipay-white-logo.svg +0 -42
- package/hmu/images/logo_visa_75wx45h.gif +0 -0
- package/hmu/images/map_marker.svg +0 -8
- package/svg-icons/HiBriefcaseRescue.js +0 -30
package/HiSelect/HiSelect.js
CHANGED
@@ -3,23 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.styles =
|
7
|
-
|
8
|
-
var _keys = require('babel-runtime/core-js/object/keys');
|
9
|
-
|
10
|
-
var _keys2 = _interopRequireDefault(_keys);
|
6
|
+
exports.styles = undefined;
|
11
7
|
|
12
8
|
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
13
9
|
|
14
10
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
15
11
|
|
16
|
-
var
|
17
|
-
|
18
|
-
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
|
19
|
-
|
20
|
-
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
12
|
+
var _keys = require('babel-runtime/core-js/object/keys');
|
21
13
|
|
22
|
-
var
|
14
|
+
var _keys2 = _interopRequireDefault(_keys);
|
23
15
|
|
24
16
|
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
25
17
|
|
@@ -71,18 +63,22 @@ var _ClickAwayListener = require('material-ui/utils/ClickAwayListener');
|
|
71
63
|
|
72
64
|
var _ClickAwayListener2 = _interopRequireDefault(_ClickAwayListener);
|
73
65
|
|
74
|
-
var
|
66
|
+
var _Collapse = require('material-ui/transitions/Collapse');
|
75
67
|
|
76
|
-
var
|
68
|
+
var _Collapse2 = _interopRequireDefault(_Collapse);
|
77
69
|
|
78
|
-
var
|
70
|
+
var _reactPopper = require('react-popper');
|
79
71
|
|
80
|
-
var
|
72
|
+
var _mdiMaterialUi = require('mdi-material-ui');
|
81
73
|
|
82
74
|
var _HiSelectableList = require('../HiSelectableList');
|
83
75
|
|
84
76
|
var _HiSelectableList2 = _interopRequireDefault(_HiSelectableList);
|
85
77
|
|
78
|
+
var _HiSelectableListItem = require('../HiSelectableList/HiSelectableListItem');
|
79
|
+
|
80
|
+
var _HiSelectableListItem2 = _interopRequireDefault(_HiSelectableListItem);
|
81
|
+
|
86
82
|
var _HiForm = require('../HiForm');
|
87
83
|
|
88
84
|
var _SelectInput = require('./SelectInput');
|
@@ -103,7 +99,7 @@ var _HiIconBuilder2 = _interopRequireDefault(_HiIconBuilder);
|
|
103
99
|
|
104
100
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
105
101
|
|
106
|
-
|
102
|
+
// @inheritedComponent Input
|
107
103
|
|
108
104
|
var styles = exports.styles = function styles(theme) {
|
109
105
|
return {
|
@@ -115,7 +111,7 @@ var styles = exports.styles = function styles(theme) {
|
|
115
111
|
},
|
116
112
|
popper: {
|
117
113
|
width: '100%',
|
118
|
-
zIndex:
|
114
|
+
zIndex: 9
|
119
115
|
},
|
120
116
|
paper: {
|
121
117
|
borderRadius: '0px 2px',
|
@@ -161,7 +157,249 @@ var HiSelect = function (_React$PureComponent) {
|
|
161
157
|
|
162
158
|
var _this = (0, _possibleConstructorReturn3.default)(this, (HiSelect.__proto__ || (0, _getPrototypeOf2.default)(HiSelect)).call(this, props));
|
163
159
|
|
164
|
-
|
160
|
+
_this.handleClick = function () {
|
161
|
+
document.body.style.overflow = 'hidden';
|
162
|
+
_this.setState({ open: true });
|
163
|
+
var options = _this.props.options.slice();
|
164
|
+
_this.handleSuggestions(options);
|
165
|
+
|
166
|
+
if (_this.props.onClick) {
|
167
|
+
_this.props.onClick();
|
168
|
+
}
|
169
|
+
|
170
|
+
// Gestion du focus
|
171
|
+
if (_this.searchField) {
|
172
|
+
// si searchable, focus sur le champs de recherche
|
173
|
+
var searchField = _this.searchField;
|
174
|
+
setTimeout(function () {
|
175
|
+
searchField.focus();
|
176
|
+
}, 1);
|
177
|
+
} else if (_this.overlay) {
|
178
|
+
// sinon focus sur le dernier élément selectionné
|
179
|
+
_this.focusOnSelectedItem();
|
180
|
+
}
|
181
|
+
};
|
182
|
+
|
183
|
+
_this.focusOnSelectedItem = function () {
|
184
|
+
// On récupère la div parent "overlay"
|
185
|
+
var overlay = (0, _reactDom.findDOMNode)(_this.overlay);
|
186
|
+
var multiple = _this.props.multiple;
|
187
|
+
var value = _this.props.value;
|
188
|
+
var selectedIdList = Array.isArray(value) ? value : [value];
|
189
|
+
setTimeout(function () {
|
190
|
+
var focused = false;
|
191
|
+
// Si un ou plusieurs items sont selectionnés, on focus sur le dernier
|
192
|
+
if (selectedIdList.length > 0) {
|
193
|
+
var itemSelected = overlay.querySelector('[data-id="' + selectedIdList[selectedIdList.length - 1] + '"]');
|
194
|
+
if (itemSelected && itemSelected.parentElement.tagName === 'LI') {
|
195
|
+
itemSelected.parentElement.focus();
|
196
|
+
focused = true;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
// Si pas d'item selectionné, ou pas visible (en cas de recherche), focus sur le premier
|
200
|
+
if (selectedIdList.length === 0 || !focused) {
|
201
|
+
// On recupère tous les items
|
202
|
+
var items = overlay.getElementsByTagName('li');
|
203
|
+
var itemToFocus = items[0];
|
204
|
+
// Si select multiple, et qu'au moins un selectionné, focus sur le 2e item
|
205
|
+
if (multiple && selectedIdList.length > 0) {
|
206
|
+
itemToFocus = items[1];
|
207
|
+
}
|
208
|
+
itemToFocus.focus();
|
209
|
+
}
|
210
|
+
}, 1);
|
211
|
+
};
|
212
|
+
|
213
|
+
_this.handleKeyDown = function (event) {
|
214
|
+
var nextItem = void 0;
|
215
|
+
if (event.key === 'ArrowDown') {
|
216
|
+
nextItem = (0, _hiHelpers.getNextItemSelectable)(document.activeElement, 'down');
|
217
|
+
} else if (event.key === 'ArrowUp') {
|
218
|
+
nextItem = (0, _hiHelpers.getNextItemSelectable)(document.activeElement, 'up');
|
219
|
+
} else if (event.key === 'Tab') {
|
220
|
+
document.body.style.overflow = 'auto';
|
221
|
+
_this.setState({ open: false });
|
222
|
+
}
|
223
|
+
if (nextItem) {
|
224
|
+
nextItem.focus();
|
225
|
+
}
|
226
|
+
};
|
227
|
+
|
228
|
+
_this.handleKeyDownSearch = function (event) {
|
229
|
+
if (_this.overlay && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
230
|
+
_this.focusOnSelectedItem();
|
231
|
+
}
|
232
|
+
};
|
233
|
+
|
234
|
+
_this.handleFocus = function () {
|
235
|
+
_this.setState({ focused: true });
|
236
|
+
};
|
237
|
+
|
238
|
+
_this.handleBlur = function () {
|
239
|
+
_this.setState({ focused: false });
|
240
|
+
};
|
241
|
+
|
242
|
+
_this.handleClose = function () {
|
243
|
+
document.body.style.overflow = 'auto';
|
244
|
+
_this.setState({
|
245
|
+
open: false
|
246
|
+
});
|
247
|
+
|
248
|
+
if (_this.props.onClose) {
|
249
|
+
_this.props.onClose();
|
250
|
+
}
|
251
|
+
};
|
252
|
+
|
253
|
+
_this.handleSelect = function (event, item) {
|
254
|
+
var _this$props = _this.props,
|
255
|
+
multiple = _this$props.multiple,
|
256
|
+
value = _this$props.value,
|
257
|
+
name = _this$props.name,
|
258
|
+
onChange = _this$props.onChange,
|
259
|
+
options = _this$props.options,
|
260
|
+
hierarchic = _this$props.hierarchic;
|
261
|
+
var _this$state = _this.state,
|
262
|
+
hierarchySelected = _this$state.hierarchySelected,
|
263
|
+
hierarchy = _this$state.hierarchy,
|
264
|
+
nbOptions = _this$state.nbOptions;
|
265
|
+
|
266
|
+
var hiSelected = (0, _extends3.default)({}, hierarchySelected);
|
267
|
+
|
268
|
+
if (multiple) {
|
269
|
+
var valueList = value;
|
270
|
+
if (item.id === '_all') {
|
271
|
+
if (valueList.length === nbOptions) {
|
272
|
+
valueList = [];
|
273
|
+
if (hierarchic) {
|
274
|
+
// if hierarchic select => empty associative array of selected children
|
275
|
+
(0, _keys2.default)(hiSelected).forEach(function (key) {
|
276
|
+
hiSelected[key] = [];
|
277
|
+
});
|
278
|
+
}
|
279
|
+
} else {
|
280
|
+
options.forEach(function (option) {
|
281
|
+
if (option.hasChildren !== true && !valueList.includes(option.id) && option.id !== '_all') {
|
282
|
+
valueList.push(option.id);
|
283
|
+
} else if (option.hasChildren === true) {
|
284
|
+
// if hierarchic select => fill associative array of selected children
|
285
|
+
hiSelected[option.id] = hierarchy[option.id];
|
286
|
+
}
|
287
|
+
});
|
288
|
+
}
|
289
|
+
} else if (valueList.includes(item.id) || item.hasChildren === true && hierarchySelected[item.id].length === hierarchy[item.id].length) {
|
290
|
+
// item déjà sélectionné => on le déselectionne
|
291
|
+
if (item.hasChildren !== true) {
|
292
|
+
valueList = valueList.filter(function (val) {
|
293
|
+
return val !== item.id;
|
294
|
+
});
|
295
|
+
}
|
296
|
+
|
297
|
+
if (item.hasChildren === true) {
|
298
|
+
// remove all children
|
299
|
+
valueList = valueList.filter(function (val) {
|
300
|
+
return !_this.state.hierarchy[item.id].includes(val);
|
301
|
+
});
|
302
|
+
hiSelected[item.id] = [];
|
303
|
+
} else if (item.hasOwnProperty('parentId')) {
|
304
|
+
// Si item est un enfant on l'enlève du tableau associatif des
|
305
|
+
// elmts sélectionnés
|
306
|
+
hiSelected[item.parentId].splice(hiSelected[item.parentId].indexOf(item.id), 1);
|
307
|
+
}
|
308
|
+
} else {
|
309
|
+
// item non sélectionné => on le sélectionne
|
310
|
+
if (item.hasChildren !== true) valueList.push(item.id);
|
311
|
+
|
312
|
+
if (item.hasChildren === true) {
|
313
|
+
// Si item parent => on ajoute tous les enfants
|
314
|
+
// Ou on les supprime s'ils sont déjà tous sélectionnés (dans une liste filtrée)
|
315
|
+
var idsInSuggestions = [];
|
316
|
+
_this.state.suggestions.forEach(function (suggestion) {
|
317
|
+
if (_this.state.hierarchy[item.id].includes(suggestion.id)) {
|
318
|
+
idsInSuggestions.push(suggestion.id);
|
319
|
+
}
|
320
|
+
});
|
321
|
+
// if(hierarchySelected[item.id].length > 0) {}
|
322
|
+
var allChildrenSuggestionsSelected = true;
|
323
|
+
idsInSuggestions.forEach(function (id) {
|
324
|
+
if (!hierarchySelected[item.id].includes(id)) {
|
325
|
+
allChildrenSuggestionsSelected = false;
|
326
|
+
}
|
327
|
+
});
|
328
|
+
|
329
|
+
if (allChildrenSuggestionsSelected === true) {
|
330
|
+
// On supprime les enfants car déjà tous sélectionnés
|
331
|
+
idsInSuggestions.forEach(function (id) {
|
332
|
+
valueList.splice(valueList.indexOf(id), 1);
|
333
|
+
hiSelected[item.id].splice(hiSelected[item.id].indexOf(id), 1);
|
334
|
+
});
|
335
|
+
} else {
|
336
|
+
// On ajoute tous les enfants filtrés au éléments sélectionnés
|
337
|
+
valueList = (0, _hiHelpers.arrayUnique)(valueList.concat(idsInSuggestions));
|
338
|
+
hiSelected[item.id] = (0, _hiHelpers.arrayUnique)(hiSelected[item.id].concat(idsInSuggestions));
|
339
|
+
}
|
340
|
+
|
341
|
+
_this.setState({ hierarchySelected: hiSelected });
|
342
|
+
} else if (item.hasOwnProperty('parentId')) {
|
343
|
+
// Si item est un enfant on l'ajoute du tableau associatif des
|
344
|
+
// elmts sélectionnés
|
345
|
+
hiSelected[item.parentId].push(item.id);
|
346
|
+
}
|
347
|
+
}
|
348
|
+
_this.setState({ hierarchySelected: hiSelected });
|
349
|
+
onChange(event, valueList);
|
350
|
+
} else {
|
351
|
+
onChange(event, item.id);
|
352
|
+
_this.handleClose();
|
353
|
+
}
|
354
|
+
};
|
355
|
+
|
356
|
+
_this.handleSuggestions = function (suggestions) {
|
357
|
+
var _this$props2 = _this.props,
|
358
|
+
options = _this$props2.options,
|
359
|
+
hasAll = _this$props2.hasAll,
|
360
|
+
iconAll = _this$props2.iconAll,
|
361
|
+
translations = _this$props2.translations,
|
362
|
+
multiple = _this$props2.multiple;
|
363
|
+
|
364
|
+
|
365
|
+
if (suggestions.length === 0) {
|
366
|
+
// Handle No Result
|
367
|
+
// FIX to remove all item
|
368
|
+
suggestions = [];
|
369
|
+
suggestions.push({
|
370
|
+
id: '_no_result',
|
371
|
+
type: 'text',
|
372
|
+
disabled: true,
|
373
|
+
centered: true,
|
374
|
+
checkbox: false,
|
375
|
+
label: translations.no_result_match
|
376
|
+
});
|
377
|
+
} else if (hasAll && suggestions.length > 0 && suggestions.length === options.length && multiple === true) {
|
378
|
+
// Handle 'All'
|
379
|
+
if (suggestions.filter(function (suggestion) {
|
380
|
+
return suggestion.id === '_all';
|
381
|
+
}).length === 0) {
|
382
|
+
var allItem = {
|
383
|
+
id: '_all',
|
384
|
+
icon: iconAll,
|
385
|
+
label: translations.all
|
386
|
+
};
|
387
|
+
if (iconAll !== false) {
|
388
|
+
allItem.type = 'icon';
|
389
|
+
}
|
390
|
+
suggestions.unshift(allItem);
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
_this.setState({
|
395
|
+
suggestions: suggestions
|
396
|
+
});
|
397
|
+
};
|
398
|
+
|
399
|
+
_this.handleRequestDelete = function (evt) {
|
400
|
+
evt.stopPropagation();
|
401
|
+
_this.props.onChange(_this.props.name, []);
|
402
|
+
};
|
165
403
|
|
166
404
|
_this.state = {
|
167
405
|
open: false,
|
@@ -170,39 +408,31 @@ var HiSelect = function (_React$PureComponent) {
|
|
170
408
|
hierarchySelected: {},
|
171
409
|
hierarchy: {},
|
172
410
|
nbOptions: 0,
|
173
|
-
dynamic:
|
174
|
-
resultsPageNumber: 1
|
411
|
+
dynamic: false
|
175
412
|
};
|
176
413
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
props.options.forEach(function (
|
186
|
-
if (
|
187
|
-
|
414
|
+
if (props.hierarchic === true && props.options.length > 1) {
|
415
|
+
// Construct two associative arrays
|
416
|
+
// hierarchy[parentId] => children
|
417
|
+
// hierarchySelected[parentId] => selected children
|
418
|
+
var hierarchy = {};
|
419
|
+
var hierarchySelected = {};
|
420
|
+
var value = props.value || [];
|
421
|
+
if (!Array.isArray(value)) value = [props.value];
|
422
|
+
props.options.forEach(function (option) {
|
423
|
+
if (option.hasChildren === true && !hierarchy.hasOwnProperty(option.id)) {
|
424
|
+
hierarchy[option.id] = [];
|
425
|
+
hierarchySelected[option.id] = [];
|
426
|
+
} else if (option.hasOwnProperty('parentId')) {
|
427
|
+
hierarchy[option.parentId].push(option.id);
|
428
|
+
if (value.includes(option.id)) {
|
429
|
+
hierarchySelected[option.parentId].push(option.id);
|
430
|
+
}
|
188
431
|
}
|
189
432
|
});
|
190
|
-
if (!valueInOptions && props.pinnedItem) {
|
191
|
-
if (props.value.indexOf(props.pinnedItem.id) >= 0) {
|
192
|
-
valueInOptions = true;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
|
-
|
197
|
-
if (!valueInOptions) {
|
198
|
-
throw new Error('prop value provided does not match any option.');
|
199
|
-
}
|
200
|
-
|
201
|
-
if (props.hierarchic === true && props.options.length > 1) {
|
202
|
-
var hierarchyTrees = _this.buildHierarchyTrees(props);
|
203
433
|
|
204
|
-
_this.state.hierarchy =
|
205
|
-
_this.state.hierarchySelected =
|
434
|
+
_this.state.hierarchy = hierarchy;
|
435
|
+
_this.state.hierarchySelected = hierarchySelected;
|
206
436
|
}
|
207
437
|
|
208
438
|
if (props.options.length > 0) {
|
@@ -214,14 +444,13 @@ var HiSelect = function (_React$PureComponent) {
|
|
214
444
|
}
|
215
445
|
});
|
216
446
|
_this.state.nbOptions = optionsLength;
|
217
|
-
} else
|
447
|
+
} else {
|
218
448
|
_this.state.dynamic = true;
|
219
449
|
}
|
220
450
|
|
221
451
|
_this.handleSelect = _this.handleSelect.bind(_this);
|
222
452
|
_this.handleClick = _this.handleClick.bind(_this);
|
223
453
|
_this.handleClose = _this.handleClose.bind(_this);
|
224
|
-
_this.handleClickAway = _this.handleClickAway.bind(_this);
|
225
454
|
_this.handleRequestDelete = _this.handleRequestDelete.bind(_this);
|
226
455
|
_this.handleSuggestions = _this.handleSuggestions.bind(_this);
|
227
456
|
_this.handleFocus = _this.handleFocus.bind(_this);
|
@@ -230,24 +459,6 @@ var HiSelect = function (_React$PureComponent) {
|
|
230
459
|
}
|
231
460
|
|
232
461
|
(0, _createClass3.default)(HiSelect, [{
|
233
|
-
key: 'componentDidUpdate',
|
234
|
-
value: function componentDidUpdate(prevProps, prevState, prevContext) {
|
235
|
-
var _this2 = this;
|
236
|
-
|
237
|
-
if (this.props.infiniteScroll && !prevState.open && this.state.open && this.optionsContent) {
|
238
|
-
var optionList = this.optionsContent.querySelector('div').querySelector('div');
|
239
|
-
optionList.addEventListener('scroll', function (event) {
|
240
|
-
if (optionList.scrollTop >= event.target.scrollHeight - optionList.offsetHeight && !_this2.props.loadingMoreResults && _this2.props.hasMore) {
|
241
|
-
_this2.props.loadMoreResults(_this2.state.resultsPageNumber + 1);
|
242
|
-
_this2.setState({ resultsPageNumber: _this2.state.resultsPageNumber + 1 });
|
243
|
-
}
|
244
|
-
});
|
245
|
-
} else if (this.optionsContent && this.props.infiniteScroll && !this.state.open && prevState.open) {
|
246
|
-
var _optionList = this.optionsContent.querySelector('div').querySelector('div');
|
247
|
-
_optionList.removeEventListener('scroll');
|
248
|
-
}
|
249
|
-
}
|
250
|
-
}, {
|
251
462
|
key: 'componentWillReceiveProps',
|
252
463
|
value: function componentWillReceiveProps(nextProps) {
|
253
464
|
if (typeof this.props.onSearch !== 'undefined' && this.props.options && this.props.options.length > 0) {
|
@@ -260,42 +471,6 @@ var HiSelect = function (_React$PureComponent) {
|
|
260
471
|
});
|
261
472
|
this.setState({ nbOptions: optionsLength });
|
262
473
|
}
|
263
|
-
|
264
|
-
if (nextProps.hierarchic === true && nextProps.options.length > 1) {
|
265
|
-
var hierarchyTrees = this.buildHierarchyTrees(nextProps);
|
266
|
-
this.setState({ hierarchy: hierarchyTrees.hierarchy, hierarchySelected: hierarchyTrees.hierarchySelected });
|
267
|
-
}
|
268
|
-
}
|
269
|
-
}, {
|
270
|
-
key: 'buildHierarchyTrees',
|
271
|
-
value: function buildHierarchyTrees(props) {
|
272
|
-
// Construct two associative arrays
|
273
|
-
// hierarchy[parentId] => children
|
274
|
-
// hierarchySelected[parentId] => selected children
|
275
|
-
var hierarchy = {};
|
276
|
-
var hierarchySelected = {};
|
277
|
-
var value = props.value || [];
|
278
|
-
if (!Array.isArray(value)) value = [props.value];
|
279
|
-
props.options.forEach(function (option) {
|
280
|
-
if (option.hasChildren === true && !hierarchy.hasOwnProperty(option.id)) {
|
281
|
-
hierarchy[option.id] = [];
|
282
|
-
hierarchySelected[option.id] = [];
|
283
|
-
} else if (option.hasOwnProperty('parentId')) {
|
284
|
-
hierarchy[option.parentId].push(option.id);
|
285
|
-
if (value.includes(option.id)) {
|
286
|
-
hierarchySelected[option.parentId].push(option.id);
|
287
|
-
}
|
288
|
-
}
|
289
|
-
});
|
290
|
-
return { hierarchy: hierarchy, hierarchySelected: hierarchySelected };
|
291
|
-
}
|
292
|
-
}, {
|
293
|
-
key: 'handleReset',
|
294
|
-
value: function handleReset(event) {
|
295
|
-
if (this.props.onReset) {
|
296
|
-
event.stopPropagation();
|
297
|
-
this.props.onReset(event);
|
298
|
-
}
|
299
474
|
}
|
300
475
|
|
301
476
|
// Key down on list items
|
@@ -326,13 +501,12 @@ var HiSelect = function (_React$PureComponent) {
|
|
326
501
|
}, {
|
327
502
|
key: 'render',
|
328
503
|
value: function render() {
|
329
|
-
var
|
504
|
+
var _this2 = this;
|
330
505
|
|
331
506
|
var _props = this.props,
|
332
507
|
classes = _props.classes,
|
333
508
|
disabled = _props.disabled,
|
334
509
|
error = _props.error,
|
335
|
-
loading = _props.loading,
|
336
510
|
options = _props.options,
|
337
511
|
checkbox = _props.checkbox,
|
338
512
|
searchable = _props.searchable,
|
@@ -346,73 +520,42 @@ var HiSelect = function (_React$PureComponent) {
|
|
346
520
|
hoverIcon = _props.hoverIcon,
|
347
521
|
checkedIcon = _props.checkedIcon,
|
348
522
|
hierarchic = _props.hierarchic,
|
349
|
-
id = _props.id
|
350
|
-
placeholder = _props.placeholder,
|
351
|
-
staticPosition = _props.staticPosition,
|
352
|
-
pinnedItem = _props.pinnedItem,
|
353
|
-
hasAll = _props.hasAll,
|
354
|
-
infiniteScroll = _props.infiniteScroll,
|
355
|
-
loadingMoreResults = _props.loadingMoreResults,
|
356
|
-
showNoResults = _props.showNoResults,
|
357
|
-
showMinLength = _props.showMinLength,
|
358
|
-
other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'disabled', 'error', 'loading', 'options', 'checkbox', 'searchable', 'displayAsChip', 'type', 'value', 'translations', 'parentItemSelectable', 'icon', 'parentIcon', 'hoverIcon', 'checkedIcon', 'hierarchic', 'id', 'placeholder', 'staticPosition', 'pinnedItem', 'hasAll', 'infiniteScroll', 'loadingMoreResults', 'showNoResults', 'showMinLength']);
|
523
|
+
id = _props.id;
|
359
524
|
var _state = this.state,
|
360
525
|
open = _state.open,
|
361
526
|
suggestions = _state.suggestions,
|
362
|
-
focused = _state.focused
|
363
|
-
dynamic = _state.dynamic;
|
527
|
+
focused = _state.focused;
|
364
528
|
|
365
529
|
|
366
530
|
var display = '';
|
367
|
-
var selectedIdList = Array.isArray(value) ? value :
|
368
|
-
|
369
|
-
var _suggestions = [].concat((0, _toConsumableArray3.default)(suggestions));
|
370
|
-
|
371
|
-
if (pinnedItem) {
|
372
|
-
_suggestions.unshift(pinnedItem);
|
373
|
-
}
|
531
|
+
var selectedIdList = Array.isArray(value) ? value : [value];
|
374
532
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
id: '_loading',
|
379
|
-
type: 'loader',
|
380
|
-
disabled: true,
|
381
|
-
centered: true,
|
382
|
-
checkbox: false,
|
383
|
-
label: 'loading'
|
384
|
-
});
|
385
|
-
}
|
386
|
-
|
387
|
-
if ((dynamic || loading) && selectedIdList.length === 1) {
|
388
|
-
display = translations.one_item_selected;
|
389
|
-
} else if ((this.state.nbOptions !== selectedIdList.length || !hasAll) && selectedIdList.length > 1) {
|
533
|
+
if (this.state.dynamic && selectedIdList.length === 1) {
|
534
|
+
display = translations.one_item_selected.replace('%s', selectedIdList.length);
|
535
|
+
} else if (this.state.nbOptions !== selectedIdList.length && selectedIdList.length > 1) {
|
390
536
|
display = translations.n_items_selected.replace('%s', selectedIdList.length);
|
391
|
-
} else if (this.state.nbOptions === selectedIdList.length
|
537
|
+
} else if (this.state.nbOptions === selectedIdList.length) {
|
392
538
|
display = translations.all;
|
393
539
|
} else if (selectedIdList.length === 1) {
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
display = translations.one_item_selected;
|
399
|
-
} else if (type !== 'icon') {
|
400
|
-
if (pinnedItem) {
|
401
|
-
item = pinnedItem;
|
402
|
-
}
|
403
|
-
display = item.label;
|
540
|
+
if (type !== 'icon') {
|
541
|
+
display = options.find(function (o) {
|
542
|
+
return o.id === selectedIdList[0];
|
543
|
+
}).label;
|
404
544
|
} else {
|
545
|
+
var optionSelected = options.find(function (o) {
|
546
|
+
return o.id === selectedIdList[0];
|
547
|
+
});
|
405
548
|
display = _react2.default.createElement(
|
406
549
|
'span',
|
407
550
|
{ className: classes.selectIconLabel },
|
408
|
-
_react2.default.createElement(_HiIconBuilder2.default, { icon:
|
409
|
-
|
551
|
+
_react2.default.createElement(_HiIconBuilder2.default, { icon: optionSelected.icon, className: classes.labelIcon }),
|
552
|
+
optionSelected.label
|
410
553
|
);
|
411
554
|
}
|
412
555
|
}
|
413
556
|
|
414
557
|
if (displayAsChip) {
|
415
|
-
var chipFilter = _react2.default.createElement(_HiChip2.default, { label:
|
558
|
+
var chipFilter = _react2.default.createElement(_HiChip2.default, { label: display, onDelete: this.handleRequestDelete });
|
416
559
|
if (display) {
|
417
560
|
display = chipFilter;
|
418
561
|
}
|
@@ -430,84 +573,12 @@ var HiSelect = function (_React$PureComponent) {
|
|
430
573
|
popperStyle = { width: this.props.containerWidth };
|
431
574
|
}
|
432
575
|
|
433
|
-
if (infiniteScroll && loadingMoreResults) {
|
434
|
-
_suggestions.push({
|
435
|
-
id: '_loading',
|
436
|
-
type: 'loader',
|
437
|
-
disabled: true,
|
438
|
-
centered: true,
|
439
|
-
checkbox: false,
|
440
|
-
label: 'loading'
|
441
|
-
});
|
442
|
-
}
|
443
|
-
|
444
|
-
if (!loading && !loadingMoreResults && _suggestions.length === 0 && (showNoResults || showMinLength)) {
|
445
|
-
suggestions.push({
|
446
|
-
id: '_no_result',
|
447
|
-
type: 'text',
|
448
|
-
disabled: true,
|
449
|
-
centered: true,
|
450
|
-
checkbox: false,
|
451
|
-
label: showNoResults ? translations.no_result_match : translations.min_length
|
452
|
-
});
|
453
|
-
}
|
454
|
-
|
455
|
-
var content = _react2.default.createElement(
|
456
|
-
_ClickAwayListener2.default,
|
457
|
-
{ onClickAway: this.handleClickAway },
|
458
|
-
_react2.default.createElement(
|
459
|
-
_Grow2.default,
|
460
|
-
{ 'in': open, id: 'menu-list', style: { transformOrigin: '0 0 0' } },
|
461
|
-
_react2.default.createElement(
|
462
|
-
_Paper2.default,
|
463
|
-
{ className: classes.paper },
|
464
|
-
!!searchable && _react2.default.createElement(_HiForm.HiSearchField, {
|
465
|
-
itemList: options,
|
466
|
-
callbackFilteredList: this.handleSuggestions,
|
467
|
-
filterPropertyList: ['label'],
|
468
|
-
placeholder: translations.search,
|
469
|
-
autoFocus: true,
|
470
|
-
onSearch: this.props.onSearch,
|
471
|
-
inputRef: function inputRef(el) {
|
472
|
-
_this3.searchField = el;
|
473
|
-
},
|
474
|
-
onKeyDown: this.handleKeyDownSearch
|
475
|
-
}),
|
476
|
-
_react2.default.createElement(
|
477
|
-
'div',
|
478
|
-
{ ref: function ref(content) {
|
479
|
-
return _this3.optionsContent = content;
|
480
|
-
} },
|
481
|
-
_react2.default.createElement(_HiSelectableList2.default, (0, _extends3.default)({
|
482
|
-
type: type,
|
483
|
-
parentItemSelectable: parentItemSelectable,
|
484
|
-
itemList: _suggestions,
|
485
|
-
onSelect: this.handleSelect,
|
486
|
-
selectedIdList: selectedIdList,
|
487
|
-
checkbox: checkbox,
|
488
|
-
hierarchy: this.state.hierarchy,
|
489
|
-
hierarchic: hierarchic,
|
490
|
-
hierarchySelected: this.state.hierarchySelected,
|
491
|
-
translations: translations,
|
492
|
-
icon: icon,
|
493
|
-
parentIcon: parentIcon,
|
494
|
-
hoverIcon: hoverIcon,
|
495
|
-
checkedIcon: checkedIcon,
|
496
|
-
allSelected: allSelected,
|
497
|
-
value: value,
|
498
|
-
onKeyDown: this.handleKeyDown
|
499
|
-
}, other))
|
500
|
-
)
|
501
|
-
)
|
502
|
-
)
|
503
|
-
);
|
504
|
-
|
505
576
|
return _react2.default.createElement(
|
506
577
|
'div',
|
507
578
|
{
|
508
579
|
className: classes.root,
|
509
580
|
ref: function ref(el) {
|
510
|
-
|
581
|
+
_this2.overlay = el;
|
511
582
|
}
|
512
583
|
},
|
513
584
|
_react2.default.createElement(
|
@@ -518,7 +589,7 @@ var HiSelect = function (_React$PureComponent) {
|
|
518
589
|
null,
|
519
590
|
_react2.default.createElement(_SelectInput2.default, {
|
520
591
|
id: id,
|
521
|
-
value:
|
592
|
+
value: display,
|
522
593
|
open: open,
|
523
594
|
focused: focused,
|
524
595
|
type: type,
|
@@ -529,19 +600,10 @@ var HiSelect = function (_React$PureComponent) {
|
|
529
600
|
onFocus: this.handleFocus,
|
530
601
|
onBlur: this.handleBlur,
|
531
602
|
onMouseEnter: this.props.onMouseEnter,
|
532
|
-
onMouseLeave: this.props.onMouseLeave
|
533
|
-
refElement: function refElement(el) {
|
534
|
-
_this3.selectInputElement = el;
|
535
|
-
},
|
536
|
-
onSubmit: this.props.onSubmit,
|
537
|
-
onReset: this.props.onReset
|
603
|
+
onMouseLeave: this.props.onMouseLeave
|
538
604
|
})
|
539
605
|
),
|
540
|
-
open &&
|
541
|
-
'div',
|
542
|
-
{ style: popperStyle },
|
543
|
-
content
|
544
|
-
) : _react2.default.createElement(
|
606
|
+
open && _react2.default.createElement(
|
545
607
|
_reactPopper.Popper,
|
546
608
|
{
|
547
609
|
placement: 'bottom-start',
|
@@ -549,8 +611,50 @@ var HiSelect = function (_React$PureComponent) {
|
|
549
611
|
className: popperClass,
|
550
612
|
style: popperStyle
|
551
613
|
},
|
552
|
-
|
553
|
-
|
614
|
+
_react2.default.createElement(
|
615
|
+
_ClickAwayListener2.default,
|
616
|
+
{ onClickAway: this.handleClose },
|
617
|
+
_react2.default.createElement(
|
618
|
+
_Grow2.default,
|
619
|
+
{ 'in': open, id: 'menu-list', style: { transformOrigin: '0 0 0' } },
|
620
|
+
_react2.default.createElement(
|
621
|
+
_Paper2.default,
|
622
|
+
{ className: classes.paper },
|
623
|
+
!!searchable && _react2.default.createElement(_HiForm.HiSearchField, {
|
624
|
+
itemList: options,
|
625
|
+
callbackFilteredList: this.handleSuggestions,
|
626
|
+
filterPropertyList: ['label'],
|
627
|
+
placeholder: translations.search,
|
628
|
+
autoFocus: true,
|
629
|
+
onSearch: this.props.onSearch,
|
630
|
+
inputRef: function inputRef(el) {
|
631
|
+
_this2.searchField = el;
|
632
|
+
},
|
633
|
+
onKeyDown: this.handleKeyDownSearch
|
634
|
+
}),
|
635
|
+
_react2.default.createElement(_HiSelectableList2.default, {
|
636
|
+
type: type,
|
637
|
+
parentItemSelectable: parentItemSelectable,
|
638
|
+
itemList: suggestions,
|
639
|
+
onSelect: this.handleSelect,
|
640
|
+
selectedIdList: selectedIdList,
|
641
|
+
checkbox: checkbox,
|
642
|
+
hierarchy: this.state.hierarchy,
|
643
|
+
hierarchic: hierarchic,
|
644
|
+
hierarchySelected: this.state.hierarchySelected,
|
645
|
+
translations: translations,
|
646
|
+
icon: icon,
|
647
|
+
parentIcon: parentIcon,
|
648
|
+
hoverIcon: hoverIcon,
|
649
|
+
checkedIcon: checkedIcon,
|
650
|
+
allSelected: allSelected,
|
651
|
+
value: value,
|
652
|
+
onKeyDown: this.handleKeyDown
|
653
|
+
})
|
654
|
+
)
|
655
|
+
)
|
656
|
+
)
|
657
|
+
)
|
554
658
|
)
|
555
659
|
);
|
556
660
|
}
|
@@ -570,309 +674,20 @@ HiSelect.defaultProps = {
|
|
570
674
|
hierarchic: false,
|
571
675
|
parentItemSelectable: false,
|
572
676
|
displayAsChip: false,
|
573
|
-
dynamic: false,
|
574
|
-
infiniteScroll: false,
|
575
677
|
icon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
576
678
|
parentIcon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
577
679
|
hoverIcon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
578
680
|
checkedIcon: _react2.default.createElement(_mdiMaterialUi.CheckboxMarked, { style: { width: 20, height: 20 } }),
|
579
681
|
translations: {
|
580
682
|
all: 'All',
|
581
|
-
min_length: 'Veuillez saisir 3 caractères minimum',
|
582
683
|
no_result_match: 'No result match',
|
583
684
|
search: 'Search',
|
584
685
|
n_items_selected: '%s items selected',
|
585
686
|
one_item_selected: '%s item selected',
|
586
687
|
n_children: '%s items',
|
587
688
|
one_child: '%s item'
|
588
|
-
}
|
589
|
-
staticPosition: false,
|
590
|
-
loadingMoreResults: false,
|
591
|
-
hasMore: false
|
592
|
-
};
|
593
|
-
|
594
|
-
var _initialiseProps = function _initialiseProps() {
|
595
|
-
var _this4 = this;
|
596
|
-
|
597
|
-
this.handleClick = function () {
|
598
|
-
if (_this4.state.open) {
|
599
|
-
_this4.handleClose();
|
600
|
-
} else {
|
601
|
-
/*if (!this.props.staticPosition) {
|
602
|
-
// document.body.style.overflow = 'hidden';
|
603
|
-
}*/
|
604
|
-
_this4.setState({ open: true });
|
605
|
-
var options = _this4.props.options.slice();
|
606
|
-
_this4.handleSuggestions(options);
|
607
|
-
|
608
|
-
if (_this4.props.onClick) {
|
609
|
-
_this4.props.onClick();
|
610
|
-
}
|
611
|
-
|
612
|
-
// Gestion du focus
|
613
|
-
if (!_this4.props.searchable) {
|
614
|
-
// sinon focus sur le dernier élément selectionné
|
615
|
-
_this4.focusOnSelectedItem();
|
616
|
-
}
|
617
|
-
}
|
618
|
-
};
|
619
|
-
|
620
|
-
this.focusOnSelectedItem = function () {
|
621
|
-
// On récupère la div parent "overlay"
|
622
|
-
var overlay = (0, _reactDom.findDOMNode)(_this4.overlay);
|
623
|
-
var multiple = _this4.props.multiple;
|
624
|
-
var value = _this4.props.value;
|
625
|
-
var selectedIdList = Array.isArray(value) ? value : [value];
|
626
|
-
setTimeout(function () {
|
627
|
-
var focused = false;
|
628
|
-
// Si un ou plusieurs items sont selectionnés, on focus sur le dernier
|
629
|
-
if (selectedIdList.length > 0) {
|
630
|
-
var itemSelected = overlay.querySelector('[data-id="' + selectedIdList[selectedIdList.length - 1] + '"]');
|
631
|
-
if (itemSelected && itemSelected.parentElement.tagName === 'LI') {
|
632
|
-
itemSelected.parentElement.focus();
|
633
|
-
focused = true;
|
634
|
-
}
|
635
|
-
}
|
636
|
-
// Si pas d'item selectionné, ou pas visible (en cas de recherche), focus sur le premier
|
637
|
-
if (selectedIdList.length === 0 || !focused) {
|
638
|
-
// On recupère tous les items
|
639
|
-
var items = overlay.getElementsByTagName('li');
|
640
|
-
var itemToFocus = items[0];
|
641
|
-
// Si select multiple, et qu'au moins un selectionné, focus sur le 2e item
|
642
|
-
if (multiple && selectedIdList.length > 0) {
|
643
|
-
itemToFocus = items[1];
|
644
|
-
}
|
645
|
-
if (itemToFocus) {
|
646
|
-
itemToFocus.focus();
|
647
|
-
}
|
648
|
-
}
|
649
|
-
}, 1);
|
650
|
-
};
|
651
|
-
|
652
|
-
this.handleKeyDown = function (event) {
|
653
|
-
var nextItem = void 0;
|
654
|
-
if (event.key === 'ArrowDown') {
|
655
|
-
nextItem = (0, _hiHelpers.getNextItemSelectable)(document.activeElement, 'down');
|
656
|
-
} else if (event.key === 'ArrowUp') {
|
657
|
-
nextItem = (0, _hiHelpers.getNextItemSelectable)(document.activeElement, 'up');
|
658
|
-
} else if (event.key === 'Tab') {
|
659
|
-
/* if (!this.props.staticPosition) {
|
660
|
-
document.body.style.overflow = 'auto';
|
661
|
-
} */
|
662
|
-
_this4.setState({ open: false });
|
663
|
-
} else if (event.key === 'Escape') {
|
664
|
-
_this4.setState({ open: false });
|
665
|
-
}
|
666
|
-
if (nextItem) {
|
667
|
-
nextItem.focus();
|
668
|
-
}
|
669
|
-
};
|
670
|
-
|
671
|
-
this.handleKeyDownSearch = function (event) {
|
672
|
-
if (_this4.overlay && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
673
|
-
_this4.focusOnSelectedItem();
|
674
|
-
} else if (event.key === 'Enter' && _this4.props.onSubmit) {
|
675
|
-
_this4.props.onSubmit(event);
|
676
|
-
}
|
677
|
-
};
|
678
|
-
|
679
|
-
this.handleFocus = function () {
|
680
|
-
_this4.setState({ focused: true });
|
681
|
-
};
|
682
|
-
|
683
|
-
this.handleBlur = function () {
|
684
|
-
_this4.setState({ focused: false });
|
685
|
-
};
|
686
|
-
|
687
|
-
this.handleClose = function () {
|
688
|
-
if (!_this4.props.staticPosition) {
|
689
|
-
//document.body.style.overflow = 'auto';
|
690
|
-
}
|
691
|
-
_this4.setState({
|
692
|
-
open: false
|
693
|
-
});
|
694
|
-
|
695
|
-
if (_this4.props.onClose) {
|
696
|
-
_this4.props.onClose();
|
697
|
-
}
|
698
|
-
if (_this4.selectInputElement) {
|
699
|
-
_this4.selectInputElement.focus();
|
700
|
-
}
|
701
|
-
};
|
702
|
-
|
703
|
-
this.handleClickAway = function (event) {
|
704
|
-
// Au clic sur le bouton, on laisse le handleClick fermer le select
|
705
|
-
if (!_this4.selectInputElement.contains(event.target)) {
|
706
|
-
_this4.handleClose(event);
|
707
|
-
}
|
708
|
-
};
|
709
|
-
|
710
|
-
this.handleSelect = function (event, item) {
|
711
|
-
var _props2 = _this4.props,
|
712
|
-
multiple = _props2.multiple,
|
713
|
-
value = _props2.value,
|
714
|
-
onChange = _props2.onChange,
|
715
|
-
options = _props2.options,
|
716
|
-
hierarchic = _props2.hierarchic,
|
717
|
-
pinnedItem = _props2.pinnedItem;
|
718
|
-
var _state2 = _this4.state,
|
719
|
-
hierarchySelected = _state2.hierarchySelected,
|
720
|
-
hierarchy = _state2.hierarchy,
|
721
|
-
nbOptions = _state2.nbOptions;
|
722
|
-
|
723
|
-
var hiSelected = (0, _extends3.default)({}, hierarchySelected);
|
724
|
-
|
725
|
-
if (multiple) {
|
726
|
-
var valueList = value;
|
727
|
-
if (item.id === '_all') {
|
728
|
-
if (valueList.length === nbOptions) {
|
729
|
-
valueList = [];
|
730
|
-
if (hierarchic) {
|
731
|
-
// if hierarchic select => empty associative array of selected children
|
732
|
-
(0, _keys2.default)(hiSelected).forEach(function (key) {
|
733
|
-
hiSelected[key] = [];
|
734
|
-
});
|
735
|
-
}
|
736
|
-
} else {
|
737
|
-
options.forEach(function (option) {
|
738
|
-
if (option.hasChildren !== true && !valueList.includes(option.id) && option.id !== '_all') {
|
739
|
-
valueList.push(option.id);
|
740
|
-
} else if (option.hasChildren === true) {
|
741
|
-
// if hierarchic select => fill associative array of selected children
|
742
|
-
hiSelected[option.id] = hierarchy[option.id];
|
743
|
-
}
|
744
|
-
});
|
745
|
-
}
|
746
|
-
} else if (valueList.includes(item.id) || item.hasChildren === true && hierarchySelected[item.id].length === hierarchy[item.id].length) {
|
747
|
-
// item déjà sélectionné => on le déselectionne
|
748
|
-
if (item.hasChildren !== true) {
|
749
|
-
valueList = valueList.filter(function (val) {
|
750
|
-
return val !== item.id;
|
751
|
-
});
|
752
|
-
}
|
753
|
-
|
754
|
-
if (item.hasChildren === true) {
|
755
|
-
// remove all children
|
756
|
-
valueList = valueList.filter(function (val) {
|
757
|
-
return !_this4.state.hierarchy[item.id].includes(val);
|
758
|
-
});
|
759
|
-
hiSelected[item.id] = [];
|
760
|
-
} else if (item.hasOwnProperty('parentId')) {
|
761
|
-
// Si item est un enfant on l'enlève du tableau associatif des
|
762
|
-
// elmts sélectionnés
|
763
|
-
hiSelected[item.parentId].splice(hiSelected[item.parentId].indexOf(item.id), 1);
|
764
|
-
}
|
765
|
-
} else {
|
766
|
-
if (pinnedItem && item.id === pinnedItem.id) {
|
767
|
-
(0, _keys2.default)(hiSelected).map(function (parentItemId) {
|
768
|
-
hiSelected[parentItemId] = [];
|
769
|
-
return true;
|
770
|
-
});
|
771
|
-
valueList = [item.id];
|
772
|
-
} else {
|
773
|
-
// item non sélectionné => on le sélectionne
|
774
|
-
if (item.hasChildren !== true) valueList.push(item.id);
|
775
|
-
|
776
|
-
if (pinnedItem && valueList.includes(pinnedItem.id)) {
|
777
|
-
valueList.splice(valueList.indexOf(pinnedItem.id), 1);
|
778
|
-
}
|
779
|
-
}
|
780
|
-
|
781
|
-
if (item.hasChildren === true) {
|
782
|
-
// Si item parent => on ajoute tous les enfants
|
783
|
-
// Ou on les supprime s'ils sont déjà tous sélectionnés (dans une liste filtrée)
|
784
|
-
var idsInSuggestions = [];
|
785
|
-
_this4.state.suggestions.forEach(function (suggestion) {
|
786
|
-
if (_this4.state.hierarchy[item.id].includes(suggestion.id)) {
|
787
|
-
idsInSuggestions.push(suggestion.id);
|
788
|
-
}
|
789
|
-
});
|
790
|
-
// if(hierarchySelected[item.id].length > 0) {}
|
791
|
-
var allChildrenSuggestionsSelected = true;
|
792
|
-
idsInSuggestions.forEach(function (id) {
|
793
|
-
if (!hierarchySelected[item.id].includes(id)) {
|
794
|
-
allChildrenSuggestionsSelected = false;
|
795
|
-
}
|
796
|
-
});
|
797
|
-
|
798
|
-
if (allChildrenSuggestionsSelected === true) {
|
799
|
-
// On supprime les enfants car déjà tous sélectionnés
|
800
|
-
idsInSuggestions.forEach(function (id) {
|
801
|
-
valueList.splice(valueList.indexOf(id), 1);
|
802
|
-
hiSelected[item.id].splice(hiSelected[item.id].indexOf(id), 1);
|
803
|
-
});
|
804
|
-
} else {
|
805
|
-
// On ajoute tous les enfants filtrés au éléments sélectionnés
|
806
|
-
valueList = (0, _hiHelpers.arrayUnique)(valueList.concat(idsInSuggestions));
|
807
|
-
hiSelected[item.id] = (0, _hiHelpers.arrayUnique)(hiSelected[item.id].concat(idsInSuggestions));
|
808
|
-
}
|
809
|
-
|
810
|
-
_this4.setState({ hierarchySelected: hiSelected });
|
811
|
-
} else if (item.hasOwnProperty('parentId')) {
|
812
|
-
// Si item est un enfant on l'ajoute du tableau associatif des
|
813
|
-
// elmts sélectionnés
|
814
|
-
hiSelected[item.parentId].push(item.id);
|
815
|
-
}
|
816
|
-
}
|
817
|
-
_this4.setState({ hierarchySelected: hiSelected });
|
818
|
-
onChange(event, valueList, item);
|
819
|
-
} else {
|
820
|
-
onChange(event, item.id, item);
|
821
|
-
_this4.handleClose();
|
822
|
-
}
|
823
|
-
};
|
824
|
-
|
825
|
-
this.handleSuggestions = function (suggestions) {
|
826
|
-
var _props3 = _this4.props,
|
827
|
-
options = _props3.options,
|
828
|
-
hasAll = _props3.hasAll,
|
829
|
-
iconAll = _props3.iconAll,
|
830
|
-
translations = _props3.translations,
|
831
|
-
multiple = _props3.multiple,
|
832
|
-
showNoResults = _props3.showNoResults,
|
833
|
-
showMinLength = _props3.showMinLength;
|
834
|
-
|
835
|
-
|
836
|
-
if (suggestions.length === 0 && (showNoResults || showMinLength)) {
|
837
|
-
// Handle No Result
|
838
|
-
// FIX to remove all item
|
839
|
-
suggestions = [];
|
840
|
-
suggestions.push({
|
841
|
-
id: '_no_result',
|
842
|
-
type: 'text',
|
843
|
-
disabled: true,
|
844
|
-
centered: true,
|
845
|
-
checkbox: false,
|
846
|
-
label: showNoResults ? translations.no_result_match : translations.min_length
|
847
|
-
});
|
848
|
-
} else if (hasAll && suggestions.length > 0 && suggestions.length === options.length && multiple === true) {
|
849
|
-
// Handle 'All'
|
850
|
-
if (suggestions.filter(function (suggestion) {
|
851
|
-
return suggestion.id === '_all';
|
852
|
-
}).length === 0) {
|
853
|
-
var allItem = {
|
854
|
-
id: '_all',
|
855
|
-
icon: iconAll,
|
856
|
-
label: translations.all
|
857
|
-
};
|
858
|
-
if (iconAll !== false) {
|
859
|
-
allItem.type = 'icon';
|
860
|
-
}
|
861
|
-
suggestions.unshift(allItem);
|
862
|
-
}
|
863
|
-
}
|
864
|
-
|
865
|
-
_this4.setState({
|
866
|
-
suggestions: suggestions
|
867
|
-
});
|
868
|
-
};
|
869
|
-
|
870
|
-
this.handleRequestDelete = function (evt) {
|
871
|
-
evt.stopPropagation();
|
872
|
-
_this4.props.onChange(_this4.props.name, []);
|
873
|
-
};
|
689
|
+
}
|
874
690
|
};
|
875
|
-
|
876
691
|
HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
877
692
|
/**
|
878
693
|
* Affiche une checkbox pour chaque éléments, par défaut si options est nested
|
@@ -894,12 +709,6 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
894
709
|
* Option permettant d'afficher les sélection sous forme de Chip.
|
895
710
|
*/
|
896
711
|
displayAsChip: _propTypes2.default.bool,
|
897
|
-
/**
|
898
|
-
* Option permettant de définir si les options du select sont dynamiques.
|
899
|
-
* Si les options du select sont initialisées à vide, alors ce sera mis à true
|
900
|
-
* automatiquement.
|
901
|
-
*/
|
902
|
-
dynamic: _propTypes2.default.bool.isRequired,
|
903
712
|
/**
|
904
713
|
* Applique le style error
|
905
714
|
*/
|
@@ -912,10 +721,6 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
912
721
|
* Les items sont hiérarchisés
|
913
722
|
*/
|
914
723
|
hierarchic: _propTypes2.default.bool,
|
915
|
-
/**
|
916
|
-
* Indique si l'infinite scroll doit rechercher de nouveaux résultats
|
917
|
-
*/
|
918
|
-
hasMore: _propTypes2.default.bool,
|
919
724
|
/**
|
920
725
|
* Icon affiché lorsque l'item n'est pas sélectionné et qu'on le survole
|
921
726
|
*/
|
@@ -932,28 +737,6 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
932
737
|
* id du select
|
933
738
|
*/
|
934
739
|
id: _propTypes2.default.string,
|
935
|
-
/**
|
936
|
-
* Infinite scroll dans le select dans le cas où il y a beaucoup de résultats à afficher
|
937
|
-
* afin d'éviter un lag du navigateur
|
938
|
-
*/
|
939
|
-
infiniteScroll: _propTypes2.default.bool.isRequired,
|
940
|
-
/**
|
941
|
-
* Ajoute un loader
|
942
|
-
*/
|
943
|
-
loading: _propTypes2.default.bool,
|
944
|
-
/**
|
945
|
-
* Ajoute un loader en bas pour l'infiniteScroll
|
946
|
-
*/
|
947
|
-
loadingMoreResults: _propTypes2.default.bool,
|
948
|
-
/**
|
949
|
-
* Fonction de callback appelée lorsque l'utilisateur arrive en bas de la liste des options
|
950
|
-
* afin de charger les nouvelles options
|
951
|
-
*
|
952
|
-
* @param {int} pageNumber
|
953
|
-
*/
|
954
|
-
loadMoreResults: (0, _reactProptypeConditionalRequire2.default)(_propTypes2.default.func, function (props) {
|
955
|
-
return props.hasOwnProperty('infiniteScroll') && props.infiniteScroll === true;
|
956
|
-
}, INFINITESCROLL_ERROR_MESSAGE),
|
957
740
|
/**
|
958
741
|
* Autorise la sélection de plusieurs valeurs
|
959
742
|
*/
|
@@ -981,22 +764,13 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
981
764
|
* Fonction de callback appelée lorsque le curseur quitte le champs
|
982
765
|
*/
|
983
766
|
onMouseLeave: _propTypes2.default.func,
|
984
|
-
/**
|
985
|
-
* Fonction de callback appelée lorsqu'on vide le champs
|
986
|
-
*/
|
987
|
-
onReset: _propTypes2.default.func,
|
988
767
|
/**
|
989
768
|
* Fonction de callback appelée lorsqu'on écrit dans la barre de recherche
|
990
769
|
* A utiliser pour les selects avec des données dynamiques
|
991
770
|
*
|
992
|
-
* @param {object} event
|
993
771
|
* @param {string} value
|
994
772
|
*/
|
995
773
|
onSearch: _propTypes2.default.func,
|
996
|
-
/**
|
997
|
-
* Fonction de callback à la pression de la touche "Entrée"
|
998
|
-
*/
|
999
|
-
onSubmit: _propTypes2.default.func,
|
1000
774
|
/**
|
1001
775
|
* Listes des options du select
|
1002
776
|
*/
|
@@ -1009,31 +783,10 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1009
783
|
* Les items parents sont sélectionnables
|
1010
784
|
*/
|
1011
785
|
parentItemSelectable: _propTypes2.default.bool,
|
1012
|
-
/**
|
1013
|
-
* Item épinglé en début de liste
|
1014
|
-
*/
|
1015
|
-
pinnedItem: _propTypes2.default.object,
|
1016
|
-
/**
|
1017
|
-
* Placeholder affiché lorsque le select est fermé
|
1018
|
-
* Surcharge le placeholder par défaut
|
1019
|
-
*/
|
1020
|
-
placeholder: _propTypes2.default.string,
|
1021
786
|
/**
|
1022
787
|
* Affiche un input de recherche permettant de filtrer les options
|
1023
788
|
*/
|
1024
789
|
searchable: _propTypes2.default.bool,
|
1025
|
-
/**
|
1026
|
-
* Si true, le contenu du select sera dans une div static plutot que dans une popper absolute
|
1027
|
-
*/
|
1028
|
-
staticPosition: _propTypes2.default.bool,
|
1029
|
-
/**
|
1030
|
-
* Permet d'afficher un message si pas assez de caractères
|
1031
|
-
*/
|
1032
|
-
showMinLength: _propTypes2.default.bool,
|
1033
|
-
/**
|
1034
|
-
* Permet d'afficher un message si aucune options n'est présente
|
1035
|
-
*/
|
1036
|
-
showNoResults: _propTypes2.default.bool,
|
1037
790
|
/**
|
1038
791
|
* Traductions (par défaut en anglais)
|
1039
792
|
*/
|