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