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.
Files changed (62) hide show
  1. package/dist/css/qbs-react-grid.css +1 -1095
  2. package/dist/css/qbs-react-grid.min.css +1 -1
  3. package/dist/css/qbs-react-grid.min.css.map +1 -1
  4. package/es/Table.js +19 -19
  5. package/es/less/index.less +3 -0
  6. package/es/less/qbs-table.less +89 -22
  7. package/es/qbsTable/QbsTable.js +40 -7
  8. package/es/qbsTable/TableCardList.d.ts +5 -0
  9. package/es/qbsTable/TableCardList.js +564 -0
  10. package/es/qbsTable/Toolbar.js +21 -5
  11. package/es/qbsTable/commontypes.d.ts +12 -0
  12. package/es/qbsTable/utilities/CardComponent.d.ts +14 -0
  13. package/es/qbsTable/utilities/CardComponent.js +83 -0
  14. package/es/qbsTable/utilities/CardMenuDropdown.d.ts +13 -0
  15. package/es/qbsTable/utilities/CardMenuDropdown.js +93 -0
  16. package/es/qbsTable/utilities/SwitchCardColumns.d.ts +2 -0
  17. package/es/qbsTable/utilities/SwitchCardColumns.js +24 -0
  18. package/es/qbsTable/utilities/ToolTip.js +2 -5
  19. package/es/qbsTable/utilities/icons.d.ts +3 -0
  20. package/es/qbsTable/utilities/icons.js +45 -0
  21. package/es/qbsTable/utilities/store.d.ts +2 -0
  22. package/es/qbsTable/utilities/store.js +60 -0
  23. package/es/utils/getTotalByColumns.js +1 -1
  24. package/es/utils/mergeCells.js +1 -1
  25. package/es/utils/useCellDescriptor.js +11 -11
  26. package/es/utils/useClassNames.js +2 -0
  27. package/lib/Table.js +19 -19
  28. package/lib/less/index.less +3 -0
  29. package/lib/less/qbs-table.less +89 -22
  30. package/lib/qbsTable/QbsTable.js +40 -7
  31. package/lib/qbsTable/TableCardList.d.ts +5 -0
  32. package/lib/qbsTable/TableCardList.js +571 -0
  33. package/lib/qbsTable/Toolbar.js +20 -4
  34. package/lib/qbsTable/commontypes.d.ts +12 -0
  35. package/lib/qbsTable/utilities/CardComponent.d.ts +14 -0
  36. package/lib/qbsTable/utilities/CardComponent.js +91 -0
  37. package/lib/qbsTable/utilities/CardMenuDropdown.d.ts +13 -0
  38. package/lib/qbsTable/utilities/CardMenuDropdown.js +100 -0
  39. package/lib/qbsTable/utilities/SwitchCardColumns.d.ts +2 -0
  40. package/lib/qbsTable/utilities/SwitchCardColumns.js +30 -0
  41. package/lib/qbsTable/utilities/ToolTip.js +2 -5
  42. package/lib/qbsTable/utilities/icons.d.ts +3 -0
  43. package/lib/qbsTable/utilities/icons.js +50 -2
  44. package/lib/qbsTable/utilities/store.d.ts +2 -0
  45. package/lib/qbsTable/utilities/store.js +66 -0
  46. package/lib/utils/getTotalByColumns.js +1 -1
  47. package/lib/utils/mergeCells.js +1 -1
  48. package/lib/utils/useCellDescriptor.js +11 -11
  49. package/lib/utils/useClassNames.js +2 -0
  50. package/package.json +11 -6
  51. package/src/less/index.less +3 -0
  52. package/src/less/qbs-table.less +89 -22
  53. package/src/qbsTable/QbsTable.tsx +205 -173
  54. package/src/qbsTable/TableCardList.tsx +629 -0
  55. package/src/qbsTable/Toolbar.tsx +25 -4
  56. package/src/qbsTable/commontypes.ts +12 -0
  57. package/src/qbsTable/utilities/CardComponent.tsx +132 -0
  58. package/src/qbsTable/utilities/CardMenuDropdown.tsx +120 -0
  59. package/src/qbsTable/utilities/SwitchCardColumns.tsx +29 -0
  60. package/src/qbsTable/utilities/ToolTip.tsx +1 -4
  61. package/src/qbsTable/utilities/icons.tsx +51 -0
  62. package/src/qbsTable/utilities/store.ts +61 -0
