@hipay/hipay-material-ui 1.0.0-beta.5 → 1.0.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. package/HI-CHANGELOG.md +42 -0
  2. package/HiAlertModal/HiAlertModal.js +247 -0
  3. package/HiAlertModal/index.js +16 -0
  4. package/HiColoredLabel/HiColoredLabel.js +2 -1
  5. package/HiDatePicker/HiDateRangeSelector.js +8 -0
  6. package/HiExpansionPanel/HiExpansionPanel.js +231 -0
  7. package/HiExpansionPanel/index.js +16 -0
  8. package/HiForm/HiFormControl.js +3 -0
  9. package/HiSelect/HiSelect.js +50 -34
  10. package/HiSelectableList/HiSelectableListItem.js +35 -9
  11. package/HiTable/BodyCells/CellCountry.js +1 -1
  12. package/HiTopBar/HiTopBar.js +0 -4
  13. package/es/HiAlertModal/HiAlertModal.js +189 -0
  14. package/es/HiAlertModal/index.js +1 -0
  15. package/es/HiColoredLabel/HiColoredLabel.js +2 -1
  16. package/es/HiDatePicker/HiDateRangeSelector.js +8 -0
  17. package/es/HiExpansionPanel/HiExpansionPanel.js +170 -0
  18. package/es/HiExpansionPanel/index.js +1 -0
  19. package/es/HiForm/HiFormControl.js +3 -0
  20. package/es/HiSelect/HiSelect.js +49 -34
  21. package/es/HiSelectableList/HiSelectableListItem.js +31 -9
  22. package/es/HiTable/BodyCells/CellCountry.js +1 -1
  23. package/es/HiTopBar/HiTopBar.js +0 -4
  24. package/es/styles/createHiMuiTheme.js +4 -0
  25. package/hmu/images/countries/ad.svg +151 -0
  26. package/hmu/images/countries/ae.svg +6 -0
  27. package/hmu/images/countries/af.svg +83 -0
  28. package/hmu/images/countries/ag.svg +15 -0
  29. package/hmu/images/countries/ai.svg +767 -0
  30. package/hmu/images/countries/al.svg +5 -0
  31. package/hmu/images/countries/am.svg +5 -0
  32. package/hmu/images/countries/ao.svg +13 -0
  33. package/hmu/images/countries/aq.svg +6 -0
  34. package/hmu/images/countries/ar.svg +32 -0
  35. package/hmu/images/countries/as.svg +33 -0
  36. package/hmu/images/countries/at.svg +6 -0
  37. package/hmu/images/countries/au.svg +9 -0
  38. package/hmu/images/countries/aw.svg +186 -0
  39. package/hmu/images/countries/ax.svg +18 -0
  40. package/hmu/images/countries/az.svg +8 -0
  41. package/hmu/images/countries/ba.svg +12 -0
  42. package/hmu/images/countries/bb.svg +6 -0
  43. package/hmu/images/countries/bd.svg +4 -0
  44. package/hmu/images/countries/be.svg +7 -0
  45. package/hmu/images/countries/bf.svg +7 -0
  46. package/hmu/images/countries/bg.svg +7 -0
  47. package/hmu/images/countries/bh.svg +11 -0
  48. package/hmu/images/countries/bi.svg +15 -0
  49. package/hmu/images/countries/bj.svg +14 -0
  50. package/hmu/images/countries/bl.svg +7 -0
  51. package/hmu/images/countries/bm.svg +99 -0
  52. package/hmu/images/countries/bn.svg +36 -0
  53. package/hmu/images/countries/bo.svg +686 -0
  54. package/hmu/images/countries/bq.svg +5 -0
  55. package/hmu/images/countries/br.svg +45 -0
  56. package/hmu/images/countries/bs.svg +13 -0
  57. package/hmu/images/countries/bt.svg +89 -0
  58. package/hmu/images/countries/bv.svg +13 -0
  59. package/hmu/images/countries/bw.svg +7 -0
  60. package/hmu/images/countries/by.svg +61 -0
  61. package/hmu/images/countries/bz.svg +146 -0
  62. package/hmu/images/countries/ca.svg +4 -0
  63. package/hmu/images/countries/cc.svg +19 -0
  64. package/hmu/images/countries/cd.svg +5 -0
  65. package/hmu/images/countries/cf.svg +15 -0
  66. package/hmu/images/countries/cg.svg +12 -0
  67. package/hmu/images/countries/ch.svg +9 -0
  68. package/hmu/images/countries/ci.svg +7 -0
  69. package/hmu/images/countries/ck.svg +9 -0
  70. package/hmu/images/countries/cl.svg +13 -0
  71. package/hmu/images/countries/cm.svg +15 -0
  72. package/hmu/images/countries/cn.svg +11 -0
  73. package/hmu/images/countries/co.svg +7 -0
  74. package/hmu/images/countries/cr.svg +7 -0
  75. package/hmu/images/countries/cu.svg +13 -0
  76. package/hmu/images/countries/cv.svg +13 -0
  77. package/hmu/images/countries/cw.svg +14 -0
  78. package/hmu/images/countries/cx.svg +15 -0
  79. package/hmu/images/countries/cy.svg +6 -0
  80. package/hmu/images/countries/cz.svg +12 -0
  81. package/hmu/images/countries/de.svg +5 -0
  82. package/hmu/images/countries/dj.svg +13 -0
  83. package/hmu/images/countries/dk.svg +5 -0
  84. package/hmu/images/countries/dm.svg +152 -0
  85. package/hmu/images/countries/do.svg +6745 -0
  86. package/hmu/images/countries/dz.svg +5 -0
  87. package/hmu/images/countries/ec.svg +141 -0
  88. package/hmu/images/countries/ee.svg +7 -0
  89. package/hmu/images/countries/eg.svg +38 -0
  90. package/hmu/images/countries/eh.svg +15 -0
  91. package/hmu/images/countries/er.svg +8 -0
  92. package/hmu/images/countries/es-ct.svg +4 -0
  93. package/hmu/images/countries/es.svg +581 -0
  94. package/hmu/images/countries/et.svg +14 -0
  95. package/hmu/images/countries/eu.svg +28 -0
  96. package/hmu/images/countries/fi.svg +5 -0
  97. package/hmu/images/countries/fj.svg +124 -0
  98. package/hmu/images/countries/fk.svg +90 -0
  99. package/hmu/images/countries/fm.svg +11 -0
  100. package/hmu/images/countries/fo.svg +12 -0
  101. package/hmu/images/countries/fr.svg +7 -0
  102. package/hmu/images/countries/ga.svg +7 -0
  103. package/hmu/images/countries/gb-eng.svg +5 -0
  104. package/hmu/images/countries/gb-nir.svg +137 -0
  105. package/hmu/images/countries/gb-sct.svg +4 -0
  106. package/hmu/images/countries/gb-wls.svg +9 -0
  107. package/hmu/images/countries/gb.svg +15 -0
  108. package/hmu/images/countries/gd.svg +27 -0
  109. package/hmu/images/countries/ge.svg +6 -0
  110. package/hmu/images/countries/gf.svg +5 -0
  111. package/hmu/images/countries/gg.svg +9 -0
  112. package/hmu/images/countries/gh.svg +6 -0
  113. package/hmu/images/countries/gi.svg +33 -0
  114. package/hmu/images/countries/gl.svg +4 -0
  115. package/hmu/images/countries/gm.svg +14 -0
  116. package/hmu/images/countries/gn.svg +7 -0
  117. package/hmu/images/countries/gp.svg +7 -0
  118. package/hmu/images/countries/gq.svg +23 -0
  119. package/hmu/images/countries/gr.svg +22 -0
  120. package/hmu/images/countries/gs.svg +205 -0
  121. package/hmu/images/countries/gt.svg +204 -0
  122. package/hmu/images/countries/gu.svg +39 -0
  123. package/hmu/images/countries/gw.svg +13 -0
  124. package/hmu/images/countries/gy.svg +9 -0
  125. package/hmu/images/countries/hk.svg +32 -0
  126. package/hmu/images/countries/hm.svg +9 -0
  127. package/hmu/images/countries/hn.svg +18 -0
  128. package/hmu/images/countries/hr.svg +59 -0
  129. package/hmu/images/countries/ht.svg +122 -0
  130. package/hmu/images/countries/hu.svg +7 -0
  131. package/hmu/images/countries/id.svg +6 -0
  132. package/hmu/images/countries/ie.svg +7 -0
  133. package/hmu/images/countries/il.svg +14 -0
  134. package/hmu/images/countries/im.svg +36 -0
  135. package/hmu/images/countries/in.svg +25 -0
  136. package/hmu/images/countries/io.svg +148 -0
  137. package/hmu/images/countries/iq.svg +10 -0
  138. package/hmu/images/countries/ir.svg +219 -0
  139. package/hmu/images/countries/is.svg +12 -0
  140. package/hmu/images/countries/it.svg +7 -0
  141. package/hmu/images/countries/je.svg +32 -0
  142. package/hmu/images/countries/jm.svg +8 -0
  143. package/hmu/images/countries/jo.svg +16 -0
  144. package/hmu/images/countries/jp.svg +11 -0
  145. package/hmu/images/countries/ke.svg +23 -0
  146. package/hmu/images/countries/kg.svg +15 -0
  147. package/hmu/images/countries/kh.svg +69 -0
  148. package/hmu/images/countries/ki.svg +36 -0
  149. package/hmu/images/countries/km.svg +16 -0
  150. package/hmu/images/countries/kn.svg +14 -0
  151. package/hmu/images/countries/kp.svg +15 -0
  152. package/hmu/images/countries/kr.svg +24 -0
  153. package/hmu/images/countries/kw.svg +13 -0
  154. package/hmu/images/countries/ky.svg +63 -0
  155. package/hmu/images/countries/kz.svg +23 -0
  156. package/hmu/images/countries/la.svg +12 -0
  157. package/hmu/images/countries/lb.svg +15 -0
  158. package/hmu/images/countries/lc.svg +8 -0
  159. package/hmu/images/countries/li.svg +43 -0
  160. package/hmu/images/countries/lk.svg +22 -0
  161. package/hmu/images/countries/lr.svg +14 -0
  162. package/hmu/images/countries/ls.svg +8 -0
  163. package/hmu/images/countries/lt.svg +7 -0
  164. package/hmu/images/countries/lu.svg +5 -0
  165. package/hmu/images/countries/lv.svg +6 -0
  166. package/hmu/images/countries/ly.svg +13 -0
  167. package/hmu/images/countries/ma.svg +4 -0
  168. package/hmu/images/countries/mc.svg +6 -0
  169. package/hmu/images/countries/md.svg +72 -0
  170. package/hmu/images/countries/me.svg +118 -0
  171. package/hmu/images/countries/mf.svg +7 -0
  172. package/hmu/images/countries/mg.svg +7 -0
  173. package/hmu/images/countries/mh.svg +7 -0
  174. package/hmu/images/countries/mk.svg +5 -0
  175. package/hmu/images/countries/ml.svg +7 -0
  176. package/hmu/images/countries/mm.svg +16 -0
  177. package/hmu/images/countries/mn.svg +13 -0
  178. package/hmu/images/countries/mo.svg +9 -0
  179. package/hmu/images/countries/mp.svg +86 -0
  180. package/hmu/images/countries/mq.svg +7 -0
  181. package/hmu/images/countries/mr.svg +6 -0
  182. package/hmu/images/countries/ms.svg +39 -0
  183. package/hmu/images/countries/mt.svg +49 -0
  184. package/hmu/images/countries/mu.svg +8 -0
  185. package/hmu/images/countries/mv.svg +6 -0
  186. package/hmu/images/countries/mw.svg +10 -0
  187. package/hmu/images/countries/mx.svg +385 -0
  188. package/hmu/images/countries/my.svg +15 -0
  189. package/hmu/images/countries/mz.svg +21 -0
  190. package/hmu/images/countries/na.svg +16 -0
  191. package/hmu/images/countries/nc.svg +7 -0
  192. package/hmu/images/countries/ne.svg +6 -0
  193. package/hmu/images/countries/nf.svg +9 -0
  194. package/hmu/images/countries/ng.svg +6 -0
  195. package/hmu/images/countries/ni.svg +131 -0
  196. package/hmu/images/countries/nl.svg +7 -0
  197. package/hmu/images/countries/no.svg +7 -0
  198. package/hmu/images/countries/np.svg +14 -0
  199. package/hmu/images/countries/nr.svg +12 -0
  200. package/hmu/images/countries/nu.svg +26 -0
  201. package/hmu/images/countries/nz.svg +41 -0
  202. package/hmu/images/countries/om.svg +116 -0
  203. package/hmu/images/countries/pa.svg +14 -0
  204. package/hmu/images/countries/pe.svg +279 -0
  205. package/hmu/images/countries/pf.svg +19 -0
  206. package/hmu/images/countries/pg.svg +9 -0
  207. package/hmu/images/countries/ph.svg +28 -0
  208. package/hmu/images/countries/pk.svg +15 -0
  209. package/hmu/images/countries/pl.svg +6 -0
  210. package/hmu/images/countries/pm.svg +7 -0
  211. package/hmu/images/countries/pn.svg +62 -0
  212. package/hmu/images/countries/pr.svg +13 -0
  213. package/hmu/images/countries/ps.svg +15 -0
  214. package/hmu/images/countries/pt.svg +57 -0
  215. package/hmu/images/countries/pw.svg +11 -0
  216. package/hmu/images/countries/py.svg +157 -0
  217. package/hmu/images/countries/qa.svg +4 -0
  218. package/hmu/images/countries/re.svg +7 -0
  219. package/hmu/images/countries/ro.svg +7 -0
  220. package/hmu/images/countries/rs.svg +292 -0
  221. package/hmu/images/countries/ru.svg +7 -0
  222. package/hmu/images/countries/rw.svg +13 -0
  223. package/hmu/images/countries/sa.svg +26 -0
  224. package/hmu/images/countries/sb.svg +13 -0
  225. package/hmu/images/countries/sc.svg +14 -0
  226. package/hmu/images/countries/sd.svg +13 -0
  227. package/hmu/images/countries/se.svg +16 -0
  228. package/hmu/images/countries/sg.svg +13 -0
  229. package/hmu/images/countries/sh.svg +74 -0
  230. package/hmu/images/countries/si.svg +18 -0
  231. package/hmu/images/countries/sj.svg +7 -0
  232. package/hmu/images/countries/sk.svg +9 -0
  233. package/hmu/images/countries/sl.svg +7 -0
  234. package/hmu/images/countries/sm.svg +91 -0
  235. package/hmu/images/countries/sn.svg +8 -0
  236. package/hmu/images/countries/so.svg +11 -0
  237. package/hmu/images/countries/sr.svg +6 -0
  238. package/hmu/images/countries/ss.svg +8 -0
  239. package/hmu/images/countries/st.svg +16 -0
  240. package/hmu/images/countries/sv.svg +618 -0
  241. package/hmu/images/countries/sx.svg +56 -0
  242. package/hmu/images/countries/sy.svg +6 -0
  243. package/hmu/images/countries/sz.svg +45 -0
  244. package/hmu/images/countries/tc.svg +67 -0
  245. package/hmu/images/countries/td.svg +7 -0
  246. package/hmu/images/countries/tf.svg +15 -0
  247. package/hmu/images/countries/tg.svg +14 -0
  248. package/hmu/images/countries/th.svg +7 -0
  249. package/hmu/images/countries/tj.svg +22 -0
  250. package/hmu/images/countries/tk.svg +5 -0
  251. package/hmu/images/countries/tl.svg +13 -0
  252. package/hmu/images/countries/tm.svg +213 -0
  253. package/hmu/images/countries/tn.svg +13 -0
  254. package/hmu/images/countries/to.svg +10 -0
  255. package/hmu/images/countries/tr.svg +8 -0
  256. package/hmu/images/countries/tt.svg +5 -0
  257. package/hmu/images/countries/tv.svg +27 -0
  258. package/hmu/images/countries/tw.svg +14 -0
  259. package/hmu/images/countries/tz.svg +13 -0
  260. package/hmu/images/countries/ua.svg +6 -0
  261. package/hmu/images/countries/ug.svg +30 -0
  262. package/hmu/images/countries/um.svg +23 -0
  263. package/hmu/images/countries/un.svg +16 -0
  264. package/hmu/images/countries/us.svg +12 -0
  265. package/hmu/images/countries/uy.svg +28 -0
  266. package/hmu/images/countries/uz.svg +30 -0
  267. package/hmu/images/countries/va.svg +483 -0
  268. package/hmu/images/countries/vc.svg +8 -0
  269. package/hmu/images/countries/ve.svg +26 -0
  270. package/hmu/images/countries/vg.svg +133 -0
  271. package/hmu/images/countries/vi.svg +31 -0
  272. package/hmu/images/countries/vn.svg +11 -0
  273. package/hmu/images/countries/vu.svg +18 -0
  274. package/hmu/images/countries/wf.svg +7 -0
  275. package/hmu/images/countries/ws.svg +7 -0
  276. package/hmu/images/countries/ye.svg +7 -0
  277. package/hmu/images/countries/yt.svg +7 -0
  278. package/hmu/images/countries/za.svg +17 -0
  279. package/hmu/images/countries/zm.svg +27 -0
  280. package/hmu/images/countries/zw.svg +21 -0
  281. package/hmu/images/hipay-white-logo.svg +42 -0
  282. package/hmu/images/logo_visa_75wx45h.gif +0 -0
  283. package/index.es.js +1 -1
  284. package/index.js +1 -1
  285. package/package.json +1 -1
  286. package/styles/createHiMuiTheme.js +4 -0
  287. package/umd/hipay-material-ui.development.js +828 -782
  288. package/umd/hipay-material-ui.production.min.js +4 -4
