@hipay/hipay-material-ui 2.3.1-rc4 → 2.3.1-rc5
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/HiAlertModal/HiAlertModal.js +77 -48
- package/HiAlertModal/index.js +15 -1
- package/HiAppBar/HiAppBar.js +63 -34
- package/HiAppBar/index.js +15 -1
- package/HiBadge/HiBadge.js +29 -10
- package/HiBadge/index.js +15 -1
- package/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/HiBreadcrumb/HiStep.js +58 -35
- package/HiBreadcrumb/HiStepConnector.js +58 -33
- package/HiBreadcrumb/HiStepContent.js +47 -26
- package/HiBreadcrumb/HiStepIcon.js +47 -27
- package/HiBreadcrumb/HiStepLabel.js +62 -37
- package/HiBreadcrumb/HiStepper.js +44 -24
- package/HiBreadcrumb/index.js +15 -1
- package/HiButton/HiButton.js +27 -9
- package/HiButton/index.js +13 -2
- package/HiCell/CellAddress.js +39 -21
- package/HiCell/CellDate.js +44 -27
- package/HiCell/CellIcon.js +48 -29
- package/HiCell/CellImage.js +41 -24
- package/HiCell/CellNumeric.js +45 -26
- package/HiCell/CellPinToAction.js +41 -20
- package/HiCell/CellRate.js +56 -33
- package/HiCell/CellSentinel.js +41 -23
- package/HiCell/CellSentinelScore.js +43 -24
- package/HiCell/CellText.js +54 -37
- package/HiCell/CellTextStyled.js +21 -8
- package/HiCell/index.js +79 -9
- package/HiCheckbox/HiCheckbox.js +61 -36
- package/HiCheckbox/index.js +15 -1
- package/HiChip/HiChip.js +44 -24
- package/HiChip/HiChipSwitch.js +73 -47
- package/HiChip/index.js +23 -2
- package/HiColoredLabel/HiColoredLabel.js +52 -28
- package/HiColoredLabel/index.js +15 -1
- package/HiDatePicker/Caption.js +28 -11
- package/HiDatePicker/HiDatePicker.js +131 -101
- package/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/HiDatePicker/HiDateRangePicker.js +168 -139
- package/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/HiDatePicker/ListPicker.js +54 -34
- package/HiDatePicker/NavBar.js +45 -18
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/Overlay.js +35 -18
- package/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/index.js +47 -5
- package/HiDatePicker/Weekday.js +13 -3
- package/HiDatePicker/hiLocaleUtils.js +8 -1
- package/HiDatePicker/index.js +15 -1
- package/HiDatePicker/stylesheet.js +22 -9
- package/HiDotsStepper/HiDot.js +56 -31
- package/HiDotsStepper/HiDotsStepper.js +47 -28
- package/HiDotsStepper/index.js +23 -2
- package/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/HiExpansionPanel/index.js +13 -2
- package/HiForm/HiAddressField.js +46 -29
- package/HiForm/HiEmailField.js +45 -27
- package/HiForm/HiFormControl.js +105 -72
- package/HiForm/HiFormLabel.js +53 -30
- package/HiForm/HiInput.js +89 -62
- package/HiForm/HiPasswordField.js +55 -29
- package/HiForm/HiSearchField.js +43 -28
- package/HiForm/HiSlider.js +64 -41
- package/HiForm/HiTextField.js +46 -29
- package/HiForm/HiUpload.js +76 -53
- package/HiForm/HiUploadField.js +40 -25
- package/HiForm/HiUploadInput.js +84 -56
- package/HiForm/index.js +95 -11
- package/HiIcon/HiIcon.js +44 -22
- package/HiIcon/index.js +15 -1
- package/HiIconButton/HiIconButton.js +40 -18
- package/HiIconButton/index.js +15 -1
- package/HiLoader/HiLoader.js +24 -9
- package/HiLoader/index.js +15 -1
- package/HiMap/HiMap.js +76 -51
- package/HiMap/HiMapExpand.js +64 -39
- package/HiMap/index.js +23 -2
- package/HiNotice/HiKPI.js +56 -33
- package/HiNotice/HiKPINotice.js +21 -7
- package/HiNotice/index.js +23 -2
- package/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/HiPaymentMeans/index.js +15 -1
- package/HiPdfReader/HiPdfReader.js +78 -52
- package/HiPdfReader/index.js +15 -1
- package/HiPin/HiPin.js +30 -9
- package/HiPin/index.js +15 -1
- package/HiRadio/HiRadio.js +24 -7
- package/HiRadio/index.js +15 -1
- package/HiSelect/HiDynamicSelect.js +58 -40
- package/HiSelect/HiDynamicSelectField.js +40 -22
- package/HiSelect/HiNestedSelect.js +85 -55
- package/HiSelect/HiNestedSelectContent.js +72 -46
- package/HiSelect/HiNestedSelectField.js +40 -22
- package/HiSelect/HiSelect.js +161 -123
- package/HiSelect/HiSelectContent.js +104 -73
- package/HiSelect/HiSelectField.js +40 -22
- package/HiSelect/HiSelectInput.js +94 -63
- package/HiSelect/HiSelectMobile.js +54 -35
- package/HiSelect/HiSuggestSelect.js +83 -56
- package/HiSelect/HiSuggestSelectField.js +40 -22
- package/HiSelect/index.js +85 -8
- package/HiSelectableList/HiSelectableList.js +80 -49
- package/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/HiSelectableList/HiSelectableListItem.js +101 -66
- package/HiSelectableList/index.js +31 -3
- package/HiSwitch/HiSwitch.js +45 -20
- package/HiSwitch/HiSwitchState.js +36 -15
- package/HiSwitch/index.js +23 -2
- package/HiTable/HiCellBuilder.js +69 -43
- package/HiTable/HiTable.js +46 -28
- package/HiTable/HiTableBody.js +34 -19
- package/HiTable/HiTableHeader.js +50 -29
- package/HiTable/HiTableRow.js +56 -29
- package/HiTable/constants.js +94 -43
- package/HiTable/index.js +15 -1
- package/es/HiAlertModal/HiAlertModal.js +77 -48
- package/es/HiAlertModal/index.js +15 -1
- package/es/HiAppBar/HiAppBar.js +63 -34
- package/es/HiAppBar/index.js +15 -1
- package/es/HiBadge/HiBadge.js +29 -10
- package/es/HiBadge/index.js +15 -1
- package/es/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/es/HiBreadcrumb/HiStep.js +58 -35
- package/es/HiBreadcrumb/HiStepConnector.js +58 -33
- package/es/HiBreadcrumb/HiStepContent.js +47 -26
- package/es/HiBreadcrumb/HiStepIcon.js +47 -27
- package/es/HiBreadcrumb/HiStepLabel.js +62 -37
- package/es/HiBreadcrumb/HiStepper.js +44 -24
- package/es/HiBreadcrumb/index.js +15 -1
- package/es/HiButton/HiButton.js +27 -9
- package/es/HiButton/index.js +13 -2
- package/es/HiCell/CellAddress.js +39 -21
- package/es/HiCell/CellDate.js +44 -27
- package/es/HiCell/CellIcon.js +48 -29
- package/es/HiCell/CellImage.js +41 -24
- package/es/HiCell/CellNumeric.js +45 -26
- package/es/HiCell/CellPinToAction.js +41 -20
- package/es/HiCell/CellRate.js +56 -33
- package/es/HiCell/CellSentinel.js +41 -23
- package/es/HiCell/CellSentinelScore.js +43 -24
- package/es/HiCell/CellText.js +54 -37
- package/es/HiCell/CellTextStyled.js +21 -8
- package/es/HiCell/index.js +79 -9
- package/es/HiCheckbox/HiCheckbox.js +61 -36
- package/es/HiCheckbox/index.js +15 -1
- package/es/HiChip/HiChip.js +44 -24
- package/es/HiChip/HiChipSwitch.js +73 -47
- package/es/HiChip/index.js +23 -2
- package/es/HiColoredLabel/HiColoredLabel.js +52 -28
- package/es/HiColoredLabel/index.js +15 -1
- package/es/HiDatePicker/Caption.js +28 -11
- package/es/HiDatePicker/HiDatePicker.js +131 -101
- package/es/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/es/HiDatePicker/HiDateRangePicker.js +168 -139
- package/es/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/es/HiDatePicker/ListPicker.js +54 -34
- package/es/HiDatePicker/NavBar.js +45 -18
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/Overlay.js +35 -18
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/index.js +47 -5
- package/es/HiDatePicker/Weekday.js +13 -3
- package/es/HiDatePicker/hiLocaleUtils.js +8 -1
- package/es/HiDatePicker/index.js +15 -1
- package/es/HiDatePicker/stylesheet.js +22 -9
- package/es/HiDotsStepper/HiDot.js +56 -31
- package/es/HiDotsStepper/HiDotsStepper.js +47 -28
- package/es/HiDotsStepper/index.js +23 -2
- package/es/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/es/HiExpansionPanel/index.js +13 -2
- package/es/HiForm/HiAddressField.js +46 -29
- package/es/HiForm/HiEmailField.js +45 -27
- package/es/HiForm/HiFormControl.js +105 -72
- package/es/HiForm/HiFormLabel.js +53 -30
- package/es/HiForm/HiInput.js +89 -62
- package/es/HiForm/HiPasswordField.js +55 -29
- package/es/HiForm/HiSearchField.js +43 -28
- package/es/HiForm/HiSlider.js +64 -41
- package/es/HiForm/HiTextField.js +46 -29
- package/es/HiForm/HiUpload.js +76 -53
- package/es/HiForm/HiUploadField.js +40 -25
- package/es/HiForm/HiUploadInput.js +84 -56
- package/es/HiForm/index.js +95 -11
- package/es/HiIcon/HiIcon.js +44 -22
- package/es/HiIcon/index.js +15 -1
- package/es/HiIconButton/HiIconButton.js +40 -18
- package/es/HiIconButton/index.js +15 -1
- package/es/HiLoader/HiLoader.js +24 -9
- package/es/HiLoader/index.js +15 -1
- package/es/HiMap/HiMap.js +76 -51
- package/es/HiMap/HiMapExpand.js +64 -39
- package/es/HiMap/index.js +23 -2
- package/es/HiNotice/HiKPI.js +56 -33
- package/es/HiNotice/HiKPINotice.js +21 -7
- package/es/HiNotice/index.js +23 -2
- package/es/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/es/HiPaymentMeans/index.js +15 -1
- package/es/HiPdfReader/HiPdfReader.js +78 -52
- package/es/HiPdfReader/index.js +15 -1
- package/es/HiPin/HiPin.js +30 -9
- package/es/HiPin/index.js +15 -1
- package/es/HiRadio/HiRadio.js +24 -7
- package/es/HiRadio/index.js +15 -1
- package/es/HiSelect/HiDynamicSelect.js +58 -40
- package/es/HiSelect/HiDynamicSelectField.js +40 -22
- package/es/HiSelect/HiNestedSelect.js +85 -55
- package/es/HiSelect/HiNestedSelectContent.js +72 -46
- package/es/HiSelect/HiNestedSelectField.js +40 -22
- package/es/HiSelect/HiSelect.js +161 -123
- package/es/HiSelect/HiSelectContent.js +104 -73
- package/es/HiSelect/HiSelectField.js +40 -22
- package/es/HiSelect/HiSelectInput.js +94 -63
- package/es/HiSelect/HiSelectMobile.js +54 -35
- package/es/HiSelect/HiSuggestSelect.js +83 -56
- package/es/HiSelect/HiSuggestSelectField.js +40 -22
- package/es/HiSelect/index.js +85 -8
- package/es/HiSelectableList/HiSelectableList.js +80 -49
- package/es/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/es/HiSelectableList/HiSelectableListItem.js +101 -66
- package/es/HiSelectableList/index.js +31 -3
- package/es/HiSwitch/HiSwitch.js +45 -20
- package/es/HiSwitch/HiSwitchState.js +36 -15
- package/es/HiSwitch/index.js +23 -2
- package/es/HiTable/HiCellBuilder.js +69 -43
- package/es/HiTable/HiTable.js +46 -28
- package/es/HiTable/HiTableBody.js +34 -19
- package/es/HiTable/HiTableHeader.js +50 -29
- package/es/HiTable/HiTableRow.js +56 -29
- package/es/HiTable/constants.js +94 -43
- package/es/HiTable/index.js +15 -1
- package/es/hi-svg-icons/HiAccount.js +36 -18
- package/es/hi-svg-icons/HiActivity.js +35 -17
- package/es/hi-svg-icons/HiAll.js +42 -22
- package/es/hi-svg-icons/HiBilling.js +36 -18
- package/es/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/es/hi-svg-icons/HiCatalog.js +36 -18
- package/es/hi-svg-icons/HiCustomer.js +36 -18
- package/es/hi-svg-icons/HiDownload.js +25 -11
- package/es/hi-svg-icons/HiFinance.js +36 -18
- package/es/hi-svg-icons/HiPermission.js +35 -17
- package/es/hi-svg-icons/HiRoute.js +36 -18
- package/es/hi-svg-icons/HiSettlement.js +36 -18
- package/es/hi-svg-icons/HiSizeLarge.js +27 -12
- package/es/hi-svg-icons/HiSizeMedium.js +25 -11
- package/es/hi-svg-icons/HiSizeSmall.js +25 -11
- package/es/hi-svg-icons/HiTransaction.js +36 -18
- package/es/hi-svg-icons/HiUser.js +36 -18
- package/es/hi-svg-icons/HiWidget.js +42 -22
- package/es/hi-svg-icons/index.js +151 -18
- package/es/hi-svg-icons/index.text.js +21 -11
- package/es/styleguide/Wrapper.js +36 -19
- package/es/styles/MuiThemeProvider.js +57 -39
- package/es/styles/colorManipulator.js +44 -16
- package/es/styles/createBreakpoints.js +20 -6
- package/es/styles/createGenerateClassName.js +15 -5
- package/es/styles/createMixins.js +19 -8
- package/es/styles/createMuiTheme.js +53 -34
- package/es/styles/createPalette.js +50 -30
- package/es/styles/createStyles.js +8 -1
- package/es/styles/createTypography.js +30 -18
- package/es/styles/getStylesCreator.js +24 -11
- package/es/styles/getThemeProps.js +9 -1
- package/es/styles/index.js +47 -5
- package/es/styles/jssPreset.js +25 -9
- package/es/styles/mergeClasses.js +19 -7
- package/es/styles/shadows.js +8 -1
- package/es/styles/shape.js +8 -1
- package/es/styles/spacing.js +9 -1
- package/es/styles/themeListener.js +18 -5
- package/es/styles/transitions.js +38 -18
- package/es/styles/zIndex.js +8 -1
- package/es/test-utils/createMount.js +22 -11
- package/es/test-utils/createRender.js +19 -8
- package/es/test-utils/createShallow.js +23 -13
- package/es/test-utils/getClasses.js +11 -2
- package/es/test-utils/index.js +47 -5
- package/es/test-utils/until.js +16 -6
- package/es/test-utils/unwrap.js +8 -1
- package/es/theme/palette.js +10 -2
- package/es/theme/typography.js +11 -3
- package/es/theme.js +13 -4
- package/es/transitions/utils.js +13 -2
- package/es/utils/exactProp.js +18 -5
- package/es/utils/helpers.js +55 -18
- package/es/withMobileDialog/index.js +15 -1
- package/es/withMobileDialog/withMobileDialog.js +22 -7
- package/hi-svg-icons/HiAccount.js +36 -18
- package/hi-svg-icons/HiActivity.js +35 -17
- package/hi-svg-icons/HiAll.js +42 -22
- package/hi-svg-icons/HiBilling.js +36 -18
- package/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/hi-svg-icons/HiCatalog.js +36 -18
- package/hi-svg-icons/HiCustomer.js +36 -18
- package/hi-svg-icons/HiDownload.js +25 -11
- package/hi-svg-icons/HiFinance.js +36 -18
- package/hi-svg-icons/HiPermission.js +35 -17
- package/hi-svg-icons/HiRoute.js +36 -18
- package/hi-svg-icons/HiSettlement.js +36 -18
- package/hi-svg-icons/HiSizeLarge.js +27 -12
- package/hi-svg-icons/HiSizeMedium.js +25 -11
- package/hi-svg-icons/HiSizeSmall.js +25 -11
- package/hi-svg-icons/HiTransaction.js +36 -18
- package/hi-svg-icons/HiUser.js +36 -18
- package/hi-svg-icons/HiWidget.js +42 -22
- package/hi-svg-icons/index.js +151 -18
- package/hi-svg-icons/index.text.js +21 -11
- package/package.json +2 -1
- package/styleguide/Wrapper.js +36 -19
- package/styles/MuiThemeProvider.js +57 -39
- package/styles/colorManipulator.js +44 -16
- package/styles/createBreakpoints.js +20 -6
- package/styles/createGenerateClassName.js +15 -5
- package/styles/createMixins.js +19 -8
- package/styles/createMuiTheme.js +53 -34
- package/styles/createPalette.js +50 -30
- package/styles/createStyles.js +8 -1
- package/styles/createTypography.js +30 -18
- package/styles/getStylesCreator.js +24 -11
- package/styles/getThemeProps.js +9 -1
- package/styles/index.js +47 -5
- package/styles/jssPreset.js +25 -9
- package/styles/mergeClasses.js +19 -7
- package/styles/shadows.js +8 -1
- package/styles/shape.js +8 -1
- package/styles/spacing.js +9 -1
- package/styles/themeListener.js +18 -5
- package/styles/transitions.js +38 -18
- package/styles/zIndex.js +8 -1
- package/test-utils/createMount.js +22 -11
- package/test-utils/createRender.js +19 -8
- package/test-utils/createShallow.js +23 -13
- package/test-utils/getClasses.js +11 -2
- package/test-utils/index.js +47 -5
- package/test-utils/until.js +16 -6
- package/test-utils/unwrap.js +8 -1
- package/theme/palette.js +10 -2
- package/theme/typography.js +11 -3
- package/theme.js +13 -4
- package/transitions/utils.js +13 -2
- package/utils/exactProp.js +18 -5
- package/utils/helpers.js +55 -18
- package/withMobileDialog/index.js +15 -1
- package/withMobileDialog/withMobileDialog.js +22 -7
- package/App.test.js +0 -8
- package/HiAlertModal/HiAlertModal.test.js +0 -189
- package/HiBadge/HiBadge.test.js +0 -49
- package/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/HiBreadcrumb/HiStep.test.js +0 -47
- package/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/HiBreadcrumb/HiStepper.test.js +0 -33
- package/HiCell/CellAddress.test.js +0 -75
- package/HiCell/CellDate.test.js +0 -173
- package/HiCell/CellIcon.test.js +0 -57
- package/HiCell/CellImage.test.js +0 -49
- package/HiCell/CellNumeric.test.js +0 -46
- package/HiCell/CellRate.test.js +0 -73
- package/HiCell/CellSentinel.test.js +0 -48
- package/HiCell/CellText.test.js +0 -76
- package/HiCheckbox/HiCheckbox.test.js +0 -55
- package/HiChip/HiChip.test.js +0 -136
- package/HiChip/HiChipSwitch.test.js +0 -99
- package/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/HiDatePicker/Caption.test.js +0 -65
- package/HiDatePicker/HiDatePicker.test.js +0 -370
- package/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/HiDatePicker/ListPicker.test.js +0 -53
- package/HiDatePicker/NavBar.test.js +0 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/HiDotsStepper/HiDot.test.js +0 -55
- package/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/HiForm/HiAddressField.test.js +0 -79
- package/HiForm/HiEmailField.test.js +0 -19
- package/HiForm/HiFormControl.test.js +0 -195
- package/HiForm/HiFormLabel.test.js +0 -66
- package/HiForm/HiInput.test.js +0 -202
- package/HiForm/HiPasswordField.test.js +0 -60
- package/HiForm/HiSearchField.test.js +0 -193
- package/HiForm/HiSlider.test.js +0 -99
- package/HiForm/HiTextField.test.js +0 -254
- package/HiForm/HiUpload.test.js +0 -241
- package/HiForm/HiUploadField.test.js +0 -55
- package/HiForm/HiUploadInput.test.js +0 -148
- package/HiIconButton/HiIconButton.test.js +0 -69
- package/HiLoader/HiLoader.test.js +0 -18
- package/HiMap/HiMap.test.js +0 -29
- package/HiMap/HiMapExpand.test.js +0 -48
- package/HiNotice/HiKPI.test.js +0 -171
- package/HiNotice/HiKPINotice.test.js +0 -88
- package/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/HiPin/HiPin.test.js +0 -61
- package/HiRadio/HiRadio.test.js +0 -57
- package/HiSelect/HiSelect.test.js +0 -1092
- package/HiSelect/HiSelectInput.test.js +0 -21
- package/HiSelectableList/HiSelectableList.test.js +0 -173
- package/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/HiSwitch/HiSwitch.test.js +0 -41
- package/HiSwitch/HiSwitchState.test.js +0 -76
- package/HiTable/HiTable.test.js +0 -29
- package/es/App.test.js +0 -8
- package/es/HiAlertModal/HiAlertModal.test.js +0 -189
- package/es/HiBadge/HiBadge.test.js +0 -49
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/es/HiBreadcrumb/HiStep.test.js +0 -47
- package/es/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/es/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/es/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/es/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/es/HiBreadcrumb/HiStepper.test.js +0 -33
- package/es/HiCell/CellAddress.test.js +0 -75
- package/es/HiCell/CellDate.test.js +0 -173
- package/es/HiCell/CellIcon.test.js +0 -57
- package/es/HiCell/CellImage.test.js +0 -49
- package/es/HiCell/CellNumeric.test.js +0 -46
- package/es/HiCell/CellRate.test.js +0 -73
- package/es/HiCell/CellSentinel.test.js +0 -48
- package/es/HiCell/CellText.test.js +0 -76
- package/es/HiCheckbox/HiCheckbox.test.js +0 -55
- package/es/HiChip/HiChip.test.js +0 -136
- package/es/HiChip/HiChipSwitch.test.js +0 -99
- package/es/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/es/HiDatePicker/Caption.test.js +0 -65
- package/es/HiDatePicker/HiDatePicker.test.js +0 -370
- package/es/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/es/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/es/HiDatePicker/ListPicker.test.js +0 -53
- package/es/HiDatePicker/NavBar.test.js +0 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/es/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/es/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/es/HiDotsStepper/HiDot.test.js +0 -55
- package/es/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/es/HiForm/HiAddressField.test.js +0 -79
- package/es/HiForm/HiEmailField.test.js +0 -19
- package/es/HiForm/HiFormControl.test.js +0 -195
- package/es/HiForm/HiFormLabel.test.js +0 -66
- package/es/HiForm/HiInput.test.js +0 -202
- package/es/HiForm/HiPasswordField.test.js +0 -60
- package/es/HiForm/HiSearchField.test.js +0 -193
- package/es/HiForm/HiSlider.test.js +0 -99
- package/es/HiForm/HiTextField.test.js +0 -254
- package/es/HiForm/HiUpload.test.js +0 -241
- package/es/HiForm/HiUploadField.test.js +0 -55
- package/es/HiForm/HiUploadInput.test.js +0 -148
- package/es/HiIconButton/HiIconButton.test.js +0 -69
- package/es/HiLoader/HiLoader.test.js +0 -18
- package/es/HiMap/HiMap.test.js +0 -29
- package/es/HiMap/HiMapExpand.test.js +0 -48
- package/es/HiNotice/HiKPI.test.js +0 -171
- package/es/HiNotice/HiKPINotice.test.js +0 -88
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/es/HiPin/HiPin.test.js +0 -61
- package/es/HiRadio/HiRadio.test.js +0 -57
- package/es/HiSelect/HiSelect.test.js +0 -1092
- package/es/HiSelect/HiSelectInput.test.js +0 -21
- package/es/HiSelectableList/HiSelectableList.test.js +0 -173
- package/es/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/es/HiSwitch/HiSwitch.test.js +0 -41
- package/es/HiSwitch/HiSwitchState.test.js +0 -76
- package/es/HiTable/HiTable.test.js +0 -29
- package/es/styles/colorManipulator.test.js +0 -242
- package/es/styles/createBreakpoints.test.js +0 -48
- package/es/styles/createGenerateClassName.test.js +0 -141
- package/es/styles/createMixins.test.js +0 -24
- package/es/styles/createMuiTheme.test.js +0 -67
- package/es/styles/createPalette.test.js +0 -159
- package/es/styles/createStyles.test.js +0 -8
- package/es/styles/createTypography.test.js +0 -60
- package/es/styles/getStylesCreator.test.js +0 -92
- package/es/styles/getThemeProps.test.js +0 -39
- package/es/styles/themeListener.test.js +0 -26
- package/es/styles/transitions.test.js +0 -208
- package/es/test-utils/until.test.js +0 -157
- package/es/withMobileDialog/withMobileDialog.test.js +0 -67
- package/styles/colorManipulator.test.js +0 -242
- package/styles/createBreakpoints.test.js +0 -48
- package/styles/createGenerateClassName.test.js +0 -141
- package/styles/createMixins.test.js +0 -24
- package/styles/createMuiTheme.test.js +0 -67
- package/styles/createPalette.test.js +0 -159
- package/styles/createStyles.test.js +0 -8
- package/styles/createTypography.test.js +0 -60
- package/styles/getStylesCreator.test.js +0 -92
- package/styles/getThemeProps.test.js +0 -39
- package/styles/themeListener.test.js +0 -26
- package/styles/transitions.test.js +0 -208
- package/test-utils/until.test.js +0 -157
- package/withMobileDialog/withMobileDialog.test.js +0 -67
package/utils/helpers.js
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.camelize = camelize;
|
|
9
|
+
exports.capitalize = capitalize;
|
|
10
|
+
exports.contains = contains;
|
|
11
|
+
exports.escapeHTML = escapeHTML;
|
|
12
|
+
exports.findIndex = findIndex;
|
|
13
|
+
exports.find = find;
|
|
14
|
+
exports.createChainedFunction = createChainedFunction;
|
|
15
|
+
exports.arrayUnique = arrayUnique;
|
|
16
|
+
exports.formatNumber = formatNumber;
|
|
17
|
+
exports.formatCurrencyAmount = formatCurrencyAmount;
|
|
18
|
+
exports.formatRate = formatRate;
|
|
19
|
+
exports.getNextItemSelectable = getNextItemSelectable;
|
|
20
|
+
exports.foldAccents = foldAccents;
|
|
21
|
+
|
|
22
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
23
|
+
|
|
24
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
25
|
+
|
|
26
|
+
var _warning = _interopRequireDefault(require("warning"));
|
|
27
|
+
|
|
28
|
+
function camelize(string) {
|
|
4
29
|
string = string.replace(/(_\w)/g, function (m) {
|
|
5
30
|
return m[1].toUpperCase();
|
|
6
31
|
});
|
|
@@ -10,14 +35,16 @@ export function camelize(string) {
|
|
|
10
35
|
return index === 0 ? match.toLowerCase() : match.toUpperCase();
|
|
11
36
|
});
|
|
12
37
|
}
|
|
13
|
-
|
|
38
|
+
|
|
39
|
+
function capitalize(string) {
|
|
14
40
|
if (process.env.NODE_ENV !== 'production' && typeof string !== 'string') {
|
|
15
41
|
throw new Error('Material-UI: capitalize(string) expects a string argument.');
|
|
16
42
|
}
|
|
17
43
|
|
|
18
44
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
19
45
|
}
|
|
20
|
-
|
|
46
|
+
|
|
47
|
+
function contains(obj, pred) {
|
|
21
48
|
return Object.keys(pred).every(function (key) {
|
|
22
49
|
return obj.hasOwnProperty(key) && obj[key] === pred[key];
|
|
23
50
|
});
|
|
@@ -30,11 +57,13 @@ export function contains(obj, pred) {
|
|
|
30
57
|
* @returns {*}
|
|
31
58
|
*/
|
|
32
59
|
|
|
33
|
-
|
|
60
|
+
|
|
61
|
+
function escapeHTML(unsafeStr) {
|
|
34
62
|
return unsafeStr.replace(/<br\/?>/g, '[br]').replace(/<strong>/g, '[[').replace(/<\/?strong>/g, ']]').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\[\[/g, '<strong>').replace(/\]\]/g, '</strong>').replace(/\[br\]/g, '<br>');
|
|
35
63
|
}
|
|
36
|
-
|
|
37
|
-
|
|
64
|
+
|
|
65
|
+
function findIndex(arr, pred) {
|
|
66
|
+
var predType = (0, _typeof2.default)(pred);
|
|
38
67
|
|
|
39
68
|
for (var i = 0; i < arr.length; i += 1) {
|
|
40
69
|
if (predType === 'function' && !!pred(arr[i], i, arr) === true) {
|
|
@@ -52,7 +81,8 @@ export function findIndex(arr, pred) {
|
|
|
52
81
|
|
|
53
82
|
return -1;
|
|
54
83
|
}
|
|
55
|
-
|
|
84
|
+
|
|
85
|
+
function find(arr, pred) {
|
|
56
86
|
var index = findIndex(arr, pred);
|
|
57
87
|
return index > -1 ? arr[index] : undefined;
|
|
58
88
|
}
|
|
@@ -66,7 +96,8 @@ export function find(arr, pred) {
|
|
|
66
96
|
* @returns {function|null}
|
|
67
97
|
*/
|
|
68
98
|
|
|
69
|
-
|
|
99
|
+
|
|
100
|
+
function createChainedFunction() {
|
|
70
101
|
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
71
102
|
funcs[_key] = arguments[_key];
|
|
72
103
|
}
|
|
@@ -76,7 +107,7 @@ export function createChainedFunction() {
|
|
|
76
107
|
return acc;
|
|
77
108
|
}
|
|
78
109
|
|
|
79
|
-
|
|
110
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(typeof func === 'function', 'Material-UI: invalid Argument Type, must only provide functions, undefined, or null.') : void 0;
|
|
80
111
|
return function chainedFunction() {
|
|
81
112
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
82
113
|
args[_key2] = arguments[_key2];
|
|
@@ -95,8 +126,9 @@ export function createChainedFunction() {
|
|
|
95
126
|
* @param array
|
|
96
127
|
*/
|
|
97
128
|
|
|
98
|
-
|
|
99
|
-
|
|
129
|
+
|
|
130
|
+
function arrayUnique(array) {
|
|
131
|
+
var a = (0, _toConsumableArray2.default)(array);
|
|
100
132
|
|
|
101
133
|
for (var i = 0; i < a.length; i + 1) {
|
|
102
134
|
for (var j = i + 1; j < a.length; j + 1) {
|
|
@@ -115,7 +147,8 @@ export function arrayUnique(array) {
|
|
|
115
147
|
* @param precision
|
|
116
148
|
*/
|
|
117
149
|
|
|
118
|
-
|
|
150
|
+
|
|
151
|
+
function formatNumber(number) {
|
|
119
152
|
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'l';
|
|
120
153
|
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en-EN';
|
|
121
154
|
var precision = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -162,7 +195,8 @@ export function formatNumber(number) {
|
|
|
162
195
|
* @param currency - ISO 4217
|
|
163
196
|
*/
|
|
164
197
|
|
|
165
|
-
|
|
198
|
+
|
|
199
|
+
function formatCurrencyAmount(amount) {
|
|
166
200
|
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'l';
|
|
167
201
|
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en-EN';
|
|
168
202
|
var currency = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'EUR';
|
|
@@ -222,7 +256,8 @@ export function formatCurrencyAmount(amount) {
|
|
|
222
256
|
* @param locale
|
|
223
257
|
*/
|
|
224
258
|
|
|
225
|
-
|
|
259
|
+
|
|
260
|
+
function formatRate(rate) {
|
|
226
261
|
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'l';
|
|
227
262
|
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en-EN';
|
|
228
263
|
var effectiveSize = 0;
|
|
@@ -243,7 +278,8 @@ export function formatRate(rate) {
|
|
|
243
278
|
* @returns {*}
|
|
244
279
|
*/
|
|
245
280
|
|
|
246
|
-
|
|
281
|
+
|
|
282
|
+
function getNextItemSelectable(node, direction) {
|
|
247
283
|
if (direction === 'down') {
|
|
248
284
|
if (node.nextSibling === null) {
|
|
249
285
|
return null;
|
|
@@ -272,7 +308,8 @@ export function getNextItemSelectable(node, direction) {
|
|
|
272
308
|
* @returns {*}
|
|
273
309
|
*/
|
|
274
310
|
|
|
275
|
-
|
|
311
|
+
|
|
312
|
+
function foldAccents(toFold) {
|
|
276
313
|
return toFold.replace(/([àáâãäå])|([ç])|([èéêë])|([ìíîï])|([ñ])|([òóôõöø])|([ß])|([ùúûü])|([ÿ])|([æ])|([œ])|([+])|([\\])|([[])|([\]])|([(])|([)])|([?])|([*])/g, function (str, a, c, e, i, n, o, s, u, y, ae, oe, plus, backSlash, lc, rc, lp, rp, interogation, star) {
|
|
277
314
|
if (a) return 'a';
|
|
278
315
|
if (c) return 'c';
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _withMobileDialog.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _withMobileDialog = _interopRequireDefault(require("./withMobileDialog"));
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _withWidth = _interopRequireWildcard(require("@material-ui/core/withWidth"));
|
|
17
|
+
|
|
3
18
|
/**
|
|
4
19
|
* Dialog will responsively be full screen *at or below* the given breakpoint
|
|
5
20
|
* (defaults to 'sm' for mobile devices).
|
|
6
21
|
* Notice that this Higher-order Component is incompatible with server side rendering.
|
|
7
22
|
*/
|
|
8
|
-
|
|
9
23
|
var withMobileDialog = function withMobileDialog() {
|
|
10
24
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
25
|
return function (Component) {
|
|
@@ -13,13 +27,14 @@ var withMobileDialog = function withMobileDialog() {
|
|
|
13
27
|
breakpoint = _options$breakpoint === void 0 ? 'sm' : _options$breakpoint;
|
|
14
28
|
|
|
15
29
|
function WithMobileDialog(props) {
|
|
16
|
-
return
|
|
17
|
-
fullScreen: isWidthDown(breakpoint, props.width)
|
|
30
|
+
return _react.default.createElement(Component, (0, _extends2.default)({
|
|
31
|
+
fullScreen: (0, _withWidth.isWidthDown)(breakpoint, props.width)
|
|
18
32
|
}, props));
|
|
19
33
|
}
|
|
20
34
|
|
|
21
|
-
return
|
|
35
|
+
return (0, _withWidth.default)()(WithMobileDialog);
|
|
22
36
|
};
|
|
23
37
|
};
|
|
24
38
|
|
|
25
|
-
|
|
39
|
+
var _default = withMobileDialog;
|
|
40
|
+
exports.default = _default;
|
package/App.test.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import App from './App';
|
|
4
|
-
it('renders without crashing', function () {
|
|
5
|
-
var div = document.createElement('div');
|
|
6
|
-
ReactDOM.render(React.createElement(App, null), div);
|
|
7
|
-
ReactDOM.unmountComponentAtNode(div);
|
|
8
|
-
});
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { spy, useFakeTimers } from 'sinon';
|
|
4
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
|
5
|
-
import HiAlertModal from './HiAlertModal';
|
|
6
|
-
import HiButton from '../HiButton';
|
|
7
|
-
import HiIcon from '../HiIcon';
|
|
8
|
-
import Dialog from '@material-ui/core/Dialog';
|
|
9
|
-
import DialogActions from '@material-ui/core/DialogActions';
|
|
10
|
-
import DialogContent from '@material-ui/core/DialogContent';
|
|
11
|
-
import DialogTitle from '@material-ui/core/DialogTitle';
|
|
12
|
-
describe('<HiAlertModal />', function () {
|
|
13
|
-
var mount;
|
|
14
|
-
var wrapper;
|
|
15
|
-
var shallow;
|
|
16
|
-
var componentClasses;
|
|
17
|
-
before(function () {
|
|
18
|
-
componentClasses = getClasses(React.createElement(HiAlertModal, {
|
|
19
|
-
open: true,
|
|
20
|
-
title: "Title",
|
|
21
|
-
content: "Content",
|
|
22
|
-
labelCancelButton: "Cancel Button",
|
|
23
|
-
labelSubmitButton: "Submit Button"
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
beforeEach(function () {
|
|
27
|
-
mount = createMount();
|
|
28
|
-
shallow = createShallow({
|
|
29
|
-
dive: true
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
afterEach(function () {
|
|
33
|
-
mount.cleanUp();
|
|
34
|
-
}); // Tests component
|
|
35
|
-
|
|
36
|
-
it('Test mount component complete', function () {
|
|
37
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
38
|
-
open: true,
|
|
39
|
-
title: "Title",
|
|
40
|
-
content: "Content",
|
|
41
|
-
labelSubmitButton: "Submit Button",
|
|
42
|
-
labelCancelButton: "Cancel Button",
|
|
43
|
-
submitColor: "negative",
|
|
44
|
-
backgroundIcon: "mdi_bulletin_board"
|
|
45
|
-
}));
|
|
46
|
-
assert.strictEqual(wrapper.find(DialogTitle).length, 1, 'should have DialogTitle');
|
|
47
|
-
assert.strictEqual(wrapper.find(DialogContent).length, 1, 'should have DialogContent');
|
|
48
|
-
assert.strictEqual(wrapper.find(DialogActions).length, 1, 'should have DialogActions');
|
|
49
|
-
assert.strictEqual(wrapper.find(HiButton).length, 2, 'should have 2 HiButtons');
|
|
50
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 1, 'should have 1 HiIcon');
|
|
51
|
-
});
|
|
52
|
-
it('Test mount component without background', function () {
|
|
53
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
54
|
-
open: true,
|
|
55
|
-
title: "Title",
|
|
56
|
-
content: "Content",
|
|
57
|
-
labelSubmitButton: "Submit Button",
|
|
58
|
-
labelCancelButton: "Cancel Button",
|
|
59
|
-
submitColor: "negative"
|
|
60
|
-
}));
|
|
61
|
-
assert.strictEqual(wrapper.find(DialogTitle).length, 1, 'should have DialogTitle');
|
|
62
|
-
assert.strictEqual(wrapper.find(DialogContent).length, 1, 'should have DialogContent');
|
|
63
|
-
assert.strictEqual(wrapper.find(DialogActions).length, 1, 'should have DialogActions');
|
|
64
|
-
assert.strictEqual(wrapper.find(HiButton).length, 2, 'should have 2 HiButtons');
|
|
65
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 0, 'should have no HiIcon');
|
|
66
|
-
});
|
|
67
|
-
it('Test mount component without submit button', function () {
|
|
68
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
69
|
-
open: true,
|
|
70
|
-
title: "Title",
|
|
71
|
-
content: "Content",
|
|
72
|
-
labelCancelButton: "Cancel Button",
|
|
73
|
-
submitColor: "negative"
|
|
74
|
-
}));
|
|
75
|
-
assert.strictEqual(wrapper.find(DialogTitle).length, 1, 'should have DialogTitle');
|
|
76
|
-
assert.strictEqual(wrapper.find(DialogContent).length, 1, 'should have DialogContent');
|
|
77
|
-
assert.strictEqual(wrapper.find(DialogActions).length, 1, 'should have DialogActions');
|
|
78
|
-
assert.strictEqual(wrapper.find(HiButton).length, 1, 'should have 1 HiButton');
|
|
79
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 0, 'should have no HiIcon');
|
|
80
|
-
});
|
|
81
|
-
it('Test mount component without cancel button', function () {
|
|
82
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
83
|
-
open: true,
|
|
84
|
-
title: "Title",
|
|
85
|
-
content: "Content",
|
|
86
|
-
labelSubmitButton: "Submit Button",
|
|
87
|
-
submitColor: "negative"
|
|
88
|
-
}));
|
|
89
|
-
assert.strictEqual(wrapper.find(DialogTitle).length, 1, 'should have DialogTitle');
|
|
90
|
-
assert.strictEqual(wrapper.find(DialogContent).length, 1, 'should have DialogContent');
|
|
91
|
-
assert.strictEqual(wrapper.find(DialogActions).length, 1, 'should have DialogActions');
|
|
92
|
-
assert.strictEqual(wrapper.find(HiButton).length, 1, 'should have 1 HiButton');
|
|
93
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 0, 'should have no HiIcon');
|
|
94
|
-
});
|
|
95
|
-
describe('Focus', function () {
|
|
96
|
-
var clock;
|
|
97
|
-
beforeEach(function () {
|
|
98
|
-
clock = useFakeTimers();
|
|
99
|
-
});
|
|
100
|
-
afterEach(function () {
|
|
101
|
-
clock.restore;
|
|
102
|
-
});
|
|
103
|
-
it('Should focus on submit button when mounted with submit and cancel buttons', function () {
|
|
104
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
105
|
-
open: true,
|
|
106
|
-
title: "Title",
|
|
107
|
-
content: "Content",
|
|
108
|
-
labelCancelButton: "Cancel Button",
|
|
109
|
-
labelSubmitButton: "Submit Button"
|
|
110
|
-
}));
|
|
111
|
-
clock.tick(10000);
|
|
112
|
-
var focusedElement = document.activeElement;
|
|
113
|
-
var cancelButtonWrapper = wrapper.find("." + componentClasses.classCancelButton).first();
|
|
114
|
-
var submitButtonWrapper = wrapper.find("." + componentClasses.classSubmitButton).first();
|
|
115
|
-
assert.notStrictEqual(focusedElement, cancelButtonWrapper.getDOMNode(), 'Cancel button should not be focused');
|
|
116
|
-
assert.strictEqual(focusedElement, submitButtonWrapper.getDOMNode(), 'Submit button should be focused');
|
|
117
|
-
});
|
|
118
|
-
it('Should focus on submit button when mounted with only a submit button', function () {
|
|
119
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
120
|
-
open: true,
|
|
121
|
-
title: "Title",
|
|
122
|
-
content: "Content",
|
|
123
|
-
labelSubmitButton: "Submit Button"
|
|
124
|
-
}));
|
|
125
|
-
clock.tick(10000);
|
|
126
|
-
var focusedElement = document.activeElement;
|
|
127
|
-
var submitButtonWrapper = wrapper.find("." + componentClasses.classSubmitButton).first();
|
|
128
|
-
assert.strictEqual("Submit Button", submitButtonWrapper.text(), 'submitButtonWrapper variable isn\'t the submit button');
|
|
129
|
-
assert.strictEqual(focusedElement, submitButtonWrapper.getDOMNode(), 'Submit button should be focused');
|
|
130
|
-
});
|
|
131
|
-
it('Should focus on cancel button when mounted with only a cancel button', function () {
|
|
132
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
133
|
-
open: true,
|
|
134
|
-
title: "Title",
|
|
135
|
-
content: "Content",
|
|
136
|
-
labelCancelButton: "Cancel Button"
|
|
137
|
-
}));
|
|
138
|
-
clock.tick(10000);
|
|
139
|
-
var focusedElement = document.activeElement;
|
|
140
|
-
var cancelButtonWrapper = wrapper.find("." + componentClasses.classCancelButton).first();
|
|
141
|
-
assert.strictEqual("Cancel Button", cancelButtonWrapper.text(), 'cancelButtonWrapper variable isn\'t the cancel button');
|
|
142
|
-
assert.strictEqual(focusedElement, cancelButtonWrapper.getDOMNode(), 'Cancel button should be focused');
|
|
143
|
-
});
|
|
144
|
-
}); // Tests callbacks
|
|
145
|
-
|
|
146
|
-
describe('callbacks', function () {
|
|
147
|
-
it('should call handleClickSubmit or handleClickCancel when clicking on buttons.', function () {
|
|
148
|
-
var handleClickSubmit = spy();
|
|
149
|
-
var handleClickCancel = spy();
|
|
150
|
-
var handleClose = spy();
|
|
151
|
-
wrapper = mount(React.createElement(HiAlertModal, {
|
|
152
|
-
open: true,
|
|
153
|
-
title: "Title",
|
|
154
|
-
labelSubmitButton: "Submit",
|
|
155
|
-
labelCancelButton: "Cancel",
|
|
156
|
-
onSubmitClick: handleClickSubmit,
|
|
157
|
-
onCancelClick: handleClickCancel,
|
|
158
|
-
onClose: handleClose
|
|
159
|
-
}));
|
|
160
|
-
wrapper.find('button').first().simulate('click');
|
|
161
|
-
assert.strictEqual(handleClickCancel.callCount, 1, 'should have been called once handleClickSubmit');
|
|
162
|
-
wrapper.find('button').last().simulate('click');
|
|
163
|
-
assert.strictEqual(handleClickSubmit.callCount, 1, 'should have been called once handleClickCancel');
|
|
164
|
-
});
|
|
165
|
-
it('callbacks onclose', function () {
|
|
166
|
-
var handleClose = spy();
|
|
167
|
-
wrapper = shallow(React.createElement(HiAlertModal, {
|
|
168
|
-
open: true,
|
|
169
|
-
title: "Title",
|
|
170
|
-
labelSubmitButton: "Submit",
|
|
171
|
-
labelCancelButton: "Cancel",
|
|
172
|
-
onClose: handleClose
|
|
173
|
-
}));
|
|
174
|
-
wrapper.find(Dialog).props().onClose();
|
|
175
|
-
assert.strictEqual(handleClose.callCount, 1, 'should have been called once handleClose');
|
|
176
|
-
});
|
|
177
|
-
it('not callback onclose', function () {
|
|
178
|
-
var handleClose = spy();
|
|
179
|
-
wrapper = shallow(React.createElement(HiAlertModal, {
|
|
180
|
-
open: true,
|
|
181
|
-
title: "Title",
|
|
182
|
-
labelSubmitButton: "Submit",
|
|
183
|
-
labelCancelButton: "Cancel"
|
|
184
|
-
}));
|
|
185
|
-
wrapper.find(Dialog).props().onClose();
|
|
186
|
-
assert.strictEqual(handleClose.callCount, 0, 'should no have been called once handleClose');
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
});
|
package/HiBadge/HiBadge.test.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createShallow, getClasses } from '../test-utils';
|
|
4
|
-
import HiBadge from './HiBadge';
|
|
5
|
-
describe('<HiBadge />', function () {
|
|
6
|
-
var shallow;
|
|
7
|
-
var classes;
|
|
8
|
-
before(function () {
|
|
9
|
-
shallow = createShallow({
|
|
10
|
-
untilSelector: 'Badge'
|
|
11
|
-
});
|
|
12
|
-
classes = getClasses(React.createElement(HiBadge, {
|
|
13
|
-
value: 5
|
|
14
|
-
}, React.createElement("div", {
|
|
15
|
-
className: "unique"
|
|
16
|
-
}, "Hello World")));
|
|
17
|
-
});
|
|
18
|
-
var testChildren = React.createElement("div", {
|
|
19
|
-
className: "unique"
|
|
20
|
-
}, "Hello World");
|
|
21
|
-
it('renders children and badgeContent', function () {
|
|
22
|
-
var wrapper = shallow(React.createElement(HiBadge, {
|
|
23
|
-
value: 5
|
|
24
|
-
}, testChildren));
|
|
25
|
-
assert.strictEqual(wrapper.contains(testChildren), true, 'should contain the children');
|
|
26
|
-
assert.strictEqual(wrapper.text(), 'Hello World5', 'should contain the children with badge value < 100');
|
|
27
|
-
assert.ok(wrapper.find('span').length, 'should contain the badgeContent');
|
|
28
|
-
assert.strictEqual(wrapper.find('span').at(1).hasClass(classes.badge), true, 'should have badge class');
|
|
29
|
-
assert.strictEqual(wrapper.find('span').at(1).hasClass(classes.shortBadge), true, 'should have shortBadge class');
|
|
30
|
-
});
|
|
31
|
-
it('renders children and badgeContent', function () {
|
|
32
|
-
var wrapper = shallow(React.createElement(HiBadge, {
|
|
33
|
-
value: 500
|
|
34
|
-
}, testChildren));
|
|
35
|
-
assert.strictEqual(wrapper.contains(testChildren), true, 'should contain the children');
|
|
36
|
-
assert.strictEqual(wrapper.text(), 'Hello World+100', 'should contain the children with badge value > 100');
|
|
37
|
-
assert.ok(wrapper.find('span').length, 'should contain the badgeContent');
|
|
38
|
-
assert.strictEqual(wrapper.find('span').at(1).hasClass(classes.longBadge), true, 'should have longBadge class');
|
|
39
|
-
});
|
|
40
|
-
it('renders children and badgeContent', function () {
|
|
41
|
-
var wrapper = shallow(React.createElement(HiBadge, {
|
|
42
|
-
value: 50
|
|
43
|
-
}, testChildren));
|
|
44
|
-
assert.strictEqual(wrapper.contains(testChildren), true, 'should contain the children');
|
|
45
|
-
assert.strictEqual(wrapper.text(), 'Hello World50', 'should contain the children with badge value = 50');
|
|
46
|
-
assert.ok(wrapper.find('span').length, 'should contain the badgeContent');
|
|
47
|
-
assert.strictEqual(wrapper.find('span').at(1).hasClass(classes.mediumBadge), true, 'should have mediumBadge class');
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { spy } from 'sinon';
|
|
4
|
-
import { createShallow } from '../test-utils';
|
|
5
|
-
import HiBreadcrumb from './HiBreadcrumb';
|
|
6
|
-
import HiStep from './HiStep';
|
|
7
|
-
describe('<HiBreadcrumb />', function () {
|
|
8
|
-
var shallow;
|
|
9
|
-
var wrapper;
|
|
10
|
-
var handleStep = spy();
|
|
11
|
-
before(function () {
|
|
12
|
-
shallow = createShallow();
|
|
13
|
-
wrapper = shallow(React.createElement(HiBreadcrumb, {
|
|
14
|
-
activeStep: 0,
|
|
15
|
-
steps: [{
|
|
16
|
-
id: 0,
|
|
17
|
-
status: 'unreviewed',
|
|
18
|
-
label: 'test',
|
|
19
|
-
notificationNumber: 2
|
|
20
|
-
}, {
|
|
21
|
-
id: 1,
|
|
22
|
-
status: 'validated',
|
|
23
|
-
label: 'test',
|
|
24
|
-
notificationNumber: 0
|
|
25
|
-
}, {
|
|
26
|
-
id: 2,
|
|
27
|
-
status: 'active',
|
|
28
|
-
label: 'test',
|
|
29
|
-
notificationNumber: 1
|
|
30
|
-
}],
|
|
31
|
-
handleStep: handleStep
|
|
32
|
-
}));
|
|
33
|
-
});
|
|
34
|
-
it('should render a HiStepper component', function () {
|
|
35
|
-
assert.strictEqual(wrapper.dive().name(), 'HiStepper');
|
|
36
|
-
});
|
|
37
|
-
it('should check its props', function () {
|
|
38
|
-
assert.strictEqual(wrapper.find(HiStep).length, 3);
|
|
39
|
-
});
|
|
40
|
-
it('should have its callbacks checked', function () {
|
|
41
|
-
wrapper.dive().find(HiStep).at(1).props().onClick();
|
|
42
|
-
assert.strictEqual(handleStep.calledOnce, true);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createShallow } from '../test-utils';
|
|
4
|
-
import HiStep from './HiStep';
|
|
5
|
-
describe('<HiStep />', function () {
|
|
6
|
-
var shallow;
|
|
7
|
-
before(function () {
|
|
8
|
-
shallow = createShallow();
|
|
9
|
-
});
|
|
10
|
-
it('should render a HiStep component', function () {
|
|
11
|
-
var wrapper = shallow(React.createElement(HiStep, {
|
|
12
|
-
index: 0
|
|
13
|
-
}));
|
|
14
|
-
assert.strictEqual(wrapper.name(), 'HiStep');
|
|
15
|
-
});
|
|
16
|
-
it('should render a connector', function () {
|
|
17
|
-
var wrapper = shallow(React.createElement(HiStep, {
|
|
18
|
-
index: 0
|
|
19
|
-
}));
|
|
20
|
-
assert.strictEqual(wrapper.dive().find('WithStyles(HiStepConnector)').dive().name(), 'HiStepConnector');
|
|
21
|
-
});
|
|
22
|
-
it("should not render a connector if it's the last step", function () {
|
|
23
|
-
var wrapper = shallow(React.createElement(HiStep, {
|
|
24
|
-
isLast: true,
|
|
25
|
-
index: 0
|
|
26
|
-
}));
|
|
27
|
-
assert.strictEqual(wrapper.dive().find('WithStyles(HiStepConnector)').length, 0);
|
|
28
|
-
});
|
|
29
|
-
it("should render some content if it's the last step and it's a front-light breadcrumb", function () {
|
|
30
|
-
var wrapper = shallow(React.createElement(HiStep, {
|
|
31
|
-
isLast: true,
|
|
32
|
-
index: 0,
|
|
33
|
-
type: "front-light",
|
|
34
|
-
content: React.createElement("div", null, "Some content"),
|
|
35
|
-
active: true
|
|
36
|
-
}));
|
|
37
|
-
assert.strictEqual(wrapper.dive().childAt(0).dive().name(), 'HiStepContent');
|
|
38
|
-
});
|
|
39
|
-
it('should render its children', function () {
|
|
40
|
-
var wrapper = shallow(React.createElement(HiStep, {
|
|
41
|
-
index: 0
|
|
42
|
-
}, React.createElement("div", {
|
|
43
|
-
id: "test"
|
|
44
|
-
}, "label test")));
|
|
45
|
-
assert.strictEqual(wrapper.dive().find('div#test').props().active, false);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createShallow } from '../test-utils';
|
|
4
|
-
import HiStepConnector from './HiStepConnector';
|
|
5
|
-
describe('<HiStepConnector />', function () {
|
|
6
|
-
var shallow;
|
|
7
|
-
var wrapper;
|
|
8
|
-
var steps = [{
|
|
9
|
-
id: 0,
|
|
10
|
-
status: 'validated',
|
|
11
|
-
label: 'Informations légales'
|
|
12
|
-
}, {
|
|
13
|
-
id: 1,
|
|
14
|
-
status: 'validated',
|
|
15
|
-
label: 'Les bénéficiaires effectifs'
|
|
16
|
-
}, {
|
|
17
|
-
id: 2,
|
|
18
|
-
status: 'validated',
|
|
19
|
-
label: 'Les mandataires'
|
|
20
|
-
}, {
|
|
21
|
-
id: 3,
|
|
22
|
-
status: 'active',
|
|
23
|
-
label: 'Autres documents'
|
|
24
|
-
}, {
|
|
25
|
-
id: 4,
|
|
26
|
-
status: 'unreviewed',
|
|
27
|
-
label: 'Mise en place du compte'
|
|
28
|
-
}];
|
|
29
|
-
before(function () {
|
|
30
|
-
shallow = createShallow();
|
|
31
|
-
});
|
|
32
|
-
describe('with a steps prop', function () {
|
|
33
|
-
before(function () {
|
|
34
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
35
|
-
steps: steps
|
|
36
|
-
}));
|
|
37
|
-
});
|
|
38
|
-
it('should render a HiStepConnector component', function () {
|
|
39
|
-
assert.strictEqual(wrapper.name(), 'HiStepConnector');
|
|
40
|
-
});
|
|
41
|
-
it('should render a div', function () {
|
|
42
|
-
assert.strictEqual(wrapper.dive().name(), 'div');
|
|
43
|
-
});
|
|
44
|
-
it('should have its validConnector prop set correctly', function () {
|
|
45
|
-
assert.strictEqual(wrapper.props().validConnector, false);
|
|
46
|
-
});
|
|
47
|
-
it('should have its type prop set correctly', function () {
|
|
48
|
-
assert.strictEqual(wrapper.props().type, 'back');
|
|
49
|
-
});
|
|
50
|
-
it('should have its active prop set correctly', function () {
|
|
51
|
-
assert.strictEqual(wrapper.props().active, false);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
describe('with a validConnector prop', function () {
|
|
55
|
-
before(function () {
|
|
56
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
57
|
-
validConnector: true
|
|
58
|
-
}));
|
|
59
|
-
});
|
|
60
|
-
it('should have its validConnector prop set correctly', function () {
|
|
61
|
-
assert.strictEqual(wrapper.props().validConnector, true);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
describe('with a type prop', function () {
|
|
65
|
-
before(function () {
|
|
66
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
67
|
-
type: "front-dark"
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
it('should have its type prop set correctly', function () {
|
|
71
|
-
assert.strictEqual(wrapper.props().type, 'front-dark');
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe('with an active prop', function () {
|
|
75
|
-
before(function () {
|
|
76
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
77
|
-
active: true
|
|
78
|
-
}));
|
|
79
|
-
});
|
|
80
|
-
it('should have its type prop set correctly', function () {
|
|
81
|
-
assert.strictEqual(wrapper.props().active, true);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
describe('with an active prop and a type prop', function () {
|
|
85
|
-
before(function () {
|
|
86
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
87
|
-
steps: steps,
|
|
88
|
-
type: "front-dark",
|
|
89
|
-
active: true
|
|
90
|
-
}));
|
|
91
|
-
}); // Pour ce test, on vérifie que la hauteur du connector est correctement calculée.
|
|
92
|
-
// Elle est fonction du nombre d'étapes, est le polynome permettant de la calculer est le suivant :
|
|
93
|
-
// height = screenHeight - 58 * (nbSteps - 1), ce qui pour notre cas de test où nbSteps = 5 et la hauteur de l'écran est initialisée à 768 donne 310
|
|
94
|
-
|
|
95
|
-
it('should have its length calculated correctly', function () {
|
|
96
|
-
assert.strictEqual(wrapper.dive().find('span').props().style.height, 310);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
describe('with content attached, in the case of a front-light breadcrumb', function () {
|
|
100
|
-
before(function () {
|
|
101
|
-
var content = React.createElement("span", null, "Test");
|
|
102
|
-
wrapper = shallow(React.createElement(HiStepConnector, {
|
|
103
|
-
steps: steps,
|
|
104
|
-
type: "front-light",
|
|
105
|
-
active: true,
|
|
106
|
-
content: content
|
|
107
|
-
}));
|
|
108
|
-
});
|
|
109
|
-
it('should render a HiStepContent component with content in it', function () {
|
|
110
|
-
assert.strictEqual(wrapper.dive().childAt(1).dive().name(), 'HiStepContent');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
});
|