@widergy/energy-ui 1.95.4 → 1.96.1

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,31 @@
1
+ ## [1.96.1](https://github.com/widergy/energy-ui/compare/v1.96.0...v1.96.1) (2021-09-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * set scrollbar size in uttable ([#223](https://github.com/widergy/energy-ui/issues/223)) ([9e6eb2d](https://github.com/widergy/energy-ui/commit/9e6eb2d9ae2f9eee01e33243a6c4d1fcb67c290a))
7
+
8
+ # [1.96.0](https://github.com/widergy/energy-ui/compare/v1.95.6...v1.96.0) (2021-09-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * added initial order prop to uttable ([#220](https://github.com/widergy/energy-ui/issues/220)) ([41cdd13](https://github.com/widergy/energy-ui/commit/41cdd131b5189fd17ea1ab67cede83eaf8543ba6))
14
+
15
+ ## [1.95.6](https://github.com/widergy/energy-ui/compare/v1.95.5...v1.95.6) (2021-09-15)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Fixed responsive cell styles ([#219](https://github.com/widergy/energy-ui/issues/219)) ([af88a66](https://github.com/widergy/energy-ui/commit/af88a66cdbf29f6f20368c4665edff95b7a1a089))
21
+
22
+ ## [1.95.5](https://github.com/widergy/energy-ui/compare/v1.95.4...v1.95.5) (2021-09-15)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * uttable minor fix ([#218](https://github.com/widergy/energy-ui/issues/218)) ([1be054d](https://github.com/widergy/energy-ui/commit/1be054d7a283a0f6949569ebe5632d908713e28d))
28
+
1
29
  ## [1.95.4](https://github.com/widergy/energy-ui/compare/v1.95.3...v1.95.4) (2021-09-15)
2
30
 
3
31
 
@@ -86,7 +86,7 @@ var TableRow = function TableRow(_ref) {
86
86
  };
