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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,24 +1,40 @@
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
13
+
10
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
15
+
11
16
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
17
+
12
18
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
19
+
13
20
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
21
+
14
22
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
23
+
15
24
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
25
+
16
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
27
+
17
28
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
29
+
18
30
  var _react = _interopRequireDefault(require("react"));
31
+
19
32
  var _HiSelect = _interopRequireDefault(require("./HiSelect"));
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); }; }
21
- 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 HiSelect
35
+
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; } }
37
+
22
38
  /**
23
39
  * HiDynamicSelect hérite du composant HiSelect
24
40
  *
@@ -32,33 +48,31 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
32
48
  */
33
49
  var HiDynamicSelect = /*#__PURE__*/function (_React$PureComponent) {
34
50
  (0, _inherits2.default)(HiDynamicSelect, _React$PureComponent);
51
+
35
52
  var _super = _createSuper(HiDynamicSelect);
53
+
36
54
  function HiDynamicSelect(props) {
37
55
  var _this;
56
+
38
57
  (0, _classCallCheck2.default)(this, HiDynamicSelect);
39
58
  _this = _super.call(this, props);
59
+
40
60
  _this.handleScrollReachBottom = function () {
41
61
  if (!_this.props.loading && _this.props.nextPage === 'auto' && _this.props.onNextPage) {
42
62
  _this.props.onNextPage();
43
63
  }
44
64
  };
45
- /**
46
- * Call onChange with the updated value
47
- *
48
- * - handle single value
49
- * - handle multiple value
50
- *
51
- * @param event
52
- * @param item
53
- */
65
+
54
66
  _this.handleSelect = function (event, item) {
55
67
  var _this$props = _this.props,
56
- multiple = _this$props.multiple,
57
- onChange = _this$props.onChange,
58
- value = _this$props.value;
68
+ multiple = _this$props.multiple,
69
+ onChange = _this$props.onChange,
70
+ value = _this$props.value;
71
+
59
72
  if (item.id === '_next_page' && !_this.props.loading && _this.props.nextPage === 'manual' && _this.props.onNextPage) {
60
73
  _this.props.onNextPage();
61
74
  }
75
+
62
76
  if (!multiple) {
63
77
  // single value
64
78
  onChange(event, item.id, item);
@@ -71,22 +85,14 @@ var HiDynamicSelect = /*#__PURE__*/function (_React$PureComponent) {
71
85
  onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
72
86
  }
73
87
  };
74
- /**
75
- * Build itemList & inputValue from select props
76
- * @param options
77
- * @param value
78
- * @param search
79
- * @param loading
80
- * @returns {{itemList: *[], inputValue: *}}
81
- */
82
- // eslint-disable-next-line no-unused-vars
88
+
83
89
  _this.buildSelectProps = function (options) {
84
90
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
85
91
  var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
86
92
  var loading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
87
93
  var _this$props2 = _this.props,
88
- nextPage = _this$props2.nextPage,
89
- translations = _this$props2.translations;
94
+ nextPage = _this$props2.nextPage,
95
+ translations = _this$props2.translations;
90
96
  var itemList = [].concat((0, _toConsumableArray2.default)(options.length === 0 && !loading ? [{
91
97
  id: '_no_result',
92
98
  type: 'text',
@@ -112,21 +118,23 @@ var HiDynamicSelect = /*#__PURE__*/function (_React$PureComponent) {
112
118
  itemList: itemList
113
119
  };
114
120
  };
121
+
115
122
  _this.handleScrollReachBottom = _this.handleScrollReachBottom.bind((0, _assertThisInitialized2.default)(_this));
116
123
  _this.handleSelect = _this.handleSelect.bind((0, _assertThisInitialized2.default)(_this));
117
124
  return _this;
118
125
  }
126
+
119
127
  (0, _createClass2.default)(HiDynamicSelect, [{
120
128
  key: "render",
121
129
  value: function render() {
122
130
  var _this$props3 = this.props,
123
- hiSelectableListProps = _this$props3.hiSelectableListProps,
124
- multiple = _this$props3.multiple,
125
- nextPage = _this$props3.nextPage,
126
- options = _this$props3.options,
127
- translations = _this$props3.translations,
128
- value = _this$props3.value,
129
- other = (0, _objectWithoutProperties2.default)(_this$props3, ["hiSelectableListProps", "multiple", "nextPage", "options", "translations", "value"]);
131
+ hiSelectableListProps = _this$props3.hiSelectableListProps,
132
+ multiple = _this$props3.multiple,
133
+ nextPage = _this$props3.nextPage,
134
+ options = _this$props3.options,
135
+ translations = _this$props3.translations,
136
+ value = _this$props3.value,
137
+ other = (0, _objectWithoutProperties2.default)(_this$props3, ["hiSelectableListProps", "multiple", "nextPage", "options", "translations", "value"]);
130
138
  return /*#__PURE__*/_react.default.createElement(_HiSelect.default, (0, _extends2.default)({
131
139
  buildSelectProps: this.buildSelectProps,
132
140
  hiSelectableListProps: (0, _objectSpread2.default)({}, hiSelectableListProps),
@@ -142,6 +150,7 @@ var HiDynamicSelect = /*#__PURE__*/function (_React$PureComponent) {
142
150
  }]);
143
151
  return HiDynamicSelect;
144
152
  }(_react.default.PureComponent);
153
+
145
154
  HiDynamicSelect.defaultProps = {
146
155
  loading: false,
147
156
  multiple: false,
@@ -156,4 +165,5 @@ HiDynamicSelect.defaultProps = {
156
165
  next_page: 'Load more'
157
166
  }
158
167
  };
159
- var _default = exports.default = HiDynamicSelect;
168
+ var _default = HiDynamicSelect;
169
+ exports.default = _default;
@@ -1,64 +1,85 @@
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
+
9
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
+
10
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
15
+
11
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
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("../HiForm/HiFormControl"));
27
+
17
28
  var _HiDynamicSelect = _interopRequireDefault(require("./HiDynamicSelect"));
29
+
18
30
  var _classnames = _interopRequireDefault(require("classnames"));
31
+
19
32
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
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); }; }
21
- 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 HiDynamicSelect
22
- var styles = exports.styles = {
35
+
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; } }
37
+
38
+ var styles = {
23
39
  root: {
24
40
  maxWidth: 500
25
41
  }
26
42
  };
27
-
28
43
  /**
29
44
  * Champs input pour formulaire
30
45
  */
46
+
47
+ exports.styles = styles;
48
+
31
49
  var HiDynamicSelectField = /*#__PURE__*/function (_React$PureComponent) {
32
50
  (0, _inherits2.default)(HiDynamicSelectField, _React$PureComponent);
51
+
33
52
  var _super = _createSuper(HiDynamicSelectField);
53
+
34
54
  function HiDynamicSelectField() {
35
55
  (0, _classCallCheck2.default)(this, HiDynamicSelectField);
36
56
  return _super.apply(this, arguments);
37
57
  }
58
+
38
59
  (0, _createClass2.default)(HiDynamicSelectField, [{
39
60
  key: "render",
40
61
  value: function render() {
41
62
  var _this$props = this.props,
42
- label = _this$props.label,
43
- required = _this$props.required,
44
- disabled = _this$props.disabled,
45
- error = _this$props.error,
46
- errorText = _this$props.errorText,
47
- helperText = _this$props.helperText,
48
- helperIcon = _this$props.helperIcon,
49
- id = _this$props.id,
50
- name = _this$props.name,
51
- value = _this$props.value,
52
- options = _this$props.options,
53
- type = _this$props.type,
54
- multiple = _this$props.multiple,
55
- iconAll = _this$props.iconAll,
56
- checkbox = _this$props.checkbox,
57
- searchable = _this$props.searchable,
58
- translations = _this$props.translations,
59
- className = _this$props.className,
60
- classes = _this$props.classes,
61
- others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "classes"]);
63
+ label = _this$props.label,
64
+ required = _this$props.required,
65
+ disabled = _this$props.disabled,
66
+ error = _this$props.error,
67
+ errorText = _this$props.errorText,
68
+ helperText = _this$props.helperText,
69
+ helperIcon = _this$props.helperIcon,
70
+ id = _this$props.id,
71
+ name = _this$props.name,
72
+ value = _this$props.value,
73
+ options = _this$props.options,
74
+ type = _this$props.type,
75
+ multiple = _this$props.multiple,
76
+ iconAll = _this$props.iconAll,
77
+ checkbox = _this$props.checkbox,
78
+ searchable = _this$props.searchable,
79
+ translations = _this$props.translations,
80
+ className = _this$props.className,
81
+ classes = _this$props.classes,
82
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "classes"]);
62
83
  return /*#__PURE__*/_react.default.createElement(_HiFormControl.default, {
63
84
  id: id,
64
85
  label: label,
@@ -87,4 +108,7 @@ var HiDynamicSelectField = /*#__PURE__*/function (_React$PureComponent) {
87
108
  }]);
88
109
  return HiDynamicSelectField;
89
110
  }(_react.default.PureComponent);
90
- var _default = exports.default = (0, _withStyles.default)(styles)(HiDynamicSelectField);
111
+
112
+ var _default = (0, _withStyles.default)(styles)(HiDynamicSelectField);
113
+
114
+ exports.default = _default;
@@ -1,27 +1,46 @@
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.filterValue = exports.default = void 0;
9
+
8
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
+
9
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
+
10
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
15
+
11
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
17
+
12
18
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
27
+
17
28
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
29
+
18
30
  var _react = _interopRequireDefault(require("react"));
31
+
19
32
  var _HiSelect = _interopRequireDefault(require("./HiSelect"));
33
+
20
34
  var _HiIcon = _interopRequireDefault(require("../HiIcon"));
35
+
21
36
  var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
37
+
22
38
  var _helpers = require("../utils/helpers");
39
+
23
40
  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); }; }
24
- 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 HiSelect
41
+
42
+ 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; } }
43
+
25
44
  /**
26
45
  * Return array of final item id in nested list (via props chlidren)
27
46
  * @param itemList
@@ -34,16 +53,18 @@ function getRecursiveFinalItemIdList(itemList) {
34
53
  if (item.children) {
35
54
  return getRecursiveFinalItemIdList(item.children, memo);
36
55
  }
56
+
37
57
  return [].concat((0, _toConsumableArray2.default)(memo), [item.id]);
38
58
  }, [])));
39
59
  }
40
-
41
60
  /**
42
61
  * Find item by id in nested list (via props children)
43
62
  * @param itemList
44
63
  * @param searchId
45
64
  * @returns {boolean}
46
65
  */
