@hipay/hipay-material-ui 1.0.0-beta.2 → 1.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/HI-CHANGELOG.md +58 -0
  2. package/HiAlertModal/HiAlertModal.js +247 -0
  3. package/HiAlertModal/index.js +16 -0
  4. package/HiBreadcrumb/HiBreadcrumb.js +149 -0
  5. package/HiBreadcrumb/HiStep.js +159 -0
  6. package/HiBreadcrumb/HiStepConnector.js +207 -0
  7. package/HiBreadcrumb/HiStepContent.js +122 -0
  8. package/HiBreadcrumb/HiStepIcon.js +191 -0
  9. package/HiBreadcrumb/HiStepLabel.js +248 -0
  10. package/HiBreadcrumb/HiStepper.js +106 -0
  11. package/HiBreadcrumb/index.js +16 -0
  12. package/HiCheckbox/HiCheckbox.js +4 -1
  13. package/HiChip/HiChip.js +16 -6
  14. package/HiChip/HiChipSwitch.js +11 -4
  15. package/HiColoredLabel/HiColoredLabel.js +9 -3
  16. package/HiDatePicker/HiDatePicker.js +34 -30
  17. package/HiDatePicker/HiDateRangePicker.js +77 -34
  18. package/HiDatePicker/HiDateRangeSelector.js +38 -17
  19. package/HiDatePicker/ListPicker.js +32 -7
  20. package/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
  21. package/HiDatePicker/Overlays/MonthPickerOverlay.js +5 -1
  22. package/HiDatePicker/Overlays/Overlay.js +22 -4
  23. package/HiDatePicker/Overlays/YearPickerOverlay.js +2 -1
  24. package/HiDatePicker/stylesheet.js +11 -0
  25. package/HiDotsStepper/HiDot.js +151 -0
  26. package/HiDotsStepper/HiDotsStepper.js +146 -0
  27. package/HiDotsStepper/index.js +16 -0
  28. package/HiExpansionPanel/HiExpansionPanel.js +231 -0
  29. package/HiExpansionPanel/index.js +16 -0
  30. package/HiForm/HiAddressField.js +187 -0
  31. package/HiForm/HiFormControl.js +39 -31
  32. package/HiForm/HiInput.js +48 -22
  33. package/HiForm/HiSearchField.js +2 -2
  34. package/HiForm/HiSlider.js +399 -0
  35. package/HiForm/HiUpload.js +280 -0
  36. package/HiForm/HiUploadField.js +456 -0
  37. package/HiForm/index.js +36 -0
  38. package/HiMap/HiMap.js +367 -0
  39. package/HiMap/HiMapExpand.js +217 -0
  40. package/HiMap/index.js +25 -0
  41. package/HiPdfReader/HiPdfReader.js +282 -0
  42. package/HiPdfReader/index.js +16 -0
  43. package/HiPins/HiPins.js +0 -1
  44. package/HiSelect/HiSelect.js +401 -354
  45. package/HiSelect/HiSelectField.js +8 -6
  46. package/HiSelect/HiSuggestSelect.js +27 -47
  47. package/HiSelect/HiSuggestSelectField.js +88 -80
  48. package/HiSelect/SelectInput.js +34 -23
  49. package/HiSelectableList/HiSelectableList.js +9 -3
  50. package/HiSelectableList/HiSelectableListItem.js +96 -55
  51. package/HiSwitch/HiSwitchState.js +1 -1
  52. package/HiSwitch/index.js +6 -0
  53. package/HiTable/BodyCellBuilder.js +116 -101
  54. package/HiTable/BodyCells/CellCountry.js +11 -36
  55. package/HiTable/BodyCells/CellIcon.js +29 -20
  56. package/HiTable/BodyCells/CellImage.js +44 -23
  57. package/HiTable/BodyCells/CellLayout.js +50 -21
  58. package/HiTable/BodyCells/CellNumeric.js +7 -2
  59. package/HiTable/BodyCells/CellSentinel.js +26 -17
  60. package/HiTable/BodyCells/CellStatus.js +7 -3
  61. package/HiTable/BodyCells/CellText.js +2 -1
  62. package/HiTable/BodyCells/CellThirdPartySecurity.js +45 -22
  63. package/HiTable/BodyRow.js +106 -62
  64. package/HiTable/ChildRow.js +3 -9
  65. package/HiTable/ColumnFilter.js +28 -15
  66. package/HiTable/HeaderCell.js +25 -20
  67. package/HiTable/HiTable.js +75 -11
  68. package/HiTable/HiTableBody.js +80 -36
  69. package/HiTable/HiTableContextMenu.js +7 -3
  70. package/HiTable/HiTableFooter.js +132 -0
  71. package/HiTable/HiTableFooterScroll.js +1 -1
  72. package/HiTable/HiTableHead.js +24 -7
  73. package/HiTable/OrderColumns.js +6 -2
  74. package/HiTopBar/HiTopBar.js +42 -120
  75. package/es/HiAlertModal/HiAlertModal.js +189 -0
  76. package/es/HiAlertModal/index.js +1 -0
  77. package/es/HiBreadcrumb/HiBreadcrumb.js +81 -0
  78. package/es/HiBreadcrumb/HiStep.js +94 -0
  79. package/es/HiBreadcrumb/HiStepConnector.js +143 -0
  80. package/es/HiBreadcrumb/HiStepContent.js +63 -0
  81. package/es/HiBreadcrumb/HiStepIcon.js +149 -0
  82. package/es/HiBreadcrumb/HiStepLabel.js +197 -0
  83. package/es/HiBreadcrumb/HiStepper.js +46 -0
  84. package/es/HiBreadcrumb/index.js +1 -0
  85. package/es/HiCheckbox/HiCheckbox.js +4 -1
  86. package/es/HiChip/HiChip.js +15 -6
  87. package/es/HiChip/HiChipSwitch.js +11 -4
  88. package/es/HiColoredLabel/HiColoredLabel.js +9 -4
  89. package/es/HiDatePicker/HiDatePicker.js +30 -25
  90. package/es/HiDatePicker/HiDateRangePicker.js +73 -33
  91. package/es/HiDatePicker/HiDateRangeSelector.js +39 -18
  92. package/es/HiDatePicker/ListPicker.js +39 -20
  93. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
  94. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +5 -1
  95. package/es/HiDatePicker/Overlays/Overlay.js +18 -4
  96. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +2 -1
  97. package/es/HiDatePicker/stylesheet.js +11 -0
  98. package/es/HiDotsStepper/HiDot.js +92 -0
  99. package/es/HiDotsStepper/HiDotsStepper.js +83 -0
  100. package/es/HiDotsStepper/index.js +1 -0
  101. package/es/HiExpansionPanel/HiExpansionPanel.js +170 -0
  102. package/es/HiExpansionPanel/index.js +1 -0
  103. package/es/HiForm/HiAddressField.js +127 -0
  104. package/es/HiForm/HiFormControl.js +32 -18
  105. package/es/HiForm/HiInput.js +43 -21
  106. package/es/HiForm/HiSearchField.js +2 -2
  107. package/es/HiForm/HiSlider.js +309 -0
  108. package/es/HiForm/HiUpload.js +194 -0
  109. package/es/HiForm/HiUploadField.js +368 -0
  110. package/es/HiForm/index.js +5 -1
  111. package/es/HiMap/HiMap.js +285 -0
  112. package/es/HiMap/HiMapExpand.js +145 -0
  113. package/es/HiMap/index.js +2 -0
  114. package/es/HiPdfReader/HiPdfReader.js +198 -0
  115. package/es/HiPdfReader/index.js +1 -0
  116. package/es/HiPins/HiPins.js +0 -1
  117. package/es/HiSelect/HiSelect.js +376 -325
  118. package/es/HiSelect/HiSelectField.js +9 -7
  119. package/es/HiSelect/HiSuggestSelect.js +26 -39
  120. package/es/HiSelect/HiSuggestSelectField.js +77 -69
  121. package/es/HiSelect/SelectInput.js +44 -23
  122. package/es/HiSelectableList/HiSelectableList.js +10 -4
  123. package/es/HiSelectableList/HiSelectableListItem.js +91 -55
  124. package/es/HiSwitch/HiSwitchState.js +1 -1
  125. package/es/HiSwitch/index.js +1 -0
  126. package/es/HiTable/BodyCellBuilder.js +112 -102
  127. package/es/HiTable/BodyCells/CellCountry.js +10 -35
  128. package/es/HiTable/BodyCells/CellIcon.js +18 -9
  129. package/es/HiTable/BodyCells/CellImage.js +43 -24
  130. package/es/HiTable/BodyCells/CellLayout.js +51 -24
  131. package/es/HiTable/BodyCells/CellNumeric.js +6 -2
  132. package/es/HiTable/BodyCells/CellSentinel.js +20 -9
  133. package/es/HiTable/BodyCells/CellStatus.js +7 -3
  134. package/es/HiTable/BodyCells/CellText.js +2 -1
  135. package/es/HiTable/BodyCells/CellThirdPartySecurity.js +42 -18
  136. package/es/HiTable/BodyRow.js +106 -61
  137. package/es/HiTable/ChildRow.js +3 -10
  138. package/es/HiTable/ColumnFilter.js +15 -9
  139. package/es/HiTable/HeaderCell.js +25 -19
  140. package/es/HiTable/HiTable.js +73 -12
  141. package/es/HiTable/HiTableBody.js +71 -32
  142. package/es/HiTable/HiTableContextMenu.js +7 -3
  143. package/es/HiTable/HiTableFooter.js +75 -0
  144. package/es/HiTable/HiTableFooterScroll.js +1 -1
  145. package/es/HiTable/HiTableHead.js +19 -7
  146. package/es/HiTable/OrderColumns.js +6 -2
  147. package/es/HiTopBar/HiTopBar.js +45 -111
  148. package/es/styles/createHiMuiTheme.js +13 -0
  149. package/es/utils/hiHelpers.js +6 -5
  150. package/hmu/images/countries/ad.svg +151 -0
  151. package/hmu/images/countries/ae.svg +6 -0
  152. package/hmu/images/countries/af.svg +83 -0
  153. package/hmu/images/countries/ag.svg +15 -0
  154. package/hmu/images/countries/ai.svg +767 -0
  155. package/hmu/images/countries/al.svg +5 -0
  156. package/hmu/images/countries/am.svg +5 -0
  157. package/hmu/images/countries/ao.svg +13 -0
  158. package/hmu/images/countries/aq.svg +6 -0
  159. package/hmu/images/countries/ar.svg +32 -0
  160. package/hmu/images/countries/as.svg +33 -0
  161. package/hmu/images/countries/at.svg +6 -0
  162. package/hmu/images/countries/au.svg +9 -0
  163. package/hmu/images/countries/aw.svg +186 -0
  164. package/hmu/images/countries/ax.svg +18 -0
  165. package/hmu/images/countries/az.svg +8 -0
  166. package/hmu/images/countries/ba.svg +12 -0
  167. package/hmu/images/countries/bb.svg +6 -0
  168. package/hmu/images/countries/bd.svg +4 -0
  169. package/hmu/images/countries/be.svg +7 -0
  170. package/hmu/images/countries/bf.svg +7 -0
  171. package/hmu/images/countries/bg.svg +7 -0
  172. package/hmu/images/countries/bh.svg +11 -0
  173. package/hmu/images/countries/bi.svg +15 -0
  174. package/hmu/images/countries/bj.svg +14 -0
  175. package/hmu/images/countries/bl.svg +7 -0
  176. package/hmu/images/countries/bm.svg +99 -0
  177. package/hmu/images/countries/bn.svg +36 -0
  178. package/hmu/images/countries/bo.svg +686 -0
  179. package/hmu/images/countries/bq.svg +5 -0
  180. package/hmu/images/countries/br.svg +45 -0
  181. package/hmu/images/countries/bs.svg +13 -0
  182. package/hmu/images/countries/bt.svg +89 -0
  183. package/hmu/images/countries/bv.svg +13 -0
  184. package/hmu/images/countries/bw.svg +7 -0
  185. package/hmu/images/countries/by.svg +61 -0
  186. package/hmu/images/countries/bz.svg +146 -0
  187. package/hmu/images/countries/ca.svg +4 -0
  188. package/hmu/images/countries/cc.svg +19 -0
  189. package/hmu/images/countries/cd.svg +5 -0
  190. package/hmu/images/countries/cf.svg +15 -0
  191. package/hmu/images/countries/cg.svg +12 -0
  192. package/hmu/images/countries/ch.svg +9 -0
  193. package/hmu/images/countries/ci.svg +7 -0
  194. package/hmu/images/countries/ck.svg +9 -0
  195. package/hmu/images/countries/cl.svg +13 -0
  196. package/hmu/images/countries/cm.svg +15 -0
  197. package/hmu/images/countries/cn.svg +11 -0
  198. package/hmu/images/countries/co.svg +7 -0
  199. package/hmu/images/countries/cr.svg +7 -0
  200. package/hmu/images/countries/cu.svg +13 -0
  201. package/hmu/images/countries/cv.svg +13 -0
  202. package/hmu/images/countries/cw.svg +14 -0
  203. package/hmu/images/countries/cx.svg +15 -0
  204. package/hmu/images/countries/cy.svg +6 -0
  205. package/hmu/images/countries/cz.svg +12 -0
  206. package/hmu/images/countries/de.svg +5 -0
  207. package/hmu/images/countries/dj.svg +13 -0
  208. package/hmu/images/countries/dk.svg +5 -0
  209. package/hmu/images/countries/dm.svg +152 -0
  210. package/hmu/images/countries/do.svg +6745 -0
  211. package/hmu/images/countries/dz.svg +5 -0
  212. package/hmu/images/countries/ec.svg +141 -0
  213. package/hmu/images/countries/ee.svg +7 -0
  214. package/hmu/images/countries/eg.svg +38 -0
  215. package/hmu/images/countries/eh.svg +15 -0
  216. package/hmu/images/countries/er.svg +8 -0
  217. package/hmu/images/countries/es-ct.svg +4 -0
  218. package/hmu/images/countries/es.svg +581 -0
  219. package/hmu/images/countries/et.svg +14 -0
  220. package/hmu/images/countries/eu.svg +28 -0
  221. package/hmu/images/countries/fi.svg +5 -0
  222. package/hmu/images/countries/fj.svg +124 -0
  223. package/hmu/images/countries/fk.svg +90 -0
  224. package/hmu/images/countries/fm.svg +11 -0
  225. package/hmu/images/countries/fo.svg +12 -0
  226. package/hmu/images/countries/fr.svg +7 -0
  227. package/hmu/images/countries/ga.svg +7 -0
  228. package/hmu/images/countries/gb-eng.svg +5 -0
  229. package/hmu/images/countries/gb-nir.svg +137 -0
  230. package/hmu/images/countries/gb-sct.svg +4 -0
  231. package/hmu/images/countries/gb-wls.svg +9 -0
  232. package/hmu/images/countries/gb.svg +15 -0
  233. package/hmu/images/countries/gd.svg +27 -0
  234. package/hmu/images/countries/ge.svg +6 -0
  235. package/hmu/images/countries/gf.svg +5 -0
  236. package/hmu/images/countries/gg.svg +9 -0
  237. package/hmu/images/countries/gh.svg +6 -0
  238. package/hmu/images/countries/gi.svg +33 -0
  239. package/hmu/images/countries/gl.svg +4 -0
  240. package/hmu/images/countries/gm.svg +14 -0
  241. package/hmu/images/countries/gn.svg +7 -0
  242. package/hmu/images/countries/gp.svg +7 -0
  243. package/hmu/images/countries/gq.svg +23 -0
  244. package/hmu/images/countries/gr.svg +22 -0
  245. package/hmu/images/countries/gs.svg +205 -0
  246. package/hmu/images/countries/gt.svg +204 -0
  247. package/hmu/images/countries/gu.svg +39 -0
  248. package/hmu/images/countries/gw.svg +13 -0
  249. package/hmu/images/countries/gy.svg +9 -0
  250. package/hmu/images/countries/hk.svg +32 -0
  251. package/hmu/images/countries/hm.svg +9 -0
  252. package/hmu/images/countries/hn.svg +18 -0
  253. package/hmu/images/countries/hr.svg +59 -0
  254. package/hmu/images/countries/ht.svg +122 -0
  255. package/hmu/images/countries/hu.svg +7 -0
  256. package/hmu/images/countries/id.svg +6 -0
  257. package/hmu/images/countries/ie.svg +7 -0
  258. package/hmu/images/countries/il.svg +14 -0
  259. package/hmu/images/countries/im.svg +36 -0
  260. package/hmu/images/countries/in.svg +25 -0
  261. package/hmu/images/countries/io.svg +148 -0
  262. package/hmu/images/countries/iq.svg +10 -0
  263. package/hmu/images/countries/ir.svg +219 -0
  264. package/hmu/images/countries/is.svg +12 -0
  265. package/hmu/images/countries/it.svg +7 -0
  266. package/hmu/images/countries/je.svg +32 -0
  267. package/hmu/images/countries/jm.svg +8 -0
  268. package/hmu/images/countries/jo.svg +16 -0
  269. package/hmu/images/countries/jp.svg +11 -0
  270. package/hmu/images/countries/ke.svg +23 -0
  271. package/hmu/images/countries/kg.svg +15 -0
  272. package/hmu/images/countries/kh.svg +69 -0
  273. package/hmu/images/countries/ki.svg +36 -0
  274. package/hmu/images/countries/km.svg +16 -0
  275. package/hmu/images/countries/kn.svg +14 -0
  276. package/hmu/images/countries/kp.svg +15 -0
  277. package/hmu/images/countries/kr.svg +24 -0
  278. package/hmu/images/countries/kw.svg +13 -0
  279. package/hmu/images/countries/ky.svg +63 -0
  280. package/hmu/images/countries/kz.svg +23 -0
  281. package/hmu/images/countries/la.svg +12 -0
  282. package/hmu/images/countries/lb.svg +15 -0
  283. package/hmu/images/countries/lc.svg +8 -0
  284. package/hmu/images/countries/li.svg +43 -0
  285. package/hmu/images/countries/lk.svg +22 -0
  286. package/hmu/images/countries/lr.svg +14 -0
  287. package/hmu/images/countries/ls.svg +8 -0
  288. package/hmu/images/countries/lt.svg +7 -0
  289. package/hmu/images/countries/lu.svg +5 -0
  290. package/hmu/images/countries/lv.svg +6 -0
  291. package/hmu/images/countries/ly.svg +13 -0
  292. package/hmu/images/countries/ma.svg +4 -0
  293. package/hmu/images/countries/mc.svg +6 -0
  294. package/hmu/images/countries/md.svg +72 -0
  295. package/hmu/images/countries/me.svg +118 -0
  296. package/hmu/images/countries/mf.svg +7 -0
  297. package/hmu/images/countries/mg.svg +7 -0
  298. package/hmu/images/countries/mh.svg +7 -0
  299. package/hmu/images/countries/mk.svg +5 -0
  300. package/hmu/images/countries/ml.svg +7 -0
  301. package/hmu/images/countries/mm.svg +16 -0
  302. package/hmu/images/countries/mn.svg +13 -0
  303. package/hmu/images/countries/mo.svg +9 -0
  304. package/hmu/images/countries/mp.svg +86 -0
  305. package/hmu/images/countries/mq.svg +7 -0
  306. package/hmu/images/countries/mr.svg +6 -0
  307. package/hmu/images/countries/ms.svg +39 -0
  308. package/hmu/images/countries/mt.svg +49 -0
  309. package/hmu/images/countries/mu.svg +8 -0
  310. package/hmu/images/countries/mv.svg +6 -0
  311. package/hmu/images/countries/mw.svg +10 -0
  312. package/hmu/images/countries/mx.svg +385 -0
  313. package/hmu/images/countries/my.svg +15 -0
  314. package/hmu/images/countries/mz.svg +21 -0
  315. package/hmu/images/countries/na.svg +16 -0
  316. package/hmu/images/countries/nc.svg +7 -0
  317. package/hmu/images/countries/ne.svg +6 -0
  318. package/hmu/images/countries/nf.svg +9 -0
  319. package/hmu/images/countries/ng.svg +6 -0
  320. package/hmu/images/countries/ni.svg +131 -0
  321. package/hmu/images/countries/nl.svg +7 -0
  322. package/hmu/images/countries/no.svg +7 -0
  323. package/hmu/images/countries/np.svg +14 -0
  324. package/hmu/images/countries/nr.svg +12 -0
  325. package/hmu/images/countries/nu.svg +26 -0
  326. package/hmu/images/countries/nz.svg +41 -0
  327. package/hmu/images/countries/om.svg +116 -0
  328. package/hmu/images/countries/pa.svg +14 -0
  329. package/hmu/images/countries/pe.svg +279 -0
  330. package/hmu/images/countries/pf.svg +19 -0
  331. package/hmu/images/countries/pg.svg +9 -0
  332. package/hmu/images/countries/ph.svg +28 -0
  333. package/hmu/images/countries/pk.svg +15 -0
  334. package/hmu/images/countries/pl.svg +6 -0
  335. package/hmu/images/countries/pm.svg +7 -0
  336. package/hmu/images/countries/pn.svg +62 -0
  337. package/hmu/images/countries/pr.svg +13 -0
  338. package/hmu/images/countries/ps.svg +15 -0
  339. package/hmu/images/countries/pt.svg +57 -0
  340. package/hmu/images/countries/pw.svg +11 -0
  341. package/hmu/images/countries/py.svg +157 -0
  342. package/hmu/images/countries/qa.svg +4 -0
  343. package/hmu/images/countries/re.svg +7 -0
  344. package/hmu/images/countries/ro.svg +7 -0
  345. package/hmu/images/countries/rs.svg +292 -0
  346. package/hmu/images/countries/ru.svg +7 -0
  347. package/hmu/images/countries/rw.svg +13 -0
  348. package/hmu/images/countries/sa.svg +26 -0
  349. package/hmu/images/countries/sb.svg +13 -0
  350. package/hmu/images/countries/sc.svg +14 -0
  351. package/hmu/images/countries/sd.svg +13 -0
  352. package/hmu/images/countries/se.svg +16 -0
  353. package/hmu/images/countries/sg.svg +13 -0
  354. package/hmu/images/countries/sh.svg +74 -0
  355. package/hmu/images/countries/si.svg +18 -0
  356. package/hmu/images/countries/sj.svg +7 -0
  357. package/hmu/images/countries/sk.svg +9 -0
  358. package/hmu/images/countries/sl.svg +7 -0
  359. package/hmu/images/countries/sm.svg +91 -0
  360. package/hmu/images/countries/sn.svg +8 -0
  361. package/hmu/images/countries/so.svg +11 -0
  362. package/hmu/images/countries/sr.svg +6 -0
  363. package/hmu/images/countries/ss.svg +8 -0
  364. package/hmu/images/countries/st.svg +16 -0
  365. package/hmu/images/countries/sv.svg +618 -0
  366. package/hmu/images/countries/sx.svg +56 -0
  367. package/hmu/images/countries/sy.svg +6 -0
  368. package/hmu/images/countries/sz.svg +45 -0
  369. package/hmu/images/countries/tc.svg +67 -0
  370. package/hmu/images/countries/td.svg +7 -0
  371. package/hmu/images/countries/tf.svg +15 -0
  372. package/hmu/images/countries/tg.svg +14 -0
  373. package/hmu/images/countries/th.svg +7 -0
  374. package/hmu/images/countries/tj.svg +22 -0
  375. package/hmu/images/countries/tk.svg +5 -0
  376. package/hmu/images/countries/tl.svg +13 -0
  377. package/hmu/images/countries/tm.svg +213 -0
  378. package/hmu/images/countries/tn.svg +13 -0
  379. package/hmu/images/countries/to.svg +10 -0
  380. package/hmu/images/countries/tr.svg +8 -0
  381. package/hmu/images/countries/tt.svg +5 -0
  382. package/hmu/images/countries/tv.svg +27 -0
  383. package/hmu/images/countries/tw.svg +14 -0
  384. package/hmu/images/countries/tz.svg +13 -0
  385. package/hmu/images/countries/ua.svg +6 -0
  386. package/hmu/images/countries/ug.svg +30 -0
  387. package/hmu/images/countries/um.svg +23 -0
  388. package/hmu/images/countries/un.svg +16 -0
  389. package/hmu/images/countries/us.svg +12 -0
  390. package/hmu/images/countries/uy.svg +28 -0
  391. package/hmu/images/countries/uz.svg +30 -0
  392. package/hmu/images/countries/va.svg +483 -0
  393. package/hmu/images/countries/vc.svg +8 -0
  394. package/hmu/images/countries/ve.svg +26 -0
  395. package/hmu/images/countries/vg.svg +133 -0
  396. package/hmu/images/countries/vi.svg +31 -0
  397. package/hmu/images/countries/vn.svg +11 -0
  398. package/hmu/images/countries/vu.svg +18 -0
  399. package/hmu/images/countries/wf.svg +7 -0
  400. package/hmu/images/countries/ws.svg +7 -0
  401. package/hmu/images/countries/ye.svg +7 -0
  402. package/hmu/images/countries/yt.svg +7 -0
  403. package/hmu/images/countries/za.svg +17 -0
  404. package/hmu/images/countries/zm.svg +27 -0
  405. package/hmu/images/countries/zw.svg +21 -0
  406. package/hmu/images/hipay-white-logo.svg +42 -0
  407. package/hmu/images/logo_visa_75wx45h.gif +0 -0
  408. package/hmu/images/map_marker.svg +8 -0
  409. package/index.es.js +1 -1
  410. package/index.js +1 -1
  411. package/package.json +8 -5
  412. package/styles/createHiMuiTheme.js +13 -0
  413. package/umd/hipay-material-ui.development.js +86185 -41566
  414. package/umd/hipay-material-ui.production.min.js +5 -5
  415. package/utils/hiHelpers.js +6 -4
