@widergy/energy-ui 1.110.1 → 1.110.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.110.2](https://github.com/widergy/energy-ui/compare/v1.110.1...v1.110.2) (2022-02-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * uttable actions optimization ([#259](https://github.com/widergy/energy-ui/issues/259)) ([ddfed55](https://github.com/widergy/energy-ui/commit/ddfed55c16c19f2f998ba316e8eb1953c0340b6c))
7
+
1
8
  ## [1.110.1](https://github.com/widergy/energy-ui/compare/v1.110.0...v1.110.1) (2022-02-10)
2
9
 
3
10
 
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DEAULT_LOADING_SIZE = void 0;
7
+ var DEAULT_LOADING_SIZE = 24;
8
+ exports.DEAULT_LOADING_SIZE = DEAULT_LOADING_SIZE;
@@ -13,7 +13,7 @@ var _propTypes = require("prop-types");
13
13
 
14
14
  var _array = require("@widergy/web-utils/lib/array");
15
15
 
16
- var _UTIconButton = _interopRequireDefault(require("../../../UTIconButton"));
16
+ var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
17
17
 
18
18
  var _UTTooltip = _interopRequireDefault(require("../../../UTTooltip"));
19
19
 
@@ -21,6 +21,8 @@ var _UTMenu = _interopRequireDefault(require("../../../UTMenu"));
21
21
 
22
22
  var _types = require("../../types");
23
23
 
24
+ var _constants = require("./constants");
25
+
24
26
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
25
27
 
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -60,6 +62,8 @@ var ActionIcons = function ActionIcons(_ref) {
60
62
  iconClassName = _ref2.iconClassName,
61
63
  disabledIconClassName = _ref2.disabledIconClassName,
62
64
  loadingClassName = _ref2.loadingClassName,
65
+ _ref2$loadingSize = _ref2.loadingSize,
66
+ loadingSize = _ref2$loadingSize === void 0 ? _constants.DEAULT_LOADING_SIZE : _ref2$loadingSize,
63
67
  _ref2$isVisible = _ref2.isVisible,
64
68
  isVisible = _ref2$isVisible === void 0 ? function () {
65
69
  return true;
@@ -126,17 +130,18 @@ var ActionIcons = function ActionIcons(_ref) {
126
130
  content: tooltipContent,
127
131
  stringContentClassName: _stylesModule.default.tooltip,
128
132
  tippyProps: tippyProps
129
- }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_UTIconButton.default, {
130
- className: "".concat(_stylesModule.default.iconButton, " ").concat(classes.actionIconButton, " ").concat(buttonClassName),
131
- loadingClassName: loadingClassName,
132
- loading: isLoading(rowData),
133
+ }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("div", {
134
+ className: "".concat(_stylesModule.default.iconButton, " ").concat(classes.actionIconButton, " \n ").concat((isDisabled(rowData) || isLoading(rowData)) && _stylesModule.default.disabled, " ").concat(buttonClassName),
133
135
  onClick: function onClick(event) {
134
136
  return handleActionClick(event, rowData);
135
137
  },
136
- disabled: isDisabled(rowData)
137
- }, /*#__PURE__*/_react.default.createElement(Icon, {
138
+ role: "button"
139
+ }, isLoading(rowData) ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
140
+ className: "".concat(classes.actionLoading, " ").concat(loadingClassName),
141
+ size: loadingSize
142
+ }) : /*#__PURE__*/_react.default.createElement(Icon, {
138
143
  className: "".concat(classes.actionIcon, " ").concat(iconClassName, " ").concat(isDisabled(rowData) && disabledIconClassName)
139
- })), !(0, _array.isEmpty)(menuItems) && /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
144
+ })), !!menuAnchor && !(0, _array.isEmpty)(menuItems) && /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
140
145
  anchor: menuAnchor,
141
146
  contextData: menuRowContextData,
142
147
  onClose: closeMenu,
@@ -1,6 +1,25 @@
1
+ @import '../../../../scss//variables/colors';
2
+
1
3
  .iconButton {
4
+ align-items: center;
5
+ border-radius: 50%;
6
+ display: flex;
7
+ justify-content: center;
2
8
  margin: -4px 0;
3
9
  padding: 8px;
10
+ transition: 0.5s;
11
+
12
+ &:not(.disabled) {
13
+ cursor: pointer;
14
+
15
+ &:hover {
16
+ background-color: darken($white, 10%);
17
+ }
18
+ }
19
+ }
20
+
21
+ .disabled {
22
+ pointer-events: none;
4
23
  }
5
24
 
6
25
  .tooltip {
@@ -346,6 +346,9 @@ var retrieveStyle = function retrieveStyle(theme) {
346
346
  '&:before': {
347
347
  backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'headerDecorator', 'unSelected', 'color'], _colors.default.gray3)
348
348
  }
349
+ },
350
+ actionLoading: {
351
+ color: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'base', 'color'], _colors.default.loadingBase)
349
352
  }
350
353
  };
351
354
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.110.1",
3
+ "version": "1.110.2",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",