@hipay/hipay-material-ui 4.0.1-beta3 → 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 +47 -15
  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 +35 -10
  16. package/HiBreadcrumb/HiStep.js +50 -17
  17. package/HiBreadcrumb/HiStepConnector.js +55 -18
  18. package/HiBreadcrumb/HiStepContent.js +35 -10
  19. package/HiBreadcrumb/HiStepIcon.js +40 -14
  20. package/HiBreadcrumb/HiStepLabel.js +49 -18
  21. package/HiBreadcrumb/HiStepper.js +35 -10
  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 +38 -16
  26. package/HiCell/CellDate.js +41 -14
  27. package/HiCell/CellHiddenContent.js +30 -8
  28. package/HiCell/CellIcon.js +41 -16
  29. package/HiCell/CellImage.js +39 -16
  30. package/HiCell/CellNumeric.js +45 -17
  31. package/HiCell/CellPinToAction.js +38 -13
  32. package/HiCell/CellRate.js +52 -17
  33. package/HiCell/CellSentinel.js +38 -16
  34. package/HiCell/CellSentinelScore.js +36 -13
  35. package/HiCell/CellText.js +58 -21
  36. package/HiCell/CellTextStyled.js +24 -13
  37. package/HiCell/index.js +10 -0
  38. package/HiCheckbox/HiCheckbox.js +57 -19
  39. package/HiCheckbox/index.js +2 -0
  40. package/HiChip/HiChip.js +47 -24
  41. package/HiChip/HiChipSwitch.js +65 -21
  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 +93 -20
  47. package/HiDatePicker/HiDatePickerMobile.js +48 -22
  48. package/HiDatePicker/HiDateRangePicker.js +139 -42
  49. package/HiDatePicker/HiDateRangeSelector.js +135 -53
  50. package/HiDatePicker/ListPicker.js +43 -12
  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 +32 -9
  55. package/HiDatePicker/Overlays/Overlay.js +25 -8
  56. package/HiDatePicker/Overlays/TimePickerOverlay.js +45 -13
  57. package/HiDatePicker/Overlays/YearPickerOverlay.js +38 -13
  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 -6
  63. package/HiDialog/HiDialog.js +19 -7
  64. package/HiDialog/index.js +2 -0
  65. package/HiDotsStepper/HiDot.js +42 -12
  66. package/HiDotsStepper/HiDotsStepper.js +43 -15
  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 +41 -14
  71. package/HiForm/HiEmailField.js +34 -9
  72. package/HiForm/HiFormControl.js +79 -32
  73. package/HiForm/HiFormLabel.js +45 -18
  74. package/HiForm/HiInput.js +97 -37
  75. package/HiForm/HiPasswordField.js +43 -13
  76. package/HiForm/HiSearchField.js +40 -8
  77. package/HiForm/HiSlider.js +62 -26
  78. package/HiForm/HiTextField.js +52 -26
  79. package/HiForm/HiUpload.js +94 -33
  80. package/HiForm/HiUploadField.js +37 -14
  81. package/HiForm/HiUploadInput.js +81 -25
  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 -6
  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 +53 -21
  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 +61 -27
  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 +47 -36
  107. package/HiSelect/HiDynamicSelectField.js +52 -27
  108. package/HiSelect/HiNestedSelect.js +116 -69
  109. package/HiSelect/HiNestedSelectContent.js +90 -63
  110. package/HiSelect/HiNestedSelectField.js +52 -27
  111. package/HiSelect/HiSelect.js +192 -93
  112. package/HiSelect/HiSelectContent.js +103 -67
  113. package/HiSelect/HiSelectField.js +53 -28
  114. package/HiSelect/HiSelectInput.js +81 -25
  115. package/HiSelect/HiSelectMobile.js +49 -11
  116. package/HiSelect/HiSuggestSelect.js +85 -28
  117. package/HiSelect/HiSuggestSelectField.js +43 -18
  118. package/HiSelect/index.js +14 -2
  119. package/HiSelectableList/HiSelectableList.js +95 -38
  120. package/HiSelectableList/HiSelectableListHierarchic.js +65 -38
  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 +69 -13
  131. package/HiTable/HiTable.js +48 -20
  132. package/HiTable/HiTableBody.js +28 -10
  133. package/HiTable/HiTableHeader.js +55 -21
  134. package/HiTable/HiTableRow.js +51 -16
  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 +47 -15
  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 +35 -10
  152. package/es/HiBreadcrumb/HiStep.js +50 -17
  153. package/es/HiBreadcrumb/HiStepConnector.js +55 -18
  154. package/es/HiBreadcrumb/HiStepContent.js +35 -10
  155. package/es/HiBreadcrumb/HiStepIcon.js +40 -14
  156. package/es/HiBreadcrumb/HiStepLabel.js +49 -18
  157. package/es/HiBreadcrumb/HiStepper.js +35 -10
  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 +38 -16
  162. package/es/HiCell/CellDate.js +41 -14
  163. package/es/HiCell/CellHiddenContent.js +30 -8
  164. package/es/HiCell/CellIcon.js +41 -16
  165. package/es/HiCell/CellImage.js +39 -16
  166. package/es/HiCell/CellNumeric.js +45 -17
  167. package/es/HiCell/CellPinToAction.js +38 -13
  168. package/es/HiCell/CellRate.js +52 -17
  169. package/es/HiCell/CellSentinel.js +38 -16
  170. package/es/HiCell/CellSentinelScore.js +36 -13
  171. package/es/HiCell/CellText.js +58 -21
  172. package/es/HiCell/CellTextStyled.js +24 -13
  173. package/es/HiCell/index.js +10 -0
  174. package/es/HiCheckbox/HiCheckbox.js +57 -19
  175. package/es/HiCheckbox/index.js +2 -0
  176. package/es/HiChip/HiChip.js +47 -24
  177. package/es/HiChip/HiChipSwitch.js +65 -21
  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 +93 -20
  183. package/es/HiDatePicker/HiDatePickerMobile.js +48 -22
  184. package/es/HiDatePicker/HiDateRangePicker.js +139 -42
  185. package/es/HiDatePicker/HiDateRangeSelector.js +135 -53
  186. package/es/HiDatePicker/ListPicker.js +43 -12
  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 +32 -9
  191. package/es/HiDatePicker/Overlays/Overlay.js +25 -8
  192. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +45 -13
  193. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +38 -13
  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 -6
  199. package/es/HiDialog/HiDialog.js +19 -7
  200. package/es/HiDialog/index.js +2 -0
  201. package/es/HiDotsStepper/HiDot.js +42 -12
  202. package/es/HiDotsStepper/HiDotsStepper.js +43 -15
  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 +41 -14
  207. package/es/HiForm/HiEmailField.js +34 -9
  208. package/es/HiForm/HiFormControl.js +79 -32
  209. package/es/HiForm/HiFormLabel.js +45 -18
  210. package/es/HiForm/HiInput.js +97 -37
  211. package/es/HiForm/HiPasswordField.js +43 -13
  212. package/es/HiForm/HiSearchField.js +40 -8
  213. package/es/HiForm/HiSlider.js +62 -26
  214. package/es/HiForm/HiTextField.js +52 -26
  215. package/es/HiForm/HiUpload.js +94 -33
  216. package/es/HiForm/HiUploadField.js +37 -14
  217. package/es/HiForm/HiUploadInput.js +81 -25
  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 -6
  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 +53 -21
  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 +61 -27
  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 +47 -36
  243. package/es/HiSelect/HiDynamicSelectField.js +52 -27
  244. package/es/HiSelect/HiNestedSelect.js +116 -69
  245. package/es/HiSelect/HiNestedSelectContent.js +90 -63
  246. package/es/HiSelect/HiNestedSelectField.js +52 -27
  247. package/es/HiSelect/HiSelect.js +192 -93
  248. package/es/HiSelect/HiSelectContent.js +103 -67
  249. package/es/HiSelect/HiSelectField.js +53 -28
  250. package/es/HiSelect/HiSelectInput.js +81 -25
  251. package/es/HiSelect/HiSelectMobile.js +49 -11
  252. package/es/HiSelect/HiSuggestSelect.js +85 -28
  253. package/es/HiSelect/HiSuggestSelectField.js +43 -18
  254. package/es/HiSelect/index.js +14 -2
  255. package/es/HiSelectableList/HiSelectableList.js +95 -38
  256. package/es/HiSelectableList/HiSelectableListHierarchic.js +65 -38
  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 +69 -13
  267. package/es/HiTable/HiTable.js +48 -20
  268. package/es/HiTable/HiTableBody.js +28 -10
  269. package/es/HiTable/HiTableHeader.js +55 -21
  270. package/es/HiTable/HiTableRow.js +51 -16
  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 +53 -18
  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 -66
  326. package/es/styles/createStyles.js +1 -0
  327. package/es/styles/createTypography.js +24 -15
  328. package/es/styles/getStylesCreator.js +14 -2
  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 +1 -1
  401. package/setupTest.js +13 -2
  402. package/styleguide/Wrapper.js +6 -0
  403. package/styles/MuiThemeProvider.js +53 -18
  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 -66
  410. package/styles/createStyles.js +1 -0
  411. package/styles/createTypography.js +24 -15
  412. package/styles/getStylesCreator.js +14 -2
  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,42 +1,75 @@
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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
15
+
11
16
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
17
+
12
18
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
19
+
13
20
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
21
+
14
22
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
23
+
24
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
25
+
15
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
27
+
16
28
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
17
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
29
+
18
30
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
31
+
19
32
  var _react = _interopRequireDefault(require("react"));
