@salutejs/plasma-new-hope 0.174.0-canary.1497.11463811587.0 → 0.174.0-canary.1497.11500952087.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
- package/cjs/components/Attach/Attach.js +3 -4
- package/cjs/components/Attach/Attach.js.map +1 -1
- package/cjs/components/Attach/components/AttachButton/AttachButton.js +0 -1
- package/cjs/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
- package/cjs/components/Attach/ui/Button/Button.styles.js +0 -1
- package/cjs/components/Attach/ui/Button/Button.styles.js.map +1 -1
- package/cjs/components/Attach/ui/Cell/Cell.styles.js +0 -2
- package/cjs/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
- package/cjs/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
- package/cjs/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
- package/cjs/components/Attach/utils/getFileicon.js +3 -4
- package/cjs/components/Attach/utils/getFileicon.js.map +1 -1
- package/cjs/components/Attach/utils/index.js +0 -3
- package/cjs/components/Attach/utils/index.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.js +5 -6
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.styles.js +2 -3
- package/cjs/components/Autocomplete/Autocomplete.styles.js.map +1 -1
- package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
- package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/Avatar/Avatar.js +2 -3
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
- package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/cjs/components/Button/Button.styles.js +0 -3
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +5 -5
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
- package/cjs/components/Calendar/hooks/useDays.js +2 -2
- package/cjs/components/Calendar/hooks/useKeyNavigation.js +1 -1
- package/cjs/components/Calendar/hooks/useMonths.js +2 -2
- package/cjs/components/Calendar/hooks/useQuarters.js +2 -2
- package/cjs/components/Calendar/hooks/useYears.js +2 -2
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +9 -5
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +9 -5
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +9 -5
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +9 -5
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +11 -12
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +6 -8
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +7 -23
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_1us8jz1.css → Item.styles_y71664.css} +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.js +4 -11
- package/cjs/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
- package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -7
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
- package/cjs/components/Drawer/Drawer.js +5 -10
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Drawer/Drawer.styles.js +0 -4
- package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
- package/cjs/components/Drawer/hooks/useDrawer.js +0 -4
- package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
- package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
- package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.css +1 -1
- package/cjs/components/Dropdown/Dropdown.js +3 -9
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
- package/cjs/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
- package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
- package/cjs/components/Editable/Editable.js +3 -4
- package/cjs/components/Editable/Editable.js.map +1 -1
- package/cjs/components/Editable/utils/clearSelection.js +0 -2
- package/cjs/components/Editable/utils/clearSelection.js.map +1 -1
- package/cjs/components/Editable/utils/selectText.js +0 -2
- package/cjs/components/Editable/utils/selectText.js.map +1 -1
- package/cjs/components/EmptyState/EmptyState.styles.js +1 -2
- package/cjs/components/EmptyState/EmptyState.styles.js.map +1 -1
- package/cjs/components/IconButton/IconButton.js +1 -1
- package/cjs/components/IconButton/IconButton.styles.js +0 -8
- package/cjs/components/IconButton/IconButton.styles.js.map +1 -1
- package/cjs/components/Modal/Modal.js +6 -8
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/hooks/useModal.js +0 -4
- package/cjs/components/Modal/hooks/useModal.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +2 -3
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +3 -4
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Pagination/Pagination.styles.js +1 -2
- package/cjs/components/Pagination/Pagination.styles.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/Popup/Popup.js +2 -2
- package/cjs/components/Popup/PopupContext.js +1 -1
- package/cjs/components/Range/Range.styles.js +0 -1
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/cjs/components/Select/Select.js +11 -12
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/Select.styles.js +2 -5
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/hooks/usePathMaps.js +0 -2
- package/cjs/components/Select/hooks/usePathMaps.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.js +1 -2
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +4 -5
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Button/Button.js +1 -1
- package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
- package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
- package/cjs/components/Select/utils/getButtonLabel.js +0 -2
- package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
- package/cjs/components/Sheet/Sheet.js +3 -3
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
- package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
- package/cjs/components/Slider/Slider.js +0 -8
- package/cjs/components/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.js +1 -2
- package/cjs/components/Slider/components/Double/Double.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.styles.js +0 -1
- package/cjs/components/Slider/components/Double/Double.styles.js.map +1 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.js +1 -2
- package/cjs/components/Slider/components/Single/Single.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +1 -1
- package/cjs/components/Steps/Steps.js +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/cjs/components/TextArea/TextArea.js +3 -3
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.styles.js +4 -5
- package/cjs/components/TextArea/TextArea.styles.js.map +1 -1
- package/cjs/components/TextArea/ui/Hint/Hint.js +1 -2
- package/cjs/components/TextArea/ui/Hint/Hint.js.map +1 -1
- package/cjs/components/TextField/TextField.js +4 -4
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.styles.js +3 -4
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/ui/Hint/Hint.js +1 -2
- package/cjs/components/TextField/ui/Hint/Hint.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/cjs/components/Toast/Toast.styles.js +1 -1
- package/cjs/components/Toast/ToastController.js +1 -1
- package/cjs/components/Toast/utils.js +1 -2
- package/cjs/components/Toast/utils.js.map +1 -1
- package/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
- package/cjs/components/Tooltip/Tooltip.js +2 -3
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/engines/index.js +0 -2
- package/cjs/engines/index.js.map +1 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/cjs/index.css +10 -10
- package/cjs/index.js +48 -51
- package/cjs/index.js.map +1 -1
- package/cjs/utils/index.js +0 -5
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +5 -1
- package/emotion/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +5 -1
- package/emotion/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +5 -1
- package/emotion/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +5 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +14 -20
- package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
- package/emotion/cjs/components/TextArea/TextArea.js +2 -2
- package/emotion/cjs/components/TextArea/TextArea.styles.js +20 -20
- package/emotion/cjs/components/TextField/TextField.js +2 -2
- package/emotion/cjs/components/TextField/TextField.styles.js +24 -24
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/es/components/Calendar/ui/CalendarDays/CalendarDays.js +5 -1
- package/emotion/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +5 -1
- package/emotion/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +5 -1
- package/emotion/es/components/Calendar/ui/CalendarYears/CalendarYears.js +5 -1
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +14 -20
- package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +2 -2
- package/emotion/es/components/TextArea/TextArea.styles.js +20 -20
- package/emotion/es/components/TextField/TextField.js +2 -2
- package/emotion/es/components/TextField/TextField.styles.js +24 -24
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/es/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/package.json +2 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
- package/es/components/Attach/Attach.js +3 -4
- package/es/components/Attach/Attach.js.map +1 -1
- package/es/components/Attach/components/AttachButton/AttachButton.js +0 -1
- package/es/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
- package/es/components/Attach/ui/Button/Button.styles.js +0 -1
- package/es/components/Attach/ui/Button/Button.styles.js.map +1 -1
- package/es/components/Attach/ui/Cell/Cell.styles.js +0 -2
- package/es/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
- package/es/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
- package/es/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
- package/es/components/Attach/utils/getFileicon.js +3 -4
- package/es/components/Attach/utils/getFileicon.js.map +1 -1
- package/es/components/Attach/utils/index.js +0 -3
- package/es/components/Attach/utils/index.js.map +1 -1
- package/es/components/Autocomplete/Autocomplete.js +5 -6
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Autocomplete/Autocomplete.styles.js +2 -3
- package/es/components/Autocomplete/Autocomplete.styles.js.map +1 -1
- package/es/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
- package/es/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
- package/es/components/Avatar/Avatar.js +2 -3
- package/es/components/Avatar/Avatar.js.map +1 -1
- package/es/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
- package/es/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/es/components/Button/Button.styles.js +0 -3
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js +5 -5
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
- package/es/components/Calendar/hooks/useDays.js +2 -2
- package/es/components/Calendar/hooks/useKeyNavigation.js +1 -1
- package/es/components/Calendar/hooks/useMonths.js +2 -2
- package/es/components/Calendar/hooks/useQuarters.js +2 -2
- package/es/components/Calendar/hooks/useYears.js +2 -2
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +9 -5
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +9 -5
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +9 -5
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +9 -5
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/es/components/Combobox/ComboboxNew/Combobox.js +11 -12
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +6 -8
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +7 -23
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_1us8jz1.css → Item.styles_y71664.css} +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.js +4 -11
- package/es/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
- package/es/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
- package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js +1 -7
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.js +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
- package/es/components/Drawer/Drawer.js +5 -10
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Drawer/Drawer.styles.js +0 -4
- package/es/components/Drawer/Drawer.styles.js.map +1 -1
- package/es/components/Drawer/hooks/useDrawer.js +0 -4
- package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
- package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
- package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
- package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
- package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/es/components/Dropdown/Dropdown.css +1 -1
- package/es/components/Dropdown/Dropdown.js +3 -9
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +1 -1
- package/es/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
- package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
- package/es/components/Editable/Editable.js +3 -4
- package/es/components/Editable/Editable.js.map +1 -1
- package/es/components/Editable/utils/clearSelection.js +0 -2
- package/es/components/Editable/utils/clearSelection.js.map +1 -1
- package/es/components/Editable/utils/selectText.js +0 -2
- package/es/components/Editable/utils/selectText.js.map +1 -1
- package/es/components/EmptyState/EmptyState.styles.js +1 -2
- package/es/components/EmptyState/EmptyState.styles.js.map +1 -1
- package/es/components/IconButton/IconButton.js +1 -1
- package/es/components/IconButton/IconButton.styles.js +0 -8
- package/es/components/IconButton/IconButton.styles.js.map +1 -1
- package/es/components/Modal/Modal.js +6 -8
- package/es/components/Modal/Modal.js.map +1 -1
- package/es/components/Modal/hooks/useModal.js +0 -4
- package/es/components/Modal/hooks/useModal.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +2 -3
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +3 -4
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Pagination/Pagination.styles.js +1 -2
- package/es/components/Pagination/Pagination.styles.js.map +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/es/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
- package/es/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
- package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
- package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
- package/es/components/Popover/Popover.js +1 -1
- package/es/components/Popup/Popup.js +2 -2
- package/es/components/Popup/PopupContext.js +1 -1
- package/es/components/Range/Range.styles.js +0 -1
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/es/components/Select/Select.js +11 -12
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/Select.styles.js +2 -5
- package/es/components/Select/Select.styles.js.map +1 -1
- package/es/components/Select/hooks/usePathMaps.js +0 -2
- package/es/components/Select/hooks/usePathMaps.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.js +1 -2
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +4 -5
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Button/Button.js +1 -1
- package/es/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
- package/es/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
- package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
- package/es/components/Select/utils/getButtonLabel.js +0 -2
- package/es/components/Select/utils/getButtonLabel.js.map +1 -1
- package/es/components/Sheet/Sheet.js +3 -3
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/es/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
- package/es/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
- package/es/components/Slider/Slider.js +0 -8
- package/es/components/Slider/Slider.js.map +1 -1
- package/es/components/Slider/components/Double/Double.js +1 -2
- package/es/components/Slider/components/Double/Double.js.map +1 -1
- package/es/components/Slider/components/Double/Double.styles.js +0 -1
- package/es/components/Slider/components/Double/Double.styles.js.map +1 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/es/components/Slider/components/Single/Single.js +1 -2
- package/es/components/Slider/components/Single/Single.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.js +1 -1
- package/es/components/Steps/Steps.js +1 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/es/components/TextArea/TextArea.js +3 -3
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.styles.js +4 -5
- package/es/components/TextArea/TextArea.styles.js.map +1 -1
- package/es/components/TextArea/ui/Hint/Hint.js +1 -2
- package/es/components/TextArea/ui/Hint/Hint.js.map +1 -1
- package/es/components/TextField/TextField.js +4 -4
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.styles.js +3 -4
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/ui/Hint/Hint.js +1 -2
- package/es/components/TextField/ui/Hint/Hint.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/es/components/Toast/Toast.styles.js +1 -1
- package/es/components/Toast/ToastController.js +1 -1
- package/es/components/Toast/utils.js +1 -2
- package/es/components/Toast/utils.js.map +1 -1
- package/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -3
- package/es/components/Tooltip/Tooltip.js.map +1 -1
- package/es/engines/index.js +0 -2
- package/es/engines/index.js.map +1 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/es/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/es/index.css +10 -10
- package/es/index.js +21 -24
- package/es/index.js.map +1 -1
- package/es/utils/index.js +0 -3
- package/es/utils/index.js.map +1 -1
- package/package.json +5 -2
- package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +5 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +5 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +5 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +5 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +4 -10
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
- package/styled-components/cjs/components/TextArea/TextArea.js +1 -1
- package/styled-components/cjs/components/TextArea/TextArea.styles.js +2 -2
- package/styled-components/cjs/components/TextField/TextField.js +1 -1
- package/styled-components/cjs/components/TextField/TextField.styles.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +5 -1
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +5 -1
- package/styled-components/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +5 -1
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +5 -1
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -2
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +4 -10
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.styles.js +2 -2
- package/styled-components/es/components/TextField/TextField.js +1 -1
- package/styled-components/es/components/TextField/TextField.styles.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/package.json +2 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarMonths/CalendarMonths.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarQuarters/CalendarQuarters.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarYears/CalendarYears.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +4 -0
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.styles.d.ts +1 -1
- package/types/components/TextArea/TextArea.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +1 -1
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useMonths } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_MONTH_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n value,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredMonth,\n onChangeMonth,\n onHoverMonth,\n onSetSelected,\n onKeyDown,\n locale,\n}) => {\n const [months, selected] = useMonths({ date: currentDate, value, eventList, disabledList, min, max, locale });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_MONTH_STEP : 0;\n\n const monthItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarMonthFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarMonthFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarMonthFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarMonthFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarMonthFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarMonthFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarMonthSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarMonthItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarMonthItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarMonthItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeMonth = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeMonth(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverMonth?.(undefined);\n }\n },\n [getSelectedDate, onChangeMonth, offset, value, onHoverMonth],\n );\n\n const handleOnHoverMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverMonth?.(selectedDate);\n },\n [getSelectedDate, onHoverMonth, value],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(\n (\n {\n monthName,\n monthIndex,\n isSelected,\n isCurrent,\n monthFullName,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={monthItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredMonth)}\n inRange={getInRange(value, date, hoveredMonth, inRange)}\n sideInRange={getSideInRange(value, date, hoveredMonth, isSelected)}\n onClick={disabled ? undefined : handleOnChangeMonth(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverMonth}\n key={`StyledMonth-${i}-${j}`}\n role=\"gridcell\"\n aria-label={monthFullName}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {monthName}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarMonths>\n );\n};\n"],"names":["CalendarMonths","_ref","currentDate","date","value","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredMonth","onChangeMonth","onHoverMonth","onSetSelected","onKeyDown","locale","_useMonths","useMonths","_useMonths2","_slicedToArray","months","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_MONTH_STEP","monthItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarMonthFontFamily","dateStructureFontSize","calendarMonthFontSize","dateStructureFontWeight","calendarMonthFontWeight","dateStructureFontLineHeight","calendarMonthFontLineHeight","dateStructureFontLetterSpacing","calendarMonthFontLetterSpacing","dateStructureFontStyle","calendarMonthFontStyle","dateStructureSelectedFontWeight","calendarMonthSelectedFontWeight","dateStructureWidth","calendarMonthItemWidth","dateStructureHeight","calendarMonthItemHeight","dateStructureBorderRadius","calendarMonthItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeMonth","i","j","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverMonth","isSelectedDone","Array","isArray","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarMonths","role","map","month","StyledFlex","key","_ref2","monthName","isSelected","isCurrent","monthFullName","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAiBpD;AAAA,EAAA,IAhBIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,GAAG,GAAAR,IAAA,CAAHQ,GAAG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;AACf,QAAA,YAAA,EAAYS,aAAc;AAC1BK,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCa,QAAAA,cAAc,EAAEZ,aAAc;QAC9Ba,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElBtB,SACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
|
1
|
+
{"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useMonths } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_MONTH_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n value,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredMonth,\n onChangeMonth,\n onHoverMonth,\n onSetSelected,\n onKeyDown,\n locale,\n}) => {\n const [months, selected] = useMonths({ date: currentDate, value, eventList, disabledList, min, max, locale });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_MONTH_STEP : 0;\n\n const monthItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarMonthFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarMonthFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarMonthFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarMonthFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarMonthFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarMonthFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarMonthSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarMonthItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarMonthItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarMonthItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeMonth = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeMonth(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverMonth?.(undefined);\n }\n },\n [getSelectedDate, onChangeMonth, offset, value, onHoverMonth],\n );\n\n const handleOnHoverMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverMonth?.(selectedDate);\n },\n [getSelectedDate, onHoverMonth, value],\n );\n\n const handleMouseOutGrid = () => onHoverMonth?.(undefined);\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths\n role=\"grid\"\n aria-labelledby=\"id-grid-label\"\n onKeyDown={onKeyDown}\n onMouseLeave={handleMouseOutGrid}\n >\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(\n (\n {\n monthName,\n monthIndex,\n isSelected,\n isCurrent,\n monthFullName,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={monthItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredMonth)}\n inRange={getInRange(value, date, hoveredMonth, inRange)}\n sideInRange={getSideInRange(value, date, hoveredMonth, isSelected)}\n onClick={disabled ? undefined : handleOnChangeMonth(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverMonth}\n key={`StyledMonth-${i}-${j}`}\n role=\"gridcell\"\n aria-label={monthFullName}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {monthName}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarMonths>\n );\n};\n"],"names":["CalendarMonths","_ref","currentDate","date","value","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredMonth","onChangeMonth","onHoverMonth","onSetSelected","onKeyDown","locale","_useMonths","useMonths","_useMonths2","_slicedToArray","months","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_MONTH_STEP","monthItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarMonthFontFamily","dateStructureFontSize","calendarMonthFontSize","dateStructureFontWeight","calendarMonthFontWeight","dateStructureFontLineHeight","calendarMonthFontLineHeight","dateStructureFontLetterSpacing","calendarMonthFontLetterSpacing","dateStructureFontStyle","calendarMonthFontStyle","dateStructureSelectedFontWeight","calendarMonthSelectedFontWeight","dateStructureWidth","calendarMonthItemWidth","dateStructureHeight","calendarMonthItemHeight","dateStructureBorderRadius","calendarMonthItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeMonth","i","j","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverMonth","isSelectedDone","Array","isArray","handleMouseOutGrid","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarMonths","role","onMouseLeave","map","month","StyledFlex","key","_ref2","monthName","isSelected","isCurrent","monthFullName","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAiBpD;AAAA,EAAA,IAhBIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,GAAG,GAAAR,IAAA,CAAHQ,GAAG;IACHC,SAAS,GAAAT,IAAA,CAATS,SAAS;IACTC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,QAAQ,GAAAX,IAAA,CA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G,EAAA,cAAA,CAAA7D,MAAA,CAAiBoC,CAAC,OAAApC,MAAA,CAAIqC,CAAC,CAAG;AAC7BmB,QAAAA,IAAI,EAAC,UAAU;AACf,QAAA,YAAA,EAAYU,aAAc;AAC1BK,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCa,QAAAA,cAAc,EAAEZ,aAAc;QAC9Ba,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElBtB,SACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
|
-
var constants = require('../../utils/constants.js');
|
8
|
-
var calendarGridHelper = require('../../utils/calendarGridHelper.js');
|
9
|
-
var calendarRangeHelper = require('../../utils/calendarRangeHelper.js');
|
10
|
-
var useQuarters = require('../../hooks/useQuarters.js');
|
11
7
|
var Calendar_tokens = require('../../Calendar.tokens.js');
|
12
8
|
var DateStructureItem = require('../DateStructureItem/DateStructureItem.js');
|
13
9
|
var CalendarQuarters_styles = require('./CalendarQuarters.styles.js');
|
10
|
+
var useQuarters = require('../../hooks/useQuarters.js');
|
11
|
+
var constants = require('../../utils/constants.js');
|
12
|
+
var calendarGridHelper = require('../../utils/calendarGridHelper.js');
|
13
|
+
var calendarRangeHelper = require('../../utils/calendarRangeHelper.js');
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Компонент кварталов в календаре.
|
@@ -87,6 +87,9 @@ var CalendarQuarters = function CalendarQuarters(_ref) {
|
|
87
87
|
}
|
88
88
|
onHoverQuarter === null || onHoverQuarter === void 0 || onHoverQuarter(selectedDate);
|
89
89
|
}, [getSelectedDate, onHoverQuarter, value]);
|
90
|
+
var handleMouseOutGrid = function handleMouseOutGrid() {
|
91
|
+
return onHoverQuarter === null || onHoverQuarter === void 0 ? void 0 : onHoverQuarter(undefined);
|
92
|
+
};
|
90
93
|
var getRefs = React.useCallback(function (element, i, j) {
|
91
94
|
outerRefs.current[i + offset][j] = element;
|
92
95
|
}, [offset, outerRefs]);
|
@@ -99,7 +102,8 @@ var CalendarQuarters = function CalendarQuarters(_ref) {
|
|
99
102
|
return /*#__PURE__*/React.createElement(CalendarQuarters_styles.StyledCalendarQuarters, {
|
100
103
|
role: "grid",
|
101
104
|
"aria-labelledby": "id-grid-label",
|
102
|
-
onKeyDown: onKeyDown
|
105
|
+
onKeyDown: onKeyDown,
|
106
|
+
onMouseLeave: handleMouseOutGrid
|
103
107
|
}, quarters.map(function (quarter, i) {
|
104
108
|
return /*#__PURE__*/React.createElement(CalendarQuarters_styles.StyledFlex, {
|
105
109
|
role: "row",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarQuarters.js","sources":["../../../../../src/components/Calendar/ui/CalendarQuarters/CalendarQuarters.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useQuarters } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_QUARTER_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarQuartersProps } from './CalendarQuarters.types';\nimport { StyledCalendarQuarters, StyledFlex } from './CalendarQuarters.styles';\n\n/**\n * Компонент кварталов в календаре.\n */\nexport const CalendarQuarters: React.FC<CalendarQuartersProps> = ({\n date: currentDate,\n value,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredQuarter,\n onChangeQuarter,\n onHoverQuarter,\n onSetSelected,\n onKeyDown,\n}) => {\n const [quarters, selected] = useQuarters({ date: currentDate, value, eventList, disabledList, min, max });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_QUARTER_STEP : 0;\n\n const quarterItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarQuarterFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarQuarterFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarQuarterFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarQuarterFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarQuarterFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarQuarterFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarQuarterSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarQuarterItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarQuarterItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarQuarterItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeQuarter = useCallback(\n (i: number, j: number, quarterName: string) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeQuarter(selectedDate, [i + offset, j], quarterName);\n\n if (isSelectProcess(value)) {\n onHoverQuarter?.(undefined);\n }\n },\n [getSelectedDate, onChangeQuarter, offset, value, onHoverQuarter],\n );\n\n const handleOnHoverQuarter = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverQuarter?.(selectedDate);\n },\n [getSelectedDate, onHoverQuarter, value],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarQuarters role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {quarters.map((quarter, i) => (\n <StyledFlex role=\"row\" key={i}>\n {quarter.map(\n (\n {\n quarterName,\n isSelected,\n isCurrent,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={quarterItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredQuarter)}\n inRange={getInRange(value, date, hoveredQuarter, inRange)}\n sideInRange={getSideInRange(value, date, hoveredQuarter, isSelected)}\n onClick={disabled ? undefined : handleOnChangeQuarter(i, j, String(quarterName))}\n onMouseOver={disabled ? undefined : handleOnHoverQuarter}\n key={`StyledQuarter-${i}-${j}`}\n role=\"gridcell\"\n aria-label={quarterName}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {quarterName}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarQuarters>\n );\n};\n"],"names":["CalendarQuarters","_ref","currentDate","date","value","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredQuarter","onChangeQuarter","onHoverQuarter","onSetSelected","onKeyDown","_useQuarters","useQuarters","_useQuarters2","_slicedToArray","quarters","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_QUARTER_STEP","quarterItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarQuarterFontFamily","dateStructureFontSize","calendarQuarterFontSize","dateStructureFontWeight","calendarQuarterFontWeight","dateStructureFontLineHeight","calendarQuarterFontLineHeight","dateStructureFontLetterSpacing","calendarQuarterFontLetterSpacing","dateStructureFontStyle","calendarQuarterFontStyle","dateStructureSelectedFontWeight","calendarQuarterSelectedFontWeight","dateStructureWidth","calendarQuarterItemWidth","dateStructureHeight","calendarQuarterItemHeight","dateStructureBorderRadius","calendarQuarterItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeQuarter","i","j","quarterName","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverQuarter","isSelectedDone","Array","isArray","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarQuarters","role","map","quarter","StyledFlex","key","_ref2","isSelected","isCurrent","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","String","onMouseOver","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,gBAAiD,GAAG,SAApDA,gBAAiDA,CAAAC,IAAA,EAgBxD;AAAA,EAAA,IAfIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,aAAa,GAAAJ,IAAA,CAA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BAAA,CAAA5D,MAAA,CAAmBoC,CAAC,OAAApC,MAAA,CAAIqC,CAAC,CAAG;AAC/BmB,QAAAA,IAAI,EAAC,UAAU;AACf,QAAA,YAAA,EAAYlB,WAAY;AACxB8B,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCc,QAAAA,cAAc,EAAEb,aAAc;QAC9Bc,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElB7C,WACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACmB,CAAC,CAAA;AAEjC;;;;"}
|
1
|
+
{"version":3,"file":"CalendarQuarters.js","sources":["../../../../../src/components/Calendar/ui/CalendarQuarters/CalendarQuarters.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useQuarters } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_QUARTER_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarQuartersProps } from './CalendarQuarters.types';\nimport { StyledCalendarQuarters, StyledFlex } from './CalendarQuarters.styles';\n\n/**\n * Компонент кварталов в календаре.\n */\nexport const CalendarQuarters: React.FC<CalendarQuartersProps> = ({\n date: currentDate,\n value,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredQuarter,\n onChangeQuarter,\n onHoverQuarter,\n onSetSelected,\n onKeyDown,\n}) => {\n const [quarters, selected] = useQuarters({ date: currentDate, value, eventList, disabledList, min, max });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_QUARTER_STEP : 0;\n\n const quarterItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarQuarterFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarQuarterFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarQuarterFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarQuarterFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarQuarterFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarQuarterFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarQuarterSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarQuarterItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarQuarterItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarQuarterItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeQuarter = useCallback(\n (i: number, j: number, quarterName: string) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeQuarter(selectedDate, [i + offset, j], quarterName);\n\n if (isSelectProcess(value)) {\n onHoverQuarter?.(undefined);\n }\n },\n [getSelectedDate, onChangeQuarter, offset, value, onHoverQuarter],\n );\n\n const handleOnHoverQuarter = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverQuarter?.(selectedDate);\n },\n [getSelectedDate, onHoverQuarter, value],\n );\n\n const handleMouseOutGrid = () => onHoverQuarter?.(undefined);\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarQuarters\n role=\"grid\"\n aria-labelledby=\"id-grid-label\"\n onKeyDown={onKeyDown}\n onMouseLeave={handleMouseOutGrid}\n >\n {quarters.map((quarter, i) => (\n <StyledFlex role=\"row\" key={i}>\n {quarter.map(\n (\n {\n quarterName,\n isSelected,\n isCurrent,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={quarterItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredQuarter)}\n inRange={getInRange(value, date, hoveredQuarter, inRange)}\n sideInRange={getSideInRange(value, date, hoveredQuarter, isSelected)}\n onClick={disabled ? undefined : handleOnChangeQuarter(i, j, String(quarterName))}\n onMouseOver={disabled ? undefined : handleOnHoverQuarter}\n key={`StyledQuarter-${i}-${j}`}\n role=\"gridcell\"\n aria-label={quarterName}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {quarterName}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarQuarters>\n );\n};\n"],"names":["CalendarQuarters","_ref","currentDate","date","value","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredQuarter","onChangeQuarter","onHoverQuarter","onSetSelected","onKeyDown","_useQuarters","useQuarters","_useQuarters2","_slicedToArray","quarters","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_QUARTER_STEP","quarterItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarQuarterFontFamily","dateStructureFontSize","calendarQuarterFontSize","dateStructureFontWeight","calendarQuarterFontWeight","dateStructureFontLineHeight","calendarQuarterFontLineHeight","dateStructureFontLetterSpacing","calendarQuarterFontLetterSpacing","dateStructureFontStyle","calendarQuarterFontStyle","dateStructureSelectedFontWeight","calendarQuarterSelectedFontWeight","dateStructureWidth","calendarQuarterItemWidth","dateStructureHeight","calendarQuarterItemHeight","dateStructureBorderRadius","calendarQuarterItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeQuarter","i","j","quarterName","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverQuarter","isSelectedDone","Array","isArray","handleMouseOutGrid","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarQuarters","role","onMouseLeave","map","quarter","StyledFlex","key","_ref2","isSelected","isCurrent","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","String","onMouseOver","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,gBAAiD,GAAG,SAApDA,gBAAiDA,CAAAC,IAAA,EAgBxD;AAAA,EAAA,IAfIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY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,EAAE6C,MAAM,CAAC5C,WAAW,CAAC,CAAE;AACjF6C,QAAAA,WAAW,EAAEd,QAAQ,GAAG3B,SAAS,GAAGC,oBAAqB;QACzDmB,GAAG,EAAA,gBAAA,CAAA9D,MAAA,CAAmBoC,CAAC,OAAApC,MAAA,CAAIqC,CAAC,CAAG;AAC/BoB,QAAAA,IAAI,EAAC,UAAU;AACf,QAAA,YAAA,EAAYnB,WAAY;AACxBgC,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCc,QAAAA,cAAc,EAAEb,aAAc;QAC9Bc,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElB/C,WACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACmB,CAAC,CAAA;AAEjC;;;;"}
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
|
-
var constants = require('../../utils/constants.js');
|
8
|
-
var calendarGridHelper = require('../../utils/calendarGridHelper.js');
|
9
|
-
var calendarRangeHelper = require('../../utils/calendarRangeHelper.js');
|
10
|
-
var useYears = require('../../hooks/useYears.js');
|
11
7
|
var Calendar_tokens = require('../../Calendar.tokens.js');
|
12
8
|
var DateStructureItem = require('../DateStructureItem/DateStructureItem.js');
|
13
9
|
var CalendarYears_styles = require('./CalendarYears.styles.js');
|
10
|
+
var useYears = require('../../hooks/useYears.js');
|
11
|
+
var constants = require('../../utils/constants.js');
|
12
|
+
var calendarGridHelper = require('../../utils/calendarGridHelper.js');
|
13
|
+
var calendarRangeHelper = require('../../utils/calendarRangeHelper.js');
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Компонент годов в календаре.
|
@@ -89,6 +89,9 @@ var CalendarYears = function CalendarYears(_ref) {
|
|
89
89
|
}
|
90
90
|
onHoverYear === null || onHoverYear === void 0 || onHoverYear(selectedDate);
|
91
91
|
}, [getSelectedDate, onHoverYear, value]);
|
92
|
+
var handleMouseOutGrid = function handleMouseOutGrid() {
|
93
|
+
return onHoverYear === null || onHoverYear === void 0 ? void 0 : onHoverYear(undefined);
|
94
|
+
};
|
92
95
|
var getRefs = React.useCallback(function (element, i, j) {
|
93
96
|
outerRefs.current[i + offset][j] = element;
|
94
97
|
}, [outerRefs]);
|
@@ -101,7 +104,8 @@ var CalendarYears = function CalendarYears(_ref) {
|
|
101
104
|
return /*#__PURE__*/React.createElement(CalendarYears_styles.StyledCalendarYears, {
|
102
105
|
role: "grid",
|
103
106
|
"aria-labelledby": "id-grid-label",
|
104
|
-
onKeyDown: onKeyDown
|
107
|
+
onKeyDown: onKeyDown,
|
108
|
+
onMouseLeave: handleMouseOutGrid
|
105
109
|
}, years.map(function (year, i) {
|
106
110
|
return /*#__PURE__*/React.createElement(CalendarYears_styles.StyledFlex, {
|
107
111
|
role: "row",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useYears } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_YEAR_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n value,\n startYear,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredYear,\n onChangeYear,\n onHoverYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears({ date: currentDate, value, startYear, eventList, disabledList, min, max });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_YEAR_STEP : 0;\n\n const yearItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarYearFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarYearFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarYearFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarYearFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarYearFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarYearFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarYearSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarYearItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarYearItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarYearItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeYear = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeYear(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverYear?.(undefined);\n }\n },\n [getSelectedDate, onChangeYear, offset, value, onHoverYear],\n );\n\n const handleOnHoverYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverYear?.(selectedDate);\n },\n [getSelectedDate, onHoverYear, value],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(\n (\n {\n yearValue,\n isSelected,\n isCurrent,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={yearItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={yearValue}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredYear)}\n inRange={getInRange(value, date, hoveredYear, inRange)}\n sideInRange={getSideInRange(value, date, hoveredYear, isSelected)}\n onClick={disabled ? undefined : handleOnChangeYear(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverYear}\n key={`StyledYear-${i}-${j}`}\n role=\"gridcell\"\n data-year={yearValue}\n data-month-index={date.monthIndex}\n data-day={date.day}\n aria-label={String(yearValue)}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {yearValue}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","value","startYear","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredYear","onChangeYear","onHoverYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_YEAR_STEP","yearItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarYearFontFamily","dateStructureFontSize","calendarYearFontSize","dateStructureFontWeight","calendarYearFontWeight","dateStructureFontLineHeight","calendarYearFontLineHeight","dateStructureFontLetterSpacing","calendarYearFontLetterSpacing","dateStructureFontStyle","calendarYearFontStyle","dateStructureSelectedFontWeight","calendarYearSelectedFontWeight","dateStructureWidth","calendarYearItemWidth","dateStructureHeight","calendarYearItemHeight","dateStructureBorderRadius","calendarYearItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeYear","i","j","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverYear","isSelectedDone","Array","isArray","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","String","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAiBlD;AAAA,EAAA,IAhBIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,SAAS,GAAAN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AAU;AACf,QAAA,WAAA,EAAWK,SAAU;QACrB,kBAAkBzF,EAAAA,IAAI,CAAC2D,UAAW;QAClC,UAAU3D,EAAAA,IAAI,CAAC0D,GAAI;QACnB,YAAYmD,EAAAA,MAAM,CAACpB,SAAS,CAAE;AAC9BO,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCc,QAAAA,cAAc,EAAEb,aAAc;QAC9Bc,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElBtB,SACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
|
1
|
+
{"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useYears } from '../../hooks';\nimport { innerTokens, tokens } from '../../Calendar.tokens';\nimport { ROW_YEAR_STEP, canSelectDate, getInRange, getSideInRange, isSameDay, isSelectProcess } from '../../utils';\nimport { DateStructureItem } from '../DateStructureItem/DateStructureItem';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n value,\n startYear,\n selectIndexes,\n eventList,\n disabledList,\n min,\n max,\n outerRefs,\n isDouble,\n isSecond,\n hoveredYear,\n onChangeYear,\n onHoverYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears({ date: currentDate, value, startYear, eventList, disabledList, min, max });\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_YEAR_STEP : 0;\n\n const yearItemTokens = {\n [`${innerTokens.dateStructureFontFamily}`]: `var(${tokens.calendarYearFontFamily})`,\n [`${innerTokens.dateStructureFontSize}`]: `var(${tokens.calendarYearFontSize})`,\n [`${innerTokens.dateStructureFontWeight}`]: `var(${tokens.calendarYearFontWeight})`,\n [`${innerTokens.dateStructureFontLineHeight}`]: `var(${tokens.calendarYearFontLineHeight})`,\n [`${innerTokens.dateStructureFontLetterSpacing}`]: `var(${tokens.calendarYearFontLetterSpacing})`,\n [`${innerTokens.dateStructureFontStyle}`]: `var(${tokens.calendarYearFontStyle})`,\n [`${innerTokens.dateStructureSelectedFontWeight}`]: `var(${tokens.calendarYearSelectedFontWeight})`,\n [`${innerTokens.dateStructureWidth}`]: `var(${tokens.calendarYearItemWidth})`,\n [`${innerTokens.dateStructureHeight}`]: `var(${tokens.calendarYearItemHeight})`,\n [`${innerTokens.dateStructureBorderRadius}`]: `var(${tokens.calendarYearItemBorderRadius})`,\n };\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeYear = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeYear(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverYear?.(undefined);\n }\n },\n [getSelectedDate, onChangeYear, offset, value, onHoverYear],\n );\n\n const handleOnHoverYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverYear?.(selectedDate);\n },\n [getSelectedDate, onHoverYear, value],\n );\n\n const handleMouseOutGrid = () => onHoverYear?.(undefined);\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i + offset][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears\n role=\"grid\"\n aria-labelledby=\"id-grid-label\"\n onKeyDown={onKeyDown}\n onMouseLeave={handleMouseOutGrid}\n >\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(\n (\n {\n yearValue,\n isSelected,\n isCurrent,\n date,\n events,\n isOutOfMinMaxRange,\n inRange,\n disabled,\n disabledArrowKey,\n disabledDates,\n },\n j,\n ) => {\n return (\n <DateStructureItem\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n style={yearItemTokens}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={yearValue}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] &&\n j === selectIndexes?.[1] &&\n !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredYear)}\n inRange={getInRange(value, date, hoveredYear, inRange)}\n sideInRange={getSideInRange(value, date, hoveredYear, isSelected)}\n onClick={disabled ? undefined : handleOnChangeYear(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverYear}\n key={`StyledYear-${i}-${j}`}\n role=\"gridcell\"\n data-year={yearValue}\n data-month-index={date.monthIndex}\n data-day={date.day}\n aria-label={String(yearValue)}\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledDates}\n isDayInCurrentMonth\n >\n {yearValue}\n </DateStructureItem>\n );\n },\n )}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","value","startYear","selectIndexes","eventList","disabledList","min","max","outerRefs","isDouble","isSecond","hoveredYear","onChangeYear","onHoverYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_YEAR_STEP","yearItemTokens","_defineProperty","concat","innerTokens","dateStructureFontFamily","tokens","calendarYearFontFamily","dateStructureFontSize","calendarYearFontSize","dateStructureFontWeight","calendarYearFontWeight","dateStructureFontLineHeight","calendarYearFontLineHeight","dateStructureFontLetterSpacing","calendarYearFontLetterSpacing","dateStructureFontStyle","calendarYearFontStyle","dateStructureSelectedFontWeight","calendarYearSelectedFontWeight","dateStructureWidth","calendarYearItemWidth","dateStructureHeight","calendarYearItemHeight","dateStructureBorderRadius","calendarYearItemBorderRadius","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeYear","i","j","nativeEvent","stopImmediatePropagation","isSelectProcess","undefined","handleOnHoverYear","isSelectedDone","Array","isArray","handleMouseOutGrid","getRefs","element","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","onMouseLeave","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","events","isOutOfMinMaxRange","inRange","disabled","disabledArrowKey","disabledDates","DateStructureItem","ref","style","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","String","disabledMonths","isDayInCurrentMonth"],"mappings":";;;;;;;;;;;;;;AAUA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAiBlD;AAAA,EAAA,IAhBIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,YAAY,GAAAP,IAAA,CAAZO,YAAY;IACZC,GAAG,GAAAR,IAAA,CAAHQ,GAAG;IACHC,GAAG,GAAAT,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A,aAAA,CAAA5D,MAAA,CAAgBoC,CAAC,OAAApC,MAAA,CAAIqC,CAAC,CAAG;AAC5BmB,QAAAA,IAAI,EAAC,UAAU;AACf,QAAA,WAAA,EAAWM,SAAU;QACrB,kBAAkB3F,EAAAA,IAAI,CAAC2D,UAAW;QAClC,UAAU3D,EAAAA,IAAI,CAAC0D,GAAI;QACnB,YAAYqD,EAAAA,MAAM,CAACpB,SAAS,CAAE;AAC9BO,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCc,QAAAA,cAAc,EAAEb,aAAc;QAC9Bc,mBAAmB,EAAA,IAAA;AAAA,OAAA,EAElBtB,SACc,CAAC,CAAA;AAE5B,KACJ,CACQ,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
|
@@ -34,16 +34,16 @@
|
|
34
34
|
|
35
35
|
.CellTextbox_styles_rgpies_cz0uqdu__c842929b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-cell-textbox-gap);}
|
36
36
|
|
37
|
-
.
|
38
|
-
|
39
|
-
.
|
40
|
-
.
|
41
|
-
.
|
42
|
-
.
|
43
|
-
.
|
44
|
-
.
|
45
|
-
.
|
46
|
-
.
|
37
|
+
.Item_styles_y71664_s17m41ki__7af900cf{--plasma-cell-title-color:var(--text-primary);--plasma-cell-background-color:var(--plasma-colors-transparent);--plasma-cell-padding:var(--plasma-combobox-cell-padding);--plasma-cell-padding-left-content:var(--plasma-combobox-cell-padding-left-content);--plasma-cell-padding-content:var(--plasma-combobox-cell-padding-content);--plasma-cell-padding-right-content:var(--plasma-combobox-cell-padding-right-content);--plasma-cell-textbox-gap:var(--plasma-combobox-cell-textbox-gap);--plasma-cell-gap:var(--plasma-combobox-cell-gap);--plasma-cell-title-font-family:var(--plasma-combobox-cell-title-font-family);--plasma-cell-title-font-size:var(--plasma-combobox-cell-title-font-size);--plasma-cell-title-font-style:var(--plasma-combobox-cell-title-font-style);--plasma-cell-title-font-weight:var(--plasma-combobox-cell-title-font-weight);--plasma-cell-title-letter-spacing:var(--plasma-combobox-cell-title-letter-spacing);--plasma-cell-title-line-height:var(--plasma-combobox-cell-title-line-height);width:100%;}
|
38
|
+
|
39
|
+
.Item_styles_y71664_sabntqz__7af900cf{--plasma-checkbox-trigger-size:var(--plasma-combobox-checkbox-trigger-size);--plasma-checkbox-trigger-border-radius:var(--plasma-combobox-checkbox-trigger-border-radius);--plasma-checkbox-fill-color:var(--plasma-combobox-checkbox-fill-color);--plasma-checkbox-icon-color:var(--plasma-combobox-checkbox-icon-color);--plasma-checkbox-trigger-border-color:var(--plasma-combobox-checkbox-trigger-border-color);}
|
40
|
+
.Item_styles_y71664_sbva27s__7af900cf{--plasma-indicator-size:var(--plasma-combobox-indicator-size);--plasma-indicator-color:var(--plasma-combobox-checkbox-fill-color);}
|
41
|
+
.Item_styles_y71664_s198ssfl__7af900cf{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
42
|
+
.Item_styles_y71664_sq42uro__7af900cf{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
43
|
+
.Item_styles_y71664_d96nkq__7af900cf{line-height:0;color:var(--text-secondary);}.Item_styles_y71664_d96nkq__7af900cf:hover{color:var(--text-secondary-hover);}
|
44
|
+
.Item_styles_y71664_i170raop__7af900cf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-flex:none;-ms-flex:none;flex:none;width:var(--i170raop-0);height:var(--i170raop-0);margin:var(--plasma-combobox-item-icon-margin);line-height:0;color:var(--plasma-combobox-checkbox-fill-color);}
|
45
|
+
.Item_styles_y71664_s1bsz3m1__7af900cf{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
|
46
|
+
.Item_styles_y71664_wwurntn__7af900cf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:var(--plasma-combobox-item-height);margin:0;box-sizing:content-box;padding:var(--wwurntn-0);font-family:var(--plasma-combobox-font-family);font-size:var(--plasma-combobox-font-size);font-style:var(--plasma-combobox-font-style);font-weight:var(--plasma-combobox-font-weight);-webkit-letter-spacing:var(--plasma-combobox-font-letter-spacing);-moz-letter-spacing:var(--plasma-combobox-font-letter-spacing);-ms-letter-spacing:var(--plasma-combobox-font-letter-spacing);letter-spacing:var(--plasma-combobox-font-letter-spacing);line-height:var(--plasma-combobox-font-line-height);background-color:var(--plasma-colors-transparent);color:var(--text-primary);border-radius:var(--plasma-combobox-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-right:2px solid transparent;border-left:2px solid transparent;background-clip:padding-box;position:relative;}.Item_styles_y71664_wwurntn__7af900cf:hover:not(.Item_styles_y71664_dropdownItemIsDisabled__7af900cf){cursor:pointer;background-color:var(--surface-transparent-secondary);}.Item_styles_y71664_wwurntn__7af900cf.Item_styles_y71664_dropdownItemIsActive__7af900cf{background-color:var(--surface-transparent-secondary);}.Item_styles_y71664_wwurntn__7af900cf.Item_styles_y71664_dropdownItemIsDisabled__7af900cf{opacity:0.4;cursor:not-allowed;}.Item_styles_y71664_wwurntn__7af900cf:focus{outline:none;}.Item_styles_y71664_wwurntn__7af900cf::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-combobox-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.Item_styles_y71664_wwurntn__7af900cf.Item_styles_y71664_dropdownItemIsFocused__7af900cf:before{outline:none;box-shadow:0 0 0 0.0625rem var(--surface-accent);}
|
47
47
|
|
48
48
|
|
49
49
|
.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i13qvwoy__5f4dd9b9{width:100%;font:inherit;-webkit-letter-spacing:inherit;-moz-letter-spacing:inherit;-ms-letter-spacing:inherit;letter-spacing:inherit;line-height:inherit;}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i19ry60d__5f4dd9b9{width:100%;font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i1j28rg8__5f4dd9b9{height:var(--plasma-textfield-height);border-radius:var(--plasma-textfield-border-radius);padding:var(--plasma-textfield-padding);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i1j28rg8__5f4dd9b9.base_1xdmaqh_hasChips__5f4dd9b9{padding-top:var(--plasma-textfield-padding-with-chips);padding-bottom:var(--plasma-textfield-padding-with-chips);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i1j28rg8__5f4dd9b9.base_1xdmaqh_hasEmptyContentLeft__5f4dd9b9{padding-left:var(--plasma-textfield-padding-with-chips);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_i1j28rg8__5f4dd9b9.base_1xdmaqh_hasEmptyContentRight__5f4dd9b9{padding-right:var(--plasma-textfield-padding-with-chips);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_l1gjsnfi__5f4dd9b9,.base_1xdmaqh_b13ve66i__5f4dd9b9:not(.base_1xdmaqh_labelPlacementInner__5f4dd9b9) .base_1xdmaqh_s16itze4__5f4dd9b9{font-family:var(--plasma-textfield__label-font-family);font-size:var(--plasma-textfield__label-font-size);font-style:var(--plasma-textfield__label-font-style);font-weight:var(--plasma-textfield__label-font-weight);-webkit-letter-spacing:var(--plasma-textfield__label-letter-spacing);-moz-letter-spacing:var(--plasma-textfield__label-letter-spacing);-ms-letter-spacing:var(--plasma-textfield__label-letter-spacing);letter-spacing:var(--plasma-textfield__label-letter-spacing);line-height:var(--plasma-textfield__label-line-height);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_s1skqnhr__5f4dd9b9{margin:var(--plasma-textfield__hint-margin);width:var(--plasma-textfield__hint-target-size);height:var(--plasma-textfield__hint-target-size);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_hgy0im1__5f4dd9b9{width:var(--plasma-textfield__hint-target-size);height:var(--plasma-textfield__hint-target-size);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_t600610__5f4dd9b9{font-family:var(--plasma-textfield__title-caption-font-family);font-size:var(--plasma-textfield__title-caption-font-size);font-style:var(--plasma-textfield__title-caption-font-style);font-weight:var(--plasma-textfield__title-caption-font-weight);-webkit-letter-spacing:var(--plasma-textfield__title-caption-letter-spacing);-moz-letter-spacing:var(--plasma-textfield__title-caption-letter-spacing);-ms-letter-spacing:var(--plasma-textfield__title-caption-letter-spacing);letter-spacing:var(--plasma-textfield__title-caption-letter-spacing);line-height:var(--plasma-textfield__title-caption-line-height);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_l7hnwwb__5f4dd9b9{margin-top:var(--plasma-textfield__left-helper-offset);font-family:var(--plasma-textfield__left-helper-font-family);font-size:var(--plasma-textfield__left-helper-font-size);font-style:var(--plasma-textfield__left-helper-font-style);font-weight:var(--plasma-textfield__left-helper-font-weight);-webkit-letter-spacing:var(--plasma-textfield__left-helper-letter-spacing);-moz-letter-spacing:var(--plasma-textfield__left-helper-letter-spacing);-ms-letter-spacing:var(--plasma-textfield__left-helper-letter-spacing);letter-spacing:var(--plasma-textfield__left-helper-letter-spacing);line-height:var(--plasma-textfield__left-helper-line-height);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_smqgwd8__5f4dd9b9,.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_s14qvple__5f4dd9b9{font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_smqgwd8__5f4dd9b9{margin:var(--plasma-textfield__before-text-margin);}.base_1xdmaqh_b13ve66i__5f4dd9b9 .base_1xdmaqh_s14qvple__5f4dd9b9{margin:var(--plasma-textfield__after-text-margin);}
|
@@ -5,27 +5,26 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
7
|
var plasmaCore = require('@salutejs/plasma-core');
|
8
|
-
require('../../../utils/react.js');
|
9
|
-
var isEmpty = require('../../../utils/isEmpty.js');
|
10
|
-
var useOutsideClick = require('../../../hooks/useOutsideClick.js');
|
11
|
-
var sizeToIconSize = require('../../Select/utils/sizeToIconSize.js');
|
12
8
|
var Combobox_tokens = require('./Combobox.tokens.js');
|
13
9
|
var FloatingPopover = require('./FloatingPopover.js');
|
14
10
|
var useKeyboardNavigation = require('./hooks/useKeyboardNavigation.js');
|
11
|
+
var getPathMaps = require('./hooks/getPathMaps.js');
|
12
|
+
var Combobox_styles = require('./Combobox.styles.js');
|
13
|
+
var base = require('./variations/_view/base.js');
|
14
|
+
var base$1 = require('./variations/_size/base.js');
|
15
15
|
var initialItemsTransform = require('./utils/initialItemsTransform.js');
|
16
|
+
var filterItems = require('./utils/filterItems.js');
|
17
|
+
var pathReducer = require('./reducers/pathReducer.js');
|
18
|
+
var focusedPathReducer = require('./reducers/focusedPathReducer.js');
|
19
|
+
var useOutsideClick = require('../../../hooks/useOutsideClick.js');
|
20
|
+
var isEmpty = require('../../../utils/isEmpty.js');
|
16
21
|
var updateDescendants = require('./utils/updateDescendants.js');
|
17
22
|
var updateAncestors = require('./utils/updateAncestors.js');
|
18
23
|
var updateSingleAncestors = require('./utils/updateSingleAncestors.js');
|
19
|
-
var
|
24
|
+
var Target_styles = require('./ui/Target/Target.styles.js');
|
25
|
+
var sizeToIconSize = require('../../Select/utils/sizeToIconSize.js');
|
20
26
|
var getItemId = require('./utils/getItemId.js');
|
21
27
|
var Inner = require('./ui/Inner/Inner.js');
|
22
|
-
var Target_styles = require('./ui/Target/Target.styles.js');
|
23
|
-
var pathReducer = require('./reducers/pathReducer.js');
|
24
|
-
var focusedPathReducer = require('./reducers/focusedPathReducer.js');
|
25
|
-
var getPathMaps = require('./hooks/getPathMaps.js');
|
26
|
-
var Combobox_styles = require('./Combobox.styles.js');
|
27
|
-
var base = require('./variations/_view/base.js');
|
28
|
-
var base$1 = require('./variations/_size/base.js');
|
29
28
|
|
30
29
|
var _excluded = ["multiple", "value", "onChange", "isTargetAmount", "items", "placement", "label", "placeholder", "helperText", "contentLeft", "textBefore", "textAfter", "variant", "listOverflow", "listHeight", "listWidth", "portal", "renderItem", "view", "size", "labelPlacement", "readOnly", "disabled", "alwaysOpened", "filter", "closeAfterSelect"];
|
31
30
|
var Context = /*#__PURE__*/React.createContext({});
|