@hipay/hipay-material-ui 2.3.1-rc3 → 2.3.1-rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. package/App.test.js +8 -0
  2. package/HiAlertModal/HiAlertModal.js +48 -77
  3. package/HiAlertModal/HiAlertModal.test.js +189 -0
  4. package/HiAlertModal/index.js +1 -15
  5. package/HiAppBar/HiAppBar.js +34 -63
  6. package/HiAppBar/index.js +1 -15
  7. package/HiBadge/HiBadge.js +10 -29
  8. package/HiBadge/HiBadge.test.js +49 -0
  9. package/HiBadge/index.js +1 -15
  10. package/HiBreadcrumb/HiBreadcrumb.js +27 -43
  11. package/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
  12. package/HiBreadcrumb/HiStep.js +35 -57
  13. package/HiBreadcrumb/HiStep.test.js +47 -0
  14. package/HiBreadcrumb/HiStepConnector.js +32 -57
  15. package/HiBreadcrumb/HiStepConnector.test.js +113 -0
  16. package/HiBreadcrumb/HiStepContent.js +25 -46
  17. package/HiBreadcrumb/HiStepContent.test.js +32 -0
  18. package/HiBreadcrumb/HiStepIcon.js +26 -46
  19. package/HiBreadcrumb/HiStepIcon.test.js +65 -0
  20. package/HiBreadcrumb/HiStepLabel.js +36 -61
  21. package/HiBreadcrumb/HiStepLabel.test.js +30 -0
  22. package/HiBreadcrumb/HiStepper.js +23 -45
  23. package/HiBreadcrumb/HiStepper.test.js +33 -0
  24. package/HiBreadcrumb/index.js +1 -15
  25. package/HiButton/HiButton.js +9 -27
  26. package/HiButton/index.js +2 -13
  27. package/HiCell/CellAddress.js +20 -40
  28. package/HiCell/CellAddress.test.js +75 -0
  29. package/HiCell/CellDate.js +26 -47
  30. package/HiCell/CellDate.test.js +173 -0
  31. package/HiCell/CellIcon.js +28 -49
  32. package/HiCell/CellIcon.test.js +57 -0
  33. package/HiCell/CellImage.js +23 -42
  34. package/HiCell/CellImage.test.js +49 -0
  35. package/HiCell/CellNumeric.js +25 -46
  36. package/HiCell/CellNumeric.test.js +46 -0
  37. package/HiCell/CellPinToAction.js +20 -41
  38. package/HiCell/CellRate.js +32 -55
  39. package/HiCell/CellRate.test.js +73 -0
  40. package/HiCell/CellSentinel.js +22 -42
  41. package/HiCell/CellSentinel.test.js +48 -0
  42. package/HiCell/CellSentinelScore.js +23 -44
  43. package/HiCell/CellText.js +37 -56
  44. package/HiCell/CellText.test.js +76 -0
  45. package/HiCell/CellTextStyled.js +8 -21
  46. package/HiCell/index.js +9 -79
  47. package/HiCheckbox/HiCheckbox.js +35 -60
  48. package/HiCheckbox/HiCheckbox.test.js +55 -0
  49. package/HiCheckbox/index.js +1 -15
  50. package/HiChip/HiChip.js +24 -44
  51. package/HiChip/HiChip.test.js +136 -0
  52. package/HiChip/HiChipSwitch.js +47 -70
  53. package/HiChip/HiChipSwitch.test.js +99 -0
  54. package/HiChip/index.js +2 -23
  55. package/HiColoredLabel/HiColoredLabel.js +28 -52
  56. package/HiColoredLabel/HiColoredLabel.test.js +96 -0
  57. package/HiColoredLabel/index.js +1 -15
  58. package/HiDatePicker/Caption.js +11 -28
  59. package/HiDatePicker/Caption.test.js +65 -0
  60. package/HiDatePicker/HiDatePicker.js +100 -115
  61. package/HiDatePicker/HiDatePicker.test.js +370 -0
  62. package/HiDatePicker/HiDatePickerMobile.js +32 -54
  63. package/HiDatePicker/HiDateRangePicker.js +138 -149
  64. package/HiDatePicker/HiDateRangePicker.test.js +703 -0
  65. package/HiDatePicker/HiDateRangeSelector.js +71 -103
  66. package/HiDatePicker/HiDateRangeSelector.test.js +193 -0
  67. package/HiDatePicker/ListPicker.js +33 -55
  68. package/HiDatePicker/ListPicker.test.js +53 -0
  69. package/HiDatePicker/NavBar.js +18 -45
  70. package/HiDatePicker/NavBar.test.js +39 -0
  71. package/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
  72. package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
  73. package/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
  74. package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
  75. package/HiDatePicker/Overlays/Overlay.js +18 -35
  76. package/HiDatePicker/Overlays/Overlay.test.js +20 -0
  77. package/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
  78. package/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
  79. package/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
  80. package/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
  81. package/HiDatePicker/Overlays/index.js +5 -47
  82. package/HiDatePicker/Weekday.js +3 -13
  83. package/HiDatePicker/hiLocaleUtils.js +1 -8
  84. package/HiDatePicker/hiLocaleUtils.test.js +51 -0
  85. package/HiDatePicker/index.js +1 -15
  86. package/HiDatePicker/stylesheet.js +9 -22
  87. package/HiDotsStepper/HiDot.js +30 -57
  88. package/HiDotsStepper/HiDot.test.js +55 -0
  89. package/HiDotsStepper/HiDotsStepper.js +29 -47
  90. package/HiDotsStepper/HiDotsStepper.test.js +90 -0
  91. package/HiDotsStepper/index.js +2 -23
  92. package/HiExpansionPanel/HiExpansionPanel.js +42 -72
  93. package/HiExpansionPanel/index.js +2 -13
  94. package/HiForm/HiAddressField.js +30 -47
  95. package/HiForm/HiAddressField.test.js +79 -0
  96. package/HiForm/HiEmailField.js +28 -46
  97. package/HiForm/HiEmailField.test.js +19 -0
  98. package/HiForm/HiFormControl.js +72 -100
  99. package/HiForm/HiFormControl.test.js +195 -0
  100. package/HiForm/HiFormLabel.js +29 -54
  101. package/HiForm/HiFormLabel.test.js +66 -0
  102. package/HiForm/HiInput.js +62 -86
  103. package/HiForm/HiInput.test.js +202 -0
  104. package/HiForm/HiPasswordField.js +29 -55
  105. package/HiForm/HiPasswordField.test.js +60 -0
  106. package/HiForm/HiSearchField.js +27 -44
  107. package/HiForm/HiSearchField.test.js +193 -0
  108. package/HiForm/HiSlider.js +42 -64
  109. package/HiForm/HiSlider.test.js +99 -0
  110. package/HiForm/HiTextField.js +29 -46
  111. package/HiForm/HiTextField.test.js +254 -0
  112. package/HiForm/HiUpload.js +54 -70
  113. package/HiForm/HiUpload.test.js +241 -0
  114. package/HiForm/HiUploadField.js +24 -41
  115. package/HiForm/HiUploadField.test.js +55 -0
  116. package/HiForm/HiUploadInput.js +56 -77
  117. package/HiForm/HiUploadInput.test.js +148 -0
  118. package/HiForm/index.js +11 -95
  119. package/HiIcon/HiIcon.js +22 -44
  120. package/HiIcon/index.js +1 -15
  121. package/HiIconButton/HiIconButton.js +18 -40
  122. package/HiIconButton/HiIconButton.test.js +69 -0
  123. package/HiIconButton/index.js +1 -15
  124. package/HiLoader/HiLoader.js +9 -24
  125. package/HiLoader/HiLoader.test.js +18 -0
  126. package/HiLoader/index.js +1 -15
  127. package/HiMap/HiMap.js +50 -77
  128. package/HiMap/HiMap.test.js +29 -0
  129. package/HiMap/HiMapExpand.js +39 -64
  130. package/HiMap/HiMapExpand.test.js +48 -0
  131. package/HiMap/index.js +2 -23
  132. package/HiNotice/HiKPI.js +33 -54
  133. package/HiNotice/HiKPI.test.js +171 -0
  134. package/HiNotice/HiKPINotice.js +7 -21
  135. package/HiNotice/HiKPINotice.test.js +88 -0
  136. package/HiNotice/index.js +2 -23
  137. package/HiPaymentMeans/HiPaymentMeans.js +112 -131
  138. package/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
  139. package/HiPaymentMeans/index.js +1 -15
  140. package/HiPdfReader/HiPdfReader.js +51 -76
  141. package/HiPdfReader/index.js +1 -15
  142. package/HiPin/HiPin.js +9 -30
  143. package/HiPin/HiPin.test.js +61 -0
  144. package/HiPin/index.js +1 -15
  145. package/HiRadio/HiRadio.js +7 -24
  146. package/HiRadio/HiRadio.test.js +57 -0
  147. package/HiRadio/index.js +1 -15
  148. package/HiSelect/HiDynamicSelect.js +40 -56
  149. package/HiSelect/HiDynamicSelectField.js +22 -40
  150. package/HiSelect/HiNestedSelect.js +55 -84
  151. package/HiSelect/HiNestedSelectContent.js +46 -73
  152. package/HiSelect/HiNestedSelectField.js +22 -40
  153. package/HiSelect/HiSelect.js +123 -139
  154. package/HiSelect/HiSelect.test.js +1092 -0
  155. package/HiSelect/HiSelectContent.js +73 -95
  156. package/HiSelect/HiSelectField.js +22 -40
  157. package/HiSelect/HiSelectInput.js +63 -87
  158. package/HiSelect/HiSelectInput.test.js +21 -0
  159. package/HiSelect/HiSelectMobile.js +35 -54
  160. package/HiSelect/HiSuggestSelect.js +56 -78
  161. package/HiSelect/HiSuggestSelectField.js +22 -40
  162. package/HiSelect/index.js +8 -85
  163. package/HiSelectableList/HiSelectableList.js +49 -77
  164. package/HiSelectableList/HiSelectableList.test.js +173 -0
  165. package/HiSelectableList/HiSelectableListHierarchic.js +35 -56
  166. package/HiSelectableList/HiSelectableListItem.js +66 -98
  167. package/HiSelectableList/HiSelectableListItem.test.js +97 -0
  168. package/HiSelectableList/index.js +3 -31
  169. package/HiSwitch/HiSwitch.js +20 -45
  170. package/HiSwitch/HiSwitch.test.js +41 -0
  171. package/HiSwitch/HiSwitchState.js +15 -36
  172. package/HiSwitch/HiSwitchState.test.js +76 -0
  173. package/HiSwitch/index.js +2 -23
  174. package/HiTable/HiCellBuilder.js +44 -72
  175. package/HiTable/HiTable.js +29 -47
  176. package/HiTable/HiTable.test.js +29 -0
  177. package/HiTable/HiTableBody.js +19 -34
  178. package/HiTable/HiTableHeader.js +30 -53
  179. package/HiTable/HiTableRow.js +29 -56
  180. package/HiTable/constants.js +43 -94
  181. package/HiTable/index.js +1 -15
  182. package/es/App.test.js +8 -0
  183. package/es/HiAlertModal/HiAlertModal.js +48 -77
  184. package/es/HiAlertModal/HiAlertModal.test.js +189 -0
  185. package/es/HiAlertModal/index.js +1 -15
  186. package/es/HiAppBar/HiAppBar.js +34 -63
  187. package/es/HiAppBar/index.js +1 -15
  188. package/es/HiBadge/HiBadge.js +10 -29
  189. package/es/HiBadge/HiBadge.test.js +49 -0
  190. package/es/HiBadge/index.js +1 -15
  191. package/es/HiBreadcrumb/HiBreadcrumb.js +27 -43
  192. package/es/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
  193. package/es/HiBreadcrumb/HiStep.js +35 -57
  194. package/es/HiBreadcrumb/HiStep.test.js +47 -0
  195. package/es/HiBreadcrumb/HiStepConnector.js +32 -57
  196. package/es/HiBreadcrumb/HiStepConnector.test.js +113 -0
  197. package/es/HiBreadcrumb/HiStepContent.js +25 -46
  198. package/es/HiBreadcrumb/HiStepContent.test.js +32 -0
  199. package/es/HiBreadcrumb/HiStepIcon.js +26 -46
  200. package/es/HiBreadcrumb/HiStepIcon.test.js +65 -0
  201. package/es/HiBreadcrumb/HiStepLabel.js +36 -61
  202. package/es/HiBreadcrumb/HiStepLabel.test.js +30 -0
  203. package/es/HiBreadcrumb/HiStepper.js +23 -45
  204. package/es/HiBreadcrumb/HiStepper.test.js +33 -0
  205. package/es/HiBreadcrumb/index.js +1 -15
  206. package/es/HiButton/HiButton.js +9 -27
  207. package/es/HiButton/index.js +2 -13
  208. package/es/HiCell/CellAddress.js +20 -40
  209. package/es/HiCell/CellAddress.test.js +75 -0
  210. package/es/HiCell/CellDate.js +26 -47
  211. package/es/HiCell/CellDate.test.js +173 -0
  212. package/es/HiCell/CellIcon.js +28 -49
  213. package/es/HiCell/CellIcon.test.js +57 -0
  214. package/es/HiCell/CellImage.js +23 -42
  215. package/es/HiCell/CellImage.test.js +49 -0
  216. package/es/HiCell/CellNumeric.js +25 -46
  217. package/es/HiCell/CellNumeric.test.js +46 -0
  218. package/es/HiCell/CellPinToAction.js +20 -41
  219. package/es/HiCell/CellRate.js +32 -55
  220. package/es/HiCell/CellRate.test.js +73 -0
  221. package/es/HiCell/CellSentinel.js +22 -42
  222. package/es/HiCell/CellSentinel.test.js +48 -0
  223. package/es/HiCell/CellSentinelScore.js +23 -44
  224. package/es/HiCell/CellText.js +37 -56
  225. package/es/HiCell/CellText.test.js +76 -0
  226. package/es/HiCell/CellTextStyled.js +8 -21
  227. package/es/HiCell/index.js +9 -79
  228. package/es/HiCheckbox/HiCheckbox.js +35 -60
  229. package/es/HiCheckbox/HiCheckbox.test.js +55 -0
  230. package/es/HiCheckbox/index.js +1 -15
  231. package/es/HiChip/HiChip.js +24 -44
  232. package/es/HiChip/HiChip.test.js +136 -0
  233. package/es/HiChip/HiChipSwitch.js +47 -70
  234. package/es/HiChip/HiChipSwitch.test.js +99 -0
  235. package/es/HiChip/index.js +2 -23
  236. package/es/HiColoredLabel/HiColoredLabel.js +28 -52
  237. package/es/HiColoredLabel/HiColoredLabel.test.js +96 -0
  238. package/es/HiColoredLabel/index.js +1 -15
  239. package/es/HiDatePicker/Caption.js +11 -28
  240. package/es/HiDatePicker/Caption.test.js +65 -0
  241. package/es/HiDatePicker/HiDatePicker.js +100 -115
  242. package/es/HiDatePicker/HiDatePicker.test.js +370 -0
  243. package/es/HiDatePicker/HiDatePickerMobile.js +32 -54
  244. package/es/HiDatePicker/HiDateRangePicker.js +138 -149
  245. package/es/HiDatePicker/HiDateRangePicker.test.js +703 -0
  246. package/es/HiDatePicker/HiDateRangeSelector.js +71 -103
  247. package/es/HiDatePicker/HiDateRangeSelector.test.js +193 -0
  248. package/es/HiDatePicker/ListPicker.js +33 -55
  249. package/es/HiDatePicker/ListPicker.test.js +53 -0
  250. package/es/HiDatePicker/NavBar.js +18 -45
  251. package/es/HiDatePicker/NavBar.test.js +39 -0
  252. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
  253. package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
  254. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
  255. package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
  256. package/es/HiDatePicker/Overlays/Overlay.js +18 -35
  257. package/es/HiDatePicker/Overlays/Overlay.test.js +20 -0
  258. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
  259. package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
  260. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
  261. package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
  262. package/es/HiDatePicker/Overlays/index.js +5 -47
  263. package/es/HiDatePicker/Weekday.js +3 -13
  264. package/es/HiDatePicker/hiLocaleUtils.js +1 -8
  265. package/es/HiDatePicker/hiLocaleUtils.test.js +51 -0
  266. package/es/HiDatePicker/index.js +1 -15
  267. package/es/HiDatePicker/stylesheet.js +9 -22
  268. package/es/HiDotsStepper/HiDot.js +30 -57
  269. package/es/HiDotsStepper/HiDot.test.js +55 -0
  270. package/es/HiDotsStepper/HiDotsStepper.js +29 -47
  271. package/es/HiDotsStepper/HiDotsStepper.test.js +90 -0
  272. package/es/HiDotsStepper/index.js +2 -23
  273. package/es/HiExpansionPanel/HiExpansionPanel.js +42 -72
  274. package/es/HiExpansionPanel/index.js +2 -13
  275. package/es/HiForm/HiAddressField.js +30 -47
  276. package/es/HiForm/HiAddressField.test.js +79 -0
  277. package/es/HiForm/HiEmailField.js +28 -46
  278. package/es/HiForm/HiEmailField.test.js +19 -0
  279. package/es/HiForm/HiFormControl.js +72 -100
  280. package/es/HiForm/HiFormControl.test.js +195 -0
  281. package/es/HiForm/HiFormLabel.js +29 -54
  282. package/es/HiForm/HiFormLabel.test.js +66 -0
  283. package/es/HiForm/HiInput.js +62 -86
  284. package/es/HiForm/HiInput.test.js +202 -0
  285. package/es/HiForm/HiPasswordField.js +29 -55
  286. package/es/HiForm/HiPasswordField.test.js +60 -0
  287. package/es/HiForm/HiSearchField.js +27 -44
  288. package/es/HiForm/HiSearchField.test.js +193 -0
  289. package/es/HiForm/HiSlider.js +42 -64
  290. package/es/HiForm/HiSlider.test.js +99 -0
  291. package/es/HiForm/HiTextField.js +29 -46
  292. package/es/HiForm/HiTextField.test.js +254 -0
  293. package/es/HiForm/HiUpload.js +54 -70
  294. package/es/HiForm/HiUpload.test.js +241 -0
  295. package/es/HiForm/HiUploadField.js +24 -41
  296. package/es/HiForm/HiUploadField.test.js +55 -0
  297. package/es/HiForm/HiUploadInput.js +56 -77
  298. package/es/HiForm/HiUploadInput.test.js +148 -0
  299. package/es/HiForm/index.js +11 -95
  300. package/es/HiIcon/HiIcon.js +22 -44
  301. package/es/HiIcon/index.js +1 -15
  302. package/es/HiIconButton/HiIconButton.js +18 -40
  303. package/es/HiIconButton/HiIconButton.test.js +69 -0
  304. package/es/HiIconButton/index.js +1 -15
  305. package/es/HiLoader/HiLoader.js +9 -24
  306. package/es/HiLoader/HiLoader.test.js +18 -0
  307. package/es/HiLoader/index.js +1 -15
  308. package/es/HiMap/HiMap.js +50 -77
  309. package/es/HiMap/HiMap.test.js +29 -0
  310. package/es/HiMap/HiMapExpand.js +39 -64
  311. package/es/HiMap/HiMapExpand.test.js +48 -0
  312. package/es/HiMap/index.js +2 -23
  313. package/es/HiNotice/HiKPI.js +33 -54
  314. package/es/HiNotice/HiKPI.test.js +171 -0
  315. package/es/HiNotice/HiKPINotice.js +7 -21
  316. package/es/HiNotice/HiKPINotice.test.js +88 -0
  317. package/es/HiNotice/index.js +2 -23
  318. package/es/HiPaymentMeans/HiPaymentMeans.js +112 -131
  319. package/es/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
  320. package/es/HiPaymentMeans/index.js +1 -15
  321. package/es/HiPdfReader/HiPdfReader.js +51 -76
  322. package/es/HiPdfReader/index.js +1 -15
  323. package/es/HiPin/HiPin.js +9 -30
  324. package/es/HiPin/HiPin.test.js +61 -0
  325. package/es/HiPin/index.js +1 -15
  326. package/es/HiRadio/HiRadio.js +7 -24
  327. package/es/HiRadio/HiRadio.test.js +57 -0
  328. package/es/HiRadio/index.js +1 -15
  329. package/es/HiSelect/HiDynamicSelect.js +40 -56
  330. package/es/HiSelect/HiDynamicSelectField.js +22 -40
  331. package/es/HiSelect/HiNestedSelect.js +55 -84
  332. package/es/HiSelect/HiNestedSelectContent.js +46 -73
  333. package/es/HiSelect/HiNestedSelectField.js +22 -40
  334. package/es/HiSelect/HiSelect.js +123 -139
  335. package/es/HiSelect/HiSelect.test.js +1092 -0
  336. package/es/HiSelect/HiSelectContent.js +73 -95
  337. package/es/HiSelect/HiSelectField.js +22 -40
  338. package/es/HiSelect/HiSelectInput.js +63 -87
  339. package/es/HiSelect/HiSelectInput.test.js +21 -0
  340. package/es/HiSelect/HiSelectMobile.js +35 -54
  341. package/es/HiSelect/HiSuggestSelect.js +56 -78
  342. package/es/HiSelect/HiSuggestSelectField.js +22 -40
  343. package/es/HiSelect/index.js +8 -85
  344. package/es/HiSelectableList/HiSelectableList.js +49 -77
  345. package/es/HiSelectableList/HiSelectableList.test.js +173 -0
  346. package/es/HiSelectableList/HiSelectableListHierarchic.js +35 -56
  347. package/es/HiSelectableList/HiSelectableListItem.js +66 -98
  348. package/es/HiSelectableList/HiSelectableListItem.test.js +97 -0
  349. package/es/HiSelectableList/index.js +3 -31
  350. package/es/HiSwitch/HiSwitch.js +20 -45
  351. package/es/HiSwitch/HiSwitch.test.js +41 -0
  352. package/es/HiSwitch/HiSwitchState.js +15 -36
  353. package/es/HiSwitch/HiSwitchState.test.js +76 -0
  354. package/es/HiSwitch/index.js +2 -23
  355. package/es/HiTable/HiCellBuilder.js +44 -72
  356. package/es/HiTable/HiTable.js +29 -47
  357. package/es/HiTable/HiTable.test.js +29 -0
  358. package/es/HiTable/HiTableBody.js +19 -34
  359. package/es/HiTable/HiTableHeader.js +30 -53
  360. package/es/HiTable/HiTableRow.js +29 -56
  361. package/es/HiTable/constants.js +43 -94
  362. package/es/HiTable/index.js +1 -15
  363. package/es/hi-svg-icons/HiAccount.js +18 -36
  364. package/es/hi-svg-icons/HiActivity.js +17 -35
  365. package/es/hi-svg-icons/HiAll.js +22 -42
  366. package/es/hi-svg-icons/HiBilling.js +18 -36
  367. package/es/hi-svg-icons/HiBriefcaseRescue.js +10 -26
  368. package/es/hi-svg-icons/HiCatalog.js +18 -36
  369. package/es/hi-svg-icons/HiCustomer.js +18 -36
  370. package/es/hi-svg-icons/HiDownload.js +11 -25
  371. package/es/hi-svg-icons/HiFinance.js +18 -36
  372. package/es/hi-svg-icons/HiPermission.js +17 -35
  373. package/es/hi-svg-icons/HiRoute.js +18 -36
  374. package/es/hi-svg-icons/HiSettlement.js +18 -36
  375. package/es/hi-svg-icons/HiSizeLarge.js +12 -27
  376. package/es/hi-svg-icons/HiSizeMedium.js +11 -25
  377. package/es/hi-svg-icons/HiSizeSmall.js +11 -25
  378. package/es/hi-svg-icons/HiTransaction.js +18 -36
  379. package/es/hi-svg-icons/HiUser.js +18 -36
  380. package/es/hi-svg-icons/HiWidget.js +22 -42
  381. package/es/hi-svg-icons/index.js +18 -151
  382. package/es/hi-svg-icons/index.text.js +11 -21
  383. package/es/styleguide/Wrapper.js +19 -36
  384. package/es/styles/MuiThemeProvider.js +39 -59
  385. package/es/styles/colorManipulator.js +16 -44
  386. package/es/styles/colorManipulator.test.js +242 -0
  387. package/es/styles/createBreakpoints.js +6 -20
  388. package/es/styles/createBreakpoints.test.js +48 -0
  389. package/es/styles/createGenerateClassName.js +5 -15
  390. package/es/styles/createGenerateClassName.test.js +141 -0
  391. package/es/styles/createMixins.js +8 -19
  392. package/es/styles/createMixins.test.js +24 -0
  393. package/es/styles/createMuiTheme.js +34 -53
  394. package/es/styles/createMuiTheme.test.js +67 -0
  395. package/es/styles/createPalette.js +30 -50
  396. package/es/styles/createPalette.test.js +159 -0
  397. package/es/styles/createStyles.js +1 -8
  398. package/es/styles/createStyles.test.js +8 -0
  399. package/es/styles/createTypography.js +18 -30
  400. package/es/styles/createTypography.test.js +60 -0
  401. package/es/styles/getStylesCreator.js +11 -24
  402. package/es/styles/getStylesCreator.test.js +92 -0
  403. package/es/styles/getThemeProps.js +1 -9
  404. package/es/styles/getThemeProps.test.js +39 -0
  405. package/es/styles/index.js +5 -47
  406. package/es/styles/jssPreset.js +9 -25
  407. package/es/styles/mergeClasses.js +7 -19
  408. package/es/styles/shadows.js +1 -8
  409. package/es/styles/shape.js +1 -8
  410. package/es/styles/spacing.js +1 -9
  411. package/es/styles/themeListener.js +5 -18
  412. package/es/styles/themeListener.test.js +26 -0
  413. package/es/styles/transitions.js +18 -38
  414. package/es/styles/transitions.test.js +208 -0
  415. package/es/styles/zIndex.js +1 -8
  416. package/es/test-utils/createMount.js +11 -22
  417. package/es/test-utils/createRender.js +8 -19
  418. package/es/test-utils/createShallow.js +13 -23
  419. package/es/test-utils/getClasses.js +2 -11
  420. package/es/test-utils/index.js +5 -47
  421. package/es/test-utils/until.js +6 -16
  422. package/es/test-utils/until.test.js +157 -0
  423. package/es/test-utils/unwrap.js +1 -8
  424. package/es/theme/palette.js +2 -10
  425. package/es/theme/typography.js +2 -10
  426. package/es/theme.js +2 -11
  427. package/es/transitions/utils.js +2 -13
  428. package/es/utils/exactProp.js +5 -18
  429. package/es/utils/helpers.js +18 -55
  430. package/es/withMobileDialog/index.js +1 -15
  431. package/es/withMobileDialog/withMobileDialog.js +7 -22
  432. package/es/withMobileDialog/withMobileDialog.test.js +67 -0
  433. package/hi-svg-icons/HiAccount.js +18 -36
  434. package/hi-svg-icons/HiActivity.js +17 -35
  435. package/hi-svg-icons/HiAll.js +22 -42
  436. package/hi-svg-icons/HiBilling.js +18 -36
  437. package/hi-svg-icons/HiBriefcaseRescue.js +10 -26
  438. package/hi-svg-icons/HiCatalog.js +18 -36
  439. package/hi-svg-icons/HiCustomer.js +18 -36
  440. package/hi-svg-icons/HiDownload.js +11 -25
  441. package/hi-svg-icons/HiFinance.js +18 -36
  442. package/hi-svg-icons/HiPermission.js +17 -35
  443. package/hi-svg-icons/HiRoute.js +18 -36
  444. package/hi-svg-icons/HiSettlement.js +18 -36
  445. package/hi-svg-icons/HiSizeLarge.js +12 -27
  446. package/hi-svg-icons/HiSizeMedium.js +11 -25
  447. package/hi-svg-icons/HiSizeSmall.js +11 -25
  448. package/hi-svg-icons/HiTransaction.js +18 -36
  449. package/hi-svg-icons/HiUser.js +18 -36
  450. package/hi-svg-icons/HiWidget.js +22 -42
  451. package/hi-svg-icons/index.js +18 -151
  452. package/hi-svg-icons/index.text.js +11 -21
  453. package/package.json +1 -1
  454. package/styleguide/Wrapper.js +19 -36
  455. package/styles/MuiThemeProvider.js +39 -59
  456. package/styles/colorManipulator.js +16 -44
  457. package/styles/colorManipulator.test.js +242 -0
  458. package/styles/createBreakpoints.js +6 -20
  459. package/styles/createBreakpoints.test.js +48 -0
  460. package/styles/createGenerateClassName.js +5 -15
  461. package/styles/createGenerateClassName.test.js +141 -0
  462. package/styles/createMixins.js +8 -19
  463. package/styles/createMixins.test.js +24 -0
  464. package/styles/createMuiTheme.js +34 -53
  465. package/styles/createMuiTheme.test.js +67 -0
  466. package/styles/createPalette.js +30 -50
  467. package/styles/createPalette.test.js +159 -0
  468. package/styles/createStyles.js +1 -8
  469. package/styles/createStyles.test.js +8 -0
  470. package/styles/createTypography.js +18 -30
  471. package/styles/createTypography.test.js +60 -0
  472. package/styles/getStylesCreator.js +11 -24
  473. package/styles/getStylesCreator.test.js +92 -0
  474. package/styles/getThemeProps.js +1 -9
  475. package/styles/getThemeProps.test.js +39 -0
  476. package/styles/index.js +5 -47
  477. package/styles/jssPreset.js +9 -25
  478. package/styles/mergeClasses.js +7 -19
  479. package/styles/shadows.js +1 -8
  480. package/styles/shape.js +1 -8
  481. package/styles/spacing.js +1 -9
  482. package/styles/themeListener.js +5 -18
  483. package/styles/themeListener.test.js +26 -0
  484. package/styles/transitions.js +18 -38
  485. package/styles/transitions.test.js +208 -0
  486. package/styles/zIndex.js +1 -8
  487. package/test-utils/createMount.js +11 -22
  488. package/test-utils/createRender.js +8 -19
  489. package/test-utils/createShallow.js +13 -23
  490. package/test-utils/getClasses.js +2 -11
  491. package/test-utils/index.js +5 -47
  492. package/test-utils/until.js +6 -16
  493. package/test-utils/until.test.js +157 -0
  494. package/test-utils/unwrap.js +1 -8
  495. package/theme/palette.js +2 -10
  496. package/theme/typography.js +2 -10
  497. package/theme.js +2 -11
  498. package/transitions/utils.js +2 -13
  499. package/utils/exactProp.js +5 -18
  500. package/utils/helpers.js +18 -55
  501. package/withMobileDialog/index.js +1 -15
  502. package/withMobileDialog/withMobileDialog.js +7 -22
  503. package/withMobileDialog/withMobileDialog.test.js +67 -0