@@ -163,46 +163,28 @@ var HiSelect = function (_React$PureComponent) {
163
163
 
164
164
  // Check if value is in options
165
165
  var valueInOptions = false;
166
- var val = _this.props.value;
166
+ var val = props.value;
167
167
  // No options provided.
168
- if (!_this.props.options.length && !val.length) {
168
+ if (!props.options.length || !val || !val.length) {
169
169
  valueInOptions = true;
170
+ } else {
171
+ // Check if an option match value prop.
172
+ props.options.forEach(function (item) {
173
+ if (!valueInOptions && val.indexOf(item.id) !== -1) {
174
+ valueInOptions = true;
175
+ }
176
+ });
170
177
  }
171
- // Check if an option match value prop.
172
- _this.props.options.forEach(function (item) {
173
- if (!val.length) {
174
- valueInOptions = true;
175
- }
176
- if (!valueInOptions && val.indexOf(item.id) !== -1) {
177
- valueInOptions = true;
178
- }
179
- });
178
+
180
179
  if (!valueInOptions) {
181
180
  throw new Error('prop value provided does not match any option.');
182
181
  }
183
182
 
184
183
  if (props.hierarchic === true && props.options.length > 1) {
185
- // Construct two associative arrays
186
- // hierarchy[parentId] => children
187
- // hierarchySelected[parentId] => selected children
188
- var hierarchy = {};
189
- var hierarchySelected = {};
190
- var value = props.value || [];
191
- if (!Array.isArray(value)) value = [props.value];
192
- props.options.forEach(function (option) {
193
- if (option.hasChildren === true && !hierarchy.hasOwnProperty(option.id)) {
194
- hierarchy[option.id] = [];
195
- hierarchySelected[option.id] = [];
196
- } else if (option.hasOwnProperty('parentId')) {
197
- hierarchy[option.parentId].push(option.id);
198
- if (value.includes(option.id)) {
199
- hierarchySelected[option.parentId].push(option.id);
200
- }
201
- }
202
- });
184
+ var hierarchyTrees = _this.buildHierarchyTrees(props);
203
185
 
204
- _this.state.hierarchy = hierarchy;
205
- _this.state.hierarchySelected = hierarchySelected;
186
+ _this.state.hierarchy = hierarchyTrees.hierarchy;
187
+ _this.state.hierarchySelected = hierarchyTrees.hierarchySelected;
206
188
  }
207
189
 
208
190
  if (props.options.length > 0) {
@@ -241,6 +223,34 @@ var HiSelect = function (_React$PureComponent) {
241
223
  });
242
224
  this.setState({ nbOptions: optionsLength });
243
225
  }
226
+
227
+ if (nextProps.hierarchic === true && nextProps.options.length > 1) {
228
+ var hierarchyTrees = this.buildHierarchyTrees(nextProps);
229
+ this.setState({ hierarchy: hierarchyTrees.hierarchy, hierarchySelected: hierarchyTrees.hierarchySelected });
230
+ }
231
+ }
232
+ }, {
233
+ key: 'buildHierarchyTrees',
234
+ value: function buildHierarchyTrees(props) {
235
+ // Construct two associative arrays
236
+ // hierarchy[parentId] => children
237
+ // hierarchySelected[parentId] => selected children
238
+ var hierarchy = {};
239
+ var hierarchySelected = {};
240
+ var value = props.value || [];
241
+ if (!Array.isArray(value)) value = [props.value];
242
+ props.options.forEach(function (option) {
243
+ if (option.hasChildren === true && !hierarchy.hasOwnProperty(option.id)) {
244
+ hierarchy[option.id] = [];
245
+ hierarchySelected[option.id] = [];
246
+ } else if (option.hasOwnProperty('parentId')) {
247
+ hierarchy[option.parentId].push(option.id);
248
+ if (value.includes(option.id)) {
249
+ hierarchySelected[option.parentId].push(option.id);
250
+ }
251
+ }
252
+ });
253
+ return { hierarchy: hierarchy, hierarchySelected: hierarchySelected };
244
254
  }
245
255
 
246
256
  // Key down on list items
@@ -290,7 +300,8 @@ var HiSelect = function (_React$PureComponent) {
290
300
  hoverIcon = _props.hoverIcon,
291
301
  checkedIcon = _props.checkedIcon,
292
302
  hierarchic = _props.hierarchic,
293
- id = _props.id;
303
+ id = _props.id,
304
+ placeholder = _props.placeholder;
294
305
  var _state = this.state,
295
306
  open = _state.open,
296
307
  suggestions = _state.suggestions,
@@ -325,7 +336,7 @@ var HiSelect = function (_React$PureComponent) {
325
336
  }
326
337
 
327
338
  if (displayAsChip) {
328
- var chipFilter = _react2.default.createElement(_HiChip2.default, { label: display, onDelete: this.handleRequestDelete });
339
+ var chipFilter = _react2.default.createElement(_HiChip2.default, { label: placeholder || display, onDelete: this.handleRequestDelete });
329
340
  if (display) {
330
341
  display = chipFilter;
331
342
  }
@@ -359,7 +370,7 @@ var HiSelect = function (_React$PureComponent) {
359
370
  null,
360
371
  _react2.default.createElement(_SelectInput2.default, {
361
372
  id: id,
362
- value: display,
373
+ value: placeholder || display,
363
374
  open: open,
364
375
  focused: focused,
365
376
  type: type,
@@ -811,6 +822,11 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
811
822
  * Les items parents sont sélectionnables
812
823
  */
813
824
  parentItemSelectable: _propTypes2.default.bool,
825
+ /**
826
+ * Placeholder affiché lorsque le select est fermé
827
+ * Surcharge le placeholder par défaut
828
+ */
829
+ placeholder: _propTypes2.default.string,
814
830
  /**
815
831
  * Affiche un input de recherche permettant de filtrer les options
816
832
  */
@@ -69,6 +69,10 @@ var _HiIconBuilder = require('../utils/HiIconBuilder');
69
69
 
70
70
  var _HiIconBuilder2 = _interopRequireDefault(_HiIconBuilder);
71
71
 
72
+ var _HiColoredLabel = require('../HiColoredLabel');
73
+
74
+ var _HiColoredLabel2 = _interopRequireDefault(_HiColoredLabel);
75
+
72
76
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
73
77
 
74
78
  var styles = exports.styles = function styles(theme) {
@@ -112,9 +116,10 @@ var styles = exports.styles = function styles(theme) {
112
116
  fontWeight: 'inherit',
113
117
  width: '100%'
114
118
  }),
115
- listItemSecondaryText: (0, _extends3.default)({}, theme.typography.body4, {
119
+ listItemSecondaryText: (0, _extends3.default)({}, theme.typography.body5, {
116
120
  fontWeight: theme.typography.fontWeightLight,
117
- marginLeft: theme.spacing.unit
121
+ marginLeft: theme.spacing.unit,
122
+ color: theme.palette.neutral.normal
118
123
  }),
119
124
  listItemInfoText: (0, _extends3.default)({
120
125
  whiteSpace: 'nowrap',
@@ -213,13 +218,18 @@ var HiSelectableListItem = function (_React$Component) {
213
218
  'div',
214
219
  { className: classes.listItemContent, 'data-id': item.id },
215
220
  !effectiveCheckbox && _react2.default.createElement(_HiIconBuilder2.default, { icon: item.icon, className: classes.icon }),
216
- item.label,
217
- _react2.default.createElement('span', { className: classes.listItemSecondaryText }),
221
+ _this.getItemLabel(item),
222
+ _react2.default.createElement(
223
+ 'span',
224
+ { className: classes.listItemSecondaryText },
225
+ item.secondaryLabel
226
+ ),
218
227
  childrenIndicator
219
228
  );
220
229
  case 'image':
221
230
  var img = '';
222
231
  if (typeof item.img !== 'undefined') {
232
+
223
233
  img = _react2.default.createElement('img', { src: item.img, className: classes.imgListItem });
224
234
  }
225
235
 
@@ -227,8 +237,12 @@ var HiSelectableListItem = function (_React$Component) {
227
237
  'div',
228
238
  { className: classes.listItemContent, 'data-id': item.id },
229
239
  img,
230
- item.label,
231
- _react2.default.createElement('span', { className: classes.listItemSecondaryText }),
240
+ _this.getItemLabel(item),
241
+ _react2.default.createElement(
242
+ 'span',
243
+ { className: classes.listItemSecondaryText },
244
+ item.secondaryLabel
245
+ ),
232
246
  childrenIndicator
233
247
  );
234
248
  case 'primary-highlight':
@@ -238,7 +252,7 @@ var HiSelectableListItem = function (_React$Component) {
238
252
  return _react2.default.createElement(
239
253
  'div',
240
254
  { className: itemPrimaryHighlightClass, 'data-id': item.id },
241
- item.label
255
+ _this.getItemLabel(item)
242
256
  );
243
257
  case 'text':
244
258
  default:
@@ -253,8 +267,12 @@ var HiSelectableListItem = function (_React$Component) {
253
267
  __html: (0, _hiHelpers.escapeHTML)(item.labelHighlight)
254
268
  }
255
269
  }),
256
- !item.labelHighlight && item.label,
257
- _react2.default.createElement('span', { className: classes.listItemSecondaryText }),
270
+ !item.labelHighlight && _this.getItemLabel(item),
271
+ _react2.default.createElement(
272
+ 'span',
273
+ { className: classes.listItemSecondaryText },
274
+ item.secondaryLabel
275
+ ),
258
276
  childrenIndicator
259
277
  );
260
278
  }
@@ -274,6 +292,14 @@ var HiSelectableListItem = function (_React$Component) {
274
292
  value: function toggleHover() {
275
293
  this.setState({ hover: !this.state.hover });
276
294
  }
295
+ }, {
296
+ key: 'getItemLabel',
297
+ value: function getItemLabel(item) {
298
+ if (item.color) {
299
+ return _react2.default.createElement(_HiColoredLabel2.default, { color: item.color, label: item.label });
300
+ }
301
+ return item.label;
302
+ }
277
303
 
278
304
  /**
279
305
  * Build list item from type
@@ -112,7 +112,7 @@ var CellCountry = function (_React$PureComponent) {
112
112
  view = _props.view;
113
113
 
114
114
 
115
- var path = '/static/images/countries/' + isoCode.toLowerCase() + '.svg';
115
+ var path = '/static/hmu/images/countries/' + isoCode.toLowerCase() + '.svg';
116
116
 
117
117
  var tooltipContent = _react2.default.createElement(
118
118
  'div',
@@ -508,10 +508,6 @@ HiTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
508
508
  * Fonction de callback au click sur l'accountSelector'
509
509
  */
510
510
  onClickAccountSelector: _propTypes2.default.func,
511
- /**
512
- * Fonction de callback au click sur le menu
513
- */
514
- onClickInputButton: _propTypes2.default.func.isRequired,
515
511
  /**
516
512
  * Fonction de callback au click sur le menu
517
513
  */
@@ -0,0 +1,189 @@
1
+ import _extends from 'babel-runtime/helpers/extends';
2
+ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
+ // @inheritedComponent Dialog
4
+
5
+ import React from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import Dialog, { DialogActions, DialogContent, DialogContentText, DialogTitle } from 'material-ui/Dialog';
8
+ import { withStyles } from '../styles';
9
+ import HiButton from '../HiButton';
10
+
11
+ export const styles = theme => ({
12
+ classContent: {
13
+ fontSize: 14,
14
+ lineHeight: '24px',
15
+ color: '#484848'
16
+ },
17
+ classPaper: {
18
+ maxWidth: 300
19
+ },
20
+ classCancelButton: {
21
+ float: 'right'
22
+ },
23
+ classTitle: {
24
+ fontSize: 20,
25
+ fontFamily: theme.typography.fontFamily,
26
+ fontWeight: theme.typography.fontWeightLight,
27
+ lineHeight: '24px'
28
+ },
29
+ classAction: {
30
+ display: 'inline-block'
31
+ },
32
+ classDialogRoot: {
33
+ backgroundColor: 'rgba(0, 0, 0, 0.28)'
34
+ }
35
+ });
36
+
37
+ /**
38
+ * Pop up d'alert
39
+ */
40
+ class HiAlertModal extends React.PureComponent {
41
+
42
+ constructor(props) {
43
+ super(props);
44
+
45
+ this.handleClickCancel = () => {
46
+ if (this.props.onCancelClick) {
47
+ this.props.onCancelClick();
48
+ }
49
+ };
50
+
51
+ this.handleClickSubmit = () => {
52
+ if (this.props.onSubmitClick) {
53
+ this.props.onSubmitClick();
54
+ }
55
+ };
56
+
57
+ this.handleOnClose = () => {
58
+ if (this.props.onClose) {
59
+ this.props.onClose();
60
+ }
61
+ };
62
+
63
+ this.handleOnClose = this.handleOnClose.bind(this);
64
+ this.handleClickCancel = this.handleClickCancel.bind(this);
65
+ this.handleClickSubmit = this.handleClickSubmit.bind(this);
66
+ }
67
+
68
+ // Appelé au clic du bouton d'annulation
69
+
70
+
71
+ // Appelé au clic du bouton de soumission
72
+
73
+
74
+ // Appelé si clic en dehors de la pop up
75
+
76
+
77
+ // Render
78
+ render() {
79
+ const _props = this.props,
80
+ {
81
+ labelSubmitButton,
82
+ labelCancelButton,
83
+ content,
84
+ title,
85
+ positive,
86
+ negative,
87
+ open,
88
+ onCancelClick,
89
+ onSubmitClick,
90
+ classes
91
+ } = _props,
92
+ props = _objectWithoutProperties(_props, ['labelSubmitButton', 'labelCancelButton', 'content', 'title', 'positive', 'negative', 'open', 'onCancelClick', 'onSubmitClick', 'classes']);
93
+ return React.createElement(
94
+ Dialog,
95
+ _extends({
96
+ open: open,
97
+ onClose: this.handleOnClose,
98
+ classes: { paper: classes.classPaper, root: classes.classDialogRoot }
99
+ }, props),
100
+ React.createElement(
101
+ DialogTitle,
102
+ { disableTypography: true, classes: { root: classes.classTitle } },
103
+ title
104
+ ),
105
+ React.createElement(
106
+ DialogContent,
107
+ null,
108
+ React.createElement(
109
+ DialogContentText,
110
+ { classes: { root: classes.classContent } },
111
+ content
112
+ )
113
+ ),
114
+ React.createElement(
115
+ DialogActions,
116
+ { classes: { root: classes.classAction } },
117
+ React.createElement(
118
+ HiButton,
119
+ {
120
+ onClick: this.handleClickSubmit,
121
+ positive: positive,
122
+ negative: negative
123
+ },
124
+ labelSubmitButton
125
+ ),
126
+ React.createElement(
127
+ HiButton,
128
+ {
129
+ classes: { root: classes.classCancelButton },
130
+ onClick: this.handleClickCancel
131
+ },
132
+ labelCancelButton
133
+ )
134
+ )
135
+ );
136
+ }
137
+ }
138
+
139
+ HiAlertModal.defaultProps = {
140
+ negative: false,
141
+ positive: false
142
+ };
143
+ HiAlertModal.propTypes = process.env.NODE_ENV !== "production" ? {
144
+ /**
145
+ * Surcharge les classes du composant
146
+ */
147
+ classes: PropTypes.object,
148
+ /**
149
+ * Texte contenu dans la modal
150
+ */
151
+ content: PropTypes.string,
152
+ /**
153
+ * Texte sur le bouton d'annulation
154
+ */
155
+ labelCancelButton: PropTypes.string,
156
+ /**
157
+ * Texte sur le bouton de soumission
158
+ */
159
+ labelSubmitButton: PropTypes.string,
160
+ /**
161
+ * Colore le bouton de soumission en rouge
162
+ */
163
+ negative: PropTypes.bool,
164
+ /**
165
+ * Fonction de callback appelée au clic sur le bouton d'annulation
166
+ */
167
+ onCancelClick: PropTypes.func,
168
+ /**
169
+ * Fonction de callback appelée au clic en dehors de la pop up
170
+ */
171
+ onClose: PropTypes.func,
172
+ /**
173
+ * Fonction de callback appelée au clic sur le bouton de soumission
174
+ */
175
+ onSubmitClick: PropTypes.func,
176
+ /**
177
+ * pop up ouverte ou pas
178
+ */
179
+ open: PropTypes.bool.isRequired,
180
+ /**
181
+ * Colore le bouton de soumission en vert
182
+ */
183
+ positive: PropTypes.bool,
184
+ /**
185
+ * Titre de la modal
186
+ */
187
+ title: PropTypes.string
188
+ } : {};
189
+ export default withStyles(styles, { name: 'HmuiHiAlertModal' })(HiAlertModal);
@@ -0,0 +1 @@
1
+ export { default } from './HiAlertModal';
@@ -78,7 +78,8 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
78
78
  } : {};
79
79
 
80
80
  HiColoredLabel.defaultProps = {
81
- active: false
81
+ active: false,
82
+ color: '#737373'
82
83
  };
83
84
 
84
85
  export default withStyles(styles, { name: 'HmuiHiColoredLabel' })(HiColoredLabel);
@@ -127,6 +127,9 @@ class HiDateRangeSelector extends React.Component {
127
127
  if (selectedOption) {
128
128
  this.props.onChange('from', selectedOption.from.toDate());
129
129
  this.props.onChange('to', selectedOption.to.toDate());
130
+ if (this.props.returnSelectValue === true) {
131
+ this.props.onChange('period', value);
132
+ }
130
133
  }
131
134
  }
132
135
  };
@@ -231,6 +234,7 @@ HiDateRangeSelector.defaultProps = {
231
234
  availableOptionKeys: ['cd', 'pd', 'cw', 'pw', 'cm', 'pm', 'cq', 'pq', 'cy', 'custom'],
232
235
  defaultPreset: 'cd',
233
236
  enableTime: false,
237
+ returnSelectValue: false,
234
238
  locale: 'fr-FR',
235
239
  format: 'YYYY-DD-MM',
236
240
  translations: {
@@ -325,6 +329,10 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
325
329
  * true si champs obligatoire
326
330
  */
327
331
  required: PropTypes.bool,
332
+ /**
333
+ * Retourne la valeur du select de la période au change du select
334
+ */
335
+ returnSelectValue: PropTypes.bool.isRequired,
328
336
  /**
329
337
  * Date de fin sélectionnée
330
338
  */
@@ -0,0 +1,170 @@
1
+ import _extends from 'babel-runtime/helpers/extends';
2
+ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
+ // @inheritedComponent ExpansionPanel
4
+
5
+ import React from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import ExpansionPanel, { ExpansionPanelSummary, ExpansionPanelDetails } from 'material-ui/ExpansionPanel';
8
+ import Typography from 'material-ui/Typography';
9
+ import MenuDownIcon from 'mdi-material-ui/MenuDown';
10
+ import { withStyles } from '../styles';
11
+
12
+ export const styles = theme => ({
13
+ heading: {
14
+ fontSize: 20,
15
+ lineHeight: '24px',
16
+ fontWeight: theme.typography.fontWeightLight
17
+ },
18
+ secondaryHeading: {
19
+ fontSize: 11,
20
+ color: '#737373',
21
+ textAlign: 'right',
22
+ lineHeight: '24px',
23
+ fontWeight: theme.typography.fontWeightRegular,
24
+ verticalAlign: 'middle',
25
+ '&>svg': {
26
+ fontSize: 18,
27
+ marginLeft: 3,
28
+ marginBottom: -5
29
+ }
30
+ },
31
+ column: {
32
+ flexBasis: '100%'
33
+ },
34
+ panelSummary: {
35
+ '&>div:first-child': {
36
+ margin: '12px 0',
37
+ '&>div:last-child': {
38
+ paddingRight: 8
39
+ }
40
+ },
41
+ '&>div:last-child': {
42
+ width: 16,
43
+ height: 16
44
+ }
45
+ },
46
+ panelSummaryExpanded: {
47
+ borderBottom: '1px solid #E3E6E7',
48
+ minHeight: 0
49
+ },
50
+ expandMoreIcon: {
51
+ margin: 0,
52
+ fontSize: 18,
53
+ width: 20
54
+ },
55
+ panel: {
56
+ boxShadow: 'none',
57
+ border: 'none'
58
+ },
59
+ panelDetails: {
60
+ padding: '8px 24px 8px'
61
+ },
62
+ disabledPanel: {
63
+ backgroundColor: '#ffffff',
64
+ opacity: 1
65
+ },
66
+ expandIconExpanded: {
67
+ transform: 'translateY(-50%) rotate(-90deg)'
68
+ }
69
+ });
70
+
71
+ class HiExpansionPanel extends React.PureComponent {
72
+
73
+ render() {
74
+ const _props = this.props,
75
+ {
76
+ disabled,
77
+ heading,
78
+ secondaryHeading,
79
+ secondaryHeadingDisabled,
80
+ secondaryHeadingIcon,
81
+ children,
82
+ classes
83
+ } = _props,
84
+ props = _objectWithoutProperties(_props, ['disabled', 'heading', 'secondaryHeading', 'secondaryHeadingDisabled', 'secondaryHeadingIcon', 'children', 'classes']);
85
+
86
+ const effectiveDisabled = disabled || !children;
87
+
88
+ return React.createElement(
89
+ ExpansionPanel,
90
+ _extends({
91
+ disabled: effectiveDisabled,
92
+ classes: { root: classes.panel, disabled: classes.disabledPanel }
93
+ }, props),
94
+ React.createElement(
95
+ ExpansionPanelSummary,
96
+ {
97
+ classes: {
98
+ root: classes.panelSummary,
99
+ disabled: classes.disabledPanel,
100
+ expanded: classes.panelSummaryExpanded,
101
+ expandIconExpanded: classes.expandIconExpanded
102
+ },
103
+ expandIcon: React.createElement(MenuDownIcon, { classes: { root: classes.expandMoreIcon } })
104
+ },
105
+ React.createElement(
106
+ 'div',
107
+ { className: classes.column },
108
+ React.createElement(
109
+ Typography,
110
+ { classes: { root: classes.heading } },
111
+ heading
112
+ )
113
+ ),
114
+ React.createElement(
115
+ 'div',
116
+ { className: classes.column },
117
+ React.createElement(
118
+ Typography,
119
+ { classes: { root: classes.secondaryHeading } },
120
+ !effectiveDisabled ? secondaryHeading : secondaryHeadingDisabled,
121
+ secondaryHeadingIcon
122
+ )
123
+ )
124
+ ),
125
+ !!children && React.createElement(
126
+ ExpansionPanelDetails,
127
+ { classes: { root: classes.panelDetails } },
128
+ children
129
+ )
130
+ );
131
+ }
132
+ }
133
+
134
+ HiExpansionPanel.defaultProps = {
135
+ disabled: false,
136
+ secondaryHeading: '',
137
+ secondaryHeadingIcon: '',
138
+ secondaryHeadingDisabled: 'PAS ENCORE COMPLETE'
139
+ };
140
+ HiExpansionPanel.propTypes = process.env.NODE_ENV !== "production" ? {
141
+ /**
142
+ * Contenu du panel
143
+ */
144
+ children: PropTypes.any,
145
+ /**
146
+ * Surcharge les classes du composant
147
+ */
148
+ classes: PropTypes.object,
149
+ /**
150
+ * Désactivé
151
+ */
152
+ disabled: PropTypes.bool,
153
+ /**
154
+ * Titre principal du panel
155
+ */
156
+ heading: PropTypes.string.isRequired,
157
+ /**
158
+ * Titre secondaire du panel
159
+ */
160
+ secondaryHeading: PropTypes.string,
161
+ /**
162
+ * Titre secondaire si désactivé
163
+ */
164
+ secondaryHeadingDisabled: PropTypes.string,
165
+ /**
166
+ * Icone dans le titre secondaire du panel
167
+ */
168
+ secondaryHeadingIcon: PropTypes.any
169
+ } : {};
170
+ export default withStyles(styles, { name: 'HmuiHiExpansionPanel' })(HiExpansionPanel);
@@ -0,0 +1 @@
1
+ export { default } from './HiExpansionPanel';
@@ -107,6 +107,9 @@ class HiFormControl extends React.PureComponent {
107
107
 
108
108
  handleFocus(value) {
109
109
  this.setState({ focused: value });
110
+ if (value === false && this.state.hovered) {
111
+ this.setState({ hovered: false });
112
+ }
110
113
  }
111
114
 
112
115
  handleHover(value) {