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