mui-universal-table 2.1.1 → 2.1.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/index.cjs CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React$1 = require('react');
5
+ var React = require('react');
6
6
  var PropTypes = require('prop-types');
7
7
  var Paper = require('@mui/material/Paper');
8
8
  var material = require('@mui/material');
9
+ var jsxRuntime = require('react/jsx-runtime');
9
10
  var styles = require('@mui/material/styles');
10
11
  var iconsMaterial = require('@mui/icons-material');
11
12
  var RefreshIcon = require('@mui/icons-material/Refresh');
@@ -29,15 +30,6 @@ function _defineProperty(e, r, t) {
29
30
  writable: true
30
31
  }) : e[r] = t, e;
31
32
  }
32
- function _extends() {
33
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
34
- for (var e = 1; e < arguments.length; e++) {
35
- var t = arguments[e];
36
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
37
- }
38
- return n;
39
- }, _extends.apply(null, arguments);
40
- }
41
33
  function _iterableToArray(r) {
42
34
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
43
35
  }
@@ -124,25 +116,28 @@ var LazyLoadingIndicator = function LazyLoadingIndicator(_ref) {
124
116
  var show = _ref.show,
125
117
  currentPage = _ref.currentPage,
126
118
  totalPages = _ref.totalPages;
127
- return /*#__PURE__*/React.createElement(material.Collapse, {
119
+ return /*#__PURE__*/jsxRuntime.jsx(material.Collapse, {
128
120
  "in": show,
129
121
  timeout: "auto",
130
- unmountOnExit: true
131
- }, /*#__PURE__*/React.createElement(material.Box, {
132
- sx: {
133
- width: "100%",
134
- p: 2
135
- }
136
- }, /*#__PURE__*/React.createElement(material.Typography, {
137
- variant: "body2",
138
- color: "text.secondary",
139
- sx: {
140
- mb: 1
141
- }
142
- }, "Loading page ", currentPage, " of ", totalPages, "..."), /*#__PURE__*/React.createElement(material.LinearProgress, {
143
- variant: "determinate",
144
- value: currentPage / totalPages * 100
145
- })));
122
+ unmountOnExit: true,
123
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
124
+ sx: {
125
+ width: "100%",
126
+ p: 2
127
+ },
128
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
129
+ variant: "body2",
130
+ color: "text.secondary",
131
+ sx: {
132
+ mb: 1
133
+ },
134
+ children: ["Loading page ", currentPage, " of ", totalPages, "..."]
135
+ }), /*#__PURE__*/jsxRuntime.jsx(material.LinearProgress, {
136
+ variant: "determinate",
137
+ value: currentPage / totalPages * 100
138
+ })]
139
+ })
140
+ });
146
141
  };
