@arcblock/ux 2.1.41 → 2.1.44
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/lib/CodeBlock/index.js +1 -2
- package/lib/CountDown/index.js +1 -1
- package/lib/Datatable/index.js +20 -16
- package/lib/Footer/index.js +4 -3
- package/lib/Header/header.js +1 -1
- package/lib/InfoRow/index.js +1 -1
- package/lib/Metric/index.js +2 -2
- package/lib/NavMenu/style.js +1 -1
- package/lib/PricingTable/PricingPlan.js +2 -2
- package/lib/PricingTable/index.js +5 -2
- package/lib/RelativeTime/index.js +23 -11
- package/lib/Screenshot/index.js +3 -1
- package/lib/Tabs/index.js +1 -1
- package/lib/Video/index.js +1 -1
- package/lib/Wallet/Action.js +1 -1
- package/package.json +4 -4
- package/src/CodeBlock/index.js +2 -2
- package/src/CountDown/index.js +1 -1
- package/src/Datatable/index.js +20 -14
- package/src/Footer/index.js +4 -3
- package/src/Header/header.js +1 -1
- package/src/InfoRow/index.js +1 -1
- package/src/Metric/index.js +2 -2
- package/src/NavMenu/style.js +1 -1
- package/src/PricingTable/PricingPlan.js +2 -2
- package/src/PricingTable/index.js +3 -2
- package/src/RelativeTime/index.js +18 -6
- package/src/Screenshot/index.js +5 -2
- package/src/Tabs/index.js +1 -1
- package/src/Video/index.js +1 -1
- package/src/Wallet/Action.js +1 -1
package/lib/CodeBlock/index.js
CHANGED
|
@@ -148,7 +148,6 @@ function CodeBlock(_ref) {
|
|
|
148
148
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_IconButton.default, {
|
|
149
149
|
className: "copy-button",
|
|
150
150
|
onClick: onCopy,
|
|
151
|
-
tabIndex: "-1",
|
|
152
151
|
color: "primary",
|
|
153
152
|
disabled: copied,
|
|
154
153
|
children: [!copied && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileCopy.default, {
|
|
@@ -181,4 +180,4 @@ const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monos
|
|
|
181
180
|
const Pre = _styledComponents.default.pre.withConfig({
|
|
182
181
|
displayName: "CodeBlock__Pre",
|
|
183
182
|
componentId: "sc-1bpapaq-0"
|
|
184
|
-
})(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:
|
|
183
|
+
})(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:flex;}}code{counter-reset:line;counter-increment:line;padding:16px;font-family:", ";color:#fff;*{font-family:", ";}}.hljs *{white-space:normal;}"], fontFamily, _Colors.default.primary.main, fontFamily, fontFamily);
|
package/lib/CountDown/index.js
CHANGED
|
@@ -83,8 +83,8 @@ function FixWidthNumber(_ref) {
|
|
|
83
83
|
|
|
84
84
|
class CountDown extends _react.Component {
|
|
85
85
|
constructor(props) {
|
|
86
|
+
super(props);
|
|
86
87
|
const newProps = (0, _Util.mergeProps)(props, CountDown, ['dark', 'endTime', 'style']);
|
|
87
|
-
super(newProps);
|
|
88
88
|
this.state = getRemaining(newProps.endTime);
|
|
89
89
|
this.timer = null;
|
|
90
90
|
}
|
package/lib/Datatable/index.js
CHANGED
|
@@ -56,6 +56,24 @@ function Datatable(_ref) {
|
|
|
56
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ReDatatable, _objectSpread({}, props))
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
const fixCellProp = (tempObj, cellProps) => {
|
|
61
|
+
const cellStyle = {};
|
|
62
|
+
|
|
63
|
+
if (tempObj.align) {
|
|
64
|
+
cellProps.className = (0, _clsx.default)(cellProps.className, "pc-align-".concat(tempObj.align));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (tempObj.verticalKeyAlign) {
|
|
68
|
+
cellProps.className = (0, _clsx.default)(cellProps.className, "vertical-align-".concat(tempObj.verticalKeyAlign));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (tempObj.minWidth) {
|
|
72
|
+
cellStyle.minWidth = tempObj.minWidth;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
cellProps.style = Object.assign({}, cellProps.style, cellStyle);
|
|
76
|
+
};
|
|
59
77
|
/**
|
|
60
78
|
* @param {Object} props.options The options of mui-datatable,detail see https://github.com/gregnb/mui-datatables/tree/b8d2eee6af4589d254b40918e5d7e70b1ee4baca
|
|
61
79
|
* @param {Array} props.customButtons Custom buttons for toolbar
|
|
@@ -147,14 +165,7 @@ function ReDatatable(_ref2) {
|
|
|
147
165
|
cellProps.width = tempObj.width;
|
|
148
166
|
}
|
|
149
167
|
|
|
150
|
-
|
|
151
|
-
cellProps.className = (0, _clsx.default)(cellProps.className, "pc-align-".concat(tempObj.align));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (tempObj.verticalKeyAlign) {
|
|
155
|
-
cellProps.className = (0, _clsx.default)(cellProps.className, "vertical-align-".concat(tempObj.verticalKeyAlign));
|
|
156
|
-
}
|
|
157
|
-
|
|
168
|
+
fixCellProp(tempObj, cellProps);
|
|
158
169
|
return cellProps;
|
|
159
170
|
}; // Prevent memory xie caused by recursive forwarding of setCellHeaderProps functions
|
|
160
171
|
|
|
@@ -171,14 +182,7 @@ function ReDatatable(_ref2) {
|
|
|
171
182
|
cellProps = _objectSpread(_objectSpread({}, cellProps), setCellProps(...arguments) || {});
|
|
172
183
|
}
|
|
173
184
|
|
|
174
|
-
|
|
175
|
-
cellProps.className = (0, _clsx.default)(cellProps.className, "pc-align-".concat(tempObj.align));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (tempObj.verticalKeyAlign) {
|
|
179
|
-
cellProps.className = (0, _clsx.default)(cellProps.className, "vertical-align-".concat(tempObj.verticalKeyAlign));
|
|
180
|
-
}
|
|
181
|
-
|
|
185
|
+
fixCellProp(tempObj, cellProps);
|
|
182
186
|
return cellProps;
|
|
183
187
|
};
|
|
184
188
|
|
package/lib/Footer/index.js
CHANGED
|
@@ -31,8 +31,9 @@ function Footer(props) {
|
|
|
31
31
|
brand,
|
|
32
32
|
dark
|
|
33
33
|
} = newProps;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
34
|
+
const endYearString = "".concat(new Date().getFullYear());
|
|
35
|
+
const copyStartString = "".concat(copyStart);
|
|
36
|
+
const copyYear = endYearString === copyStartString ? endYearString : "".concat(copyStartString, "-").concat(endYearString);
|
|
36
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
37
38
|
className: className,
|
|
38
39
|
style: style,
|
|
@@ -73,7 +74,7 @@ function Footer(props) {
|
|
|
73
74
|
Footer.propTypes = {
|
|
74
75
|
dark: _propTypes.default.bool,
|
|
75
76
|
className: _propTypes.default.string,
|
|
76
|
-
copyStart: _propTypes.default.string,
|
|
77
|
+
copyStart: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
77
78
|
brand: _propTypes.default.string,
|
|
78
79
|
style: _propTypes.default.object
|
|
79
80
|
};
|
package/lib/Header/header.js
CHANGED
|
@@ -98,7 +98,7 @@ Header.propTypes = {
|
|
|
98
98
|
// brand 右侧的内容区域, 可显示一个 badge 或 tag
|
|
99
99
|
brandAddon: _propTypes.default.node,
|
|
100
100
|
// brand 下方的描述
|
|
101
|
-
description: _propTypes.default.
|
|
101
|
+
description: _propTypes.default.node,
|
|
102
102
|
children: _propTypes.default.node,
|
|
103
103
|
// 右侧区域, 可以放置 icons/actions/login 等
|
|
104
104
|
addons: _propTypes.default.node,
|
package/lib/InfoRow/index.js
CHANGED
|
@@ -74,7 +74,7 @@ InfoRow.defaultProps = {
|
|
|
74
74
|
const resetName = name.split(' ').map(x => (0, _upperFirst.default)((0, _camelCase.default)(x))).join(' ');
|
|
75
75
|
return typeof name === 'string' ? resetName : name;
|
|
76
76
|
},
|
|
77
|
-
valueComponent: '
|
|
77
|
+
valueComponent: 'div',
|
|
78
78
|
layout: 'horizontal'
|
|
79
79
|
};
|
|
80
80
|
|
package/lib/Metric/index.js
CHANGED
|
@@ -31,7 +31,7 @@ function Metric(_ref) {
|
|
|
31
31
|
className: "metric__image",
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_image.default, {
|
|
33
33
|
name: icon,
|
|
34
|
-
alt: name,
|
|
34
|
+
alt: typeof name === 'string' ? name : '',
|
|
35
35
|
size: 30,
|
|
36
36
|
prefix: prefix,
|
|
37
37
|
color: "#222222"
|
|
@@ -59,7 +59,7 @@ function Metric(_ref) {
|
|
|
59
59
|
Metric.propTypes = {
|
|
60
60
|
icon: _propTypes.default.string.isRequired,
|
|
61
61
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
62
|
-
name: _propTypes.default.
|
|
62
|
+
name: _propTypes.default.node.isRequired,
|
|
63
63
|
animated: _propTypes.default.bool,
|
|
64
64
|
url: _propTypes.default.string,
|
|
65
65
|
LinkComponent: _propTypes.default.any,
|
package/lib/NavMenu/style.js
CHANGED
|
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
12
|
const NavMenuBase = _styledComponents.default.nav.withConfig({
|
|
13
13
|
displayName: "style__NavMenuBase",
|
|
14
14
|
componentId: "sc-2g7isz-0"
|
|
15
|
-
})(["background-color:", ";font-size:
|
|
15
|
+
})(["background-color:", ";font-size:16px;ul{list-style:none;margin:0;padding:0;}.navmenu-item,.navmenu-sub{display:flex;align-items:center;}a{color:inherit;}.navmenu-item,.navmenu-sub{color:", ";}.navmenu-item--active,.navmenu-item:hover,.navmenu-sub--opened{color:", ";}.navmenu-item{position:relative;cursor:pointer;transition:color 0.2s ease-in-out;a{text-decoration:none;white-space:nowrap;}a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.navmenu-sub{position:relative;cursor:pointer;}.navmenu-item-icon,.navmenu-sub-icon,.navmenu-sub-expand-icon{display:flex;line-height:1;}.navmenu-item-icon,.navmenu-sub-icon{margin-right:4px;}.navmenu-item-icon > *,.navmenu-sub-icon > *{width:auto;height:22px;max-height:22px;font-size:1.5em;}.navmenu-sub-expand-icon{margin-left:8px;> *{width:0.8em;height:0.8em;transition:transform 0.2s ease-in-out;}}"], props => props.$bgColor, props => props.$textColor, props => props.$activeTextColor);
|
|
16
16
|
|
|
17
17
|
const HorizontalStyle = (0, _styledComponents.default)(NavMenuBase).withConfig({
|
|
18
18
|
displayName: "style__HorizontalStyle",
|
|
@@ -26,7 +26,7 @@ function PricingPlan(_ref) {
|
|
|
26
26
|
plan
|
|
27
27
|
} = _ref;
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanCard, {
|
|
29
|
-
shadow: true,
|
|
29
|
+
$shadow: true,
|
|
30
30
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
31
31
|
className: "card-header",
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -77,4 +77,4 @@ PricingPlan.propTypes = {
|
|
|
77
77
|
const PlanCard = (0, _styledComponents.default)(_Card.default).withConfig({
|
|
78
78
|
displayName: "PricingPlan__PlanCard",
|
|
79
79
|
componentId: "sc-11tuq1x-0"
|
|
80
|
-
})(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props
|
|
80
|
+
})(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)');
|
|
@@ -29,7 +29,10 @@ function PricingTable(_ref) {
|
|
|
29
29
|
container: true,
|
|
30
30
|
spacing: 2,
|
|
31
31
|
justifyContent: "center",
|
|
32
|
-
children: plans.map(x
|
|
32
|
+
children: plans.map((x, index) =>
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
35
|
+
(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
33
36
|
item: true,
|
|
34
37
|
className: "plan-item",
|
|
35
38
|
xs: 12,
|
|
@@ -38,7 +41,7 @@ function PricingTable(_ref) {
|
|
|
38
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PricingPlan.default, {
|
|
39
42
|
plan: x
|
|
40
43
|
})
|
|
41
|
-
},
|
|
44
|
+
}, index))
|
|
42
45
|
})
|
|
43
46
|
});
|
|
44
47
|
}
|
|
@@ -27,7 +27,7 @@ var _Util = require("../Util");
|
|
|
27
27
|
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
|
-
const _excluded = ["value", "locale", "withoutSuffix", "from", "to"];
|
|
30
|
+
const _excluded = ["value", "locale", "withoutSuffix", "from", "to", "type"];
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
@@ -78,7 +78,8 @@ function RelativeTime(_ref) {
|
|
|
78
78
|
locale,
|
|
79
79
|
withoutSuffix,
|
|
80
80
|
from,
|
|
81
|
-
to
|
|
81
|
+
to,
|
|
82
|
+
type
|
|
82
83
|
} = _ref,
|
|
83
84
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
84
85
|
|
|
@@ -87,20 +88,29 @@ function RelativeTime(_ref) {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
const localeOption = locale === 'zh' ? 'zh-cn' : 'zh-us';
|
|
90
|
-
let
|
|
91
|
+
let relativeString;
|
|
91
92
|
|
|
92
93
|
if (from) {
|
|
93
|
-
|
|
94
|
+
relativeString = (0, _dayjs.default)(value).locale(localeOption).from(from, withoutSuffix);
|
|
94
95
|
} else if (to) {
|
|
95
|
-
|
|
96
|
+
relativeString = (0, _dayjs.default)(value).locale(localeOption).to(to, withoutSuffix);
|
|
96
97
|
} else {
|
|
97
|
-
|
|
98
|
+
relativeString = (0, _dayjs.default)(value).locale(localeOption).fromNow(withoutSuffix);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const absoluteString = (0, _Util.formatToDatetime)(value, {
|
|
102
|
+
locale: localeOption
|
|
103
|
+
});
|
|
104
|
+
let innerContent = relativeString;
|
|
105
|
+
let popContent = absoluteString;
|
|
106
|
+
|
|
107
|
+
if (type === 'absolute') {
|
|
108
|
+
innerContent = absoluteString;
|
|
109
|
+
popContent = relativeString;
|
|
98
110
|
}
|
|
99
111
|
|
|
100
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
101
|
-
title:
|
|
102
|
-
locale: localeOption
|
|
103
|
-
}),
|
|
113
|
+
title: popContent,
|
|
104
114
|
placement: "top-end",
|
|
105
115
|
enterTouchDelay: 0,
|
|
106
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", _objectSpread(_objectSpread({}, rest), {}, {
|
|
@@ -114,11 +124,13 @@ RelativeTime.propTypes = {
|
|
|
114
124
|
locale: _propTypes.default.string,
|
|
115
125
|
withoutSuffix: _propTypes.default.bool,
|
|
116
126
|
from: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
117
|
-
to: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
127
|
+
to: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
128
|
+
type: _propTypes.default.string
|
|
118
129
|
};
|
|
119
130
|
RelativeTime.defaultProps = {
|
|
120
131
|
locale: 'en',
|
|
121
132
|
withoutSuffix: false,
|
|
122
133
|
from: '',
|
|
123
|
-
to: ''
|
|
134
|
+
to: '',
|
|
135
|
+
type: 'relative'
|
|
124
136
|
};
|
package/lib/Screenshot/index.js
CHANGED
|
@@ -166,7 +166,9 @@ function Screenshot(props) {
|
|
|
166
166
|
className: "device-frame",
|
|
167
167
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
168
|
className: "device-content",
|
|
169
|
-
children: findChildren(_react.Children.toArray(children))
|
|
169
|
+
children: findChildren(_react.Children.toArray(children)).map((item, index) => /*#__PURE__*/(0, _react.cloneElement)(item, {
|
|
170
|
+
key: index
|
|
171
|
+
}))
|
|
170
172
|
})
|
|
171
173
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
172
174
|
className: "device-stripe"
|
package/lib/Tabs/index.js
CHANGED
|
@@ -58,7 +58,7 @@ function Tabs(_ref2) {
|
|
|
58
58
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
59
59
|
|
|
60
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTabs, _objectSpread(_objectSpread({
|
|
61
|
-
scrollButtons: "
|
|
61
|
+
scrollButtons: "auto",
|
|
62
62
|
variant: "scrollable",
|
|
63
63
|
value: current,
|
|
64
64
|
onChange: (_, newValue) => _onChange(newValue),
|
package/lib/Video/index.js
CHANGED
|
@@ -63,7 +63,7 @@ function Video(props) {
|
|
|
63
63
|
style: styles,
|
|
64
64
|
src: url,
|
|
65
65
|
onLoad: () => setLoaded(true),
|
|
66
|
-
allowFullScreen:
|
|
66
|
+
allowFullScreen: true
|
|
67
67
|
}), !loaded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
68
68
|
className: "loading-indicator",
|
|
69
69
|
color: "primary"
|
package/lib/Wallet/Action.js
CHANGED
|
@@ -84,7 +84,7 @@ function WalletAction(props) {
|
|
|
84
84
|
|
|
85
85
|
WalletAction.propTypes = {
|
|
86
86
|
action: _propTypes.default.string,
|
|
87
|
-
size: _propTypes.default.oneOf(['large', 'medium', 'small']),
|
|
87
|
+
size: _propTypes.default.oneOf(['xlarge', 'large', 'medium', 'small']),
|
|
88
88
|
textLayout: _propTypes.default.oneOf(['vertical', 'horizontal']),
|
|
89
89
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string])
|
|
90
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.44",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "20e72c7ddc7f6f67d2b14782044bfc8e9609ca36",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.44",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.44",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
package/src/CodeBlock/index.js
CHANGED
|
@@ -74,7 +74,7 @@ export default function CodeBlock({ code, language, children, ...rest }) {
|
|
|
74
74
|
dangerouslySetInnerHTML={{ __html: hljs.highlightAuto(source, [language]).value }}
|
|
75
75
|
/>
|
|
76
76
|
</span>
|
|
77
|
-
<Button className="copy-button" onClick={onCopy}
|
|
77
|
+
<Button className="copy-button" onClick={onCopy} color="primary" disabled={copied}>
|
|
78
78
|
{!copied && <CopyIcon style={{ color: '#fff', fontSize: 16 }} />}
|
|
79
79
|
{copied && <CheckIcon style={{ color: '#fff', fontSize: 16 }} />}
|
|
80
80
|
</Button>
|
|
@@ -134,7 +134,7 @@ const Pre = styled.pre`
|
|
|
134
134
|
|
|
135
135
|
&:hover {
|
|
136
136
|
.copy-button {
|
|
137
|
-
display:
|
|
137
|
+
display: flex;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
package/src/CountDown/index.js
CHANGED
|
@@ -43,8 +43,8 @@ function FixWidthNumber({ number, label, length = 2 }) {
|
|
|
43
43
|
|
|
44
44
|
export default class CountDown extends Component {
|
|
45
45
|
constructor(props) {
|
|
46
|
+
super(props);
|
|
46
47
|
const newProps = mergeProps(props, CountDown, ['dark', 'endTime', 'style']);
|
|
47
|
-
super(newProps);
|
|
48
48
|
this.state = getRemaining(newProps.endTime);
|
|
49
49
|
this.timer = null;
|
|
50
50
|
}
|
package/src/Datatable/index.js
CHANGED
|
@@ -20,6 +20,24 @@ export default function Datatable({ ...props }) {
|
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const fixCellProp = (tempObj, cellProps) => {
|
|
24
|
+
const cellStyle = {};
|
|
25
|
+
|
|
26
|
+
if (tempObj.align) {
|
|
27
|
+
cellProps.className = clsx(cellProps.className, `pc-align-${tempObj.align}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (tempObj.verticalKeyAlign) {
|
|
31
|
+
cellProps.className = clsx(cellProps.className, `vertical-align-${tempObj.verticalKeyAlign}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (tempObj.minWidth) {
|
|
35
|
+
cellStyle.minWidth = tempObj.minWidth;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
cellProps.style = Object.assign({}, cellProps.style, cellStyle);
|
|
39
|
+
};
|
|
40
|
+
|
|
23
41
|
/**
|
|
24
42
|
* @param {Object} props.options The options of mui-datatable,detail see https://github.com/gregnb/mui-datatables/tree/b8d2eee6af4589d254b40918e5d7e70b1ee4baca
|
|
25
43
|
* @param {Array} props.customButtons Custom buttons for toolbar
|
|
@@ -102,13 +120,7 @@ function ReDatatable({
|
|
|
102
120
|
cellProps.width = tempObj.width;
|
|
103
121
|
}
|
|
104
122
|
|
|
105
|
-
|
|
106
|
-
cellProps.className = clsx(cellProps.className, `pc-align-${tempObj.align}`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (tempObj.verticalKeyAlign) {
|
|
110
|
-
cellProps.className = clsx(cellProps.className, `vertical-align-${tempObj.verticalKeyAlign}`);
|
|
111
|
-
}
|
|
123
|
+
fixCellProp(tempObj, cellProps);
|
|
112
124
|
|
|
113
125
|
return cellProps;
|
|
114
126
|
};
|
|
@@ -130,13 +142,7 @@ function ReDatatable({
|
|
|
130
142
|
};
|
|
131
143
|
}
|
|
132
144
|
|
|
133
|
-
|
|
134
|
-
cellProps.className = clsx(cellProps.className, `pc-align-${tempObj.align}`);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (tempObj.verticalKeyAlign) {
|
|
138
|
-
cellProps.className = clsx(cellProps.className, `vertical-align-${tempObj.verticalKeyAlign}`);
|
|
139
|
-
}
|
|
145
|
+
fixCellProp(tempObj, cellProps);
|
|
140
146
|
|
|
141
147
|
return cellProps;
|
|
142
148
|
};
|
package/src/Footer/index.js
CHANGED
|
@@ -11,8 +11,9 @@ export default function Footer(props) {
|
|
|
11
11
|
const newProps = mergeProps(props, Footer, ['dark', 'style']);
|
|
12
12
|
const { className, copyStart, style, brand, dark } = newProps;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const endYearString = `${new Date().getFullYear()}`;
|
|
15
|
+
const copyStartString = `${copyStart}`;
|
|
16
|
+
const copyYear = endYearString === copyStartString ? endYearString : `${copyStartString}-${endYearString}`;
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<Container className={className} style={style} dark={dark}>
|
|
@@ -35,7 +36,7 @@ export default function Footer(props) {
|
|
|
35
36
|
Footer.propTypes = {
|
|
36
37
|
dark: PropTypes.bool,
|
|
37
38
|
className: PropTypes.string,
|
|
38
|
-
copyStart: PropTypes.string,
|
|
39
|
+
copyStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
39
40
|
brand: PropTypes.string,
|
|
40
41
|
style: PropTypes.object,
|
|
41
42
|
};
|
package/src/Header/header.js
CHANGED
|
@@ -41,7 +41,7 @@ Header.propTypes = {
|
|
|
41
41
|
// brand 右侧的内容区域, 可显示一个 badge 或 tag
|
|
42
42
|
brandAddon: PropTypes.node,
|
|
43
43
|
// brand 下方的描述
|
|
44
|
-
description: PropTypes.
|
|
44
|
+
description: PropTypes.node,
|
|
45
45
|
children: PropTypes.node,
|
|
46
46
|
// 右侧区域, 可以放置 icons/actions/login 等
|
|
47
47
|
addons: PropTypes.node,
|
package/src/InfoRow/index.js
CHANGED
package/src/Metric/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
|
|
|
8
8
|
const metric = (
|
|
9
9
|
<>
|
|
10
10
|
<div className="metric__image">
|
|
11
|
-
<ImageIcon name={icon} alt={name} size={30} prefix={prefix} color="#222222" />
|
|
11
|
+
<ImageIcon name={icon} alt={typeof name === 'string' ? name : ''} size={30} prefix={prefix} color="#222222" />
|
|
12
12
|
</div>
|
|
13
13
|
<div>
|
|
14
14
|
<div
|
|
@@ -26,7 +26,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
|
|
|
26
26
|
Metric.propTypes = {
|
|
27
27
|
icon: PropTypes.string.isRequired,
|
|
28
28
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
29
|
-
name: PropTypes.
|
|
29
|
+
name: PropTypes.node.isRequired,
|
|
30
30
|
animated: PropTypes.bool,
|
|
31
31
|
url: PropTypes.string,
|
|
32
32
|
LinkComponent: PropTypes.any,
|
package/src/NavMenu/style.js
CHANGED
|
@@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography';
|
|
|
8
8
|
|
|
9
9
|
function PricingPlan({ plan }) {
|
|
10
10
|
return (
|
|
11
|
-
<PlanCard shadow>
|
|
11
|
+
<PlanCard $shadow>
|
|
12
12
|
<div className="card-header">
|
|
13
13
|
<div className="title">{plan.name}</div>
|
|
14
14
|
</div>
|
|
@@ -54,7 +54,7 @@ const PlanCard = styled(Card)`
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
&& {
|
|
57
|
-
${(props) => (props
|
|
57
|
+
${(props) => (props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)')}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.card-header {
|
|
@@ -9,8 +9,9 @@ function PricingTable({ plans }) {
|
|
|
9
9
|
return (
|
|
10
10
|
<Div variant="even">
|
|
11
11
|
<Grid container spacing={2} justifyContent="center">
|
|
12
|
-
{plans.map((x) => (
|
|
13
|
-
|
|
12
|
+
{plans.map((x, index) => (
|
|
13
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
14
|
+
<Grid item className="plan-item" key={index} xs={12} sm={6} md={3}>
|
|
14
15
|
<PricingPlan plan={x} />
|
|
15
16
|
</Grid>
|
|
16
17
|
))}
|
|
@@ -34,25 +34,35 @@ dayjs.updateLocale('zh-cn', {
|
|
|
34
34
|
});
|
|
35
35
|
setDateTool(dayjs);
|
|
36
36
|
|
|
37
|
-
export default function RelativeTime({ value, locale, withoutSuffix, from, to, ...rest }) {
|
|
37
|
+
export default function RelativeTime({ value, locale, withoutSuffix, from, to, type, ...rest }) {
|
|
38
38
|
if (!value) {
|
|
39
39
|
return '-';
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const localeOption = locale === 'zh' ? 'zh-cn' : 'zh-us';
|
|
43
43
|
|
|
44
|
-
let
|
|
44
|
+
let relativeString;
|
|
45
45
|
|
|
46
46
|
if (from) {
|
|
47
|
-
|
|
47
|
+
relativeString = dayjs(value).locale(localeOption).from(from, withoutSuffix);
|
|
48
48
|
} else if (to) {
|
|
49
|
-
|
|
49
|
+
relativeString = dayjs(value).locale(localeOption).to(to, withoutSuffix);
|
|
50
50
|
} else {
|
|
51
|
-
|
|
51
|
+
relativeString = dayjs(value).locale(localeOption).fromNow(withoutSuffix);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const absoluteString = formatToDatetime(value, { locale: localeOption });
|
|
55
|
+
|
|
56
|
+
let innerContent = relativeString;
|
|
57
|
+
let popContent = absoluteString;
|
|
58
|
+
|
|
59
|
+
if (type === 'absolute') {
|
|
60
|
+
innerContent = absoluteString;
|
|
61
|
+
popContent = relativeString;
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
return (
|
|
55
|
-
<Tooltip title={
|
|
65
|
+
<Tooltip title={popContent} placement="top-end" enterTouchDelay={0}>
|
|
56
66
|
<span {...rest}>{innerContent}</span>
|
|
57
67
|
</Tooltip>
|
|
58
68
|
);
|
|
@@ -64,6 +74,7 @@ RelativeTime.propTypes = {
|
|
|
64
74
|
withoutSuffix: PropTypes.bool,
|
|
65
75
|
from: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
66
76
|
to: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
77
|
+
type: PropTypes.string,
|
|
67
78
|
};
|
|
68
79
|
|
|
69
80
|
RelativeTime.defaultProps = {
|
|
@@ -71,4 +82,5 @@ RelativeTime.defaultProps = {
|
|
|
71
82
|
withoutSuffix: false,
|
|
72
83
|
from: '',
|
|
73
84
|
to: '',
|
|
85
|
+
type: 'relative',
|
|
74
86
|
};
|
package/src/Screenshot/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Children } from 'react';
|
|
1
|
+
import { createElement, Children, cloneElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
@@ -130,7 +130,10 @@ function Screenshot(props) {
|
|
|
130
130
|
contentRadius={borderRadius}
|
|
131
131
|
contentZIndex={zIndex}>
|
|
132
132
|
<div className="device-frame">
|
|
133
|
-
<div className="device-content">
|
|
133
|
+
<div className="device-content">
|
|
134
|
+
{/* eslint-disable-next-line react/no-array-index-key */}
|
|
135
|
+
{findChildren(Children.toArray(children)).map((item, index) => cloneElement(item, { key: index }))}
|
|
136
|
+
</div>
|
|
134
137
|
</div>
|
|
135
138
|
<div className="device-stripe" />
|
|
136
139
|
<div className="device-header" />
|
package/src/Tabs/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const StyledMuiTabs = styled(MuiTabs)(({ theme }) => ({
|
|
|
24
24
|
export default function Tabs({ tabs, current, onChange, ...rest }) {
|
|
25
25
|
return (
|
|
26
26
|
<StyledMuiTabs
|
|
27
|
-
scrollButtons="
|
|
27
|
+
scrollButtons="auto"
|
|
28
28
|
variant="scrollable"
|
|
29
29
|
value={current}
|
|
30
30
|
onChange={(_, newValue) => onChange(newValue)}
|
package/src/Video/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export default function Video(props) {
|
|
|
23
23
|
if (url.indexOf('v.qq.com') > 0) {
|
|
24
24
|
return (
|
|
25
25
|
<Placeholder style={{ width, height }}>
|
|
26
|
-
<iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen
|
|
26
|
+
<iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen />
|
|
27
27
|
{!loaded && <CircularProgress className="loading-indicator" color="primary" />}
|
|
28
28
|
</Placeholder>
|
|
29
29
|
);
|
package/src/Wallet/Action.js
CHANGED
|
@@ -35,7 +35,7 @@ export default function WalletAction(props) {
|
|
|
35
35
|
|
|
36
36
|
WalletAction.propTypes = {
|
|
37
37
|
action: PropTypes.string,
|
|
38
|
-
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
38
|
+
size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small']),
|
|
39
39
|
textLayout: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
40
40
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
41
41
|
};
|