@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,51 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
19
|
-
|
20
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
21
|
-
|
22
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/possibleConstructorReturn"));
|
23
|
-
|
24
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
25
|
-
|
26
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
27
|
-
|
28
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
29
|
-
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
31
|
-
|
32
|
-
var _react = _interopRequireDefault(require("react"));
|
33
|
-
|
34
|
-
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
35
|
-
|
36
|
-
var _reactDom = require("react-dom");
|
37
|
-
|
38
|
-
var _styles = require("@material-ui/core/styles");
|
39
|
-
|
40
|
-
var _HiSelectField = _interopRequireDefault(require("../HiSelect/HiSelectField"));
|
41
|
-
|
42
|
-
var _HiDateRangePicker = _interopRequireDefault(require("./HiDateRangePicker"));
|
43
|
-
|
44
|
-
var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
|
45
|
-
|
46
|
-
var _reactDeviceDetect = require("react-device-detect");
|
47
|
-
|
48
|
-
function findSeparator(format) {
|
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";
|
9
|
+
import React from 'react';
|
10
|
+
import moment from 'moment-timezone';
|
11
|
+
import { findDOMNode } from 'react-dom';
|
12
|
+
import { withStyles } from '@material-ui/core/styles';
|
13
|
+
import HiSelectField from '../HiSelect/HiSelectField';
|
14
|
+
import HiDateRangePicker from './HiDateRangePicker';
|
15
|
+
import HiFormControl from '../HiForm/HiFormControl';
|
16
|
+
import { isMobile } from 'react-device-detect';
|
17
|
+
export function findSeparator(format) {
|
49
18
|
var str = '';
|
50
19
|
|
51
20
|
if (format.search('[/]') >= 0) {
|
@@ -58,8 +27,7 @@ function findSeparator(format) {
|
|
58
27
|
|
59
28
|
return str;
|
60
29
|
}
|
61
|
-
|
62
|
-
function yearAndMonth(format, date) {
|
30
|
+
export function yearAndMonth(format, date) {
|
63
31
|
var findY = function findY(el) {
|
64
32
|
return el.toUpperCase().search('Y') >= 0;
|
65
33
|
};
|
@@ -74,8 +42,7 @@ function yearAndMonth(format, date) {
|
|
74
42
|
var indexM = split.findIndex(findM);
|
75
43
|
return indexY < indexM ? date.format(split[indexY] + s + split[indexM]) : date.format(split[indexM] + s + split[indexY]);
|
76
44
|
}
|
77
|
-
|
78
|
-
function yearAndQuarter(format, date, t) {
|
45
|
+
export function yearAndQuarter(format, date, t) {
|
79
46
|
var findY = function findY(el) {
|
80
47
|
return el.toUpperCase().search('Y') >= 0;
|
81
48
|
};
|
@@ -90,15 +57,13 @@ function yearAndQuarter(format, date, t) {
|
|
90
57
|
var indexM = split.findIndex(findM);
|
91
58
|
return indexY < indexM ? date.format("".concat(split[indexY]).concat(s, "[").concat(t.short_quarter, "]Q")) : date.format("[".concat(t.short_quarter, "]Q").concat(s).concat(split[indexY]));
|
92
59
|
}
|
93
|
-
|
94
|
-
function buildDateRangeOptionByKey(key, t, format, timezoneName) {
|
60
|
+
export function buildDateRangeOptionByKey(key, t, format, timezoneName) {
|
95
61
|
var from;
|
96
62
|
var label;
|
97
63
|
var info;
|
98
64
|
var to;
|
99
65
|
var type;
|
100
|
-
|
101
|
-
_momentTimezone.default.updateLocale('en', {
|
66
|
+
moment.updateLocale('en', {
|
102
67
|
week: {
|
103
68
|
dow: 1
|
104
69
|
}
|
@@ -107,71 +72,71 @@ function buildDateRangeOptionByKey(key, t, format, timezoneName) {
|
|
107
72
|
switch (key) {
|
108
73
|
case 'custom':
|
109
74
|
label = t.custom_period;
|
110
|
-
from = (
|
111
|
-
to = (
|
75
|
+
from = moment().tz(timezoneName).subtract(15, 'day').startOf('day');
|
76
|
+
to = moment().tz(timezoneName).endOf('day');
|
112
77
|
type = 'primary-highlight';
|
113
78
|
break;
|
114
79
|
|
115
80
|
case 'cd':
|
116
81
|
label = t.today;
|
117
|
-
from = (
|
118
|
-
to = (
|
82
|
+
from = moment().tz(timezoneName).startOf('day');
|
83
|
+
to = moment().tz(timezoneName).endOf('day');
|
119
84
|
info = "".concat(from.format(format));
|
120
85
|
break;
|
121
86
|
|
122
87
|
case 'pd':
|
123
88
|
label = t.yesterday;
|
124
|
-
from = (
|
125
|
-
to = (
|
89
|
+
from = moment().tz(timezoneName).subtract(1, 'day').startOf('day');
|
90
|
+
to = moment().tz(timezoneName).subtract(1, 'day').endOf('day');
|
126
91
|
info = "".concat(from.format(format));
|
127
92
|
break;
|
128
93
|
|
129
94
|
case 'cw':
|
130
95
|
label = t.current_week;
|
131
|
-
from = (
|
132
|
-
to = (
|
96
|
+
from = moment().tz(timezoneName).startOf('week');
|
97
|
+
to = moment().tz(timezoneName);
|
133
98
|
info = "".concat(t.short_week).concat(from.format('w'), ", \n ").concat(from.format(format), " ").concat(t.to_now);
|
134
99
|
break;
|
135
100
|
|
136
101
|
case 'pw':
|
137
102
|
label = t.previous_week;
|
138
|
-
from = (
|
139
|
-
to = (
|
103
|
+
from = moment().tz(timezoneName).subtract(1, 'week').startOf('week');
|
104
|
+
to = moment().tz(timezoneName).subtract(1, 'week').endOf('week');
|
140
105
|
info = "".concat(t.short_week).concat(from.format('w'), ", ").concat(from.format(format), " ").concat(t.to, " ").concat(to.format(format));
|
141
106
|
break;
|
142
107
|
|
143
108
|
case 'cm':
|
144
109
|
label = t.current_month;
|
145
|
-
from = (
|
146
|
-
to = (
|
110
|
+
from = moment().tz(timezoneName).startOf('month');
|
111
|
+
to = moment().tz(timezoneName);
|
147
112
|
info = "".concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
|
148
113
|
break;
|
149
114
|
|
150
115
|
case 'pm':
|
151
116
|
label = t.previous_month;
|
152
|
-
from = (
|
153
|
-
to = (
|
117
|
+
from = moment().tz(timezoneName).subtract(1, 'month').startOf('month');
|
118
|
+
to = moment().tz(timezoneName).subtract(1, 'month').endOf('month');
|
154
119
|
info = "".concat(yearAndMonth(format, from), ", ").concat(from.daysInMonth(), " ").concat(t.days);
|
155
120
|
break;
|
156
121
|
|
157
122
|
case 'cq':
|
158
123
|
label = t.current_quarter;
|
159
|
-
from = (
|
160
|
-
to = (
|
124
|
+
from = moment().tz(timezoneName).startOf('quarter');
|
125
|
+
to = moment().tz(timezoneName);
|
161
126
|
info = "".concat(yearAndQuarter(format, from, t), ", ").concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
|
162
127
|
break;
|
163
128
|
|
164
129
|
case 'pq':
|
165
130
|
label = t.previous_quarter;
|
166
|
-
from = (
|
167
|
-
to = (
|
131
|
+
from = moment().tz(timezoneName).subtract(1, 'quarter').startOf('quarter');
|
132
|
+
to = moment().tz(timezoneName).subtract(1, 'quarter').endOf('quarter');
|
168
133
|
info = "".concat(yearAndQuarter(format, from, t), ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
|
169
134
|
break;
|
170
135
|
|
171
136
|
case 'cy':
|
172
137
|
label = t.current_year;
|
173
|
-
from = (
|
174
|
-
to = (
|
138
|
+
from = moment().tz(timezoneName).startOf('year');
|
139
|
+
to = moment().tz(timezoneName);
|
175
140
|
info = "".concat(from.format(format), " ").concat(t.to_now, ", ").concat(to.diff(from, 'days') + 1, " ").concat(t.days);
|
176
141
|
break;
|
177
142
|
|
@@ -188,8 +153,7 @@ function buildDateRangeOptionByKey(key, t, format, timezoneName) {
|
|
188
153
|
type: type
|
189
154
|
};
|
190
155
|
}
|
191
|
-
|
192
|
-
var styles = function styles() {
|
156
|
+
export var styles = function styles() {
|
193
157
|
return {
|
194
158
|
root: {
|
195
159
|
maxWidth: 500,
|
@@ -231,40 +195,44 @@ var styles = function styles() {
|
|
231
195
|
};
|
232
196
|
};
|
233
197
|
|
234
|
-
exports.styles = styles;
|
235
|
-
|
236
198
|
var HiDateRangeSelector =
|
237
199
|
/*#__PURE__*/
|
238
200
|
function (_React$Component) {
|
239
|
-
(
|
201
|
+
_inherits(HiDateRangeSelector, _React$Component);
|
240
202
|
|
241
203
|
function HiDateRangeSelector(props) {
|
242
204
|
var _this;
|
243
205
|
|
244
|
-
(
|
245
|
-
|
246
|
-
(
|
247
|
-
|
206
|
+
_classCallCheck(this, HiDateRangeSelector);
|
207
|
+
|
208
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiDateRangeSelector).call(this));
|
209
|
+
|
210
|
+
_defineProperty(_assertThisInitialized(_this), "options", []);
|
211
|
+
|
212
|
+
_defineProperty(_assertThisInitialized(_this), "handleBlur", function (event) {
|
248
213
|
if (event instanceof Object && _this.props.onblur) {
|
249
214
|
_this.props.onBlur(event);
|
250
215
|
}
|
251
216
|
});
|
252
|
-
|
217
|
+
|
218
|
+
_defineProperty(_assertThisInitialized(_this), "handleReset", function (name) {
|
253
219
|
_this.props.onChange(name, undefined);
|
254
220
|
|
255
221
|
_this.props.onChange("".concat(name, "Error"), undefined);
|
256
222
|
});
|
257
|
-
|
223
|
+
|
224
|
+
_defineProperty(_assertThisInitialized(_this), "handleSelectChange", function (name) {
|
258
225
|
return function (event, value) {
|
259
226
|
_this.setState(function (prevState) {
|
260
227
|
var _ref;
|
261
228
|
|
262
|
-
return _ref = {}, (
|
229
|
+
return _ref = {}, _defineProperty(_ref, name, value), _defineProperty(_ref, "key", prevState.key === 1 ? 2 : 1), _ref;
|
263
230
|
});
|
264
231
|
|
265
232
|
_this.updateDates(value);
|
266
233
|
};
|
267
234
|
});
|
235
|
+
|
268
236
|
_this.options = props.availableOptionKeys.map(function (key) {
|
269
237
|
return buildDateRangeOptionByKey(key, props.translations, props.format, props.timezoneName);
|
270
238
|
});
|
@@ -275,12 +243,12 @@ function (_React$Component) {
|
|
275
243
|
return _this;
|
276
244
|
}
|
277
245
|
|
278
|
-
(
|
246
|
+
_createClass(HiDateRangeSelector, [{
|
279
247
|
key: "componentDidMount",
|
280
248
|
value: function componentDidMount() {
|
281
249
|
if (this.container) {
|
282
250
|
this.setState({
|
283
|
-
containerWidth:
|
251
|
+
containerWidth: findDOMNode(this.container).clientWidth - 5
|
284
252
|
});
|
285
253
|
}
|
286
254
|
}
|
@@ -344,14 +312,15 @@ function (_React$Component) {
|
|
344
312
|
classes = _this$props.classes,
|
345
313
|
selectProps = _this$props.selectProps,
|
346
314
|
staticPosition = _this$props.staticPosition,
|
347
|
-
props = (
|
315
|
+
props = _objectWithoutProperties(_this$props, ["disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
|
316
|
+
|
348
317
|
var _this$state = this.state,
|
349
318
|
selectedPreset = _this$state.selectedPreset,
|
350
319
|
containerWidth = _this$state.containerWidth;
|
351
320
|
var hiSelectableListProps = {
|
352
321
|
hideCheckbox: true
|
353
322
|
};
|
354
|
-
return
|
323
|
+
return React.createElement(HiFormControl, {
|
355
324
|
disabled: disabled,
|
356
325
|
helperIcon: helperIcon,
|
357
326
|
helperText: helperText,
|
@@ -361,7 +330,7 @@ function (_React$Component) {
|
|
361
330
|
InputLabelProps: {
|
362
331
|
className: classes.formControlLabel
|
363
332
|
}
|
364
|
-
},
|
333
|
+
}, React.createElement("div", {
|
365
334
|
className: classes.root,
|
366
335
|
style: containerWidth < 364 ? {
|
367
336
|
flexDirection: 'column'
|
@@ -369,14 +338,14 @@ function (_React$Component) {
|
|
369
338
|
ref: function ref(container) {
|
370
339
|
_this3.container = container;
|
371
340
|
}
|
372
|
-
},
|
341
|
+
}, React.createElement("div", {
|
373
342
|
className: classes.select,
|
374
343
|
style: containerWidth < 364 ? {
|
375
344
|
minWidth: '100%',
|
376
345
|
paddingBottom: 8,
|
377
346
|
paddingRight: 0
|
378
347
|
} : {}
|
379
|
-
},
|
348
|
+
}, React.createElement(HiSelectField, Object.assign({
|
380
349
|
disabled: disabled,
|
381
350
|
id: idSelect,
|
382
351
|
label: label,
|
@@ -391,12 +360,12 @@ function (_React$Component) {
|
|
391
360
|
containerWidth: this.state.containerWidth,
|
392
361
|
staticPosition: staticPosition,
|
393
362
|
onSubmit: this.props.onSubmit
|
394
|
-
}, selectProps))), (
|
363
|
+
}, selectProps))), (isMobile && selectedPreset === 'custom' || !isMobile) && React.createElement("div", {
|
395
364
|
className: classes.input,
|
396
365
|
style: containerWidth < 364 ? {
|
397
366
|
width: '100%'
|
398
367
|
} : {}
|
399
|
-
},
|
368
|
+
}, React.createElement(HiDateRangePicker, Object.assign({
|
400
369
|
key: this.state.key,
|
401
370
|
classes: {
|
402
371
|
root: classes.dateRangePicker
|
@@ -430,10 +399,11 @@ function (_React$Component) {
|
|
430
399
|
return null;
|
431
400
|
}
|
432
401
|
}]);
|
402
|
+
|
433
403
|
return HiDateRangeSelector;
|
434
|
-
}(
|
404
|
+
}(React.Component);
|
435
405
|
|
436
|
-
(
|
406
|
+
_defineProperty(HiDateRangeSelector, "defaultProps", {
|
437
407
|
availableOptionKeys: ['cd', 'pd', 'cw', 'pw', 'cm', 'pm', 'cq', 'pq', 'cy', 'custom'],
|
438
408
|
enableTime: false,
|
439
409
|
returnSelectValue: false,
|
@@ -476,8 +446,6 @@ function (_React$Component) {
|
|
476
446
|
}
|
477
447
|
});
|
478
448
|
|
479
|
-
|
449
|
+
export default withStyles(styles, {
|
480
450
|
name: 'HmuiHiDateRangeSelector'
|
481
|
-
})(HiDateRangeSelector);
|
482
|
-
|
483
|
-
exports.default = _default;
|
451
|
+
})(HiDateRangeSelector);
|
@@ -0,0 +1,193 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import React from 'react';
|
3
|
+
import { assert } from 'chai';
|
4
|
+
import moment from 'moment';
|
5
|
+
import { spy, useFakeTimers } from 'sinon';
|
6
|
+
import { createMount, createShallow } from '../test-utils';
|
7
|
+
import HiDateRangeSelector from './HiDateRangeSelector';
|
8
|
+
import { HiSelectField } from '../HiSelect';
|
9
|
+
import HiDateRangePicker from './HiDateRangePicker';
|
10
|
+
import { HiInput } from '../HiForm';
|
11
|
+
describe('<HiDateRangeSelector />', function () {
|
12
|
+
var shallow;
|
13
|
+
var mount;
|
14
|
+
before(function () {
|
15
|
+
shallow = createShallow({
|
16
|
+
dive: true
|
17
|
+
});
|
18
|
+
mount = createMount();
|
19
|
+
});
|
20
|
+
after(function () {
|
21
|
+
mount.cleanUp();
|
22
|
+
}); //
|
23
|
+
// describe('shallow', () => {
|
24
|
+
// it('renders a div containing 1 HiSelectField & 1 DateRangePicker', () => {
|
25
|
+
// const wrapper = shallow(
|
26
|
+
// <HiDateRangeSelector
|
27
|
+
// idSelect="idSelect"
|
28
|
+
// idRange="idRange"
|
29
|
+
// onChange={() => {}}
|
30
|
+
// />,
|
31
|
+
// );
|
32
|
+
//
|
33
|
+
// assert.strictEqual(
|
34
|
+
// wrapper.find(HiSelectField).length,
|
35
|
+
// 1,
|
36
|
+
// 'should render a HiSelectField',
|
37
|
+
// );
|
38
|
+
// assert.strictEqual(
|
39
|
+
// wrapper.find(HiDateRangePicker).length,
|
40
|
+
// 1,
|
41
|
+
// 'should render a DateRangePicker',
|
42
|
+
// );
|
43
|
+
// });
|
44
|
+
//
|
45
|
+
// it('should handle 2 input day picker interface', () => {
|
46
|
+
// const from = new Date(2018, 1, 17);
|
47
|
+
// const to = new Date(2019, 2, 18);
|
48
|
+
// const handleChange = spy();
|
49
|
+
//
|
50
|
+
// moment.updateLocale('en', { week: { dow: 1 } });
|
51
|
+
//
|
52
|
+
// const wrapper = shallow(
|
53
|
+
// <HiDateRangeSelector
|
54
|
+
// idSelect="idSelect"
|
55
|
+
// idRange="idRange"
|
56
|
+
// from={from}
|
57
|
+
// to={to}
|
58
|
+
// labelFrom={'Start'}
|
59
|
+
// labelTo={'End'}
|
60
|
+
// onChange={handleChange}
|
61
|
+
// />,
|
62
|
+
// );
|
63
|
+
//
|
64
|
+
// wrapper
|
65
|
+
// .find(HiSelectField)
|
66
|
+
// .dive()
|
67
|
+
// .childAt(0)
|
68
|
+
// .props()
|
69
|
+
// .onChange('selectedPreset', 'pm');
|
70
|
+
//
|
71
|
+
// // OnChange is call twice because it set from and to date
|
72
|
+
// assert.strictEqual(
|
73
|
+
// handleChange.calledTwice,
|
74
|
+
// true,
|
75
|
+
// 'should call onChange callback twice',
|
76
|
+
// );
|
77
|
+
// assert.strictEqual(
|
78
|
+
// handleChange.calledWith(
|
79
|
+
// 'from',
|
80
|
+
// moment()
|
81
|
+
// .subtract(1, 'month')
|
82
|
+
// .startOf('month')
|
83
|
+
// .toDate(),
|
84
|
+
// ),
|
85
|
+
// true,
|
86
|
+
// 'should call onChange callback once',
|
87
|
+
// );
|
88
|
+
// assert.strictEqual(
|
89
|
+
// handleChange.calledWith(
|
90
|
+
// 'to',
|
91
|
+
// moment()
|
92
|
+
// .subtract(1, 'month')
|
93
|
+
// .endOf('month')
|
94
|
+
// .toDate(),
|
95
|
+
// ),
|
96
|
+
// true,
|
97
|
+
// 'should call onChange callback once',
|
98
|
+
// );
|
99
|
+
// });
|
100
|
+
//
|
101
|
+
// it('should ignore unknown options', () => {
|
102
|
+
// const handleChange = spy();
|
103
|
+
//
|
104
|
+
// moment.updateLocale('en', { week: { dow: 1 } });
|
105
|
+
//
|
106
|
+
// const wrapper = shallow(
|
107
|
+
// <HiDateRangeSelector
|
108
|
+
// idSelect="idSelect"
|
109
|
+
// idRange="idRange"
|
110
|
+
// labelFrom={'Start'}
|
111
|
+
// labelTo={'End'}
|
112
|
+
// onChange={handleChange}
|
113
|
+
// availableOptionKeys={['unknown']}
|
114
|
+
// />,
|
115
|
+
// );
|
116
|
+
//
|
117
|
+
// wrapper
|
118
|
+
// .find(HiSelectField)
|
119
|
+
// .dive()
|
120
|
+
// .childAt(0)
|
121
|
+
// .props()
|
122
|
+
// .onChange('selectedPreset', 'pm');
|
123
|
+
//
|
124
|
+
// // OnChange is call twice because it set from and to date
|
125
|
+
// assert.strictEqual(handleChange.callCount, 0, 'should not call onChange callback');
|
126
|
+
// });
|
127
|
+
// });
|
128
|
+
//
|
129
|
+
// describe('mount', () => {
|
130
|
+
// let clock;
|
131
|
+
//
|
132
|
+
// before(() => {
|
133
|
+
// clock = useFakeTimers();
|
134
|
+
// });
|
135
|
+
//
|
136
|
+
// after(() => {
|
137
|
+
// clock.restore();
|
138
|
+
// });
|
139
|
+
//
|
140
|
+
// it('should mount', () => {
|
141
|
+
// const handleChange = spy();
|
142
|
+
// const handleReset = spy();
|
143
|
+
// const wrapper = mount(
|
144
|
+
// <HiDateRangeSelector
|
145
|
+
// idSelect="idSelect"
|
146
|
+
// idRange="idRange"
|
147
|
+
// label={'Order date'}
|
148
|
+
// onChange={handleChange}
|
149
|
+
// />,
|
150
|
+
// );
|
151
|
+
//
|
152
|
+
// assert.strictEqual(
|
153
|
+
// wrapper.find(HiSelectField).length,
|
154
|
+
// 1,
|
155
|
+
// 'should render a HiSelectField',
|
156
|
+
// );
|
157
|
+
// assert.strictEqual(
|
158
|
+
// wrapper.find(HiDateRangePicker).length,
|
159
|
+
// 1,
|
160
|
+
// 'should render a DateRangePicker',
|
161
|
+
// );
|
162
|
+
//
|
163
|
+
// wrapper
|
164
|
+
// .find(HiSelectField)
|
165
|
+
// .props()
|
166
|
+
// .onChange('selectedPreset', 'pm');
|
167
|
+
//
|
168
|
+
// // OnChange is call twice because it set from and to date
|
169
|
+
// assert.strictEqual(
|
170
|
+
// handleChange.calledTwice,
|
171
|
+
// true,
|
172
|
+
// 'should call onChange callback twice',
|
173
|
+
// );
|
174
|
+
//
|
175
|
+
// wrapper
|
176
|
+
// .find(HiSelectField)
|
177
|
+
// .props()
|
178
|
+
// .onChange('selectedPreset', 'custom');
|
179
|
+
//
|
180
|
+
// assert.strictEqual(handleChange.calledTwice, true, 'should not call onChange callback');
|
181
|
+
//
|
182
|
+
// wrapper
|
183
|
+
// .find(HiInput)
|
184
|
+
// .at(0)
|
185
|
+
// .props()
|
186
|
+
// .onReset();
|
187
|
+
//
|
188
|
+
// assert.strictEqual(handleReset.callCount, 0);
|
189
|
+
// clock.tick(1);
|
190
|
+
// assert.strictEqual(handleChange.callCount, 3);
|
191
|
+
// });
|
192
|
+
// });
|
193
|
+
});
|