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