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