33
+
20
34
  var _reactCustomScrollbars = _interopRequireDefault(require("react-custom-scrollbars"));
35
+
21
36
  var _Grow = _interopRequireDefault(require("@mui/material/Grow"));
37
+
22
38
  var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
39
+
23
40
  var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
41
+
24
42
  var _ClickAwayListener = _interopRequireDefault(require("@mui/material/ClickAwayListener"));
43
+
25
44
  var _HiSelectableList = _interopRequireDefault(require("../HiSelectableList"));
45
+
26
46
  var _HiInput = _interopRequireDefault(require("../HiForm/HiInput"));
47
+
27
48
  var _HiSelectInput = _interopRequireDefault(require("./HiSelectInput"));
49
+
28
50
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
51
+
29
52
  var _helpers = require("../utils/helpers");
53
+
30
54
  var _HiIcon = _interopRequireDefault(require("../HiIcon"));
55
+
31
56
  var _keycode = _interopRequireDefault(require("keycode"));
57
+
32
58
  var _classnames = _interopRequireDefault(require("classnames"));
59
+
33
60
  var _HiAlertModal = _interopRequireDefault(require("../HiAlertModal"));
61
+
34
62
  var _reactDeviceDetect = require("react-device-detect");
63
+
35
64
  var _HiSelectMobile = _interopRequireDefault(require("./HiSelectMobile"));
