@megafon/ui-core 6.2.1 → 7.0.0
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/colors/ColorItem/ColorItem.css +1 -45
- package/dist/es/colors/ColorItem/ColorItem.d.ts +2 -2
- package/dist/es/colors/ColorItem/ColorItem.js +5 -7
- package/dist/es/colors/Colors.css +1 -233
- package/dist/es/colors/Colors.d.ts +1 -1
- package/dist/es/colors/Colors.js +33 -55
- package/dist/es/colors/colorsData.d.ts +4 -4
- package/dist/es/components/Accordion/Accordion.css +1 -89
- package/dist/es/components/Accordion/Accordion.d.ts +2 -1
- package/dist/es/components/Accordion/Accordion.js +22 -65
- package/dist/es/components/Avatar/Avatar.css +1 -52
- package/dist/es/components/Avatar/Avatar.d.ts +1 -1
- package/dist/es/components/Avatar/Avatar.js +9 -27
- package/dist/es/components/Badges/CounterBadge/CounterBadge.css +1 -0
- package/dist/{lib/components/Badges/components → es/components/Badges}/CounterBadge/CounterBadge.d.ts +2 -2
- package/dist/es/components/Badges/{components/CounterBadge → CounterBadge}/CounterBadge.js +10 -28
- package/dist/es/components/Badges/NotificationBadge/NotificationBadge.css +1 -0
- package/dist/{lib/components/Badges/components → es/components/Badges}/NotificationBadge/NotificationBadge.d.ts +3 -3
- package/dist/es/components/Badges/{components/NotificationBadge → NotificationBadge}/NotificationBadge.js +8 -22
- package/dist/es/components/Badges/PriceBadge/PriceBadge.css +1 -0
- package/dist/es/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.d.ts +4 -4
- package/dist/es/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.js +11 -54
- package/dist/es/components/Badges/PromoBadge/PromoBadge.css +1 -0
- package/dist/es/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.d.ts +4 -4
- package/dist/es/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.js +9 -23
- package/dist/es/components/Badges/TimerBadge/TimerBadge.css +1 -0
- package/dist/{lib/components/Badges/components → es/components/Badges}/TimerBadge/TimerBadge.d.ts +2 -2
- package/dist/es/components/Badges/{components/TimerBadge → TimerBadge}/TimerBadge.js +22 -46
- package/dist/es/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.js +5 -32
- package/dist/es/components/Banner/Banner.css +1 -195
- package/dist/es/components/Banner/Banner.d.ts +5 -4
- package/dist/es/components/Banner/Banner.js +82 -130
- package/dist/es/components/Banner/BannerDot.css +1 -69
- package/dist/es/components/Banner/BannerDot.d.ts +1 -1
- package/dist/es/components/Banner/BannerDot.js +6 -22
- package/dist/es/components/Banner/slidesSettings.d.ts +4 -2
- package/dist/es/components/Banner/slidesSettings.js +3 -6
- package/dist/es/components/Button/Button.css +1 -814
- package/dist/es/components/Button/Button.d.ts +7 -6
- package/dist/es/components/Button/Button.js +44 -104
- package/dist/es/components/Calendar/Calendar.css +1 -24
- package/dist/es/components/Calendar/Calendar.d.ts +4 -4
- package/dist/es/components/Calendar/Calendar.js +75 -144
- package/dist/es/components/Calendar/components/_Day/Day.css +1 -0
- package/dist/es/components/Calendar/components/{Day → _Day}/Day.d.ts +4 -4
- package/dist/es/components/Calendar/components/{Day → _Day}/Day.js +21 -53
- package/dist/es/components/Calendar/components/_Month/Month.css +1 -0
- package/dist/es/components/Calendar/components/{Month → _Month}/Month.d.ts +3 -2
- package/dist/es/components/Calendar/components/{Month → _Month}/Month.js +11 -36
- package/dist/es/components/Caption/Caption.css +1 -48
- package/dist/es/components/Caption/Caption.d.ts +4 -2
- package/dist/es/components/Caption/Caption.js +11 -25
- package/dist/es/components/Carousel/Carousel.css +1 -215
- package/dist/es/components/Carousel/Carousel.d.ts +11 -10
- package/dist/es/components/Carousel/Carousel.js +135 -162
- package/dist/es/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
- package/dist/es/components/Carousel/checkBreakpointsPropTypes.js +1 -4
- package/dist/es/components/Carousel/useGradient.d.ts +1 -1
- package/dist/es/components/Carousel/useGradient.js +9 -13
- package/dist/es/components/Checkbox/Checkbox.css +1 -150
- package/dist/es/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/es/components/Checkbox/Checkbox.js +21 -50
- package/dist/es/components/Chips/Chip.css +1 -132
- package/dist/es/components/Chips/Chip.d.ts +6 -26
- package/dist/es/components/Chips/Chip.js +17 -42
- package/dist/es/components/Chips/Chips.css +1 -19
- package/dist/es/components/Chips/Chips.d.ts +2 -2
- package/dist/es/components/Chips/Chips.js +32 -56
- package/dist/es/components/Chips/components/ChipsDropdown.css +1 -106
- package/dist/es/components/Chips/components/ChipsDropdown.d.ts +2 -2
- package/dist/es/components/Chips/components/ChipsDropdown.js +12 -27
- package/dist/es/components/ContentArea/ContentArea.css +1 -109
- package/dist/es/components/ContentArea/ContentArea.d.ts +5 -4
- package/dist/es/components/ContentArea/ContentArea.js +9 -28
- package/dist/es/components/ContentView/ContentView.css +1 -103
- package/dist/es/components/ContentView/ContentView.d.ts +3 -2
- package/dist/es/components/ContentView/ContentView.js +12 -46
- package/dist/es/components/Counter/Counter.css +1 -123
- package/dist/es/components/Counter/Counter.d.ts +1 -1
- package/dist/es/components/Counter/Counter.js +20 -55
- package/dist/es/components/Grid/Grid.css +1 -102
- package/dist/es/components/Grid/Grid.d.ts +1 -1
- package/dist/es/components/Grid/Grid.js +8 -24
- package/dist/es/components/Grid/GridColumn.css +1 -3102
- package/dist/es/components/Grid/GridColumn.d.ts +2 -2
- package/dist/es/components/Grid/GridColumn.js +33 -62
- package/dist/es/components/Header/Header.css +1 -122
- package/dist/es/components/Header/Header.d.ts +3 -1
- package/dist/es/components/Header/Header.js +13 -28
- package/dist/es/components/Link/Link.d.ts +2 -2
- package/dist/es/components/Link/Link.js +9 -25
- package/dist/es/components/List/List.css +1 -66
- package/dist/es/components/List/List.d.ts +2 -1
- package/dist/es/components/List/List.js +8 -18
- package/dist/es/components/List/ListItem.css +1 -6
- package/dist/es/components/List/ListItem.d.ts +2 -1
- package/dist/es/components/List/ListItem.js +1 -7
- package/dist/es/components/ListData/ListData.css +1 -162
- package/dist/es/components/ListData/ListData.d.ts +6 -34
- package/dist/es/components/ListData/ListData.js +22 -65
- package/dist/es/components/ListData/ListDataGroup.css +1 -15
- package/dist/es/components/ListData/ListDataGroup.d.ts +4 -4
- package/dist/es/components/ListData/ListDataGroup.js +29 -74
- package/dist/es/components/ListData/components/ListDataSortable.css +1 -79
- package/dist/es/components/ListData/components/ListDataSortable.d.ts +4 -4
- package/dist/es/components/ListData/components/ListDataSortable.js +21 -42
- package/dist/es/components/ListData/helpers.js +1 -8
- package/dist/es/components/Logo/Logo.css +1 -43
- package/dist/es/components/Logo/Logo.d.ts +1 -1
- package/dist/es/components/Logo/Logo.js +9 -25
- package/dist/es/components/Modal/Modal.css +1 -0
- package/dist/es/components/Modal/Modal.d.ts +106 -0
- package/dist/es/components/Modal/Modal.js +278 -0
- package/dist/es/components/Modal/_ModalContent/ModalContent.css +1 -0
- package/dist/es/components/Modal/_ModalContent/ModalContent.d.ts +8 -0
- package/dist/es/components/Modal/_ModalContent/ModalContent.js +168 -0
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.css +1 -0
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.d.ts +8 -0
- package/dist/es/components/Modal/_ModalDesktop/ModalDesktop.js +32 -0
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +1 -0
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +12 -0
- package/dist/es/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +114 -0
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +1 -0
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +8 -0
- package/dist/es/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +55 -0
- package/dist/es/components/Modal/mocks.d.ts +3 -0
- package/dist/es/components/Modal/mocks.js +79 -0
- package/dist/es/components/Modal/types.d.ts +27 -0
- package/dist/es/components/Modal/types.js +1 -0
- package/dist/es/components/Modal/utils/utils.d.ts +18 -0
- package/dist/es/components/Modal/utils/utils.js +66 -0
- package/dist/es/components/NavArrow/NavArrow.css +1 -63
- package/dist/es/components/NavArrow/NavArrow.d.ts +3 -3
- package/dist/es/components/NavArrow/NavArrow.js +8 -28
- package/dist/es/components/Notification/Notification.css +1 -350
- package/dist/es/components/Notification/Notification.d.ts +5 -4
- package/dist/es/components/Notification/Notification.js +61 -131
- package/dist/es/components/Pagination/Pagination.css +1 -5
- package/dist/es/components/Pagination/Pagination.d.ts +4 -3
- package/dist/es/components/Pagination/Pagination.js +7 -22
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +1 -62
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +5 -4
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +10 -26
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -10
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +3 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +5 -22
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -17
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +3 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +7 -23
- package/dist/es/components/Pagination/helpers.js +0 -3
- package/dist/es/components/Pagination/usePagination.d.ts +2 -1
- package/dist/es/components/Pagination/usePagination.js +6 -18
- package/dist/es/components/Paragraph/Paragraph.css +1 -43
- package/dist/es/components/Paragraph/Paragraph.d.ts +4 -2
- package/dist/es/components/Paragraph/Paragraph.js +9 -22
- package/dist/es/components/Preloader/Preloader.css +1 -224
- package/dist/es/components/Preloader/Preloader.d.ts +3 -3
- package/dist/es/components/Preloader/Preloader.js +16 -36
- package/dist/es/components/RadioButton/RadioButton.css +1 -120
- package/dist/es/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/es/components/RadioButton/RadioButton.js +18 -50
- package/dist/es/components/Row/Row.css +1 -238
- package/dist/es/components/Row/Row.d.ts +2 -2
- package/dist/es/components/Row/Row.js +23 -48
- package/dist/es/components/ScrollBar/ScrollBar.css +1 -0
- package/dist/es/components/ScrollBar/ScrollBar.d.ts +34 -0
- package/dist/es/components/ScrollBar/ScrollBar.js +86 -0
- package/dist/es/components/Search/Search.css +1 -453
- package/dist/es/components/Search/Search.d.ts +7 -8
- package/dist/es/components/Search/Search.js +54 -149
- package/dist/es/components/Select/Select.css +1 -389
- package/dist/es/components/Select/Select.d.ts +8 -84
- package/dist/es/components/Select/Select.js +52 -142
- package/dist/es/components/Select/reducer/selectReducer.d.ts +1 -1
- package/dist/es/components/Select/reducer/selectReducer.js +18 -32
- package/dist/es/components/Selector/Selector.css +1 -132
- package/dist/es/components/Selector/Selector.d.ts +1 -1
- package/dist/es/components/Selector/Selector.js +23 -50
- package/dist/es/components/Sliders/Slider/Slider.css +1 -128
- package/dist/es/components/Sliders/Slider/Slider.d.ts +1 -1
- package/dist/es/components/Sliders/Slider/Slider.js +25 -56
- package/dist/es/components/Sliders/SliderRange/SliderRange.css +1 -169
- package/dist/es/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRange/SliderRange.js +33 -80
- package/dist/es/components/Sliders/SliderRange/helpers.js +0 -2
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +1 -219
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +36 -85
- package/dist/es/components/Sliders/SliderRatio/helpers.js +1 -1
- package/dist/es/components/Sliders/SliderRatio/types.d.ts +1 -1
- package/dist/es/components/Sliders/SliderRatio/types.js +0 -1
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -84
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +11 -35
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.css +1 -15
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
- package/dist/es/components/Sliders/components/SliderScale/SliderScale.js +6 -20
- package/dist/es/components/Sliders/components/SliderScale/helpers.js +12 -16
- package/dist/es/components/Sliders/helpers.js +1 -5
- package/dist/es/components/Snackbar/Snackbar.css +1 -220
- package/dist/es/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/es/components/Snackbar/Snackbar.js +44 -82
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -66
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.js +9 -17
- package/dist/es/components/Switcher/Switcher.css +1 -160
- package/dist/es/components/Switcher/Switcher.d.ts +2 -1
- package/dist/es/components/Switcher/Switcher.js +17 -39
- package/dist/es/components/Tabs/Tab.js +0 -14
- package/dist/es/components/Tabs/Tabs.css +1 -306
- package/dist/es/components/Tabs/Tabs.d.ts +6 -5
- package/dist/es/components/Tabs/Tabs.js +110 -166
- package/dist/es/components/TextField/TextField.css +1 -343
- package/dist/es/components/TextField/TextField.d.ts +3 -3
- package/dist/es/components/TextField/TextField.js +85 -193
- package/dist/es/components/TextField/utils/countGraphemes.js +10 -18
- package/dist/es/components/TextLink/TextLink.css +1 -50
- package/dist/es/components/TextLink/TextLink.d.ts +2 -2
- package/dist/es/components/TextLink/TextLink.js +14 -27
- package/dist/es/components/Tile/Tile.css +1 -43
- package/dist/es/components/Tile/Tile.d.ts +7 -5
- package/dist/es/components/Tile/Tile.js +16 -36
- package/dist/es/components/Tooltip/Tooltip.css +1 -335
- package/dist/es/components/Tooltip/Tooltip.d.ts +9 -8
- package/dist/es/components/Tooltip/Tooltip.js +58 -139
- package/dist/es/components/_Collapse/Collapse.css +1 -0
- package/dist/{lib/components/Collapse → es/components/_Collapse}/Collapse.d.ts +3 -3
- package/dist/es/components/{Collapse → _Collapse}/Collapse.js +25 -62
- package/dist/es/hooks/usePrevious.js +0 -2
- package/dist/es/hooks/useResolution.d.ts +1 -1
- package/dist/es/hooks/useResolution.js +5 -11
- package/dist/es/hooks/useSwipe.d.ts +1 -1
- package/dist/es/hooks/useSwipe.js +17 -44
- package/dist/es/index.d.ts +16 -9
- package/dist/es/index.js +17 -10
- package/dist/es/styles/base.css +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -45
- package/dist/lib/colors/ColorItem/ColorItem.d.ts +2 -2
- package/dist/lib/colors/ColorItem/ColorItem.js +9 -18
- package/dist/lib/colors/Colors.css +1 -233
- package/dist/lib/colors/Colors.d.ts +1 -1
- package/dist/lib/colors/Colors.js +38 -80
- package/dist/lib/colors/colorsData.d.ts +4 -4
- package/dist/lib/colors/colorsData.js +1 -2
- package/dist/lib/components/Accordion/Accordion.css +1 -89
- package/dist/lib/components/Accordion/Accordion.d.ts +2 -1
- package/dist/lib/components/Accordion/Accordion.js +27 -82
- package/dist/lib/components/Avatar/Avatar.css +1 -52
- package/dist/lib/components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/components/Avatar/Avatar.js +14 -42
- package/dist/lib/components/Badges/CounterBadge/CounterBadge.css +1 -0
- package/dist/{es/components/Badges/components → lib/components/Badges}/CounterBadge/CounterBadge.d.ts +2 -2
- package/dist/lib/components/Badges/CounterBadge/CounterBadge.js +52 -0
- package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.css +1 -0
- package/dist/{es/components/Badges/components → lib/components/Badges}/NotificationBadge/NotificationBadge.d.ts +3 -3
- package/dist/lib/components/Badges/NotificationBadge/NotificationBadge.js +44 -0
- package/dist/lib/components/Badges/PriceBadge/PriceBadge.css +1 -0
- package/dist/lib/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.d.ts +4 -4
- package/dist/lib/components/Badges/{components/PriceBadge → PriceBadge}/PriceBadge.js +20 -76
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.css +1 -0
- package/dist/lib/components/Badges/{components/PromoBadge → PromoBadge}/PromoBadge.d.ts +4 -4
- package/dist/lib/components/Badges/PromoBadge/PromoBadge.js +56 -0
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.css +1 -0
- package/dist/{es/components/Badges/components → lib/components/Badges}/TimerBadge/TimerBadge.d.ts +2 -2
- package/dist/lib/components/Badges/TimerBadge/TimerBadge.js +96 -0
- package/dist/lib/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.js +12 -56
- package/dist/lib/components/Banner/Banner.css +1 -195
- package/dist/lib/components/Banner/Banner.d.ts +5 -4
- package/dist/lib/components/Banner/Banner.js +94 -164
- package/dist/lib/components/Banner/BannerDot.css +1 -69
- package/dist/lib/components/Banner/BannerDot.d.ts +1 -1
- package/dist/lib/components/Banner/BannerDot.js +11 -37
- package/dist/lib/components/Banner/slidesSettings.d.ts +4 -2
- package/dist/lib/components/Banner/slidesSettings.js +5 -12
- package/dist/lib/components/Button/Button.css +1 -814
- package/dist/lib/components/Button/Button.d.ts +7 -6
- package/dist/lib/components/Button/Button.js +71 -158
- package/dist/lib/components/Calendar/Calendar.css +1 -24
- package/dist/lib/components/Calendar/Calendar.d.ts +4 -4
- package/dist/lib/components/Calendar/Calendar.js +90 -191
- package/dist/lib/components/Calendar/components/_Day/Day.css +1 -0
- package/dist/lib/components/Calendar/components/{Day → _Day}/Day.d.ts +4 -4
- package/dist/lib/components/Calendar/components/{Day → _Day}/Day.js +29 -72
- package/dist/lib/components/Calendar/components/_Month/Month.css +1 -0
- package/dist/lib/components/Calendar/components/{Month → _Month}/Month.d.ts +3 -2
- package/dist/lib/components/Calendar/components/_Month/Month.js +97 -0
- package/dist/lib/components/Caption/Caption.css +1 -48
- package/dist/lib/components/Caption/Caption.d.ts +4 -2
- package/dist/lib/components/Caption/Caption.js +16 -41
- package/dist/lib/components/Carousel/Carousel.css +1 -215
- package/dist/lib/components/Carousel/Carousel.d.ts +11 -10
- package/dist/lib/components/Carousel/Carousel.js +223 -228
- package/dist/lib/components/Carousel/checkBreakpointsPropTypes.d.ts +1 -1
- package/dist/lib/components/Carousel/checkBreakpointsPropTypes.js +6 -18
- package/dist/lib/components/Carousel/useGradient.d.ts +1 -1
- package/dist/lib/components/Carousel/useGradient.js +12 -25
- package/dist/lib/components/Checkbox/Checkbox.css +1 -150
- package/dist/lib/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/lib/components/Checkbox/Checkbox.js +35 -75
- package/dist/lib/components/Chips/Chip.css +1 -132
- package/dist/lib/components/Chips/Chip.d.ts +6 -26
- package/dist/lib/components/Chips/Chip.js +36 -76
- package/dist/lib/components/Chips/Chips.css +1 -19
- package/dist/lib/components/Chips/Chips.d.ts +2 -2
- package/dist/lib/components/Chips/Chips.js +47 -92
- package/dist/lib/components/Chips/components/ChipsDropdown.css +1 -106
- package/dist/lib/components/Chips/components/ChipsDropdown.d.ts +2 -2
- package/dist/lib/components/Chips/components/ChipsDropdown.js +31 -67
- package/dist/lib/components/ContentArea/ContentArea.css +1 -109
- package/dist/lib/components/ContentArea/ContentArea.d.ts +5 -4
- package/dist/lib/components/ContentArea/ContentArea.js +14 -44
- package/dist/lib/components/ContentView/ContentView.css +1 -103
- package/dist/lib/components/ContentView/ContentView.d.ts +3 -2
- package/dist/lib/components/ContentView/ContentView.js +17 -63
- package/dist/lib/components/Counter/Counter.css +1 -123
- package/dist/lib/components/Counter/Counter.d.ts +1 -1
- package/dist/lib/components/Counter/Counter.js +25 -71
- package/dist/lib/components/Grid/Grid.css +1 -102
- package/dist/lib/components/Grid/Grid.d.ts +1 -1
- package/dist/lib/components/Grid/Grid.js +13 -40
- package/dist/lib/components/Grid/GridColumn.css +1 -3102
- package/dist/lib/components/Grid/GridColumn.d.ts +2 -2
- package/dist/lib/components/Grid/GridColumn.js +38 -77
- package/dist/lib/components/Header/Header.css +1 -122
- package/dist/lib/components/Header/Header.d.ts +3 -1
- package/dist/lib/components/Header/Header.js +18 -43
- package/dist/lib/components/Link/Link.d.ts +2 -2
- package/dist/lib/components/Link/Link.js +15 -34
- package/dist/lib/components/List/List.css +1 -66
- package/dist/lib/components/List/List.d.ts +2 -1
- package/dist/lib/components/List/List.js +12 -30
- package/dist/lib/components/List/ListItem.css +1 -6
- package/dist/lib/components/List/ListItem.d.ts +2 -1
- package/dist/lib/components/List/ListItem.js +5 -19
- package/dist/lib/components/ListData/ListData.css +1 -162
- package/dist/lib/components/ListData/ListData.d.ts +6 -34
- package/dist/lib/components/ListData/ListData.js +51 -111
- package/dist/lib/components/ListData/ListDataGroup.css +1 -15
- package/dist/lib/components/ListData/ListDataGroup.d.ts +4 -4
- package/dist/lib/components/ListData/ListDataGroup.js +48 -118
- package/dist/lib/components/ListData/components/ListDataSortable.css +1 -79
- package/dist/lib/components/ListData/components/ListDataSortable.d.ts +4 -4
- package/dist/lib/components/ListData/components/ListDataSortable.js +35 -74
- package/dist/lib/components/ListData/helpers.js +7 -25
- package/dist/lib/components/Logo/Logo.css +1 -43
- package/dist/lib/components/Logo/Logo.d.ts +1 -1
- package/dist/lib/components/Logo/Logo.js +14 -41
- package/dist/lib/components/Modal/Modal.css +1 -0
- package/dist/lib/components/Modal/Modal.d.ts +106 -0
- package/dist/lib/components/Modal/Modal.js +287 -0
- package/dist/lib/components/Modal/_ModalContent/ModalContent.css +1 -0
- package/dist/lib/components/Modal/_ModalContent/ModalContent.d.ts +8 -0
- package/dist/lib/components/Modal/_ModalContent/ModalContent.js +177 -0
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.css +1 -0
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.d.ts +8 -0
- package/dist/lib/components/Modal/_ModalDesktop/ModalDesktop.js +41 -0
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.css +1 -0
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.d.ts +12 -0
- package/dist/lib/components/Modal/_ModalMobileBottom/ModalMobileBottom.js +123 -0
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.css +1 -0
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.d.ts +8 -0
- package/dist/lib/components/Modal/_ModalMobileFullScreen/ModalMobileFullScreen.js +64 -0
- package/dist/lib/components/Modal/mocks.d.ts +3 -0
- package/dist/lib/components/Modal/mocks.js +85 -0
- package/dist/lib/components/Modal/types.d.ts +27 -0
- package/dist/lib/components/Modal/types.js +5 -0
- package/dist/lib/components/Modal/utils/utils.d.ts +18 -0
- package/dist/lib/components/Modal/utils/utils.js +72 -0
- package/dist/lib/components/NavArrow/NavArrow.css +1 -63
- package/dist/lib/components/NavArrow/NavArrow.d.ts +3 -3
- package/dist/lib/components/NavArrow/NavArrow.js +15 -47
- package/dist/lib/components/Notification/Notification.css +1 -350
- package/dist/lib/components/Notification/Notification.d.ts +5 -4
- package/dist/lib/components/Notification/Notification.js +114 -201
- package/dist/lib/components/Pagination/Pagination.css +1 -5
- package/dist/lib/components/Pagination/Pagination.d.ts +4 -3
- package/dist/lib/components/Pagination/Pagination.js +19 -51
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +1 -62
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +5 -4
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -35
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.css +1 -10
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +3 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +7 -32
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +1 -17
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +3 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +9 -32
- package/dist/lib/components/Pagination/helpers.js +1 -6
- package/dist/lib/components/Pagination/usePagination.d.ts +2 -1
- package/dist/lib/components/Pagination/usePagination.js +10 -36
- package/dist/lib/components/Paragraph/Paragraph.css +1 -43
- package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -2
- package/dist/lib/components/Paragraph/Paragraph.js +14 -38
- package/dist/lib/components/Preloader/Preloader.css +1 -224
- package/dist/lib/components/Preloader/Preloader.d.ts +3 -3
- package/dist/lib/components/Preloader/Preloader.js +23 -58
- package/dist/lib/components/RadioButton/RadioButton.css +1 -120
- package/dist/lib/components/RadioButton/RadioButton.d.ts +1 -1
- package/dist/lib/components/RadioButton/RadioButton.js +23 -70
- package/dist/lib/components/Row/Row.css +1 -238
- package/dist/lib/components/Row/Row.d.ts +2 -2
- package/dist/lib/components/Row/Row.js +40 -76
- package/dist/lib/components/ScrollBar/ScrollBar.css +1 -0
- package/dist/lib/components/ScrollBar/ScrollBar.d.ts +34 -0
- package/dist/lib/components/ScrollBar/ScrollBar.js +94 -0
- package/dist/lib/components/Search/Search.css +1 -453
- package/dist/lib/components/Search/Search.d.ts +7 -8
- package/dist/lib/components/Search/Search.js +122 -262
- package/dist/lib/components/Select/Select.css +1 -389
- package/dist/lib/components/Select/Select.d.ts +8 -84
- package/dist/lib/components/Select/Select.js +70 -187
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +1 -1
- package/dist/lib/components/Select/reducer/selectReducer.js +22 -42
- package/dist/lib/components/Selector/Selector.css +1 -132
- package/dist/lib/components/Selector/Selector.d.ts +1 -1
- package/dist/lib/components/Selector/Selector.js +28 -71
- package/dist/lib/components/Sliders/Slider/Slider.css +1 -128
- package/dist/lib/components/Sliders/Slider/Slider.d.ts +1 -1
- package/dist/lib/components/Sliders/Slider/Slider.js +30 -76
- package/dist/lib/components/Sliders/SliderRange/SliderRange.css +1 -169
- package/dist/lib/components/Sliders/SliderRange/SliderRange.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.js +38 -101
- package/dist/lib/components/Sliders/SliderRange/helpers.js +5 -18
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +1 -219
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +41 -112
- package/dist/lib/components/Sliders/SliderRatio/helpers.js +9 -28
- package/dist/lib/components/Sliders/SliderRatio/types.d.ts +1 -1
- package/dist/lib/components/Sliders/SliderRatio/types.js +0 -2
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -84
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +2 -2
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +18 -57
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.css +1 -15
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.d.ts +2 -2
- package/dist/lib/components/Sliders/components/SliderScale/SliderScale.js +12 -40
- package/dist/lib/components/Sliders/components/SliderScale/helpers.js +16 -34
- package/dist/lib/components/Sliders/helpers.js +5 -22
- package/dist/lib/components/Snackbar/Snackbar.css +1 -220
- package/dist/lib/components/Snackbar/Snackbar.d.ts +3 -3
- package/dist/lib/components/Snackbar/Snackbar.js +82 -139
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +1 -66
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +3 -3
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.js +18 -37
- package/dist/lib/components/Switcher/Switcher.css +1 -160
- package/dist/lib/components/Switcher/Switcher.d.ts +2 -1
- package/dist/lib/components/Switcher/Switcher.js +22 -53
- package/dist/lib/components/Tabs/Tab.js +5 -26
- package/dist/lib/components/Tabs/Tabs.css +1 -306
- package/dist/lib/components/Tabs/Tabs.d.ts +6 -5
- package/dist/lib/components/Tabs/Tabs.js +121 -200
- package/dist/lib/components/TextField/TextField.css +1 -343
- package/dist/lib/components/TextField/TextField.d.ts +3 -3
- package/dist/lib/components/TextField/TextField.js +119 -244
- package/dist/lib/components/TextField/utils/countGraphemes.js +11 -28
- package/dist/lib/components/TextLink/TextLink.css +1 -50
- package/dist/lib/components/TextLink/TextLink.d.ts +2 -2
- package/dist/lib/components/TextLink/TextLink.js +19 -42
- package/dist/lib/components/Tile/Tile.css +1 -43
- package/dist/lib/components/Tile/Tile.d.ts +7 -5
- package/dist/lib/components/Tile/Tile.js +27 -55
- package/dist/lib/components/Tooltip/Tooltip.css +1 -335
- package/dist/lib/components/Tooltip/Tooltip.d.ts +9 -8
- package/dist/lib/components/Tooltip/Tooltip.js +111 -219
- package/dist/lib/components/_Collapse/Collapse.css +1 -0
- package/dist/{es/components/Collapse → lib/components/_Collapse}/Collapse.d.ts +3 -3
- package/dist/lib/components/_Collapse/Collapse.js +95 -0
- package/dist/lib/constants/throttleTime.js +2 -3
- package/dist/lib/hooks/usePrevious.js +4 -11
- package/dist/lib/hooks/useResolution.d.ts +1 -1
- package/dist/lib/hooks/useResolution.js +10 -24
- package/dist/lib/hooks/useSwipe.d.ts +1 -1
- package/dist/lib/hooks/useSwipe.js +22 -64
- package/dist/lib/index.d.ts +16 -9
- package/dist/lib/index.js +83 -102
- package/dist/lib/styles/base.css +1 -0
- package/package.json +106 -101
- package/styles/base.scss +150 -0
- package/styles/colors.css +53 -0
- package/CHANGELOG.md +0 -4062
- package/dist/es/components/Avatar/doc/i/img.png +0 -0
- package/dist/es/components/Badges/components/CounterBadge/CounterBadge.css +0 -54
- package/dist/es/components/Badges/components/NotificationBadge/NotificationBadge.css +0 -58
- package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +0 -119
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +0 -69
- package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +0 -60
- package/dist/es/components/Calendar/components/Day/Day.css +0 -243
- package/dist/es/components/Calendar/components/Month/Month.css +0 -135
- package/dist/es/components/Collapse/Collapse.css +0 -3
- package/dist/es/components/ListData/doc/i/img.png +0 -0
- package/dist/es/components/Selector/doc/Selector.example.css +0 -17
- package/dist/lib/components/Avatar/doc/i/img.png +0 -0
- package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.css +0 -54
- package/dist/lib/components/Badges/components/CounterBadge/CounterBadge.js +0 -81
- package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.css +0 -58
- package/dist/lib/components/Badges/components/NotificationBadge/NotificationBadge.js +0 -71
- package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +0 -119
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +0 -69
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +0 -84
- package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +0 -60
- package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.js +0 -135
- package/dist/lib/components/Calendar/components/Day/Day.css +0 -243
- package/dist/lib/components/Calendar/components/Month/Month.css +0 -135
- package/dist/lib/components/Calendar/components/Month/Month.js +0 -127
- package/dist/lib/components/Collapse/Collapse.css +0 -3
- package/dist/lib/components/Collapse/Collapse.js +0 -141
- package/dist/lib/components/ListData/doc/i/img.png +0 -0
- package/dist/lib/components/Selector/doc/Selector.example.css +0 -17
- package/styles/base.less +0 -171
- /package/dist/es/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.d.ts +0 -0
- /package/dist/lib/components/Badges/{components/TimerBadge → TimerBadge/components}/Timer/Timer.d.ts +0 -0
|
@@ -2,30 +2,23 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
-
import "core-js/modules/es.array.index-of.js";
|
|
6
5
|
import "core-js/modules/es.symbol.js";
|
|
7
|
-
import "core-js/modules/es.date.to-string.js";
|
|
8
|
-
import "core-js/modules/es.array.reverse.js";
|
|
9
|
-
import "core-js/modules/es.array.from.js";
|
|
10
|
-
import "core-js/modules/es.string.iterator.js";
|
|
11
6
|
import "core-js/modules/es.array.concat.js";
|
|
7
|
+
import "core-js/modules/es.array.from.js";
|
|
8
|
+
import "core-js/modules/es.array.index-of.js";
|
|
12
9
|
import "core-js/modules/es.array.map.js";
|
|
13
|
-
import "core-js/modules/es.
|
|
14
|
-
|
|
10
|
+
import "core-js/modules/es.array.reverse.js";
|
|
11
|
+
import "core-js/modules/es.date.to-string.js";
|
|
12
|
+
import "core-js/modules/es.string.iterator.js";
|
|
15
13
|
var __rest = this && this.__rest || function (s, e) {
|
|
16
14
|
var t = {};
|
|
17
|
-
|
|
18
|
-
for (var p in s) {
|
|
19
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
16
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
17
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
24
18
|
}
|
|
25
19
|
return t;
|
|
26
20
|
};
|
|
27
|
-
|
|
28
|
-
import React, { useState, useEffect, useMemo, useRef } from 'react';
|
|
21
|
+
import * as React from 'react';
|
|
29
22
|
import { START_DATE, END_DATE, useDatepicker, useMonth } from '@datepicker-react/hooks';
|
|
30
23
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
31
24
|
import { addMonths, subMonths } from 'date-fns';
|
|
@@ -36,18 +29,15 @@ import isBefore from 'date-fns/isBefore';
|
|
|
36
29
|
import isEqual from 'date-fns/isEqual';
|
|
37
30
|
import isSameMonth from 'date-fns/isSameMonth';
|
|
38
31
|
import ruLocale from 'date-fns/locale/ru';
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import Month from "./components/Month/Month";
|
|
32
|
+
import Day from "./components/_Day/Day";
|
|
33
|
+
import Month from "./components/_Month/Month";
|
|
42
34
|
import "./Calendar.css";
|
|
43
|
-
|
|
44
35
|
var formatDate = function formatDate(date, pattern) {
|
|
45
36
|
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ruLocale;
|
|
46
37
|
return format(date, pattern, {
|
|
47
38
|
locale: locale
|
|
48
39
|
});
|
|
49
40
|
};
|
|
50
|
-
|
|
51
41
|
export var CalendarTypes = {
|
|
52
42
|
CLASSIC: 'Classic',
|
|
53
43
|
MODERN: 'Modern'
|
|
@@ -57,19 +47,15 @@ export var CalendarDirectionTypes = {
|
|
|
57
47
|
FUTURE: 'future',
|
|
58
48
|
BOTH: 'both'
|
|
59
49
|
};
|
|
60
|
-
|
|
61
50
|
var weekdayLabelFormat = function weekdayLabelFormat(date) {
|
|
62
51
|
return formatDate(date, 'EEEEEE');
|
|
63
52
|
};
|
|
64
|
-
|
|
65
53
|
var dayLabelFormat = function dayLabelFormat(date) {
|
|
66
54
|
return formatDate(date, 'd');
|
|
67
55
|
};
|
|
68
|
-
|
|
69
56
|
var monthLabelFormat = function monthLabelFormat(date) {
|
|
70
57
|
return formatDate(date, 'LLLL');
|
|
71
58
|
};
|
|
72
|
-
|
|
73
59
|
var generateMonthsData = function generateMonthsData(pastMonthsCount, futureMonthsCount, direction) {
|
|
74
60
|
var months = [];
|
|
75
61
|
var currentDate = new Date();
|
|
@@ -77,7 +63,6 @@ var generateMonthsData = function generateMonthsData(pastMonthsCount, futureMont
|
|
|
77
63
|
year: currentDate.getFullYear(),
|
|
78
64
|
month: currentDate.getMonth()
|
|
79
65
|
};
|
|
80
|
-
|
|
81
66
|
if (direction === 'past' || direction === 'both') {
|
|
82
67
|
var pastMonths = Array.from({
|
|
83
68
|
length: pastMonthsCount
|
|
@@ -92,7 +77,6 @@ var generateMonthsData = function generateMonthsData(pastMonthsCount, futureMont
|
|
|
92
77
|
} else {
|
|
93
78
|
months.push(currentMonth);
|
|
94
79
|
}
|
|
95
|
-
|
|
96
80
|
if (direction === 'future' || direction === 'both') {
|
|
97
81
|
var futureMonths = Array.from({
|
|
98
82
|
length: futureMonthsCount
|
|
@@ -103,9 +87,8 @@ var generateMonthsData = function generateMonthsData(pastMonthsCount, futureMont
|
|
|
103
87
|
month: monthDate.getMonth()
|
|
104
88
|
};
|
|
105
89
|
});
|
|
106
|
-
months = [].concat(_toConsumableArray(months),
|
|
90
|
+
months = [].concat(_toConsumableArray(months), futureMonths);
|
|
107
91
|
}
|
|
108
|
-
|
|
109
92
|
return months;
|
|
110
93
|
};
|
|
111
94
|
/* List of cases to check on component change:
|
|
@@ -118,31 +101,28 @@ var generateMonthsData = function generateMonthsData(pastMonthsCount, futureMont
|
|
|
118
101
|
- Should correctly highlights period if start date chosen and hover on possible end date
|
|
119
102
|
|
|
120
103
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
104
|
var cn = cnCreate('mfui-calendar');
|
|
124
|
-
|
|
125
105
|
var Calendar = function Calendar(_ref) {
|
|
126
106
|
var dataAttrs = _ref.dataAttrs,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var calendarStateFromProps = useMemo(function () {
|
|
107
|
+
_ref$isSingleDate = _ref.isSingleDate,
|
|
108
|
+
isSingleDate = _ref$isSingleDate === void 0 ? false : _ref$isSingleDate,
|
|
109
|
+
_ref$startDate = _ref.startDate,
|
|
110
|
+
startDate = _ref$startDate === void 0 ? null : _ref$startDate,
|
|
111
|
+
_ref$endDate = _ref.endDate,
|
|
112
|
+
endDate = _ref$endDate === void 0 ? null : _ref$endDate,
|
|
113
|
+
className = _ref.className,
|
|
114
|
+
onChange = _ref.onChange,
|
|
115
|
+
minBookingDate = _ref.minBookingDate,
|
|
116
|
+
maxBookingDate = _ref.maxBookingDate,
|
|
117
|
+
_ref$type = _ref.type,
|
|
118
|
+
type = _ref$type === void 0 ? 'Classic' : _ref$type,
|
|
119
|
+
_ref$pastMonthsCount = _ref.pastMonthsCount,
|
|
120
|
+
pastMonthsCount = _ref$pastMonthsCount === void 0 ? 1 : _ref$pastMonthsCount,
|
|
121
|
+
_ref$futureMonthsCoun = _ref.futureMonthsCount,
|
|
122
|
+
futureMonthsCount = _ref$futureMonthsCoun === void 0 ? 1 : _ref$futureMonthsCoun,
|
|
123
|
+
_ref$direction = _ref.direction,
|
|
124
|
+
direction = _ref$direction === void 0 ? 'past' : _ref$direction;
|
|
125
|
+
var calendarStateFromProps = React.useMemo(function () {
|
|
146
126
|
var isInitialDatesEqual = startDate && endDate && isEqual(startDate, endDate);
|
|
147
127
|
var isStartFocus = !startDate || endDate && !isInitialDatesEqual;
|
|
148
128
|
var isStartDateBlocked = startDate && minBookingDate && maxBookingDate && (isAfter(minBookingDate, startDate) || isBefore(maxBookingDate, startDate));
|
|
@@ -154,57 +134,51 @@ var Calendar = function Calendar(_ref) {
|
|
|
154
134
|
focusedInput: isStartFocus ? START_DATE : END_DATE
|
|
155
135
|
};
|
|
156
136
|
}, [startDate, endDate, isSingleDate, minBookingDate, maxBookingDate]);
|
|
157
|
-
var monthsData = useMemo(function () {
|
|
137
|
+
var monthsData = React.useMemo(function () {
|
|
158
138
|
return generateMonthsData(pastMonthsCount, futureMonthsCount, direction);
|
|
159
139
|
}, [pastMonthsCount, futureMonthsCount, direction]);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var isUserChoice = useRef(false);
|
|
172
|
-
var currentMonthRef = useRef(null);
|
|
140
|
+
var _React$useState = React.useState(calendarStateFromProps),
|
|
141
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
142
|
+
calendarState = _React$useState2[0],
|
|
143
|
+
setCalendarState = _React$useState2[1];
|
|
144
|
+
var _React$useState3 = React.useState(undefined),
|
|
145
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
146
|
+
hoveredDate = _React$useState4[0],
|
|
147
|
+
setHoveredDate = _React$useState4[1];
|
|
148
|
+
var isUserChoice = React.useRef(false);
|
|
149
|
+
var currentMonthRef = React.useRef(null);
|
|
173
150
|
var stateStartDate = calendarState.startDate,
|
|
174
|
-
|
|
175
|
-
|
|
151
|
+
stateEndDate = calendarState.endDate,
|
|
152
|
+
stateFocusedInput = calendarState.focusedInput;
|
|
176
153
|
var isModernType = type === CalendarTypes.MODERN;
|
|
177
|
-
|
|
178
154
|
var _a = useDatepicker(_extends({
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
useEffect(function () {
|
|
155
|
+
onDatesChange: function onDatesChange() {
|
|
156
|
+
return undefined;
|
|
157
|
+
},
|
|
158
|
+
numberOfMonths: 1,
|
|
159
|
+
minBookingDate: minBookingDate,
|
|
160
|
+
maxBookingDate: maxBookingDate,
|
|
161
|
+
initialVisibleMonth: stateStartDate || undefined
|
|
162
|
+
}, calendarState)),
|
|
163
|
+
firstDayOfWeek = _a.firstDayOfWeek,
|
|
164
|
+
activeMonths = _a.activeMonths,
|
|
165
|
+
goToPreviousMonths = _a.goToPreviousMonths,
|
|
166
|
+
goToNextMonths = _a.goToNextMonths,
|
|
167
|
+
goToDate = _a.goToDate,
|
|
168
|
+
pickerProps = __rest(_a, ["firstDayOfWeek", "activeMonths", "goToPreviousMonths", "goToNextMonths", "goToDate"]);
|
|
169
|
+
React.useEffect(function () {
|
|
195
170
|
isUserChoice.current = false;
|
|
196
171
|
}, [startDate]);
|
|
197
|
-
useEffect(function () {
|
|
172
|
+
React.useEffect(function () {
|
|
198
173
|
var propsStartDate = calendarStateFromProps.startDate;
|
|
199
174
|
setCalendarState(calendarStateFromProps);
|
|
200
|
-
!isUserChoice.current && propsStartDate && goToDate(propsStartDate);
|
|
175
|
+
!isUserChoice.current && propsStartDate && goToDate(propsStartDate);
|
|
176
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
201
177
|
}, [calendarStateFromProps]);
|
|
202
|
-
useEffect(function () {
|
|
178
|
+
React.useEffect(function () {
|
|
203
179
|
var _a, _b;
|
|
204
|
-
|
|
205
180
|
if (isModernType && direction !== 'future') {
|
|
206
181
|
var parentElement = (_a = currentMonthRef.current) === null || _a === void 0 ? void 0 : _a.parentNode;
|
|
207
|
-
|
|
208
182
|
if (parentElement && currentMonthRef.current) {
|
|
209
183
|
parentElement.scrollTo({
|
|
210
184
|
top: ((_b = currentMonthRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) * pastMonthsCount || 0
|
|
@@ -212,7 +186,6 @@ var Calendar = function Calendar(_ref) {
|
|
|
212
186
|
}
|
|
213
187
|
}
|
|
214
188
|
}, [isModernType, direction, pastMonthsCount]);
|
|
215
|
-
|
|
216
189
|
var getCalendarState = function getCalendarState(date) {
|
|
217
190
|
var isStartChose = stateFocusedInput === START_DATE;
|
|
218
191
|
var isEndChose = stateFocusedInput === END_DATE;
|
|
@@ -224,10 +197,8 @@ var Calendar = function Calendar(_ref) {
|
|
|
224
197
|
var isClickAfterChosenEndDate = stateEndDate && isStartChose && isAfter(date, stateEndDate || 0);
|
|
225
198
|
var isClickBeforeStartDate = stateStartDate && isEndChose && !isAfter(date, stateStartDate || 0);
|
|
226
199
|
var isStartDateChose = isStartDateClick || isEndDateClick || isClickBeforeChosenEndDate || isClickAfterChosenEndDate || isClickBeforeStartDate;
|
|
227
|
-
|
|
228
200
|
if (isModernType) {
|
|
229
201
|
var resetEndDateCondition = isStartChose || !stateStartDate || !!stateEndDate;
|
|
230
|
-
|
|
231
202
|
if (resetEndDateCondition || isEndChose && stateStartDate && isBefore(date, stateStartDate)) {
|
|
232
203
|
return {
|
|
233
204
|
startDate: date,
|
|
@@ -235,7 +206,6 @@ var Calendar = function Calendar(_ref) {
|
|
|
235
206
|
focusedInput: END_DATE
|
|
236
207
|
};
|
|
237
208
|
}
|
|
238
|
-
|
|
239
209
|
if (isEndChose && stateStartDate) {
|
|
240
210
|
return {
|
|
241
211
|
startDate: stateStartDate,
|
|
@@ -244,13 +214,11 @@ var Calendar = function Calendar(_ref) {
|
|
|
244
214
|
};
|
|
245
215
|
}
|
|
246
216
|
}
|
|
247
|
-
|
|
248
217
|
switch (true) {
|
|
249
218
|
case isSingleDate:
|
|
250
219
|
return _extends(_extends({}, calendarState), {
|
|
251
220
|
startDate: date
|
|
252
221
|
});
|
|
253
|
-
|
|
254
222
|
case isPeriodNarrow:
|
|
255
223
|
{
|
|
256
224
|
var isCloserToStart = stateStartDate && stateEndDate && differenceInDays(stateStartDate, date) >= differenceInDays(date, stateEndDate);
|
|
@@ -260,20 +228,17 @@ var Calendar = function Calendar(_ref) {
|
|
|
260
228
|
focusedInput: START_DATE
|
|
261
229
|
});
|
|
262
230
|
}
|
|
263
|
-
|
|
264
231
|
case isStartDateChose:
|
|
265
232
|
return {
|
|
266
233
|
startDate: date,
|
|
267
234
|
endDate: null,
|
|
268
235
|
focusedInput: END_DATE
|
|
269
236
|
};
|
|
270
|
-
|
|
271
237
|
case isEndDateChose:
|
|
272
238
|
return _extends(_extends({}, calendarState), {
|
|
273
239
|
endDate: date,
|
|
274
240
|
focusedInput: START_DATE
|
|
275
241
|
});
|
|
276
|
-
|
|
277
242
|
default:
|
|
278
243
|
return _extends(_extends({}, calendarState), {
|
|
279
244
|
startDate: date,
|
|
@@ -281,45 +246,37 @@ var Calendar = function Calendar(_ref) {
|
|
|
281
246
|
});
|
|
282
247
|
}
|
|
283
248
|
};
|
|
284
|
-
|
|
285
249
|
var isDateHighlighted = function isDateHighlighted(date) {
|
|
286
250
|
if (!stateStartDate || !!stateEndDate || isSingleDate) {
|
|
287
251
|
return false;
|
|
288
252
|
}
|
|
289
|
-
|
|
290
253
|
return !!stateStartDate && !!hoveredDate && isAfter(hoveredDate, date) && isBefore(stateStartDate, date);
|
|
291
254
|
};
|
|
292
|
-
|
|
293
255
|
var handleDaySelect = function handleDaySelect(date) {
|
|
294
256
|
var nextState = getCalendarState(date);
|
|
295
257
|
var nextStartDate = nextState.startDate,
|
|
296
|
-
|
|
258
|
+
nextEndDate = nextState.endDate;
|
|
297
259
|
setCalendarState(nextState);
|
|
298
260
|
isUserChoice.current = true;
|
|
299
261
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextStartDate, nextEndDate);
|
|
300
262
|
};
|
|
301
|
-
|
|
302
263
|
var handleDateHover = function handleDateHover(date) {
|
|
303
|
-
|
|
264
|
+
date && setHoveredDate(date);
|
|
304
265
|
};
|
|
305
|
-
|
|
306
266
|
var handleDateMouseLeave = function handleDateMouseLeave() {
|
|
307
267
|
return setHoveredDate(undefined);
|
|
308
268
|
};
|
|
309
|
-
|
|
310
269
|
var renderDays = function renderDays(days) {
|
|
311
270
|
var correctionIndex = 0;
|
|
312
271
|
return days.map(function (day, index) {
|
|
313
272
|
if (_typeof(day) === 'object') {
|
|
314
273
|
var date = day.date,
|
|
315
|
-
|
|
316
|
-
|
|
274
|
+
dayLabel = day.dayLabel;
|
|
317
275
|
if (!dayLabel) {
|
|
318
276
|
return /*#__PURE__*/React.createElement("div", {
|
|
319
277
|
key: index + String(date)
|
|
320
278
|
});
|
|
321
279
|
}
|
|
322
|
-
|
|
323
280
|
return /*#__PURE__*/React.createElement(Day, _extends({
|
|
324
281
|
dataAttrs: {
|
|
325
282
|
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.day, index + 1 - correctionIndex))
|
|
@@ -335,33 +292,29 @@ var Calendar = function Calendar(_ref) {
|
|
|
335
292
|
isModern: isModernType
|
|
336
293
|
}));
|
|
337
294
|
}
|
|
338
|
-
|
|
339
295
|
correctionIndex += 1;
|
|
340
296
|
return /*#__PURE__*/React.createElement("div", {
|
|
341
297
|
key: index + day
|
|
342
298
|
});
|
|
343
299
|
});
|
|
344
300
|
};
|
|
345
|
-
|
|
346
301
|
var renderMonths = function renderMonths() {
|
|
347
302
|
var monthsArray = isModernType ? monthsData : activeMonths;
|
|
348
303
|
return monthsArray.map(function (_ref2) {
|
|
349
304
|
var month = _ref2.month,
|
|
350
|
-
|
|
351
|
-
|
|
305
|
+
year = _ref2.year;
|
|
352
306
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
353
307
|
var _useMonth = useMonth({
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
308
|
+
year: year,
|
|
309
|
+
month: month,
|
|
310
|
+
firstDayOfWeek: firstDayOfWeek,
|
|
311
|
+
dayLabelFormat: dayLabelFormat,
|
|
312
|
+
weekdayLabelFormat: weekdayLabelFormat,
|
|
313
|
+
monthLabelFormat: monthLabelFormat
|
|
314
|
+
}),
|
|
315
|
+
days = _useMonth.days,
|
|
316
|
+
weekdayLabels = _useMonth.weekdayLabels,
|
|
317
|
+
monthLabel = _useMonth.monthLabel;
|
|
365
318
|
var isPrevMonthDisabled = !!minBookingDate && isSameMonth(new Date(year, month, 1), minBookingDate);
|
|
366
319
|
var isNextMonthDisabled = !!maxBookingDate && isSameMonth(new Date(year, month, 1), maxBookingDate);
|
|
367
320
|
var isCurrentMonth = new Date().getFullYear() === year && new Date().getMonth() === month;
|
|
@@ -385,32 +338,10 @@ var Calendar = function Calendar(_ref) {
|
|
|
385
338
|
}, renderDays(days)));
|
|
386
339
|
});
|
|
387
340
|
};
|
|
388
|
-
|
|
389
341
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
390
342
|
className: cn([className], {
|
|
391
343
|
modern: isModernType
|
|
392
344
|
})
|
|
393
345
|
}), renderMonths());
|
|
394
346
|
};
|
|
395
|
-
|
|
396
|
-
Calendar.propTypes = {
|
|
397
|
-
dataAttrs: PropTypes.shape({
|
|
398
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
399
|
-
day: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
400
|
-
month: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
401
|
-
arrowLeft: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
402
|
-
arrowRight: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
403
|
-
}),
|
|
404
|
-
isSingleDate: PropTypes.bool,
|
|
405
|
-
className: PropTypes.string,
|
|
406
|
-
startDate: PropTypes.instanceOf(Date),
|
|
407
|
-
endDate: PropTypes.instanceOf(Date),
|
|
408
|
-
minBookingDate: PropTypes.instanceOf(Date),
|
|
409
|
-
maxBookingDate: PropTypes.instanceOf(Date),
|
|
410
|
-
type: PropTypes.oneOf(Object.values(CalendarTypes)),
|
|
411
|
-
pastMonthsCount: PropTypes.number,
|
|
412
|
-
futureMonthsCount: PropTypes.number,
|
|
413
|
-
direction: PropTypes.oneOf(Object.values(CalendarDirectionTypes)),
|
|
414
|
-
onChange: PropTypes.func
|
|
415
|
-
};
|
|
416
347
|
export default Calendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-day{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;-webkit-box-sizing:content-box;box-sizing:content-box;color:var(--content);cursor:pointer;height:32px;line-height:24px;outline:none;padding:0 10px 8px 0;position:relative;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:32px;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:12px;line-height:18px}.mfui-day:last-child{padding-right:0}.mfui-day:not(:disabled):not(.mfui-day_active):focus:after,.mfui-day:not(:disabled):not(.mfui-day_active):hover:after,.mfui-day_active-modern:after,.mfui-day_active:after{background-color:var(--spbSky0);border-radius:50%!important;color:var(--content);content:"";height:32px;left:0;position:absolute;top:0;width:32px;z-index:1}.mfui-day_active-modern:after{height:38px;width:38px}.mfui-day_active-modern:hover:after{background-color:var(--brandGreen)!important}.mfui-day:not(:disabled):not(.mfui-day_active):hover:after{background-color:var(--spbSky0);color:var(--content)}.mfui-day:not(:disabled):not(.mfui-day_active):focus:after,.mfui-day_active-modern:after,.mfui-day_active:after{background-color:var(--brandGreen)}.mfui-day_disabled{cursor:default;opacity:.3;pointer-events:none}.mfui-day:not(:disabled):not(.mfui-day_active):focus,.mfui-day_active,.mfui-day_active-modern:after{color:var(--stcWhite)}.mfui-day_active+.mfui-day_active:before,.mfui-day_between:hover+.mfui-day:not(.mfui-day_monday).mfui-day_active:before{background-color:var(--spbSky1);content:"";display:block;height:32px;left:-22px;position:absolute;top:0;width:32px;z-index:-1}.mfui-day_between{border-radius:0;position:relative}.mfui-day_between:before{left:-22px;padding:0 20px}.mfui-day_between:after,.mfui-day_between:before{background-color:var(--spbSky1);content:"";display:block;height:32px;position:absolute;top:0;z-index:-1}.mfui-day_between:after{right:-16px;width:40px}.mfui-day_last,.mfui-day_sunday{border-radius:50%}.mfui-day_last:after,.mfui-day_sunday:after{border-radius:50%;right:10px;width:32px}.mfui-day_last:after{right:0}.mfui-day_first,.mfui-day_monday{border-radius:50%}.mfui-day_first:before,.mfui-day_monday:before{border-radius:50%;left:0;padding:0;width:32px}.mfui-day_sunday.mfui-day_first{border-radius:50%}.mfui-day__label{position:relative;z-index:99}.mfui-day_modern{height:38px;width:38.29px}.mfui-day_modern:not(:disabled):not(.mfui-day_active-modern):focus:after,.mfui-day_modern:not(:disabled):not(.mfui-day_active-modern):hover:after,.mfui-day_modern_active-modern:after{background-color:var(--spbSky0);border-radius:50%!important;color:var(--content);content:"";height:38px;left:0;position:absolute;top:0;width:38px;z-index:1}.mfui-day_modern:not(:disabled):not(.mfui-day_active-modern):hover:after{background-color:var(--spbSky0);color:var(--content)}.mfui-day_modern:not(:disabled):not(.mfui-day_active-modern):focus:after,.mfui-day_modern_active-modern:after{background-color:var(--brandGreen)}.mfui-day:not(:disabled):focus,.mfui-day_active-modern{color:var(--stcWhite)}.mfui-day_active-modern+.mfui-day_active-modern:before,.mfui-day_between-modern:hover+.mfui-day:not(.mfui-day_monday-modern).mfui-day_active-modern:before{background-color:var(--spbSky1);content:"";display:block;height:38px;left:-22px;position:absolute;top:0;width:40px;z-index:-1}.mfui-day_between-modern{border-radius:0;position:relative}.mfui-day_between-modern:before{left:-28px;padding:0 29px}.mfui-day_between-modern:after,.mfui-day_between-modern:before{background-color:var(--spbSky1);content:"";display:block;height:38px;position:absolute;top:0;z-index:-1}.mfui-day_between-modern:after{right:-18px;width:45px}.mfui-day_last-modern,.mfui-day_sunday-modern{border-radius:50%}.mfui-day_last-modern:before,.mfui-day_sunday-modern:before{padding-left:20px}.mfui-day_last-modern:after,.mfui-day_sunday-modern:after{border-radius:50%;right:10px;width:38.29px}.mfui-day_last-modern:after{right:0}.mfui-day_first-modern,.mfui-day_monday-modern{border-radius:50%}.mfui-day_first-modern:before,.mfui-day_monday-modern:before{border-radius:50%;left:0;padding:0;width:38px}.mfui-day_sunday-modern.mfui-day_first-modern{border-radius:50%}.mfui-day__label_modern{font-size:15px;font-weight:400;line-height:24px;text-align:center}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Day.
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './Day.scss';
|
|
3
3
|
export interface IDayPickerProps {
|
|
4
4
|
dataAttrs?: {
|
|
5
5
|
root?: Record<string, string>;
|
|
@@ -14,13 +14,13 @@ export interface IDayPickerProps {
|
|
|
14
14
|
onDateSelect: (date: Date) => void;
|
|
15
15
|
onDateFocus: (date: Date) => void;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type DayType = {
|
|
18
18
|
isBetween?: boolean;
|
|
19
19
|
dayLabel?: string;
|
|
20
20
|
date: Date;
|
|
21
21
|
isModern?: boolean;
|
|
22
22
|
onMouseLeave?: () => void;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type IDayProps = IDayPickerProps & DayType;
|
|
25
25
|
declare const Day: React.FC<IDayProps>;
|
|
26
26
|
export default Day;
|
|
@@ -1,57 +1,45 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import "core-js/modules/es.array.index-of.js";
|
|
3
2
|
import "core-js/modules/es.symbol.js";
|
|
4
|
-
import "core-js/modules/es.
|
|
5
|
-
|
|
3
|
+
import "core-js/modules/es.array.index-of.js";
|
|
6
4
|
var __rest = this && this.__rest || function (s, e) {
|
|
7
5
|
var t = {};
|
|
8
|
-
|
|
9
|
-
for (var p in s) {
|
|
10
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
13
7
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
8
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
15
9
|
}
|
|
16
10
|
return t;
|
|
17
11
|
};
|
|
18
|
-
|
|
19
|
-
import React from 'react';
|
|
12
|
+
import * as React from 'react';
|
|
20
13
|
import { useDay } from '@datepicker-react/hooks';
|
|
21
14
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
22
15
|
import isFirstDayOfMonth from 'date-fns/isFirstDayOfMonth';
|
|
23
16
|
import isLastDayOfMonth from 'date-fns/isLastDayOfMonth';
|
|
24
17
|
import isMonday from 'date-fns/isMonday';
|
|
25
18
|
import isSunday from 'date-fns/isSunday';
|
|
26
|
-
import PropTypes from 'prop-types';
|
|
27
19
|
import "./Day.css";
|
|
28
20
|
var cn = cnCreate('mfui-day');
|
|
29
|
-
|
|
30
21
|
var Day = function Day(_a) {
|
|
31
22
|
var dataAttrs = _a.dataAttrs,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
_a$isBetween = _a.isBetween,
|
|
24
|
+
isBetween = _a$isBetween === void 0 ? false : _a$isBetween,
|
|
25
|
+
dayLabel = _a.dayLabel,
|
|
26
|
+
date = _a.date,
|
|
27
|
+
_a$isModern = _a.isModern,
|
|
28
|
+
isModern = _a$isModern === void 0 ? false : _a$isModern,
|
|
29
|
+
onMouseLeave = _a.onMouseLeave,
|
|
30
|
+
pickerProps = __rest(_a, ["dataAttrs", "isBetween", "dayLabel", "date", "isModern", "onMouseLeave"]);
|
|
41
31
|
var dayRef = React.useRef(null);
|
|
42
|
-
|
|
43
32
|
var _useDay = useDay(_extends({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
date: date,
|
|
34
|
+
dayRef: dayRef
|
|
35
|
+
}, pickerProps)),
|
|
36
|
+
isSelected = _useDay.isSelected,
|
|
37
|
+
isSelectedStartOrEnd = _useDay.isSelectedStartOrEnd,
|
|
38
|
+
isDateDisabled = _useDay.disabledDate,
|
|
39
|
+
onClick = _useDay.onClick,
|
|
40
|
+
onKeyDown = _useDay.onKeyDown,
|
|
41
|
+
onMouseEnter = _useDay.onMouseEnter,
|
|
42
|
+
tabIndex = _useDay.tabIndex;
|
|
55
43
|
var modernClasses = {
|
|
56
44
|
modern: isModern,
|
|
57
45
|
disabled: isDateDisabled,
|
|
@@ -72,11 +60,9 @@ var Day = function Day(_a) {
|
|
|
72
60
|
disabled: isDateDisabled
|
|
73
61
|
};
|
|
74
62
|
var modClasses = isModern ? modernClasses : classicClasses;
|
|
75
|
-
|
|
76
63
|
var handleMouseLeave = function handleMouseLeave() {
|
|
77
64
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
78
65
|
};
|
|
79
|
-
|
|
80
66
|
return /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
81
67
|
onClick: onClick,
|
|
82
68
|
onKeyDown: onKeyDown,
|
|
@@ -92,22 +78,4 @@ var Day = function Day(_a) {
|
|
|
92
78
|
})
|
|
93
79
|
}, dayLabel));
|
|
94
80
|
};
|
|
95
|
-
|
|
96
|
-
Day.propTypes = {
|
|
97
|
-
dataAttrs: PropTypes.shape({
|
|
98
|
-
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
99
|
-
}),
|
|
100
|
-
dayLabel: PropTypes.string,
|
|
101
|
-
date: PropTypes.instanceOf(Date).isRequired,
|
|
102
|
-
focusedDate: PropTypes.instanceOf(Date),
|
|
103
|
-
isModern: PropTypes.bool,
|
|
104
|
-
isDateSelected: PropTypes.func.isRequired,
|
|
105
|
-
isDateHovered: PropTypes.func.isRequired,
|
|
106
|
-
isFirstOrLastSelectedDate: PropTypes.func.isRequired,
|
|
107
|
-
isDateBlocked: PropTypes.func.isRequired,
|
|
108
|
-
isDateFocused: PropTypes.func.isRequired,
|
|
109
|
-
onDateHover: PropTypes.func.isRequired,
|
|
110
|
-
onDateSelect: PropTypes.func.isRequired,
|
|
111
|
-
onDateFocus: PropTypes.func.isRequired
|
|
112
|
-
};
|
|
113
81
|
export default Day;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-month{position:relative;z-index:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:28px 0;width:284px}.mfui-month,.mfui-month__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-month__header{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:20px;text-transform:capitalize;width:282px}.mfui-month__header svg{cursor:pointer;height:24.5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:var(--content)}.mfui-month__title{font-size:15px;font-weight:500;line-height:24px;text-align:center;width:224px}.mfui-month__weekday-labels{border-bottom:1px solid var(--spbSky1);-webkit-column-gap:22px;-moz-column-gap:22px;column-gap:22px;display:grid;grid-template-columns:repeat(7,1fr);padding-bottom:13px;width:272px}.mfui-month__weekday{color:var(--content);font-size:12px;font-weight:600;height:16px;line-height:18px;line-height:24px;text-align:center;text-transform:capitalize;width:20px}.mfui-month__days{-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;display:grid;grid-template-columns:repeat(7,1fr);margin-top:8px;row-gap:0;width:284px}.mfui-month svg.mfui-month__arrow_disabled{cursor:default;opacity:.5}.mfui-month_modern{padding:0 0 24px;width:344px}.mfui-month_modern .mfui-month__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:16px;text-transform:capitalize;width:328px}.mfui-month_modern .mfui-month__title{font-size:15px;font-weight:500;line-height:24px;margin:0 auto;text-align:center;width:224px}.mfui-month_modern .mfui-month__weekday-labels{border-bottom:none;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;display:grid;grid-template-columns:repeat(7,1fr);padding-bottom:0;width:328px}.mfui-month_modern .mfui-month__weekday{color:var(--spbSky3);font-size:15px;font-weight:400;height:24px;line-height:24px;margin:0 auto;text-align:center;text-transform:capitalize;width:20px}.mfui-month_modern .mfui-month__days{-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;display:grid;grid-template-columns:repeat(7,1fr);margin-top:10px;row-gap:0;width:328px}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { FirstDayOfWeek, MonthType } from '@datepicker-react/hooks';
|
|
3
|
-
import './Month.
|
|
3
|
+
import './Month.scss';
|
|
4
4
|
export interface IMonthPickerProps {
|
|
5
5
|
firstDayOfWeek: FirstDayOfWeek;
|
|
6
6
|
activeMonths: MonthType[];
|
|
@@ -21,6 +21,7 @@ export interface IMonthProps {
|
|
|
21
21
|
goToPreviousMonth: () => void;
|
|
22
22
|
goToNextMonth: () => void;
|
|
23
23
|
isModern?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
24
25
|
}
|
|
25
26
|
declare const Month: React.FC<IMonthProps>;
|
|
26
27
|
export default Month;
|