@@ -1,56 +1,25 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.styles = void 0;
9
-
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
-
14
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
15
-
16
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
21
-
22
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
23
-
24
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
25
-
26
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
27
-
28
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
29
-
30
- var _react = _interopRequireDefault(require("react"));
31
-
32
- var _classnames = _interopRequireDefault(require("classnames"));
33
-
34
- var _Warning = _interopRequireDefault(require("@material-ui/icons/Warning"));
35
-
36
- var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
37
-
38
- var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
39
-
40
- var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
41
-
42
- var _styles = require("@material-ui/core/styles");
43
-
44
- var _HiFormLabel = _interopRequireDefault(require("./HiFormLabel"));
45
-
46
- var _HiIconButton = _interopRequireDefault(require("../HiIconButton"));
47
-
48
- var _helpers = require("../utils/helpers");
49
-
50
- var _index = _interopRequireDefault(require("keycode/index"));
51
-
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
6
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
7
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
52
10
  // @inheritedComponent FormControl
53
- var styles = function styles(theme) {
11
+ import React from 'react';
12
+ import classNames from 'classnames';
13
+ import Warning from '@material-ui/icons/Warning';
14
+ import Info from '@material-ui/icons/Info';
15
+ import FormControl from '@material-ui/core/FormControl';
16
+ import FormHelperText from '@material-ui/core/FormHelperText';
17
+ import { withStyles } from '@material-ui/core/styles';
18
+ import HiFormLabel from './HiFormLabel';
19
+ import HiIconButton from '../HiIconButton';
20
+ import { escapeHTML } from '../utils/helpers';
21
+ import keycode from 'keycode/index';
22
+ export var styles = function styles(theme) {
54
23
  return {
55
24
  helperTextClassName: {
56
25
  color: theme.palette.neutral.main,
@@ -84,7 +53,7 @@ var styles = function styles(theme) {
84
53
  iconButtonInfo: {},
85
54
  iconButtonInfoActive: {},
86
55
  iconFullWidth: {},
87
- errorDiv: (0, _objectSpread2.default)({}, theme.typography.b3, {
56
+ errorDiv: _objectSpread({}, theme.typography.b3, {
88
57
  backgroundColor: theme.palette.negative.main,
89
58
  color: '#FFFFFF',
90
59
  padding: '16px 8px',
@@ -114,7 +83,7 @@ var styles = function styles(theme) {
114
83
  errorDivArrowDown: {
115
84
  borderTopColor: theme.palette.negative.main
116
85
  },
117
- helperDiv: (0, _objectSpread2.default)({}, theme.typography.b2, {
86
+ helperDiv: _objectSpread({}, theme.typography.b2, {
118
87
  width: '100%',
119
88
  backgroundColor: '#ffffff',
120
89
  color: theme.palette.neutral.normal,
@@ -139,20 +108,19 @@ var styles = function styles(theme) {
139
108
  * Champs input pour formulaire
140
109
  */
141
110
 
142
-
143
- exports.styles = styles;
144
-
145
111
  var HiFormControl =
146
112
  /*#__PURE__*/
147
113
  function (_React$PureComponent) {
148
- (0, _inherits2.default)(HiFormControl, _React$PureComponent);
114
+ _inherits(HiFormControl, _React$PureComponent);
149
115
 
150
116
  function HiFormControl(props) {
151
117
  var _this;
152
118
 
153
- (0, _classCallCheck2.default)(this, HiFormControl);
154
- _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiFormControl).call(this, props));
155
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHelperClick", function (event) {
119
+ _classCallCheck(this, HiFormControl);
120
+
121
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(HiFormControl).call(this, props));
122
+
123
+ _defineProperty(_assertThisInitialized(_this), "handleHelperClick", function (event) {
156
124
  _this.setState(function (prevState) {
157
125
  return {
158
126
  helperOpen: !prevState.helperOpen
@@ -163,21 +131,24 @@ function (_React$PureComponent) {
163
131
  event.preventDefault();
164
132
  }
165
133
  });
166
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
167
- var key = (0, _index.default)(event);
134
+
135
+ _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
136
+ var key = keycode(event);
168
137
 
169
138
  if (['space', 'enter'].includes(key)) {
170
139
  _this.handleHelperClick(event);
171
140
  }
172
141
  });
173
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHover", function (value) {
142
+
143
+ _defineProperty(_assertThisInitialized(_this), "handleHover", function (value) {
174
144
  return function () {
175
145
  _this.setState({
176
146
  hovered: value
177
147
  });
178
148
  };
179
149
  });
180
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFocus", function (value) {
150
+
151
+ _defineProperty(_assertThisInitialized(_this), "handleFocus", function (value) {
181
152
  return function () {
182
153
  _this.setState({
183
154
  focused: value
@@ -190,19 +161,20 @@ function (_React$PureComponent) {
190
161
  }
191
162
  };
192
163
  });
164
+
193
165
  _this.state = {
194
166
  helperOpen: false,
195
167
  focused: false,
196
168
  hovered: false
197
169
  };
198
- _this.handleHelperClick = _this.handleHelperClick.bind((0, _assertThisInitialized2.default)(_this));
199
- _this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2.default)(_this));
200
- _this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)(_this));
201
- _this.handleHover = _this.handleHover.bind((0, _assertThisInitialized2.default)(_this));
170
+ _this.handleHelperClick = _this.handleHelperClick.bind(_assertThisInitialized(_this));
171
+ _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
172
+ _this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
173
+ _this.handleHover = _this.handleHover.bind(_assertThisInitialized(_this));
202
174
  return _this;
203
175
  }
204
176
 
205
- (0, _createClass2.default)(HiFormControl, [{
177
+ _createClass(HiFormControl, [{
206
178
  key: "render",
207
179
  value: function render() {
208
180
  var _classNames2;
@@ -226,66 +198,68 @@ function (_React$PureComponent) {
226
198
  rootRef = _this$props.rootRef,
227
199
  maxLength = _this$props.maxLength,
228
200
  nbChars = _this$props.nbChars,
229
- others = (0, _objectWithoutProperties2.default)(_this$props, ["children", "classes", "className", "disabled", "error", "errorText", "id", "label", "InputLabelProps", "helperText", "helperIcon", "FormHelperTextProps", "fullWidth", "required", "multiline", "rootRef", "maxLength", "nbChars"]);
201
+ others = _objectWithoutProperties(_this$props, ["children", "classes", "className", "disabled", "error", "errorText", "id", "label", "InputLabelProps", "helperText", "helperIcon", "FormHelperTextProps", "fullWidth", "required", "multiline", "rootRef", "maxLength", "nbChars"]);
202
+
230
203
  var _this$state = this.state,
231
204
  helperOpen = _this$state.helperOpen,
232
205
  focused = _this$state.focused,
233
206
  hovered = _this$state.hovered;
234
- return _react.default.createElement(_FormControl.default, (0, _extends2.default)({
207
+ return React.createElement(FormControl, Object.assign({
235
208
  fullWidth: fullWidth,
236
209
  className: className,
237
210
  error: error,
238
211
  ref: rootRef
239
- }, others), error && errorText && helperOpen && _react.default.createElement("div", {
212
+ }, others), error && errorText && helperOpen && React.createElement("div", {
240
213
  className: classes.errorDiv
241
- }, _react.default.createElement("div", {
242
- className: (0, _classnames.default)(classes.arrowDown, classes.errorDivArrowDown, fullWidth ? [classes.arrowFullWidth] : [classes.arrowNotFullWidth])
243
- }), _react.default.createElement("span", {
214
+ }, React.createElement("div", {
215
+ className: classNames(classes.arrowDown, classes.errorDivArrowDown, fullWidth ? [classes.arrowFullWidth] : [classes.arrowNotFullWidth])
216
+ }), React.createElement("span", {
244
217
  // eslint-disable-next-line react/no-danger
245
218
  dangerouslySetInnerHTML: {
246
- __html: (0, _helpers.escapeHTML)(errorText)
219
+ __html: escapeHTML(errorText)
247
220
  }
248
- })), helperIcon && helperText && !error && helperOpen && _react.default.createElement("div", {
221
+ })), helperIcon && helperText && !error && helperOpen && React.createElement("div", {
249
222
  className: classes.helperDiv
250
- }, _react.default.createElement("div", {
251
- className: (0, _classnames.default)(classes.arrowDown, classes.helperDivArrowDown, fullWidth ? [classes.arrowFullWidth] : [classes.arrowNotFullWidth])
252
- }), _react.default.createElement("span", {
223
+ }, React.createElement("div", {
224
+ className: classNames(classes.arrowDown, classes.helperDivArrowDown, fullWidth ? [classes.arrowFullWidth] : [classes.arrowNotFullWidth])
225
+ }), React.createElement("span", {
253
226
  // eslint-disable-next-line react/no-danger
254
227
  dangerouslySetInnerHTML: {
255
- __html: (0, _helpers.escapeHTML)(helperText)
228
+ __html: escapeHTML(helperText)
256
229
  }
257
- })), label && _react.default.createElement(_HiFormLabel.default, (0, _extends2.default)({
230
+ })), label && React.createElement(HiFormLabel, Object.assign({
258
231
  htmlFor: id,
259
232
  label: label,
260
233
  required: required,
261
234
  disabled: disabled,
262
235
  focused: !disabled && (focused || hovered)
263
- }, InputLabelProps), error && errorText && _react.default.createElement(_HiIconButton.default, {
264
- className: (0, _classnames.default)(classes.iconButton, classes.iconButtonError, (0, _defineProperty2.default)({}, classes.iconFullWidth, fullWidth)),
236
+ }, InputLabelProps), error && errorText && React.createElement(HiIconButton, {
237
+ className: classNames(classes.iconButton, classes.iconButtonError, _defineProperty({}, classes.iconFullWidth, fullWidth)),
265
238
  onClick: this.handleHelperClick
266
- }, _react.default.createElement(_Warning.default, {
267
- className: (0, _classnames.default)(classes.icon)
268
- })), helperIcon && helperText && !error && _react.default.createElement(_HiIconButton.default, {
269
- className: (0, _classnames.default)(classes.iconButton, classes.iconButtonInfo, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.iconButtonInfoActive, helperOpen), (0, _defineProperty2.default)(_classNames2, classes.iconFullWidth, fullWidth), _classNames2)),
239
+ }, React.createElement(Warning, {
240
+ className: classNames(classes.icon)
241
+ })), helperIcon && helperText && !error && React.createElement(HiIconButton, {
242
+ className: classNames(classes.iconButton, classes.iconButtonInfo, (_classNames2 = {}, _defineProperty(_classNames2, classes.iconButtonInfoActive, helperOpen), _defineProperty(_classNames2, classes.iconFullWidth, fullWidth), _classNames2)),
270
243
  onClick: this.handleHelperClick
271
- }, _react.default.createElement(_Info.default, {
272
- className: (0, _classnames.default)(classes.icon)
273
- }))), _react.default.createElement("div", {
244
+ }, React.createElement(Info, {
245
+ className: classNames(classes.icon)
246
+ }))), React.createElement("div", {
274
247
  onMouseEnter: this.handleHover(true),
275
248
  onMouseLeave: this.handleHover(false),
276
249
  onFocus: this.handleFocus(true),
277
250
  onBlur: this.handleFocus(false)
278
- }, children), !multiline && helperText && !helperIcon && _react.default.createElement(_FormHelperText.default, (0, _extends2.default)({
251
+ }, children), !multiline && helperText && !helperIcon && React.createElement(FormHelperText, Object.assign({
279
252
  className: classes.helperTextClassName
280
- }, FormHelperTextProps), helperText), multiline && _react.default.createElement(_FormHelperText.default, (0, _extends2.default)({
253
+ }, FormHelperTextProps), helperText), multiline && React.createElement(FormHelperText, Object.assign({
281
254
  className: classes.helperTextClassName
282
255
  }, FormHelperTextProps), nbChars, "/", maxLength));
283
256
  }
284
257
  }]);
258
+
285
259
  return HiFormControl;
286
- }(_react.default.PureComponent);
260
+ }(React.PureComponent);
287
261
 
288
- (0, _defineProperty2.default)(HiFormControl, "defaultProps", {
262
+ _defineProperty(HiFormControl, "defaultProps", {
289
263
  fullWidth: true,
290
264
  required: true,
291
265
  disabled: false,
@@ -298,9 +272,7 @@ function (_React$PureComponent) {
298
272
  maxLength: 280
299
273
  });
300
274
 
301
- var _default = (0, _styles.withStyles)(styles, {
275
+ export default withStyles(styles, {
302
276
  hiComponent: true,
303
277
  name: 'HmuiHiFormControl'
304
- })(HiFormControl);
305
-
306
- exports.default = _default;
278
+ })(HiFormControl);
@@ -0,0 +1,195 @@
1
+ /* eslint-disable */
2
+ import React from 'react';
3
+ import { assert } from 'chai';
4
+ import { spy } from 'sinon';
5
+ import { createShallow, createMount } from '../test-utils';
6
+ import Info from '@material-ui/icons/Info';
7
+ import HiFormControl from './HiFormControl';
8
+ import HiIconButton from '../HiIconButton';
9
+ import HiFormLabel from './HiFormLabel';
10
+ import HiInput from './HiInput';
11
+ import FormControl from '@material-ui/core/FormControl';
12
+ import FormHelperText from '@material-ui/core/FormHelperText';
13
+ describe('<HiFormControl />', function () {
14
+ var shallow;
15
+ var mount;
16
+ before(function () {
17
+ shallow = createShallow({
18
+ dive: true
19
+ });
20
+ });
21
+ beforeEach(function () {
22
+ mount = createMount();
23
+ });
24
+ afterEach(function () {
25
+ mount.cleanUp();
26
+ });
27
+ describe('shallow', function () {
28
+ var wrapper;
29
+ beforeEach(function () {
30
+ wrapper = shallow(React.createElement(HiFormControl, null, React.createElement(HiInput, null)));
31
+ });
32
+ describe('structure', function () {
33
+ it('should be a FormControl', function () {
34
+ assert.strictEqual(wrapper.name(), 'WithStyles(FormControl)');
35
+ assert.strictEqual(wrapper.dive().name(), 'FormControl');
36
+ });
37
+ it('should have initial props', function () {
38
+ assert.strictEqual(wrapper.props().error, false);
39
+ });
40
+ it('should pass className to the FormControl', function () {
41
+ wrapper.setProps({
42
+ className: 'foo'
43
+ });
44
+ assert.strictEqual(wrapper.dive().hasClass('foo'), true);
45
+ });
46
+ it('should have one child', function () {
47
+ assert.strictEqual(wrapper.children().length, 1);
48
+ });
49
+ it('should forward the fullWidth prop to FormControl', function () {
50
+ wrapper = shallow(React.createElement(HiFormControl, {
51
+ fullWidth: true
52
+ }));
53
+ assert.strictEqual(wrapper.props().fullWidth, true);
54
+ });
55
+ it('should display help', function () {
56
+ assert.strictEqual(wrapper.state().helperOpen, false);
57
+ wrapper.setProps({
58
+ label: 'Label',
59
+ helperText: 'helper',
60
+ helperIcon: true
61
+ });
62
+ var helperIcon = wrapper.find(HiIconButton);
63
+ assert.strictEqual(wrapper.childAt(0).type(), HiFormLabel, 'helper div should not be here');
64
+ helperIcon.simulate('click');
65
+ assert.strictEqual(wrapper.state().helperOpen, true, 'helper should be open');
66
+ assert.strictEqual(wrapper.childAt(0).type(), 'div', 'helper div should be here');
67
+ });
68
+ });
69
+ describe('with a label', function () {
70
+ beforeEach(function () {
71
+ wrapper.setProps({
72
+ label: 'Foo bar'
73
+ });
74
+ });
75
+ it('should have 2 children', function () {
76
+ assert.strictEqual(wrapper.children().length, 2);
77
+ });
78
+ it('should have an HiFormLabel as the first child', function () {
79
+ assert.strictEqual(wrapper.childAt(0).type(), HiFormLabel);
80
+ });
81
+ it('should have a div as the second child', function () {
82
+ assert.strictEqual(wrapper.childAt(1).type(), 'div');
83
+ });
84
+ });
85
+ describe('with a helper text', function () {
86
+ beforeEach(function () {
87
+ wrapper.setProps({
88
+ helperText: 'Foo bar'
89
+ });
90
+ });
91
+ it('should have 2 children', function () {
92
+ assert.strictEqual(wrapper.children().length, 2);
93
+ });
94
+ it('should have a FormHelperText as the second child', function () {
95
+ assert.strictEqual(wrapper.childAt(1).type(), FormHelperText);
96
+ });
97
+ it('should have a div as the first child', function () {
98
+ assert.strictEqual(wrapper.childAt(0).type(), 'div');
99
+ });
100
+ });
101
+ describe('with a helper text', function () {
102
+ beforeEach(function () {
103
+ wrapper.setProps({
104
+ multiline: true
105
+ });
106
+ });
107
+ it('should have 2 children', function () {
108
+ assert.strictEqual(wrapper.children().length, 2);
109
+ });
110
+ });
111
+ });
112
+ describe('mount', function () {
113
+ var wrapper;
114
+ var handleBlur = spy();
115
+ var handleFocus = spy();
116
+ beforeEach(function () {
117
+ wrapper = mount(React.createElement(HiFormControl, {
118
+ onBlur: handleBlur,
119
+ onFocus: handleFocus,
120
+ helperText: "helper"
121
+ }));
122
+ });
123
+ describe('callbacks', function () {
124
+ it('should be called', function () {
125
+ wrapper.find(FormControl).simulate('focus');
126
+ assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
127
+ wrapper.find(FormControl).simulate('blur');
128
+ assert.strictEqual(handleBlur.callCount, 1, 'should trigger blur callback');
129
+ });
130
+ });
131
+ describe('without callbacks (for 100% Branch coverage', function () {
132
+ it('should not be called', function () {
133
+ // wrapper = mount(
134
+ // <HiFormControl
135
+ // value="defaultValue"
136
+ // label="label"
137
+ // helperText="My helper"
138
+ // helperIcon
139
+ // />,
140
+ // );
141
+ wrapper.find(FormControl).simulate('blur');
142
+ });
143
+ });
144
+ describe('helpers', function () {
145
+ it('should be displayed', function () {
146
+ assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
147
+ });
148
+ });
149
+ describe('helpers on multiline', function () {
150
+ it('should be displayed', function () {
151
+ assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
152
+ });
153
+ it('should display nbChars/maxLength', function () {
154
+ wrapper.setProps({
155
+ multiline: true,
156
+ nbChars: 5,
157
+ maxLength: 200
158
+ });
159
+ assert.strictEqual(wrapper.find('p').text(), '5/200', 'Should render helper');
160
+ });
161
+ });
162
+ describe('helpers', function () {
163
+ it('should be displayed', function () {
164
+ wrapper.setProps({
165
+ helperIcon: true,
166
+ value: 'Default value',
167
+ label: 'label'
168
+ });
169
+ assert.strictEqual(wrapper.find('p').length, 0, 'Should not have helper p');
170
+ assert.strictEqual(wrapper.find(Info).length, 1, 'Should have helper icon');
171
+ assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
172
+ var helperIcon = wrapper.find(Info);
173
+ helperIcon.simulate('click');
174
+ assert.strictEqual(wrapper.childAt(0).text(), 'helperlabel', 'First child should be the helper div');
175
+ });
176
+ });
177
+ describe('errors', function () {
178
+ it('should be displayed', function () {
179
+ wrapper.unmount();
180
+ wrapper = mount(React.createElement(HiFormControl, {
181
+ value: "defaultValue",
182
+ label: "label",
183
+ error: true,
184
+ errorText: "My error"
185
+ }));
186
+ assert.strictEqual(wrapper.find('p').length, 0, 'Should not have error p');
187
+ assert.strictEqual(wrapper.find(HiIconButton).length, 1, 'Should have error icon');
188
+ assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
189
+ var errorIcon = wrapper.find(HiIconButton);
190
+ errorIcon.simulate('click');
191
+ assert.strictEqual(wrapper.childAt(0).text(), 'My errorlabel', 'First child should be the error div');
192
+ });
193
+ });
194
+ });
195
+ });
@@ -1,42 +1,19 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.styles = void 0;
9
-
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
-
14
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
15
-
16
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
21
-
22
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
23
-
24
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
25
-
26
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
27
-
28
- var _react = _interopRequireDefault(require("react"));
29
-
30
- var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel"));
31
-
32
- var _classnames = _interopRequireDefault(require("classnames"));
33
-
34
- var _styles = require("@material-ui/core/styles");
35
-
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
36
9
  // @inheritedComponent InputLabel
37
- var styles = function styles(theme) {
10
+ import React from 'react';
11
+ import InputLabel from '@material-ui/core/InputLabel';
12
+ import classNames from 'classnames';
13
+ import { withStyles } from '@material-ui/core/styles';
14
+ export var styles = function styles(theme) {
38
15
  return {
39
- root: (0, _objectSpread2.default)({}, theme.typography.h4, {
16
+ root: _objectSpread({}, theme.typography.h4, {
40
17
  fontWeight: theme.typography.fontWeightRegular,
41
18
  color: theme.palette.neutral.main,
42
19
  position: 'inherit',
@@ -64,20 +41,18 @@ var styles = function styles(theme) {
64
41
  * Label pour champs de formulaire
65
42
  */
66
43
 
67
-
68
- exports.styles = styles;
69
-
70
44
  var HiFormLabel =
71
45
  /*#__PURE__*/
72
46
  function (_React$PureComponent) {
73
- (0, _inherits2.default)(HiFormLabel, _React$PureComponent);
47
+ _inherits(HiFormLabel, _React$PureComponent);
74
48
 
75
49
  function HiFormLabel() {
76
- (0, _classCallCheck2.default)(this, HiFormLabel);
77
- return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiFormLabel).apply(this, arguments));
50
+ _classCallCheck(this, HiFormLabel);
51
+
52
+ return _possibleConstructorReturn(this, _getPrototypeOf(HiFormLabel).apply(this, arguments));
78
53
  }
79
54
 
80
- (0, _createClass2.default)(HiFormLabel, [{
55
+ _createClass(HiFormLabel, [{
81
56
  key: "render",
82
57
  value: function render() {
83
58
  var _this$props = this.props,
@@ -90,9 +65,10 @@ function (_React$PureComponent) {
90
65
  required = _this$props.required,
91
66
  translations = _this$props.translations,
92
67
  focused = _this$props.focused,
93
- other = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "className", "children", "htmlFor", "label", "InputLabelProps", "required", "translations", "focused"]);
94
- var className = (0, _classnames.default)(classes.root, classNameProp);
95
- return _react.default.createElement(_InputLabel.default, (0, _extends2.default)({
68
+ other = _objectWithoutProperties(_this$props, ["classes", "className", "children", "htmlFor", "label", "InputLabelProps", "required", "translations", "focused"]);
69
+
70
+ var className = classNames(classes.root, classNameProp);
71
+ return React.createElement(InputLabel, Object.assign({
96
72
  htmlFor: htmlFor,
97
73
  className: className,
98
74
  focused: focused,
@@ -102,24 +78,23 @@ function (_React$PureComponent) {
102
78
  error: classes.error,
103
79
  focused: classes.focused
104
80
  }
105
- }, InputLabelProps, other), label, !required && _react.default.createElement("span", {
81
+ }, InputLabelProps, other), label, !required && React.createElement("span", {
106
82
  className: classes.optional
107
83
  }, " ", translations.optional), children);
108
84
  }
109
85
  }]);
86
+
110
87
  return HiFormLabel;
111
- }(_react.default.PureComponent);
88
+ }(React.PureComponent);
112
89
 
113
- (0, _defineProperty2.default)(HiFormLabel, "defaultProps", {
90
+ _defineProperty(HiFormLabel, "defaultProps", {
114
91
  required: true,
115
92
  translations: {
116
93
  optional: 'optional'
117
94
  }
118
95
  });
119
96
 
120
- var _default = (0, _styles.withStyles)(styles, {
97
+ export default withStyles(styles, {
121
98
  hiComponent: true,
122
99
  name: 'HmuiHiFormLabel'
123
- })(HiFormLabel);
124
-
125
- exports.default = _default;
100
+ })(HiFormLabel);