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

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 (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,62 +1,44 @@
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 = void 0;
9
-
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
15
-
16
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
17
-
18
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
19
-
20
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
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 _react = _interopRequireDefault(require("react"));
27
-
28
- var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
29
-
30
- var _HiInput = _interopRequireDefault(require("./HiInput"));
31
-
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
5
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
6
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
32
8
  // @inheritedComponent TextField
33
-
9
+ import React from 'react';
10
+ import HiFormControl from './HiFormControl';
11
+ import HiInput from './HiInput';
34
12
  /**
35
13
  * Champs input pour formulaire
36
14
  */
15
+
37
16
  var HiTextField =
38
17
  /*#__PURE__*/
39
18
  function (_React$PureComponent) {
40
- (0, _inherits2.default)(HiTextField, _React$PureComponent);
19
+ _inherits(HiTextField, _React$PureComponent);
41
20
 
42
21
  function HiTextField(props) {
43
22
  var _this;
44
23
 
45
- (0, _classCallCheck2.default)(this, HiTextField);
46
- _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiTextField).call(this, props));
47
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focus", function () {
24
+ _classCallCheck(this, HiTextField);
25
+
26
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(HiTextField).call(this, props));
27
+
28
+ _defineProperty(_assertThisInitialized(_this), "focus", function () {
48
29
  _this.input.focus();
49
30
  });
31
+
50
32
  _this.state = {
51
33
  nbChars: props.value ? props.value.length : 0
52
34
  };
53
- _this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)(_this));
54
- _this.handleChange = _this.handleChange.bind((0, _assertThisInitialized2.default)(_this));
55
- _this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)(_this));
35
+ _this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
36
+ _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
37
+ _this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
56
38
  return _this;
57
39
  }
58
40
 