147
142
  LazyLoadingIndicator.propTypes = {
148
143
  show: PropTypes.bool.isRequired,
@@ -300,14 +295,14 @@ function stableSort(array, comparator, headers, orderBy) {
300
295
  }
301
296
 
302
297
  function useSearchableRows(data, headers, async) {
303
- var _React$useState = React$1.useState(""),
298
+ var _React$useState = React.useState(""),
304
299
  _React$useState2 = _slicedToArray(_React$useState, 2),
305
300
  searchTerm = _React$useState2[0],
306
301
  setSearchTerm = _React$useState2[1];
307
- var filterOptions = React$1.useMemo(function () {
302
+ var filterOptions = React.useMemo(function () {
308
303
  return getSearchableColumnIds(headers);
309
304
  }, [headers]);
310
- var rows = React$1.useMemo(function () {
305
+ var rows = React.useMemo(function () {
311
306
  return async ? data : filterRows(data, searchTerm, filterOptions);
312
307
  }, [async, data, filterOptions, searchTerm]);
313
308
  return {
@@ -321,14 +316,14 @@ function useSelectableRows(_ref) {
321
316
  var rows = _ref.rows,
322
317
  selectRows = _ref.selectRows,
323
318
  selectID = _ref.selectID;
324
- var _React$useState = React$1.useState([]),
319
+ var _React$useState = React.useState([]),
325
320
  _React$useState2 = _slicedToArray(_React$useState, 2),
326
321
  selected = _React$useState2[0],
327
322
  setSelected = _React$useState2[1];
328
- var clearSelection = React$1.useCallback(function () {
323
+ var clearSelection = React.useCallback(function () {
329
324
  setSelected([]);
330
325
  }, []);
331
- var handleSelectAllClick = React$1.useCallback(function (event) {
326
+ var handleSelectAllClick = React.useCallback(function (event) {
332
327
  if (!event.target.checked) {
333
328
  setSelected([]);
334
329
  return;
@@ -338,7 +333,7 @@ function useSelectableRows(_ref) {
338
333
  });
339
334
  setSelected(newSelected);
340
335
  }, [rows, selectID]);
341
- var handleClick = React$1.useCallback(function (event, id) {
336
+ var handleClick = React.useCallback(function (event, id) {
342
337
  if (!selectRows) {
343
338
  return;
344
339
  }
@@ -360,30 +355,34 @@ function TableSelectionBanner(_ref) {
360
355
  var selected = _ref.selected,
361
356
  onSelection = _ref.onSelection,
362
357
  selectIcon = _ref.selectIcon;
363
- return /*#__PURE__*/React.createElement(material.Collapse, {
358
+ return /*#__PURE__*/jsxRuntime.jsx(material.Collapse, {
364
359
  "in": selected.length > 0,
365
- unmountOnExit: true
366
- }, /*#__PURE__*/React.createElement(material.Box, {
367
- sx: {
368
- p: 2,
369
- display: "flex",
370
- justifyContent: "space-between",
371
- bgcolor: function bgcolor(theme) {
372
- return styles.alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity);
360
+ unmountOnExit: true,
361
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
362
+ sx: {
363
+ p: 2,
364
+ display: "flex",
365
+ justifyContent: "space-between",
366
+ bgcolor: function bgcolor(theme) {
367
+ return styles.alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity);
368
+ },
369
+ borderRadius: 1,
370
+ borderBottomLeftRadius: 0,
371
+ borderBottomRightRadius: 0
373
372
  },
374
- borderRadius: 1,
375
- borderBottomLeftRadius: 0,
376
- borderBottomRightRadius: 0
377
- }
378
- }, /*#__PURE__*/React.createElement(material.Typography, {
379
- variant: "h6",
380
- id: "tableTitle",
381
- component: "div"
382
- }, selected.length, " selected"), /*#__PURE__*/React.createElement(material.IconButton, {
383
- onClick: function onClick() {
384
- return onSelection(selected);
385
- }
386
- }, selectIcon || /*#__PURE__*/React.createElement(iconsMaterial.Task, null))));
373
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
374
+ variant: "h6",
375
+ id: "tableTitle",
376
+ component: "div",
377
+ children: [selected.length, " selected"]
378
+ }), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
379
+ onClick: function onClick() {
380
+ return onSelection(selected);
381
+ },
382
+ children: selectIcon || /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.Task, {})
383
+ })]
384
+ })
385
+ });
387
386
  }
388
387
  TableSelectionBanner.propTypes = {
389
388
  selected: PropTypes.array.isRequired,
@@ -394,13 +393,14 @@ TableSelectionBanner.propTypes = {
394
393
  function TableTitle(_ref) {
395
394
  var name = _ref.name,
396
395
  subTable = _ref.subTable;
397
- return /*#__PURE__*/React.createElement(material.Typography, {
396
+ return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
398
397
  variant: subTable ? "h6" : "h5",
399
398
  color: subTable ? "secondary" : "primary",
400
399
  sx: {
401
400
  p: 2
402
- }
403
- }, name);
401
+ },
402
+ children: name
403
+ });
404
404
  }
405
405
  TableTitle.propTypes = {
406
406
  name: PropTypes.string,
@@ -419,14 +419,16 @@ function ReloadBtn(_ref) {
419
419
  onReload();
420
420
  }
421
421
  };
422
- return /*#__PURE__*/React.createElement(material.Tooltip, {
423
- title: "Reload"
424
- }, /*#__PURE__*/React.createElement(material.Button, {
425
- variant: "contained",
426
- color: "primary",
427
- onClick: handleClick,
428
- disabled: loading
429
- }, /*#__PURE__*/React.createElement(RefreshIcon, null)));
422
+ return /*#__PURE__*/jsxRuntime.jsx(material.Tooltip, {
423
+ title: "Reload",
424
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Button, {
425
+ variant: "contained",
426
+ color: "primary",
427
+ onClick: handleClick,
428
+ disabled: loading,
429
+ children: /*#__PURE__*/jsxRuntime.jsx(RefreshIcon, {})
430
+ })
431
+ });
430
432
  }
431
433
  ReloadBtn.propTypes = {
432
434
  loading: PropTypes.bool,
@@ -437,7 +439,7 @@ ReloadBtn.propTypes = {
437
439
  function FancySearch(_ref) {
438
440
  var value = _ref.value,
439
441
  onSubmit = _ref.onSubmit;
440
- var _React$useState = React$1.useState(Boolean(value)),
442
+ var _React$useState = React.useState(Boolean(value)),
441
443
  _React$useState2 = _slicedToArray(_React$useState, 2),
442
444
  hover = _React$useState2[0],
443
445
  setHover = _React$useState2[1];
@@ -453,69 +455,75 @@ function FancySearch(_ref) {
453
455
  // Sync internal state when the parent clears/changes the search term.
454
456
  // A ref tracks whether this sync came from the user typing or from a parent
455
457
  // update, so the debounce only fires for genuine user input.
456
- var isUserTypingRef = React$1.useRef(false);
457
- return /*#__PURE__*/React$1.createElement("form", {
458
- onSubmit: handleSubmit
459
- }, /*#__PURE__*/React$1.createElement(material.Paper, {
460
- elevation: 0,
461
- sx: {
462
- borderRadius: expanded ? "24px" : "50px",
463
- display: "flex",
464
- alignItems: "center",
465
- transition: "all 0.5s ease-in-out",
466
- p: expanded ? 1 : 0.5,
467
- width: "fit-content",
468
- border: function border(theme) {
469
- return "1px solid ".concat(theme.palette.divider);
458
+ var isUserTypingRef = React.useRef(false);
459
+ return /*#__PURE__*/jsxRuntime.jsx("form", {
460
+ onSubmit: handleSubmit,
461
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Paper, {
462
+ elevation: 0,
463
+ sx: {
464
+ borderRadius: expanded ? "24px" : "50px",
465
+ display: "flex",
466
+ alignItems: "center",
467
+ transition: "all 0.5s ease-in-out",
468
+ p: expanded ? 1 : 0.5,
469
+ width: "fit-content",
470
+ border: function border(theme) {
471
+ return "1px solid ".concat(theme.palette.divider);
472
+ },
473
+ mb: 1
470
474
  },
471
- mb: 1
472
- },
473
- onMouseEnter: function onMouseEnter() {
474
- return setHover(true);
475
- },
476
- onMouseLeave: handleEndHover,
477
- onKeyDown: function onKeyDown(e) {
478
- return e.key === "Enter" && handleSubmit(e);
479
- }
480
- }, /*#__PURE__*/React$1.createElement(material.InputBase, {
481
- placeholder: "Search",
482
- value: value,
483
- onChange: function onChange(e) {
484
- isUserTypingRef.current = true;
485
- onSubmit(e.target.value);
486
- },
487
- sx: _objectSpread2({
488
- ml: 1,
489
- width: expanded ? "100%" : 0,
490
- transition: "width 0.5s ease-in-out"
491
- }, expanded ? {} : {
492
- margin: 0
493
- }),
494
- onBlur: handleEndHover
495
- }), /*#__PURE__*/React$1.createElement(material.Collapse, {
496
- "in": Boolean(value),
497
- orientation: "horizontal",
498
- unmountOnExit: true
499
- }, /*#__PURE__*/React$1.createElement(material.Stack, {
500
- direction: "row",
501
- spacing: 0,
502
- sx: {
503
- mr: 3,
504
- alignItems: "center"
505
- }
506
- }, /*#__PURE__*/React$1.createElement(material.IconButton, {
507
- onClick: function onClick() {
508
- isUserTypingRef.current = false;
509
- // Immediately clear instead of waiting for the debounce
510
- onSubmit("");
511
- }
512
- }, /*#__PURE__*/React$1.createElement(iconsMaterial.Clear, null)), /*#__PURE__*/React$1.createElement(material.Divider, {
513
- orientation: "vertical",
514
- flexItem: true
515
- }))), /*#__PURE__*/React$1.createElement(material.IconButton, {
516
- onClick: handleSubmit,
517
- type: "submit"
518
- }, /*#__PURE__*/React$1.createElement(iconsMaterial.Search, null))));
475
+ onMouseEnter: function onMouseEnter() {
476
+ return setHover(true);
477
+ },
478
+ onMouseLeave: handleEndHover,
479
+ onKeyDown: function onKeyDown(e) {
480
+ return e.key === "Enter" && handleSubmit(e);
481
+ },
482
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.InputBase, {
483
+ placeholder: "Search",
484
+ value: value,
485
+ onChange: function onChange(e) {
486
+ isUserTypingRef.current = true;
487
+ onSubmit(e.target.value);
488
+ },
489
+ sx: _objectSpread2({
490
+ ml: 1,
491
+ width: expanded ? "100%" : 0,
492
+ transition: "width 0.5s ease-in-out"
493
+ }, expanded ? {} : {
494
+ margin: 0
495
+ }),
496
+ onBlur: handleEndHover
497
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Collapse, {
498
+ "in": Boolean(value),
499
+ orientation: "horizontal",
500
+ unmountOnExit: true,
501
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Stack, {
502
+ direction: "row",
503
+ spacing: 0,
504
+ sx: {
505
+ mr: 3,
506
+ alignItems: "center"
507
+ },
508
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
509
+ onClick: function onClick() {
510
+ isUserTypingRef.current = false;
511
+ // Immediately clear instead of waiting for the debounce
512
+ onSubmit("");
513
+ },
514
+ children: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.Clear, {})
515
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Divider, {
516
+ orientation: "vertical",
517
+ flexItem: true
518
+ })]
519
+ })
520
+ }), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
521
+ onClick: handleSubmit,
522
+ type: "submit",
523
+ children: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.Search, {})
524
+ })]
525
+ })
526
+ });
519
527
  }
