@arcblock/ux 2.1.18 → 2.1.21
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/ActionButton/index.js +16 -8
- package/lib/ActivityIndicator/index.js +49 -36
- package/lib/Alert/index.js +25 -17
- package/lib/AnimationWaiter/index.js +44 -35
- package/lib/Async/index.js +15 -3
- package/lib/Badge/index.js +14 -4
- package/lib/Blocklet/blocklet.js +81 -62
- package/lib/BlockletNFT/index.js +95 -76
- package/lib/Button/wrap.js +13 -9
- package/lib/Center/index.js +6 -5
- package/lib/ClickToCopy/index.js +31 -21
- package/lib/CodeBlock/index.js +35 -27
- package/lib/ContactForm/index.js +46 -41
- package/lib/CookieConsent/index.js +33 -21
- package/lib/CountDown/index.js +50 -34
- package/lib/Datatable/CustomToolbar.js +138 -97
- package/lib/Datatable/DatatableContext.js +9 -12
- package/lib/Datatable/TableSearch.js +44 -27
- package/lib/Datatable/index.js +44 -28
- package/lib/Dialog/confirm.js +26 -13
- package/lib/Dialog/dialog.js +42 -26
- package/lib/DriftBot/index.js +2 -2
- package/lib/Earth/index.js +121 -107
- package/lib/Empty/index.js +19 -10
- package/lib/ErrorBoundary/fallback.js +18 -12
- package/lib/Footer/index.js +32 -26
- package/lib/Header/header.js +37 -21
- package/lib/Header/responsive-header.js +40 -30
- package/lib/Icon/image.js +22 -15
- package/lib/Icon/index.js +17 -7
- package/lib/Img/index.js +34 -32
- package/lib/InfoRow/index.js +23 -13
- package/lib/Layout/dashboard/index.js +66 -54
- package/lib/Layout/dashboard/sidebar.js +39 -26
- package/lib/Layout/dashboard-legacy/header.js +56 -38
- package/lib/Layout/dashboard-legacy/index.js +54 -44
- package/lib/Layout/dashboard-legacy/sidebar.js +48 -38
- package/lib/Layout/index.js +147 -111
- package/lib/Locale/context.js +8 -10
- package/lib/Locale/selector.js +55 -41
- package/lib/Logo/index.js +50 -30
- package/lib/Metric/index.js +30 -23
- package/lib/NFTDisplay/aspect-ratio-container.js +15 -6
- package/lib/NFTDisplay/broken.js +3 -3
- package/lib/NFTDisplay/index.js +29 -28
- package/lib/NFTDisplay/loading.js +6 -5
- package/lib/NFTDisplay/svg-embedder/img.js +10 -4
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +14 -6
- package/lib/NavMenu/nav-menu.js +60 -49
- package/lib/PageScroller/index.js +29 -27
- package/lib/PageScroller/usePrevValue.js +1 -5
- package/lib/PricingTable/PricingPlan.js +46 -36
- package/lib/PricingTable/index.js +22 -20
- package/lib/QRCode/index.js +6 -9
- package/lib/RelativeTime/index.js +14 -5
- package/lib/Result/common.js +49 -44
- package/lib/Result/index.js +6 -6
- package/lib/Result/result.js +29 -18
- package/lib/Screenshot/index.js +32 -21
- package/lib/Spinner/index.js +3 -3
- package/lib/SplitButton/index.js +40 -24
- package/lib/Switch/index.js +12 -6
- package/lib/Tabs/index.js +18 -12
- package/lib/Tag/index.js +14 -4
- package/lib/Terminal/Player.js +108 -92
- package/lib/Terminal/index.js +3 -1
- package/lib/TextCollapse/index.js +18 -8
- package/lib/Toast/index.js +17 -14
- package/lib/Video/index.js +31 -25
- package/lib/Wallet/Action.js +37 -25
- package/lib/Wallet/Download.js +236 -181
- package/lib/Wallet/Open.js +6 -5
- package/lib/WechatPrompt/index.js +40 -28
- package/lib/withTheme/index.js +23 -9
- package/lib/withTracker/error_boundary.js +10 -7
- package/lib/withTracker/index.js +8 -4
- package/package.json +4 -4
- package/src/ActionButton/index.js +3 -4
- package/src/ActivityIndicator/index.js +4 -7
- package/src/Alert/index.js +4 -10
- package/src/AnimationWaiter/index.js +4 -2
- package/src/Async/index.js +4 -8
- package/src/Badge/index.js +2 -2
- package/src/Blocklet/blocklet.js +16 -27
- package/src/Blocklet/utils.js +3 -3
- package/src/BlockletNFT/index.js +7 -15
- package/src/Button/wrap.js +2 -2
- package/src/Center/index.js +0 -1
- package/src/ClickToCopy/index.js +5 -12
- package/src/CodeBlock/index.js +2 -7
- package/src/Colors/index.js +1 -0
- package/src/ContactForm/index.js +16 -16
- package/src/CookieConsent/index.js +3 -2
- package/src/CountDown/index.js +8 -8
- package/src/Datatable/CustomToolbar.js +8 -9
- package/src/Datatable/DatatableContext.js +3 -3
- package/src/Datatable/TableSearch.js +18 -13
- package/src/Datatable/index.js +13 -12
- package/src/Datatable/utils.js +19 -23
- package/src/Dialog/confirm.js +0 -1
- package/src/Dialog/dialog.js +7 -27
- package/src/Dialog/index.js +1 -0
- package/src/DriftBot/index.js +2 -2
- package/src/Earth/index.js +26 -44
- package/src/Empty/index.js +0 -1
- package/src/ErrorBoundary/fallback.js +2 -3
- package/src/Footer/index.js +3 -7
- package/src/Header/header.js +4 -5
- package/src/Header/responsive-header.js +4 -10
- package/src/Icon/image.js +0 -1
- package/src/Icon/index.js +8 -8
- package/src/Img/index.js +6 -6
- package/src/InfoRow/index.js +22 -21
- package/src/Layout/dashboard/index.js +9 -4
- package/src/Layout/dashboard/sidebar.js +4 -10
- package/src/Layout/dashboard-legacy/header.js +9 -15
- package/src/Layout/dashboard-legacy/index.js +4 -11
- package/src/Layout/dashboard-legacy/sidebar.js +7 -7
- package/src/Layout/index.js +12 -26
- package/src/Locale/browser-lang.js +2 -2
- package/src/Locale/context.js +7 -11
- package/src/Locale/selector.js +8 -8
- package/src/Logo/index.js +4 -6
- package/src/Metric/index.js +9 -10
- package/src/NFTDisplay/aspect-ratio-container.js +0 -1
- package/src/NFTDisplay/broken.js +0 -1
- package/src/NFTDisplay/index.js +10 -8
- package/src/NFTDisplay/loading.js +0 -1
- package/src/NFTDisplay/svg-embedder/img.js +1 -2
- package/src/NFTDisplay/svg-embedder/inline-svg.js +0 -1
- package/src/NavMenu/index.js +1 -0
- package/src/NavMenu/nav-menu.js +14 -27
- package/src/NavMenu/style.js +3 -3
- package/src/PageScroller/index.js +19 -35
- package/src/PageScroller/usePrevValue.js +1 -1
- package/src/PricingTable/PricingPlan.js +31 -30
- package/src/PricingTable/index.js +4 -5
- package/src/QRCode/index.js +3 -2
- package/src/RelativeTime/index.js +1 -5
- package/src/Result/common.js +19 -20
- package/src/Result/index.js +5 -6
- package/src/Result/result.js +2 -3
- package/src/Result/translations.js +1 -2
- package/src/Screenshot/index.js +10 -10
- package/src/Spinner/index.js +0 -1
- package/src/SplitButton/index.js +6 -19
- package/src/Switch/index.js +40 -41
- package/src/Tabs/index.js +2 -9
- package/src/Tag/index.js +2 -2
- package/src/Terminal/Player.js +7 -8
- package/src/Terminal/index.js +4 -3
- package/src/Terminal/util.js +3 -3
- package/src/TextCollapse/index.js +4 -10
- package/src/Theme/index.js +1 -8
- package/src/Toast/index.js +6 -10
- package/src/Util/index.js +15 -27
- package/src/Video/index.js +2 -8
- package/src/Wallet/Action.js +5 -6
- package/src/Wallet/Download.js +6 -7
- package/src/Wallet/Open.js +1 -2
- package/src/WechatPrompt/index.js +2 -7
- package/src/withTheme/index.js +5 -5
- package/src/withTracker/error_boundary.js +3 -3
- package/src/withTracker/index.js +2 -2
package/lib/Result/common.js
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
exports.ComingSoon = ComingSoon;
|
|
7
|
+
exports.Error = Error;
|
|
8
|
+
exports.Forbidden = Forbidden;
|
|
9
|
+
exports.Info = Info;
|
|
10
|
+
exports.InternalServerError = InternalServerError;
|
|
11
|
+
exports.Maintenance = Maintenance;
|
|
12
|
+
exports.PageNotFound = PageNotFound;
|
|
9
13
|
|
|
10
14
|
var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
|
|
11
15
|
|
|
@@ -19,6 +23,8 @@ var _translations = _interopRequireDefault(require("./translations"));
|
|
|
19
23
|
|
|
20
24
|
var _context = require("../Locale/context");
|
|
21
25
|
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
|
|
22
28
|
const _excluded = ["locale"],
|
|
23
29
|
_excluded2 = ["locale"],
|
|
24
30
|
_excluded3 = ["locale"],
|
|
@@ -28,6 +34,12 @@ const _excluded = ["locale"],
|
|
|
28
34
|
|
|
29
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
36
|
|
|
37
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
38
|
+
|
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
40
|
+
|
|
41
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
42
|
+
|
|
31
43
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
44
|
|
|
33
45
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -44,133 +56,126 @@ const useLocale = locale => {
|
|
|
44
56
|
}; // 404
|
|
45
57
|
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
function PageNotFound(_ref) {
|
|
48
60
|
let {
|
|
49
61
|
locale
|
|
50
62
|
} = _ref,
|
|
51
63
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
64
|
|
|
53
65
|
locale = useLocale(locale);
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
-
icon: /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
67
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorIcon, {}),
|
|
56
68
|
title: _translations.default[locale][404].title,
|
|
57
69
|
description: _translations.default[locale][404].description
|
|
58
70
|
}, rest));
|
|
59
|
-
}
|
|
71
|
+
}
|
|
60
72
|
|
|
61
|
-
exports.PageNotFound = PageNotFound;
|
|
62
73
|
PageNotFound.status = '404'; // 403
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
function Forbidden(_ref2) {
|
|
65
76
|
let {
|
|
66
77
|
locale
|
|
67
78
|
} = _ref2,
|
|
68
79
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
69
80
|
|
|
70
81
|
locale = useLocale(locale);
|
|
71
|
-
return /*#__PURE__*/
|
|
72
|
-
icon: /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
83
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorIcon, {}),
|
|
73
84
|
title: _translations.default[locale][403].title,
|
|
74
85
|
description: _translations.default[locale][403].description
|
|
75
86
|
}, rest));
|
|
76
|
-
}
|
|
87
|
+
}
|
|
77
88
|
|
|
78
|
-
exports.Forbidden = Forbidden;
|
|
79
89
|
Forbidden.status = '403'; // 500
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
function InternalServerError(_ref3) {
|
|
82
92
|
let {
|
|
83
93
|
locale
|
|
84
94
|
} = _ref3,
|
|
85
95
|
rest = _objectWithoutProperties(_ref3, _excluded3);
|
|
86
96
|
|
|
87
97
|
locale = useLocale(locale);
|
|
88
|
-
return /*#__PURE__*/
|
|
89
|
-
icon: /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
99
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorIcon, {}),
|
|
90
100
|
title: _translations.default[locale][500].title,
|
|
91
101
|
description: _translations.default[locale][500].description
|
|
92
102
|
}, rest));
|
|
93
|
-
}
|
|
103
|
+
}
|
|
94
104
|
|
|
95
|
-
exports.InternalServerError = InternalServerError;
|
|
96
105
|
InternalServerError.status = '500'; // 通用错误
|
|
97
106
|
|
|
98
|
-
|
|
107
|
+
function Error(_ref4) {
|
|
99
108
|
let {
|
|
100
109
|
locale
|
|
101
110
|
} = _ref4,
|
|
102
111
|
rest = _objectWithoutProperties(_ref4, _excluded4);
|
|
103
112
|
|
|
104
113
|
locale = useLocale(locale);
|
|
105
|
-
return /*#__PURE__*/
|
|
106
|
-
icon: /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
115
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorIcon, {}),
|
|
107
116
|
title: _translations.default[locale].error.title,
|
|
108
117
|
description: _translations.default[locale].error.description
|
|
109
118
|
}, rest));
|
|
110
|
-
}
|
|
119
|
+
}
|
|
111
120
|
|
|
112
|
-
exports.Error = Error;
|
|
113
121
|
Error.status = 'error'; // under maintenance
|
|
114
122
|
|
|
115
|
-
|
|
123
|
+
function Maintenance(_ref5) {
|
|
116
124
|
let {
|
|
117
125
|
locale
|
|
118
126
|
} = _ref5,
|
|
119
127
|
rest = _objectWithoutProperties(_ref5, _excluded5);
|
|
120
128
|
|
|
121
129
|
locale = useLocale(locale);
|
|
122
|
-
return /*#__PURE__*/
|
|
123
|
-
icon: /*#__PURE__*/
|
|
130
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
131
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInfoIcon, {}),
|
|
124
132
|
title: _translations.default[locale].maintenance.title,
|
|
125
133
|
description: _translations.default[locale].maintenance.description
|
|
126
134
|
}, rest));
|
|
127
|
-
}
|
|
135
|
+
}
|
|
128
136
|
|
|
129
|
-
exports.Maintenance = Maintenance;
|
|
130
137
|
Maintenance.status = 'maintenance'; // coming soon
|
|
131
138
|
|
|
132
|
-
|
|
139
|
+
function ComingSoon(_ref6) {
|
|
133
140
|
let {
|
|
134
141
|
locale
|
|
135
142
|
} = _ref6,
|
|
136
143
|
rest = _objectWithoutProperties(_ref6, _excluded6);
|
|
137
144
|
|
|
138
145
|
locale = useLocale(locale);
|
|
139
|
-
return /*#__PURE__*/
|
|
140
|
-
icon: /*#__PURE__*/
|
|
146
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
147
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInfoIcon, {}),
|
|
141
148
|
title: _translations.default[locale]['coming-soon'].title,
|
|
142
149
|
description: _translations.default[locale]['coming-soon'].description
|
|
143
150
|
}, rest));
|
|
144
|
-
}
|
|
151
|
+
}
|
|
145
152
|
|
|
146
|
-
exports.ComingSoon = ComingSoon;
|
|
147
153
|
ComingSoon.status = 'coming-soon'; // info, 与其它 status 不同, title/description 需要使用方自己传入
|
|
148
154
|
|
|
149
|
-
|
|
150
|
-
return /*#__PURE__*/
|
|
151
|
-
icon: /*#__PURE__*/
|
|
155
|
+
function Info(props) {
|
|
156
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({
|
|
157
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInfoIcon, {})
|
|
152
158
|
}, props));
|
|
153
|
-
}
|
|
159
|
+
}
|
|
154
160
|
|
|
155
|
-
exports.Info = Info;
|
|
156
161
|
Info.status = 'info';
|
|
157
162
|
|
|
158
|
-
|
|
163
|
+
function StyledErrorIcon(props) {
|
|
159
164
|
const theme = (0, _useTheme.default)();
|
|
160
|
-
return /*#__PURE__*/
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CancelRounded.default, _objectSpread({
|
|
161
166
|
style: {
|
|
162
167
|
color: theme.palette.error.main,
|
|
163
168
|
fontSize: 72
|
|
164
169
|
}
|
|
165
170
|
}, props));
|
|
166
|
-
}
|
|
171
|
+
}
|
|
167
172
|
|
|
168
|
-
|
|
173
|
+
function StyledInfoIcon(props) {
|
|
169
174
|
const theme = (0, _useTheme.default)();
|
|
170
|
-
return /*#__PURE__*/
|
|
175
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Info.default, _objectSpread({
|
|
171
176
|
style: {
|
|
172
177
|
color: theme.palette.info.main,
|
|
173
178
|
fontSize: 72
|
|
174
179
|
}
|
|
175
180
|
}, props));
|
|
176
|
-
}
|
|
181
|
+
}
|
package/lib/Result/index.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _result = _interopRequireDefault(require("./result"));
|
|
13
11
|
|
|
14
12
|
var common = _interopRequireWildcard(require("./common"));
|
|
15
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
16
|
const _excluded = ["status"];
|
|
17
17
|
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -35,7 +35,7 @@ const componentsKeyByStatus = Object.keys(common).reduce((acc, cur) => _objectSp
|
|
|
35
35
|
[common[cur].status || cur]: common[cur]
|
|
36
36
|
}), {});
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
function ResultWrapper(_ref) {
|
|
39
39
|
let {
|
|
40
40
|
status
|
|
41
41
|
} = _ref,
|
|
@@ -44,14 +44,14 @@ const ResultWrapper = _ref => {
|
|
|
44
44
|
if (status) {
|
|
45
45
|
if (componentsKeyByStatus[status]) {
|
|
46
46
|
const Component = componentsKeyByStatus[status];
|
|
47
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, rest));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
throw new Error("Please provide a valid status for Result.status. Valid values are: ".concat(Object.keys(componentsKeyByStatus).join(', ')));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
return /*#__PURE__*/
|
|
54
|
-
}
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_result.default, _objectSpread({}, rest));
|
|
54
|
+
}
|
|
55
55
|
|
|
56
56
|
ResultWrapper.propTypes = _objectSpread({
|
|
57
57
|
status: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
package/lib/Result/result.js
CHANGED
|
@@ -5,23 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
11
|
|
|
14
12
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
15
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
16
|
const _excluded = ["icon", "title", "description", "extra"];
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
|
|
20
26
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
27
|
|
|
22
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
function Result(_ref) {
|
|
25
31
|
let {
|
|
26
32
|
icon,
|
|
27
33
|
title,
|
|
@@ -30,21 +36,26 @@ const Result = _ref => {
|
|
|
30
36
|
} = _ref,
|
|
31
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
38
|
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, _objectSpread(_objectSpread({}, rest), {}, {
|
|
40
|
+
children: [icon, typeof title === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
41
|
+
mt: 3,
|
|
42
|
+
fontSize: 22,
|
|
43
|
+
fontWeight: 400,
|
|
44
|
+
color: "#47494E",
|
|
45
|
+
textAlign: "center",
|
|
46
|
+
children: title
|
|
47
|
+
}) : title, typeof description === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
48
|
+
mt: 1,
|
|
49
|
+
fontSize: 14,
|
|
50
|
+
color: "#7F828B",
|
|
51
|
+
textAlign: "center",
|
|
52
|
+
children: description
|
|
53
|
+
}) : description, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
54
|
+
mt: 3,
|
|
55
|
+
children: extra
|
|
56
|
+
})]
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
48
59
|
|
|
49
60
|
Result.propTypes = {
|
|
50
61
|
icon: _propTypes.default.element,
|
package/lib/Screenshot/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -15,10 +15,18 @@ var _Util = require("../Util");
|
|
|
15
15
|
|
|
16
16
|
require("./devices.css");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
const _excluded = ["type", "children", "style", "className", "width", "height"];
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
|
|
22
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
31
|
|
|
24
32
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -95,7 +103,7 @@ const childProps = {
|
|
|
95
103
|
video: ['alt', 'title', 'muted', 'autoplay', 'loop', 'key', 'children']
|
|
96
104
|
};
|
|
97
105
|
|
|
98
|
-
const createChild = child => [/*#__PURE__*/_react.
|
|
106
|
+
const createChild = child => [/*#__PURE__*/(0, _react.createElement)(child.type, childProps[child.type].reduce((acc, x) => {
|
|
99
107
|
acc[x] = child.props[x];
|
|
100
108
|
return acc;
|
|
101
109
|
}, {}))];
|
|
@@ -111,7 +119,7 @@ const findChildren = function findChildren(children) {
|
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
if (child.props && child.props.children) {
|
|
114
|
-
const subChildren = _react.
|
|
122
|
+
const subChildren = _react.Children.toArray(child.props.children);
|
|
115
123
|
|
|
116
124
|
const result = findChildren(subChildren, false);
|
|
117
125
|
|
|
@@ -131,7 +139,7 @@ const findChildren = function findChildren(children) {
|
|
|
131
139
|
// If neither of them are found, the whole child tree is rendered
|
|
132
140
|
|
|
133
141
|
|
|
134
|
-
|
|
142
|
+
function Screenshot(props) {
|
|
135
143
|
const newProps = (0, _Util.mergeProps)(props, Screenshot, ['style', 'width', 'height']);
|
|
136
144
|
|
|
137
145
|
const {
|
|
@@ -148,28 +156,31 @@ const Screenshot = props => {
|
|
|
148
156
|
zIndex = 0,
|
|
149
157
|
borderRadius = 0
|
|
150
158
|
} = types[type] || {};
|
|
151
|
-
return /*#__PURE__*/
|
|
159
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, _objectSpread(_objectSpread({}, rest), {}, {
|
|
152
160
|
type: type,
|
|
153
161
|
className: "device device-".concat(type, " ").concat(className).trim(),
|
|
154
162
|
style: style,
|
|
155
163
|
contentRadius: borderRadius,
|
|
156
|
-
contentZIndex: zIndex
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
contentZIndex: zIndex,
|
|
165
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
166
|
+
className: "device-frame",
|
|
167
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
|
+
className: "device-content",
|
|
169
|
+
children: findChildren(_react.Children.toArray(children))
|
|
170
|
+
})
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
172
|
+
className: "device-stripe"
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
174
|
+
className: "device-header"
|
|
175
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
176
|
+
className: "device-sensors"
|
|
177
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
178
|
+
className: "device-btns"
|
|
179
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
180
|
+
className: "device-power"
|
|
181
|
+
})]
|
|
171
182
|
}));
|
|
172
|
-
}
|
|
183
|
+
}
|
|
173
184
|
|
|
174
185
|
const Div = _styledComponents.default.div.withConfig({
|
|
175
186
|
displayName: "Screenshot__Div",
|
package/lib/Spinner/index.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = Spinner;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
11
9
|
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -33,5 +33,5 @@ function Spinner(props) {
|
|
|
33
33
|
[_props.size] = _props.size;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, _objectSpread({}, _props));
|
|
37
37
|
}
|
package/lib/SplitButton/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = SplitButton;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -27,13 +27,17 @@ var _ButtonGroup = _interopRequireDefault(require("@mui/material/ButtonGroup"));
|
|
|
27
27
|
|
|
28
28
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
29
29
|
|
|
30
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
|
|
30
32
|
const _excluded = ["size", "color", "menu", "children", "variant", "onClick", "menuButtonProps"];
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
|
-
function
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
39
|
|
|
36
|
-
function
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
41
|
|
|
38
42
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
39
43
|
|
|
@@ -73,27 +77,39 @@ function SplitButton(_ref) {
|
|
|
73
77
|
}
|
|
74
78
|
};
|
|
75
79
|
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledButtonGroup, _objectSpread(_objectSpread({
|
|
82
|
+
variant: variant,
|
|
83
|
+
size: size,
|
|
84
|
+
color: color,
|
|
85
|
+
ref: anchorRef
|
|
86
|
+
}, rest), {}, {
|
|
87
|
+
children: [typeof children === 'function' ? children() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
88
|
+
onClick: onClick,
|
|
89
|
+
color: color,
|
|
90
|
+
children: children
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread({
|
|
92
|
+
onClick: onToggle,
|
|
93
|
+
color: color
|
|
94
|
+
}, menuButtonProps), {}, {
|
|
95
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {})
|
|
96
|
+
}))]
|
|
97
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledPopper, {
|
|
98
|
+
open: open,
|
|
99
|
+
anchorEl: anchorRef.current,
|
|
100
|
+
placement: "bottom-end",
|
|
101
|
+
disablePortal: false,
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Paper.default, {
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickAwayListener.default, {
|
|
104
|
+
onClickAway: handleClose,
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuList.default, {
|
|
106
|
+
onClick: handleItemClick,
|
|
107
|
+
children: menu
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
97
113
|
}
|
|
98
114
|
|
|
99
115
|
SplitButton.propTypes = {
|
package/lib/Switch/index.js
CHANGED
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
9
|
|
|
12
10
|
var _styles = require("@mui/material/styles");
|
|
@@ -15,6 +13,8 @@ var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormContro
|
|
|
15
13
|
|
|
16
14
|
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
17
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
18
|
const _excluded = ["labelProps"];
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -23,8 +23,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
23
23
|
|
|
24
24
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
25
|
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
|
|
26
32
|
// 参考: https://mui.com/material-ui/react-switch/#customization
|
|
27
|
-
const IOSSwitch = (0, _styles.styled)(props => /*#__PURE__*/
|
|
33
|
+
const IOSSwitch = (0, _styles.styled)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, _objectSpread({
|
|
28
34
|
focusVisibleClassName: ".Mui-focusVisible",
|
|
29
35
|
disableRipple: true
|
|
30
36
|
}, props)))(_ref => {
|
|
@@ -89,12 +95,12 @@ function Switch(_ref2) {
|
|
|
89
95
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
90
96
|
|
|
91
97
|
if (labelProps) {
|
|
92
|
-
return /*#__PURE__*/
|
|
93
|
-
control: /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, _objectSpread({
|
|
99
|
+
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(IOSSwitch, _objectSpread({}, rest))
|
|
94
100
|
}, labelProps));
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
return /*#__PURE__*/
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(IOSSwitch, _objectSpread({}, rest));
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
Switch.propTypes = {
|