qbs-react-grid 1.0.46 → 1.0.48

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.
@@ -0,0 +1,38 @@
1
+ export function deepEqual(value1, value2) {
2
+ if (value1 === value2) {
3
+ return true;
4
+ }
5
+ if (typeof value1 !== typeof value2) {
6
+ return false;
7
+ }
8
+ if (value1 === null || value2 === null) {
9
+ return value1 === value2;
10
+ }
11
+ if (typeof value1 === 'object' && typeof value2 === 'object') {
12
+ if (Array.isArray(value1) && Array.isArray(value2)) {
13
+ if (value1.length !== value2.length) {
14
+ return false;
15
+ }
16
+ for (var i = 0; i < value1.length; i++) {
17
+ if (!deepEqual(value1[i], value2[i])) {
18
+ return false;
19
+ }
20
+ }
21
+ return true;
22
+ } else if (!Array.isArray(value1) && !Array.isArray(value2)) {
23
+ var keys1 = Object.keys(value1);
24
+ var keys2 = Object.keys(value2);
25
+ if (keys1.length !== keys2.length) {
26
+ return false;
27
+ }
28
+ for (var _i = 0, _keys = keys1; _i < _keys.length; _i++) {
29
+ var key = _keys[_i];
30
+ if (!keys2.includes(key) || !deepEqual(value1[key], value2[key])) {
31
+ return false;
32
+ }
33
+ }
34
+ return true;
35
+ }
36
+ }
37
+ return false;
38
+ }
package/lib/Pagination.js CHANGED
@@ -48,7 +48,7 @@ var Pagination = function Pagination(_ref2) {
48
48
  _paginationProps$curr = paginationProps.currentPage,
49
49
  currentPage = _paginationProps$curr === void 0 ? 1 : _paginationProps$curr,
50
50
  _paginationProps$tota = paginationProps.total,
51
- total = _paginationProps$tota === void 0 ? 100 : _paginationProps$tota,
51
+ total = _paginationProps$tota === void 0 ? 0 : _paginationProps$tota,
52
52
  onRowsPerPage = paginationProps.onRowsPerPage,
53
53
  _paginationProps$rows = paginationProps.rowsPerPage,
54
54
  rowsPerPage = _paginationProps$rows === void 0 ? 10 : _paginationProps$rows,
@@ -66,28 +66,20 @@ var Pagination = function Pagination(_ref2) {
66
66
  onRowsPerPage === null || onRowsPerPage === void 0 ? void 0 : onRowsPerPage(value, currentPage);
67
67
  };
68
68
  var handleFirst = function handleFirst(index) {
69
- // setCurrenIndex(index);
70
69
  onPagination === null || onPagination === void 0 ? void 0 : onPagination(index, currentPage);
71
70
  };
72
71
  var handleLast = function handleLast() {
73
72
  var value = pageCount != null ? pageCount : 0;
74
- // setCurrenIndex(value);
75
73
  onPagination === null || onPagination === void 0 ? void 0 : onPagination(value, currentPage);
76
74
  };
77
- // useEffect(() => {
78
- // setCurrenIndex(currentPage);
79
- // }, [currentPage]);
80
-
81
75
  (0, _react.useEffect)(function () {
82
76
  var calculatedPageCount = Math.ceil(total / rowsPerPageState);
83
77
  setPageCount(calculatedPageCount);
84
78
  }, [total, rowsPerPageState]);
85
79
  var handlePrevious = function handlePrevious() {
86
- // setCurrenIndex(currentPage - 1);
87
80
  onPagination === null || onPagination === void 0 ? void 0 : onPagination(currentPage - 1, currentPage);
88
81
  };
89
82
  var handleNext = function handleNext() {
90
- // setCurrenIndex(currentPage + 1);
91
83
  onPagination === null || onPagination === void 0 ? void 0 : onPagination(currentPage + 1, currentPage);
92
84
  };
93
85
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -115,9 +107,9 @@ var Pagination = function Pagination(_ref2) {
115
107
  }, /*#__PURE__*/_react["default"].createElement("path", {
116
108
  d: "M9.16667 15.8333L3.33334 9.99996L9.16667 4.16663M15.8333 15.8333L10 9.99996L15.8333 4.16663",
117
109
  stroke: "#313131",
118
- "stroke-width": "1.5",
119
- "stroke-linecap": "round",
120
- "stroke-linejoin": "round"
110
+ strokeWidth: "1.5",
111
+ strokeLinecap: "round",
112
+ strokeLinejoin: "round"
121
113
  }))), /*#__PURE__*/_react["default"].createElement("button", {
122
114
  className: "qbs-table-icon-container",
123
115
  disabled: currentPage < 2,
@@ -133,9 +125,9 @@ var Pagination = function Pagination(_ref2) {
133
125
  }, /*#__PURE__*/_react["default"].createElement("path", {
134
126
  d: "M12.5 15.8334L6.66666 10L12.5 4.16669",
135
127
  stroke: "#313131",
136
- "stroke-width": "1.5",
137
- "stroke-linecap": "round",
138
- "stroke-linejoin": "round"
128
+ strokeWidth: "1.5",
129
+ strokeLinecap: "round",
130
+ strokeLinejoin: "round"
139
131
  }))), /*#__PURE__*/_react["default"].createElement("div", {
140
132
  className: "block-container"
141
133
  }, /*#__PURE__*/_react["default"].createElement(PageIndex, {
@@ -145,7 +137,7 @@ var Pagination = function Pagination(_ref2) {
145
137
  pageCount: pageCount
146
138
  })), /*#__PURE__*/_react["default"].createElement("button", {
147
139
  className: "qbs-table-icon-container",
148
- disabled: currentPage >= pageCount - 1,
140
+ disabled: currentPage === pageCount || pageCount === 0,
149
141
  onClick: function onClick() {
150
142
  return handleNext();
151
143
  }
@@ -158,12 +150,12 @@ var Pagination = function Pagination(_ref2) {
158
150
  }, /*#__PURE__*/_react["default"].createElement("path", {
159
151
  d: "M7.5 4.16669L13.3333 10L7.5 15.8334",
160
152
  stroke: "#313131",
161
- "stroke-width": "1.5",
162
- "stroke-linecap": "round",
163
- "stroke-linejoin": "round"
153
+ strokeWidth: "1.5",
154
+ strokeLinecap: "round",
155
+ strokeLinejoin: "round"
164
156
  }))), /*#__PURE__*/_react["default"].createElement("button", {
165
157
  className: "qbs-table-icon-container",
166
- disabled: currentPage == pageCount,
158
+ disabled: currentPage == pageCount || pageCount === 0,
167
159
  onClick: function onClick() {
168
160
  return handleLast();
169
161
  }
@@ -176,9 +168,9 @@ var Pagination = function Pagination(_ref2) {
176
168
  }, /*#__PURE__*/_react["default"].createElement("path", {
177
169
  d: "M10.8333 4.16663L16.6667 9.99996L10.8333 15.8333M4.16666 4.16663L10 9.99996L4.16666 15.8333",
178
170
  stroke: "#313131",
179
- "stroke-width": "1.5",
180
- "stroke-linecap": "round",
181
- "stroke-linejoin": "round"
171
+ strokeWidth: "1.5",
172
+ strokeLinecap: "round",
173
+ strokeLinejoin: "round"
182
174
  })))), /*#__PURE__*/_react["default"].createElement("div", {
183
175
  className: "qbs-table-pagination-flexBox"
184
176
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -5,8 +5,8 @@
5
5
  min-height: 40px;
6
6
  align-items: center;
7
7
  border-radius: 4px;
8
- border-top: 1px solid #D6D8DC;
9
- background: #FFF;
8
+ border-top: 1px solid #d6d8dc;
9
+ background: #fff;
10
10
  &-header {
11
11
  border-bottom: 1px solid #eee;
12
12
  position: absolute;
@@ -27,8 +27,8 @@
27
27
  font-weight: 500;
28
28
  line-height: 20px;
29
29
  border-radius: 6px;
30
- border: 1px solid #D6D8DC;
31
- background: #FFF;
30
+ border: 1px solid #d6d8dc;
31
+ background: #fff;
32
32
  }
33
33
  .qbs-table-icon-container {
34
34
  padding: 0;
@@ -37,7 +37,6 @@
37
37
  justify-items: center;
38
38
  align-items: center;
39
39
  color: black;
40
- height: 100%;
41
40
  background-color: transparent;
42
41
  width: 24px;
43
42
  height: 24px;
@@ -48,6 +47,7 @@
48
47
  }
49
48
  &:disabled {
50
49
  color: grey;
50
+ cursor: not-allowed;
51
51
  }
52
52
  svg {
53
53
  width: 16px;
@@ -80,19 +80,19 @@
80
80
  border: 1px solid transparent;
81
81
  transition: all 0.2s ease;
82
82
  &:hover {
83
- border-color: #E76458;
84
- color: #E76458;
83
+ border-color: #e76458;
84
+ color: #e76458;
85
85
  transition: all 0.2s ease;
86
86
  }
87
87
  &:active {
88
- border-color: #E76458;
89
- color: #E76458;
88
+ border-color: #e76458;
89
+ color: #e76458;
90
90
  transition: all 0.2s ease;
91
91
  }
92
92
  }
93
93
  .selected {
94
- color: #E76458;
95
- border: 1px solid #E76458;
94
+ color: #e76458;
95
+ border: 1px solid #e76458;
96
96
  transition: all 0.2s ease;
97
97
  }
98
98
  }
@@ -115,4 +115,4 @@
115
115
 
116
116
  .qbs-table-custom-pagination .qbs-table-pagination-dropdown:focus {
117
117
  outline: none;
118
- }
118
+ }
@@ -8,7 +8,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _Cell = _interopRequireDefault(require("../Cell"));
10
10
  var _menuDropDown = _interopRequireDefault(require("./utilities/menuDropDown"));
