qbs-react-grid 1.2.1 → 1.2.3
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/dist/css/qbs-react-grid.css +1 -1095
- package/dist/css/qbs-react-grid.min.css +1 -1
- package/dist/css/qbs-react-grid.min.css.map +1 -1
- package/es/Table.js +19 -19
- package/es/less/index.less +3 -0
- package/es/less/qbs-table.less +89 -22
- package/es/qbsTable/QbsTable.js +40 -7
- package/es/qbsTable/TableCardList.d.ts +5 -0
- package/es/qbsTable/TableCardList.js +564 -0
- package/es/qbsTable/Toolbar.js +21 -5
- package/es/qbsTable/commontypes.d.ts +12 -0
- package/es/qbsTable/utilities/CardComponent.d.ts +14 -0
- package/es/qbsTable/utilities/CardComponent.js +83 -0
- package/es/qbsTable/utilities/CardMenuDropdown.d.ts +13 -0
- package/es/qbsTable/utilities/CardMenuDropdown.js +93 -0
- package/es/qbsTable/utilities/SwitchCardColumns.d.ts +2 -0
- package/es/qbsTable/utilities/SwitchCardColumns.js +24 -0
- package/es/qbsTable/utilities/ToolTip.js +2 -5
- package/es/qbsTable/utilities/icons.d.ts +3 -0
- package/es/qbsTable/utilities/icons.js +45 -0
- package/es/qbsTable/utilities/store.d.ts +2 -0
- package/es/qbsTable/utilities/store.js +60 -0
- package/es/utils/getTotalByColumns.js +1 -1
- package/es/utils/mergeCells.js +1 -1
- package/es/utils/useCellDescriptor.js +11 -11
- package/es/utils/useClassNames.js +2 -0
- package/lib/Table.js +19 -19
- package/lib/less/index.less +3 -0
- package/lib/less/qbs-table.less +89 -22
- package/lib/qbsTable/QbsTable.js +40 -7
- package/lib/qbsTable/TableCardList.d.ts +5 -0
- package/lib/qbsTable/TableCardList.js +571 -0
- package/lib/qbsTable/Toolbar.js +20 -4
- package/lib/qbsTable/commontypes.d.ts +12 -0
- package/lib/qbsTable/utilities/CardComponent.d.ts +14 -0
- package/lib/qbsTable/utilities/CardComponent.js +91 -0
- package/lib/qbsTable/utilities/CardMenuDropdown.d.ts +13 -0
- package/lib/qbsTable/utilities/CardMenuDropdown.js +100 -0
- package/lib/qbsTable/utilities/SwitchCardColumns.d.ts +2 -0
- package/lib/qbsTable/utilities/SwitchCardColumns.js +30 -0
- package/lib/qbsTable/utilities/ToolTip.js +2 -5
- package/lib/qbsTable/utilities/icons.d.ts +3 -0
- package/lib/qbsTable/utilities/icons.js +50 -2
- package/lib/qbsTable/utilities/store.d.ts +2 -0
- package/lib/qbsTable/utilities/store.js +66 -0
- package/lib/utils/getTotalByColumns.js +1 -1
- package/lib/utils/mergeCells.js +1 -1
- package/lib/utils/useCellDescriptor.js +11 -11
- package/lib/utils/useClassNames.js +2 -0
- package/package.json +11 -6
- package/src/less/index.less +3 -0
- package/src/less/qbs-table.less +89 -22
- package/src/qbsTable/QbsTable.tsx +205 -173
- package/src/qbsTable/TableCardList.tsx +629 -0
- package/src/qbsTable/Toolbar.tsx +25 -4
- package/src/qbsTable/commontypes.ts +12 -0
- package/src/qbsTable/utilities/CardComponent.tsx +132 -0
- package/src/qbsTable/utilities/CardMenuDropdown.tsx +120 -0
- package/src/qbsTable/utilities/SwitchCardColumns.tsx +29 -0
- package/src/qbsTable/utilities/ToolTip.tsx +1 -4
- package/src/qbsTable/utilities/icons.tsx +51 -0
- package/src/qbsTable/utilities/store.ts +61 -0
package/lib/Table.js
CHANGED
|
@@ -36,13 +36,13 @@ var filterTreeData = function filterTreeData(data, expandedRowKeys, rowKey) {
|
|
|
36
36
|
return (0, _utils.flattenData)(data).filter(function (rowData) {
|
|
37
37
|
if (rowKey) {
|
|
38
38
|
var parents = (0, _utils.findAllParents)(rowData, rowKey);
|
|
39
|
-
var
|
|
39
|
+
var expanded = (0, _utils.shouldShowRowByExpanded)(expandedRowKeys, parents);
|
|
40
40
|
|
|
41
41
|
// FIXME This function is supposed to be pure.
|
|
42
42
|
// Don't mutate rowData in-place!
|
|
43
|
-
rowData[_constants.EXPANDED_KEY] =
|
|
43
|
+
rowData[_constants.EXPANDED_KEY] = expanded;
|
|
44
44
|
rowData[_constants.TREE_DEPTH] = parents.length;
|
|
45
|
-
return
|
|
45
|
+
return expanded;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -593,7 +593,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
593
593
|
|
|
594
594
|
// Cells marked as deleted when checking for merged cell.
|
|
595
595
|
var removedCell = (_cell$props4 = cell.props) !== null && _cell$props4 !== void 0 && _cell$props4.rowSpan && !rowSpan && ((_rowSpanState$current2 = rowSpanState.current[_cellKey]) === null || _rowSpanState$current2 === void 0 ? void 0 : _rowSpanState$current2[0]) !== 0 ? true : false;
|
|
596
|
-
cells.push(
|
|
596
|
+
cells.push(/*#__PURE__*/_react["default"].cloneElement(cell, {
|
|
597
597
|
hasChildren: hasChildren,
|
|
598
598
|
rowData: rowData,
|
|
599
599
|
rowIndex: props.rowIndex,
|
|
@@ -617,7 +617,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
617
617
|
}
|
|
618
618
|
var scrollbars = [];
|
|
619
619
|
if (hasHorizontalScrollbar && !(tableKey === 'parent' && isChildFocused)) {
|
|
620
|
-
scrollbars.push(
|
|
620
|
+
scrollbars.push(/*#__PURE__*/_react["default"].createElement(_Scrollbar["default"], {
|
|
621
621
|
key: "scrollbar",
|
|
622
622
|
tableId: id,
|
|
623
623
|
style: {
|
|
@@ -630,7 +630,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
630
630
|
}));
|
|
631
631
|
}
|
|
632
632
|
if (hasVerticalScrollbar && !(tableKey === 'parent' && isChildFocused)) {
|
|
633
|
-
scrollbars.push(
|
|
633
|
+
scrollbars.push(/*#__PURE__*/_react["default"].createElement(_Scrollbar["default"], {
|
|
634
634
|
vertical: true,
|
|
635
635
|
key: "vertical-scrollbar",
|
|
636
636
|
tableId: id,
|
|
@@ -673,7 +673,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
673
673
|
var bottomHideHeight = 0;
|
|
674
674
|
visibleRows.current = [];
|
|
675
675
|
if (data) {
|
|
676
|
-
var
|
|
676
|
+
var top = 0; // Row position
|
|
677
677
|
var minTop = Math.abs(scrollY.current);
|
|
678
678
|
var maxTop = minTop + height + rowExpandedHeight;
|
|
679
679
|
var isCustomRowHeight = typeof rowHeight === 'function';
|
|
@@ -690,13 +690,13 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
690
690
|
maxTop = maxTop + coveredHeight;
|
|
691
691
|
}
|
|
692
692
|
for (var index = 0; index < data.length; index++) {
|
|
693
|
-
var
|
|
693
|
+
var rowData = data[index];
|
|
694
694
|
var maxHeight = tableRowsMaxHeight[index];
|
|
695
|
-
var expandedRow = shouldRenderExpandedRow(
|
|
695
|
+
var expandedRow = shouldRenderExpandedRow(rowData);
|
|
696
696
|
var nextRowHeight = 0;
|
|
697
697
|
var cellHeight = 0;
|
|
698
698
|
if (typeof rowHeight === 'function') {
|
|
699
|
-
nextRowHeight = rowHeight(
|
|
699
|
+
nextRowHeight = rowHeight(rowData);
|
|
700
700
|
cellHeight = nextRowHeight;
|
|
701
701
|
} else {
|
|
702
702
|
nextRowHeight = maxHeight ? Math.max(maxHeight + _constants.CELL_PADDING_HEIGHT, rowHeight) : rowHeight;
|
|
@@ -709,10 +709,10 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
709
709
|
contentHeight += nextRowHeight;
|
|
710
710
|
var rowProps = {
|
|
711
711
|
key: index,
|
|
712
|
-
top:
|
|
712
|
+
top: top,
|
|
713
713
|
rowIndex: index,
|
|
714
714
|
width: rowWidth,
|
|
715
|
-
depth:
|
|
715
|
+
depth: rowData[_constants.TREE_DEPTH],
|
|
716
716
|
height: nextRowHeight,
|
|
717
717
|
cellHeight: cellHeight,
|
|
718
718
|
index: index,
|
|
@@ -720,17 +720,17 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
720
720
|
handleParentCallBack: handleParentCallBack,
|
|
721
721
|
zIndexValue: rowZIndices[index]
|
|
722
722
|
};
|
|
723
|
-
|
|
723
|
+
top += nextRowHeight;
|
|
724
724
|
if (virtualized && !wordWrap) {
|
|
725
|
-
if (
|
|
725
|
+
if (top + nextRowHeight < minTop) {
|
|
726
726
|
topHideHeight += nextRowHeight;
|
|
727
727
|
continue;
|
|
728
|
-
} else if (
|
|
728
|
+
} else if (top > maxTop) {
|
|
729
729
|
bottomHideHeight += nextRowHeight;
|
|
730
730
|
continue;
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
visibleRows.current.push(renderRowData(bodyCells,
|
|
733
|
+
visibleRows.current.push(renderRowData(bodyCells, rowData, rowProps, expandedRow));
|
|
734
734
|
}
|
|
735
735
|
} else {
|
|
736
736
|
/** virtualized */
|
|
@@ -752,11 +752,11 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
752
752
|
topHideHeight = startIndex * _nextRowHeight;
|
|
753
753
|
bottomHideHeight = (data.length - endIndex) * _nextRowHeight;
|
|
754
754
|
for (var _index = startIndex; _index < endIndex; _index++) {
|
|
755
|
-
var
|
|
755
|
+
var _rowData = data[_index];
|
|
756
756
|
var _rowProps = {
|
|
757
757
|
key: _index,
|
|
758
758
|
rowIndex: _index,
|
|
759
|
-
depth:
|
|
759
|
+
depth: _rowData[_constants.TREE_DEPTH],
|
|
760
760
|
top: _index * _nextRowHeight,
|
|
761
761
|
width: rowWidth,
|
|
762
762
|
height: _nextRowHeight,
|
|
@@ -766,7 +766,7 @@ var Table = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
766
766
|
handleParentCallBack: handleParentCallBack,
|
|
767
767
|
zIndexValue: rowZIndices[_index]
|
|
768
768
|
};
|
|
769
|
-
visibleRows.current.push(renderRowData(bodyCells,
|
|
769
|
+
visibleRows.current.push(renderRowData(bodyCells, _rowData, _rowProps, false));
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
}
|
package/lib/less/index.less
CHANGED
package/lib/less/qbs-table.less
CHANGED
|
@@ -180,16 +180,77 @@
|
|
|
180
180
|
transition: all 0.2s ease;
|
|
181
181
|
}
|
|
182
182
|
/* Tooltip container */
|
|
183
|
+
// .qbs-table-tooltip {
|
|
184
|
+
// position: relative;
|
|
185
|
+
// display: contents;
|
|
186
|
+
// cursor: pointer;
|
|
187
|
+
// }
|
|
188
|
+
|
|
189
|
+
// .qbs-table-tooltip .tooltiptext {
|
|
190
|
+
// visibility: hidden;
|
|
191
|
+
// background-color: #000;
|
|
192
|
+
// color: #fff;
|
|
193
|
+
// text-align: center;
|
|
194
|
+
// padding: 6px;
|
|
195
|
+
// border-radius: 4px;
|
|
196
|
+
// position: absolute;
|
|
197
|
+
// z-index: 9999;
|
|
198
|
+
// opacity: 0;
|
|
199
|
+
// transition: opacity 0.3s;
|
|
200
|
+
// font-size: 12px;
|
|
201
|
+
// font-style: normal;
|
|
202
|
+
// font-weight: 400;
|
|
203
|
+
// line-height: 16px;
|
|
204
|
+
// width: 100px;
|
|
205
|
+
// }
|
|
206
|
+
|
|
207
|
+
// .qbs-table-tooltip.up .tooltiptext {
|
|
208
|
+
// bottom: 125%;
|
|
209
|
+
// left: 0%;
|
|
210
|
+
// }
|
|
211
|
+
|
|
212
|
+
// .qbs-table-tooltip.down .tooltiptext {
|
|
213
|
+
// top: 125%;
|
|
214
|
+
// right: 0px;
|
|
215
|
+
// left: auto;
|
|
216
|
+
// }
|
|
217
|
+
|
|
218
|
+
// .qbs-table-tooltip:hover .tooltiptext {
|
|
219
|
+
// visibility: visible;
|
|
220
|
+
// opacity: 1;
|
|
221
|
+
// }
|
|
222
|
+
|
|
223
|
+
// .qbs-table-tooltip .tooltiptext::after {
|
|
224
|
+
// content: '';
|
|
225
|
+
// position: absolute;
|
|
226
|
+
// border-width: 5px;
|
|
227
|
+
// border-style: solid;
|
|
228
|
+
// }
|
|
229
|
+
|
|
230
|
+
// .qbs-table-tooltip.up .tooltiptext::after {
|
|
231
|
+
// top: 100%;
|
|
232
|
+
// left: 50%;
|
|
233
|
+
// margin-left: -5px;
|
|
234
|
+
// border-color: #000 transparent transparent transparent;
|
|
235
|
+
// }
|
|
236
|
+
|
|
237
|
+
// .qbs-table-tooltip.down .tooltiptext::after {
|
|
238
|
+
// bottom: 100%;
|
|
239
|
+
// left: 50%;
|
|
240
|
+
// margin-left: -5px;
|
|
241
|
+
// border-color: transparent transparent #000 transparent;
|
|
242
|
+
// }
|
|
183
243
|
.qbs-table-tooltip {
|
|
184
|
-
position: relative;
|
|
185
|
-
display: contents;
|
|
186
244
|
cursor: pointer;
|
|
245
|
+
position: relative;
|
|
246
|
+
width: auto;
|
|
247
|
+
display: flex;
|
|
187
248
|
}
|
|
188
249
|
|
|
189
250
|
.qbs-table-tooltip .tooltiptext {
|
|
190
251
|
visibility: hidden;
|
|
191
|
-
background-color:
|
|
192
|
-
color:
|
|
252
|
+
background-color: black;
|
|
253
|
+
color: white;
|
|
193
254
|
text-align: center;
|
|
194
255
|
padding: 6px;
|
|
195
256
|
border-radius: 4px;
|
|
@@ -205,20 +266,20 @@
|
|
|
205
266
|
}
|
|
206
267
|
|
|
207
268
|
.qbs-table-tooltip.up .tooltiptext {
|
|
208
|
-
bottom:
|
|
209
|
-
|
|
269
|
+
bottom: calc(100% + 10px);
|
|
270
|
+
right: -8px;
|
|
271
|
+
left: unset;
|
|
210
272
|
}
|
|
211
273
|
|
|
212
274
|
.qbs-table-tooltip.down .tooltiptext {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
left: auto;
|
|
275
|
+
right: -10px;
|
|
276
|
+
top: calc(100% + 8px);
|
|
216
277
|
}
|
|
217
278
|
|
|
218
|
-
.qbs-table-tooltip:hover .tooltiptext {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
279
|
+
// .qbs-table-tooltip:hover .tooltiptext {
|
|
280
|
+
// visibility: visible;
|
|
281
|
+
// opacity: 1;
|
|
282
|
+
// }
|
|
222
283
|
|
|
223
284
|
.qbs-table-tooltip .tooltiptext::after {
|
|
224
285
|
content: '';
|
|
@@ -228,19 +289,25 @@
|
|
|
228
289
|
}
|
|
229
290
|
|
|
230
291
|
.qbs-table-tooltip.up .tooltiptext::after {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
margin-left: -5px;
|
|
234
|
-
|
|
292
|
+
border-color: black transparent transparent !important;
|
|
293
|
+
right: 12px !important;
|
|
294
|
+
margin-left: -5px !important;
|
|
295
|
+
top: 100% !important;
|
|
296
|
+
left: unset !important;
|
|
235
297
|
}
|
|
236
298
|
|
|
237
299
|
.qbs-table-tooltip.down .tooltiptext::after {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
300
|
+
border-color: transparent transparent black;
|
|
301
|
+
bottom: 100% !important;
|
|
302
|
+
right: 12px !important;
|
|
303
|
+
margin-left: -5px !important;
|
|
304
|
+
left: unset !important;
|
|
305
|
+
}
|
|
306
|
+
.qbs-table-tooltip.down .tooltiptext {
|
|
307
|
+
top: 145% !important;
|
|
308
|
+
right: -10px !important;
|
|
309
|
+
left: auto !important;
|
|
242
310
|
}
|
|
243
|
-
|
|
244
311
|
.rs-table-row {
|
|
245
312
|
overflow: visible !important;
|
|
246
313
|
}
|
package/lib/qbsTable/QbsTable.js
CHANGED
|
@@ -16,9 +16,10 @@ var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
|
16
16
|
var _ColumShowHide = _interopRequireDefault(require("./utilities/ColumShowHide"));
|
|
17
17
|
var _debounce = _interopRequireDefault(require("./utilities/debounce"));
|
|
18
18
|
var _deepEqual = require("./utilities/deepEqual");
|
|
19
|
+
var _empty = _interopRequireDefault(require("./utilities/empty"));
|
|
19
20
|
var _icons = require("./utilities/icons");
|
|
20
21
|
require("../../dist/css/qbs-react-grid.css");
|
|
21
|
-
var
|
|
22
|
+
var _CardComponent = _interopRequireDefault(require("./utilities/CardComponent"));
|
|
22
23
|
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); }
|
|
23
24
|
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; }
|
|
24
25
|
// import 'qbs-react-table/dist/css/qbs-react-grid.css';
|
|
@@ -97,7 +98,15 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
97
98
|
_renderEmpty = _ref.renderEmpty,
|
|
98
99
|
autoHeight = _ref.autoHeight,
|
|
99
100
|
emptySubTitle = _ref.emptySubTitle,
|
|
100
|
-
emptyTitle = _ref.emptyTitle
|
|
101
|
+
emptyTitle = _ref.emptyTitle,
|
|
102
|
+
_ref$tableView = _ref.tableView,
|
|
103
|
+
tableView = _ref$tableView === void 0 ? true : _ref$tableView,
|
|
104
|
+
_ref$enableTableToggl = _ref.enableTableToggle,
|
|
105
|
+
enableTableToggle = _ref$enableTableToggl === void 0 ? false : _ref$enableTableToggl,
|
|
106
|
+
_ref$cardColumLimit = _ref.cardColumLimit,
|
|
107
|
+
cardColumLimit = _ref$cardColumLimit === void 0 ? 5 : _ref$cardColumLimit,
|
|
108
|
+
_ref$childDetailHeadi = _ref.childDetailHeading,
|
|
109
|
+
childDetailHeading = _ref$childDetailHeadi === void 0 ? '' : _ref$childDetailHeadi;
|
|
101
110
|
var _useState = (0, _react.useState)(false),
|
|
102
111
|
loading = _useState[0],
|
|
103
112
|
setLoading = _useState[1];
|
|
@@ -115,6 +124,9 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
115
124
|
isOpen = _useState4[0],
|
|
116
125
|
setIsOpen = _useState4[1];
|
|
117
126
|
var prevColumns = (0, _react.useRef)();
|
|
127
|
+
var _useState5 = (0, _react.useState)(tableView),
|
|
128
|
+
tableViewToggle = _useState5[0],
|
|
129
|
+
setTableViewToggle = _useState5[1];
|
|
118
130
|
var tableBodyRef = (0, _react.useRef)(null);
|
|
119
131
|
var handleSortColumn = (0, _react.useCallback)(function (sortColumn, sortType) {
|
|
120
132
|
setLoading(true);
|
|
@@ -137,6 +149,10 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
137
149
|
var keys = event.target.checked ? data.map(function (item) {
|
|
138
150
|
return item.id;
|
|
139
151
|
}) : [];
|
|
152
|
+
// let updatedKeys = [...keys];
|
|
153
|
+
// if (checkedKeys) {
|
|
154
|
+
// updatedKeys = [...checkedKeys, ...updatedKeys];
|
|
155
|
+
// } TODO => previous bug fix removed this section
|
|
140
156
|
var updatedKeys = [].concat(keys);
|
|
141
157
|
setCheckedKeys(updatedKeys);
|
|
142
158
|
handleChecked(updatedKeys);
|
|
@@ -233,7 +249,10 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
233
249
|
onSelect: handleClear,
|
|
234
250
|
handleColumnToggle: handleColumnToggle,
|
|
235
251
|
dataLength: data === null || data === void 0 ? void 0 : data.length,
|
|
236
|
-
searchPlaceholder: searchPlaceholder
|
|
252
|
+
searchPlaceholder: searchPlaceholder,
|
|
253
|
+
setTableViewToggle: setTableViewToggle,
|
|
254
|
+
tableViewToggle: tableViewToggle,
|
|
255
|
+
enableTableToggle: enableTableToggle
|
|
237
256
|
};
|
|
238
257
|
var themeToggle = (0, _react.useMemo)(function () {
|
|
239
258
|
return document.getElementById('themeToggle');
|
|
@@ -410,7 +429,7 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
410
429
|
"data-theme": dataTheme
|
|
411
430
|
}, toolbar && /*#__PURE__*/_react["default"].createElement(_Toolbar["default"], toolbarProps), /*#__PURE__*/_react["default"].createElement("div", {
|
|
412
431
|
className: "qbs-table-border-wrap"
|
|
413
|
-
}, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
|
|
432
|
+
}, tableViewToggle ? /*#__PURE__*/_react["default"].createElement(_Table["default"], {
|
|
414
433
|
height: autoHeight ? undefined : height,
|
|
415
434
|
key: tableKey,
|
|
416
435
|
tableKey: tableKey,
|
|
@@ -482,13 +501,13 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
482
501
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
483
502
|
type: "checkbox",
|
|
484
503
|
onChange: handleCheckAll,
|
|
485
|
-
id:
|
|
504
|
+
id: 'checkbox-all',
|
|
486
505
|
className: "qbs-table-checkbox-input " + classes.tableCheckBoxClass,
|
|
487
506
|
checked: (data === null || data === void 0 ? void 0 : data.length) > 0 && data.every(function (item) {
|
|
488
507
|
return checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.includes(item.id);
|
|
489
508
|
})
|
|
490
509
|
}), /*#__PURE__*/_react["default"].createElement("label", {
|
|
491
|
-
htmlFor:
|
|
510
|
+
htmlFor: 'checkbox-all'
|
|
492
511
|
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
493
512
|
width: "8",
|
|
494
513
|
height: "6",
|
|
@@ -559,7 +578,21 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
559
578
|
className: classes.cellClass + " " + classes.actionCellClass,
|
|
560
579
|
handleMenuActions: handleMenuActions,
|
|
561
580
|
dataTheme: dataTheme
|
|
562
|
-
})))
|
|
581
|
+
}))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
582
|
+
className: " p-2"
|
|
583
|
+
}, data.map(function (items) {
|
|
584
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
585
|
+
className: "flex flex-col gap-3 p-2",
|
|
586
|
+
key: items === null || items === void 0 ? void 0 : items.id
|
|
587
|
+
}, /*#__PURE__*/_react["default"].createElement(_CardComponent["default"], {
|
|
588
|
+
data: items,
|
|
589
|
+
cardColumLimit: cardColumLimit,
|
|
590
|
+
childDetailHeading: childDetailHeading,
|
|
591
|
+
columns: columns,
|
|
592
|
+
tableBodyRef: tableBodyRef,
|
|
593
|
+
actionProps: actionProps
|
|
594
|
+
}));
|
|
595
|
+
})), /*#__PURE__*/_react["default"].createElement("div", null, pagination && (data === null || data === void 0 ? void 0 : data.length) > 0 && /*#__PURE__*/_react["default"].createElement(_Pagination["default"], {
|
|
563
596
|
paginationProps: paginationProps
|
|
564
597
|
}))));
|
|
565
598
|
};
|