@arcblock/ux 1.15.16 → 1.15.20
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/Button/wrap.js +5 -4
- package/package.json +4 -4
package/lib/Button/wrap.js
CHANGED
|
@@ -37,6 +37,7 @@ function _default(BaseComponent) {
|
|
|
37
37
|
} = newProps,
|
|
38
38
|
rest = _objectWithoutProperties(newProps, _excluded);
|
|
39
39
|
|
|
40
|
+
const isDisabled = disabled || loading;
|
|
40
41
|
let loadingSize = 16;
|
|
41
42
|
|
|
42
43
|
switch (rest.size) {
|
|
@@ -68,11 +69,11 @@ function _default(BaseComponent) {
|
|
|
68
69
|
|
|
69
70
|
if (!rest.color || rest.color === 'default') {
|
|
70
71
|
if (rest.variant === 'contained') {
|
|
71
|
-
styles.backgroundColor =
|
|
72
|
+
styles.backgroundColor = isDisabled ? _Theme.colors.lightGrey : _Theme.colors.primary;
|
|
72
73
|
styles.color = _Theme.colors.white;
|
|
73
74
|
} else {
|
|
74
|
-
styles.borderColor =
|
|
75
|
-
styles.color =
|
|
75
|
+
styles.borderColor = isDisabled ? _Theme.colors.lightGrey : _Theme.colors.primary;
|
|
76
|
+
styles.color = isDisabled ? _Theme.colors.lightGrey : _Theme.colors.primary;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
@@ -94,7 +95,7 @@ function _default(BaseComponent) {
|
|
|
94
95
|
return /*#__PURE__*/_react.default.createElement(BaseComponent, Object.assign({
|
|
95
96
|
style: styles,
|
|
96
97
|
ref: forwardedRef,
|
|
97
|
-
disabled:
|
|
98
|
+
disabled: isDisabled
|
|
98
99
|
}, rest), loading && /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
99
100
|
size: loadingSize,
|
|
100
101
|
style: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.20",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=16.12.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "0c4c81779f27921b7cd0c3621482050aedfd594c",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^1.15.
|
|
58
|
-
"@arcblock/react-hooks": "^1.15.
|
|
57
|
+
"@arcblock/icons": "^1.15.20",
|
|
58
|
+
"@arcblock/react-hooks": "^1.15.20",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@material-ui/core": "^4.12.3",
|
|
61
61
|
"@material-ui/icons": "4.11.2",
|