@hipay/hipay-material-ui 4.0.0 → 4.0.1-beta5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (439) hide show
  1. package/HiAccordion/HiAccordion.js +26 -8
  2. package/HiAccordion/index.js +5 -1
  3. package/HiAccordionActions/HiAccordionActions.js +14 -1
  4. package/HiAccordionActions/index.js +5 -1
  5. package/HiAccordionSummary/HiAccordionSummary.js +15 -1
  6. package/HiAccordionSummary/index.js +5 -1
  7. package/HiAlertModal/HiAlertModal.js +22 -7
  8. package/HiAlertModal/index.js +5 -1
  9. package/HiAppBar/HiAppBar.js +42 -11
  10. package/HiAppBar/index.js +2 -0
  11. package/HiAvatar/HiAvatar.js +12 -3
  12. package/HiAvatar/index.js +2 -0
  13. package/HiBadge/HiBadge.js +24 -8
  14. package/HiBadge/index.js +2 -0
  15. package/HiBreadcrumb/HiBreadcrumb.js +30 -6
  16. package/HiBreadcrumb/HiStep.js +45 -13
  17. package/HiBreadcrumb/HiStepConnector.js +49 -14
  18. package/HiBreadcrumb/HiStepContent.js +30 -6
  19. package/HiBreadcrumb/HiStepIcon.js +35 -10
  20. package/HiBreadcrumb/HiStepLabel.js +44 -14
  21. package/HiBreadcrumb/HiStepper.js +30 -6
  22. package/HiBreadcrumb/index.js +2 -0
  23. package/HiButton/HiButton.js +33 -8
  24. package/HiButton/index.js +5 -1
  25. package/HiCell/CellAddress.js +33 -12
  26. package/HiCell/CellDate.js +36 -10
  27. package/HiCell/CellHiddenContent.js +30 -8
  28. package/HiCell/CellIcon.js +36 -12
  29. package/HiCell/CellImage.js +34 -12
  30. package/HiCell/CellNumeric.js +40 -13
  31. package/HiCell/CellPinToAction.js +33 -9
  32. package/HiCell/CellRate.js +47 -13
  33. package/HiCell/CellSentinel.js +33 -12
  34. package/HiCell/CellSentinelScore.js +31 -9
  35. package/HiCell/CellText.js +52 -16
  36. package/HiCell/CellTextStyled.js +24 -13
  37. package/HiCell/index.js +10 -0
  38. package/HiCheckbox/HiCheckbox.js +52 -15
  39. package/HiCheckbox/index.js +2 -0
  40. package/HiChip/HiChip.js +47 -24
  41. package/HiChip/HiChipSwitch.js +59 -16
  42. package/HiChip/index.js +3 -0
  43. package/HiColoredLabel/HiColoredLabel.js +49 -15
  44. package/HiColoredLabel/index.js +2 -0
  45. package/HiDatePicker/Caption.js +21 -9
  46. package/HiDatePicker/HiDatePicker.js +88 -16
  47. package/HiDatePicker/HiDatePickerMobile.js +43 -18
  48. package/HiDatePicker/HiDateRangePicker.js +134 -38
  49. package/HiDatePicker/HiDateRangeSelector.js +130 -49
  50. package/HiDatePicker/ListPicker.js +38 -8
  51. package/HiDatePicker/NavBar.js +31 -12
  52. package/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
  53. package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
  54. package/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
  55. package/HiDatePicker/Overlays/Overlay.js +25 -8
  56. package/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
  57. package/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
  58. package/HiDatePicker/Overlays/index.js +6 -0
  59. package/HiDatePicker/Weekday.js +9 -4
  60. package/HiDatePicker/hiLocaleUtils.js +20 -8
  61. package/HiDatePicker/index.js +2 -0
  62. package/HiDatePicker/stylesheet.js +13 -7
  63. package/HiDialog/HiDialog.js +19 -7
  64. package/HiDialog/index.js +2 -0
  65. package/HiDotsStepper/HiDot.js +37 -8
  66. package/HiDotsStepper/HiDotsStepper.js +37 -10
  67. package/HiDotsStepper/index.js +3 -0
  68. package/HiExpansionPanel/HiExpansionPanel.js +38 -16
  69. package/HiExpansionPanel/index.js +5 -1
  70. package/HiForm/HiAddressField.js +36 -10
  71. package/HiForm/HiEmailField.js +29 -5
  72. package/HiForm/HiFormControl.js +74 -28
  73. package/HiForm/HiFormLabel.js +41 -15
  74. package/HiForm/HiInput.js +91 -33
  75. package/HiForm/HiPasswordField.js +46 -9
  76. package/HiForm/HiSearchField.js +34 -3
  77. package/HiForm/HiSlider.js +57 -22
  78. package/HiForm/HiTextField.js +47 -22
  79. package/HiForm/HiUpload.js +89 -29
  80. package/HiForm/HiUploadField.js +32 -10
  81. package/HiForm/HiUploadInput.js +76 -23
  82. package/HiForm/index.js +12 -0
  83. package/HiIcon/HiIcon.js +34 -9
  84. package/HiIcon/index.js +2 -0
  85. package/HiIconButton/HiIconButton.js +21 -6
  86. package/HiIconButton/index.js +2 -0
  87. package/HiListItemLink/HiListItemLink.js +19 -7
  88. package/HiListItemLink/index.js +2 -0
  89. package/HiLoader/HiLoader.js +16 -6
  90. package/HiLoader/index.js +2 -0
  91. package/HiNotice/HiKPI.js +47 -16
  92. package/HiNotice/HiKPINotice.js +16 -6
  93. package/HiNotice/index.js +3 -0
  94. package/HiPagination/HiPagination.js +11 -1
  95. package/HiPagination/index.js +2 -0
  96. package/HiPaymentMeans/HiPaymentMeans.js +72 -31
  97. package/HiPaymentMeans/index.js +2 -0
  98. package/HiPdfReader/HiPdfReader.js +57 -24
  99. package/HiPdfReader/index.js +2 -0
  100. package/HiPin/HiPin.js +19 -7
  101. package/HiPin/index.js +2 -0
  102. package/HiRadio/HiRadio.js +22 -11
  103. package/HiRadio/index.js +2 -0
  104. package/HiScrollStepper/HiScrollStepper.js +67 -29
  105. package/HiScrollStepper/index.js +2 -0
  106. package/HiSelect/HiDynamicSelect.js +42 -32
  107. package/HiSelect/HiDynamicSelectField.js +48 -24
  108. package/HiSelect/HiNestedSelect.js +111 -65
  109. package/HiSelect/HiNestedSelectContent.js +86 -60
  110. package/HiSelect/HiNestedSelectField.js +48 -24
  111. package/HiSelect/HiSelect.js +187 -89
  112. package/HiSelect/HiSelectContent.js +97 -62
  113. package/HiSelect/HiSelectField.js +49 -25
  114. package/HiSelect/HiSelectInput.js +76 -23
  115. package/HiSelect/HiSelectMobile.js +44 -7
  116. package/HiSelect/HiSuggestSelect.js +81 -25
  117. package/HiSelect/HiSuggestSelectField.js +39 -15
  118. package/HiSelect/index.js +14 -2
  119. package/HiSelectableList/HiSelectableList.js +90 -34
  120. package/HiSelectableList/HiSelectableListHierarchic.js +60 -34
  121. package/HiSelectableList/HiSelectableListItem.js +88 -45
  122. package/HiSelectableList/index.js +4 -0
  123. package/HiStepper/DefaultIndicator.js +10 -1
  124. package/HiStepper/HiStep.js +48 -18
  125. package/HiStepper/HiStepper.js +15 -2
  126. package/HiStepper/index.js +3 -0
  127. package/HiSwitch/HiSwitch.js +33 -9
  128. package/HiSwitch/HiSwitchState.js +32 -15
  129. package/HiSwitch/index.js +3 -0
  130. package/HiTable/HiCellBuilder.js +65 -10
  131. package/HiTable/HiTable.js +48 -20
  132. package/HiTable/HiTableBody.js +24 -7
  133. package/HiTable/HiTableHeader.js +51 -18
  134. package/HiTable/HiTableRow.js +46 -12
  135. package/HiTable/constants.js +98 -48
  136. package/HiTable/index.js +2 -0
  137. package/es/HiAccordion/HiAccordion.js +26 -8
  138. package/es/HiAccordion/index.js +5 -1
  139. package/es/HiAccordionActions/HiAccordionActions.js +14 -1
  140. package/es/HiAccordionActions/index.js +5 -1
  141. package/es/HiAccordionSummary/HiAccordionSummary.js +15 -1
  142. package/es/HiAccordionSummary/index.js +5 -1
  143. package/es/HiAlertModal/HiAlertModal.js +22 -7
  144. package/es/HiAlertModal/index.js +5 -1
  145. package/es/HiAppBar/HiAppBar.js +42 -11
  146. package/es/HiAppBar/index.js +2 -0
  147. package/es/HiAvatar/HiAvatar.js +12 -3
  148. package/es/HiAvatar/index.js +2 -0
  149. package/es/HiBadge/HiBadge.js +24 -8
  150. package/es/HiBadge/index.js +2 -0
  151. package/es/HiBreadcrumb/HiBreadcrumb.js +30 -6
  152. package/es/HiBreadcrumb/HiStep.js +45 -13
  153. package/es/HiBreadcrumb/HiStepConnector.js +49 -14
  154. package/es/HiBreadcrumb/HiStepContent.js +30 -6
  155. package/es/HiBreadcrumb/HiStepIcon.js +35 -10
  156. package/es/HiBreadcrumb/HiStepLabel.js +44 -14
  157. package/es/HiBreadcrumb/HiStepper.js +30 -6
  158. package/es/HiBreadcrumb/index.js +2 -0
  159. package/es/HiButton/HiButton.js +33 -8
  160. package/es/HiButton/index.js +5 -1
  161. package/es/HiCell/CellAddress.js +33 -12
  162. package/es/HiCell/CellDate.js +36 -10
  163. package/es/HiCell/CellHiddenContent.js +30 -8
  164. package/es/HiCell/CellIcon.js +36 -12
  165. package/es/HiCell/CellImage.js +34 -12
  166. package/es/HiCell/CellNumeric.js +40 -13
  167. package/es/HiCell/CellPinToAction.js +33 -9
  168. package/es/HiCell/CellRate.js +47 -13
  169. package/es/HiCell/CellSentinel.js +33 -12
  170. package/es/HiCell/CellSentinelScore.js +31 -9
  171. package/es/HiCell/CellText.js +52 -16
  172. package/es/HiCell/CellTextStyled.js +24 -13
  173. package/es/HiCell/index.js +10 -0
  174. package/es/HiCheckbox/HiCheckbox.js +52 -15
  175. package/es/HiCheckbox/index.js +2 -0
  176. package/es/HiChip/HiChip.js +47 -24
  177. package/es/HiChip/HiChipSwitch.js +59 -16
  178. package/es/HiChip/index.js +3 -0
  179. package/es/HiColoredLabel/HiColoredLabel.js +49 -15
  180. package/es/HiColoredLabel/index.js +2 -0
  181. package/es/HiDatePicker/Caption.js +21 -9
  182. package/es/HiDatePicker/HiDatePicker.js +88 -16
  183. package/es/HiDatePicker/HiDatePickerMobile.js +43 -18
  184. package/es/HiDatePicker/HiDateRangePicker.js +134 -38
  185. package/es/HiDatePicker/HiDateRangeSelector.js +130 -49
  186. package/es/HiDatePicker/ListPicker.js +38 -8
  187. package/es/HiDatePicker/NavBar.js +31 -12
  188. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
  189. package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
  190. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
  191. package/es/HiDatePicker/Overlays/Overlay.js +25 -8
  192. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
  193. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
  194. package/es/HiDatePicker/Overlays/index.js +6 -0
  195. package/es/HiDatePicker/Weekday.js +9 -4
  196. package/es/HiDatePicker/hiLocaleUtils.js +20 -8
  197. package/es/HiDatePicker/index.js +2 -0
  198. package/es/HiDatePicker/stylesheet.js +13 -7
  199. package/es/HiDialog/HiDialog.js +19 -7
  200. package/es/HiDialog/index.js +2 -0
  201. package/es/HiDotsStepper/HiDot.js +37 -8
  202. package/es/HiDotsStepper/HiDotsStepper.js +37 -10
  203. package/es/HiDotsStepper/index.js +3 -0
  204. package/es/HiExpansionPanel/HiExpansionPanel.js +38 -16
  205. package/es/HiExpansionPanel/index.js +5 -1
  206. package/es/HiForm/HiAddressField.js +36 -10
  207. package/es/HiForm/HiEmailField.js +29 -5
  208. package/es/HiForm/HiFormControl.js +74 -28
  209. package/es/HiForm/HiFormLabel.js +41 -15
  210. package/es/HiForm/HiInput.js +91 -33
  211. package/es/HiForm/HiPasswordField.js +46 -9
  212. package/es/HiForm/HiSearchField.js +34 -3
  213. package/es/HiForm/HiSlider.js +57 -22
  214. package/es/HiForm/HiTextField.js +47 -22
  215. package/es/HiForm/HiUpload.js +89 -29
  216. package/es/HiForm/HiUploadField.js +32 -10
  217. package/es/HiForm/HiUploadInput.js +76 -23
  218. package/es/HiForm/index.js +12 -0
  219. package/es/HiIcon/HiIcon.js +34 -9
  220. package/es/HiIcon/index.js +2 -0
  221. package/es/HiIconButton/HiIconButton.js +21 -6
  222. package/es/HiIconButton/index.js +2 -0
  223. package/es/HiListItemLink/HiListItemLink.js +19 -7
  224. package/es/HiListItemLink/index.js +2 -0
  225. package/es/HiLoader/HiLoader.js +16 -6
  226. package/es/HiLoader/index.js +2 -0
  227. package/es/HiNotice/HiKPI.js +47 -16
  228. package/es/HiNotice/HiKPINotice.js +16 -6
  229. package/es/HiNotice/index.js +3 -0
  230. package/es/HiPagination/HiPagination.js +11 -1
  231. package/es/HiPagination/index.js +2 -0
  232. package/es/HiPaymentMeans/HiPaymentMeans.js +72 -31
  233. package/es/HiPaymentMeans/index.js +2 -0
  234. package/es/HiPdfReader/HiPdfReader.js +57 -24
  235. package/es/HiPdfReader/index.js +2 -0
  236. package/es/HiPin/HiPin.js +19 -7
  237. package/es/HiPin/index.js +2 -0
  238. package/es/HiRadio/HiRadio.js +22 -11
  239. package/es/HiRadio/index.js +2 -0
  240. package/es/HiScrollStepper/HiScrollStepper.js +67 -29
  241. package/es/HiScrollStepper/index.js +2 -0
  242. package/es/HiSelect/HiDynamicSelect.js +42 -32
  243. package/es/HiSelect/HiDynamicSelectField.js +48 -24
  244. package/es/HiSelect/HiNestedSelect.js +111 -65
  245. package/es/HiSelect/HiNestedSelectContent.js +86 -60
  246. package/es/HiSelect/HiNestedSelectField.js +48 -24
  247. package/es/HiSelect/HiSelect.js +187 -89
  248. package/es/HiSelect/HiSelectContent.js +97 -62
  249. package/es/HiSelect/HiSelectField.js +49 -25
  250. package/es/HiSelect/HiSelectInput.js +76 -23
  251. package/es/HiSelect/HiSelectMobile.js +44 -7
  252. package/es/HiSelect/HiSuggestSelect.js +81 -25
  253. package/es/HiSelect/HiSuggestSelectField.js +39 -15
  254. package/es/HiSelect/index.js +14 -2
  255. package/es/HiSelectableList/HiSelectableList.js +90 -34
  256. package/es/HiSelectableList/HiSelectableListHierarchic.js +60 -34
  257. package/es/HiSelectableList/HiSelectableListItem.js +88 -45
  258. package/es/HiSelectableList/index.js +4 -0
  259. package/es/HiStepper/DefaultIndicator.js +10 -1
  260. package/es/HiStepper/HiStep.js +48 -18
  261. package/es/HiStepper/HiStepper.js +15 -2
  262. package/es/HiStepper/index.js +3 -0
  263. package/es/HiSwitch/HiSwitch.js +33 -9
  264. package/es/HiSwitch/HiSwitchState.js +32 -15
  265. package/es/HiSwitch/index.js +3 -0
  266. package/es/HiTable/HiCellBuilder.js +65 -10
  267. package/es/HiTable/HiTable.js +48 -20
  268. package/es/HiTable/HiTableBody.js +24 -7
  269. package/es/HiTable/HiTableHeader.js +51 -18
  270. package/es/HiTable/HiTableRow.js +46 -12
  271. package/es/HiTable/constants.js +98 -48
  272. package/es/HiTable/index.js +2 -0
  273. package/es/hi-svg-icons/HiAccount.js +14 -4
  274. package/es/hi-svg-icons/HiActivity.js +14 -4
  275. package/es/hi-svg-icons/HiAll.js +18 -7
  276. package/es/hi-svg-icons/HiBilling.js +14 -4
  277. package/es/hi-svg-icons/HiBriefcaseRescue.js +14 -4
  278. package/es/hi-svg-icons/HiBusiness.js +14 -4
  279. package/es/hi-svg-icons/HiCatalog.js +14 -4
  280. package/es/hi-svg-icons/HiCustomer.js +14 -4
  281. package/es/hi-svg-icons/HiDownload.js +14 -4
  282. package/es/hi-svg-icons/HiFinance.js +14 -4
  283. package/es/hi-svg-icons/HiFinanceMenu.js +14 -4
  284. package/es/hi-svg-icons/HiHostedPaymentPage.js +14 -4
  285. package/es/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
  286. package/es/hi-svg-icons/HiIntegration.js +14 -4
  287. package/es/hi-svg-icons/HiIntegrationMenu.js +14 -4
  288. package/es/hi-svg-icons/HiIntelligence.js +14 -4
  289. package/es/hi-svg-icons/HiIntelligenceMenu.js +14 -4
  290. package/es/hi-svg-icons/HiInvoice.js +14 -4
  291. package/es/hi-svg-icons/HiInvoiceMenu.js +14 -4
  292. package/es/hi-svg-icons/HiLogoRounded.js +17 -6
  293. package/es/hi-svg-icons/HiOrder.js +14 -4
  294. package/es/hi-svg-icons/HiPaymentOrder.js +14 -4
  295. package/es/hi-svg-icons/HiPermission.js +14 -4
  296. package/es/hi-svg-icons/HiPriceGrid.js +14 -4
  297. package/es/hi-svg-icons/HiPrivate.js +14 -4
  298. package/es/hi-svg-icons/HiRoute.js +14 -4
  299. package/es/hi-svg-icons/HiRouteMenu.js +14 -4
  300. package/es/hi-svg-icons/HiRouteSwitch.js +19 -7
  301. package/es/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
  302. package/es/hi-svg-icons/HiSettlement.js +14 -4
  303. package/es/hi-svg-icons/HiSizeLarge.js +14 -4
  304. package/es/hi-svg-icons/HiSizeMedium.js +14 -4
  305. package/es/hi-svg-icons/HiSizeSmall.js +14 -4
  306. package/es/hi-svg-icons/HiStore.js +14 -4
  307. package/es/hi-svg-icons/HiStoreMenu.js +14 -4
  308. package/es/hi-svg-icons/HiTransaction.js +14 -4
  309. package/es/hi-svg-icons/HiTransactionMenu.js +14 -4
  310. package/es/hi-svg-icons/HiUser.js +14 -4
  311. package/es/hi-svg-icons/HiVendor.js +14 -4
  312. package/es/hi-svg-icons/HiWidget.js +14 -4
  313. package/es/hi-svg-icons/index.js +41 -0
  314. package/es/hi-svg-images/HiLogo.js +12 -4
  315. package/es/hi-svg-images/HiLogoWhite.js +12 -4
  316. package/es/hi-svg-images/index.js +3 -0
  317. package/es/setupTest.js +13 -2
  318. package/es/styleguide/Wrapper.js +6 -0
  319. package/es/styles/MuiThemeProvider.js +49 -15
  320. package/es/styles/colorManipulator.js +50 -15
  321. package/es/styles/createBreakpoints.js +29 -14
  322. package/es/styles/createGenerateClassName.js +24 -14
  323. package/es/styles/createMixins.js +10 -4
  324. package/es/styles/createMuiTheme.js +28 -11
  325. package/es/styles/createPalette.js +89 -67
  326. package/es/styles/createStyles.js +1 -0
  327. package/es/styles/createTypography.js +24 -15
  328. package/es/styles/getStylesCreator.js +14 -1
  329. package/es/styles/getThemeProps.js +7 -2
  330. package/es/styles/index.js +6 -0
  331. package/es/styles/jssPreset.js +11 -1
  332. package/es/styles/makeStyles.js +9 -2
  333. package/es/styles/mergeClasses.js +16 -5
  334. package/es/styles/shadows.js +4 -1
  335. package/es/styles/shape.js +2 -1
  336. package/es/styles/spacing.js +4 -1
  337. package/es/styles/themeListener.js +10 -2
  338. package/es/styles/transitions.js +35 -20
  339. package/es/styles/withStyles.js +9 -2
  340. package/es/styles/zIndex.js +2 -1
  341. package/es/test-utils/createMount.js +12 -2
  342. package/es/test-utils/createRender.js +9 -2
  343. package/es/test-utils/createShallow.js +17 -6
  344. package/es/test-utils/getClasses.js +4 -1
  345. package/es/test-utils/index.js +6 -0
  346. package/es/test-utils/until.js +14 -3
  347. package/es/test-utils/unwrap.js +1 -0
  348. package/es/theme/palette.js +7 -2
  349. package/es/theme/typography.js +15 -7
  350. package/es/theme.js +8 -2
  351. package/es/transitions/utils.js +7 -3
  352. package/es/utils/exactProp.js +13 -3
  353. package/es/utils/helpers.js +58 -19
  354. package/es/withMobileDialog/index.js +2 -0
  355. package/es/withMobileDialog/withMobileDialog.js +12 -3
  356. package/hi-svg-icons/HiAccount.js +14 -4
  357. package/hi-svg-icons/HiActivity.js +14 -4
  358. package/hi-svg-icons/HiAll.js +18 -7
  359. package/hi-svg-icons/HiBilling.js +14 -4
  360. package/hi-svg-icons/HiBriefcaseRescue.js +14 -4
  361. package/hi-svg-icons/HiBusiness.js +14 -4
  362. package/hi-svg-icons/HiCatalog.js +14 -4
  363. package/hi-svg-icons/HiCustomer.js +14 -4
  364. package/hi-svg-icons/HiDownload.js +14 -4
  365. package/hi-svg-icons/HiFinance.js +14 -4
  366. package/hi-svg-icons/HiFinanceMenu.js +14 -4
  367. package/hi-svg-icons/HiHostedPaymentPage.js +14 -4
  368. package/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
  369. package/hi-svg-icons/HiIntegration.js +14 -4
  370. package/hi-svg-icons/HiIntegrationMenu.js +14 -4
  371. package/hi-svg-icons/HiIntelligence.js +14 -4
  372. package/hi-svg-icons/HiIntelligenceMenu.js +14 -4
  373. package/hi-svg-icons/HiInvoice.js +14 -4
  374. package/hi-svg-icons/HiInvoiceMenu.js +14 -4
  375. package/hi-svg-icons/HiLogoRounded.js +17 -6
  376. package/hi-svg-icons/HiOrder.js +14 -4
  377. package/hi-svg-icons/HiPaymentOrder.js +14 -4
  378. package/hi-svg-icons/HiPermission.js +14 -4
  379. package/hi-svg-icons/HiPriceGrid.js +14 -4
  380. package/hi-svg-icons/HiPrivate.js +14 -4
  381. package/hi-svg-icons/HiRoute.js +14 -4
  382. package/hi-svg-icons/HiRouteMenu.js +14 -4
  383. package/hi-svg-icons/HiRouteSwitch.js +19 -7
  384. package/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
  385. package/hi-svg-icons/HiSettlement.js +14 -4
  386. package/hi-svg-icons/HiSizeLarge.js +14 -4
  387. package/hi-svg-icons/HiSizeMedium.js +14 -4
  388. package/hi-svg-icons/HiSizeSmall.js +14 -4
  389. package/hi-svg-icons/HiStore.js +14 -4
  390. package/hi-svg-icons/HiStoreMenu.js +14 -4
  391. package/hi-svg-icons/HiTransaction.js +14 -4
  392. package/hi-svg-icons/HiTransactionMenu.js +14 -4
  393. package/hi-svg-icons/HiUser.js +14 -4
  394. package/hi-svg-icons/HiVendor.js +14 -4
  395. package/hi-svg-icons/HiWidget.js +14 -4
  396. package/hi-svg-icons/index.js +41 -0
  397. package/hi-svg-images/HiLogo.js +12 -4
  398. package/hi-svg-images/HiLogoWhite.js +12 -4
  399. package/hi-svg-images/index.js +3 -0
  400. package/package.json +2 -2
  401. package/setupTest.js +13 -2
  402. package/styleguide/Wrapper.js +6 -0
  403. package/styles/MuiThemeProvider.js +49 -15
  404. package/styles/colorManipulator.js +50 -15
  405. package/styles/createBreakpoints.js +29 -14
  406. package/styles/createGenerateClassName.js +24 -14
  407. package/styles/createMixins.js +10 -4
  408. package/styles/createMuiTheme.js +28 -11
  409. package/styles/createPalette.js +89 -67
  410. package/styles/createStyles.js +1 -0
  411. package/styles/createTypography.js +24 -15
  412. package/styles/getStylesCreator.js +14 -1
  413. package/styles/getThemeProps.js +7 -2
  414. package/styles/index.js +6 -0
  415. package/styles/jssPreset.js +11 -1
  416. package/styles/makeStyles.js +9 -2
  417. package/styles/mergeClasses.js +16 -5
  418. package/styles/shadows.js +4 -1
  419. package/styles/shape.js +2 -1
  420. package/styles/spacing.js +4 -1
  421. package/styles/themeListener.js +10 -2
  422. package/styles/transitions.js +35 -20
  423. package/styles/withStyles.js +9 -2
  424. package/styles/zIndex.js +2 -1
  425. package/test-utils/createMount.js +12 -2
  426. package/test-utils/createRender.js +9 -2
  427. package/test-utils/createShallow.js +17 -6
  428. package/test-utils/getClasses.js +4 -1
  429. package/test-utils/index.js +6 -0
  430. package/test-utils/until.js +14 -3
  431. package/test-utils/unwrap.js +1 -0
  432. package/theme/palette.js +7 -2
  433. package/theme/typography.js +15 -7
  434. package/theme.js +8 -2
  435. package/transitions/utils.js +7 -3
  436. package/utils/exactProp.js +13 -3
  437. package/utils/helpers.js +58 -19
  438. package/withMobileDialog/index.js +2 -0
  439. package/withMobileDialog/withMobileDialog.js +12 -3
