@consta/uikit 3.17.1 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +29 -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/es.js +1 -0
- package/ContextMenuCanary/index.d.ts +1 -0
- package/ContextMenuCanary/index.js +4 -0
- package/ContextMenuCanary/package.json +9 -0
- 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/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/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/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/es.js +1 -0
- package/MixPopoverArrow/index.d.ts +1 -0
- package/MixPopoverArrow/index.js +4 -0
- package/MixPopoverArrow/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/Card/Card.d.ts +1 -0
- package/__internal__/cjs-src/components/Card/Card.js +8 -4
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenu.css +18 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuCanary.d.ts +4 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuCanary.js +30 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.css +74 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.d.ts +3 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.js +45 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.css +73 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +4 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +102 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.d.ts +2 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +74 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/helper.d.ts +95 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/helper.js +119 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/types.d.ts +141 -0
- package/__internal__/cjs-src/components/ContextMenuCanary/types.js +14 -0
- package/__internal__/cjs-src/components/EventInterceptor/EventInterceptor.d.ts +2 -2
- package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -81
- package/__internal__/cjs-src/components/EventInterceptor/types.d.ts +1 -0
- package/__internal__/cjs-src/components/EventInterceptor/types.js +2 -0
- package/__internal__/cjs-src/components/EventInterceptor/usePropsHandler.d.ts +2 -2
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.css +0 -1
- package/__internal__/cjs-src/components/Sidebar/Sidebar.css +5 -0
- package/__internal__/cjs-src/components/Sidebar/Sidebar.js +1 -1
- package/__internal__/cjs-src/components/Tag/Tag.d.ts +1 -0
- package/__internal__/cjs-src/components/Tag/Tag.js +8 -4
- package/__internal__/cjs-src/components/ThemeToggler/ThemeToggler.d.ts +2 -30
- package/__internal__/cjs-src/components/ThemeToggler/ThemeToggler.js +23 -37
- package/__internal__/cjs-src/components/ThemeToggler/helpers.d.ts +274 -0
- package/__internal__/cjs-src/components/ThemeToggler/helpers.js +27 -0
- package/__internal__/cjs-src/components/ThemeToggler/types.d.ts +45 -0
- package/__internal__/cjs-src/components/ThemeToggler/types.js +5 -0
- package/__internal__/cjs-src/components/Tooltip/Tooltip.css +1 -89
- package/__internal__/cjs-src/components/Tooltip/Tooltip.js +3 -2
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.css +88 -0
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.d.ts +8 -0
- package/__internal__/cjs-src/mixs/MixPopoverArrow/MixPopoverArrow.js +6 -0
- package/__internal__/src/components/Card/Card.d.ts +1 -0
- package/__internal__/src/components/Card/Card.js +7 -3
- package/__internal__/src/components/ContextMenuCanary/ContextMenu.css +18 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuCanary.d.ts +4 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuCanary.js +27 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.css +74 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.d.ts +3 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuItem/ContextMenuItem.js +42 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.css +73 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.d.ts +4 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevel/ContextMenuLevel.js +99 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.d.ts +2 -0
- package/__internal__/src/components/ContextMenuCanary/ContextMenuLevels/ContextMenuLevels.js +71 -0
- package/__internal__/src/components/ContextMenuCanary/helper.d.ts +95 -0
- package/__internal__/src/components/ContextMenuCanary/helper.js +115 -0
- package/__internal__/src/components/ContextMenuCanary/types.d.ts +141 -0
- package/__internal__/src/components/ContextMenuCanary/types.js +11 -0
- package/__internal__/src/components/EventInterceptor/EventInterceptor.d.ts +2 -2
- package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +2 -81
- package/__internal__/src/components/EventInterceptor/types.d.ts +1 -0
- package/__internal__/src/components/EventInterceptor/types.js +0 -0
- package/__internal__/src/components/EventInterceptor/usePropsHandler.d.ts +2 -2
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.css +0 -1
- package/__internal__/src/components/Sidebar/Sidebar.css +5 -0
- package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
- package/__internal__/src/components/Tag/Tag.d.ts +1 -0
- package/__internal__/src/components/Tag/Tag.js +7 -3
- package/__internal__/src/components/ThemeToggler/ThemeToggler.d.ts +2 -30
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js +21 -35
- package/__internal__/src/components/ThemeToggler/helpers.d.ts +274 -0
- package/__internal__/src/components/ThemeToggler/helpers.js +23 -0
- package/__internal__/src/components/ThemeToggler/types.d.ts +45 -0
- package/__internal__/src/components/ThemeToggler/types.js +2 -0
- package/__internal__/src/components/Tooltip/Tooltip.css +1 -89
- package/__internal__/src/components/Tooltip/Tooltip.js +3 -2
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.css +88 -0
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.d.ts +8 -0
- package/__internal__/src/mixs/MixPopoverArrow/MixPopoverArrow.js +3 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +3 -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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import './ContextMenu.css';
|
|
3
|
+
import React, { useRef, useState } from 'react';
|
|
4
|
+
import { Transition } from 'react-transition-group';
|
|
5
|
+
import { useFlag } from '../../hooks/useFlag/useFlag';
|
|
6
|
+
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
7
|
+
import { animateTimeout, cnMixPopoverAnimate, } from '../../mixs/MixPopoverAnimate/MixPopoverAnimate';
|
|
8
|
+
import { cn } from '../../utils/bem';
|
|
9
|
+
import { ContextMenuLevels } from './ContextMenuLevels/ContextMenuLevels';
|
|
10
|
+
var cnContextMenu = cn('ContextMenuCanary');
|
|
11
|
+
function ContextMenuRender(props, ref) {
|
|
12
|
+
var isOpen = props.isOpen, className = props.className, onSetDirection = props.onSetDirection, otherProps = __rest(props, ["isOpen", "className", "onSetDirection"]);
|
|
13
|
+
var _a = __read(useFlag(), 2), playAnimation = _a[0], setPlayAnimation = _a[1];
|
|
14
|
+
var _b = __read(useState(props.direction), 2), direction = _b[0], setDirection = _b[1];
|
|
15
|
+
var nodeRef = useRef(null);
|
|
16
|
+
var levelRef = useForkRef([ref, nodeRef]);
|
|
17
|
+
var handleSetDirection = function (d) {
|
|
18
|
+
setDirection(d);
|
|
19
|
+
onSetDirection === null || onSetDirection === void 0 ? void 0 : onSetDirection(d);
|
|
20
|
+
};
|
|
21
|
+
return (React.createElement(Transition, { "in": isOpen, unmountOnExit: true, timeout: animateTimeout, onEnter: setPlayAnimation.off, onExit: setPlayAnimation.on, nodeRef: nodeRef }, function (animate) { return (React.createElement(ContextMenuLevels, __assign({}, otherProps, { ref: levelRef, onSetDirection: handleSetDirection, className: cnContextMenu('Level', { playAnimation: playAnimation }, [
|
|
22
|
+
className,
|
|
23
|
+
cnMixPopoverAnimate({ animate: animate, direction: direction }),
|
|
24
|
+
]) }))); }));
|
|
25
|
+
}
|
|
26
|
+
export var ContextMenu = React.forwardRef(ContextMenuRender);
|
|
27
|
+
export * from './types';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.ContextMenuItemCanary {
|
|
2
|
+
--vertical-space: 0;
|
|
3
|
+
display: -webkit-box;
|
|
4
|
+
display: -ms-flexbox;
|
|
5
|
+
display: flex;
|
|
6
|
+
-webkit-box-align: center;
|
|
7
|
+
-ms-flex-align: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: var(--vertical-space) var(--space-s);
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
word-break: break-word;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
-webkit-transition: background-color 0.2s;
|
|
14
|
+
transition: background-color 0.2s;
|
|
15
|
+
gap: var(--space-xs);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ContextMenuItemCanary:hover,
|
|
19
|
+
.ContextMenuItemCanary_active {
|
|
20
|
+
background: var(--color-control-bg-clear-hover);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ContextMenuItemCanary_size_xs {
|
|
24
|
+
--vertical-space: var(--space-2xs);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ContextMenuItemCanary_size_s {
|
|
28
|
+
--vertical-space: var(--space-xs);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ContextMenuItemCanary_size_m {
|
|
32
|
+
--vertical-space: var(--space-s);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ContextMenuItemCanary_size_l {
|
|
36
|
+
--vertical-space: var(--space-m);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ContextMenuItemCanary-Label {
|
|
40
|
+
-webkit-box-flex: 1;
|
|
41
|
+
-ms-flex: 1;
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ContextMenuItemCanary_disabled.Text {
|
|
46
|
+
color: var(--color-control-typo-disable);
|
|
47
|
+
cursor: default;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ContextMenuItemCanary_disabled.Text:hover {
|
|
51
|
+
background: transparent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ContextMenuItemCanary-Slot {
|
|
55
|
+
display: -webkit-box;
|
|
56
|
+
display: -ms-flexbox;
|
|
57
|
+
display: flex;
|
|
58
|
+
-webkit-box-align: center;
|
|
59
|
+
-ms-flex-align: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ContextMenuItemCanary-Slot_position_left,
|
|
64
|
+
.ContextMenuItemCanary-Slot_position_right {
|
|
65
|
+
-webkit-box-flex: 0;
|
|
66
|
+
-ms-flex: 0;
|
|
67
|
+
flex: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ContextMenuItemCanary-Slot_position_center {
|
|
71
|
+
-webkit-box-flex: 1;
|
|
72
|
+
-ms-flex: 1;
|
|
73
|
+
flex: 1;
|
|
74
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __spread } from "tslib";
|
|
2
|
+
import './ContextMenuItem.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { IconArrowRight } from '../../../icons/IconArrowRight/IconArrowRight';
|
|
5
|
+
import { cn } from '../../../utils/bem';
|
|
6
|
+
import { getByMap } from '../../../utils/getByMap';
|
|
7
|
+
import { Text } from '../../Text/Text';
|
|
8
|
+
import { sizeMapIcon } from '../helper';
|
|
9
|
+
import { contextMenuDefaultSize, } from '../types';
|
|
10
|
+
var cnContextMenuItem = cn('ContextMenuItemCanary');
|
|
11
|
+
function renderSide(side, position, withArrow, size, icon) {
|
|
12
|
+
var sides = side ? __spread((Array.isArray(side) ? side : [side])) : [];
|
|
13
|
+
if (icon) {
|
|
14
|
+
var Icon = icon;
|
|
15
|
+
var render = React.createElement(Icon, { size: getByMap(sizeMapIcon, size) });
|
|
16
|
+
if (position === 'left') {
|
|
17
|
+
sides.unshift(render);
|
|
18
|
+
}
|
|
19
|
+
if (position === 'right') {
|
|
20
|
+
sides.push(render);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (withArrow) {
|
|
24
|
+
sides.push(React.createElement(IconArrowRight, { size: "xs", view: "secondary" }));
|
|
25
|
+
}
|
|
26
|
+
var sidesRender = sides.map(function (item, index) { return (React.createElement("div", { className: cnContextMenuItem('Slot', {
|
|
27
|
+
position: position
|
|
28
|
+
}), key: cnContextMenuItem('Slot', {
|
|
29
|
+
position: position,
|
|
30
|
+
index: index
|
|
31
|
+
}) }, item)); });
|
|
32
|
+
return sidesRender;
|
|
33
|
+
}
|
|
34
|
+
function ContextMenuItemRender(props, ref) {
|
|
35
|
+
var label = props.label, rightSide = props.rightSide, leftSide = props.leftSide, _a = props.size, size = _a === void 0 ? contextMenuDefaultSize : _a, _b = props.as, as = _b === void 0 ? 'div' : _b, disabled = props.disabled, status = props.status, withSubMenu = props.withSubMenu, className = props.className, active = props.active, leftIcon = props.leftIcon, rightIcon = props.rightIcon, otherProps = __rest(props, ["label", "rightSide", "leftSide", "size", "as", "disabled", "status", "withSubMenu", "className", "active", "leftIcon", "rightIcon"]);
|
|
36
|
+
var view = (disabled ? undefined : status) || 'primary';
|
|
37
|
+
return (React.createElement(Text, __assign({ className: cnContextMenuItem({ size: size, active: active, disabled: disabled }, [className]), as: as, size: size, view: view, lineHeight: "xs", ref: ref }, otherProps),
|
|
38
|
+
renderSide(leftSide, 'left', false, size, leftIcon),
|
|
39
|
+
!rightSide && !leftSide && !withSubMenu && !leftIcon && !rightIcon ? (label) : (React.createElement("div", { className: cnContextMenuItem('Slot', { position: 'center' }), key: "center" }, label)),
|
|
40
|
+
renderSide(rightSide, 'right', withSubMenu, size, rightIcon)));
|
|
41
|
+
}
|
|
42
|
+
export var ContextMenuItem = React.forwardRef(ContextMenuItemRender);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.ContextMenuLevelCanary {
|
|
2
|
+
-webkit-box-sizing: border-box;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
width: 240px;
|
|
5
|
+
padding: var(--space-xs) 0;
|
|
6
|
+
background: var(--color-bg-default);
|
|
7
|
+
border: var(--control-border-width) solid var(--color-control-bg-border-default);
|
|
8
|
+
border-radius: var(--control-radius);
|
|
9
|
+
-webkit-box-shadow: var(--shadow-layer);
|
|
10
|
+
box-shadow: var(--shadow-layer);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_rightStartUp,
|
|
14
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_leftStartUp {
|
|
15
|
+
-webkit-transform: translateY(calc(-1 * (var(--space-xs) + 1px)));
|
|
16
|
+
transform: translateY(calc(-1 * (var(--space-xs) + 1px)));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_rightStartDown,
|
|
20
|
+
.ContextMenuLevelCanary:not(.ContextMenuLevelCanary_firstLevel).ContextMenuLevelCanary_direction_leftStartDown {
|
|
21
|
+
-webkit-transform: translateY(calc(var(--space-xs) + 1px));
|
|
22
|
+
transform: translateY(calc(var(--space-xs) + 1px));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ContextMenuLevelCanary-Divider {
|
|
26
|
+
--vertical-space: 0;
|
|
27
|
+
height: var(--control-border-width);
|
|
28
|
+
margin: var(--vertical-space) var(--space-s);
|
|
29
|
+
background: var(--color-control-bg-border-default);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ContextMenuLevelCanary-Divider_size_l {
|
|
33
|
+
--vertical-space: var(--space-xs);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ContextMenuLevelCanary-Divider_size_m,
|
|
37
|
+
.ContextMenuLevelCanary-Divider_size_s,
|
|
38
|
+
.ContextMenuLevelCanary-Divider_size_xs {
|
|
39
|
+
--vertical-space: var(--space-2xs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ContextMenuLevelCanary-Group_size_xs > .ContextMenuLevel-Item:not(:last-child) {
|
|
43
|
+
margin-bottom: var(--space-2xs);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ContextMenuLevelCanary-Header {
|
|
47
|
+
--top-space: 0;
|
|
48
|
+
--bottom-space: 0;
|
|
49
|
+
margin: 0 var(--space-s);
|
|
50
|
+
padding: var(--top-space) 0 var(--bottom-space) 0;
|
|
51
|
+
border-bottom: solid var(--control-border-width) var(--color-control-bg-border-default);
|
|
52
|
+
letter-spacing: 0.05em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ContextMenuLevelCanary-Header_size_xs,
|
|
56
|
+
.ContextMenuLevelCanary-Header_size_s {
|
|
57
|
+
--top-space: var(--space-xs);
|
|
58
|
+
--bottom-space: var(--space-2xs);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ContextMenuLevelCanary-Header_size_m {
|
|
62
|
+
--top-space: var(--space-s);
|
|
63
|
+
--bottom-space: var(--space-xs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ContextMenuLevelCanary-Header_size_l {
|
|
67
|
+
--top-space: var(--space-s);
|
|
68
|
+
--bottom-space: var(--space-s);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ContextMenuLevelCanary-Header_first {
|
|
72
|
+
padding: calc(var(--top-space) - var(--space-xs)) 0 var(--bottom-space) 0;
|
|
73
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __values } from "tslib";
|
|
2
|
+
import './ContextMenuLevel.css';
|
|
3
|
+
import React, { createRef, forwardRef, useEffect, useMemo } from 'react';
|
|
4
|
+
import { useFlag } from '../../../hooks/useFlag/useFlag';
|
|
5
|
+
import { cn } from '../../../utils/bem';
|
|
6
|
+
import { getByMap } from '../../../utils/getByMap';
|
|
7
|
+
import { getGroups } from '../../../utils/getGroups';
|
|
8
|
+
import { Popover } from '../../Popover/Popover';
|
|
9
|
+
import { Text } from '../../Text/Text';
|
|
10
|
+
import { ContextMenuItem } from '../ContextMenuItem/ContextMenuItem';
|
|
11
|
+
import { getItemIndex, sizeMapHeader } from '../helper';
|
|
12
|
+
import { contextMenuDefaultSize, } from '../types';
|
|
13
|
+
export var cnContextMenuLevel = cn('ContextMenuLevelCanary');
|
|
14
|
+
var renderHeader = function (groupLabel, first, size) {
|
|
15
|
+
if (size === void 0) { size = contextMenuDefaultSize; }
|
|
16
|
+
if (!groupLabel) {
|
|
17
|
+
if (first) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return React.createElement("div", { className: cnContextMenuLevel('Divider', { size: size }) });
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement(Text, { view: "secondary", transform: "uppercase", className: cnContextMenuLevel('Header', { size: size, first: first }), size: getByMap(sizeMapHeader, size) }, groupLabel));
|
|
23
|
+
};
|
|
24
|
+
function ContextMenuLevelRender(props, ref) {
|
|
25
|
+
var _a = props.size, size = _a === void 0 ? contextMenuDefaultSize : _a, items = props.items, groupsProp = props.groups, className = props.className,
|
|
26
|
+
// Свойства относящиеся к меню
|
|
27
|
+
levelDepth = props.levelDepth, activeItem = props.activeItem, addLevel = props.addLevel, deleteLevel = props.deleteLevel, setHoveredParenLevel = props.setHoveredParenLevel, hoveredParenLevel = props.hoveredParenLevel, sortGroup = props.sortGroup, onItemClick = props.onItemClick,
|
|
28
|
+
// Свойства для поповера
|
|
29
|
+
direction = props.direction, possibleDirections = props.possibleDirections, offset = props.offset, onSetDirection = props.onSetDirection, spareDirection = props.spareDirection, anchorRef = props.anchorRef,
|
|
30
|
+
// Геттеры для ITEM
|
|
31
|
+
getItemLabel = props.getItemLabel, getItemRightSide = props.getItemRightSide, getItemLeftSide = props.getItemLeftSide, getItemSubMenu = props.getItemSubMenu, getItemStatus = props.getItemStatus, getItemDisabled = props.getItemDisabled, getItemKey = props.getItemKey, getItemOnClick = props.getItemOnClick, getItemAs = props.getItemAs, getItemAttributes = props.getItemAttributes, getItemGroupId = props.getItemGroupId, getItemLeftIcon = props.getItemLeftIcon, getItemRightIcon = props.getItemRightIcon,
|
|
32
|
+
// Геттеры для GROUP
|
|
33
|
+
getGroupLabel = props.getGroupLabel, getGroupId = props.getGroupId, otherProps = __rest(props, ["size", "items", "groups", "className", "levelDepth", "activeItem", "addLevel", "deleteLevel", "setHoveredParenLevel", "hoveredParenLevel", "sortGroup", "onItemClick", "direction", "possibleDirections", "offset", "onSetDirection", "spareDirection", "anchorRef", "getItemLabel", "getItemRightSide", "getItemLeftSide", "getItemSubMenu", "getItemStatus", "getItemDisabled", "getItemKey", "getItemOnClick", "getItemAs", "getItemAttributes", "getItemGroupId", "getItemLeftIcon", "getItemRightIcon", "getGroupLabel", "getGroupId"]);
|
|
34
|
+
var _b = __read(useFlag(false), 2), hovered = _b[0], setHovered = _b[1];
|
|
35
|
+
var groups = getGroups(items, getItemGroupId, groupsProp, getGroupId, sortGroup && (function (a, b) { return sortGroup(a.key, b.key); }));
|
|
36
|
+
var constructItemRefs = function () {
|
|
37
|
+
var e_1, _a;
|
|
38
|
+
var refs = {};
|
|
39
|
+
try {
|
|
40
|
+
for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
41
|
+
var group = groups_1_1.value;
|
|
42
|
+
for (var i = 0; i < items.length; i++) {
|
|
43
|
+
refs[getItemIndex(group.key, i)] = createRef();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (groups_1_1 && !groups_1_1.done && (_a = groups_1["return"])) _a.call(groups_1);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e_1) throw e_1.error; }
|
|
53
|
+
}
|
|
54
|
+
return refs;
|
|
55
|
+
};
|
|
56
|
+
var itemsRefs = useMemo(constructItemRefs, [items, groupsProp]);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {
|
|
59
|
+
setTimeout(function () { return deleteLevel(levelDepth); }, 300);
|
|
60
|
+
}
|
|
61
|
+
}, [hovered, hoveredParenLevel]);
|
|
62
|
+
var onMouseEnter = function (item, itemIndex) {
|
|
63
|
+
var subMenu = getItemSubMenu(item);
|
|
64
|
+
var disabled = getItemDisabled(item);
|
|
65
|
+
if (Array.isArray(subMenu) && !disabled) {
|
|
66
|
+
addLevel({
|
|
67
|
+
level: levelDepth + 1,
|
|
68
|
+
items: subMenu,
|
|
69
|
+
anchorRef: itemsRefs[itemIndex],
|
|
70
|
+
activeItem: itemIndex
|
|
71
|
+
});
|
|
72
|
+
setHoveredParenLevel(levelDepth + 1);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
setHoveredParenLevel(levelDepth);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return (React.createElement(Popover, __assign({ anchorRef: anchorRef, className: cnContextMenuLevel({ firstLevel: levelDepth === 0, direction: direction }, [className]), possibleDirections: possibleDirections, spareDirection: spareDirection, direction: direction, offset: offset, onSetDirection: onSetDirection, onMouseEnter: setHovered.on, onMouseLeave: setHovered.off, ref: ref }, otherProps), groups.map(function (group, groupIndex) {
|
|
79
|
+
return (React.createElement("div", { className: cnContextMenuLevel('Group', { size: size }), key: group.key },
|
|
80
|
+
renderHeader(group.group && getGroupLabel(group.group), groupIndex === 0, size),
|
|
81
|
+
group.items.map(function (item, index) {
|
|
82
|
+
var _a;
|
|
83
|
+
var itemIndex = getItemIndex(group.key, index);
|
|
84
|
+
var onClick = function (e) {
|
|
85
|
+
var _a;
|
|
86
|
+
if (!getItemDisabled(item)) {
|
|
87
|
+
if (typeof getItemOnClick(item) === 'function') {
|
|
88
|
+
(_a = getItemOnClick(item)) === null || _a === void 0 ? void 0 : _a({ e: e, item: item });
|
|
89
|
+
}
|
|
90
|
+
if (typeof onItemClick === 'function') {
|
|
91
|
+
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick({ e: e, item: item });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return (React.createElement(ContextMenuItem, __assign({ label: getItemLabel(item), rightSide: getItemRightSide(item), rightIcon: getItemRightIcon(item), leftSide: getItemLeftSide(item), leftIcon: getItemLeftIcon(item), status: getItemStatus(item), key: cnContextMenuLevel('Item', { groupIndex: groupIndex, index: index }), disabled: getItemDisabled(item), onClick: onClick, as: getItemAs(item) }, ((_a = getItemAttributes(item)) !== null && _a !== void 0 ? _a : {}), { ref: itemsRefs[itemIndex], className: cnContextMenuLevel('Item'), onMouseEnter: function () { return onMouseEnter(item, itemIndex); }, active: activeItem === itemIndex, size: size, withSubMenu: !!getItemSubMenu(item) })));
|
|
96
|
+
})));
|
|
97
|
+
})));
|
|
98
|
+
}
|
|
99
|
+
export var ContextMenuLevel = forwardRef(ContextMenuLevelRender);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { __assign, __read, __rest, __spread } from "tslib";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { useClickOutside } from '../../../hooks/useClickOutside/useClickOutside';
|
|
4
|
+
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
5
|
+
import { useRefs } from '../../../hooks/useRefs/useRefs';
|
|
6
|
+
import { directions } from '../../Popover/Popover';
|
|
7
|
+
import { ContextMenuLevel } from '../ContextMenuLevel/ContextMenuLevel';
|
|
8
|
+
import { getLevels, withDefaultGetters } from '../helper';
|
|
9
|
+
import { contextMenuPropDefaultSubMenuDirection, contextMenuPropSubMenuDirections, } from '../types';
|
|
10
|
+
function ContextMenuLevelsRender(propsComponent, ref) {
|
|
11
|
+
var props = withDefaultGetters(propsComponent);
|
|
12
|
+
var items = props.items, anchorRef = props.anchorRef, position = props.position, direction = props.direction, _a = props.possibleDirections, possibleDirections = _a === void 0 ? directions : _a, offset = props.offset, onClickOutside = props.onClickOutside, getItemKey = props.getItemKey, getItemLabel = props.getItemLabel, getItemSubMenu = props.getItemSubMenu, style = props.style, spareDirection = props.spareDirection, _b = props.subMenuDirection, subMenuDirectionProp = _b === void 0 ? contextMenuPropDefaultSubMenuDirection : _b, otherProps = __rest(props, ["items", "anchorRef", "position", "direction", "possibleDirections", "offset", "onClickOutside", "getItemKey", "getItemLabel", "getItemSubMenu", "style", "spareDirection", "subMenuDirection"]);
|
|
13
|
+
var defaultLevels = [
|
|
14
|
+
{
|
|
15
|
+
items: items,
|
|
16
|
+
anchorRef: anchorRef,
|
|
17
|
+
position: position,
|
|
18
|
+
direction: direction,
|
|
19
|
+
possibleDirections: possibleDirections,
|
|
20
|
+
offset: offset
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
var _c = __read(useState(defaultLevels), 2), levels = _c[0], setLevels = _c[1];
|
|
24
|
+
var _d = __read(useState(subMenuDirectionProp), 2), subMenuDirection = _d[0], setSubMenuDirection = _d[1];
|
|
25
|
+
var _e = __read(useState(-1), 2), hoveredParenLevel = _e[0], setHoveredParenLevel = _e[1];
|
|
26
|
+
var levelsRefs = useRefs(levels.length);
|
|
27
|
+
var addLevel = function (_a) {
|
|
28
|
+
var level = _a.level, items = _a.items, anchorRef = _a.anchorRef, activeItem = _a.activeItem;
|
|
29
|
+
var newLevels = __spread(levels);
|
|
30
|
+
var oldDirection = newLevels[level] && newLevels.length - level > 1 ? newLevels[level].direction : undefined;
|
|
31
|
+
if (newLevels[level] && newLevels.length - level > 1 && oldDirection) {
|
|
32
|
+
setSubMenuDirection(oldDirection);
|
|
33
|
+
}
|
|
34
|
+
newLevels[level - 1].activeItem = activeItem;
|
|
35
|
+
newLevels.splice(level);
|
|
36
|
+
newLevels.push({
|
|
37
|
+
items: items,
|
|
38
|
+
anchorRef: anchorRef,
|
|
39
|
+
direction: oldDirection || subMenuDirection,
|
|
40
|
+
possibleDirections: contextMenuPropSubMenuDirections,
|
|
41
|
+
position: undefined
|
|
42
|
+
});
|
|
43
|
+
setLevels(newLevels);
|
|
44
|
+
};
|
|
45
|
+
var deleteLevel = function (level) {
|
|
46
|
+
var newLevels = __spread(levels);
|
|
47
|
+
newLevels.splice(level);
|
|
48
|
+
newLevels[level - 1] = __assign(__assign({}, newLevels[level - 1]), { activeItem: undefined });
|
|
49
|
+
setLevels(newLevels);
|
|
50
|
+
};
|
|
51
|
+
useClickOutside({
|
|
52
|
+
isActive: !!onClickOutside,
|
|
53
|
+
ignoreClicksInsideRefs: __spread(levelsRefs, [anchorRef || { current: null }]),
|
|
54
|
+
handler: function (e) { return onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e); }
|
|
55
|
+
});
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
setLevels(getLevels({
|
|
58
|
+
levels: levels,
|
|
59
|
+
items: items,
|
|
60
|
+
getItemLabel: getItemLabel,
|
|
61
|
+
getItemKey: getItemKey,
|
|
62
|
+
getItemSubMenu: getItemSubMenu
|
|
63
|
+
}));
|
|
64
|
+
}, [items]);
|
|
65
|
+
var firstLevelRef = useForkRef([levelsRefs[0], ref]);
|
|
66
|
+
return (React.createElement(React.Fragment, null, levels.map(function (level, index) {
|
|
67
|
+
var _a;
|
|
68
|
+
return (React.createElement(ContextMenuLevel, __assign({}, otherProps, level, { key: "ContextMenu-" + index, style: __assign(__assign({}, style), { zIndex: Number((_a = style === null || style === void 0 ? void 0 : style.zIndex) !== null && _a !== void 0 ? _a : 0) + index }), levelDepth: index, getItemLabel: getItemLabel, addLevel: addLevel, deleteLevel: deleteLevel, onSetDirection: index > 0 ? setSubMenuDirection : props.onSetDirection, hoveredParenLevel: hoveredParenLevel, setHoveredParenLevel: setHoveredParenLevel, getItemSubMenu: getItemSubMenu, getItemKey: getItemKey, ref: index === 0 ? firstLevelRef : levelsRefs[index], spareDirection: index === 0 ? spareDirection : 'rightStartUp' })));
|
|
69
|
+
})));
|
|
70
|
+
}
|
|
71
|
+
export var ContextMenuLevels = React.forwardRef(ContextMenuLevelsRender);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconPropSize } from '../../icons/Icon/Icon';
|
|
3
|
+
import { TextPropSize } from '../Text/Text';
|
|
4
|
+
import { ContextMenuGroupDefault, ContextMenuItemDefault, ContextMenuPropGetGroupId, ContextMenuPropGetGroupLabel, ContextMenuPropGetItemAs, ContextMenuPropGetItemAttributes, ContextMenuPropGetItemDisabled, ContextMenuPropGetItemGroupId, ContextMenuPropGetItemKey, ContextMenuPropGetItemLabel, ContextMenuPropGetItemLeftIcon, ContextMenuPropGetItemLeftSide, ContextMenuPropGetItemOnClick, ContextMenuPropGetItemRightIcon, ContextMenuPropGetItemRightSide, ContextMenuPropGetItemStatus, ContextMenuPropGetItemSubMenu, ContextMenuProps, ContextMenuPropSize, GetLevelsParams, Level, MappersGroup } from './types';
|
|
5
|
+
export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<ITEM, GROUP>): ({
|
|
6
|
+
items: ITEM[];
|
|
7
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
8
|
+
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
9
|
+
offset?: number | undefined;
|
|
10
|
+
groups?: GROUP[] | undefined;
|
|
11
|
+
sortGroup?: import("./types").ContextMenuPropSortGroup | undefined;
|
|
12
|
+
onItemClick?: import("./types").ContextMenuPropOnClick<ITEM> | undefined;
|
|
13
|
+
possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
|
|
14
|
+
subMenuDirection?: "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
15
|
+
spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
16
|
+
onSetDirection?: ((direction: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown") => void) | undefined;
|
|
17
|
+
onClickOutside?: import("../../hooks/useClickOutside/useClickOutside").ClickOutsideHandler | undefined;
|
|
18
|
+
isOpen?: boolean | undefined;
|
|
19
|
+
} & import("./types").MappersItem<ITEM> & MappersGroup<GROUP> & {
|
|
20
|
+
anchorRef: import("react").RefObject<HTMLElement>;
|
|
21
|
+
position?: undefined;
|
|
22
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
|
|
23
|
+
id: unknown;
|
|
24
|
+
} ? {} : {
|
|
25
|
+
getGroupId: ContextMenuPropGetGroupId<GROUP>;
|
|
26
|
+
}) & (ITEM extends {
|
|
27
|
+
label: import("react").ReactText;
|
|
28
|
+
} ? {} : {
|
|
29
|
+
getItemLabel: ContextMenuPropGetItemLabel<ITEM>;
|
|
30
|
+
}) & {
|
|
31
|
+
getItemKey: ContextMenuPropGetItemKey<ContextMenuItemDefault> | ContextMenuPropGetItemKey<ITEM>;
|
|
32
|
+
getItemLabel: ContextMenuPropGetItemLabel<ContextMenuItemDefault> | ContextMenuPropGetItemLabel<ITEM>;
|
|
33
|
+
getItemRightSide: ContextMenuPropGetItemRightSide<ContextMenuItemDefault> | ContextMenuPropGetItemRightSide<ITEM>;
|
|
34
|
+
getItemLeftSide: ContextMenuPropGetItemLeftSide<ContextMenuItemDefault> | ContextMenuPropGetItemLeftSide<ITEM>;
|
|
35
|
+
getItemRightIcon: ContextMenuPropGetItemRightIcon<ContextMenuItemDefault> | ContextMenuPropGetItemRightIcon<ITEM>;
|
|
36
|
+
getItemLeftIcon: ContextMenuPropGetItemLeftIcon<ContextMenuItemDefault> | ContextMenuPropGetItemLeftIcon<ITEM>;
|
|
37
|
+
getItemSubMenu: ContextMenuPropGetItemSubMenu<ContextMenuItemDefault> | ContextMenuPropGetItemSubMenu<ITEM>;
|
|
38
|
+
getItemStatus: ContextMenuPropGetItemStatus<ContextMenuItemDefault> | ContextMenuPropGetItemStatus<ITEM>;
|
|
39
|
+
getItemDisabled: ContextMenuPropGetItemDisabled<ContextMenuItemDefault> | ContextMenuPropGetItemDisabled<ITEM>;
|
|
40
|
+
getItemOnClick: ContextMenuPropGetItemOnClick<ContextMenuItemDefault> | ContextMenuPropGetItemOnClick<ITEM>;
|
|
41
|
+
getItemAs: ContextMenuPropGetItemAs<ContextMenuItemDefault> | ContextMenuPropGetItemAs<ITEM>;
|
|
42
|
+
getItemAttributes: ContextMenuPropGetItemAttributes<ContextMenuItemDefault> | ContextMenuPropGetItemAttributes<ITEM>;
|
|
43
|
+
getItemGroupId: ContextMenuPropGetItemGroupId<ContextMenuItemDefault> | ContextMenuPropGetItemGroupId<ITEM>;
|
|
44
|
+
getGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> | ContextMenuPropGetGroupId<GROUP>;
|
|
45
|
+
getGroupLabel: ContextMenuPropGetGroupLabel<ContextMenuGroupDefault> | ContextMenuPropGetGroupLabel<GROUP>;
|
|
46
|
+
}) | ({
|
|
47
|
+
items: ITEM[];
|
|
48
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
49
|
+
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
50
|
+
offset?: number | undefined;
|
|
51
|
+
groups?: GROUP[] | undefined;
|
|
52
|
+
sortGroup?: import("./types").ContextMenuPropSortGroup | undefined;
|
|
53
|
+
onItemClick?: import("./types").ContextMenuPropOnClick<ITEM> | undefined;
|
|
54
|
+
possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
|
|
55
|
+
subMenuDirection?: "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
56
|
+
spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
57
|
+
onSetDirection?: ((direction: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown") => void) | undefined;
|
|
58
|
+
onClickOutside?: import("../../hooks/useClickOutside/useClickOutside").ClickOutsideHandler | undefined;
|
|
59
|
+
isOpen?: boolean | undefined;
|
|
60
|
+
} & import("./types").MappersItem<ITEM> & MappersGroup<GROUP> & {
|
|
61
|
+
anchorRef?: undefined;
|
|
62
|
+
position: import("../Popover/Popover").Position;
|
|
63
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
|
|
64
|
+
id: unknown;
|
|
65
|
+
} ? {} : {
|
|
66
|
+
getGroupId: ContextMenuPropGetGroupId<GROUP>;
|
|
67
|
+
}) & (ITEM extends {
|
|
68
|
+
label: import("react").ReactText;
|
|
69
|
+
} ? {} : {
|
|
70
|
+
getItemLabel: ContextMenuPropGetItemLabel<ITEM>;
|
|
71
|
+
}) & {
|
|
72
|
+
getItemKey: ContextMenuPropGetItemKey<ContextMenuItemDefault> | ContextMenuPropGetItemKey<ITEM>;
|
|
73
|
+
getItemLabel: ContextMenuPropGetItemLabel<ContextMenuItemDefault> | ContextMenuPropGetItemLabel<ITEM>;
|
|
74
|
+
getItemRightSide: ContextMenuPropGetItemRightSide<ContextMenuItemDefault> | ContextMenuPropGetItemRightSide<ITEM>;
|
|
75
|
+
getItemLeftSide: ContextMenuPropGetItemLeftSide<ContextMenuItemDefault> | ContextMenuPropGetItemLeftSide<ITEM>;
|
|
76
|
+
getItemRightIcon: ContextMenuPropGetItemRightIcon<ContextMenuItemDefault> | ContextMenuPropGetItemRightIcon<ITEM>;
|
|
77
|
+
getItemLeftIcon: ContextMenuPropGetItemLeftIcon<ContextMenuItemDefault> | ContextMenuPropGetItemLeftIcon<ITEM>;
|
|
78
|
+
getItemSubMenu: ContextMenuPropGetItemSubMenu<ContextMenuItemDefault> | ContextMenuPropGetItemSubMenu<ITEM>;
|
|
79
|
+
getItemStatus: ContextMenuPropGetItemStatus<ContextMenuItemDefault> | ContextMenuPropGetItemStatus<ITEM>;
|
|
80
|
+
getItemDisabled: ContextMenuPropGetItemDisabled<ContextMenuItemDefault> | ContextMenuPropGetItemDisabled<ITEM>;
|
|
81
|
+
getItemOnClick: ContextMenuPropGetItemOnClick<ContextMenuItemDefault> | ContextMenuPropGetItemOnClick<ITEM>;
|
|
82
|
+
getItemAs: ContextMenuPropGetItemAs<ContextMenuItemDefault> | ContextMenuPropGetItemAs<ITEM>;
|
|
83
|
+
getItemAttributes: ContextMenuPropGetItemAttributes<ContextMenuItemDefault> | ContextMenuPropGetItemAttributes<ITEM>;
|
|
84
|
+
getItemGroupId: ContextMenuPropGetItemGroupId<ContextMenuItemDefault> | ContextMenuPropGetItemGroupId<ITEM>;
|
|
85
|
+
getGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> | ContextMenuPropGetGroupId<GROUP>;
|
|
86
|
+
getGroupLabel: ContextMenuPropGetGroupLabel<ContextMenuGroupDefault> | ContextMenuPropGetGroupLabel<GROUP>;
|
|
87
|
+
});
|
|
88
|
+
export declare const getGroup: <GROUP>(group: GROUP, props: Required<MappersGroup<GROUP>>) => {
|
|
89
|
+
id: number;
|
|
90
|
+
name: string | undefined;
|
|
91
|
+
};
|
|
92
|
+
export declare const getLevels: <ITEM>(params: GetLevelsParams<ITEM>) => Level<ITEM>[];
|
|
93
|
+
export declare const getItemIndex: (groupId: number | string, itemIndex: number) => string;
|
|
94
|
+
export declare const sizeMapHeader: Record<ContextMenuPropSize, TextPropSize>;
|
|
95
|
+
export declare const sizeMapIcon: Record<ContextMenuPropSize, IconPropSize>;
|