@consta/uikit 3.18.2 → 3.18.3
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 +24 -40
- 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/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/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 +6 -9
- 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/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/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 +5 -8
- 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 +1 -1
- 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
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconVkontakteSizeM(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 24 24" }, props),
|
|
7
|
-
React.createElement("path", { d: "M20.
|
|
7
|
+
React.createElement("path", { d: "M20.904 16.775a1.233 1.233 0 00-.06-.117c-.313-.563-.91-1.253-1.79-2.072l-.02-.018-.008-.01-.01-.01h-.01c-.4-.38-.652-.636-.758-.768-.194-.25-.238-.503-.132-.759.075-.194.357-.603.844-1.228.256-.33.459-.596.609-.796 1.08-1.437 1.55-2.355 1.406-2.755l-.056-.094c-.038-.056-.134-.108-.29-.155-.157-.046-.357-.054-.6-.023l-2.7.019a.35.35 0 00-.187.004l-.122.029-.047.023-.037.028a.417.417 0 00-.103.099.645.645 0 00-.094.164 15.294 15.294 0 01-1.003 2.108c-.23.388-.443.723-.637 1.008a4.843 4.843 0 01-.487.628c-.132.134-.25.242-.357.323-.106.081-.187.116-.243.103a6.405 6.405 0 01-.16-.037.624.624 0 01-.21-.23 1.028 1.028 0 01-.108-.366 4.028 4.028 0 01-.033-.38 7.973 7.973 0 01.005-.45c.006-.193.01-.324.01-.393 0-.237.004-.495.013-.773.01-.278.017-.498.024-.66.006-.163.009-.335.009-.516s-.011-.323-.033-.426a1.46 1.46 0 00-.098-.3.505.505 0 00-.192-.225 1.083 1.083 0 00-.314-.127c-.331-.075-.753-.115-1.265-.122-1.162-.012-1.91.063-2.24.225-.131.069-.25.163-.356.281-.113.138-.128.213-.047.225.375.056.64.19.796.403l.057.113c.043.081.087.225.13.43.044.207.073.435.085.685.031.456.031.847 0 1.171a14 14 0 01-.089.76 1.52 1.52 0 01-.239.646.161.161 0 01-.047.047.702.702 0 01-.253.047c-.087 0-.193-.044-.318-.131a2.248 2.248 0 01-.39-.361 4.82 4.82 0 01-.454-.642c-.169-.275-.344-.6-.525-.975l-.15-.272c-.093-.175-.221-.43-.384-.763a14.728 14.728 0 01-.43-.97.618.618 0 00-.226-.3l-.047-.029a.642.642 0 00-.15-.08.995.995 0 00-.215-.06L3.6 7.97c-.262 0-.44.059-.534.178l-.038.056a.303.303 0 00-.028.15c0 .069.019.153.056.253.375.881.783 1.73 1.223 2.55.44.818.823 1.477 1.148 1.976.325.5.656.972.994 1.416.337.443.56.728.67.852.11.126.195.22.257.281l.235.225c.15.15.37.33.66.54.291.209.613.415.966.618s.764.368 1.232.496c.469.129.925.18 1.369.155h1.077c.219-.018.384-.087.497-.206l.037-.047a.621.621 0 00.07-.173.953.953 0 00.033-.258 3.09 3.09 0 01.061-.726c.047-.216.1-.378.16-.487a1.197 1.197 0 01.36-.413.617.617 0 01.075-.032c.15-.05.327-.002.53.145s.394.328.572.544c.178.215.392.457.642.726.25.268.468.468.656.6l.187.112c.125.075.288.144.488.206.2.063.374.078.524.047l2.4-.037c.237 0 .421-.04.552-.117.132-.079.21-.165.235-.258a.725.725 0 00.004-.319 1.177 1.177 0 00-.066-.248z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconVkontakteSizeM;
|
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconVkontakteSizeS(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 16 16" }, props),
|
|
7
|
-
React.createElement("path", { d: "M13.
|
|
7
|
+
React.createElement("path", { d: "M13.936 11.183a.822.822 0 00-.04-.078c-.209-.375-.606-.835-1.194-1.38l-.012-.013-.006-.006-.007-.007h-.006a7.223 7.223 0 01-.506-.512c-.13-.167-.158-.335-.087-.506.05-.13.237-.402.562-.819.17-.22.306-.397.406-.53.72-.959 1.033-1.571.937-1.838l-.037-.062c-.025-.037-.09-.072-.194-.103a.984.984 0 00-.4-.016l-1.799.013a.233.233 0 00-.125.003l-.081.019-.032.015-.024.02a.276.276 0 00-.07.065.427.427 0 00-.062.11 10.21 10.21 0 01-.668 1.405c-.154.258-.296.482-.425.672-.13.189-.237.329-.325.418-.087.09-.166.161-.237.216-.071.054-.125.077-.163.068a4.601 4.601 0 01-.106-.025.415.415 0 01-.14-.153.685.685 0 01-.072-.243 2.686 2.686 0 01-.02-.553c.005-.13.007-.217.007-.263 0-.158.003-.33.01-.515.006-.186.01-.332.015-.44.004-.109.006-.224.006-.344 0-.121-.007-.216-.022-.285a.972.972 0 00-.065-.2.337.337 0 00-.128-.15.722.722 0 00-.21-.084 4.157 4.157 0 00-.843-.081c-.775-.008-1.272.042-1.493.15a.842.842 0 00-.238.187c-.075.092-.085.142-.03.15.25.038.426.127.53.269l.038.075c.029.054.058.15.087.287.03.138.048.29.056.456.021.304.021.565 0 .781-.02.217-.04.386-.059.506a1.013 1.013 0 01-.16.431.108.108 0 01-.03.032.468.468 0 01-.17.031c-.058 0-.128-.03-.212-.088a1.5 1.5 0 01-.259-.24A3.217 3.217 0 015.53 7.6a7.47 7.47 0 01-.35-.65l-.1-.181a15.59 15.59 0 01-.256-.51 9.819 9.819 0 01-.287-.646.412.412 0 00-.15-.2l-.031-.019a.663.663 0 00-.244-.094L2.4 5.314c-.175 0-.294.04-.356.119l-.025.037a.202.202 0 00-.019.1c0 .046.013.102.038.169.25.587.521 1.154.815 1.7.293.545.549.985.765 1.318.217.333.437.647.662.943.225.296.374.485.447.569.073.083.13.145.172.187l.156.15c.1.1.247.22.44.36.194.139.409.276.644.412.236.135.51.245.822.33.312.086.616.12.912.104h.719a.498.498 0 00.33-.138l.026-.03a.415.415 0 00.046-.116.634.634 0 00.022-.172c-.004-.18.01-.34.04-.484.032-.144.067-.252.107-.325a.797.797 0 01.24-.275.393.393 0 01.05-.022c.1-.033.218-.001.354.097.135.098.262.219.38.362.12.144.262.306.429.485.167.179.312.312.437.4l.125.074c.083.05.192.096.325.138a.7.7 0 00.35.031l1.6-.025a.724.724 0 00.368-.078c.087-.052.14-.11.156-.172a.485.485 0 00.003-.212.784.784 0 00-.044-.166z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconVkontakteSizeS;
|
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconYandexDzenSizeM(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 24 24" }, props),
|
|
7
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2
|
|
7
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 11.798c4.114-.047 6.417-.316 7.95-1.849 1.532-1.532 1.801-3.835 1.848-7.948-5.363.106-9.69 4.434-9.797 9.797zm10.396-9.792c.047 4.11.317 6.411 1.849 7.943 1.508 1.509 3.763 1.793 7.756 1.847-.107-5.298-4.332-9.585-9.605-9.79zm9.6 10.392c-3.99.054-6.244.339-7.751 1.847-1.508 1.507-1.793 3.76-1.847 7.75a10.002 10.002 0 009.597-9.597zm-10.2 9.603c-.054-3.994-.338-6.248-1.847-7.756-1.531-1.532-3.832-1.802-7.943-1.85.205 5.274 4.492 9.5 9.79 9.606z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconYandexDzenSizeM;
|
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconYandexDzenSizeS(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 16 16" }, props),
|
|
7
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 7.
|
|
7
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 7.877c2.468-.028 3.849-.19 4.768-1.109.92-.92 1.081-2.3 1.11-4.768A6 6 0 002 7.877zm6.236-5.874c.028 2.466.19 3.846 1.109 4.765.905.905 2.257 1.076 4.653 1.108a6 6 0 00-5.762-5.873zm5.758 6.234c-2.393.032-3.745.203-4.65 1.108-.904.904-1.075 2.256-1.107 4.65a6 6 0 005.757-5.758zm-6.118 5.76c-.032-2.395-.203-3.747-1.108-4.652-.919-.92-2.299-1.08-4.765-1.11a6 6 0 005.873 5.763z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconYandexDzenSizeS;
|
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconYoutubeSizeM(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 24 24" }, props),
|
|
7
|
-
React.createElement("path", { d: "M21.
|
|
7
|
+
React.createElement("path", { d: "M21.588 7.191a2.505 2.505 0 00-1.763-1.763C18.26 5 12 5 12 5s-6.26 0-7.825.412c-.84.23-1.533.922-1.763 1.78C2 8.755 2 12.001 2 12.001s0 3.261.412 4.81c.23.857.906 1.532 1.763 1.763 1.581.428 7.825.428 7.825.428s6.26 0 7.825-.412a2.506 2.506 0 001.763-1.763c.412-1.565.412-4.81.412-4.81s.016-3.262-.412-4.827zM10.007 15V9.003l5.205 2.999L10.007 15z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconYoutubeSizeM;
|
|
@@ -4,6 +4,6 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var React = tslib_1.__importStar(require("react"));
|
|
5
5
|
function IconYoutubeSizeS(props) {
|
|
6
6
|
return (React.createElement("svg", tslib_1.__assign({ viewBox: "0 0 16 16" }, props),
|
|
7
|
-
React.createElement("path", { d: "M13.
|
|
7
|
+
React.createElement("path", { d: "M13.753 5.315a1.503 1.503 0 00-1.058-1.058C11.756 4 8 4 8 4s-3.756 0-4.695.247c-.504.138-.92.554-1.058 1.068C2 6.254 2 8.2 2 8.2s0 1.957.247 2.886c.139.514.544.92 1.058 1.058.949.257 4.695.257 4.695.257s3.756 0 4.695-.247c.514-.139.92-.544 1.058-1.058C14 10.158 14 8.211 14 8.211s.01-1.957-.247-2.896zM6.804 10V6.402l3.123 1.799L6.804 10z" })));
|
|
8
8
|
}
|
|
9
9
|
exports["default"] = IconYoutubeSizeS;
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
display: -webkit-inline-box;
|
|
6
6
|
display: -ms-inline-flexbox;
|
|
7
7
|
display: inline-flex;
|
|
8
|
-
max-width: 100%;
|
|
9
8
|
background-color: var(--choice-group-bg-color);
|
|
10
9
|
border-radius: var(--choice-radius);
|
|
11
10
|
-webkit-box-shadow: inset 0 0 0 var(--control-border-width) var(--choice-group-border-color);
|
|
12
11
|
box-shadow: inset 0 0 0 var(--control-border-width) var(--choice-group-border-color);
|
|
13
12
|
}
|
|
14
13
|
|
|
14
|
+
.ChoiceGroup_truncate {
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
15
18
|
.ChoiceGroup_view_primary {
|
|
16
19
|
--choice-bg-color: var(--color-control-bg-primary);
|
|
17
20
|
--choice-text-color: var(--color-control-typo-primary);
|
|
@@ -37,6 +37,7 @@ declare type Props<ITEM, MULTIPLE extends boolean = false> = PropsWithHTMLAttrib
|
|
|
37
37
|
value?: ChoiceGroupPropValue<ITEM, MULTIPLE>;
|
|
38
38
|
onChange?: ChoiceGroupPropOnChange<ITEM, MULTIPLE>;
|
|
39
39
|
multiple?: MULTIPLE;
|
|
40
|
+
truncate?: boolean;
|
|
40
41
|
children?: never;
|
|
41
42
|
}, HTMLDivElement>;
|
|
42
43
|
declare type ChoiceGroupComponent = <ITEM, MULTIPLE extends boolean = false>(props: Props<ITEM, MULTIPLE>) => React.ReactElement | null;
|
|
@@ -21,7 +21,7 @@ var sizeMap = {
|
|
|
21
21
|
};
|
|
22
22
|
export var cnChoiceGroup = cn('ChoiceGroup');
|
|
23
23
|
export var ChoiceGroup = React.forwardRef(function (props, ref) {
|
|
24
|
-
var _a = props.size, size = _a === void 0 ? choiceGroupDefaultSize : _a, _b = props.form, form = _b === void 0 ? choiceGroupDefaultForm : _b, _c = props.view, view = _c === void 0 ? choiceGroupDefaultView : _c, _d = props.width, width = _d === void 0 ? choiceGroupWidthDefault : _d, onlyIcon = props.onlyIcon, iconSizeProp = props.iconSize, _e = props.value, value = _e === void 0 ? null : _e, _f = props.multiple, multiple = _f === void 0 ? false : _f, items = props.items, getLabel = props.getLabel, onChange = props.onChange, getIcon = props.getIcon, name = props.name, className = props.className, _g = props.disabled, disabled = _g === void 0 ? false : _g, getDisabled = props.getDisabled, otherProps = __rest(props, ["size", "form", "view", "width", "onlyIcon", "iconSize", "value", "multiple", "items", "getLabel", "onChange", "getIcon", "name", "className", "disabled", "getDisabled"]);
|
|
24
|
+
var _a = props.size, size = _a === void 0 ? choiceGroupDefaultSize : _a, _b = props.form, form = _b === void 0 ? choiceGroupDefaultForm : _b, _c = props.view, view = _c === void 0 ? choiceGroupDefaultView : _c, _d = props.width, width = _d === void 0 ? choiceGroupWidthDefault : _d, onlyIcon = props.onlyIcon, iconSizeProp = props.iconSize, _e = props.value, value = _e === void 0 ? null : _e, _f = props.multiple, multiple = _f === void 0 ? false : _f, items = props.items, getLabel = props.getLabel, onChange = props.onChange, getIcon = props.getIcon, name = props.name, className = props.className, _g = props.disabled, disabled = _g === void 0 ? false : _g, getDisabled = props.getDisabled, truncate = props.truncate, otherProps = __rest(props, ["size", "form", "view", "width", "onlyIcon", "iconSize", "value", "multiple", "items", "getLabel", "onChange", "getIcon", "name", "className", "disabled", "getDisabled", "truncate"]);
|
|
25
25
|
var _h = useChoiceGroup({
|
|
26
26
|
value: value,
|
|
27
27
|
getKey: getLabel,
|
|
@@ -29,7 +29,9 @@ export var ChoiceGroup = React.forwardRef(function (props, ref) {
|
|
|
29
29
|
multiple: multiple
|
|
30
30
|
}), getOnChange = _h.getOnChange, getChecked = _h.getChecked;
|
|
31
31
|
var iconSize = getByMap(sizeMap, size, iconSizeProp);
|
|
32
|
-
return (React.createElement("div", __assign({}, otherProps, { ref: ref, className: cnChoiceGroup({ size: size, form: form, view: view, width: width, onlyIcon: onlyIcon, disabled: disabled
|
|
32
|
+
return (React.createElement("div", __assign({}, otherProps, { ref: ref, className: cnChoiceGroup({ size: size, form: form, view: view, width: width, onlyIcon: onlyIcon, disabled: disabled, truncate: truncate }, [
|
|
33
|
+
className,
|
|
34
|
+
]) }), items.map(function (item, idx) {
|
|
33
35
|
var itemChecked = getChecked(item);
|
|
34
36
|
var itemDisabled = !!getDisabled && getDisabled(item);
|
|
35
37
|
return (React.createElement(React.Fragment, { key: getLabel(item) },
|
package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './ContextMenuLevel.css';
|
|
2
2
|
import { ContextMenuLevelComponent } from '../types';
|
|
3
3
|
export declare const cnContextMenuLevel: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare function clearTimers(): void;
|
|
4
5
|
export declare const ContextMenuLevel: ContextMenuLevelComponent;
|
|
@@ -21,6 +21,25 @@ var renderHeader = function (groupLabel, first, size) {
|
|
|
21
21
|
}
|
|
22
22
|
return (React.createElement(Text, { view: "secondary", transform: "uppercase", className: cnContextMenuLevel('Header', { size: size, first: first }), size: getByMap(sizeMapHeader, size) }, groupLabel));
|
|
23
23
|
};
|
|
24
|
+
var timers = [];
|
|
25
|
+
export function clearTimers() {
|
|
26
|
+
var e_1, _a;
|
|
27
|
+
try {
|
|
28
|
+
for (var timers_1 = __values(timers), timers_1_1 = timers_1.next(); !timers_1_1.done; timers_1_1 = timers_1.next()) {
|
|
29
|
+
var timer = timers_1_1.value;
|
|
30
|
+
clearTimeout(timer);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
34
|
+
finally {
|
|
35
|
+
try {
|
|
36
|
+
if (timers_1_1 && !timers_1_1.done && (_a = timers_1["return"])) _a.call(timers_1);
|
|
37
|
+
}
|
|
38
|
+
finally { if (e_1) throw e_1.error; }
|
|
39
|
+
}
|
|
40
|
+
timers = [];
|
|
41
|
+
}
|
|
42
|
+
var closeDelay = 300;
|
|
24
43
|
function ContextMenuLevelRender(props, ref) {
|
|
25
44
|
var _a = props.size, size = _a === void 0 ? contextMenuDefaultSize : _a, items = props.items, groupsProp = props.groups, className = props.className,
|
|
26
45
|
// Свойства относящиеся к меню
|
|
@@ -34,7 +53,7 @@ function ContextMenuLevelRender(props, ref) {
|
|
|
34
53
|
var _b = __read(useFlag(false), 2), hovered = _b[0], setHovered = _b[1];
|
|
35
54
|
var groups = getGroups(items, getItemGroupId, groupsProp, getGroupId, sortGroup && (function (a, b) { return sortGroup(a.key, b.key); }));
|
|
36
55
|
var constructItemRefs = function () {
|
|
37
|
-
var
|
|
56
|
+
var e_2, _a;
|
|
38
57
|
var refs = {};
|
|
39
58
|
try {
|
|
40
59
|
for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
@@ -44,20 +63,22 @@ function ContextMenuLevelRender(props, ref) {
|
|
|
44
63
|
}
|
|
45
64
|
}
|
|
46
65
|
}
|
|
47
|
-
catch (
|
|
66
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
48
67
|
finally {
|
|
49
68
|
try {
|
|
50
69
|
if (groups_1_1 && !groups_1_1.done && (_a = groups_1["return"])) _a.call(groups_1);
|
|
51
70
|
}
|
|
52
|
-
finally { if (
|
|
71
|
+
finally { if (e_2) throw e_2.error; }
|
|
53
72
|
}
|
|
54
73
|
return refs;
|
|
55
74
|
};
|
|
56
75
|
var itemsRefs = useMemo(constructItemRefs, [items, groupsProp]);
|
|
57
76
|
useEffect(function () {
|
|
58
77
|
if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {
|
|
59
|
-
|
|
78
|
+
clearTimeout(timers[levelDepth]);
|
|
79
|
+
timers[levelDepth] = setTimeout(function () { return deleteLevel(levelDepth); }, closeDelay);
|
|
60
80
|
}
|
|
81
|
+
return function () { return clearTimeout(timers[levelDepth]); };
|
|
61
82
|
}, [hovered, hoveredParenLevel]);
|
|
62
83
|
var onMouseEnter = function (item, itemIndex) {
|
|
63
84
|
var subMenu = getItemSubMenu(item);
|
package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useClickOutside } from '../../../hooks/useClickOutside/useClickOutside'
|
|
|
4
4
|
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
5
5
|
import { useRefs } from '../../../hooks/useRefs/useRefs';
|
|
6
6
|
import { directions } from '../../Popover/Popover';
|
|
7
|
-
import { ContextMenuLevel } from '../ContextMenuLevel/ContextMenuLevel';
|
|
7
|
+
import { clearTimers, ContextMenuLevel } from '../ContextMenuLevel/ContextMenuLevel';
|
|
8
8
|
import { getLevels, withDefaultGetters } from '../helper';
|
|
9
9
|
import { contextMenuPropDefaultSubMenuDirection, contextMenuPropSubMenuDirections, } from '../types';
|
|
10
10
|
function ContextMenuLevelsRender(propsComponent, ref) {
|
|
@@ -54,6 +54,7 @@ function ContextMenuLevelsRender(propsComponent, ref) {
|
|
|
54
54
|
handler: function (e) { return onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e); }
|
|
55
55
|
});
|
|
56
56
|
useEffect(function () {
|
|
57
|
+
clearTimers();
|
|
57
58
|
setLevels(getLevels({
|
|
58
59
|
levels: levels,
|
|
59
60
|
items: items,
|
|
@@ -61,6 +62,7 @@ function ContextMenuLevelsRender(propsComponent, ref) {
|
|
|
61
62
|
getItemKey: getItemKey,
|
|
62
63
|
getItemSubMenu: getItemSubMenu
|
|
63
64
|
}));
|
|
65
|
+
return function () { return clearTimers(); };
|
|
64
66
|
}, [items]);
|
|
65
67
|
var firstLevelRef = useForkRef([levelsRefs[0], ref]);
|
|
66
68
|
return (React.createElement(React.Fragment, null, levels.map(function (level, index) { return (React.createElement(ContextMenuLevel, __assign({}, otherProps, level, { key: "ContextMenu-" + index, style: __assign(__assign({}, style), {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import React, { forwardRef, useRef } from 'react';
|
|
2
|
+
import React, { forwardRef, useMemo, useRef } from 'react';
|
|
3
3
|
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
4
4
|
import { maxDateDefault, minDateDefault } from '../../utils/date';
|
|
5
5
|
import { getByMap } from '../../utils/getByMap';
|
|
@@ -8,24 +8,28 @@ import { DatePickerTypeDate } from './DatePickerTypeDate/DatePickerTypeDate';
|
|
|
8
8
|
import { DatePickerTypeDateRange } from './DatePickerTypeDateRange/DatePickerTypeDateRange';
|
|
9
9
|
import { DatePickerTypeDateTime } from './DatePickerTypeDateTime/DatePickerTypeDateTime';
|
|
10
10
|
import { DatePickerTypeDateTimeRange } from './DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange';
|
|
11
|
-
import {
|
|
11
|
+
import { DatePickerTypeTime } from './DatePickerTypeTime/DatePickerTypeTime';
|
|
12
|
+
import { datePickerPropTypeDefault, isTypeWithTime, } from './helpers';
|
|
12
13
|
var typeMap = {
|
|
13
14
|
'date': DatePickerTypeDate,
|
|
14
15
|
'date-range': DatePickerTypeDateRange,
|
|
15
16
|
'date-time': DatePickerTypeDateTime,
|
|
16
|
-
'date-time-range': DatePickerTypeDateTimeRange
|
|
17
|
+
'date-time-range': DatePickerTypeDateTimeRange,
|
|
18
|
+
'time': DatePickerTypeTime
|
|
17
19
|
};
|
|
18
20
|
export var COMPONENT_NAME = 'DatePicker';
|
|
19
21
|
export var DatePicker = forwardRef(function (props, ref) {
|
|
20
22
|
var datePickerRef = useRef(null);
|
|
21
23
|
var _a = usePropsHandler(COMPONENT_NAME, props, datePickerRef), _b = _a.type, type = _b === void 0 ? datePickerPropTypeDefault : _b, _c = _a.minDate, minDate = _c === void 0 ? minDateDefault : _c, _d = _a.maxDate, maxDate = _d === void 0 ? maxDateDefault : _d, multiplicityMinutes = _a.multiplicityMinutes, multiplicitySeconds = _a.multiplicitySeconds, multiplicityHours = _a.multiplicityHours, otherProps = __rest(_a, ["type", "minDate", "maxDate", "multiplicityMinutes", "multiplicitySeconds", "multiplicityHours"]);
|
|
22
|
-
var timeProps =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var timeProps = useMemo(function () {
|
|
25
|
+
return isTypeWithTime(type)
|
|
26
|
+
? {
|
|
27
|
+
multiplicityMinutes: multiplicityMinutes,
|
|
28
|
+
multiplicitySeconds: multiplicitySeconds,
|
|
29
|
+
multiplicityHours: multiplicityHours
|
|
30
|
+
}
|
|
31
|
+
: undefined;
|
|
32
|
+
}, [type, multiplicityMinutes, multiplicitySeconds, multiplicityHours]);
|
|
29
33
|
var Component = getByMap(typeMap, type);
|
|
30
34
|
return (React.createElement(Component, __assign({}, otherProps, timeProps, { minDate: minDate, maxDate: maxDate, ref: useForkRef([ref, datePickerRef]) })));
|
|
31
35
|
});
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { format, isValid, isWithinInterval, parse } from 'date-fns';
|
|
4
|
-
import IMask from 'imask';
|
|
5
4
|
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
6
5
|
import { useMutableRef } from '../../../hooks/useMutableRef/useMutableRef';
|
|
7
|
-
import {
|
|
6
|
+
import { maxDateDefault, minDateDefault } from '../../../utils/date';
|
|
8
7
|
import { TextField } from '../../TextField/TextField';
|
|
9
|
-
import { datePickerErrorTypes, datePickerPropFormatTypeDate, datePickerPropPlaceholderTypeDate, datePickerPropSeparatorDefault, } from '../helpers';
|
|
10
|
-
import {
|
|
8
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeDate, datePickerPropPlaceholderTypeDate, datePickerPropSeparatorDefault, getPartsDate, } from '../helpers';
|
|
9
|
+
import { useImask } from './helpers';
|
|
11
10
|
export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
12
11
|
var _a = props.format, formatProp = _a === void 0 ? datePickerPropFormatTypeDate : _a, _b = props.separator, separator = _b === void 0 ? datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? datePickerPropPlaceholderTypeDate : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, otherProps = __rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef"]);
|
|
13
12
|
var inputRef = useRef(null);
|
|
14
|
-
var imaskRef = useRef(null);
|
|
15
13
|
var onChangeRef = useMutableRef(onChange);
|
|
16
14
|
var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
17
15
|
var handleChange = useCallback(function (e, stringValue) {
|
|
@@ -22,7 +20,11 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
22
20
|
onChange({ e: e, value: null });
|
|
23
21
|
return;
|
|
24
22
|
}
|
|
25
|
-
var _a = __read(getPartsDate(stringValue, formatProp, separator
|
|
23
|
+
var _a = __read(getPartsDate(stringValue, formatProp, separator, false, [
|
|
24
|
+
'dd',
|
|
25
|
+
'MM',
|
|
26
|
+
'yyyy',
|
|
27
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
26
28
|
if (dd && MM && yyyy) {
|
|
27
29
|
var date = parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatTypeDate, new Date());
|
|
28
30
|
if (!isWithinInterval(date, { start: minDate, end: maxDate })) {
|
|
@@ -45,6 +47,7 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
}, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
|
|
50
|
+
useImask(formatProp, separator, inputRef, stringValue, onError);
|
|
48
51
|
// при изменении value, нужно обновить stringValue
|
|
49
52
|
useEffect(function () {
|
|
50
53
|
if (value && isValid(value)) {
|
|
@@ -60,66 +63,6 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
60
63
|
}, [value === null || value === void 0 ? void 0 : value.getTime()]);
|
|
61
64
|
// задаем маску и сохраняем обьект маски в ref
|
|
62
65
|
// обнавляем при смене формата
|
|
63
|
-
useEffect(function () {
|
|
64
|
-
if (inputRef.current) {
|
|
65
|
-
imaskRef.current = IMask(inputRef.current, {
|
|
66
|
-
mask: Date,
|
|
67
|
-
pattern: formatProp,
|
|
68
|
-
blocks: {
|
|
69
|
-
yyyy: {
|
|
70
|
-
mask: IMask.MaskedRange,
|
|
71
|
-
from: 1,
|
|
72
|
-
to: 9999
|
|
73
|
-
},
|
|
74
|
-
MM: {
|
|
75
|
-
mask: IMask.MaskedRange,
|
|
76
|
-
from: 1,
|
|
77
|
-
to: 12
|
|
78
|
-
},
|
|
79
|
-
dd: {
|
|
80
|
-
mask: IMask.MaskedRange,
|
|
81
|
-
from: 1,
|
|
82
|
-
to: 31
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
lazy: true,
|
|
86
|
-
autofix: true,
|
|
87
|
-
format: function (date) { return format(date, formatProp); },
|
|
88
|
-
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
89
|
-
validate: function (string) {
|
|
90
|
-
var _a = __read(getPartsDate(string, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
91
|
-
if (dd &&
|
|
92
|
-
MM &&
|
|
93
|
-
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatTypeDate, new Date()))) {
|
|
94
|
-
onError &&
|
|
95
|
-
onError({
|
|
96
|
-
type: datePickerErrorTypes[1],
|
|
97
|
-
stringValue: string,
|
|
98
|
-
dd: dd,
|
|
99
|
-
MM: MM,
|
|
100
|
-
yyyy: yyyy
|
|
101
|
-
});
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
if (dd &&
|
|
105
|
-
MM &&
|
|
106
|
-
yyyy &&
|
|
107
|
-
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatTypeDate, new Date()))) {
|
|
108
|
-
onError &&
|
|
109
|
-
onError({
|
|
110
|
-
type: datePickerErrorTypes[1],
|
|
111
|
-
stringValue: string,
|
|
112
|
-
dd: dd,
|
|
113
|
-
MM: MM,
|
|
114
|
-
yyyy: yyyy
|
|
115
|
-
});
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}, [formatProp, separator]);
|
|
123
66
|
// задаем нативный oninput, так как с маской по другому не будет работать
|
|
124
67
|
// обнавляем oninput при смене handleChange
|
|
125
68
|
useEffect(function () {
|
|
@@ -130,12 +73,5 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
130
73
|
};
|
|
131
74
|
}
|
|
132
75
|
}, [handleChange]);
|
|
133
|
-
// Нужно для синхранизации value c Imask,
|
|
134
|
-
// так как value мы можем задать через пропс без самого ввода,
|
|
135
|
-
// и Imask требует ручной синхронихации в этом случае
|
|
136
|
-
useEffect(function () {
|
|
137
|
-
var _a;
|
|
138
|
-
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
139
|
-
}, [stringValue]);
|
|
140
76
|
return (React.createElement(TextField, __assign({}, otherProps, { type: "text", inputContainerRef: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
141
77
|
});
|
|
@@ -42,5 +42,5 @@ export declare type DatePickerFieldTypeDateProps = PropsWithHTMLAttributes<{
|
|
|
42
42
|
caption?: string;
|
|
43
43
|
labelPosition?: 'top' | 'left';
|
|
44
44
|
}, HTMLDivElement>;
|
|
45
|
-
export declare const
|
|
45
|
+
export declare const useImask: (formatProp: string, separator: string, inputRef: React.RefObject<HTMLInputElement>, stringValue: string | null, onError: DatePickerPropOnError | undefined) => void;
|
|
46
46
|
export {};
|
|
@@ -1,13 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { format, isValid, parse } from 'date-fns';
|
|
4
|
+
import IMask from 'imask';
|
|
5
|
+
import { leapYear } from '../../../utils/date';
|
|
6
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeDate, datePickerPropSeparatorDefault, getPartsDate, } from '../helpers';
|
|
7
|
+
export var useImask = function (formatProp, separator, inputRef, stringValue, onError) {
|
|
8
|
+
var imaskRef = useRef(null);
|
|
9
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
10
|
+
// обнавляем при смене формата
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
if (inputRef.current) {
|
|
13
|
+
imaskRef.current = IMask(inputRef.current, {
|
|
14
|
+
mask: Date,
|
|
15
|
+
pattern: formatProp,
|
|
16
|
+
blocks: {
|
|
17
|
+
yyyy: {
|
|
18
|
+
mask: IMask.MaskedRange,
|
|
19
|
+
from: 1,
|
|
20
|
+
to: 9999
|
|
21
|
+
},
|
|
22
|
+
MM: {
|
|
23
|
+
mask: IMask.MaskedRange,
|
|
24
|
+
from: 1,
|
|
25
|
+
to: 12
|
|
26
|
+
},
|
|
27
|
+
dd: {
|
|
28
|
+
mask: IMask.MaskedRange,
|
|
29
|
+
from: 1,
|
|
30
|
+
to: 31
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
lazy: true,
|
|
34
|
+
autofix: true,
|
|
35
|
+
format: function (date) { return format(date, formatProp); },
|
|
36
|
+
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
37
|
+
validate: function (string) {
|
|
38
|
+
var _a = __read(getPartsDate(string, formatProp, separator, false, [
|
|
39
|
+
'dd',
|
|
40
|
+
'MM',
|
|
41
|
+
'yyyy',
|
|
42
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
43
|
+
if (dd &&
|
|
44
|
+
MM &&
|
|
45
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatTypeDate, new Date()))) {
|
|
46
|
+
onError &&
|
|
47
|
+
onError({
|
|
48
|
+
type: datePickerErrorTypes[1],
|
|
49
|
+
stringValue: string,
|
|
50
|
+
dd: dd,
|
|
51
|
+
MM: MM,
|
|
52
|
+
yyyy: yyyy
|
|
53
|
+
});
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (dd &&
|
|
57
|
+
MM &&
|
|
58
|
+
yyyy &&
|
|
59
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatTypeDate, new Date()))) {
|
|
60
|
+
onError &&
|
|
61
|
+
onError({
|
|
62
|
+
type: datePickerErrorTypes[1],
|
|
63
|
+
stringValue: string,
|
|
64
|
+
dd: dd,
|
|
65
|
+
MM: MM,
|
|
66
|
+
yyyy: yyyy
|
|
67
|
+
});
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}, [formatProp, separator]);
|
|
75
|
+
// Нужно для синхранизации value c Imask,
|
|
76
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
77
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
var _a;
|
|
80
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
81
|
+
}, [stringValue]);
|
|
13
82
|
};
|
|
@@ -5,14 +5,14 @@ import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
|
5
5
|
import { useMutableRef } from '../../../hooks/useMutableRef/useMutableRef';
|
|
6
6
|
import { maxDateDefault, minDateDefault } from '../../../utils/date';
|
|
7
7
|
import { TextField } from '../../TextField/TextField';
|
|
8
|
-
import { datePickerErrorTypes, datePickerPropFormatTypeDateTime, datePickerPropPlaceholderTypeDateTime, datePickerPropSeparatorDefault, } from '../helpers';
|
|
9
|
-
import {
|
|
8
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeDateTime, datePickerPropPlaceholderTypeDateTime, datePickerPropSeparatorDefault, getParts, getPartsDate, } from '../helpers';
|
|
9
|
+
import { useImask } from './helpers';
|
|
10
10
|
export var DatePickerFieldTypeDateTime = React.forwardRef(function (props, ref) {
|
|
11
11
|
var _a = props.format, formatProp = _a === void 0 ? datePickerPropFormatTypeDateTime : _a, _b = props.separator, separator = _b === void 0 ? datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? datePickerPropPlaceholderTypeDateTime : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, multiplicityHours = props.multiplicityHours, multiplicitySeconds = props.multiplicitySeconds, multiplicityMinutes = props.multiplicityMinutes, otherProps = __rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef", "multiplicityHours", "multiplicitySeconds", "multiplicityMinutes"]);
|
|
12
12
|
var inputRef = useRef(null);
|
|
13
13
|
var onChangeRef = useMutableRef(onChange);
|
|
14
14
|
var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
15
|
-
var formatParts = useMemo(function () { return getParts(formatProp, separator); }, [formatProp, separator]);
|
|
15
|
+
var formatParts = useMemo(function () { return getParts(formatProp, separator, true); }, [formatProp, separator]);
|
|
16
16
|
var handleChange = useCallback(function (e, stringValue) {
|
|
17
17
|
setStringValue(stringValue);
|
|
18
18
|
var onChange = onChangeRef.current;
|
|
@@ -21,7 +21,14 @@ export var DatePickerFieldTypeDateTime = React.forwardRef(function (props, ref)
|
|
|
21
21
|
onChange({ e: e, value: null });
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
var partsDate = getPartsDate(stringValue, formatProp, separator
|
|
24
|
+
var partsDate = getPartsDate(stringValue, formatProp, separator, true, [
|
|
25
|
+
'dd',
|
|
26
|
+
'MM',
|
|
27
|
+
'yyyy',
|
|
28
|
+
'HH',
|
|
29
|
+
'mm',
|
|
30
|
+
'ss',
|
|
31
|
+
]);
|
|
25
32
|
var _a = __read(partsDate, 6), dd = _a[0], MM = _a[1], yyyy = _a[2], HH = _a[3], mm = _a[4], ss = _a[5];
|
|
26
33
|
if (partsDate.filter(function (item) { return !!item; }).length === formatParts.length) {
|
|
27
34
|
var date = parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy + " " + (HH ||
|
package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts
CHANGED
|
@@ -45,7 +45,5 @@ export declare type DatePickerFieldTypeDateTimeProps = PropsWithHTMLAttributes<{
|
|
|
45
45
|
caption?: string;
|
|
46
46
|
labelPosition?: 'top' | 'left';
|
|
47
47
|
}, HTMLDivElement>;
|
|
48
|
-
export declare const getParts: (format: string, separator: string) => string[];
|
|
49
|
-
export declare const getPartsDate: (value: string, format: string, separator: string, markers?: string[]) => (string | undefined)[];
|
|
50
48
|
export declare const useImask: (formatProp: string, separator: string, multiplicityHours: number | undefined, multiplicitySeconds: number | undefined, multiplicityMinutes: number | undefined, inputRef: React.RefObject<HTMLInputElement>, stringValue: string | null, onError: DatePickerPropOnError | undefined) => void;
|
|
51
49
|
export {};
|