@arcblock/ux 1.16.53 → 1.16.56
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/Spinner/index.js +1 -20
- package/lib/SplitButton/index.js +9 -6
- package/package.json +4 -4
- package/src/Spinner/index.js +0 -14
- package/src/SplitButton/index.js +13 -2
package/lib/Spinner/index.js
CHANGED
|
@@ -7,8 +7,6 @@ exports.default = Spinner;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
|
|
13
11
|
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -28,29 +26,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
28
26
|
* - color 默认使用 #4598fa, 如果调用方传入了 color prop 或 style#color, 则默认 color 被覆盖
|
|
29
27
|
*/
|
|
30
28
|
function Spinner(props) {
|
|
31
|
-
var _props$style;
|
|
32
|
-
|
|
33
29
|
const _props = _objectSpread({}, props); // 兼容之前的 size prop (设置外圈/内圈的尺寸)
|
|
34
30
|
|
|
35
31
|
|
|
36
32
|
if (_props.size && Array.isArray(_props.size)) {
|
|
37
33
|
[_props.size] = _props.size;
|
|
38
|
-
} // 默认 color: #4598fa
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (!(_props.color || (_props$style = _props.style) !== null && _props$style !== void 0 && _props$style.color)) {
|
|
42
|
-
_props.style = _objectSpread(_objectSpread({}, _props.style), {}, {
|
|
43
|
-
color: '#4598fa'
|
|
44
|
-
});
|
|
45
34
|
}
|
|
46
35
|
|
|
47
36
|
return /*#__PURE__*/_react.default.createElement(_CircularProgress.default, _props);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
Spinner.propTypes = {
|
|
51
|
-
// 改为基于 @material-ui/core/CircularProgress 的实现后, 该 prop 将被废弃
|
|
52
|
-
duration: _propTypes.default.array
|
|
53
|
-
};
|
|
54
|
-
Spinner.defaultProps = {
|
|
55
|
-
duration: [1, 1.6]
|
|
56
|
-
};
|
|
37
|
+
}
|
package/lib/SplitButton/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var _ButtonGroup = _interopRequireDefault(require("@material-ui/core/ButtonGroup
|
|
|
27
27
|
|
|
28
28
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
29
29
|
|
|
30
|
-
const _excluded = ["size", "color", "menu", "children", "variant", "onClick"];
|
|
30
|
+
const _excluded = ["size", "color", "menu", "children", "variant", "onClick", "menuButtonProps"];
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
@@ -46,7 +46,8 @@ function SplitButton(_ref) {
|
|
|
46
46
|
menu,
|
|
47
47
|
children,
|
|
48
48
|
variant,
|
|
49
|
-
onClick
|
|
49
|
+
onClick,
|
|
50
|
+
menuButtonProps
|
|
50
51
|
} = _ref,
|
|
51
52
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
53
|
|
|
@@ -80,10 +81,10 @@ function SplitButton(_ref) {
|
|
|
80
81
|
}, rest), typeof children === 'function' ? children() : /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
81
82
|
onClick: onClick,
|
|
82
83
|
color: color
|
|
83
|
-
}, children), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
84
|
+
}, children), /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
|
|
84
85
|
onClick: onToggle,
|
|
85
86
|
color: color
|
|
86
|
-
}, /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null))), /*#__PURE__*/_react.default.createElement(StyledPopper, {
|
|
87
|
+
}, menuButtonProps), /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null))), /*#__PURE__*/_react.default.createElement(StyledPopper, {
|
|
87
88
|
open: open,
|
|
88
89
|
anchorEl: anchorRef.current,
|
|
89
90
|
placement: "bottom-end",
|
|
@@ -102,7 +103,8 @@ SplitButton.propTypes = {
|
|
|
102
103
|
// 也可以是用于渲染主按钮的 function
|
|
103
104
|
children: _propTypes.default.any,
|
|
104
105
|
variant: _propTypes.default.oneOf(['outlined', 'contained']),
|
|
105
|
-
onClick: _propTypes.default.func
|
|
106
|
+
onClick: _propTypes.default.func,
|
|
107
|
+
menuButtonProps: _propTypes.default.object
|
|
106
108
|
};
|
|
107
109
|
SplitButton.defaultProps = {
|
|
108
110
|
size: 'medium',
|
|
@@ -110,7 +112,8 @@ SplitButton.defaultProps = {
|
|
|
110
112
|
menu: [],
|
|
111
113
|
children: null,
|
|
112
114
|
variant: 'contained',
|
|
113
|
-
onClick: () => {}
|
|
115
|
+
onClick: () => {},
|
|
116
|
+
menuButtonProps: {}
|
|
114
117
|
};
|
|
115
118
|
SplitButton.Item = _MenuItem.default;
|
|
116
119
|
const StyledButtonGroup = (0, _styledComponents.default)(_ButtonGroup.default).withConfig({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.56",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"react": ">=16.12.0",
|
|
54
54
|
"react-ga": "^2.7.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4c7f0557738e4339b364c192b97ebdb06cde16c1",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@arcblock/icons": "^1.16.
|
|
59
|
-
"@arcblock/react-hooks": "^1.16.
|
|
58
|
+
"@arcblock/icons": "^1.16.56",
|
|
59
|
+
"@arcblock/react-hooks": "^1.16.56",
|
|
60
60
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
61
61
|
"@fontsource/lato": "^4.5.3",
|
|
62
62
|
"@material-ui/core": "^4.12.3",
|
package/src/Spinner/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -16,18 +15,5 @@ export default function Spinner(props) {
|
|
|
16
15
|
if (_props.size && Array.isArray(_props.size)) {
|
|
17
16
|
[_props.size] = _props.size;
|
|
18
17
|
}
|
|
19
|
-
// 默认 color: #4598fa
|
|
20
|
-
if (!(_props.color || _props.style?.color)) {
|
|
21
|
-
_props.style = { ..._props.style, color: '#4598fa' };
|
|
22
|
-
}
|
|
23
18
|
return <CircularProgress {..._props} />;
|
|
24
19
|
}
|
|
25
|
-
|
|
26
|
-
Spinner.propTypes = {
|
|
27
|
-
// 改为基于 @material-ui/core/CircularProgress 的实现后, 该 prop 将被废弃
|
|
28
|
-
duration: PropTypes.array,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
Spinner.defaultProps = {
|
|
32
|
-
duration: [1, 1.6],
|
|
33
|
-
};
|
package/src/SplitButton/index.js
CHANGED
|
@@ -10,7 +10,16 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|
|
10
10
|
import ButtonGroup from '@material-ui/core/ButtonGroup';
|
|
11
11
|
import Button from '../Button';
|
|
12
12
|
|
|
13
|
-
export default function SplitButton({
|
|
13
|
+
export default function SplitButton({
|
|
14
|
+
size,
|
|
15
|
+
color,
|
|
16
|
+
menu,
|
|
17
|
+
children,
|
|
18
|
+
variant,
|
|
19
|
+
onClick,
|
|
20
|
+
menuButtonProps,
|
|
21
|
+
...rest
|
|
22
|
+
}) {
|
|
14
23
|
const [open, setOpen] = useState(false);
|
|
15
24
|
const anchorRef = useRef(null);
|
|
16
25
|
|
|
@@ -42,7 +51,7 @@ export default function SplitButton({ size, color, menu, children, variant, onCl
|
|
|
42
51
|
{children}
|
|
43
52
|
</Button>
|
|
44
53
|
)}
|
|
45
|
-
<Button onClick={onToggle} color={color}>
|
|
54
|
+
<Button onClick={onToggle} color={color} {...menuButtonProps}>
|
|
46
55
|
<ExpandMore />
|
|
47
56
|
</Button>
|
|
48
57
|
</StyledButtonGroup>
|
|
@@ -69,6 +78,7 @@ SplitButton.propTypes = {
|
|
|
69
78
|
children: PropTypes.any,
|
|
70
79
|
variant: PropTypes.oneOf(['outlined', 'contained']),
|
|
71
80
|
onClick: PropTypes.func,
|
|
81
|
+
menuButtonProps: PropTypes.object,
|
|
72
82
|
};
|
|
73
83
|
|
|
74
84
|
SplitButton.defaultProps = {
|
|
@@ -78,6 +88,7 @@ SplitButton.defaultProps = {
|
|
|
78
88
|
children: null,
|
|
79
89
|
variant: 'contained',
|
|
80
90
|
onClick: () => {},
|
|
91
|
+
menuButtonProps: {},
|
|
81
92
|
};
|
|
82
93
|
|
|
83
94
|
SplitButton.Item = MenuItem;
|