@consta/uikit 3.7.0 → 3.8.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/Button/package.json +1 -1
- package/CHANGELOG.md +16 -11
- 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/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/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/IconPlay/package.json +1 -1
- package/IconPressure/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/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/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/IconTarget/package.json +1 -1
- package/IconTeam/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/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/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/es.js +1 -0
- package/ProgressStepBarCanary/index.d.ts +1 -0
- package/ProgressStepBarCanary/index.js +4 -0
- package/ProgressStepBarCanary/package.json +9 -0
- 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/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/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/Modal/Modal.css +5 -0
- package/__internal__/cjs-src/components/Modal/Modal.js +1 -1
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +72 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +67 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +50 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +45 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.d.ts +106 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.js +30 -0
- package/__internal__/src/components/Modal/Modal.css +5 -0
- package/__internal__/src/components/Modal/Modal.js +1 -1
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +69 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +64 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +50 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +42 -0
- package/__internal__/src/components/ProgressStepBarCanary/helpers.d.ts +106 -0
- package/__internal__/src/components/ProgressStepBarCanary/helpers.js +26 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +2 -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/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/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,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../icons/Icon/Icon';
|
|
3
|
+
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
export declare const propSize: readonly ["s", "xs", "m"];
|
|
5
|
+
export declare type PropSize = typeof propSize[number];
|
|
6
|
+
export declare const propSizeDefault: "s";
|
|
7
|
+
export declare const propDirection: readonly ["horizontal", "vertical"];
|
|
8
|
+
export declare type PropDirection = typeof propDirection[number];
|
|
9
|
+
export declare const propDirectionDefault: "horizontal";
|
|
10
|
+
export declare const propStatus: readonly ["normal", "success", "warning", "alert"];
|
|
11
|
+
export declare type PropStatus = typeof propStatus[number];
|
|
12
|
+
export declare const propStatusDefault: "normal";
|
|
13
|
+
export declare const pointNumbersMap: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
14
|
+
export declare type PointNumbersMap = typeof pointNumbersMap[number];
|
|
15
|
+
export declare const propPosition: readonly ["center", "start", "end"];
|
|
16
|
+
export declare type PropPosition = typeof propPosition[number];
|
|
17
|
+
export declare const propPositionDefault: PropPosition;
|
|
18
|
+
export declare type PropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
19
|
+
export declare type PropGetItemKey<ITEM> = (item: ITEM) => string | number;
|
|
20
|
+
export declare type PropGetItemTooltipContent<ITEM> = (item: ITEM) => string | undefined;
|
|
21
|
+
export declare type PropGetItemLineStatus<ITEM> = (item: ITEM) => PropStatus | undefined;
|
|
22
|
+
export declare type PropGetItemPoint<ITEM> = (item: ITEM) => PointNumbersMap | React.FC<IconProps> | undefined;
|
|
23
|
+
export declare type PropGetItemProgress<ITEM> = (item: ITEM) => boolean | undefined;
|
|
24
|
+
export declare type PropGetItemContent<ITEM> = (item: ITEM) => React.ReactNode | undefined;
|
|
25
|
+
export declare type PropGetItemStatus<ITEM> = (item: ITEM) => PropStatus | 'system' | undefined;
|
|
26
|
+
export declare type PropGetItemOnCLick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
|
|
27
|
+
export declare type DefaultItem = {
|
|
28
|
+
label: string;
|
|
29
|
+
tooltipContent?: string;
|
|
30
|
+
lineStatus?: PropStatus;
|
|
31
|
+
point?: PointNumbersMap | React.FC<IconProps>;
|
|
32
|
+
status?: PropStatus | 'system';
|
|
33
|
+
progress?: boolean;
|
|
34
|
+
content?: React.ReactNode;
|
|
35
|
+
};
|
|
36
|
+
export declare type Line = {
|
|
37
|
+
status: PropStatus;
|
|
38
|
+
size: number;
|
|
39
|
+
};
|
|
40
|
+
export declare type ProgressStepBarProps<ITEM = DefaultItem> = PropsWithHTMLAttributesAndRef<{
|
|
41
|
+
steps: ITEM[];
|
|
42
|
+
direction?: PropDirection;
|
|
43
|
+
size?: PropSize;
|
|
44
|
+
activeStepIndex?: number;
|
|
45
|
+
onClick?: (e: React.MouseEvent, item: ITEM, index: number) => void;
|
|
46
|
+
getItemLabel?: PropGetItemLabel<ITEM>;
|
|
47
|
+
getItemLineStatus?: PropGetItemLineStatus<ITEM>;
|
|
48
|
+
getItemTooltipContent?: PropGetItemTooltipContent<ITEM>;
|
|
49
|
+
getItemPoint?: PropGetItemPoint<ITEM>;
|
|
50
|
+
getItemProgress?: PropGetItemProgress<ITEM>;
|
|
51
|
+
getItemContent?: PropGetItemContent<ITEM>;
|
|
52
|
+
getItemStatus?: PropGetItemStatus<ITEM>;
|
|
53
|
+
}, HTMLDivElement> & (ITEM extends {
|
|
54
|
+
label: DefaultItem['label'];
|
|
55
|
+
} ? {} : {
|
|
56
|
+
getItemLabel: PropGetItemLabel<ITEM>;
|
|
57
|
+
});
|
|
58
|
+
export declare type ProgressStepBarItemProps = {
|
|
59
|
+
content?: React.ReactNode;
|
|
60
|
+
label: string;
|
|
61
|
+
point?: PointNumbersMap | React.FC<IconProps>;
|
|
62
|
+
progress?: boolean;
|
|
63
|
+
status?: PropStatus | 'system';
|
|
64
|
+
tooltipContent?: string;
|
|
65
|
+
position?: PropPosition;
|
|
66
|
+
direction: PropDirection;
|
|
67
|
+
size: PropSize;
|
|
68
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
69
|
+
pointRef?: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLDivElement>;
|
|
70
|
+
};
|
|
71
|
+
export declare const cnProgressStepBar: import("@bem-react/classname").ClassNameFormatter;
|
|
72
|
+
export declare const defaultGetItemLabel: PropGetItemLabel<DefaultItem>;
|
|
73
|
+
export declare const defaultGetItemTooltipContent: PropGetItemTooltipContent<DefaultItem>;
|
|
74
|
+
export declare const defaultGetItemPoint: PropGetItemPoint<DefaultItem>;
|
|
75
|
+
export declare const defaultGetItemLineStatus: PropGetItemLineStatus<DefaultItem>;
|
|
76
|
+
export declare const defaultGetItemProgress: PropGetItemProgress<DefaultItem>;
|
|
77
|
+
export declare const defaultGetItemContent: PropGetItemContent<DefaultItem>;
|
|
78
|
+
export declare const defaultGetItemStatus: PropGetItemStatus<DefaultItem>;
|
|
79
|
+
export declare type ProgressStepBarComponent = <ITEM = DefaultItem>(props: ProgressStepBarProps<ITEM>) => React.ReactElement | null;
|
|
80
|
+
export declare type ProgressStepBarItemComponent = (props: ProgressStepBarItemProps) => React.ReactElement | null;
|
|
81
|
+
export declare function withDefaultGetters<ITEM>(props: ProgressStepBarProps<ITEM>): {
|
|
82
|
+
steps: ITEM[];
|
|
83
|
+
direction?: "horizontal" | "vertical" | undefined;
|
|
84
|
+
size?: "xs" | "s" | "m" | undefined;
|
|
85
|
+
activeStepIndex?: number | undefined;
|
|
86
|
+
onClick?: ((e: React.MouseEvent<Element, MouseEvent>, item: ITEM, index: number) => void) | undefined;
|
|
87
|
+
getItemLabel?: PropGetItemLabel<ITEM> | undefined;
|
|
88
|
+
getItemLineStatus?: PropGetItemLineStatus<ITEM> | undefined;
|
|
89
|
+
getItemTooltipContent?: PropGetItemTooltipContent<ITEM> | undefined;
|
|
90
|
+
getItemPoint?: PropGetItemPoint<ITEM> | undefined;
|
|
91
|
+
getItemProgress?: PropGetItemProgress<ITEM> | undefined;
|
|
92
|
+
getItemContent?: PropGetItemContent<ITEM> | undefined;
|
|
93
|
+
getItemStatus?: PropGetItemStatus<ITEM> | undefined;
|
|
94
|
+
} & Pick<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" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
95
|
+
label: string;
|
|
96
|
+
} ? {} : {
|
|
97
|
+
getItemLabel: PropGetItemLabel<ITEM>;
|
|
98
|
+
}) & {
|
|
99
|
+
getItemLabel: PropGetItemLabel<DefaultItem> | PropGetItemLabel<ITEM>;
|
|
100
|
+
getItemTooltipContent: PropGetItemTooltipContent<DefaultItem> | PropGetItemTooltipContent<ITEM>;
|
|
101
|
+
getItemPoint: PropGetItemPoint<DefaultItem> | PropGetItemPoint<ITEM>;
|
|
102
|
+
getItemProgress: PropGetItemProgress<DefaultItem> | PropGetItemProgress<ITEM>;
|
|
103
|
+
getItemContent: PropGetItemContent<DefaultItem> | PropGetItemContent<ITEM>;
|
|
104
|
+
getItemStatus: PropGetItemStatus<DefaultItem> | PropGetItemStatus<ITEM>;
|
|
105
|
+
getItemLineStatus: PropGetItemLineStatus<DefaultItem> | PropGetItemLineStatus<ITEM>;
|
|
106
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.withDefaultGetters = exports.defaultGetItemStatus = exports.defaultGetItemContent = exports.defaultGetItemProgress = exports.defaultGetItemLineStatus = exports.defaultGetItemPoint = exports.defaultGetItemTooltipContent = exports.defaultGetItemLabel = exports.cnProgressStepBar = exports.propPositionDefault = exports.propPosition = exports.pointNumbersMap = exports.propStatusDefault = exports.propStatus = exports.propDirectionDefault = exports.propDirection = exports.propSizeDefault = exports.propSize = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var bem_1 = require("../../utils/bem");
|
|
6
|
+
exports.propSize = ['s', 'xs', 'm'];
|
|
7
|
+
exports.propSizeDefault = exports.propSize[0];
|
|
8
|
+
exports.propDirection = ['horizontal', 'vertical'];
|
|
9
|
+
exports.propDirectionDefault = exports.propDirection[0];
|
|
10
|
+
exports.propStatus = ['normal', 'success', 'warning', 'alert'];
|
|
11
|
+
exports.propStatusDefault = exports.propStatus[0];
|
|
12
|
+
exports.pointNumbersMap = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
13
|
+
exports.propPosition = ['center', 'start', 'end'];
|
|
14
|
+
exports.propPositionDefault = exports.propPosition[0];
|
|
15
|
+
exports.cnProgressStepBar = bem_1.cn('ProgressStepBar');
|
|
16
|
+
exports.defaultGetItemLabel = function (item) { return item.label; };
|
|
17
|
+
exports.defaultGetItemTooltipContent = function (item) {
|
|
18
|
+
return item.tooltipContent;
|
|
19
|
+
};
|
|
20
|
+
exports.defaultGetItemPoint = function (item) { return item.point; };
|
|
21
|
+
exports.defaultGetItemLineStatus = function (item) {
|
|
22
|
+
return item.lineStatus;
|
|
23
|
+
};
|
|
24
|
+
exports.defaultGetItemProgress = function (item) { return item.progress; };
|
|
25
|
+
exports.defaultGetItemContent = function (item) { return item.content; };
|
|
26
|
+
exports.defaultGetItemStatus = function (item) { return item.status; };
|
|
27
|
+
function withDefaultGetters(props) {
|
|
28
|
+
return tslib_1.__assign(tslib_1.__assign({}, props), { getItemLabel: props.getItemLabel || exports.defaultGetItemLabel, getItemTooltipContent: props.getItemTooltipContent || exports.defaultGetItemTooltipContent, getItemPoint: props.getItemPoint || exports.defaultGetItemPoint, getItemProgress: props.getItemProgress || exports.defaultGetItemProgress, getItemContent: props.getItemContent || exports.defaultGetItemContent, getItemStatus: props.getItemStatus || exports.defaultGetItemStatus, getItemLineStatus: props.getItemLineStatus || exports.defaultGetItemLineStatus });
|
|
29
|
+
}
|
|
30
|
+
exports.withDefaultGetters = withDefaultGetters;
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
padding: var(--space-5xl);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.Modal:not(.Modal_hasOverlay) {
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.Modal-Window {
|
|
17
21
|
z-index: 100;
|
|
18
22
|
overflow: auto;
|
|
@@ -24,6 +28,7 @@
|
|
|
24
28
|
border-radius: var(--control-radius);
|
|
25
29
|
-webkit-box-shadow: var(--shadow-modal);
|
|
26
30
|
box-shadow: var(--shadow-modal);
|
|
31
|
+
pointer-events: auto;
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
.Modal-Window_position_center {
|
|
@@ -45,7 +45,7 @@ export var Modal = function (props) {
|
|
|
45
45
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
46
46
|
});
|
|
47
47
|
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition(cnModal), timeout: 200, nodeRef: portalRef },
|
|
48
|
-
React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal(
|
|
48
|
+
React.createElement(PortalWithTheme, { preset: theme, container: container, className: cnModal({ hasOverlay: hasOverlay }, [rootClassName]), ref: portalRef },
|
|
49
49
|
hasOverlay && React.createElement("div", { className: cnModal('Overlay'), "aria-label": "Overlay" }),
|
|
50
50
|
React.createElement("div", __assign({ className: cnModal('Window', { width: width, position: position }, [className]), ref: ref }, rest),
|
|
51
51
|
React.createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: __spread((refsForExcludeClickOutside || []), [ref]) }, children)))));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.ProgressStepBar {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: -webkit-inline-box;
|
|
4
|
+
display: -ms-inline-flexbox;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
-webkit-box-pack: justify;
|
|
7
|
+
-ms-flex-pack: justify;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ProgressStepBar_direction_horizontal {
|
|
12
|
+
-webkit-box-orient: horizontal;
|
|
13
|
+
-webkit-box-direction: normal;
|
|
14
|
+
-ms-flex-direction: row;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ProgressStepBar_direction_vertical {
|
|
20
|
+
-webkit-box-orient: vertical;
|
|
21
|
+
-webkit-box-direction: normal;
|
|
22
|
+
-ms-flex-direction: column;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import './ProgressStepBar.css';
|
|
3
|
+
import React, { createRef, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { useComponentSize } from '../../hooks/useComponentSize/useComponentSize';
|
|
5
|
+
import { useForkRef } from '../../hooks/useForkRef/useForkRef';
|
|
6
|
+
import { ProgressStepBarItem } from './ProgressStepBarItem/ProgressStepBarItem';
|
|
7
|
+
import { ProgressStepBarLine } from './ProgressStepBarLine/ProgressStepBarLine';
|
|
8
|
+
import { cnProgressStepBar, propDirectionDefault, propSizeDefault, withDefaultGetters, } from './helpers';
|
|
9
|
+
function ProgressStepBarRender(props, ref) {
|
|
10
|
+
var _a = withDefaultGetters(props), _b = _a.steps, steps = _b === void 0 ? [] : _b, _c = _a.direction, direction = _c === void 0 ? propDirectionDefault : _c, _d = _a.size, size = _d === void 0 ? propSizeDefault : _d, className = _a.className, activeStepIndex = _a.activeStepIndex, onClick = _a.onClick, getItemContent = _a.getItemContent, getItemLabel = _a.getItemLabel, getItemPoint = _a.getItemPoint, getItemProgress = _a.getItemProgress, getItemStatus = _a.getItemStatus, getItemTooltipContent = _a.getItemTooltipContent, getItemLineStatus = _a.getItemLineStatus, otherProps = __rest(_a, ["steps", "direction", "size", "className", "activeStepIndex", "onClick", "getItemContent", "getItemLabel", "getItemPoint", "getItemProgress", "getItemStatus", "getItemTooltipContent", "getItemLineStatus"]);
|
|
11
|
+
var _e = __read(useState([]), 2), lines = _e[0], setLines = _e[1];
|
|
12
|
+
var containerRef = useRef(null);
|
|
13
|
+
var _f = useComponentSize(containerRef), width = _f.width, height = _f.height;
|
|
14
|
+
useEffect(function () {
|
|
15
|
+
if (steps.length > 0) {
|
|
16
|
+
var linesArray_1 = [];
|
|
17
|
+
steps.forEach(function (step, index) {
|
|
18
|
+
if (index !== steps.length - 1)
|
|
19
|
+
linesArray_1.push({
|
|
20
|
+
status: getItemLineStatus(step) || 'normal',
|
|
21
|
+
size: getLineSize(containerRef, stepsRef[index + 1])
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
setLines(linesArray_1);
|
|
25
|
+
}
|
|
26
|
+
}, [activeStepIndex, steps, direction, size, width, height]);
|
|
27
|
+
var stepsRef = useMemo(function () { return new Array(steps.length).fill(null).map(function () { return createRef(); }); }, [steps.length]);
|
|
28
|
+
var getLineSize = function (container, activeElement) {
|
|
29
|
+
var size = 0;
|
|
30
|
+
if (container && container.current && activeElement && activeElement.current) {
|
|
31
|
+
var containerPosition = container.current.getBoundingClientRect();
|
|
32
|
+
var activeElementPosition = activeElement.current.getBoundingClientRect();
|
|
33
|
+
if (direction === 'vertical')
|
|
34
|
+
size = activeElementPosition.y - containerPosition.y + activeElementPosition.height;
|
|
35
|
+
else
|
|
36
|
+
size = activeElementPosition.x - containerPosition.x;
|
|
37
|
+
}
|
|
38
|
+
return size;
|
|
39
|
+
};
|
|
40
|
+
var getStepItem = function (item, index) {
|
|
41
|
+
var position = 'center';
|
|
42
|
+
if (index === steps.length - 1)
|
|
43
|
+
position = 'end';
|
|
44
|
+
if (index === 0)
|
|
45
|
+
position = 'start';
|
|
46
|
+
return {
|
|
47
|
+
content: getItemContent(item),
|
|
48
|
+
label: getItemLabel(item),
|
|
49
|
+
point: getItemPoint(item),
|
|
50
|
+
progress: getItemProgress(item),
|
|
51
|
+
status: typeof activeStepIndex === 'number' && activeStepIndex >= index
|
|
52
|
+
? getItemStatus(item)
|
|
53
|
+
: 'system',
|
|
54
|
+
tooltipContent: getItemTooltipContent(item),
|
|
55
|
+
size: size,
|
|
56
|
+
position: position,
|
|
57
|
+
pointRef: stepsRef[index],
|
|
58
|
+
direction: direction,
|
|
59
|
+
onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e, item, index); }
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
return (React.createElement("div", __assign({ ref: useForkRef([ref, containerRef]) }, otherProps, { className: cnProgressStepBar({ direction: direction }, [className]) }),
|
|
63
|
+
React.createElement(ProgressStepBarLine, { lines: lines, size: size, direction: direction, activeStepIndex: activeStepIndex }),
|
|
64
|
+
steps.map(function (step, index) {
|
|
65
|
+
var item = getStepItem(step, index);
|
|
66
|
+
return React.createElement(ProgressStepBarItem, __assign({}, item));
|
|
67
|
+
})));
|
|
68
|
+
}
|
|
69
|
+
export var ProgressStepBar = forwardRef(ProgressStepBarRender);
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
.ProgressStepBarItem {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: -webkit-inline-box;
|
|
4
|
+
display: -ms-inline-flexbox;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
-webkit-box-align: start;
|
|
7
|
+
-ms-flex-align: start;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ProgressStepBarItem_direction_horizontal {
|
|
14
|
+
-webkit-box-orient: vertical;
|
|
15
|
+
-webkit-box-direction: normal;
|
|
16
|
+
-ms-flex-direction: column;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_xs {
|
|
21
|
+
margin-bottom: var(--space-2xs);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_s,
|
|
25
|
+
.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_m {
|
|
26
|
+
margin-bottom: var(--space-xs);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ProgressStepBarItem_direction_vertical {
|
|
30
|
+
-webkit-box-orient: horizontal;
|
|
31
|
+
-webkit-box-direction: normal;
|
|
32
|
+
-ms-flex-direction: row;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Point {
|
|
37
|
+
margin-right: var(--space-xs);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Content_size_xs {
|
|
41
|
+
margin-top: -4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ProgressStepBarItem_size_xs {
|
|
45
|
+
--progress-step-bar-item-point-size: var(--space-xs);
|
|
46
|
+
--progress-step-bar-item-label-margin: var(--space-2xs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ProgressStepBarItem_size_s {
|
|
50
|
+
--progress-step-bar-item-point-size: var(--space-m);
|
|
51
|
+
--progress-step-bar-item-label-margin: var(--space-xs);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ProgressStepBarItem_size_m {
|
|
55
|
+
--progress-step-bar-item-point-size: var(--space-xl);
|
|
56
|
+
--progress-step-bar-item-label-margin: var(--space-xs);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ProgressStepBarItem_position_start {
|
|
60
|
+
-webkit-box-flex: 1;
|
|
61
|
+
-ms-flex: 1;
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ProgressStepBarItem_position_start.ProgressStepBarItem_direction_horizontal,
|
|
66
|
+
.ProgressStepBarItem_position_start .ProgressStepBarItem-Content {
|
|
67
|
+
-webkit-box-align: start;
|
|
68
|
+
-ms-flex-align: start;
|
|
69
|
+
align-items: flex-start;
|
|
70
|
+
text-align: left;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProgressStepBarItem_position_center {
|
|
74
|
+
-webkit-box-flex: 2;
|
|
75
|
+
-ms-flex: 2;
|
|
76
|
+
flex: 2;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ProgressStepBarItem_position_center.ProgressStepBarItem_direction_horizontal,
|
|
80
|
+
.ProgressStepBarItem_position_center .ProgressStepBarItemr-Content {
|
|
81
|
+
-webkit-box-align: center;
|
|
82
|
+
-ms-flex-align: center;
|
|
83
|
+
align-items: center;
|
|
84
|
+
text-align: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ProgressStepBarItem_position_end {
|
|
88
|
+
-webkit-box-flex: 1;
|
|
89
|
+
-ms-flex: 1;
|
|
90
|
+
flex: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ProgressStepBarItem_position_end.ProgressStepBarItem_direction_horizontal,
|
|
94
|
+
.ProgressStepBarItem_position_end .ProgressStepBarItem-Content {
|
|
95
|
+
-webkit-box-align: end;
|
|
96
|
+
-ms-flex-align: end;
|
|
97
|
+
align-items: flex-end;
|
|
98
|
+
text-align: right;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ProgressStepBarItem_status_system {
|
|
102
|
+
--progress-step-bar-item-point-background: var(--color-bg-system);
|
|
103
|
+
--progress-step-bar-item-point-content-color: var(--color-typo-secondary);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ProgressStepBarItem_status_normal {
|
|
107
|
+
--progress-step-bar-item-point-background: var(--color-bg-normal);
|
|
108
|
+
--progress-step-bar-item-point-content-color: var(--color-bg-default);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ProgressStepBarItem_status_success {
|
|
112
|
+
--progress-step-bar-item-point-background: var(--color-bg-success);
|
|
113
|
+
--progress-step-bar-item-point-content-color: var(--color-bg-default);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ProgressStepBarItem_status_warning {
|
|
117
|
+
--progress-step-bar-item-point-background: var(--color-bg-warning);
|
|
118
|
+
--progress-step-bar-item-point-content-color: var(--color-bg-default);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ProgressStepBarItem_status_alert {
|
|
122
|
+
--progress-step-bar-item-point-background: var(--color-bg-alert);
|
|
123
|
+
--progress-step-bar-item-point-content-color: var(--color-bg-default);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ProgressStepBarItem .ProgressStepBarItem-PointText,
|
|
127
|
+
.ProgressStepBarItem .Icon {
|
|
128
|
+
color: var(--progress-step-bar-item-point-content-color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ProgressStepBarItem .ProgressSpin {
|
|
132
|
+
stroke: var(--progress-step-bar-item-point-content-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ProgressStepBarItem-Point {
|
|
136
|
+
display: -webkit-box;
|
|
137
|
+
display: -ms-flexbox;
|
|
138
|
+
display: flex;
|
|
139
|
+
-webkit-box-pack: center;
|
|
140
|
+
-ms-flex-pack: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
-webkit-box-align: center;
|
|
143
|
+
-ms-flex-align: center;
|
|
144
|
+
align-items: center;
|
|
145
|
+
min-width: var(--progress-step-bar-item-point-size);
|
|
146
|
+
min-height: var(--progress-step-bar-item-point-size);
|
|
147
|
+
margin: 0;
|
|
148
|
+
padding: 0;
|
|
149
|
+
color: var(--color-bg-default);
|
|
150
|
+
background-color: var(--progress-step-bar-item-point-background);
|
|
151
|
+
border: none;
|
|
152
|
+
border-radius: calc(var(--progress-step-bar-item-point-size) * 0.5);
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
-webkit-transition: background-color 0.3s;
|
|
155
|
+
transition: background-color 0.3s;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ProgressStepBarItem-PointText {
|
|
159
|
+
color: var(--color-typo-secondary);
|
|
160
|
+
-webkit-transition: color 0.3s;
|
|
161
|
+
transition: color 0.3s;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ProgressStepBarItem-Label {
|
|
165
|
+
margin-bottom: var(--progress-step-bar-item-label-margin);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ProgressStepBarItem-Content_bottomOffset {
|
|
169
|
+
margin-bottom: var(--progress-step-bar-item-label-margin);
|
|
170
|
+
}
|
package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import './ProgressStepBarItem.css';
|
|
3
|
+
import React, { useRef, useState } from 'react';
|
|
4
|
+
import { cnMixFocus } from '../../../mixs/MixFocus/MixFocus';
|
|
5
|
+
import { cn } from '../../../utils/bem';
|
|
6
|
+
import { ProgressSpin } from '../../ProgressSpin/ProgressSpin';
|
|
7
|
+
import { Text } from '../../Text/Text';
|
|
8
|
+
import { Tooltip } from '../../Tooltip/Tooltip';
|
|
9
|
+
import { propPositionDefault, propStatusDefault, } from '../helpers';
|
|
10
|
+
var cnProgressStepBarItem = cn('ProgressStepBarItem');
|
|
11
|
+
var possibleVerticalDirections = [
|
|
12
|
+
'leftCenter',
|
|
13
|
+
'rightCenter',
|
|
14
|
+
'rightUp',
|
|
15
|
+
'downCenter',
|
|
16
|
+
];
|
|
17
|
+
var possibleHorizontalDirections = [
|
|
18
|
+
'downCenter',
|
|
19
|
+
'upCenter',
|
|
20
|
+
'downStartLeft',
|
|
21
|
+
'downStartRight',
|
|
22
|
+
];
|
|
23
|
+
var renderPointContent = function (point, size, progress) {
|
|
24
|
+
if (!point)
|
|
25
|
+
return null;
|
|
26
|
+
if (progress)
|
|
27
|
+
return React.createElement(ProgressSpin, { size: size });
|
|
28
|
+
if (typeof point === 'number' || !point)
|
|
29
|
+
return (React.createElement(Text, { className: cnProgressStepBarItem('PointText'), size: size === 's' ? '2xs' : 'xs', weight: "bold" }, point));
|
|
30
|
+
var Icon = point;
|
|
31
|
+
return React.createElement(Icon, { size: "xs" });
|
|
32
|
+
};
|
|
33
|
+
export var ProgressStepBarItem = function (props) {
|
|
34
|
+
var content = props.content, tooltipContent = props.tooltipContent, label = props.label, point = props.point, status = props.status, progress = props.progress, direction = props.direction, size = props.size, pointRef = props.pointRef, onClick = props.onClick, _a = props.position, position = _a === void 0 ? propPositionDefault : _a, otherProps = __rest(props, ["content", "tooltipContent", "label", "point", "status", "progress", "direction", "size", "pointRef", "onClick", "position"]);
|
|
35
|
+
var _b = __read(useState(true), 2), isTooltipHidden = _b[0], setIsTooltipHidden = _b[1];
|
|
36
|
+
var anchorRef = useRef(null);
|
|
37
|
+
var pointProps = {
|
|
38
|
+
onMouseEnter: function () { return setIsTooltipHidden(false); },
|
|
39
|
+
onMouseLeave: function () { return setIsTooltipHidden(true); },
|
|
40
|
+
className: cnProgressStepBarItem('Point', {
|
|
41
|
+
size: size
|
|
42
|
+
}, [cnMixFocus()]),
|
|
43
|
+
children: size !== 'xs' && renderPointContent(point, size, progress)
|
|
44
|
+
};
|
|
45
|
+
var pointButtonProps = {
|
|
46
|
+
ref: pointRef,
|
|
47
|
+
onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e); }
|
|
48
|
+
};
|
|
49
|
+
var pointDivButton = {
|
|
50
|
+
ref: pointRef
|
|
51
|
+
};
|
|
52
|
+
return (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", __assign({ className: cnProgressStepBarItem({
|
|
54
|
+
direction: direction,
|
|
55
|
+
position: position,
|
|
56
|
+
status: status || propStatusDefault,
|
|
57
|
+
size: size
|
|
58
|
+
}) }, otherProps),
|
|
59
|
+
onClick ? (React.createElement("button", __assign({ type: "button" }, pointButtonProps, pointProps))) : (React.createElement("div", __assign({}, pointProps, pointDivButton))),
|
|
60
|
+
React.createElement("div", { className: cnProgressStepBarItem('Content', { bottomOffset: !!content }) },
|
|
61
|
+
React.createElement(Text, { className: cnProgressStepBarItem('Label'), ref: anchorRef, size: size, onMouseEnter: function () { return setIsTooltipHidden(false); }, onMouseLeave: function () { return setIsTooltipHidden(true); }, lineHeight: size === 's' ? 'xs' : size, view: "primary" }, label),
|
|
62
|
+
content)),
|
|
63
|
+
tooltipContent && !isTooltipHidden && (React.createElement(Tooltip, { anchorRef: anchorRef, className: cnProgressStepBarItem('Tooltip'), direction: direction === 'horizontal' ? 'downCenter' : 'leftUp', possibleDirections: direction === 'horizontal' ? possibleHorizontalDirections : possibleVerticalDirections }, tooltipContent))));
|
|
64
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.ProgressStepBarLine {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: var(--progress-step-bar-line-top);
|
|
4
|
+
left: var(--progress-step-bar-line-left);
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
width: var(--progress-step-bar-line-width);
|
|
7
|
+
height: var(--progress-step-bar-line-height);
|
|
8
|
+
background: var(--line-background);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ProgressStepBarLine_direction_horizontal {
|
|
12
|
+
--progress-step-bar-line-top: var(--progress-step-bar-line-padding);
|
|
13
|
+
--progress-step-bar-line-left: 0;
|
|
14
|
+
--progress-step-bar-line-width: var(--line-size);
|
|
15
|
+
--progress-step-bar-line-height: var(--progress-step-bar-line-size);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ProgressStepBarLine_direction_vertical {
|
|
19
|
+
--progress-step-bar-line-top: 0;
|
|
20
|
+
--progress-step-bar-line-left: var(--progress-step-bar-line-padding);
|
|
21
|
+
--progress-step-bar-line-width: var(--progress-step-bar-line-size);
|
|
22
|
+
--progress-step-bar-line-height: var(--line-size);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ProgressStepBarLine_size_xs {
|
|
26
|
+
--progress-step-bar-line-size: var(--space-3xs);
|
|
27
|
+
--progress-step-bar-line-padding: calc((var(--space-xs) - var(--space-3xs)) * 0.5);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProgressStepBarLine_size_s {
|
|
31
|
+
--progress-step-bar-line-size: var(--space-2xs);
|
|
32
|
+
--progress-step-bar-line-padding: calc((var(--space-m) - var(--space-2xs)) * 0.5);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ProgressStepBarLine_size_m {
|
|
36
|
+
--progress-step-bar-line-size: var(--space-2xs);
|
|
37
|
+
--progress-step-bar-line-padding: calc((var(--space-xl) - var(--space-2xs)) * 0.5);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ProgressStepBarLine::after {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
left: var(--line-active-size);
|
|
46
|
+
bottom: 0;
|
|
47
|
+
background: var(--color-bg-system);
|
|
48
|
+
-webkit-transition: left 0.3s;
|
|
49
|
+
transition: left 0.3s;
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './ProgressStepBarLine.css';
|
|
3
|
+
import { Line, PropDirection, PropSize } from '../helpers';
|
|
4
|
+
declare type ProgressStepBarLineProps = {
|
|
5
|
+
lines: Line[];
|
|
6
|
+
size: PropSize;
|
|
7
|
+
direction: PropDirection;
|
|
8
|
+
activeStepIndex?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const ProgressStepBarLine: (props: ProgressStepBarLineProps) => JSX.Element;
|
|
11
|
+
export {};
|
package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './ProgressStepBarLine.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { cn } from '../../../utils/bem';
|
|
5
|
+
import { getSizeByMap } from '../../../utils/getSizeByMap';
|
|
6
|
+
var cnProgressStepBarLine = cn('ProgressStepBarLine');
|
|
7
|
+
var mapVarsByStatus = {
|
|
8
|
+
normal: 'var(--color-bg-normal)',
|
|
9
|
+
success: 'var(--color-bg-success)',
|
|
10
|
+
warning: 'var(--color-bg-warning)',
|
|
11
|
+
alert: 'var(--color-bg-alert)'
|
|
12
|
+
};
|
|
13
|
+
var backgroundGenerate = function (lines, direction) {
|
|
14
|
+
var background = "linear-gradient(" + (direction === 'horizontal' ? '90' : '180') + "deg, ";
|
|
15
|
+
var length = lines.length;
|
|
16
|
+
for (var index = 0; index < length; index++) {
|
|
17
|
+
var line = lines[index];
|
|
18
|
+
var color = getSizeByMap(mapVarsByStatus, line.status || 'normal');
|
|
19
|
+
var from = lines[index - 1] ? lines[index - 1].size : 0;
|
|
20
|
+
var to = line.size;
|
|
21
|
+
background += color + " " + from + "px, " + color + " " + to + "px" + (index < length - 1 ? ', ' : ')');
|
|
22
|
+
}
|
|
23
|
+
return background;
|
|
24
|
+
};
|
|
25
|
+
var getActiveLineSize = function (activeStepIndex, lines, lineSize) {
|
|
26
|
+
if (typeof activeStepIndex !== 'number') {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
return lines[activeStepIndex] ? lines[activeStepIndex].size : lineSize;
|
|
30
|
+
};
|
|
31
|
+
export var ProgressStepBarLine = function (props) {
|
|
32
|
+
var _a;
|
|
33
|
+
var lines = props.lines, activeStepIndex = props.activeStepIndex, size = props.size, direction = props.direction, otherProps = __rest(props, ["lines", "activeStepIndex", "size", "direction"]);
|
|
34
|
+
var background = backgroundGenerate(lines, direction);
|
|
35
|
+
var lineSize = lines.length > 0 ? lines[lines.length - 1].size : 0;
|
|
36
|
+
var activeLineSize = getActiveLineSize(activeStepIndex, lines, lineSize);
|
|
37
|
+
return (React.createElement("div", __assign({}, otherProps, { className: cnProgressStepBarLine({ size: size, direction: direction }), style: (_a = {},
|
|
38
|
+
_a['--line-size'] = lineSize + "px",
|
|
39
|
+
_a['--line-background'] = background,
|
|
40
|
+
_a['--line-active-size'] = activeLineSize + "px",
|
|
41
|
+
_a) })));
|
|
42
|
+
};
|