@widergy/energy-ui 3.1.1 → 3.1.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
|
+
## [3.1.2](https://github.com/widergy/energy-ui/compare/v3.1.1...v3.1.2) (2024-01-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* responsive table fixes ([#401](https://github.com/widergy/energy-ui/issues/401)) ([870a518](https://github.com/widergy/energy-ui/commit/870a518810b84f2465a72ffc973c048941d55da0))
|
|
7
|
+
|
|
1
8
|
## [3.1.1](https://github.com/widergy/energy-ui/compare/v3.1.0...v3.1.1) (2024-01-10)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -16,6 +16,7 @@ var _ActionIcons = _interopRequireDefault(require("../ActionIcons"));
|
|
|
16
16
|
var _PrimaryAction = _interopRequireDefault(require("../PrimaryAction"));
|
|
17
17
|
var _types = require("../../types");
|
|
18
18
|
var _constants2 = require("./constants");
|
|
19
|
+
var _utils = require("./utils");
|
|
19
20
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -54,7 +55,8 @@ const TableRow = _ref => {
|
|
|
54
55
|
secondaryActions = []
|
|
55
56
|
} = columnsDefinition;
|
|
56
57
|
const SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
|
|
57
|
-
const
|
|
58
|
+
const hasActionsRow = selectable || (0, _utils.hasVisibleActions)(secondaryActions, cellProps.rowData);
|
|
59
|
+
const selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(hasActionsRow ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden, "\n ") : "\n\t".concat(_stylesModule.default.fixedRowLeft, "\n\t").concat(fixedRowsLeftClassName, "\n\t").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedLeftColumns)) && _stylesModule.default.disableBorderRight, "\n\t").concat(!selectable && (0, _array.isEmpty)(fixedLeftColumns) && _stylesModule.default.cleanFixedColumns, "\n");
|
|
58
60
|
return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
59
61
|
onClick: handleRowClick,
|
|
60
62
|
className: "\n ".concat(_stylesModule.default.row, "\n ").concat((!handleRowClick || isResponsive) && _stylesModule.default.noClick, "\n ").concat(isResponsive && cellProps.classes.responsiveRow, "\n ").concat(className, "\n "),
|
|
@@ -102,7 +104,7 @@ const TableRow = _ref => {
|
|
|
102
104
|
rowData: cellProps.rowData,
|
|
103
105
|
classes: cellProps.classes
|
|
104
106
|
})))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
-
className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n "),
|
|
107
|
+
className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n ").concat(isResponsive && hasActionsRow && _stylesModule.default.fixBorderRadius, "\n "),
|
|
106
108
|
style: {
|
|
107
109
|
width: isResponsive ? 'auto' : columnSizes.secondaryColumnsSize
|
|
108
110
|
}
|
|
@@ -133,7 +133,7 @@ $selection-element-size: 42px;
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
.hidden {
|
|
136
|
-
display: none;
|
|
136
|
+
display: none !important;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
.hideTopBorder {
|
|
@@ -146,3 +146,10 @@ $selection-element-size: 42px;
|
|
|
146
146
|
.disableSelectionTooltip {
|
|
147
147
|
text-align: center;
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
.fixBorderRadius {
|
|
151
|
+
& :first-child {
|
|
152
|
+
border-top-left-radius: 0 !important;
|
|
153
|
+
border-top-right-radius: 0 !important;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasVisibleActions = void 0;
|
|
7
|
+
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
+
const hasVisibleActions = (secondaryActions, rowData) => !(0, _array.isEmpty)(secondaryActions) && secondaryActions.some(secondaryAction => {
|
|
9
|
+
var _secondaryAction$acti;
|
|
10
|
+
return secondaryAction === null || secondaryAction === void 0 || (_secondaryAction$acti = secondaryAction.actions) === null || _secondaryAction$acti === void 0 ? void 0 : _secondaryAction$acti.some(action => action.isVisible(rowData));
|
|
11
|
+
});
|
|
12
|
+
exports.hasVisibleActions = hasVisibleActions;
|