59
- (0, _createClass2.default)(HiTextField, [{
41
+ _createClass(HiTextField, [{
60
42
  key: "handleBlur",
61
43
  value: function handleBlur(event) {
62
44
  if (this.props.onBlur) {
@@ -113,7 +95,7 @@ function (_React$PureComponent) {
113
95
  rows = _this$props.rows,
114
96
  maxLength = _this$props.maxLength;
115
97
  var nbChars = this.state.nbChars;
116
- return _react.default.createElement(_HiFormControl.default, {
98
+ return React.createElement(HiFormControl, {
117
99
  label: label,
118
100
  required: required,
119
101
  disabled: disabled,
@@ -127,7 +109,7 @@ function (_React$PureComponent) {
127
109
  maxLength: maxLength,
128
110
  nbChars: nbChars,
129
111
  InputLabelProps: HiInputLabelProps
130
- }, _react.default.createElement(_HiInput.default, (0, _extends2.default)({
112
+ }, React.createElement(HiInput, Object.assign({
131
113
  inputId: id,
132
114
  name: name,
133
115
  type: type,
@@ -150,10 +132,11 @@ function (_React$PureComponent) {
150
132
  }, HiInputProps)));
151
133
  }
152
134
  }]);
135
+
153
136
  return HiTextField;
154
- }(_react.default.PureComponent);
137
+ }(React.PureComponent);
155
138
 
156
- (0, _defineProperty2.default)(HiTextField, "defaultProps", {
139
+ _defineProperty(HiTextField, "defaultProps", {
157
140
  name: '',
158
141
  type: 'text',
159
142
  fullWidth: true,
@@ -166,5 +149,5 @@ function (_React$PureComponent) {
166
149
  multiline: false,
167
150
  maxLength: 280
168
151
  });
169
- var _default = HiTextField;
170
- exports.default = _default;
152
+
153
+ export default HiTextField;
@@ -0,0 +1,254 @@
1
+ import React from 'react';
2
+ import { assert } from 'chai';
3
+ import { spy } from 'sinon';
4
+ import { createShallow, createMount } from '../test-utils';
5
+ import Warning from '@material-ui/icons/Warning';
6
+ import Info from '@material-ui/icons/Info';
7
+ import HiTextField from './HiTextField';
8
+ import HiInput from './HiInput';
9
+ describe('<HiTextField />', function () {
10
+ var shallow;
11
+ var mount;
12
+ before(function () {
13
+ shallow = createShallow({
14
+ dive: true
15
+ });
16
+ });
17
+ beforeEach(function () {
18
+ mount = createMount();
19
+ });
20
+ afterEach(function () {
21
+ mount.cleanUp();
22
+ });
23
+ describe('shallow', function () {
24
+ var wrapper;
25
+ beforeEach(function () {
26
+ wrapper = shallow(React.createElement(HiTextField, {
27
+ id: "text",
28
+ HiInputProps: {
29
+ name: 'testName',
30
+ startAdornment: 'Archive',
31
+ className: 'fullWidth'
32
+ }
33
+ }));
34
+ });
35
+ describe('shallow', function () {
36
+ it('should be a FormControl', function () {
37
+ assert.strictEqual(wrapper.name(), 'HiFormControl');
38
+ assert.strictEqual(wrapper.dive().name(), 'WithStyles(FormControl)');
39
+ });
40
+ it('should have initial props', function () {
41
+ assert.strictEqual(wrapper.props().error, false);
42
+ assert.strictEqual(wrapper.childAt(0).props().error, false);
43
+ });
44
+ it('should pass className to the FormControl', function () {
45
+ wrapper.setProps({
46
+ className: 'foo'
47
+ });
48
+ assert.strictEqual(wrapper.dive().hasClass('foo'), true);
49
+ });
50
+ it('should have an HiInput as the only child', function () {
51
+ assert.strictEqual(wrapper.children().length, 1);
52
+ assert.strictEqual(wrapper.childAt(0).type(), HiInput);
53
+ });
54
+ it('should forward the error prop to Input', function () {
55
+ wrapper = shallow(React.createElement(HiTextField, {
56
+ id: "text",
57
+ error: true
58
+ }));
59
+ assert.strictEqual(wrapper.childAt(0).props().error, true);
60
+ });
61
+ it('should forward the fullWidth prop to FormControl', function () {
62
+ wrapper = shallow(React.createElement(HiTextField, {
63
+ id: "text",
64
+ fullWidth: true
65
+ }));
66
+ assert.strictEqual(wrapper.props().fullWidth, true);
67
+ });
68
+ it('should pass HiInputProps to the HiInput', function () {
69
+ assert.strictEqual(wrapper.find(HiInput).props().startAdornment, 'Archive');
70
+ });
71
+ it('should apply additional properties to the Input component', function () {
72
+ wrapper.setProps({
73
+ HiInputProps: {
74
+ className: 'fullWidth'
75
+ }
76
+ });
77
+ assert.strictEqual(wrapper.find(HiInput).props().className, 'fullWidth');
78
+ });
79
+ });
80
+ describe('with a label', function () {
81
+ beforeEach(function () {
82
+ wrapper.setProps({
83
+ label: 'Foo bar'
84
+ });
85
+ });
86
+ it('should have 1 child', function () {
87
+ assert.strictEqual(wrapper.children().length, 1);
88
+ });
89
+ it('should have an HiInput as the first child', function () {
90
+ assert.strictEqual(wrapper.childAt(0).type(), HiInput);
91
+ });
92
+ });
93
+ describe('with a helper text', function () {
94
+ beforeEach(function () {
95
+ wrapper.setProps({
96
+ helperText: 'Foo bar'
97
+ });
98
+ });
99
+ it('should have 1 child', function () {
100
+ assert.strictEqual(wrapper.children().length, 1);
101
+ });
102
+ /* it('should have a FormHelperText as the second child', () => {
103
+ assert.strictEqual(wrapper.childAt(1).type(), FormHelperText);
104
+ }); */
105
+
106
+ it('should have an HiInput as the first child', function () {
107
+ assert.strictEqual(wrapper.childAt(0).type(), HiInput);
108
+ });
109
+ });
110
+ });
111
+ describe('mount', function () {
112
+ var wrapper;
113
+ var handleChange = spy();
114
+ var handleReset = spy();
115
+ var handleBlur = spy();
116
+ var handleFocus = spy();
117
+ describe('callbacks', function () {
118
+ it('should be called', function () {
119
+ wrapper = mount(React.createElement(HiTextField, {
120
+ id: "text",
121
+ onChange: handleChange,
122
+ onReset: handleReset,
123
+ onBlur: handleBlur,
124
+ onFocus: handleFocus,
125
+ value: "defaultValue",
126
+ helperText: "helper",
127
+ maxLength: 20
128
+ }));
129
+ wrapper.find('input').simulate('change', {
130
+ target: {
131
+ value: 'newValue'
132
+ }
133
+ });
134
+ assert.strictEqual(handleChange.callCount, 1, 'should trigger change callback');
135
+ assert.strictEqual(handleChange.args[0][0].target.value, 'newValue');
136
+ assert.strictEqual(wrapper.state().nbChars, 12);
137
+ wrapper.find('input').simulate('change', {
138
+ target: {
139
+ value: '1234567890123456789012345'
140
+ }
141
+ });
142
+ assert.strictEqual(handleChange.callCount, 1, 'should not trigger change callback');
143
+ assert.strictEqual(wrapper.state().nbChars, 12);
144
+ wrapper.find('input').simulate('focus');
145
+ assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
146
+ wrapper.find('button').simulate('click');
147
+ assert.strictEqual(handleReset.callCount, 1, 'should trigger reset callback');
148
+ wrapper.find('input').simulate('blur');
149
+ assert.strictEqual(handleBlur.callCount, 1, 'should trigger blur callback');
150
+ });
151
+ });
152
+ describe('without callbacks (for 100% Branch coverage', function () {
153
+ it('should not be called', function () {
154
+ wrapper = mount(React.createElement(HiTextField, {
155
+ id: "text",
156
+ value: "defaultValue",
157
+ label: "label",
158
+ helperText: "My helper",
159
+ helperIcon: true,
160
+ onReset: function onReset() {}
161
+ }));
162
+ wrapper.find('input').simulate('change', {
163
+ target: {
164
+ value: 'newValue'
165
+ }
166
+ });
167
+ assert.strictEqual(wrapper.find('button').length, 1, 'should not have clear icon');
168
+ wrapper.find('input').simulate('focus');
169
+ assert.strictEqual(wrapper.find('button').length, 2, 'should not have clear icon');
170
+ wrapper.find('button').at(1).simulate('click');
171
+ wrapper.find('input').simulate('blur');
172
+ });
173
+ });
174
+ describe('helpers', function () {
175
+ it('should be displayed', function () {
176
+ wrapper = mount(React.createElement(HiTextField, {
177
+ id: "text",
178
+ onChange: handleChange,
179
+ onReset: handleReset,
180
+ onBlur: handleBlur,
181
+ onFocus: handleFocus,
182
+ value: "defaultValue",
183
+ helperText: "helper",
184
+ maxLength: 20
185
+ }));
186
+ assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
187
+ });
188
+ });
189
+ describe('helpers', function () {
190
+ it('should be displayed', function () {
191
+ wrapper = mount(React.createElement(HiTextField, {
192
+ id: "text",
193
+ value: "defaultValue",
194
+ label: "label",
195
+ helperText: "My helper",
196
+ helperIcon: true
197
+ }));
198
+ assert.strictEqual(wrapper.find('p').length, 0, 'Should not have helper p');
199
+ assert.strictEqual(wrapper.find(Info).length, 1, 'Should have helper icon');
200
+ assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
201
+ var helperIcon = wrapper.find(Info);
202
+ helperIcon.simulate('click');
203
+ assert.strictEqual(wrapper.childAt(0).text(), 'My helperlabel', 'First child should be the helper div');
204
+ });
205
+ });
206
+ describe('errors', function () {
207
+ it('should be displayed', function () {
208
+ wrapper = mount(React.createElement(HiTextField, {
209
+ id: "text",
210
+ value: "defaultValue",
211
+ label: "label",
212
+ error: true,
213
+ errorText: "My error"
214
+ }));
215
+ assert.strictEqual(wrapper.find('p').length, 0, 'Should not have error p');
216
+ assert.strictEqual(wrapper.find(Warning).length, 1, 'Should have error icon');
217
+ assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
218
+ var errorIcon = wrapper.find(Warning);
219
+ errorIcon.simulate('click');
220
+ assert.strictEqual(wrapper.childAt(0).text(), 'My errorlabel', 'First child should be the error div');
221
+ });
222
+ });
223
+ describe('state with multiline', function () {
224
+ it('should be good', function () {
225
+ var handleChange1 = spy();
226
+ wrapper = mount(React.createElement(HiTextField, {
227
+ id: "text",
228
+ onChange: handleChange1,
229
+ value: "defaultValue",
230
+ multiline: true
231
+ }));
232
+ assert.strictEqual(wrapper.state().nbChars, 12);
233
+ wrapper.find('textarea').first().simulate('change', {
234
+ target: {
235
+ value: 'newValue'
236
+ }
237
+ });
238
+ wrapper.find('textarea').at(1).simulate('change', {
239
+ target: {
240
+ value: 'newValue'
241
+ }
242
+ });
243
+ wrapper.find('textarea').at(2).simulate('change', {
244
+ target: {
245
+ value: 'newValue'
246
+ }
247
+ });
248
+ assert.strictEqual(handleChange1.callCount, 1, 'should trigger change callback');
249
+ assert.strictEqual(handleChange1.args[0][0].target.value, 'newValue');
250
+ assert.strictEqual(wrapper.state().nbChars, 8);
251
+ });
252
+ });
253
+ });
254
+ });
@@ -1,43 +1,18 @@
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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
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 _react = _interopRequireDefault(require("react"));
29
-
30
- var _classnames = _interopRequireDefault(require("classnames"));
31
-
32
- var _index = _interopRequireDefault(require("keycode/index"));
33
-
34
- var _styles = require("@material-ui/core/styles");
35
-
36
- var _HiUploadInput = _interopRequireDefault(require("./HiUploadInput"));
37
-
38
- var _HiIcon = _interopRequireDefault(require("../HiIcon"));
39
-
40
- var styles = function styles(theme) {
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 React from 'react';
10
+ import classNames from 'classnames';
11
+ import keycode from 'keycode/index';
12
+ import { withStyles } from '@material-ui/core/styles';
13
+ import HiUploadInput from './HiUploadInput';
14
+ import HiIcon from '../HiIcon';
15
+ export var styles = function styles(theme) {
41
16
  return {
42
17
  flexContainer: {
43
18
  display: 'flex',
@@ -86,19 +61,19 @@ var styles = function styles(theme) {
86
61
  };
87
62
  };
88
63
 
89
- exports.styles = styles;
90
-
91
64
  var HiUpload =
92
65
  /*#__PURE__*/
93
66
  function (_React$PureComponent) {
94
- (0, _inherits2.default)(HiUpload, _React$PureComponent);
67
+ _inherits(HiUpload, _React$PureComponent);
95
68
 
96
69
  function HiUpload() {
97
70
  var _this;
98
71
 
99
- (0, _classCallCheck2.default)(this, HiUpload);
100
- _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiUpload).call(this));
101
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDrop", function (event) {
72
+ _classCallCheck(this, HiUpload);
73
+
74
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(HiUpload).call(this));
75
+
76
+ _defineProperty(_assertThisInitialized(_this), "handleDrop", function (event) {
102
77
  if (event.path[0].id === _this.uploadIconRef.props.id) {
103
78
  event.preventDefault();
104
79
  event.stopPropagation();
@@ -120,7 +95,8 @@ function (_React$PureComponent) {
120
95
  }
121
96
  }
122
97
  });
123
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDragEnter", function (event) {
98
+
99
+ _defineProperty(_assertThisInitialized(_this), "handleDragEnter", function (event) {
124
100
  event.preventDefault();
125
101
  event.stopPropagation();
126
102
 
@@ -144,7 +120,8 @@ function (_React$PureComponent) {
144
120
  }
145
121
  }
146
122
  });
147
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDragLeave", function (event) {
123
+
124
+ _defineProperty(_assertThisInitialized(_this), "handleDragLeave", function (event) {
148
125
  event.preventDefault();
149
126
  event.stopPropagation();
150
127
 
@@ -160,18 +137,21 @@ function (_React$PureComponent) {
160
137
  });
161
138
  }
162
139
  });
163
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleChange", function (event) {
140
+
141
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function (event) {
164
142
  var index = _this.getNextInputIndex();
165
143
 
166
144
  var param = _this.handleFile(event.target.files, index);
167
145
 
168
146
  _this.props.onChange(param, index);
169
147
  });
170
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmptyField", function (event) {
148
+
149
+ _defineProperty(_assertThisInitialized(_this), "handleEmptyField", function (event) {
171
150
  event.target.value = '';
172
151
  });
173
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyPress", function (event) {
174
- var key = (0, _index.default)(event);
152
+
153
+ _defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (event) {
154
+ var key = keycode(event);
175
155
 
176
156
  if (key === 'enter' || key === 'space') {
177
157
  event.preventDefault();
@@ -179,7 +159,8 @@ function (_React$PureComponent) {
179
159
  _this.uploadInput.click();
180
160
  }
181
161
  });
182
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFile", function (files, index) {
162
+
163
+ _defineProperty(_assertThisInitialized(_this), "handleFile", function (files, index) {
183
164
  var error = false;
184
165
  var errorMessage = '';
185
166
  var file = null;
@@ -206,7 +187,8 @@ function (_React$PureComponent) {
206
187
  value: file
207
188
  };
208
189
  });
209
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createInputs", function (others) {
190
+
191
+ _defineProperty(_assertThisInitialized(_this), "createInputs", function (others) {
210
192
  var _this$props = _this.props,
211
193
  inputs = _this$props.inputs,
212
194
  values = _this$props.values;
@@ -220,7 +202,7 @@ function (_React$PureComponent) {
220
202
 
221
203
  for (var i = 0; i < files.length; i += 1) {
222
204
  if (files.length > 1 || values[i] && values[i].value) {
223
- inputComponents.push(_react.default.createElement(_HiUploadInput.default, (0, _extends2.default)({
205
+ inputComponents.push(React.createElement(HiUploadInput, Object.assign({
224
206
  maxSize: inputs[i] ? inputs[i].maxSize : undefined,
225
207
  acceptedTypes: inputs[i] ? inputs[i].acceptedTypes : undefined,
226
208
  placeholder: inputs[i] ? inputs[i].placeholder : undefined,
@@ -238,7 +220,9 @@ function (_React$PureComponent) {
238
220
 
239
221
  return inputComponents;
240
222
  });
241
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uploadFieldRef", void 0);
223
+
224
+ _defineProperty(_assertThisInitialized(_this), "uploadFieldRef", void 0);
225
+
242
226
  _this.state = {
243
227
  dragOver: false,
244
228
  droppable: false
@@ -247,7 +231,7 @@ function (_React$PureComponent) {
247
231
  } // When component mounts, we add eventListeners to handle the file drag and drop
248
232
 
249
233
 
250
- (0, _createClass2.default)(HiUpload, [{
234
+ _createClass(HiUpload, [{
251
235
  key: "componentDidMount",
252
236
  value: function componentDidMount() {
253
237
  this.uploadFieldRef.addEventListener('dragenter', this.handleDragEnter, false);
@@ -300,7 +284,8 @@ function (_React$PureComponent) {
300
284
  classes = _this$props2.classes,
301
285
  values = _this$props2.values,
302
286
  focused = _this$props2.focused,
303
- others = (0, _objectWithoutProperties2.default)(_this$props2, ["id", "inputs", "classes", "values", "focused"]);
287
+ others = _objectWithoutProperties(_this$props2, ["id", "inputs", "classes", "values", "focused"]);
288
+
304
289
  var _this$state = this.state,
305
290
  dragOver = _this$state.dragOver,
306
291
  droppable = _this$state.droppable;
@@ -326,7 +311,7 @@ function (_React$PureComponent) {
326
311
  }
327
312
  }
328
313
 
329
- var statusClass = (0, _classnames.default)(classes.statusIcon, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.empty, empty), (0, _defineProperty2.default)(_classNames, classes.complete, complete), _classNames));
314
+ var statusClass = classNames(classes.statusIcon, (_classNames = {}, _defineProperty(_classNames, classes.empty, empty), _defineProperty(_classNames, classes.complete, complete), _classNames));
330
315
  var icon;
331
316
 
332
317
  if (error) {
@@ -343,15 +328,15 @@ function (_React$PureComponent) {
343
328
  focusable = false;
344
329
  }
345
330
 
346
- var iconClass = (0, _classnames.default)(statusClass, classes.fileButton, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.dragOver, dragOver), (0, _defineProperty2.default)(_classNames2, classes.droppable, droppable), (0, _defineProperty2.default)(_classNames2, classes.focused, focused), (0, _defineProperty2.default)(_classNames2, classes.error, error && !focused), (0, _defineProperty2.default)(_classNames2, classes.focusable, focusable), _classNames2));
347
- return _react.default.createElement("div", {
331
+ var iconClass = classNames(statusClass, classes.fileButton, (_classNames2 = {}, _defineProperty(_classNames2, classes.dragOver, dragOver), _defineProperty(_classNames2, classes.droppable, droppable), _defineProperty(_classNames2, classes.focused, focused), _defineProperty(_classNames2, classes.error, error && !focused), _defineProperty(_classNames2, classes.focusable, focusable), _classNames2));
332
+ return React.createElement("div", {
348
333
  className: classes.flexContainer
349
- }, _react.default.createElement("label", {
334
+ }, React.createElement("label", {
350
335
  ref: function ref(label) {
351
336
  _this2.uploadFieldRef = label;
352
337
  },
353
338
  tabIndex: "-1"
354
- }, _react.default.createElement("input", {
339
+ }, React.createElement("input", {
355
340
  hidden: true,
356
341
  type: !complete || values.length === 1 ? 'file' : 'hidden',
357
342
  onChange: this.handleChange,
@@ -359,7 +344,7 @@ function (_React$PureComponent) {
359
344
  ref: function ref(el) {
360
345
  _this2.uploadInput = el;
361
346
  }
362
- }), _react.default.createElement(_HiIcon.default, {
347
+ }), React.createElement(HiIcon, {
363
348
  ref: function ref(uploadIcon) {
364
349
  _this2.uploadIconRef = uploadIcon;
365
350
  },
@@ -369,17 +354,16 @@ function (_React$PureComponent) {
369
354
  size: 32,
370
355
  tabIndex: focusable ? '0' : '-1',
371
356
  onKeyPress: this.handleKeyPress
372
- })), _react.default.createElement("div", {
357
+ })), React.createElement("div", {
373
358
  className: classes.inputContainer
374
359
  }, this.createInputs(others)));
375
360
  }
376
361
  }]);
362
+
377
363
  return HiUpload;
378
- }(_react.default.PureComponent);
364
+ }(React.PureComponent);
379
365
 
380
- var _default = (0, _styles.withStyles)(styles, {
366
+ export default withStyles(styles, {
381
367
  hiComponent: true,
382
368
  name: 'HmuiHiUpload'
383
- })(HiUpload);
384
-
385
- exports.default = _default;
369
+ })(HiUpload);