@@ -144,7 +144,8 @@ class HiChipSwitch extends React.PureComponent {
144
144
  active,
145
145
  onClick,
146
146
  onSelectionClick,
147
- selection
147
+ selection,
148
+ selectionTitle
148
149
  } = this.props;
149
150
  let selectionProps = {
150
151
  tabIndex: '-1'
@@ -154,7 +155,8 @@ class HiChipSwitch extends React.PureComponent {
154
155
  onClick: this.handleClickSelection,
155
156
  role: 'button',
156
157
  tabIndex: '0',
157
- onKeyDown: this.handleKeyDownSelection
158
+ onKeyDown: this.handleKeyDownSelection,
159
+ title: selectionTitle
158
160
  };
159
161
  }
160
162
 
@@ -205,7 +207,8 @@ class HiChipSwitch extends React.PureComponent {
205
207
  HiChipSwitch.defaultProps = {
206
208
  activeIcon: 'check',
207
209
  active: false,
208
- selection: null
210
+ selection: null,
211
+ selectionTitle: ''
209
212
  };
210
213
  HiChipSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
211
214
  /**
@@ -239,6 +242,10 @@ HiChipSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
239
242
  /**
240
243
  * nombre de valeurs selectionnées.
241
244
  */
242
- selection: PropTypes.number
245
+ selection: PropTypes.number,
246
+ /**
247
+ * Title de la selection.
248
+ */
249
+ selectionTitle: PropTypes.string
243
250
  } : {};
