@hipay/hipay-material-ui 2.3.1-rc2 → 2.3.1-rc4
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,13 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = void 0;
|
9
|
-
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
1
|
+
import React from 'react';
|
11
2
|
|
12
3
|
var Weekday = function Weekday(_ref) {
|
13
4
|
var weekday = _ref.weekday,
|
@@ -15,11 +6,10 @@ var Weekday = function Weekday(_ref) {
|
|
15
6
|
localeUtils = _ref.localeUtils,
|
16
7
|
locale = _ref.locale;
|
17
8
|
var weekdayName = localeUtils.formatWeekdayLong(weekday, locale);
|
18
|
-
return
|
9
|
+
return React.createElement("div", {
|
19
10
|
className: className,
|
20
11
|
title: weekdayName
|
21
12
|
}, weekdayName.slice(0, 1));
|
22
13
|
};
|
23
14
|
|
24
|
-
|
25
|
-
exports.default = _default;
|
15
|
+
export default Weekday;
|
@@ -1,9 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
1
|
var WEEKDAYS_LONG = {
|
8
2
|
en_US: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
9
3
|
fr_FR: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
|
@@ -140,5 +134,4 @@ var HiLocaleUtils = {
|
|
140
134
|
getMonths: getMonths,
|
141
135
|
formatLocale: formatLocale
|
142
136
|
};
|
143
|
-
|
144
|
-
exports.default = _default;
|
137
|
+
export default HiLocaleUtils;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { assert } from 'chai';
|
2
|
+
import localeUtils from './hiLocaleUtils';
|
3
|
+
describe('HiDatePicker/HiLocaleUtils.js', function () {
|
4
|
+
describe('formatLocale', function () {
|
5
|
+
it('should work', function () {
|
6
|
+
assert.strictEqual(localeUtils.formatLocale('fr_FR'), 'fr_FR');
|
7
|
+
});
|
8
|
+
});
|
9
|
+
describe('formatDay', function () {
|
10
|
+
it('should work', function () {
|
11
|
+
var d = new Date('2018-11-23');
|
12
|
+
assert.strictEqual(localeUtils.formatDay(d), 'Friday, 23 November 2018');
|
13
|
+
assert.strictEqual(localeUtils.formatDay(d, 'fr_FR'), 'Vendredi, 23 Novembre 2018');
|
14
|
+
});
|
15
|
+
});
|
16
|
+
describe('formatMonthTitle', function () {
|
17
|
+
it('should work', function () {
|
18
|
+
var d = new Date('2018-11-23');
|
19
|
+
assert.strictEqual(localeUtils.formatMonthTitle(d), 'November 2018');
|
20
|
+
assert.strictEqual(localeUtils.formatMonthTitle(d, 'fr_FR'), 'Novembre 2018');
|
21
|
+
});
|
22
|
+
});
|
23
|
+
describe('formatWeekdayShort', function () {
|
24
|
+
it('should work', function () {
|
25
|
+
assert.strictEqual(localeUtils.formatWeekdayShort(0), 'Su');
|
26
|
+
assert.strictEqual(localeUtils.formatWeekdayShort(0, 'fr_FR'), 'Di');
|
27
|
+
});
|
28
|
+
});
|
29
|
+
describe('formatWeekdayLong', function () {
|
30
|
+
it('should work', function () {
|
31
|
+
assert.strictEqual(localeUtils.formatWeekdayLong(0), 'Sunday');
|
32
|
+
assert.strictEqual(localeUtils.formatWeekdayLong(0, 'fr_FR'), 'Dimanche');
|
33
|
+
});
|
34
|
+
});
|
35
|
+
describe('getFirstDayOfWeek', function () {
|
36
|
+
it('should work', function () {
|
37
|
+
assert.strictEqual(localeUtils.getFirstDayOfWeek(), 0);
|
38
|
+
assert.strictEqual(localeUtils.getFirstDayOfWeek('fr_FR'), 1);
|
39
|
+
});
|
40
|
+
});
|
41
|
+
describe('getMonths', function () {
|
42
|
+
it('should work', function () {
|
43
|
+
var actualJSONUS = JSON.stringify(localeUtils.getMonths());
|
44
|
+
var expectedJSONUS = JSON.stringify(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
|
45
|
+
assert.strictEqual(actualJSONUS, expectedJSONUS);
|
46
|
+
var actualJSONFR = JSON.stringify(localeUtils.getMonths('fr_FR'));
|
47
|
+
var expectedJSONFR = JSON.stringify(['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']);
|
48
|
+
assert.strictEqual(actualJSONFR, expectedJSONFR);
|
49
|
+
});
|
50
|
+
});
|
51
|
+
});
|
package/es/HiDatePicker/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 _HiDatePicker.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
|
15
|
-
var _HiDatePicker = _interopRequireDefault(require("./HiDatePicker"));
|
1
|
+
export { default } from './HiDatePicker';
|
@@ -1,17 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = void 0;
|
9
|
-
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
11
|
-
|
12
|
-
var _colorManipulator = require("@material-ui/core/styles/colorManipulator");
|
13
|
-
|
14
|
-
var _default = function _default(theme) {
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import { fade } from '@material-ui/core/styles/colorManipulator';
|
3
|
+
export default (function (theme) {
|
15
4
|
return {
|
16
5
|
root: {
|
17
6
|
position: 'relative',
|
@@ -20,7 +9,7 @@ var _default = function _default(theme) {
|
|
20
9
|
minWidth: 252,
|
21
10
|
maxWidth: 500
|
22
11
|
},
|
23
|
-
rootMobile: (
|
12
|
+
rootMobile: _objectSpread({}, theme.typography.b1, {
|
24
13
|
backgroundColor: theme.palette.background2,
|
25
14
|
borderBottom: '1px solid #E0E0E0',
|
26
15
|
borderLeft: 'none',
|
@@ -125,7 +114,7 @@ var _default = function _default(theme) {
|
|
125
114
|
height: 40
|
126
115
|
},
|
127
116
|
// Cell displaying the weekday name
|
128
|
-
weekday: (
|
117
|
+
weekday: _objectSpread({
|
129
118
|
display: 'table-cell'
|
130
119
|
}, theme.typography.body2, {
|
131
120
|
color: theme.palette.neutral.main,
|
@@ -154,7 +143,7 @@ var _default = function _default(theme) {
|
|
154
143
|
borderRight: '1px solid #eaecec'
|
155
144
|
},
|
156
145
|
// The single day cell
|
157
|
-
day: (
|
146
|
+
day: _objectSpread({
|
158
147
|
display: 'table-cell',
|
159
148
|
padding: '4px 8px',
|
160
149
|
textAlign: 'center',
|
@@ -174,7 +163,7 @@ var _default = function _default(theme) {
|
|
174
163
|
width: '100%'
|
175
164
|
},
|
176
165
|
// The today button (only with todayButton prop)
|
177
|
-
todayButton: (
|
166
|
+
todayButton: _objectSpread({
|
178
167
|
display: 'table',
|
179
168
|
minWidth: 230,
|
180
169
|
margin: '0 auto',
|
@@ -189,7 +178,7 @@ var _default = function _default(theme) {
|
|
189
178
|
fontWeight: theme.typography.fontWeightMedium,
|
190
179
|
textTransform: 'uppercase',
|
191
180
|
'&:hover': {
|
192
|
-
backgroundColor:
|
181
|
+
backgroundColor: fade(theme.palette.neutral.dark, theme.palette.action.hoverOpacity),
|
193
182
|
// Reset on touch devices, it doesn't add specificity
|
194
183
|
'@media (hover: none)': {
|
195
184
|
backgroundColor: 'transparent'
|
@@ -261,6 +250,4 @@ var _default = function _default(theme) {
|
|
261
250
|
}
|
262
251
|
}
|
263
252
|
};
|
264
|
-
};
|
265
|
-
|
266
|
-
exports.default = _default;
|
253
|
+
});
|
@@ -1,37 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
var
|
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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
23
|
-
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
25
|
-
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
27
|
-
|
28
|
-
var _styles = require("@material-ui/core/styles");
|
29
|
-
|
30
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
31
|
-
|
32
|
-
var _HiIconButton = _interopRequireDefault(require("../HiIconButton"));
|
33
|
-
|
34
|
-
var styles = function styles() {
|
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 _inherits from "@babel/runtime/helpers/esm/inherits";
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
8
|
+
import React from 'react';
|
9
|
+
import { withStyles } from '@material-ui/core/styles';
|
10
|
+
import HiIcon from '../HiIcon';
|
11
|
+
import HiIconButton from '../HiIconButton';
|
12
|
+
export var styles = function styles() {
|
35
13
|
return {
|
36
14
|
dot: {
|
37
15
|
padding: 4,
|
@@ -42,27 +20,18 @@ var styles = function styles() {
|
|
42
20
|
};
|
43
21
|
};
|
44
22
|
|
45
|
-
exports.styles = styles;
|
46
|
-
|
47
|
-
var _ref = _react.default.createElement(_HiIcon.default, {
|
48
|
-
size: 24
|
49
|
-
}, "radio_button_checked");
|
50
|
-
|
51
|
-
var _ref2 = _react.default.createElement(_HiIcon.default, {
|
52
|
-
size: 12
|
53
|
-
}, "lens");
|
54
|
-
|
55
23
|
var HiDot =
|
56
24
|
/*#__PURE__*/
|
57
25
|
function (_React$PureComponent) {
|
58
|
-
(
|
26
|
+
_inherits(HiDot, _React$PureComponent);
|
59
27
|
|
60
28
|
function HiDot() {
|
61
|
-
(
|
62
|
-
|
29
|
+
_classCallCheck(this, HiDot);
|
30
|
+
|
31
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(HiDot).apply(this, arguments));
|
63
32
|
}
|
64
33
|
|
65
|
-
(
|
34
|
+
_createClass(HiDot, [{
|
66
35
|
key: "render",
|
67
36
|
value: function render() {
|
68
37
|
var _this$props = this.props,
|
@@ -70,7 +39,8 @@ function (_React$PureComponent) {
|
|
70
39
|
status = _this$props.status,
|
71
40
|
classes = _this$props.classes,
|
72
41
|
onClick = _this$props.onClick,
|
73
|
-
props = (
|
42
|
+
props = _objectWithoutProperties(_this$props, ["active", "status", "classes", "onClick"]);
|
43
|
+
|
74
44
|
var dotColor;
|
75
45
|
|
76
46
|
if (!status || status === 'unreviewed') {
|
@@ -79,24 +49,27 @@ function (_React$PureComponent) {
|
|
79
49
|
dotColor = status === 'refused' ? 'negative' : 'positive';
|
80
50
|
}
|
81
51
|
|
82
|
-
return
|
52
|
+
return React.createElement(HiIconButton, Object.assign({
|
83
53
|
className: classes.dot,
|
84
54
|
color: dotColor,
|
85
55
|
onClick: onClick
|
86
|
-
}, props), active ?
|
56
|
+
}, props), active ? React.createElement(HiIcon, {
|
57
|
+
size: 24
|
58
|
+
}, "radio_button_checked") : React.createElement(HiIcon, {
|
59
|
+
size: 12
|
60
|
+
}, "lens"));
|
87
61
|
}
|
88
62
|
}]);
|
63
|
+
|
89
64
|
return HiDot;
|
90
|
-
}(
|
65
|
+
}(React.PureComponent);
|
91
66
|
|
92
|
-
(
|
67
|
+
_defineProperty(HiDot, "defaultProps", {
|
93
68
|
active: false,
|
94
69
|
status: 'unreviewed'
|
95
70
|
});
|
96
71
|
|
97
|
-
|
72
|
+
export default withStyles(styles, {
|
98
73
|
hiComponent: true,
|
99
74
|
name: 'HmuiHiDot'
|
100
|
-
})(HiDot);
|
101
|
-
|
102
|
-
exports.default = _default;
|
75
|
+
})(HiDot);
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { assert } from 'chai';
|
3
|
+
import { createShallow } from '../test-utils';
|
4
|
+
import HiDot from './HiDot';
|
5
|
+
import HiIcon from '../HiIcon';
|
6
|
+
describe('<HiDot />', function () {
|
7
|
+
var shallow;
|
8
|
+
before(function () {
|
9
|
+
shallow = createShallow();
|
10
|
+
});
|
11
|
+
describe('<HiDot />', function () {
|
12
|
+
it('should have its props correctly received', function () {
|
13
|
+
var wrapper = shallow(React.createElement(HiDot, {
|
14
|
+
active: true
|
15
|
+
}));
|
16
|
+
assert.strictEqual(wrapper.prop('active'), true);
|
17
|
+
});
|
18
|
+
it('should have good color applied : validated status', function () {
|
19
|
+
var wrapper = shallow(React.createElement(HiDot, {
|
20
|
+
status: "validated"
|
21
|
+
}));
|
22
|
+
assert.strictEqual(wrapper.dive().dive().props().color, 'positive');
|
23
|
+
});
|
24
|
+
it('should have good color applied : refused status', function () {
|
25
|
+
var wrapper = shallow(React.createElement(HiDot, {
|
26
|
+
status: "refused"
|
27
|
+
}));
|
28
|
+
assert.strictEqual(wrapper.dive().dive().props().color, 'negative');
|
29
|
+
});
|
30
|
+
it('should have good color applied : no status', function () {
|
31
|
+
var wrapper = shallow(React.createElement(HiDot, null));
|
32
|
+
assert.strictEqual(wrapper.dive().dive().props().color, 'default');
|
33
|
+
});
|
34
|
+
it('should have good size applied : active dot', function () {
|
35
|
+
var wrapper = shallow(React.createElement(HiDot, {
|
36
|
+
active: true
|
37
|
+
}));
|
38
|
+
assert.strictEqual(wrapper.dive().find(HiIcon).props().size, 24);
|
39
|
+
});
|
40
|
+
it('should have good size applied : default dot', function () {
|
41
|
+
var wrapper = shallow(React.createElement(HiDot, null));
|
42
|
+
assert.strictEqual(wrapper.dive().find(HiIcon).props().size, 12);
|
43
|
+
});
|
44
|
+
it('should have good icon applied : active dot', function () {
|
45
|
+
var wrapper = shallow(React.createElement(HiDot, {
|
46
|
+
active: true
|
47
|
+
}));
|
48
|
+
assert.strictEqual(wrapper.dive().find(HiIcon).props().children, 'radio_button_checked');
|
49
|
+
});
|
50
|
+
it('should have good icon applied : default dot', function () {
|
51
|
+
var wrapper = shallow(React.createElement(HiDot, null));
|
52
|
+
assert.strictEqual(wrapper.dive().find(HiIcon).props().children, 'lens');
|
53
|
+
});
|
54
|
+
});
|
55
|
+
});
|
@@ -1,33 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
13
|
-
|
14
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
15
|
-
|
16
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
17
|
-
|
18
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
19
|
-
|
20
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
21
|
-
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
23
|
-
|
24
|
-
var _react = _interopRequireDefault(require("react"));
|
25
|
-
|
26
|
-
var _styles = require("@material-ui/core/styles");
|
27
|
-
|
28
|
-
var _HiDot = _interopRequireDefault(require("./HiDot"));
|
29
|
-
|
30
|
-
var styles = function styles() {
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
5
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
8
|
+
import React from 'react';
|
9
|
+
import { withStyles } from '@material-ui/core/styles';
|
10
|
+
import HiDot from './HiDot';
|
11
|
+
export var styles = function styles() {
|
31
12
|
return {
|
32
13
|
dotStepper: {
|
33
14
|
width: '100%',
|
@@ -41,24 +22,25 @@ var styles = function styles() {
|
|
41
22
|
};
|
42
23
|
};
|
43
24
|
|
44
|
-
exports.styles = styles;
|
45
|
-
|
46
25
|
var HiDotsStepper =
|
47
26
|
/*#__PURE__*/
|
48
27
|
function (_React$PureComponent) {
|
49
|
-
(
|
28
|
+
_inherits(HiDotsStepper, _React$PureComponent);
|
50
29
|
|
51
30
|
function HiDotsStepper(props) {
|
52
31
|
var _this;
|
53
32
|
|
54
|
-
(
|
55
|
-
|
56
|
-
(
|
33
|
+
_classCallCheck(this, HiDotsStepper);
|
34
|
+
|
35
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiDotsStepper).call(this, props));
|
36
|
+
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (activeStep) {
|
57
38
|
return function () {
|
58
39
|
_this.props.onChange(activeStep);
|
59
40
|
};
|
60
41
|
});
|
61
|
-
|
42
|
+
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "handleNavigation", function (e) {
|
62
44
|
var _this$props = _this.props,
|
63
45
|
activeStep = _this$props.activeStep,
|
64
46
|
steps = _this$props.steps;
|
@@ -71,12 +53,13 @@ function (_React$PureComponent) {
|
|
71
53
|
|
72
54
|
_this.props.onChange(nextStep);
|
73
55
|
});
|
74
|
-
|
75
|
-
_this.
|
56
|
+
|
57
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
58
|
+
_this.handleNavigation = _this.handleNavigation.bind(_assertThisInitialized(_this));
|
76
59
|
return _this;
|
77
60
|
}
|
78
61
|
|
79
|
-
(
|
62
|
+
_createClass(HiDotsStepper, [{
|
80
63
|
key: "render",
|
81
64
|
value: function render() {
|
82
65
|
var _this2 = this;
|
@@ -85,12 +68,12 @@ function (_React$PureComponent) {
|
|
85
68
|
classes = _this$props2.classes,
|
86
69
|
activeStep = _this$props2.activeStep,
|
87
70
|
steps = _this$props2.steps;
|
88
|
-
return
|
71
|
+
return React.createElement("div", {
|
89
72
|
role: "presentation",
|
90
73
|
className: classes.dotStepper,
|
91
74
|
onKeyDown: this.handleNavigation
|
92
75
|
}, steps.map(function (step, idx) {
|
93
|
-
return
|
76
|
+
return React.createElement(HiDot, {
|
94
77
|
key: step.id,
|
95
78
|
tabIndex: step.id,
|
96
79
|
status: step.status,
|
@@ -100,12 +83,11 @@ function (_React$PureComponent) {
|
|
100
83
|
}));
|
101
84
|
}
|
102
85
|
}]);
|
86
|
+
|
103
87
|
return HiDotsStepper;
|
104
|
-
}(
|
88
|
+
}(React.PureComponent);
|
105
89
|
|
106
|
-
|
90
|
+
export default withStyles(styles, {
|
107
91
|
hiComponent: true,
|
108
92
|
name: 'HmuiHiDotsStepper'
|
109
|
-
})(HiDotsStepper);
|
110
|
-
|
111
|
-
exports.default = _default;
|
93
|
+
})(HiDotsStepper);
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { assert } from 'chai';
|
3
|
+
import { spy } from 'sinon';
|
4
|
+
import { createShallow, createMount } from '../test-utils';
|
5
|
+
import HiDotsStepper from './HiDotsStepper';
|
6
|
+
import HiDot from './HiDot';
|
7
|
+
describe('<HiDotsStepper />', function () {
|
8
|
+
var shallow;
|
9
|
+
var mount;
|
10
|
+
var wrapper;
|
11
|
+
var props = {
|
12
|
+
steps: [{
|
13
|
+
id: 0,
|
14
|
+
status: 'validated'
|
15
|
+
}, {
|
16
|
+
id: 1,
|
17
|
+
status: 'unreviewed'
|
18
|
+
}, {
|
19
|
+
id: 2,
|
20
|
+
status: 'refused'
|
21
|
+
}],
|
22
|
+
activeStep: 0
|
23
|
+
};
|
24
|
+
before(function () {
|
25
|
+
shallow = createShallow();
|
26
|
+
});
|
27
|
+
beforeEach(function () {
|
28
|
+
mount = createMount();
|
29
|
+
});
|
30
|
+
afterEach(function () {
|
31
|
+
mount.cleanUp();
|
32
|
+
});
|
33
|
+
describe('Working onClick & onNavigation callbacks', function () {
|
34
|
+
it('should test onClick callbacks', function () {
|
35
|
+
var handleChange = spy();
|
36
|
+
wrapper = shallow(React.createElement(HiDotsStepper, Object.assign({}, props, {
|
37
|
+
onChange: handleChange
|
38
|
+
})));
|
39
|
+
wrapper.dive().find(HiDot).at(1).props().onClick();
|
40
|
+
assert.strictEqual(handleChange.calledOnce, true);
|
41
|
+
assert.strictEqual(handleChange.calledWith(1), true);
|
42
|
+
});
|
43
|
+
it('should test onNavigation callbacks', function () {
|
44
|
+
var handleChange = spy();
|
45
|
+
wrapper = mount(React.createElement(HiDotsStepper, Object.assign({}, props, {
|
46
|
+
onChange: handleChange
|
47
|
+
})));
|
48
|
+
wrapper.find('button').at(0).simulate('focus'); // Active step = 0
|
49
|
+
// -> = 1
|
50
|
+
|
51
|
+
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
52
|
+
key: 'ArrowRight'
|
53
|
+
});
|
54
|
+
assert.strictEqual(handleChange.calledOnce, true);
|
55
|
+
assert.strictEqual(handleChange.calledWith(1), true); // <- = 2
|
56
|
+
|
57
|
+
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
58
|
+
key: 'ArrowLeft'
|
59
|
+
});
|
60
|
+
assert.strictEqual(handleChange.calledTwice, true);
|
61
|
+
assert.strictEqual(handleChange.calledWith(2), true); // Active step = 2
|
62
|
+
|
63
|
+
wrapper.setProps({
|
64
|
+
activeStep: 2
|
65
|
+
});
|
66
|
+
wrapper.update();
|
67
|
+
wrapper.find('button').at(2).simulate('focus'); // -> = 1
|
68
|
+
|
69
|
+
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
70
|
+
key: 'ArrowRight'
|
71
|
+
});
|
72
|
+
assert.strictEqual(handleChange.calledThrice, true);
|
73
|
+
assert.strictEqual(handleChange.calledWith(1), true); // <- = 1
|
74
|
+
|
75
|
+
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
76
|
+
key: 'ArrowLeft'
|
77
|
+
});
|
78
|
+
assert.strictEqual(handleChange.callCount, 4);
|
79
|
+
assert.strictEqual(handleChange.calledWith(1), true);
|
80
|
+
});
|
81
|
+
});
|
82
|
+
describe('mount', function () {
|
83
|
+
describe('callbacks', function () {
|
84
|
+
it('should instanciate correctly', function () {
|
85
|
+
wrapper = mount(React.createElement(HiDotsStepper, props));
|
86
|
+
assert.instanceOf(wrapper.instance(), HiDotsStepper);
|
87
|
+
});
|
88
|
+
});
|
89
|
+
});
|
90
|
+
});
|
@@ -1,23 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "HiDot", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function get() {
|
11
|
-
return _HiDot.default;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
Object.defineProperty(exports, "HiDotsStepper", {
|
15
|
-
enumerable: true,
|
16
|
-
get: function get() {
|
17
|
-
return _HiDotsStepper.default;
|
18
|
-
}
|
19
|
-
});
|
20
|
-
|
21
|
-
var _HiDot = _interopRequireDefault(require("./HiDot"));
|
22
|
-
|
23
|
-
var _HiDotsStepper = _interopRequireDefault(require("./HiDotsStepper"));
|
1
|
+
export { default as HiDot } from './HiDot';
|
2
|
+
export { default as HiDotsStepper } from './HiDotsStepper';
|