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