@hipay/hipay-material-ui 3.15.2 → 3.15.3-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/HiAccordion/HiAccordion.js +8 -26
- package/HiAccordion/index.js +1 -5
- package/HiAccordionActions/HiAccordionActions.js +1 -14
- package/HiAccordionActions/index.js +1 -5
- package/HiAccordionSummary/HiAccordionSummary.js +1 -15
- package/HiAccordionSummary/index.js +1 -5
- package/HiAlertModal/HiAlertModal.js +7 -22
- package/HiAlertModal/index.js +1 -5
- package/HiAppBar/HiAppBar.js +11 -42
- package/HiAppBar/index.js +0 -2
- package/HiAvatar/HiAvatar.js +3 -12
- package/HiAvatar/index.js +0 -2
- package/HiBadge/HiBadge.js +17 -33
- package/HiBadge/index.js +0 -2
- package/HiBreadcrumb/HiBreadcrumb.js +6 -30
- package/HiBreadcrumb/HiStep.js +13 -45
- package/HiBreadcrumb/HiStepConnector.js +15 -50
- package/HiBreadcrumb/HiStepContent.js +6 -30
- package/HiBreadcrumb/HiStepIcon.js +17 -42
- package/HiBreadcrumb/HiStepLabel.js +17 -47
- package/HiBreadcrumb/HiStepper.js +6 -30
- package/HiBreadcrumb/index.js +0 -2
- package/HiButton/HiButton.js +12 -37
- package/HiButton/index.js +1 -5
- package/HiCell/CellAddress.js +12 -33
- package/HiCell/CellDate.js +10 -36
- package/HiCell/CellHiddenContent.js +8 -30
- package/HiCell/CellIcon.js +12 -36
- package/HiCell/CellImage.js +12 -34
- package/HiCell/CellNumeric.js +13 -40
- package/HiCell/CellPinToAction.js +9 -33
- package/HiCell/CellRate.js +17 -51
- package/HiCell/CellSentinel.js +12 -33
- package/HiCell/CellSentinelScore.js +9 -31
- package/HiCell/CellText.js +16 -52
- package/HiCell/CellTextStyled.js +13 -24
- package/HiCell/index.js +0 -10
- package/HiCheckbox/HiCheckbox.js +19 -56
- package/HiCheckbox/index.js +0 -2
- package/HiChip/HiChip.js +24 -47
- package/HiChip/HiChipSwitch.js +16 -59
- package/HiChip/index.js +0 -3
- package/HiColoredLabel/HiColoredLabel.js +47 -69
- package/HiColoredLabel/index.js +0 -2
- package/HiDatePicker/Caption.js +9 -21
- package/HiDatePicker/HiDatePicker.js +16 -88
- package/HiDatePicker/HiDatePickerMobile.js +18 -43
- package/HiDatePicker/HiDateRangePicker.js +38 -134
- package/HiDatePicker/HiDateRangeSelector.js +49 -130
- package/HiDatePicker/ListPicker.js +8 -38
- package/HiDatePicker/NavBar.js +12 -31
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +11 -28
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +11 -28
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +4 -26
- package/HiDatePicker/Overlays/Overlay.js +8 -25
- package/HiDatePicker/Overlays/TimePickerOverlay.js +8 -39
- package/HiDatePicker/Overlays/YearPickerOverlay.js +8 -31
- package/HiDatePicker/Overlays/index.js +0 -6
- package/HiDatePicker/Weekday.js +4 -9
- package/HiDatePicker/hiLocaleUtils.js +8 -20
- package/HiDatePicker/index.js +0 -2
- package/HiDatePicker/stylesheet.js +7 -13
- package/HiDialog/HiDialog.js +7 -19
- package/HiDialog/index.js +0 -2
- package/HiDotsStepper/HiDot.js +9 -38
- package/HiDotsStepper/HiDotsStepper.js +10 -37
- package/HiDotsStepper/index.js +0 -3
- package/HiExpansionPanel/HiExpansionPanel.js +16 -38
- package/HiExpansionPanel/index.js +1 -5
- package/HiForm/HiAddressField.js +10 -36
- package/HiForm/HiEmailField.js +5 -29
- package/HiForm/HiFormControl.js +31 -77
- package/HiForm/HiFormLabel.js +16 -42
- package/HiForm/HiInput.js +34 -92
- package/HiForm/HiPasswordField.js +8 -36
- package/HiForm/HiSearchField.js +3 -34
- package/HiForm/HiSlider.js +22 -57
- package/HiForm/HiTextField.js +22 -47
- package/HiForm/HiUpload.js +35 -95
- package/HiForm/HiUploadField.js +10 -32
- package/HiForm/HiUploadInput.js +24 -77
- package/HiForm/index.js +0 -12
- package/HiIcon/HiIcon.js +9 -34
- package/HiIcon/index.js +0 -2
- package/HiIconButton/HiIconButton.js +7 -22
- package/HiIconButton/index.js +0 -2
- package/HiListItemLink/HiListItemLink.js +7 -19
- package/HiListItemLink/index.js +0 -2
- package/HiLoader/HiLoader.js +6 -16
- package/HiLoader/index.js +0 -2
- package/HiNotice/HiKPI.js +17 -48
- package/HiNotice/HiKPINotice.js +6 -16
- package/HiNotice/index.js +0 -3
- package/HiPagination/HiPagination.js +1 -11
- package/HiPagination/index.js +0 -2
- package/HiPaymentMeans/HiPaymentMeans.js +31 -72
- package/HiPaymentMeans/index.js +0 -2
- package/HiPdfReader/HiPdfReader.js +24 -57
- package/HiPdfReader/index.js +0 -2
- package/HiPin/HiPin.js +16 -28
- package/HiPin/index.js +0 -2
- package/HiRadio/HiRadio.js +12 -23
- package/HiRadio/index.js +0 -2
- package/HiScrollStepper/HiScrollStepper.js +29 -67
- package/HiScrollStepper/index.js +0 -2
- package/HiSelect/HiDynamicSelect.js +32 -42
- package/HiSelect/HiDynamicSelectField.js +24 -48
- package/HiSelect/HiNestedSelect.js +65 -111
- package/HiSelect/HiNestedSelectContent.js +60 -86
- package/HiSelect/HiNestedSelectField.js +24 -48
- package/HiSelect/HiSelect.js +89 -187
- package/HiSelect/HiSelectContent.js +62 -97
- package/HiSelect/HiSelectField.js +25 -49
- package/HiSelect/HiSelectInput.js +24 -77
- package/HiSelect/HiSelectMobile.js +7 -44
- package/HiSelect/HiSuggestSelect.js +25 -81
- package/HiSelect/HiSuggestSelectField.js +15 -39
- package/HiSelect/index.js +2 -14
- package/HiSelectableList/HiSelectableList.js +34 -90
- package/HiSelectableList/HiSelectableListHierarchic.js +34 -60
- package/HiSelectableList/HiSelectableListItem.js +45 -88
- package/HiSelectableList/index.js +0 -4
- package/HiStepper/DefaultIndicator.js +1 -10
- package/HiStepper/HiStep.js +21 -51
- package/HiStepper/HiStepper.js +2 -15
- package/HiStepper/index.js +0 -3
- package/HiSwitch/HiSwitch.js +19 -43
- package/HiSwitch/HiSwitchState.js +22 -39
- package/HiSwitch/index.js +0 -3
- package/HiTable/HiCellBuilder.js +10 -65
- package/HiTable/HiTable.js +20 -48
- package/HiTable/HiTableBody.js +7 -24
- package/HiTable/HiTableHeader.js +18 -51
- package/HiTable/HiTableRow.js +12 -46
- package/HiTable/constants.js +48 -98
- package/HiTable/index.js +0 -2
- package/es/HiAccordion/HiAccordion.js +8 -26
- package/es/HiAccordion/index.js +1 -5
- package/es/HiAccordionActions/HiAccordionActions.js +1 -14
- package/es/HiAccordionActions/index.js +1 -5
- package/es/HiAccordionSummary/HiAccordionSummary.js +1 -15
- package/es/HiAccordionSummary/index.js +1 -5
- package/es/HiAlertModal/HiAlertModal.js +7 -22
- package/es/HiAlertModal/index.js +1 -5
- package/es/HiAppBar/HiAppBar.js +11 -42
- package/es/HiAppBar/index.js +0 -2
- package/es/HiAvatar/HiAvatar.js +3 -12
- package/es/HiAvatar/index.js +0 -2
- package/es/HiBadge/HiBadge.js +17 -33
- package/es/HiBadge/index.js +0 -2
- package/es/HiBreadcrumb/HiBreadcrumb.js +6 -30
- package/es/HiBreadcrumb/HiStep.js +13 -45
- package/es/HiBreadcrumb/HiStepConnector.js +15 -50
- package/es/HiBreadcrumb/HiStepContent.js +6 -30
- package/es/HiBreadcrumb/HiStepIcon.js +17 -42
- package/es/HiBreadcrumb/HiStepLabel.js +17 -47
- package/es/HiBreadcrumb/HiStepper.js +6 -30
- package/es/HiBreadcrumb/index.js +0 -2
- package/es/HiButton/HiButton.js +12 -37
- package/es/HiButton/index.js +1 -5
- package/es/HiCell/CellAddress.js +12 -33
- package/es/HiCell/CellDate.js +10 -36
- package/es/HiCell/CellHiddenContent.js +8 -30
- package/es/HiCell/CellIcon.js +12 -36
- package/es/HiCell/CellImage.js +12 -34
- package/es/HiCell/CellNumeric.js +13 -40
- package/es/HiCell/CellPinToAction.js +9 -33
- package/es/HiCell/CellRate.js +17 -51
- package/es/HiCell/CellSentinel.js +12 -33
- package/es/HiCell/CellSentinelScore.js +9 -31
- package/es/HiCell/CellText.js +16 -52
- package/es/HiCell/CellTextStyled.js +13 -24
- package/es/HiCell/index.js +0 -10
- package/es/HiCheckbox/HiCheckbox.js +19 -56
- package/es/HiCheckbox/index.js +0 -2
- package/es/HiChip/HiChip.js +24 -47
- package/es/HiChip/HiChipSwitch.js +16 -59
- package/es/HiChip/index.js +0 -3
- package/es/HiColoredLabel/HiColoredLabel.js +47 -69
- package/es/HiColoredLabel/index.js +0 -2
- package/es/HiDatePicker/Caption.js +9 -21
- package/es/HiDatePicker/HiDatePicker.js +16 -88
- package/es/HiDatePicker/HiDatePickerMobile.js +18 -43
- package/es/HiDatePicker/HiDateRangePicker.js +38 -134
- package/es/HiDatePicker/HiDateRangeSelector.js +49 -130
- package/es/HiDatePicker/ListPicker.js +8 -38
- package/es/HiDatePicker/NavBar.js +12 -31
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +11 -28
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +11 -28
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +4 -26
- package/es/HiDatePicker/Overlays/Overlay.js +8 -25
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +8 -39
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +8 -31
- package/es/HiDatePicker/Overlays/index.js +0 -6
- package/es/HiDatePicker/Weekday.js +4 -9
- package/es/HiDatePicker/hiLocaleUtils.js +8 -20
- package/es/HiDatePicker/index.js +0 -2
- package/es/HiDatePicker/stylesheet.js +7 -13
- package/es/HiDialog/HiDialog.js +7 -19
- package/es/HiDialog/index.js +0 -2
- package/es/HiDotsStepper/HiDot.js +9 -38
- package/es/HiDotsStepper/HiDotsStepper.js +10 -37
- package/es/HiDotsStepper/index.js +0 -3
- package/es/HiExpansionPanel/HiExpansionPanel.js +16 -38
- package/es/HiExpansionPanel/index.js +1 -5
- package/es/HiForm/HiAddressField.js +10 -36
- package/es/HiForm/HiEmailField.js +5 -29
- package/es/HiForm/HiFormControl.js +31 -77
- package/es/HiForm/HiFormLabel.js +16 -42
- package/es/HiForm/HiInput.js +34 -92
- package/es/HiForm/HiPasswordField.js +8 -36
- package/es/HiForm/HiSearchField.js +3 -34
- package/es/HiForm/HiSlider.js +22 -57
- package/es/HiForm/HiTextField.js +22 -47
- package/es/HiForm/HiUpload.js +35 -95
- package/es/HiForm/HiUploadField.js +10 -32
- package/es/HiForm/HiUploadInput.js +24 -77
- package/es/HiForm/index.js +0 -12
- package/es/HiIcon/HiIcon.js +9 -34
- package/es/HiIcon/index.js +0 -2
- package/es/HiIconButton/HiIconButton.js +7 -22
- package/es/HiIconButton/index.js +0 -2
- package/es/HiListItemLink/HiListItemLink.js +7 -19
- package/es/HiListItemLink/index.js +0 -2
- package/es/HiLoader/HiLoader.js +6 -16
- package/es/HiLoader/index.js +0 -2
- package/es/HiNotice/HiKPI.js +17 -48
- package/es/HiNotice/HiKPINotice.js +6 -16
- package/es/HiNotice/index.js +0 -3
- package/es/HiPagination/HiPagination.js +1 -11
- package/es/HiPagination/index.js +0 -2
- package/es/HiPaymentMeans/HiPaymentMeans.js +31 -72
- package/es/HiPaymentMeans/index.js +0 -2
- package/es/HiPdfReader/HiPdfReader.js +24 -57
- package/es/HiPdfReader/index.js +0 -2
- package/es/HiPin/HiPin.js +16 -28
- package/es/HiPin/index.js +0 -2
- package/es/HiRadio/HiRadio.js +12 -23
- package/es/HiRadio/index.js +0 -2
- package/es/HiScrollStepper/HiScrollStepper.js +29 -67
- package/es/HiScrollStepper/index.js +0 -2
- package/es/HiSelect/HiDynamicSelect.js +32 -42
- package/es/HiSelect/HiDynamicSelectField.js +24 -48
- package/es/HiSelect/HiNestedSelect.js +65 -111
- package/es/HiSelect/HiNestedSelectContent.js +60 -86
- package/es/HiSelect/HiNestedSelectField.js +24 -48
- package/es/HiSelect/HiSelect.js +89 -187
- package/es/HiSelect/HiSelectContent.js +62 -97
- package/es/HiSelect/HiSelectField.js +25 -49
- package/es/HiSelect/HiSelectInput.js +24 -77
- package/es/HiSelect/HiSelectMobile.js +7 -44
- package/es/HiSelect/HiSuggestSelect.js +25 -81
- package/es/HiSelect/HiSuggestSelectField.js +15 -39
- package/es/HiSelect/index.js +2 -14
- package/es/HiSelectableList/HiSelectableList.js +34 -90
- package/es/HiSelectableList/HiSelectableListHierarchic.js +34 -60
- package/es/HiSelectableList/HiSelectableListItem.js +45 -88
- package/es/HiSelectableList/index.js +0 -4
- package/es/HiStepper/DefaultIndicator.js +1 -10
- package/es/HiStepper/HiStep.js +21 -51
- package/es/HiStepper/HiStepper.js +2 -15
- package/es/HiStepper/index.js +0 -3
- package/es/HiSwitch/HiSwitch.js +19 -43
- package/es/HiSwitch/HiSwitchState.js +22 -39
- package/es/HiSwitch/index.js +0 -3
- package/es/HiTable/HiCellBuilder.js +10 -65
- package/es/HiTable/HiTable.js +20 -48
- package/es/HiTable/HiTableBody.js +7 -24
- package/es/HiTable/HiTableHeader.js +18 -51
- package/es/HiTable/HiTableRow.js +12 -46
- package/es/HiTable/constants.js +48 -98
- package/es/HiTable/index.js +0 -2
- package/es/hi-svg-icons/HiAccount.js +4 -14
- package/es/hi-svg-icons/HiActivity.js +4 -14
- package/es/hi-svg-icons/HiAll.js +7 -18
- package/es/hi-svg-icons/HiBilling.js +4 -14
- package/es/hi-svg-icons/HiBriefcaseRescue.js +4 -14
- package/es/hi-svg-icons/HiBusiness.js +4 -14
- package/es/hi-svg-icons/HiCatalog.js +4 -14
- package/es/hi-svg-icons/HiCustomer.js +4 -14
- package/es/hi-svg-icons/HiDownload.js +4 -14
- package/es/hi-svg-icons/HiFinance.js +4 -14
- package/es/hi-svg-icons/HiFinanceMenu.js +4 -14
- package/es/hi-svg-icons/HiHostedPaymentPage.js +4 -14
- package/es/hi-svg-icons/HiHostedPaymentPageMenu.js +4 -14
- package/es/hi-svg-icons/HiIntegration.js +4 -14
- package/es/hi-svg-icons/HiIntegrationMenu.js +4 -14
- package/es/hi-svg-icons/HiIntelligence.js +4 -14
- package/es/hi-svg-icons/HiIntelligenceMenu.js +4 -14
- package/es/hi-svg-icons/HiInvoice.js +4 -14
- package/es/hi-svg-icons/HiInvoiceMenu.js +4 -14
- package/es/hi-svg-icons/HiLogoRounded.js +6 -17
- package/es/hi-svg-icons/HiOrder.js +4 -14
- package/es/hi-svg-icons/HiPaymentOrder.js +4 -14
- package/es/hi-svg-icons/HiPermission.js +4 -14
- package/es/hi-svg-icons/HiPriceGrid.js +4 -14
- package/es/hi-svg-icons/HiPrivate.js +4 -14
- package/es/hi-svg-icons/HiRoute.js +4 -14
- package/es/hi-svg-icons/HiRouteMenu.js +4 -14
- package/es/hi-svg-icons/HiRouteSwitch.js +7 -19
- package/es/hi-svg-icons/HiRouteSwitchMenu.js +7 -19
- package/es/hi-svg-icons/HiSettlement.js +4 -14
- package/es/hi-svg-icons/HiSizeLarge.js +4 -14
- package/es/hi-svg-icons/HiSizeMedium.js +4 -14
- package/es/hi-svg-icons/HiSizeSmall.js +4 -14
- package/es/hi-svg-icons/HiStore.js +4 -14
- package/es/hi-svg-icons/HiStoreMenu.js +4 -14
- package/es/hi-svg-icons/HiTransaction.js +4 -14
- package/es/hi-svg-icons/HiTransactionMenu.js +4 -14
- package/es/hi-svg-icons/HiUser.js +4 -14
- package/es/hi-svg-icons/HiVendor.js +4 -14
- package/es/hi-svg-icons/HiWidget.js +4 -14
- package/es/hi-svg-icons/index.js +0 -41
- package/es/hi-svg-images/HiLogo.js +4 -12
- package/es/hi-svg-images/HiLogoWhite.js +4 -12
- package/es/hi-svg-images/index.js +0 -3
- package/es/setupTest.js +2 -13
- package/es/styleguide/Wrapper.js +0 -6
- package/es/styles/MuiThemeProvider.js +15 -49
- package/es/styles/colorManipulator.js +15 -50
- package/es/styles/createBreakpoints.js +14 -29
- package/es/styles/createGenerateClassName.js +14 -24
- package/es/styles/createMixins.js +4 -10
- package/es/styles/createMuiTheme.js +11 -28
- package/es/styles/createPalette.js +67 -89
- package/es/styles/createStyles.js +0 -1
- package/es/styles/createTypography.js +15 -24
- package/es/styles/getStylesCreator.js +1 -14
- package/es/styles/getThemeProps.js +2 -7
- package/es/styles/index.js +0 -6
- package/es/styles/jssPreset.js +1 -11
- package/es/styles/makeStyles.js +2 -9
- package/es/styles/mergeClasses.js +5 -16
- package/es/styles/shadows.js +1 -4
- package/es/styles/shape.js +1 -2
- package/es/styles/spacing.js +1 -4
- package/es/styles/themeListener.js +2 -10
- package/es/styles/transitions.js +20 -35
- package/es/styles/withStyles.js +2 -9
- package/es/styles/zIndex.js +1 -2
- package/es/test-utils/createMount.js +2 -12
- package/es/test-utils/createRender.js +2 -9
- package/es/test-utils/createShallow.js +6 -17
- package/es/test-utils/getClasses.js +1 -4
- package/es/test-utils/index.js +0 -6
- package/es/test-utils/until.js +3 -14
- package/es/test-utils/unwrap.js +0 -1
- package/es/theme/palette.js +2 -7
- package/es/theme/typography.js +7 -15
- package/es/theme.js +2 -8
- package/es/transitions/utils.js +3 -7
- package/es/utils/exactProp.js +3 -13
- package/es/utils/helpers.js +19 -58
- package/es/withMobileDialog/index.js +0 -2
- package/es/withMobileDialog/withMobileDialog.js +3 -12
- package/hi-svg-icons/HiAccount.js +4 -14
- package/hi-svg-icons/HiActivity.js +4 -14
- package/hi-svg-icons/HiAll.js +7 -18
- package/hi-svg-icons/HiBilling.js +4 -14
- package/hi-svg-icons/HiBriefcaseRescue.js +4 -14
- package/hi-svg-icons/HiBusiness.js +4 -14
- package/hi-svg-icons/HiCatalog.js +4 -14
- package/hi-svg-icons/HiCustomer.js +4 -14
- package/hi-svg-icons/HiDownload.js +4 -14
- package/hi-svg-icons/HiFinance.js +4 -14
- package/hi-svg-icons/HiFinanceMenu.js +4 -14
- package/hi-svg-icons/HiHostedPaymentPage.js +4 -14
- package/hi-svg-icons/HiHostedPaymentPageMenu.js +4 -14
- package/hi-svg-icons/HiIntegration.js +4 -14
- package/hi-svg-icons/HiIntegrationMenu.js +4 -14
- package/hi-svg-icons/HiIntelligence.js +4 -14
- package/hi-svg-icons/HiIntelligenceMenu.js +4 -14
- package/hi-svg-icons/HiInvoice.js +4 -14
- package/hi-svg-icons/HiInvoiceMenu.js +4 -14
- package/hi-svg-icons/HiLogoRounded.js +6 -17
- package/hi-svg-icons/HiOrder.js +4 -14
- package/hi-svg-icons/HiPaymentOrder.js +4 -14
- package/hi-svg-icons/HiPermission.js +4 -14
- package/hi-svg-icons/HiPriceGrid.js +4 -14
- package/hi-svg-icons/HiPrivate.js +4 -14
- package/hi-svg-icons/HiRoute.js +4 -14
- package/hi-svg-icons/HiRouteMenu.js +4 -14
- package/hi-svg-icons/HiRouteSwitch.js +7 -19
- package/hi-svg-icons/HiRouteSwitchMenu.js +7 -19
- package/hi-svg-icons/HiSettlement.js +4 -14
- package/hi-svg-icons/HiSizeLarge.js +4 -14
- package/hi-svg-icons/HiSizeMedium.js +4 -14
- package/hi-svg-icons/HiSizeSmall.js +4 -14
- package/hi-svg-icons/HiStore.js +4 -14
- package/hi-svg-icons/HiStoreMenu.js +4 -14
- package/hi-svg-icons/HiTransaction.js +4 -14
- package/hi-svg-icons/HiTransactionMenu.js +4 -14
- package/hi-svg-icons/HiUser.js +4 -14
- package/hi-svg-icons/HiVendor.js +4 -14
- package/hi-svg-icons/HiWidget.js +4 -14
- package/hi-svg-icons/index.js +0 -41
- package/hi-svg-images/HiLogo.js +4 -12
- package/hi-svg-images/HiLogoWhite.js +4 -12
- package/hi-svg-images/index.js +0 -3
- package/package.json +2 -2
- package/setupTest.js +2 -13
- package/styleguide/Wrapper.js +0 -6
- package/styles/MuiThemeProvider.js +15 -49
- package/styles/colorManipulator.js +15 -50
- package/styles/createBreakpoints.js +14 -29
- package/styles/createGenerateClassName.js +14 -24
- package/styles/createMixins.js +4 -10
- package/styles/createMuiTheme.js +11 -28
- package/styles/createPalette.js +67 -89
- package/styles/createStyles.js +0 -1
- package/styles/createTypography.js +15 -24
- package/styles/getStylesCreator.js +1 -14
- package/styles/getThemeProps.js +2 -7
- package/styles/index.js +0 -6
- package/styles/jssPreset.js +1 -11
- package/styles/makeStyles.js +2 -9
- package/styles/mergeClasses.js +5 -16
- package/styles/shadows.js +1 -4
- package/styles/shape.js +1 -2
- package/styles/spacing.js +1 -4
- package/styles/themeListener.js +2 -10
- package/styles/transitions.js +20 -35
- package/styles/withStyles.js +2 -9
- package/styles/zIndex.js +1 -2
- package/test-utils/createMount.js +2 -12
- package/test-utils/createRender.js +2 -9
- package/test-utils/createShallow.js +6 -17
- package/test-utils/getClasses.js +1 -4
- package/test-utils/index.js +0 -6
- package/test-utils/until.js +3 -14
- package/test-utils/unwrap.js +0 -1
- package/theme/palette.js +2 -7
- package/theme/typography.js +7 -15
- package/theme.js +2 -8
- package/transitions/utils.js +3 -7
- package/utils/exactProp.js +3 -13
- package/utils/helpers.js +19 -58
- package/withMobileDialog/index.js +0 -2
- package/withMobileDialog/withMobileDialog.js +3 -12
package/es/HiForm/HiSlider.js
CHANGED
@@ -1,41 +1,25 @@
|
|
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
13
|
-
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
15
|
-
|
16
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
17
|
-
|
18
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
19
|
-
|
20
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
21
|
-
|
22
14
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
23
|
-
|
24
15
|
var _react = _interopRequireDefault(require("react"));
|
25
|
-
|
26
16
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
27
|
-
|
28
17
|
var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
|
29
|
-
|
30
18
|
var _HiIcon = _interopRequireDefault(require("../HiIcon/HiIcon"));
|
31
|
-
|
32
19
|
var _classnames = _interopRequireDefault(require("classnames"));
|
33
|
-
|
34
20
|
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); }; }
|
35
|
-
|
36
21
|
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; } }
|
37
|
-
|
38
|
-
var styles = function styles(theme) {
|
22
|
+
var styles = exports.styles = function styles(theme) {
|
39
23
|
return {
|
40
24
|
barContainer: {
|
41
25
|
width: '100%',
|
@@ -111,30 +95,21 @@ var styles = function styles(theme) {
|
|
111
95
|
}
|
112
96
|
};
|
113
97
|
};
|
98
|
+
|
114
99
|
/**
|
115
100
|
* HiSlider component
|
116
101
|
*/
|
117
|
-
|
118
|
-
|
119
|
-
exports.styles = styles;
|
120
|
-
|
121
102
|
var HiSlider = /*#__PURE__*/function (_React$Component) {
|
122
103
|
(0, _inherits2.default)(HiSlider, _React$Component);
|
123
|
-
|
124
104
|
var _super = _createSuper(HiSlider);
|
125
|
-
|
126
105
|
function HiSlider(props) {
|
127
106
|
var _this;
|
128
|
-
|
129
107
|
(0, _classCallCheck2.default)(this, HiSlider);
|
130
108
|
_this = _super.call(this, props);
|
131
|
-
|
132
109
|
_this.handleChange = function (event) {
|
133
110
|
_this.props.onChange(parseFloat(event.target.value));
|
134
|
-
|
135
111
|
_this.textValueWidth = _this.textValue.offsetWidth;
|
136
112
|
};
|
137
|
-
|
138
113
|
_this.handleFocus = function (isFocused) {
|
139
114
|
return function () {
|
140
115
|
_this.setState({
|
@@ -142,19 +117,17 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
|
|
142
117
|
});
|
143
118
|
};
|
144
119
|
};
|
145
|
-
|
146
120
|
_this.state = {
|
147
121
|
focused: false
|
148
122
|
};
|
149
123
|
return _this;
|
150
124
|
}
|
125
|
+
|
151
126
|
/**
|
152
127
|
* Measures several components once they are mounted.
|
153
128
|
* If the value and a label (left or right) are hovered,
|
154
129
|
* we hide this label.
|
155
130
|
*/
|
156
|
-
|
157
|
-
|
158
131
|
(0, _createClass2.default)(HiSlider, [{
|
159
132
|
key: "componentDidMount",
|
160
133
|
value: function componentDidMount() {
|
@@ -162,19 +135,17 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
|
|
162
135
|
this.rightLabelWidth = this.rightLabel.offsetWidth;
|
163
136
|
this.textValueWidth = this.textValue.offsetWidth;
|
164
137
|
this.barContainerWidth = this.barContainer.offsetWidth;
|
165
|
-
|
166
138
|
var _this$getHovering = this.getHovering(),
|
167
|
-
|
168
|
-
|
169
|
-
|
139
|
+
hoveringLeft = _this$getHovering.hoveringLeft,
|
140
|
+
hoveringRight = _this$getHovering.hoveringRight;
|
170
141
|
if (hoveringLeft || hoveringRight) {
|
171
142
|
this.forceUpdate();
|
172
143
|
}
|
173
144
|
}
|
145
|
+
|
174
146
|
/**
|
175
147
|
* Calculates if the labels are hovered.
|
176
148
|
*/
|
177
|
-
|
178
149
|
}, {
|
179
150
|
key: "getHovering",
|
180
151
|
value: function getHovering() {
|
@@ -190,28 +161,25 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
|
|
190
161
|
key: "render",
|
191
162
|
value: function render() {
|
192
163
|
var _this2 = this;
|
193
|
-
|
194
164
|
var _this$props = this.props,
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
165
|
+
classes = _this$props.classes,
|
166
|
+
className = _this$props.className,
|
167
|
+
min = _this$props.min,
|
168
|
+
max = _this$props.max,
|
169
|
+
leftLabel = _this$props.leftLabel,
|
170
|
+
rightLabel = _this$props.rightLabel,
|
171
|
+
step = _this$props.step,
|
172
|
+
suffix = _this$props.suffix,
|
173
|
+
id = _this$props.id,
|
174
|
+
label = _this$props.label,
|
175
|
+
value = _this$props.value,
|
176
|
+
theme = _this$props.theme;
|
207
177
|
var focused = this.state.focused;
|
208
178
|
var ratio = (value - min) / (max - min);
|
209
179
|
var percentage = ratio * 100;
|
210
|
-
|
211
180
|
var _this$getHovering2 = this.getHovering(),
|
212
|
-
|
213
|
-
|
214
|
-
|
181
|
+
hoveringLeft = _this$getHovering2.hoveringLeft,
|
182
|
+
hoveringRight = _this$getHovering2.hoveringRight;
|
215
183
|
var barColor = focused ? theme.palette.primary.dark : theme.palette.primary.main;
|
216
184
|
return (
|
217
185
|
/*#__PURE__*/
|
@@ -278,11 +246,8 @@ var HiSlider = /*#__PURE__*/function (_React$Component) {
|
|
278
246
|
}]);
|
279
247
|
return HiSlider;
|
280
248
|
}(_react.default.Component);
|
281
|
-
|
282
|
-
var _default = (0, _withStyles.default)(styles, {
|
249
|
+
var _default = exports.default = (0, _withStyles.default)(styles, {
|
283
250
|
hiComponent: true,
|
284
251
|
name: 'HiSlider',
|
285
252
|
withTheme: true
|
286
|
-
})(HiSlider);
|
287
|
-
|
288
|
-
exports.default = _default;
|
253
|
+
})(HiSlider);
|
package/es/HiForm/HiTextField.js
CHANGED
@@ -1,54 +1,35 @@
|
|
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.default = void 0;
|
9
|
-
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
11
|
-
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
13
|
-
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
15
|
-
|
16
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
17
|
-
|
18
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
19
|
-
|
20
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
21
|
-
|
22
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
23
|
-
|
24
15
|
var _react = _interopRequireDefault(require("react"));
|
25
|
-
|
26
16
|
var _HiFormControl = _interopRequireDefault(require("./HiFormControl"));
|
27
|
-
|
28
17
|
var _HiInput = _interopRequireDefault(require("./HiInput"));
|
29
|
-
|
30
18
|
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
|
-
|
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; } }
|
33
|
-
|
19
|
+
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; } } // @inheritedComponent TextField
|
34
20
|
/**
|
35
21
|
* Champs input pour formulaire
|
36
22
|
*/
|
37
23
|
var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
|
38
24
|
(0, _inherits2.default)(HiTextField, _React$PureComponent);
|
39
|
-
|
40
25
|
var _super = _createSuper(HiTextField);
|
41
|
-
|
42
26
|
function HiTextField(props) {
|
43
27
|
var _this;
|
44
|
-
|
45
28
|
(0, _classCallCheck2.default)(this, HiTextField);
|
46
29
|
_this = _super.call(this, props);
|
47
|
-
|
48
30
|
_this.focus = function () {
|
49
31
|
_this.input.focus();
|
50
32
|
};
|
51
|
-
|
52
33
|
_this.state = {
|
53
34
|
nbChars: props.value ? props.value.length : 0
|
54
35
|
};
|
@@ -57,7 +38,6 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
|
|
57
38
|
_this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)(_this));
|
58
39
|
return _this;
|
59
40
|
}
|
60
|
-
|
61
41
|
(0, _createClass2.default)(HiTextField, [{
|
62
42
|
key: "handleBlur",
|
63
43
|
value: function handleBlur(event) {
|
@@ -69,12 +49,10 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
|
|
69
49
|
key: "handleChange",
|
70
50
|
value: function handleChange(event) {
|
71
51
|
var value = event.target.value;
|
72
|
-
|
73
52
|
if (value.length <= this.props.maxLength) {
|
74
53
|
if (this.props.onChange) {
|
75
54
|
this.props.onChange(event);
|
76
55
|
}
|
77
|
-
|
78
56
|
if (this.props.multiline === true) {
|
79
57
|
this.setState({
|
80
58
|
nbChars: value.length
|
@@ -93,28 +71,27 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
|
|
93
71
|
key: "render",
|
94
72
|
value: function render() {
|
95
73
|
var _this2 = this;
|
96
|
-
|
97
74
|
var _this$props = this.props,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
75
|
+
className = _this$props.className,
|
76
|
+
disabled = _this$props.disabled,
|
77
|
+
error = _this$props.error,
|
78
|
+
errorText = _this$props.errorText,
|
79
|
+
id = _this$props.id,
|
80
|
+
label = _this$props.label,
|
81
|
+
helperText = _this$props.helperText,
|
82
|
+
helperIcon = _this$props.helperIcon,
|
83
|
+
fullWidth = _this$props.fullWidth,
|
84
|
+
required = _this$props.required,
|
85
|
+
type = _this$props.type,
|
86
|
+
multiline = _this$props.multiline,
|
87
|
+
placeholder = _this$props.placeholder,
|
88
|
+
value = _this$props.value,
|
89
|
+
HiInputProps = _this$props.HiInputProps,
|
90
|
+
HiInputLabelProps = _this$props.HiInputLabelProps,
|
91
|
+
name = _this$props.name,
|
92
|
+
rows = _this$props.rows,
|
93
|
+
maxLength = _this$props.maxLength,
|
94
|
+
customRef = _this$props.customRef;
|
118
95
|
var nbChars = this.state.nbChars;
|
119
96
|
return /*#__PURE__*/_react.default.createElement(_HiFormControl.default, {
|
120
97
|
label: label,
|
@@ -156,7 +133,6 @@ var HiTextField = /*#__PURE__*/function (_React$PureComponent) {
|
|
156
133
|
}]);
|
157
134
|
return HiTextField;
|
158
135
|
}(_react.default.PureComponent);
|
159
|
-
|
160
136
|
HiTextField.defaultProps = {
|
161
137
|
name: '',
|
162
138
|
type: 'text',
|
@@ -170,5 +146,4 @@ HiTextField.defaultProps = {
|
|
170
146
|
multiline: false,
|
171
147
|
maxLength: 280
|
172
148
|
};
|
173
|
-
var _default = HiTextField;
|
174
|
-
exports.default = _default;
|
149
|
+
var _default = exports.default = HiTextField;
|
package/es/HiForm/HiUpload.js
CHANGED
@@ -1,45 +1,27 @@
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
15
|
-
|
16
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
17
|
-
|
18
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
19
|
-
|
20
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
21
|
-
|
22
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
23
|
-
|
24
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
25
|
-
|
26
16
|
var _react = _interopRequireDefault(require("react"));
|
27
|
-
|
28
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
29
|
-
|
30
18
|
var _index = _interopRequireDefault(require("keycode/index"));
|
31
|
-
|
32
19
|
var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
|
33
|
-
|
34
20
|
var _HiUploadInput = _interopRequireDefault(require("./HiUploadInput"));
|
35
|
-
|
36
21
|
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
37
|
-
|
38
22
|
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); }; }
|
39
|
-
|
40
23
|
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; } }
|
41
|
-
|
42
|
-
var styles = function styles(theme) {
|
24
|
+
var styles = exports.styles = function styles(theme) {
|
43
25
|
return {
|
44
26
|
flexContainer: {
|
45
27
|
display: 'flex',
|
@@ -52,8 +34,8 @@ var styles = function styles(theme) {
|
|
52
34
|
padding: '24px',
|
53
35
|
borderRadius: '2px',
|
54
36
|
backgroundColor: theme.palette.background2,
|
55
|
-
border: "1px solid ".concat(theme.palette.
|
56
|
-
color: "".concat(theme.palette.
|
37
|
+
border: "1px solid ".concat(theme.palette.warning.main),
|
38
|
+
color: "".concat(theme.palette.warning.main, " !important"),
|
57
39
|
fontSize: '80px'
|
58
40
|
},
|
59
41
|
dragOver: {},
|
@@ -66,13 +48,13 @@ var styles = function styles(theme) {
|
|
66
48
|
color: "".concat(theme.palette.neutral.main, " !important")
|
67
49
|
},
|
68
50
|
complete: {
|
69
|
-
border: "1px solid ".concat(theme.palette.
|
70
|
-
color: "".concat(theme.palette.
|
51
|
+
border: "1px solid ".concat(theme.palette.success.main),
|
52
|
+
color: "".concat(theme.palette.success.main, " !important"),
|
71
53
|
fontSize: '32px'
|
72
54
|
},
|
73
55
|
error: {
|
74
|
-
border: "1px solid ".concat(theme.palette.
|
75
|
-
color: "".concat(theme.palette.
|
56
|
+
border: "1px solid ".concat(theme.palette.error.main),
|
57
|
+
color: "".concat(theme.palette.error.main, " !important")
|
76
58
|
},
|
77
59
|
fileButton: {
|
78
60
|
marginRight: 8,
|
@@ -87,34 +69,24 @@ var styles = function styles(theme) {
|
|
87
69
|
focusable: {}
|
88
70
|
};
|
89
71
|
};
|
90
|
-
|
91
|
-
exports.styles = styles;
|
92
|
-
|
93
72
|
var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
94
73
|
(0, _inherits2.default)(HiUpload, _React$PureComponent);
|
95
|
-
|
96
74
|
var _super = _createSuper(HiUpload);
|
97
|
-
|
98
75
|
function HiUpload() {
|
99
76
|
var _this;
|
100
|
-
|
101
77
|
(0, _classCallCheck2.default)(this, HiUpload);
|
102
78
|
_this = _super.call(this);
|
103
|
-
|
79
|
+
// Action when files are dropped on the field
|
104
80
|
_this.handleDrop = function (event) {
|
105
81
|
if (event.path[0].id === _this.uploadIconRef.props.id) {
|
106
82
|
event.preventDefault();
|
107
83
|
event.stopPropagation();
|
108
|
-
|
109
84
|
if (_this.state.droppable) {
|
110
85
|
var index = _this.getNextInputIndex();
|
111
|
-
|
112
86
|
var param = _this.handleFile(event.dataTransfer.files, index);
|
113
|
-
|
114
87
|
_this.setState({
|
115
88
|
dragOver: false
|
116
89
|
});
|
117
|
-
|
118
90
|
_this.props.onChange(param, 0);
|
119
91
|
} else {
|
120
92
|
_this.setState({
|
@@ -123,20 +95,17 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
123
95
|
}
|
124
96
|
}
|
125
97
|
};
|
126
|
-
|
98
|
+
// Action when files are dragged over the field.
|
127
99
|
_this.handleDragEnter = function (event) {
|
128
100
|
event.preventDefault();
|
129
101
|
event.stopPropagation();
|
130
|
-
|
131
102
|
if (event.path[0].id === _this.uploadIconRef.props.id) {
|
132
103
|
if (event.dataTransfer.items.length !== 1) {
|
133
104
|
event.dataTransfer.dropEffect = 'none';
|
134
|
-
|
135
105
|
_this.props.onChange({
|
136
106
|
errorMessage: _this.props.translations.errorDragEnter,
|
137
107
|
value: null
|
138
108
|
}, 0);
|
139
|
-
|
140
109
|
_this.setState({
|
141
110
|
dragOver: true
|
142
111
|
});
|
@@ -148,59 +117,47 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
148
117
|
}
|
149
118
|
}
|
150
119
|
};
|
151
|
-
|
120
|
+
// Action when files are not dragged over the field anymore.
|
152
121
|
_this.handleDragLeave = function (event) {
|
153
122
|
event.preventDefault();
|
154
123
|
event.stopPropagation();
|
155
|
-
|
156
124
|
if (event.path[0].id === _this.uploadIconRef.props.id && event.relatedTarget.parentElement !== _this.uploadFieldRef) {
|
157
125
|
_this.props.onChange({
|
158
126
|
errorMessage: '',
|
159
127
|
value: null
|
160
128
|
}, 0);
|
161
|
-
|
162
129
|
_this.setState({
|
163
130
|
droppable: false,
|
164
131
|
dragOver: false
|
165
132
|
});
|
166
133
|
}
|
167
134
|
};
|
168
|
-
|
169
135
|
_this.handleChange = function (event) {
|
170
136
|
var index = _this.getNextInputIndex();
|
171
|
-
|
172
137
|
var param = _this.handleFile(event.target.files, index);
|
173
|
-
|
174
138
|
_this.props.onChange(param, index);
|
175
139
|
};
|
176
|
-
|
177
140
|
_this.handleEmptyField = function (event) {
|
178
141
|
event.target.value = '';
|
179
142
|
};
|
180
|
-
|
181
143
|
_this.handleKeyPress = function (event) {
|
182
144
|
var key = (0, _index.default)(event);
|
183
|
-
|
184
145
|
if (key === 'enter' || key === 'space') {
|
185
146
|
event.preventDefault();
|
186
|
-
|
187
147
|
_this.uploadInput.click();
|
188
148
|
}
|
189
149
|
};
|
190
|
-
|
150
|
+
// Handles the file wether it is selected via the input or dropped on it.
|
191
151
|
_this.handleFile = function (files, index) {
|
192
152
|
var error = false;
|
193
153
|
var errorMessage = '';
|
194
154
|
var file = null;
|
195
|
-
|
196
155
|
if (files.length === 1) {
|
197
156
|
file = files[0];
|
198
|
-
|
199
157
|
if (_this.props.inputs[index] && file.size > _this.props.inputs[index].maxSize) {
|
200
158
|
errorMessage += _this.props.translations.errorSize.replace('maxSize', _this.props.inputs[index].maxSize / 1000000);
|
201
159
|
error = true;
|
202
160
|
}
|
203
|
-
|
204
161
|
if (_this.props.inputs[index] && _this.props.inputs[index].acceptedTypes && _this.props.inputs[index].acceptedTypes.length !== 0 && _this.props.inputs[index].acceptedTypes.indexOf(file.type) === -1) {
|
205
162
|
errorMessage += _this.props.translations.errorType;
|
206
163
|
error = true;
|
@@ -208,26 +165,23 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
208
165
|
} else {
|
209
166
|
errorMessage = _this.props.translations.errorDropMultiple;
|
210
167
|
}
|
211
|
-
|
212
168
|
return {
|
213
169
|
errorMessage: errorMessage,
|
214
170
|
error: error,
|
215
171
|
value: file
|
216
172
|
};
|
217
173
|
};
|
218
|
-
|
219
174
|
_this.createInputs = function (others) {
|
220
175
|
var _this$props = _this.props,
|
221
|
-
|
222
|
-
|
223
|
-
var files = inputs;
|
176
|
+
inputs = _this$props.inputs,
|
177
|
+
values = _this$props.values;
|
178
|
+
var files = inputs;
|
224
179
|
|
180
|
+
// unlimited number of files
|
225
181
|
if (inputs.length === 0) {
|
226
182
|
files = values;
|
227
183
|
}
|
228
|
-
|
229
184
|
var inputComponents = [];
|
230
|
-
|
231
185
|
for (var i = 0; i < files.length; i += 1) {
|
232
186
|
if (files.length > 1 || values[i] && values[i].value) {
|
233
187
|
inputComponents.push( /*#__PURE__*/_react.default.createElement(_HiUploadInput.default, (0, _extends2.default)({
|
@@ -245,19 +199,17 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
245
199
|
}, others)));
|
246
200
|
}
|
247
201
|
}
|
248
|
-
|
249
202
|
return inputComponents;
|
250
203
|
};
|
251
|
-
|
252
204
|
_this.uploadFieldRef = void 0;
|
253
205
|
_this.state = {
|
254
206
|
dragOver: false,
|
255
207
|
droppable: false
|
256
208
|
};
|
257
209
|
return _this;
|
258
|
-
}
|
259
|
-
|
210
|
+
}
|
260
211
|
|
212
|
+
// When component mounts, we add eventListeners to handle the file drag and drop
|
261
213
|
(0, _createClass2.default)(HiUpload, [{
|
262
214
|
key: "componentDidMount",
|
263
215
|
value: function componentDidMount() {
|
@@ -281,8 +233,9 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
281
233
|
}, {
|
282
234
|
key: "getNextInputIndex",
|
283
235
|
value: function getNextInputIndex() {
|
284
|
-
var index = 0;
|
236
|
+
var index = 0;
|
285
237
|
|
238
|
+
// Add an input at the end
|
286
239
|
if (!this.props.inputs.length) {
|
287
240
|
index = this.props.values.length + 1;
|
288
241
|
} else {
|
@@ -294,31 +247,27 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
294
247
|
}
|
295
248
|
}
|
296
249
|
}
|
297
|
-
|
298
250
|
return index;
|
299
|
-
}
|
300
|
-
|
251
|
+
}
|
301
252
|
}, {
|
302
253
|
key: "render",
|
303
254
|
value: function render() {
|
304
|
-
var
|
305
|
-
_classNames2,
|
306
|
-
_this2 = this;
|
307
|
-
|
255
|
+
var _this2 = this;
|
308
256
|
var _this$props2 = this.props,
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
257
|
+
id = _this$props2.id,
|
258
|
+
inputs = _this$props2.inputs,
|
259
|
+
classes = _this$props2.classes,
|
260
|
+
values = _this$props2.values,
|
261
|
+
focused = _this$props2.focused,
|
262
|
+
others = (0, _objectWithoutProperties2.default)(_this$props2, ["id", "inputs", "classes", "values", "focused"]);
|
315
263
|
var _this$state = this.state,
|
316
|
-
|
317
|
-
|
264
|
+
dragOver = _this$state.dragOver,
|
265
|
+
droppable = _this$state.droppable;
|
318
266
|
var complete = true;
|
319
267
|
var empty = true;
|
320
|
-
var error = false;
|
268
|
+
var error = false;
|
321
269
|
|
270
|
+
// For unlimited inputs: always grey
|
322
271
|
if (!inputs.length) {
|
323
272
|
complete = false;
|
324
273
|
} else if (values.length === 0 || inputs.length > 0 && inputs.length !== values.length) {
|
@@ -326,7 +275,6 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
326
275
|
} else {
|
327
276
|
for (var i = 0, len = values.length; i < len; i += 1) {
|
328
277
|
var value = values[i];
|
329
|
-
|
330
278
|
if (value !== undefined) {
|
331
279
|
complete = value.value === null || value.error ? false : complete;
|
332
280
|
empty = value.value !== null && !value.error ? false : empty;
|
@@ -336,10 +284,8 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
336
284
|
}
|
337
285
|
}
|
338
286
|
}
|
339
|
-
|
340
|
-
var statusClass = (0, _classnames.default)(classes.statusIcon, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.empty, empty), (0, _defineProperty2.default)(_classNames, classes.complete, complete), _classNames));
|
287
|
+
var statusClass = (0, _classnames.default)(classes.statusIcon, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, classes.empty, empty), classes.complete, complete));
|
341
288
|
var icon;
|
342
|
-
|
343
289
|
if (error) {
|
344
290
|
icon = 'warning';
|
345
291
|
} else if (complete) {
|
@@ -347,14 +293,11 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
347
293
|
} else {
|
348
294
|
icon = 'file_upload';
|
349
295
|
}
|
350
|
-
|
351
296
|
var focusable = true;
|
352
|
-
|
353
297
|
if (complete && values.length > 1) {
|
354
298
|
focusable = false;
|
355
299
|
}
|
356
|
-
|
357
|
-
var iconClass = (0, _classnames.default)(statusClass, classes.fileButton, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.dragOver, dragOver), (0, _defineProperty2.default)(_classNames2, classes.droppable, droppable), (0, _defineProperty2.default)(_classNames2, classes.focused, focused), (0, _defineProperty2.default)(_classNames2, classes.error, error && !focused), (0, _defineProperty2.default)(_classNames2, classes.focusable, focusable), _classNames2));
|
300
|
+
var iconClass = (0, _classnames.default)(statusClass, classes.fileButton, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, classes.dragOver, dragOver), classes.droppable, droppable), classes.focused, focused), classes.error, error && !focused), classes.focusable, focusable));
|
358
301
|
return /*#__PURE__*/_react.default.createElement("div", {
|
359
302
|
className: classes.flexContainer
|
360
303
|
}, /*#__PURE__*/_react.default.createElement("label", {
|
@@ -387,10 +330,7 @@ var HiUpload = /*#__PURE__*/function (_React$PureComponent) {
|
|
387
330
|
}]);
|
388
331
|
return HiUpload;
|
389
332
|
}(_react.default.PureComponent);
|
390
|
-
|
391
|
-
var _default = (0, _withStyles.default)(styles, {
|
333
|
+
var _default = exports.default = (0, _withStyles.default)(styles, {
|
392
334
|
hiComponent: true,
|
393
335
|
name: 'HmuiHiUpload'
|
394
|
-
})(HiUpload);
|
395
|
-
|
396
|
-
exports.default = _default;
|
336
|
+
})(HiUpload);
|