@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
|
@@ -24,7 +24,7 @@ var sizeMap = {
|
|
|
24
24
|
};
|
|
25
25
|
exports.cnChoiceGroup = bem_1.cn('ChoiceGroup');
|
|
26
26
|
exports.ChoiceGroup = react_1["default"].forwardRef(function (props, ref) {
|
|
27
|
-
var _a = props.size, size = _a === void 0 ? exports.choiceGroupDefaultSize : _a, _b = props.form, form = _b === void 0 ? exports.choiceGroupDefaultForm : _b, _c = props.view, view = _c === void 0 ? exports.choiceGroupDefaultView : _c, _d = props.width, width = _d === void 0 ? exports.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 = tslib_1.__rest(props, ["size", "form", "view", "width", "onlyIcon", "iconSize", "value", "multiple", "items", "getLabel", "onChange", "getIcon", "name", "className", "disabled", "getDisabled"]);
|
|
27
|
+
var _a = props.size, size = _a === void 0 ? exports.choiceGroupDefaultSize : _a, _b = props.form, form = _b === void 0 ? exports.choiceGroupDefaultForm : _b, _c = props.view, view = _c === void 0 ? exports.choiceGroupDefaultView : _c, _d = props.width, width = _d === void 0 ? exports.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 = tslib_1.__rest(props, ["size", "form", "view", "width", "onlyIcon", "iconSize", "value", "multiple", "items", "getLabel", "onChange", "getIcon", "name", "className", "disabled", "getDisabled", "truncate"]);
|
|
28
28
|
var _h = useChoiceGroup_1.useChoiceGroup({
|
|
29
29
|
value: value,
|
|
30
30
|
getKey: getLabel,
|
|
@@ -32,7 +32,9 @@ exports.ChoiceGroup = react_1["default"].forwardRef(function (props, ref) {
|
|
|
32
32
|
multiple: multiple
|
|
33
33
|
}), getOnChange = _h.getOnChange, getChecked = _h.getChecked;
|
|
34
34
|
var iconSize = getByMap_1.getByMap(sizeMap, size, iconSizeProp);
|
|
35
|
-
return (react_1["default"].createElement("div", tslib_1.__assign({}, otherProps, { ref: ref, className: exports.cnChoiceGroup({ size: size, form: form, view: view, width: width, onlyIcon: onlyIcon, disabled: disabled
|
|
35
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({}, otherProps, { ref: ref, className: exports.cnChoiceGroup({ size: size, form: form, view: view, width: width, onlyIcon: onlyIcon, disabled: disabled, truncate: truncate }, [
|
|
36
|
+
className,
|
|
37
|
+
]) }), items.map(function (item, idx) {
|
|
36
38
|
var itemChecked = getChecked(item);
|
|
37
39
|
var itemDisabled = !!getDisabled && getDisabled(item);
|
|
38
40
|
return (react_1["default"].createElement(react_1["default"].Fragment, { key: getLabel(item) },
|
package/__internal__/cjs-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;
|
package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.ContextMenuLevel = exports.cnContextMenuLevel = void 0;
|
|
3
|
+
exports.ContextMenuLevel = exports.clearTimers = exports.cnContextMenuLevel = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./ContextMenuLevel.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
@@ -24,6 +24,26 @@ var renderHeader = function (groupLabel, first, size) {
|
|
|
24
24
|
}
|
|
25
25
|
return (react_1["default"].createElement(Text_1.Text, { view: "secondary", transform: "uppercase", className: exports.cnContextMenuLevel('Header', { size: size, first: first }), size: getByMap_1.getByMap(helper_1.sizeMapHeader, size) }, groupLabel));
|
|
26
26
|
};
|
|
27
|
+
var timers = [];
|
|
28
|
+
function clearTimers() {
|
|
29
|
+
var e_1, _a;
|
|
30
|
+
try {
|
|
31
|
+
for (var timers_1 = tslib_1.__values(timers), timers_1_1 = timers_1.next(); !timers_1_1.done; timers_1_1 = timers_1.next()) {
|
|
32
|
+
var timer = timers_1_1.value;
|
|
33
|
+
clearTimeout(timer);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
37
|
+
finally {
|
|
38
|
+
try {
|
|
39
|
+
if (timers_1_1 && !timers_1_1.done && (_a = timers_1["return"])) _a.call(timers_1);
|
|
40
|
+
}
|
|
41
|
+
finally { if (e_1) throw e_1.error; }
|
|
42
|
+
}
|
|
43
|
+
timers = [];
|
|
44
|
+
}
|
|
45
|
+
exports.clearTimers = clearTimers;
|
|
46
|
+
var closeDelay = 300;
|
|
27
47
|
function ContextMenuLevelRender(props, ref) {
|
|
28
48
|
var _a = props.size, size = _a === void 0 ? types_1.contextMenuDefaultSize : _a, items = props.items, groupsProp = props.groups, className = props.className,
|
|
29
49
|
// Свойства относящиеся к меню
|
|
@@ -37,7 +57,7 @@ function ContextMenuLevelRender(props, ref) {
|
|
|
37
57
|
var _b = tslib_1.__read(useFlag_1.useFlag(false), 2), hovered = _b[0], setHovered = _b[1];
|
|
38
58
|
var groups = getGroups_1.getGroups(items, getItemGroupId, groupsProp, getGroupId, sortGroup && (function (a, b) { return sortGroup(a.key, b.key); }));
|
|
39
59
|
var constructItemRefs = function () {
|
|
40
|
-
var
|
|
60
|
+
var e_2, _a;
|
|
41
61
|
var refs = {};
|
|
42
62
|
try {
|
|
43
63
|
for (var groups_1 = tslib_1.__values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
@@ -47,20 +67,22 @@ function ContextMenuLevelRender(props, ref) {
|
|
|
47
67
|
}
|
|
48
68
|
}
|
|
49
69
|
}
|
|
50
|
-
catch (
|
|
70
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
51
71
|
finally {
|
|
52
72
|
try {
|
|
53
73
|
if (groups_1_1 && !groups_1_1.done && (_a = groups_1["return"])) _a.call(groups_1);
|
|
54
74
|
}
|
|
55
|
-
finally { if (
|
|
75
|
+
finally { if (e_2) throw e_2.error; }
|
|
56
76
|
}
|
|
57
77
|
return refs;
|
|
58
78
|
};
|
|
59
79
|
var itemsRefs = react_1.useMemo(constructItemRefs, [items, groupsProp]);
|
|
60
80
|
react_1.useEffect(function () {
|
|
61
81
|
if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {
|
|
62
|
-
|
|
82
|
+
clearTimeout(timers[levelDepth]);
|
|
83
|
+
timers[levelDepth] = setTimeout(function () { return deleteLevel(levelDepth); }, closeDelay);
|
|
63
84
|
}
|
|
85
|
+
return function () { return clearTimeout(timers[levelDepth]); };
|
|
64
86
|
}, [hovered, hoveredParenLevel]);
|
|
65
87
|
var onMouseEnter = function (item, itemIndex) {
|
|
66
88
|
var subMenu = getItemSubMenu(item);
|
package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js
CHANGED
|
@@ -57,6 +57,7 @@ function ContextMenuLevelsRender(propsComponent, ref) {
|
|
|
57
57
|
handler: function (e) { return onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e); }
|
|
58
58
|
});
|
|
59
59
|
react_1.useEffect(function () {
|
|
60
|
+
ContextMenuLevel_1.clearTimers();
|
|
60
61
|
setLevels(helper_1.getLevels({
|
|
61
62
|
levels: levels,
|
|
62
63
|
items: items,
|
|
@@ -64,6 +65,7 @@ function ContextMenuLevelsRender(propsComponent, ref) {
|
|
|
64
65
|
getItemKey: getItemKey,
|
|
65
66
|
getItemSubMenu: getItemSubMenu
|
|
66
67
|
}));
|
|
68
|
+
return function () { return ContextMenuLevel_1.clearTimers(); };
|
|
67
69
|
}, [items]);
|
|
68
70
|
var firstLevelRef = useForkRef_1.useForkRef([levelsRefs[0], ref]);
|
|
69
71
|
return (react_1["default"].createElement(react_1["default"].Fragment, null, levels.map(function (level, index) { return (react_1["default"].createElement(ContextMenuLevel_1.ContextMenuLevel, tslib_1.__assign({}, otherProps, level, { key: "ContextMenu-" + index, style: tslib_1.__assign(tslib_1.__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>;
|
|
@@ -11,25 +11,31 @@ var DatePickerTypeDate_1 = require("./DatePickerTypeDate/DatePickerTypeDate");
|
|
|
11
11
|
var DatePickerTypeDateRange_1 = require("./DatePickerTypeDateRange/DatePickerTypeDateRange");
|
|
12
12
|
var DatePickerTypeDateTime_1 = require("./DatePickerTypeDateTime/DatePickerTypeDateTime");
|
|
13
13
|
var DatePickerTypeDateTimeRange_1 = require("./DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange");
|
|
14
|
+
var DatePickerTypeTime_1 = require("./DatePickerTypeTime/DatePickerTypeTime");
|
|
14
15
|
var helpers_1 = require("./helpers");
|
|
16
|
+
var types_1 = require("./types");
|
|
15
17
|
var typeMap = {
|
|
16
18
|
'date': DatePickerTypeDate_1.DatePickerTypeDate,
|
|
17
19
|
'date-range': DatePickerTypeDateRange_1.DatePickerTypeDateRange,
|
|
18
20
|
'date-time': DatePickerTypeDateTime_1.DatePickerTypeDateTime,
|
|
19
|
-
'date-time-range': DatePickerTypeDateTimeRange_1.DatePickerTypeDateTimeRange
|
|
21
|
+
'date-time-range': DatePickerTypeDateTimeRange_1.DatePickerTypeDateTimeRange,
|
|
22
|
+
'time': DatePickerTypeTime_1.DatePickerTypeTime
|
|
20
23
|
};
|
|
21
24
|
exports.COMPONENT_NAME = 'DatePicker';
|
|
22
25
|
exports.DatePicker = react_1.forwardRef(function (props, ref) {
|
|
23
26
|
var datePickerRef = react_1.useRef(null);
|
|
24
|
-
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, props, datePickerRef), _b = _a.type, type = _b === void 0 ?
|
|
25
|
-
var timeProps =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, props, datePickerRef), _b = _a.type, type = _b === void 0 ? types_1.datePickerPropTypeDefault : _b, _c = _a.minDate, minDate = _c === void 0 ? date_1.minDateDefault : _c, _d = _a.maxDate, maxDate = _d === void 0 ? date_1.maxDateDefault : _d, multiplicityMinutes = _a.multiplicityMinutes, multiplicitySeconds = _a.multiplicitySeconds, multiplicityHours = _a.multiplicityHours, otherProps = tslib_1.__rest(_a, ["type", "minDate", "maxDate", "multiplicityMinutes", "multiplicitySeconds", "multiplicityHours"]);
|
|
28
|
+
var timeProps = react_1.useMemo(function () {
|
|
29
|
+
return helpers_1.isTypeWithTime(type)
|
|
30
|
+
? {
|
|
31
|
+
multiplicityMinutes: multiplicityMinutes,
|
|
32
|
+
multiplicitySeconds: multiplicitySeconds,
|
|
33
|
+
multiplicityHours: multiplicityHours
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
36
|
+
}, [type, multiplicityMinutes, multiplicitySeconds, multiplicityHours]);
|
|
32
37
|
var Component = getByMap_1.getByMap(typeMap, type);
|
|
33
38
|
return (react_1["default"].createElement(Component, tslib_1.__assign({}, otherProps, timeProps, { minDate: minDate, maxDate: maxDate, ref: useForkRef_1.useForkRef([ref, datePickerRef]) })));
|
|
34
39
|
});
|
|
35
40
|
tslib_1.__exportStar(require("./helpers"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./types"), exports);
|
package/__internal__/cjs-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__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js
CHANGED
|
@@ -10,10 +10,10 @@ var MixPopoverAnimate_1 = require("../../../mixs/MixPopoverAnimate/MixPopoverAni
|
|
|
10
10
|
var bem_1 = require("../../../utils/bem");
|
|
11
11
|
var DateTimeCanary_1 = require("../../DateTimeCanary/DateTimeCanary");
|
|
12
12
|
var Popover_1 = require("../../Popover/Popover");
|
|
13
|
-
var
|
|
13
|
+
var types_1 = require("../types");
|
|
14
14
|
var cnDatePickerDropdown = bem_1.cn('DatePickerDropdown');
|
|
15
15
|
exports.DatePickerDropdown = react_1.forwardRef(function (props, componentRef) {
|
|
16
|
-
var _a = props.form, form = _a === void 0 ?
|
|
16
|
+
var _a = props.form, form = _a === void 0 ? types_1.datePickerPropDropdownFormDefault : _a, anchorRef = props.anchorRef, isOpen = props.isOpen, className = props.className, zIndex = props.zIndex, otherProps = tslib_1.__rest(props, ["form", "anchorRef", "isOpen", "className", "zIndex"]);
|
|
17
17
|
var rootRef = react_1.useRef(null);
|
|
18
18
|
var _b = tslib_1.__read(react_1.useState(), 2), direction = _b[0], setDirection = _b[1];
|
|
19
19
|
var ref = useForkRef_1.useForkRef([componentRef, rootRef]);
|
|
@@ -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;
|
|
@@ -4,17 +4,16 @@ exports.DatePickerFieldTypeDate = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var date_fns_1 = require("date-fns");
|
|
7
|
-
var imask_1 = tslib_1.__importDefault(require("imask"));
|
|
8
7
|
var useForkRef_1 = require("../../../hooks/useForkRef/useForkRef");
|
|
9
8
|
var useMutableRef_1 = require("../../../hooks/useMutableRef/useMutableRef");
|
|
10
9
|
var date_1 = require("../../../utils/date");
|
|
11
10
|
var TextField_1 = require("../../TextField/TextField");
|
|
12
11
|
var helpers_1 = require("../helpers");
|
|
12
|
+
var types_1 = require("../types");
|
|
13
13
|
var helpers_2 = require("./helpers");
|
|
14
14
|
exports.DatePickerFieldTypeDate = react_1["default"].forwardRef(function (props, ref) {
|
|
15
15
|
var _a = props.format, formatProp = _a === void 0 ? helpers_1.datePickerPropFormatTypeDate : _a, _b = props.separator, separator = _b === void 0 ? helpers_1.datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? helpers_1.datePickerPropPlaceholderTypeDate : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? date_1.minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? date_1.maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, otherProps = tslib_1.__rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef"]);
|
|
16
16
|
var inputRef = react_1.useRef(null);
|
|
17
|
-
var imaskRef = react_1.useRef(null);
|
|
18
17
|
var onChangeRef = useMutableRef_1.useMutableRef(onChange);
|
|
19
18
|
var _f = tslib_1.__read(react_1.useState(value && date_fns_1.isValid(value) ? date_fns_1.format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
20
19
|
var handleChange = react_1.useCallback(function (e, stringValue) {
|
|
@@ -25,13 +24,17 @@ exports.DatePickerFieldTypeDate = react_1["default"].forwardRef(function (props,
|
|
|
25
24
|
onChange({ e: e, value: null });
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
var _a = tslib_1.__read(
|
|
27
|
+
var _a = tslib_1.__read(helpers_1.getPartsDate(stringValue, formatProp, separator, false, [
|
|
28
|
+
'dd',
|
|
29
|
+
'MM',
|
|
30
|
+
'yyyy',
|
|
31
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
29
32
|
if (dd && MM && yyyy) {
|
|
30
33
|
var date = date_fns_1.parse("" + dd + helpers_1.datePickerPropSeparatorDefault + MM + helpers_1.datePickerPropSeparatorDefault + yyyy, helpers_1.datePickerPropFormatTypeDate, new Date());
|
|
31
34
|
if (!date_fns_1.isWithinInterval(date, { start: minDate, end: maxDate })) {
|
|
32
35
|
onError &&
|
|
33
36
|
onError({
|
|
34
|
-
type:
|
|
37
|
+
type: types_1.datePickerErrorTypes[0],
|
|
35
38
|
stringValue: stringValue,
|
|
36
39
|
dd: dd,
|
|
37
40
|
MM: MM,
|
|
@@ -48,6 +51,7 @@ exports.DatePickerFieldTypeDate = react_1["default"].forwardRef(function (props,
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
|
|
54
|
+
helpers_2.useImask(formatProp, separator, inputRef, stringValue, onError);
|
|
51
55
|
// при изменении value, нужно обновить stringValue
|
|
52
56
|
react_1.useEffect(function () {
|
|
53
57
|
if (value && date_fns_1.isValid(value)) {
|
|
@@ -63,66 +67,6 @@ exports.DatePickerFieldTypeDate = react_1["default"].forwardRef(function (props,
|
|
|
63
67
|
}, [value === null || value === void 0 ? void 0 : value.getTime()]);
|
|
64
68
|
// задаем маску и сохраняем обьект маски в ref
|
|
65
69
|
// обнавляем при смене формата
|
|
66
|
-
react_1.useEffect(function () {
|
|
67
|
-
if (inputRef.current) {
|
|
68
|
-
imaskRef.current = imask_1["default"](inputRef.current, {
|
|
69
|
-
mask: Date,
|
|
70
|
-
pattern: formatProp,
|
|
71
|
-
blocks: {
|
|
72
|
-
yyyy: {
|
|
73
|
-
mask: imask_1["default"].MaskedRange,
|
|
74
|
-
from: 1,
|
|
75
|
-
to: 9999
|
|
76
|
-
},
|
|
77
|
-
MM: {
|
|
78
|
-
mask: imask_1["default"].MaskedRange,
|
|
79
|
-
from: 1,
|
|
80
|
-
to: 12
|
|
81
|
-
},
|
|
82
|
-
dd: {
|
|
83
|
-
mask: imask_1["default"].MaskedRange,
|
|
84
|
-
from: 1,
|
|
85
|
-
to: 31
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
lazy: true,
|
|
89
|
-
autofix: true,
|
|
90
|
-
format: function (date) { return date_fns_1.format(date, formatProp); },
|
|
91
|
-
parse: function (string) { return date_fns_1.parse(string, formatProp, new Date()); },
|
|
92
|
-
validate: function (string) {
|
|
93
|
-
var _a = tslib_1.__read(helpers_2.getPartsDate(string, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
94
|
-
if (dd &&
|
|
95
|
-
MM &&
|
|
96
|
-
!date_fns_1.isValid(date_fns_1.parse("" + dd + helpers_1.datePickerPropSeparatorDefault + MM + helpers_1.datePickerPropSeparatorDefault + date_1.leapYear, helpers_1.datePickerPropFormatTypeDate, new Date()))) {
|
|
97
|
-
onError &&
|
|
98
|
-
onError({
|
|
99
|
-
type: helpers_1.datePickerErrorTypes[1],
|
|
100
|
-
stringValue: string,
|
|
101
|
-
dd: dd,
|
|
102
|
-
MM: MM,
|
|
103
|
-
yyyy: yyyy
|
|
104
|
-
});
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
if (dd &&
|
|
108
|
-
MM &&
|
|
109
|
-
yyyy &&
|
|
110
|
-
!date_fns_1.isValid(date_fns_1.parse("" + dd + helpers_1.datePickerPropSeparatorDefault + MM + helpers_1.datePickerPropSeparatorDefault + yyyy, helpers_1.datePickerPropFormatTypeDate, new Date()))) {
|
|
111
|
-
onError &&
|
|
112
|
-
onError({
|
|
113
|
-
type: helpers_1.datePickerErrorTypes[1],
|
|
114
|
-
stringValue: string,
|
|
115
|
-
dd: dd,
|
|
116
|
-
MM: MM,
|
|
117
|
-
yyyy: yyyy
|
|
118
|
-
});
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, [formatProp, separator]);
|
|
126
70
|
// задаем нативный oninput, так как с маской по другому не будет работать
|
|
127
71
|
// обнавляем oninput при смене handleChange
|
|
128
72
|
react_1.useEffect(function () {
|
|
@@ -133,12 +77,5 @@ exports.DatePickerFieldTypeDate = react_1["default"].forwardRef(function (props,
|
|
|
133
77
|
};
|
|
134
78
|
}
|
|
135
79
|
}, [handleChange]);
|
|
136
|
-
// Нужно для синхранизации value c Imask,
|
|
137
|
-
// так как value мы можем задать через пропс без самого ввода,
|
|
138
|
-
// и Imask требует ручной синхронихации в этом случае
|
|
139
|
-
react_1.useEffect(function () {
|
|
140
|
-
var _a;
|
|
141
|
-
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
142
|
-
}, [stringValue]);
|
|
143
80
|
return (react_1["default"].createElement(TextField_1.TextField, tslib_1.__assign({}, otherProps, { type: "text", inputContainerRef: ref, inputRef: useForkRef_1.useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
144
81
|
});
|
package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts
CHANGED
|
@@ -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,16 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
exports.useImask = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var date_fns_1 = require("date-fns");
|
|
7
|
+
var imask_1 = tslib_1.__importDefault(require("imask"));
|
|
8
|
+
var date_1 = require("../../../utils/date");
|
|
9
|
+
var helpers_1 = require("../helpers");
|
|
10
|
+
var types_1 = require("../types");
|
|
11
|
+
exports.useImask = function (formatProp, separator, inputRef, stringValue, onError) {
|
|
12
|
+
var imaskRef = react_1.useRef(null);
|
|
13
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
14
|
+
// обнавляем при смене формата
|
|
15
|
+
react_1.useEffect(function () {
|
|
16
|
+
if (inputRef.current) {
|
|
17
|
+
imaskRef.current = imask_1["default"](inputRef.current, {
|
|
18
|
+
mask: Date,
|
|
19
|
+
pattern: formatProp,
|
|
20
|
+
blocks: {
|
|
21
|
+
yyyy: {
|
|
22
|
+
mask: imask_1["default"].MaskedRange,
|
|
23
|
+
from: 1,
|
|
24
|
+
to: 9999
|
|
25
|
+
},
|
|
26
|
+
MM: {
|
|
27
|
+
mask: imask_1["default"].MaskedRange,
|
|
28
|
+
from: 1,
|
|
29
|
+
to: 12
|
|
30
|
+
},
|
|
31
|
+
dd: {
|
|
32
|
+
mask: imask_1["default"].MaskedRange,
|
|
33
|
+
from: 1,
|
|
34
|
+
to: 31
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
lazy: true,
|
|
38
|
+
autofix: true,
|
|
39
|
+
format: function (date) { return date_fns_1.format(date, formatProp); },
|
|
40
|
+
parse: function (string) { return date_fns_1.parse(string, formatProp, new Date()); },
|
|
41
|
+
validate: function (string) {
|
|
42
|
+
var _a = tslib_1.__read(helpers_1.getPartsDate(string, formatProp, separator, false, [
|
|
43
|
+
'dd',
|
|
44
|
+
'MM',
|
|
45
|
+
'yyyy',
|
|
46
|
+
]), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
47
|
+
if (dd &&
|
|
48
|
+
MM &&
|
|
49
|
+
!date_fns_1.isValid(date_fns_1.parse("" + dd + helpers_1.datePickerPropSeparatorDefault + MM + helpers_1.datePickerPropSeparatorDefault + date_1.leapYear, helpers_1.datePickerPropFormatTypeDate, new Date()))) {
|
|
50
|
+
onError &&
|
|
51
|
+
onError({
|
|
52
|
+
type: types_1.datePickerErrorTypes[1],
|
|
53
|
+
stringValue: string,
|
|
54
|
+
dd: dd,
|
|
55
|
+
MM: MM,
|
|
56
|
+
yyyy: yyyy
|
|
57
|
+
});
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (dd &&
|
|
61
|
+
MM &&
|
|
62
|
+
yyyy &&
|
|
63
|
+
!date_fns_1.isValid(date_fns_1.parse("" + dd + helpers_1.datePickerPropSeparatorDefault + MM + helpers_1.datePickerPropSeparatorDefault + yyyy, helpers_1.datePickerPropFormatTypeDate, new Date()))) {
|
|
64
|
+
onError &&
|
|
65
|
+
onError({
|
|
66
|
+
type: types_1.datePickerErrorTypes[1],
|
|
67
|
+
stringValue: string,
|
|
68
|
+
dd: dd,
|
|
69
|
+
MM: MM,
|
|
70
|
+
yyyy: yyyy
|
|
71
|
+
});
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, [formatProp, separator]);
|
|
79
|
+
// Нужно для синхранизации value c Imask,
|
|
80
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
81
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
82
|
+
react_1.useEffect(function () {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
85
|
+
}, [stringValue]);
|
|
16
86
|
};
|
|
@@ -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>>;
|
|
@@ -10,13 +10,13 @@ var FieldLabel_1 = require("../../FieldLabel/FieldLabel");
|
|
|
10
10
|
var DatePickerFieldTypeDate_1 = require("../DatePickerFieldTypeDate/DatePickerFieldTypeDate");
|
|
11
11
|
var DatePickerMixRangeField_1 = require("../DatePickerMixRangeField/DatePickerMixRangeField");
|
|
12
12
|
var helpers_1 = require("../helpers");
|
|
13
|
+
var types_1 = require("../types");
|
|
13
14
|
exports.DatePickerFieldTypeDateRange = react_1.forwardRef(function (props, ref) {
|
|
14
15
|
var _a, _b;
|
|
15
|
-
var className = props.className, _c = props.form, form = _c === void 0 ? 'default' : _c, startFieldInputRef = props.startFieldInputRef, startFieldLeftSide = props.startFieldLeftSide, startFieldRightSide = props.startFieldRightSide, endFieldInputRef = props.endFieldInputRef, endFieldLeftSide = props.endFieldLeftSide, endFieldRightSide = props.endFieldRightSide, _d = props.value, value = _d === void 0 ? [] : _d, onChange = props.onChange, onError = props.onError,
|
|
16
|
+
var className = props.className, _c = props.form, form = _c === void 0 ? 'default' : _c, startFieldInputRef = props.startFieldInputRef, startFieldLeftSide = props.startFieldLeftSide, startFieldRightSide = props.startFieldRightSide, endFieldInputRef = props.endFieldInputRef, endFieldLeftSide = props.endFieldLeftSide, endFieldRightSide = props.endFieldRightSide, _d = props.value, value = _d === void 0 ? [] : _d, onChange = props.onChange, onError = props.onError, startFieldName = props.startFieldName, endFieldName = props.endFieldName, disabled = props.disabled, size = props.size, view = props.view, status = props.status, autoFocus = props.autoFocus, placeholder = props.placeholder, readOnly = props.readOnly, required = props.required, tabIndex = props.tabIndex, ariaLabel = props.ariaLabel, iconSize = props.iconSize, format = props.format, separator = props.separator, minDate = props.minDate, maxDate = props.maxDate, startFieldOnBlur = props.startFieldOnBlur, startFieldOnFocus = props.startFieldOnFocus, endFieldOnBlur = props.endFieldOnBlur, endFieldOnFocus = props.endFieldOnFocus, startFieldRef = props.startFieldRef, endFieldRef = props.endFieldRef, startFocused = props.startFocused, endFocused = props.endFocused, label = props.label, labelPosition = props.labelPosition, caption = props.caption, width = props.width, otherProps = tslib_1.__rest(props, ["className", "form", "startFieldInputRef", "startFieldLeftSide", "startFieldRightSide", "endFieldInputRef", "endFieldLeftSide", "endFieldRightSide", "value", "onChange", "onError", "startFieldName", "endFieldName", "disabled", "size", "view", "status", "autoFocus", "placeholder", "readOnly", "required", "tabIndex", "ariaLabel", "iconSize", "format", "separator", "minDate", "maxDate", "startFieldOnBlur", "startFieldOnFocus", "endFieldOnBlur", "endFieldOnFocus", "startFieldRef", "endFieldRef", "startFocused", "endFocused", "label", "labelPosition", "caption", "width"]);
|
|
16
17
|
var commonProps = {
|
|
17
18
|
className: DatePickerMixRangeField_1.cnDatePickerMixRangeField('Field'),
|
|
18
19
|
disabled: disabled,
|
|
19
|
-
name: name,
|
|
20
20
|
onError: onError,
|
|
21
21
|
size: size,
|
|
22
22
|
view: view,
|
|
@@ -48,7 +48,7 @@ exports.DatePickerFieldTypeDateRange = react_1.forwardRef(function (props, ref)
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
onChange({ e: e, value: [start, undefined] });
|
|
51
|
-
onError && onError({ type:
|
|
51
|
+
onError && onError({ type: types_1.datePickerErrorTypes[2], date: [start, end] });
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
if (start) {
|
|
@@ -92,7 +92,7 @@ exports.DatePickerFieldTypeDateRange = react_1.forwardRef(function (props, ref)
|
|
|
92
92
|
label && (react_1["default"].createElement(FieldLabel_1.FieldLabel, { required: required, className: DatePickerMixRangeField_1.cnDatePickerMixRangeField('Label', { labelPosition: labelPosition }), size: size }, label)),
|
|
93
93
|
react_1["default"].createElement("div", { className: DatePickerMixRangeField_1.cnDatePickerMixRangeField('Body') },
|
|
94
94
|
react_1["default"].createElement("div", { className: DatePickerMixRangeField_1.cnDatePickerMixRangeField('Fields') },
|
|
95
|
-
react_1["default"].createElement(DatePickerFieldTypeDate_1.DatePickerFieldTypeDate, tslib_1.__assign({}, commonProps, { inputRef: startFieldInputRef, ref: startFieldRef, leftSide: startFieldLeftSide, rightSide: startFieldRightSide, form: helpers_1.getFormForStart(form), value: startDate, onChange: handleStartDateChange, onFocus: startFieldOnFocus, onBlur: startFieldOnBlur, focused: startFocused })),
|
|
96
|
-
react_1["default"].createElement(DatePickerFieldTypeDate_1.DatePickerFieldTypeDate, tslib_1.__assign({}, commonProps, { inputRef: endFieldInputRef, ref: endFieldRef, leftSide: endFieldLeftSide, rightSide: endFieldRightSide, form: helpers_1.getFormForEnd(form), value: endDate, onChange: handleEndDateChange, onFocus: endFieldOnFocus, onBlur: endFieldOnBlur, focused: endFocused }))),
|
|
95
|
+
react_1["default"].createElement(DatePickerFieldTypeDate_1.DatePickerFieldTypeDate, tslib_1.__assign({}, commonProps, { inputRef: startFieldInputRef, ref: startFieldRef, leftSide: startFieldLeftSide, rightSide: startFieldRightSide, form: helpers_1.getFormForStart(form), value: startDate, onChange: handleStartDateChange, onFocus: startFieldOnFocus, onBlur: startFieldOnBlur, focused: startFocused, name: startFieldName })),
|
|
96
|
+
react_1["default"].createElement(DatePickerFieldTypeDate_1.DatePickerFieldTypeDate, tslib_1.__assign({}, commonProps, { name: endFieldName, inputRef: endFieldInputRef, ref: endFieldRef, leftSide: endFieldLeftSide, rightSide: endFieldRightSide, form: helpers_1.getFormForEnd(form), value: endDate, onChange: handleEndDateChange, onFocus: endFieldOnFocus, onBlur: endFieldOnBlur, focused: endFocused }))),
|
|
97
97
|
caption && (react_1["default"].createElement(FieldCaption_1.FieldCaption, { className: DatePickerMixRangeField_1.cnDatePickerMixRangeField('Caption'), status: status }, caption)))));
|
|
98
98
|
});
|
package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare type DatePickerFieldTypeDateRangePropOnChange = (props: {
|
|
|
6
6
|
e: Event;
|
|
7
7
|
value: DateRange | null;
|
|
8
8
|
}) => void;
|
|
9
|
-
export declare type DatePickerFieldTypeDateRangeProps = Omit<DatePickerFieldTypeDateProps, 'onChange' | 'value' | 'inputRef' | 'leftSide' | 'rightSide' | 'id' | 'onFocus' | 'onBlur'> & {
|
|
9
|
+
export declare type DatePickerFieldTypeDateRangeProps = Omit<DatePickerFieldTypeDateProps, 'onChange' | 'value' | 'inputRef' | 'leftSide' | 'rightSide' | 'id' | 'onFocus' | 'onBlur' | 'name'> & {
|
|
10
10
|
onChange?: DatePickerFieldTypeDateRangePropOnChange;
|
|
11
11
|
value?: DateRange | null;
|
|
12
12
|
startFieldInputRef?: React.Ref<HTMLInputElement>;
|
|
@@ -26,5 +26,7 @@ export declare type DatePickerFieldTypeDateRangeProps = Omit<DatePickerFieldType
|
|
|
26
26
|
id?: string;
|
|
27
27
|
onChangeCurrentVisibleDate?: (date: Date) => void;
|
|
28
28
|
currentVisibleDate?: Date;
|
|
29
|
+
startFieldName?: string;
|
|
30
|
+
endFieldName?: string;
|
|
29
31
|
};
|
|
30
32
|
export {};
|
|
@@ -6,7 +6,7 @@ export declare const DatePickerFieldTypeDateTime: React.ForwardRefExoticComponen
|
|
|
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;
|