@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.
- package/HiAccordion/HiAccordion.js +26 -8
- package/HiAccordion/index.js +5 -1
- package/HiAccordionActions/HiAccordionActions.js +14 -1
- package/HiAccordionActions/index.js +5 -1
- package/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/HiAccordionSummary/index.js +5 -1
- package/HiAlertModal/HiAlertModal.js +22 -7
- package/HiAlertModal/index.js +5 -1
- package/HiAppBar/HiAppBar.js +42 -11
- package/HiAppBar/index.js +2 -0
- package/HiAvatar/HiAvatar.js +12 -3
- package/HiAvatar/index.js +2 -0
- package/HiBadge/HiBadge.js +24 -8
- package/HiBadge/index.js +2 -0
- package/HiBreadcrumb/HiBreadcrumb.js +30 -6
- package/HiBreadcrumb/HiStep.js +45 -13
- package/HiBreadcrumb/HiStepConnector.js +49 -14
- package/HiBreadcrumb/HiStepContent.js +30 -6
- package/HiBreadcrumb/HiStepIcon.js +35 -10
- package/HiBreadcrumb/HiStepLabel.js +44 -14
- package/HiBreadcrumb/HiStepper.js +30 -6
- package/HiBreadcrumb/index.js +2 -0
- package/HiButton/HiButton.js +33 -8
- package/HiButton/index.js +5 -1
- package/HiCell/CellAddress.js +33 -12
- package/HiCell/CellDate.js +36 -10
- package/HiCell/CellHiddenContent.js +30 -8
- package/HiCell/CellIcon.js +36 -12
- package/HiCell/CellImage.js +34 -12
- package/HiCell/CellNumeric.js +40 -13
- package/HiCell/CellPinToAction.js +33 -9
- package/HiCell/CellRate.js +47 -13
- package/HiCell/CellSentinel.js +33 -12
- package/HiCell/CellSentinelScore.js +31 -9
- package/HiCell/CellText.js +52 -16
- package/HiCell/CellTextStyled.js +24 -13
- package/HiCell/index.js +10 -0
- package/HiCheckbox/HiCheckbox.js +52 -15
- package/HiCheckbox/index.js +2 -0
- package/HiChip/HiChip.js +47 -24
- package/HiChip/HiChipSwitch.js +59 -16
- package/HiChip/index.js +3 -0
- package/HiColoredLabel/HiColoredLabel.js +49 -15
- package/HiColoredLabel/index.js +2 -0
- package/HiDatePicker/Caption.js +21 -9
- package/HiDatePicker/HiDatePicker.js +88 -16
- package/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/HiDatePicker/HiDateRangePicker.js +134 -38
- package/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/HiDatePicker/ListPicker.js +38 -8
- package/HiDatePicker/NavBar.js +31 -12
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
- package/HiDatePicker/Overlays/Overlay.js +25 -8
- package/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- package/HiDatePicker/Overlays/index.js +6 -0
- package/HiDatePicker/Weekday.js +9 -4
- package/HiDatePicker/hiLocaleUtils.js +20 -8
- package/HiDatePicker/index.js +2 -0
- package/HiDatePicker/stylesheet.js +13 -7
- package/HiDialog/HiDialog.js +19 -7
- package/HiDialog/index.js +2 -0
- package/HiDotsStepper/HiDot.js +37 -8
- package/HiDotsStepper/HiDotsStepper.js +37 -10
- package/HiDotsStepper/index.js +3 -0
- package/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/HiExpansionPanel/index.js +5 -1
- package/HiForm/HiAddressField.js +36 -10
- package/HiForm/HiEmailField.js +29 -5
- package/HiForm/HiFormControl.js +74 -28
- package/HiForm/HiFormLabel.js +41 -15
- package/HiForm/HiInput.js +91 -33
- package/HiForm/HiPasswordField.js +46 -9
- package/HiForm/HiSearchField.js +34 -3
- package/HiForm/HiSlider.js +57 -22
- package/HiForm/HiTextField.js +47 -22
- package/HiForm/HiUpload.js +89 -29
- package/HiForm/HiUploadField.js +32 -10
- package/HiForm/HiUploadInput.js +76 -23
- package/HiForm/index.js +12 -0
- package/HiIcon/HiIcon.js +34 -9
- package/HiIcon/index.js +2 -0
- package/HiIconButton/HiIconButton.js +21 -6
- package/HiIconButton/index.js +2 -0
- package/HiListItemLink/HiListItemLink.js +19 -7
- package/HiListItemLink/index.js +2 -0
- package/HiLoader/HiLoader.js +16 -6
- package/HiLoader/index.js +2 -0
- package/HiNotice/HiKPI.js +47 -16
- package/HiNotice/HiKPINotice.js +16 -6
- package/HiNotice/index.js +3 -0
- package/HiPagination/HiPagination.js +11 -1
- package/HiPagination/index.js +2 -0
- package/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/HiPaymentMeans/index.js +2 -0
- package/HiPdfReader/HiPdfReader.js +57 -24
- package/HiPdfReader/index.js +2 -0
- package/HiPin/HiPin.js +19 -7
- package/HiPin/index.js +2 -0
- package/HiRadio/HiRadio.js +22 -11
- package/HiRadio/index.js +2 -0
- package/HiScrollStepper/HiScrollStepper.js +67 -29
- package/HiScrollStepper/index.js +2 -0
- package/HiSelect/HiDynamicSelect.js +42 -32
- package/HiSelect/HiDynamicSelectField.js +48 -24
- package/HiSelect/HiNestedSelect.js +111 -65
- package/HiSelect/HiNestedSelectContent.js +86 -60
- package/HiSelect/HiNestedSelectField.js +48 -24
- package/HiSelect/HiSelect.js +187 -89
- package/HiSelect/HiSelectContent.js +97 -62
- package/HiSelect/HiSelectField.js +49 -25
- package/HiSelect/HiSelectInput.js +76 -23
- package/HiSelect/HiSelectMobile.js +44 -7
- package/HiSelect/HiSuggestSelect.js +81 -25
- package/HiSelect/HiSuggestSelectField.js +39 -15
- package/HiSelect/index.js +14 -2
- package/HiSelectableList/HiSelectableList.js +90 -34
- package/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- package/HiSelectableList/HiSelectableListItem.js +88 -45
- package/HiSelectableList/index.js +4 -0
- package/HiStepper/DefaultIndicator.js +10 -1
- package/HiStepper/HiStep.js +48 -18
- package/HiStepper/HiStepper.js +15 -2
- package/HiStepper/index.js +3 -0
- package/HiSwitch/HiSwitch.js +33 -9
- package/HiSwitch/HiSwitchState.js +32 -15
- package/HiSwitch/index.js +3 -0
- package/HiTable/HiCellBuilder.js +65 -10
- package/HiTable/HiTable.js +48 -20
- package/HiTable/HiTableBody.js +24 -7
- package/HiTable/HiTableHeader.js +51 -18
- package/HiTable/HiTableRow.js +46 -12
- package/HiTable/constants.js +98 -48
- package/HiTable/index.js +2 -0
- package/es/HiAccordion/HiAccordion.js +26 -8
- package/es/HiAccordion/index.js +5 -1
- package/es/HiAccordionActions/HiAccordionActions.js +14 -1
- package/es/HiAccordionActions/index.js +5 -1
- package/es/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/es/HiAccordionSummary/index.js +5 -1
- package/es/HiAlertModal/HiAlertModal.js +22 -7
- package/es/HiAlertModal/index.js +5 -1
- package/es/HiAppBar/HiAppBar.js +42 -11
- package/es/HiAppBar/index.js +2 -0
- package/es/HiAvatar/HiAvatar.js +12 -3
- package/es/HiAvatar/index.js +2 -0
- package/es/HiBadge/HiBadge.js +24 -8
- package/es/HiBadge/index.js +2 -0
- package/es/HiBreadcrumb/HiBreadcrumb.js +30 -6
- package/es/HiBreadcrumb/HiStep.js +45 -13
- package/es/HiBreadcrumb/HiStepConnector.js +49 -14
- package/es/HiBreadcrumb/HiStepContent.js +30 -6
- package/es/HiBreadcrumb/HiStepIcon.js +35 -10
- package/es/HiBreadcrumb/HiStepLabel.js +44 -14
- package/es/HiBreadcrumb/HiStepper.js +30 -6
- package/es/HiBreadcrumb/index.js +2 -0
- package/es/HiButton/HiButton.js +33 -8
- package/es/HiButton/index.js +5 -1
- package/es/HiCell/CellAddress.js +33 -12
- package/es/HiCell/CellDate.js +36 -10
- package/es/HiCell/CellHiddenContent.js +30 -8
- package/es/HiCell/CellIcon.js +36 -12
- package/es/HiCell/CellImage.js +34 -12
- package/es/HiCell/CellNumeric.js +40 -13
- package/es/HiCell/CellPinToAction.js +33 -9
- package/es/HiCell/CellRate.js +47 -13
- package/es/HiCell/CellSentinel.js +33 -12
- package/es/HiCell/CellSentinelScore.js +31 -9
- package/es/HiCell/CellText.js +52 -16
- package/es/HiCell/CellTextStyled.js +24 -13
- package/es/HiCell/index.js +10 -0
- package/es/HiCheckbox/HiCheckbox.js +52 -15
- package/es/HiCheckbox/index.js +2 -0
- package/es/HiChip/HiChip.js +47 -24
- package/es/HiChip/HiChipSwitch.js +59 -16
- package/es/HiChip/index.js +3 -0
- package/es/HiColoredLabel/HiColoredLabel.js +49 -15
- package/es/HiColoredLabel/index.js +2 -0
- package/es/HiDatePicker/Caption.js +21 -9
- package/es/HiDatePicker/HiDatePicker.js +88 -16
- package/es/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/es/HiDatePicker/HiDateRangePicker.js +134 -38
- package/es/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/es/HiDatePicker/ListPicker.js +38 -8
- package/es/HiDatePicker/NavBar.js +31 -12
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
- package/es/HiDatePicker/Overlays/Overlay.js +25 -8
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- package/es/HiDatePicker/Overlays/index.js +6 -0
- package/es/HiDatePicker/Weekday.js +9 -4
- package/es/HiDatePicker/hiLocaleUtils.js +20 -8
- package/es/HiDatePicker/index.js +2 -0
- package/es/HiDatePicker/stylesheet.js +13 -7
- package/es/HiDialog/HiDialog.js +19 -7
- package/es/HiDialog/index.js +2 -0
- package/es/HiDotsStepper/HiDot.js +37 -8
- package/es/HiDotsStepper/HiDotsStepper.js +37 -10
- package/es/HiDotsStepper/index.js +3 -0
- package/es/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/es/HiExpansionPanel/index.js +5 -1
- package/es/HiForm/HiAddressField.js +36 -10
- package/es/HiForm/HiEmailField.js +29 -5
- package/es/HiForm/HiFormControl.js +74 -28
- package/es/HiForm/HiFormLabel.js +41 -15
- package/es/HiForm/HiInput.js +91 -33
- package/es/HiForm/HiPasswordField.js +46 -9
- package/es/HiForm/HiSearchField.js +34 -3
- package/es/HiForm/HiSlider.js +57 -22
- package/es/HiForm/HiTextField.js +47 -22
- package/es/HiForm/HiUpload.js +89 -29
- package/es/HiForm/HiUploadField.js +32 -10
- package/es/HiForm/HiUploadInput.js +76 -23
- package/es/HiForm/index.js +12 -0
- package/es/HiIcon/HiIcon.js +34 -9
- package/es/HiIcon/index.js +2 -0
- package/es/HiIconButton/HiIconButton.js +21 -6
- package/es/HiIconButton/index.js +2 -0
- package/es/HiListItemLink/HiListItemLink.js +19 -7
- package/es/HiListItemLink/index.js +2 -0
- package/es/HiLoader/HiLoader.js +16 -6
- package/es/HiLoader/index.js +2 -0
- package/es/HiNotice/HiKPI.js +47 -16
- package/es/HiNotice/HiKPINotice.js +16 -6
- package/es/HiNotice/index.js +3 -0
- package/es/HiPagination/HiPagination.js +11 -1
- package/es/HiPagination/index.js +2 -0
- package/es/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/es/HiPaymentMeans/index.js +2 -0
- package/es/HiPdfReader/HiPdfReader.js +57 -24
- package/es/HiPdfReader/index.js +2 -0
- package/es/HiPin/HiPin.js +19 -7
- package/es/HiPin/index.js +2 -0
- package/es/HiRadio/HiRadio.js +22 -11
- package/es/HiRadio/index.js +2 -0
- package/es/HiScrollStepper/HiScrollStepper.js +67 -29
- package/es/HiScrollStepper/index.js +2 -0
- package/es/HiSelect/HiDynamicSelect.js +42 -32
- package/es/HiSelect/HiDynamicSelectField.js +48 -24
- package/es/HiSelect/HiNestedSelect.js +111 -65
- package/es/HiSelect/HiNestedSelectContent.js +86 -60
- package/es/HiSelect/HiNestedSelectField.js +48 -24
- package/es/HiSelect/HiSelect.js +187 -89
- package/es/HiSelect/HiSelectContent.js +97 -62
- package/es/HiSelect/HiSelectField.js +49 -25
- package/es/HiSelect/HiSelectInput.js +76 -23
- package/es/HiSelect/HiSelectMobile.js +44 -7
- package/es/HiSelect/HiSuggestSelect.js +81 -25
- package/es/HiSelect/HiSuggestSelectField.js +39 -15
- package/es/HiSelect/index.js +14 -2
- package/es/HiSelectableList/HiSelectableList.js +90 -34
- package/es/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- package/es/HiSelectableList/HiSelectableListItem.js +88 -45
- package/es/HiSelectableList/index.js +4 -0
- package/es/HiStepper/DefaultIndicator.js +10 -1
- package/es/HiStepper/HiStep.js +48 -18
- package/es/HiStepper/HiStepper.js +15 -2
- package/es/HiStepper/index.js +3 -0
- package/es/HiSwitch/HiSwitch.js +33 -9
- package/es/HiSwitch/HiSwitchState.js +32 -15
- package/es/HiSwitch/index.js +3 -0
- package/es/HiTable/HiCellBuilder.js +65 -10
- package/es/HiTable/HiTable.js +48 -20
- package/es/HiTable/HiTableBody.js +24 -7
- package/es/HiTable/HiTableHeader.js +51 -18
- package/es/HiTable/HiTableRow.js +46 -12
- package/es/HiTable/constants.js +98 -48
- package/es/HiTable/index.js +2 -0
- package/es/hi-svg-icons/HiAccount.js +14 -4
- package/es/hi-svg-icons/HiActivity.js +14 -4
- package/es/hi-svg-icons/HiAll.js +18 -7
- package/es/hi-svg-icons/HiBilling.js +14 -4
- package/es/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/es/hi-svg-icons/HiBusiness.js +14 -4
- package/es/hi-svg-icons/HiCatalog.js +14 -4
- package/es/hi-svg-icons/HiCustomer.js +14 -4
- package/es/hi-svg-icons/HiDownload.js +14 -4
- package/es/hi-svg-icons/HiFinance.js +14 -4
- package/es/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/es/hi-svg-icons/HiIntegration.js +14 -4
- package/es/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/es/hi-svg-icons/HiIntelligence.js +14 -4
- package/es/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/es/hi-svg-icons/HiInvoice.js +14 -4
- package/es/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/es/hi-svg-icons/HiLogoRounded.js +17 -6
- package/es/hi-svg-icons/HiOrder.js +14 -4
- package/es/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/es/hi-svg-icons/HiPermission.js +14 -4
- package/es/hi-svg-icons/HiPriceGrid.js +14 -4
- package/es/hi-svg-icons/HiPrivate.js +14 -4
- package/es/hi-svg-icons/HiRoute.js +14 -4
- package/es/hi-svg-icons/HiRouteMenu.js +14 -4
- package/es/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/es/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/es/hi-svg-icons/HiSettlement.js +14 -4
- package/es/hi-svg-icons/HiSizeLarge.js +14 -4
- package/es/hi-svg-icons/HiSizeMedium.js +14 -4
- package/es/hi-svg-icons/HiSizeSmall.js +14 -4
- package/es/hi-svg-icons/HiStore.js +14 -4
- package/es/hi-svg-icons/HiStoreMenu.js +14 -4
- package/es/hi-svg-icons/HiTransaction.js +14 -4
- package/es/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/es/hi-svg-icons/HiUser.js +14 -4
- package/es/hi-svg-icons/HiVendor.js +14 -4
- package/es/hi-svg-icons/HiWidget.js +14 -4
- package/es/hi-svg-icons/index.js +41 -0
- package/es/hi-svg-images/HiLogo.js +12 -4
- package/es/hi-svg-images/HiLogoWhite.js +12 -4
- package/es/hi-svg-images/index.js +3 -0
- package/es/setupTest.js +13 -2
- package/es/styleguide/Wrapper.js +6 -0
- package/es/styles/MuiThemeProvider.js +49 -15
- package/es/styles/colorManipulator.js +50 -15
- package/es/styles/createBreakpoints.js +29 -14
- package/es/styles/createGenerateClassName.js +24 -14
- package/es/styles/createMixins.js +10 -4
- package/es/styles/createMuiTheme.js +28 -11
- package/es/styles/createPalette.js +89 -67
- package/es/styles/createStyles.js +1 -0
- package/es/styles/createTypography.js +24 -15
- package/es/styles/getStylesCreator.js +14 -1
- package/es/styles/getThemeProps.js +7 -2
- package/es/styles/index.js +6 -0
- package/es/styles/jssPreset.js +11 -1
- package/es/styles/makeStyles.js +9 -2
- package/es/styles/mergeClasses.js +16 -5
- package/es/styles/shadows.js +4 -1
- package/es/styles/shape.js +2 -1
- package/es/styles/spacing.js +4 -1
- package/es/styles/themeListener.js +10 -2
- package/es/styles/transitions.js +35 -20
- package/es/styles/withStyles.js +9 -2
- package/es/styles/zIndex.js +2 -1
- package/es/test-utils/createMount.js +12 -2
- package/es/test-utils/createRender.js +9 -2
- package/es/test-utils/createShallow.js +17 -6
- package/es/test-utils/getClasses.js +4 -1
- package/es/test-utils/index.js +6 -0
- package/es/test-utils/until.js +14 -3
- package/es/test-utils/unwrap.js +1 -0
- package/es/theme/palette.js +7 -2
- package/es/theme/typography.js +15 -7
- package/es/theme.js +8 -2
- package/es/transitions/utils.js +7 -3
- package/es/utils/exactProp.js +13 -3
- package/es/utils/helpers.js +58 -19
- package/es/withMobileDialog/index.js +2 -0
- package/es/withMobileDialog/withMobileDialog.js +12 -3
- package/hi-svg-icons/HiAccount.js +14 -4
- package/hi-svg-icons/HiActivity.js +14 -4
- package/hi-svg-icons/HiAll.js +18 -7
- package/hi-svg-icons/HiBilling.js +14 -4
- package/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/hi-svg-icons/HiBusiness.js +14 -4
- package/hi-svg-icons/HiCatalog.js +14 -4
- package/hi-svg-icons/HiCustomer.js +14 -4
- package/hi-svg-icons/HiDownload.js +14 -4
- package/hi-svg-icons/HiFinance.js +14 -4
- package/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/hi-svg-icons/HiIntegration.js +14 -4
- package/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/hi-svg-icons/HiIntelligence.js +14 -4
- package/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/hi-svg-icons/HiInvoice.js +14 -4
- package/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/hi-svg-icons/HiLogoRounded.js +17 -6
- package/hi-svg-icons/HiOrder.js +14 -4
- package/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/hi-svg-icons/HiPermission.js +14 -4
- package/hi-svg-icons/HiPriceGrid.js +14 -4
- package/hi-svg-icons/HiPrivate.js +14 -4
- package/hi-svg-icons/HiRoute.js +14 -4
- package/hi-svg-icons/HiRouteMenu.js +14 -4
- package/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/hi-svg-icons/HiSettlement.js +14 -4
- package/hi-svg-icons/HiSizeLarge.js +14 -4
- package/hi-svg-icons/HiSizeMedium.js +14 -4
- package/hi-svg-icons/HiSizeSmall.js +14 -4
- package/hi-svg-icons/HiStore.js +14 -4
- package/hi-svg-icons/HiStoreMenu.js +14 -4
- package/hi-svg-icons/HiTransaction.js +14 -4
- package/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/hi-svg-icons/HiUser.js +14 -4
- package/hi-svg-icons/HiVendor.js +14 -4
- package/hi-svg-icons/HiWidget.js +14 -4
- package/hi-svg-icons/index.js +41 -0
- package/hi-svg-images/HiLogo.js +12 -4
- package/hi-svg-images/HiLogoWhite.js +12 -4
- package/hi-svg-images/index.js +3 -0
- package/package.json +2 -2
- package/setupTest.js +13 -2
- package/styleguide/Wrapper.js +6 -0
- package/styles/MuiThemeProvider.js +49 -15
- package/styles/colorManipulator.js +50 -15
- package/styles/createBreakpoints.js +29 -14
- package/styles/createGenerateClassName.js +24 -14
- package/styles/createMixins.js +10 -4
- package/styles/createMuiTheme.js +28 -11
- package/styles/createPalette.js +89 -67
- package/styles/createStyles.js +1 -0
- package/styles/createTypography.js +24 -15
- package/styles/getStylesCreator.js +14 -1
- package/styles/getThemeProps.js +7 -2
- package/styles/index.js +6 -0
- package/styles/jssPreset.js +11 -1
- package/styles/makeStyles.js +9 -2
- package/styles/mergeClasses.js +16 -5
- package/styles/shadows.js +4 -1
- package/styles/shape.js +2 -1
- package/styles/spacing.js +4 -1
- package/styles/themeListener.js +10 -2
- package/styles/transitions.js +35 -20
- package/styles/withStyles.js +9 -2
- package/styles/zIndex.js +2 -1
- package/test-utils/createMount.js +12 -2
- package/test-utils/createRender.js +9 -2
- package/test-utils/createShallow.js +17 -6
- package/test-utils/getClasses.js +4 -1
- package/test-utils/index.js +6 -0
- package/test-utils/until.js +14 -3
- package/test-utils/unwrap.js +1 -0
- package/theme/palette.js +7 -2
- package/theme/typography.js +15 -7
- package/theme.js +8 -2
- package/transitions/utils.js +7 -3
- package/utils/exactProp.js +13 -3
- package/utils/helpers.js +58 -19
- package/withMobileDialog/index.js +2 -0
- package/withMobileDialog/withMobileDialog.js +12 -3
package/HiSelect/HiSelect.js
CHANGED
@@ -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
|
+
|
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 _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");
|
67
|
+
|
37
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
|
+
|
38
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; } }
|
39
|
-
|
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,21 +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
|
+
|
115
153
|
var _super = _createSuper(HiSelect);
|
154
|
+
|
116
155
|
function HiSelect(_props) {
|
117
156
|
var _this;
|
157
|
+
|
118
158
|
(0, _classCallCheck2.default)(this, HiSelect);
|
119
159
|
_this = _super.call(this, _props);
|
120
|
-
|
121
|
-
* Build itemList & inputValue from select props
|
122
|
-
* @param options
|
123
|
-
* @param value
|
124
|
-
* @param search
|
125
|
-
* @param loading
|
126
|
-
* @returns {{itemList: *[], inputValue: *}}
|
127
|
-
*/
|
160
|
+
|
128
161
|
_this.buildSelectProps = function (options) {
|
129
162
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
130
163
|
var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
@@ -151,25 +184,30 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
151
184
|
inputValue: _this.buildInputValue(options, value, loading)
|
152
185
|
};
|
153
186
|
};
|
187
|
+
|
154
188
|
_this.findRecursively = function (arr, id) {
|
155
189
|
for (var i = 0; i < arr.length; i++) {
|
156
190
|
if (arr[i].id === id) {
|
157
191
|
return arr[i];
|
158
192
|
} else if (arr[i].children && arr[i].children.length) {
|
159
193
|
var found = _this.findRecursively(arr[i].children, id);
|
194
|
+
|
160
195
|
if (found) return found;
|
161
196
|
}
|
162
197
|
}
|
163
198
|
};
|
199
|
+
|
164
200
|
_this.buildInputValue = function (options) {
|
165
201
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
166
202
|
var loading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
167
203
|
var _this$props = _this.props,
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
204
|
+
classes = _this$props.classes,
|
205
|
+
hasAll = _this$props.hasAll,
|
206
|
+
translations = _this$props.translations,
|
207
|
+
type = _this$props.type; // build input value
|
208
|
+
|
172
209
|
var inputValue;
|
210
|
+
|
173
211
|
if (loading && value.length === 1) {
|
174
212
|
inputValue = translations.one_item_selected;
|
175
213
|
} else if (hasAll && options.length === value.length) {
|
@@ -179,6 +217,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
179
217
|
inputValue = translations.n_items_selected.replace('%s', value.length);
|
180
218
|
} else if (value.length === 1) {
|
181
219
|
var item = _this.findRecursively(options, value[0]);
|
220
|
+
|
182
221
|
if (item === undefined) {
|
183
222
|
inputValue = translations.one_item_selected;
|
184
223
|
} else if (type === 'icon' || item.type === 'icon') {
|
@@ -187,6 +226,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
187
226
|
color: item.color
|
188
227
|
};
|
189
228
|
var icon;
|
229
|
+
|
190
230
|
if (typeof item.icon === 'string') {
|
191
231
|
icon = /*#__PURE__*/_react.default.createElement(_HiIcon.default, (0, _extends2.default)({
|
192
232
|
icon: item.icon
|
@@ -195,6 +235,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
195
235
|
icon = (0, _objectSpread2.default)({}, item.icon);
|
196
236
|
icon.props = (0, _objectSpread2.default)({}, icon.props, {}, iconProps);
|
197
237
|
}
|
238
|
+
|
198
239
|
inputValue = /*#__PURE__*/_react.default.createElement("span", {
|
199
240
|
className: classes.selectIconLabel
|
200
241
|
}, icon, item.label);
|
@@ -217,31 +258,40 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
217
258
|
inputValue = item.label;
|
218
259
|
}
|
219
260
|
}
|
261
|
+
|
220
262
|
return inputValue;
|
221
263
|
};
|
264
|
+
|
222
265
|
_this.focusOnFirstItem = function () {
|
223
266
|
if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
|
224
267
|
setTimeout(function () {
|
225
268
|
var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
|
269
|
+
|
226
270
|
item.focus();
|
227
271
|
}, 1);
|
228
272
|
}
|
229
273
|
};
|
274
|
+
|
230
275
|
_this.getInputElement = function (el) {
|
231
276
|
_this.searchField = el;
|
277
|
+
|
232
278
|
if (_this.props.inputRef) {
|
233
279
|
_this.props.inputRef(_this.searchField);
|
234
280
|
}
|
235
281
|
};
|
282
|
+
|
236
283
|
_this.handleBlur = function (event) {
|
237
284
|
_this.handleSearchReset();
|
285
|
+
|
238
286
|
_this.setState({
|
239
287
|
focused: false
|
240
288
|
});
|
289
|
+
|
241
290
|
if (_this.props.onBlur && !_this.inputEl.contains(event.relatedTarget) && !_this.state.open) {
|
242
291
|
_this.props.onBlur(event);
|
243
292
|
}
|
244
293
|
};
|
294
|
+
|
245
295
|
_this.handleClick = function (event) {
|
246
296
|
if (_this.state.open) {
|
247
297
|
_this.handleClose();
|
@@ -255,10 +305,11 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
255
305
|
open: true,
|
256
306
|
alertOpen: false
|
257
307
|
});
|
308
|
+
|
258
309
|
_this.handleSuggestions(_this.props.options);
|
259
|
-
if (_this.props.onClick) _this.props.onClick();
|
260
310
|
|
261
|
-
// Gestion du focus
|
311
|
+
if (_this.props.onClick) _this.props.onClick(); // Gestion du focus
|
312
|
+
|
262
313
|
setTimeout(function () {
|
263
314
|
if (!_this.props.searchable) {
|
264
315
|
// Sinon focus sur l'élément sélectionné
|
@@ -267,31 +318,38 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
267
318
|
}, 1);
|
268
319
|
}
|
269
320
|
};
|
321
|
+
|
270
322
|
_this.handleSubmitAlert = function () {
|
271
323
|
_this.handleClick();
|
272
324
|
};
|
325
|
+
|
273
326
|
_this.handleCancelAlert = function () {
|
274
327
|
_this.handleClose();
|
275
328
|
};
|
329
|
+
|
276
330
|
_this.handleExitedAlert = function () {
|
277
331
|
if (_this.searchField) {
|
278
332
|
_this.searchField.focus();
|
279
333
|
}
|
280
334
|
};
|
335
|
+
|
281
336
|
_this.handleCloseAlert = function () {
|
282
337
|
_this.handleClose();
|
283
338
|
};
|
339
|
+
|
284
340
|
_this.focusOnSelectedItem = function (selectedValue) {
|
285
341
|
if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
|
286
342
|
setTimeout(function () {
|
287
343
|
if (_this.overlay) {
|
288
344
|
// On initialise au premier élément pour être sûr de ne pas se retrouver avec un focus of undefined
|
289
345
|
var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
|
346
|
+
|
290
347
|
if (selectedValue && typeof selectedValue === 'string') {
|
291
348
|
item = _this.overlay.getElementsByTagName('li').namedItem(selectedValue);
|
292
349
|
} else if (selectedValue && typeof selectedValue === 'number') {
|
293
350
|
item = _this.overlay.querySelector('li:not([tabindex^="-"])')[selectedValue - 1];
|
294
351
|
}
|
352
|
+
|
295
353
|
if (item) {
|
296
354
|
item.focus();
|
297
355
|
}
|
@@ -299,59 +357,70 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
299
357
|
}, 1);
|
300
358
|
}
|
301
359
|
};
|
360
|
+
|
302
361
|
_this.handleClickAway = function (event) {
|
303
362
|
// Au clic sur le bouton, on laisse le handleClick fermer le select
|
304
363
|
if (!_this.inputEl.contains(event.target)) {
|
305
364
|
_this.handleClose(event);
|
306
365
|
}
|
307
366
|
};
|
367
|
+
|
308
368
|
_this.handleClose = function () {
|
309
369
|
_this.handleSearchReset();
|
370
|
+
|
310
371
|
_this.setState({
|
311
372
|
open: false,
|
312
373
|
alertOpen: false
|
313
374
|
});
|
375
|
+
|
314
376
|
if (_this.props.onClose) {
|
315
377
|
_this.props.onClose();
|
316
378
|
}
|
379
|
+
|
317
380
|
if (_this.inputEl) {
|
318
381
|
setTimeout(function () {
|
319
382
|
_this.inputEl.focus();
|
320
383
|
}, 100);
|
321
384
|
}
|
322
385
|
};
|
386
|
+
|
323
387
|
_this.handleFocus = function () {
|
324
388
|
_this.setState({
|
325
389
|
focused: true
|
326
390
|
});
|
327
391
|
};
|
328
|
-
|
392
|
+
|
329
393
|
_this.handleKeyDownCapture = function (event) {
|
330
394
|
var key = (0, _keycode.default)(event);
|
395
|
+
|
331
396
|
if (key === 'enter') {
|
332
397
|
if (_this.state.open) {
|
333
398
|
if (_this.props.multiple) {
|
334
399
|
event.stopPropagation();
|
400
|
+
|
335
401
|
_this.handleClose();
|
336
402
|
}
|
337
403
|
}
|
338
404
|
}
|
339
405
|
};
|
340
|
-
|
406
|
+
|
341
407
|
_this.handleKeyDown = function (event) {
|
342
408
|
var key = (0, _keycode.default)(event);
|
409
|
+
|
343
410
|
if (!_this.state.alertOpen) {
|
344
411
|
if (event.target === _this.inputEl && _this.state.open && key === 'down') {
|
345
412
|
// Focus on list 1st item
|
346
413
|
event.stopPropagation();
|
347
414
|
event.preventDefault();
|
348
415
|
var firstLi = document.querySelector("#".concat(_this.props.id, " + div ul > li"));
|
416
|
+
|
349
417
|
if (!!firstLi) {
|
350
418
|
firstLi.focus();
|
351
419
|
}
|
352
420
|
} else if (key === 'esc' && _this.state.open) {
|
353
421
|
event.stopPropagation();
|
354
422
|
event.preventDefault();
|
423
|
+
|
355
424
|
_this.handleClose();
|
356
425
|
} else if (key === 'enter') {
|
357
426
|
if (_this.state.open) {
|
@@ -363,6 +432,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
363
432
|
event.preventDefault();
|
364
433
|
} else if (key === 'tab' && (_this.state.open || _this.state.alertOpen)) {
|
365
434
|
event.stopPropagation();
|
435
|
+
|
366
436
|
_this.handleClose();
|
367
437
|
} else if (key === 'down' && event.target.id.includes('_subheader')) {
|
368
438
|
// Focus on parent, next item is child
|
@@ -371,6 +441,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
371
441
|
}
|
372
442
|
} else if (key === 'down' && !event.target.nextSibling) {
|
373
443
|
var _document$getElementB, _document$getElementB2;
|
444
|
+
|
374
445
|
// Focus on parent, next item is child
|
375
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) {
|
376
447
|
document.getElementById(event.target.dataset.group).nextSibling.nextSibling.focus();
|
@@ -388,13 +459,15 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
388
459
|
}
|
389
460
|
}
|
390
461
|
};
|
391
|
-
|
462
|
+
|
392
463
|
_this.handleKeyDownSearch = function (event) {
|
393
464
|
var key = (0, _keycode.default)(event);
|
465
|
+
|
394
466
|
if (_this.overlay && (key === 'down' || key === 'up')) {
|
395
467
|
_this.focusOnFirstItem();
|
396
468
|
} else if (_this.overlay && (key === 'esc' || key === 'enter')) {
|
397
469
|
event.preventDefault();
|
470
|
+
|
398
471
|
_this.handleClose();
|
399
472
|
} else if (key === 'tab') {
|
400
473
|
_this.setState({
|
@@ -402,32 +475,21 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
402
475
|
});
|
403
476
|
}
|
404
477
|
};
|
405
|
-
|
406
|
-
* Call onScrollReachBottom
|
407
|
-
* @param e
|
408
|
-
*/
|
478
|
+
|
409
479
|
_this.handleScroll = function (e) {
|
410
480
|
if (e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop < 15) {
|
411
481
|
_this.props.onScrollReachBottom();
|
412
482
|
}
|
413
483
|
};
|
414
|
-
|
415
|
-
* Call onChange with the updated value
|
416
|
-
*
|
417
|
-
* - handle single value
|
418
|
-
* - handle multiple value
|
419
|
-
* - handle '_all' id
|
420
|
-
*
|
421
|
-
* @param event
|
422
|
-
* @param item
|
423
|
-
*/
|
484
|
+
|
424
485
|
_this.handleSelect = function (event, item) {
|
425
486
|
var _this$props2 = _this.props,
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
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
|
+
|
431
493
|
if (!multiple) {
|
432
494
|
// This is a fix to prevent select open after select => TODO improve ?
|
433
495
|
setTimeout(function () {
|
@@ -459,17 +521,13 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
459
521
|
onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
|
460
522
|
}
|
461
523
|
};
|
462
|
-
|
463
|
-
* Update suggestions list
|
464
|
-
* - add '_no_result' item if suggestion list is empty
|
465
|
-
* - add '_all' item if suggestion list is complete
|
466
|
-
* @param suggestions
|
467
|
-
*/
|
524
|
+
|
468
525
|
_this.handleSuggestions = function (suggestions) {
|
469
526
|
var _this$props3 = _this.props,
|
470
|
-
|
471
|
-
|
472
|
-
|
527
|
+
hasAll = _this$props3.hasAll,
|
528
|
+
iconAll = _this$props3.iconAll,
|
529
|
+
translations = _this$props3.translations;
|
530
|
+
|
473
531
|
if (suggestions.length === 0) {
|
474
532
|
// Add '_no_result' suggestion
|
475
533
|
_this.setState(function (prevState) {
|
@@ -496,8 +554,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
496
554
|
});
|
497
555
|
}
|
498
556
|
};
|
557
|
+
|
499
558
|
_this.handleSearch = function (e, inputValue) {
|
500
559
|
var searchValue = inputValue && e.target.value ? inputValue : e.target.value;
|
560
|
+
|
501
561
|
if (_this.props.onSearch) {
|
502
562
|
_this.props.onSearch(e, searchValue);
|
503
563
|
} else {
|
@@ -506,6 +566,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
506
566
|
});
|
507
567
|
}
|
508
568
|
};
|
569
|
+
|
509
570
|
_this.handleSearchReset = function () {
|
510
571
|
_this.handleSearch({
|
511
572
|
target: {
|
@@ -513,11 +574,13 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
513
574
|
}
|
514
575
|
}, '');
|
515
576
|
};
|
577
|
+
|
516
578
|
_this.getLengthItemList = function (itemList) {
|
517
579
|
var itemListLength = 0;
|
518
580
|
itemList.forEach(function (parent) {
|
519
581
|
if (parent.displayed !== false) {
|
520
582
|
itemListLength += 1;
|
583
|
+
|
521
584
|
if (parent.children) {
|
522
585
|
itemListLength += _this.getLengthItemList(parent.children);
|
523
586
|
}
|
@@ -525,9 +588,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
525
588
|
});
|
526
589
|
return itemListLength;
|
527
590
|
};
|
591
|
+
|
528
592
|
_this.renderScrollbarTrackHorizontal = function (props) {
|
529
593
|
var style = props.style,
|
530
|
-
|
594
|
+
otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
|
531
595
|
var inlineStyle = (0, _objectSpread2.default)({}, style, {
|
532
596
|
zIndex: 10,
|
533
597
|
right: 2,
|
@@ -539,9 +603,10 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
539
603
|
style: inlineStyle
|
540
604
|
}));
|
541
605
|
};
|
606
|
+
|
542
607
|
_this.renderScrollbarTrackVertical = function (props) {
|
543
608
|
var style = props.style,
|
544
|
-
|
609
|
+
otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
|
545
610
|
var inlineStyle = (0, _objectSpread2.default)({}, style, {
|
546
611
|
zIndex: 10,
|
547
612
|
right: 2,
|
@@ -553,6 +618,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
553
618
|
style: inlineStyle
|
554
619
|
}));
|
555
620
|
};
|
621
|
+
|
556
622
|
_this.state = {
|
557
623
|
alertOpen: false,
|
558
624
|
open: false,
|
@@ -564,12 +630,14 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
564
630
|
};
|
565
631
|
return _this;
|
566
632
|
}
|
633
|
+
|
567
634
|
(0, _createClass2.default)(HiSelect, [{
|
568
635
|
key: "componentDidMount",
|
569
636
|
value: function componentDidMount() {
|
570
637
|
if (this.props.autoFocus) {
|
571
638
|
this.inputEl.focus();
|
572
639
|
}
|
640
|
+
|
573
641
|
if (this.overlay) {
|
574
642
|
this.setState({
|
575
643
|
overlayWidth: (0, _reactDom.findDOMNode)(this.overlay).clientWidth
|
@@ -579,65 +647,76 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
579
647
|
}, {
|
580
648
|
key: "render",
|
581
649
|
value: function render() {
|
582
|
-
var
|
650
|
+
var _classNames,
|
651
|
+
_this2 = this;
|
652
|
+
|
583
653
|
var _this$props4 = this.props,
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
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;
|
610
680
|
var _this$state = this.state,
|
611
|
-
|
612
|
-
|
613
|
-
|
681
|
+
alertOpen = _this$state.alertOpen,
|
682
|
+
open = _this$state.open,
|
683
|
+
focused = _this$state.focused;
|
684
|
+
|
614
685
|
if (multiple) {
|
615
686
|
if (!Array.isArray(value)) {
|
616
687
|
throw new Error('HiPay Material-UI: the `value` property must be an array ' + 'when using the `HiSelect` component with `multiple`.');
|
617
688
|
}
|
618
689
|
}
|
690
|
+
|
619
691
|
var selectedItemIdList = [];
|
692
|
+
|
620
693
|
if (value) {
|
621
694
|
selectedItemIdList = multiple ? (0, _toConsumableArray2.default)(value) : [value];
|
622
695
|
}
|
696
|
+
|
623
697
|
var _buildSelectProps = buildSelectProps(options, selectedItemIdList, searchValue, loading),
|
624
|
-
|
625
|
-
|
626
|
-
|
698
|
+
itemList = _buildSelectProps.itemList,
|
699
|
+
_buildSelectProps$inp = _buildSelectProps.inputValue,
|
700
|
+
inputValue = _buildSelectProps$inp === void 0 ? this.buildInputValue(options, selectedItemIdList, loading) : _buildSelectProps$inp;
|
701
|
+
|
627
702
|
var popperStyle = {
|
628
703
|
position: staticPosition ? 'relative' : 'fix',
|
629
704
|
top: 0,
|
630
705
|
left: 0
|
631
706
|
};
|
707
|
+
|
632
708
|
if (this.props.containerWidth > 0) {
|
633
709
|
popperStyle = {
|
634
710
|
width: this.props.containerWidth
|
635
711
|
};
|
712
|
+
|
636
713
|
if (!staticPosition) {
|
637
714
|
popperStyle.position = 'absolute';
|
638
715
|
}
|
639
716
|
}
|
640
|
-
|
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
|
+
|
641
720
|
var searchInput = function searchInput(position) {
|
642
721
|
if (searchable) {
|
643
722
|
return /*#__PURE__*/_react.default.createElement(_HiInput.default, (0, _extends2.default)({
|
@@ -653,24 +732,28 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
653
732
|
className: (0, _classnames.default)((0, _defineProperty2.default)({}, classes.separator, position === 'top'))
|
654
733
|
}, hiSearchInputProps));
|
655
734
|
}
|
735
|
+
|
656
736
|
return null;
|
657
|
-
};
|
737
|
+
}; // Replace popper onSearch when popper displayed on top of selectButton
|
738
|
+
|
658
739
|
|
659
|
-
// Replace popper onSearch when popper displayed on top of selectButton
|
660
740
|
if (this.placement && this.placement.indexOf('top') >= 0 && !!searchable) {
|
661
741
|
// In case we have a nested list
|
662
|
-
var itemListLength = this.getLengthItemList(itemList);
|
663
|
-
|
742
|
+
var itemListLength = this.getLengthItemList(itemList); // +1 for search input
|
743
|
+
|
664
744
|
var nbItems = itemListLength <= maxOptionsDisplayed - 2 ? itemListLength + 1 : maxOptionsDisplayed - 1;
|
665
745
|
popperStyle.transform = "translate3d(-1px, -".concat(nbItems * 40 + 2, "px, 0px)");
|
666
746
|
} else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
|
667
747
|
popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
|
668
748
|
}
|
749
|
+
|
669
750
|
var content = function content(_ref) {
|
670
751
|
var placement = _ref.placement;
|
752
|
+
|
671
753
|
if (placement !== _this2.placement) {
|
672
754
|
_this2.placement = placement;
|
673
755
|
}
|
756
|
+
|
674
757
|
var nbItemsDisplayed = !!searchable ? maxOptionsDisplayed - 1 : maxOptionsDisplayed;
|
675
758
|
var autoHeightMax = nbItemsDisplayed * 40 - 10;
|
676
759
|
return /*#__PURE__*/_react.default.createElement(_ClickAwayListener.default, {
|
@@ -706,6 +789,7 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
706
789
|
value: value
|
707
790
|
}, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
|
708
791
|
};
|
792
|
+
|
709
793
|
return !_reactDeviceDetect.isMobile ? /*#__PURE__*/_react.default.createElement("div", {
|
710
794
|
className: classes.root,
|
711
795
|
ref: function ref(el) {
|
@@ -794,11 +878,22 @@ var HiSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
794
878
|
suggestions: nextProps.options
|
795
879
|
});
|
796
880
|
}
|
881
|
+
|
797
882
|
return null;
|
798
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
|
+
|
799
893
|
}]);
|
800
894
|
return HiSelect;
|
801
895
|
}(_react.default.PureComponent);
|
896
|
+
|
802
897
|
HiSelect.defaultProps = {
|
803
898
|
align: 'left',
|
804
899
|
autoFocus: false,
|
@@ -826,7 +921,10 @@ HiSelect.defaultProps = {
|
|
826
921
|
filterFunc: filterValue,
|
827
922
|
maxOptionsDisplayed: 12
|
828
923
|
};
|
829
|
-
|
924
|
+
|
925
|
+
var _default = (0, _withStyles.default)(styles, {
|
830
926
|
hiComponent: true,
|
831
927
|
name: 'HmuiHiSelect'
|
832
|
-
})(HiSelect);
|
928
|
+
})(HiSelect);
|
929
|
+
|
930
|
+
exports.default = _default;
|