66
+
67
+
47
68
  function findFinalItemRecursively(itemList, searchId) {
48
69
  var foundItem = false;
49
70
  itemList.some(function (item) {
@@ -52,14 +73,15 @@ function findFinalItemRecursively(itemList, searchId) {
52
73
  } else if (item.children && !foundItem) {
53
74
  foundItem = findFinalItemRecursively(item.children, searchId);
54
75
  }
76
+
55
77
  return foundItem !== false;
56
78
  });
57
79
  return foundItem;
58
80
  }
59
- var filterValue = exports.filterValue = function filterValue(item, searchValue) {
81
+
82
+ var filterValue = function filterValue(item, searchValue) {
60
83
  return searchValue === '' || (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(searchValue.toLowerCase())) !== -1;
61
84
  };
62
-
63
85
  /**
64
86
  * Build item list by settings item props relative to the nested parent/child situation
65
87
  * Reduce the item list to build specified items (displayed, pinned, disabled, selected, indeterminate)
@@ -76,6 +98,10 @@ var filterValue = exports.filterValue = function filterValue(item, searchValue)
76
98
  * @param translations - Translations
77
99
  * @returns {*}
78
100
  */
101
+
102
+
103
+ exports.filterValue = filterValue;
104
+
79
105
  function buildFilteredItemList(itemList) {
80
106
  var selectedItemIdList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
81
107
  var searchValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
@@ -87,24 +113,27 @@ function buildFilteredItemList(itemList) {
87
113
  var filterFunc = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : filterValue;
88
114
  return itemList.reduce(function (_ref, item) {
89
115
  var memoItemList = _ref.l,
90
- memoSelected = _ref.s,
91
- memoUnselected = _ref.u,
92
- memoVisible = _ref.v;
93
- var itemVisible = filterFunc(item, searchValue);
94
- // Parent item
116
+ memoSelected = _ref.s,
117
+ memoUnselected = _ref.u,
118
+ memoVisible = _ref.v;
119
+ var itemVisible = filterFunc(item, searchValue); // Parent item
120
+
95
121
  if (item.children) {
96
122
  var _buildFilteredItemLis = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent, nbChildrenAsInfo, translations, filterFunc),
97
- customizedChildren = _buildFilteredItemLis.l,
98
- selected = _buildFilteredItemLis.s,
99
- unselected = _buildFilteredItemLis.u,
100
- visible = _buildFilteredItemLis.v;
123
+ customizedChildren = _buildFilteredItemLis.l,
124
+ selected = _buildFilteredItemLis.s,
125
+ unselected = _buildFilteredItemLis.u,
126
+ visible = _buildFilteredItemLis.v;
127
+
101
128
  if (nbChildrenAsInfo) {
102
129
  item.info = translations.n_children.replace('%s', item.children.length);
103
130
  }
131
+
104
132
  return {
105
133
  l: [].concat((0, _toConsumableArray2.default)(memoItemList), [(0, _objectSpread2.default)({}, item, {}, disabledParent && {
106
134
  disabled: true,
107
135
  hideCheckbox: true // don't display checkbox on disabled parent
136
+
108
137
  }, {
109
138
  pinned: pinnedParent,
110
139
  children: customizedChildren,
@@ -117,6 +146,7 @@ function buildFilteredItemList(itemList) {
117
146
  v: memoVisible || itemVisible || visible
118
147
  };
119
148
  }
149
+
120
150
  var itemSelected = selectedItemIdList.includes(item.id);
121
151
  return {
122
152
  l: [].concat((0, _toConsumableArray2.default)(memoItemList), [(0, _objectSpread2.default)({
@@ -133,7 +163,8 @@ function buildFilteredItemList(itemList) {
133
163
  v: visibleParent
134
164
  });
135
165
  }
136
- var styles = exports.styles = function styles(theme) {
166
+
167
+ var styles = function styles(theme) {
137
168
  return {
138
169
  root: {
139
170
  backgroundColor: theme.palette.background2,
@@ -175,7 +206,6 @@ var styles = exports.styles = function styles(theme) {
175
206
  })
176
207
  };
177
208
  };
178
-
179
209
  /**
180
210
  * HiNestedSelect hérite du composant HiSelect
181
211
  *
@@ -188,36 +218,36 @@ var styles = exports.styles = function styles(theme) {
188
218
  * - si une partie des enfants sont sélectionné, le parent est affiché "indeterminate".
189
219
  * - si aucun enfant n'est sélectionné, le parent est affiché "unselected".
190
220
  */
221
+
222
+
223
+ exports.styles = styles;
224
+
191
225
  var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
192
226
  (0, _inherits2.default)(HiNestedSelect, _React$PureComponent);
227
+
193
228
  var _super = _createSuper(HiNestedSelect);
229
+
194
230
  function HiNestedSelect(props) {
195
231
  var _this;
232
+
196
233
  (0, _classCallCheck2.default)(this, HiNestedSelect);
197
234
  _this = _super.call(this, props);
198
- /**
199
- * Call onChange with the updated value
200
- *
201
- * - handle single value
202
- * - handle multiple value
203
- * - handle '_all' id
204
- *
205
- * @param event
206
- * @param item
207
- */
235
+
208
236
  _this.handleSelect = function (event, item) {
209
237
  var _this$props = _this.props,
210
- hasAll = _this$props.hasAll,
211
- multiple = _this$props.multiple,
212
- onChange = _this$props.onChange,
213
- options = _this$props.options,
214
- value = _this$props.value;
238
+ hasAll = _this$props.hasAll,
239
+ multiple = _this$props.multiple,
240
+ onChange = _this$props.onChange,
241
+ options = _this$props.options,
242
+ value = _this$props.value;
243
+
215
244
  if (!multiple) {
216
245
  // single value
217
246
  onChange(event, item.id, item);
218
247
  } else if (hasAll && item.id === '_all') {
219
248
  // ALL
220
249
  var selectableItemIdList = getRecursiveFinalItemIdList(options);
250
+
221
251
  if (value.length === selectableItemIdList.length) {
222
252
  // unselect _all options
223
253
  onChange(event, [], item);
@@ -227,8 +257,8 @@ var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
227
257
  }
228
258
  } else if (item.children) {
229
259
  // PARENT
230
- var parentSelectableItemIdList = getRecursiveFinalItemIdList(item.children);
231
- // deselect parent if every selectable child id is includes in value.
260
+ var parentSelectableItemIdList = getRecursiveFinalItemIdList(item.children); // deselect parent if every selectable child id is includes in value.
261
+
232
262
  if (parentSelectableItemIdList.every(function (pid) {
233
263
  return value.includes(pid);
234
264
  })) {
@@ -250,33 +280,28 @@ var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
250
280
  onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
251
281
  }
252
282
  };
253
- /**
254
- * Build itemList & inputValue from select props
255
- * @param options
256
- * @param value
257
- * @param search
258
- * @param loading
259
- * @returns {{itemList: *[], inputValue: *}}
260
- */
283
+
261
284
  _this.buildSelectProps = function (options) {
262
285
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
263
286
  var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
264
287
  var loading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
265
288
  var _this$props2 = _this.props,
266
- classes = _this$props2.classes,
267
- disabledParent = _this$props2.disabledParent,
268
- hasAll = _this$props2.hasAll,
269
- iconAll = _this$props2.iconAll,
270
- multiple = _this$props2.multiple,
271
- nbChildrenAsInfo = _this$props2.nbChildrenAsInfo,
272
- pinnedParent = _this$props2.pinnedParent,
273
- translations = _this$props2.translations,
274
- filterFunc = _this$props2.filterFunc; // build item list
289
+ classes = _this$props2.classes,
290
+ disabledParent = _this$props2.disabledParent,
291
+ hasAll = _this$props2.hasAll,
292
+ iconAll = _this$props2.iconAll,
293
+ multiple = _this$props2.multiple,
294
+ nbChildrenAsInfo = _this$props2.nbChildrenAsInfo,
295
+ pinnedParent = _this$props2.pinnedParent,
296
+ translations = _this$props2.translations,
297
+ filterFunc = _this$props2.filterFunc; // build item list
298
+
275
299
  var _buildFilteredItemLis2 = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations, filterFunc),
276
- filteredItemList = _buildFilteredItemLis2.l,
277
- allSelected = _buildFilteredItemLis2.s,
278
- allUnselected = _buildFilteredItemLis2.u,
279
- visible = _buildFilteredItemLis2.v;
300
+ filteredItemList = _buildFilteredItemLis2.l,
301
+ allSelected = _buildFilteredItemLis2.s,
302
+ allUnselected = _buildFilteredItemLis2.u,
303
+ visible = _buildFilteredItemLis2.v;
304
+
280
305
  var itemList = !visible ? (0, _toConsumableArray2.default)(loading ? [{
281
306
  id: '_loading',
282
307
  type: 'loader',
@@ -305,16 +330,17 @@ var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
305
330
  selected: allSelected,
306
331
  indeterminate: !allSelected && !allUnselected,
307
332
  displayed: search === ''
308
- }] : []), (0, _toConsumableArray2.default)(filteredItemList));
333
+ }] : []), (0, _toConsumableArray2.default)(filteredItemList)); // build input value
309
334
 
310
- // build input value
311
335
  var inputValue = '';
336
+
312
337
  if (allSelected) {
313
338
  inputValue = translations.all;
314
339
  } else if (value.length > 1) {
315
340
  inputValue = translations.n_items_selected.replace('%s', value.length);
316
341
  } else if (value.length === 1) {
317
342
  var selectedItem = findFinalItemRecursively(options, value[0]);
343
+
318
344
  if (selectedItem === false) {
319
345
  inputValue = translations.one_item_selected;
320
346
  } else if (selectedItem.type === 'icon') {
@@ -336,31 +362,47 @@ var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
336
362
  inputValue = selectedItem.label;
337
363
  }
338
364
  }
365
+
339
366
  return {
340
367
  itemList: itemList,
341
368
  inputValue: inputValue
342
369
  };
343
370
  };
371
+
344
372
  _this.handleSelect = _this.handleSelect.bind((0, _assertThisInitialized2.default)(_this));
345
373
  return _this;
346
374
  }
375
+ /**
376
+ * Call onChange with the updated value
377
+ *
378
+ * - handle single value
379
+ * - handle multiple value
380
+ * - handle '_all' id
381
+ *
382
+ * @param event
383
+ * @param item
384
+ */
385
+
386
+
347
387
  (0, _createClass2.default)(HiNestedSelect, [{
348
388
  key: "render",
349
389
  value: function render() {
350
390
  var _this$props3 = this.props,
351
- hasAll = _this$props3.hasAll,
352
- hiSelectableListProps = _this$props3.hiSelectableListProps,
353
- multiple = _this$props3.multiple,
354
- options = _this$props3.options,
355
- searchable = _this$props3.searchable,
356
- translations = _this$props3.translations,
357
- value = _this$props3.value,
358
- other = (0, _objectWithoutProperties2.default)(_this$props3, ["hasAll", "hiSelectableListProps", "multiple", "options", "searchable", "translations", "value"]);
391
+ hasAll = _this$props3.hasAll,
392
+ hiSelectableListProps = _this$props3.hiSelectableListProps,
393
+ multiple = _this$props3.multiple,
394
+ options = _this$props3.options,
395
+ searchable = _this$props3.searchable,
396
+ translations = _this$props3.translations,
397
+ value = _this$props3.value,
398
+ other = (0, _objectWithoutProperties2.default)(_this$props3, ["hasAll", "hiSelectableListProps", "multiple", "options", "searchable", "translations", "value"]);
399
+
359
400
  if (multiple) {
360
401
  if (!Array.isArray(value)) {
361
402
  throw new Error('HiPay Material-UI: the `value` property must be an array ' + 'when using the `HiSelect` component with `multiple`.');
362
403
  }
363
404
  }
405
+
364
406
  return /*#__PURE__*/_react.default.createElement(_HiSelect.default, (0, _extends2.default)({
365
407
  buildSelectProps: this.buildSelectProps,
366
408
  hasAll: hasAll,
@@ -377,6 +419,7 @@ var HiNestedSelect = /*#__PURE__*/function (_React$PureComponent) {
377
419
  }]);
378
420
  return HiNestedSelect;
379
421
  }(_react.default.PureComponent);
422
+
380
423
  HiNestedSelect.defaultProps = {
381
424
  disabledParent: false,
382
425
  displayAsChip: false,
@@ -395,7 +438,10 @@ HiNestedSelect.defaultProps = {
395
438
  },
396
439
  filterFunc: filterValue
397
440
  };
398
- var _default = exports.default = (0, _withStyles.default)(styles, {
441
+
442
+ var _default = (0, _withStyles.default)(styles, {
399
443
  hiComponent: true,
400
444
  name: 'HmuiHiNestedSelect'
401
- })(HiNestedSelect);
445
+ })(HiNestedSelect);
446
+
447
+ exports.default = _default;