@consta/uikit 3.15.1 → 3.17.1
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 +54 -59
- 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/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/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/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/es.js +1 -0
- package/IconPicture/index.d.ts +1 -0
- package/IconPicture/index.js +4 -0
- package/{MixDropdownAnimate → IconPicture}/package.json +2 -2
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconPriceLabel/es.js +1 -0
- package/IconPriceLabel/index.d.ts +1 -0
- package/IconPriceLabel/index.js +4 -0
- package/IconPriceLabel/package.json +9 -0
- 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/es.js +1 -0
- package/IconTable2/index.d.ts +1 -0
- package/IconTable2/index.js +4 -0
- package/IconTable2/package.json +9 -0
- 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/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/es.js +1 -0
- package/IconWrench/index.d.ts +1 -0
- package/IconWrench/index.js +4 -0
- package/IconWrench/package.json +9 -0
- 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/es.js +1 -0
- package/MixPopoverAnimate/index.d.ts +1 -0
- package/MixPopoverAnimate/index.js +4 -0
- package/MixPopoverAnimate/package.json +9 -0
- 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/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/BreadcrumbsMore/BreadcrumbsMore.d.ts +6 -0
- package/__internal__/cjs-src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.js +17 -4
- package/__internal__/cjs-src/components/Collapse/CollapseIcon/CollapseIcon.js +7 -5
- package/__internal__/cjs-src/components/Combobox/Combobox.js +4 -4
- package/__internal__/cjs-src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/ContextMenu/ContextMenu.js +1 -1
- package/__internal__/cjs-src/components/ContextMenu/helpers.d.ts +4 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +3 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +0 -49
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +1 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +11 -6
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +0 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +9 -13
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +0 -3
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +0 -33
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +83 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js +98 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.d.ts +30 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.js +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/{DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css → DatePickerMixRangeField/DatePickerMixRangeField.css} +16 -16
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerMixRangeField/DatePickerMixRangeField.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerMixRangeField/DatePickerMixRangeField.js +6 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +31 -34
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +4 -5
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +95 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +10 -7
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +37 -2
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeDateTime/DateTimeTypeDateTime.js +7 -7
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeDateTime/useOnChange.d.ts +3 -2
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeDateTime/useOnChange.js +18 -4
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/types.d.ts +3 -1
- package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -5
- package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useSnackBarEventsHandler.d.ts +2 -5
- package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +1 -1
- package/__internal__/cjs-src/components/Popover/Popover.css +8 -0
- package/__internal__/cjs-src/components/Popover/Popover.d.ts +6 -3
- package/__internal__/cjs-src/components/Popover/Popover.js +31 -9
- package/__internal__/cjs-src/components/Popover/helpers.d.ts +2 -1
- package/__internal__/cjs-src/components/Popover/helpers.js +7 -3
- package/__internal__/cjs-src/components/Select/Select.js +4 -4
- package/__internal__/cjs-src/components/Select/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.css +2 -1
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +2 -0
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +6 -4
- package/__internal__/cjs-src/components/SelectComponents/helpers.d.ts +1 -0
- package/__internal__/cjs-src/components/SelectComponents/helpers.js +2 -1
- package/__internal__/cjs-src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js +4 -3
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +3 -2
- package/__internal__/cjs-src/components/SliderCanary/SliderCanary.js +5 -3
- package/__internal__/cjs-src/components/SliderCanary/SliderInput/SliderInput.d.ts +1 -1
- package/__internal__/cjs-src/components/SliderCanary/SliderInput/SliderInput.js +1 -1
- package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.js +4 -11
- package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.js +7 -15
- package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.js +4 -10
- package/__internal__/cjs-src/components/SnackBar/SnackBar.d.ts +3 -3
- package/__internal__/cjs-src/components/SnackBar/SnackBar.js +14 -14
- package/__internal__/cjs-src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.d.ts +1 -1
- package/__internal__/cjs-src/components/SnackBar/SnackBarItem/SnackBarItem.d.ts +2 -4
- package/__internal__/cjs-src/components/SnackBar/SnackBarItem/SnackBarItem.js +14 -13
- package/__internal__/cjs-src/components/SnackBar/SnackBarLine/SnackBarLine.d.ts +1 -1
- package/__internal__/cjs-src/components/SnackBar/SnackBarTimer/SnackBarTimer.d.ts +1 -1
- package/__internal__/cjs-src/components/SnackBar/helper.d.ts +288 -45
- package/__internal__/cjs-src/components/SnackBar/helper.js +52 -4
- package/__internal__/cjs-src/components/SnackBar/types.d.ts +78 -0
- package/__internal__/cjs-src/components/SnackBar/types.js +6 -0
- package/__internal__/cjs-src/components/Table/Table.css +1 -0
- package/__internal__/cjs-src/components/Table/Table.d.ts +1 -1
- package/__internal__/cjs-src/components/Table/Table.js +17 -5
- package/__internal__/cjs-src/components/Table/helpers.d.ts +1 -0
- package/__internal__/cjs-src/components/Table/helpers.js +12 -4
- package/__internal__/cjs-src/components/TextField/TextField.js +28 -16
- package/__internal__/cjs-src/components/TextField/helpers.d.ts +17 -2
- package/__internal__/cjs-src/components/TextField/helpers.js +52 -1
- package/__internal__/cjs-src/components/UserSelect/UserSelect.js +4 -4
- package/__internal__/cjs-src/components/UserSelect/UserSelectItem/UserSelectItem.js +4 -3
- package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.js +4 -3
- package/__internal__/cjs-src/hooks/useHideElementsInLine/useHideElementsInLine.d.ts +1 -1
- package/__internal__/cjs-src/hooks/useRefs/useRefs.d.ts +1 -1
- package/__internal__/cjs-src/hooks/useSelect/useSelect.d.ts +1 -0
- package/__internal__/cjs-src/hooks/useSelect/useSelect.js +4 -2
- package/__internal__/cjs-src/hooks/useSortSteps/useSortSteps.d.ts +7 -0
- package/__internal__/cjs-src/hooks/useSortSteps/useSortSteps.js +28 -0
- package/__internal__/cjs-src/hooks/useTimer/useTimer.js +6 -1
- package/__internal__/cjs-src/icons/IconPicture/IconPicture.d.ts +5 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture.js +14 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_m.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_m.js +9 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_m.svg +5 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_s.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_s.js +9 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_s.svg +5 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_xs.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_xs.js +9 -0
- package/__internal__/cjs-src/icons/IconPicture/IconPicture_size_xs.svg +5 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel.d.ts +5 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel.js +14 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_m.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_m.js +9 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_m.svg +5 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_s.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_s.js +9 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_s.svg +5 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_xs.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_xs.js +9 -0
- package/__internal__/cjs-src/icons/IconPriceLabel/IconPriceLabel_size_xs.svg +5 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2.d.ts +5 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2.js +14 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_m.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_m.js +9 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_m.svg +7 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_s.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_s.js +9 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_s.svg +7 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_xs.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_xs.js +9 -0
- package/__internal__/cjs-src/icons/IconTable2/IconTable2_size_xs.svg +7 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench.d.ts +5 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench.js +14 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_m.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_m.js +9 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_m.svg +5 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_s.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_s.js +9 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_s.svg +5 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_xs.d.ts +3 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_xs.js +9 -0
- package/__internal__/cjs-src/icons/IconWrench/IconWrench_size_xs.svg +5 -0
- package/__internal__/cjs-src/mixs/MixPopoverAnimate/MixPopoverAnimate.css +76 -0
- package/__internal__/cjs-src/mixs/MixPopoverAnimate/MixPopoverAnimate.d.ts +12 -0
- package/__internal__/cjs-src/mixs/MixPopoverAnimate/MixPopoverAnimate.js +10 -0
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.d.ts +6 -0
- package/__internal__/src/components/BreadcrumbsCanary/BreadcrumbsMore/BreadcrumbsMore.js +18 -5
- package/__internal__/src/components/Collapse/CollapseIcon/CollapseIcon.js +7 -5
- package/__internal__/src/components/Combobox/Combobox.js +5 -5
- package/__internal__/src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/src/components/ContextMenu/ContextMenu.js +1 -1
- package/__internal__/src/components/ContextMenu/helpers.d.ts +4 -3
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +3 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +0 -49
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +1 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +14 -9
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +0 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +10 -14
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +0 -3
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +0 -32
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +83 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js +95 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.d.ts +30 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateTimeRange/helpers.js +0 -0
- package/__internal__/src/components/DatePickerCanary/{DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css → DatePickerMixRangeField/DatePickerMixRangeField.css} +16 -16
- package/__internal__/src/components/DatePickerCanary/DatePickerMixRangeField/DatePickerMixRangeField.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerMixRangeField/DatePickerMixRangeField.js +3 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +31 -34
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTime/DatePickerTypeDateTime.js +4 -5
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +92 -0
- package/__internal__/src/components/DatePickerCanary/helpers.d.ts +10 -7
- package/__internal__/src/components/DatePickerCanary/helpers.js +36 -1
- package/__internal__/src/components/DateTimeCanary/DateTimeTypeDateTime/DateTimeTypeDateTime.js +7 -7
- package/__internal__/src/components/DateTimeCanary/DateTimeTypeDateTime/useOnChange.d.ts +3 -2
- package/__internal__/src/components/DateTimeCanary/DateTimeTypeDateTime/useOnChange.js +18 -4
- package/__internal__/src/components/DateTimeCanary/helpers/types.d.ts +3 -1
- package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -5
- package/__internal__/src/components/EventInterceptor/propsHandlers/useSnackBarEventsHandler.d.ts +2 -5
- package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +1 -1
- package/__internal__/src/components/Popover/Popover.css +8 -0
- package/__internal__/src/components/Popover/Popover.d.ts +6 -3
- package/__internal__/src/components/Popover/Popover.js +30 -8
- package/__internal__/src/components/Popover/helpers.d.ts +2 -1
- package/__internal__/src/components/Popover/helpers.js +6 -2
- package/__internal__/src/components/Select/Select.js +5 -5
- package/__internal__/src/components/Select/helpers.d.ts +2 -0
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.css +2 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +2 -0
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +7 -5
- package/__internal__/src/components/SelectComponents/helpers.d.ts +1 -0
- package/__internal__/src/components/SelectComponents/helpers.js +1 -0
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js +4 -3
- package/__internal__/src/components/Sidebar/Sidebar.js +3 -2
- package/__internal__/src/components/SliderCanary/SliderCanary.js +5 -3
- package/__internal__/src/components/SliderCanary/SliderInput/SliderInput.d.ts +1 -1
- package/__internal__/src/components/SliderCanary/SliderInput/SliderInput.js +1 -1
- package/__internal__/src/components/SliderCanary/useSlider/helper.js +5 -12
- package/__internal__/src/components/SliderCanary/useSlider/useSlider.js +7 -15
- package/__internal__/src/components/SliderCanary/useSliderStationing.js +4 -10
- package/__internal__/src/components/SnackBar/SnackBar.d.ts +3 -3
- package/__internal__/src/components/SnackBar/SnackBar.js +15 -15
- package/__internal__/src/components/SnackBar/SnackBarActionButton/SnackBarActionButton.d.ts +1 -1
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.d.ts +2 -4
- package/__internal__/src/components/SnackBar/SnackBarItem/SnackBarItem.js +13 -13
- package/__internal__/src/components/SnackBar/SnackBarLine/SnackBarLine.d.ts +1 -1
- package/__internal__/src/components/SnackBar/SnackBarTimer/SnackBarTimer.d.ts +1 -1
- package/__internal__/src/components/SnackBar/helper.d.ts +288 -45
- package/__internal__/src/components/SnackBar/helper.js +51 -3
- package/__internal__/src/components/SnackBar/types.d.ts +78 -0
- package/__internal__/src/components/SnackBar/types.js +3 -0
- package/__internal__/src/components/Table/Table.css +1 -0
- package/__internal__/src/components/Table/Table.d.ts +1 -1
- package/__internal__/src/components/Table/Table.js +18 -6
- package/__internal__/src/components/Table/helpers.d.ts +1 -0
- package/__internal__/src/components/Table/helpers.js +10 -3
- package/__internal__/src/components/TextField/TextField.js +29 -17
- package/__internal__/src/components/TextField/helpers.d.ts +17 -2
- package/__internal__/src/components/TextField/helpers.js +51 -0
- package/__internal__/src/components/UserSelect/UserSelect.js +5 -5
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.js +4 -3
- package/__internal__/src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/src/components/UserSelectDeprecated/UserSelectItem/UserSelectItem.js +4 -3
- package/__internal__/src/hooks/useHideElementsInLine/useHideElementsInLine.d.ts +1 -1
- package/__internal__/src/hooks/useRefs/useRefs.d.ts +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.d.ts +1 -0
- package/__internal__/src/hooks/useSelect/useSelect.js +4 -2
- package/__internal__/src/hooks/useSortSteps/useSortSteps.d.ts +7 -0
- package/__internal__/src/hooks/useSortSteps/useSortSteps.js +25 -0
- package/__internal__/src/hooks/useTimer/useTimer.js +6 -1
- package/__internal__/src/icons/IconPicture/IconPicture.d.ts +5 -0
- package/__internal__/src/icons/IconPicture/IconPicture.js +10 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_m.d.ts +3 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_m.js +7 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_m.svg +5 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_s.d.ts +3 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_s.js +7 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_s.svg +5 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_xs.d.ts +3 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_xs.js +7 -0
- package/__internal__/src/icons/IconPicture/IconPicture_size_xs.svg +5 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel.d.ts +5 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel.js +10 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_m.d.ts +3 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_m.js +7 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_m.svg +5 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_s.d.ts +3 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_s.js +7 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_s.svg +5 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_xs.d.ts +3 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_xs.js +7 -0
- package/__internal__/src/icons/IconPriceLabel/IconPriceLabel_size_xs.svg +5 -0
- package/__internal__/src/icons/IconTable2/IconTable2.d.ts +5 -0
- package/__internal__/src/icons/IconTable2/IconTable2.js +10 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_m.d.ts +3 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_m.js +7 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_m.svg +7 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_s.d.ts +3 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_s.js +7 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_s.svg +7 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_xs.d.ts +3 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_xs.js +7 -0
- package/__internal__/src/icons/IconTable2/IconTable2_size_xs.svg +7 -0
- package/__internal__/src/icons/IconWrench/IconWrench.d.ts +5 -0
- package/__internal__/src/icons/IconWrench/IconWrench.js +10 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_m.d.ts +3 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_m.js +7 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_m.svg +5 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_s.d.ts +3 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_s.js +7 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_s.svg +5 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_xs.d.ts +3 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_xs.js +7 -0
- package/__internal__/src/icons/IconWrench/IconWrench_size_xs.svg +5 -0
- package/__internal__/src/mixs/MixPopoverAnimate/MixPopoverAnimate.css +76 -0
- package/__internal__/src/mixs/MixPopoverAnimate/MixPopoverAnimate.d.ts +12 -0
- package/__internal__/src/mixs/MixPopoverAnimate/MixPopoverAnimate.js +7 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +7 -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/es.js +1 -0
- package/useSortSteps/index.d.ts +1 -0
- package/useSortSteps/index.js +4 -0
- package/useSortSteps/package.json +9 -0
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
- package/MixDropdownAnimate/es.js +0 -1
- package/MixDropdownAnimate/index.d.ts +0 -1
- package/MixDropdownAnimate/index.js +0 -4
- package/__internal__/cjs-src/mixs/MixDropdownAnimate/MixDropdownAnimate.css +0 -37
- package/__internal__/cjs-src/mixs/MixDropdownAnimate/MixDropdownAnimate.d.ts +0 -4
- package/__internal__/cjs-src/mixs/MixDropdownAnimate/MixDropdownAnimate.js +0 -9
- package/__internal__/src/mixs/MixDropdownAnimate/MixDropdownAnimate.css +0 -37
- package/__internal__/src/mixs/MixDropdownAnimate/MixDropdownAnimate.d.ts +0 -4
- package/__internal__/src/mixs/MixDropdownAnimate/MixDropdownAnimate.js +0 -6
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { __assign, __read, __rest, __spread } from "tslib";
|
|
2
|
+
import './Popover.css';
|
|
2
3
|
import React, { useEffect } from 'react';
|
|
3
4
|
import { useClickOutside } from '../../hooks/useClickOutside/useClickOutside';
|
|
4
5
|
import { useComponentSize } from '../../hooks/useComponentSize/useComponentSize';
|
|
5
6
|
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
7
|
+
import { useThemeVars } from '../../hooks/useThemeVars/useThemeVars';
|
|
8
|
+
import { cn } from '../../utils/bem';
|
|
6
9
|
import { PortalWithTheme, usePortalContext } from '../PortalWithTheme/PortalWithTheme';
|
|
7
10
|
import { useTheme } from '../Theme/Theme';
|
|
8
11
|
import { getComputedPositionAndDirection } from './helpers';
|
|
@@ -36,6 +39,20 @@ export var directionsStartEdge = [
|
|
|
36
39
|
'rightStartUp',
|
|
37
40
|
'rightStartDown',
|
|
38
41
|
];
|
|
42
|
+
export var popoverPropOffset = [
|
|
43
|
+
'3xs',
|
|
44
|
+
'2xs',
|
|
45
|
+
'xs',
|
|
46
|
+
's',
|
|
47
|
+
'm',
|
|
48
|
+
'l',
|
|
49
|
+
'xl',
|
|
50
|
+
'2xl',
|
|
51
|
+
'3xl',
|
|
52
|
+
'4xl',
|
|
53
|
+
'5xl',
|
|
54
|
+
'6xl',
|
|
55
|
+
];
|
|
39
56
|
export var directions = __spread(directionsStartCenter, directionsStartEdge);
|
|
40
57
|
var isRenderProp = function (children) { return typeof children === 'function'; };
|
|
41
58
|
/**
|
|
@@ -53,20 +70,23 @@ var ContextConsumer = function (_a) {
|
|
|
53
70
|
});
|
|
54
71
|
return React.createElement(React.Fragment, null, children);
|
|
55
72
|
};
|
|
73
|
+
var cnPopover = cn('Popover');
|
|
56
74
|
export var Popover = React.forwardRef(function (props, componentRef) {
|
|
57
|
-
var
|
|
75
|
+
var _a;
|
|
76
|
+
var children = props.children, _b = props.direction, passedDirection = _b === void 0 ? 'upCenter' : _b, _c = props.offset, offset = _c === void 0 ? 0 : _c, arrowOffset = props.arrowOffset, _d = props.possibleDirections, possibleDirections = _d === void 0 ? directions : _d, _e = props.isInteractive, isInteractive = _e === void 0 ? true : _e, onClickOutside = props.onClickOutside, _f = props.spareDirection, spareDirection = _f === void 0 ? 'downStartLeft' : _f, style = props.style, className = props.className, passedPosition = props.position, anchorRef = props.anchorRef, equalAnchorWidth = props.equalAnchorWidth, onSetDirection = props.onSetDirection, otherProps = __rest(props, ["children", "direction", "offset", "arrowOffset", "possibleDirections", "isInteractive", "onClickOutside", "spareDirection", "style", "className", "position", "anchorRef", "equalAnchorWidth", "onSetDirection"]);
|
|
58
77
|
var ref = React.useRef(null);
|
|
59
78
|
var theme = useTheme().theme;
|
|
60
|
-
var
|
|
61
|
-
var
|
|
79
|
+
var _g = __read(React.useState(), 2), anchorClientRect = _g[0], setAnchorClientRect = _g[1];
|
|
80
|
+
var _h = useComponentSize(ref), width = _h.width, height = _h.height;
|
|
62
81
|
var anchorSize = useComponentSize(anchorRef || { current: null });
|
|
63
82
|
var previousDirectionRef = React.useRef(null);
|
|
64
83
|
var previousDirection = previousDirectionRef.current;
|
|
65
|
-
var
|
|
84
|
+
var _j = __read(React.useState([]), 2), bannedDirections = _j[0], setBannedDirections = _j[1];
|
|
66
85
|
var resetBannedDirections = function () {
|
|
67
86
|
setBannedDirections(function (state) { return (state.length ? [] : state); });
|
|
68
87
|
previousDirectionRef.current = null;
|
|
69
88
|
};
|
|
89
|
+
var vars = useThemeVars();
|
|
70
90
|
var updateAnchorClientRect = function () { var _a; return setAnchorClientRect((_a = anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()); };
|
|
71
91
|
React.useLayoutEffect(updateAnchorClientRect, [anchorSize]);
|
|
72
92
|
usePopoverReposition({
|
|
@@ -77,14 +97,16 @@ export var Popover = React.forwardRef(function (props, componentRef) {
|
|
|
77
97
|
updateAnchorClientRect();
|
|
78
98
|
}
|
|
79
99
|
});
|
|
80
|
-
var
|
|
100
|
+
var _k = getComputedPositionAndDirection({
|
|
81
101
|
contentSize: { width: width, height: height },
|
|
82
102
|
viewportSize: {
|
|
83
103
|
// Размер вьюпорта без скроллбаров
|
|
84
104
|
width: document.documentElement.clientWidth,
|
|
85
105
|
height: document.documentElement.clientHeight
|
|
86
106
|
},
|
|
87
|
-
offset: offset
|
|
107
|
+
offset: typeof offset === 'string'
|
|
108
|
+
? vars.space["--space-" + offset]
|
|
109
|
+
: offset,
|
|
88
110
|
arrowOffset: arrowOffset,
|
|
89
111
|
direction: passedDirection,
|
|
90
112
|
possibleDirections: possibleDirections,
|
|
@@ -94,7 +116,7 @@ export var Popover = React.forwardRef(function (props, componentRef) {
|
|
|
94
116
|
: passedPosition,
|
|
95
117
|
anchorSize: anchorSize,
|
|
96
118
|
spareDirection: spareDirection
|
|
97
|
-
}), position =
|
|
119
|
+
}), position = _k.position, direction = _k.direction;
|
|
98
120
|
useEffect(function () { return onSetDirection && onSetDirection(direction); }, [direction]);
|
|
99
121
|
/**
|
|
100
122
|
* Может возникнуть ситуация, когда перерасчет поповера всегда будет выдавать 2 направления
|
|
@@ -112,6 +134,6 @@ export var Popover = React.forwardRef(function (props, componentRef) {
|
|
|
112
134
|
// Главное не сбрасывать при изменении размеров поповера, т.к. именно оно может вызвать бесконечный перебор
|
|
113
135
|
React.useLayoutEffect(resetBannedDirections, [props]);
|
|
114
136
|
var content = isRenderProp(children) ? children(direction) : children;
|
|
115
|
-
return (React.createElement(PortalWithTheme, __assign({}, otherProps, { preset: theme, container: window.document.body, ref: useForkRef([ref, componentRef]), style: __assign(__assign(
|
|
137
|
+
return (React.createElement(PortalWithTheme, __assign({}, otherProps, { preset: theme, className: cnPopover(null, [className]), container: window.document.body, ref: useForkRef([ref, componentRef]), style: __assign(__assign({}, style), (_a = {}, _a['--popover-top'] = ((position === null || position === void 0 ? void 0 : position.y) || 0) + window.scrollY + "px", _a['--popover-left'] = ((position === null || position === void 0 ? void 0 : position.x) || 0) + window.scrollX + "px", _a["--popover-width"] = equalAnchorWidth ? anchorSize.width + "px" : undefined, _a["--popover-pointer-events"] = isInteractive ? undefined : 'none', _a["--popover-visibility"] = position ? undefined : 'hidden', _a)) }),
|
|
116
138
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside, ignoreClicksInsideRefs: [ref, anchorRef || { current: null }] }, content)));
|
|
117
139
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Direction, Position } from './Popover';
|
|
2
2
|
declare type Size = Pick<ClientRect, 'width' | 'height'>;
|
|
3
3
|
declare type PositionsByDirection = Record<Direction, NonNullable<Position>>;
|
|
4
|
+
export declare const convertPixelsToNumber: (pixels: string) => number;
|
|
4
5
|
export declare const getPositionsByDirection: ({ contentSize, anchorSize, position: { x, y }, offset, arrowOffset, }: {
|
|
5
6
|
contentSize: Size;
|
|
6
7
|
anchorSize: Size;
|
|
@@ -13,7 +14,7 @@ declare type ComputedPositionAndDirectionParams = {
|
|
|
13
14
|
contentSize: Size;
|
|
14
15
|
viewportSize: Size;
|
|
15
16
|
anchorSize?: Size;
|
|
16
|
-
offset
|
|
17
|
+
offset?: number | string;
|
|
17
18
|
arrowOffset?: number;
|
|
18
19
|
direction: Direction;
|
|
19
20
|
spareDirection: Direction;
|
|
@@ -3,6 +3,9 @@ var getPosition = function (x, y) { return ({
|
|
|
3
3
|
x: Math.round(x),
|
|
4
4
|
y: Math.round(y)
|
|
5
5
|
}); };
|
|
6
|
+
export var convertPixelsToNumber = function (pixels) {
|
|
7
|
+
return Number(pixels.slice(0, pixels.length - 2));
|
|
8
|
+
};
|
|
6
9
|
export var getPositionsByDirection = function (_a) {
|
|
7
10
|
var contentSize = _a.contentSize, anchorSize = _a.anchorSize, _b = _a.position, x = _b.x, y = _b.y, offset = _a.offset, _c = _a.arrowOffset, arrowOffset = _c === void 0 ? 0 : _c;
|
|
8
11
|
var contentWidth = contentSize.width, contentHeight = contentSize.height;
|
|
@@ -53,15 +56,16 @@ export var getPositionsByDirection = function (_a) {
|
|
|
53
56
|
};
|
|
54
57
|
};
|
|
55
58
|
export var getComputedPositionAndDirection = function (_a) {
|
|
56
|
-
var initialPosition = _a.position, contentSize = _a.contentSize, viewportSize = _a.viewportSize, _b = _a.anchorSize, anchorSize = _b === void 0 ? { width: 0, height: 0 } : _b,
|
|
59
|
+
var initialPosition = _a.position, contentSize = _a.contentSize, viewportSize = _a.viewportSize, _b = _a.anchorSize, anchorSize = _b === void 0 ? { width: 0, height: 0 } : _b, _c = _a.offset, offset = _c === void 0 ? 0 : _c, arrowOffset = _a.arrowOffset, initialDirection = _a.direction, possibleDirections = _a.possibleDirections, bannedDirections = _a.bannedDirections, spareDirection = _a.spareDirection;
|
|
57
60
|
if (!initialPosition) {
|
|
58
61
|
return { position: initialPosition, direction: initialDirection };
|
|
59
62
|
}
|
|
63
|
+
var currentOffset = typeof offset === 'string' ? convertPixelsToNumber(offset) : offset;
|
|
60
64
|
var positionsByDirection = getPositionsByDirection({
|
|
61
65
|
contentSize: contentSize,
|
|
62
66
|
anchorSize: anchorSize,
|
|
63
67
|
position: initialPosition,
|
|
64
|
-
offset:
|
|
68
|
+
offset: currentOffset,
|
|
65
69
|
arrowOffset: arrowOffset
|
|
66
70
|
});
|
|
67
71
|
var direction = __spread([initialDirection], possibleDirections).filter(function (dir) { return !bannedDirections.includes(dir); })
|
|
@@ -6,7 +6,7 @@ import { useSelect } from '../../hooks/useSelect/useSelect';
|
|
|
6
6
|
import { IconSelect } from '../../icons/IconSelect/IconSelect';
|
|
7
7
|
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
8
8
|
import { cnSelect, COMPONENT_NAME } from '../SelectComponents/cnSelect';
|
|
9
|
-
import { getSelectDropdownForm } from '../SelectComponents/helpers';
|
|
9
|
+
import { defaultLabelForEmptyItems, getSelectDropdownForm } from '../SelectComponents/helpers';
|
|
10
10
|
import { SelectContainer } from '../SelectComponents/SelectContainer/SelectContainer';
|
|
11
11
|
import { SelectDropdown } from '../SelectComponents/SelectDropdown/SelectDropdown';
|
|
12
12
|
import { SelectItem } from '../SelectComponents/SelectItem/SelectItem';
|
|
@@ -15,8 +15,8 @@ import { withDefaultGetters, } from './helpers';
|
|
|
15
15
|
function SelectRender(props, ref) {
|
|
16
16
|
var defaultDropdownRef = useRef(null);
|
|
17
17
|
var controlRef = useRef(null);
|
|
18
|
-
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, required = _a.required, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, inputRefProp = _a.inputRef, style = _a.style, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "required", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "inputRef", "style"]);
|
|
19
|
-
var
|
|
18
|
+
var _a = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, required = _a.required, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, _g = _a.labelForEmptyItems, labelForEmptyItems = _g === void 0 ? defaultLabelForEmptyItems : _g, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, inputRefProp = _a.inputRef, style = _a.style, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "required", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "labelForEmptyItems", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "inputRef", "style"]);
|
|
19
|
+
var _h = useSelect({
|
|
20
20
|
items: items,
|
|
21
21
|
groups: groups,
|
|
22
22
|
value: value,
|
|
@@ -32,7 +32,7 @@ function SelectRender(props, ref) {
|
|
|
32
32
|
multiple: false,
|
|
33
33
|
onBlur: onBlur,
|
|
34
34
|
onFocus: onFocus
|
|
35
|
-
}), getKeyProps =
|
|
35
|
+
}), getKeyProps = _h.getKeyProps, getOptionProps = _h.getOptionProps, isOpen = _h.isOpen, visibleItems = _h.visibleItems, isFocused = _h.isFocused, handleInputFocus = _h.handleInputFocus, handleInputBlur = _h.handleInputBlur, handleToggleDropdown = _h.handleToggleDropdown, inputRef = _h.inputRef, handleInputClick = _h.handleInputClick, notFound = _h.notFound, hasItems = _h.hasItems;
|
|
36
36
|
var dropdownForm = getSelectDropdownForm(form);
|
|
37
37
|
var renderItemDefault = function (props) {
|
|
38
38
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
@@ -53,7 +53,7 @@ function SelectRender(props, ref) {
|
|
|
53
53
|
React.createElement("span", { className: cnSelect('Indicators') },
|
|
54
54
|
React.createElement("button", { type: "button", className: cnSelect('IndicatorsDropdown'), tabIndex: -1, onClick: handleToggleDropdown },
|
|
55
55
|
React.createElement(IconSelect, { size: "xs", className: cnSelect('DropdownIndicatorIcon') })))),
|
|
56
|
-
React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, notFound: notFound, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex + 1 } : undefined })));
|
|
56
|
+
React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, notFound: notFound, labelForEmptyItems: labelForEmptyItems, hasItems: hasItems, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex + 1 } : undefined })));
|
|
57
57
|
}
|
|
58
58
|
export var Select = forwardRef(SelectRender);
|
|
59
59
|
export * from './helpers';
|
|
@@ -42,6 +42,7 @@ export declare type SelectProps<ITEM = DefaultItem, GROUP = DefaultGroup> = Prop
|
|
|
42
42
|
dropdownRef?: React.RefObject<HTMLDivElement>;
|
|
43
43
|
required?: boolean;
|
|
44
44
|
name?: string;
|
|
45
|
+
labelForEmptyItems?: string;
|
|
45
46
|
value?: PropValue<ITEM>;
|
|
46
47
|
renderItem?: PropRenderItem<ITEM>;
|
|
47
48
|
renderValue?: PropRenderValue<ITEM>;
|
|
@@ -101,6 +102,7 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: SelectProps<ITEM,
|
|
|
101
102
|
dropdownRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
102
103
|
required?: boolean | undefined;
|
|
103
104
|
name?: string | undefined;
|
|
105
|
+
labelForEmptyItems?: string | undefined;
|
|
104
106
|
value?: PropValue<ITEM>;
|
|
105
107
|
renderItem?: PropRenderItem<ITEM> | undefined;
|
|
106
108
|
renderValue?: PropRenderValue<ITEM> | undefined;
|
|
@@ -23,7 +23,9 @@ declare type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
|
|
|
23
23
|
getGroupLabel?: (group: GROUP) => string;
|
|
24
24
|
labelForCreate?: string;
|
|
25
25
|
labelForNotFound?: string;
|
|
26
|
+
labelForEmptyItems?: string;
|
|
26
27
|
notFound?: boolean;
|
|
28
|
+
hasItems?: boolean;
|
|
27
29
|
}>;
|
|
28
30
|
declare type SelectDropdown = <ITEM, GROUP>(props: Props<ITEM, GROUP>) => React.ReactElement | null;
|
|
29
31
|
export declare const SelectDropdown: SelectDropdown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import './SelectDropdown.css';
|
|
3
|
-
import React, { Fragment } from 'react';
|
|
3
|
+
import React, { Fragment, useRef } from 'react';
|
|
4
4
|
import { CSSTransition } from 'react-transition-group';
|
|
5
5
|
import { isOptionForCreate, } from '../../../hooks/useSelect/useSelect';
|
|
6
6
|
import { cn } from '../../../utils/bem';
|
|
@@ -15,11 +15,12 @@ export var defaultSelectDropdownPropForm = selectDropdownform[0];
|
|
|
15
15
|
var cnSelectDropdown = cn('SelectDropdown');
|
|
16
16
|
var cnSelectDropdownCssTransition = cnForCssTransition(cnSelectDropdown);
|
|
17
17
|
export var SelectDropdown = function (props) {
|
|
18
|
-
var controlRef = props.controlRef, size = props.size, getOptionProps = props.getOptionProps, dropdownRef = props.dropdownRef, labelForCreate = props.labelForCreate, className = props.className, labelForNotFound = props.labelForNotFound, form = props.form, isOpen = props.isOpen, renderItem = props.renderItem, visibleItems = props.visibleItems, getGroupLabel = props.getGroupLabel, notFound = props.notFound,
|
|
18
|
+
var controlRef = props.controlRef, size = props.size, getOptionProps = props.getOptionProps, dropdownRef = props.dropdownRef, labelForCreate = props.labelForCreate, className = props.className, labelForNotFound = props.labelForNotFound, labelForEmptyItems = props.labelForEmptyItems, _a = props.hasItems, hasItems = _a === void 0 ? true : _a, form = props.form, isOpen = props.isOpen, renderItem = props.renderItem, visibleItems = props.visibleItems, getGroupLabel = props.getGroupLabel, notFound = props.notFound, otherProps = __rest(props, ["controlRef", "size", "getOptionProps", "dropdownRef", "labelForCreate", "className", "labelForNotFound", "labelForEmptyItems", "hasItems", "form", "isOpen", "renderItem", "visibleItems", "getGroupLabel", "notFound"]);
|
|
19
19
|
var getIndex = fabricIndex(-1);
|
|
20
20
|
var indent = form === 'round' ? 'increased' : 'normal';
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
var popoverRef = useRef(null);
|
|
22
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, nodeRef: popoverRef, classNames: cnSelectDropdownCssTransition, timeout: 200 },
|
|
23
|
+
React.createElement(Popover, __assign({}, otherProps, { anchorRef: controlRef, direction: "downStartLeft", possibleDirections: ['downStartLeft', 'upStartLeft', 'downStartRight', 'upStartRight'], offset: 1, ref: popoverRef, role: "listbox", className: cnSelectDropdown({ form: form, size: size }, [className]), equalAnchorWidth: true }),
|
|
23
24
|
React.createElement("div", { className: cnSelectDropdown('List', { size: size, form: form }), ref: dropdownRef },
|
|
24
25
|
visibleItems.map(function (group) {
|
|
25
26
|
if (isOptionForCreate(group)) {
|
|
@@ -31,5 +32,6 @@ export var SelectDropdown = function (props) {
|
|
|
31
32
|
return (React.createElement(Fragment, { key: group.key + "-" + i }, renderItem(__assign({ item: item }, getOptionProps({ index: getIndex(), item: item })))));
|
|
32
33
|
})));
|
|
33
34
|
}),
|
|
34
|
-
notFound && labelForNotFound && (React.createElement(Text, { className: cnSelectDropdown('LabelForNotFound') }, labelForNotFound))
|
|
35
|
+
notFound && labelForNotFound && (React.createElement(Text, { className: cnSelectDropdown('LabelForNotFound') }, labelForNotFound)),
|
|
36
|
+
!hasItems && labelForEmptyItems && (React.createElement(Text, { className: cnSelectDropdown('LabelForEmptyItems') }, labelForEmptyItems))))));
|
|
35
37
|
};
|
|
@@ -3,4 +3,5 @@ import { PropForm } from './types';
|
|
|
3
3
|
export declare function getSelectDropdownForm(form: PropForm): SelectDropdownPropForm;
|
|
4
4
|
export declare const defaultlabelForNotFound = "\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E";
|
|
5
5
|
export declare const defaultlabelForCreate = "+";
|
|
6
|
+
export declare const defaultLabelForEmptyItems = "\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0443\u0441\u0442";
|
|
6
7
|
export declare const getInputWidth: (controlInnerRef: React.RefObject<HTMLDivElement>, helperInputFakeElement: React.RefObject<HTMLDivElement>) => number;
|
|
@@ -18,6 +18,7 @@ export function getSelectDropdownForm(form) {
|
|
|
18
18
|
}
|
|
19
19
|
export var defaultlabelForNotFound = 'Не найдено';
|
|
20
20
|
export var defaultlabelForCreate = '+';
|
|
21
|
+
export var defaultLabelForEmptyItems = 'Список пуст';
|
|
21
22
|
export var getInputWidth = function (controlInnerRef, helperInputFakeElement) {
|
|
22
23
|
if (!controlInnerRef.current || !helperInputFakeElement.current) {
|
|
23
24
|
return 20;
|
package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import './SelectDropdown.css';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
4
|
import { CSSTransition } from 'react-transition-group';
|
|
5
5
|
import { cn } from '../../../utils/bem';
|
|
6
6
|
import { cnForCssTransition } from '../../../utils/cnForCssTransition';
|
|
@@ -14,8 +14,9 @@ var cnSelectDropdown = cn('SelectDropdownDeprecated');
|
|
|
14
14
|
var cnSelectDropdownCssTransition = cnForCssTransition(cnSelectDropdown);
|
|
15
15
|
export var SelectDropdown = function (props) {
|
|
16
16
|
var controlRef = props.controlRef, visibleOptions = props.visibleOptions, highlightedIndex = props.highlightedIndex, size = props.size, getOptionProps = props.getOptionProps, inputValue = props.inputValue, dropdownRef = props.dropdownRef, id = props.id, _a = props.hasGroup, hasGroup = _a === void 0 ? false : _a, selectedValues = props.selectedValues, labelForCreate = props.labelForCreate, getOptionKey = props.getOptionKey, className = props.className, labelForNotFound = props.labelForNotFound, _b = props.form, form = _b === void 0 ? defaultSelectDropdownPropForm : _b, isOpen = props.isOpen, renderItem = props.renderItem;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var popoverRef = useRef(null);
|
|
18
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnSelectDropdownCssTransition, timeout: 200, nodeRef: popoverRef },
|
|
19
|
+
React.createElement(Popover, { anchorRef: controlRef, direction: "downStartLeft", possibleDirections: ['downStartLeft', 'upStartLeft', 'downStartRight', 'upStartRight'], offset: 1, ref: popoverRef, role: "listbox", className: cnSelectDropdown({ form: form, size: size }, [className]), "aria-activedescendant": id + "-" + highlightedIndex, equalAnchorWidth: true },
|
|
19
20
|
React.createElement("div", { className: cnSelectDropdown('List', { size: size, form: form }), ref: dropdownRef }, visibleOptions.length > 0 ? (visibleOptions.map(function (option, index) {
|
|
20
21
|
var isOptionForCreate = 'optionForCreate' in option;
|
|
21
22
|
var currentOption = visibleOptions[index];
|
|
@@ -34,6 +34,7 @@ var ContextConsumer = function (_a) {
|
|
|
34
34
|
export var Sidebar = function (props) {
|
|
35
35
|
var isOpen = props.isOpen, onClose = props.onClose, onOpen = props.onOpen, _a = props.hasOverlay, hasOverlay = _a === void 0 ? true : _a, onOverlayClick = props.onOverlayClick, onClickOutside = props.onClickOutside, onEsc = props.onEsc, _b = props.position, position = _b === void 0 ? sidebarPropPositionDefault : _b, _c = props.size, size = _c === void 0 ? sidebarPropSizeDefault : _c, className = props.className, children = props.children, _d = props.container, container = _d === void 0 ? window.document.body : _d, style = props.style, rootClassName = props.rootClassName, otherProps = __rest(props, ["isOpen", "onClose", "onOpen", "hasOverlay", "onOverlayClick", "onClickOutside", "onEsc", "position", "size", "className", "children", "container", "style", "rootClassName"]);
|
|
36
36
|
var ref = useRef(null);
|
|
37
|
+
var portalRef = useRef(null);
|
|
37
38
|
var theme = useTheme().theme;
|
|
38
39
|
useEffect(function () {
|
|
39
40
|
if (isOpen) {
|
|
@@ -46,8 +47,8 @@ export var Sidebar = function (props) {
|
|
|
46
47
|
useGlobalKeys({
|
|
47
48
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
48
49
|
});
|
|
49
|
-
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position }), classNames: cnForCssTransition(cnSidebar), timeout: 200 },
|
|
50
|
-
React.createElement(PortalWithTheme, { preset: theme, container: container, className: rootClassName, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
50
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position }), classNames: cnForCssTransition(cnSidebar), timeout: 200, nodeRef: portalRef },
|
|
51
|
+
React.createElement(PortalWithTheme, { preset: theme, ref: portalRef, container: container, className: rootClassName, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
|
|
51
52
|
hasOverlay && React.createElement("div", { className: cnSidebar('Overlay'), "aria-label": "Overlay" }),
|
|
52
53
|
React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), (typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' && { zIndex: (style === null || style === void 0 ? void 0 : style.zIndex) + 1 })), className: cnSidebar('Window', { size: size, position: position }, [className]), ref: ref }),
|
|
53
54
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: [ref] }, children)))));
|
|
@@ -2,6 +2,7 @@ import { __assign, __read, __rest } from "tslib";
|
|
|
2
2
|
import './Slider.css';
|
|
3
3
|
import React, { forwardRef, useRef } from 'react';
|
|
4
4
|
import { useFlag } from '../../hooks/useFlag/useFlag';
|
|
5
|
+
import { useSortSteps } from '../../hooks/useSortSteps/useSortSteps';
|
|
5
6
|
import { cn } from '../../utils/bem';
|
|
6
7
|
import { getByMap } from '../../utils/getByMap';
|
|
7
8
|
import { FieldCaption } from '../FieldCaption/FieldCaption';
|
|
@@ -25,6 +26,7 @@ function SliderRender(props, ref) {
|
|
|
25
26
|
var leftButtonRef = useRef(null);
|
|
26
27
|
var rightButtonRef = useRef(null);
|
|
27
28
|
var sliderRef = useRef(null);
|
|
29
|
+
var sortedSteps = useSortSteps({ step: step, min: min, max: max });
|
|
28
30
|
var IconRight = rightSide;
|
|
29
31
|
var IconLeft = isNotRangeParams && props.leftSide && props.leftSide !== 'input' ? props.leftSide : undefined;
|
|
30
32
|
var iconSize = getByMap(sizeMap, size);
|
|
@@ -34,13 +36,13 @@ function SliderRender(props, ref) {
|
|
|
34
36
|
value: value,
|
|
35
37
|
min: min,
|
|
36
38
|
max: max,
|
|
37
|
-
step:
|
|
39
|
+
step: sortedSteps,
|
|
38
40
|
onChange: onChange,
|
|
39
41
|
onAfterChange: onAfterChange,
|
|
40
42
|
sliderRef: sliderRef,
|
|
41
43
|
buttonRefs: [leftButtonRef, rightButtonRef]
|
|
42
44
|
}), onKeyPress = _l.onKeyPress, onFocus = _l.onFocus, handlePress = _l.handlePress, popoverPosition = _l.popoverPosition, activeButton = _l.activeButton, currentValue = _l.currentValue;
|
|
43
|
-
var _m = useSliderStationing(currentValue.length === 1 ? currentValue[0] : currentValue, min, max, view, range,
|
|
45
|
+
var _m = useSliderStationing(currentValue.length === 1 ? currentValue[0] : currentValue, min, max, view, range, sortedSteps, [leftButtonRef, rightButtonRef], sliderRef), lineSizes = _m.lineSizes, buttonPositions = _m.buttonPositions;
|
|
44
46
|
var changeHovered = function (status) {
|
|
45
47
|
if (status)
|
|
46
48
|
on();
|
|
@@ -51,7 +53,7 @@ function SliderRender(props, ref) {
|
|
|
51
53
|
label && (React.createElement(FieldLabel, { className: cnSlider('Label'), size: size }, label)),
|
|
52
54
|
React.createElement("div", { className: cnSlider('Container') },
|
|
53
55
|
leftSide === 'input' && isNotRangeParams(props) && (React.createElement("div", { className: cnSlider('Side', { position: 'left' }) },
|
|
54
|
-
React.createElement(SliderInput, { value: props.value, onChange: function (params) { var _a; return isNotRangeParams(props) && ((_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, params)); }, size: size, min: min, max: max, status: status, step:
|
|
56
|
+
React.createElement(SliderInput, { value: props.value, onChange: function (params) { var _a; return isNotRangeParams(props) && ((_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, params)); }, size: size, min: min, max: max, status: status, step: sortedSteps, disabled: disabled }))),
|
|
55
57
|
IconLeft && (React.createElement("div", { className: cnSlider('Side', { position: 'left' }) },
|
|
56
58
|
React.createElement(IconLeft, { size: iconSize, view: "secondary" }))),
|
|
57
59
|
React.createElement("div", { className: cnSlider('Control'), ref: sliderRef },
|
|
@@ -6,7 +6,7 @@ declare type Props = Omit<TextFieldProps<'number'>, 'value' | 'onChange' | 'min'
|
|
|
6
6
|
min?: number;
|
|
7
7
|
max?: number;
|
|
8
8
|
onChange?: (props: {
|
|
9
|
-
e?: React.ChangeEvent | React.MouseEvent;
|
|
9
|
+
e?: React.ChangeEvent | React.MouseEvent | React.KeyboardEvent;
|
|
10
10
|
value: number;
|
|
11
11
|
}) => void;
|
|
12
12
|
};
|
|
@@ -18,5 +18,5 @@ export var SliderInput = function (props) {
|
|
|
18
18
|
setCurrentValue(validatedValue.toString());
|
|
19
19
|
};
|
|
20
20
|
useEffect(function () { return setCurrentValue(value.toString()); }, [value]);
|
|
21
|
-
return (React.createElement(TextField, __assign({ onBlur: commitChange, type: "number", min: min, max: max, step:
|
|
21
|
+
return (React.createElement(TextField, __assign({ onBlur: commitChange, type: "number", min: min, max: max, step: step, onChange: handleChange, value: currentValue }, otherProps)));
|
|
22
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __read
|
|
1
|
+
import { __read } from "tslib";
|
|
2
2
|
import { getSteps } from '../useSliderStationing';
|
|
3
3
|
export var isRangeParams = function (params) {
|
|
4
4
|
return !!params.range;
|
|
@@ -53,25 +53,18 @@ export var getValidValue = function (value, min, max, step) {
|
|
|
53
53
|
return (Math.ceil(Number(value.toFixed(division ? division.length : 0)) / stepValue) * stepValue);
|
|
54
54
|
}
|
|
55
55
|
var resultValue_1 = value;
|
|
56
|
-
|
|
57
|
-
if (step[0] !== min) {
|
|
58
|
-
stepsArr_1 = __spread([min], stepsArr_1);
|
|
59
|
-
}
|
|
60
|
-
else if (step[step.length - 1] !== max) {
|
|
61
|
-
stepsArr_1 = __spread(stepsArr_1, [max]);
|
|
62
|
-
}
|
|
63
|
-
stepsArr_1.forEach(function (stepPoint, index) {
|
|
56
|
+
step.forEach(function (stepPoint, index) {
|
|
64
57
|
var minValue = min;
|
|
65
58
|
var maxValue = max;
|
|
66
59
|
if (index === 0) {
|
|
67
|
-
maxValue =
|
|
60
|
+
maxValue = step[index + 1];
|
|
68
61
|
}
|
|
69
|
-
else if (index ===
|
|
62
|
+
else if (index === step.length - 1) {
|
|
70
63
|
minValue = stepPoint;
|
|
71
64
|
maxValue = max;
|
|
72
65
|
}
|
|
73
66
|
else {
|
|
74
|
-
maxValue =
|
|
67
|
+
maxValue = step[index + 1];
|
|
75
68
|
minValue = stepPoint;
|
|
76
69
|
}
|
|
77
70
|
if (value <= maxValue && value >= minValue) {
|
|
@@ -52,7 +52,7 @@ export function useSlider(props) {
|
|
|
52
52
|
});
|
|
53
53
|
}, [step]);
|
|
54
54
|
useEffect(function () {
|
|
55
|
-
if (typeof value !== 'undefined'
|
|
55
|
+
if (typeof value !== 'undefined') {
|
|
56
56
|
var targetValue = isRangeParams(props)
|
|
57
57
|
? [
|
|
58
58
|
getValidValue(props.value[0], min, max, step),
|
|
@@ -93,32 +93,24 @@ export function useSlider(props) {
|
|
|
93
93
|
}
|
|
94
94
|
if (validKeyCode) {
|
|
95
95
|
if (Array.isArray(step)) {
|
|
96
|
-
|
|
97
|
-
if (step[0] !== minValue) {
|
|
98
|
-
stepsArr_1 = __spread([minValue], stepsArr_1);
|
|
99
|
-
}
|
|
100
|
-
if (step[step.length - 1] !== maxValue) {
|
|
101
|
-
stepsArr_1 = __spread(stepsArr_1, [maxValue]);
|
|
102
|
-
}
|
|
103
|
-
stepsArr_1.forEach(function (stepPoint, index) {
|
|
96
|
+
step.forEach(function (stepPoint, index) {
|
|
104
97
|
if (typeof typeButton === 'number' && changedValue_1 === stepPoint) {
|
|
105
98
|
if (stepIncrement_1 >= 0) {
|
|
106
99
|
if (index === 0) {
|
|
107
|
-
stepIncrement_1 =
|
|
100
|
+
stepIncrement_1 = step[1] - minValue;
|
|
108
101
|
}
|
|
109
102
|
else {
|
|
110
103
|
stepIncrement_1 =
|
|
111
|
-
(typeof
|
|
112
|
-
|
|
113
|
-
: maxValue) - stepPoint;
|
|
104
|
+
(typeof step[index + 1] !== 'undefined' ? step[index + 1] : maxValue) -
|
|
105
|
+
stepPoint;
|
|
114
106
|
}
|
|
115
107
|
}
|
|
116
108
|
else if (index === 0) {
|
|
117
|
-
stepIncrement_1 = minValue -
|
|
109
|
+
stepIncrement_1 = minValue - step[1];
|
|
118
110
|
}
|
|
119
111
|
else {
|
|
120
112
|
stepIncrement_1 =
|
|
121
|
-
(typeof
|
|
113
|
+
(typeof step[index - 1] !== 'undefined' ? step[index - 1] : minValue) -
|
|
122
114
|
stepPoint;
|
|
123
115
|
}
|
|
124
116
|
}
|
|
@@ -4,17 +4,10 @@ export var getSteps = function (step, min, max) {
|
|
|
4
4
|
var stepsArray = [];
|
|
5
5
|
var size = min;
|
|
6
6
|
if (Array.isArray(step)) {
|
|
7
|
-
step.
|
|
7
|
+
for (var i = 0; i < step.length - 1; i++) {
|
|
8
8
|
stepsArray.push({
|
|
9
|
-
min:
|
|
10
|
-
max:
|
|
11
|
-
});
|
|
12
|
-
size += stepSize - size;
|
|
13
|
-
});
|
|
14
|
-
if (size !== max) {
|
|
15
|
-
stepsArray.push({
|
|
16
|
-
min: size,
|
|
17
|
-
max: max
|
|
9
|
+
min: step[i],
|
|
10
|
+
max: step[i + 1]
|
|
18
11
|
});
|
|
19
12
|
}
|
|
20
13
|
}
|
|
@@ -30,6 +23,7 @@ export var getSteps = function (step, min, max) {
|
|
|
30
23
|
return stepsArray;
|
|
31
24
|
};
|
|
32
25
|
export var useSliderStationing = function (value, min, max, view, range, step, buttonRefs, sliderLineRef) {
|
|
26
|
+
if (step === void 0) { step = 1; }
|
|
33
27
|
var _a = __read(useState([]), 2), lineSizes = _a[0], setLineSizes = _a[1];
|
|
34
28
|
var _b = __read(useState([]), 2), buttonPositions = _b[0], setButtonPositions = _b[1];
|
|
35
29
|
var calculateLines = function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './SnackBar.css';
|
|
2
|
-
import
|
|
3
|
-
import { SnackBarProps } from './helper';
|
|
2
|
+
import { SnackBarComponent } from './types';
|
|
4
3
|
export declare const cnSnackBar: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
-
export declare const SnackBar:
|
|
4
|
+
export declare const SnackBar: SnackBarComponent;
|
|
5
|
+
export * from './types';
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
import './SnackBar.css';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
4
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
5
|
+
import { useRefs } from '../../hooks/useRefs/useRefs';
|
|
5
6
|
import { cn } from '../../utils/bem';
|
|
6
7
|
import { cnForCssTransition } from '../../utils/cnForCssTransition';
|
|
7
8
|
import { usePropsHandler } from '../EventInterceptor/usePropsHandler';
|
|
8
9
|
import { SnackBarItem } from './SnackBarItem/SnackBarItem';
|
|
10
|
+
import { getItem, withDefaultGetters } from './helper';
|
|
9
11
|
export var cnSnackBar = cn('SnackBar');
|
|
10
12
|
var cssTransitionClassNames = cnForCssTransition(cnSnackBar, 'Item');
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})));
|
|
24
|
-
};
|
|
13
|
+
function SnackBarRender(propsComponent, ref) {
|
|
14
|
+
var props = usePropsHandler('SnackBar', withDefaultGetters(propsComponent));
|
|
15
|
+
var items = props.items, className = props.className, getItemKey = props.getItemKey, getItemActions = props.getItemActions, getItemAutoClose = props.getItemAutoClose, getItemIcon = props.getItemIcon, getItemMessage = props.getItemMessage, getItemOnAutoClose = props.getItemOnAutoClose, getItemOnClose = props.getItemOnClose, getItemShowProgress = props.getItemShowProgress, getItemStatus = props.getItemStatus, onItemClose = props.onItemClose, onItemAutoClose = props.onItemAutoClose, otherProps = __rest(props, ["items", "className", "getItemKey", "getItemActions", "getItemAutoClose", "getItemIcon", "getItemMessage", "getItemOnAutoClose", "getItemOnClose", "getItemShowProgress", "getItemStatus", "onItemClose", "onItemAutoClose"]);
|
|
16
|
+
var refs = useRefs(items.length);
|
|
17
|
+
return (React.createElement("div", __assign({ className: cnSnackBar(null, [className]), ref: ref }, otherProps),
|
|
18
|
+
React.createElement(TransitionGroup, { component: null, appear: true, enter: true, exit: true }, items.map(function (item, index) {
|
|
19
|
+
return (React.createElement(CSSTransition, { nodeRef: refs[index], classNames: cssTransitionClassNames, key: cnSnackBar('Item', { key: getItemKey(item) }), timeout: 200 },
|
|
20
|
+
React.createElement(SnackBarItem, __assign({ ref: refs[index], className: cnSnackBar('Item') }, getItem(item, props)))));
|
|
21
|
+
}))));
|
|
22
|
+
}
|
|
23
|
+
export var SnackBar = forwardRef(SnackBarRender);
|
|
24
|
+
export * from './types';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import '../../Theme/_color/Theme_color_gpnDark.css';
|
|
2
2
|
import './SnackBarItem.css';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { SnackBarItemProps } from '../helper';
|
|
6
|
-
declare type SnackBarItemComponent = (props: PropsWithHTMLAttributesAndRef<SnackBarItemProps, HTMLDivElement>) => React.ReactElement | null;
|
|
4
|
+
import { SnackBarItemComponent, SnackBarItemProps } from '../types';
|
|
7
5
|
export declare const cnSnackBarItem: import("@bem-react/classname").ClassNameFormatter;
|
|
6
|
+
export declare function SnackBarItemRender(props: SnackBarItemProps, ref: React.Ref<HTMLDivElement>): JSX.Element;
|
|
8
7
|
export declare const SnackBarItem: SnackBarItemComponent;
|
|
9
|
-
export {};
|