244
251
  export default withStyles(styles, { name: 'HmuiHiChipSwitch' })(HiChipSwitch);
@@ -32,7 +32,7 @@ export const styles = theme => ({
32
32
  * Label with background color & text color
33
33
  */
34
34
  function HiColoredLabel(props) {
35
- const { classes, label, color, active, beta } = props;
35
+ const { classes, className, label, color, active, beta } = props;
36
36
  let fontWeight = 400;
37
37
  if (beta) {
38
38
  fontWeight = 600;
@@ -42,7 +42,7 @@ function HiColoredLabel(props) {
42
42
  return React.createElement(
43
43
  'div',
44
44
  {
45
- className: classNames(classes.root, { [classes.beta]: beta }),
45
+ className: classNames(classes.root, { [classes.beta]: beta }, className),
46
46
  style: {
47
47
  backgroundColor: active ? color : fade(color, 0.08),
48
48
  color: active ? getContrastedTextColor(color, '#4C4C4C', '#FFF') : color,
@@ -67,6 +67,10 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
67
67
  * Surcharge les classes du composant
68
68
  */
69
69
  classes: PropTypes.object,
70
+ /**
71
+ * Surcharge les classes du composant
72
+ */
73
+ className: PropTypes.string,
70
74
  /**
71
75
  * Couleur du text & du background
72
76
  */
@@ -74,11 +78,12 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
74
78
  /**
75
79
  * Label à afficher
76
80
  */
77
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
81
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]).isRequired
78
82
  } : {};
79
83
 
80
84
  HiColoredLabel.defaultProps = {
81
- active: false
85
+ active: false,
86
+ color: '#737373'
82
87
  };
83
88
 
84
89
  export default withStyles(styles, { name: 'HmuiHiColoredLabel' })(HiColoredLabel);
@@ -33,6 +33,7 @@ class HiDatePicker extends React.Component {
33
33
  this.handleDayChange = this.handleDayChange.bind(this);
34
34
  this.handleCurrentMonthChange = this.handleCurrentMonthChange.bind(this);
35
35
  this.handleReset = this.handleReset.bind(this);
36
+ this.handleTimeChange = this.handleTimeChange.bind(this);
36
37
  this.openPanel = this.openPanel.bind(this);
37
38
  this.renderCaption = this.renderCaption.bind(this);
38
39
  this.renderOverlay = this.renderOverlay.bind(this);
@@ -51,31 +52,26 @@ class HiDatePicker extends React.Component {
51
52
  }
52
53
 
53
54
  handleDayChange(day, modifiers) {
54
- this.timeout = setTimeout(() => {
55
- if (this.datePickerInput && this.datePickerInput.getInput()) {
56
- this.datePickerInput.getInput().focus();
57
- }
58
- }, 0);
59
-
60
- if (modifiers.disabled) {
61
- return; // TODO: delete ??
62
- }
63
-
64
- if (this.props.onChange) {
65
- if (modifiers.selected) {
66
- // Deselect day
67
- this.props.onChange(undefined);
68
- } else {
69
- // Keep Time if set
70
- if (this.props.enableTime) {
71
- if (this.props.value) {
72
- day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
73
- } else {
74
- day.setHours(0, 0);
75
- }
55
+ if (modifiers.selected) {
56
+ // Deselect day
57
+ this.props.onChange(undefined);
58
+ } else {
59
+ // Keep Time if set
60
+ if (this.props.enableTime && day !== undefined) {
61
+ if (this.props.value) {
62
+ day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
63
+ } else {
64
+ day.setHours(0, 0);
76
65
  }
77
- this.props.onChange(day);
78
66
  }
67
+ this.props.onChange(day);
68
+ }
69
+ if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
70
+ // Hide overlay & remove focus on input
71
+ document.activeElement.blur();
72
+ } else if (day instanceof Date && this.props.enableTime && modifiers.selected !== true) {
73
+ // Open Time panel after date selection
74
+ this.openPanel('time');
79
75
  }
80
76
  }
81
77
 
@@ -103,6 +99,13 @@ class HiDatePicker extends React.Component {
103
99
  });
104
100
  }
105
101
 
102
+ handleTimeChange(date, precision) {
103
+ this.props.onChange(date);
104
+ if (date instanceof Date && precision === 'minute') {
105
+ document.activeElement.blur();
106
+ }
107
+ }
108
+
106
109
  openPanel(panel) {
107
110
  this.setState({
108
111
  openedPanel: panel
@@ -144,7 +147,7 @@ class HiDatePicker extends React.Component {
144
147
  renderTimePickerOverlay(propsOverlay) {
145
148
  const timePickerProps = {
146
149
  value: this.props.value,
147
- onChange: this.props.onChange,
150
+ onChange: this.handleTimeChange,
148
151
  onCalendarClick: this.handleCalendarClick
149
152
  };
150
153
  return React.createElement(TimePickerOverlay, _extends({ key: 'time-picker-overlay' }, timePickerProps, propsOverlay));
@@ -296,8 +299,10 @@ HiDatePicker.propTypes = process.env.NODE_ENV !== "production" ? {
296
299
  minimumDate: PropTypes.instanceOf(Date),
297
300
  /**
298
301
  * Callback à la sélection d'une date
302
+ *
303
+ * @param {Date} date sélectionnée
299
304
  */
300
- onChange: PropTypes.func,
305
+ onChange: PropTypes.func.isRequired,
301
306
  /**
302
307
  * Callback au reset de l'input
303
308
  */
@@ -6,6 +6,8 @@ import React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { formatDate, parseDate } from 'react-day-picker/moment';
8
8
  import DayPickerInput from 'react-day-picker/DayPickerInput';
9
+ import classNames from 'classnames';
10
+
9
11
  import withStyles from '../styles/withStyles';
10
12
  import { capitalizeFirstLetter } from '../utils/helpers';
11
13
  import Caption from './Caption';
@@ -23,11 +25,14 @@ class HiDateRangePicker extends React.Component {
23
25
  constructor(props) {
24
26
  super();
25
27
 
28
+ this.handleDayPickerFocus = name => () => {
29
+ this.setState({ focusedInput: name });
30
+ };
31
+
26
32
  this.state = {
27
- fromOpenedPanel: 'calendar',
28
33
  fromCurrentMonth: props.from ? props.from : new Date(),
29
- toOpenedPanel: 'calendar',
30
- toCurrentMonth: props.to ? props.to : new Date()
34
+ toCurrentMonth: props.to ? props.to : new Date(),
35
+ focusedInput: ''
31
36
  };
32
37
 
33
38
  this.handleReset = this.handleReset.bind(this);
@@ -51,6 +56,8 @@ class HiDateRangePicker extends React.Component {
51
56
  this.handleYearClick = this.handleYearClick.bind(this);
52
57
  this.handleYearClickFrom = this.handleYearClickFrom.bind(this);
53
58
  this.handleYearClickTo = this.handleYearClickTo.bind(this);
59
+ this.handleDayPickerFocus = this.handleDayPickerFocus.bind(this);
60
+ this.handleDayPickerBlur = this.handleDayPickerBlur.bind(this);
54
61
 
55
62
  this.openPanel = this.openPanel.bind(this);
56
63
 
@@ -105,11 +112,11 @@ class HiDateRangePicker extends React.Component {
105
112
  // else focus current input
106
113
  if (!this.props.enableTime) {
107
114
  if (day instanceof Date) {
108
- this.timeout = setTimeout(() => {
109
- if (this.toInput && this.toInput.getInput()) {
110
- this.toInput.getInput().focus();
111
- }
112
- }, 0);
115
+ if (name === 'from' && this.toInput) {
116
+ this.toInput.getInput().focus();
117
+ } else if (name === 'to') {
118
+ document.activeElement.blur();
119
+ }
113
120
  }
114
121
  } else {
115
122
  this.timeout = setTimeout(() => {
@@ -199,12 +206,18 @@ class HiDateRangePicker extends React.Component {
199
206
  this.props.onChange(name, date);
200
207
  if (name === 'from' && precision === 'minute') {
201
208
  this.fromInput.hideDayPicker();
209
+ this.toInput.getInput().focus();
202
210
  this.toInput.showDayPicker();
203
211
  } else if (name === 'to' && precision === 'minute') {
204
212
  this.toInput.hideDayPicker();
213
+ document.activeElement.blur();
205
214
  }
206
215
  }
207
216
 
217
+ handleDayPickerBlur() {
218
+ this.setState({ focusedInput: '' });
219
+ }
220
+
208
221
  openPanel(name, panel) {
209
222
  this.setState({
210
223
  [`${name}OpenedPanel`]: panel
@@ -237,9 +250,10 @@ class HiDateRangePicker extends React.Component {
237
250
  return this.renderNavbar('to', propsNavbar);
238
251
  }
239
252
 
240
- renderOverlay(name, propsOverlay) {
253
+ renderOverlay(name, propsOverlay, staticPosition) {
241
254
  const rangeOverlayProps = _extends({}, propsOverlay, {
242
- side: name
255
+ side: name,
256
+ staticPosition
243
257
  });
244
258
 
245
259
  switch (this.state[`${name}OpenedPanel`]) {
@@ -255,10 +269,10 @@ class HiDateRangePicker extends React.Component {
255
269
  }
256
270
  }
257
271
  renderOverlayFrom(propsOverlay) {
258
- return this.renderOverlay('from', propsOverlay);
272
+ return this.renderOverlay('from', propsOverlay, this.props.staticPosition);
259
273
  }
260
274
  renderOverlayTo(propsOverlay) {
261
- return this.renderOverlay('to', propsOverlay);
275
+ return this.renderOverlay('to', propsOverlay, this.props.staticPosition);
262
276
  }
263
277
 
264
278
  renderMonthPickerOverlay(name, propsOverlay) {
@@ -313,9 +327,10 @@ class HiDateRangePicker extends React.Component {
313
327
  onReset,
314
328
  to,
315
329
  translations,
316
- id
330
+ id,
331
+ staticPosition
317
332
  } = _props,
318
- props = _objectWithoutProperties(_props, ['classes', 'disabledDays', 'disablePastDays', 'disableFutureDays', 'enableTime', 'labelFrom', 'labelTo', 'locale', 'format', 'from', 'minimumDate', 'onReset', 'to', 'translations', 'id']);
333
+ props = _objectWithoutProperties(_props, ['classes', 'disabledDays', 'disablePastDays', 'disableFutureDays', 'enableTime', 'labelFrom', 'labelTo', 'locale', 'format', 'from', 'minimumDate', 'onReset', 'to', 'translations', 'id', 'staticPosition']);
319
334
 
320
335
  const { fromCurrentMonth, toCurrentMonth } = this.state;
321
336
 
@@ -427,32 +442,52 @@ class HiDateRangePicker extends React.Component {
427
442
  id: `${id}-to`
428
443
  });
429
444
 
445
+ let fromClass = classNames({
446
+ [classes.absolute]: staticPosition === true && this.state.focusedInput === 'to',
447
+ [classes.dayPickerMargin]: staticPosition === true && this.state.focusedInput === 'to'
448
+ });
449
+ let toClass = classNames(classes.toInput, {
450
+ [classes.absolute]: staticPosition === true && this.state.focusedInput === 'from'
451
+ });
452
+
430
453
  return React.createElement(
431
454
  'div',
432
- { className: classes.root },
455
+ { className: classNames(classes.root, classes.rangePickerContainer) },
433
456
  React.createElement(
434
457
  'div',
435
- { className: classes.fromInput },
436
- React.createElement(DayPickerInput, {
437
- ref: el => {
438
- this.fromInput = el;
439
- },
440
- value: from,
441
- hideOnDayClick: false,
442
- overlayComponent: this.renderOverlayFrom,
443
- dayPickerProps: fromDayPickerProps,
444
- component: HiTextField,
445
- inputProps: fromInputProps,
446
- format: enableTime ? `${format} HH:mm` : format,
447
- formatDate: formatDate,
448
- parseDate: parseDate,
449
- onDayChange: this.handleDayChangeFrom,
450
- placeholder: ''
451
- })
458
+ {
459
+ className: classes.fromInput,
460
+ onFocus: this.handleDayPickerFocus('from'),
461
+ onBlur: this.handleDayPickerBlur
462
+ },
463
+ React.createElement(
464
+ 'div',
465
+ { className: fromClass },
466
+ React.createElement(DayPickerInput, {
467
+ ref: el => {
468
+ this.fromInput = el;
469
+ },
470
+ value: from,
471
+ hideOnDayClick: false,
472
+ overlayComponent: this.renderOverlayFrom,
473
+ dayPickerProps: fromDayPickerProps,
474
+ component: HiTextField,
475
+ inputProps: fromInputProps,
476
+ format: enableTime ? `${format} HH:mm` : format,
477
+ formatDate: formatDate,
478
+ parseDate: parseDate,
479
+ onDayChange: this.handleDayChangeFrom,
480
+ placeholder: ''
481
+ })
482
+ )
452
483
  ),
453
484
  React.createElement(
454
485
  'div',
455
- { className: classes.toInput },
486
+ {
487
+ className: toClass,
488
+ onFocus: this.handleDayPickerFocus('to'),
489
+ onBlur: this.handleDayPickerBlur
490
+ },
456
491
  React.createElement(DayPickerInput, {
457
492
  ref: el => {
458
493
  this.toInput = el;
@@ -478,6 +513,7 @@ HiDateRangePicker.defaultProps = {
478
513
  disabledDays: [],
479
514
  disablePastDays: false,
480
515
  disableFutureDays: false,
516
+ staticPosition: false,
481
517
  enableTime: false,
482
518
  format: 'YYYY-DD-MM',
483
519
  labelFrom: 'Start',
@@ -553,6 +589,10 @@ HiDateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? {
553
589
  * Callback au reset de l'input
554
590
  */
555
591
  onReset: PropTypes.func,
592
+ /**
593
+ * Si true, le calendrier sera dans une div static plutot que dans une popper absolute
594
+ */
595
+ staticPosition: PropTypes.bool,
556
596
  /**
557
597
  * Date de fin sélectionnée
558
598
  */
@@ -27,10 +27,10 @@ export function buildDateRangeOptionByKey(key, t, format) {
27
27
  type = 'primary-highlight';
28
28
  break;
29
29
  case 'cd':
30
- label = t.last_24h;
31
- from = moment().subtract(1, 'day');
32
- to = moment();
33
- info = `${from.calendar()} ${t.to_now}`;
30
+ label = t.today;
31
+ from = moment().startOf('day');
32
+ to = moment().endOf('day');
33
+ info = `${from.format(format)}`;
34
34
  break;
35
35
  case 'pd':
36
36
  label = t.yesterday;
@@ -97,7 +97,8 @@ export function buildDateRangeOptionByKey(key, t, format) {
97
97
  export const styles = theme => ({
98
98
  root: {
99
99
  maxWidth: 500,
100
- marginLeft: -4
100
+ marginLeft: -4,
101
+ alignItems: 'flex-start'
101
102
  },
102
103
  dateSelect: {
103
104
  paddingTop: 1,
@@ -105,7 +106,9 @@ export const styles = theme => ({
105
106
  },
106
107
  dateRangePicker: {
107
108
  width: 'calc(100% + 8px)'
108
- }
109
+ },
110
+ smSelect: {},
111
+ smRangePicker: {}
109
112
  });
110
113
 
111
114
  class HiDateRangeSelector extends React.Component {
@@ -127,6 +130,9 @@ class HiDateRangeSelector extends React.Component {
127
130
  this.props.onChange('to', selectedOption.to.toDate());
128
131
  }
129
132
  }
133
+ if (this.props.returnSelectValue === true) {
134
+ this.props.onChange('period', value);
135
+ }
130
136
  };
131
137
 
132
138
  this.state = {
@@ -171,9 +177,11 @@ class HiDateRangeSelector extends React.Component {
171
177
  required,
172
178
  to,
173
179
  translations,
174
- classes
180
+ classes,
181
+ selectProps,
182
+ staticPosition
175
183
  } = _props,
176
- props = _objectWithoutProperties(_props, ['disabled', 'enableTime', 'error', 'errorText', 'helperIcon', 'helperText', 'idRange', 'idSelect', 'label', 'from', 'onChange', 'required', 'to', 'translations', 'classes']);
184
+ props = _objectWithoutProperties(_props, ['disabled', 'enableTime', 'error', 'errorText', 'helperIcon', 'helperText', 'idRange', 'idSelect', 'label', 'from', 'onChange', 'required', 'to', 'translations', 'classes', 'selectProps', 'staticPosition']);
177
185
 
178
186
  const { selectedPreset } = this.state;
179
187
 
@@ -187,8 +195,8 @@ class HiDateRangeSelector extends React.Component {
187
195
  },
188
196
  React.createElement(
189
197
  Grid,
190
- { item: true, xs: 12, sm: 4 },
191
- React.createElement(HiSelectField, {
198
+ { item: true, xs: 12, sm: 4, classes: { 'grid-sm-4': classes.smSelect } },
199
+ React.createElement(HiSelectField, _extends({
192
200
  disabled: disabled,
193
201
  error: error,
194
202
  errorText: errorText,
@@ -203,12 +211,13 @@ class HiDateRangeSelector extends React.Component {
203
211
  translations: translations,
204
212
  value: selectedPreset,
205
213
  containerWidth: this.state.containerWidth,
206
- classes: { root: classes.dateSelect }
207
- })
214
+ classes: { root: classes.dateSelect },
215
+ staticPosition: staticPosition
216
+ }, selectProps))
208
217
  ),
209
218
  React.createElement(
210
219
  Grid,
211
- { item: true, xs: 12, sm: 8 },
220
+ { item: true, xs: 12, sm: 8, classes: { 'grid-sm-8': classes.smRangePicker } },
212
221
  React.createElement(HiDateRangePicker, _extends({
213
222
  classes: { root: classes.dateRangePicker },
214
223
  id: idRange,
@@ -218,7 +227,8 @@ class HiDateRangeSelector extends React.Component {
218
227
  onChange: onChange,
219
228
  onReset: this.handleReset,
220
229
  disabled: disabled || selectedPreset !== 'custom',
221
- translations: translations
230
+ translations: translations,
231
+ staticPosition: staticPosition
222
232
  }, props))
223
233
  )
224
234
  );
@@ -229,22 +239,21 @@ HiDateRangeSelector.defaultProps = {
229
239
  availableOptionKeys: ['cd', 'pd', 'cw', 'pw', 'cm', 'pm', 'cq', 'pq', 'cy', 'custom'],
230
240
  defaultPreset: 'cd',
231
241
  enableTime: false,
242
+ returnSelectValue: false,
243
+ staticPosition: false,
232
244
  locale: 'fr-FR',
233
245
  format: 'YYYY-DD-MM',
234
246
  translations: {
235
- today: 'today',
247
+ today: 'Today',
236
248
  hour: 'Hour',
237
249
  minute: 'Minute',
238
250
  month: 'Month',
239
251
  quarter: 'Quarter',
240
252
  week: 'Week',
241
253
  year: 'Year',
242
-
243
254
  days: 'days',
244
-
245
255
  custom_period: 'Custom Period',
246
256
  yesterday: 'Yesterday',
247
- last_24h: 'Last 24h',
248
257
  to: 'to',
249
258
  to_now: 'to now',
250
259
  current_week: 'Current Week',
@@ -325,6 +334,18 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
325
334
  * true si champs obligatoire
326
335
  */
327
336
  required: PropTypes.bool,
337
+ /**
338
+ * Retourne la valeur du select de la période au change du select
339
+ */
340
+ returnSelectValue: PropTypes.bool.isRequired,
341
+ /**
342
+ * Props passées au HiSelectField
343
+ */
344
+ selectProps: PropTypes.object,
345
+ /**
346
+ * Si true, le calendrier sera dans une div static plutot que dans une popper absolute
347
+ */
348
+ staticPosition: PropTypes.bool,
328
349
  /**
329
350
  * Date de fin sélectionnée
330
351
  */
@@ -2,6 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
+ import classNames from 'classnames';
5
6
  import { Scrollbars } from 'react-custom-scrollbars';
6
7
  import { MenuList, MenuItem } from 'material-ui/Menu';
7
8
  import withStyles from '../styles/withStyles';
@@ -18,19 +19,27 @@ export const styles = theme => ({
18
19
  },
19
20
  itemCentered: {
20
21
  margin: 'auto'
22
+ },
23
+ currentDateItem: {
24
+ color: `${theme.palette.business.primary.normal} !important`
21
25
  }
22
26
  });
23
27
 
24
28
  class ListPicker extends React.PureComponent {
25
29
 
26
30
  componentDidMount() {
27
- if (this.props.initAtMiddleScroll && this.scrollbars) {
31
+ if (this.position && this.scrollbars) {
32
+ this.scrollbars.scrollTop((this.position - 2) * 40);
33
+ } else if (this.props.initAtMiddleScroll && this.scrollbars) {
28
34
  this.scrollbars.scrollTop((this.scrollbars.getScrollHeight() - this.scrollbars.getClientHeight()) / 2 + 20);
29
35
  }
30
36
  }
31
37
 
32
38
  render() {
33
- const { classes, itemList, onItemClick, selectedItem } = this.props;
39
+ const { classes, itemList, onItemClick, selectedItem, type } = this.props;
40
+
41
+ this.position = itemList.indexOf(selectedItem);
42
+ let now = new Date();
34
43
 
35
44
  return React.createElement(
36
45
  Scrollbars,
@@ -43,30 +52,36 @@ class ListPicker extends React.PureComponent {
43
52
  React.createElement(
44
53
  MenuList,
45
54
  null,
46
- itemList.map(item => React.createElement(
47
- MenuItem,
48
- {
49
- key: `item-${item}`,
50
- classes: {
51
- root: classes.itemRoot,
52
- selected: classes.itemSelected
55
+ itemList.map((item, index) => {
56
+ const labelClass = classNames(classes.itemCentered, {
57
+ [classes.currentDateItem]: type === 'year' && now.getFullYear() === item || type === 'month' && now.getMonth() === index
58
+ });
59
+
60
+ return React.createElement(
61
+ MenuItem,
62
+ {
63
+ key: `item-${item}`,
64
+ classes: {
65
+ root: classes.itemRoot,
66
+ selected: classes.itemSelected
67
+ },
68
+ onClick: () => onItemClick(item),
69
+ selected: item === selectedItem
53
70
  },
54
- onClick: () => onItemClick(item),
55
- selected: item === selectedItem
56
- },
57
- React.createElement(
58
- 'span',
59
- { className: classes.itemCentered },
60
- item
61
- )
62
- ))
71
+ React.createElement(
72
+ 'span',
73
+ { className: labelClass },
74
+ item
75
+ )
76
+ );
77
+ })
63
78
  )
64
79
  );
65
80
  }
66
81
  }
67
82
 
68
83
  ListPicker.defaultProps = {
69
- initAtMiddleScroll: false
84
+ initAtMiddleScroll: true
70
85
  };
71
86
  ListPicker.propTypes = process.env.NODE_ENV !== "production" ? {
72
87
  /**
@@ -88,6 +103,10 @@ ListPicker.propTypes = process.env.NODE_ENV !== "production" ? {
88
103
  /**
89
104
  * Item sélectionné
90
105
  */
91
- selectedItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
106
+ selectedItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
107
+ /**
108
+ * Type des données dans la liste
109
+ */
110
+ type: PropTypes.oneOf(['year', 'month'])
92
111
  } : {};
93
112
  export default withStyles(styles, { name: 'HmuiListPicker' })(ListPicker);
@@ -70,9 +70,11 @@ const CustomOverlayLayout = (_ref) => {
70
70
  [classes.right]: side === 'to'
71
71
  });
72
72
 
73
+ let paperProps = _extends({}, props);
74
+
73
75
  return React.createElement(
74
76
  Paper,
75
- { className: paperClass },
77
+ { className: paperClass, onBlur: paperProps.onBlur, onFocus: paperProps.onFocus },
76
78
  React.createElement(
77
79
  'div',
78
80
  { className: classes.overlay },
@@ -34,13 +34,17 @@ class MonthPickerOverlay extends React.Component {
34
34
  { value, translations } = _props,
35
35
  props = _objectWithoutProperties(_props, ['value', 'translations']);
36
36
 
37
+ let now = new Date();
38
+ let currentMonth = props.localeUtils ? props.localeUtils.getMonths()[now.getMonth()] : props.children.props.localeUtils.getMonths()[now.getMonth()];
39
+
37
40
  return React.createElement(
38
41
  CustomOverlayLayout,
39
42
  _extends({ headerElement: translations.month }, props),
40
43
  React.createElement(ListPicker, {
41
44
  itemList: this.months,
42
45
  onItemClick: this.handleMonthClick,
43
- selectedItem: value ? value.getMonth() : null
46
+ selectedItem: currentMonth,
47
+ type: 'month'
44
48
  })
45
49
  );
46
50
  }