@consta/uikit 3.18.1 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +41 -64
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/ContextMenuCanary/package.json +1 -1
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFacebook/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconHome/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconInstagram/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconOperators/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPicture/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconPriceLabel/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconSave/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSendMessage/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTable2/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTechResponse/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconVkontakte/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/IconWrench/package.json +1 -1
- package/IconYandexDzen/package.json +1 -1
- package/IconYoutube/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixPopoverAnimate/package.json +1 -1
- package/MixPopoverArrow/package.json +1 -1
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/README.md +6 -6
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesExit/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsCanary.js +9 -3
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js +2 -2
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.css +20 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.d.ts +2 -14
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.js +31 -8
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.d.ts +7 -1
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.js +24 -14
- package/__internal__/cjs-src/components/BreadcrumbsCanary/helpers.d.ts +267 -18
- package/__internal__/cjs-src/components/BreadcrumbsCanary/helpers.js +3 -10
- package/__internal__/cjs-src/components/BreadcrumbsCanary/types.d.ts +18 -0
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.css +4 -1
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.d.ts +1 -0
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.js +4 -2
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +1 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +27 -5
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +2 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/helper.d.ts +2 -2
- package/__internal__/cjs-src/components/ContextMenuCanary/types.d.ts +2 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +12 -8
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +6 -70
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +82 -13
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +9 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +0 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +12 -22
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +75 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +83 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +3 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.js +35 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +6 -1
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +33 -4
- package/__internal__/cjs-src/components/EventInterceptor/types.d.ts +1 -1
- package/__internal__/cjs-src/components/Modal/Modal.css +50 -25
- package/__internal__/cjs-src/components/Modal/Modal.js +3 -3
- package/__internal__/cjs-src/components/Pagination/Pagination.d.ts +0 -1
- package/__internal__/cjs-src/components/Pagination/Pagination.js +8 -11
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithTheme.js +15 -4
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.d.ts +4 -1
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js +3 -2
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/cjs-src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/cjs-src/hooks/useClickOutside/useClickOutside.d.ts +3 -3
- package/__internal__/cjs-src/hooks/useClickOutside/useClickOutside.js +18 -7
- package/__internal__/cjs-src/icons/IconFacebook/IconFacebook_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconFacebook/IconFacebook_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconInstagram/IconInstagram_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconInstagram/IconInstagram_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconVkontakte/IconVkontakte_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconVkontakte/IconVkontakte_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconYandexDzen/IconYandexDzen_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconYandexDzen/IconYandexDzen_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconYoutube/IconYoutube_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconYoutube/IconYoutube_size_s.js +1 -1
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsCanary.js +10 -4
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js +2 -2
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.css +20 -0
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.d.ts +2 -14
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsItem/BreadcrumbsItem.js +33 -10
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.d.ts +7 -1
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.js +22 -15
- package/__internal__/src/components/BreadcrumbsCanary/helpers.d.ts +267 -18
- package/__internal__/src/components/BreadcrumbsCanary/helpers.js +2 -8
- package/__internal__/src/components/BreadcrumbsCanary/types.d.ts +18 -0
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.css +4 -1
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.d.ts +1 -0
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js +4 -2
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +1 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +25 -4
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +3 -1
- package/__internal__/src/components/ContextMenuCanary/helper.d.ts +2 -2
- package/__internal__/src/components/ContextMenuCanary/types.d.ts +2 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +14 -10
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +9 -73
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +81 -12
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +11 -4
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +0 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +13 -23
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +72 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +80 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +3 -3
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.js +32 -0
- package/__internal__/src/components/DatePickerCanary/helpers.d.ts +6 -1
- package/__internal__/src/components/DatePickerCanary/helpers.js +32 -3
- package/__internal__/src/components/EventInterceptor/types.d.ts +1 -1
- package/__internal__/src/components/Modal/Modal.css +50 -25
- package/__internal__/src/components/Modal/Modal.js +3 -3
- package/__internal__/src/components/Pagination/Pagination.d.ts +0 -1
- package/__internal__/src/components/Pagination/Pagination.js +7 -10
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js +15 -4
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.d.ts +4 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js +3 -2
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/src/hooks/useClickOutside/useClickOutside.d.ts +3 -3
- package/__internal__/src/hooks/useClickOutside/useClickOutside.js +18 -7
- package/__internal__/src/icons/IconFacebook/IconFacebook_size_m.js +1 -1
- package/__internal__/src/icons/IconFacebook/IconFacebook_size_s.js +1 -1
- package/__internal__/src/icons/IconInstagram/IconInstagram_size_m.js +1 -1
- package/__internal__/src/icons/IconInstagram/IconInstagram_size_s.js +1 -1
- package/__internal__/src/icons/IconVkontakte/IconVkontakte_size_m.js +1 -1
- package/__internal__/src/icons/IconVkontakte/IconVkontakte_size_s.js +1 -1
- package/__internal__/src/icons/IconYandexDzen/IconYandexDzen_size_m.js +1 -1
- package/__internal__/src/icons/IconYandexDzen/IconYandexDzen_size_s.js +1 -1
- package/__internal__/src/icons/IconYoutube/IconYoutube_size_m.js +1 -1
- package/__internal__/src/icons/IconYoutube/IconYoutube_size_s.js +1 -1
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +2 -2
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useHideElementsInLine/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useRefs/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useSortSteps/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { addHours, addMinutes, addSeconds, format, isValid, parse, startOfDay, startOfHour, startOfMinute, } from 'date-fns';
|
|
4
|
+
import IMask from 'imask';
|
|
5
|
+
import { getLabelHours, getLabelMinutes, getLabelSeconds } from '../../DateTimeCanary/helpers';
|
|
6
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeTime, getPartsDate, getTimeEnum, } from '../helpers';
|
|
7
|
+
export var useImask = function (formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes, inputRef, stringValue, onError) {
|
|
8
|
+
var imaskRef = useRef(null);
|
|
9
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
10
|
+
// обнавляем при смене формата
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
if (!inputRef.current) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
imaskRef.current = IMask(inputRef.current, {
|
|
16
|
+
mask: Date,
|
|
17
|
+
pattern: formatProp,
|
|
18
|
+
blocks: {
|
|
19
|
+
HH: multiplicityHours && multiplicityHours > 1
|
|
20
|
+
? {
|
|
21
|
+
mask: IMask.MaskedEnum,
|
|
22
|
+
"enum": getTimeEnum(24, multiplicityHours, startOfDay, addHours, getLabelHours)
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
mask: IMask.MaskedRange,
|
|
26
|
+
from: 0,
|
|
27
|
+
to: 23
|
|
28
|
+
},
|
|
29
|
+
mm: multiplicityMinutes && multiplicityMinutes > 1
|
|
30
|
+
? {
|
|
31
|
+
mask: IMask.MaskedEnum,
|
|
32
|
+
"enum": getTimeEnum(60, multiplicityMinutes, startOfHour, addMinutes, getLabelMinutes)
|
|
33
|
+
}
|
|
34
|
+
: {
|
|
35
|
+
mask: IMask.MaskedRange,
|
|
36
|
+
from: 0,
|
|
37
|
+
to: 59
|
|
38
|
+
},
|
|
39
|
+
ss: multiplicitySeconds && multiplicitySeconds > 1
|
|
40
|
+
? {
|
|
41
|
+
mask: IMask.MaskedEnum,
|
|
42
|
+
"enum": getTimeEnum(60, multiplicitySeconds, startOfMinute, addSeconds, getLabelSeconds)
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
mask: IMask.MaskedRange,
|
|
46
|
+
from: 0,
|
|
47
|
+
to: 59
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
lazy: true,
|
|
51
|
+
autofix: true,
|
|
52
|
+
format: function (date) { return format(date, formatProp); },
|
|
53
|
+
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
54
|
+
validate: function (string) {
|
|
55
|
+
var _a = __read(getPartsDate(string, formatProp, ':', false, ['HH', 'mm', 'ss']), 3), HH = _a[0], mm = _a[1], ss = _a[2];
|
|
56
|
+
if (HH &&
|
|
57
|
+
mm &&
|
|
58
|
+
ss &&
|
|
59
|
+
!isValid(parse(HH + ":" + mm + ":" + ss, datePickerPropFormatTypeTime, new Date()))) {
|
|
60
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
61
|
+
type: datePickerErrorTypes[1],
|
|
62
|
+
stringValue: string,
|
|
63
|
+
HH: HH,
|
|
64
|
+
mm: mm,
|
|
65
|
+
ss: ss
|
|
66
|
+
});
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}, [formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes]);
|
|
73
|
+
// Нужно для синхранизации value c Imask,
|
|
74
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
75
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
79
|
+
}, [stringValue]);
|
|
80
|
+
};
|
|
@@ -10,7 +10,7 @@ import { DatePickerFieldTypeDateTime } from '../DatePickerFieldTypeDateTime/Date
|
|
|
10
10
|
import { datePickerPropFormatTypeDateTime, getMultiplicityTime, } from '../helpers';
|
|
11
11
|
import { useCurrentVisibleDate } from '../useCurrentVisibleDate';
|
|
12
12
|
export var DatePickerTypeDateTime = forwardRef(function (props, ref) {
|
|
13
|
-
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, currentVisibleDateProp = props.currentVisibleDate, onChangeCurrentVisibleDateProp = props.onChangeCurrentVisibleDate, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "currentVisibleDate", "onChangeCurrentVisibleDate", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls"]);
|
|
13
|
+
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, currentVisibleDateProp = props.currentVisibleDate, onChangeCurrentVisibleDateProp = props.onChangeCurrentVisibleDate, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, style = props.style, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "currentVisibleDate", "onChangeCurrentVisibleDate", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls", "style"]);
|
|
14
14
|
var _a = __read(getMultiplicityTime(otherProps.format || datePickerPropFormatTypeDateTime, multiplicityHoursProp, multiplicityMinutesProp, multiplicitySecondsProp), 3), multiplicityHours = _a[0], multiplicityMinutes = _a[1], multiplicitySeconds = _a[2];
|
|
15
15
|
var fieldRef = useRef(null);
|
|
16
16
|
var calendarRef = useRef(null);
|
|
@@ -51,6 +51,6 @@ export var DatePickerTypeDateTime = forwardRef(function (props, ref) {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(DatePickerFieldTypeDateTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes })),
|
|
55
|
-
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "date-time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, currentVisibleDate: currentVisibleDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, onChangeCurrentVisibleDate: setCalendarVisibleDate, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes })));
|
|
54
|
+
React.createElement(DatePickerFieldTypeDateTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, style: style })),
|
|
55
|
+
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "date-time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, currentVisibleDate: currentVisibleDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, onChangeCurrentVisibleDate: setCalendarVisibleDate, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, zIndex: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? style.zIndex + 1 : undefined })));
|
|
56
56
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { useClickOutside } from '../../../hooks/useClickOutside/useClickOutside';
|
|
4
|
+
import { useFlag } from '../../../hooks/useFlag/useFlag';
|
|
5
|
+
import { setRef } from '../../../utils/setRef';
|
|
6
|
+
import { DatePickerDropdown } from '../DatePickerDropdown/DatePickerDropdown';
|
|
7
|
+
import { DatePickerFieldTypeTime } from '../DatePickerFieldTypeTime/DatePickerFieldTypeTime';
|
|
8
|
+
import { datePickerPropFormatTypeDateTime, getMultiplicityTime, } from '../helpers';
|
|
9
|
+
export var DatePickerTypeTime = forwardRef(function (props, ref) {
|
|
10
|
+
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, style = props.style, currentVisibleDate = props.currentVisibleDate, onChangeCurrentVisibleDate = props.onChangeCurrentVisibleDate, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls", "style", "currentVisibleDate", "onChangeCurrentVisibleDate"]);
|
|
11
|
+
var _a = __read(getMultiplicityTime(otherProps.format || datePickerPropFormatTypeDateTime, multiplicityHoursProp, multiplicityMinutesProp, multiplicitySecondsProp), 3), multiplicityHours = _a[0], multiplicityMinutes = _a[1], multiplicitySeconds = _a[2];
|
|
12
|
+
var fieldRef = useRef(null);
|
|
13
|
+
var calendarRef = useRef(null);
|
|
14
|
+
var _b = __read(useFlag(false), 2), calendarVisible = _b[0], setCalendarVisible = _b[1];
|
|
15
|
+
var onFocusHandler = function (e) {
|
|
16
|
+
onFocus && onFocus(e);
|
|
17
|
+
setCalendarVisible.on();
|
|
18
|
+
};
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
if (ref) {
|
|
21
|
+
setRef(ref, fieldRef.current);
|
|
22
|
+
}
|
|
23
|
+
}, [ref, fieldRef]);
|
|
24
|
+
useClickOutside({
|
|
25
|
+
isActive: calendarVisible,
|
|
26
|
+
ignoreClicksInsideRefs: [fieldRef, calendarRef],
|
|
27
|
+
handler: function () { return setCalendarVisible.off(); }
|
|
28
|
+
});
|
|
29
|
+
return (React.createElement(React.Fragment, null,
|
|
30
|
+
React.createElement(DatePickerFieldTypeTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, style: style })),
|
|
31
|
+
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, zIndex: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? style.zIndex + 1 : undefined })));
|
|
32
|
+
});
|
|
@@ -5,7 +5,7 @@ import { DateRange } from '../../utils/types/Date';
|
|
|
5
5
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
6
6
|
import { DateTimeAdditionalControlRenderProp, DateTimePropView } from '../DateTimeCanary/helpers';
|
|
7
7
|
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../TextField/TextField';
|
|
8
|
-
export declare const datePickerPropType: readonly ["date", "date-range", "date-time", "date-time-range"];
|
|
8
|
+
export declare const datePickerPropType: readonly ["date", "date-range", "date-time", "date-time-range", "time"];
|
|
9
9
|
export declare type DatePickerPropType = typeof datePickerPropType[number];
|
|
10
10
|
export declare const datePickerPropTypeDefault: "date";
|
|
11
11
|
export declare type DatePickerPropDateTimeView = DateTimePropView;
|
|
@@ -106,6 +106,8 @@ export declare type DatePickerPropOnError = (props: {
|
|
|
106
106
|
export declare const datePickerPropSeparatorDefault = ".";
|
|
107
107
|
export declare const datePickerPropFormatTypeDate: string;
|
|
108
108
|
export declare const datePickerPropPlaceholderTypeDate: string;
|
|
109
|
+
export declare const datePickerPropFormatTypeTime = "HH:mm:ss";
|
|
110
|
+
export declare const datePickerPropPlaceholderTypeTime = "\u0427\u0427:\u041C\u041C:\u0421\u0421";
|
|
109
111
|
export declare const datePickerPropFormatTypeDateTime: string;
|
|
110
112
|
export declare const datePickerPropPlaceholderTypeDateTime: string;
|
|
111
113
|
export declare const normalizeRangeValue: (dateRange: DateRange) => DateRange;
|
|
@@ -113,4 +115,7 @@ export declare const getMultiplicityTime: (format: string, multiplicityHours: nu
|
|
|
113
115
|
export declare const getTimeEnum: (length: number, multiplicity: number | undefined, startOfUnits: (date: Date) => Date, addUnits: (date: Date, amount: number) => Date, getItemLabel: (date: Date) => string) => string[];
|
|
114
116
|
export declare const getFormForStart: (form: TextFieldPropForm) => "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear";
|
|
115
117
|
export declare const getFormForEnd: (form: TextFieldPropForm) => "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear";
|
|
118
|
+
export declare const getParts: (format: string, separator: string, withTime?: boolean | undefined) => string[];
|
|
119
|
+
export declare const getPartsDate: (value: string, format: string, separator: string, withTime: boolean, markers: string[]) => (string | undefined)[];
|
|
120
|
+
export declare const isTypeWithTime: (type: DatePickerPropType) => boolean;
|
|
116
121
|
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { __read, __spread } from "tslib";
|
|
1
2
|
import { startOfToday } from 'date-fns';
|
|
2
3
|
import { range } from '../../utils/array';
|
|
3
4
|
import { getByMap } from '../../utils/getByMap';
|
|
4
|
-
export var datePickerPropType = [
|
|
5
|
+
export var datePickerPropType = [
|
|
6
|
+
'date',
|
|
7
|
+
'date-range',
|
|
8
|
+
'date-time',
|
|
9
|
+
'date-time-range',
|
|
10
|
+
'time',
|
|
11
|
+
];
|
|
5
12
|
export var datePickerPropTypeDefault = datePickerPropType[0];
|
|
6
13
|
export var datePickerErrorTypes = [
|
|
7
14
|
'outOfRange',
|
|
@@ -13,8 +20,10 @@ export var datePickerPropDropdownFormDefault = datePickerPropDropdownForm[0];
|
|
|
13
20
|
export var datePickerPropSeparatorDefault = '.';
|
|
14
21
|
export var datePickerPropFormatTypeDate = "dd" + datePickerPropSeparatorDefault + "MM" + datePickerPropSeparatorDefault + "yyyy";
|
|
15
22
|
export var datePickerPropPlaceholderTypeDate = "\u0414\u0414" + datePickerPropSeparatorDefault + "\u041C\u041C" + datePickerPropSeparatorDefault + "\u0413\u0413\u0413\u0413";
|
|
16
|
-
export var
|
|
17
|
-
export var
|
|
23
|
+
export var datePickerPropFormatTypeTime = "HH:mm:ss";
|
|
24
|
+
export var datePickerPropPlaceholderTypeTime = "\u0427\u0427:\u041C\u041C:\u0421\u0421";
|
|
25
|
+
export var datePickerPropFormatTypeDateTime = datePickerPropFormatTypeDate + " " + datePickerPropFormatTypeTime;
|
|
26
|
+
export var datePickerPropPlaceholderTypeDateTime = datePickerPropPlaceholderTypeDate + " " + datePickerPropPlaceholderTypeTime;
|
|
18
27
|
export var normalizeRangeValue = function (dateRange) {
|
|
19
28
|
var _a, _b;
|
|
20
29
|
if (dateRange[0] && dateRange[1] && ((_a = dateRange[0]) === null || _a === void 0 ? void 0 : _a.getTime()) > ((_b = dateRange[1]) === null || _b === void 0 ? void 0 : _b.getTime())) {
|
|
@@ -78,3 +87,23 @@ var mapFormForEnd = {
|
|
|
78
87
|
};
|
|
79
88
|
export var getFormForStart = function (form) { return getByMap(mapFormForStart, form); };
|
|
80
89
|
export var getFormForEnd = function (form) { return getByMap(mapFormForEnd, form); };
|
|
90
|
+
var getPartDate = function (formatArray, stringArray, marker) {
|
|
91
|
+
var index = formatArray.indexOf(marker);
|
|
92
|
+
if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
|
|
93
|
+
return stringArray[index];
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
export var getParts = function (format, separator, withTime) {
|
|
98
|
+
if (withTime) {
|
|
99
|
+
var _a = __read(format.split(' '), 2), date = _a[0], time = _a[1];
|
|
100
|
+
return __spread((date ? date.split(separator) : []), (time ? time.split(':') : []));
|
|
101
|
+
}
|
|
102
|
+
return format.split(separator);
|
|
103
|
+
};
|
|
104
|
+
export var getPartsDate = function (value, format, separator, withTime, markers) {
|
|
105
|
+
var formatArray = getParts(format, separator, withTime);
|
|
106
|
+
var stringArray = getParts(value, separator, withTime);
|
|
107
|
+
return markers.map(function (marker) { return getPartDate(formatArray, stringArray, marker); });
|
|
108
|
+
};
|
|
109
|
+
export var isTypeWithTime = function (type) { return type.indexOf('time') !== -1; };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type EventInterceptorComponentName = 'Attachment' | 'Avatar' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Calendar' | 'Card' | 'Checkbox' | 'CheckboxGroup' | 'ChoiceGroup' | 'Collapse' | 'CollapseGroup' | 'Combobox' | 'ContextMenu' | 'DatePicker' | 'DateTime' | 'DragNDropField' | 'File' | 'FileField' | 'Grid' | 'Header' | 'Informer' | 'Layout' | 'Loader' | 'Modal' | '
|
|
1
|
+
export declare type EventInterceptorComponentName = 'Attachment' | 'Avatar' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Calendar' | 'Card' | 'Checkbox' | 'CheckboxGroup' | 'ChoiceGroup' | 'Collapse' | 'CollapseGroup' | 'Combobox' | 'ContextMenu' | 'DatePicker' | 'DateTime' | 'DragNDropField' | 'File' | 'FileField' | 'Grid' | 'Header' | 'Informer' | 'Layout' | 'Loader' | 'Modal' | 'Popover' | 'ProgressSpin' | 'ProgressStepBar' | 'Radio' | 'RadioGroup' | 'Select' | 'Sidebar' | 'Skeleton' | 'Slider' | 'SnackBar' | 'Steps' | 'Switch' | 'SwitchGroup' | 'Table' | 'Tabs' | 'Tag' | 'TagBase' | 'Text' | 'TextField' | 'ThemeToggler' | 'Timer' | 'Tooltip' | 'User' | 'UserSelect';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.Modal {
|
|
2
|
+
--modal-window-animate-space: var(--space-xl);
|
|
2
3
|
position: fixed;
|
|
3
4
|
top: 0;
|
|
4
5
|
right: 0;
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.Modal-Window {
|
|
21
|
-
|
|
22
|
+
position: absolute;
|
|
22
23
|
overflow: auto;
|
|
23
24
|
min-width: 400px;
|
|
24
25
|
max-width: 90%;
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
.Modal-Overlay {
|
|
45
|
-
position:
|
|
46
|
+
position: absolute;
|
|
46
47
|
top: 0;
|
|
47
48
|
left: 0;
|
|
48
49
|
width: 100%;
|
|
@@ -52,30 +53,54 @@
|
|
|
52
53
|
border: none;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
.Modal_animate_appear,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
.Modal_animate_appear .Modal-Overlay, .Modal_animate_enter .Modal-Overlay, .Modal_animate_exit .Modal-Overlay, .Modal_animate_appearActive .Modal-Overlay, .Modal_animate_enterActive .Modal-Overlay, .Modal_animate_exitActive .Modal-Overlay {
|
|
57
|
+
-webkit-transition: opacity 0.24s ease;
|
|
58
|
+
transition: opacity 0.24s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.Modal_animate_appear .Modal-Window, .Modal_animate_enter .Modal-Window, .Modal_animate_exit .Modal-Window, .Modal_animate_appearActive .Modal-Window, .Modal_animate_enterActive .Modal-Window, .Modal_animate_exitActive .Modal-Window {
|
|
62
|
+
-webkit-transition: opacity 0.24s, -webkit-transform 0.24s;
|
|
63
|
+
transition: opacity 0.24s, -webkit-transform 0.24s;
|
|
64
|
+
transition: opacity 0.24s, transform 0.24s;
|
|
65
|
+
transition: opacity 0.24s, transform 0.24s, -webkit-transform 0.24s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Modal_animate_appear .Modal-Overlay, .Modal_animate_enter .Modal-Overlay {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
}
|
|
64
71
|
|
|
65
|
-
.Modal_animate_appear,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
.Modal_animate_appear .Modal-Window, .Modal_animate_enter .Modal-Window {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
-webkit-transform: translate(0, calc(-1 * var(--modal-window-animate-space)));
|
|
75
|
+
transform: translate(0, calc(-1 * var(--modal-window-animate-space)));
|
|
76
|
+
}
|
|
69
77
|
|
|
70
|
-
.Modal_animate_appearActive,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
78
|
+
.Modal_animate_appearActive .Modal-Overlay, .Modal_animate_enterActive .Modal-Overlay {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
}
|
|
74
81
|
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
.Modal_animate_appearActive .Modal-Window, .Modal_animate_enterActive .Modal-Window {
|
|
83
|
+
opacity: 1;
|
|
84
|
+
-webkit-transform: translate(0, 0);
|
|
85
|
+
transform: translate(0, 0);
|
|
86
|
+
}
|
|
78
87
|
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
.Modal_animate_exit .Modal-Overlay {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.Modal_animate_exit .Modal-Window {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
-webkit-transform: translate(0, 0);
|
|
95
|
+
transform: translate(0, 0);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.Modal_animate_exitActive .Modal-Overlay {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.Modal_animate_exitActive .Modal-Window {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
-webkit-transform: translate(0, var(--modal-window-animate-space));
|
|
105
|
+
transform: translate(0, var(--modal-window-animate-space));
|
|
106
|
+
}
|
|
@@ -24,7 +24,7 @@ var ContextConsumer = function (_a) {
|
|
|
24
24
|
useClickOutside({
|
|
25
25
|
isActive: !!onClickOutside,
|
|
26
26
|
ignoreClicksInsideRefs: __spread((ignoreClicksInsideRefs || []), (refs || [])),
|
|
27
|
-
handler:
|
|
27
|
+
handler: onClickOutside
|
|
28
28
|
});
|
|
29
29
|
return React.createElement(React.Fragment, null, children);
|
|
30
30
|
};
|
|
@@ -44,9 +44,9 @@ export var Modal = function (props) {
|
|
|
44
44
|
useGlobalKeys({
|
|
45
45
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
46
46
|
});
|
|
47
|
-
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout:
|
|
47
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout: 240, nodeRef: portalRef },
|
|
48
48
|
React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal({ hasOverlay: hasOverlay }, [rootClassName]), ref: portalRef, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
49
49
|
hasOverlay && React.createElement("div", { className: cnModal('Overlay'), "aria-label": "Overlay" }),
|
|
50
|
-
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style),
|
|
50
|
+
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), { zIndex: undefined }), className: cnModal('Window', { width: width, position: position }, [className]), ref: ref }),
|
|
51
51
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: __spread((refsForExcludeClickOutside || []), [ref]) }, children)))));
|
|
52
52
|
};
|
|
@@ -41,6 +41,5 @@ declare type Props = {
|
|
|
41
41
|
position?: PaginationPropPosition;
|
|
42
42
|
});
|
|
43
43
|
declare type Pagination = (props: PropsWithHTMLAttributesAndRef<Props, HTMLDivElement>) => React.ReactElement | null;
|
|
44
|
-
export declare const COMPONENT_NAME: "Pagination";
|
|
45
44
|
export declare const Pagination: Pagination;
|
|
46
45
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __assign, __read, __rest, __spread } from "tslib";
|
|
2
2
|
import './Pagination.css';
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { IconBackward } from '../../icons/IconBackward/IconBackward';
|
|
5
5
|
import { IconForward } from '../../icons/IconForward/IconForward';
|
|
6
6
|
import { cn } from '../../utils/bem';
|
|
7
7
|
import { Button } from '../Button/Button';
|
|
8
|
-
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
9
8
|
import { Text } from '../Text/Text';
|
|
10
9
|
import { TextField } from '../TextField/TextField';
|
|
11
10
|
import { getPaginationInfo } from './helpers';
|
|
@@ -19,10 +18,8 @@ export var paginationPositions = ['left', 'center', 'right'];
|
|
|
19
18
|
export var paginationDefaultPosition = 'center';
|
|
20
19
|
var getDefaultLabel = function (totalPages) { return "\u0438\u0437 " + totalPages; };
|
|
21
20
|
export var cnPagination = cn('Pagination');
|
|
22
|
-
export var COMPONENT_NAME = 'Pagination';
|
|
23
21
|
export var Pagination = React.forwardRef(function (props, ref) {
|
|
24
|
-
var
|
|
25
|
-
var _a = usePropsHandler(COMPONENT_NAME, props, paginationRef), _b = _a.currentPage, currentPage = _b === void 0 ? 0 : _b, _c = _a.totalPages, totalPages = _c === void 0 ? 0 : _c, onChange = _a.onChange, _d = _a.getLabel, getLabel = _d === void 0 ? getDefaultLabel(totalPages) : _d, _e = _a.form, form = _e === void 0 ? paginationDefaultForm : _e, _f = _a.size, size = _f === void 0 ? paginationDefaultSize : _f, _g = _a.type, type = _g === void 0 ? paginationDefaultType : _g, _h = _a.position, position = _h === void 0 ? paginationDefaultPosition : _h, _j = _a.minified, minified = _j === void 0 ? false : _j, _k = _a.hotkeys, hotkeys = _k === void 0 ? {
|
|
22
|
+
var _a = props.currentPage, currentPage = _a === void 0 ? 0 : _a, _b = props.totalPages, totalPages = _b === void 0 ? 0 : _b, onChange = props.onChange, _c = props.getLabel, getLabel = _c === void 0 ? getDefaultLabel(totalPages) : _c, _d = props.form, form = _d === void 0 ? paginationDefaultForm : _d, _e = props.size, size = _e === void 0 ? paginationDefaultSize : _e, _f = props.type, type = _f === void 0 ? paginationDefaultType : _f, _g = props.position, position = _g === void 0 ? paginationDefaultPosition : _g, _h = props.minified, minified = _h === void 0 ? false : _h, _j = props.hotkeys, hotkeys = _j === void 0 ? {
|
|
26
23
|
nextPage: {
|
|
27
24
|
label: 'Alt →',
|
|
28
25
|
values: ['Alt', 'ArrowRight']
|
|
@@ -31,12 +28,10 @@ export var Pagination = React.forwardRef(function (props, ref) {
|
|
|
31
28
|
label: '← Alt',
|
|
32
29
|
values: ['Alt', 'ArrowLeft']
|
|
33
30
|
}
|
|
34
|
-
} :
|
|
35
|
-
if (!totalPages)
|
|
36
|
-
return null;
|
|
31
|
+
} : _j, _k = props.containerEventListener, containerEventListener = _k === void 0 ? window : _k, className = props.className, otherProps = __rest(props, ["currentPage", "totalPages", "onChange", "getLabel", "form", "size", "type", "position", "minified", "hotkeys", "containerEventListener", "className"]);
|
|
37
32
|
var currPage = currentPage + 1;
|
|
38
|
-
var
|
|
39
|
-
var
|
|
33
|
+
var _l = getPaginationInfo(currPage, totalPages), prevPage = _l.prevPage, nextPage = _l.nextPage, isStartDots = _l.isStartDots, isEndDots = _l.isEndDots, pages = _l.pages, isEmpty = _l.isEmpty;
|
|
34
|
+
var _m = __read(React.useState([]), 2), keys = _m[0], setKeys = _m[1];
|
|
40
35
|
var changePage = function (page) {
|
|
41
36
|
if (page && page !== currPage && onChange) {
|
|
42
37
|
onChange(page - 1);
|
|
@@ -81,6 +76,8 @@ export var Pagination = React.forwardRef(function (props, ref) {
|
|
|
81
76
|
};
|
|
82
77
|
});
|
|
83
78
|
var itemWidth = "var(--control-height-" + size + ")";
|
|
79
|
+
if (!totalPages)
|
|
80
|
+
return null;
|
|
84
81
|
return ((!isEmpty && (React.createElement("nav", __assign({ className: cnPagination({ form: form, size: size, position: minified ? paginationDefaultPosition : position }, [className]), ref: ref }, otherProps),
|
|
85
82
|
(currPage > 1 || minified) && (React.createElement("div", { className: cnPagination('PrevPage') },
|
|
86
83
|
React.createElement(Button, { className: cnPagination('ItemLeft', {
|
|
@@ -5,13 +5,24 @@ import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
|
5
5
|
import { Theme } from '../Theme/Theme';
|
|
6
6
|
import { PortalWithThemeProvider, usePortalContext, } from './PortalWithThemeContext/PortalWithThemeContext';
|
|
7
7
|
export { usePortalContext };
|
|
8
|
+
var getZIndex = function (contextZindex, propZindex) {
|
|
9
|
+
if (typeof propZindex === 'number') {
|
|
10
|
+
return propZindex;
|
|
11
|
+
}
|
|
12
|
+
if (contextZindex) {
|
|
13
|
+
return contextZindex + 1;
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
};
|
|
8
17
|
export var PortalWithTheme = React.forwardRef(function (_a, ref) {
|
|
9
|
-
var children = _a.children, _b = _a.container, container = _b === void 0 ? window.document.body : _b, rest = __rest(_a, ["children", "container"]);
|
|
10
|
-
var
|
|
18
|
+
var children = _a.children, _b = _a.container, container = _b === void 0 ? window.document.body : _b, styleProp = _a.style, rest = __rest(_a, ["children", "container", "style"]);
|
|
19
|
+
var _c = usePortalContext(), addRefs = _c.addRefs, zIndexContext = _c.zIndex;
|
|
11
20
|
var themeRef = useRef(null);
|
|
21
|
+
var zIndex = getZIndex(zIndexContext, styleProp === null || styleProp === void 0 ? void 0 : styleProp.zIndex);
|
|
22
|
+
var style = __assign(__assign({}, styleProp), { zIndex: zIndex });
|
|
12
23
|
useEffect(function () {
|
|
13
24
|
addRefs && addRefs([themeRef]);
|
|
14
25
|
}, [themeRef]);
|
|
15
|
-
return ReactDOM.createPortal(React.createElement(PortalWithThemeProvider,
|
|
16
|
-
React.createElement(Theme, __assign({ ref: useForkRef([themeRef, ref]) }, rest), children)), container);
|
|
26
|
+
return ReactDOM.createPortal(React.createElement(PortalWithThemeProvider, { zIndex: zIndex },
|
|
27
|
+
React.createElement(Theme, __assign({ ref: useForkRef([themeRef, ref]), style: style }, rest), children)), container);
|
|
17
28
|
});
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare function usePortalContext(): {
|
|
3
3
|
refs: React.RefObject<HTMLElement>[];
|
|
4
4
|
addRefs?: ((ref: React.RefObject<HTMLElement>[]) => void) | undefined;
|
|
5
|
+
zIndex?: number | undefined;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* PortalWithThemeProvider
|
|
@@ -12,4 +13,6 @@ export declare function usePortalContext(): {
|
|
|
12
13
|
* компонент думал ччто клик произашел вне компонента и срабатывал onOutsideClick.
|
|
13
14
|
* Сечас когда мы знаем рефы всех вложенных порталов мы можем игнорировать события кликов на вложенных порталах
|
|
14
15
|
*/
|
|
15
|
-
export declare const PortalWithThemeProvider: React.FC
|
|
16
|
+
export declare const PortalWithThemeProvider: React.FC<{
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
}>;
|
package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { __read, __spread } from "tslib";
|
|
2
2
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
3
3
|
var Context = createContext({
|
|
4
|
-
refs: []
|
|
4
|
+
refs: [],
|
|
5
|
+
zIndex: undefined
|
|
5
6
|
});
|
|
6
7
|
export function usePortalContext() {
|
|
7
8
|
return useContext(Context);
|
|
@@ -40,5 +41,5 @@ export var PortalWithThemeProvider = function (props) {
|
|
|
40
41
|
contextAddRefs && contextAddRefs(refs);
|
|
41
42
|
}, [refs]);
|
|
42
43
|
useEffect(function () { return function () { return setRefs([]); }; }, []);
|
|
43
|
-
return React.createElement(Context.Provider, { value: { refs: refs, addRefs: addRefs } }, props.children);
|
|
44
|
+
return (React.createElement(Context.Provider, { value: { refs: refs, addRefs: addRefs, zIndex: props.zIndex } }, props.children));
|
|
44
45
|
};
|
|
@@ -41,6 +41,6 @@ export var SelectDropdown = function (props) {
|
|
|
41
41
|
return (React.createElement(Fragment, { key: group.key + "-" + i }, renderItem(__assign({ item: item }, getOptionProps({ index: getIndex(), item: item })))));
|
|
42
42
|
})));
|
|
43
43
|
}),
|
|
44
|
-
!isLoading && notFound && labelForNotFound && (React.createElement(Text, { className: cnSelectDropdown('LabelForNotFound') }, labelForNotFound)),
|
|
44
|
+
!isLoading && hasItems && notFound && labelForNotFound && (React.createElement(Text, { className: cnSelectDropdown('LabelForNotFound') }, labelForNotFound)),
|
|
45
45
|
!isLoading && !hasItems && labelForEmptyItems && (React.createElement(Text, { className: cnSelectDropdown('LabelForEmptyItems') }, labelForEmptyItems))))); }));
|
|
46
46
|
};
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.Sidebar-Overlay {
|
|
50
|
-
position:
|
|
50
|
+
position: absolute;
|
|
51
51
|
top: 0;
|
|
52
|
+
right: 0;
|
|
52
53
|
left: 0;
|
|
53
|
-
|
|
54
|
-
height: 100%;
|
|
54
|
+
bottom: 0;
|
|
55
55
|
padding: 0;
|
|
56
56
|
background: var(--color-bg-tone);
|
|
57
57
|
border: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.Sidebar-Window {
|
|
61
|
-
|
|
61
|
+
position: absolute;
|
|
62
62
|
display: -webkit-box;
|
|
63
63
|
display: -ms-flexbox;
|
|
64
64
|
display: flex;
|
|
@@ -143,15 +143,15 @@
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
.Sidebar_animate_appear .Sidebar-Overlay, .Sidebar_animate_enter .Sidebar-Overlay, .Sidebar_animate_exit .Sidebar-Overlay, .Sidebar_animate_appearActive .Sidebar-Overlay, .Sidebar_animate_enterActive .Sidebar-Overlay, .Sidebar_animate_exitActive .Sidebar-Overlay {
|
|
146
|
-
-webkit-transition: opacity 0.
|
|
147
|
-
transition: opacity 0.
|
|
146
|
+
-webkit-transition: opacity 0.24s ease;
|
|
147
|
+
transition: opacity 0.24s ease;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.Sidebar_animate_appear .Sidebar-Window, .Sidebar_animate_enter .Sidebar-Window, .Sidebar_animate_exit .Sidebar-Window, .Sidebar_animate_appearActive .Sidebar-Window, .Sidebar_animate_enterActive .Sidebar-Window, .Sidebar_animate_exitActive .Sidebar-Window {
|
|
151
|
-
-webkit-transition: -webkit-transform 0.
|
|
152
|
-
transition: -webkit-transform 0.
|
|
153
|
-
transition: transform 0.
|
|
154
|
-
transition: transform 0.
|
|
151
|
+
-webkit-transition: -webkit-transform 0.24s ease;
|
|
152
|
+
transition: -webkit-transform 0.24s ease;
|
|
153
|
+
transition: transform 0.24s ease;
|
|
154
|
+
transition: transform 0.24s ease, -webkit-transform 0.24s ease;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.Sidebar_animate_appear .Sidebar-Overlay, .Sidebar_animate_enter .Sidebar-Overlay {
|
|
@@ -47,10 +47,10 @@ export var Sidebar = function (props) {
|
|
|
47
47
|
useGlobalKeys({
|
|
48
48
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
49
49
|
});
|
|
50
|
-
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position, hasOverlay: hasOverlay }), classNames: cnForCssTransition(cnSidebar), timeout:
|
|
50
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position, hasOverlay: hasOverlay }), classNames: cnForCssTransition(cnSidebar), timeout: 240, nodeRef: portalRef },
|
|
51
51
|
React.createElement(PortalWithTheme, { preset: theme, ref: portalRef, container: container, className: rootClassName, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
52
52
|
hasOverlay && React.createElement("div", { className: cnSidebar('Overlay'), "aria-label": "Overlay" }),
|
|
53
|
-
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style),
|
|
53
|
+
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), { zIndex: undefined }), className: cnSidebar('Window', { size: size, position: position }, [className]), ref: ref }),
|
|
54
54
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: [ref] }, children)))));
|
|
55
55
|
};
|
|
56
56
|
Sidebar.Content = SidebarContent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
export declare type ClickOutsideHandler = (event: MouseEvent) => void;
|
|
3
3
|
declare type UseClickOutsideProps = {
|
|
4
|
-
isActive
|
|
5
|
-
ignoreClicksInsideRefs
|
|
6
|
-
handler
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
ignoreClicksInsideRefs?: ReadonlyArray<RefObject<HTMLElement>>;
|
|
6
|
+
handler?: ClickOutsideHandler;
|
|
7
7
|
};
|
|
8
8
|
export declare function useClickOutside({ isActive, ignoreClicksInsideRefs, handler, }: UseClickOutsideProps): void;
|
|
9
9
|
export {};
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
import { useMutableRef } from '../useMutableRef/useMutableRef';
|
|
2
3
|
export function useClickOutside(_a) {
|
|
4
|
+
// Аргументы вынесены в рефки за тем, чтобы не пересоздавать подписку `mousedown` при кажом чихе.
|
|
5
|
+
// Бывают кейсы когда на странице несколко `useClickOutside` и один вызывает рендер,
|
|
6
|
+
// А второй не успевает отрабатывать а просто пересоздается
|
|
7
|
+
// С такой реализацией пересоздание только при удалении из дома, а аргументы всегда актуалны.
|
|
3
8
|
var isActive = _a.isActive, ignoreClicksInsideRefs = _a.ignoreClicksInsideRefs, handler = _a.handler;
|
|
9
|
+
var handlerRef = useMutableRef(handler);
|
|
10
|
+
var ignoreClicksInsideRefsRef = useMutableRef(ignoreClicksInsideRefs);
|
|
11
|
+
var isActiveRef = useMutableRef(isActive);
|
|
4
12
|
useEffect(function () {
|
|
5
|
-
if (!isActive) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
13
|
var handleClick = function (event) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
if (!isActiveRef.current) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
9
18
|
var target = event.target;
|
|
10
|
-
var shouldCallHandler =
|
|
11
|
-
shouldCallHandler &&
|
|
19
|
+
var shouldCallHandler = (_a = ignoreClicksInsideRefsRef.current) === null || _a === void 0 ? void 0 : _a.every(function (ref) { var _a; return !((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(target)); });
|
|
20
|
+
shouldCallHandler && ((_b = handlerRef.current) === null || _b === void 0 ? void 0 : _b.call(handlerRef, event));
|
|
12
21
|
};
|
|
13
22
|
document.addEventListener('mousedown', handleClick);
|
|
14
|
-
return function () {
|
|
15
|
-
|
|
23
|
+
return function () {
|
|
24
|
+
document.removeEventListener('mousedown', handleClick);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
16
27
|
}
|
|
@@ -2,6 +2,6 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
function IconFacebookSizeM(props) {
|
|
4
4
|
return (React.createElement("svg", __assign({ viewBox: "0 0 24 24" }, props),
|
|
5
|
-
React.createElement("path", { d: "M22
|
|
5
|
+
React.createElement("path", { d: "M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10c.059 0 .117 0 .176-.004v-7.781h-2.149V11.71h2.149V9.867c0-2.137 1.304-3.3 3.21-3.3.915 0 1.7.066 1.927.097v2.234H16c-1.035 0-1.238.493-1.238 1.215v1.594h2.48l-.324 2.504h-2.156v7.402C18.942 20.414 22 16.566 22 12z" })));
|
|
6
6
|
}
|
|
7
7
|
export default IconFacebookSizeM;
|
|
@@ -2,6 +2,6 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
function IconFacebookSizeS(props) {
|
|
4
4
|
return (React.createElement("svg", __assign({ viewBox: "0 0 16 16" }, props),
|
|
5
|
-
React.createElement("path", { d: "M14
|
|
5
|
+
React.createElement("path", { d: "M14 8A6 6 0 102 8a6 6 0 006 6c.035 0 .07 0 .105-.002v-4.67H6.816V7.828h1.29V6.72c0-1.282.782-1.98 1.926-1.98.549 0 1.02.04 1.155.058V6.14H10.4c-.621 0-.743.295-.743.729v.956h1.488l-.194 1.503H9.657v4.441A6.002 6.002 0 0014 8z" })));
|
|
6
6
|
}
|
|
7
7
|
export default IconFacebookSizeS;
|