87
87
  return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_UTTouchableWithoutFeedback["default"], {
88
88
  onClick: handleRowClick,
89
- className: "".concat(_stylesModule["default"].row, " ").concat((!handleRowClick || isResponsive) && _stylesModule["default"].noClick, " ").concat(className),
89
+ className: "".concat(_stylesModule["default"].row, " ").concat((!handleRowClick || isResponsive) && _stylesModule["default"].noClick, " ").concat(isResponsive && cellProps.classes.responsiveRow, " ").concat(className),
90
90
  style: containerStyle
91
91
  }, !isResponsive && /*#__PURE__*/_react["default"].createElement("div", {
92
92
  className: _stylesModule["default"].stickyRowBackground
@@ -129,7 +129,7 @@ var TableRow = function TableRow(_ref) {
129
129
  classes: cellProps.classes
130
130
  });
131
131
  }))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react["default"].createElement("div", {
132
- className: "".concat(_stylesModule["default"].secondaryColumns, " ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, " ").concat(isResponsive && cellProps.classes.responsiveRow, " ").concat(isResponsive && selectable && _stylesModule["default"].hideTopBorder)
132
+ className: "".concat(_stylesModule["default"].secondaryColumns, " ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, " ").concat(isResponsive && selectable && _stylesModule["default"].hideTopBorder)
133
133
  }, secondaryColumns.map(function (column, index) {
134
134
  return /*#__PURE__*/_react["default"].createElement(CellComponent, _extends({
135
135
  key: "cell_".concat(column.key),
@@ -147,11 +147,12 @@ var UTTable = function UTTable(_ref) {
147
147
  tableTitle = _ref.tableTitle,
148
148
  totalRows = _ref.totalRows,
149
149
  totalRowsLabel = _ref.totalRowsLabel,
150
- stickyHeader = _ref.stickyHeader;
150
+ stickyHeader = _ref.stickyHeader,
151
+ initialOrder = _ref.initialOrder;
151
152
  var initialValidRowsPerPageOption = (0, _utils.getInitialValidRowsPerPage)(externalRowsPerPage, rowsPerPageOptions, data);
152
153
  var initialValidPage = (0, _utils.getInitialValidPage)(externalPage, initialValidRowsPerPageOption, data);
153
154
 
154
- var _useState = (0, _react.useState)({}),
155
+ var _useState = (0, _react.useState)(initialOrder || {}),
155
156
  _useState2 = _slicedToArray(_useState, 2),
156
157
  order = _useState2[0],
157
158
  setOrder = _useState2[1];
@@ -204,7 +205,7 @@ var UTTable = function UTTable(_ref) {
204
205
  return function () {
205
206
  return window.removeEventListener(_browser.RESIZE_EVENT, handleResize);
206
207
  };
207
- });
208
+ }, []);
208
209
  (0, _react.useEffect)(function () {
209
210
  if (!selectAllInCurrentPageOnly) setSelectedAll(!(0, _array.isEmpty)(data) && initialSelectedRows.length === data.length);
210
211
  setSelectedRows(initialSelectedRows);
@@ -334,7 +335,7 @@ var UTTable = function UTTable(_ref) {
334
335
  }, /*#__PURE__*/_react["default"].createElement(_reactPerfectScrollbar["default"], {
335
336
  onSync: handleScrollbarSync,
336
337
  onScroll: handleSinchronizeContent,
337
- className: "\n ".concat(_stylesModule["default"].scrollbar, "\n ").concat(headerPadding === _constants.ROW_PADDING_NAMES.SMALL ? _stylesModule["default"].scrollbarSmallPadding : _stylesModule["default"].scrollbarMediumPadding, "\n ").concat(classes.scrollbar, "\n ").concat(loading && _stylesModule["default"].disableHeader),
338
+ className: "\n ".concat(_stylesModule["default"].scrollbar, "\n ").concat(classes.scrollbar, "\n ").concat(loading && _stylesModule["default"].disableHeader),
338
339
  options: {
339
340
  suppressScrollY: true
340
341
  },
@@ -484,7 +485,11 @@ UTTable.propTypes = {
484
485
  defaultNullValue: _propTypes.string,
485
486
  getRowClassName: _propTypes.func,
486
487
  selectAllInCurrentPageOnly: _propTypes.bool,
487
- stickyHeader: _propTypes.bool
488
+ stickyHeader: _propTypes.bool,
489
+ initialOrder: (0, _propTypes.shape)({
490
+ direction: _propTypes.string,
491
+ key: _propTypes.string
492
+ })
488
493
  };
489
494
 
490
495
  var _default = (0, _WithTheme["default"])(_theme.retrieveStyle)(UTTable);
@@ -22,6 +22,7 @@
22
22
  .ps__rail-x {
23
23
  background: transparent !important;
24
24
  bottom: auto !important;
25
+ height: 6px !important;
25
26
  opacity: 1 !important;
26
27
  top: 0;
27
28
  z-index: 2;
@@ -30,35 +31,12 @@
30
31
  .ps__thumb-x {
31
32
  bottom: 0;
32
33
  cursor: pointer;
34
+ height: 6px !important;
33
35
  opacity: 1;
34
36
  }
35
37
  }
36
38
  }
37
39
 
38
- .scrollbarMediumPadding {
39
- :global {
40
- .ps__rail-x {
41
- height: 10px !important;
42
- }
43
-
44
- .ps__thumb-x {
45
- height: 10px !important;
46
- }
47
- }
48
- }
49
-
50
- .scrollbarSmallPadding {
51
- :global {
52
- .ps__rail-x {
53
- height: 8px !important;
54
- }
55
-
56
- .ps__thumb-x {
57
- height: 8px !important;
58
- }
59
- }
60
- }
61
-
62
40
  .noResultsContainer {
63
41
  align-items: center;
64
42
  display: flex;
@@ -76,6 +76,9 @@ var retrieveStyle = function retrieveStyle(theme) {
76
76
  borderTopRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'header', 'borderRadius']),
77
77
  '&:hover > .ps__thumb-x': {
78
78
  backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'scrollbar', 'hover', 'backgroundColor'])
79
+ },
80
+ '&.ps--clicking > .ps__thumb-x': {
81
+ backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'scrollbar', 'hover', 'backgroundColor'])
79
82
  }
80
83
  }
81
84
  },
@@ -128,15 +131,9 @@ var retrieveStyle = function retrieveStyle(theme) {
128
131
  fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'tabletMobile', 'fontWeight'])
129
132
  }),
130
133
  responsiveRow: {
131
- '& :first-child': {
132
- borderTopRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
133
- borderTopLeftRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius'])
134
- },
135
- '& :last-child': {
136
- borderBottomRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
137
- borderBottomLeftRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius'])
138
- },
139
- boxShadow: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'boxShadow'])
134
+ boxShadow: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'boxShadow']),
135
+ borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
136
+ overflow: 'hidden'
140
137
  },
141
138
  responsiveRowTopBorder: {
142
139
  borderTopRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "1.95.4",
3
+ "version": "1.96.1",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",