@megafon/ui-core 9.0.0-alpha.2 → 9.0.0-alpha.21
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/dist/es/components/Accordion/Accordion.css +1 -1
- package/dist/es/components/Accordion/Accordion.d.ts +3 -1
- package/dist/es/components/Accordion/Accordion.js +3 -3
- package/dist/es/components/Avatar/Avatar.css +1 -1
- package/dist/es/components/Avatar/Avatar.d.ts +1 -1
- package/dist/es/components/Badges/CounterBadge/CounterBadge.js +1 -2
- package/dist/es/components/Badges/InfoBadge/InfoBadge.css +1 -0
- package/dist/es/components/Badges/InfoBadge/InfoBadge.d.ts +52 -0
- package/dist/es/components/Badges/InfoBadge/InfoBadge.js +226 -0
- package/dist/es/components/Badges/PriceBadge/PriceBadge.d.ts +1 -0
- package/dist/es/components/Badges/PriceBadge/PriceBadge.js +53 -13
- package/dist/es/components/Badges/PromoBadge/PromoBadge.css +1 -1
- package/dist/es/components/Badges/PromoBadge/PromoBadge.d.ts +1 -11
- package/dist/es/components/Badges/PromoBadge/PromoBadge.js +6 -16
- package/dist/es/components/Badges/StatusBadge/StatusBadge.css +1 -1
- package/dist/es/components/Badges/StatusBadge/StatusBadge.js +16 -7
- package/dist/es/components/Badges/TimerBadge/TimerBadge.d.ts +2 -0
- package/dist/es/components/Badges/TimerBadge/TimerBadge.js +6 -2
- package/dist/es/components/Buttons/Button/Button.css +1 -0
- package/dist/es/components/{Button → Buttons/Button}/Button.d.ts +5 -0
- package/dist/es/components/{Button → Buttons/Button}/Button.js +38 -12
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.css +1 -0
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.d.ts +34 -0
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.js +69 -0
- package/dist/es/components/Calendar/components/_Month/Month.js +2 -6
- package/dist/es/components/Carousel/Carousel.css +1 -1
- package/dist/es/components/Carousel/Carousel.d.ts +9 -0
- package/dist/es/components/Carousel/Carousel.js +14 -2
- package/dist/es/components/Checkbox/Checkbox.css +1 -1
- package/dist/es/components/Checkbox/Checkbox.js +3 -2
- package/dist/es/components/Chips/Chips/Chip.css +1 -1
- package/dist/es/components/Chips/Chips/Chip.d.ts +9 -1
- package/dist/es/components/Chips/Chips/Chip.js +12 -7
- package/dist/es/components/Chips/Chips/Chips.d.ts +16 -1
- package/dist/es/components/Chips/Chips/Chips.js +28 -6
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.css +1 -1
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.d.ts +12 -4
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.js +55 -47
- package/dist/es/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +10 -1
- package/dist/es/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +12 -7
- package/dist/es/components/Chips/ChipsSuggest/ChipSuggest.css +1 -1
- package/dist/es/components/Chips/ChipsSuggest/ChipSuggest.d.ts +7 -0
- package/dist/es/components/Chips/ChipsSuggest/ChipSuggest.js +7 -0
- package/dist/es/components/Chips/ChipsSuggest/ChipsSuggest.d.ts +4 -2
- package/dist/es/components/Chips/ChipsSuggest/ChipsSuggest.js +3 -0
- package/dist/es/components/ContentArea/ContentArea.css +1 -1
- package/dist/es/components/ContentArea/ContentArea.d.ts +3 -2
- package/dist/es/components/ContentArea/ContentArea.js +5 -0
- package/dist/es/components/ContentView/ContentView.css +1 -1
- package/dist/es/components/ContentView/ContentView.d.ts +15 -4
- package/dist/es/components/ContentView/ContentView.js +17 -4
- package/dist/es/components/Counter/Counter.css +1 -1
- package/dist/es/components/Counter/Counter.d.ts +2 -0
- package/dist/es/components/Counter/Counter.js +6 -3
- package/dist/es/components/Dropdown/Dropdown.css +1 -1
- package/dist/es/components/Dropdown/Dropdown.d.ts +6 -2
- package/dist/es/components/Dropdown/Dropdown.js +31 -22
- package/dist/es/components/ErrorLoad/ErrorLoad.css +1 -1
- package/dist/es/components/ErrorLoad/ErrorLoad.d.ts +1 -1
- package/dist/es/components/ErrorLoad/ErrorLoad.js +2 -4
- package/dist/es/components/Link/Link.css +1 -0
- package/dist/es/components/Link/Link.d.ts +1 -0
- package/dist/es/components/Link/Link.js +4 -2
- package/dist/es/components/ListData/ListData.css +1 -1
- package/dist/es/components/ListData/ListData.d.ts +9 -1
- package/dist/es/components/ListData/ListData.js +20 -14
- package/dist/es/components/ListData/components/ListDataSortable.css +1 -1
- package/dist/es/components/ListData/components/ListDataSortable.js +1 -3
- package/dist/es/components/Modal/Modal.css +1 -1
- package/dist/es/components/Modal/Modal.d.ts +23 -9
- package/dist/es/components/Modal/Modal.js +34 -23
- package/dist/es/components/Modal/_ModalContent/ModalContent.css +1 -1
- package/dist/es/components/Modal/_ModalContent/ModalContent.js +37 -39
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.css +1 -1
- package/dist/es/components/Modal/_ModalMobile/ModalMobile.css +1 -0
- package/dist/es/components/Modal/{_ModalMobileBottom/ModalMobileBottom.d.ts → _ModalMobile/ModalMobile.d.ts} +6 -5
- package/dist/es/components/Modal/{_ModalMobileBottom/ModalMobileBottom.js → _ModalMobile/ModalMobile.js} +35 -26
- package/dist/es/components/Modal/mocks.js +0 -1
- package/dist/es/components/Modal/types.d.ts +1 -2
- package/dist/es/components/NavArrow/NavArrow.css +1 -1
- package/dist/es/components/NavArrow/NavArrow.js +4 -4
- package/dist/es/components/Notification/Notification.css +1 -1
- package/dist/es/components/Notification/Notification.d.ts +0 -11
- package/dist/es/components/Notification/Notification.js +19 -38
- package/dist/es/components/Pagination/Pagination.css +1 -1
- package/dist/es/components/Pagination/Pagination.d.ts +1 -3
- package/dist/es/components/Pagination/Pagination.js +4 -13
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +1 -1
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +1 -2
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +0 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -1
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +1 -3
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +5 -16
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +1 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +4 -4
- package/dist/es/components/Pagination/types.d.ts +1 -11
- package/dist/es/components/Pagination/types.js +1 -4
- package/dist/es/components/Pagination/usePagination.d.ts +2 -2
- package/dist/es/components/Pagination/usePagination.js +11 -29
- package/dist/es/components/Parameter/Parameter.d.ts +0 -3
- package/dist/es/components/Parameter/Parameter.js +3 -4
- package/dist/es/components/RadioButton/RadioButton.css +1 -1
- package/dist/es/components/Row/Row.css +1 -1
- package/dist/es/components/Row/Row.js +6 -4
- package/dist/es/components/ScrollBar/ScrollBar.d.ts +2 -0
- package/dist/es/components/ScrollBar/ScrollBar.js +6 -1
- package/dist/es/components/Search/Search.css +1 -1
- package/dist/es/components/Search/Search.d.ts +2 -2
- package/dist/es/components/Search/Search.js +72 -68
- package/dist/es/components/Select/Select.css +1 -1
- package/dist/es/components/Select/Select.d.ts +11 -20
- package/dist/es/components/Select/Select.js +40 -88
- package/dist/es/components/Select/reducer/selectReducer.js +1 -1
- package/dist/es/components/Selector/Selector.css +1 -1
- package/dist/es/components/Sliders/Slider/Slider.css +1 -1
- package/dist/es/components/Sliders/Slider/Slider.d.ts +12 -0
- package/dist/es/components/Sliders/Slider/Slider.js +26 -7
- package/dist/es/components/Sliders/SliderRange/SliderRange.css +1 -1
- package/dist/es/components/Sliders/SliderRange/SliderRange.d.ts +3 -0
- package/dist/es/components/Sliders/SliderRange/SliderRange.js +4 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.css +1 -1
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.d.ts +6 -0
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.js +8 -1
- package/dist/es/components/Sliders/helpers.d.ts +1 -0
- package/dist/es/components/Sliders/helpers.js +7 -0
- package/dist/es/components/Snackbar/Snackbar.css +1 -1
- package/dist/es/components/Snackbar/Snackbar.js +20 -21
- package/dist/es/components/Stepper/Stepper.css +1 -0
- package/dist/es/components/Stepper/Stepper.d.ts +52 -0
- package/dist/es/components/Stepper/Stepper.js +159 -0
- package/dist/es/components/Stepper/StepperItem.css +1 -0
- package/dist/es/components/Stepper/StepperItem.d.ts +57 -0
- package/dist/es/components/Stepper/StepperItem.js +101 -0
- package/dist/es/components/Stepper/img/separator-mobile.png +0 -0
- package/dist/es/components/Stepper/img/separator-vertical.png +0 -0
- package/dist/es/components/Stepper/img/separator.png +0 -0
- package/dist/es/components/Switcher/Switcher.css +1 -1
- package/dist/es/components/Switcher/Switcher.d.ts +5 -0
- package/dist/es/components/Switcher/Switcher.js +22 -10
- package/dist/es/components/Tabs/Tabs.css +1 -1
- package/dist/es/components/Tabs/Tabs.d.ts +2 -0
- package/dist/es/components/Tabs/Tabs.js +64 -55
- package/dist/es/components/TextField/TextField.css +1 -1
- package/dist/es/components/TextField/TextField.d.ts +2 -2
- package/dist/es/components/TextField/TextField.js +16 -9
- package/dist/es/components/Tooltip/Tooltip.css +1 -1
- package/dist/es/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/es/components/Tooltip/Tooltip.js +22 -17
- package/dist/es/components/UploadForm/UploadField/UploadField.css +1 -1
- package/dist/es/components/UploadForm/UploadField/UploadField.d.ts +4 -1
- package/dist/es/components/UploadForm/UploadField/UploadField.js +8 -2
- package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
- package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.d.ts +3 -1
- package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.js +30 -5
- package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
- package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.d.ts +3 -1
- package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.js +9 -6
- package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/UploadFileItemIcon.js +6 -0
- package/dist/es/hooks/useResolution.js +15 -23
- package/dist/es/index.d.ts +6 -3
- package/dist/es/index.js +6 -3
- package/dist/lib/components/Accordion/Accordion.css +1 -1
- package/dist/lib/components/Accordion/Accordion.d.ts +3 -1
- package/dist/lib/components/Accordion/Accordion.js +3 -3
- package/dist/lib/components/Avatar/Avatar.css +1 -1
- package/dist/lib/components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/components/Badges/CounterBadge/CounterBadge.js +1 -2
- package/dist/lib/components/Badges/InfoBadge/InfoBadge.css +1 -0
- package/dist/lib/components/Badges/InfoBadge/InfoBadge.d.ts +52 -0
- package/dist/lib/components/Badges/InfoBadge/InfoBadge.js +235 -0
- package/dist/lib/components/Badges/PriceBadge/PriceBadge.d.ts +1 -0
- package/dist/lib/components/Badges/PriceBadge/PriceBadge.js +54 -13
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.css +1 -1
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.d.ts +1 -11
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.js +7 -17
- package/dist/lib/components/Badges/StatusBadge/StatusBadge.css +1 -1
- package/dist/lib/components/Badges/StatusBadge/StatusBadge.js +16 -7
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.d.ts +2 -0
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.js +6 -2
- package/dist/lib/components/Buttons/Button/Button.css +1 -0
- package/dist/lib/components/{Button → Buttons/Button}/Button.d.ts +5 -0
- package/dist/lib/components/{Button → Buttons/Button}/Button.js +38 -12
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.css +1 -0
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.d.ts +34 -0
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.js +78 -0
- package/dist/lib/components/Calendar/components/_Month/Month.js +2 -6
- package/dist/lib/components/Carousel/Carousel.css +1 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -0
- package/dist/lib/components/Carousel/Carousel.js +15 -3
- package/dist/lib/components/Checkbox/Checkbox.css +1 -1
- package/dist/lib/components/Checkbox/Checkbox.js +3 -2
- package/dist/lib/components/Chips/Chips/Chip.css +1 -1
- package/dist/lib/components/Chips/Chips/Chip.d.ts +9 -1
- package/dist/lib/components/Chips/Chips/Chip.js +13 -8
- package/dist/lib/components/Chips/Chips/Chips.d.ts +16 -1
- package/dist/lib/components/Chips/Chips/Chips.js +28 -6
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.css +1 -1
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.d.ts +12 -4
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.js +55 -47
- package/dist/lib/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +10 -1
- package/dist/lib/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +11 -6
- package/dist/lib/components/Chips/ChipsSuggest/ChipSuggest.css +1 -1
- package/dist/lib/components/Chips/ChipsSuggest/ChipSuggest.d.ts +7 -0
- package/dist/lib/components/Chips/ChipsSuggest/ChipSuggest.js +8 -1
- package/dist/lib/components/Chips/ChipsSuggest/ChipsSuggest.d.ts +4 -2
- package/dist/lib/components/Chips/ChipsSuggest/ChipsSuggest.js +3 -0
- package/dist/lib/components/ContentArea/ContentArea.css +1 -1
- package/dist/lib/components/ContentArea/ContentArea.d.ts +3 -2
- package/dist/lib/components/ContentArea/ContentArea.js +5 -0
- package/dist/lib/components/ContentView/ContentView.css +1 -1
- package/dist/lib/components/ContentView/ContentView.d.ts +15 -4
- package/dist/lib/components/ContentView/ContentView.js +17 -4
- package/dist/lib/components/Counter/Counter.css +1 -1
- package/dist/lib/components/Counter/Counter.d.ts +2 -0
- package/dist/lib/components/Counter/Counter.js +6 -3
- package/dist/lib/components/Dropdown/Dropdown.css +1 -1
- package/dist/lib/components/Dropdown/Dropdown.d.ts +6 -2
- package/dist/lib/components/Dropdown/Dropdown.js +31 -22
- package/dist/lib/components/ErrorLoad/ErrorLoad.css +1 -1
- package/dist/lib/components/ErrorLoad/ErrorLoad.d.ts +1 -1
- package/dist/lib/components/ErrorLoad/ErrorLoad.js +2 -4
- package/dist/lib/components/Link/Link.css +1 -0
- package/dist/lib/components/Link/Link.d.ts +1 -0
- package/dist/lib/components/Link/Link.js +2 -1
- package/dist/lib/components/ListData/ListData.css +1 -1
- package/dist/lib/components/ListData/ListData.d.ts +9 -1
- package/dist/lib/components/ListData/ListData.js +20 -14
- package/dist/lib/components/ListData/components/ListDataSortable.css +1 -1
- package/dist/lib/components/ListData/components/ListDataSortable.js +1 -3
- package/dist/lib/components/Modal/Modal.css +1 -1
- package/dist/lib/components/Modal/Modal.d.ts +23 -9
- package/dist/lib/components/Modal/Modal.js +35 -24
- package/dist/lib/components/Modal/_ModalContent/ModalContent.css +1 -1
- package/dist/lib/components/Modal/_ModalContent/ModalContent.js +37 -39
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.css +1 -1
- package/dist/lib/components/Modal/_ModalMobile/ModalMobile.css +1 -0
- package/dist/lib/components/Modal/{_ModalMobileBottom/ModalMobileBottom.d.ts → _ModalMobile/ModalMobile.d.ts} +6 -5
- package/dist/lib/components/Modal/{_ModalMobileBottom/ModalMobileBottom.js → _ModalMobile/ModalMobile.js} +34 -25
- package/dist/lib/components/Modal/mocks.js +0 -1
- package/dist/lib/components/Modal/types.d.ts +1 -2
- package/dist/lib/components/NavArrow/NavArrow.css +1 -1
- package/dist/lib/components/NavArrow/NavArrow.js +4 -4
- package/dist/lib/components/Notification/Notification.css +1 -1
- package/dist/lib/components/Notification/Notification.d.ts +0 -11
- package/dist/lib/components/Notification/Notification.js +18 -37
- package/dist/lib/components/Pagination/Pagination.css +1 -1
- package/dist/lib/components/Pagination/Pagination.d.ts +1 -3
- package/dist/lib/components/Pagination/Pagination.js +4 -13
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +1 -1
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +1 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +0 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -1
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +1 -3
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +5 -16
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +1 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +4 -4
- package/dist/lib/components/Pagination/types.d.ts +1 -11
- package/dist/lib/components/Pagination/types.js +1 -6
- package/dist/lib/components/Pagination/usePagination.d.ts +2 -2
- package/dist/lib/components/Pagination/usePagination.js +11 -29
- package/dist/lib/components/Parameter/Parameter.d.ts +0 -3
- package/dist/lib/components/Parameter/Parameter.js +3 -4
- package/dist/lib/components/RadioButton/RadioButton.css +1 -1
- package/dist/lib/components/Row/Row.css +1 -1
- package/dist/lib/components/Row/Row.js +5 -3
- package/dist/lib/components/ScrollBar/ScrollBar.d.ts +2 -0
- package/dist/lib/components/ScrollBar/ScrollBar.js +6 -1
- package/dist/lib/components/Search/Search.css +1 -1
- package/dist/lib/components/Search/Search.d.ts +2 -2
- package/dist/lib/components/Search/Search.js +72 -68
- package/dist/lib/components/Select/Select.css +1 -1
- package/dist/lib/components/Select/Select.d.ts +11 -20
- package/dist/lib/components/Select/Select.js +40 -88
- package/dist/lib/components/Select/reducer/selectReducer.js +1 -1
- package/dist/lib/components/Selector/Selector.css +1 -1
- package/dist/lib/components/Sliders/Slider/Slider.css +1 -1
- package/dist/lib/components/Sliders/Slider/Slider.d.ts +12 -0
- package/dist/lib/components/Sliders/Slider/Slider.js +25 -6
- package/dist/lib/components/Sliders/SliderRange/SliderRange.css +1 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.d.ts +3 -0
- package/dist/lib/components/Sliders/SliderRange/SliderRange.js +4 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.css +1 -1
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.d.ts +6 -0
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.js +9 -2
- package/dist/lib/components/Sliders/helpers.d.ts +1 -0
- package/dist/lib/components/Sliders/helpers.js +8 -1
- package/dist/lib/components/Snackbar/Snackbar.css +1 -1
- package/dist/lib/components/Snackbar/Snackbar.js +20 -21
- package/dist/lib/components/Stepper/Stepper.css +1 -0
- package/dist/lib/components/Stepper/Stepper.d.ts +52 -0
- package/dist/lib/components/Stepper/Stepper.js +168 -0
- package/dist/lib/components/Stepper/StepperItem.css +1 -0
- package/dist/lib/components/Stepper/StepperItem.d.ts +57 -0
- package/dist/lib/components/Stepper/StepperItem.js +110 -0
- package/dist/lib/components/Stepper/img/separator-mobile.png +0 -0
- package/dist/lib/components/Stepper/img/separator-vertical.png +0 -0
- package/dist/lib/components/Stepper/img/separator.png +0 -0
- package/dist/lib/components/Switcher/Switcher.css +1 -1
- package/dist/lib/components/Switcher/Switcher.d.ts +5 -0
- package/dist/lib/components/Switcher/Switcher.js +21 -9
- package/dist/lib/components/Tabs/Tabs.css +1 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +2 -0
- package/dist/lib/components/Tabs/Tabs.js +64 -55
- package/dist/lib/components/TextField/TextField.css +1 -1
- package/dist/lib/components/TextField/TextField.d.ts +2 -2
- package/dist/lib/components/TextField/TextField.js +16 -9
- package/dist/lib/components/Tooltip/Tooltip.css +1 -1
- package/dist/lib/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/lib/components/Tooltip/Tooltip.js +23 -18
- package/dist/lib/components/UploadForm/UploadField/UploadField.css +1 -1
- package/dist/lib/components/UploadForm/UploadField/UploadField.d.ts +4 -1
- package/dist/lib/components/UploadForm/UploadField/UploadField.js +8 -2
- package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
- package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.d.ts +3 -1
- package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.js +30 -5
- package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
- package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.d.ts +3 -1
- package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.js +9 -6
- package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/UploadFileItemIcon.js +6 -0
- package/dist/lib/hooks/useResolution.js +15 -23
- package/dist/lib/index.d.ts +6 -3
- package/dist/lib/index.js +32 -11
- package/package.json +5 -5
- package/styles/base.scss +54 -0
- package/styles/colors.css +14 -0
- package/dist/es/components/Button/Button.css +0 -1
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +0 -1
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +0 -1
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +0 -8
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +0 -56
- package/dist/lib/components/Button/Button.css +0 -1
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +0 -1
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +0 -1
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +0 -8
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +0 -65
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-notification{
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-notification{border:1px solid transparent;border-radius:24px;overflow:hidden;padding:20px 12px 20px 20px;position:relative}@media screen and (max-width:767px){.mfui-9-notification{padding:16px 12px}}.mfui-9-notification:before{border-radius:50%;content:"";-webkit-filter:blur(30px);filter:blur(30px);height:80px;left:-14px;position:absolute;top:-6px;width:80px;z-index:0}@media screen and (max-width:767px){.mfui-9-notification:after{border-radius:50%;content:"";-webkit-filter:blur(45px);filter:blur(45px);height:128px;position:absolute;right:-32px;top:45px;width:128px;z-index:0}}.mfui-9-notification__container{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-notification__title{color:var(--content);display:block;font-size:15px;font-weight:500;line-height:18px;margin-bottom:4px}@media screen and (min-width:1280px){.mfui-9-notification__title{line-height:24px}}.mfui-9-notification__title_close-padding{padding-right:20px}.mfui-9-notification__text{color:var(--content);font-size:12px;line-height:18px;margin:0;max-width:100%;position:relative;-webkit-transition:height .3s;transition:height .3s}@media screen and (min-width:768px){.mfui-9-notification__text{font-size:15px;line-height:24px}}.mfui-9-notification__short-text{opacity:1;position:static;-webkit-transition:opacity .2s;transition:opacity .2s;visibility:visible}.mfui-9-notification__full-text,.mfui-9-notification__short-text_hidden{opacity:0;position:absolute;top:0;-webkit-transition:opacity .3s,visibility .3s;transition:opacity .3s,visibility .3s;visibility:hidden}.mfui-9-notification__full-text_visible{opacity:1;position:static;-webkit-transition:opacity .2s;transition:opacity .2s;visibility:visible}.mfui-9-notification__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-item-align:center;align-self:center;margin-left:12px;overflow:hidden;width:100%}.mfui-9-notification__icon-container{display:-webkit-box;display:-ms-flexbox;display:flex;z-index:2;-ms-flex-negative:0;flex-shrink:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:start;align-self:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;border:.3px solid transparent;border-radius:12px;height:40px;justify-content:center;min-width:40px;width:40px}.mfui-9-notification__attention-icon,.mfui-9-notification__icon-container svg{height:32px;min-width:32px;width:32px}.mfui-9-notification__text-container{margin-right:56px;width:85%}@media screen and (min-width:768px){.mfui-9-notification__text-container{margin-right:72px}}.mfui-9-notification__bottom{display:-webkit-box;display:-ms-flexbox;display:flex;z-index:1;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-9-notification__bottom-block{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden}.mfui-9-notification__bottom_has-button{margin-top:12px}.mfui-9-notification__link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--brandGreen);cursor:pointer}.mfui-9-notification__button+.mfui-9-notification__link{margin-left:16px}.mfui-9-notification__collapse-button,.mfui-9-notification__link{font-family:inherit;font-size:15px;font-weight:500;line-height:18px}@media screen and (max-width:767px){.mfui-9-notification__collapse-button,.mfui-9-notification__link{font-size:12px;line-height:14px}}.mfui-9-notification__collapse-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;background-color:transparent;border:none;color:var(--brandGreen);cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0;text-align:right}@media screen and (max-width:767px){.mfui-9-notification__collapse-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center}}.mfui-9-notification__collapse-arrow,.mfui-9-notification__link-arrow{height:20px;min-width:20px;width:20px;fill:var(--brandGreen)}.mfui-9-notification__collapse-arrow_close{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.mfui-9-notification__link-arrow{margin-bottom:-2px}@media screen and (min-width:768px){.mfui-9-notification__link-arrow{margin-bottom:-4px}}.mfui-9-notification__bottom-block+.mfui-9-notification__collapse-button{margin-left:20px}@media screen and (max-width:767px){.mfui-9-notification__bottom-block+.mfui-9-notification__collapse-button{margin-left:16px}}.mfui-9-notification__collapse_hidden{visibility:hidden}.mfui-9-notification__close{position:absolute;right:1px;top:1px;z-index:100}.mfui-9-notification_type_error{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(301.79deg,hsla(0,0%,51%,.2) 72.68%,#ffacb2 98.41%) border-box}.mfui-9-notification_type_error:before{background:linear-gradient(46.7deg,#f62434 16.91%,rgba(246,36,52,0) 86.98%)}@media screen and (max-width:767px){.mfui-9-notification_type_error:after{background:linear-gradient(46.7deg,rgba(246,36,52,.17) 16.91%,hsla(0,0%,100%,.17) 86.98%)}}.mfui-9-notification_type_error .mfui-9-notification__icon-container{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(225deg,rgba(246,36,52,0) 5.8%,#f62434 48.19%) border-box}.mfui-9-notification_type_error .mfui-9-notification__icon-container svg{fill:var(--fury)}.mfui-9-notification_type_success{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(301.79deg,hsla(0,0%,51%,.2) 72.68%,rgba(62,255,110,.7) 98.41%) border-box}.mfui-9-notification_type_success:before{background:linear-gradient(46.7deg,#00b956 16.91%,rgba(0,185,86,0) 86.98%)}@media screen and (max-width:767px){.mfui-9-notification_type_success:after{background:linear-gradient(46.7deg,rgba(0,185,86,.17) 16.91%,hsla(0,0%,100%,.17) 86.98%)}}.mfui-9-notification_type_success .mfui-9-notification__icon-container{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(225deg,rgba(0,185,86,0) 5.8%,#00b956 48.19%) border-box}.mfui-9-notification_type_success .mfui-9-notification__icon-container svg{fill:var(--brandGreen)}.mfui-9-notification_type_warning{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(301.79deg,hsla(0,0%,51%,.2) 72.68%,#ffdea7 98.41%) border-box}.mfui-9-notification_type_warning:before{background:linear-gradient(46.7deg,#ffab23 16.91%,rgba(255,171,35,0) 86.98%)}@media screen and (max-width:767px){.mfui-9-notification_type_warning:after{background:linear-gradient(46.7deg,rgba(255,171,35,.17) 16.91%,hsla(0,0%,100%,.17) 86.98%)}}.mfui-9-notification_type_warning .mfui-9-notification__icon-container{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(225deg,rgba(255,171,35,0) 5.8%,#ffab23 48.19%) border-box}.mfui-9-notification_type_warning .mfui-9-notification__icon-container svg{fill:var(--137C)}.mfui-9-notification_type_info{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(301.79deg,hsla(0,0%,51%,.2) 72.68%,#a5dfff 98.41%) border-box}.mfui-9-notification_type_info:before{background:linear-gradient(46.7deg,#3cb9ff 16.91%,rgba(60,185,255,0) 86.98%)}@media screen and (max-width:767px){.mfui-9-notification_type_info:after{background:linear-gradient(46.7deg,rgba(60,185,255,.17) 16.91%,hsla(0,0%,100%,.17) 86.98%)}}.mfui-9-notification_type_info .mfui-9-notification__icon-container{background:linear-gradient(var(--base),var(--base)) padding-box,linear-gradient(225deg,rgba(60,185,255,0) 5.8%,#3cb9ff 48.19%) border-box}.mfui-9-notification_type_info .mfui-9-notification__icon-container svg{fill:var(--sky)}
|
|
@@ -7,13 +7,6 @@ declare const NotificationTypes: {
|
|
|
7
7
|
readonly INFO: "info";
|
|
8
8
|
};
|
|
9
9
|
type NotificationType = (typeof NotificationTypes)[keyof typeof NotificationTypes];
|
|
10
|
-
declare const ShadowTypes: {
|
|
11
|
-
readonly ZERO: "zero";
|
|
12
|
-
readonly HOVER: "hover";
|
|
13
|
-
readonly PRESSED: "pressed";
|
|
14
|
-
readonly DEFAULT: "default";
|
|
15
|
-
};
|
|
16
|
-
type ShadowType = (typeof ShadowTypes)[keyof typeof ShadowTypes];
|
|
17
10
|
export interface INotificationProps {
|
|
18
11
|
/** Дополнительный класс корневого элемента */
|
|
19
12
|
className?: string;
|
|
@@ -26,10 +19,6 @@ export interface INotificationProps {
|
|
|
26
19
|
};
|
|
27
20
|
/** Тип отображения */
|
|
28
21
|
type?: NotificationType;
|
|
29
|
-
/** Уровень тени */
|
|
30
|
-
shadowLevel?: ShadowType;
|
|
31
|
-
/** Наличие фоновой заливки у уведомления */
|
|
32
|
-
isColored?: boolean;
|
|
33
22
|
/** Наличие кнопки-крестика "Закрыть" */
|
|
34
23
|
hasCloseButton?: boolean;
|
|
35
24
|
/** Заголовок */
|
|
@@ -3,8 +3,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "core-js/modules/es.string.link.js";
|
|
4
4
|
import "core-js/modules/web.timers.js";
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { cnCreate, filterDataAttrs,
|
|
7
|
-
import Button from "../Button/Button";
|
|
6
|
+
import { cnCreate, convert, filterDataAttrs, textConvertConfig, titleConvertConfig } from '@megafon/ui-helpers';
|
|
7
|
+
import Button from "../Buttons/Button/Button";
|
|
8
|
+
import ButtonClose from "../Buttons/ButtonClose/ButtonClose";
|
|
8
9
|
import TextLink from "../TextLink/TextLink";
|
|
9
10
|
import Tile from "../Tile/Tile";
|
|
10
11
|
import "./Notification.css";
|
|
@@ -12,55 +13,50 @@ var ErrorIcon = function ErrorIcon(props) {
|
|
|
12
13
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
14
|
viewBox: "0 0 32 32"
|
|
14
15
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
15
|
-
|
|
16
|
+
fillRule: "evenodd",
|
|
17
|
+
clipRule: "evenodd",
|
|
18
|
+
d: "M23.5 13.008a1.5 1.5 0 011.5 1.5v7.513a6 6 0 01-6 6h-6a6 6 0 01-6-6v-7.513a1.5 1.5 0 011.5-1.5h15zm-7.501 4.398a1.501 1.501 0 00-.702 2.825v2.493a.751.751 0 001.5 0v-2.55a1.498 1.498 0 00-.798-2.768z"
|
|
16
19
|
}), /*#__PURE__*/React.createElement("path", {
|
|
17
|
-
d: "M16
|
|
20
|
+
d: "M16 4.022a5.25 5.25 0 015.25 5.25v2.255h-1.5V9.272a3.75 3.75 0 00-7.5 0v2.255h-1.5V9.272A5.25 5.25 0 0116 4.022z"
|
|
18
21
|
}));
|
|
19
22
|
};
|
|
20
23
|
var ArrowDown = function ArrowDown(props) {
|
|
21
24
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
22
25
|
viewBox: "0 0 20 20"
|
|
23
26
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
24
|
-
d: "
|
|
25
|
-
fillRule: "evenodd",
|
|
26
|
-
clipRule: "evenodd"
|
|
27
|
+
d: "M10.465 11.798a.609.609 0 01-.907 0L7.187 9.25c-.41-.44-.1-1.25.476-1.25h4.679c.575 0 .879.811.47 1.25l-2.347 2.548z"
|
|
27
28
|
}));
|
|
28
29
|
};
|
|
29
30
|
var RightArrow = function RightArrow(props) {
|
|
30
31
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
31
32
|
viewBox: "0 0 20 20"
|
|
32
33
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
33
|
-
d: "
|
|
34
|
+
d: "M10.084 5.282a1 1 0 011.414.022l3.61 3.726c.522.54.523 1.4 0 1.94l-3.61 3.726a1 1 0 01-1.436-1.392l2.225-2.297H5.5a1 1 0 010-2h6.8l-2.239-2.31a1 1 0 01.023-1.415z"
|
|
34
35
|
}));
|
|
35
36
|
};
|
|
36
37
|
var WarningIcon = function WarningIcon(props) {
|
|
37
38
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
38
39
|
viewBox: "0 0 32 32"
|
|
39
40
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
40
|
-
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M13.373 6.516c1.128-2.018 4.041-2.023 5.176-.008l9.067 16.094C28.725 24.571 27.296 27 25.03 27H6.97c-2.263 0-3.691-2.42-2.591-4.389l8.994-16.095zM16 21.163c-.829 0-1.5.657-1.5 1.467s.671 1.466 1.5 1.466c.828 0 1.5-.656 1.5-1.466 0-.81-.672-1.467-1.5-1.467zm0-10.3a1.5 1.5 0 00-1.5 1.5v5.867a1.5 1.5 0 003 0v-5.867a1.5 1.5 0 00-1.5-1.5z"
|
|
41
44
|
}));
|
|
42
45
|
};
|
|
43
46
|
var SuccessIcon = function SuccessIcon(props) {
|
|
44
47
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
45
48
|
viewBox: "0 0 32 32"
|
|
46
49
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
47
|
-
d: "
|
|
50
|
+
d: "M11.033 15.1l3.39 3.39 6.817-6.742c.578-.572 1.483-.595 2.02-.051.538.544.504 1.449-.075 2.021l-7.858 7.773c-.576.57-1.476.595-2.015.056L8.95 17.185c-.54-.541-.512-1.446.063-2.021.576-.576 1.48-.604 2.021-.063z"
|
|
48
51
|
}));
|
|
49
52
|
};
|
|
50
53
|
var InfoIcon = function InfoIcon(props) {
|
|
51
54
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
52
55
|
viewBox: "0 0 32 32"
|
|
53
|
-
}, props), /*#__PURE__*/React.createElement("path", {
|
|
54
|
-
d: "M15 12h2v-2h-2v2zm0 10h2v-8h-2v8zm1 6C9.4 28 4 22.6 4 16S9.4 4 16 4s12 5.4 12 12-5.4 12-12 12zm0-22C10.5 6 6 10.5 6 16s4.5 10 10 10 10-4.5 10-10S21.5 6 16 6z"
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
var CancelIcon = function CancelIcon(props) {
|
|
58
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
59
|
-
viewBox: "0 0 10 10"
|
|
60
56
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
61
57
|
fillRule: "evenodd",
|
|
62
58
|
clipRule: "evenodd",
|
|
63
|
-
d: "
|
|
59
|
+
d: "M16 4c6.627 0 12 5.373 12 12s-5.373 12-12 12S4 22.627 4 16 9.373 4 16 4zm0 9.25c-.78 0-1.412.633-1.412 1.412v7.059a1.412 1.412 0 102.824 0v-7.059c0-.78-.632-1.412-1.412-1.412zm-.144-4.477a1.412 1.412 0 100 2.824 1.412 1.412 0 000-2.824z"
|
|
64
60
|
}));
|
|
65
61
|
};
|
|
66
62
|
var TIMEOUT_DELAY = 400;
|
|
@@ -73,12 +69,6 @@ var NotificationTypes = {
|
|
|
73
69
|
ERROR: 'error',
|
|
74
70
|
INFO: 'info'
|
|
75
71
|
};
|
|
76
|
-
var ShadowTypes = {
|
|
77
|
-
ZERO: 'zero',
|
|
78
|
-
HOVER: 'hover',
|
|
79
|
-
PRESSED: 'pressed',
|
|
80
|
-
DEFAULT: 'default'
|
|
81
|
-
};
|
|
82
72
|
export var testIdPrefix = 'Notification';
|
|
83
73
|
var cn = cnCreate('mfui-9-notification');
|
|
84
74
|
var Notification = function Notification(_ref) {
|
|
@@ -92,10 +82,6 @@ var Notification = function Notification(_ref) {
|
|
|
92
82
|
children = _ref.children,
|
|
93
83
|
_ref$type = _ref.type,
|
|
94
84
|
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
95
|
-
_ref$shadowLevel = _ref.shadowLevel,
|
|
96
|
-
shadowLevel = _ref$shadowLevel === void 0 ? 'zero' : _ref$shadowLevel,
|
|
97
|
-
_ref$isColored = _ref.isColored,
|
|
98
|
-
isColored = _ref$isColored === void 0 ? true : _ref$isColored,
|
|
99
85
|
hasCloseButton = _ref.hasCloseButton,
|
|
100
86
|
title = _ref.title,
|
|
101
87
|
shortText = _ref.shortText,
|
|
@@ -145,7 +131,6 @@ var Notification = function Notification(_ref) {
|
|
|
145
131
|
textClasses = _useState6[0],
|
|
146
132
|
setTextClass = _useState6[1];
|
|
147
133
|
var hasBottom = shortText || buttonText || link;
|
|
148
|
-
var isErrorType = type === NotificationTypes.ERROR;
|
|
149
134
|
useEffect(function () {
|
|
150
135
|
setShowFullText(isCollapseOpened);
|
|
151
136
|
}, [isCollapseOpened]);
|
|
@@ -193,7 +178,7 @@ var Notification = function Notification(_ref) {
|
|
|
193
178
|
},
|
|
194
179
|
className: cn('link', [linkClass]),
|
|
195
180
|
onClick: onLinkClick,
|
|
196
|
-
color:
|
|
181
|
+
color: "green",
|
|
197
182
|
rel: rel,
|
|
198
183
|
href: href,
|
|
199
184
|
target: target
|
|
@@ -209,7 +194,7 @@ var Notification = function Notification(_ref) {
|
|
|
209
194
|
},
|
|
210
195
|
sizeAll: "small",
|
|
211
196
|
sizeMobile: "extra-small",
|
|
212
|
-
theme:
|
|
197
|
+
theme: "green",
|
|
213
198
|
showLoader: buttonLoader,
|
|
214
199
|
disabled: buttonDisable,
|
|
215
200
|
ellipsis: !buttonLoader,
|
|
@@ -247,11 +232,10 @@ var Notification = function Notification(_ref) {
|
|
|
247
232
|
};
|
|
248
233
|
return /*#__PURE__*/React.createElement(Tile, {
|
|
249
234
|
className: cn({
|
|
250
|
-
type: type
|
|
251
|
-
colored: isColored
|
|
235
|
+
type: type
|
|
252
236
|
}, [className, rootClass]),
|
|
253
237
|
radius: "rounded",
|
|
254
|
-
|
|
238
|
+
radiusSize: "xl",
|
|
255
239
|
dataAttrs: {
|
|
256
240
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
|
|
257
241
|
}
|
|
@@ -287,12 +271,9 @@ var Notification = function Notification(_ref) {
|
|
|
287
271
|
})
|
|
288
272
|
}, (buttonText || link) && /*#__PURE__*/React.createElement("div", {
|
|
289
273
|
className: cn('bottom-block')
|
|
290
|
-
}, buttonText && renderButton(), link && !shortText && renderLink()), shortText && renderCollapseButton()))), hasCloseButton && /*#__PURE__*/React.createElement(
|
|
274
|
+
}, buttonText && renderButton(), link && !shortText && renderLink()), shortText && renderCollapseButton()))), hasCloseButton && /*#__PURE__*/React.createElement(ButtonClose, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
|
|
291
275
|
className: cn('close'),
|
|
292
|
-
type: "button",
|
|
293
276
|
onClick: onClose
|
|
294
|
-
}), /*#__PURE__*/React.createElement(CancelIcon, {
|
|
295
|
-
className: cn('close-icon')
|
|
296
277
|
})));
|
|
297
278
|
};
|
|
298
279
|
export default Notification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:12px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media screen and (max-width:767px){.mfui-9-pagination{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:16px}}.mfui-9-pagination__input,.mfui-9-pagination__wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-pagination__input{gap:8px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-pagination__input-caption{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.mfui-9-pagination__input-field{width:90px}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:12px;position:relative;-webkit-box-align:center;-ms-flex-align:center;align-items:center}@media screen and (max-width:767px){.mfui-9-pagination{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:16px}}.mfui-9-pagination__input,.mfui-9-pagination__wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-pagination__input{gap:8px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-pagination__input-caption{min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.mfui-9-pagination__input-field{width:90px}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeType, ValueType } from './types';
|
|
3
3
|
import './Pagination.scss';
|
|
4
4
|
interface IPaginationProps {
|
|
5
5
|
/** Общее количество страниц */
|
|
6
6
|
totalPages: number;
|
|
7
7
|
/** Номер текущей страницы */
|
|
8
8
|
activePage: number;
|
|
9
|
-
/** Тип компонента. DEPRECATED: 'classic' */
|
|
10
|
-
type?: PaginationTypesType;
|
|
11
9
|
/** Цветовая тема компонента */
|
|
12
10
|
theme?: ThemeType;
|
|
13
11
|
/** Отобразить поле ввода номера страницы */
|
|
@@ -7,22 +7,19 @@ import ValueField from "../ValueField/ValueField";
|
|
|
7
7
|
import PaginationButtons from "./components/PaginationButtons/PaginationButtons";
|
|
8
8
|
import PaginationNavigation, { HINTS } from "./components/PaginationNavigation/PaginationNavigation";
|
|
9
9
|
import { getInputRangeValue, removeFirstZeros, setValueFieldTheme } from "./helpers";
|
|
10
|
-
import { PaginationTypes } from "./types";
|
|
11
10
|
import usePagination, { BUTTONS } from "./usePagination";
|
|
12
11
|
import "./Pagination.css";
|
|
13
12
|
var cn = cnCreate('mfui-9-pagination');
|
|
14
13
|
var Pagination = function Pagination(_ref) {
|
|
15
14
|
var totalPages = _ref.totalPages,
|
|
16
15
|
activePage = _ref.activePage,
|
|
17
|
-
_ref$type = _ref.type,
|
|
18
|
-
type = _ref$type === void 0 ? PaginationTypes.CLASSIC : _ref$type,
|
|
19
16
|
_ref$theme = _ref.theme,
|
|
20
17
|
theme = _ref$theme === void 0 ? 'default' : _ref$theme,
|
|
21
18
|
showSelectPage = _ref.showSelectPage,
|
|
22
19
|
onChange = _ref.onChange,
|
|
23
20
|
className = _ref.className,
|
|
24
21
|
dataAttrs = _ref.dataAttrs;
|
|
25
|
-
var _usePagination = usePagination(
|
|
22
|
+
var _usePagination = usePagination(totalPages, activePage),
|
|
26
23
|
paginationItems = _usePagination.paginationItems,
|
|
27
24
|
skipPrevPage = _usePagination.skipPrevPage,
|
|
28
25
|
skipNextPage = _usePagination.skipNextPage;
|
|
@@ -31,8 +28,6 @@ var Pagination = function Pagination(_ref) {
|
|
|
31
28
|
inputValue = _React$useState2[0],
|
|
32
29
|
setInputValue = _React$useState2[1];
|
|
33
30
|
var inputRef = React.useRef(null);
|
|
34
|
-
var isModernType = type === PaginationTypes.MODERN;
|
|
35
|
-
var buttonForm = isModernType ? 'brick' : 'round';
|
|
36
31
|
var handleBackClick = React.useCallback(function () {
|
|
37
32
|
onChange(activePage - 1);
|
|
38
33
|
}, [activePage, onChange]);
|
|
@@ -74,9 +69,8 @@ var Pagination = function Pagination(_ref) {
|
|
|
74
69
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
|
|
75
70
|
},
|
|
76
71
|
direction: "left",
|
|
77
|
-
form: buttonForm,
|
|
78
72
|
disabled: activePage === BUTTONS.FIRST,
|
|
79
|
-
hint:
|
|
73
|
+
hint: HINTS.PREV,
|
|
80
74
|
theme: theme,
|
|
81
75
|
onClick: handleBackClick
|
|
82
76
|
}), /*#__PURE__*/React.createElement(PaginationButtons, {
|
|
@@ -89,9 +83,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
89
83
|
activeButton: activePage,
|
|
90
84
|
skipButtonPrev: BUTTONS.SKIP_PREV,
|
|
91
85
|
skipButtonNext: BUTTONS.SKIP_NEXT,
|
|
92
|
-
|
|
93
|
-
form: buttonForm,
|
|
94
|
-
showHints: isModernType,
|
|
86
|
+
showHints: true,
|
|
95
87
|
theme: theme,
|
|
96
88
|
onClick: handlePageButtonClick
|
|
97
89
|
}), /*#__PURE__*/React.createElement(PaginationNavigation, {
|
|
@@ -100,9 +92,8 @@ var Pagination = function Pagination(_ref) {
|
|
|
100
92
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
|
|
101
93
|
},
|
|
102
94
|
direction: "right",
|
|
103
|
-
form: buttonForm,
|
|
104
95
|
disabled: activePage === totalPages,
|
|
105
|
-
hint:
|
|
96
|
+
hint: HINTS.NEXT,
|
|
106
97
|
theme: theme,
|
|
107
98
|
onClick: handleNextClick
|
|
108
99
|
})), showSelectPage && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination-button{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;font-weight:500;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;border:1px solid transparent;border-radius:
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination-button{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;font-weight:500;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:1px solid transparent;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;height:32px;justify-content:center;padding:0;width:32px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mfui-9-pagination-button:focus-visible{-webkit-animation:focus-outline-shrink .3s linear forwards;animation:focus-outline-shrink .3s linear forwards;outline-offset:2px}@-webkit-keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}@keyframes focus-outline-shrink{0%{outline:0 solid var(--137C)}to{outline:4px solid var(--137C)}}.mfui-9-pagination-button:focus{outline:none}.mfui-9-pagination-button svg{width:100%}.mfui-9-pagination-button:disabled{pointer-events:none}.mfui-9-pagination-button_auto-width{min-width:32px;padding:0 8px;width:auto}.mfui-9-pagination-button_active{border-color:var(--brandGreen);pointer-events:none}.mfui-9-pagination-button_theme_default{color:var(--content)}.mfui-9-pagination-button_theme_default svg{fill:var(--content)}.mfui-9-pagination-button_theme_default:hover{background-color:var(--spbSky0)}.mfui-9-pagination-button_theme_default.mfui-9-pagination-button_active{border-color:var(--brandGreen);color:var(--brandGreen)}.mfui-9-pagination-button_theme_light{color:var(--stcWhite)}.mfui-9-pagination-button_theme_light svg{fill:var(--stcWhite)}.mfui-9-pagination-button_theme_light:hover{background-color:var(--stcWhite20)}.mfui-9-pagination-button_theme_light.mfui-9-pagination-button_active{border-color:var(--stcWhite)}.mfui-9-pagination-button_theme_gray{color:var(--content)}.mfui-9-pagination-button_theme_gray svg{fill:var(--content)}.mfui-9-pagination-button_theme_gray:hover{background-color:var(--base)}.mfui-9-pagination-button_theme_gray.mfui-9-pagination-button_active{border-color:var(--brandGreen);color:var(--brandGreen)}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ValueType, ThemeType
|
|
2
|
+
import { ValueType, ThemeType } from '../../types';
|
|
3
3
|
import './PaginationButton.scss';
|
|
4
4
|
export interface IPaginationButtonProps {
|
|
5
5
|
theme?: ThemeType;
|
|
6
|
-
form?: ButtonFormType;
|
|
7
6
|
value?: ValueType;
|
|
8
7
|
disabled?: boolean;
|
|
9
8
|
isActive?: boolean;
|
|
@@ -10,7 +10,6 @@ var PaginationButton = function PaginationButton(_ref) {
|
|
|
10
10
|
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
11
11
|
_ref$theme = _ref.theme,
|
|
12
12
|
theme = _ref$theme === void 0 ? 'default' : _ref$theme,
|
|
13
|
-
form = _ref.form,
|
|
14
13
|
autoWidth = _ref.autoWidth,
|
|
15
14
|
className = _ref.className,
|
|
16
15
|
children = _ref.children,
|
|
@@ -27,7 +26,6 @@ var PaginationButton = function PaginationButton(_ref) {
|
|
|
27
26
|
className: cn({
|
|
28
27
|
active: isActive,
|
|
29
28
|
theme: theme,
|
|
30
|
-
form: form,
|
|
31
29
|
'auto-width': autoWidth
|
|
32
30
|
}, className),
|
|
33
31
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination-buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-pagination-buttons__button{-ms-flex-negative:0;flex-shrink:0;margin:0
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-pagination-buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-pagination-buttons__button{-ms-flex-negative:0;flex-shrink:0;margin:0 2px}@media screen and (max-width:767px){.mfui-9-pagination-buttons__button{margin:0}}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ValueType, ThemeType
|
|
2
|
+
import { ValueType, ThemeType } from '../../types';
|
|
3
3
|
import './PaginationButtons.scss';
|
|
4
4
|
export interface IPaginationButtonsProps {
|
|
5
5
|
items: Array<string | number>;
|
|
6
|
-
type: PaginationTypesType;
|
|
7
|
-
form: ButtonFormType;
|
|
8
6
|
theme: ThemeType;
|
|
9
7
|
showHints: boolean;
|
|
10
8
|
activeButton: number;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import "core-js/modules/es.array.map.js";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
4
|
-
import { PaginationTypes } from "../../types";
|
|
5
4
|
import PaginationButton from "../PaginationButton/PaginationButton";
|
|
6
5
|
import PaginationNavigation, { HINTS } from "../PaginationNavigation/PaginationNavigation";
|
|
7
6
|
import "./PaginationButtons.css";
|
|
8
7
|
var cn = cnCreate('mfui-9-pagination-buttons');
|
|
9
8
|
var PaginationButtons = function PaginationButtons(_ref) {
|
|
10
9
|
var items = _ref.items,
|
|
11
|
-
type = _ref.type,
|
|
12
10
|
theme = _ref.theme,
|
|
13
|
-
form = _ref.form,
|
|
14
11
|
showHints = _ref.showHints,
|
|
15
12
|
onClick = _ref.onClick,
|
|
16
13
|
activeButton = _ref.activeButton,
|
|
17
14
|
skipButtonPrev = _ref.skipButtonPrev,
|
|
18
15
|
skipButtonNext = _ref.skipButtonNext,
|
|
19
16
|
dataAttrs = _ref.dataAttrs;
|
|
20
|
-
var isModernType = type === PaginationTypes.MODERN;
|
|
21
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
22
18
|
className: cn()
|
|
23
19
|
}, items.map(function (pageNumber, index) {
|
|
@@ -28,14 +24,10 @@ var PaginationButtons = function PaginationButtons(_ref) {
|
|
|
28
24
|
var hint = isSkipButtonNext ? HINTS.SKIP_NEXT : HINTS.SKIP_PREV;
|
|
29
25
|
return /*#__PURE__*/React.createElement(PaginationNavigation, {
|
|
30
26
|
key: index,
|
|
31
|
-
className: cn('button',
|
|
32
|
-
form: form
|
|
33
|
-
}),
|
|
27
|
+
className: cn('button'),
|
|
34
28
|
theme: theme,
|
|
35
|
-
form: form,
|
|
36
29
|
value: pageNumber,
|
|
37
30
|
variant: "skip",
|
|
38
|
-
disabled: !isModernType,
|
|
39
31
|
direction: isSkipButtonNext ? 'right' : 'left',
|
|
40
32
|
hint: showHints ? hint : null,
|
|
41
33
|
onClick: onClick,
|
|
@@ -46,21 +38,18 @@ var PaginationButtons = function PaginationButtons(_ref) {
|
|
|
46
38
|
}
|
|
47
39
|
var isActive = pageNumber === activeButton;
|
|
48
40
|
var digitCount = String(pageNumber).length;
|
|
49
|
-
var pageNumberStyle =
|
|
41
|
+
var pageNumberStyle = {
|
|
50
42
|
width: 10 * digitCount
|
|
51
|
-
}
|
|
43
|
+
};
|
|
52
44
|
return /*#__PURE__*/React.createElement(PaginationButton, {
|
|
53
45
|
key: index,
|
|
54
|
-
className: cn('button',
|
|
55
|
-
form: form
|
|
56
|
-
}),
|
|
46
|
+
className: cn('button'),
|
|
57
47
|
dataAttrs: {
|
|
58
48
|
root: filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button, dataIndex)
|
|
59
49
|
},
|
|
60
50
|
theme: theme,
|
|
61
|
-
form: form,
|
|
62
51
|
value: pageNumber,
|
|
63
|
-
autoWidth:
|
|
52
|
+
autoWidth: true,
|
|
64
53
|
isActive: isActive,
|
|
65
54
|
onClick: onClick
|
|
66
55
|
}, /*#__PURE__*/React.createElement("div", {
|
package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeType, ValueType } from '../../types';
|
|
3
3
|
import './PaginationNavigation.scss';
|
|
4
4
|
export declare const HINTS: {
|
|
5
5
|
PREV: string;
|
|
@@ -9,7 +9,6 @@ export declare const HINTS: {
|
|
|
9
9
|
};
|
|
10
10
|
interface IPaginationNavigationProps {
|
|
11
11
|
theme?: ThemeType;
|
|
12
|
-
form?: ButtonFormType;
|
|
13
12
|
direction?: 'left' | 'right';
|
|
14
13
|
variant?: 'default' | 'skip';
|
|
15
14
|
disabled?: boolean;
|
package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js
CHANGED
|
@@ -10,14 +10,16 @@ var NothingIcon = function NothingIcon(props) {
|
|
|
10
10
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
11
11
|
viewBox: "0 0 20 20"
|
|
12
12
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
13
|
-
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
clipRule: "evenodd",
|
|
15
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM6 11a1 1 0 100-2 1 1 0 000 2zm4 0a1 1 0 100-2 1 1 0 000 2zm4 0a1 1 0 100-2 1 1 0 000 2z"
|
|
14
16
|
}));
|
|
15
17
|
};
|
|
16
18
|
var ArrowRightIcon = function ArrowRightIcon(props) {
|
|
17
19
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
18
20
|
viewBox: "0 0 32 32"
|
|
19
21
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
20
|
-
d: "
|
|
22
|
+
d: "M16.326 9.118a1.25 1.25 0 011.768-.004l5.618 5.592a1.825 1.825 0 010 2.588l-5.618 5.592a1.25 1.25 0 01-1.764-1.772l3.871-3.853H9a1.25 1.25 0 010-2.5h11.223l-3.893-3.875a1.25 1.25 0 01-.004-1.768z"
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
23
25
|
var ArrowsRightIcon = function ArrowsRightIcon(props) {
|
|
@@ -41,7 +43,6 @@ var PaginationNavigation = function PaginationNavigation(_ref) {
|
|
|
41
43
|
_ref$direction = _ref.direction,
|
|
42
44
|
direction = _ref$direction === void 0 ? 'right' : _ref$direction,
|
|
43
45
|
theme = _ref.theme,
|
|
44
|
-
form = _ref.form,
|
|
45
46
|
disabled = _ref.disabled,
|
|
46
47
|
value = _ref.value,
|
|
47
48
|
hint = _ref.hint,
|
|
@@ -110,7 +111,6 @@ var PaginationNavigation = function PaginationNavigation(_ref) {
|
|
|
110
111
|
dataAttrs: dataAttrs,
|
|
111
112
|
disabled: disabled,
|
|
112
113
|
theme: theme,
|
|
113
|
-
form: form,
|
|
114
114
|
onClick: handleClick,
|
|
115
115
|
onMouseEnter: hasHint ? handleMouseEnter : undefined,
|
|
116
116
|
onMouseLeave: hasHint ? handleMouseLeave : undefined,
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
export declare const PaginationTypes: {
|
|
2
|
-
readonly CLASSIC: "classic";
|
|
3
|
-
readonly MODERN: "modern";
|
|
4
|
-
};
|
|
5
|
-
export type PaginationTypesType = (typeof PaginationTypes)[keyof typeof PaginationTypes];
|
|
6
|
-
export type ButtonFormType = 'brick' | 'round';
|
|
7
1
|
export type ValueType = string | number;
|
|
8
2
|
export type ThemeType = 'default' | 'light' | 'gray';
|
|
9
|
-
type SettingsType = {
|
|
3
|
+
export type SettingsType = {
|
|
10
4
|
neighbourCount: {
|
|
11
5
|
main: number;
|
|
12
6
|
mobile: number;
|
|
@@ -19,7 +13,3 @@ type SettingsType = {
|
|
|
19
13
|
};
|
|
20
14
|
skipStep: number;
|
|
21
15
|
};
|
|
22
|
-
export type SettingsMapType = {
|
|
23
|
-
[key in PaginationTypesType]: SettingsType;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ValueType } from './types';
|
|
2
2
|
export declare const BUTTONS: {
|
|
3
3
|
SKIP_PREV: string;
|
|
4
4
|
SKIP_NEXT: string;
|
|
@@ -9,5 +9,5 @@ type usePaginationReturnType = {
|
|
|
9
9
|
skipPrevPage: number;
|
|
10
10
|
skipNextPage: number;
|
|
11
11
|
};
|
|
12
|
-
declare const usePagination: (
|
|
12
|
+
declare const usePagination: (totalPages: number, activePage: number) => usePaginationReturnType;
|
|
13
13
|
export default usePagination;
|
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import "core-js/modules/es.array.concat.js";
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import useResolution from "../../hooks/useResolution";
|
|
7
6
|
import { getRange } from "./helpers";
|
|
8
|
-
import { PaginationTypes } from "./types";
|
|
9
7
|
export var BUTTONS = {
|
|
10
8
|
SKIP_PREV: 'SKIP_PREV',
|
|
11
9
|
SKIP_NEXT: 'SKIP_NEXT',
|
|
12
10
|
FIRST: 1
|
|
13
11
|
};
|
|
14
|
-
var PAGINATION_SETTINGS =
|
|
15
|
-
neighbourCount: {
|
|
16
|
-
main: 1,
|
|
17
|
-
mobile: 1,
|
|
18
|
-
mobileXS: 0
|
|
19
|
-
},
|
|
20
|
-
visibleNumbers: {
|
|
21
|
-
main: 7,
|
|
22
|
-
mobile: 7,
|
|
23
|
-
mobileXS: 5
|
|
24
|
-
},
|
|
25
|
-
skipStep: 0
|
|
26
|
-
}), PaginationTypes.MODERN, {
|
|
12
|
+
var PAGINATION_SETTINGS = {
|
|
27
13
|
neighbourCount: {
|
|
28
14
|
main: 3,
|
|
29
15
|
mobile: 2,
|
|
@@ -35,37 +21,34 @@ var PAGINATION_SETTINGS = _defineProperty(_defineProperty({}, PaginationTypes.CL
|
|
|
35
21
|
mobileXS: 4
|
|
36
22
|
},
|
|
37
23
|
skipStep: 4
|
|
38
|
-
}
|
|
24
|
+
};
|
|
39
25
|
var getItems = function getItems(_ref) {
|
|
40
|
-
var
|
|
41
|
-
totalPages = _ref.totalPages,
|
|
26
|
+
var totalPages = _ref.totalPages,
|
|
42
27
|
activePage = _ref.activePage,
|
|
43
28
|
buttonsCount = _ref.buttonsCount,
|
|
44
29
|
neighbourCount = _ref.neighbourCount;
|
|
45
|
-
var isClassicType = type === PaginationTypes.CLASSIC;
|
|
46
30
|
var isMoreThenButtonsCount = totalPages > buttonsCount;
|
|
47
31
|
var lastPage = totalPages;
|
|
48
32
|
if (!isMoreThenButtonsCount) {
|
|
49
33
|
return getRange(BUTTONS.FIRST, lastPage);
|
|
50
34
|
}
|
|
51
35
|
var hasLeftHiddenButtons = activePage > Math.ceil(buttonsCount / 2);
|
|
52
|
-
var hasRightHiddenButtons =
|
|
36
|
+
var hasRightHiddenButtons = lastPage > activePage + neighbourCount;
|
|
53
37
|
if (!hasLeftHiddenButtons && hasRightHiddenButtons) {
|
|
54
38
|
var _range = getRange(BUTTONS.FIRST, buttonsCount - 2);
|
|
55
39
|
return [].concat(_toConsumableArray(_range), [BUTTONS.SKIP_NEXT, lastPage]);
|
|
56
40
|
}
|
|
57
41
|
if (hasLeftHiddenButtons && !hasRightHiddenButtons) {
|
|
58
|
-
var _range2 =
|
|
42
|
+
var _range2 = getRange(totalPages - neighbourCount, totalPages);
|
|
59
43
|
return [BUTTONS.FIRST, BUTTONS.SKIP_PREV].concat(_toConsumableArray(_range2));
|
|
60
44
|
}
|
|
61
|
-
var range =
|
|
45
|
+
var range = getRange(activePage, activePage + neighbourCount);
|
|
62
46
|
return [BUTTONS.FIRST, BUTTONS.SKIP_PREV].concat(_toConsumableArray(range), [BUTTONS.SKIP_NEXT, lastPage]);
|
|
63
47
|
};
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
skipStep = _PAGINATION_SETTINGS$.skipStep;
|
|
48
|
+
var neighbourCount = PAGINATION_SETTINGS.neighbourCount,
|
|
49
|
+
visibleNumbers = PAGINATION_SETTINGS.visibleNumbers,
|
|
50
|
+
skipStep = PAGINATION_SETTINGS.skipStep;
|
|
51
|
+
var usePagination = function usePagination(totalPages, activePage) {
|
|
69
52
|
var _useResolution = useResolution(),
|
|
70
53
|
isMobileExtraSmall = _useResolution.isMobileExtraSmall,
|
|
71
54
|
isMobile = _useResolution.isMobile;
|
|
@@ -77,7 +60,6 @@ var usePagination = function usePagination(type, totalPages, activePage) {
|
|
|
77
60
|
config = _React$useState2[0],
|
|
78
61
|
setConfig = _React$useState2[1];
|
|
79
62
|
var paginationItems = getItems({
|
|
80
|
-
type: type,
|
|
81
63
|
totalPages: totalPages,
|
|
82
64
|
activePage: activePage,
|
|
83
65
|
neighbourCount: config.neighbourCount,
|
|
@@ -97,7 +79,7 @@ var usePagination = function usePagination(type, totalPages, activePage) {
|
|
|
97
79
|
neighbourCount: isMobile ? neighbourCount.mobile : neighbourCount.main,
|
|
98
80
|
buttonsCount: isMobile ? visibleNumbers.mobile : visibleNumbers.main
|
|
99
81
|
});
|
|
100
|
-
}, [isMobile, isMobileExtraSmall
|
|
82
|
+
}, [isMobile, isMobileExtraSmall]);
|
|
101
83
|
return {
|
|
102
84
|
paginationItems: paginationItems,
|
|
103
85
|
skipPrevPage: skipPrevPage,
|