@consta/uikit 3.18.2 → 3.20.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 +75 -66
- 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 +10 -10
- 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.d.ts +2 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +15 -9
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +2 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +8 -71
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +2 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +83 -13
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +4 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +5 -5
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +3 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +11 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +1 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +15 -24
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +4 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js +5 -6
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.d.ts +3 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +76 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +84 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +8 -14
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +3 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +8 -14
- 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 +8 -105
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +36 -12
- package/__internal__/cjs-src/components/DatePickerCanary/types.d.ts +96 -0
- package/__internal__/cjs-src/components/DatePickerCanary/types.js +18 -0
- 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/ResponsesExit/ResponsesExit.js +1 -1
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +21 -19
- package/__internal__/cjs-src/components/SelectComponents/SelectItem/SelectItem.css +1 -0
- package/__internal__/cjs-src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/cjs-src/components/Table/Table.js +3 -4
- package/__internal__/cjs-src/hooks/useBreakpoints/useBreakpoints.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/hooks/useForkRef/useForkRef.d.ts +1 -4
- 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.d.ts +2 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +16 -10
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +10 -73
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +2 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +82 -12
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +4 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +5 -5
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +3 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +12 -4
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +1 -3
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +14 -23
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +4 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js +5 -6
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.d.ts +3 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +73 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +81 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +9 -15
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +4 -4
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +9 -15
- 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 +8 -105
- package/__internal__/src/components/DatePickerCanary/helpers.js +35 -11
- package/__internal__/src/components/DatePickerCanary/types.d.ts +96 -0
- package/__internal__/src/components/DatePickerCanary/types.js +15 -0
- 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/ResponsesExit/ResponsesExit.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +21 -19
- package/__internal__/src/components/SelectComponents/SelectItem/SelectItem.css +1 -0
- package/__internal__/src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/src/components/Table/Table.js +3 -4
- package/__internal__/src/hooks/useBreakpoints/useBreakpoints.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/hooks/useForkRef/useForkRef.d.ts +1 -4
- 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
|
@@ -10,6 +10,7 @@ export declare const breadcrumbPropFitModeDefault: "dropdown";
|
|
|
10
10
|
export declare type BreadcrumbsPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
11
11
|
export declare type BreadcrumbsPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
|
|
12
12
|
export declare type BreadcrumbsPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
13
|
+
export declare type BreadcrumbsPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
|
|
13
14
|
export declare type BreadcrumbsPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
14
15
|
export declare type BreadcrumbsPropOnItemClick<ITEM> = (props: {
|
|
15
16
|
item: ITEM;
|
|
@@ -20,6 +21,7 @@ export declare type DefaultItem = {
|
|
|
20
21
|
icon?: IconComponent;
|
|
21
22
|
href?: string;
|
|
22
23
|
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
24
|
+
subMenu?: DefaultItem[];
|
|
23
25
|
};
|
|
24
26
|
export declare type RenderItem<ITEM> = (item: ITEM | undefined, index: number | string, isFirst?: boolean, isLast?: boolean, ref?: React.Ref<HTMLLIElement>, hidden?: boolean) => React.ReactElement | undefined;
|
|
25
27
|
export declare type BreadcrumbsProps<ITEM = DefaultItem> = PropsWithHTMLAttributesAndRef<{
|
|
@@ -28,6 +30,7 @@ export declare type BreadcrumbsProps<ITEM = DefaultItem> = PropsWithHTMLAttribut
|
|
|
28
30
|
getItemHref?: BreadcrumbsPropGetItemHref<ITEM>;
|
|
29
31
|
getItemIcon?: BreadcrumbsPropGetItemIcon<ITEM>;
|
|
30
32
|
getItemOnClick?: BreadcrumbsPropGetItemOnClick<ITEM>;
|
|
33
|
+
getItemSubMenu?: BreadcrumbsPropGetItemSubMenu<ITEM>;
|
|
31
34
|
onItemClick?: BreadcrumbsPropOnItemClick<ITEM>;
|
|
32
35
|
size?: BreadcrumbPropSize;
|
|
33
36
|
onlyIconRoot?: boolean;
|
|
@@ -45,16 +48,31 @@ export declare type BreadcrumbsMoreProps<ITEM> = PropsWithHTMLAttributesAndRef<{
|
|
|
45
48
|
getItemLabel: BreadcrumbsPropGetItemLabel<ITEM>;
|
|
46
49
|
getItemHref: BreadcrumbsPropGetItemHref<ITEM>;
|
|
47
50
|
getItemIcon: BreadcrumbsPropGetItemIcon<ITEM>;
|
|
51
|
+
getItemSubMenu: BreadcrumbsPropGetItemSubMenu<ITEM>;
|
|
48
52
|
getItemOnClick: BreadcrumbsPropGetItemOnClick<ITEM>;
|
|
49
53
|
onItemClick?: BreadcrumbsPropOnItemClick<ITEM>;
|
|
50
54
|
}, HTMLLIElement>;
|
|
51
55
|
export declare type BreadcrumbsMoreComponent = <ITEM>(props: BreadcrumbsMoreProps<ITEM>) => React.ReactElement | null;
|
|
56
|
+
export declare type BreadcrumbsItemProps<ITEM> = PropsWithHTMLAttributesAndRef<{
|
|
57
|
+
size: 'm' | 'xs' | 's' | 'l';
|
|
58
|
+
item?: ITEM;
|
|
59
|
+
getItemLabel?: BreadcrumbsPropGetItemLabel<ITEM>;
|
|
60
|
+
getItemHref?: BreadcrumbsPropGetItemHref<ITEM>;
|
|
61
|
+
getItemIcon?: BreadcrumbsPropGetItemIcon<ITEM>;
|
|
62
|
+
getItemSubMenu?: BreadcrumbsPropGetItemSubMenu<ITEM>;
|
|
63
|
+
active?: boolean;
|
|
64
|
+
onlyIcon?: boolean;
|
|
65
|
+
delimiter?: boolean;
|
|
66
|
+
onItemClick?: BreadcrumbsPropOnItemClick<ITEM>;
|
|
67
|
+
}, HTMLLIElement>;
|
|
68
|
+
export declare type BreadcrumbsItemComponent = <ITEM>(props: BreadcrumbsItemProps<ITEM>) => React.ReactElement | null;
|
|
52
69
|
export declare type BreadcrumbsFitModeDropdownProps<ITEM> = PropsWithHTMLAttributesAndRef<{
|
|
53
70
|
items: ITEM[];
|
|
54
71
|
getItemLabel: BreadcrumbsPropGetItemLabel<ITEM>;
|
|
55
72
|
getItemHref: BreadcrumbsPropGetItemHref<ITEM>;
|
|
56
73
|
getItemIcon: BreadcrumbsPropGetItemIcon<ITEM>;
|
|
57
74
|
getItemOnClick: BreadcrumbsPropGetItemOnClick<ITEM>;
|
|
75
|
+
getItemSubMenu: BreadcrumbsPropGetItemSubMenu<ITEM>;
|
|
58
76
|
onItemClick?: BreadcrumbsPropOnItemClick<ITEM>;
|
|
59
77
|
renderItem: RenderItem<ITEM>;
|
|
60
78
|
size: BreadcrumbPropSize;
|
|
@@ -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), {
|
|
@@ -6,7 +6,7 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
|
|
|
6
6
|
items: ITEM[];
|
|
7
7
|
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
8
8
|
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
9
|
-
offset?: number | undefined;
|
|
9
|
+
offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
|
|
10
10
|
groups?: GROUP[] | undefined;
|
|
11
11
|
sortGroup?: import("./types").ContextMenuPropSortGroup | undefined;
|
|
12
12
|
onItemClick?: import("./types").ContextMenuPropOnClick<ITEM> | undefined;
|
|
@@ -47,7 +47,7 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
|
|
|
47
47
|
items: ITEM[];
|
|
48
48
|
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
49
49
|
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
50
|
-
offset?: number | undefined;
|
|
50
|
+
offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
|
|
51
51
|
groups?: GROUP[] | undefined;
|
|
52
52
|
sortGroup?: import("./types").ContextMenuPropSortGroup | undefined;
|
|
53
53
|
onItemClick?: import("./types").ContextMenuPropOnClick<ITEM> | undefined;
|
|
@@ -3,7 +3,7 @@ import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside
|
|
|
3
3
|
import { IconComponent } from '../../icons/Icon/Icon';
|
|
4
4
|
import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
|
|
5
5
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
6
|
-
import { Direction, Position } from '../Popover/Popover';
|
|
6
|
+
import { Direction, PopoverPropOffset, Position } from '../Popover/Popover';
|
|
7
7
|
export declare const contextMenuSizes: readonly ["m", "xs", "s", "l"];
|
|
8
8
|
export declare type ContextMenuPropSize = typeof contextMenuSizes[number];
|
|
9
9
|
export declare const contextMenuDefaultSize: ContextMenuPropSize;
|
|
@@ -95,7 +95,7 @@ export declare type ContextMenuProps<ITEM = ContextMenuItemDefault, GROUP = Cont
|
|
|
95
95
|
items: ITEM[];
|
|
96
96
|
size?: ContextMenuPropSize;
|
|
97
97
|
direction?: Direction;
|
|
98
|
-
offset?:
|
|
98
|
+
offset?: PopoverPropOffset;
|
|
99
99
|
groups?: GROUP[];
|
|
100
100
|
sortGroup?: ContextMenuPropSortGroup;
|
|
101
101
|
onItemClick?: ContextMenuPropOnClick<ITEM>;
|
|
@@ -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,25 +8,31 @@ 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 { isTypeWithTime } from './helpers';
|
|
13
|
+
import { datePickerPropTypeDefault, } from './types';
|
|
12
14
|
var typeMap = {
|
|
13
15
|
'date': DatePickerTypeDate,
|
|
14
16
|
'date-range': DatePickerTypeDateRange,
|
|
15
17
|
'date-time': DatePickerTypeDateTime,
|
|
16
|
-
'date-time-range': DatePickerTypeDateTimeRange
|
|
18
|
+
'date-time-range': DatePickerTypeDateTimeRange,
|
|
19
|
+
'time': DatePickerTypeTime
|
|
17
20
|
};
|
|
18
21
|
export var COMPONENT_NAME = 'DatePicker';
|
|
19
22
|
export var DatePicker = forwardRef(function (props, ref) {
|
|
20
23
|
var datePickerRef = useRef(null);
|
|
21
24
|
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
|
-
|
|
25
|
+
var timeProps = useMemo(function () {
|
|
26
|
+
return isTypeWithTime(type)
|
|
27
|
+
? {
|
|
28
|
+
multiplicityMinutes: multiplicityMinutes,
|
|
29
|
+
multiplicitySeconds: multiplicitySeconds,
|
|
30
|
+
multiplicityHours: multiplicityHours
|
|
31
|
+
}
|
|
32
|
+
: undefined;
|
|
33
|
+
}, [type, multiplicityMinutes, multiplicitySeconds, multiplicityHours]);
|
|
29
34
|
var Component = getByMap(typeMap, type);
|
|
30
35
|
return (React.createElement(Component, __assign({}, otherProps, timeProps, { minDate: minDate, maxDate: maxDate, ref: useForkRef([ref, datePickerRef]) })));
|
|
31
36
|
});
|
|
32
37
|
export * from './helpers';
|
|
38
|
+
export * from './types';
|
package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { DateRange } from '../../../utils/types/Date';
|
|
4
4
|
import { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
5
5
|
import { DateTimeAdditionalControlRenderProp, DateTimePropOnChange, DateTimePropType } from '../../DateTimeCanary/DateTimeCanary';
|
|
6
|
-
import { DatePickerPropDateTimeView, DatePickerPropDropdownForm } from '../
|
|
6
|
+
import { DatePickerPropDateTimeView, DatePickerPropDropdownForm } from '../types';
|
|
7
7
|
export declare type DatePickerDropdownPropOnChange = DateTimePropOnChange;
|
|
8
8
|
export declare type DatePickerDropdownProps = PropsWithHTMLAttributesAndRef<{
|
|
9
9
|
anchorRef: React.RefObject<HTMLElement>;
|
package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js
CHANGED
|
@@ -7,7 +7,7 @@ import { animateTimeout, cnMixPopoverAnimate, } from '../../../mixs/MixPopoverAn
|
|
|
7
7
|
import { cn } from '../../../utils/bem';
|
|
8
8
|
import { DateTime, } from '../../DateTimeCanary/DateTimeCanary';
|
|
9
9
|
import { Popover } from '../../Popover/Popover';
|
|
10
|
-
import { datePickerPropDropdownFormDefault, } from '../
|
|
10
|
+
import { datePickerPropDropdownFormDefault, } from '../types';
|
|
11
11
|
var cnDatePickerDropdown = cn('DatePickerDropdown');
|
|
12
12
|
export var DatePickerDropdown = forwardRef(function (props, componentRef) {
|
|
13
13
|
var _a = props.form, form = _a === void 0 ? datePickerPropDropdownFormDefault : _a, anchorRef = props.anchorRef, isOpen = props.isOpen, className = props.className, zIndex = props.zIndex, otherProps = __rest(props, ["form", "anchorRef", "isOpen", "className", "zIndex"]);
|
|
@@ -6,7 +6,7 @@ export declare const DatePickerFieldTypeDate: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
e: Event;
|
|
7
7
|
value: Date | null;
|
|
8
8
|
}) => void) | undefined;
|
|
9
|
-
onError?: import("../
|
|
9
|
+
onError?: import("../types").DatePickerPropOnError | undefined;
|
|
10
10
|
id?: string | undefined;
|
|
11
11
|
name?: string | undefined;
|
|
12
12
|
disabled?: boolean | undefined;
|
|
@@ -1,17 +1,16 @@
|
|
|
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 {
|
|
10
|
-
import {
|
|
8
|
+
import { datePickerPropFormatTypeDate, datePickerPropPlaceholderTypeDate, datePickerPropSeparatorDefault, getPartsDate, } from '../helpers';
|
|
9
|
+
import { datePickerErrorTypes } from '../types';
|
|
10
|
+
import { useImask } from './helpers';
|
|
11
11
|
export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
12
12
|
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
13
|
var inputRef = useRef(null);
|
|
14
|
-
var imaskRef = useRef(null);
|
|
15
14
|
var onChangeRef = useMutableRef(onChange);
|
|
16
15
|
var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
17
16
|
var handleChange = useCallback(function (e, stringValue) {
|
|
@@ -22,7 +21,11 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
22
21
|
onChange({ e: e, value: null });
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
var _a = __read(getPartsDate(stringValue, formatProp, separator
|
|
24
|
+
var _a = __read(getPartsDate(stringValue, formatProp, separator, false, [
|
|
25
|
+
'dd',
|
|
26
|
+
'MM',
|
|
27
|
+
'yyyy',
|
|
28
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
26
29
|
if (dd && MM && yyyy) {
|
|
27
30
|
var date = parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatTypeDate, new Date());
|
|
28
31
|
if (!isWithinInterval(date, { start: minDate, end: maxDate })) {
|
|
@@ -45,6 +48,7 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
}, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
|
|
51
|
+
useImask(formatProp, separator, inputRef, stringValue, onError);
|
|
48
52
|
// при изменении value, нужно обновить stringValue
|
|
49
53
|
useEffect(function () {
|
|
50
54
|
if (value && isValid(value)) {
|
|
@@ -60,66 +64,6 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
60
64
|
}, [value === null || value === void 0 ? void 0 : value.getTime()]);
|
|
61
65
|
// задаем маску и сохраняем обьект маски в ref
|
|
62
66
|
// обнавляем при смене формата
|
|
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
67
|
// задаем нативный oninput, так как с маской по другому не будет работать
|
|
124
68
|
// обнавляем oninput при смене handleChange
|
|
125
69
|
useEffect(function () {
|
|
@@ -130,12 +74,5 @@ export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
|
130
74
|
};
|
|
131
75
|
}
|
|
132
76
|
}, [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
77
|
return (React.createElement(TextField, __assign({}, otherProps, { type: "text", inputContainerRef: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
141
78
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { IconComponent, IconPropSize } from '../../../icons/Icon/Icon';
|
|
3
3
|
import { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../../TextField/TextField';
|
|
5
|
-
import { DatePickerPropOnError } from '../
|
|
5
|
+
import { DatePickerPropOnError } from '../types';
|
|
6
6
|
declare type DatePickerFieldTypeDatePropOnChange = (props: {
|
|
7
7
|
e: Event;
|
|
8
8
|
value: Date | null;
|
|
@@ -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,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export var
|
|
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 { datePickerPropFormatTypeDate, datePickerPropSeparatorDefault, getPartsDate, } from '../helpers';
|
|
7
|
+
import { datePickerErrorTypes } from '../types';
|
|
8
|
+
export var useImask = function (formatProp, separator, inputRef, stringValue, onError) {
|
|
9
|
+
var imaskRef = useRef(null);
|
|
10
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
11
|
+
// обнавляем при смене формата
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
if (inputRef.current) {
|
|
14
|
+
imaskRef.current = IMask(inputRef.current, {
|
|
15
|
+
mask: Date,
|
|
16
|
+
pattern: formatProp,
|
|
17
|
+
blocks: {
|
|
18
|
+
yyyy: {
|
|
19
|
+
mask: IMask.MaskedRange,
|
|
20
|
+
from: 1,
|
|
21
|
+
to: 9999
|
|
22
|
+
},
|
|
23
|
+
MM: {
|
|
24
|
+
mask: IMask.MaskedRange,
|
|
25
|
+
from: 1,
|
|
26
|
+
to: 12
|
|
27
|
+
},
|
|
28
|
+
dd: {
|
|
29
|
+
mask: IMask.MaskedRange,
|
|
30
|
+
from: 1,
|
|
31
|
+
to: 31
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
lazy: true,
|
|
35
|
+
autofix: true,
|
|
36
|
+
format: function (date) { return format(date, formatProp); },
|
|
37
|
+
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
38
|
+
validate: function (string) {
|
|
39
|
+
var _a = __read(getPartsDate(string, formatProp, separator, false, [
|
|
40
|
+
'dd',
|
|
41
|
+
'MM',
|
|
42
|
+
'yyyy',
|
|
43
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
44
|
+
if (dd &&
|
|
45
|
+
MM &&
|
|
46
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatTypeDate, new Date()))) {
|
|
47
|
+
onError &&
|
|
48
|
+
onError({
|
|
49
|
+
type: datePickerErrorTypes[1],
|
|
50
|
+
stringValue: string,
|
|
51
|
+
dd: dd,
|
|
52
|
+
MM: MM,
|
|
53
|
+
yyyy: yyyy
|
|
54
|
+
});
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (dd &&
|
|
58
|
+
MM &&
|
|
59
|
+
yyyy &&
|
|
60
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatTypeDate, new Date()))) {
|
|
61
|
+
onError &&
|
|
62
|
+
onError({
|
|
63
|
+
type: datePickerErrorTypes[1],
|
|
64
|
+
stringValue: string,
|
|
65
|
+
dd: dd,
|
|
66
|
+
MM: MM,
|
|
67
|
+
yyyy: yyyy
|
|
68
|
+
});
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}, [formatProp, separator]);
|
|
76
|
+
// Нужно для синхранизации value c Imask,
|
|
77
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
78
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
82
|
+
}, [stringValue]);
|
|
13
83
|
};
|
|
@@ -6,7 +6,7 @@ export declare const DatePickerFieldTypeDateRange: React.ForwardRefExoticCompone
|
|
|
6
6
|
e: Event;
|
|
7
7
|
value: Date | null;
|
|
8
8
|
}) => void) | undefined;
|
|
9
|
-
onError?: import("../
|
|
9
|
+
onError?: import("../types").DatePickerPropOnError | undefined;
|
|
10
10
|
id?: string | undefined;
|
|
11
11
|
name?: string | undefined;
|
|
12
12
|
disabled?: boolean | undefined;
|
|
@@ -42,7 +42,7 @@ export declare const DatePickerFieldTypeDateRange: React.ForwardRefExoticCompone
|
|
|
42
42
|
label?: string | undefined;
|
|
43
43
|
caption?: string | undefined;
|
|
44
44
|
labelPosition?: "left" | "top" | undefined;
|
|
45
|
-
}, HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "view" | "size" | "caption" | "form" | "label" | "
|
|
45
|
+
}, HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "view" | "size" | "caption" | "form" | "label" | "width" | "format" | "autoFocus" | "readOnly" | "required" | "status" | "focused" | "ariaLabel" | "labelPosition" | "iconSize" | "separator" | "minDate" | "maxDate"> & {
|
|
46
46
|
onChange?: ((props: {
|
|
47
47
|
e: Event;
|
|
48
48
|
value: import("../../../utils/types/Date").DateRange | null;
|
|
@@ -77,4 +77,6 @@ export declare const DatePickerFieldTypeDateRange: React.ForwardRefExoticCompone
|
|
|
77
77
|
id?: string | undefined;
|
|
78
78
|
onChangeCurrentVisibleDate?: ((date: Date) => void) | undefined;
|
|
79
79
|
currentVisibleDate?: Date | undefined;
|
|
80
|
+
startFieldName?: string | undefined;
|
|
81
|
+
endFieldName?: string | undefined;
|
|
80
82
|
} & React.RefAttributes<HTMLDivElement>>;
|