520
528
  FancySearch.propTypes = {
521
529
  value: PropTypes.string,
@@ -527,7 +535,7 @@ function SearchArea(props) {
527
535
  setFinalVal = props.setFinalVal,
528
536
  searchName = props.searchName,
529
537
  persistSearch = props.persistSearch;
530
- var searchVal = React$1.useMemo(function () {
538
+ var searchVal = React.useMemo(function () {
531
539
  if (current !== undefined && current !== null) return current;
532
540
  if (persistSearch && searchName) {
533
541
  var _sessionStorage$getIt;
@@ -535,12 +543,12 @@ function SearchArea(props) {
535
543
  }
536
544
  return "";
537
545
  }, [current, persistSearch, searchName]);
538
- return /*#__PURE__*/React$1.createElement("div", {
539
- key: "SearchArea"
540
- }, /*#__PURE__*/React$1.createElement(FancySearch, {
541
- value: searchVal,
542
- onSubmit: setFinalVal
543
- }));
546
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
547
+ children: /*#__PURE__*/jsxRuntime.jsx(FancySearch, {
548
+ value: searchVal,
549
+ onSubmit: setFinalVal
550
+ })
551
+ }, "SearchArea");
544
552
  }
545
553
  SearchArea.propTypes = {
546
554
  current: PropTypes.string,
@@ -557,7 +565,7 @@ function TableToolbarContent(_ref) {
557
565
  onSearchChange = _ref.onSearchChange,
558
566
  name = _ref.name,
559
567
  persistSearch = _ref.persistSearch;
560
- return /*#__PURE__*/React.createElement(material.Toolbar, {
568
+ return /*#__PURE__*/jsxRuntime.jsx(material.Toolbar, {
561
569
  sx: {
562
570
  pl: {
563
571
  sm: 2
@@ -567,34 +575,37 @@ function TableToolbarContent(_ref) {
567
575
  sm: 1
568
576
  },
569
577
  pt: 2
570
- }
571
- }, /*#__PURE__*/React.createElement(material.Stack, {
572
- spacing: 2,
573
- direction: {
574
- xs: "column",
575
- md: "row"
576
578
  },
577
- sx: {
578
- width: "100%",
579
- alignItems: {
580
- xs: "flex-start",
581
- md: "center"
582
- }
583
- }
584
- }, /*#__PURE__*/React.createElement(material.Box, {
585
- sx: {
586
- flex: "1 1 100%"
587
- },
588
- id: "tableTitle"
589
- }, /*#__PURE__*/React.createElement(ReloadBtn, {
590
- onReload: onReload,
591
- loading: reloadBtnLoading
592
- })), /*#__PURE__*/React.createElement(SearchArea, {
593
- current: searchTerm,
594
- setFinalVal: onSearchChange,
595
- searchName: name,
596
- persistSearch: persistSearch
597
- })));
579
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Stack, {
580
+ spacing: 2,
581
+ direction: {
582
+ xs: "column",
583
+ md: "row"
584
+ },
585
+ sx: {
586
+ width: "100%",
587
+ alignItems: {
588
+ xs: "flex-start",
589
+ md: "center"
590
+ }
591
+ },
592
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
593
+ sx: {
594
+ flex: "1 1 100%"
595
+ },
596
+ id: "tableTitle",
597
+ children: /*#__PURE__*/jsxRuntime.jsx(ReloadBtn, {
598
+ onReload: onReload,
599
+ loading: reloadBtnLoading
600
+ })
601
+ }), /*#__PURE__*/jsxRuntime.jsx(SearchArea, {
602
+ current: searchTerm,
603
+ setFinalVal: onSearchChange,
604
+ searchName: name,
605
+ persistSearch: persistSearch
606
+ })]
607
+ })
608
+ });
598
609
  }
