@hipay/hipay-material-ui 4.0.0 → 4.0.1-beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HiAccordion/HiAccordion.js +26 -8
- package/HiAccordion/index.js +5 -1
- package/HiAccordionActions/HiAccordionActions.js +14 -1
- package/HiAccordionActions/index.js +5 -1
- package/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/HiAccordionSummary/index.js +5 -1
- package/HiAlertModal/HiAlertModal.js +22 -7
- package/HiAlertModal/index.js +5 -1
- package/HiAppBar/HiAppBar.js +42 -11
- package/HiAppBar/index.js +2 -0
- package/HiAvatar/HiAvatar.js +12 -3
- package/HiAvatar/index.js +2 -0
- package/HiBadge/HiBadge.js +24 -8
- package/HiBadge/index.js +2 -0
- package/HiBreadcrumb/HiBreadcrumb.js +30 -6
- package/HiBreadcrumb/HiStep.js +45 -13
- package/HiBreadcrumb/HiStepConnector.js +49 -14
- package/HiBreadcrumb/HiStepContent.js +30 -6
- package/HiBreadcrumb/HiStepIcon.js +35 -10
- package/HiBreadcrumb/HiStepLabel.js +44 -14
- package/HiBreadcrumb/HiStepper.js +30 -6
- package/HiBreadcrumb/index.js +2 -0
- package/HiButton/HiButton.js +33 -8
- package/HiButton/index.js +5 -1
- package/HiCell/CellAddress.js +33 -12
- package/HiCell/CellDate.js +36 -10
- package/HiCell/CellHiddenContent.js +30 -8
- package/HiCell/CellIcon.js +36 -12
- package/HiCell/CellImage.js +34 -12
- package/HiCell/CellNumeric.js +40 -13
- package/HiCell/CellPinToAction.js +33 -9
- package/HiCell/CellRate.js +47 -13
- package/HiCell/CellSentinel.js +33 -12
- package/HiCell/CellSentinelScore.js +31 -9
- package/HiCell/CellText.js +52 -16
- package/HiCell/CellTextStyled.js +24 -13
- package/HiCell/index.js +10 -0
- package/HiCheckbox/HiCheckbox.js +52 -15
- package/HiCheckbox/index.js +2 -0
- package/HiChip/HiChip.js +47 -24
- package/HiChip/HiChipSwitch.js +59 -16
- package/HiChip/index.js +3 -0
- package/HiColoredLabel/HiColoredLabel.js +49 -15
- package/HiColoredLabel/index.js +2 -0
- package/HiDatePicker/Caption.js +21 -9
- package/HiDatePicker/HiDatePicker.js +88 -16
- package/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/HiDatePicker/HiDateRangePicker.js +134 -38
- package/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/HiDatePicker/ListPicker.js +38 -8
- package/HiDatePicker/NavBar.js +31 -12
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
- package/HiDatePicker/Overlays/Overlay.js +25 -8
- package/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- package/HiDatePicker/Overlays/index.js +6 -0
- package/HiDatePicker/Weekday.js +9 -4
- package/HiDatePicker/hiLocaleUtils.js +20 -8
- package/HiDatePicker/index.js +2 -0
- package/HiDatePicker/stylesheet.js +13 -7
- package/HiDialog/HiDialog.js +19 -7
- package/HiDialog/index.js +2 -0
- package/HiDotsStepper/HiDot.js +37 -8
- package/HiDotsStepper/HiDotsStepper.js +37 -10
- package/HiDotsStepper/index.js +3 -0
- package/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/HiExpansionPanel/index.js +5 -1
- package/HiForm/HiAddressField.js +36 -10
- package/HiForm/HiEmailField.js +29 -5
- package/HiForm/HiFormControl.js +74 -28
- package/HiForm/HiFormLabel.js +41 -15
- package/HiForm/HiInput.js +91 -33
- package/HiForm/HiPasswordField.js +46 -9
- package/HiForm/HiSearchField.js +34 -3
- package/HiForm/HiSlider.js +57 -22
- package/HiForm/HiTextField.js +47 -22
- package/HiForm/HiUpload.js +89 -29
- package/HiForm/HiUploadField.js +32 -10
- package/HiForm/HiUploadInput.js +76 -23
- package/HiForm/index.js +12 -0
- package/HiIcon/HiIcon.js +34 -9
- package/HiIcon/index.js +2 -0
- package/HiIconButton/HiIconButton.js +21 -6
- package/HiIconButton/index.js +2 -0
- package/HiListItemLink/HiListItemLink.js +19 -7
- package/HiListItemLink/index.js +2 -0
- package/HiLoader/HiLoader.js +16 -6
- package/HiLoader/index.js +2 -0
- package/HiNotice/HiKPI.js +47 -16
- package/HiNotice/HiKPINotice.js +16 -6
- package/HiNotice/index.js +3 -0
- package/HiPagination/HiPagination.js +11 -1
- package/HiPagination/index.js +2 -0
- package/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/HiPaymentMeans/index.js +2 -0
- package/HiPdfReader/HiPdfReader.js +57 -24
- package/HiPdfReader/index.js +2 -0
- package/HiPin/HiPin.js +19 -7
- package/HiPin/index.js +2 -0
- package/HiRadio/HiRadio.js +22 -11
- package/HiRadio/index.js +2 -0
- package/HiScrollStepper/HiScrollStepper.js +67 -29
- package/HiScrollStepper/index.js +2 -0
- package/HiSelect/HiDynamicSelect.js +42 -32
- package/HiSelect/HiDynamicSelectField.js +48 -24
- package/HiSelect/HiNestedSelect.js +111 -65
- package/HiSelect/HiNestedSelectContent.js +86 -60
- package/HiSelect/HiNestedSelectField.js +48 -24
- package/HiSelect/HiSelect.js +187 -89
- package/HiSelect/HiSelectContent.js +97 -62
- package/HiSelect/HiSelectField.js +49 -25
- package/HiSelect/HiSelectInput.js +76 -23
- package/HiSelect/HiSelectMobile.js +44 -7
- package/HiSelect/HiSuggestSelect.js +81 -25
- package/HiSelect/HiSuggestSelectField.js +39 -15
- package/HiSelect/index.js +14 -2
- package/HiSelectableList/HiSelectableList.js +90 -34
- package/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- package/HiSelectableList/HiSelectableListItem.js +88 -45
- package/HiSelectableList/index.js +4 -0
- package/HiStepper/DefaultIndicator.js +10 -1
- package/HiStepper/HiStep.js +48 -18
- package/HiStepper/HiStepper.js +15 -2
- package/HiStepper/index.js +3 -0
- package/HiSwitch/HiSwitch.js +33 -9
- package/HiSwitch/HiSwitchState.js +32 -15
- package/HiSwitch/index.js +3 -0
- package/HiTable/HiCellBuilder.js +65 -10
- package/HiTable/HiTable.js +48 -20
- package/HiTable/HiTableBody.js +24 -7
- package/HiTable/HiTableHeader.js +51 -18
- package/HiTable/HiTableRow.js +46 -12
- package/HiTable/constants.js +98 -48
- package/HiTable/index.js +2 -0
- package/es/HiAccordion/HiAccordion.js +26 -8
- package/es/HiAccordion/index.js +5 -1
- package/es/HiAccordionActions/HiAccordionActions.js +14 -1
- package/es/HiAccordionActions/index.js +5 -1
- package/es/HiAccordionSummary/HiAccordionSummary.js +15 -1
- package/es/HiAccordionSummary/index.js +5 -1
- package/es/HiAlertModal/HiAlertModal.js +22 -7
- package/es/HiAlertModal/index.js +5 -1
- package/es/HiAppBar/HiAppBar.js +42 -11
- package/es/HiAppBar/index.js +2 -0
- package/es/HiAvatar/HiAvatar.js +12 -3
- package/es/HiAvatar/index.js +2 -0
- package/es/HiBadge/HiBadge.js +24 -8
- package/es/HiBadge/index.js +2 -0
- package/es/HiBreadcrumb/HiBreadcrumb.js +30 -6
- package/es/HiBreadcrumb/HiStep.js +45 -13
- package/es/HiBreadcrumb/HiStepConnector.js +49 -14
- package/es/HiBreadcrumb/HiStepContent.js +30 -6
- package/es/HiBreadcrumb/HiStepIcon.js +35 -10
- package/es/HiBreadcrumb/HiStepLabel.js +44 -14
- package/es/HiBreadcrumb/HiStepper.js +30 -6
- package/es/HiBreadcrumb/index.js +2 -0
- package/es/HiButton/HiButton.js +33 -8
- package/es/HiButton/index.js +5 -1
- package/es/HiCell/CellAddress.js +33 -12
- package/es/HiCell/CellDate.js +36 -10
- package/es/HiCell/CellHiddenContent.js +30 -8
- package/es/HiCell/CellIcon.js +36 -12
- package/es/HiCell/CellImage.js +34 -12
- package/es/HiCell/CellNumeric.js +40 -13
- package/es/HiCell/CellPinToAction.js +33 -9
- package/es/HiCell/CellRate.js +47 -13
- package/es/HiCell/CellSentinel.js +33 -12
- package/es/HiCell/CellSentinelScore.js +31 -9
- package/es/HiCell/CellText.js +52 -16
- package/es/HiCell/CellTextStyled.js +24 -13
- package/es/HiCell/index.js +10 -0
- package/es/HiCheckbox/HiCheckbox.js +52 -15
- package/es/HiCheckbox/index.js +2 -0
- package/es/HiChip/HiChip.js +47 -24
- package/es/HiChip/HiChipSwitch.js +59 -16
- package/es/HiChip/index.js +3 -0
- package/es/HiColoredLabel/HiColoredLabel.js +49 -15
- package/es/HiColoredLabel/index.js +2 -0
- package/es/HiDatePicker/Caption.js +21 -9
- package/es/HiDatePicker/HiDatePicker.js +88 -16
- package/es/HiDatePicker/HiDatePickerMobile.js +43 -18
- package/es/HiDatePicker/HiDateRangePicker.js +134 -38
- package/es/HiDatePicker/HiDateRangeSelector.js +130 -49
- package/es/HiDatePicker/ListPicker.js +38 -8
- package/es/HiDatePicker/NavBar.js +31 -12
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +28 -11
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +28 -11
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +26 -4
- package/es/HiDatePicker/Overlays/Overlay.js +25 -8
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +39 -8
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +31 -8
- package/es/HiDatePicker/Overlays/index.js +6 -0
- package/es/HiDatePicker/Weekday.js +9 -4
- package/es/HiDatePicker/hiLocaleUtils.js +20 -8
- package/es/HiDatePicker/index.js +2 -0
- package/es/HiDatePicker/stylesheet.js +13 -7
- package/es/HiDialog/HiDialog.js +19 -7
- package/es/HiDialog/index.js +2 -0
- package/es/HiDotsStepper/HiDot.js +37 -8
- package/es/HiDotsStepper/HiDotsStepper.js +37 -10
- package/es/HiDotsStepper/index.js +3 -0
- package/es/HiExpansionPanel/HiExpansionPanel.js +38 -16
- package/es/HiExpansionPanel/index.js +5 -1
- package/es/HiForm/HiAddressField.js +36 -10
- package/es/HiForm/HiEmailField.js +29 -5
- package/es/HiForm/HiFormControl.js +74 -28
- package/es/HiForm/HiFormLabel.js +41 -15
- package/es/HiForm/HiInput.js +91 -33
- package/es/HiForm/HiPasswordField.js +46 -9
- package/es/HiForm/HiSearchField.js +34 -3
- package/es/HiForm/HiSlider.js +57 -22
- package/es/HiForm/HiTextField.js +47 -22
- package/es/HiForm/HiUpload.js +89 -29
- package/es/HiForm/HiUploadField.js +32 -10
- package/es/HiForm/HiUploadInput.js +76 -23
- package/es/HiForm/index.js +12 -0
- package/es/HiIcon/HiIcon.js +34 -9
- package/es/HiIcon/index.js +2 -0
- package/es/HiIconButton/HiIconButton.js +21 -6
- package/es/HiIconButton/index.js +2 -0
- package/es/HiListItemLink/HiListItemLink.js +19 -7
- package/es/HiListItemLink/index.js +2 -0
- package/es/HiLoader/HiLoader.js +16 -6
- package/es/HiLoader/index.js +2 -0
- package/es/HiNotice/HiKPI.js +47 -16
- package/es/HiNotice/HiKPINotice.js +16 -6
- package/es/HiNotice/index.js +3 -0
- package/es/HiPagination/HiPagination.js +11 -1
- package/es/HiPagination/index.js +2 -0
- package/es/HiPaymentMeans/HiPaymentMeans.js +72 -31
- package/es/HiPaymentMeans/index.js +2 -0
- package/es/HiPdfReader/HiPdfReader.js +57 -24
- package/es/HiPdfReader/index.js +2 -0
- package/es/HiPin/HiPin.js +19 -7
- package/es/HiPin/index.js +2 -0
- package/es/HiRadio/HiRadio.js +22 -11
- package/es/HiRadio/index.js +2 -0
- package/es/HiScrollStepper/HiScrollStepper.js +67 -29
- package/es/HiScrollStepper/index.js +2 -0
- package/es/HiSelect/HiDynamicSelect.js +42 -32
- package/es/HiSelect/HiDynamicSelectField.js +48 -24
- package/es/HiSelect/HiNestedSelect.js +111 -65
- package/es/HiSelect/HiNestedSelectContent.js +86 -60
- package/es/HiSelect/HiNestedSelectField.js +48 -24
- package/es/HiSelect/HiSelect.js +187 -89
- package/es/HiSelect/HiSelectContent.js +97 -62
- package/es/HiSelect/HiSelectField.js +49 -25
- package/es/HiSelect/HiSelectInput.js +76 -23
- package/es/HiSelect/HiSelectMobile.js +44 -7
- package/es/HiSelect/HiSuggestSelect.js +81 -25
- package/es/HiSelect/HiSuggestSelectField.js +39 -15
- package/es/HiSelect/index.js +14 -2
- package/es/HiSelectableList/HiSelectableList.js +90 -34
- package/es/HiSelectableList/HiSelectableListHierarchic.js +60 -34
- package/es/HiSelectableList/HiSelectableListItem.js +88 -45
- package/es/HiSelectableList/index.js +4 -0
- package/es/HiStepper/DefaultIndicator.js +10 -1
- package/es/HiStepper/HiStep.js +48 -18
- package/es/HiStepper/HiStepper.js +15 -2
- package/es/HiStepper/index.js +3 -0
- package/es/HiSwitch/HiSwitch.js +33 -9
- package/es/HiSwitch/HiSwitchState.js +32 -15
- package/es/HiSwitch/index.js +3 -0
- package/es/HiTable/HiCellBuilder.js +65 -10
- package/es/HiTable/HiTable.js +48 -20
- package/es/HiTable/HiTableBody.js +24 -7
- package/es/HiTable/HiTableHeader.js +51 -18
- package/es/HiTable/HiTableRow.js +46 -12
- package/es/HiTable/constants.js +98 -48
- package/es/HiTable/index.js +2 -0
- package/es/hi-svg-icons/HiAccount.js +14 -4
- package/es/hi-svg-icons/HiActivity.js +14 -4
- package/es/hi-svg-icons/HiAll.js +18 -7
- package/es/hi-svg-icons/HiBilling.js +14 -4
- package/es/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/es/hi-svg-icons/HiBusiness.js +14 -4
- package/es/hi-svg-icons/HiCatalog.js +14 -4
- package/es/hi-svg-icons/HiCustomer.js +14 -4
- package/es/hi-svg-icons/HiDownload.js +14 -4
- package/es/hi-svg-icons/HiFinance.js +14 -4
- package/es/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/es/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/es/hi-svg-icons/HiIntegration.js +14 -4
- package/es/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/es/hi-svg-icons/HiIntelligence.js +14 -4
- package/es/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/es/hi-svg-icons/HiInvoice.js +14 -4
- package/es/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/es/hi-svg-icons/HiLogoRounded.js +17 -6
- package/es/hi-svg-icons/HiOrder.js +14 -4
- package/es/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/es/hi-svg-icons/HiPermission.js +14 -4
- package/es/hi-svg-icons/HiPriceGrid.js +14 -4
- package/es/hi-svg-icons/HiPrivate.js +14 -4
- package/es/hi-svg-icons/HiRoute.js +14 -4
- package/es/hi-svg-icons/HiRouteMenu.js +14 -4
- package/es/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/es/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/es/hi-svg-icons/HiSettlement.js +14 -4
- package/es/hi-svg-icons/HiSizeLarge.js +14 -4
- package/es/hi-svg-icons/HiSizeMedium.js +14 -4
- package/es/hi-svg-icons/HiSizeSmall.js +14 -4
- package/es/hi-svg-icons/HiStore.js +14 -4
- package/es/hi-svg-icons/HiStoreMenu.js +14 -4
- package/es/hi-svg-icons/HiTransaction.js +14 -4
- package/es/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/es/hi-svg-icons/HiUser.js +14 -4
- package/es/hi-svg-icons/HiVendor.js +14 -4
- package/es/hi-svg-icons/HiWidget.js +14 -4
- package/es/hi-svg-icons/index.js +41 -0
- package/es/hi-svg-images/HiLogo.js +12 -4
- package/es/hi-svg-images/HiLogoWhite.js +12 -4
- package/es/hi-svg-images/index.js +3 -0
- package/es/setupTest.js +13 -2
- package/es/styleguide/Wrapper.js +6 -0
- package/es/styles/MuiThemeProvider.js +49 -15
- package/es/styles/colorManipulator.js +50 -15
- package/es/styles/createBreakpoints.js +29 -14
- package/es/styles/createGenerateClassName.js +24 -14
- package/es/styles/createMixins.js +10 -4
- package/es/styles/createMuiTheme.js +28 -11
- package/es/styles/createPalette.js +89 -67
- package/es/styles/createStyles.js +1 -0
- package/es/styles/createTypography.js +24 -15
- package/es/styles/getStylesCreator.js +14 -1
- package/es/styles/getThemeProps.js +7 -2
- package/es/styles/index.js +6 -0
- package/es/styles/jssPreset.js +11 -1
- package/es/styles/makeStyles.js +9 -2
- package/es/styles/mergeClasses.js +16 -5
- package/es/styles/shadows.js +4 -1
- package/es/styles/shape.js +2 -1
- package/es/styles/spacing.js +4 -1
- package/es/styles/themeListener.js +10 -2
- package/es/styles/transitions.js +35 -20
- package/es/styles/withStyles.js +9 -2
- package/es/styles/zIndex.js +2 -1
- package/es/test-utils/createMount.js +12 -2
- package/es/test-utils/createRender.js +9 -2
- package/es/test-utils/createShallow.js +17 -6
- package/es/test-utils/getClasses.js +4 -1
- package/es/test-utils/index.js +6 -0
- package/es/test-utils/until.js +14 -3
- package/es/test-utils/unwrap.js +1 -0
- package/es/theme/palette.js +7 -2
- package/es/theme/typography.js +15 -7
- package/es/theme.js +8 -2
- package/es/transitions/utils.js +7 -3
- package/es/utils/exactProp.js +13 -3
- package/es/utils/helpers.js +58 -19
- package/es/withMobileDialog/index.js +2 -0
- package/es/withMobileDialog/withMobileDialog.js +12 -3
- package/hi-svg-icons/HiAccount.js +14 -4
- package/hi-svg-icons/HiActivity.js +14 -4
- package/hi-svg-icons/HiAll.js +18 -7
- package/hi-svg-icons/HiBilling.js +14 -4
- package/hi-svg-icons/HiBriefcaseRescue.js +14 -4
- package/hi-svg-icons/HiBusiness.js +14 -4
- package/hi-svg-icons/HiCatalog.js +14 -4
- package/hi-svg-icons/HiCustomer.js +14 -4
- package/hi-svg-icons/HiDownload.js +14 -4
- package/hi-svg-icons/HiFinance.js +14 -4
- package/hi-svg-icons/HiFinanceMenu.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPage.js +14 -4
- package/hi-svg-icons/HiHostedPaymentPageMenu.js +14 -4
- package/hi-svg-icons/HiIntegration.js +14 -4
- package/hi-svg-icons/HiIntegrationMenu.js +14 -4
- package/hi-svg-icons/HiIntelligence.js +14 -4
- package/hi-svg-icons/HiIntelligenceMenu.js +14 -4
- package/hi-svg-icons/HiInvoice.js +14 -4
- package/hi-svg-icons/HiInvoiceMenu.js +14 -4
- package/hi-svg-icons/HiLogoRounded.js +17 -6
- package/hi-svg-icons/HiOrder.js +14 -4
- package/hi-svg-icons/HiPaymentOrder.js +14 -4
- package/hi-svg-icons/HiPermission.js +14 -4
- package/hi-svg-icons/HiPriceGrid.js +14 -4
- package/hi-svg-icons/HiPrivate.js +14 -4
- package/hi-svg-icons/HiRoute.js +14 -4
- package/hi-svg-icons/HiRouteMenu.js +14 -4
- package/hi-svg-icons/HiRouteSwitch.js +19 -7
- package/hi-svg-icons/HiRouteSwitchMenu.js +19 -7
- package/hi-svg-icons/HiSettlement.js +14 -4
- package/hi-svg-icons/HiSizeLarge.js +14 -4
- package/hi-svg-icons/HiSizeMedium.js +14 -4
- package/hi-svg-icons/HiSizeSmall.js +14 -4
- package/hi-svg-icons/HiStore.js +14 -4
- package/hi-svg-icons/HiStoreMenu.js +14 -4
- package/hi-svg-icons/HiTransaction.js +14 -4
- package/hi-svg-icons/HiTransactionMenu.js +14 -4
- package/hi-svg-icons/HiUser.js +14 -4
- package/hi-svg-icons/HiVendor.js +14 -4
- package/hi-svg-icons/HiWidget.js +14 -4
- package/hi-svg-icons/index.js +41 -0
- package/hi-svg-images/HiLogo.js +12 -4
- package/hi-svg-images/HiLogoWhite.js +12 -4
- package/hi-svg-images/index.js +3 -0
- package/package.json +2 -2
- package/setupTest.js +13 -2
- package/styleguide/Wrapper.js +6 -0
- package/styles/MuiThemeProvider.js +49 -15
- package/styles/colorManipulator.js +50 -15
- package/styles/createBreakpoints.js +29 -14
- package/styles/createGenerateClassName.js +24 -14
- package/styles/createMixins.js +10 -4
- package/styles/createMuiTheme.js +28 -11
- package/styles/createPalette.js +89 -67
- package/styles/createStyles.js +1 -0
- package/styles/createTypography.js +24 -15
- package/styles/getStylesCreator.js +14 -1
- package/styles/getThemeProps.js +7 -2
- package/styles/index.js +6 -0
- package/styles/jssPreset.js +11 -1
- package/styles/makeStyles.js +9 -2
- package/styles/mergeClasses.js +16 -5
- package/styles/shadows.js +4 -1
- package/styles/shape.js +2 -1
- package/styles/spacing.js +4 -1
- package/styles/themeListener.js +10 -2
- package/styles/transitions.js +35 -20
- package/styles/withStyles.js +9 -2
- package/styles/zIndex.js +2 -1
- package/test-utils/createMount.js +12 -2
- package/test-utils/createRender.js +9 -2
- package/test-utils/createShallow.js +17 -6
- package/test-utils/getClasses.js +4 -1
- package/test-utils/index.js +6 -0
- package/test-utils/until.js +14 -3
- package/test-utils/unwrap.js +1 -0
- package/theme/palette.js +7 -2
- package/theme/typography.js +15 -7
- package/theme.js +8 -2
- package/transitions/utils.js +7 -3
- package/utils/exactProp.js +13 -3
- package/utils/helpers.js +58 -19
- package/withMobileDialog/index.js +2 -0
- package/withMobileDialog/withMobileDialog.js +12 -3
@@ -1,29 +1,49 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.styles = exports.default = void 0;
|
9
|
+
|
8
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
11
|
+
|
9
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
13
|
+
|
10
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
15
|
+
|
11
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
17
|
+
|
12
18
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
19
|
+
|
13
20
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
21
|
+
|
14
22
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
23
|
+
|
15
24
|
var _react = _interopRequireDefault(require("react"));
|
25
|
+
|
16
26
|
var _classnames = _interopRequireDefault(require("classnames"));
|
27
|
+
|
17
28
|
var _ArrowDropDown = _interopRequireDefault(require("@mui/icons-material/ArrowDropDown"));
|
29
|
+
|
18
30
|
var _ButtonBase = _interopRequireDefault(require("@mui/material/ButtonBase"));
|
31
|
+
|
19
32
|
var _Icon = _interopRequireDefault(require("@mui/material/Icon"));
|
33
|
+
|
20
34
|
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
35
|
+
|
21
36
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
37
|
+
|
22
38
|
var _keycode = _interopRequireDefault(require("keycode"));
|
39
|
+
|
23
40
|
var _reactDeviceDetect = require("react-device-detect");
|
41
|
+
|
24
42
|
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); }; }
|
43
|
+
|
25
44
|
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; } }
|
26
|
-
|
45
|
+
|
46
|
+
var styles = function styles(theme) {
|
27
47
|
return {
|
28
48
|
root: {
|
29
49
|
width: '100%',
|
@@ -51,8 +71,8 @@ var styles = exports.styles = function styles(theme) {
|
|
51
71
|
easing: theme.transitions.easing.ease
|
52
72
|
}),
|
53
73
|
pointerEvents: 'none' // Transparent to the hover style.
|
54
|
-
},
|
55
74
|
|
75
|
+
},
|
56
76
|
'&:hover:not($disabled):before': {
|
57
77
|
backgroundColor: theme.palette.input.bottomLine,
|
58
78
|
height: 2
|
@@ -82,8 +102,8 @@ var styles = exports.styles = function styles(theme) {
|
|
82
102
|
easing: theme.transitions.easing.easeOut
|
83
103
|
}),
|
84
104
|
pointerEvents: 'none' // Transparent to the hover style.
|
85
|
-
},
|
86
105
|
|
106
|
+
},
|
87
107
|
'&:hover:after': {
|
88
108
|
transform: 'scaleX(1)'
|
89
109
|
},
|
@@ -131,38 +151,54 @@ var styles = exports.styles = function styles(theme) {
|
|
131
151
|
}
|
132
152
|
};
|
133
153
|
};
|
134
|
-
|
135
154
|
/**
|
136
155
|
* @ignore - internal component.
|
137
156
|
*/
|
157
|
+
|
158
|
+
|
159
|
+
exports.styles = styles;
|
160
|
+
|
138
161
|
var _ref = /*#__PURE__*/_react.default.createElement(_ArrowDropDown.default, null);
|
162
|
+
|
139
163
|
var HiSelectInput = /*#__PURE__*/function (_React$PureComponent) {
|
140
164
|
(0, _inherits2.default)(HiSelectInput, _React$PureComponent);
|
165
|
+
|
141
166
|
var _super = _createSuper(HiSelectInput);
|
167
|
+
|
142
168
|
function HiSelectInput() {
|
143
169
|
var _this;
|
170
|
+
|
144
171
|
(0, _classCallCheck2.default)(this, HiSelectInput);
|
172
|
+
|
145
173
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
146
174
|
args[_key] = arguments[_key];
|
147
175
|
}
|
176
|
+
|
148
177
|
_this = _super.call.apply(_super, [this].concat(args));
|
178
|
+
|
149
179
|
_this.handleKeyDown = function (event) {
|
150
180
|
var key = (0, _keycode.default)(event);
|
181
|
+
|
151
182
|
if (_this.props.onKeyDown) {
|
152
183
|
_this.props.onKeyDown(event);
|
153
184
|
} else if (key === 'enter' && _this.props.onSubmit) {
|
154
185
|
event.preventDefault();
|
186
|
+
|
155
187
|
_this.props.onSubmit(event);
|
156
188
|
}
|
157
189
|
};
|
190
|
+
|
158
191
|
_this.handleKeyDownReset = function (event) {
|
159
192
|
var key = (0, _keycode.default)(event);
|
193
|
+
|
160
194
|
if (key === 'enter' || key === 'space') {
|
161
195
|
_this.handleReset(event);
|
196
|
+
|
162
197
|
event.stopPropagation();
|
163
198
|
event.preventDefault();
|
164
199
|
}
|
165
200
|
};
|
201
|
+
|
166
202
|
_this.handleClick = function (event) {
|
167
203
|
// Do not open select if press on resetIcon
|
168
204
|
if ((!_this.resetIcon || !_this.resetIcon.contains(event.target)) && _this.props.onClick) {
|
@@ -172,45 +208,58 @@ var HiSelectInput = /*#__PURE__*/function (_React$PureComponent) {
|
|
172
208
|
}
|
173
209
|
}
|
174
210
|
};
|
211
|
+
|
175
212
|
_this.handleReset = function (event) {
|
176
213
|
_this.props.onReset(event);
|
214
|
+
|
177
215
|
if (_this.input) {
|
178
216
|
_this.input.focus();
|
179
217
|
}
|
180
218
|
};
|
219
|
+
|
181
220
|
_this.handleBlur = function (event) {
|
182
221
|
if ((!_this.input || !_this.input.contains(event.relatedTarget)) && _this.props.onBlur) {
|
183
222
|
_this.props.onBlur(event);
|
184
|
-
}
|
185
|
-
|
186
|
-
|
223
|
+
}
|
224
|
+
/* else if (this.input && (!this.resetIcon || !this.resetIcon.contains(event.relatedTarget))) {
|
225
|
+
this.input.focus();
|
226
|
+
}*/
|
227
|
+
|
187
228
|
};
|
229
|
+
|
188
230
|
_this.ref = function (el) {
|
189
231
|
_this.input = el;
|
232
|
+
|
190
233
|
if (_this.props.refElement) {
|
191
234
|
_this.props.refElement(el);
|
192
235
|
}
|
193
236
|
};
|
237
|
+
|
194
238
|
return _this;
|
195
239
|
}
|
240
|
+
|
196
241
|
(0, _createClass2.default)(HiSelectInput, [{
|
197
242
|
key: "render",
|
198
243
|
value: function render() {
|
199
|
-
var
|
244
|
+
var _classNames,
|
245
|
+
_classNames2,
|
246
|
+
_this2 = this;
|
247
|
+
|
200
248
|
var _this$props = this.props,
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
var
|
249
|
+
classes = _this$props.classes,
|
250
|
+
noButton = _this$props.noButton,
|
251
|
+
disabled = _this$props.disabled,
|
252
|
+
onClick = _this$props.onClick,
|
253
|
+
onReset = _this$props.onReset,
|
254
|
+
value = _this$props.value,
|
255
|
+
open = _this$props.open,
|
256
|
+
focused = _this$props.focused,
|
257
|
+
error = _this$props.error,
|
258
|
+
id = _this$props.id,
|
259
|
+
placeholder = _this$props.placeholder; // On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
260
|
+
|
261
|
+
var rootClass = (0, _classnames.default)(classes.root, classes.inkbar, classes.underline, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.disabled, disabled), (0, _defineProperty2.default)(_classNames, classes.focused, focused), (0, _defineProperty2.default)(_classNames, classes.error, error && !focused), (0, _defineProperty2.default)(_classNames, classes.rootMobile, _reactDeviceDetect.isMobile), _classNames));
|
262
|
+
var iconClass = (0, _classnames.default)(classes.icon, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.iconOpen, open), (0, _defineProperty2.default)(_classNames2, classes.iconClose, !open), _classNames2));
|
214
263
|
return noButton ? /*#__PURE__*/_react.default.createElement("div", {
|
215
264
|
id: id,
|
216
265
|
className: rootClass,
|
@@ -261,6 +310,7 @@ var HiSelectInput = /*#__PURE__*/function (_React$PureComponent) {
|
|
261
310
|
}]);
|
262
311
|
return HiSelectInput;
|
263
312
|
}(_react.default.PureComponent);
|
313
|
+
|
264
314
|
HiSelectInput.defaultProps = {
|
265
315
|
disabled: false,
|
266
316
|
open: false,
|
@@ -268,7 +318,10 @@ HiSelectInput.defaultProps = {
|
|
268
318
|
noButton: false,
|
269
319
|
error: false
|
270
320
|
};
|
271
|
-
|
321
|
+
|
322
|
+
var _default = (0, _withStyles.default)(styles, {
|
272
323
|
hiComponent: true,
|
273
324
|
name: 'HmuiHiSelectInput'
|
274
|
-
})(HiSelectInput);
|
325
|
+
})(HiSelectInput);
|
326
|
+
|
327
|
+
exports.default = _default;
|
@@ -1,23 +1,37 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.styles = exports.default = void 0;
|
9
|
+
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
11
|
+
|
9
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
13
|
+
|
10
14
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
15
|
+
|
11
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
17
|
+
|
12
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
19
|
+
|
13
20
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
21
|
+
|
14
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
23
|
+
|
15
24
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
25
|
+
|
16
26
|
var _react = _interopRequireDefault(require("react"));
|
27
|
+
|
17
28
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
29
|
+
|
18
30
|
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); }; }
|
31
|
+
|
19
32
|
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; } }
|
20
|
-
|
33
|
+
|
34
|
+
var styles = function styles(theme) {
|
21
35
|
return {
|
22
36
|
root: {
|
23
37
|
position: 'absolute',
|
@@ -27,18 +41,28 @@ var styles = exports.styles = function styles(theme) {
|
|
27
41
|
}
|
28
42
|
};
|
29
43
|
};
|
44
|
+
|
45
|
+
exports.styles = styles;
|
46
|
+
|
30
47
|
var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
31
48
|
(0, _inherits2.default)(HiSelectMobile, _React$Component);
|
49
|
+
|
32
50
|
var _super = _createSuper(HiSelectMobile);
|
51
|
+
|
33
52
|
function HiSelectMobile() {
|
34
53
|
var _this;
|
54
|
+
|
35
55
|
(0, _classCallCheck2.default)(this, HiSelectMobile);
|
56
|
+
|
36
57
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
37
58
|
args[_key] = arguments[_key];
|
38
59
|
}
|
60
|
+
|
39
61
|
_this = _super.call.apply(_super, [this].concat(args));
|
62
|
+
|
40
63
|
_this.buildOptionList = function (itemList) {
|
41
64
|
var optionList = [];
|
65
|
+
|
42
66
|
if (itemList.length) {
|
43
67
|
var parentId;
|
44
68
|
var groupList = [];
|
@@ -49,6 +73,7 @@ var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
|
49
73
|
optionList.push(_this.buildChildrenList(groupList));
|
50
74
|
groupList = [];
|
51
75
|
}
|
76
|
+
|
52
77
|
parentId = item.id;
|
53
78
|
groupList.push(item);
|
54
79
|
} else if (parentId) {
|
@@ -64,12 +89,15 @@ var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
|
64
89
|
}
|
65
90
|
}
|
66
91
|
});
|
92
|
+
|
67
93
|
if (groupList.length) {
|
68
94
|
optionList.push(_this.buildChildrenList(groupList));
|
69
95
|
}
|
70
96
|
}
|
97
|
+
|
71
98
|
return optionList;
|
72
99
|
};
|
100
|
+
|
73
101
|
_this.buildChildrenList = function (itemList) {
|
74
102
|
var group = itemList.shift();
|
75
103
|
return /*#__PURE__*/_react.default.createElement("optgroup", {
|
@@ -83,9 +111,11 @@ var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
|
83
111
|
}, item.label);
|
84
112
|
}));
|
85
113
|
};
|
114
|
+
|
86
115
|
_this.handleChange = function (event) {
|
87
116
|
if (!_this.props.multiple) {
|
88
117
|
var itemSelected = event.target[event.target.selectedIndex];
|
118
|
+
|
89
119
|
_this.props.onChange(event, JSON.parse(itemSelected.getAttribute('data-item')));
|
90
120
|
} else {
|
91
121
|
// Multiple on mobile trigger on change with all selected items
|
@@ -95,20 +125,23 @@ var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
|
95
125
|
optionsSelected.push(JSON.parse(option.getAttribute('data-item')));
|
96
126
|
}
|
97
127
|
});
|
128
|
+
|
98
129
|
_this.props.onChange(event, optionsSelected);
|
99
130
|
}
|
100
131
|
};
|
132
|
+
|
101
133
|
return _this;
|
102
134
|
}
|
135
|
+
|
103
136
|
(0, _createClass2.default)(HiSelectMobile, [{
|
104
137
|
key: "render",
|
105
138
|
value: function render() {
|
106
139
|
var _this$props = this.props,
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
140
|
+
classes = _this$props.classes,
|
141
|
+
id = _this$props.id,
|
142
|
+
itemList = _this$props.itemList,
|
143
|
+
multiple = _this$props.multiple,
|
144
|
+
value = _this$props.value;
|
112
145
|
var additionalProps = (0, _objectSpread2.default)({}, multiple && {
|
113
146
|
multiple: 'multiple'
|
114
147
|
});
|
@@ -126,7 +159,11 @@ var HiSelectMobile = /*#__PURE__*/function (_React$Component) {
|
|
126
159
|
}]);
|
127
160
|
return HiSelectMobile;
|
128
161
|
}(_react.default.Component);
|
162
|
+
|
129
163
|
HiSelectMobile.defaultProps = {
|
130
164
|
itemList: []
|
131
165
|
};
|
132
|
-
|
166
|
+
|
167
|
+
var _default = (0, _withStyles.default)(styles)(HiSelectMobile);
|
168
|
+
|
169
|
+
exports.default = _default;
|
@@ -1,32 +1,55 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.styles = exports.default = void 0;
|
9
|
+
|
8
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
11
|
+
|
9
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
13
|
+
|
10
14
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
15
|
+
|
11
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
17
|
+
|
12
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
19
|
+
|
13
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
21
|
+
|
14
22
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
23
|
+
|
15
24
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
25
|
+
|
16
26
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
27
|
+
|
17
28
|
var _react = _interopRequireDefault(require("react"));
|
29
|
+
|
18
30
|
var _Grow = _interopRequireDefault(require("@mui/material/Grow"));
|
31
|
+
|
19
32
|
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
33
|
+
|
20
34
|
var _classnames = _interopRequireDefault(require("classnames"));
|
35
|
+
|
21
36
|
var _HiSelectableList = _interopRequireDefault(require("../HiSelectableList"));
|
37
|
+
|
22
38
|
var _HiInput = _interopRequireDefault(require("../HiForm/HiInput"));
|
39
|
+
|
23
40
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
41
|
+
|
24
42
|
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
43
|
+
|
25
44
|
var _helpers = require("../utils/helpers");
|
45
|
+
|
26
46
|
var _keycode = _interopRequireDefault(require("keycode"));
|
47
|
+
|
27
48
|
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); }; }
|
28
|
-
|
29
|
-
|
49
|
+
|
50
|
+
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; } }
|
51
|
+
|
52
|
+
var styles = function styles(theme) {
|
30
53
|
return {
|
31
54
|
root: {
|
32
55
|
backgroundColor: theme.palette.background2,
|
@@ -50,23 +73,35 @@ var styles = exports.styles = function styles(theme) {
|
|
50
73
|
}
|
51
74
|
};
|
52
75
|
};
|
76
|
+
|
77
|
+
exports.styles = styles;
|
78
|
+
|
53
79
|
var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
54
80
|
(0, _inherits2.default)(HiSuggestSelect, _React$PureComponent);
|
81
|
+
|
55
82
|
var _super = _createSuper(HiSuggestSelect);
|
83
|
+
|
56
84
|
function HiSuggestSelect(props) {
|
57
85
|
var _this;
|
86
|
+
|
58
87
|
(0, _classCallCheck2.default)(this, HiSuggestSelect);
|
59
88
|
_this = _super.call(this, props);
|
89
|
+
|
60
90
|
_this.getInputElement = function (el) {
|
61
91
|
_this.textInput = el;
|
92
|
+
|
62
93
|
if (_this.props.inputRef) {
|
63
94
|
_this.props.inputRef(_this.textInput);
|
64
95
|
}
|
65
96
|
};
|
97
|
+
|
66
98
|
_this.handleSelect = function (event, value) {
|
67
99
|
document.body.style.overflow = 'auto';
|
100
|
+
|
68
101
|
_this.props.onSelect(event, value);
|
102
|
+
|
69
103
|
var textInput = _this.textInput;
|
104
|
+
|
70
105
|
if (textInput) {
|
71
106
|
setTimeout(function () {
|
72
107
|
textInput.focus();
|
@@ -74,10 +109,11 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
74
109
|
}, 1);
|
75
110
|
}
|
76
111
|
};
|
77
|
-
|
112
|
+
|
78
113
|
_this.handleKeyDown = function (event) {
|
79
114
|
var nextItem;
|
80
115
|
var key = (0, _keycode.default)(event);
|
116
|
+
|
81
117
|
if (key === 'down') {
|
82
118
|
event.preventDefault();
|
83
119
|
nextItem = (0, _helpers.getNextItemSelectable)(document.activeElement, 'down');
|
@@ -86,31 +122,37 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
86
122
|
nextItem = (0, _helpers.getNextItemSelectable)(document.activeElement, 'up');
|
87
123
|
} else if (key === 'tab') {
|
88
124
|
document.body.style.overflow = 'auto';
|
125
|
+
|
89
126
|
if ((0, _helpers.getNextItemSelectable)(document.activeElement, 'down') === null) {
|
90
127
|
_this.setState({
|
91
128
|
options: [],
|
92
129
|
focused: false,
|
93
130
|
suggestionFocusIndex: -1
|
94
131
|
});
|
132
|
+
|
95
133
|
if (_this.props.onBlurInput) {
|
96
134
|
_this.props.onBlurInput(event);
|
97
135
|
}
|
98
136
|
}
|
99
137
|
} else if (key === 'escape' || 'enter') {
|
100
138
|
event.preventDefault();
|
139
|
+
|
101
140
|
var item = _this.props.options.find(function (elem) {
|
102
141
|
return String(elem.id) === event.target.id;
|
103
142
|
});
|
143
|
+
|
104
144
|
_this.handleSelect(null, item);
|
105
145
|
}
|
146
|
+
|
106
147
|
if (nextItem) {
|
107
148
|
nextItem.focus();
|
108
149
|
}
|
109
150
|
};
|
110
|
-
|
151
|
+
|
111
152
|
_this.handleKeyDownSearch = function (event) {
|
112
153
|
if (event.key === 'ArrowDown') {
|
113
154
|
event.preventDefault();
|
155
|
+
|
114
156
|
if (_this.state.suggestionFocusIndex < _this.props.options.length - 1) {
|
115
157
|
_this.setState(function (prevState) {
|
116
158
|
return {
|
@@ -120,6 +162,7 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
120
162
|
}
|
121
163
|
} else if (event.key === 'ArrowUp') {
|
122
164
|
event.preventDefault();
|
165
|
+
|
123
166
|
if (_this.state.suggestionFocusIndex >= 0) {
|
124
167
|
_this.setState(function (prevState) {
|
125
168
|
return {
|
@@ -128,8 +171,8 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
128
171
|
});
|
129
172
|
}
|
130
173
|
} else if (event.key === 'Enter' && _this.state.suggestionFocusIndex >= 0) {
|
131
|
-
event.preventDefault();
|
132
|
-
|
174
|
+
event.preventDefault(); // Suggestion focused
|
175
|
+
|
133
176
|
_this.handleSelect(event, _this.state.options[_this.state.suggestionFocusIndex]);
|
134
177
|
} else if (event.key === 'Escape') {
|
135
178
|
_this.setState({
|
@@ -138,14 +181,17 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
138
181
|
});
|
139
182
|
}
|
140
183
|
};
|
184
|
+
|
141
185
|
_this.handleFocus = function (event) {
|
142
186
|
_this.setState({
|
143
187
|
focused: true
|
144
188
|
});
|
189
|
+
|
145
190
|
if (_this.props.onFocusInput) {
|
146
191
|
_this.props.onFocusInput(event);
|
147
192
|
}
|
148
193
|
};
|
194
|
+
|
149
195
|
_this.handleBlur = function (event) {
|
150
196
|
// Si on click sur un élément de HiInput, on garde le focus
|
151
197
|
// Par exemple sur l'icone reset
|
@@ -155,6 +201,7 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
155
201
|
focused: false,
|
156
202
|
suggestionFocusIndex: -1
|
157
203
|
});
|
204
|
+
|
158
205
|
if (_this.props.onBlurInput) {
|
159
206
|
_this.props.onBlurInput(event);
|
160
207
|
}
|
@@ -163,11 +210,13 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
163
210
|
options: [],
|
164
211
|
suggestionFocusIndex: -1
|
165
212
|
});
|
213
|
+
|
166
214
|
if (_this.textInput) {
|
167
215
|
_this.textInput.focus();
|
168
216
|
}
|
169
217
|
}
|
170
218
|
};
|
219
|
+
|
171
220
|
_this.state = {
|
172
221
|
focused: false,
|
173
222
|
options: props.options,
|
@@ -175,30 +224,31 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
175
224
|
};
|
176
225
|
return _this;
|
177
226
|
}
|
227
|
+
|
178
228
|
(0, _createClass2.default)(HiSuggestSelect, [{
|
179
229
|
key: "render",
|
180
230
|
value: function render() {
|
181
231
|
var _this2 = this;
|
232
|
+
|
182
233
|
var _this$props = this.props,
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
234
|
+
classes = _this$props.classes,
|
235
|
+
id = _this$props.id,
|
236
|
+
loading = _this$props.loading,
|
237
|
+
showMinLength = _this$props.showMinLength,
|
238
|
+
showNoResults = _this$props.showNoResults,
|
239
|
+
onSearch = _this$props.onSearch,
|
240
|
+
translations = _this$props.translations,
|
241
|
+
align = _this$props.align,
|
242
|
+
inputClasses = _this$props.inputClasses,
|
243
|
+
_this$props$HiInputPr = _this$props.HiInputProps,
|
244
|
+
HiInputProps = _this$props$HiInputPr === void 0 ? {} : _this$props$HiInputPr,
|
245
|
+
otherProps = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "id", "loading", "showMinLength", "showNoResults", "onSearch", "translations", "align", "inputClasses", "HiInputProps"]);
|
195
246
|
var _this$state = this.state,
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
var optionsShown = options;
|
247
|
+
focused = _this$state.focused,
|
248
|
+
options = _this$state.options,
|
249
|
+
suggestionFocusIndex = _this$state.suggestionFocusIndex;
|
250
|
+
var optionsShown = options; // If loading
|
200
251
|
|
201
|
-
// If loading
|
202
252
|
if (loading) {
|
203
253
|
optionsShown = [{
|
204
254
|
id: '_loading',
|
@@ -220,6 +270,7 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
220
270
|
selectable: false
|
221
271
|
}];
|
222
272
|
}
|
273
|
+
|
223
274
|
var open = !!optionsShown.length && focused;
|
224
275
|
return /*#__PURE__*/_react.default.createElement("div", {
|
225
276
|
className: classes.root,
|
@@ -269,11 +320,13 @@ var HiSuggestSelect = /*#__PURE__*/function (_React$PureComponent) {
|
|
269
320
|
suggestionFocusIndex: -1
|
270
321
|
};
|
271
322
|
}
|
323
|
+
|
272
324
|
return null;
|
273
325
|
}
|
274
326
|
}]);
|
275
327
|
return HiSuggestSelect;
|
276
328
|
}(_react.default.PureComponent);
|
329
|
+
|
277
330
|
HiSuggestSelect.defaultProps = {
|
278
331
|
align: 'left',
|
279
332
|
showMinLength: false,
|
@@ -284,7 +337,10 @@ HiSuggestSelect.defaultProps = {
|
|
284
337
|
},
|
285
338
|
options: []
|
286
339
|
};
|
287
|
-
|
340
|
+
|
341
|
+
var _default = (0, _withStyles.default)(styles, {
|
288
342
|
hiComponent: true,
|
289
343
|
name: 'HmuiHiSuggestSelect'
|
290
|
-
})(HiSuggestSelect);
|
344
|
+
})(HiSuggestSelect);
|
345
|
+
|
346
|
+
exports.default = _default;
|