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