linear-react-components-ui 1.1.3-beta.0 → 1.1.3-beta.2
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/.eslintcache +1 -1
- package/lib/buttons/DefaultButton.js +13 -11
- package/package.json +1 -1
|
@@ -73,6 +73,13 @@ const DefaultButton = _ref => {
|
|
|
73
73
|
handlerSetOnDeniedText
|
|
74
74
|
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
75
75
|
const getClass = () => "button-component ".concat(className, "\n ").concat(customClass, "\n ").concat(transparent && '-transparent', "\n ").concat(isDisabled && '-disabled', "\n ").concat(size && "-".concat(size), "\n ").concat(dropdown && !round && 'icon-right', "\n ").concat(dropdown && round && 'icon-center', "\n ").concat(iconAlign && !dropdown && "icon-".concat(iconAlign), "\n ").concat(boxShadow ? '' : '-shadowsdisabled', "\n ").concat(round && '-round');
|
|
76
|
+
const returnPadlockIcon = resultantStyle => /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
77
|
+
name: "padlock",
|
|
78
|
+
size: 16,
|
|
79
|
+
pointerEvents: "none",
|
|
80
|
+
color: disabledIconColor,
|
|
81
|
+
style: resultantStyle
|
|
82
|
+
});
|
|
76
83
|
const getIcon = () => {
|
|
77
84
|
let resultantStyle = iconStyle;
|
|
78
85
|
if (isDisabled) {
|
|
@@ -91,30 +98,25 @@ const DefaultButton = _ref => {
|
|
|
91
98
|
});
|
|
92
99
|
}
|
|
93
100
|
if (icon) {
|
|
94
|
-
if (
|
|
101
|
+
if (disabledByPermission) {
|
|
102
|
+
return returnPadlockIcon(resultantStyle);
|
|
103
|
+
} else if (disabled) {
|
|
95
104
|
return /*#__PURE__*/_react.default.createElement(_icons.default, _extends({}, icon.props, {
|
|
96
105
|
color: disabledIconColor
|
|
97
106
|
}));
|
|
98
107
|
}
|
|
99
108
|
return icon;
|
|
109
|
+
} else if (!icon && disabledByPermission) {
|
|
110
|
+
return returnPadlockIcon(resultantStyle);
|
|
100
111
|
} else if (iconName) {
|
|
101
112
|
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
102
|
-
name:
|
|
113
|
+
name: iconName,
|
|
103
114
|
size: 16,
|
|
104
115
|
color: toggleable && activeIconColor && activeButton && activeIconColor || '#676464',
|
|
105
116
|
pointerEvents: "none",
|
|
106
117
|
style: resultantStyle
|
|
107
118
|
});
|
|
108
119
|
}
|
|
109
|
-
if (!icon && disabledByPermission) {
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
111
|
-
name: "padlock",
|
|
112
|
-
size: 16,
|
|
113
|
-
pointerEvents: "none",
|
|
114
|
-
color: disabledIconColor,
|
|
115
|
-
style: resultantStyle
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
120
|
return null;
|
|
119
121
|
};
|
|
120
122
|
(0, _react.useEffect)(() => {
|