@hipay/hipay-material-ui 2.3.1-rc3 → 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { assert } from 'chai';
|
|
3
|
+
import { createShallow, createMount } from '../test-utils';
|
|
4
|
+
import HiFormLabel from './HiFormLabel';
|
|
5
|
+
describe('<HiFormLabel />', function () {
|
|
6
|
+
var shallow;
|
|
7
|
+
var mount;
|
|
8
|
+
before(function () {
|
|
9
|
+
shallow = createShallow({
|
|
10
|
+
dive: true
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
beforeEach(function () {
|
|
14
|
+
mount = createMount();
|
|
15
|
+
});
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
mount.cleanUp();
|
|
18
|
+
});
|
|
19
|
+
it('should render a label', function () {
|
|
20
|
+
var wrapper = mount(React.createElement(HiFormLabel, {
|
|
21
|
+
label: "Test"
|
|
22
|
+
}));
|
|
23
|
+
assert.strictEqual(wrapper.find(HiFormLabel).length, 1, 'Should render 1 HiFormLabel');
|
|
24
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').length, 1, 'Should render 1 label');
|
|
25
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test', 'Should render label');
|
|
26
|
+
wrapper.setProps({
|
|
27
|
+
required: false
|
|
28
|
+
});
|
|
29
|
+
wrapper.update();
|
|
30
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test optional', 'Should render label optional');
|
|
31
|
+
wrapper.setProps({
|
|
32
|
+
required: false,
|
|
33
|
+
translations: {
|
|
34
|
+
optional: 'Optionnel'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
wrapper.update();
|
|
38
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test Optionnel', 'Should render label optional');
|
|
39
|
+
});
|
|
40
|
+
it('should render a label with children', function () {
|
|
41
|
+
var wrapper = mount(React.createElement(HiFormLabel, {
|
|
42
|
+
label: "Test"
|
|
43
|
+
}, React.createElement("p", null, " my children")));
|
|
44
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test my children', 'Should render label with children');
|
|
45
|
+
wrapper.setProps({
|
|
46
|
+
required: false
|
|
47
|
+
});
|
|
48
|
+
wrapper.update();
|
|
49
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test optional my children', 'Should render label optional');
|
|
50
|
+
wrapper.setProps({
|
|
51
|
+
required: false,
|
|
52
|
+
translations: {
|
|
53
|
+
optional: 'Optionnel'
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
wrapper.update();
|
|
57
|
+
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test Optionnel my children', 'Should render label optional');
|
|
58
|
+
});
|
|
59
|
+
it('should pass className to the HiFormLabel', function () {
|
|
60
|
+
var wrapper = shallow(React.createElement(HiFormLabel, {
|
|
61
|
+
label: "Test",
|
|
62
|
+
className: "foo"
|
|
63
|
+
}));
|
|
64
|
+
assert.strictEqual(wrapper.dive().hasClass('foo'), true);
|
|
65
|
+
});
|
|
66
|
+
});
|
package/es/HiForm/HiInput.js
CHANGED
|
@@ -1,45 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
|
-
var _index = _interopRequireDefault(require("keycode/index"));
|
|
31
|
-
|
|
32
|
-
var _Input = _interopRequireDefault(require("@material-ui/core/Input"));
|
|
33
|
-
|
|
34
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
|
35
|
-
|
|
36
|
-
var _HiIconButton = _interopRequireDefault(require("../HiIconButton"));
|
|
37
|
-
|
|
38
|
-
var _styles = require("@material-ui/core/styles");
|
|
39
|
-
|
|
40
|
-
var styles = function styles(theme) {
|
|
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 _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import keycode from 'keycode/index';
|
|
12
|
+
import Input from '@material-ui/core/Input';
|
|
13
|
+
import HiIcon from '../HiIcon';
|
|
14
|
+
import HiIconButton from '../HiIconButton';
|
|
15
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
16
|
+
export var styles = function styles(theme) {
|
|
41
17
|
return {
|
|
42
|
-
root: (
|
|
18
|
+
root: _objectSpread({
|
|
43
19
|
position: 'relative'
|
|
44
20
|
}, theme.typography.b1, {
|
|
45
21
|
borderBottom: "1px solid ".concat(theme.palette.input.bottomLine),
|
|
@@ -111,13 +87,13 @@ var styles = function styles(theme) {
|
|
|
111
87
|
// Ajout d'1px pour ne pas avoir de décalage en mode error avec le border right
|
|
112
88
|
marginRight: '-1px'
|
|
113
89
|
},
|
|
114
|
-
input: (
|
|
90
|
+
input: _objectSpread({}, theme.typography.b1, {
|
|
115
91
|
fontWeight: theme.typography.fontWeightRegular,
|
|
116
92
|
caretColor: theme.palette.primary.main,
|
|
117
93
|
display: 'flex',
|
|
118
94
|
alignItems: 'center'
|
|
119
95
|
}),
|
|
120
|
-
inputPropsClassName: (
|
|
96
|
+
inputPropsClassName: _objectSpread({}, theme.typography.b1, {
|
|
121
97
|
padding: 0
|
|
122
98
|
}),
|
|
123
99
|
inputText: {
|
|
@@ -151,26 +127,20 @@ var styles = function styles(theme) {
|
|
|
151
127
|
};
|
|
152
128
|
};
|
|
153
129
|
|
|
154
|
-
exports.styles = styles;
|
|
155
|
-
|
|
156
|
-
var _ref = _react.default.createElement(_HiIcon.default, {
|
|
157
|
-
icon: "close",
|
|
158
|
-
size: 20,
|
|
159
|
-
color: "neutral"
|
|
160
|
-
});
|
|
161
|
-
|
|
162
130
|
var HiInput =
|
|
163
131
|
/*#__PURE__*/
|
|
164
132
|
function (_React$PureComponent) {
|
|
165
|
-
(
|
|
133
|
+
_inherits(HiInput, _React$PureComponent);
|
|
166
134
|
|
|
167
135
|
function HiInput() {
|
|
168
136
|
var _this;
|
|
169
137
|
|
|
170
|
-
(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
138
|
+
_classCallCheck(this, HiInput);
|
|
139
|
+
|
|
140
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiInput).call(this));
|
|
141
|
+
|
|
142
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
143
|
+
var key = keycode(event);
|
|
174
144
|
|
|
175
145
|
if (_this.props.onKeyDown) {
|
|
176
146
|
_this.props.onKeyDown(event);
|
|
@@ -180,27 +150,29 @@ function (_React$PureComponent) {
|
|
|
180
150
|
_this.props.onSubmit(event);
|
|
181
151
|
}
|
|
182
152
|
});
|
|
183
|
-
|
|
153
|
+
|
|
154
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
184
155
|
if (_this.props.onClick) {
|
|
185
156
|
_this.props.onClick(event);
|
|
186
157
|
}
|
|
187
158
|
});
|
|
159
|
+
|
|
188
160
|
_this.state = {
|
|
189
161
|
focused: false
|
|
190
162
|
};
|
|
191
|
-
_this.handleChange = _this.handleChange.bind((
|
|
192
|
-
_this.handleFocus = _this.handleFocus.bind((
|
|
193
|
-
_this.handleDivClick = _this.handleDivClick.bind((
|
|
194
|
-
_this.handleBlur = _this.handleBlur.bind((
|
|
195
|
-
_this.handleReset = _this.handleReset.bind((
|
|
196
|
-
_this.handleMouseEnter = _this.handleMouseEnter.bind((
|
|
197
|
-
_this.handleMouseLeave = _this.handleMouseLeave.bind((
|
|
198
|
-
_this.getInputElement = _this.getInputElement.bind((
|
|
199
|
-
_this.handleOverlayRef = _this.handleOverlayRef.bind((
|
|
163
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
164
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
165
|
+
_this.handleDivClick = _this.handleDivClick.bind(_assertThisInitialized(_this));
|
|
166
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
167
|
+
_this.handleReset = _this.handleReset.bind(_assertThisInitialized(_this));
|
|
168
|
+
_this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
|
|
169
|
+
_this.handleMouseLeave = _this.handleMouseLeave.bind(_assertThisInitialized(_this));
|
|
170
|
+
_this.getInputElement = _this.getInputElement.bind(_assertThisInitialized(_this));
|
|
171
|
+
_this.handleOverlayRef = _this.handleOverlayRef.bind(_assertThisInitialized(_this));
|
|
200
172
|
return _this;
|
|
201
173
|
}
|
|
202
174
|
|
|
203
|
-
(
|
|
175
|
+
_createClass(HiInput, [{
|
|
204
176
|
key: "getInputElement",
|
|
205
177
|
value: function getInputElement(el) {
|
|
206
178
|
this.inputElement = el;
|
|
@@ -339,8 +311,9 @@ function (_React$PureComponent) {
|
|
|
339
311
|
startAdornmentColor = _this$props.startAdornmentColor,
|
|
340
312
|
inputProps = _this$props.inputProps;
|
|
341
313
|
var focused = this.state.focused;
|
|
342
|
-
|
|
343
|
-
|
|
314
|
+
|
|
315
|
+
var overlayProps = _objectSpread({
|
|
316
|
+
className: classNames(classes.root, (_classNames = {}, _defineProperty(_classNames, classes.disabled, disabled && !error), _defineProperty(_classNames, classes.inkbar, !disabled), _defineProperty(_classNames, classes.focused, focused), _defineProperty(_classNames, classes.error, error), _classNames), className)
|
|
344
317
|
}, !disabled && {
|
|
345
318
|
onClick: this.handleDivClick,
|
|
346
319
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -348,22 +321,23 @@ function (_React$PureComponent) {
|
|
|
348
321
|
}, {
|
|
349
322
|
ref: this.handleOverlayRef
|
|
350
323
|
});
|
|
324
|
+
|
|
351
325
|
var leftIcon;
|
|
352
326
|
|
|
353
327
|
if (startAdornment) {
|
|
354
328
|
var _classNames2;
|
|
355
329
|
|
|
356
|
-
leftIcon =
|
|
330
|
+
leftIcon = React.createElement(HiIcon, {
|
|
357
331
|
icon: startAdornment,
|
|
358
332
|
size: 20,
|
|
359
333
|
color: startAdornmentColor,
|
|
360
334
|
onClick: this.props.onLeftIconClick,
|
|
361
|
-
className: (
|
|
335
|
+
className: classNames(classes.startAdornment, (_classNames2 = {}, _defineProperty(_classNames2, classes.startAdornmentFocus, focused), _defineProperty(_classNames2, classes.startAdornmentDisabled, disabled), _defineProperty(_classNames2, classes.iconPointer, this.props.onLeftIconClick), _classNames2))
|
|
362
336
|
});
|
|
363
337
|
} // Build endAdornment with eraseIcon + endAdornmentProps
|
|
364
338
|
|
|
365
339
|
|
|
366
|
-
var eraseIcon = !multiline && onReset && focused && !disabled && value.length > 0 &&
|
|
340
|
+
var eraseIcon = !multiline && onReset && focused && !disabled && value.length > 0 && React.createElement(HiIconButton, {
|
|
367
341
|
className: classes.eraseButton,
|
|
368
342
|
classes: {
|
|
369
343
|
label: classes.eraseButtonLabel
|
|
@@ -373,23 +347,26 @@ function (_React$PureComponent) {
|
|
|
373
347
|
buttonRef: function buttonRef(el) {
|
|
374
348
|
_this2.eraseIconNode = el;
|
|
375
349
|
}
|
|
376
|
-
},
|
|
377
|
-
|
|
350
|
+
}, React.createElement(HiIcon, {
|
|
351
|
+
icon: "close",
|
|
352
|
+
size: 20,
|
|
353
|
+
color: "neutral"
|
|
354
|
+
}));
|
|
378
355
|
var endAdornment = endAdornmentProps;
|
|
379
356
|
|
|
380
357
|
if (typeof endAdornmentProps === 'string' && endAdornmentProps !== '') {
|
|
381
358
|
var _classNames3;
|
|
382
359
|
|
|
383
|
-
endAdornment =
|
|
360
|
+
endAdornment = React.createElement(HiIcon, {
|
|
384
361
|
icon: endAdornmentProps,
|
|
385
362
|
size: 20,
|
|
386
363
|
color: "neutral",
|
|
387
364
|
onClick: this.props.onRightIconClick,
|
|
388
|
-
className: (
|
|
365
|
+
className: classNames(classes.rightIcon, (_classNames3 = {}, _defineProperty(_classNames3, classes.rightIconFocus, focused), _defineProperty(_classNames3, classes.rightIconDisabled, disabled), _defineProperty(_classNames3, classes.rightIconError, error), _defineProperty(_classNames3, classes.iconPointer, this.props.onRightIconClick), _classNames3))
|
|
389
366
|
});
|
|
390
367
|
}
|
|
391
368
|
|
|
392
|
-
return
|
|
369
|
+
return React.createElement("div", overlayProps, React.createElement(Input, {
|
|
393
370
|
id: inputId,
|
|
394
371
|
type: type,
|
|
395
372
|
className: classes.input,
|
|
@@ -410,15 +387,15 @@ function (_React$PureComponent) {
|
|
|
410
387
|
autoFocus: autoFocus,
|
|
411
388
|
name: name,
|
|
412
389
|
startAdornment: leftIcon,
|
|
413
|
-
endAdornment:
|
|
390
|
+
endAdornment: React.createElement("div", {
|
|
414
391
|
className: classes.endAdornment,
|
|
415
392
|
ref: function ref(el) {
|
|
416
393
|
_this2.endAdornmentNode = el;
|
|
417
394
|
}
|
|
418
395
|
}, eraseIcon, endAdornment),
|
|
419
|
-
inputProps: (
|
|
396
|
+
inputProps: _objectSpread({
|
|
420
397
|
spellCheck: spellcheck ? "true" : "false",
|
|
421
|
-
className: (
|
|
398
|
+
className: classNames(inputClassName, classes.inputPropsClassName, (_classNames4 = {}, _defineProperty(_classNames4, classes.inputText, !multiline), _defineProperty(_classNames4, classes.inputTextArea, multiline), _classNames4))
|
|
422
399
|
}, inputProps)
|
|
423
400
|
}));
|
|
424
401
|
}
|
|
@@ -434,10 +411,11 @@ function (_React$PureComponent) {
|
|
|
434
411
|
return null;
|
|
435
412
|
}
|
|
436
413
|
}]);
|
|
414
|
+
|
|
437
415
|
return HiInput;
|
|
438
|
-
}(
|
|
416
|
+
}(React.PureComponent);
|
|
439
417
|
|
|
440
|
-
(
|
|
418
|
+
_defineProperty(HiInput, "defaultProps", {
|
|
441
419
|
value: '',
|
|
442
420
|
placeholder: '',
|
|
443
421
|
inputId: '',
|
|
@@ -451,9 +429,7 @@ function (_React$PureComponent) {
|
|
|
451
429
|
spellcheck: false
|
|
452
430
|
});
|
|
453
431
|
|
|
454
|
-
|
|
432
|
+
export default withStyles(styles, {
|
|
455
433
|
hiComponent: true,
|
|
456
434
|
name: 'HiMuiHiInput'
|
|
457
|
-
})(HiInput);
|
|
458
|
-
|
|
459
|
-
exports.default = _default;
|
|
435
|
+
})(HiInput);
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { assert } from 'chai';
|
|
3
|
+
import { spy } from 'sinon';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { createShallow, createMount, getClasses } from '../test-utils';
|
|
6
|
+
import HiInput from './HiInput';
|
|
7
|
+
describe('<HiInput />', function () {
|
|
8
|
+
var shallow;
|
|
9
|
+
var mount;
|
|
10
|
+
var classes;
|
|
11
|
+
before(function () {
|
|
12
|
+
shallow = createShallow({
|
|
13
|
+
untilSelector: 'HiInput'
|
|
14
|
+
});
|
|
15
|
+
classes = getClasses(React.createElement(HiInput, {
|
|
16
|
+
value: '',
|
|
17
|
+
onChange: function onChange() {
|
|
18
|
+
return null;
|
|
19
|
+
},
|
|
20
|
+
onReset: function onReset() {
|
|
21
|
+
return null;
|
|
22
|
+
},
|
|
23
|
+
placeholder: 'Rechercher'
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
beforeEach(function () {
|
|
27
|
+
mount = createMount();
|
|
28
|
+
});
|
|
29
|
+
afterEach(function () {
|
|
30
|
+
mount.cleanUp();
|
|
31
|
+
});
|
|
32
|
+
it('should render a td with an Lock icon for code 0', function () {
|
|
33
|
+
var handleBlur = spy();
|
|
34
|
+
var wrapper = shallow(React.createElement(HiInput, {
|
|
35
|
+
value: '',
|
|
36
|
+
onChange: function onChange() {
|
|
37
|
+
return null;
|
|
38
|
+
},
|
|
39
|
+
onReset: function onReset() {
|
|
40
|
+
return null;
|
|
41
|
+
},
|
|
42
|
+
placeholder: 'Rechercher',
|
|
43
|
+
autoFocus: false,
|
|
44
|
+
onBlur: handleBlur
|
|
45
|
+
}));
|
|
46
|
+
assert.strictEqual(wrapper.name(), 'div');
|
|
47
|
+
assert.strictEqual(wrapper.state().focused, false, 'Initial focus is false');
|
|
48
|
+
});
|
|
49
|
+
it('should have a fonctionnal input', function () {
|
|
50
|
+
var handleChange = spy();
|
|
51
|
+
var handleReset = spy();
|
|
52
|
+
var handleMouseEnter = spy();
|
|
53
|
+
var handleMouseLeave = spy();
|
|
54
|
+
var handleBlur = spy();
|
|
55
|
+
var handleFocus = spy();
|
|
56
|
+
var handleSubmit = spy();
|
|
57
|
+
var handleClick = spy();
|
|
58
|
+
var wrapper = mount(React.createElement(HiInput, {
|
|
59
|
+
value: 'test',
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
onChange: handleChange,
|
|
62
|
+
onReset: handleReset,
|
|
63
|
+
inputId: 'test-input',
|
|
64
|
+
onMouseEnter: handleMouseEnter,
|
|
65
|
+
onMouseLeave: handleMouseLeave,
|
|
66
|
+
onBlur: handleBlur,
|
|
67
|
+
onFocus: handleFocus,
|
|
68
|
+
onSubmit: handleSubmit
|
|
69
|
+
}));
|
|
70
|
+
assert.strictEqual(wrapper.find('input').length, 1);
|
|
71
|
+
assert.strictEqual(wrapper.find('input').props().type, 'text');
|
|
72
|
+
assert.strictEqual(wrapper.find('input').props().value, 'test');
|
|
73
|
+
assert.strictEqual(wrapper.find('input').props().placeholder, '');
|
|
74
|
+
wrapper.setProps({
|
|
75
|
+
placeholder: 'Rechercher'
|
|
76
|
+
});
|
|
77
|
+
wrapper.update();
|
|
78
|
+
assert.strictEqual(wrapper.find('input').props().placeholder, 'Rechercher');
|
|
79
|
+
wrapper.find('input').simulate('change', {
|
|
80
|
+
target: {
|
|
81
|
+
value: 'newValue'
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
assert.strictEqual(handleChange.callCount, 1);
|
|
85
|
+
assert.strictEqual(handleChange.args[0][0].target.value, 'newValue');
|
|
86
|
+
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
|
87
|
+
wrapper.find('input').simulate('focus');
|
|
88
|
+
assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
|
|
89
|
+
assert.strictEqual(handleSubmit.callCount, 0, 'should not trigger handleSubmit');
|
|
90
|
+
assert.strictEqual(wrapper.find('button').length, 1, 'should have clear icon');
|
|
91
|
+
wrapper.find('button').simulate('click');
|
|
92
|
+
assert.strictEqual(handleReset.callCount, 1, 'should trigger reset callback');
|
|
93
|
+
assert.strictEqual(handleFocus.callCount, 2, 'should trigger focus callback');
|
|
94
|
+
assert.strictEqual(handleSubmit.callCount, 0, 'should not trigger handleSubmit');
|
|
95
|
+
assert.strictEqual(handleClick.callCount, 1, 'should call handleClick once');
|
|
96
|
+
wrapper.find('input').simulate('click');
|
|
97
|
+
var input = document.getElementById('test-input');
|
|
98
|
+
var divs = document.getElementsByClassName(classes.root);
|
|
99
|
+
|
|
100
|
+
if (!input) {
|
|
101
|
+
throw new Error('missing input');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
assert.strictEqual(handleClick.callCount, 2, 'should call handleClick once more');
|
|
105
|
+
assert.strictEqual(divs.length, 1);
|
|
106
|
+
var rootDiv = divs[0];
|
|
107
|
+
var rootClass = classNames(classes.root, classes.inkbar);
|
|
108
|
+
var rootFocusClass = classNames(classes.root, classes.inkbar, classes.focused);
|
|
109
|
+
input.focus();
|
|
110
|
+
assert.strictEqual(rootDiv.className, rootFocusClass);
|
|
111
|
+
var focusedElement = document.activeElement;
|
|
112
|
+
assert.strictEqual(input, focusedElement, 'should trigger reset callback');
|
|
113
|
+
input.blur();
|
|
114
|
+
assert.strictEqual(rootDiv.className, rootClass);
|
|
115
|
+
wrapper.simulate('mouseEnter');
|
|
116
|
+
assert.strictEqual(handleMouseEnter.callCount, 1, 'should trigger mouse enter callback');
|
|
117
|
+
wrapper.simulate('mouseLeave');
|
|
118
|
+
assert.strictEqual(handleMouseLeave.callCount, 1, 'should trigger mouse leave callback'); // Press "enter" on HiSelectInput => onSubmit
|
|
119
|
+
|
|
120
|
+
wrapper.find('input').simulate('keydown', {
|
|
121
|
+
keyCode: 13
|
|
122
|
+
});
|
|
123
|
+
assert.strictEqual(handleSubmit.callCount, 1, 'should call handleSubmit once');
|
|
124
|
+
});
|
|
125
|
+
it('should not call callbacks', function () {
|
|
126
|
+
var handleChange = spy();
|
|
127
|
+
var handleReset = spy();
|
|
128
|
+
var handleMouseEnter = spy();
|
|
129
|
+
var handleMouseLeave = spy();
|
|
130
|
+
var handleBlur = spy();
|
|
131
|
+
var handleFocus = spy();
|
|
132
|
+
var wrapper = mount(React.createElement(HiInput, {
|
|
133
|
+
value: 'test',
|
|
134
|
+
inputId: 'test-input',
|
|
135
|
+
onReset: function onReset() {}
|
|
136
|
+
}));
|
|
137
|
+
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
|
138
|
+
wrapper.find('input').simulate('focus');
|
|
139
|
+
assert.strictEqual(wrapper.find('button').length, 1, 'should have clear icon');
|
|
140
|
+
wrapper.find('button').simulate('click');
|
|
141
|
+
assert.strictEqual(handleReset.callCount, 0, 'should not trigger reset callback');
|
|
142
|
+
assert.strictEqual(handleFocus.callCount, 0, 'should not trigger focus callback');
|
|
143
|
+
wrapper.find('input').simulate('change', {
|
|
144
|
+
target: {
|
|
145
|
+
value: 'newValue'
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
assert.strictEqual(handleChange.callCount, 0);
|
|
149
|
+
wrapper.find('input').simulate('click');
|
|
150
|
+
assert.strictEqual(handleBlur.callCount, 0, 'should not trigger blur callback');
|
|
151
|
+
wrapper.simulate('mouseEnter');
|
|
152
|
+
assert.strictEqual(handleMouseEnter.callCount, 0, 'should not trigger mouse enter callback');
|
|
153
|
+
wrapper.simulate('mouseLeave');
|
|
154
|
+
assert.strictEqual(handleMouseLeave.callCount, 0, 'should not trigger mouse leave callback');
|
|
155
|
+
});
|
|
156
|
+
describe('shallow', function () {
|
|
157
|
+
var wrapper;
|
|
158
|
+
beforeEach(function () {
|
|
159
|
+
wrapper = shallow(React.createElement(HiInput, {
|
|
160
|
+
value: 'test'
|
|
161
|
+
}));
|
|
162
|
+
});
|
|
163
|
+
describe('without icons', function () {
|
|
164
|
+
it('should have 1 child', function () {
|
|
165
|
+
assert.strictEqual(wrapper.children().length, 1);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
describe('with clearIcon', function () {
|
|
169
|
+
beforeEach(function () {
|
|
170
|
+
wrapper.setProps({
|
|
171
|
+
onReset: function onReset() {}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
it('should still have 1 child', function () {
|
|
175
|
+
assert.strictEqual(wrapper.children().length, 1);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('with rightIcon', function () {
|
|
179
|
+
beforeEach(function () {
|
|
180
|
+
wrapper.setProps({
|
|
181
|
+
startAdornment: 'Archive'
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
it('should have 1 child', function () {
|
|
185
|
+
assert.strictEqual(wrapper.children().length, 1);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe('with multiline', function () {
|
|
189
|
+
beforeEach(function () {
|
|
190
|
+
wrapper.setProps({
|
|
191
|
+
onReset: function onReset() {},
|
|
192
|
+
leftIcon: 'Archive',
|
|
193
|
+
rightIcon: 'Eye',
|
|
194
|
+
multiline: true
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
it('should have 1 child', function () {
|
|
198
|
+
assert.strictEqual(wrapper.children().length, 1);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
});
|
|
@@ -1,42 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
11
|
-
|
|
12
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
|
-
|
|
34
|
-
var _styles = require("@material-ui/core/styles");
|
|
35
|
-
|
|
36
|
-
var _HiTextField = _interopRequireDefault(require("./HiTextField"));
|
|
37
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
9
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
38
10
|
// @inheritedComponent HiTextField
|
|
39
|
-
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
14
|
+
import HiTextField from './HiTextField';
|
|
15
|
+
export var styles = function styles() {
|
|
40
16
|
return {
|
|
41
17
|
inputPassword: {
|
|
42
18
|
fontWeight: 'bolder',
|
|
@@ -50,27 +26,25 @@ var styles = function styles() {
|
|
|
50
26
|
* Champs input email pour formulaire
|
|
51
27
|
*/
|
|
52
28
|
|
|
53
|
-
|
|
54
|
-
exports.styles = styles;
|
|
55
|
-
|
|
56
29
|
var HiPasswordField =
|
|
57
30
|
/*#__PURE__*/
|
|
58
31
|
function (_React$Component) {
|
|
59
|
-
(
|
|
32
|
+
_inherits(HiPasswordField, _React$Component);
|
|
60
33
|
|
|
61
34
|
function HiPasswordField(props) {
|
|
62
35
|
var _this;
|
|
63
36
|
|
|
64
|
-
(
|
|
65
|
-
|
|
37
|
+
_classCallCheck(this, HiPasswordField);
|
|
38
|
+
|
|
39
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiPasswordField).call(this, props));
|
|
66
40
|
_this.state = {
|
|
67
41
|
showText: false
|
|
68
42
|
};
|
|
69
|
-
_this.handlePasswordToggle = _this.handlePasswordToggle.bind((
|
|
43
|
+
_this.handlePasswordToggle = _this.handlePasswordToggle.bind(_assertThisInitialized(_this));
|
|
70
44
|
return _this;
|
|
71
45
|
}
|
|
72
46
|
|
|
73
|
-
(
|
|
47
|
+
_createClass(HiPasswordField, [{
|
|
74
48
|
key: "handlePasswordToggle",
|
|
75
49
|
value: function handlePasswordToggle() {
|
|
76
50
|
this.setState(function (prevState) {
|
|
@@ -85,14 +59,15 @@ function (_React$Component) {
|
|
|
85
59
|
var _this$props = this.props,
|
|
86
60
|
classes = _this$props.classes,
|
|
87
61
|
HiInputProps = _this$props.HiInputProps,
|
|
88
|
-
otherProps = (
|
|
62
|
+
otherProps = _objectWithoutProperties(_this$props, ["classes", "HiInputProps"]);
|
|
63
|
+
|
|
89
64
|
var endAdornment = this.state.showText ? 'visibility_off' : 'visibility';
|
|
90
65
|
var type = this.state.showText ? 'text' : 'password';
|
|
91
|
-
var inputClassName = (
|
|
92
|
-
return
|
|
66
|
+
var inputClassName = classNames(_defineProperty({}, classes.inputPassword, !this.state.showText && otherProps.value !== ""));
|
|
67
|
+
return React.createElement(HiTextField, Object.assign({}, otherProps, {
|
|
93
68
|
type: type,
|
|
94
69
|
onRightIconClick: this.handlePasswordToggle,
|
|
95
|
-
HiInputProps: (
|
|
70
|
+
HiInputProps: _objectSpread({
|
|
96
71
|
placeholder: ''
|
|
97
72
|
}, HiInputProps, {
|
|
98
73
|
endAdornment: endAdornment,
|
|
@@ -102,12 +77,11 @@ function (_React$Component) {
|
|
|
102
77
|
}));
|
|
103
78
|
}
|
|
104
79
|
}]);
|
|
80
|
+
|
|
105
81
|
return HiPasswordField;
|
|
106
|
-
}(
|
|
82
|
+
}(React.Component);
|
|
107
83
|
|
|
108
|
-
|
|
84
|
+
export default withStyles(styles, {
|
|
109
85
|
hiComponent: true,
|
|
110
86
|
name: 'HmuiHiPasswordField'
|
|
111
|
-
})(HiPasswordField);
|
|
112
|
-
|
|
113
|
-
exports.default = _default;
|
|
87
|
+
})(HiPasswordField);
|