11
- var _ToolTip = _interopRequireDefault(require("./utilities/ToolTip"));
12
11
  var _excluded = ["rowData", "onChange", "checkedKeys", "dataKey", "dataTheme"],
13
12
  _excluded2 = ["rowData", "dataKey", "expandedRowKeys", "onChange"],
14
13
  _excluded3 = ["rowData", "renderCell", "toolTip", "dataKey", "onChange", "rowClick", "link"];
@@ -80,7 +79,7 @@ var ExpandCell = /*#__PURE__*/_react["default"].memo(function (_ref3) {
80
79
  });
81
80
  exports.ExpandCell = ExpandCell;
82
81
  var CustomTableCell = /*#__PURE__*/_react["default"].memo(function (_ref4) {
83
- var _renderCell, _renderCell2, _renderCell3;
82
+ var _renderCell, _renderCell2;
84
83
  var rowData = _ref4.rowData,
85
84
  renderCell = _ref4.renderCell,
86
85
  toolTip = _ref4.toolTip,
@@ -89,15 +88,18 @@ var CustomTableCell = /*#__PURE__*/_react["default"].memo(function (_ref4) {
89
88
  rowClick = _ref4.rowClick,
90
89
  link = _ref4.link,
91
90
  props = (0, _objectWithoutPropertiesLoose2["default"])(_ref4, _excluded3);
92
- return /*#__PURE__*/_react["default"].createElement(_ToolTip["default"], {
93
- title: renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.toolTip : toolTip
94
- }, /*#__PURE__*/_react["default"].createElement(_Cell["default"], (0, _extends2["default"])({}, props, {
95
- dataKey: dataKey
96
- }), link ? /*#__PURE__*/_react["default"].createElement("a", {
97
- onClick: function onClick() {
98
- return rowClick === null || rowClick === void 0 ? void 0 : rowClick(rowData);
99
- },
100
- className: "qbs-table-row-link"
101
- }, renderCell ? (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell : rowData[dataKey]) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (_renderCell3 = renderCell(rowData)) === null || _renderCell3 === void 0 ? void 0 : _renderCell3.cell)));
91
+ return (
92
+ /*#__PURE__*/
93
+ // <TooltipComponent title={renderCell ? renderCell(rowData)?.toolTip : toolTip}>
94
+ _react["default"].createElement(_Cell["default"], (0, _extends2["default"])({}, props, {
95
+ dataKey: dataKey
96
+ }), link ? /*#__PURE__*/_react["default"].createElement("a", {
97
+ onClick: function onClick() {
98
+ return rowClick === null || rowClick === void 0 ? void 0 : rowClick(rowData);
99
+ },
100
+ className: "qbs-table-row-link"
101
+ }, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : rowData[dataKey]) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell))
102
+ // </TooltipComponent>
103
+ );
102
104
  });
103
105
  exports.CustomTableCell = CustomTableCell;
@@ -17,6 +17,7 @@ var _ColumShowHide = _interopRequireDefault(require("./utilities/ColumShowHide")
17
17
  var _debounce = _interopRequireDefault(require("./utilities/debounce"));
18
18
  var _icons = require("./utilities/icons");
19
19
  require("../../dist/css/qbs-react-grid.css");
20
+ var _deepEqual = require("./utilities/deepEqual");
20
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
23
  var CHECKBOX_LINE_HEIGHT = '36px';
@@ -95,6 +96,7 @@ var QbsTable = function QbsTable(_ref) {
95
96
  var _useState4 = (0, _react.useState)(false),
96
97
  isOpen = _useState4[0],
97
98
  setIsOpen = _useState4[1];
99
+ var prevColumns = (0, _react.useRef)();
98
100
  var handleSortColumn = (0, _react.useCallback)(function (sortColumn, sortType) {
99
101
  setLoading(true);
100
102
  setTimeout(function () {
@@ -116,10 +118,7 @@ var QbsTable = function QbsTable(_ref) {
116
118
  var keys = event.target.checked ? data.map(function (item) {
117
119
  return item.id;
118
120
  }) : [];
119
- var updatedKeys = [].concat(keys);
120
- if (checkedKeys) {
121
- updatedKeys = [].concat(checkedKeys, updatedKeys);
122
- }
121
+ var updatedKeys = [].concat(checkedKeys, keys);
123
122
  setCheckedKeys(updatedKeys);
124
123
  handleChecked(updatedKeys);
125
124
  }, [data]);
@@ -166,9 +165,10 @@ var QbsTable = function QbsTable(_ref) {
166
165
  var onReorder = (0, _react.useCallback)(function (columns) {
167
166
  setColumns(columns);
168
167
  }, []);
169
- (0, _react.useEffect)(function () {
170
- handleColumnToggle === null || handleColumnToggle === void 0 ? void 0 : handleColumnToggle(columns);
171
- }, [columns]);
168
+
169
+ // useEffect(() => {
170
+ // }, [columns]);
171
+
172
172
  var handleClear = function handleClear(_ref2) {
173
173
  setCheckedKeys([]);
174
174
  handleChecked([]);
@@ -192,7 +192,8 @@ var QbsTable = function QbsTable(_ref) {
192
192
  checkedKeys: checkedKeys,
193
193
  tableHeaderActions: tableHeaderActions,
194
194
  selectedRowActions: selectedRowActions,
195
- onSelect: handleClear
195
+ onSelect: handleClear,
196
+ handleColumnToggle: handleColumnToggle
196
197
  };
197
198
  var themeToggle = (0, _react.useMemo)(function () {
198
199
  return document.getElementById('themeToggle');
@@ -250,6 +251,26 @@ var QbsTable = function QbsTable(_ref) {
250
251
  });
251
252
  return largestCellLength;
252
253
  }
254
+ var handleColumnsResizable = (0, _react.useCallback)(function () {
255
+ var _filteredColumns$leng;
256
+ var filteredColumns = columns === null || columns === void 0 ? void 0 : columns.filter(function (item) {
257
+ return item.isVisible;
258
+ });
259
+ var length = (_filteredColumns$leng = filteredColumns === null || filteredColumns === void 0 ? void 0 : filteredColumns.length) != null ? _filteredColumns$leng : 0;
260
+ var lastVisibleColumn = filteredColumns[length - 1];
261
+ var reColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
262
+ return (item === null || item === void 0 ? void 0 : item.field) === (lastVisibleColumn === null || lastVisibleColumn === void 0 ? void 0 : lastVisibleColumn.field) ? (0, _extends2["default"])({}, item, {
263
+ resizable: false
264
+ }) : item;
265
+ });
266
+ setColumns(reColumns);
267
+ }, [columns]);
268
+ (0, _react.useEffect)(function () {
269
+ if (!(0, _deepEqual.deepEqual)(columns, prevColumns.current)) {
270
+ handleColumnsResizable();
271
+ }
272
+ prevColumns.current = columns;
273
+ }, [columns, handleColumnsResizable]);
253
274
  var columnsRendered = (0, _react.useMemo)(function () {
254
275
  return (columns != null ? columns : []).map(function (_ref3) {
255
276
  var title = _ref3.title,
@@ -39,6 +39,15 @@ var ToolBar = function ToolBar(_ref) {
39
39
  handleSearchValue === null || handleSearchValue === void 0 ? void 0 : handleSearchValue(e);
40
40
  }
41
41
  }, [asyncSearch, handleSearch, handleSearchValue]);
42
+ var handleHide = function handleHide(actions) {
43
+ if (actions.hidden) {
44
+ return false;
45
+ } else if (actions.customHide == '>2') {
46
+ return checkedKeys && (checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) >= 2 ? true : false;
47
+ } else {
48
+ return true;
49
+ }
50
+ };
42
51
  return /*#__PURE__*/_react["default"].createElement("div", {
43
52
  className: "qbs-table-toolbar-container"
44
53
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -74,7 +83,7 @@ var ToolBar = function ToolBar(_ref) {
74
83
  return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
75
84
  }
76
85
  }, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
77
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !actions.hidden && /*#__PURE__*/_react["default"].createElement("button", {
86
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, handleHide(actions) && /*#__PURE__*/_react["default"].createElement("button", {
78
87
  key: index.toString(),
79
88
  className: "btn",
80
89
  disabled: actions.disabled,
@@ -88,6 +88,7 @@ export interface QbsTableProps {
88
88
  action: (checked: (number | string)[]) => void;
89
89
  disabled?: boolean;
90
90
  hidden?: boolean;
91
+ customHide?: string;
91
92
  }[];
92
93
  selectedRows?: (number | string)[];
93
94
  classes?: {
@@ -117,11 +118,13 @@ export interface QbsTableToolbarProps {
117
118
  checkedKeys?: (number | string)[];
118
119
  tableHeaderActions?: ReactElement | ReactNode;
119
120
  onSelect?: (keys: any[]) => void;
121
+ handleColumnToggle?: (columns: QbsColumnProps[]) => void;
120
122
  selectedRowActions?: {
121
123
  actionTitle?: string;
122
124
  action: (checked: (number | string)[]) => void;
123
125
  disabled?: boolean;
124
126
  hidden?: boolean;
127
+ customHide?: string;
125
128
  }[];
126
129
  }
127
130
  export {};
@@ -0,0 +1 @@
1
+ export declare function deepEqual(value1: any, value2: any): boolean;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.deepEqual = deepEqual;
5
+ function deepEqual(value1, value2) {
6
+ if (value1 === value2) {
7
+ return true;
8
+ }
9
+ if (typeof value1 !== typeof value2) {
10
+ return false;
11
+ }
12
+ if (value1 === null || value2 === null) {
13
+ return value1 === value2;
14
+ }
15
+ if (typeof value1 === 'object' && typeof value2 === 'object') {
16
+ if (Array.isArray(value1) && Array.isArray(value2)) {
17
+ if (value1.length !== value2.length) {
18
+ return false;
19
+ }
20
+ for (var i = 0; i < value1.length; i++) {
21
+ if (!deepEqual(value1[i], value2[i])) {
22
+ return false;
23
+ }
24
+ }
25
+ return true;
26
+ } else if (!Array.isArray(value1) && !Array.isArray(value2)) {
27
+ var keys1 = Object.keys(value1);
28
+ var keys2 = Object.keys(value2);
29
+ if (keys1.length !== keys2.length) {
30
+ return false;
31
+ }
32
+ for (var _i = 0, _keys = keys1; _i < _keys.length; _i++) {
33
+ var key = _keys[_i];
34
+ if (!keys2.includes(key) || !deepEqual(value1[key], value2[key])) {
35
+ return false;
36
+ }
37
+ }
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qbs-react-grid",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "description": "A React table component",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -59,7 +59,7 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
59
59
  const {
60
60
  dropOptions = [10, 20, 50, 100, 200],
61
61
  currentPage = 1,
62
- total = 100,
62
+ total = 0,
63
63
  onRowsPerPage,
64
64
  rowsPerPage = 10,
65
65
  onPagination
@@ -75,18 +75,13 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
75
75
  onRowsPerPage?.(value, currentPage);
76
76
  };
77
77
  const handleFirst = (index: number) => {
78
- // setCurrenIndex(index);
79
78
  onPagination?.(index, currentPage);
80
79
  };
81
80
 
82
81
  const handleLast = () => {
83
82
  const value = pageCount ?? 0;
84
- // setCurrenIndex(value);
85
83
  onPagination?.(value, currentPage);
86
84
  };
87
- // useEffect(() => {
88
- // setCurrenIndex(currentPage);
89
- // }, [currentPage]);
90
85
 
91
86
  useEffect(() => {
92
87
  const calculatedPageCount = Math.ceil(total / rowsPerPageState);
@@ -94,11 +89,9 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
94
89
  }, [total, rowsPerPageState]);
95
90
 
96
91
  const handlePrevious = () => {
97
- // setCurrenIndex(currentPage - 1);
98
92
  onPagination?.(currentPage - 1, currentPage);
99
93
  };
100
94
  const handleNext = () => {
101
- // setCurrenIndex(currentPage + 1);
102
95
  onPagination?.(currentPage + 1, currentPage);
103
96
  };
104
97
 
@@ -130,9 +123,9 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
130
123
  <path
131
124
  d="M9.16667 15.8333L3.33334 9.99996L9.16667 4.16663M15.8333 15.8333L10 9.99996L15.8333 4.16663"
132
125
  stroke="#313131"
133
- stroke-width="1.5"
134
- stroke-linecap="round"
135
- stroke-linejoin="round"
126
+ strokeWidth="1.5"
127
+ strokeLinecap="round"
128
+ strokeLinejoin="round"
136
129
  />
137
130
  </svg>
138
131
  </button>
@@ -151,9 +144,9 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
151
144
  <path
152
145
  d="M12.5 15.8334L6.66666 10L12.5 4.16669"
153
146
  stroke="#313131"
154
- stroke-width="1.5"
155
- stroke-linecap="round"
156
- stroke-linejoin="round"
147
+ strokeWidth="1.5"
148
+ strokeLinecap="round"
149
+ strokeLinejoin="round"
157
150
  />
158
151
  </svg>
159
152
  </button>
@@ -167,7 +160,7 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
167
160
  </div>
168
161
  <button
169
162
  className="qbs-table-icon-container"
170
- disabled={currentPage >= pageCount - 1}
163
+ disabled={currentPage === pageCount || pageCount === 0}
171
164
  onClick={() => handleNext()}
172
165
  >
173
166
  <svg
@@ -180,15 +173,15 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
180
173
  <path
181
174
  d="M7.5 4.16669L13.3333 10L7.5 15.8334"
182
175
  stroke="#313131"
183
- stroke-width="1.5"
184
- stroke-linecap="round"
185
- stroke-linejoin="round"
176
+ strokeWidth="1.5"
177
+ strokeLinecap="round"
178
+ strokeLinejoin="round"
186
179
  />
187
180
  </svg>
188
181
  </button>
189
182
  <button
190
183
  className="qbs-table-icon-container"
191
- disabled={currentPage == pageCount}
184
+ disabled={currentPage == pageCount || pageCount === 0}
192
185
  onClick={() => handleLast()}
193
186
  >
194
187
  <svg
@@ -201,9 +194,9 @@ const Pagination: FC<PageProps> = ({ paginationProps }) => {
201
194
  <path
202
195
  d="M10.8333 4.16663L16.6667 9.99996L10.8333 15.8333M4.16666 4.16663L10 9.99996L4.16666 15.8333"
203
196
  stroke="#313131"
204
- stroke-width="1.5"
205
- stroke-linecap="round"
206
- stroke-linejoin="round"
197
+ strokeWidth="1.5"
198
+ strokeLinecap="round"
199
+ strokeLinejoin="round"
207
200
  />
208
201
  </svg>
209
202
  </button>
@@ -5,8 +5,8 @@
5
5
  min-height: 40px;
6
6
  align-items: center;
7
7
  border-radius: 4px;
8
- border-top: 1px solid #D6D8DC;
9
- background: #FFF;
8
+ border-top: 1px solid #d6d8dc;
9
+ background: #fff;
10
10
  &-header {
11
11
  border-bottom: 1px solid #eee;
12
12
  position: absolute;
@@ -27,8 +27,8 @@
27
27
  font-weight: 500;
28
28
  line-height: 20px;
29
29
  border-radius: 6px;
30
- border: 1px solid #D6D8DC;
31
- background: #FFF;
30
+ border: 1px solid #d6d8dc;
31
+ background: #fff;
32
32
  }
33
33
  .qbs-table-icon-container {
34
34
  padding: 0;
@@ -37,7 +37,6 @@
37
37
  justify-items: center;
38
38
  align-items: center;
39
39
  color: black;
40
- height: 100%;
41
40
  background-color: transparent;
42
41
  width: 24px;
43
42
  height: 24px;
@@ -48,6 +47,7 @@
48
47
  }
49
48
  &:disabled {
50
49
  color: grey;
50
+ cursor: not-allowed;
51
51
  }
52
52
  svg {
53
53
  width: 16px;
@@ -80,19 +80,19 @@
80
80
  border: 1px solid transparent;
81
81
  transition: all 0.2s ease;
82
82
  &:hover {
83
- border-color: #E76458;
84
- color: #E76458;
83
+ border-color: #e76458;
84
+ color: #e76458;
85
85
  transition: all 0.2s ease;
86
86
  }
87
87
  &:active {
88
- border-color: #E76458;
89
- color: #E76458;
88
+ border-color: #e76458;
89
+ color: #e76458;
90
90
  transition: all 0.2s ease;
91
91
  }
92
92
  }
93
93
  .selected {
94
- color: #E76458;
95
- border: 1px solid #E76458;
94
+ color: #e76458;
95
+ border: 1px solid #e76458;
96
96
  transition: all 0.2s ease;
97
97
  }
98
98
  }
@@ -115,4 +115,4 @@
115
115
 
116
116
  .qbs-table-custom-pagination .qbs-table-pagination-dropdown:focus {
117
117
  outline: none;
118
- }
118
+ }
@@ -2,7 +2,6 @@ import React from 'react';
2
2
 
3
3
  import Cell from '../Cell';
4
4
  import MenuDropDown from './utilities/menuDropDown';
5
- import TooltipComponent from './utilities/ToolTip';
6
5
 
7
6
  const CHECKBOX_LINE_HEIGHT = '36px';
8
7
 
@@ -64,17 +63,17 @@ export const ExpandCell: React.FC<any> = React.memo(
64
63
  export const CustomTableCell: React.FC<any> = React.memo(
65
64
  ({ rowData, renderCell, toolTip, dataKey, onChange, rowClick, link, ...props }) => {
66
65
  return (
67
- <TooltipComponent title={renderCell ? renderCell(rowData)?.toolTip : toolTip}>
68
- <Cell {...props} dataKey={dataKey}>
69
- {link ? (
70
- <a onClick={() => rowClick?.(rowData)} className="qbs-table-row-link">
71
- {renderCell ? renderCell(rowData)?.cell : rowData[dataKey]}
72
- </a>
73
- ) : (
74
- <>{renderCell(rowData)?.cell}</>
75
- )}
76
- </Cell>
77
- </TooltipComponent>
66
+ // <TooltipComponent title={renderCell ? renderCell(rowData)?.toolTip : toolTip}>
67
+ <Cell {...props} dataKey={dataKey}>
68
+ {link ? (
69
+ <a onClick={() => rowClick?.(rowData)} className="qbs-table-row-link">
70
+ {renderCell ? renderCell(rowData)?.cell : rowData[dataKey]}
71
+ </a>
72
+ ) : (
73
+ <>{renderCell(rowData)?.cell}</>
74
+ )}
75
+ </Cell>
76
+ // </TooltipComponent>
78
77
  );
79
78
  }
80
79
  );