@hipay/hipay-material-ui 2.3.1-rc2 → 2.3.1-rc4
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/App.test.js +8 -0
- package/HiAlertModal/HiAlertModal.js +48 -77
- package/HiAlertModal/HiAlertModal.test.js +189 -0
- package/HiAlertModal/index.js +1 -15
- package/HiAppBar/HiAppBar.js +34 -63
- package/HiAppBar/index.js +1 -15
- package/HiBadge/HiBadge.js +10 -29
- package/HiBadge/HiBadge.test.js +49 -0
- package/HiBadge/index.js +1 -15
- package/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/HiBreadcrumb/HiStep.js +35 -57
- package/HiBreadcrumb/HiStep.test.js +47 -0
- package/HiBreadcrumb/HiStepConnector.js +32 -57
- package/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/HiBreadcrumb/HiStepContent.js +25 -46
- package/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/HiBreadcrumb/HiStepIcon.js +26 -46
- package/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/HiBreadcrumb/HiStepLabel.js +36 -61
- package/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/HiBreadcrumb/HiStepper.js +23 -45
- package/HiBreadcrumb/HiStepper.test.js +33 -0
- package/HiBreadcrumb/index.js +1 -15
- package/HiButton/HiButton.js +9 -27
- package/HiButton/index.js +2 -13
- package/HiCell/CellAddress.js +20 -40
- package/HiCell/CellAddress.test.js +75 -0
- package/HiCell/CellDate.js +26 -47
- package/HiCell/CellDate.test.js +173 -0
- package/HiCell/CellIcon.js +28 -49
- package/HiCell/CellIcon.test.js +57 -0
- package/HiCell/CellImage.js +23 -42
- package/HiCell/CellImage.test.js +49 -0
- package/HiCell/CellNumeric.js +25 -46
- package/HiCell/CellNumeric.test.js +46 -0
- package/HiCell/CellPinToAction.js +20 -41
- package/HiCell/CellRate.js +32 -55
- package/HiCell/CellRate.test.js +73 -0
- package/HiCell/CellSentinel.js +22 -42
- package/HiCell/CellSentinel.test.js +48 -0
- package/HiCell/CellSentinelScore.js +23 -44
- package/HiCell/CellText.js +37 -56
- package/HiCell/CellText.test.js +76 -0
- package/HiCell/CellTextStyled.js +8 -21
- package/HiCell/index.js +9 -79
- package/HiCheckbox/HiCheckbox.js +35 -60
- package/HiCheckbox/HiCheckbox.test.js +55 -0
- package/HiCheckbox/index.js +1 -15
- package/HiChip/HiChip.js +24 -44
- package/HiChip/HiChip.test.js +136 -0
- package/HiChip/HiChipSwitch.js +47 -70
- package/HiChip/HiChipSwitch.test.js +99 -0
- package/HiChip/index.js +2 -23
- package/HiColoredLabel/HiColoredLabel.js +28 -52
- package/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/HiColoredLabel/index.js +1 -15
- package/HiDatePicker/Caption.js +11 -28
- package/HiDatePicker/Caption.test.js +65 -0
- package/HiDatePicker/HiDatePicker.js +100 -115
- package/HiDatePicker/HiDatePicker.test.js +370 -0
- package/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/HiDatePicker/HiDateRangePicker.js +138 -149
- package/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/HiDatePicker/ListPicker.js +33 -55
- package/HiDatePicker/ListPicker.test.js +53 -0
- package/HiDatePicker/NavBar.js +18 -45
- package/HiDatePicker/NavBar.test.js +39 -0
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/HiDatePicker/Overlays/Overlay.js +18 -35
- package/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/HiDatePicker/Overlays/index.js +5 -47
- package/HiDatePicker/Weekday.js +3 -13
- package/HiDatePicker/hiLocaleUtils.js +1 -8
- package/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/HiDatePicker/index.js +1 -15
- package/HiDatePicker/stylesheet.js +9 -22
- package/HiDotsStepper/HiDot.js +30 -57
- package/HiDotsStepper/HiDot.test.js +55 -0
- package/HiDotsStepper/HiDotsStepper.js +29 -47
- package/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/HiDotsStepper/index.js +2 -23
- package/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/HiExpansionPanel/index.js +2 -13
- package/HiForm/HiAddressField.js +30 -47
- package/HiForm/HiAddressField.test.js +79 -0
- package/HiForm/HiEmailField.js +28 -46
- package/HiForm/HiEmailField.test.js +19 -0
- package/HiForm/HiFormControl.js +72 -100
- package/HiForm/HiFormControl.test.js +195 -0
- package/HiForm/HiFormLabel.js +29 -54
- package/HiForm/HiFormLabel.test.js +66 -0
- package/HiForm/HiInput.js +62 -86
- package/HiForm/HiInput.test.js +202 -0
- package/HiForm/HiPasswordField.js +29 -55
- package/HiForm/HiPasswordField.test.js +60 -0
- package/HiForm/HiSearchField.js +27 -44
- package/HiForm/HiSearchField.test.js +193 -0
- package/HiForm/HiSlider.js +42 -64
- package/HiForm/HiSlider.test.js +99 -0
- package/HiForm/HiTextField.js +29 -46
- package/HiForm/HiTextField.test.js +254 -0
- package/HiForm/HiUpload.js +54 -70
- package/HiForm/HiUpload.test.js +241 -0
- package/HiForm/HiUploadField.js +24 -41
- package/HiForm/HiUploadField.test.js +55 -0
- package/HiForm/HiUploadInput.js +56 -77
- package/HiForm/HiUploadInput.test.js +148 -0
- package/HiForm/index.js +11 -95
- package/HiIcon/HiIcon.js +22 -44
- package/HiIcon/index.js +1 -15
- package/HiIconButton/HiIconButton.js +18 -40
- package/HiIconButton/HiIconButton.test.js +69 -0
- package/HiIconButton/index.js +1 -15
- package/HiLoader/HiLoader.js +9 -24
- package/HiLoader/HiLoader.test.js +18 -0
- package/HiLoader/index.js +1 -15
- package/HiMap/HiMap.js +50 -77
- package/HiMap/HiMap.test.js +29 -0
- package/HiMap/HiMapExpand.js +39 -64
- package/HiMap/HiMapExpand.test.js +48 -0
- package/HiMap/index.js +2 -23
- package/HiNotice/HiKPI.js +33 -54
- package/HiNotice/HiKPI.test.js +171 -0
- package/HiNotice/HiKPINotice.js +7 -21
- package/HiNotice/HiKPINotice.test.js +88 -0
- package/HiNotice/index.js +2 -23
- package/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/HiPaymentMeans/index.js +1 -15
- package/HiPdfReader/HiPdfReader.js +51 -76
- package/HiPdfReader/index.js +1 -15
- package/HiPin/HiPin.js +9 -30
- package/HiPin/HiPin.test.js +61 -0
- package/HiPin/index.js +1 -15
- package/HiRadio/HiRadio.js +7 -24
- package/HiRadio/HiRadio.test.js +57 -0
- package/HiRadio/index.js +1 -15
- package/HiSelect/HiDynamicSelect.js +40 -56
- package/HiSelect/HiDynamicSelectField.js +22 -40
- package/HiSelect/HiNestedSelect.js +55 -84
- package/HiSelect/HiNestedSelectContent.js +46 -73
- package/HiSelect/HiNestedSelectField.js +22 -40
- package/HiSelect/HiSelect.js +123 -139
- package/HiSelect/HiSelect.test.js +1092 -0
- package/HiSelect/HiSelectContent.js +73 -95
- package/HiSelect/HiSelectField.js +22 -40
- package/HiSelect/HiSelectInput.js +63 -87
- package/HiSelect/HiSelectInput.test.js +21 -0
- package/HiSelect/HiSelectMobile.js +35 -54
- package/HiSelect/HiSuggestSelect.js +56 -78
- package/HiSelect/HiSuggestSelectField.js +22 -40
- package/HiSelect/index.js +8 -85
- package/HiSelectableList/HiSelectableList.js +49 -77
- package/HiSelectableList/HiSelectableList.test.js +173 -0
- package/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/HiSelectableList/HiSelectableListItem.js +66 -98
- package/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/HiSelectableList/index.js +3 -31
- package/HiSwitch/HiSwitch.js +20 -45
- package/HiSwitch/HiSwitch.test.js +41 -0
- package/HiSwitch/HiSwitchState.js +15 -36
- package/HiSwitch/HiSwitchState.test.js +76 -0
- package/HiSwitch/index.js +2 -23
- package/HiTable/HiCellBuilder.js +44 -72
- package/HiTable/HiTable.js +29 -47
- package/HiTable/HiTable.test.js +29 -0
- package/HiTable/HiTableBody.js +19 -34
- package/HiTable/HiTableHeader.js +30 -53
- package/HiTable/HiTableRow.js +29 -56
- package/HiTable/constants.js +43 -94
- package/HiTable/index.js +1 -15
- package/es/App.test.js +8 -0
- package/es/HiAlertModal/HiAlertModal.js +48 -77
- package/es/HiAlertModal/HiAlertModal.test.js +189 -0
- package/es/HiAlertModal/index.js +1 -15
- package/es/HiAppBar/HiAppBar.js +34 -63
- package/es/HiAppBar/index.js +1 -15
- package/es/HiBadge/HiBadge.js +10 -29
- package/es/HiBadge/HiBadge.test.js +49 -0
- package/es/HiBadge/index.js +1 -15
- package/es/HiBreadcrumb/HiBreadcrumb.js +27 -43
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +44 -0
- package/es/HiBreadcrumb/HiStep.js +35 -57
- package/es/HiBreadcrumb/HiStep.test.js +47 -0
- package/es/HiBreadcrumb/HiStepConnector.js +32 -57
- package/es/HiBreadcrumb/HiStepConnector.test.js +113 -0
- package/es/HiBreadcrumb/HiStepContent.js +25 -46
- package/es/HiBreadcrumb/HiStepContent.test.js +32 -0
- package/es/HiBreadcrumb/HiStepIcon.js +26 -46
- package/es/HiBreadcrumb/HiStepIcon.test.js +65 -0
- package/es/HiBreadcrumb/HiStepLabel.js +36 -61
- package/es/HiBreadcrumb/HiStepLabel.test.js +30 -0
- package/es/HiBreadcrumb/HiStepper.js +23 -45
- package/es/HiBreadcrumb/HiStepper.test.js +33 -0
- package/es/HiBreadcrumb/index.js +1 -15
- package/es/HiButton/HiButton.js +9 -27
- package/es/HiButton/index.js +2 -13
- package/es/HiCell/CellAddress.js +20 -40
- package/es/HiCell/CellAddress.test.js +75 -0
- package/es/HiCell/CellDate.js +26 -47
- package/es/HiCell/CellDate.test.js +173 -0
- package/es/HiCell/CellIcon.js +28 -49
- package/es/HiCell/CellIcon.test.js +57 -0
- package/es/HiCell/CellImage.js +23 -42
- package/es/HiCell/CellImage.test.js +49 -0
- package/es/HiCell/CellNumeric.js +25 -46
- package/es/HiCell/CellNumeric.test.js +46 -0
- package/es/HiCell/CellPinToAction.js +20 -41
- package/es/HiCell/CellRate.js +32 -55
- package/es/HiCell/CellRate.test.js +73 -0
- package/es/HiCell/CellSentinel.js +22 -42
- package/es/HiCell/CellSentinel.test.js +48 -0
- package/es/HiCell/CellSentinelScore.js +23 -44
- package/es/HiCell/CellText.js +37 -56
- package/es/HiCell/CellText.test.js +76 -0
- package/es/HiCell/CellTextStyled.js +8 -21
- package/es/HiCell/index.js +9 -79
- package/es/HiCheckbox/HiCheckbox.js +35 -60
- package/es/HiCheckbox/HiCheckbox.test.js +55 -0
- package/es/HiCheckbox/index.js +1 -15
- package/es/HiChip/HiChip.js +24 -44
- package/es/HiChip/HiChip.test.js +136 -0
- package/es/HiChip/HiChipSwitch.js +47 -70
- package/es/HiChip/HiChipSwitch.test.js +99 -0
- package/es/HiChip/index.js +2 -23
- package/es/HiColoredLabel/HiColoredLabel.js +28 -52
- package/es/HiColoredLabel/HiColoredLabel.test.js +96 -0
- package/es/HiColoredLabel/index.js +1 -15
- package/es/HiDatePicker/Caption.js +11 -28
- package/es/HiDatePicker/Caption.test.js +65 -0
- package/es/HiDatePicker/HiDatePicker.js +100 -115
- package/es/HiDatePicker/HiDatePicker.test.js +370 -0
- package/es/HiDatePicker/HiDatePickerMobile.js +32 -54
- package/es/HiDatePicker/HiDateRangePicker.js +138 -149
- package/es/HiDatePicker/HiDateRangePicker.test.js +703 -0
- package/es/HiDatePicker/HiDateRangeSelector.js +71 -103
- package/es/HiDatePicker/HiDateRangeSelector.test.js +193 -0
- package/es/HiDatePicker/ListPicker.js +33 -55
- package/es/HiDatePicker/ListPicker.test.js +53 -0
- package/es/HiDatePicker/NavBar.js +18 -45
- package/es/HiDatePicker/NavBar.test.js +39 -0
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +23 -40
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +22 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +50 -0
- package/es/HiDatePicker/Overlays/Overlay.js +18 -35
- package/es/HiDatePicker/Overlays/Overlay.test.js +20 -0
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +47 -73
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +48 -0
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +29 -45
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +79 -0
- package/es/HiDatePicker/Overlays/index.js +5 -47
- package/es/HiDatePicker/Weekday.js +3 -13
- package/es/HiDatePicker/hiLocaleUtils.js +1 -8
- package/es/HiDatePicker/hiLocaleUtils.test.js +51 -0
- package/es/HiDatePicker/index.js +1 -15
- package/es/HiDatePicker/stylesheet.js +9 -22
- package/es/HiDotsStepper/HiDot.js +30 -57
- package/es/HiDotsStepper/HiDot.test.js +55 -0
- package/es/HiDotsStepper/HiDotsStepper.js +29 -47
- package/es/HiDotsStepper/HiDotsStepper.test.js +90 -0
- package/es/HiDotsStepper/index.js +2 -23
- package/es/HiExpansionPanel/HiExpansionPanel.js +42 -72
- package/es/HiExpansionPanel/index.js +2 -13
- package/es/HiForm/HiAddressField.js +30 -47
- package/es/HiForm/HiAddressField.test.js +79 -0
- package/es/HiForm/HiEmailField.js +28 -46
- package/es/HiForm/HiEmailField.test.js +19 -0
- package/es/HiForm/HiFormControl.js +72 -100
- package/es/HiForm/HiFormControl.test.js +195 -0
- package/es/HiForm/HiFormLabel.js +29 -54
- package/es/HiForm/HiFormLabel.test.js +66 -0
- package/es/HiForm/HiInput.js +62 -86
- package/es/HiForm/HiInput.test.js +202 -0
- package/es/HiForm/HiPasswordField.js +29 -55
- package/es/HiForm/HiPasswordField.test.js +60 -0
- package/es/HiForm/HiSearchField.js +27 -44
- package/es/HiForm/HiSearchField.test.js +193 -0
- package/es/HiForm/HiSlider.js +42 -64
- package/es/HiForm/HiSlider.test.js +99 -0
- package/es/HiForm/HiTextField.js +29 -46
- package/es/HiForm/HiTextField.test.js +254 -0
- package/es/HiForm/HiUpload.js +54 -70
- package/es/HiForm/HiUpload.test.js +241 -0
- package/es/HiForm/HiUploadField.js +24 -41
- package/es/HiForm/HiUploadField.test.js +55 -0
- package/es/HiForm/HiUploadInput.js +56 -77
- package/es/HiForm/HiUploadInput.test.js +148 -0
- package/es/HiForm/index.js +11 -95
- package/es/HiIcon/HiIcon.js +22 -44
- package/es/HiIcon/index.js +1 -15
- package/es/HiIconButton/HiIconButton.js +18 -40
- package/es/HiIconButton/HiIconButton.test.js +69 -0
- package/es/HiIconButton/index.js +1 -15
- package/es/HiLoader/HiLoader.js +9 -24
- package/es/HiLoader/HiLoader.test.js +18 -0
- package/es/HiLoader/index.js +1 -15
- package/es/HiMap/HiMap.js +50 -77
- package/es/HiMap/HiMap.test.js +29 -0
- package/es/HiMap/HiMapExpand.js +39 -64
- package/es/HiMap/HiMapExpand.test.js +48 -0
- package/es/HiMap/index.js +2 -23
- package/es/HiNotice/HiKPI.js +33 -54
- package/es/HiNotice/HiKPI.test.js +171 -0
- package/es/HiNotice/HiKPINotice.js +7 -21
- package/es/HiNotice/HiKPINotice.test.js +88 -0
- package/es/HiNotice/index.js +2 -23
- package/es/HiPaymentMeans/HiPaymentMeans.js +112 -131
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +162 -0
- package/es/HiPaymentMeans/index.js +1 -15
- package/es/HiPdfReader/HiPdfReader.js +51 -76
- package/es/HiPdfReader/index.js +1 -15
- package/es/HiPin/HiPin.js +9 -30
- package/es/HiPin/HiPin.test.js +61 -0
- package/es/HiPin/index.js +1 -15
- package/es/HiRadio/HiRadio.js +7 -24
- package/es/HiRadio/HiRadio.test.js +57 -0
- package/es/HiRadio/index.js +1 -15
- package/es/HiSelect/HiDynamicSelect.js +40 -56
- package/es/HiSelect/HiDynamicSelectField.js +22 -40
- package/es/HiSelect/HiNestedSelect.js +55 -84
- package/es/HiSelect/HiNestedSelectContent.js +46 -73
- package/es/HiSelect/HiNestedSelectField.js +22 -40
- package/es/HiSelect/HiSelect.js +123 -139
- package/es/HiSelect/HiSelect.test.js +1092 -0
- package/es/HiSelect/HiSelectContent.js +73 -95
- package/es/HiSelect/HiSelectField.js +22 -40
- package/es/HiSelect/HiSelectInput.js +63 -87
- package/es/HiSelect/HiSelectInput.test.js +21 -0
- package/es/HiSelect/HiSelectMobile.js +35 -54
- package/es/HiSelect/HiSuggestSelect.js +56 -78
- package/es/HiSelect/HiSuggestSelectField.js +22 -40
- package/es/HiSelect/index.js +8 -85
- package/es/HiSelectableList/HiSelectableList.js +49 -77
- package/es/HiSelectableList/HiSelectableList.test.js +173 -0
- package/es/HiSelectableList/HiSelectableListHierarchic.js +35 -56
- package/es/HiSelectableList/HiSelectableListItem.js +66 -98
- package/es/HiSelectableList/HiSelectableListItem.test.js +97 -0
- package/es/HiSelectableList/index.js +3 -31
- package/es/HiSwitch/HiSwitch.js +20 -45
- package/es/HiSwitch/HiSwitch.test.js +41 -0
- package/es/HiSwitch/HiSwitchState.js +15 -36
- package/es/HiSwitch/HiSwitchState.test.js +76 -0
- package/es/HiSwitch/index.js +2 -23
- package/es/HiTable/HiCellBuilder.js +44 -72
- package/es/HiTable/HiTable.js +29 -47
- package/es/HiTable/HiTable.test.js +29 -0
- package/es/HiTable/HiTableBody.js +19 -34
- package/es/HiTable/HiTableHeader.js +30 -53
- package/es/HiTable/HiTableRow.js +29 -56
- package/es/HiTable/constants.js +43 -94
- package/es/HiTable/index.js +1 -15
- package/es/hi-svg-icons/HiAccount.js +18 -36
- package/es/hi-svg-icons/HiActivity.js +17 -35
- package/es/hi-svg-icons/HiAll.js +22 -42
- package/es/hi-svg-icons/HiBilling.js +18 -36
- package/es/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/es/hi-svg-icons/HiCatalog.js +18 -36
- package/es/hi-svg-icons/HiCustomer.js +18 -36
- package/es/hi-svg-icons/HiDownload.js +11 -25
- package/es/hi-svg-icons/HiFinance.js +18 -36
- package/es/hi-svg-icons/HiPermission.js +17 -35
- package/es/hi-svg-icons/HiRoute.js +18 -36
- package/es/hi-svg-icons/HiSettlement.js +18 -36
- package/es/hi-svg-icons/HiSizeLarge.js +12 -27
- package/es/hi-svg-icons/HiSizeMedium.js +11 -25
- package/es/hi-svg-icons/HiSizeSmall.js +11 -25
- package/es/hi-svg-icons/HiTransaction.js +18 -36
- package/es/hi-svg-icons/HiUser.js +18 -36
- package/es/hi-svg-icons/HiWidget.js +22 -42
- package/es/hi-svg-icons/index.js +18 -151
- package/es/hi-svg-icons/index.text.js +11 -21
- package/es/styleguide/Wrapper.js +19 -36
- package/es/styles/MuiThemeProvider.js +39 -59
- package/es/styles/colorManipulator.js +16 -44
- package/es/styles/colorManipulator.test.js +242 -0
- package/es/styles/createBreakpoints.js +6 -20
- package/es/styles/createBreakpoints.test.js +48 -0
- package/es/styles/createGenerateClassName.js +5 -15
- package/es/styles/createGenerateClassName.test.js +141 -0
- package/es/styles/createMixins.js +8 -19
- package/es/styles/createMixins.test.js +24 -0
- package/es/styles/createMuiTheme.js +34 -53
- package/es/styles/createMuiTheme.test.js +67 -0
- package/es/styles/createPalette.js +30 -50
- package/es/styles/createPalette.test.js +159 -0
- package/es/styles/createStyles.js +1 -8
- package/es/styles/createStyles.test.js +8 -0
- package/es/styles/createTypography.js +18 -30
- package/es/styles/createTypography.test.js +60 -0
- package/es/styles/getStylesCreator.js +11 -24
- package/es/styles/getStylesCreator.test.js +92 -0
- package/es/styles/getThemeProps.js +1 -9
- package/es/styles/getThemeProps.test.js +39 -0
- package/es/styles/index.js +5 -47
- package/es/styles/jssPreset.js +9 -25
- package/es/styles/mergeClasses.js +7 -19
- package/es/styles/shadows.js +1 -8
- package/es/styles/shape.js +1 -8
- package/es/styles/spacing.js +1 -9
- package/es/styles/themeListener.js +5 -18
- package/es/styles/themeListener.test.js +26 -0
- package/es/styles/transitions.js +18 -38
- package/es/styles/transitions.test.js +208 -0
- package/es/styles/zIndex.js +1 -8
- package/es/test-utils/createMount.js +11 -22
- package/es/test-utils/createRender.js +8 -19
- package/es/test-utils/createShallow.js +13 -23
- package/es/test-utils/getClasses.js +2 -11
- package/es/test-utils/index.js +5 -47
- package/es/test-utils/until.js +6 -16
- package/es/test-utils/until.test.js +157 -0
- package/es/test-utils/unwrap.js +1 -8
- package/es/theme/palette.js +2 -10
- package/es/theme/typography.js +2 -10
- package/es/theme.js +2 -11
- package/es/transitions/utils.js +2 -13
- package/es/utils/exactProp.js +5 -18
- package/es/utils/helpers.js +18 -55
- package/es/withMobileDialog/index.js +1 -15
- package/es/withMobileDialog/withMobileDialog.js +7 -22
- package/es/withMobileDialog/withMobileDialog.test.js +67 -0
- package/hi-svg-icons/HiAccount.js +18 -36
- package/hi-svg-icons/HiActivity.js +17 -35
- package/hi-svg-icons/HiAll.js +22 -42
- package/hi-svg-icons/HiBilling.js +18 -36
- package/hi-svg-icons/HiBriefcaseRescue.js +10 -26
- package/hi-svg-icons/HiCatalog.js +18 -36
- package/hi-svg-icons/HiCustomer.js +18 -36
- package/hi-svg-icons/HiDownload.js +11 -25
- package/hi-svg-icons/HiFinance.js +18 -36
- package/hi-svg-icons/HiPermission.js +17 -35
- package/hi-svg-icons/HiRoute.js +18 -36
- package/hi-svg-icons/HiSettlement.js +18 -36
- package/hi-svg-icons/HiSizeLarge.js +12 -27
- package/hi-svg-icons/HiSizeMedium.js +11 -25
- package/hi-svg-icons/HiSizeSmall.js +11 -25
- package/hi-svg-icons/HiTransaction.js +18 -36
- package/hi-svg-icons/HiUser.js +18 -36
- package/hi-svg-icons/HiWidget.js +22 -42
- package/hi-svg-icons/index.js +18 -151
- package/hi-svg-icons/index.text.js +11 -21
- package/package.json +1 -1
- package/styleguide/Wrapper.js +19 -36
- package/styles/MuiThemeProvider.js +39 -59
- package/styles/colorManipulator.js +16 -44
- package/styles/colorManipulator.test.js +242 -0
- package/styles/createBreakpoints.js +6 -20
- package/styles/createBreakpoints.test.js +48 -0
- package/styles/createGenerateClassName.js +5 -15
- package/styles/createGenerateClassName.test.js +141 -0
- package/styles/createMixins.js +8 -19
- package/styles/createMixins.test.js +24 -0
- package/styles/createMuiTheme.js +34 -53
- package/styles/createMuiTheme.test.js +67 -0
- package/styles/createPalette.js +30 -50
- package/styles/createPalette.test.js +159 -0
- package/styles/createStyles.js +1 -8
- package/styles/createStyles.test.js +8 -0
- package/styles/createTypography.js +18 -30
- package/styles/createTypography.test.js +60 -0
- package/styles/getStylesCreator.js +11 -24
- package/styles/getStylesCreator.test.js +92 -0
- package/styles/getThemeProps.js +1 -9
- package/styles/getThemeProps.test.js +39 -0
- package/styles/index.js +5 -47
- package/styles/jssPreset.js +9 -25
- package/styles/mergeClasses.js +7 -19
- package/styles/shadows.js +1 -8
- package/styles/shape.js +1 -8
- package/styles/spacing.js +1 -9
- package/styles/themeListener.js +5 -18
- package/styles/themeListener.test.js +26 -0
- package/styles/transitions.js +18 -38
- package/styles/transitions.test.js +208 -0
- package/styles/zIndex.js +1 -8
- package/test-utils/createMount.js +11 -22
- package/test-utils/createRender.js +8 -19
- package/test-utils/createShallow.js +13 -23
- package/test-utils/getClasses.js +2 -11
- package/test-utils/index.js +5 -47
- package/test-utils/until.js +6 -16
- package/test-utils/until.test.js +157 -0
- package/test-utils/unwrap.js +1 -8
- package/theme/palette.js +2 -10
- package/theme/typography.js +2 -10
- package/theme.js +2 -11
- package/transitions/utils.js +2 -13
- package/utils/exactProp.js +5 -18
- package/utils/helpers.js +18 -55
- package/withMobileDialog/index.js +1 -15
- package/withMobileDialog/withMobileDialog.js +7 -22
- package/withMobileDialog/withMobileDialog.test.js +67 -0
package/App.test.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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,52 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
23
|
-
|
|
24
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
25
|
-
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
27
|
-
|
|
28
|
-
var _react = _interopRequireDefault(require("react"));
|
|
29
|
-
|
|
30
|
-
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
31
|
-
|
|
32
|
-
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
33
|
-
|
|
34
|
-
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
35
|
-
|
|
36
|
-
var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));
|
|
37
|
-
|
|
38
|
-
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
39
|
-
|
|
40
|
-
var _styles = require("@material-ui/core/styles");
|
|
41
|
-
|
|
42
|
-
var _HiButton = _interopRequireDefault(require("../HiButton"));
|
|
43
|
-
|
|
44
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
|
45
|
-
|
|
46
|
-
var _helpers = require("../utils/helpers");
|
|
47
|
-
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
48
9
|
// @inheritedComponent Dialog
|
|
49
|
-
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import Dialog from '@material-ui/core/Dialog';
|
|
12
|
+
import DialogActions from '@material-ui/core/DialogActions';
|
|
13
|
+
import DialogContent from '@material-ui/core/DialogContent';
|
|
14
|
+
import DialogContentText from '@material-ui/core/DialogContentText';
|
|
15
|
+
import DialogTitle from '@material-ui/core/DialogTitle';
|
|
16
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
17
|
+
import HiButton from '../HiButton';
|
|
18
|
+
import HiIcon from '../HiIcon';
|
|
19
|
+
import { escapeHTML } from '../utils/helpers';
|
|
20
|
+
export var styles = function styles(theme) {
|
|
50
21
|
return {
|
|
51
22
|
classContent: {
|
|
52
23
|
fontSize: 14,
|
|
@@ -94,33 +65,33 @@ var styles = function styles(theme) {
|
|
|
94
65
|
* Pop up d'alert
|
|
95
66
|
*/
|
|
96
67
|
|
|
97
|
-
|
|
98
|
-
exports.styles = styles;
|
|
99
|
-
|
|
100
68
|
var HiAlertModal =
|
|
101
69
|
/*#__PURE__*/
|
|
102
70
|
function (_React$PureComponent) {
|
|
103
|
-
(
|
|
71
|
+
_inherits(HiAlertModal, _React$PureComponent);
|
|
104
72
|
|
|
105
73
|
function HiAlertModal(props) {
|
|
106
74
|
var _this;
|
|
107
75
|
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
(
|
|
76
|
+
_classCallCheck(this, HiAlertModal);
|
|
77
|
+
|
|
78
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiAlertModal).call(this, props));
|
|
79
|
+
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "handleOnClose", function () {
|
|
111
81
|
if (_this.props.onClose) {
|
|
112
82
|
_this.props.onClose();
|
|
113
83
|
}
|
|
114
84
|
});
|
|
115
|
-
|
|
116
|
-
_this.
|
|
117
|
-
_this.
|
|
118
|
-
_this.
|
|
85
|
+
|
|
86
|
+
_this.submitButtonRef = React.createRef();
|
|
87
|
+
_this.cancelButtonRef = React.createRef();
|
|
88
|
+
_this.handleOnClose = _this.handleOnClose.bind(_assertThisInitialized(_this));
|
|
89
|
+
_this.handleOnEntered = _this.handleOnEntered.bind(_assertThisInitialized(_this));
|
|
119
90
|
return _this;
|
|
120
91
|
} // Appelé si clic en dehors de la pop up
|
|
121
92
|
|
|
122
93
|
|
|
123
|
-
(
|
|
94
|
+
_createClass(HiAlertModal, [{
|
|
124
95
|
key: "handleOnEntered",
|
|
125
96
|
value: function handleOnEntered() {
|
|
126
97
|
if (this.props.labelSubmitButton) {
|
|
@@ -151,19 +122,20 @@ function (_React$PureComponent) {
|
|
|
151
122
|
submitColor = _this$props.submitColor,
|
|
152
123
|
title = _this$props.title,
|
|
153
124
|
theme = _this$props.theme,
|
|
154
|
-
props = (
|
|
125
|
+
props = _objectWithoutProperties(_this$props, ["backgroundIcon", "iconSize", "classes", "content", "labelCancelButton", "labelSubmitButton", "onCancelClick", "onSubmitClick", "open", "cancelColor", "submitColor", "title", "theme"]);
|
|
126
|
+
|
|
155
127
|
var dialogContent = content;
|
|
156
128
|
|
|
157
129
|
if (typeof content === 'string') {
|
|
158
|
-
dialogContent =
|
|
130
|
+
dialogContent = React.createElement("span", {
|
|
159
131
|
// eslint-disable-next-line react/no-danger
|
|
160
132
|
dangerouslySetInnerHTML: {
|
|
161
|
-
__html:
|
|
133
|
+
__html: escapeHTML(content)
|
|
162
134
|
}
|
|
163
135
|
});
|
|
164
136
|
}
|
|
165
137
|
|
|
166
|
-
return
|
|
138
|
+
return React.createElement(Dialog, Object.assign({
|
|
167
139
|
open: open,
|
|
168
140
|
onClose: this.handleOnClose,
|
|
169
141
|
onEntered: this.handleOnEntered,
|
|
@@ -171,26 +143,26 @@ function (_React$PureComponent) {
|
|
|
171
143
|
root: classes.classDialogRoot,
|
|
172
144
|
paper: classes.classDialogPaper
|
|
173
145
|
}
|
|
174
|
-
}, props), backgroundIcon &&
|
|
146
|
+
}, props), backgroundIcon && React.createElement("div", {
|
|
175
147
|
className: classes.classBackgroundIcon
|
|
176
|
-
},
|
|
148
|
+
}, React.createElement(HiIcon, {
|
|
177
149
|
color: "inherit",
|
|
178
150
|
icon: backgroundIcon,
|
|
179
151
|
size: iconSize
|
|
180
|
-
})), title &&
|
|
152
|
+
})), title && React.createElement(DialogTitle, {
|
|
181
153
|
disableTypography: true,
|
|
182
154
|
classes: {
|
|
183
155
|
root: classes.classTitle
|
|
184
156
|
}
|
|
185
|
-
}, title),
|
|
157
|
+
}, title), React.createElement(DialogContent, null, React.createElement(DialogContentText, {
|
|
186
158
|
classes: {
|
|
187
159
|
root: classes.classContent
|
|
188
160
|
}
|
|
189
|
-
}, dialogContent)),
|
|
161
|
+
}, dialogContent)), React.createElement(DialogActions, {
|
|
190
162
|
classes: {
|
|
191
163
|
root: classes.classAction
|
|
192
164
|
}
|
|
193
|
-
}, labelCancelButton &&
|
|
165
|
+
}, labelCancelButton && React.createElement(HiButton, {
|
|
194
166
|
classes: {
|
|
195
167
|
root: classes.classCancelButton
|
|
196
168
|
},
|
|
@@ -200,7 +172,7 @@ function (_React$PureComponent) {
|
|
|
200
172
|
action: function action(actions) {
|
|
201
173
|
_this2.cancelActionsRef = actions;
|
|
202
174
|
}
|
|
203
|
-
}, labelCancelButton), labelSubmitButton &&
|
|
175
|
+
}, labelCancelButton), labelSubmitButton && React.createElement(HiButton, {
|
|
204
176
|
classes: {
|
|
205
177
|
root: classes.classSubmitButton
|
|
206
178
|
},
|
|
@@ -213,19 +185,18 @@ function (_React$PureComponent) {
|
|
|
213
185
|
}, labelSubmitButton)));
|
|
214
186
|
}
|
|
215
187
|
}]);
|
|
188
|
+
|
|
216
189
|
return HiAlertModal;
|
|
217
|
-
}(
|
|
190
|
+
}(React.PureComponent);
|
|
218
191
|
|
|
219
|
-
(
|
|
192
|
+
_defineProperty(HiAlertModal, "defaultProps", {
|
|
220
193
|
content: '',
|
|
221
194
|
cancelColor: 'neutral',
|
|
222
195
|
submitColor: 'primary'
|
|
223
196
|
});
|
|
224
197
|
|
|
225
|
-
|
|
198
|
+
export default withStyles(styles, {
|
|
226
199
|
hiComponent: true,
|
|
227
200
|
name: 'HmuiHiAlertModal',
|
|
228
201
|
withTheme: true
|
|
229
|
-
})(HiAlertModal);
|
|
230
|
-
|
|
231
|
-
exports.default = _default;
|
|
202
|
+
})(HiAlertModal);
|
|
@@ -0,0 +1,189 @@
|
|
|
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/HiAlertModal/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
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 _HiAlertModal.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var _HiAlertModal = _interopRequireDefault(require("./HiAlertModal"));
|
|
1
|
+
export { default } from './HiAlertModal';
|
package/HiAppBar/HiAppBar.js
CHANGED
|
@@ -1,44 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = exports.styles = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
21
|
-
|
|
22
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
27
|
-
|
|
28
|
-
var _styles = require("@material-ui/core/styles");
|
|
29
|
-
|
|
30
|
-
var _AppBar = _interopRequireDefault(require("@material-ui/core/AppBar"));
|
|
31
|
-
|
|
32
|
-
var _Collapse = _interopRequireDefault(require("@material-ui/core/Collapse"));
|
|
33
|
-
|
|
34
|
-
var _Toolbar = _interopRequireDefault(require("@material-ui/core/Toolbar"));
|
|
35
|
-
|
|
36
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
|
37
|
-
|
|
38
|
-
var _HiIconButton = _interopRequireDefault(require("../HiIconButton"));
|
|
39
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
40
8
|
// @inheritedComponent AppBar
|
|
41
|
-
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
12
|
+
import AppBar from '@material-ui/core/AppBar';
|
|
13
|
+
import Collapse from '@material-ui/core/Collapse';
|
|
14
|
+
import Toolbar from '@material-ui/core/Toolbar';
|
|
15
|
+
import HiIcon from '../HiIcon';
|
|
16
|
+
import HiIconButton from '../HiIconButton';
|
|
17
|
+
export var styles = function styles(theme) {
|
|
42
18
|
return {
|
|
43
19
|
root: {},
|
|
44
20
|
bar: {
|
|
@@ -63,30 +39,25 @@ var styles = function styles(theme) {
|
|
|
63
39
|
};
|
|
64
40
|
};
|
|
65
41
|
|
|
66
|
-
exports.styles = styles;
|
|
67
|
-
|
|
68
|
-
var _ref = _react.default.createElement(_HiIcon.default, {
|
|
69
|
-
icon: "keyboard_arrow_up"
|
|
70
|
-
});
|
|
71
|
-
|
|
72
42
|
var HiAppBar =
|
|
73
43
|
/*#__PURE__*/
|
|
74
44
|
function (_React$Component) {
|
|
75
|
-
(
|
|
45
|
+
_inherits(HiAppBar, _React$Component);
|
|
76
46
|
|
|
77
47
|
function HiAppBar(props) {
|
|
78
48
|
var _this;
|
|
79
49
|
|
|
80
|
-
(
|
|
81
|
-
|
|
50
|
+
_classCallCheck(this, HiAppBar);
|
|
51
|
+
|
|
52
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiAppBar).call(this, props));
|
|
82
53
|
_this.state = {
|
|
83
54
|
collapsed: false
|
|
84
55
|
};
|
|
85
|
-
_this.handleCollapse = _this.handleCollapse.bind((
|
|
56
|
+
_this.handleCollapse = _this.handleCollapse.bind(_assertThisInitialized(_this));
|
|
86
57
|
return _this;
|
|
87
58
|
}
|
|
88
59
|
|
|
89
|
-
(
|
|
60
|
+
_createClass(HiAppBar, [{
|
|
90
61
|
key: "handleCollapse",
|
|
91
62
|
value: function handleCollapse() {
|
|
92
63
|
this.props.onCollapse(!this.state.collapsed);
|
|
@@ -102,35 +73,35 @@ function (_React$Component) {
|
|
|
102
73
|
focused = _this$props.focused,
|
|
103
74
|
hideable = _this$props.hideable,
|
|
104
75
|
position = _this$props.position;
|
|
105
|
-
return
|
|
106
|
-
className: (
|
|
76
|
+
return React.createElement(AppBar, {
|
|
77
|
+
className: classNames(className, classes.bar, _defineProperty({}, classes.focused, focused)),
|
|
107
78
|
classes: {
|
|
108
79
|
root: classes.root
|
|
109
80
|
},
|
|
110
81
|
elevation: 2,
|
|
111
82
|
position: position,
|
|
112
83
|
color: "default"
|
|
113
|
-
},
|
|
114
|
-
className: (
|
|
84
|
+
}, React.createElement(Collapse, {
|
|
85
|
+
className: classNames(_defineProperty({}, classes.collapseOverflow, !hideable)),
|
|
115
86
|
in: !collapsed
|
|
116
|
-
},
|
|
87
|
+
}, React.createElement("div", null, React.createElement(Toolbar, null, children, hideable && React.createElement(HiIconButton, {
|
|
117
88
|
onClick: this.handleCollapse,
|
|
118
89
|
color: "inherit",
|
|
119
90
|
className: classes.iconButton
|
|
120
|
-
},
|
|
91
|
+
}, React.createElement(HiIcon, {
|
|
92
|
+
icon: "keyboard_arrow_up"
|
|
93
|
+
}))))));
|
|
121
94
|
}
|
|
122
95
|
}]);
|
|
96
|
+
|
|
123
97
|
return HiAppBar;
|
|
124
|
-
}(
|
|
98
|
+
}(React.Component);
|
|
125
99
|
|
|
126
100
|
HiAppBar.defaultProps = {
|
|
127
101
|
focused: false,
|
|
128
102
|
hideable: false
|
|
129
103
|
};
|
|
130
|
-
|
|
131
|
-
var _default = (0, _styles.withStyles)(styles, {
|
|
104
|
+
export default withStyles(styles, {
|
|
132
105
|
hiComponent: true,
|
|
133
106
|
name: 'HmuiHiAppBar'
|
|
134
|
-
})(HiAppBar);
|
|
135
|
-
|
|
136
|
-
exports.default = _default;
|
|
107
|
+
})(HiAppBar);
|
package/HiAppBar/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
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 _HiAppBar.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var _HiAppBar = _interopRequireDefault(require("./HiAppBar"));
|
|
1
|
+
export { default } from './HiAppBar';
|
package/HiBadge/HiBadge.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = exports.styles = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _Badge = _interopRequireDefault(require("@material-ui/core/Badge"));
|
|
17
|
-
|
|
18
|
-
var _styles = require("@material-ui/core/styles");
|
|
19
|
-
|
|
20
|
-
var styles = function styles(theme) {
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Badge from '@material-ui/core/Badge';
|
|
5
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
6
|
+
export var styles = function styles(theme) {
|
|
21
7
|
return {
|
|
22
8
|
// Usefull for style overriding
|
|
23
9
|
root: {},
|
|
@@ -67,8 +53,6 @@ var styles = function styles(theme) {
|
|
|
67
53
|
};
|
|
68
54
|
};
|
|
69
55
|
|
|
70
|
-
exports.styles = styles;
|
|
71
|
-
|
|
72
56
|
function HiBadge(props) {
|
|
73
57
|
var _classNames;
|
|
74
58
|
|
|
@@ -79,8 +63,8 @@ function HiBadge(props) {
|
|
|
79
63
|
value = props.value;
|
|
80
64
|
var length = value.toString().length;
|
|
81
65
|
var finalValue = value > 100 ? '+100' : value;
|
|
82
|
-
var badgeClass = (
|
|
83
|
-
return
|
|
66
|
+
var badgeClass = classNames(classes.badge, (_classNames = {}, _defineProperty(_classNames, classes.primary, color === 'primary'), _defineProperty(_classNames, classes.secondary, color === 'secondary'), _defineProperty(_classNames, classes.positive, color === 'positive'), _defineProperty(_classNames, classes.negative, color === 'negative'), _defineProperty(_classNames, classes.middle, color === 'middle'), _defineProperty(_classNames, classes.neutral, color === 'neutral'), _defineProperty(_classNames, classes.shortBadge, length < 2), _defineProperty(_classNames, classes.mediumBadge, length === 2), _defineProperty(_classNames, classes.longBadge, length > 2), _classNames));
|
|
67
|
+
return React.createElement(Badge, {
|
|
84
68
|
className: className,
|
|
85
69
|
classes: {
|
|
86
70
|
root: classes.root,
|
|
@@ -94,10 +78,7 @@ function HiBadge(props) {
|
|
|
94
78
|
HiBadge.defaultProps = {
|
|
95
79
|
color: 'primary'
|
|
96
80
|
};
|
|
97
|
-
|
|
98
|
-
var _default = (0, _styles.withStyles)(styles, {
|
|
81
|
+
export default withStyles(styles, {
|
|
99
82
|
hiComponent: true,
|
|
100
83
|
name: 'HmuiHiBadge'
|
|
101
|
-
})(HiBadge);
|
|
102
|
-
|
|
103
|
-
exports.default = _default;
|
|
84
|
+
})(HiBadge);
|