599
610
  TableToolbarContent.propTypes = {
600
611
  onReload: PropTypes.func,
@@ -627,7 +638,7 @@ function useEnhancedTableState(_ref2) {
627
638
  order = _ref2.order,
628
639
  orderBy = _ref2.orderBy,
629
640
  asyncPages = _ref2.asyncPages;
630
- var _React$useState = React$1.useState(function () {
641
+ var _React$useState = React.useState(function () {
631
642
  return {
632
643
  page: 0,
633
644
  rowsPerPage: getInitialRowsPerPage({
@@ -641,7 +652,7 @@ function useEnhancedTableState(_ref2) {
641
652
  _React$useState2 = _slicedToArray(_React$useState, 2),
642
653
  pagination = _React$useState2[0],
643
654
  setPagination = _React$useState2[1];
644
- React$1.useEffect(function () {
655
+ React.useEffect(function () {
645
656
  // Resetting derived pagination state here intentionally preserves the
646
657
  // current rows-per-page choice while jumping back to the first page.
647
658
  // eslint-disable-next-line @eslint-react/set-state-in-effect
@@ -657,19 +668,19 @@ function useEnhancedTableState(_ref2) {
657
668
  }, [resetFlag]);
658
669
  var page = pagination.page;
659
670
  var rowsPerPage = subTable ? rows.length : pagination.rowsPerPage;
660
- var handleRequestSort = React$1.useCallback(function (property) {
671
+ var handleRequestSort = React.useCallback(function (property) {
661
672
  var isAsc = orderBy === property && order === "asc";
662
673
  setOrder(isAsc ? "desc" : "asc");
663
674
  setOrderBy(property);
664
675
  }, [order, orderBy, setOrder, setOrderBy]);
665
- var handleChangePage = React$1.useCallback(function (event, newPage) {
676
+ var handleChangePage = React.useCallback(function (event, newPage) {
666
677
  setPagination(function (previous) {
667
678
  return _objectSpread2(_objectSpread2({}, previous), {}, {
668
679
  page: newPage
669
680
  });
670
681
  });
671
682
  }, []);
672
- var handleChangeRowsPerPage = React$1.useCallback(function (event) {
683
+ var handleChangeRowsPerPage = React.useCallback(function (event) {
673
684
  setPagination(function (previous) {
674
685
  return _objectSpread2(_objectSpread2({}, previous), {}, {
675
686
  page: 0,
@@ -712,31 +723,38 @@ function EnhancedTableHead(props) {
712
723
  rowCount = props.rowCount,
713
724
  onSelectAllClick = props.onSelectAllClick,
714
725
  async = props.async;
715
- return /*#__PURE__*/React.createElement(material.TableHead, null, /*#__PURE__*/React.createElement(material.TableRow, null, selectRows && /*#__PURE__*/React.createElement(material.TableCell, {
716
- padding: "checkbox"
717
- }, /*#__PURE__*/React.createElement(material.Checkbox, {
718
- color: "primary",
719
- indeterminate: numSelected > 0 && numSelected < rowCount,
720
- checked: rowCount > 0 && numSelected === rowCount,
721
- onChange: onSelectAllClick
722
- })), props.headings.map(function (headCell) {
723
- return /*#__PURE__*/React.createElement(material.TableCell, {
724
- key: headCell.id,
725
- align: headCell.numeric ? "right" : "left",
726
- padding: "normal",
727
- sortDirection: orderBy === headCell.id ? order : false
728
- }, /*#__PURE__*/React.createElement(material.TableSortLabel, {
729
- active: orderBy === headCell.id,
730
- direction: orderBy === headCell.id ? order : "asc",
731
- onClick: function onClick() {
732
- return onRequestSort(headCell.id, headCell.sortable && async);
733
- },
734
- disabled: headCell.subRow
735
- }, headCell.label, orderBy === headCell.id ? /*#__PURE__*/React.createElement(material.Box, {
736
- component: "span",
737
- sx: visuallyHidden
738
- }, order === "desc" ? "sorted descending" : "sorted ascending") : undefined));
739
- })));
726
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableHead, {
727
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.TableRow, {
728
+ children: [selectRows && /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
729
+ padding: "checkbox",
730
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
731
+ color: "primary",
732
+ indeterminate: numSelected > 0 && numSelected < rowCount,
733
+ checked: rowCount > 0 && numSelected === rowCount,
734
+ onChange: onSelectAllClick
735
+ })
736
+ }), props.headings.map(function (headCell) {
737
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
738
+ align: headCell.numeric ? "right" : "left",
739
+ padding: "normal",
740
+ sortDirection: orderBy === headCell.id ? order : false,
741
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.TableSortLabel, {
742
+ active: orderBy === headCell.id,
743
+ direction: orderBy === headCell.id ? order : "asc",
744
+ onClick: function onClick() {
745
+ return onRequestSort(headCell.id, headCell.sortable && async);
746
+ },
747
+ disabled: headCell.subRow,
748
+ children: [headCell.label, orderBy === headCell.id ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
749
+ component: "span",
750
+ sx: visuallyHidden,
751
+ children: order === "desc" ? "sorted descending" : "sorted ascending"
752
+ }) : undefined]
753
+ })
754
+ }, headCell.id);
755
+ })]
756
+ })
757
+ });
740
758
  }
741
759
  EnhancedTableHead.propTypes = {
742
760
  onRequestSort: PropTypes.func.isRequired,
@@ -750,12 +768,7 @@ EnhancedTableHead.propTypes = {
750
768
  async: PropTypes.bool
751
769
  };
752
770
 
753
- /**
754
- * Lazily import UniversalTable to statically break the circular dependency:
755
- * UniversalTable → EnhancedTable → DataRow → SubTableRow → UniversalTable
756
- * React.lazy resolves the import at render time, so the module graph stays acyclic.
757
- */
758
- var UniversalTable$2 = /*#__PURE__*/React$1.lazy(function () {
771
+ var UniversalTable$2 = /*#__PURE__*/React.lazy(function () {
759
772
  return Promise.resolve().then(function () { return UniversalTable$1; });
760
773
  });
761
774
 
@@ -769,30 +782,37 @@ function SubRowToggleCell(_ref) {
769
782
  onToggle = _ref.onToggle,
770
783
  rowValues = _ref.rowValues,
771
784
  hideBadge = _ref.hideBadge;
772
- return /*#__PURE__*/React$1.createElement(material.TableCell, null, /*#__PURE__*/React$1.createElement(material.Tooltip, {
773
- title: isOpen ? "Hide ".concat(header.id) : "Show ".concat(header.id)
774
- }, /*#__PURE__*/React$1.createElement(material.Box, null, /*#__PURE__*/React$1.createElement(material.IconButton, {
775
- onClick: function onClick(event) {
776
- event.stopPropagation();
777
- onToggle();
778
- },
779
- disabled: rowValues[header.id].length === 0,
780
- color: header.iconColor || "secondary"
781
- }, /*#__PURE__*/React$1.createElement(material.Badge, {
782
- badgeContent: rowValues[header.id].length,
783
- invisible: hideBadge,
784
- anchorOrigin: {
785
- vertical: "bottom",
786
- horizontal: "right"
787
- },
788
- sx: {
789
- "& .MuiBadge-badge": {
790
- color: function color(theme) {
791
- return theme.palette.text.primary;
792
- }
793
- }
794
- }
795
- }, isOpen ? (header === null || header === void 0 ? void 0 : header.closeIcon) || /*#__PURE__*/React$1.createElement(iconsMaterial.RemoveCircle, null) : (header === null || header === void 0 ? void 0 : header.openIcon) || /*#__PURE__*/React$1.createElement(iconsMaterial.AddCircle, null))))));
785
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
786
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Tooltip, {
787
+ title: isOpen ? "Hide ".concat(header.id) : "Show ".concat(header.id),
788
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Box, {
789
+ children: /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
790
+ onClick: function onClick(event) {
791
+ event.stopPropagation();
792
+ onToggle();
793
+ },
794
+ disabled: rowValues[header.id].length === 0,
795
+ color: header.iconColor || "secondary",
796
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Badge, {
797
+ badgeContent: rowValues[header.id].length,
798
+ invisible: hideBadge,
799
+ anchorOrigin: {
800
+ vertical: "bottom",
801
+ horizontal: "right"
802
+ },
803
+ sx: {
804
+ "& .MuiBadge-badge": {
805
+ color: function color(theme) {
806
+ return theme.palette.text.primary;
807
+ }
808
+ }
809
+ },
810
+ children: isOpen ? (header === null || header === void 0 ? void 0 : header.closeIcon) || /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.RemoveCircle, {}) : (header === null || header === void 0 ? void 0 : header.openIcon) || /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.AddCircle, {})
811
+ })
812
+ })
813
+ })
814
+ })
815
+ });
796
816
  }
797
817
  SubRowToggleCell.propTypes = {
798
818
  header: PropTypes.object.isRequired,
@@ -811,27 +831,32 @@ function SubTableRow(_ref2) {
811
831
  isOpen = _ref2.isOpen,
812
832
  rowValues = _ref2.rowValues,
813
833
  colSpan = _ref2.colSpan;
814
- return /*#__PURE__*/React$1.createElement(material.TableRow, null, /*#__PURE__*/React$1.createElement(material.TableCell, {
815
- colSpan: colSpan,
816
- style: {
817
- paddingBottom: 0,
818
- paddingTop: 0
819
- }
820
- }, /*#__PURE__*/React$1.createElement(material.Collapse, {
821
- "in": isOpen,
822
- timeout: "auto",
823
- unmountOnExit: true
824
- }, /*#__PURE__*/React$1.createElement(React$1.Suspense, {
825
- fallback: null
826
- }, /*#__PURE__*/React$1.createElement(UniversalTable$2, {
827
- loading: table.loading,
828
- setLoading: table.setLoading,
829
- onReload: table.onReload,
830
- data: rowValues[table.id],
831
- headers: table.headers,
832
- name: table.subTitle,
833
- subTable: true
834
- })))));
834
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableRow, {
835
+ children: /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
836
+ colSpan: colSpan,
837
+ style: {
838
+ paddingBottom: 0,
839
+ paddingTop: 0
840
+ },
841
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Collapse, {
842
+ "in": isOpen,
843
+ timeout: "auto",
844
+ unmountOnExit: true,
845
+ children: /*#__PURE__*/jsxRuntime.jsx(React.Suspense, {
846
+ fallback: null,
847
+ children: /*#__PURE__*/jsxRuntime.jsx(UniversalTable$2, {
848
+ loading: table.loading,
849
+ setLoading: table.setLoading,
850
+ onReload: table.onReload,
851
+ data: rowValues[table.id],
852
+ headers: table.headers,
853
+ name: table.subTitle,
854
+ subTable: true
855
+ })
856
+ })
857
+ })
858
+ })
859
+ });
835
860
  }
836
861
  SubTableRow.propTypes = {
837
862
  table: PropTypes.object.isRequired,
@@ -843,80 +868,82 @@ SubTableRow.propTypes = {
843
868
  function renderDataCells(headers, rowValues) {
844
869
  return headers.map(function (header) {
845
870
  var _header$id;
846
- return /*#__PURE__*/React$1.createElement(material.TableCell, _extends({
847
- key: (_header$id = header.id) !== null && _header$id !== void 0 ? _header$id : header.label
848
- }, header.cellProps), header.component ? header.component(rowValues) : formatCellValue(header, rowValues));
871
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableCell, _objectSpread2(_objectSpread2({}, header.cellProps), {}, {
872
+ children: header.component ? header.component(rowValues) : formatCellValue(header, rowValues)
873
+ }), (_header$id = header.id) !== null && _header$id !== void 0 ? _header$id : header.label);
849
874
  });
850
875
  }
851
- var DataRow = /*#__PURE__*/React$1.memo(function DataRow(props) {
876
+ var DataRow = /*#__PURE__*/React.memo(function DataRow(props) {
852
877
  var rowValues = props.rowValues,
853
878
  headers = props.headers,
854
879
  selectRows = props.selectRows,
855
880
  isSelected = props.isSelected,
856
881
  handleClick = props.handleClick;
857
- var _React$useMemo = React$1.useMemo(function () {
882
+ var _React$useMemo = React.useMemo(function () {
858
883
  return splitHeaders(headers);
859
884
  }, [headers]),
860
885
  subTables = _React$useMemo.subTables,
861
886
  columns = _React$useMemo.columns;
862
887
  var hideBadge = props.hideBadge || false;
863
888
  var isItemSelected = isSelected(props.rowID);
864
- var _React$useState = React$1.useState(Array.from({
889
+ var _React$useState = React.useState(Array.from({
865
890
  length: subTables.length
866
891
  }).fill(false)),
867
892
  _React$useState2 = _slicedToArray(_React$useState, 2),
868
893
  reveal = _React$useState2[0],
869
894
  setReveal = _React$useState2[1];
870
- var toggleSubRow = React$1.useCallback(function (index) {
895
+ var toggleSubRow = React.useCallback(function (index) {
871
896
  setReveal(function (previous) {
872
897
  var next = _toConsumableArray(previous);
873
898
  next[index] = !next[index];
874
899
  return next;
875
900
  });
876
901
  }, []);
877
- var handleRowKeyDown = React$1.useCallback(function (event) {
902
+ var handleRowKeyDown = React.useCallback(function (event) {
878
903
  if (selectRows && (event.key === " " || event.key === "Enter")) {
879
904
  event.preventDefault();
880
905
  handleClick(event, props.rowID);
881
906
  }
882
907
  }, [selectRows, handleClick, props.rowID]);
883
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(material.TableRow, {
884
- tabIndex: selectRows ? 0 : -1,
885
- hover: selectRows,
886
- role: selectRows ? "checkbox" : "row",
887
- selected: isItemSelected,
888
- "aria-checked": isItemSelected,
889
- onKeyDown: handleRowKeyDown
890
- }, selectRows && /*#__PURE__*/React$1.createElement(material.TableCell, {
891
- padding: "checkbox"
892
- }, /*#__PURE__*/React$1.createElement(material.Checkbox, {
893
- color: "primary",
894
- checked: isItemSelected,
895
- onClick: function onClick(event) {
896
- return handleClick(event, props.rowID);
897
- }
898
- })), subTables.map(function (header, index) {
899
- var _header$id2;
900
- return /*#__PURE__*/React$1.createElement(SubRowToggleCell, {
901
- key: (_header$id2 = header.id) !== null && _header$id2 !== void 0 ? _header$id2 : header.label,
902
- header: header,
903
- isOpen: reveal[index],
904
- onToggle: function onToggle() {
905
- return toggleSubRow(index);
906
- },
907
- rowValues: rowValues,
908
- hideBadge: hideBadge
909
- });
910
- }), renderDataCells(columns, rowValues)), subTables.map(function (table, index) {
911
- var _table$id;
912
- return /*#__PURE__*/React$1.createElement(SubTableRow, {
913
- key: (_table$id = table.id) !== null && _table$id !== void 0 ? _table$id : table.label,
914
- table: table,
915
- isOpen: reveal[index],
916
- rowValues: rowValues,
917
- colSpan: props.headers.length + 1
918
- });
919
- }));
908
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
909
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.TableRow, {
910
+ tabIndex: selectRows ? 0 : -1,
911
+ hover: selectRows,
912
+ role: selectRows ? "checkbox" : "row",
913
+ selected: isItemSelected,
914
+ "aria-checked": isItemSelected,
915
+ onKeyDown: handleRowKeyDown,
916
+ children: [selectRows && /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
917
+ padding: "checkbox",
918
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
919
+ color: "primary",
920
+ checked: isItemSelected,
921
+ onClick: function onClick(event) {
922
+ return handleClick(event, props.rowID);
923
+ }
924
+ })
925
+ }), subTables.map(function (header, index) {
926
+ var _header$id2;
927
+ return /*#__PURE__*/jsxRuntime.jsx(SubRowToggleCell, {
928
+ header: header,
929
+ isOpen: reveal[index],
930
+ onToggle: function onToggle() {
931
+ return toggleSubRow(index);
932
+ },
933
+ rowValues: rowValues,
934
+ hideBadge: hideBadge
935
+ }, (_header$id2 = header.id) !== null && _header$id2 !== void 0 ? _header$id2 : header.label);
936
+ }), renderDataCells(columns, rowValues)]
937
+ }), subTables.map(function (table, index) {
938
+ var _table$id;
939
+ return /*#__PURE__*/jsxRuntime.jsx(SubTableRow, {
940
+ table: table,
941
+ isOpen: reveal[index],
942
+ rowValues: rowValues,
943
+ colSpan: props.headers.length + 1
944
+ }, (_table$id = table.id) !== null && _table$id !== void 0 ? _table$id : table.label);
945
+ })]
946
+ });
920
947
  });
921
948
  DataRow.propTypes = {
922
949
  rowValues: PropTypes.object.isRequired,
@@ -931,17 +958,21 @@ DataRow.propTypes = {
931
958
  var skeletonRows = ["row-1", "row-2", "row-3", "row-4", "row-5"];
932
959
  var skeletonCells = ["cell-1", "cell-2", "cell-3", "cell-4"];
933
960
  var TableLoader = function TableLoader() {
934
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(material.TableHead, null), /*#__PURE__*/React.createElement(material.TableBody, null, skeletonRows.map(function (rowKey) {
935
- return /*#__PURE__*/React.createElement(material.TableRow, {
936
- key: rowKey
937
- }, skeletonCells.map(function (cellKey) {
938
- return /*#__PURE__*/React.createElement(material.TableCell, {
939
- key: cellKey
940
- }, /*#__PURE__*/React.createElement(material.Skeleton, {
941
- height: 30
942
- }));
943
- }));
944
- })));
961
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
962
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.TableHead, {}), /*#__PURE__*/jsxRuntime.jsx(material.TableBody, {
963
+ children: skeletonRows.map(function (rowKey) {
964
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableRow, {
965
+ children: skeletonCells.map(function (cellKey) {
966
+ return /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
967
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Skeleton, {
968
+ height: 30
969
+ })
970
+ }, cellKey);
971
+ })
972
+ }, rowKey);
973
+ })
974
+ })]
975
+ });
945
976
  };
946
977
 
947
978
  function EnhancedTable(props) {
@@ -978,65 +1009,72 @@ function EnhancedTable(props) {
978
1009
  handleChangeRowsPerPage = _useEnhancedTableStat.handleChangeRowsPerPage;
979
1010
  var effectiveRowsPerPage = rowsPerPage === -1 ? rows.length : rowsPerPage;
980
1011
  var emptyRows = Math.max(0, effectiveRowsPerPage - Math.min(effectiveRowsPerPage, rows.length - page * effectiveRowsPerPage));
981
- var isSelected = React$1.useCallback(function (id) {
1012
+ var isSelected = React.useCallback(function (id) {
982
1013
  return selected.includes(id);
983
1014
  }, [selected]);
984
- var visibleRows = React$1.useMemo(function () {
1015
+ var visibleRows = React.useMemo(function () {
985
1016
  return stableSort(rows, getComparator(order, orderBy), headers, orderBy).slice(page * effectiveRowsPerPage, page * effectiveRowsPerPage + effectiveRowsPerPage);
986
1017
  }, [effectiveRowsPerPage, headers, order, orderBy, page, rows]);
987
- return /*#__PURE__*/React$1.createElement(material.TableContainer, null, /*#__PURE__*/React$1.createElement(material.Table, {
988
- sx: {
989
- minWidth: 750
990
- },
991
- size: "small" ,
992
- "aria-label": props.name || "data table"
993
- }, props.loading ? /*#__PURE__*/React$1.createElement(TableLoader, null) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(EnhancedTableHead, {
994
- order: order,
995
- orderBy: orderBy,
996
- onRequestSort: handleSort,
997
- headings: headers,
998
- selectRows: props.selectRows,
999
- numSelected: selected.length,
1000
- rowCount: rows.length,
1001
- onSelectAllClick: props.handleSelectAllClick,
1002
- async: async
1003
- }), /*#__PURE__*/React$1.createElement(material.TableBody, null, visibleRows.map(function (row, index) {
1004
- var rowKey = selectID ? row[selectID] : "row-".concat(page * effectiveRowsPerPage + index);
1005
- var rowID = getSelectableRowId(row, index, selectID);
1006
- return /*#__PURE__*/React$1.createElement(DataRow, {
1007
- key: rowKey,
1008
- rowID: rowID,
1009
- headers: headers,
1010
- rowValues: row,
1011
- hideBadge: props.hideBadge,
1012
- selectRows: props.selectRows,
1013
- handleClick: props.handleClick,
1014
- isSelected: isSelected
1015
- });
1016
- }), !subTable && emptyRows > 0 && /*#__PURE__*/React$1.createElement(material.TableRow, {
1017
- style: {
1018
- height: (33 ) * emptyRows
1019
- }
1020
- }, /*#__PURE__*/React$1.createElement(material.TableCell, {
1021
- colSpan: headers.length
1022
- }))))), subTable ? /*#__PURE__*/React$1.createElement(material.Box, {
1023
- sx: {
1024
- mb: 3
1025
- }
1026
- }) : /*#__PURE__*/React$1.createElement(material.TablePagination, {
1027
- rowsPerPageOptions: props.pageSizeOptions || getPageOptions(rows.length),
1028
- component: "div",
1029
- count: rows.length,
1030
- rowsPerPage: rowsPerPage,
1031
- page: page,
1032
- onPageChange: handleChangePage,
1033
- onRowsPerPageChange: handleChangeRowsPerPage,
1034
- sx: {
1035
- overflow: "visible"
1036
- },
1037
- showFirstButton: true,
1038
- showLastButton: true
1039
- }));
1018
+ return /*#__PURE__*/jsxRuntime.jsxs(material.TableContainer, {
1019
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Table, {
1020
+ sx: {
1021
+ minWidth: 750
1022
+ },
1023
+ size: "small" ,
1024
+ "aria-label": props.name || "data table",
1025
+ children: props.loading ? /*#__PURE__*/jsxRuntime.jsx(TableLoader, {}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1026
+ children: [/*#__PURE__*/jsxRuntime.jsx(EnhancedTableHead, {
1027
+ order: order,
1028
+ orderBy: orderBy,
1029
+ onRequestSort: handleSort,
1030
+ headings: headers,
1031
+ selectRows: props.selectRows,
1032
+ numSelected: selected.length,
1033
+ rowCount: rows.length,
1034
+ onSelectAllClick: props.handleSelectAllClick,
1035
+ async: async
1036
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.TableBody, {
1037
+ children: [visibleRows.map(function (row, index) {
1038
+ var rowKey = selectID ? row[selectID] : "row-".concat(page * effectiveRowsPerPage + index);
1039
+ var rowID = getSelectableRowId(row, index, selectID);
1040
+ return /*#__PURE__*/jsxRuntime.jsx(DataRow, {
1041
+ rowID: rowID,
1042
+ headers: headers,
1043
+ rowValues: row,
1044
+ hideBadge: props.hideBadge,
1045
+ selectRows: props.selectRows,
1046
+ handleClick: props.handleClick,
1047
+ isSelected: isSelected
1048
+ }, rowKey);
1049
+ }), !subTable && emptyRows > 0 && /*#__PURE__*/jsxRuntime.jsx(material.TableRow, {
1050
+ style: {
1051
+ height: (33 ) * emptyRows
1052
+ },
1053
+ children: /*#__PURE__*/jsxRuntime.jsx(material.TableCell, {
1054
+ colSpan: headers.length
1055
+ })
1056
+ })]
1057
+ })]
1058
+ })
1059
+ }), subTable ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1060
+ sx: {
1061
+ mb: 3
1062
+ }
1063
+ }) : /*#__PURE__*/jsxRuntime.jsx(material.TablePagination, {
1064
+ rowsPerPageOptions: props.pageSizeOptions || getPageOptions(rows.length),
1065
+ component: "div",
1066
+ count: rows.length,
1067
+ rowsPerPage: rowsPerPage,
1068
+ page: page,
1069
+ onPageChange: handleChangePage,
1070
+ onRowsPerPageChange: handleChangeRowsPerPage,
1071
+ sx: {
1072
+ overflow: "visible"
1073
+ },
1074
+ showFirstButton: true,
1075
+ showLastButton: true
1076
+ })]
1077
+ });
1040
1078
  }
1041
1079
  EnhancedTable.propTypes = {
1042
1080
  headers: PropTypes.array.isRequired,
@@ -1086,19 +1124,19 @@ function UniversalTable(_ref) {
1086
1124
  pageSizeOptions = _ref.pageSizeOptions,
1087
1125
  persistSearch = _ref.persistSearch,
1088
1126
  asyncPages = _ref.asyncPages;
1089
- var debounceRef = React$1.useRef(null);
1090
- var hasLoadedInitialAsyncPageRef = React$1.useRef(false);
1127
+ var debounceRef = React.useRef(null);
1128
+ var hasLoadedInitialAsyncPageRef = React.useRef(false);
1091
1129
  var async = typeof asyncPages === "number" && asyncPages > 0;
1092
1130
  var head = headers || [];
1093
1131
  var _useSearchableRows = useSearchableRows(data, head, async),
1094
1132
  rows = _useSearchableRows.rows,
1095
1133
  searchTerm = _useSearchableRows.searchTerm,
1096
1134
  setSearchTerm = _useSearchableRows.setSearchTerm;
1097
- var _React$useState = React$1.useState("asc"),
1135
+ var _React$useState = React.useState("asc"),
1098
1136
  _React$useState2 = _slicedToArray(_React$useState, 2),
1099
1137
  order = _React$useState2[0],
1100
1138
  setOrder = _React$useState2[1];
1101
- var _React$useState3 = React$1.useState(""),
1139
+ var _React$useState3 = React.useState(""),
1102
1140
  _React$useState4 = _slicedToArray(_React$useState3, 2),
1103
1141
  orderBy = _React$useState4[0],
1104
1142
  setOrderBy = _React$useState4[1];
@@ -1111,7 +1149,7 @@ function UniversalTable(_ref) {
1111
1149
  clearSelection = _useSelectableRows.clearSelection,
1112
1150
  handleSelectAllClick = _useSelectableRows.handleSelectAllClick,
1113
1151
  handleClick = _useSelectableRows.handleClick;
1114
- var handleSearchChange = React$1.useCallback(function (value) {
1152
+ var handleSearchChange = React.useCallback(function (value) {
1115
1153
  clearSelection();
1116
1154
  setSearchTerm(value);
1117
1155
  }, [clearSelection, setSearchTerm]);
@@ -1131,12 +1169,12 @@ function UniversalTable(_ref) {
1131
1169
  handleSearchChange(searchValue);
1132
1170
  }
1133
1171
  };
1134
- React$1.useEffect(function () {
1172
+ React.useEffect(function () {
1135
1173
  return function () {
1136
1174
  return clearTimeout(debounceRef.current);
1137
1175
  };
1138
1176
  }, []);
1139
- React$1.useEffect(function () {
1177
+ React.useEffect(function () {
1140
1178
  if (!async || hasLoadedInitialAsyncPageRef.current) {
1141
1179
  return;
1142
1180
  }
@@ -1148,7 +1186,7 @@ function UniversalTable(_ref) {
1148
1186
  pages: asyncPages
1149
1187
  });
1150
1188
  }, [async, asyncPages, order, orderBy, searchTerm, setLoading]);
1151
- var handleReload = React$1.useCallback(function () {
1189
+ var handleReload = React.useCallback(function () {
1152
1190
  if (typeof onReload === "function") {
1153
1191
  onReload();
1154
1192
  return;
@@ -1162,51 +1200,54 @@ function UniversalTable(_ref) {
1162
1200
  } : true);
1163
1201
  }
1164
1202
  }, [async, onReload, setLoading, searchTerm, order, orderBy, asyncPages]);
1165
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(LazyLoadingIndicator, {
1166
- show: lazyloading,
1167
- currentPage: currentPage,
1168
- totalPages: totalPages
1169
- }), /*#__PURE__*/React$1.createElement(Paper, {
1170
- sx: _objectSpread2({}, subTable && {
1171
- boxShadow: "none"
1172
- })
1173
- }, /*#__PURE__*/React$1.createElement(TableSelectionBanner, {
1174
- selected: selected,
1175
- onSelection: onSelection,
1176
- selectIcon: selectIcon
1177
- }), /*#__PURE__*/React$1.createElement(TableTitle, {
1178
- name: name,
1179
- subTable: subTable
1180
- }), !subTable && /*#__PURE__*/React$1.createElement(TableToolbarContent, {
1181
- onReload: typeof onReload === "function" || typeof setLoading === "function" ? handleReload : undefined,
1182
- reloadBtnLoading: reloadBtnLoading,
1183
- searchTerm: searchTerm,
1184
- onSearchChange: handleSearch,
1185
- name: name,
1186
- persistSearch: persistSearch
1187
- }), /*#__PURE__*/React$1.createElement(EnhancedTable, {
1188
- headers: head,
1189
- rows: rows,
1190
- resetFlag: searchTerm,
1191
- searchTerm: searchTerm,
1192
- subTable: subTable,
1193
- hideBadge: hideBadge,
1194
- loading: loading,
1195
- selectRows: selectRows,
1196
- handleSelectAllClick: handleSelectAllClick,
1197
- handleClick: handleClick,
1198
- selected: selected,
1199
- selectID: selectID,
1200
- pageSizeOptions: pageSizeOptions,
1201
- name: name,
1202
- setLoading: setLoading,
1203
- order: order,
1204
- orderBy: orderBy,
1205
- setOrder: setOrder,
1206
- setOrderBy: setOrderBy,
1207
- asyncPages: asyncPages,
1208
- async: async
1209
- })));
1203
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1204
+ children: [/*#__PURE__*/jsxRuntime.jsx(LazyLoadingIndicator, {
1205
+ show: lazyloading,
1206
+ currentPage: currentPage,
1207
+ totalPages: totalPages
1208
+ }), /*#__PURE__*/jsxRuntime.jsxs(Paper, {
1209
+ sx: _objectSpread2({}, subTable && {
1210
+ boxShadow: "none"
1211
+ }),
1212
+ children: [/*#__PURE__*/jsxRuntime.jsx(TableSelectionBanner, {
1213
+ selected: selected,
1214
+ onSelection: onSelection,
1215
+ selectIcon: selectIcon
1216
+ }), /*#__PURE__*/jsxRuntime.jsx(TableTitle, {
1217
+ name: name,
1218
+ subTable: subTable
1219
+ }), !subTable && /*#__PURE__*/jsxRuntime.jsx(TableToolbarContent, {
1220
+ onReload: typeof onReload === "function" || typeof setLoading === "function" ? handleReload : undefined,
1221
+ reloadBtnLoading: reloadBtnLoading,
1222
+ searchTerm: searchTerm,
1223
+ onSearchChange: handleSearch,
1224
+ name: name,
1225
+ persistSearch: persistSearch
1226
+ }), /*#__PURE__*/jsxRuntime.jsx(EnhancedTable, {
1227
+ headers: head,
1228
+ rows: rows,
1229
+ resetFlag: searchTerm,
1230
+ searchTerm: searchTerm,
1231
+ subTable: subTable,
1232
+ hideBadge: hideBadge,
1233
+ loading: loading,
1234
+ selectRows: selectRows,
1235
+ handleSelectAllClick: handleSelectAllClick,
1236
+ handleClick: handleClick,
1237
+ selected: selected,
1238
+ selectID: selectID,
1239
+ pageSizeOptions: pageSizeOptions,
1240
+ name: name,
1241
+ setLoading: setLoading,
1242
+ order: order,
1243
+ orderBy: orderBy,
1244
+ setOrder: setOrder,
1245
+ setOrderBy: setOrderBy,
1246
+ asyncPages: asyncPages,
1247
+ async: async
1248
+ })]
1249
+ })]
1250
+ });
1210
1251
  }
1211
1252
  UniversalTable.propTypes = {
1212
1253
  loading: PropTypes.bool,