@@ -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: #000;
192
- color: #fff;
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: 125%;
209
- left: 0%;
269
+ bottom: calc(100% + 10px);
270
+ right: -8px;
271
+ left: unset;
210
272
  }
211
273
 
212
274
  .qbs-table-tooltip.down .tooltiptext {
213
- top: 125%;
214
- right: 0px;
215
- left: auto;
275
+ right: -10px;
276
+ top: calc(100% + 8px);
216
277
  }
217
278
 
218
- .qbs-table-tooltip:hover .tooltiptext {
219
- visibility: visible;
220
- opacity: 1;
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
- top: 100%;
232
- left: 50%;
233
- margin-left: -5px;
234
- border-color: #000 transparent transparent transparent;
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
- bottom: 100%;
239
- left: 50%;
240
- margin-left: -5px;
241
- border-color: transparent transparent #000 transparent;
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
  }
@@ -18,12 +18,13 @@ import ToolBar from './Toolbar';
18
18
  import ColumToggle from './utilities/ColumShowHide';
19
19
  import debounce from './utilities/debounce';
20
20
  import { deepEqual } from './utilities/deepEqual';
21
+ import NoData from './utilities/empty';
21
22
  import { SettingsIcon } from './utilities/icons';
22
23
 
23
24
  // import 'qbs-react-table/dist/css/qbs-react-grid.css';
24
25
 
25
26
  import '../../dist/css/qbs-react-grid.css';
26
- import NoData from './utilities/empty';
27
+ import CardComponent from './utilities/CardComponent';
27
28
 
28
29
  const CHECKBOX_LINE_HEIGHT = '36px';
29
30
  const COLUMN_WIDTH = 250;
