@consta/uikit 3.17.0 → 3.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/BreadcrumbsCanary/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +23 -45
- 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/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/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/ContextMenu/helpers.d.ts +3 -3
- 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/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/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/Tooltip/Tooltip.css +0 -1
- package/__internal__/src/components/ContextMenu/helpers.d.ts +3 -3
- 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/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/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/Tooltip/Tooltip.css +0 -1
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +1 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useHideElementsInLine/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useRefs/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useSortSteps/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
package/Select/package.json
CHANGED
package/Sidebar/package.json
CHANGED
package/Skeleton/package.json
CHANGED
package/SnackBar/package.json
CHANGED
package/Steps/package.json
CHANGED
package/Switch/package.json
CHANGED
package/SwitchGroup/package.json
CHANGED
package/Table/package.json
CHANGED
package/Tabs/package.json
CHANGED
package/Tag/package.json
CHANGED
package/TagBase/package.json
CHANGED
package/Text/package.json
CHANGED
package/TextField/package.json
CHANGED
package/Theme/package.json
CHANGED
package/Timer/package.json
CHANGED
package/Tooltip/package.json
CHANGED
package/User/package.json
CHANGED
package/UserSelect/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
|
|
3
3
|
import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
|
|
4
4
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
5
|
-
import { Direction, Position } from '../Popover/Popover';
|
|
5
|
+
import { Direction, PopoverPropOffset, Position } from '../Popover/Popover';
|
|
6
6
|
export declare const contextMenuSizes: readonly ["m", "s", "l"];
|
|
7
7
|
export declare type ContextMenuPropSize = typeof contextMenuSizes[number];
|
|
8
8
|
export declare const contextMenuDefaultSize: ContextMenuPropSize;
|
|
@@ -48,7 +48,7 @@ export declare type ContextMenuProps<ITEM> = PropsWithHTMLAttributesAndRef<{
|
|
|
48
48
|
subMenuDirection?: ContextMenuPropSubMenuDirection;
|
|
49
49
|
getKey?: ContextMenuPropGetKey<ITEM>;
|
|
50
50
|
getDisabled?: ContextMenuPropGetDisable<ITEM>;
|
|
51
|
-
offset?:
|
|
51
|
+
offset?: PopoverPropOffset;
|
|
52
52
|
onItemClick?: (props: {
|
|
53
53
|
e: React.MouseEvent;
|
|
54
54
|
item: ITEM;
|
|
@@ -85,7 +85,7 @@ export declare type Level<ITEM> = {
|
|
|
85
85
|
activeItem?: string;
|
|
86
86
|
direction?: Direction;
|
|
87
87
|
possibleDirections?: readonly Direction[];
|
|
88
|
-
offset?:
|
|
88
|
+
offset?: PopoverPropOffset;
|
|
89
89
|
} & PositioningProps;
|
|
90
90
|
export declare type ContextMenuItemComponent = <AS extends keyof JSX.IntrinsicElements = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
|
|
91
91
|
export declare type ContextMenuComponent = <ITEM>(props: ContextMenuProps<ITEM>) => React.ReactElement | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './Popover.css';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
|
|
3
4
|
import { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';
|
|
@@ -9,6 +10,8 @@ export { usePopoverReposition };
|
|
|
9
10
|
*/
|
|
10
11
|
export declare const directionsStartCenter: readonly ["downCenter", "upCenter", "downRight", "downLeft", "upRight", "upLeft", "leftUp", "leftCenter", "leftDown", "rightUp", "rightCenter", "rightDown"];
|
|
11
12
|
export declare const directionsStartEdge: readonly ["downStartLeft", "upStartLeft", "downStartRight", "upStartRight", "leftStartUp", "leftStartDown", "rightStartUp", "rightStartDown"];
|
|
13
|
+
export declare const popoverPropOffset: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"];
|
|
14
|
+
export declare type PopoverPropOffset = typeof popoverPropOffset[number] | number;
|
|
12
15
|
export declare const directions: ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[];
|
|
13
16
|
export declare type Direction = typeof directions[number];
|
|
14
17
|
export declare type Position = {
|
|
@@ -28,7 +31,7 @@ declare type ChildrenRenderProp = (direction: Direction) => React.ReactNode;
|
|
|
28
31
|
export declare type Props = PropsWithJsxAttributes<{
|
|
29
32
|
direction?: Direction;
|
|
30
33
|
spareDirection?: Direction;
|
|
31
|
-
offset?:
|
|
34
|
+
offset?: PopoverPropOffset;
|
|
32
35
|
arrowOffset?: number;
|
|
33
36
|
possibleDirections?: readonly Direction[];
|
|
34
37
|
isInteractive?: boolean;
|
|
@@ -39,7 +42,7 @@ export declare type Props = PropsWithJsxAttributes<{
|
|
|
39
42
|
export declare const Popover: React.ForwardRefExoticComponent<Pick<Pick<({
|
|
40
43
|
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
41
44
|
spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
42
|
-
offset?: number | undefined;
|
|
45
|
+
offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
|
|
43
46
|
arrowOffset?: number | undefined;
|
|
44
47
|
possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
|
|
45
48
|
isInteractive?: boolean | undefined;
|
|
@@ -53,7 +56,7 @@ export declare const Popover: React.ForwardRefExoticComponent<Pick<Pick<({
|
|
|
53
56
|
} & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "css" | "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" | "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" | "ref" | "key">) | ({
|
|
54
57
|
direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
55
58
|
spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
|
|
56
|
-
offset?: number | undefined;
|
|
59
|
+
offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
|
|
57
60
|
arrowOffset?: number | undefined;
|
|
58
61
|
possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
|
|
59
62
|
isInteractive?: boolean | undefined;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.Popover = exports.directions = exports.directionsStartEdge = exports.directionsStartCenter = exports.usePopoverReposition = void 0;
|
|
3
|
+
exports.Popover = exports.directions = exports.popoverPropOffset = exports.directionsStartEdge = exports.directionsStartCenter = exports.usePopoverReposition = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
+
require("./Popover.css");
|
|
5
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
7
|
var useClickOutside_1 = require("../../hooks/useClickOutside/useClickOutside");
|
|
7
8
|
var useComponentSize_1 = require("../../hooks/useComponentSize/useComponentSize");
|
|
8
9
|
var useForkRef_1 = require("../../hooks/useForkRef/useForkRef");
|
|
10
|
+
var useThemeVars_1 = require("../../hooks/useThemeVars/useThemeVars");
|
|
11
|
+
var bem_1 = require("../../utils/bem");
|
|
9
12
|
var PortalWithTheme_1 = require("../PortalWithTheme/PortalWithTheme");
|
|
10
13
|
var Theme_1 = require("../Theme/Theme");
|
|
11
14
|
var helpers_1 = require("./helpers");
|
|
@@ -39,6 +42,20 @@ exports.directionsStartEdge = [
|
|
|
39
42
|
'rightStartUp',
|
|
40
43
|
'rightStartDown',
|
|
41
44
|
];
|
|
45
|
+
exports.popoverPropOffset = [
|
|
46
|
+
'3xs',
|
|
47
|
+
'2xs',
|
|
48
|
+
'xs',
|
|
49
|
+
's',
|
|
50
|
+
'm',
|
|
51
|
+
'l',
|
|
52
|
+
'xl',
|
|
53
|
+
'2xl',
|
|
54
|
+
'3xl',
|
|
55
|
+
'4xl',
|
|
56
|
+
'5xl',
|
|
57
|
+
'6xl',
|
|
58
|
+
];
|
|
42
59
|
exports.directions = tslib_1.__spread(exports.directionsStartCenter, exports.directionsStartEdge);
|
|
43
60
|
var isRenderProp = function (children) { return typeof children === 'function'; };
|
|
44
61
|
/**
|
|
@@ -56,20 +73,23 @@ var ContextConsumer = function (_a) {
|
|
|
56
73
|
});
|
|
57
74
|
return react_1["default"].createElement(react_1["default"].Fragment, null, children);
|
|
58
75
|
};
|
|
76
|
+
var cnPopover = bem_1.cn('Popover');
|
|
59
77
|
exports.Popover = react_1["default"].forwardRef(function (props, componentRef) {
|
|
60
|
-
var
|
|
78
|
+
var _a;
|
|
79
|
+
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 ? exports.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 = tslib_1.__rest(props, ["children", "direction", "offset", "arrowOffset", "possibleDirections", "isInteractive", "onClickOutside", "spareDirection", "style", "className", "position", "anchorRef", "equalAnchorWidth", "onSetDirection"]);
|
|
61
80
|
var ref = react_1["default"].useRef(null);
|
|
62
81
|
var theme = Theme_1.useTheme().theme;
|
|
63
|
-
var
|
|
64
|
-
var
|
|
82
|
+
var _g = tslib_1.__read(react_1["default"].useState(), 2), anchorClientRect = _g[0], setAnchorClientRect = _g[1];
|
|
83
|
+
var _h = useComponentSize_1.useComponentSize(ref), width = _h.width, height = _h.height;
|
|
65
84
|
var anchorSize = useComponentSize_1.useComponentSize(anchorRef || { current: null });
|
|
66
85
|
var previousDirectionRef = react_1["default"].useRef(null);
|
|
67
86
|
var previousDirection = previousDirectionRef.current;
|
|
68
|
-
var
|
|
87
|
+
var _j = tslib_1.__read(react_1["default"].useState([]), 2), bannedDirections = _j[0], setBannedDirections = _j[1];
|
|
69
88
|
var resetBannedDirections = function () {
|
|
70
89
|
setBannedDirections(function (state) { return (state.length ? [] : state); });
|
|
71
90
|
previousDirectionRef.current = null;
|
|
72
91
|
};
|
|
92
|
+
var vars = useThemeVars_1.useThemeVars();
|
|
73
93
|
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()); };
|
|
74
94
|
react_1["default"].useLayoutEffect(updateAnchorClientRect, [anchorSize]);
|
|
75
95
|
usePopoverReposition_1.usePopoverReposition({
|
|
@@ -80,14 +100,16 @@ exports.Popover = react_1["default"].forwardRef(function (props, componentRef) {
|
|
|
80
100
|
updateAnchorClientRect();
|
|
81
101
|
}
|
|
82
102
|
});
|
|
83
|
-
var
|
|
103
|
+
var _k = helpers_1.getComputedPositionAndDirection({
|
|
84
104
|
contentSize: { width: width, height: height },
|
|
85
105
|
viewportSize: {
|
|
86
106
|
// Размер вьюпорта без скроллбаров
|
|
87
107
|
width: document.documentElement.clientWidth,
|
|
88
108
|
height: document.documentElement.clientHeight
|
|
89
109
|
},
|
|
90
|
-
offset: offset
|
|
110
|
+
offset: typeof offset === 'string'
|
|
111
|
+
? vars.space["--space-" + offset]
|
|
112
|
+
: offset,
|
|
91
113
|
arrowOffset: arrowOffset,
|
|
92
114
|
direction: passedDirection,
|
|
93
115
|
possibleDirections: possibleDirections,
|
|
@@ -97,7 +119,7 @@ exports.Popover = react_1["default"].forwardRef(function (props, componentRef) {
|
|
|
97
119
|
: passedPosition,
|
|
98
120
|
anchorSize: anchorSize,
|
|
99
121
|
spareDirection: spareDirection
|
|
100
|
-
}), position =
|
|
122
|
+
}), position = _k.position, direction = _k.direction;
|
|
101
123
|
react_1.useEffect(function () { return onSetDirection && onSetDirection(direction); }, [direction]);
|
|
102
124
|
/**
|
|
103
125
|
* Может возникнуть ситуация, когда перерасчет поповера всегда будет выдавать 2 направления
|
|
@@ -115,6 +137,6 @@ exports.Popover = react_1["default"].forwardRef(function (props, componentRef) {
|
|
|
115
137
|
// Главное не сбрасывать при изменении размеров поповера, т.к. именно оно может вызвать бесконечный перебор
|
|
116
138
|
react_1["default"].useLayoutEffect(resetBannedDirections, [props]);
|
|
117
139
|
var content = isRenderProp(children) ? children(direction) : children;
|
|
118
|
-
return (react_1["default"].createElement(PortalWithTheme_1.PortalWithTheme, tslib_1.__assign({}, otherProps, { preset: theme, container: window.document.body, ref: useForkRef_1.useForkRef([ref, componentRef]), style: tslib_1.__assign(tslib_1.__assign(
|
|
140
|
+
return (react_1["default"].createElement(PortalWithTheme_1.PortalWithTheme, tslib_1.__assign({}, otherProps, { preset: theme, className: cnPopover(null, [className]), container: window.document.body, ref: useForkRef_1.useForkRef([ref, componentRef]), style: tslib_1.__assign(tslib_1.__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)) }),
|
|
119
141
|
react_1["default"].createElement(ContextConsumer, { onClickOutside: onClickOutside, ignoreClicksInsideRefs: [ref, anchorRef || { current: null }] }, content)));
|
|
120
142
|
});
|
|
@@ -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;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.getComputedPositionAndDirection = exports.getPositionsByDirection = void 0;
|
|
3
|
+
exports.getComputedPositionAndDirection = exports.getPositionsByDirection = exports.convertPixelsToNumber = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var getPosition = function (x, y) { return ({
|
|
6
6
|
x: Math.round(x),
|
|
7
7
|
y: Math.round(y)
|
|
8
8
|
}); };
|
|
9
|
+
exports.convertPixelsToNumber = function (pixels) {
|
|
10
|
+
return Number(pixels.slice(0, pixels.length - 2));
|
|
11
|
+
};
|
|
9
12
|
exports.getPositionsByDirection = function (_a) {
|
|
10
13
|
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;
|
|
11
14
|
var contentWidth = contentSize.width, contentHeight = contentSize.height;
|
|
@@ -56,15 +59,16 @@ exports.getPositionsByDirection = function (_a) {
|
|
|
56
59
|
};
|
|
57
60
|
};
|
|
58
61
|
exports.getComputedPositionAndDirection = function (_a) {
|
|
59
|
-
var initialPosition = _a.position, contentSize = _a.contentSize, viewportSize = _a.viewportSize, _b = _a.anchorSize, anchorSize = _b === void 0 ? { width: 0, height: 0 } : _b,
|
|
62
|
+
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;
|
|
60
63
|
if (!initialPosition) {
|
|
61
64
|
return { position: initialPosition, direction: initialDirection };
|
|
62
65
|
}
|
|
66
|
+
var currentOffset = typeof offset === 'string' ? exports.convertPixelsToNumber(offset) : offset;
|
|
63
67
|
var positionsByDirection = exports.getPositionsByDirection({
|
|
64
68
|
contentSize: contentSize,
|
|
65
69
|
anchorSize: anchorSize,
|
|
66
70
|
position: initialPosition,
|
|
67
|
-
offset:
|
|
71
|
+
offset: currentOffset,
|
|
68
72
|
arrowOffset: arrowOffset
|
|
69
73
|
});
|
|
70
74
|
var direction = tslib_1.__spread([initialDirection], possibleDirections).filter(function (dir) { return !bannedDirections.includes(dir); })
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.Sidebar:not(.Sidebar_hasOverlay) {
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
.Sidebar_position_top {
|
|
23
27
|
-webkit-box-orient: vertical;
|
|
24
28
|
-webkit-box-direction: normal;
|
|
@@ -65,6 +69,7 @@
|
|
|
65
69
|
background-color: var(--color-bg-default);
|
|
66
70
|
-webkit-box-shadow: var(--shadow-modal);
|
|
67
71
|
box-shadow: var(--shadow-modal);
|
|
72
|
+
pointer-events: auto;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
.Sidebar-Window_position_right,
|
|
@@ -50,7 +50,7 @@ exports.Sidebar = function (props) {
|
|
|
50
50
|
useGlobalKeys_1.useGlobalKeys({
|
|
51
51
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
52
52
|
});
|
|
53
|
-
return (react_1["default"].createElement(react_transition_group_1.CSSTransition, { "in": isOpen, unmountOnExit: true, className: exports.cnSidebar({ position: position }), classNames: cnForCssTransition_1.cnForCssTransition(exports.cnSidebar), timeout: 200, nodeRef: portalRef },
|
|
53
|
+
return (react_1["default"].createElement(react_transition_group_1.CSSTransition, { "in": isOpen, unmountOnExit: true, className: exports.cnSidebar({ position: position, hasOverlay: hasOverlay }), classNames: cnForCssTransition_1.cnForCssTransition(exports.cnSidebar), timeout: 200, nodeRef: portalRef },
|
|
54
54
|
react_1["default"].createElement(PortalWithTheme_1.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 },
|
|
55
55
|
hasOverlay && react_1["default"].createElement("div", { className: exports.cnSidebar('Overlay'), "aria-label": "Overlay" }),
|
|
56
56
|
react_1["default"].createElement("div", tslib_1.__assign({}, otherProps, { style: tslib_1.__assign(tslib_1.__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: exports.cnSidebar('Window', { size: size, position: position }, [className]), ref: ref }),
|
|
@@ -93,13 +93,13 @@ export declare type TableColumn<T extends TableRow> = {
|
|
|
93
93
|
export declare type TableProps<T extends TableRow> = {
|
|
94
94
|
columns: TableColumn<T>[];
|
|
95
95
|
rows: T[];
|
|
96
|
+
isResizable?: boolean;
|
|
96
97
|
filters?: Filters<T>;
|
|
97
98
|
onSortBy?: onSortBy<T>;
|
|
98
99
|
size?: Size;
|
|
99
100
|
stickyHeader?: boolean;
|
|
100
101
|
stickyColumns?: number;
|
|
101
102
|
minColumnWidth?: number;
|
|
102
|
-
isResizable?: boolean;
|
|
103
103
|
activeRow?: ActiveRow;
|
|
104
104
|
verticalAlign?: VerticalAlign;
|
|
105
105
|
headerVerticalAlign?: HeaderVerticalAlign;
|