@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
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
|
@@ -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 {
|
|
@@ -48,7 +48,7 @@ exports.Modal = function (props) {
|
|
|
48
48
|
Escape: function (e) { return isOpen && onEsc && onEsc(e); }
|
|
49
49
|
});
|
|
50
50
|
return (react_1["default"].createElement(react_transition_group_1.CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnForCssTransition_1.cnForCssTransition(cnModal), timeout: 200, nodeRef: portalRef },
|
|
51
|
-
react_1["default"].createElement(PortalWithTheme_1.PortalWithTheme, { preset: theme, container: container, className: cnModal(
|
|
51
|
+
react_1["default"].createElement(PortalWithTheme_1.PortalWithTheme, { preset: theme, container: container, className: cnModal({ hasOverlay: hasOverlay }, [rootClassName]), ref: portalRef },
|
|
52
52
|
hasOverlay && react_1["default"].createElement("div", { className: cnModal('Overlay'), "aria-label": "Overlay" }),
|
|
53
53
|
react_1["default"].createElement("div", tslib_1.__assign({ className: cnModal('Window', { width: width, position: position }, [className]), ref: ref }, rest),
|
|
54
54
|
react_1["default"].createElement(ContextConsumer, { onClickOutside: onClickOutside || onOverlayClick, ignoreClicksInsideRefs: tslib_1.__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,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.ProgressStepBar = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./ProgressStepBar.css");
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var useComponentSize_1 = require("../../hooks/useComponentSize/useComponentSize");
|
|
8
|
+
var useForkRef_1 = require("../../hooks/useForkRef/useForkRef");
|
|
9
|
+
var ProgressStepBarItem_1 = require("./ProgressStepBarItem/ProgressStepBarItem");
|
|
10
|
+
var ProgressStepBarLine_1 = require("./ProgressStepBarLine/ProgressStepBarLine");
|
|
11
|
+
var helpers_1 = require("./helpers");
|
|
12
|
+
function ProgressStepBarRender(props, ref) {
|
|
13
|
+
var _a = helpers_1.withDefaultGetters(props), _b = _a.steps, steps = _b === void 0 ? [] : _b, _c = _a.direction, direction = _c === void 0 ? helpers_1.propDirectionDefault : _c, _d = _a.size, size = _d === void 0 ? helpers_1.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 = tslib_1.__rest(_a, ["steps", "direction", "size", "className", "activeStepIndex", "onClick", "getItemContent", "getItemLabel", "getItemPoint", "getItemProgress", "getItemStatus", "getItemTooltipContent", "getItemLineStatus"]);
|
|
14
|
+
var _e = tslib_1.__read(react_1.useState([]), 2), lines = _e[0], setLines = _e[1];
|
|
15
|
+
var containerRef = react_1.useRef(null);
|
|
16
|
+
var _f = useComponentSize_1.useComponentSize(containerRef), width = _f.width, height = _f.height;
|
|
17
|
+
react_1.useEffect(function () {
|
|
18
|
+
if (steps.length > 0) {
|
|
19
|
+
var linesArray_1 = [];
|
|
20
|
+
steps.forEach(function (step, index) {
|
|
21
|
+
if (index !== steps.length - 1)
|
|
22
|
+
linesArray_1.push({
|
|
23
|
+
status: getItemLineStatus(step) || 'normal',
|
|
24
|
+
size: getLineSize(containerRef, stepsRef[index + 1])
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
setLines(linesArray_1);
|
|
28
|
+
}
|
|
29
|
+
}, [activeStepIndex, steps, direction, size, width, height]);
|
|
30
|
+
var stepsRef = react_1.useMemo(function () { return new Array(steps.length).fill(null).map(function () { return react_1.createRef(); }); }, [steps.length]);
|
|
31
|
+
var getLineSize = function (container, activeElement) {
|
|
32
|
+
var size = 0;
|
|
33
|
+
if (container && container.current && activeElement && activeElement.current) {
|
|
34
|
+
var containerPosition = container.current.getBoundingClientRect();
|
|
35
|
+
var activeElementPosition = activeElement.current.getBoundingClientRect();
|
|
36
|
+
if (direction === 'vertical')
|
|
37
|
+
size = activeElementPosition.y - containerPosition.y + activeElementPosition.height;
|
|
38
|
+
else
|
|
39
|
+
size = activeElementPosition.x - containerPosition.x;
|
|
40
|
+
}
|
|
41
|
+
return size;
|
|
42
|
+
};
|
|
43
|
+
var getStepItem = function (item, index) {
|
|
44
|
+
var position = 'center';
|
|
45
|
+
if (index === steps.length - 1)
|
|
46
|
+
position = 'end';
|
|
47
|
+
if (index === 0)
|
|
48
|
+
position = 'start';
|
|
49
|
+
return {
|
|
50
|
+
content: getItemContent(item),
|
|
51
|
+
label: getItemLabel(item),
|
|
52
|
+
point: getItemPoint(item),
|
|
53
|
+
progress: getItemProgress(item),
|
|
54
|
+
status: typeof activeStepIndex === 'number' && activeStepIndex >= index
|
|
55
|
+
? getItemStatus(item)
|
|
56
|
+
: 'system',
|
|
57
|
+
tooltipContent: getItemTooltipContent(item),
|
|
58
|
+
size: size,
|
|
59
|
+
position: position,
|
|
60
|
+
pointRef: stepsRef[index],
|
|
61
|
+
direction: direction,
|
|
62
|
+
onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e, item, index); }
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({ ref: useForkRef_1.useForkRef([ref, containerRef]) }, otherProps, { className: helpers_1.cnProgressStepBar({ direction: direction }, [className]) }),
|
|
66
|
+
react_1["default"].createElement(ProgressStepBarLine_1.ProgressStepBarLine, { lines: lines, size: size, direction: direction, activeStepIndex: activeStepIndex }),
|
|
67
|
+
steps.map(function (step, index) {
|
|
68
|
+
var item = getStepItem(step, index);
|
|
69
|
+
return react_1["default"].createElement(ProgressStepBarItem_1.ProgressStepBarItem, tslib_1.__assign({}, item));
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
exports.ProgressStepBar = react_1.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
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.ProgressStepBarItem = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./ProgressStepBarItem.css");
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var MixFocus_1 = require("../../../mixs/MixFocus/MixFocus");
|
|
8
|
+
var bem_1 = require("../../../utils/bem");
|
|
9
|
+
var ProgressSpin_1 = require("../../ProgressSpin/ProgressSpin");
|
|
10
|
+
var Text_1 = require("../../Text/Text");
|
|
11
|
+
var Tooltip_1 = require("../../Tooltip/Tooltip");
|
|
12
|
+
var helpers_1 = require("../helpers");
|
|
13
|
+
var cnProgressStepBarItem = bem_1.cn('ProgressStepBarItem');
|
|
14
|
+
var possibleVerticalDirections = [
|
|
15
|
+
'leftCenter',
|
|
16
|
+
'rightCenter',
|
|
17
|
+
'rightUp',
|
|
18
|
+
'downCenter',
|
|
19
|
+
];
|
|
20
|
+
var possibleHorizontalDirections = [
|
|
21
|
+
'downCenter',
|
|
22
|
+
'upCenter',
|
|
23
|
+
'downStartLeft',
|
|
24
|
+
'downStartRight',
|
|
25
|
+
];
|
|
26
|
+
var renderPointContent = function (point, size, progress) {
|
|
27
|
+
if (!point)
|
|
28
|
+
return null;
|
|
29
|
+
if (progress)
|
|
30
|
+
return react_1["default"].createElement(ProgressSpin_1.ProgressSpin, { size: size });
|
|
31
|
+
if (typeof point === 'number' || !point)
|
|
32
|
+
return (react_1["default"].createElement(Text_1.Text, { className: cnProgressStepBarItem('PointText'), size: size === 's' ? '2xs' : 'xs', weight: "bold" }, point));
|
|
33
|
+
var Icon = point;
|
|
34
|
+
return react_1["default"].createElement(Icon, { size: "xs" });
|
|
35
|
+
};
|
|
36
|
+
exports.ProgressStepBarItem = function (props) {
|
|
37
|
+
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 ? helpers_1.propPositionDefault : _a, otherProps = tslib_1.__rest(props, ["content", "tooltipContent", "label", "point", "status", "progress", "direction", "size", "pointRef", "onClick", "position"]);
|
|
38
|
+
var _b = tslib_1.__read(react_1.useState(true), 2), isTooltipHidden = _b[0], setIsTooltipHidden = _b[1];
|
|
39
|
+
var anchorRef = react_1.useRef(null);
|
|
40
|
+
var pointProps = {
|
|
41
|
+
onMouseEnter: function () { return setIsTooltipHidden(false); },
|
|
42
|
+
onMouseLeave: function () { return setIsTooltipHidden(true); },
|
|
43
|
+
className: cnProgressStepBarItem('Point', {
|
|
44
|
+
size: size
|
|
45
|
+
}, [MixFocus_1.cnMixFocus()]),
|
|
46
|
+
children: size !== 'xs' && renderPointContent(point, size, progress)
|
|
47
|
+
};
|
|
48
|
+
var pointButtonProps = {
|
|
49
|
+
ref: pointRef,
|
|
50
|
+
onClick: function (e) { return onClick === null || onClick === void 0 ? void 0 : onClick(e); }
|
|
51
|
+
};
|
|
52
|
+
var pointDivButton = {
|
|
53
|
+
ref: pointRef
|
|
54
|
+
};
|
|
55
|
+
return (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
56
|
+
react_1["default"].createElement("div", tslib_1.__assign({ className: cnProgressStepBarItem({
|
|
57
|
+
direction: direction,
|
|
58
|
+
position: position,
|
|
59
|
+
status: status || helpers_1.propStatusDefault,
|
|
60
|
+
size: size
|
|
61
|
+
}) }, otherProps),
|
|
62
|
+
onClick ? (react_1["default"].createElement("button", tslib_1.__assign({ type: "button" }, pointButtonProps, pointProps))) : (react_1["default"].createElement("div", tslib_1.__assign({}, pointProps, pointDivButton))),
|
|
63
|
+
react_1["default"].createElement("div", { className: cnProgressStepBarItem('Content', { bottomOffset: !!content }) },
|
|
64
|
+
react_1["default"].createElement(Text_1.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),
|
|
65
|
+
content)),
|
|
66
|
+
tooltipContent && !isTooltipHidden && (react_1["default"].createElement(Tooltip_1.Tooltip, { anchorRef: anchorRef, className: cnProgressStepBarItem('Tooltip'), direction: direction === 'horizontal' ? 'downCenter' : 'leftUp', possibleDirections: direction === 'horizontal' ? possibleHorizontalDirections : possibleVerticalDirections }, tooltipContent))));
|
|
67
|
+
};
|
|
@@ -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 {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.ProgressStepBarLine = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./ProgressStepBarLine.css");
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var bem_1 = require("../../../utils/bem");
|
|
8
|
+
var getSizeByMap_1 = require("../../../utils/getSizeByMap");
|
|
9
|
+
var cnProgressStepBarLine = bem_1.cn('ProgressStepBarLine');
|
|
10
|
+
var mapVarsByStatus = {
|
|
11
|
+
normal: 'var(--color-bg-normal)',
|
|
12
|
+
success: 'var(--color-bg-success)',
|
|
13
|
+
warning: 'var(--color-bg-warning)',
|
|
14
|
+
alert: 'var(--color-bg-alert)'
|
|
15
|
+
};
|
|
16
|
+
var backgroundGenerate = function (lines, direction) {
|
|
17
|
+
var background = "linear-gradient(" + (direction === 'horizontal' ? '90' : '180') + "deg, ";
|
|
18
|
+
var length = lines.length;
|
|
19
|
+
for (var index = 0; index < length; index++) {
|
|
20
|
+
var line = lines[index];
|
|
21
|
+
var color = getSizeByMap_1.getSizeByMap(mapVarsByStatus, line.status || 'normal');
|
|
22
|
+
var from = lines[index - 1] ? lines[index - 1].size : 0;
|
|
23
|
+
var to = line.size;
|
|
24
|
+
background += color + " " + from + "px, " + color + " " + to + "px" + (index < length - 1 ? ', ' : ')');
|
|
25
|
+
}
|
|
26
|
+
return background;
|
|
27
|
+
};
|
|
28
|
+
var getActiveLineSize = function (activeStepIndex, lines, lineSize) {
|
|
29
|
+
if (typeof activeStepIndex !== 'number') {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
return lines[activeStepIndex] ? lines[activeStepIndex].size : lineSize;
|
|
33
|
+
};
|
|
34
|
+
exports.ProgressStepBarLine = function (props) {
|
|
35
|
+
var _a;
|
|
36
|
+
var lines = props.lines, activeStepIndex = props.activeStepIndex, size = props.size, direction = props.direction, otherProps = tslib_1.__rest(props, ["lines", "activeStepIndex", "size", "direction"]);
|
|
37
|
+
var background = backgroundGenerate(lines, direction);
|
|
38
|
+
var lineSize = lines.length > 0 ? lines[lines.length - 1].size : 0;
|
|
39
|
+
var activeLineSize = getActiveLineSize(activeStepIndex, lines, lineSize);
|
|
40
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({}, otherProps, { className: cnProgressStepBarLine({ size: size, direction: direction }), style: (_a = {},
|
|
41
|
+
_a['--line-size'] = lineSize + "px",
|
|
42
|
+
_a['--line-background'] = background,
|
|
43
|
+
_a['--line-active-size'] = activeLineSize + "px",
|
|
44
|
+
_a) })));
|
|
45
|
+
};
|