@@ -81,7 +82,11 @@ const QbsTable: React.FC<QbsTableProps> = ({
81
82
  renderEmpty,
82
83
  autoHeight,
83
84
  emptySubTitle,
84
- emptyTitle
85
+ emptyTitle,
86
+ tableView = true,
87
+ enableTableToggle = false,
88
+ cardColumLimit = 5,
89
+ childDetailHeading = ''
85
90
  }) => {
86
91
  const [loading, setLoading] = useState(false);
87
92
  const [columns, setColumns] = useState(propColumn);
@@ -89,6 +94,8 @@ const QbsTable: React.FC<QbsTableProps> = ({
89
94
  const dataTheme = useMemo(() => localStorage.getItem('theme') ?? theme, [theme]);
90
95
  const [isOpen, setIsOpen] = useState(false);
91
96
  const prevColumns = useRef<any | null>();
97
+ const [tableViewToggle, setTableViewToggle] = useState(tableView);
98
+
92
99
  const tableBodyRef = useRef<HTMLDivElement>(null);
93
100
  const handleSortColumn = useCallback(
94
101
  (sortColumn: any, sortType: any) => {
@@ -115,7 +122,11 @@ const QbsTable: React.FC<QbsTableProps> = ({
115
122
  const handleCheckAll = useCallback(
116
123
  (event: React.ChangeEvent<HTMLInputElement>) => {
117
124
  const keys = event.target.checked ? data.map(item => item.id) : [];
118
- let updatedKeys = [...keys];
125
+ // let updatedKeys = [...keys];
126
+ // if (checkedKeys) {
127
+ // updatedKeys = [...checkedKeys, ...updatedKeys];
128
+ // } TODO => previous bug fix removed this section
129
+ const updatedKeys = [...keys];
119
130
  setCheckedKeys(updatedKeys);
120
131
  handleChecked(updatedKeys);
121
132
  },
@@ -126,7 +137,7 @@ const QbsTable: React.FC<QbsTableProps> = ({
126
137
  (event: React.ChangeEvent<HTMLInputElement>) => {
127
138
  const value = event.target.value;
128
139
  if (value !== undefined) {
129
- let updatedKeys = event.target.checked
140
+ const updatedKeys = event.target.checked
130
141
  ? [...checkedKeys, value]
131
142
  : checkedKeys.filter(key => key !== value);
132
143
  setCheckedKeys(updatedKeys);
@@ -222,7 +233,10 @@ const QbsTable: React.FC<QbsTableProps> = ({
222
233
  onSelect: handleClear,
223
234
  handleColumnToggle: handleColumnToggle,
224
235
  dataLength: data?.length,
225
- searchPlaceholder: searchPlaceholder
236
+ searchPlaceholder: searchPlaceholder,
237
+ setTableViewToggle: setTableViewToggle,
238
+ tableViewToggle: tableViewToggle,
239
+ enableTableToggle: enableTableToggle
226
240
  };
227
241
  const themeToggle = useMemo(() => document.getElementById('themeToggle') as HTMLInputElement, []);
228
242
 
@@ -259,7 +273,7 @@ const QbsTable: React.FC<QbsTableProps> = ({
259
273
  const keyValue = dataRowKey as string;
260
274
  const key = rowData[keyValue];
261
275
 
262
- let nextExpandedRowKeys = new Set(expandedRowKeys);
276
+ const nextExpandedRowKeys = new Set(expandedRowKeys);
263
277
 
264
278
  if (nextExpandedRowKeys.has(key)) {
265
279
  nextExpandedRowKeys.delete(key);
@@ -436,129 +450,154 @@ const QbsTable: React.FC<QbsTableProps> = ({
436
450
  <div className={`qbs-table ${classes.tableContainerClass}`} data-theme={dataTheme}>
437
451
  {toolbar && <ToolBar {...toolbarProps} />}
438
452
  <div className="qbs-table-border-wrap">
439
- <Table
440
- height={autoHeight ? undefined : height}
441
- key={tableKey}
442
- tableKey={tableKey}
443
- data={data}
444
- tableBodyRef={tableBodyRef}
445
- dataTheme={dataTheme}
446
- wordWrap={wordWrap}
447
- autoHeight={autoHeight}
448
- sortColumn={sortColumn}
449
- style={{ position: 'relative' }}
450
- sortType={sortType}
451
- onSortColumn={handleSortColumn}
452
- onRowClick={onRowClick}
453
- tableBodyHeight={tableBodyHeight}
454
- cellBordered={cellBordered}
455
- bordered={bordered}
456
- renderEmpty={(info: React.ReactNode) =>
457
- renderEmpty ? (
458
- renderEmpty(info)
459
- ) : (
460
- <NoData title={emptyTitle ?? 'No Data Found'} subtitle={emptySubTitle} />
461
- )
462
- }
463
- columns={columns}
464
- minHeight={minHeight}
465
- headerHeight={headerHeight}
466
- rowExpandedHeight={rowExpandedHeight}
467
- loading={isLoading ?? loading}
468
- showHeader
469
- defaultChecked
470
- expandedRowKeys={expandedRowKeys}
471
- onExpandChange={onExpandChange}
472
- rowKey={dataRowKey ?? 'id'}
473
- defaultExpandAllRows={defaultExpandAllRows}
474
- shouldUpdateScroll={shouldUpdateScroll}
475
- renderRowExpanded={rowData => {
476
- return handleRowExpanded?.(rowData);
477
- }}
478
- >
479
- {rowExpand && (
480
- <Column width={70} align="center" fixed="left">
481
- <HeaderCell
482
- verticalAlign={findGrouped() ? 'middle' : undefined}
483
- className={` ${classes.headerlClass}`}
484
- renderSortIcon={renderSortIcon}
485
- >
486
- #
487
- </HeaderCell>
488
- <ExpandCell
489
- dataKey={dataRowKey}
490
- expandedRowKeys={expandedRowKeys}
491
- onChange={handleExpanded}
492
- />
493
- </Column>
494
- )}
495
- {selection && (
496
- <Column width={50} align="center" fixed="left">
497
- <HeaderCell
498
- style={{ padding: 0 }}
499
- verticalAlign={findGrouped() ? 'middle' : undefined}
500
- dataTheme={dataTheme}
501
- renderSortIcon={renderSortIcon}
502
- className={`qbs-checkbox-border-none ${classes.headerlClass}`}
503
- >
504
- <div
505
- style={{ lineHeight: CHECKBOX_LINE_HEIGHT }}
506
- className={`qbs-table-checkbox ${classes.selectionCell}`}
453
+ {tableViewToggle ? (
454
+ <Table
455
+ height={autoHeight ? undefined : height}
456
+ key={tableKey}
457
+ tableKey={tableKey}
458
+ data={data}
459
+ tableBodyRef={tableBodyRef}
460
+ dataTheme={dataTheme}
461
+ wordWrap={wordWrap}
462
+ autoHeight={autoHeight}
463
+ sortColumn={sortColumn}
464
+ style={{ position: 'relative' }}
465
+ sortType={sortType}
466
+ onSortColumn={handleSortColumn}
467
+ onRowClick={onRowClick}
468
+ tableBodyHeight={tableBodyHeight}
469
+ cellBordered={cellBordered}
470
+ bordered={bordered}
471
+ renderEmpty={(info: React.ReactNode) =>
472
+ renderEmpty ? (
473
+ renderEmpty(info)
474
+ ) : (
475
+ <NoData title={emptyTitle ?? 'No Data Found'} subtitle={emptySubTitle} />
476
+ )
477
+ }
478
+ columns={columns}
479
+ minHeight={minHeight}
480
+ headerHeight={headerHeight}
481
+ rowExpandedHeight={rowExpandedHeight}
482
+ loading={isLoading ?? loading}
483
+ showHeader
484
+ defaultChecked
485
+ expandedRowKeys={expandedRowKeys}
486
+ onExpandChange={onExpandChange}
487
+ rowKey={dataRowKey ?? 'id'}
488
+ defaultExpandAllRows={defaultExpandAllRows}
489
+ shouldUpdateScroll={shouldUpdateScroll}
490
+ renderRowExpanded={rowData => {
491
+ return handleRowExpanded?.(rowData);
492
+ }}
493
+ >
494
+ {rowExpand && (
495
+ <Column width={70} align="center" fixed="left">
496
+ <HeaderCell
497
+ verticalAlign={findGrouped() ? 'middle' : undefined}
498
+ className={` ${classes.headerlClass}`}
499
+ renderSortIcon={renderSortIcon}
507
500
  >
508
- <input
509
- type="checkbox"
510
- onChange={handleCheckAll}
511
- id={`checkbox-all`}
512
- className={`qbs-table-checkbox-input ${classes.tableCheckBoxClass}`}
513
- checked={data?.length > 0 && data.every(item => checkedKeys?.includes(item.id))}
514
- />
515
- <label htmlFor={`checkbox-all`}>
516
- <svg
517
- width="8"
518
- height="6"
519
- viewBox="0 0 8 6"
520
- fill="none"
521
- xmlns="http://www.w3.org/2000/svg"
522
- >
523
- <path
524
- d="M0 3.21739L2.89883 6L8 1.06994L6.89494 0L2.89883 3.86768L1.09728 2.14745L0 3.21739Z"
525
- fill="white"
526
- />
527
- </svg>
528
- </label>
529
- </div>
530
- </HeaderCell>
531
- <CheckCell
532
- dataKey="id"
533
- checkedKeys={checkedKeys}
534
- className={`${classes.tableCheckBoxClass}`}
535
- onChange={handleCheck}
536
- dataTheme={dataTheme}
537
- />
538
- </Column>
539
- )}
540
- {customRowStatus && Object.keys(customRowStatus)?.length > 0 && (
541
- <Column width={50} align="center" fixed="left">
542
- <HeaderCell
543
- verticalAlign={findGrouped() ? 'middle' : undefined}
544
- className={` ${classes.headerlClass}`}
545
- renderSortIcon={renderSortIcon}
546
- >
547
- {' '}
548
- </HeaderCell>
549
- <CustomRowStatus
550
- getIcon={customRowStatus.getIcon}
551
- dataKey={customRowStatus.field}
552
- rowClick={customRowStatus.onClick}
553
- path={customRowStatus.getPath}
554
- link={customRowStatus.link}
555
- getToolTip={customRowStatus.getToolTip}
556
- />
557
- </Column>
558
- )}
559
- {columnsRendered}
560
- {!actionProps ||
561
- (actionProps?.length === 0 && columnToggle && (
501
+ #
502
+ </HeaderCell>
503
+ <ExpandCell
504
+ dataKey={dataRowKey}
505
+ expandedRowKeys={expandedRowKeys}
506
+ onChange={handleExpanded}
507
+ />
508
+ </Column>
509
+ )}
510
+ {selection && (
511
+ <Column width={50} align="center" fixed="left">
512
+ <HeaderCell
513
+ style={{ padding: 0 }}
514
+ verticalAlign={findGrouped() ? 'middle' : undefined}
515
+ dataTheme={dataTheme}
516
+ renderSortIcon={renderSortIcon}
517
+ className={`qbs-checkbox-border-none ${classes.headerlClass}`}
518
+ >
519
+ <div
520
+ style={{ lineHeight: CHECKBOX_LINE_HEIGHT }}
521
+ className={`qbs-table-checkbox ${classes.selectionCell}`}
522
+ >
523
+ <input
524
+ type="checkbox"
525
+ onChange={handleCheckAll}
526
+ id={'checkbox-all'}
527
+ className={`qbs-table-checkbox-input ${classes.tableCheckBoxClass}`}
528
+ checked={
529
+ data?.length > 0 && data.every(item => checkedKeys?.includes(item.id))
530
+ }
531
+ />
532
+ <label htmlFor={'checkbox-all'}>
533
+ <svg
534
+ width="8"
535
+ height="6"
536
+ viewBox="0 0 8 6"
537
+ fill="none"
538
+ xmlns="http://www.w3.org/2000/svg"
539
+ >
540
+ <path
541
+ d="M0 3.21739L2.89883 6L8 1.06994L6.89494 0L2.89883 3.86768L1.09728 2.14745L0 3.21739Z"
542
+ fill="white"
543
+ />
544
+ </svg>
545
+ </label>
546
+ </div>
547
+ </HeaderCell>
548
+ <CheckCell
549
+ dataKey="id"
550
+ checkedKeys={checkedKeys}
551
+ className={`${classes.tableCheckBoxClass}`}
552
+ onChange={handleCheck}
553
+ dataTheme={dataTheme}
554
+ />
555
+ </Column>
556
+ )}
557
+ {customRowStatus && Object.keys(customRowStatus)?.length > 0 && (
558
+ <Column width={50} align="center" fixed="left">
559
+ <HeaderCell
560
+ verticalAlign={findGrouped() ? 'middle' : undefined}
561
+ className={` ${classes.headerlClass}`}
562
+ renderSortIcon={renderSortIcon}
563
+ >
564
+ {' '}
565
+ </HeaderCell>
566
+ <CustomRowStatus
567
+ getIcon={customRowStatus.getIcon}
568
+ dataKey={customRowStatus.field}
569
+ rowClick={customRowStatus.onClick}
570
+ path={customRowStatus.getPath}
571
+ link={customRowStatus.link}
572
+ getToolTip={customRowStatus.getToolTip}
573
+ />
574
+ </Column>
575
+ )}
576
+ {columnsRendered}
577
+ {!actionProps ||
578
+ (actionProps?.length === 0 && columnToggle && (
579
+ <Column width={40} fixed="right">
580
+ <HeaderCell
581
+ verticalAlign={findGrouped() ? 'middle' : undefined}
582
+ className={` ${classes.headerlClass}`}
583
+ dataTheme={dataTheme}
584
+ renderSortIcon={renderSortIcon}
585
+ >
586
+ <ColumToggle
587
+ columns={columns}
588
+ onToggle={handleToggle}
589
+ onReorder={onReorder}
590
+ isOpen={isOpen}
591
+ tableHeight={height}
592
+ setIsOpen={setIsOpen}
593
+ handleResetColumns={handleResetColumns}
594
+ handleColumnToggle={handleColumnToggle}
595
+ />
596
+ </HeaderCell>
597
+ <Cell />
598
+ </Column>
599
+ ))}
600
+ {actionProps && actionProps?.length > 0 && (
562
601
  <Column width={40} fixed="right">
563
602
  <HeaderCell
564
603
  verticalAlign={findGrouped() ? 'middle' : undefined}
@@ -566,54 +605,47 @@ const QbsTable: React.FC<QbsTableProps> = ({
566
605
  dataTheme={dataTheme}
567
606
  renderSortIcon={renderSortIcon}
568
607
  >
569
- <ColumToggle
570
- columns={columns}
571
- onToggle={handleToggle}
572
- onReorder={onReorder}
573
- isOpen={isOpen}
574
- tableHeight={height}
575
- setIsOpen={setIsOpen}
576
- handleResetColumns={handleResetColumns}
577
- handleColumnToggle={handleColumnToggle}
578
- />
608
+ {!columnToggle ? (
609
+ <SettingsIcon />
610
+ ) : (
611
+ <ColumToggle
612
+ columns={columns}
613
+ onToggle={handleToggle}
614
+ tableHeight={height}
615
+ onReorder={onReorder}
616
+ isOpen={isOpen}
617
+ setIsOpen={setIsOpen}
618
+ handleResetColumns={handleResetColumns}
619
+ handleColumnToggle={handleColumnToggle}
620
+ />
621
+ )}
579
622
  </HeaderCell>
580
- <Cell />
623
+ <ActionCell
624
+ tableBodyRef={tableBodyRef}
625
+ actionProps={actionProps}
626
+ className={`${classes.cellClass} ${classes.actionCellClass}`}
627
+ handleMenuActions={handleMenuActions}
628
+ dataTheme={dataTheme}
629
+ />
581
630
  </Column>
631
+ )}
632
+ </Table>
633
+ ) : (
634
+ <div className=" p-2">
635
+ {data.map((items: any) => (
636
+ <div className="flex flex-col gap-3 p-2" key={items?.id}>
637
+ <CardComponent
638
+ data={items}
639
+ cardColumLimit={cardColumLimit}
640
+ childDetailHeading={childDetailHeading}
641
+ columns={columns}
642
+ tableBodyRef={tableBodyRef}
643
+ actionProps={actionProps}
644
+ />
645
+ </div>
582
646
  ))}
583
- {actionProps && actionProps?.length > 0 && (
584
- <Column width={40} fixed="right">
585
- <HeaderCell
586
- verticalAlign={findGrouped() ? 'middle' : undefined}
587
- className={` ${classes.headerlClass}`}
588
- dataTheme={dataTheme}
589
- renderSortIcon={renderSortIcon}
590
- >
591
- {!columnToggle ? (
592
- <SettingsIcon />
593
- ) : (
594
- <ColumToggle
595
- columns={columns}
596
- onToggle={handleToggle}
597
- tableHeight={height}
598
- onReorder={onReorder}
599
- isOpen={isOpen}
600
- setIsOpen={setIsOpen}
601
- handleResetColumns={handleResetColumns}
602
- handleColumnToggle={handleColumnToggle}
603
- />
604
- )}
605
- </HeaderCell>
606
- <ActionCell
607
- tableBodyRef={tableBodyRef}
608
- actionProps={actionProps}
609
- className={`${classes.cellClass} ${classes.actionCellClass}`}
610
- handleMenuActions={handleMenuActions}
611
- dataTheme={dataTheme}
612
- />
613
- </Column>
614
- )}
615
- </Table>
616
-
647
+ </div>
648
+ )}
617
649
  <div>
618
650
  {pagination && data?.length > 0 && <Pagination paginationProps={paginationProps} />}
619
651
  </div>