@digitalc/dxp-ui 0.0.5-alpha.15 → 0.0.5-alpha.17
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/README.md +81 -47
- package/es/assets/token.json +128 -102
- package/es/components/Accordion/designTokens.d.ts +3 -3
- package/es/components/Accordion/designTokens.js +22 -14
- package/es/components/Accordion/index.js +8 -4
- package/es/components/Amount/designTokens.d.ts +2 -2
- package/es/components/Amount/designTokens.js +12 -8
- package/es/components/Amount/index.d.ts +3 -10
- package/es/components/Amount/index.js +122 -136
- package/es/components/Button/designTokens.d.ts +18 -3
- package/es/components/Button/designTokens.js +136 -122
- package/es/components/Button/index.d.ts +16 -5
- package/es/components/Button/index.js +89 -94
- package/es/components/Button/style/index.less +1 -1
- package/es/components/Card/designTokens.d.ts +9 -0
- package/es/components/Card/designTokens.js +14 -0
- package/es/components/Card/index.d.ts +15 -0
- package/es/components/Card/index.js +66 -0
- package/es/components/Card/style/index.less +45 -0
- package/es/components/Card/style/variables.less +4 -0
- package/es/components/Chip/designTokens.d.ts +2 -2
- package/es/components/Chip/designTokens.js +25 -21
- package/es/components/Chip/index.js +9 -8
- package/es/components/Divider/designTokens.d.ts +4 -0
- package/es/components/Divider/designTokens.js +9 -0
- package/es/components/Divider/index.d.ts +3 -8
- package/es/components/Divider/index.js +31 -49
- package/es/components/Drawer/designTokens.d.ts +2 -2
- package/es/components/Drawer/designTokens.js +30 -26
- package/es/components/Drawer/index.d.ts +6 -2
- package/es/components/Drawer/index.js +71 -68
- package/es/components/Drawer/style/index.less +13 -7
- package/es/components/GlobalTokenProvider/index.d.ts +11 -0
- package/es/components/GlobalTokenProvider/index.js +16 -0
- package/es/components/Icon/designTokens.d.ts +3 -3
- package/es/components/Icon/designTokens.js +11 -6
- package/es/components/Icon/index.js +6 -2
- package/es/components/IconButton/designTokens.d.ts +3 -4
- package/es/components/IconButton/designTokens.js +38 -32
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +7 -7
- package/es/components/Image/index.d.ts +1 -1
- package/es/components/Image/index.js +4 -3
- package/es/components/ListItem/designTokens.d.ts +4 -2
- package/es/components/ListItem/designTokens.js +36 -30
- package/es/components/ListItem/index.d.ts +12 -2
- package/es/components/ListItem/index.js +95 -30
- package/es/components/ListItem/style/index.less +42 -9
- package/es/components/Modal/designTokens.d.ts +11 -20
- package/es/components/Modal/designTokens.js +39 -30
- package/es/components/Modal/index.js +24 -11
- package/es/components/Navigation/designTokens.d.ts +9 -8
- package/es/components/Navigation/designTokens.js +24 -18
- package/es/components/Navigation/index.d.ts +1 -0
- package/es/components/Navigation/index.js +14 -10
- package/es/components/Notification/designTokens.d.ts +9 -0
- package/es/components/Notification/designTokens.js +14 -0
- package/es/components/Notification/index.d.ts +12 -0
- package/es/components/Notification/index.js +54 -0
- package/es/components/Notification/style/index.less +45 -0
- package/es/components/Notification/style/variables.less +4 -0
- package/es/components/Search/designTokens.d.ts +4 -4
- package/es/components/Search/designTokens.js +57 -46
- package/es/components/Search/index.js +15 -9
- package/es/components/Stepper/designTokens.d.ts +4 -5
- package/es/components/Stepper/designTokens.js +48 -40
- package/es/components/Stepper/index.d.ts +9 -10
- package/es/components/Stepper/index.js +139 -135
- package/es/components/Stepper/style/index.less +27 -12
- package/es/components/StickyFooter/designTokens.d.ts +2 -2
- package/es/components/StickyFooter/designTokens.js +20 -16
- package/es/components/StickyFooter/index.d.ts +2 -2
- package/es/components/StickyFooter/index.js +68 -39
- package/es/components/StickyFooter/style/index.less +5 -3
- package/es/components/Tabs/designTokens.d.ts +6 -6
- package/es/components/Tabs/designTokens.js +77 -60
- package/es/components/Tabs/index.js +11 -6
- package/es/components/Tag/designTokens.d.ts +42 -42
- package/es/components/Tag/designTokens.js +139 -95
- package/es/components/Tag/index.d.ts +1 -1
- package/es/components/Tag/index.js +16 -3
- package/es/components/Text/designTokens.d.ts +19 -10
- package/es/components/Text/designTokens.js +65 -51
- package/es/components/Text/index.d.ts +2 -1
- package/es/components/Text/index.js +42 -12
- package/es/components/TextInputInside/designTokens.d.ts +3 -12
- package/es/components/TextInputInside/designTokens.js +59 -57
- package/es/components/TextInputInside/index.js +10 -7
- package/es/components/TextInputOutside/designTokens.d.ts +5 -5
- package/es/components/TextInputOutside/designTokens.js +77 -61
- package/es/components/TextInputOutside/index.js +12 -7
- package/es/components/TextLink/designTokens.d.ts +2 -2
- package/es/components/TextLink/designTokens.js +14 -10
- package/es/components/TextLink/index.js +2 -1
- package/es/components/Toast/designTokens.d.ts +2 -2
- package/es/components/Toast/designTokens.js +20 -19
- package/es/components/Toast/index.js +2 -1
- package/es/components/Toggle/designTokens.d.ts +2 -2
- package/es/components/Toggle/designTokens.js +16 -12
- package/es/components/Toggle/index.js +2 -1
- package/es/components/index.d.ts +7 -1
- package/es/components/index.js +6 -2
- package/es/constants/index.d.ts +4 -1
- package/es/constants/index.js +5 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/tokens/DXPGlobal.d.ts +27 -19
- package/es/tokens/DXPGlobal.js +3 -2
- package/es/utils/TokenContext.d.ts +14 -0
- package/es/utils/TokenContext.js +91 -0
- package/es/utils/deviceType.d.ts +14 -0
- package/es/utils/deviceType.js +65 -0
- package/es/utils/index.d.ts +9 -0
- package/es/utils/index.js +9 -0
- package/es/utils/tokenHelper.js +2 -5
- package/es/utils/tokenManager.d.ts +82 -20
- package/es/utils/tokenManager.js +857 -779
- package/lib/assets/token.json +128 -102
- package/lib/components/Accordion/designTokens.d.ts +3 -3
- package/lib/components/Accordion/designTokens.js +25 -17
- package/lib/components/Accordion/index.js +8 -4
- package/lib/components/Amount/designTokens.d.ts +2 -2
- package/lib/components/Amount/designTokens.js +13 -9
- package/lib/components/Amount/index.d.ts +3 -10
- package/lib/components/Amount/index.js +84 -90
- package/lib/components/Button/designTokens.d.ts +18 -3
- package/lib/components/Button/designTokens.js +120 -114
- package/lib/components/Button/index.d.ts +16 -5
- package/lib/components/Button/index.js +59 -51
- package/lib/components/Button/style/index.less +1 -1
- package/lib/components/Card/designTokens.d.ts +9 -0
- package/lib/components/Card/designTokens.js +37 -0
- package/lib/components/Card/index.d.ts +15 -0
- package/lib/components/Card/index.js +156 -0
- package/lib/components/Card/style/index.less +45 -0
- package/lib/components/Card/style/variables.less +4 -0
- package/lib/components/Chip/designTokens.d.ts +2 -2
- package/lib/components/Chip/designTokens.js +25 -21
- package/lib/components/Chip/index.js +8 -5
- package/lib/components/Divider/designTokens.d.ts +4 -0
- package/lib/components/Divider/designTokens.js +32 -0
- package/lib/components/Divider/index.d.ts +3 -8
- package/lib/components/Divider/index.js +41 -43
- package/lib/components/Drawer/designTokens.d.ts +2 -2
- package/lib/components/Drawer/designTokens.js +31 -38
- package/lib/components/Drawer/index.d.ts +6 -2
- package/lib/components/Drawer/index.js +80 -53
- package/lib/components/Drawer/style/index.less +13 -7
- package/lib/components/GlobalTokenProvider/index.d.ts +11 -0
- package/lib/components/GlobalTokenProvider/index.js +40 -0
- package/lib/components/Icon/designTokens.d.ts +3 -3
- package/lib/components/Icon/designTokens.js +11 -17
- package/lib/components/Icon/index.js +5 -4
- package/lib/components/IconButton/designTokens.d.ts +3 -4
- package/lib/components/IconButton/designTokens.js +41 -34
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +25 -23
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.js +4 -4
- package/lib/components/ListItem/designTokens.d.ts +4 -2
- package/lib/components/ListItem/designTokens.js +36 -41
- package/lib/components/ListItem/index.d.ts +12 -2
- package/lib/components/ListItem/index.js +115 -46
- package/lib/components/ListItem/style/index.less +42 -9
- package/lib/components/Modal/designTokens.d.ts +11 -20
- package/lib/components/Modal/designTokens.js +44 -60
- package/lib/components/Modal/index.js +63 -16
- package/lib/components/Navigation/designTokens.d.ts +9 -8
- package/lib/components/Navigation/designTokens.js +24 -29
- package/lib/components/Navigation/index.d.ts +1 -0
- package/lib/components/Navigation/index.js +13 -12
- package/lib/components/Notification/designTokens.d.ts +9 -0
- package/lib/components/Notification/designTokens.js +37 -0
- package/lib/components/Notification/index.d.ts +12 -0
- package/lib/components/Notification/index.js +110 -0
- package/lib/components/Notification/style/index.less +45 -0
- package/lib/components/Notification/style/variables.less +4 -0
- package/lib/components/Search/designTokens.d.ts +4 -4
- package/lib/components/Search/designTokens.js +61 -49
- package/lib/components/Search/index.js +31 -9
- package/lib/components/Stepper/designTokens.d.ts +4 -5
- package/lib/components/Stepper/designTokens.js +70 -62
- package/lib/components/Stepper/index.d.ts +9 -10
- package/lib/components/Stepper/index.js +104 -53
- package/lib/components/Stepper/style/index.less +27 -12
- package/lib/components/StickyFooter/designTokens.d.ts +2 -2
- package/lib/components/StickyFooter/designTokens.js +21 -17
- package/lib/components/StickyFooter/index.d.ts +2 -2
- package/lib/components/StickyFooter/index.js +50 -18
- package/lib/components/StickyFooter/style/index.less +5 -3
- package/lib/components/Tabs/designTokens.d.ts +6 -6
- package/lib/components/Tabs/designTokens.js +80 -63
- package/lib/components/Tabs/index.js +19 -12
- package/lib/components/Tag/designTokens.d.ts +42 -42
- package/lib/components/Tag/designTokens.js +159 -115
- package/lib/components/Tag/index.d.ts +1 -1
- package/lib/components/Tag/index.js +27 -14
- package/lib/components/Text/designTokens.d.ts +19 -10
- package/lib/components/Text/designTokens.js +65 -51
- package/lib/components/Text/index.d.ts +2 -1
- package/lib/components/Text/index.js +407 -297
- package/lib/components/TextInputInside/designTokens.d.ts +3 -12
- package/lib/components/TextInputInside/designTokens.js +62 -75
- package/lib/components/TextInputInside/index.js +10 -7
- package/lib/components/TextInputOutside/designTokens.d.ts +5 -5
- package/lib/components/TextInputOutside/designTokens.js +82 -66
- package/lib/components/TextInputOutside/index.js +12 -8
- package/lib/components/TextLink/designTokens.d.ts +2 -2
- package/lib/components/TextLink/designTokens.js +14 -21
- package/lib/components/TextLink/index.js +3 -2
- package/lib/components/Toast/designTokens.d.ts +2 -2
- package/lib/components/Toast/designTokens.js +20 -16
- package/lib/components/Toast/index.js +7 -6
- package/lib/components/Toggle/designTokens.d.ts +2 -2
- package/lib/components/Toggle/designTokens.js +16 -23
- package/lib/components/Toggle/index.js +3 -2
- package/lib/components/index.d.ts +7 -1
- package/lib/components/index.js +10 -2
- package/lib/constants/index.d.ts +4 -1
- package/lib/constants/index.js +5 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +22 -0
- package/lib/tokens/DXPGlobal.d.ts +27 -19
- package/lib/tokens/DXPGlobal.js +1 -1
- package/lib/utils/TokenContext.d.ts +14 -0
- package/lib/utils/TokenContext.js +85 -0
- package/lib/utils/deviceType.d.ts +14 -0
- package/lib/utils/deviceType.js +56 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +44 -0
- package/lib/utils/tokenHelper.js +2 -12
- package/lib/utils/tokenManager.d.ts +82 -20
- package/lib/utils/tokenManager.js +840 -777
- package/package.json +14 -11
- package/umd/dxp-ui.min.css +1 -1
- package/umd/dxp-ui.min.js +1 -1
- package/lib/components/Button/demo/index.d.ts +0 -3
- package/lib/components/Button/demo/index.js +0 -138
|
@@ -5,149 +5,153 @@ import _Steps from "antd/es/steps";
|
|
|
5
5
|
import "antd/es/progress/style";
|
|
6
6
|
import _Progress from "antd/es/progress";
|
|
7
7
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
14
|
-
import React, { PureComponent } from 'react';
|
|
15
|
-
import { cssClasses } from "../../constants";
|
|
8
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
|
+
var _excluded = ["style", "className", "items", "children", "stepperType", "percent", "current", "nextStepText", "prefixCls", "labelPlacement"];
|
|
10
|
+
import React, { useMemo } from 'react';
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
import { cssClasses, strings } from "../../constants";
|
|
16
13
|
import Text from "../Text";
|
|
17
|
-
import
|
|
14
|
+
import { useDesignTokens, useMobileDesignTokens, useOtherDesignTokens } from "./designTokens";
|
|
15
|
+
// import { useBreakPoint } from '@/utils';
|
|
16
|
+
|
|
18
17
|
import "./style/index.less";
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
export var stepperTypes = {
|
|
20
|
+
default: 'default',
|
|
21
|
+
// 默认web上的stepper
|
|
22
|
+
line: 'line' // 移动端上的stepper
|
|
23
|
+
};
|
|
24
|
+
var Stepper = function Stepper(_ref) {
|
|
25
|
+
var style = _ref.style,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
items = _ref.items,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
_ref$stepperType = _ref.stepperType,
|
|
30
|
+
stepperType = _ref$stepperType === void 0 ? stepperTypes.default : _ref$stepperType,
|
|
31
|
+
percent = _ref.percent,
|
|
32
|
+
current = _ref.current,
|
|
33
|
+
_ref$nextStepText = _ref.nextStepText,
|
|
34
|
+
nextStepText = _ref$nextStepText === void 0 ? 'Next Step:' : _ref$nextStepText,
|
|
35
|
+
_ref$prefixCls = _ref.prefixCls,
|
|
36
|
+
prefixCls = _ref$prefixCls === void 0 ? cssClasses.PREFIX + '-stepper' : _ref$prefixCls,
|
|
37
|
+
_ref$labelPlacement = _ref.labelPlacement,
|
|
38
|
+
labelPlacement = _ref$labelPlacement === void 0 ? 'vertical' : _ref$labelPlacement,
|
|
39
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
// 使用hooks获取动态tokens
|
|
41
|
+
var designTokens = useDesignTokens();
|
|
42
|
+
var mobileDesignTokens = useMobileDesignTokens();
|
|
43
|
+
var otherDesignTokens = useOtherDesignTokens();
|
|
44
|
+
|
|
45
|
+
// 使用 Hook 获取设备类型,如果未指定 breakpoint,则根据设备类型自动选择
|
|
46
|
+
// const autoBreakPoint = useBreakPoint();
|
|
47
|
+
// const deviceType = breakpoint || autoBreakPoint;
|
|
48
|
+
|
|
49
|
+
var descriptionText = function descriptionText(content) {
|
|
50
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
51
|
+
className: cssClasses.PREFIX + '-stepper-description',
|
|
52
|
+
size: "ContentC12Bold",
|
|
53
|
+
children: content
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// 处理 items 方式
|
|
58
|
+
var processedItems = useMemo(function () {
|
|
59
|
+
return items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
60
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
61
|
+
description: descriptionText(item.description)
|
|
35
62
|
});
|
|
36
63
|
});
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
_createClass(Stepper, [{
|
|
40
|
-
key: "render",
|
|
41
|
-
value: function render() {
|
|
42
|
-
var _this2 = this;
|
|
43
|
-
var _this$props = this.props,
|
|
44
|
-
style = _this$props.style,
|
|
45
|
-
items = _this$props.items,
|
|
46
|
-
children = _this$props.children,
|
|
47
|
-
breakpoint = _this$props.breakpoint,
|
|
48
|
-
percent = _this$props.percent,
|
|
49
|
-
current = _this$props.current,
|
|
50
|
-
_this$props$nextStepT = _this$props.nextStepText,
|
|
51
|
-
nextStepText = _this$props$nextStepT === void 0 ? 'Next Step:' : _this$props$nextStepT;
|
|
64
|
+
}, [items]);
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
// 处理 children 方式
|
|
67
|
+
var processedChildren = useMemo(function () {
|
|
68
|
+
return children && React.Children.map(children, function (child) {
|
|
69
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
70
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
71
|
+
description: descriptionText(child.props.description)
|
|
57
72
|
});
|
|
58
|
-
}
|
|
73
|
+
}
|
|
74
|
+
return child;
|
|
75
|
+
});
|
|
76
|
+
}, [children]);
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
description: _this2.descriptionText(child.props.description)
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return child;
|
|
68
|
-
});
|
|
78
|
+
// 计算总步骤数
|
|
79
|
+
var totalSteps = useMemo(function () {
|
|
80
|
+
return (items === null || items === void 0 ? void 0 : items.length) || React.Children.count(children) || 0;
|
|
81
|
+
}, [items, children]);
|
|
69
82
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
title: hasNextStep ? ((_items$current = items[current]) === null || _items$current === void 0 ? void 0 : _items$current.title) || '' : '',
|
|
78
|
-
nextStep: hasNextStep ? ((_items = items[current + 1]) === null || _items === void 0 ? void 0 : _items.title) || '' : ''
|
|
79
|
-
};
|
|
83
|
+
// 优化获取步骤信息的逻辑
|
|
84
|
+
var _useMemo = useMemo(function () {
|
|
85
|
+
var _items$current, _items;
|
|
86
|
+
var hasNextStep = items && current !== undefined && current < items.length - 1;
|
|
87
|
+
return {
|
|
88
|
+
title: hasNextStep ? ((_items$current = items[current]) === null || _items$current === void 0 ? void 0 : _items$current.title) || '' : '',
|
|
89
|
+
nextStep: hasNextStep ? ((_items = items[current + 1]) === null || _items === void 0 ? void 0 : _items.title) || '' : ''
|
|
80
90
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
size: "ContentC12Regular",
|
|
134
|
-
children: [nextStepText, " ", nextStep]
|
|
135
|
-
})
|
|
136
|
-
})]
|
|
91
|
+
}, [items, current]),
|
|
92
|
+
title = _useMemo.title,
|
|
93
|
+
nextStep = _useMemo.nextStep;
|
|
94
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
95
|
+
prefixCls: cssClasses.PREFIX,
|
|
96
|
+
theme: {
|
|
97
|
+
components: {
|
|
98
|
+
Steps: _objectSpread({}, designTokens)
|
|
99
|
+
},
|
|
100
|
+
cssVar: true,
|
|
101
|
+
hashed: false
|
|
102
|
+
},
|
|
103
|
+
children: stepperType === stepperTypes.line ? /*#__PURE__*/_jsx("div", {
|
|
104
|
+
className: classNames("".concat(cssClasses.PREFIX, "-stepper-m"), className),
|
|
105
|
+
style: _objectSpread(_objectSpread({}, mobileDesignTokens), style),
|
|
106
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
107
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-header"),
|
|
108
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
109
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-count"),
|
|
110
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
111
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-neutral"),
|
|
112
|
+
breakpoint: strings.breakpoint.MOBILE,
|
|
113
|
+
size: "TitleT41Bold",
|
|
114
|
+
children: String(current !== undefined ? current + 1 : 1).padStart(2, '0')
|
|
115
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
116
|
+
breakpoint: strings.breakpoint.MOBILE,
|
|
117
|
+
size: "TitleT15Bold",
|
|
118
|
+
children: "/"
|
|
119
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
120
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-secondary"),
|
|
121
|
+
breakpoint: strings.breakpoint.MOBILE,
|
|
122
|
+
size: "TitleT23Bold",
|
|
123
|
+
children: totalSteps
|
|
124
|
+
})]
|
|
125
|
+
}), /*#__PURE__*/_jsx(_Progress, {
|
|
126
|
+
percent: percent,
|
|
127
|
+
status: "active",
|
|
128
|
+
strokeColor: designTokens.colorPrimary,
|
|
129
|
+
trailColor: mobileDesignTokens.colorStepperBackgroundActiveWeak,
|
|
130
|
+
showInfo: false,
|
|
131
|
+
size: ['100%', 8]
|
|
132
|
+
}), title && /*#__PURE__*/_jsx(Text, {
|
|
133
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-title"),
|
|
134
|
+
breakpoint: strings.breakpoint.MOBILE,
|
|
135
|
+
size: "TitleT15Bold",
|
|
136
|
+
children: title
|
|
137
|
+
}), nextStep && /*#__PURE__*/_jsx("div", {
|
|
138
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-next"),
|
|
139
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
140
|
+
type: "secondary",
|
|
141
|
+
size: "ContentC12Regular",
|
|
142
|
+
children: [nextStepText, " ", nextStep]
|
|
137
143
|
})
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
export { Stepper as default };
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
}) : /*#__PURE__*/_jsx(_Steps, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
147
|
+
prefixCls: prefixCls,
|
|
148
|
+
style: _objectSpread(_objectSpread({}, otherDesignTokens), style),
|
|
149
|
+
className: className,
|
|
150
|
+
items: processedItems,
|
|
151
|
+
current: current,
|
|
152
|
+
labelPlacement: labelPlacement,
|
|
153
|
+
children: processedChildren
|
|
154
|
+
}))
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
export default Stepper;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
.@{prefix}-@{components} {
|
|
8
8
|
display: flex;
|
|
9
9
|
width: 100%;
|
|
10
|
-
font-size:0;
|
|
10
|
+
font-size: 0;
|
|
11
11
|
text-align: initial;
|
|
12
12
|
min-width: 128px;
|
|
13
13
|
padding-top: 8px;
|
|
@@ -72,18 +72,19 @@
|
|
|
72
72
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
// moblie
|
|
76
|
+
@dxp-steps-color-neutral: ~"--dxp-steps-color-neutral";
|
|
77
|
+
@dxp-steps-color-secondary: ~"--dxp-steps-color-secondary";
|
|
78
|
+
@dxp-steps-color-label2: ~"--dxp-steps-color-label2";
|
|
79
|
+
@dxp-steps-background-active: ~"--dxp-steps-background-active";
|
|
80
|
+
@dxp-steps-background-activeWeak: ~"--dxp-steps-background-activeWeak";
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
@stepper-prefix-cls: stepper;
|
|
84
84
|
|
|
85
85
|
.@{prefix}-@{stepper-prefix-cls} {
|
|
86
|
-
font-size:0;
|
|
86
|
+
font-size: 0;
|
|
87
|
+
|
|
87
88
|
&-description {
|
|
88
89
|
margin-top: 4px;
|
|
89
90
|
}
|
|
@@ -97,10 +98,12 @@
|
|
|
97
98
|
display: flex;
|
|
98
99
|
flex-direction: column;
|
|
99
100
|
gap: 0;
|
|
100
|
-
|
|
101
|
+
|
|
102
|
+
.@{prefix}-@{stepper-prefix-cls}-bg {
|
|
101
103
|
background-color: var(@dxp-steps-background-active);
|
|
102
104
|
}
|
|
103
|
-
|
|
105
|
+
|
|
106
|
+
.@{prefix}-@{stepper-prefix-cls}-inner {
|
|
104
107
|
background-color: var(@dxp-steps-background-activeWeak);
|
|
105
108
|
}
|
|
106
109
|
}
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
|
|
128
131
|
&-next {
|
|
129
132
|
color: var(@dxp-steps-color-label2);
|
|
130
|
-
margin-top:0;
|
|
133
|
+
margin-top: 0;
|
|
131
134
|
color: #858585;
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -137,4 +140,16 @@
|
|
|
137
140
|
margin: 4px 0;
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
|
-
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dxp-progress .dxp-progress-bg::after {
|
|
146
|
+
content: ' ';
|
|
147
|
+
display: block;
|
|
148
|
+
width: 4px;
|
|
149
|
+
position: relative;
|
|
150
|
+
top: 2px;
|
|
151
|
+
left: calc(100% - 6px);
|
|
152
|
+
height: 4px;
|
|
153
|
+
border-radius: 50%;
|
|
154
|
+
background: #fff !important;
|
|
155
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const useDesignTokens: () => {
|
|
2
2
|
padding: string;
|
|
3
3
|
borderTop: string;
|
|
4
4
|
backgroundColor: any;
|
|
@@ -7,4 +7,4 @@ declare const designTokens: {
|
|
|
7
7
|
textDiscontColor: any;
|
|
8
8
|
colorStrikethrough: any;
|
|
9
9
|
};
|
|
10
|
-
export {
|
|
10
|
+
export { useDesignTokens };
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { useDynamicTokens } from "../../utils";
|
|
2
|
+
var useDesignTokens = function useDesignTokens() {
|
|
3
|
+
var getToken = useDynamicTokens();
|
|
4
|
+
var designTokens = {
|
|
5
|
+
padding: "".concat(getToken('spacingStickyFooterPaddingTop'), "px ").concat(getToken('spacingStickyFooterPaddingHorizontal'), "px ").concat(getToken('spacingStickyFooterPaddingBottom'), "px"),
|
|
6
|
+
// 间距
|
|
7
|
+
borderTop: "1px solid ".concat(getToken('colorStickyFooterBorderTop')),
|
|
8
|
+
// 边框
|
|
9
|
+
backgroundColor: getToken('colorStickyFooterBackground'),
|
|
10
|
+
// 背景颜色
|
|
11
|
+
priceColor: getToken('colorStickyFooterPrice'),
|
|
12
|
+
// 金额颜色
|
|
13
|
+
textColor: getToken('colorStickyFooterText'),
|
|
14
|
+
// 文本颜色
|
|
15
|
+
textDiscontColor: getToken('colorStickyFooterText2'),
|
|
16
|
+
// 文本颜色
|
|
17
|
+
colorStrikethrough: getToken('colorStickyFooterPriceStrikethrough') // 划线价颜色
|
|
18
|
+
};
|
|
19
|
+
return designTokens;
|
|
16
20
|
};
|
|
17
|
-
export {
|
|
21
|
+
export { useDesignTokens };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style/index.less';
|
|
3
|
-
export type type = 'default' | '
|
|
3
|
+
export type type = 'default' | 'priceVariant';
|
|
4
4
|
export interface StickyFooterProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
hideBorder?: boolean;
|
|
6
7
|
className?: string;
|
|
7
8
|
colorPrice?: string;
|
|
8
9
|
type?: type;
|
|
@@ -10,7 +11,6 @@ export interface StickyFooterProps {
|
|
|
10
11
|
style?: React.CSSProperties;
|
|
11
12
|
[key: string]: any;
|
|
12
13
|
onDropDownClick?: React.MouseEventHandler;
|
|
13
|
-
onRightBtnClick?: React.MouseEventHandler;
|
|
14
14
|
onBtnClick?: React.MouseEventHandler;
|
|
15
15
|
}
|
|
16
16
|
declare const StickyFooter: (props: StickyFooterProps) => React.JSX.Element;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["type", "colorPrice", "price", "priceStrikethrough", "buttonText", "title", "position", "size", "
|
|
3
|
+
var _excluded = ["hideBorder", "prefix", "type", "colorPrice", "price", "priceStrikethrough", "buttonText", "title", "position", "size", "onDropDownClick", "onBtnClick", "showIcon", "iconType", "className", "extraContent", "btnDisabled", "btnLoading", "hideAmount", "hideBtn", "showCancel", "showPrevious", "showBackPage", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
6
|
+
import { useBreakPoint } from "../../utils";
|
|
6
7
|
import { theme } from "../../utils/theme";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { cssClasses, strings } from "../../constants";
|
|
9
|
+
import { useDesignTokens } from "./designTokens";
|
|
9
10
|
import { Amount, Button } from "../index";
|
|
10
11
|
import "./style/index.less";
|
|
11
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
var StickyFooter = function StickyFooter(props) {
|
|
13
|
-
var
|
|
14
|
+
var hideBorder = props.hideBorder,
|
|
15
|
+
_props$prefix = props.prefix,
|
|
16
|
+
prefix = _props$prefix === void 0 ? "".concat(cssClasses.PREFIX, "-stickyFooter") : _props$prefix,
|
|
17
|
+
_props$type = props.type,
|
|
14
18
|
type = _props$type === void 0 ? 'default' : _props$type,
|
|
15
19
|
colorPrice = props.colorPrice,
|
|
16
20
|
price = props.price,
|
|
@@ -20,14 +24,28 @@ var StickyFooter = function StickyFooter(props) {
|
|
|
20
24
|
title = props.title,
|
|
21
25
|
position = props.position,
|
|
22
26
|
size = props.size,
|
|
23
|
-
children = props.children,
|
|
24
27
|
onDropDownClick = props.onDropDownClick,
|
|
25
|
-
onRightBtnClick = props.onRightBtnClick,
|
|
26
28
|
onBtnClick = props.onBtnClick,
|
|
27
29
|
_props$showIcon = props.showIcon,
|
|
28
30
|
showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
|
|
29
31
|
iconType = props.iconType,
|
|
32
|
+
_props$className = props.className,
|
|
33
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
34
|
+
extraContent = props.extraContent,
|
|
35
|
+
btnDisabled = props.btnDisabled,
|
|
36
|
+
btnLoading = props.btnLoading,
|
|
37
|
+
hideAmount = props.hideAmount,
|
|
38
|
+
hideBtn = props.hideBtn,
|
|
39
|
+
showCancel = props.showCancel,
|
|
40
|
+
showPrevious = props.showPrevious,
|
|
41
|
+
showBackPage = props.showBackPage,
|
|
42
|
+
children = props.children,
|
|
30
43
|
attr = _objectWithoutProperties(props, _excluded);
|
|
44
|
+
var designTokens = useDesignTokens();
|
|
45
|
+
var _strings$breakpoint = strings.breakpoint,
|
|
46
|
+
DESKTOP = _strings$breakpoint.DESKTOP,
|
|
47
|
+
MOBILE = _strings$breakpoint.MOBILE;
|
|
48
|
+
var autoBreakPoint = useBreakPoint();
|
|
31
49
|
var padding = designTokens.padding,
|
|
32
50
|
borderTop = designTokens.borderTop,
|
|
33
51
|
backgroundColor = designTokens.backgroundColor,
|
|
@@ -38,44 +56,55 @@ var StickyFooter = function StickyFooter(props) {
|
|
|
38
56
|
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
39
57
|
var hashId = useStyleRegister({
|
|
40
58
|
theme: theme,
|
|
41
|
-
token: {
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
path: ["".concat(cssClasses.PREFIX, "-stickyFooter")]
|
|
59
|
+
token: {},
|
|
60
|
+
path: ["".concat(prefix)]
|
|
45
61
|
}, function () {
|
|
46
|
-
return "\n .".concat(
|
|
62
|
+
return "\n .".concat(prefix, " {\n padding: ").concat(padding, ";\n border-top: ").concat(borderTop, ";\n background-color: ").concat(backgroundColor, ";\n &.").concat(prefix, "-hideBorder {\n border-top:none;\n box-shadow: 0px -2px 10px 0px rgba(26, 24, 134, 0.1);\n }\n }\n ");
|
|
47
63
|
});
|
|
48
64
|
return hashId;
|
|
49
65
|
};
|
|
50
66
|
useCustomButtonStyle();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
var hideBorderClass = hideBorder ? "".concat(prefix, "-hideBorder") : '';
|
|
68
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, attr), {}, {
|
|
69
|
+
className: "".concat(prefix, " ").concat(prefix, "-").concat(type, " ").concat(hideBorderClass, " ").concat(className),
|
|
70
|
+
onClick: props.onClick,
|
|
71
|
+
children: [extraContent && extraContent, /*#__PURE__*/_jsxs("div", {
|
|
72
|
+
className: "".concat(prefix, "-wrap"),
|
|
73
|
+
children: [type === 'default' && /*#__PURE__*/_jsx(_Fragment, {
|
|
74
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
75
|
+
type: "primary",
|
|
76
|
+
block: true,
|
|
77
|
+
onClick: onBtnClick,
|
|
78
|
+
children: buttonText
|
|
79
|
+
})
|
|
80
|
+
}), type === 'priceVariant' && !hideAmount && /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Amount, {
|
|
82
|
+
priceStrikethrough: priceStrikethrough,
|
|
83
|
+
priceColor: colorPrice || priceColor,
|
|
84
|
+
textColor: title === 'discount' ? textDiscontColor : textColor,
|
|
85
|
+
strikethroughColor: colorStrikethrough,
|
|
86
|
+
title: title,
|
|
87
|
+
position: position,
|
|
88
|
+
size: size,
|
|
89
|
+
showIcon: showIcon,
|
|
90
|
+
onDropDownClick: onDropDownClick,
|
|
91
|
+
iconType: iconType,
|
|
92
|
+
children: price
|
|
93
|
+
}), autoBreakPoint === DESKTOP && !hideBtn && /*#__PURE__*/_jsxs("div", {
|
|
94
|
+
children: [showCancel, showPrevious, showBackPage, /*#__PURE__*/_jsx(Button, {
|
|
95
|
+
disabled: btnDisabled,
|
|
96
|
+
loading: btnLoading,
|
|
97
|
+
type: "primary",
|
|
98
|
+
onClick: onBtnClick,
|
|
99
|
+
children: buttonText
|
|
100
|
+
})]
|
|
101
|
+
}), autoBreakPoint === MOBILE && /*#__PURE__*/_jsx(Button, {
|
|
102
|
+
disabled: btnDisabled,
|
|
103
|
+
loading: btnLoading,
|
|
104
|
+
type: "primary",
|
|
105
|
+
onClick: onBtnClick,
|
|
106
|
+
children: buttonText
|
|
107
|
+
})]
|
|
79
108
|
})]
|
|
80
109
|
}), children]
|
|
81
110
|
}));
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
@import './variables.less';
|
|
3
3
|
@components: stickyFooter;
|
|
4
4
|
.@{prefix}-@{components} {
|
|
5
|
-
display: flex;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
align-items: center;
|
|
8
5
|
position: fixed;
|
|
9
6
|
left: 0;
|
|
10
7
|
bottom: 0;
|
|
@@ -15,4 +12,9 @@
|
|
|
15
12
|
&.@{prefix}-@{components}-default {
|
|
16
13
|
justify-content: center;
|
|
17
14
|
}
|
|
15
|
+
.@{prefix}-@{components}-wrap {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
18
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const useOtherDesignTokens: () => {
|
|
2
2
|
colorTabsTextSubtitleInverseInactive: any;
|
|
3
3
|
colorTabsTextSubtitleInactive: any;
|
|
4
4
|
colorTabsIconInactiveInverse: any;
|
|
@@ -7,9 +7,9 @@ declare const otherDesignToken: {
|
|
|
7
7
|
colorTabsIconActive: any;
|
|
8
8
|
colorTabsTextSubtitleInverse: any;
|
|
9
9
|
colorTabsTextSubtitle: any;
|
|
10
|
-
sizingTabsIcon:
|
|
10
|
+
sizingTabsIcon: number;
|
|
11
11
|
};
|
|
12
|
-
declare const
|
|
12
|
+
declare const useDesignTokens: () => {
|
|
13
13
|
inkBarColor: any;
|
|
14
14
|
itemSelectedColor: any;
|
|
15
15
|
itemHoverColor: any;
|
|
@@ -19,7 +19,7 @@ declare const designTokens: {
|
|
|
19
19
|
horizontalItemPadding: string;
|
|
20
20
|
lineWidthBold: any;
|
|
21
21
|
};
|
|
22
|
-
declare const
|
|
22
|
+
declare const useDesignFillTokens: () => {
|
|
23
23
|
inkBarColor: string;
|
|
24
24
|
itemSelectedColor: string;
|
|
25
25
|
itemHoverColor: any;
|
|
@@ -31,7 +31,7 @@ declare const designFillTokens: {
|
|
|
31
31
|
lineWidth: number;
|
|
32
32
|
colorBgContainer: string;
|
|
33
33
|
};
|
|
34
|
-
declare const
|
|
34
|
+
declare const useInverseDesignTokens: () => {
|
|
35
35
|
inkBarColor: any;
|
|
36
36
|
itemSelectedColor: any;
|
|
37
37
|
itemHoverColor: any;
|
|
@@ -41,4 +41,4 @@ declare const inverseDesignTokens: {
|
|
|
41
41
|
horizontalItemPadding: string;
|
|
42
42
|
lineWidthBold: any;
|
|
43
43
|
};
|
|
44
|
-
export {
|
|
44
|
+
export { useOtherDesignTokens, useDesignTokens, useDesignFillTokens, useInverseDesignTokens };
|