@widergy/energy-ui 3.4.0 → 3.4.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,17 @@
1
+ ## [3.4.2](https://github.com/widergy/energy-ui/compare/v3.4.1...v3.4.2) (2024-02-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * initial valid rows per page when integration type is external ([#425](https://github.com/widergy/energy-ui/issues/425)) ([2ce679f](https://github.com/widergy/energy-ui/commit/2ce679f0af51065fb6bd5de116f6450e0b4a620c))
7
+
8
+ ## [3.4.1](https://github.com/widergy/energy-ui/compare/v3.4.0...v3.4.1) (2024-02-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * uttable responsive breakpoint fix ([#419](https://github.com/widergy/energy-ui/issues/419)) ([f6a16d7](https://github.com/widergy/energy-ui/commit/f6a16d7b2702078ebb8254bc3c6e49a74a0a9ddb))
14
+
1
15
  # [3.4.0](https://github.com/widergy/energy-ui/compare/v3.3.0...v3.4.0) (2024-02-23)
2
16
 
3
17
 
@@ -59,7 +59,7 @@ const TableRow = _ref => {
59
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");
60
60
  return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
61
61
  onClick: handleRowClick,
62
- className: "\n ".concat(_stylesModule.default.row, "\n ").concat((!handleRowClick || isResponsive) && _stylesModule.default.noClick, "\n ").concat(isResponsive && cellProps.classes.responsiveRow, "\n ").concat(className, "\n "),
62
+ className: "\n ".concat(_stylesModule.default.row, "\n ").concat((!handleRowClick || isResponsive) && _stylesModule.default.noClick, "\n ").concat(isResponsive && cellProps.classes.responsiveRow, "\n ").concat(isResponsive && _stylesModule.default.responsiveRow, "\n ").concat(className, "\n "),
63
63
  style: containerStyle
64
64
  }, !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
65
65
  className: _stylesModule.default.stickyRowBackground
@@ -104,7 +104,7 @@ const TableRow = _ref => {
104
104
  rowData: cellProps.rowData,
105
105
  classes: cellProps.classes
106
106
  })))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
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 "),
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 "),
108
108
  style: {
109
109
  width: isResponsive ? 'auto' : columnSizes.secondaryColumnsSize
110
110
  }
@@ -1,5 +1,3 @@
1
- @import '../../../../scss/variables/mediaQueries.module.scss';
2
-
3
1
  $selection-element-size: 42px;
4
2
 
5
3
  .row {
@@ -12,7 +10,7 @@ $selection-element-size: 42px;
12
10
  margin-bottom: 0 !important;
13
11
  }
14
12
 
15
- @media #{$tablet-mobile} {
13
+ .responsiveRow & {
16
14
  margin-bottom: 24px !important;
17
15
  }
18
16
  }
@@ -40,7 +38,7 @@ $selection-element-size: 42px;
40
38
  @extend %fixedRow;
41
39
  left: 0;
42
40
 
43
- @media #{$tablet-mobile} {
41
+ .responsiveRow & {
44
42
  border: 1;
45
43
  }
46
44
  }
@@ -70,7 +68,7 @@ $selection-element-size: 42px;
70
68
  align-items: center;
71
69
  display: flex;
72
70
 
73
- @media #{$tablet-mobile} {
71
+ .responsiveRow & {
74
72
  &::before {
75
73
  content: '';
76
74
  height: 5px;
@@ -91,7 +89,8 @@ $selection-element-size: 42px;
91
89
 
92
90
  .checkboxColorPrimary {
93
91
  padding: 10px !important;
94
- @media #{$tablet-mobile} {
92
+
93
+ .responsiveRow & {
95
94
  padding: 0 !important;
96
95
  }
97
96
  }
@@ -99,7 +98,7 @@ $selection-element-size: 42px;
99
98
  .secondaryColumns {
100
99
  display: flex;
101
100
 
102
- @media #{$tablet-mobile} {
101
+ .responsiveRow & {
103
102
  flex-direction: column;
104
103
  }
105
104
  }
@@ -79,7 +79,7 @@ const UTTable = _ref => {
79
79
  totalRows,
80
80
  totalRowsLabel
81
81
  } = _ref;
82
- const initialValidRowsPerPageOption = (0, _utils.getInitialValidRowsPerPage)(externalRowsPerPage, rowsPerPageOptions, data);
82
+ const initialValidRowsPerPageOption = (0, _utils.getInitialValidRowsPerPage)(externalRowsPerPage, rowsPerPageOptions, data, integrationType, totalRows);
83
83
  const initialValidPage = (0, _utils.getInitialValidPage)(externalPage, initialValidRowsPerPageOption, data, integrationType);
84
84
  const [order, setOrder] = (0, _react.useState)(initialOrder || {});
85
85
  const [rows, setRows] = (0, _react.useState)([]);
@@ -216,7 +216,7 @@ const UTTable = _ref => {
216
216
  },
217
217
  checkBoxOnChange: () => selectRow(row),
218
218
  checkBoxSelected: isSelected,
219
- className: "".concat(_stylesModule.default.responsiveRow, " ").concat(isRowClickable && classes.rowContainerClickable, " ").concat(getRowClassName(row)),
219
+ className: "\n ".concat(isResponsive && _stylesModule.default.responsiveRow, "\n ").concat(isRowClickable && classes.rowContainerClickable, "\n ").concat(getRowClassName(row), "\n "),
220
220
  columnsDefinition: columnsDefinition,
221
221
  columnSizes: columnSizes,
222
222
  containerStyle: {
@@ -1,5 +1,4 @@
1
1
  @import '../../scss/variables/colors.module.scss';
2
- @import '../../scss/variables/mediaQueries.module.scss';
3
2
 
4
3
  .table {
5
4
  position: relative;
@@ -64,8 +63,6 @@
64
63
  }
65
64
 
66
65
  .responsiveRow {
67
- @media #{$tablet-mobile} {
68
- display: flex;
69
- flex-direction: column !important;
70
- }
66
+ display: flex;
67
+ flex-direction: column !important;
71
68
  }
@@ -136,9 +136,9 @@ const createRowStyles = (rowPadding, rowSpacing, headerPadding, isResponsive) =>
136
136
  exports.createRowStyles = createRowStyles;
137
137
  const getSelectableRowIds = (rows, rowKey, disableRowSelection) => (disableRowSelection ? rows.filter(_row => !disableRowSelection(_row)) : rows).map(_row => _row[rowKey]);
138
138
  exports.getSelectableRowIds = getSelectableRowIds;
139
- const getInitialValidRowsPerPage = (externalOption, originalOptions, data) => {
139
+ const getInitialValidRowsPerPage = (externalOption, originalOptions, data, integrationType, totalRows) => {
140
140
  if (externalOption === undefined) return originalOptions[0];
141
- const options = (0, _utils.getPageSizeOptions)(originalOptions, data.length).map(_ref2 => {
141
+ const options = (0, _utils.getPageSizeOptions)(originalOptions, integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? totalRows : data.length).map(_ref2 => {
142
142
  let {
143
143
  value
144
144
  } = _ref2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",