@@ -1,25 +1,41 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.styles = exports.default = void 0;
9
+
8
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
11
+
9
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
13
+
10
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
15
+
11
16
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
17
+
12
18
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
19
+
13
20
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
21
+
14
22
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
23
+
15
24
  var _react = _interopRequireDefault(require("react"));
25
+
16
26
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
27
+
17
28
  var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
29
+
18
30
  var _HiIcon = _interopRequireDefault(require("../HiIcon/HiIcon"));
31
+
19
32
  var _classnames = _interopRequireDefault(require("classnames"));
33
+
20
34
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
35
+
21
36
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
- var styles = exports.styles = function styles(theme) {
37
+
38
+ var styles = function styles(theme) {
23
39
  return {
24
40
  barContainer: {
25
41
  width: '100%',
@@ -95,21 +111,30 @@ var styles = exports.styles = function styles(theme) {
95
111
  }
96
112
  };
97
113
  };
98
-
99
114
  /**
100
115
  * HiSlider component
101
116
  */
117
+
118
+
119
+ exports.styles = styles;
120
+
102
121
  var HiSlider = /*#__PURE__*/function (_React$Component) {
103
122
  (0, _inherits2.default)(HiSlider, _React$Component);
123
+
104
124
  var _super = _createSuper(HiSlider);
125
+
105
126
  function HiSlider(props) {
106
127
  var _this;
128
+
107
129
  (0, _classCallCheck2.default)(this, HiSlider);
108
130
  _this = _super.call(this, props);
131
+
109
132
  _this.handleChange = function (event) {
110
133
  _this.props.onChange(parseFloat(event.target.value));
134
+
111
135
  _this.textValueWidth = _this.textValue.offsetWidth;
112
136
  };
137
+
113
138
  _this.handleFocus = function (isFocused) {
114
139
  return function () {
115
140
  _this.setState({
@@ -117,17 +142,19 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
117
142
  });
118
143
  };
119
144
  };
145
+
120
146
  _this.state = {
121
147
  focused: false
122
148
  };
123
149
  return _this;
124
150
  }
125
-
126
151
  /**
127
152
  * Measures several components once they are mounted.
128
153
  * If the value and a label (left or right) are hovered,
129
154
  * we hide this label.
130
155
  */
156
+
157
+
131
158
  (0, _createClass2.default)(HiSlider, [{
132
159
  key: "componentDidMount",
133
160
  value: function componentDidMount() {
@@ -135,17 +162,19 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
135
162
  this.rightLabelWidth = this.rightLabel.offsetWidth;
136
163
  this.textValueWidth = this.textValue.offsetWidth;
137
164
  this.barContainerWidth = this.barContainer.offsetWidth;
165
+
138
166
  var _this$getHovering = this.getHovering(),
139
- hoveringLeft = _this$getHovering.hoveringLeft,
140
- hoveringRight = _this$getHovering.hoveringRight;
167
+ hoveringLeft = _this$getHovering.hoveringLeft,
168
+ hoveringRight = _this$getHovering.hoveringRight;
169
+
141
170
  if (hoveringLeft || hoveringRight) {
142
171
  this.forceUpdate();
143
172
  }
144
173
  }
145
-
146
174
  /**
147
175
  * Calculates if the labels are hovered.
148
176
  */
177
+
149
178
  }, {
150
179
  key: "getHovering",
151
180
  value: function getHovering() {
@@ -161,25 +190,28 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
161
190
  key: "render",
162
191
  value: function render() {
163
192
  var _this2 = this;
193
+
164
194
  var _this$props = this.props,
165
- classes = _this$props.classes,
166
- className = _this$props.className,
167
- min = _this$props.min,
168
- max = _this$props.max,
169
- leftLabel = _this$props.leftLabel,
170
- rightLabel = _this$props.rightLabel,
171
- step = _this$props.step,
172
- suffix = _this$props.suffix,
173
- id = _this$props.id,
174
- label = _this$props.label,
175
- value = _this$props.value,
176
- theme = _this$props.theme;
195
+ classes = _this$props.classes,
196
+ className = _this$props.className,
197
+ min = _this$props.min,
198
+ max = _this$props.max,
199
+ leftLabel = _this$props.leftLabel,
200
+ rightLabel = _this$props.rightLabel,
201
+ step = _this$props.step,
202
+ suffix = _this$props.suffix,
203
+ id = _this$props.id,
204
+ label = _this$props.label,
205
+ value = _this$props.value,
206
+ theme = _this$props.theme;
177
207
  var focused = this.state.focused;
178
208
  var ratio = (value - min) / (max - min);
179
209
  var percentage = ratio * 100;
210
+
180
211
  var _this$getHovering2 = this.getHovering(),
181
- hoveringLeft = _this$getHovering2.hoveringLeft,
182
- hoveringRight = _this$getHovering2.hoveringRight;
212
+ hoveringLeft = _this$getHovering2.hoveringLeft,
213
+ hoveringRight = _this$getHovering2.hoveringRight;
214
+
183
215
  var barColor = focused ? theme.palette.primary.dark : theme.palette.primary.main;
184
216
  return (
185
217
  /*#__PURE__*/
@@ -246,8 +278,11 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
246
278
  }]);
247
279
  return HiSlider;
248
280
  }(_react.default.Component);
249
- var _default = exports.default = (0, _withStyles.default)(styles, {
281
+
282
+ var _default = (0, _withStyles.default)(styles, {
250
283
  hiComponent: true,
251
284
  name: 'HiSlider',
252
285
  withTheme: true
253
- })(HiSlider);
286
+ })(HiSlider);
287
+
288
+ exports.default = _default;
@@ -1,35 +1,54 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+
8
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
+
9
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
13
+
10
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
15
+
11
16
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
17
+
12
18
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
19
+
13
20
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
21
+
14
22
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
23
+
15
24
  var _react = _interopRequireDefault(require("react"));
25
+
16
26
  var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
27
+
17
28
  var _HiInput = _interopRequireDefault(require("./HiInput"));
29
+
18
30
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // @inheritedComponent TextField
31
+
32
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
33
+
20
34
  /**
21
35
  * Champs input pour formulaire
22
36
  */
23
37
  var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
24
38
  (0, _inherits2.default)(HiTextField, _React$PureComponent);
39
+
25
40
  var _super = _createSuper(HiTextField);
41
+
26
42
  function HiTextField(props) {
27
43
  var _this;
44
+
28
45
  (0, _classCallCheck2.default)(this, HiTextField);
29
46
  _this = _super.call(this, props);
47
+
30
48
  _this.focus = function () {
31
49
  _this.input.focus();
32
50
  };
51
+
33
52
  _this.state = {
34
53
  nbChars: props.value ? props.value.length : 0
35
54
  };
@@ -38,6 +57,7 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
38
57
  _this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)(_this));
39
58
  return _this;
40
59
  }
60
+
41
61
  (0, _createClass2.default)(HiTextField, [{
42
62
  key: "handleBlur",
43
63
  value: function handleBlur(event) {
@@ -49,10 +69,12 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
49
69
  key: "handleChange",
50
70
  value: function handleChange(event) {
51
71
  var value = event.target.value;
72
+
52
73
  if (value.length <= this.props.maxLength) {
53
74
  if (this.props.onChange) {
54
75
  this.props.onChange(event);
55
76
  }
77
+
56
78
  if (this.props.multiline === true) {
57
79
  this.setState({
58
80
  nbChars: value.length
@@ -71,27 +93,28 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
71
93
  key: "render",
72
94
  value: function render() {
73
95
  var _this2 = this;
96
+
74
97
  var _this$props = this.props,
75
- className = _this$props.className,
76
- disabled = _this$props.disabled,
77
- error = _this$props.error,
78
- errorText = _this$props.errorText,
79
- id = _this$props.id,
80
- label = _this$props.label,
81
- helperText = _this$props.helperText,
82
- helperIcon = _this$props.helperIcon,
83
- fullWidth = _this$props.fullWidth,
84
- required = _this$props.required,
85
- type = _this$props.type,
86
- multiline = _this$props.multiline,
87
- placeholder = _this$props.placeholder,
88
- value = _this$props.value,
89
- HiInputProps = _this$props.HiInputProps,
90
- HiInputLabelProps = _this$props.HiInputLabelProps,
91
- name = _this$props.name,
92
- rows = _this$props.rows,
93
- maxLength = _this$props.maxLength,
94
- customRef = _this$props.customRef;
98
+ className = _this$props.className,
99
+ disabled = _this$props.disabled,
100
+ error = _this$props.error,
101
+ errorText = _this$props.errorText,
102
+ id = _this$props.id,
103
+ label = _this$props.label,
104
+ helperText = _this$props.helperText,
105
+ helperIcon = _this$props.helperIcon,
106
+ fullWidth = _this$props.fullWidth,
107
+ required = _this$props.required,
108
+ type = _this$props.type,
109
+ multiline = _this$props.multiline,
110
+ placeholder = _this$props.placeholder,
111
+ value = _this$props.value,
112
+ HiInputProps = _this$props.HiInputProps,
113
+ HiInputLabelProps = _this$props.HiInputLabelProps,
114
+ name = _this$props.name,
115
+ rows = _this$props.rows,
116
+ maxLength = _this$props.maxLength,
117
+ customRef = _this$props.customRef;
95
118
  var nbChars = this.state.nbChars;
96
119
  return /*#__PURE__*/_react.default.createElement(_HiFormControl.default, {
97
120
  label: label,
@@ -133,6 +156,7 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
133
156
  }]);
134
157
  return HiTextField;
135
158
  }(_react.default.PureComponent);
159
+
136
160
  HiTextField.defaultProps = {
137
161
  name: '',
138
162
  type: 'text',
@@ -146,4 +170,5 @@ HiTextField.defaultProps = {
146
170
  multiline: false,
147
171
  maxLength: 280
148
172
  };
149
- var _default = exports.default = HiTextField;
173
+ var _default = HiTextField;
174
+ exports.default = _default;
@@ -1,27 +1,45 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.styles = exports.default = void 0;
9
+
8
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
11
+
9
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
+
10
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
15
+
11
16
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
17
+
12
18
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
19
+
13
20
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
21
+
14
22
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
23
+
15
24
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
25
+
16
26
  var _react = _interopRequireDefault(require("react"));
27
+
17
28
  var _classnames = _interopRequireDefault(require("classnames"));
29
+
18
30
  var _index = _interopRequireDefault(require("keycode/index"));
31
+
19
32
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
33
+
20
34
  var _HiUploadInput = _interopRequireDefault(require("./HiUploadInput"));
35
+
21
36
  var _HiIcon = _interopRequireDefault(require("../HiIcon"));
37
+
22
38
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
39
+
23
40
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
- var styles = exports.styles = function styles(theme) {
41
+
42
+ var styles = function styles(theme) {
25
43
  return {
26
44
  flexContainer: {
27
45
  display: 'flex',
@@ -69,24 +87,34 @@ var styles = exports.styles = function styles(theme) {
69
87
  focusable: {}
70
88
  };
71
89
  };
90
+
91
+ exports.styles = styles;
92
+
72
93
  var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
73
94
  (0, _inherits2.default)(HiUpload, _React$PureComponent);
95
+
74
96
  var _super = _createSuper(HiUpload);
97
+
75
98
  function HiUpload() {
76
99
  var _this;
100
+
77
101
  (0, _classCallCheck2.default)(this, HiUpload);
78
102
  _this = _super.call(this);
79
- // Action when files are dropped on the field
103
+
80
104
  _this.handleDrop = function (event) {
81
105
  if (event.path[0].id === _this.uploadIconRef.props.id) {
82
106
  event.preventDefault();
83
107
  event.stopPropagation();
108
+
84
109
  if (_this.state.droppable) {
85
110
  var index = _this.getNextInputIndex();
111
+
86
112
  var param = _this.handleFile(event.dataTransfer.files, index);
113
+
87
114
  _this.setState({
88
115
  dragOver: false
89
116
  });
117
+
90
118
  _this.props.onChange(param, 0);
91
119
  } else {
92
120
  _this.setState({
@@ -95,17 +123,20 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
95
123
  }
96
124
  }
97
125
  };
98
- // Action when files are dragged over the field.
126
+
99
127
  _this.handleDragEnter = function (event) {
100
128
  event.preventDefault();
101
129
  event.stopPropagation();
130
+
102
131
  if (event.path[0].id === _this.uploadIconRef.props.id) {
103
132
  if (event.dataTransfer.items.length !== 1) {
104
133
  event.dataTransfer.dropEffect = 'none';
134
+
105
135
  _this.props.onChange({
106
136
  errorMessage: _this.props.translations.errorDragEnter,
107
137
  value: null
108
138
  }, 0);
139
+
109
140
  _this.setState({
110
141
  dragOver: true
111
142
  });
@@ -117,47 +148,59 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
117
148
  }
118
149
  }
119
150
  };
120
- // Action when files are not dragged over the field anymore.
151
+
121
152
  _this.handleDragLeave = function (event) {
122
153
  event.preventDefault();
123
154
  event.stopPropagation();
155
+
124
156
  if (event.path[0].id === _this.uploadIconRef.props.id && event.relatedTarget.parentElement !== _this.uploadFieldRef) {
125
157
  _this.props.onChange({
126
158
  errorMessage: '',
127
159
  value: null
128
160
  }, 0);
161
+
129
162
  _this.setState({
130
163
  droppable: false,
131
164
  dragOver: false
132
165
  });
133
166
  }
134
167
  };
168
+
135
169
  _this.handleChange = function (event) {
136
170
  var index = _this.getNextInputIndex();
171
+
137
172
  var param = _this.handleFile(event.target.files, index);
173
+
138
174
  _this.props.onChange(param, index);
139
175
  };
176
+
140
177
  _this.handleEmptyField = function (event) {
141
178
  event.target.value = '';
142
179
  };
180
+
143
181
  _this.handleKeyPress = function (event) {
144
182
  var key = (0, _index.default)(event);
183
+
145
184
  if (key === 'enter' || key === 'space') {
146
185
  event.preventDefault();
186
+
147
187
  _this.uploadInput.click();
148
188
  }
149
189
  };
150
- // Handles the file wether it is selected via the input or dropped on it.
190
+
151
191
  _this.handleFile = function (files, index) {
152
192
  var error = false;
153
193
  var errorMessage = '';
154
194
  var file = null;
195
+
155
196
  if (files.length === 1) {
156
197
  file = files[0];
198
+
157
199
  if (_this.props.inputs[index] && file.size > _this.props.inputs[index].maxSize) {
158
200
  errorMessage += _this.props.translations.errorSize.replace('maxSize', _this.props.inputs[index].maxSize / 1000000);
159
201
  error = true;
160
202
  }
203
+
161
204
  if (_this.props.inputs[index] && _this.props.inputs[index].acceptedTypes && _this.props.inputs[index].acceptedTypes.length !== 0 && _this.props.inputs[index].acceptedTypes.indexOf(file.type) === -1) {
162
205
  errorMessage += _this.props.translations.errorType;
163
206
  error = true;
@@ -165,23 +208,26 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
165
208
  } else {
166
209
  errorMessage = _this.props.translations.errorDropMultiple;
167
210
  }
211
+
168
212
  return {
169
213
  errorMessage: errorMessage,
170
214
  error: error,
171
215
  value: file
172
216
  };
173
217
  };
218
+
174
219
  _this.createInputs = function (others) {
175
220
  var _this$props = _this.props,
176
- inputs = _this$props.inputs,
177
- values = _this$props.values;
178
- var files = inputs;
221
+ inputs = _this$props.inputs,
222
+ values = _this$props.values;
223
+ var files = inputs; // unlimited number of files
179
224
 
180
- // unlimited number of files
181
225
  if (inputs.length === 0) {
182
226
  files = values;
183
227
  }
228
+
184
229
  var inputComponents = [];
230
+
185
231
  for (var i = 0; i < files.length; i += 1) {
186
232
  if (files.length > 1 || values[i] && values[i].value) {
187
233
  inputComponents.push( /*#__PURE__*/_react.default.createElement(_HiUploadInput.default, (0, _extends2.default)({
@@ -199,17 +245,19 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
199
245
  }, others)));
200
246
  }
201
247
  }
248
+
202
249
  return inputComponents;
203
250
  };
251
+
204
252
  _this.uploadFieldRef = void 0;
205
253
  _this.state = {
206
254
  dragOver: false,
207
255
  droppable: false
208
256
  };
209
257
  return _this;
210
- }
258
+ } // When component mounts, we add eventListeners to handle the file drag and drop
259
+
211
260
 
212
- // When component mounts, we add eventListeners to handle the file drag and drop
213
261
  (0, _createClass2.default)(HiUpload, [{
214
262
  key: "componentDidMount",
215
263
  value: function componentDidMount() {
@@ -233,9 +281,8 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
233
281
  }, {
234
282
  key: "getNextInputIndex",
235
283
  value: function getNextInputIndex() {
236
- var index = 0;
284
+ var index = 0; // Add an input at the end
237
285
 
238
- // Add an input at the end
239
286
  if (!this.props.inputs.length) {
240
287
  index = this.props.values.length + 1;
241
288
  } else {
@@ -247,27 +294,31 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
247
294
  }
248
295
  }
249
296
  }
297
+
250
298
  return index;
251
- }
299
+ } // Action when files are dropped on the field
300
+
252
301
  }, {
253
302
  key: "render",
254
303
  value: function render() {
255
- var _this2 = this;
304
+ var _classNames,
305
+ _classNames2,
306
+ _this2 = this;
307
+
256
308
  var _this$props2 = this.props,
257
- id = _this$props2.id,
258
- inputs = _this$props2.inputs,
259
- classes = _this$props2.classes,
260
- values = _this$props2.values,
261
- focused = _this$props2.focused,
262
- others = (0, _objectWithoutProperties2.default)(_this$props2, ["id", "inputs", "classes", "values", "focused"]);
309
+ id = _this$props2.id,
310
+ inputs = _this$props2.inputs,
311
+ classes = _this$props2.classes,
312
+ values = _this$props2.values,
313
+ focused = _this$props2.focused,
314
+ others = (0, _objectWithoutProperties2.default)(_this$props2, ["id", "inputs", "classes", "values", "focused"]);
263
315
  var _this$state = this.state,
264
- dragOver = _this$state.dragOver,
265
- droppable = _this$state.droppable;
316
+ dragOver = _this$state.dragOver,
317
+ droppable = _this$state.droppable;
266
318
  var complete = true;
267
319
  var empty = true;
268
- var error = false;
320
+ var error = false; // For unlimited inputs: always grey
269
321
 
270
- // For unlimited inputs: always grey
271
322
  if (!inputs.length) {
272
323
  complete = false;
273
324
  } else if (values.length === 0 || inputs.length > 0 && inputs.length !== values.length) {
@@ -275,6 +326,7 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
275
326
  } else {
276
327
  for (var i = 0, len = values.length; i < len; i += 1) {
277
328
  var value = values[i];
329
+
278
330
  if (value !== undefined) {
279
331
  complete = value.value === null || value.error ? false : complete;
280
332
  empty = value.value !== null && !value.error ? false : empty;
@@ -284,8 +336,10 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
284
336
  }
285
337
  }
286
338
  }
287
- var statusClass = (0, _classnames.default)(classes.statusIcon, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, classes.empty, empty), classes.complete, complete));
339
+
340
+ var statusClass = (0, _classnames.default)(classes.statusIcon, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.empty, empty), (0, _defineProperty2.default)(_classNames, classes.complete, complete), _classNames));
288
341
  var icon;
342
+
289
343
  if (error) {
290
344
  icon = 'warning';
291
345
  } else if (complete) {
@@ -293,11 +347,14 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
293
347
  } else {
294
348
  icon = 'file_upload';
295
349
  }
350
+
296
351
  var focusable = true;
352
+
297
353
  if (complete && values.length > 1) {
298
354
  focusable = false;
299
355
  }
300
- var iconClass = (0, _classnames.default)(statusClass, classes.fileButton, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, classes.dragOver, dragOver), classes.droppable, droppable), classes.focused, focused), classes.error, error && !focused), classes.focusable, focusable));
356
+
357
+ 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));
301
358
  return /*#__PURE__*/_react.default.createElement("div", {
302
359
  className: classes.flexContainer
303
360
  }, /*#__PURE__*/_react.default.createElement("label", {
@@ -330,7 +387,10 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
330
387
  }]);
331
388
  return HiUpload;
332
389
  }(_react.default.PureComponent);
333
- var _default = exports.default = (0, _withStyles.default)(styles, {
390
+
391
+ var _default = (0, _withStyles.default)(styles, {
334
392
  hiComponent: true,
335
393
  name: 'HmuiHiUpload'
336
- })(HiUpload);
394
+ })(HiUpload);
395
+
396
+ exports.default = _default;