65
+
36
66
  var _reactDom = require("react-dom");
37
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
38
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
39
- var styles = exports.styles = function styles(theme) {
67
+
68
+ 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); }; }
69
+
70
+ 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; } }
71
+
72
+ var styles = function styles(theme) {
40
73
  return {
41
74
  root: {
42
75
  backgroundColor: theme.palette.background2,
@@ -91,10 +124,12 @@ var styles = exports.styles = function styles(theme) {
91
124
  }
92
125
  };
93
126
  };
127
+
128
+ exports.styles = styles;
129
+
94
130
  function filterValue(item, search) {
95
131
  return search === '' || (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(search.toLowerCase())) !== -1;
96
132
  }
97
-
98
133
  /**
99
134
  *
100
135
  * Utilisé pour tous types de selects dans les formulaires.
@@ -110,20 +145,19 @@ function filterValue(item, search) {
110
145
  * - HiSearchField : intègre une barre de recherche dans le Popper, il filtre la liste des suggestions
111
146
  * - HiSelectableList : affiche la liste des suggestions selon le type des éléments
112
147
  */
148
+
149
+
113
150
  var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
114
151
  (0, _inherits2.default)(HiSelect, _React$PureComponent);
152
+
153
+ var _super = _createSuper(HiSelect);
154
+
115
155
  function HiSelect(_props) {
116
156
  var _this;
157
+
117
158
  (0, _classCallCheck2.default)(this, HiSelect);
118
- _this = _callSuper(this, HiSelect, [_props]);
119
- /**
120
- * Build itemList & inputValue from select props
121
- * @param options
122
- * @param value
123
- * @param search
124
- * @param loading
125
- * @returns {{itemList: *[], inputValue: *}}
126
- */
159
+ _this = _super.call(this, _props);
160
+
127
161
  _this.buildSelectProps = function (options) {
128
162
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
129
163
  var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
@@ -150,25 +184,30 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
150
184
  inputValue: _this.buildInputValue(options, value, loading)
151
185
  };
152
186
  };
187
+
153
188
  _this.findRecursively = function (arr, id) {
154
189
  for (var i = 0; i < arr.length; i++) {
155
190
  if (arr[i].id === id) {
156
191
  return arr[i];
157
192
  } else if (arr[i].children && arr[i].children.length) {
158
193
  var found = _this.findRecursively(arr[i].children, id);
194
+
159
195
  if (found) return found;
160
196
  }
161
197
  }
162
198
  };
199
+
163
200
  _this.buildInputValue = function (options) {
164
201
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
165
202
  var loading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
166
203
  var _this$props = _this.props,
167
- classes = _this$props.classes,
168
- hasAll = _this$props.hasAll,
169
- translations = _this$props.translations,
170
- type = _this$props.type; // build input value
204
+ classes = _this$props.classes,
205
+ hasAll = _this$props.hasAll,
206
+ translations = _this$props.translations,
207
+ type = _this$props.type; // build input value
208
+
171
209
  var inputValue;
210
+
172
211
  if (loading && value.length === 1) {
173
212
  inputValue = translations.one_item_selected;
174
213
  } else if (hasAll && options.length === value.length) {
@@ -178,6 +217,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
178
217
  inputValue = translations.n_items_selected.replace('%s', value.length);
179
218
  } else if (value.length === 1) {
180
219
  var item = _this.findRecursively(options, value[0]);
220
+
181
221
  if (item === undefined) {
182
222
  inputValue = translations.one_item_selected;
183
223
  } else if (type === 'icon' || item.type === 'icon') {
@@ -186,6 +226,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
186
226
  color: item.color
187
227
  };
188
228
  var icon;
229
+
189
230
  if (typeof item.icon === 'string') {
190
231
  icon = /*#__PURE__*/_react.default.createElement(_HiIcon.default, (0, _extends2.default)({
191
232
  icon: item.icon
@@ -194,6 +235,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
194
235
  icon = (0, _objectSpread2.default)({}, item.icon);
195
236
  icon.props = (0, _objectSpread2.default)({}, icon.props, {}, iconProps);
196
237
  }
238
+
197
239
  inputValue = /*#__PURE__*/_react.default.createElement("span", {
198
240
  className: classes.selectIconLabel
199
241
  }, icon, item.label);
@@ -216,31 +258,40 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
216
258
  inputValue = item.label;
217
259
  }
218
260
  }
261
+
219
262
  return inputValue;
220
263
  };
264
+
221
265
  _this.focusOnFirstItem = function () {
222
266
  if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
223
267
  setTimeout(function () {
224
268
  var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
269
+
225
270
  item.focus();
226
271
  }, 1);
227
272
  }
228
273
  };
274
+
229
275
  _this.getInputElement = function (el) {
230
276
  _this.searchField = el;
277
+
231
278
  if (_this.props.inputRef) {
232
279
  _this.props.inputRef(_this.searchField);
233
280
  }
234
281
  };
282
+
235
283
  _this.handleBlur = function (event) {
236
284
  _this.handleSearchReset();
285
+
237
286
  _this.setState({
238
287
  focused: false
239
288
  });
289
+
240
290
  if (_this.props.onBlur && !_this.inputEl.contains(event.relatedTarget) && !_this.state.open) {
241
291
  _this.props.onBlur(event);
242
292
  }
243
293
  };
294
+
244
295
  _this.handleClick = function (event) {
245
296
  if (_this.state.open) {
246
297
  _this.handleClose();
@@ -254,10 +305,11 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
254
305
  open: true,
255
306
  alertOpen: false
256
307
  });
308
+
257
309
  _this.handleSuggestions(_this.props.options);
258
- if (_this.props.onClick) _this.props.onClick();
259
310
 
260
- // Gestion du focus
311
+ if (_this.props.onClick) _this.props.onClick(); // Gestion du focus
312
+
261
313
  setTimeout(function () {
262
314
  if (!_this.props.searchable) {
263
315
  // Sinon focus sur l'élément sélectionné
@@ -266,31 +318,38 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
266
318
  }, 1);
267
319
  }
268
320
  };
321
+
269
322
  _this.handleSubmitAlert = function () {
270
323
  _this.handleClick();
271
324
  };
325
+
272
326
  _this.handleCancelAlert = function () {
273
327
  _this.handleClose();
274
328
  };
329
+
275
330
  _this.handleExitedAlert = function () {
276
331
  if (_this.searchField) {
277
332
  _this.searchField.focus();
278
333
  }
279
334
  };
335
+
280
336
  _this.handleCloseAlert = function () {
281
337
  _this.handleClose();
282
338
  };
339
+
283
340
  _this.focusOnSelectedItem = function (selectedValue) {
284
341
  if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
285
342
  setTimeout(function () {
286
343
  if (_this.overlay) {
287
344
  // On initialise au premier élément pour être sûr de ne pas se retrouver avec un focus of undefined
288
345
  var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
346
+
289
347
  if (selectedValue && typeof selectedValue === 'string') {
290
348
  item = _this.overlay.getElementsByTagName('li').namedItem(selectedValue);
291
349
  } else if (selectedValue && typeof selectedValue === 'number') {
292
350
  item = _this.overlay.querySelector('li:not([tabindex^="-"])')[selectedValue - 1];
293
351
  }
352
+
294
353
  if (item) {
295
354
  item.focus();
296
355
  }
@@ -298,59 +357,70 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
298
357
  }, 1);
299
358
  }
300
359
  };
360
+
301
361
  _this.handleClickAway = function (event) {
302
362
  // Au clic sur le bouton, on laisse le handleClick fermer le select
303
363
  if (!_this.inputEl.contains(event.target)) {
304
364
  _this.handleClose(event);
305
365
  }
306
366
  };
367
+
307
368
  _this.handleClose = function () {
308
369
  _this.handleSearchReset();
370
+
309
371
  _this.setState({
310
372
  open: false,
311
373
  alertOpen: false
312
374
  });
375
+
313
376
  if (_this.props.onClose) {
314
377
  _this.props.onClose();
315
378
  }
379
+
316
380
  if (_this.inputEl) {
317
381
  setTimeout(function () {
318
382
  _this.inputEl.focus();
319
383
  }, 100);
320
384
  }
321
385
  };
386
+
322
387
  _this.handleFocus = function () {
323
388
  _this.setState({
324
389
  focused: true
325
390
  });
326
391
  };
327
- // Stop the propagation of the event before it reach the childrens
392
+
328
393
  _this.handleKeyDownCapture = function (event) {
329
394
  var key = (0, _keycode.default)(event);
395
+
330
396
  if (key === 'enter') {
331
397
  if (_this.state.open) {
332
398
  if (_this.props.multiple) {
333
399
  event.stopPropagation();
400
+
334
401
  _this.handleClose();
335
402
  }
336
403
  }
337
404
  }
338
405
  };
339
- // Key down on input
406
+
340
407
  _this.handleKeyDown = function (event) {
341
408
  var key = (0, _keycode.default)(event);
409
+
342
410
  if (!_this.state.alertOpen) {
343
411
  if (event.target === _this.inputEl && _this.state.open && key === 'down') {
344
412
  // Focus on list 1st item
345
413
  event.stopPropagation();
346
414
  event.preventDefault();
347
415
  var firstLi = document.querySelector("#".concat(_this.props.id, " + div ul > li"));
416
+
348
417
  if (!!firstLi) {
349
418
  firstLi.focus();
350
419
  }
351
420
  } else if (key === 'esc' && _this.state.open) {
352
421
  event.stopPropagation();
353
422
  event.preventDefault();
423
+
354
424
  _this.handleClose();
355
425
  } else if (key === 'enter') {
356
426
  if (_this.state.open) {
@@ -362,6 +432,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
362
432
  event.preventDefault();
363
433
  } else if (key === 'tab' && (_this.state.open || _this.state.alertOpen)) {
364
434
  event.stopPropagation();
435
+
365
436
  _this.handleClose();
366
437
  } else if (key === 'down' && event.target.id.includes('_subheader')) {
367
438
  // Focus on parent, next item is child
@@ -370,6 +441,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
370
441
  }
371
442
  } else if (key === 'down' && !event.target.nextSibling) {
372
443
  var _document$getElementB, _document$getElementB2;
444
+
373
445
  // Focus on parent, next item is child
374
446
  if ((_document$getElementB = document.getElementById(event.target.dataset.group)) === null || _document$getElementB === void 0 ? void 0 : (_document$getElementB2 = _document$getElementB.nextSibling) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.nextSibling) {
375
447
  document.getElementById(event.target.dataset.group).nextSibling.nextSibling.focus();
@@ -387,13 +459,15 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
387
459
  }
388
460
  }
389
461
  };
390
- // Key down on search input
462
+
391
463
  _this.handleKeyDownSearch = function (event) {
392
464
  var key = (0, _keycode.default)(event);
465
+
393
466
  if (_this.overlay && (key === 'down' || key === 'up')) {
394
467
  _this.focusOnFirstItem();
395
468
  } else if (_this.overlay && (key === 'esc' || key === 'enter')) {
396
469
  event.preventDefault();
470
+
397
471
  _this.handleClose();
398
472
  } else if (key === 'tab') {
399
473
  _this.setState({
@@ -401,32 +475,21 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
401
475
  });
402
476
  }
403
477
  };
404
- /**
405
- * Call onScrollReachBottom
406
- * @param e
407
- */
478
+
408
479
  _this.handleScroll = function (e) {
409
480
  if (e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop < 15) {
410
481
  _this.props.onScrollReachBottom();
411
482
  }
412
483
  };
413
- /**
414
- * Call onChange with the updated value
415
- *
416
- * - handle single value
417
- * - handle multiple value
418
- * - handle '_all' id
419
- *
420
- * @param event
421
- * @param item
422
- */
484
+
423
485
  _this.handleSelect = function (event, item) {
424
486
  var _this$props2 = _this.props,
425
- hasAll = _this$props2.hasAll,
426
- multiple = _this$props2.multiple,
427
- onChange = _this$props2.onChange,
428
- options = _this$props2.options,
429
- value = _this$props2.value;
487
+ hasAll = _this$props2.hasAll,
488
+ multiple = _this$props2.multiple,
489
+ onChange = _this$props2.onChange,
490
+ options = _this$props2.options,
491
+ value = _this$props2.value;
492
+
430
493
  if (!multiple) {
431
494
  // This is a fix to prevent select open after select => TODO improve ?
432
495
  setTimeout(function () {
@@ -458,17 +521,13 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
458
521
  onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
459
522
  }
460
523
  };
461
- /**
462
- * Update suggestions list
463
- * - add '_no_result' item if suggestion list is empty
464
- * - add '_all' item if suggestion list is complete
465
- * @param suggestions
466
- */
524
+
467
525
  _this.handleSuggestions = function (suggestions) {
468
526
  var _this$props3 = _this.props,
469
- hasAll = _this$props3.hasAll,
470
- iconAll = _this$props3.iconAll,
471
- translations = _this$props3.translations;
527
+ hasAll = _this$props3.hasAll,
528
+ iconAll = _this$props3.iconAll,
529
+ translations = _this$props3.translations;
530
+
472
531
  if (suggestions.length === 0) {
473
532
  // Add '_no_result' suggestion
474
533
  _this.setState(function (prevState) {
@@ -495,8 +554,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
495
554
  });
496
555
  }
497
556
  };
557
+
498
558
  _this.handleSearch = function (e, inputValue) {
499
559
  var searchValue = inputValue && e.target.value ? inputValue : e.target.value;
560
+
500
561
  if (_this.props.onSearch) {
501
562
  _this.props.onSearch(e, searchValue);
502
563
  } else {
@@ -505,6 +566,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
505
566
  });
506
567
  }
507
568
  };
569
+
508
570
  _this.handleSearchReset = function () {
509
571
  _this.handleSearch({
510
572
  target: {
@@ -512,11 +574,13 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
512
574
  }
513
575
  }, '');
514
576
  };
577
+
515
578
  _this.getLengthItemList = function (itemList) {
516
579
  var itemListLength = 0;
517
580
  itemList.forEach(function (parent) {
518
581
  if (parent.displayed !== false) {
519
582
  itemListLength += 1;
583
+
520
584
  if (parent.children) {
521
585
  itemListLength += _this.getLengthItemList(parent.children);
522
586
  }
@@ -524,9 +588,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
524
588
  });
525
589
  return itemListLength;
526
590
  };
591
+
527
592
  _this.renderScrollbarTrackHorizontal = function (props) {
528
593
  var style = props.style,
529
- otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
594
+ otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
530
595
  var inlineStyle = (0, _objectSpread2.default)({}, style, {
531
596
  zIndex: 10,
532
597
  right: 2,
@@ -538,9 +603,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
538
603
  style: inlineStyle
539
604
  }));
540
605
  };
606
+
541
607
  _this.renderScrollbarTrackVertical = function (props) {
542
608
  var style = props.style,
543
- otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
609
+ otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
544
610
  var inlineStyle = (0, _objectSpread2.default)({}, style, {
545
611
  zIndex: 10,
546
612
  right: 2,
@@ -552,6 +618,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
552
618
  style: inlineStyle
553
619
  }));
554
620
  };
621
+
555
622
  _this.state = {
556
623
  alertOpen: false,
557
624
  open: false,
@@ -563,12 +630,14 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
563
630
  };
564
631
  return _this;
565
632
  }
