@arcblock/ux 1.16.55 → 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/SplitButton/index.js +9 -6
- package/package.json +4 -4
- package/src/SplitButton/index.js +13 -2
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/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;
|