@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
package/es/HiSelect/HiSelect.js
CHANGED
|
@@ -1,69 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
|
-
var _reactCustomScrollbars = _interopRequireDefault(require("react-custom-scrollbars"));
|
|
33
|
-
|
|
34
|
-
var _Grow = _interopRequireDefault(require("@material-ui/core/Grow"));
|
|
35
|
-
|
|
36
|
-
var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
|
|
37
|
-
|
|
38
|
-
var _Popper = _interopRequireDefault(require("@material-ui/core/Popper"));
|
|
39
|
-
|
|
40
|
-
var _ClickAwayListener = _interopRequireDefault(require("@material-ui/core/ClickAwayListener"));
|
|
41
|
-
|
|
42
|
-
var _HiSelectableList = _interopRequireDefault(require("../HiSelectableList"));
|
|
43
|
-
|
|
44
|
-
var _HiInput = _interopRequireDefault(require("../HiForm/HiInput"));
|
|
45
|
-
|
|
46
|
-
var _HiSelectInput = _interopRequireDefault(require("./HiSelectInput"));
|
|
47
|
-
|
|
48
|
-
var _styles = require("@material-ui/core/styles");
|
|
49
|
-
|
|
50
|
-
var _helpers = require("../utils/helpers");
|
|
51
|
-
|
|
52
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
|
53
|
-
|
|
54
|
-
var _keycode = _interopRequireDefault(require("keycode"));
|
|
55
|
-
|
|
56
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
57
|
-
|
|
58
|
-
var _HiAlertModal = _interopRequireDefault(require("../HiAlertModal"));
|
|
59
|
-
|
|
60
|
-
var _reactDeviceDetect = require("react-device-detect");
|
|
61
|
-
|
|
62
|
-
var _HiSelectMobile = _interopRequireDefault(require("./HiSelectMobile"));
|
|
63
|
-
|
|
64
|
-
var _reactDom = require("react-dom");
|
|
65
|
-
|
|
66
|
-
var styles = function styles(theme) {
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
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 _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import Scrollbars from 'react-custom-scrollbars';
|
|
12
|
+
import Grow from '@material-ui/core/Grow';
|
|
13
|
+
import Paper from '@material-ui/core/Paper';
|
|
14
|
+
import Popper from '@material-ui/core/Popper';
|
|
15
|
+
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
|
|
16
|
+
import HiSelectableList from '../HiSelectableList';
|
|
17
|
+
import HiInput from '../HiForm/HiInput';
|
|
18
|
+
import HiSelectInput from './HiSelectInput';
|
|
19
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
20
|
+
import { foldAccents } from '../utils/helpers';
|
|
21
|
+
import HiIcon from '../HiIcon';
|
|
22
|
+
import keycode from 'keycode';
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import HiAlertModal from '../HiAlertModal';
|
|
25
|
+
import { isMobile } from 'react-device-detect';
|
|
26
|
+
import HiSelectMobile from './HiSelectMobile';
|
|
27
|
+
import { findDOMNode } from 'react-dom';
|
|
28
|
+
export var styles = function styles(theme) {
|
|
67
29
|
return {
|
|
68
30
|
root: {
|
|
69
31
|
backgroundColor: theme.palette.background2,
|
|
@@ -96,7 +58,7 @@ var styles = function styles(theme) {
|
|
|
96
58
|
margin: '0 4px',
|
|
97
59
|
verticalAlign: 'text-bottom'
|
|
98
60
|
},
|
|
99
|
-
selectIconLabel: (
|
|
61
|
+
selectIconLabel: _objectSpread({
|
|
100
62
|
whiteSpace: 'nowrap',
|
|
101
63
|
overflow: 'hidden',
|
|
102
64
|
textOverflow: 'ellipsis',
|
|
@@ -105,7 +67,7 @@ var styles = function styles(theme) {
|
|
|
105
67
|
display: 'inline-block',
|
|
106
68
|
width: '100%'
|
|
107
69
|
}),
|
|
108
|
-
selectImgLabel: (
|
|
70
|
+
selectImgLabel: _objectSpread({
|
|
109
71
|
whiteSpace: 'nowrap',
|
|
110
72
|
overflow: 'hidden',
|
|
111
73
|
textOverflow: 'ellipsis',
|
|
@@ -120,10 +82,8 @@ var styles = function styles(theme) {
|
|
|
120
82
|
};
|
|
121
83
|
};
|
|
122
84
|
|
|
123
|
-
exports.styles = styles;
|
|
124
|
-
|
|
125
85
|
function filterValue(item, search) {
|
|
126
|
-
return search === '' ||
|
|
86
|
+
return search === '' || foldAccents(item.label.toString().toLowerCase()).search(foldAccents(search.toLowerCase())) !== -1;
|
|
127
87
|
}
|
|
128
88
|
/**
|
|
129
89
|
*
|
|
@@ -145,40 +105,43 @@ function filterValue(item, search) {
|
|
|
145
105
|
var HiSelect =
|
|
146
106
|
/*#__PURE__*/
|
|
147
107
|
function (_React$PureComponent) {
|
|
148
|
-
(
|
|
108
|
+
_inherits(HiSelect, _React$PureComponent);
|
|
149
109
|
|
|
150
110
|
function HiSelect(props) {
|
|
151
111
|
var _this;
|
|
152
112
|
|
|
153
|
-
(
|
|
154
|
-
|
|
155
|
-
(
|
|
113
|
+
_classCallCheck(this, HiSelect);
|
|
114
|
+
|
|
115
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(HiSelect).call(this, props));
|
|
116
|
+
|
|
117
|
+
_defineProperty(_assertThisInitialized(_this), "buildSelectProps", function (options) {
|
|
156
118
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
157
119
|
var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
158
120
|
var loading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
159
121
|
// build item list
|
|
160
|
-
var itemList = [].concat((
|
|
122
|
+
var itemList = [].concat(_toConsumableArray(loading ? [{
|
|
161
123
|
id: '_loading',
|
|
162
124
|
type: 'loader',
|
|
163
125
|
disabled: true,
|
|
164
126
|
centered: true,
|
|
165
127
|
hideCheckbox: true,
|
|
166
128
|
label: 'loading'
|
|
167
|
-
}] : []), (
|
|
129
|
+
}] : []), _toConsumableArray(search !== '' ? _toConsumableArray(options.filter(function (item) {
|
|
168
130
|
return _this.props.filterFunc(item, search);
|
|
169
|
-
})) : [].concat((
|
|
131
|
+
})) : [].concat(_toConsumableArray(_this.props.hasAll ? [_objectSpread({
|
|
170
132
|
id: '_all',
|
|
171
133
|
label: _this.props.translations.all
|
|
172
134
|
}, _this.props.iconAll && {
|
|
173
135
|
type: 'icon',
|
|
174
136
|
icon: _this.props.iconAll
|
|
175
|
-
})] : []), (
|
|
137
|
+
})] : []), _toConsumableArray(options))));
|
|
176
138
|
return {
|
|
177
139
|
itemList: itemList,
|
|
178
140
|
inputValue: _this.buildInputValue(options, value, loading)
|
|
179
141
|
};
|
|
180
142
|
});
|
|
181
|
-
|
|
143
|
+
|
|
144
|
+
_defineProperty(_assertThisInitialized(_this), "buildInputValue", function (options) {
|
|
182
145
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
183
146
|
var loading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
184
147
|
var _this$props = _this.props,
|
|
@@ -204,17 +167,17 @@ function (_React$PureComponent) {
|
|
|
204
167
|
if (item === undefined) {
|
|
205
168
|
inputValue = translations.one_item_selected;
|
|
206
169
|
} else if (type === 'icon' || item.type === 'icon') {
|
|
207
|
-
inputValue =
|
|
170
|
+
inputValue = React.createElement("span", {
|
|
208
171
|
className: classes.selectIconLabel
|
|
209
|
-
},
|
|
172
|
+
}, React.createElement(HiIcon, {
|
|
210
173
|
className: classes.labelIcon,
|
|
211
174
|
color: item.color,
|
|
212
175
|
icon: item.icon
|
|
213
176
|
}), item.label);
|
|
214
177
|
} else if (type === 'image' || item.type === 'image') {
|
|
215
|
-
inputValue =
|
|
178
|
+
inputValue = React.createElement("span", {
|
|
216
179
|
className: classes.selectIconLabel
|
|
217
|
-
}, item.img &&
|
|
180
|
+
}, item.img && React.createElement("img", {
|
|
218
181
|
className: classes.labelImg,
|
|
219
182
|
src: item.img,
|
|
220
183
|
alt: item.label,
|
|
@@ -233,7 +196,8 @@ function (_React$PureComponent) {
|
|
|
233
196
|
|
|
234
197
|
return inputValue;
|
|
235
198
|
});
|
|
236
|
-
|
|
199
|
+
|
|
200
|
+
_defineProperty(_assertThisInitialized(_this), "focusOnFirstItem", function () {
|
|
237
201
|
if (_this.overlay && _this.overlay.getElementsByTagName('li')[0]) {
|
|
238
202
|
setTimeout(function () {
|
|
239
203
|
var item = _this.overlay.getElementsByTagName('li')[0];
|
|
@@ -242,14 +206,16 @@ function (_React$PureComponent) {
|
|
|
242
206
|
}, 1);
|
|
243
207
|
}
|
|
244
208
|
});
|
|
245
|
-
|
|
209
|
+
|
|
210
|
+
_defineProperty(_assertThisInitialized(_this), "getInputElement", function (el) {
|
|
246
211
|
_this.searchField = el;
|
|
247
212
|
|
|
248
213
|
if (_this.props.inputRef) {
|
|
249
214
|
_this.props.inputRef(_this.searchField);
|
|
250
215
|
}
|
|
251
216
|
});
|
|
252
|
-
|
|
217
|
+
|
|
218
|
+
_defineProperty(_assertThisInitialized(_this), "handleBlur", function (event) {
|
|
253
219
|
_this.handleSearchReset();
|
|
254
220
|
|
|
255
221
|
_this.setState({
|
|
@@ -260,7 +226,8 @@ function (_React$PureComponent) {
|
|
|
260
226
|
_this.props.onBlur(event);
|
|
261
227
|
}
|
|
262
228
|
});
|
|
263
|
-
|
|
229
|
+
|
|
230
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function () {
|
|
264
231
|
if (_this.state.open) {
|
|
265
232
|
_this.handleClose();
|
|
266
233
|
} else if (_this.props.alert && !_this.state.alertOpen) {
|
|
@@ -286,21 +253,26 @@ function (_React$PureComponent) {
|
|
|
286
253
|
}, 1);
|
|
287
254
|
}
|
|
288
255
|
});
|
|
289
|
-
|
|
256
|
+
|
|
257
|
+
_defineProperty(_assertThisInitialized(_this), "handleSubmitAlert", function () {
|
|
290
258
|
_this.handleClick();
|
|
291
259
|
});
|
|
292
|
-
|
|
260
|
+
|
|
261
|
+
_defineProperty(_assertThisInitialized(_this), "handleCancelAlert", function () {
|
|
293
262
|
_this.handleClose();
|
|
294
263
|
});
|
|
295
|
-
|
|
264
|
+
|
|
265
|
+
_defineProperty(_assertThisInitialized(_this), "handleExitedAlert", function () {
|
|
296
266
|
if (_this.searchField) {
|
|
297
267
|
_this.searchField.focus();
|
|
298
268
|
}
|
|
299
269
|
});
|
|
300
|
-
|
|
270
|
+
|
|
271
|
+
_defineProperty(_assertThisInitialized(_this), "handleCloseAlert", function () {
|
|
301
272
|
_this.handleClose();
|
|
302
273
|
});
|
|
303
|
-
|
|
274
|
+
|
|
275
|
+
_defineProperty(_assertThisInitialized(_this), "focusOnSelectedItem", function (selectedValue) {
|
|
304
276
|
if (_this.overlay && _this.overlay.getElementsByTagName('li')[0]) {
|
|
305
277
|
setTimeout(function () {
|
|
306
278
|
if (_this.overlay) {
|
|
@@ -320,13 +292,15 @@ function (_React$PureComponent) {
|
|
|
320
292
|
}, 1);
|
|
321
293
|
}
|
|
322
294
|
});
|
|
323
|
-
|
|
295
|
+
|
|
296
|
+
_defineProperty(_assertThisInitialized(_this), "handleClickAway", function (event) {
|
|
324
297
|
// Au clic sur le bouton, on laisse le handleClick fermer le select
|
|
325
298
|
if (!_this.inputEl.contains(event.target)) {
|
|
326
299
|
_this.handleClose(event);
|
|
327
300
|
}
|
|
328
301
|
});
|
|
329
|
-
|
|
302
|
+
|
|
303
|
+
_defineProperty(_assertThisInitialized(_this), "handleClose", function () {
|
|
330
304
|
_this.handleSearchReset();
|
|
331
305
|
|
|
332
306
|
_this.setState({
|
|
@@ -342,13 +316,15 @@ function (_React$PureComponent) {
|
|
|
342
316
|
_this.inputEl.focus();
|
|
343
317
|
}
|
|
344
318
|
});
|
|
345
|
-
|
|
319
|
+
|
|
320
|
+
_defineProperty(_assertThisInitialized(_this), "handleFocus", function () {
|
|
346
321
|
_this.setState({
|
|
347
322
|
focused: true
|
|
348
323
|
});
|
|
349
324
|
});
|
|
350
|
-
|
|
351
|
-
|
|
325
|
+
|
|
326
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDownCapture", function (event) {
|
|
327
|
+
var key = keycode(event);
|
|
352
328
|
|
|
353
329
|
if (key === 'enter') {
|
|
354
330
|
if (_this.state.open) {
|
|
@@ -360,8 +336,9 @@ function (_React$PureComponent) {
|
|
|
360
336
|
}
|
|
361
337
|
}
|
|
362
338
|
});
|
|
363
|
-
|
|
364
|
-
|
|
339
|
+
|
|
340
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
341
|
+
var key = keycode(event);
|
|
365
342
|
|
|
366
343
|
if (!_this.state.alertOpen) {
|
|
367
344
|
if (key === 'esc') {
|
|
@@ -383,8 +360,9 @@ function (_React$PureComponent) {
|
|
|
383
360
|
}
|
|
384
361
|
}
|
|
385
362
|
});
|
|
386
|
-
|
|
387
|
-
|
|
363
|
+
|
|
364
|
+
_defineProperty(_assertThisInitialized(_this), "handleKeyDownSearch", function (event) {
|
|
365
|
+
var key = keycode(event);
|
|
388
366
|
|
|
389
367
|
if (_this.overlay && (key === 'down' || key === 'up')) {
|
|
390
368
|
_this.focusOnFirstItem();
|
|
@@ -398,12 +376,14 @@ function (_React$PureComponent) {
|
|
|
398
376
|
});
|
|
399
377
|
}
|
|
400
378
|
});
|
|
401
|
-
|
|
379
|
+
|
|
380
|
+
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (e) {
|
|
402
381
|
if (e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop < 15) {
|
|
403
382
|
_this.props.onScrollReachBottom();
|
|
404
383
|
}
|
|
405
384
|
});
|
|
406
|
-
|
|
385
|
+
|
|
386
|
+
_defineProperty(_assertThisInitialized(_this), "handleSelect", function (event, item) {
|
|
407
387
|
var _this$props2 = _this.props,
|
|
408
388
|
hasAll = _this$props2.hasAll,
|
|
409
389
|
multiple = _this$props2.multiple,
|
|
@@ -426,7 +406,7 @@ function (_React$PureComponent) {
|
|
|
426
406
|
return option.id;
|
|
427
407
|
}), item);
|
|
428
408
|
}
|
|
429
|
-
} else if (
|
|
409
|
+
} else if (isMobile && multiple) {
|
|
430
410
|
// Array of selected values
|
|
431
411
|
onChange(event, item.map(function (option) {
|
|
432
412
|
return option.id;
|
|
@@ -437,10 +417,11 @@ function (_React$PureComponent) {
|
|
|
437
417
|
return id !== item.id;
|
|
438
418
|
}), item);
|
|
439
419
|
} else {
|
|
440
|
-
onChange(event, [].concat((
|
|
420
|
+
onChange(event, [].concat(_toConsumableArray(value), [item.id]), item);
|
|
441
421
|
}
|
|
442
422
|
});
|
|
443
|
-
|
|
423
|
+
|
|
424
|
+
_defineProperty(_assertThisInitialized(_this), "handleSuggestions", function (suggestions) {
|
|
444
425
|
var _this$props3 = _this.props,
|
|
445
426
|
hasAll = _this$props3.hasAll,
|
|
446
427
|
iconAll = _this$props3.iconAll,
|
|
@@ -449,7 +430,7 @@ function (_React$PureComponent) {
|
|
|
449
430
|
if (suggestions.length === 0) {
|
|
450
431
|
// Add '_no_result' suggestion
|
|
451
432
|
_this.setState(function (prevState) {
|
|
452
|
-
return (
|
|
433
|
+
return _objectSpread({}, prevState, {
|
|
453
434
|
suggestions: [{
|
|
454
435
|
id: '_no_result',
|
|
455
436
|
type: 'text',
|
|
@@ -462,17 +443,18 @@ function (_React$PureComponent) {
|
|
|
462
443
|
});
|
|
463
444
|
} else {
|
|
464
445
|
_this.setState({
|
|
465
|
-
suggestions: [].concat((
|
|
446
|
+
suggestions: [].concat(_toConsumableArray(hasAll ? [_objectSpread({
|
|
466
447
|
id: '_all',
|
|
467
448
|
label: translations.all
|
|
468
449
|
}, iconAll && {
|
|
469
450
|
type: 'icon',
|
|
470
451
|
icon: iconAll
|
|
471
|
-
})] : []), (
|
|
452
|
+
})] : []), _toConsumableArray(suggestions))
|
|
472
453
|
});
|
|
473
454
|
}
|
|
474
455
|
});
|
|
475
|
-
|
|
456
|
+
|
|
457
|
+
_defineProperty(_assertThisInitialized(_this), "handleSearch", function (e, inputValue) {
|
|
476
458
|
var searchValue = inputValue && e.target.value ? inputValue : e.target.value;
|
|
477
459
|
|
|
478
460
|
if (_this.props.onSearch) {
|
|
@@ -483,14 +465,16 @@ function (_React$PureComponent) {
|
|
|
483
465
|
});
|
|
484
466
|
}
|
|
485
467
|
});
|
|
486
|
-
|
|
468
|
+
|
|
469
|
+
_defineProperty(_assertThisInitialized(_this), "handleSearchReset", function () {
|
|
487
470
|
_this.handleSearch({
|
|
488
471
|
target: {
|
|
489
472
|
value: ''
|
|
490
473
|
}
|
|
491
474
|
}, '');
|
|
492
475
|
});
|
|
493
|
-
|
|
476
|
+
|
|
477
|
+
_defineProperty(_assertThisInitialized(_this), "getLengthItemList", function (itemList) {
|
|
494
478
|
var itemListLength = 0;
|
|
495
479
|
itemList.forEach(function (parent) {
|
|
496
480
|
if (parent.displayed !== false) {
|
|
@@ -503,6 +487,7 @@ function (_React$PureComponent) {
|
|
|
503
487
|
});
|
|
504
488
|
return itemListLength;
|
|
505
489
|
});
|
|
490
|
+
|
|
506
491
|
_this.state = {
|
|
507
492
|
alertOpen: false,
|
|
508
493
|
open: false,
|
|
@@ -515,7 +500,7 @@ function (_React$PureComponent) {
|
|
|
515
500
|
return _this;
|
|
516
501
|
}
|
|
517
502
|
|
|
518
|
-
(
|
|
503
|
+
_createClass(HiSelect, [{
|
|
519
504
|
key: "componentDidMount",
|
|
520
505
|
value: function componentDidMount() {
|
|
521
506
|
if (this.props.autoFocus) {
|
|
@@ -524,7 +509,7 @@ function (_React$PureComponent) {
|
|
|
524
509
|
|
|
525
510
|
if (this.overlay) {
|
|
526
511
|
this.setState({
|
|
527
|
-
overlayWidth:
|
|
512
|
+
overlayWidth: findDOMNode(this.overlay).clientWidth
|
|
528
513
|
});
|
|
529
514
|
}
|
|
530
515
|
}
|
|
@@ -575,7 +560,7 @@ function (_React$PureComponent) {
|
|
|
575
560
|
var selectedItemIdList = [];
|
|
576
561
|
|
|
577
562
|
if (value) {
|
|
578
|
-
selectedItemIdList = multiple ? (
|
|
563
|
+
selectedItemIdList = multiple ? _toConsumableArray(value) : [value];
|
|
579
564
|
}
|
|
580
565
|
|
|
581
566
|
var _buildSelectProps = buildSelectProps(options, selectedItemIdList, searchValue, loading),
|
|
@@ -595,11 +580,11 @@ function (_React$PureComponent) {
|
|
|
595
580
|
}
|
|
596
581
|
}
|
|
597
582
|
|
|
598
|
-
var popperClass = (
|
|
583
|
+
var popperClass = classNames(classes.popper, (_classNames = {}, _defineProperty(_classNames, classes.popperWidth, !this.props.containerWidth), _defineProperty(_classNames, classes.popperRightAlign, this.props.containerWidth && this.props.align === 'right'), _classNames));
|
|
599
584
|
|
|
600
585
|
var searchInput = function searchInput(position) {
|
|
601
586
|
if (searchable) {
|
|
602
|
-
return
|
|
587
|
+
return React.createElement(HiInput, Object.assign({
|
|
603
588
|
value: searchValue,
|
|
604
589
|
autoFocus: true,
|
|
605
590
|
inputRef: _this2.getInputElement,
|
|
@@ -609,7 +594,7 @@ function (_React$PureComponent) {
|
|
|
609
594
|
placeholder: translations.search,
|
|
610
595
|
startAdornment: 'search',
|
|
611
596
|
tabIndex: 0,
|
|
612
|
-
className: (
|
|
597
|
+
className: classNames(_defineProperty({}, classes.separator, position === 'top'))
|
|
613
598
|
}, hiSearchInputProps));
|
|
614
599
|
}
|
|
615
600
|
|
|
@@ -636,20 +621,20 @@ function (_React$PureComponent) {
|
|
|
636
621
|
|
|
637
622
|
var nbItemsDisplayed = !!searchable ? maxOptionsDisplayed - 1 : maxOptionsDisplayed;
|
|
638
623
|
var autoHeightMax = nbItemsDisplayed * 40 - 10;
|
|
639
|
-
return
|
|
624
|
+
return React.createElement(ClickAwayListener, {
|
|
640
625
|
onClickAway: _this2.handleClickAway
|
|
641
|
-
},
|
|
626
|
+
}, React.createElement(Grow, {
|
|
642
627
|
in: open,
|
|
643
628
|
id: "menu-list",
|
|
644
629
|
style: {
|
|
645
630
|
transformOrigin: '0 0 0'
|
|
646
631
|
}
|
|
647
|
-
},
|
|
632
|
+
}, React.createElement(Paper, {
|
|
648
633
|
style: maxOptionsDisplayed < 12 ? {
|
|
649
634
|
maxHeight: 40 * maxOptionsDisplayed
|
|
650
635
|
} : {},
|
|
651
636
|
className: classes.paper
|
|
652
|
-
}, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment,
|
|
637
|
+
}, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, React.createElement(Scrollbars, Object.assign({
|
|
653
638
|
ref: function ref(contentEl) {
|
|
654
639
|
_this2.optionsContent = contentEl;
|
|
655
640
|
},
|
|
@@ -657,7 +642,7 @@ function (_React$PureComponent) {
|
|
|
657
642
|
autoHeightMax: autoHeightMax
|
|
658
643
|
}, onScrollReachBottom && {
|
|
659
644
|
onScroll: _this2.handleScroll
|
|
660
|
-
}),
|
|
645
|
+
}), React.createElement(HiSelectableList, Object.assign({
|
|
661
646
|
type: type,
|
|
662
647
|
itemList: itemList,
|
|
663
648
|
onSelect: _this2.handleSelect,
|
|
@@ -668,14 +653,14 @@ function (_React$PureComponent) {
|
|
|
668
653
|
}, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
|
|
669
654
|
};
|
|
670
655
|
|
|
671
|
-
return !
|
|
656
|
+
return !isMobile ? React.createElement("div", {
|
|
672
657
|
className: classes.root,
|
|
673
658
|
ref: function ref(el) {
|
|
674
659
|
_this2.overlay = el;
|
|
675
660
|
},
|
|
676
661
|
onKeyDown: this.handleKeyDown,
|
|
677
662
|
onKeyDownCapture: this.handleKeyDownCapture
|
|
678
|
-
}, alert &&
|
|
663
|
+
}, alert && React.createElement(HiAlertModal, {
|
|
679
664
|
open: alertOpen,
|
|
680
665
|
title: alert.title,
|
|
681
666
|
content: alert.content,
|
|
@@ -685,7 +670,7 @@ function (_React$PureComponent) {
|
|
|
685
670
|
onExited: this.handleExitedAlert,
|
|
686
671
|
labelSubmitButton: alert.submitButton,
|
|
687
672
|
labelCancelButton: alert.cancelButton
|
|
688
|
-
}),
|
|
673
|
+
}), React.createElement(HiSelectInput, Object.assign({
|
|
689
674
|
id: id,
|
|
690
675
|
value: inputValue,
|
|
691
676
|
open: open,
|
|
@@ -706,21 +691,21 @@ function (_React$PureComponent) {
|
|
|
706
691
|
refElement: function refElement(el) {
|
|
707
692
|
_this2.inputEl = el;
|
|
708
693
|
}
|
|
709
|
-
})), open && staticPosition ?
|
|
694
|
+
})), open && staticPosition ? React.createElement("div", {
|
|
710
695
|
style: popperStyle,
|
|
711
696
|
className: popperClass
|
|
712
|
-
}, content({})) :
|
|
697
|
+
}, content({})) : React.createElement(Popper, {
|
|
713
698
|
anchorEl: this.inputEl,
|
|
714
699
|
placement: "bottom-start",
|
|
715
700
|
open: open,
|
|
716
701
|
className: popperClass,
|
|
717
702
|
disablePortal: true,
|
|
718
703
|
style: popperStyle
|
|
719
|
-
}, content)) :
|
|
704
|
+
}, content)) : React.createElement("div", {
|
|
720
705
|
ref: function ref(el) {
|
|
721
706
|
_this2.overlay = el;
|
|
722
707
|
}
|
|
723
|
-
},
|
|
708
|
+
}, React.createElement(HiSelectInput, Object.assign({
|
|
724
709
|
id: id,
|
|
725
710
|
value: inputValue,
|
|
726
711
|
open: open,
|
|
@@ -739,7 +724,7 @@ function (_React$PureComponent) {
|
|
|
739
724
|
refElement: function refElement(el) {
|
|
740
725
|
_this2.inputEl = el;
|
|
741
726
|
}
|
|
742
|
-
})),
|
|
727
|
+
})), React.createElement(HiSelectMobile, {
|
|
743
728
|
onChange: this.handleSelect,
|
|
744
729
|
multiple: multiple,
|
|
745
730
|
id: id,
|
|
@@ -752,7 +737,7 @@ function (_React$PureComponent) {
|
|
|
752
737
|
key: "getDerivedStateFromProps",
|
|
753
738
|
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
754
739
|
if (nextProps.options !== prevState.suggestions) {
|
|
755
|
-
return (
|
|
740
|
+
return _objectSpread({}, prevState, {
|
|
756
741
|
suggestions: nextProps.options
|
|
757
742
|
});
|
|
758
743
|
}
|
|
@@ -769,10 +754,11 @@ function (_React$PureComponent) {
|
|
|
769
754
|
*/
|
|
770
755
|
|
|
771
756
|
}]);
|
|
757
|
+
|
|
772
758
|
return HiSelect;
|
|
773
|
-
}(
|
|
759
|
+
}(React.PureComponent);
|
|
774
760
|
|
|
775
|
-
(
|
|
761
|
+
_defineProperty(HiSelect, "defaultProps", {
|
|
776
762
|
align: 'left',
|
|
777
763
|
autoFocus: false,
|
|
778
764
|
disabled: false,
|
|
@@ -800,9 +786,7 @@ function (_React$PureComponent) {
|
|
|
800
786
|
maxOptionsDisplayed: 12
|
|
801
787
|
});
|
|
802
788
|
|
|
803
|
-
|
|
789
|
+
export default withStyles(styles, {
|
|
804
790
|
hiComponent: true,
|
|
805
791
|
name: 'HmuiHiSelect'
|
|
806
|
-
})(HiSelect);
|
|
807
|
-
|
|
808
|
-
exports.default = _default;
|
|
792
|
+
})(HiSelect);
|