633
+
566
634
  (0, _createClass2.default)(HiSelect, [{
567
635
  key: "componentDidMount",
568
636
  value: function componentDidMount() {
569
637
  if (this.props.autoFocus) {
570
638
  this.inputEl.focus();
571
639
  }
640
+
572
641
  if (this.overlay) {
573
642
  this.setState({
574
643
  overlayWidth: (0, _reactDom.findDOMNode)(this.overlay).clientWidth
@@ -578,65 +647,76 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
578
647
  }, {
579
648
  key: "render",
580
649
  value: function render() {
581
- var _this2 = this;
650
+ var _classNames,
651
+ _this2 = this;
652
+
582
653
  var _this$props4 = this.props,
583
- alert = _this$props4.alert,
584
- classes = _this$props4.classes,
585
- disabled = _this$props4.disabled,
586
- error = _this$props4.error,
587
- loading = _this$props4.loading,
588
- options = _this$props4.options,
589
- searchable = _this$props4.searchable,
590
- displayAsChip = _this$props4.displayAsChip,
591
- type = _this$props4.type,
592
- value = _this$props4.value,
593
- multiple = _this$props4.multiple,
594
- translations = _this$props4.translations,
595
- hiSearchInputProps = _this$props4.hiSearchInputProps,
596
- hiSelectableListProps = _this$props4.hiSelectableListProps,
597
- hiSelectInputProps = _this$props4.hiSelectInputProps,
598
- id = _this$props4.id,
599
- onScrollReachBottom = _this$props4.onScrollReachBottom,
600
- onSubmit = _this$props4.onSubmit,
601
- placeholder = _this$props4.placeholder,
602
- _this$props4$searchVa = _this$props4.searchValue,
603
- searchValue = _this$props4$searchVa === void 0 ? this.state.searchValue : _this$props4$searchVa,
604
- startAdornment = _this$props4.startAdornment,
605
- staticPosition = _this$props4.staticPosition,
606
- maxOptionsDisplayed = _this$props4.maxOptionsDisplayed,
607
- _this$props4$buildSel = _this$props4.buildSelectProps,
608
- buildSelectProps = _this$props4$buildSel === void 0 ? this.buildSelectProps : _this$props4$buildSel;
654
+ alert = _this$props4.alert,
655
+ classes = _this$props4.classes,
656
+ disabled = _this$props4.disabled,
657
+ error = _this$props4.error,
658
+ loading = _this$props4.loading,
659
+ options = _this$props4.options,
660
+ searchable = _this$props4.searchable,
661
+ displayAsChip = _this$props4.displayAsChip,
662
+ type = _this$props4.type,
663
+ value = _this$props4.value,
664
+ multiple = _this$props4.multiple,
665
+ translations = _this$props4.translations,
666
+ hiSearchInputProps = _this$props4.hiSearchInputProps,
667
+ hiSelectableListProps = _this$props4.hiSelectableListProps,
668
+ hiSelectInputProps = _this$props4.hiSelectInputProps,
669
+ id = _this$props4.id,
670
+ onScrollReachBottom = _this$props4.onScrollReachBottom,
671
+ onSubmit = _this$props4.onSubmit,
672
+ placeholder = _this$props4.placeholder,
673
+ _this$props4$searchVa = _this$props4.searchValue,
674
+ searchValue = _this$props4$searchVa === void 0 ? this.state.searchValue : _this$props4$searchVa,
675
+ startAdornment = _this$props4.startAdornment,
676
+ staticPosition = _this$props4.staticPosition,
677
+ maxOptionsDisplayed = _this$props4.maxOptionsDisplayed,
678
+ _this$props4$buildSel = _this$props4.buildSelectProps,
679
+ buildSelectProps = _this$props4$buildSel === void 0 ? this.buildSelectProps : _this$props4$buildSel;
609
680
  var _this$state = this.state,
610
- alertOpen = _this$state.alertOpen,
611
- open = _this$state.open,
612
- focused = _this$state.focused;
681
+ alertOpen = _this$state.alertOpen,
682
+ open = _this$state.open,
683
+ focused = _this$state.focused;
684
+
613
685
  if (multiple) {
614
686
  if (!Array.isArray(value)) {
615
687
  throw new Error('HiPay Material-UI: the `value` property must be an array ' + 'when using the `HiSelect` component with `multiple`.');
616
688
  }
617
689
  }
690
+
618
691
  var selectedItemIdList = [];
692
+
619
693
  if (value) {
620
694
  selectedItemIdList = multiple ? (0, _toConsumableArray2.default)(value) : [value];
621
695
  }
696
+
622
697
  var _buildSelectProps = buildSelectProps(options, selectedItemIdList, searchValue, loading),
623
- itemList = _buildSelectProps.itemList,
624
- _buildSelectProps$inp = _buildSelectProps.inputValue,
625
- inputValue = _buildSelectProps$inp === void 0 ? this.buildInputValue(options, selectedItemIdList, loading) : _buildSelectProps$inp;
698
+ itemList = _buildSelectProps.itemList,
699
+ _buildSelectProps$inp = _buildSelectProps.inputValue,
700
+ inputValue = _buildSelectProps$inp === void 0 ? this.buildInputValue(options, selectedItemIdList, loading) : _buildSelectProps$inp;
701
+
626
702
  var popperStyle = {
627
703
  position: staticPosition ? 'relative' : 'fix',
628
704
  top: 0,
629
705
  left: 0
630
706
  };
707
+
631
708
  if (this.props.containerWidth > 0) {
632
709
  popperStyle = {
633
710
  width: this.props.containerWidth
634
711
  };
712
+
635
713
  if (!staticPosition) {
636
714
  popperStyle.position = 'absolute';
637
715
  }
638
716
  }
639
- var popperClass = (0, _classnames.default)(classes.popper, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, classes.popperWidth, !this.props.containerWidth), classes.popperRightAlign, this.props.containerWidth && this.props.align === 'right'));
717
+
718
+ var popperClass = (0, _classnames.default)(classes.popper, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.popperWidth, !this.props.containerWidth), (0, _defineProperty2.default)(_classNames, classes.popperRightAlign, this.props.containerWidth && this.props.align === 'right'), _classNames));
719
+
640
720
  var searchInput = function searchInput(position) {
641
721
  if (searchable) {
642
722
  return /*#__PURE__*/_react.default.createElement(_HiInput.default, (0, _extends2.default)({
@@ -652,24 +732,28 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
652
732
  className: (0, _classnames.default)((0, _defineProperty2.default)({}, classes.separator, position === 'top'))
653
733
  }, hiSearchInputProps));
654
734
  }
735
+
655
736
  return null;
656
- };
737
+ }; // Replace popper onSearch when popper displayed on top of selectButton
738
+
657
739
 
658
- // Replace popper onSearch when popper displayed on top of selectButton
659
740
  if (this.placement && this.placement.indexOf('top') >= 0 && !!searchable) {
660
741
  // In case we have a nested list
661
- var itemListLength = this.getLengthItemList(itemList);
662
- // +1 for search input
742
+ var itemListLength = this.getLengthItemList(itemList); // +1 for search input
743
+
663
744
  var nbItems = itemListLength <= maxOptionsDisplayed - 2 ? itemListLength + 1 : maxOptionsDisplayed - 1;
664
745
  popperStyle.transform = "translate3d(-1px, -".concat(nbItems * 40 + 2, "px, 0px)");
665
746
  } else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
666
747
  popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
667
748
  }
749
+
668
750
  var content = function content(_ref) {
669
751
  var placement = _ref.placement;
752
+
670
753
  if (placement !== _this2.placement) {
671
754
  _this2.placement = placement;
672
755
  }
756
+
673
757
  var nbItemsDisplayed = !!searchable ? maxOptionsDisplayed - 1 : maxOptionsDisplayed;
674
758
  var autoHeightMax = nbItemsDisplayed * 40 - 10;
675
759
  return /*#__PURE__*/_react.default.createElement(_ClickAwayListener.default, {
@@ -705,6 +789,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
705
789
  value: value
706
790
  }, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
707
791
  };
792
+
708
793
  return !_reactDeviceDetect.isMobile ? /*#__PURE__*/_react.default.createElement("div", {
709
794
  className: classes.root,
710
795
  ref: function ref(el) {
@@ -793,11 +878,22 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
793
878
  suggestions: nextProps.options
794
879
  });
795
880
  }
881
+
796
882
  return null;
797
883
  }
884
+ /**
885
+ * Build itemList & inputValue from select props
886
+ * @param options
887
+ * @param value
888
+ * @param search
889
+ * @param loading
890
+ * @returns {{itemList: *[], inputValue: *}}
891
+ */
892
+
798
893
  }]);
799
894
  return HiSelect;
800
895
  }(_react.default.PureComponent);
896
+
801
897
  HiSelect.defaultProps = {
802
898
  align: 'left',
803
899
  autoFocus: false,
@@ -825,7 +921,10 @@ HiSelect.defaultProps = {
825
921
  filterFunc: filterValue,
826
922
  maxOptionsDisplayed: 12
827
923
  };
828
- var _default = exports.default = (0, _withStyles.default)(styles, {
924
+
925
+ var _default = (0, _withStyles.default)(styles, {
829
926
  hiComponent: true,
830
927
  name: 'HmuiHiSelect'
831
- })(HiSelect);
928
+ })(HiSelect);
929
+
930
+ exports.default = _default;