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