@consta/uikit 3.18.2 → 3.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +24 -40
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/ContextMenuCanary/package.json +1 -1
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFacebook/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconHome/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconInstagram/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconOperators/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPicture/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconPriceLabel/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconSave/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSendMessage/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTable2/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTechResponse/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconVkontakte/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/IconWrench/package.json +1 -1
- package/IconYandexDzen/package.json +1 -1
- package/IconYoutube/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixPopoverAnimate/package.json +1 -1
- package/MixPopoverArrow/package.json +1 -1
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/README.md +6 -6
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesExit/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.css +4 -1
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.d.ts +1 -0
- package/__internal__/cjs-src/components/ChoiceGroup/ChoiceGroup.js +4 -2
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +1 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +27 -5
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +12 -8
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +6 -70
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +82 -13
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +9 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +0 -2
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +12 -22
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +75 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +83 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +3 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.js +35 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +6 -1
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +33 -4
- package/__internal__/cjs-src/components/EventInterceptor/types.d.ts +1 -1
- package/__internal__/cjs-src/components/Modal/Modal.css +50 -25
- package/__internal__/cjs-src/components/Modal/Modal.js +3 -3
- package/__internal__/cjs-src/components/Pagination/Pagination.d.ts +0 -1
- package/__internal__/cjs-src/components/Pagination/Pagination.js +6 -9
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithTheme.js +15 -4
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.d.ts +4 -1
- package/__internal__/cjs-src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js +3 -2
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/cjs-src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/cjs-src/hooks/useClickOutside/useClickOutside.d.ts +3 -3
- package/__internal__/cjs-src/hooks/useClickOutside/useClickOutside.js +18 -7
- package/__internal__/cjs-src/icons/IconFacebook/IconFacebook_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconFacebook/IconFacebook_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconInstagram/IconInstagram_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconInstagram/IconInstagram_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconVkontakte/IconVkontakte_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconVkontakte/IconVkontakte_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconYandexDzen/IconYandexDzen_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconYandexDzen/IconYandexDzen_size_s.js +1 -1
- package/__internal__/cjs-src/icons/IconYoutube/IconYoutube_size_m.js +1 -1
- package/__internal__/cjs-src/icons/IconYoutube/IconYoutube_size_s.js +1 -1
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.css +4 -1
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.d.ts +1 -0
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js +4 -2
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +1 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +25 -4
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +3 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +14 -10
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +9 -73
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +81 -12
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +11 -4
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.d.ts +0 -2
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTime/helpers.js +13 -23
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +48 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +72 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.d.ts +49 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeTime/helpers.js +80 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +3 -3
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeTime/DatePickerTypeTime.js +32 -0
- package/__internal__/src/components/DatePickerCanary/helpers.d.ts +6 -1
- package/__internal__/src/components/DatePickerCanary/helpers.js +32 -3
- package/__internal__/src/components/EventInterceptor/types.d.ts +1 -1
- package/__internal__/src/components/Modal/Modal.css +50 -25
- package/__internal__/src/components/Modal/Modal.js +3 -3
- package/__internal__/src/components/Pagination/Pagination.d.ts +0 -1
- package/__internal__/src/components/Pagination/Pagination.js +5 -8
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js +15 -4
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.d.ts +4 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithThemeContext/PortalWithThemeContext.js +3 -2
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.css +10 -10
- package/__internal__/src/components/Sidebar/Sidebar.js +2 -2
- package/__internal__/src/hooks/useClickOutside/useClickOutside.d.ts +3 -3
- package/__internal__/src/hooks/useClickOutside/useClickOutside.js +18 -7
- package/__internal__/src/icons/IconFacebook/IconFacebook_size_m.js +1 -1
- package/__internal__/src/icons/IconFacebook/IconFacebook_size_s.js +1 -1
- package/__internal__/src/icons/IconInstagram/IconInstagram_size_m.js +1 -1
- package/__internal__/src/icons/IconInstagram/IconInstagram_size_s.js +1 -1
- package/__internal__/src/icons/IconVkontakte/IconVkontakte_size_m.js +1 -1
- package/__internal__/src/icons/IconVkontakte/IconVkontakte_size_s.js +1 -1
- package/__internal__/src/icons/IconYandexDzen/IconYandexDzen_size_m.js +1 -1
- package/__internal__/src/icons/IconYandexDzen/IconYandexDzen_size_s.js +1 -1
- package/__internal__/src/icons/IconYoutube/IconYoutube_size_m.js +1 -1
- package/__internal__/src/icons/IconYoutube/IconYoutube_size_s.js +1 -1
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +1 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useHideElementsInLine/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useRefs/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useSortSteps/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
import { __read
|
|
1
|
+
import { __read } from "tslib";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
import { addHours, addMinutes, addSeconds, format, isValid, parse, startOfDay, startOfHour, startOfMinute, } from 'date-fns';
|
|
4
4
|
import IMask from 'imask';
|
|
5
5
|
import { leapYear } from '../../../utils/date';
|
|
6
6
|
import { getLabelHours, getLabelMinutes, getLabelSeconds } from '../../DateTimeCanary/helpers';
|
|
7
|
-
import { datePickerErrorTypes, datePickerPropFormatTypeDate, datePickerPropSeparatorDefault, getTimeEnum, } from '../helpers';
|
|
8
|
-
var getPartDate = function (formatArray, stringArray, marker) {
|
|
9
|
-
var index = formatArray.indexOf(marker);
|
|
10
|
-
if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
|
|
11
|
-
return stringArray[index];
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
export var getParts = function (format, separator) {
|
|
16
|
-
var _a = __read(format.split(' '), 2), date = _a[0], time = _a[1];
|
|
17
|
-
return __spread((date ? date.split(separator) : []), (time ? time.split(':') : []));
|
|
18
|
-
};
|
|
19
|
-
export var getPartsDate = function (value, format, separator, markers) {
|
|
20
|
-
if (markers === void 0) { markers = ['dd', 'MM', 'yyyy', 'HH', 'mm', 'ss']; }
|
|
21
|
-
var formatArray = getParts(format, separator);
|
|
22
|
-
var stringArray = getParts(value, separator);
|
|
23
|
-
return markers.map(function (marker) { return getPartDate(formatArray, stringArray, marker); });
|
|
24
|
-
};
|
|
7
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeDate, datePickerPropSeparatorDefault, getPartsDate, getTimeEnum, } from '../helpers';
|
|
25
8
|
export var useImask = function (formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes, inputRef, stringValue, onError) {
|
|
26
9
|
var imaskRef = useRef(null);
|
|
27
10
|
// задаем маску и сохраняем обьект маски в ref
|
|
@@ -49,7 +32,7 @@ export var useImask = function (formatProp, separator, multiplicityHours, multip
|
|
|
49
32
|
from: 1,
|
|
50
33
|
to: 31
|
|
51
34
|
},
|
|
52
|
-
HH: multiplicityHours && multiplicityHours >
|
|
35
|
+
HH: multiplicityHours && multiplicityHours > 1
|
|
53
36
|
? {
|
|
54
37
|
mask: IMask.MaskedEnum,
|
|
55
38
|
"enum": getTimeEnum(24, multiplicityHours, startOfDay, addHours, getLabelHours)
|
|
@@ -59,7 +42,7 @@ export var useImask = function (formatProp, separator, multiplicityHours, multip
|
|
|
59
42
|
from: 0,
|
|
60
43
|
to: 23
|
|
61
44
|
},
|
|
62
|
-
mm: multiplicityMinutes && multiplicityMinutes >
|
|
45
|
+
mm: multiplicityMinutes && multiplicityMinutes > 1
|
|
63
46
|
? {
|
|
64
47
|
mask: IMask.MaskedEnum,
|
|
65
48
|
"enum": getTimeEnum(60, multiplicityMinutes, startOfHour, addMinutes, getLabelMinutes)
|
|
@@ -69,7 +52,7 @@ export var useImask = function (formatProp, separator, multiplicityHours, multip
|
|
|
69
52
|
from: 0,
|
|
70
53
|
to: 59
|
|
71
54
|
},
|
|
72
|
-
ss: multiplicitySeconds && multiplicitySeconds >
|
|
55
|
+
ss: multiplicitySeconds && multiplicitySeconds > 1
|
|
73
56
|
? {
|
|
74
57
|
mask: IMask.MaskedEnum,
|
|
75
58
|
"enum": getTimeEnum(60, multiplicitySeconds, startOfMinute, addSeconds, getLabelSeconds)
|
|
@@ -85,7 +68,14 @@ export var useImask = function (formatProp, separator, multiplicityHours, multip
|
|
|
85
68
|
format: function (date) { return format(date, formatProp); },
|
|
86
69
|
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
87
70
|
validate: function (string) {
|
|
88
|
-
var _a = __read(getPartsDate(string, formatProp, separator
|
|
71
|
+
var _a = __read(getPartsDate(string, formatProp, separator, true, [
|
|
72
|
+
'dd',
|
|
73
|
+
'MM',
|
|
74
|
+
'yyyy',
|
|
75
|
+
'HH',
|
|
76
|
+
'mm',
|
|
77
|
+
'ss',
|
|
78
|
+
]), 6), dd = _a[0], MM = _a[1], yyyy = _a[2], HH = _a[3], mm = _a[4], ss = _a[5];
|
|
89
79
|
if (dd &&
|
|
90
80
|
MM &&
|
|
91
81
|
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatTypeDate, new Date()))) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DatePickerFieldTypeTime: React.ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
value?: Date | null | undefined;
|
|
5
|
+
onChange?: ((props: {
|
|
6
|
+
e: Event;
|
|
7
|
+
value: Date | null;
|
|
8
|
+
}) => void) | undefined;
|
|
9
|
+
onError?: import("../helpers").DatePickerPropOnError | undefined;
|
|
10
|
+
id?: string | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
14
|
+
view?: "default" | "clear" | undefined;
|
|
15
|
+
form?: "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear" | undefined;
|
|
16
|
+
status?: "alert" | "success" | "warning" | undefined;
|
|
17
|
+
width?: "default" | "full" | undefined;
|
|
18
|
+
onFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
19
|
+
onBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
20
|
+
autoFocus?: boolean | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
leftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributesAndRef<{
|
|
23
|
+
view?: "link" | "alert" | "brand" | "ghost" | "primary" | "secondary" | "success" | "warning" | "disabled" | undefined;
|
|
24
|
+
size?: "xs" | "s" | "m" | undefined;
|
|
25
|
+
}, HTMLSpanElement>> | undefined;
|
|
26
|
+
rightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributesAndRef<{
|
|
27
|
+
view?: "link" | "alert" | "brand" | "ghost" | "primary" | "secondary" | "success" | "warning" | "disabled" | undefined;
|
|
28
|
+
size?: "xs" | "s" | "m" | undefined;
|
|
29
|
+
}, HTMLSpanElement>> | undefined;
|
|
30
|
+
readOnly?: boolean | undefined;
|
|
31
|
+
required?: boolean | undefined;
|
|
32
|
+
tabIndex?: number | undefined;
|
|
33
|
+
inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
|
|
34
|
+
ariaLabel?: string | undefined;
|
|
35
|
+
iconSize?: "xs" | "s" | "m" | undefined;
|
|
36
|
+
children?: undefined;
|
|
37
|
+
format?: string | undefined;
|
|
38
|
+
separator?: string | undefined;
|
|
39
|
+
minDate?: Date | undefined;
|
|
40
|
+
maxDate?: Date | undefined;
|
|
41
|
+
focused?: boolean | undefined;
|
|
42
|
+
multiplicitySeconds?: number | undefined;
|
|
43
|
+
multiplicityMinutes?: number | undefined;
|
|
44
|
+
multiplicityHours?: number | undefined;
|
|
45
|
+
label?: string | undefined;
|
|
46
|
+
caption?: string | undefined;
|
|
47
|
+
labelPosition?: "left" | "top" | undefined;
|
|
48
|
+
} & Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "slot" | "spellCheck" | "style" | "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" | "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" | "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"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { format, isValid, isWithinInterval, parse } from 'date-fns';
|
|
4
|
+
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
5
|
+
import { useMutableRef } from '../../../hooks/useMutableRef/useMutableRef';
|
|
6
|
+
import { maxDateDefault, minDateDefault } from '../../../utils/date';
|
|
7
|
+
import { TextField } from '../../TextField/TextField';
|
|
8
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeTime, datePickerPropPlaceholderTypeTime, datePickerPropSeparatorDefault, getParts, getPartsDate, } from '../helpers';
|
|
9
|
+
import { useImask } from './helpers';
|
|
10
|
+
export var DatePickerFieldTypeTime = React.forwardRef(function (props, ref) {
|
|
11
|
+
var _a = props.format, formatProp = _a === void 0 ? datePickerPropFormatTypeTime : _a, _b = props.separator, separator = _b === void 0 ? datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? datePickerPropPlaceholderTypeTime : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, multiplicityHours = props.multiplicityHours, multiplicitySeconds = props.multiplicitySeconds, multiplicityMinutes = props.multiplicityMinutes, otherProps = __rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef", "multiplicityHours", "multiplicitySeconds", "multiplicityMinutes"]);
|
|
12
|
+
var inputRef = useRef(null);
|
|
13
|
+
var onChangeRef = useMutableRef(onChange);
|
|
14
|
+
var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
15
|
+
var formatParts = useMemo(function () { return getParts(formatProp, ':'); }, [formatProp, separator]);
|
|
16
|
+
var handleChange = useCallback(function (e, stringValue) {
|
|
17
|
+
setStringValue(stringValue);
|
|
18
|
+
var onChange = onChangeRef.current;
|
|
19
|
+
if (onChange) {
|
|
20
|
+
if (!stringValue) {
|
|
21
|
+
onChange({ e: e, value: null });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
var partsTime = getPartsDate(stringValue, formatProp, ':', false, ['HH', 'mm', 'ss']);
|
|
25
|
+
var _a = __read(partsTime, 3), HH = _a[0], mm = _a[1], ss = _a[2];
|
|
26
|
+
if (partsTime.filter(function (item) { return !!item; }).length === formatParts.length) {
|
|
27
|
+
var date = parse(HH + ":" + mm + ":" + ss, datePickerPropFormatTypeTime, value || new Date());
|
|
28
|
+
if (!isWithinInterval(date, { start: minDate, end: maxDate })) {
|
|
29
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
30
|
+
type: datePickerErrorTypes[0],
|
|
31
|
+
stringValue: stringValue,
|
|
32
|
+
date: date,
|
|
33
|
+
HH: HH,
|
|
34
|
+
mm: mm,
|
|
35
|
+
ss: ss
|
|
36
|
+
});
|
|
37
|
+
onChange({ e: e, value: null });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
onChange({ e: e, value: date });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
onChange({ e: e, value: null });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
|
|
47
|
+
useImask(formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes, inputRef, stringValue, onError);
|
|
48
|
+
// при изменении value, нужно обновить stringValue
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
if (value && isValid(value)) {
|
|
51
|
+
setStringValue(format(value, formatProp));
|
|
52
|
+
}
|
|
53
|
+
else if ((stringValue === null || stringValue === void 0 ? void 0 : stringValue.length) === formatProp.length) {
|
|
54
|
+
// если количество введенных символов меньше чем в формате маски
|
|
55
|
+
// то не нужно мешать вводу с клавиатуры
|
|
56
|
+
// если дата была введена полностью и value пришел null,
|
|
57
|
+
// то можно считать что поле нуждается в очистке
|
|
58
|
+
setStringValue('');
|
|
59
|
+
}
|
|
60
|
+
}, [value === null || value === void 0 ? void 0 : value.getTime()]);
|
|
61
|
+
// задаем нативный oninput, так как с маской по другому не будет работать
|
|
62
|
+
// обнавляем oninput при смене handleChange
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (inputRef.current) {
|
|
65
|
+
inputRef.current.oninput = function (e) {
|
|
66
|
+
var _a;
|
|
67
|
+
handleChange(e, ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || '');
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, [handleChange]);
|
|
71
|
+
return (React.createElement(TextField, __assign({}, otherProps, { type: "text", inputContainerRef: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
72
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconComponent, IconPropSize } from '../../../icons/Icon/Icon';
|
|
3
|
+
import { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../../TextField/TextField';
|
|
5
|
+
import { DatePickerPropOnError } from '../helpers';
|
|
6
|
+
declare type DatePickerFieldTypeTimePropOnChange = (props: {
|
|
7
|
+
e: Event;
|
|
8
|
+
value: Date | null;
|
|
9
|
+
}) => void;
|
|
10
|
+
export declare type DatePickerFieldTypeTimeProps = PropsWithHTMLAttributes<{
|
|
11
|
+
className?: string;
|
|
12
|
+
value?: Date | null;
|
|
13
|
+
onChange?: DatePickerFieldTypeTimePropOnChange;
|
|
14
|
+
onError?: DatePickerPropOnError;
|
|
15
|
+
id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
size?: TextFieldPropSize;
|
|
19
|
+
view?: TextFieldPropView;
|
|
20
|
+
form?: TextFieldPropForm;
|
|
21
|
+
status?: TextFieldPropStatus;
|
|
22
|
+
width?: TextFieldPropWidth;
|
|
23
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
24
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
leftSide?: string | IconComponent;
|
|
28
|
+
rightSide?: string | IconComponent;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
tabIndex?: number;
|
|
32
|
+
inputRef?: React.Ref<HTMLTextAreaElement | HTMLInputElement>;
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
iconSize?: IconPropSize;
|
|
35
|
+
children?: never;
|
|
36
|
+
format?: string;
|
|
37
|
+
separator?: string;
|
|
38
|
+
minDate?: Date;
|
|
39
|
+
maxDate?: Date;
|
|
40
|
+
focused?: boolean;
|
|
41
|
+
multiplicitySeconds?: number;
|
|
42
|
+
multiplicityMinutes?: number;
|
|
43
|
+
multiplicityHours?: number;
|
|
44
|
+
label?: string;
|
|
45
|
+
caption?: string;
|
|
46
|
+
labelPosition?: 'top' | 'left';
|
|
47
|
+
}, HTMLDivElement>;
|
|
48
|
+
export declare const useImask: (formatProp: string, separator: string, multiplicityHours: number | undefined, multiplicitySeconds: number | undefined, multiplicityMinutes: number | undefined, inputRef: React.RefObject<HTMLInputElement>, stringValue: string | null, onError: DatePickerPropOnError | undefined) => void;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { addHours, addMinutes, addSeconds, format, isValid, parse, startOfDay, startOfHour, startOfMinute, } from 'date-fns';
|
|
4
|
+
import IMask from 'imask';
|
|
5
|
+
import { getLabelHours, getLabelMinutes, getLabelSeconds } from '../../DateTimeCanary/helpers';
|
|
6
|
+
import { datePickerErrorTypes, datePickerPropFormatTypeTime, getPartsDate, getTimeEnum, } from '../helpers';
|
|
7
|
+
export var useImask = function (formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes, inputRef, stringValue, onError) {
|
|
8
|
+
var imaskRef = useRef(null);
|
|
9
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
10
|
+
// обнавляем при смене формата
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
if (!inputRef.current) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
imaskRef.current = IMask(inputRef.current, {
|
|
16
|
+
mask: Date,
|
|
17
|
+
pattern: formatProp,
|
|
18
|
+
blocks: {
|
|
19
|
+
HH: multiplicityHours && multiplicityHours > 1
|
|
20
|
+
? {
|
|
21
|
+
mask: IMask.MaskedEnum,
|
|
22
|
+
"enum": getTimeEnum(24, multiplicityHours, startOfDay, addHours, getLabelHours)
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
mask: IMask.MaskedRange,
|
|
26
|
+
from: 0,
|
|
27
|
+
to: 23
|
|
28
|
+
},
|
|
29
|
+
mm: multiplicityMinutes && multiplicityMinutes > 1
|
|
30
|
+
? {
|
|
31
|
+
mask: IMask.MaskedEnum,
|
|
32
|
+
"enum": getTimeEnum(60, multiplicityMinutes, startOfHour, addMinutes, getLabelMinutes)
|
|
33
|
+
}
|
|
34
|
+
: {
|
|
35
|
+
mask: IMask.MaskedRange,
|
|
36
|
+
from: 0,
|
|
37
|
+
to: 59
|
|
38
|
+
},
|
|
39
|
+
ss: multiplicitySeconds && multiplicitySeconds > 1
|
|
40
|
+
? {
|
|
41
|
+
mask: IMask.MaskedEnum,
|
|
42
|
+
"enum": getTimeEnum(60, multiplicitySeconds, startOfMinute, addSeconds, getLabelSeconds)
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
mask: IMask.MaskedRange,
|
|
46
|
+
from: 0,
|
|
47
|
+
to: 59
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
lazy: true,
|
|
51
|
+
autofix: true,
|
|
52
|
+
format: function (date) { return format(date, formatProp); },
|
|
53
|
+
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
54
|
+
validate: function (string) {
|
|
55
|
+
var _a = __read(getPartsDate(string, formatProp, ':', false, ['HH', 'mm', 'ss']), 3), HH = _a[0], mm = _a[1], ss = _a[2];
|
|
56
|
+
if (HH &&
|
|
57
|
+
mm &&
|
|
58
|
+
ss &&
|
|
59
|
+
!isValid(parse(HH + ":" + mm + ":" + ss, datePickerPropFormatTypeTime, new Date()))) {
|
|
60
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
61
|
+
type: datePickerErrorTypes[1],
|
|
62
|
+
stringValue: string,
|
|
63
|
+
HH: HH,
|
|
64
|
+
mm: mm,
|
|
65
|
+
ss: ss
|
|
66
|
+
});
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}, [formatProp, separator, multiplicityHours, multiplicitySeconds, multiplicityMinutes]);
|
|
73
|
+
// Нужно для синхранизации value c Imask,
|
|
74
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
75
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
79
|
+
}, [stringValue]);
|
|
80
|
+
};
|
|
@@ -10,7 +10,7 @@ import { DatePickerFieldTypeDateTime } from '../DatePickerFieldTypeDateTime/Date
|
|
|
10
10
|
import { datePickerPropFormatTypeDateTime, getMultiplicityTime, } from '../helpers';
|
|
11
11
|
import { useCurrentVisibleDate } from '../useCurrentVisibleDate';
|
|
12
12
|
export var DatePickerTypeDateTime = forwardRef(function (props, ref) {
|
|
13
|
-
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, currentVisibleDateProp = props.currentVisibleDate, onChangeCurrentVisibleDateProp = props.onChangeCurrentVisibleDate, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "currentVisibleDate", "onChangeCurrentVisibleDate", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls"]);
|
|
13
|
+
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, currentVisibleDateProp = props.currentVisibleDate, onChangeCurrentVisibleDateProp = props.onChangeCurrentVisibleDate, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, style = props.style, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "currentVisibleDate", "onChangeCurrentVisibleDate", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls", "style"]);
|
|
14
14
|
var _a = __read(getMultiplicityTime(otherProps.format || datePickerPropFormatTypeDateTime, multiplicityHoursProp, multiplicityMinutesProp, multiplicitySecondsProp), 3), multiplicityHours = _a[0], multiplicityMinutes = _a[1], multiplicitySeconds = _a[2];
|
|
15
15
|
var fieldRef = useRef(null);
|
|
16
16
|
var calendarRef = useRef(null);
|
|
@@ -51,6 +51,6 @@ export var DatePickerTypeDateTime = forwardRef(function (props, ref) {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(DatePickerFieldTypeDateTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes })),
|
|
55
|
-
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "date-time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, currentVisibleDate: currentVisibleDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, onChangeCurrentVisibleDate: setCalendarVisibleDate, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes })));
|
|
54
|
+
React.createElement(DatePickerFieldTypeDateTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, style: style })),
|
|
55
|
+
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "date-time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, currentVisibleDate: currentVisibleDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, onChangeCurrentVisibleDate: setCalendarVisibleDate, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, zIndex: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? style.zIndex + 1 : undefined })));
|
|
56
56
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { useClickOutside } from '../../../hooks/useClickOutside/useClickOutside';
|
|
4
|
+
import { useFlag } from '../../../hooks/useFlag/useFlag';
|
|
5
|
+
import { setRef } from '../../../utils/setRef';
|
|
6
|
+
import { DatePickerDropdown } from '../DatePickerDropdown/DatePickerDropdown';
|
|
7
|
+
import { DatePickerFieldTypeTime } from '../DatePickerFieldTypeTime/DatePickerFieldTypeTime';
|
|
8
|
+
import { datePickerPropFormatTypeDateTime, getMultiplicityTime, } from '../helpers';
|
|
9
|
+
export var DatePickerTypeTime = forwardRef(function (props, ref) {
|
|
10
|
+
var events = props.events, dateTimeView = props.dateTimeView, locale = props.locale, dropdownForm = props.dropdownForm, onFocus = props.onFocus, multiplicityHoursProp = props.multiplicityHours, multiplicityMinutesProp = props.multiplicityMinutes, multiplicitySecondsProp = props.multiplicitySeconds, renderAdditionalControls = props.renderAdditionalControls, style = props.style, currentVisibleDate = props.currentVisibleDate, onChangeCurrentVisibleDate = props.onChangeCurrentVisibleDate, otherProps = __rest(props, ["events", "dateTimeView", "locale", "dropdownForm", "onFocus", "multiplicityHours", "multiplicityMinutes", "multiplicitySeconds", "renderAdditionalControls", "style", "currentVisibleDate", "onChangeCurrentVisibleDate"]);
|
|
11
|
+
var _a = __read(getMultiplicityTime(otherProps.format || datePickerPropFormatTypeDateTime, multiplicityHoursProp, multiplicityMinutesProp, multiplicitySecondsProp), 3), multiplicityHours = _a[0], multiplicityMinutes = _a[1], multiplicitySeconds = _a[2];
|
|
12
|
+
var fieldRef = useRef(null);
|
|
13
|
+
var calendarRef = useRef(null);
|
|
14
|
+
var _b = __read(useFlag(false), 2), calendarVisible = _b[0], setCalendarVisible = _b[1];
|
|
15
|
+
var onFocusHandler = function (e) {
|
|
16
|
+
onFocus && onFocus(e);
|
|
17
|
+
setCalendarVisible.on();
|
|
18
|
+
};
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
if (ref) {
|
|
21
|
+
setRef(ref, fieldRef.current);
|
|
22
|
+
}
|
|
23
|
+
}, [ref, fieldRef]);
|
|
24
|
+
useClickOutside({
|
|
25
|
+
isActive: calendarVisible,
|
|
26
|
+
ignoreClicksInsideRefs: [fieldRef, calendarRef],
|
|
27
|
+
handler: function () { return setCalendarVisible.off(); }
|
|
28
|
+
});
|
|
29
|
+
return (React.createElement(React.Fragment, null,
|
|
30
|
+
React.createElement(DatePickerFieldTypeTime, __assign({}, otherProps, { ref: fieldRef, onFocus: onFocusHandler, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, style: style })),
|
|
31
|
+
React.createElement(DatePickerDropdown, { ref: calendarRef, anchorRef: fieldRef, isOpen: calendarVisible, value: props.value || undefined, type: "time", view: dateTimeView, events: events, locale: locale, minDate: props.minDate, maxDate: props.maxDate, form: dropdownForm, onChange: props.onChange, renderAdditionalControls: renderAdditionalControls, multiplicityHours: multiplicityHours, multiplicitySeconds: multiplicitySeconds, multiplicityMinutes: multiplicityMinutes, zIndex: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? style.zIndex + 1 : undefined })));
|
|
32
|
+
});
|
|
@@ -5,7 +5,7 @@ import { DateRange } from '../../utils/types/Date';
|
|
|
5
5
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
6
6
|
import { DateTimeAdditionalControlRenderProp, DateTimePropView } from '../DateTimeCanary/helpers';
|
|
7
7
|
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../TextField/TextField';
|
|
8
|
-
export declare const datePickerPropType: readonly ["date", "date-range", "date-time", "date-time-range"];
|
|
8
|
+
export declare const datePickerPropType: readonly ["date", "date-range", "date-time", "date-time-range", "time"];
|
|
9
9
|
export declare type DatePickerPropType = typeof datePickerPropType[number];
|
|
10
10
|
export declare const datePickerPropTypeDefault: "date";
|
|
11
11
|
export declare type DatePickerPropDateTimeView = DateTimePropView;
|
|
@@ -106,6 +106,8 @@ export declare type DatePickerPropOnError = (props: {
|
|
|
106
106
|
export declare const datePickerPropSeparatorDefault = ".";
|
|
107
107
|
export declare const datePickerPropFormatTypeDate: string;
|
|
108
108
|
export declare const datePickerPropPlaceholderTypeDate: string;
|
|
109
|
+
export declare const datePickerPropFormatTypeTime = "HH:mm:ss";
|
|
110
|
+
export declare const datePickerPropPlaceholderTypeTime = "\u0427\u0427:\u041C\u041C:\u0421\u0421";
|
|
109
111
|
export declare const datePickerPropFormatTypeDateTime: string;
|
|
110
112
|
export declare const datePickerPropPlaceholderTypeDateTime: string;
|
|
111
113
|
export declare const normalizeRangeValue: (dateRange: DateRange) => DateRange;
|
|
@@ -113,4 +115,7 @@ export declare const getMultiplicityTime: (format: string, multiplicityHours: nu
|
|
|
113
115
|
export declare const getTimeEnum: (length: number, multiplicity: number | undefined, startOfUnits: (date: Date) => Date, addUnits: (date: Date, amount: number) => Date, getItemLabel: (date: Date) => string) => string[];
|
|
114
116
|
export declare const getFormForStart: (form: TextFieldPropForm) => "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear";
|
|
115
117
|
export declare const getFormForEnd: (form: TextFieldPropForm) => "default" | "round" | "brick" | "brickRound" | "roundBrick" | "brickDefault" | "defaultBrick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "brickClear" | "clearBrick" | "clearClear";
|
|
118
|
+
export declare const getParts: (format: string, separator: string, withTime?: boolean | undefined) => string[];
|
|
119
|
+
export declare const getPartsDate: (value: string, format: string, separator: string, withTime: boolean, markers: string[]) => (string | undefined)[];
|
|
120
|
+
export declare const isTypeWithTime: (type: DatePickerPropType) => boolean;
|
|
116
121
|
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { __read, __spread } from "tslib";
|
|
1
2
|
import { startOfToday } from 'date-fns';
|
|
2
3
|
import { range } from '../../utils/array';
|
|
3
4
|
import { getByMap } from '../../utils/getByMap';
|
|
4
|
-
export var datePickerPropType = [
|
|
5
|
+
export var datePickerPropType = [
|
|
6
|
+
'date',
|
|
7
|
+
'date-range',
|
|
8
|
+
'date-time',
|
|
9
|
+
'date-time-range',
|
|
10
|
+
'time',
|
|
11
|
+
];
|
|
5
12
|
export var datePickerPropTypeDefault = datePickerPropType[0];
|
|
6
13
|
export var datePickerErrorTypes = [
|
|
7
14
|
'outOfRange',
|
|
@@ -13,8 +20,10 @@ export var datePickerPropDropdownFormDefault = datePickerPropDropdownForm[0];
|
|
|
13
20
|
export var datePickerPropSeparatorDefault = '.';
|
|
14
21
|
export var datePickerPropFormatTypeDate = "dd" + datePickerPropSeparatorDefault + "MM" + datePickerPropSeparatorDefault + "yyyy";
|
|
15
22
|
export var datePickerPropPlaceholderTypeDate = "\u0414\u0414" + datePickerPropSeparatorDefault + "\u041C\u041C" + datePickerPropSeparatorDefault + "\u0413\u0413\u0413\u0413";
|
|
16
|
-
export var
|
|
17
|
-
export var
|
|
23
|
+
export var datePickerPropFormatTypeTime = "HH:mm:ss";
|
|
24
|
+
export var datePickerPropPlaceholderTypeTime = "\u0427\u0427:\u041C\u041C:\u0421\u0421";
|
|
25
|
+
export var datePickerPropFormatTypeDateTime = datePickerPropFormatTypeDate + " " + datePickerPropFormatTypeTime;
|
|
26
|
+
export var datePickerPropPlaceholderTypeDateTime = datePickerPropPlaceholderTypeDate + " " + datePickerPropPlaceholderTypeTime;
|
|
18
27
|
export var normalizeRangeValue = function (dateRange) {
|
|
19
28
|
var _a, _b;
|
|
20
29
|
if (dateRange[0] && dateRange[1] && ((_a = dateRange[0]) === null || _a === void 0 ? void 0 : _a.getTime()) > ((_b = dateRange[1]) === null || _b === void 0 ? void 0 : _b.getTime())) {
|
|
@@ -78,3 +87,23 @@ var mapFormForEnd = {
|
|
|
78
87
|
};
|
|
79
88
|
export var getFormForStart = function (form) { return getByMap(mapFormForStart, form); };
|
|
80
89
|
export var getFormForEnd = function (form) { return getByMap(mapFormForEnd, form); };
|
|
90
|
+
var getPartDate = function (formatArray, stringArray, marker) {
|
|
91
|
+
var index = formatArray.indexOf(marker);
|
|
92
|
+
if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
|
|
93
|
+
return stringArray[index];
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
export var getParts = function (format, separator, withTime) {
|
|
98
|
+
if (withTime) {
|
|
99
|
+
var _a = __read(format.split(' '), 2), date = _a[0], time = _a[1];
|
|
100
|
+
return __spread((date ? date.split(separator) : []), (time ? time.split(':') : []));
|
|
101
|
+
}
|
|
102
|
+
return format.split(separator);
|
|
103
|
+
};
|
|
104
|
+
export var getPartsDate = function (value, format, separator, withTime, markers) {
|
|
105
|
+
var formatArray = getParts(format, separator, withTime);
|
|
106
|
+
var stringArray = getParts(value, separator, withTime);
|
|
107
|
+
return markers.map(function (marker) { return getPartDate(formatArray, stringArray, marker); });
|
|
108
|
+
};
|
|
109
|
+
export var isTypeWithTime = function (type) { return type.indexOf('time') !== -1; };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type EventInterceptorComponentName = 'Attachment' | 'Avatar' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Calendar' | 'Card' | 'Checkbox' | 'CheckboxGroup' | 'ChoiceGroup' | 'Collapse' | 'CollapseGroup' | 'Combobox' | 'ContextMenu' | 'DatePicker' | 'DateTime' | 'DragNDropField' | 'File' | 'FileField' | 'Grid' | 'Header' | 'Informer' | 'Layout' | 'Loader' | 'Modal' | '
|
|
1
|
+
export declare type EventInterceptorComponentName = 'Attachment' | 'Avatar' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Calendar' | 'Card' | 'Checkbox' | 'CheckboxGroup' | 'ChoiceGroup' | 'Collapse' | 'CollapseGroup' | 'Combobox' | 'ContextMenu' | 'DatePicker' | 'DateTime' | 'DragNDropField' | 'File' | 'FileField' | 'Grid' | 'Header' | 'Informer' | 'Layout' | 'Loader' | 'Modal' | 'Popover' | 'ProgressSpin' | 'ProgressStepBar' | 'Radio' | 'RadioGroup' | 'Select' | 'Sidebar' | 'Skeleton' | 'Slider' | 'SnackBar' | 'Steps' | 'Switch' | 'SwitchGroup' | 'Table' | 'Tabs' | 'Tag' | 'TagBase' | 'Text' | 'TextField' | 'ThemeToggler' | 'Timer' | 'Tooltip' | 'User' | 'UserSelect';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.Modal {
|
|
2
|
+
--modal-window-animate-space: var(--space-xl);
|
|
2
3
|
position: fixed;
|
|
3
4
|
top: 0;
|
|
4
5
|
right: 0;
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.Modal-Window {
|
|
21
|
-
|
|
22
|
+
position: absolute;
|
|
22
23
|
overflow: auto;
|
|
23
24
|
min-width: 400px;
|
|
24
25
|
max-width: 90%;
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
.Modal-Overlay {
|
|
45
|
-
position:
|
|
46
|
+
position: absolute;
|
|
46
47
|
top: 0;
|
|
47
48
|
left: 0;
|
|
48
49
|
width: 100%;
|
|
@@ -52,30 +53,54 @@
|
|
|
52
53
|
border: none;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
.Modal_animate_appear,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
.Modal_animate_appear .Modal-Overlay, .Modal_animate_enter .Modal-Overlay, .Modal_animate_exit .Modal-Overlay, .Modal_animate_appearActive .Modal-Overlay, .Modal_animate_enterActive .Modal-Overlay, .Modal_animate_exitActive .Modal-Overlay {
|
|
57
|
+
-webkit-transition: opacity 0.24s ease;
|
|
58
|
+
transition: opacity 0.24s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.Modal_animate_appear .Modal-Window, .Modal_animate_enter .Modal-Window, .Modal_animate_exit .Modal-Window, .Modal_animate_appearActive .Modal-Window, .Modal_animate_enterActive .Modal-Window, .Modal_animate_exitActive .Modal-Window {
|
|
62
|
+
-webkit-transition: opacity 0.24s, -webkit-transform 0.24s;
|
|
63
|
+
transition: opacity 0.24s, -webkit-transform 0.24s;
|
|
64
|
+
transition: opacity 0.24s, transform 0.24s;
|
|
65
|
+
transition: opacity 0.24s, transform 0.24s, -webkit-transform 0.24s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Modal_animate_appear .Modal-Overlay, .Modal_animate_enter .Modal-Overlay {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
}
|
|
64
71
|
|
|
65
|
-
.Modal_animate_appear,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
.Modal_animate_appear .Modal-Window, .Modal_animate_enter .Modal-Window {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
-webkit-transform: translate(0, calc(-1 * var(--modal-window-animate-space)));
|
|
75
|
+
transform: translate(0, calc(-1 * var(--modal-window-animate-space)));
|
|
76
|
+
}
|
|
69
77
|
|
|
70
|
-
.Modal_animate_appearActive,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
78
|
+
.Modal_animate_appearActive .Modal-Overlay, .Modal_animate_enterActive .Modal-Overlay {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
}
|
|
74
81
|
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
.Modal_animate_appearActive .Modal-Window, .Modal_animate_enterActive .Modal-Window {
|
|
83
|
+
opacity: 1;
|
|
84
|
+
-webkit-transform: translate(0, 0);
|
|
85
|
+
transform: translate(0, 0);
|
|
86
|
+
}
|
|
78
87
|
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
.Modal_animate_exit .Modal-Overlay {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.Modal_animate_exit .Modal-Window {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
-webkit-transform: translate(0, 0);
|
|
95
|
+
transform: translate(0, 0);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.Modal_animate_exitActive .Modal-Overlay {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.Modal_animate_exitActive .Modal-Window {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
-webkit-transform: translate(0, var(--modal-window-animate-space));
|
|
105
|
+
transform: translate(0, var(--modal-window-animate-space));
|
|
106
|
+
}
|
|
@@ -24,7 +24,7 @@ var ContextConsumer = function (_a) {
|
|
|
24
24
|
useClickOutside({
|
|
25
25
|
isActive: !!onClickOutside,
|
|
26
26
|
ignoreClicksInsideRefs: __spread((ignoreClicksInsideRefs || []), (refs || [])),
|
|
27
|
-
handler:
|
|
27
|
+
handler: onClickOutside
|
|
28
28
|
});
|
|
29
29
|
return React.createElement(React.Fragment, null, children);
|
|
30
30
|
};
|
|
@@ -44,9 +44,9 @@ export var Modal = function (props) {
|
|
|
44
44
|
useGlobalKeys({
|
|
45
45
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
46
46
|
});
|
|
47
|
-
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout:
|
|
47
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout: 240, nodeRef: portalRef },
|
|
48
48
|
React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal({ hasOverlay: hasOverlay }, [rootClassName]), ref: portalRef, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
49
49
|
hasOverlay && React.createElement("div", { className: cnModal('Overlay'), "aria-label": "Overlay" }),
|
|
50
|
-
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style),
|
|
50
|
+
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), { zIndex: undefined }), className: cnModal('Window', { width: width, position: position }, [className]), ref: ref }),
|
|
51
51
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: __spread((refsForExcludeClickOutside || []), [ref]) }, children)))));
|
|
52
52
|
};
|
|
@@ -41,6 +41,5 @@ declare type Props = {
|
|
|
41
41
|
position?: PaginationPropPosition;
|
|
42
42
|
});
|
|
43
43
|
declare type Pagination = (props: PropsWithHTMLAttributesAndRef<Props, HTMLDivElement>) => React.ReactElement | null;
|
|
44
|
-
export declare const COMPONENT_NAME: "Pagination";
|
|
45
44
|
export declare const Pagination: Pagination;
|
|
46
45
|
export {};
|