@pdg/react-table 1.0.127 → 1.0.128

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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React,{createContext,useContext,useMemo,useCallback,useState,useEffect,useRef,useLayoutEffect,useId}from'react';import classNames from'classnames';import {styled,TableRow,lighten,TableCell,Box,Tooltip,Checkbox,Stack,Pagination,useTheme,TableHead,TableBody,Icon,TableFooter,Paper,Table as Table$1,Grid,Popper,Grow,ClickAwayListener,IconButton}from'@mui/material';import {useResizeDetector}from'react-resize-detector';import {useSortable,sortableKeyboardCoordinates,arrayMove,SortableContext,verticalListSortingStrategy}from'@dnd-kit/sortable';import dayjs from'dayjs';import {personalNoAutoDash,companyNoAutoDash,telNoAutoDash,numberFormat,notEmpty,equal,empty}from'@pdg/util';import {useInView}from'react-intersection-observer';import {useAutoUpdateLayoutState}from'@pdg/react-hook';import {useSensors,useSensor,MouseSensor,TouchSensor,KeyboardSensor,DndContext,closestCenter}from'@dnd-kit/core';import SimpleBar from'simplebar-react';import'simplebar-react/dist/simplebar.min.css';import {v4}from'uuid';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';import {PdgButton,PdgIcon,PdgCopyToClipboard}from'@pdg/react-component';function styleInject(css, ref) {
1
+ import React,{createContext,useContext,useMemo,useCallback,useState,useEffect,useRef,useLayoutEffect,useId}from'react';import classNames from'classnames';import {styled,TableRow,lighten,TableCell,Stack,Pagination,Checkbox,useTheme,TableHead,Box,Tooltip,TableBody,Icon,TableFooter,Paper,Table as Table$1,Grid,Popper,Grow,ClickAwayListener,IconButton}from'@mui/material';import {useResizeDetector}from'react-resize-detector';import {useAutoUpdateLayoutState}from'@pdg/react-hook';import {useSensors,useSensor,MouseSensor,TouchSensor,KeyboardSensor,DndContext,closestCenter}from'@dnd-kit/core';import {useSortable,SortableContext,verticalListSortingStrategy,sortableKeyboardCoordinates,arrayMove}from'@dnd-kit/sortable';import SimpleBar from'simplebar-react';import'simplebar-react/dist/simplebar.min.css';import {v4}from'uuid';import dayjs from'dayjs';import {personalNoAutoDash,companyNoAutoDash,telNoAutoDash,numberFormat,ifUndefined,notEmpty,equal,empty}from'@pdg/util';import {useInView}from'react-intersection-observer';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';import {PdgButton,PdgIcon,PdgCopyToClipboard}from'@pdg/react-component';function styleInject(css, ref) {
2
2
  if ( ref === void 0 ) ref = {};
3
3
  var insertAt = ref.insertAt;
4
4
 
@@ -83,57 +83,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
83
83
  });
84
84
  });
85
85
  var StyledNoDataDiv = styled('div')(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n text-align: center;\n padding: 30px 0;\n font-weight: 500;\n font-size: 13px;\n color: #94a0b2;\n opacity: 0.8;\n\n .material-icons {\n font-size: 40px;\n margin-bottom: 5px;\n }\n"], ["\n text-align: center;\n padding: 30px 0;\n font-weight: 500;\n font-size: 13px;\n color: #94a0b2;\n opacity: 0.8;\n\n .material-icons {\n font-size: 40px;\n margin-bottom: 5px;\n }\n"])));
86
- var templateObject_1$4;const CSS = /*#__PURE__*/Object.freeze({
87
- Translate: {
88
- toString(transform) {
89
- if (!transform) {
90
- return;
91
- }
92
-
93
- const {
94
- x,
95
- y
96
- } = transform;
97
- return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
98
- }
99
-
100
- },
101
- Scale: {
102
- toString(transform) {
103
- if (!transform) {
104
- return;
105
- }
106
-
107
- const {
108
- scaleX,
109
- scaleY
110
- } = transform;
111
- return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
112
- }
113
-
114
- },
115
- Transform: {
116
- toString(transform) {
117
- if (!transform) {
118
- return;
119
- }
120
-
121
- return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
122
- }
123
-
124
- },
125
- Transition: {
126
- toString(_ref) {
127
- let {
128
- property,
129
- duration,
130
- easing
131
- } = _ref;
132
- return property + " " + duration + "ms " + easing;
133
- }
134
-
135
- }
136
- });function getTableColumnAlign(column, defaultAlign) {
86
+ var templateObject_1$4;function getTableColumnAlign(column, defaultAlign) {
137
87
  switch (column.type) {
138
88
  case 'number':
139
89
  return column.align ? column.align : 'right';
@@ -170,7 +120,6 @@ function typographyColorToSxColor(color) {
170
120
  }var TableContextDefaultValue = {
171
121
  menuOpen: false,
172
122
  openMenuId: undefined,
173
- inViewRender: false,
174
123
  setMenuOpen: function () { },
175
124
  setItemColumnChecked: function () { },
176
125
  setItemColumnCheckDisabled: function () { },
@@ -340,19 +289,286 @@ var TableCommonCell = React.forwardRef(function (_a, ref) {
340
289
  * ******************************************************************************************************************/
341
290
  return (React.createElement(StyledTableCell, { ref: ref, align: align, className: classNames(className, 'TableCommonCell', ellipsis && 'ellipsis', column.type ? "column-type-".concat(column.type) : false), style: style, sx: sx, onClick: type === 'body' ? handleClick : undefined }, children));
342
291
  });
343
- var templateObject_1$3;var StyledButtonsBox = styled(Box)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n"])));
292
+ var templateObject_1$3;var TableFooterCell = function (_a) {
293
+ /********************************************************************************************************************
294
+ * Memo
295
+ * ******************************************************************************************************************/
296
+ var column = _a.column, items = _a.items, defaultAlign = _a.defaultAlign;
297
+ var data = useMemo(function () {
298
+ var _a, _b, _c;
299
+ if ((_a = column.footer) === null || _a === void 0 ? void 0 : _a.onRender) {
300
+ return (_b = column.footer) === null || _b === void 0 ? void 0 : _b.onRender(items);
301
+ }
302
+ else {
303
+ return (_c = column.footer) === null || _c === void 0 ? void 0 : _c.value;
304
+ }
305
+ }, [column.footer, items]);
306
+ /********************************************************************************************************************
307
+ * Render
308
+ * ******************************************************************************************************************/
309
+ return (React.createElement(TableCommonCell, { type: 'head', className: 'TableFooterCell', column: column, defaultAlign: defaultAlign }, data));
310
+ };var TablePagination = function (_a) {
311
+ var className = _a.className, style = _a.style, sx = _a.sx, paging = _a.paging, align = _a.align, onChange = _a.onChange;
312
+ return (React.createElement(Stack, { alignItems: align },
313
+ React.createElement(Pagination, { count: paging.last_page, page: paging.current_page, color: 'primary', className: classNames('TablePagination', className), style: style, sx: sx, onChange: function (e, page) {
314
+ if (onChange)
315
+ onChange(page);
316
+ } })));
317
+ };var TableContextProvider = function (_a) {
318
+ var children = _a.children, value = _a.value;
319
+ return React.createElement(TableContext.Provider, { value: value }, children);
320
+ };var TableTopHeadCaptionRow = styled(TableRow)(function (_a) {
321
+ var theme = _a.theme;
322
+ return ({
323
+ '> th': {
324
+ backgroundColor: theme.palette.grey.A100,
325
+ textAlign: 'center',
326
+ fontWeight: 700,
327
+ },
328
+ });
329
+ });var TableHeadCell = function (_a) {
330
+ /********************************************************************************************************************
331
+ * Use
332
+ * ******************************************************************************************************************/
333
+ var column = _a.column, items = _a.items, defaultAlign = _a.defaultAlign, top = _a.top, onCheckChange = _a.onCheckChange;
334
+ var _b = useTableState(), setHeadColumnChecked = _b.setHeadColumnChecked, setHeadColumnCommands = _b.setHeadColumnCommands;
335
+ /********************************************************************************************************************
336
+ * State
337
+ * ******************************************************************************************************************/
338
+ var _c = useState(false), checked = _c[0], setChecked = _c[1];
339
+ var _d = useState(false), checkDisabled = _d[0], setCheckDisabled = _d[1];
340
+ /********************************************************************************************************************
341
+ * Effect
342
+ * ******************************************************************************************************************/
343
+ useEffect(function () {
344
+ if (column.type === 'check') {
345
+ setHeadColumnChecked(column, checked);
346
+ }
347
+ }, [column, checked, setHeadColumnChecked]);
348
+ useEffect(function () {
349
+ setHeadColumnCommands(column, {
350
+ setChecked: function (checked) {
351
+ if (column.type === 'check') {
352
+ setChecked(checked);
353
+ }
354
+ },
355
+ setCheckDisabled: function (checkDisabled) {
356
+ if (column.type === 'check') {
357
+ setCheckDisabled(checkDisabled);
358
+ }
359
+ },
360
+ });
361
+ }, [setHeadColumnCommands, column]);
362
+ /********************************************************************************************************************
363
+ * Memo
364
+ * ******************************************************************************************************************/
365
+ var data = useMemo(function () {
366
+ var _a, _b, _c, _d;
367
+ if (column.type === 'check') {
368
+ if (column.hideAllCheck) {
369
+ if ((_a = column.head) === null || _a === void 0 ? void 0 : _a.onRender) {
370
+ return (_b = column.head) === null || _b === void 0 ? void 0 : _b.onRender(items);
371
+ }
372
+ else {
373
+ if (typeof column.label === 'string') {
374
+ return React.createElement("div", { dangerouslySetInnerHTML: { __html: column.label } });
375
+ }
376
+ else {
377
+ return column.label;
378
+ }
379
+ }
380
+ }
381
+ else {
382
+ return (React.createElement(Checkbox, { checked: checked, disabled: checkDisabled, onChange: function (e, newChecked) {
383
+ setChecked(newChecked);
384
+ onCheckChange && onCheckChange(column, newChecked);
385
+ } }));
386
+ }
387
+ }
388
+ else {
389
+ if ((_c = column.head) === null || _c === void 0 ? void 0 : _c.onRender) {
390
+ return (_d = column.head) === null || _d === void 0 ? void 0 : _d.onRender(items);
391
+ }
392
+ else {
393
+ if (typeof column.label === 'string') {
394
+ return React.createElement("div", { dangerouslySetInnerHTML: { __html: column.label } });
395
+ }
396
+ else {
397
+ return column.label;
398
+ }
399
+ }
400
+ }
401
+ }, [checkDisabled, checked, column, items, onCheckChange]);
402
+ /********************************************************************************************************************
403
+ * Render
404
+ * ******************************************************************************************************************/
405
+ return (React.createElement(TableCommonCell, { type: 'head', className: 'TableHeadCell', style: top !== undefined ? { top: top } : undefined, column: column, defaultAlign: defaultAlign }, data));
406
+ };var BottomLine = styled('div')(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n height: 1px;\n position: absolute;\n left: 3px;\n right: 3px;\n bottom: 0;\n"], ["\n height: 1px;\n position: absolute;\n left: 3px;\n right: 3px;\n bottom: 0;\n"])));
407
+ var TableTopHead = function (_a) {
408
+ /********************************************************************************************************************
409
+ * Use
410
+ * ******************************************************************************************************************/
411
+ var columns = _a.columns, items = _a.items, rows = _a.rows, caption = _a.caption, defaultAlign = _a.defaultAlign, onCheckChange = _a.onCheckChange;
412
+ var theme = useTheme();
413
+ /********************************************************************************************************************
414
+ * Ref
415
+ * ******************************************************************************************************************/
416
+ var captionRef = useRef(null);
417
+ var row1Ref = useRef(null);
418
+ var row2Ref = useRef(null);
419
+ var row3Ref = useRef(null);
420
+ /********************************************************************************************************************
421
+ * ResizeDetector
422
+ * ******************************************************************************************************************/
423
+ var captionHeight = useResizeDetector({
424
+ targetRef: captionRef,
425
+ handleWidth: false,
426
+ handleHeight: true,
427
+ }).height;
428
+ var row1Height = useResizeDetector({ targetRef: row1Ref, handleWidth: false, handleHeight: true }).height;
429
+ var row2Height = useResizeDetector({ targetRef: row2Ref, handleWidth: false, handleHeight: true }).height;
430
+ var row3Height = useResizeDetector({ targetRef: row3Ref, handleWidth: false, handleHeight: true }).height;
431
+ /********************************************************************************************************************
432
+ * Function
433
+ * ******************************************************************************************************************/
434
+ var makeRowCells = useCallback(function (row, top) {
435
+ var totalColumns = 0;
436
+ var cells = row
437
+ .map(function (info, idx) {
438
+ if (info) {
439
+ totalColumns += info.colSpan || 1;
440
+ return (React.createElement(TableCell, { key: idx, colSpan: info.colSpan, align: info.align, style: {
441
+ top: top,
442
+ borderBottom: 0,
443
+ } },
444
+ info.label,
445
+ info.label != null && React.createElement(BottomLine, { style: { backgroundColor: theme.palette.divider } })));
446
+ }
447
+ })
448
+ .filter(function (cell) { return !!cell; });
449
+ if (totalColumns < columns.length) {
450
+ cells.push(React.createElement(TableCell, { key: columns.length, colSpan: columns.length - cells.length, style: { top: top, borderBottom: 0 } }));
451
+ }
452
+ return cells;
453
+ }, [columns, theme.palette.divider]);
454
+ var columnRow = useMemo(function () {
455
+ var top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0) + (row3Height || 0);
456
+ return (React.createElement(TableRow, null, columns.map(function (column, idx) { return (React.createElement(TableHeadCell, { key: idx, column: column, items: items, defaultAlign: defaultAlign, top: top, onCheckChange: onCheckChange })); })));
457
+ }, [captionHeight, columns, defaultAlign, items, onCheckChange, row1Height, row2Height, row3Height]);
458
+ /********************************************************************************************************************
459
+ * Variable
460
+ * ******************************************************************************************************************/
461
+ var captionRow = !!caption && (React.createElement(TableTopHeadCaptionRow, { ref: captionRef, className: 'TableTopHeadCaptionRow' },
462
+ React.createElement(TableCell, { colSpan: columns.length }, caption)));
463
+ /********************************************************************************************************************
464
+ * Render
465
+ * ******************************************************************************************************************/
466
+ if (rows) {
467
+ if (Array.isArray(rows[0])) {
468
+ return (React.createElement(TableHead, { className: 'TableHead' },
469
+ captionRow,
470
+ rows.map(function (row, idx) {
471
+ var ref = undefined;
472
+ var top = undefined;
473
+ switch (idx) {
474
+ case 0:
475
+ ref = row1Ref;
476
+ top = captionHeight;
477
+ break;
478
+ case 1:
479
+ ref = row2Ref;
480
+ top = (captionHeight || 0) + (row1Height || 0);
481
+ break;
482
+ case 2:
483
+ ref = row3Ref;
484
+ top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0);
485
+ break;
486
+ case 3:
487
+ top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0) + (row3Height || 0);
488
+ }
489
+ return (React.createElement(TableRow, { key: idx, ref: ref, className: 'TableHeadRow' }, makeRowCells(row, top)));
490
+ })));
491
+ }
492
+ else {
493
+ return (React.createElement(TableHead, { className: 'TableHead' },
494
+ captionRow,
495
+ React.createElement(TableRow, { ref: row1Ref, className: 'TableHeadRow' }, makeRowCells(rows, captionHeight)),
496
+ columnRow));
497
+ }
498
+ }
499
+ else {
500
+ return (React.createElement(TableHead, { className: 'TableHead' },
501
+ captionRow,
502
+ columnRow));
503
+ }
504
+ };
505
+ var templateObject_1$2;var makeSortableItems = function (items) {
506
+ return items === null || items === void 0 ? void 0 : items.map(function (_a, index) {
507
+ var id = _a.id, item = __rest(_a, ["id"]);
508
+ return __assign({ id: id == null ? "".concat(v4(), "_").concat(index) : id }, item);
509
+ });
510
+ };const CSS = /*#__PURE__*/Object.freeze({
511
+ Translate: {
512
+ toString(transform) {
513
+ if (!transform) {
514
+ return;
515
+ }
516
+
517
+ const {
518
+ x,
519
+ y
520
+ } = transform;
521
+ return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
522
+ }
523
+
524
+ },
525
+ Scale: {
526
+ toString(transform) {
527
+ if (!transform) {
528
+ return;
529
+ }
530
+
531
+ const {
532
+ scaleX,
533
+ scaleY
534
+ } = transform;
535
+ return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
536
+ }
537
+
538
+ },
539
+ Transform: {
540
+ toString(transform) {
541
+ if (!transform) {
542
+ return;
543
+ }
544
+
545
+ return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
546
+ }
547
+
548
+ },
549
+ Transition: {
550
+ toString(_ref) {
551
+ let {
552
+ property,
553
+ duration,
554
+ easing
555
+ } = _ref;
556
+ return property + " " + duration + "ms " + easing;
557
+ }
558
+
559
+ }
560
+ });var StyledButtonsBox = styled(Box)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n"])));
344
561
  var TableBodyCell = React.forwardRef(function (_a, ref) {
345
562
  /********************************************************************************************************************
346
563
  * Use
347
564
  * ******************************************************************************************************************/
348
565
  var className = _a.className, style = _a.style, sx = _a.sx, item = _a.item, index = _a.index, column = _a.column, defaultAlign = _a.defaultAlign, defaultEllipsis = _a.defaultEllipsis, onClick = _a.onClick, onCheckChange = _a.onCheckChange;
349
- var _b = useTableState(), menuOpen = _b.menuOpen, inViewRender = _b.inViewRender, setItemColumnChecked = _b.setItemColumnChecked, setItemColumnCheckDisabled = _b.setItemColumnCheckDisabled, setItemColumnCommands = _b.setItemColumnCommands;
350
- var _c = useInView({ threshold: 0 }), inViewRef = _c.ref, inView = _c.inView;
566
+ var _b = useTableState(), menuOpen = _b.menuOpen, setItemColumnChecked = _b.setItemColumnChecked, setItemColumnCheckDisabled = _b.setItemColumnCheckDisabled, setItemColumnCommands = _b.setItemColumnCommands;
351
567
  /********************************************************************************************************************
352
568
  * State
353
569
  * ******************************************************************************************************************/
354
- var _d = useState(false), checked = _d[0], setChecked = _d[1];
355
- var _e = useState(false), checkDisabled = _e[0], setCheckDisabled = _e[1];
570
+ var _c = useState(false), checked = _c[0], setChecked = _c[1];
571
+ var _d = useState(false), checkDisabled = _d[0], setCheckDisabled = _d[1];
356
572
  /********************************************************************************************************************
357
573
  * Effect
358
574
  * ******************************************************************************************************************/
@@ -406,7 +622,7 @@ var TableBodyCell = React.forwardRef(function (_a, ref) {
406
622
  var data;
407
623
  if (column.type !== 'check') {
408
624
  if (column.onRender) {
409
- data = column.onRender(item, index, inView);
625
+ data = column.onRender(item, index);
410
626
  }
411
627
  else if (column.name) {
412
628
  data = item[column.name];
@@ -515,7 +731,7 @@ var TableBodyCell = React.forwardRef(function (_a, ref) {
515
731
  }
516
732
  }
517
733
  return data;
518
- }, [column, item, index, inView, menuOpen, checked, checkDisabled, buttonsBoxJustifyContent, onCheckChange]);
734
+ }, [column, item, index, menuOpen, checked, checkDisabled, buttonsBoxJustifyContent, onCheckChange]);
519
735
  /********************************************************************************************************************
520
736
  * Event Handler
521
737
  * ******************************************************************************************************************/
@@ -531,21 +747,9 @@ var TableBodyCell = React.forwardRef(function (_a, ref) {
531
747
  /********************************************************************************************************************
532
748
  * Render
533
749
  * ******************************************************************************************************************/
534
- return (React.createElement(TableCommonCell, { ref: function (cellRef) {
535
- if (inViewRender) {
536
- inViewRef(cellRef);
537
- }
538
- if (ref) {
539
- if (typeof ref === 'function') {
540
- ref(cellRef);
541
- }
542
- else {
543
- ref.current = cellRef;
544
- }
545
- }
546
- }, type: 'body', className: classNames('TableBodyCell', className), style: style, sx: sx, column: column, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, item: item, index: index, onClick: column.onClick || onClick ? handleClick : undefined }, !isHidden && data));
750
+ return (React.createElement(TableCommonCell, { ref: ref, type: 'body', className: classNames('TableBodyCell', className), style: style, sx: sx, column: column, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, item: item, index: index, onClick: column.onClick || onClick ? handleClick : undefined }, !isHidden && data));
547
751
  });
548
- var templateObject_1$2;var StyledBodyRow = styled(TableRow)(function (_a) {
752
+ var templateObject_1$1;var StyledBodyRow = styled(TableRow)(function (_a) {
549
753
  var theme = _a.theme;
550
754
  return ({
551
755
  '&.odd-color:nth-of-type(odd):not(:hover)': {
@@ -573,224 +777,104 @@ var TableBodyRow = function (_a) {
573
777
  return (React.createElement(React.Fragment, null,
574
778
  React.createElement(StyledBodyRow, __assign({ className: classNames('TableBodyRow', className), style: sortable
575
779
  ? __assign(__assign({}, style), { transform: CSS.Transform.toString(transform), transition: transition }) : style }, props, sortableProps), columns.map(function (column, columnIdx) { return (React.createElement(TableBodyCell, { className: onGetColumnClassName ? onGetColumnClassName(column, item, index) : undefined, sx: onGetColumnSx ? onGetColumnSx(column, item, index) : undefined, style: onGetColumnStyle ? onGetColumnStyle(column, item, index) : undefined, key: columnIdx, index: index, item: item, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, column: column, onClick: onClick, onCheckChange: onCheckChange })); }))));
576
- };var TableFooterCell = function (_a) {
577
- /********************************************************************************************************************
578
- * Memo
579
- * ******************************************************************************************************************/
580
- var column = _a.column, items = _a.items, defaultAlign = _a.defaultAlign;
581
- var data = useMemo(function () {
582
- var _a, _b, _c;
583
- if ((_a = column.footer) === null || _a === void 0 ? void 0 : _a.onRender) {
584
- return (_b = column.footer) === null || _b === void 0 ? void 0 : _b.onRender(items);
585
- }
586
- else {
587
- return (_c = column.footer) === null || _c === void 0 ? void 0 : _c.value;
588
- }
589
- }, [column.footer, items]);
590
- /********************************************************************************************************************
591
- * Render
592
- * ******************************************************************************************************************/
593
- return (React.createElement(TableCommonCell, { type: 'head', className: 'TableFooterCell', column: column, defaultAlign: defaultAlign }, data));
594
- };var TablePagination = function (_a) {
595
- var className = _a.className, style = _a.style, sx = _a.sx, paging = _a.paging, align = _a.align, onChange = _a.onChange;
596
- return (React.createElement(Stack, { alignItems: align },
597
- React.createElement(Pagination, { count: paging.last_page, page: paging.current_page, color: 'primary', className: classNames('TablePagination', className), style: style, sx: sx, onChange: function (e, page) {
598
- if (onChange)
599
- onChange(page);
600
- } })));
601
- };var TableContextProvider = function (_a) {
602
- var children = _a.children, value = _a.value;
603
- return React.createElement(TableContext.Provider, { value: value }, children);
604
- };var TableTopHeadCaptionRow = styled(TableRow)(function (_a) {
605
- var theme = _a.theme;
606
- return ({
607
- '> th': {
608
- backgroundColor: theme.palette.grey.A100,
609
- textAlign: 'center',
610
- fontWeight: 700,
611
- },
612
- });
613
- });var TableHeadCell = function (_a) {
780
+ };var TableSortableBodyBlock = function (_a) {
781
+ var items = _a.items, baseIndex = _a.baseIndex, columns = _a.columns, showOddColor = _a.showOddColor, showEvenColor = _a.showEvenColor, onGetBodyRowStyle = _a.onGetBodyRowStyle, onGetBodyRowSx = _a.onGetBodyRowSx, onGetBodyRowClassName = _a.onGetBodyRowClassName, onGetBodyColumnClassName = _a.onGetBodyColumnClassName, onGetBodyColumnStyle = _a.onGetBodyColumnStyle, onGetBodyColumnSx = _a.onGetBodyColumnSx, defaultAlign = _a.defaultAlign, defaultEllipsis = _a.defaultEllipsis, sortable = _a.sortable, onClick = _a.onClick, onCheckChange = _a.onCheckChange;
782
+ var progressiveVisible = useTableState().progressiveVisible;
614
783
  /********************************************************************************************************************
615
784
  * Use
616
785
  * ******************************************************************************************************************/
617
- var column = _a.column, items = _a.items, defaultAlign = _a.defaultAlign, top = _a.top, onCheckChange = _a.onCheckChange;
618
- var _b = useTableState(), setHeadColumnChecked = _b.setHeadColumnChecked, setHeadColumnCommands = _b.setHeadColumnCommands;
786
+ var _b = useInView({ threshold: 0, triggerOnce: true }), ref = _b.ref, inView = _b.inView;
619
787
  /********************************************************************************************************************
620
788
  * State
621
789
  * ******************************************************************************************************************/
622
- var _c = useState(false), checked = _c[0], setChecked = _c[1];
623
- var _d = useState(false), checkDisabled = _d[0], setCheckDisabled = _d[1];
790
+ var _c = useState(baseIndex === 0), canInView = _c[0], setCanInView = _c[1];
624
791
  /********************************************************************************************************************
625
792
  * Effect
626
793
  * ******************************************************************************************************************/
627
794
  useEffect(function () {
628
- if (column.type === 'check') {
629
- setHeadColumnChecked(column, checked);
795
+ if (progressiveVisible && baseIndex > 0) {
796
+ setTimeout(function () {
797
+ setCanInView(true);
798
+ }, baseIndex * ifUndefined(progressiveVisible.delay, 300));
630
799
  }
631
- }, [column, checked, setHeadColumnChecked]);
632
- useEffect(function () {
633
- setHeadColumnCommands(column, {
634
- setChecked: function (checked) {
635
- if (column.type === 'check') {
636
- setChecked(checked);
637
- }
638
- },
639
- setCheckDisabled: function (checkDisabled) {
640
- if (column.type === 'check') {
641
- setCheckDisabled(checkDisabled);
642
- }
643
- },
644
- });
645
- }, [setHeadColumnCommands, column]);
800
+ // eslint-disable-next-line react-hooks/exhaustive-deps
801
+ }, [progressiveVisible]);
646
802
  /********************************************************************************************************************
647
803
  * Memo
648
804
  * ******************************************************************************************************************/
649
- var data = useMemo(function () {
650
- var _a, _b, _c, _d;
651
- if (column.type === 'check') {
652
- if (column.hideAllCheck) {
653
- if ((_a = column.head) === null || _a === void 0 ? void 0 : _a.onRender) {
654
- return (_b = column.head) === null || _b === void 0 ? void 0 : _b.onRender(items);
655
- }
656
- else {
657
- if (typeof column.label === 'string') {
658
- return React.createElement("div", { dangerouslySetInnerHTML: { __html: column.label } });
659
- }
660
- else {
661
- return column.label;
662
- }
663
- }
664
- }
665
- else {
666
- return (React.createElement(Checkbox, { checked: checked, disabled: checkDisabled, onChange: function (e, newChecked) {
667
- setChecked(newChecked);
668
- onCheckChange && onCheckChange(column, newChecked);
669
- } }));
670
- }
671
- }
672
- else {
673
- if ((_c = column.head) === null || _c === void 0 ? void 0 : _c.onRender) {
674
- return (_d = column.head) === null || _d === void 0 ? void 0 : _d.onRender(items);
675
- }
676
- else {
677
- if (typeof column.label === 'string') {
678
- return React.createElement("div", { dangerouslySetInnerHTML: { __html: column.label } });
679
- }
680
- else {
681
- return column.label;
682
- }
683
- }
684
- }
685
- }, [checkDisabled, checked, column, items, onCheckChange]);
805
+ var renderItems = useMemo(function () {
806
+ return !progressiveVisible || inView ? (items.map(function (item, idx) { return (React.createElement(TableBodyRow, { key: item.id, id: item.id, index: baseIndex + idx, className: classNames(showOddColor && 'odd-color', showEvenColor && 'even-color', onGetBodyRowClassName ? onGetBodyRowClassName(item, baseIndex + idx) : undefined), style: onGetBodyRowStyle ? onGetBodyRowStyle(item, baseIndex + idx) : undefined, sx: onGetBodyRowSx ? onGetBodyRowSx(item, baseIndex + idx) : undefined, hover: true, onGetColumnClassName: onGetBodyColumnClassName, onGetColumnStyle: onGetBodyColumnStyle, onGetColumnSx: onGetBodyColumnSx, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, sortable: sortable, columns: columns, item: item, onClick: onClick, onCheckChange: onCheckChange })); })) : (React.createElement(TableRow, { ref: canInView ? ref : undefined },
807
+ React.createElement(TableCell, { colSpan: columns.length, style: { height: 50 * items.length, border: 'none', textAlign: 'center' } }, canInView && '...')));
808
+ }, [
809
+ baseIndex,
810
+ canInView,
811
+ columns,
812
+ defaultAlign,
813
+ defaultEllipsis,
814
+ inView,
815
+ items,
816
+ onCheckChange,
817
+ onClick,
818
+ onGetBodyColumnClassName,
819
+ onGetBodyColumnStyle,
820
+ onGetBodyColumnSx,
821
+ onGetBodyRowClassName,
822
+ onGetBodyRowStyle,
823
+ onGetBodyRowSx,
824
+ progressiveVisible,
825
+ ref,
826
+ showEvenColor,
827
+ showOddColor,
828
+ sortable,
829
+ ]);
686
830
  /********************************************************************************************************************
687
831
  * Render
688
832
  * ******************************************************************************************************************/
689
- return (React.createElement(TableCommonCell, { type: 'head', className: 'TableHeadCell', style: top !== undefined ? { top: top } : undefined, column: column, defaultAlign: defaultAlign }, data));
690
- };var BottomLine = styled('div')(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n height: 1px;\n position: absolute;\n left: 3px;\n right: 3px;\n bottom: 0;\n"], ["\n height: 1px;\n position: absolute;\n left: 3px;\n right: 3px;\n bottom: 0;\n"])));
691
- var TableTopHead = function (_a) {
833
+ return React.createElement(React.Fragment, null, renderItems);
834
+ };var chunkArray = function (array, size) {
835
+ var result = [];
836
+ for (var i = 0; i < array.length; i += size) {
837
+ result.push(array.slice(i, i + size));
838
+ }
839
+ return result;
840
+ };var TableSortableBody = function (_a) {
692
841
  /********************************************************************************************************************
693
842
  * Use
694
843
  * ******************************************************************************************************************/
695
- var columns = _a.columns, items = _a.items, rows = _a.rows, caption = _a.caption, defaultAlign = _a.defaultAlign, onCheckChange = _a.onCheckChange;
696
- var theme = useTheme();
697
- /********************************************************************************************************************
698
- * Ref
699
- * ******************************************************************************************************************/
700
- var captionRef = useRef(null);
701
- var row1Ref = useRef(null);
702
- var row2Ref = useRef(null);
703
- var row3Ref = useRef(null);
704
- /********************************************************************************************************************
705
- * ResizeDetector
706
- * ******************************************************************************************************************/
707
- var captionHeight = useResizeDetector({
708
- targetRef: captionRef,
709
- handleWidth: false,
710
- handleHeight: true,
711
- }).height;
712
- var row1Height = useResizeDetector({ targetRef: row1Ref, handleWidth: false, handleHeight: true }).height;
713
- var row2Height = useResizeDetector({ targetRef: row2Ref, handleWidth: false, handleHeight: true }).height;
714
- var row3Height = useResizeDetector({ targetRef: row3Ref, handleWidth: false, handleHeight: true }).height;
844
+ var items = _a.items, columns = _a.columns, showOddColor = _a.showOddColor, showEvenColor = _a.showEvenColor, onGetBodyRowStyle = _a.onGetBodyRowStyle, onGetBodyRowSx = _a.onGetBodyRowSx, onGetBodyRowClassName = _a.onGetBodyRowClassName, onGetBodyColumnClassName = _a.onGetBodyColumnClassName, onGetBodyColumnStyle = _a.onGetBodyColumnStyle, onGetBodyColumnSx = _a.onGetBodyColumnSx, defaultAlign = _a.defaultAlign, defaultEllipsis = _a.defaultEllipsis, sortable = _a.sortable, onClick = _a.onClick, onCheckChange = _a.onCheckChange;
845
+ var progressiveVisible = useTableState().progressiveVisible;
715
846
  /********************************************************************************************************************
716
- * Function
847
+ * Memo
717
848
  * ******************************************************************************************************************/
718
- var makeRowCells = useCallback(function (row, top) {
719
- var totalColumns = 0;
720
- var cells = row
721
- .map(function (info, idx) {
722
- if (info) {
723
- totalColumns += info.colSpan || 1;
724
- return (React.createElement(TableCell, { key: idx, colSpan: info.colSpan, align: info.align, style: {
725
- top: top,
726
- borderBottom: 0,
727
- } },
728
- info.label,
729
- info.label != null && React.createElement(BottomLine, { style: { backgroundColor: theme.palette.divider } })));
730
- }
731
- })
732
- .filter(function (cell) { return !!cell; });
733
- if (totalColumns < columns.length) {
734
- cells.push(React.createElement(TableCell, { key: columns.length, colSpan: columns.length - cells.length, style: { top: top, borderBottom: 0 } }));
849
+ var renderBlock = useMemo(function () {
850
+ if (progressiveVisible) {
851
+ return (React.createElement(React.Fragment, null, chunkArray(items, 5).map(function (bItems, index) { return (React.createElement(TableSortableBodyBlock, { key: index, items: bItems, baseIndex: index, columns: columns, showOddColor: showOddColor, showEvenColor: showEvenColor, onGetBodyRowStyle: onGetBodyRowStyle, onGetBodyRowSx: onGetBodyRowSx, onGetBodyRowClassName: onGetBodyRowClassName, onGetBodyColumnClassName: onGetBodyColumnClassName, onGetBodyColumnStyle: onGetBodyColumnStyle, onGetBodyColumnSx: onGetBodyColumnSx, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, sortable: sortable, onClick: onClick, onCheckChange: onCheckChange })); })));
735
852
  }
736
- return cells;
737
- }, [columns, theme.palette.divider]);
738
- var columnRow = useMemo(function () {
739
- var top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0) + (row3Height || 0);
740
- return (React.createElement(TableRow, null, columns.map(function (column, idx) { return (React.createElement(TableHeadCell, { key: idx, column: column, items: items, defaultAlign: defaultAlign, top: top, onCheckChange: onCheckChange })); })));
741
- }, [captionHeight, columns, defaultAlign, items, onCheckChange, row1Height, row2Height, row3Height]);
742
- /********************************************************************************************************************
743
- * Variable
744
- * ******************************************************************************************************************/
745
- var captionRow = !!caption && (React.createElement(TableTopHeadCaptionRow, { ref: captionRef, className: 'TableTopHeadCaptionRow' },
746
- React.createElement(TableCell, { colSpan: columns.length }, caption)));
853
+ else {
854
+ return (React.createElement(TableSortableBodyBlock, { items: items, baseIndex: 0, columns: columns, showOddColor: showOddColor, showEvenColor: showEvenColor, onGetBodyRowStyle: onGetBodyRowStyle, onGetBodyRowSx: onGetBodyRowSx, onGetBodyRowClassName: onGetBodyRowClassName, onGetBodyColumnClassName: onGetBodyColumnClassName, onGetBodyColumnStyle: onGetBodyColumnStyle, onGetBodyColumnSx: onGetBodyColumnSx, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, sortable: sortable, onClick: onClick, onCheckChange: onCheckChange }));
855
+ }
856
+ }, [
857
+ columns,
858
+ defaultAlign,
859
+ defaultEllipsis,
860
+ items,
861
+ onCheckChange,
862
+ onClick,
863
+ onGetBodyColumnClassName,
864
+ onGetBodyColumnStyle,
865
+ onGetBodyColumnSx,
866
+ onGetBodyRowClassName,
867
+ onGetBodyRowStyle,
868
+ onGetBodyRowSx,
869
+ progressiveVisible,
870
+ showEvenColor,
871
+ showOddColor,
872
+ sortable,
873
+ ]);
747
874
  /********************************************************************************************************************
748
875
  * Render
749
876
  * ******************************************************************************************************************/
750
- if (rows) {
751
- if (Array.isArray(rows[0])) {
752
- return (React.createElement(TableHead, { className: 'TableHead' },
753
- captionRow,
754
- rows.map(function (row, idx) {
755
- var ref = undefined;
756
- var top = undefined;
757
- switch (idx) {
758
- case 0:
759
- ref = row1Ref;
760
- top = captionHeight;
761
- break;
762
- case 1:
763
- ref = row2Ref;
764
- top = (captionHeight || 0) + (row1Height || 0);
765
- break;
766
- case 2:
767
- ref = row3Ref;
768
- top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0);
769
- break;
770
- case 3:
771
- top = (captionHeight || 0) + (row1Height || 0) + (row2Height || 0) + (row3Height || 0);
772
- }
773
- return (React.createElement(TableRow, { key: idx, ref: ref, className: 'TableHeadRow' }, makeRowCells(row, top)));
774
- })));
775
- }
776
- else {
777
- return (React.createElement(TableHead, { className: 'TableHead' },
778
- captionRow,
779
- React.createElement(TableRow, { ref: row1Ref, className: 'TableHeadRow' }, makeRowCells(rows, captionHeight)),
780
- columnRow));
781
- }
782
- }
783
- else {
784
- return (React.createElement(TableHead, { className: 'TableHead' },
785
- captionRow,
786
- columnRow));
787
- }
788
- };
789
- var templateObject_1$1;var makeSortableItems = function (items) {
790
- return items === null || items === void 0 ? void 0 : items.map(function (_a, index) {
791
- var id = _a.id, item = __rest(_a, ["id"]);
792
- return __assign({ id: id == null ? "".concat(v4(), "_").concat(index) : id }, item);
793
- });
877
+ return sortable ? (React.createElement(SortableContext, { items: items, strategy: verticalListSortingStrategy }, renderBlock)) : (renderBlock);
794
878
  };function columnFilter(v) {
795
879
  return v !== undefined && v !== null && v !== false;
796
880
  }
@@ -799,7 +883,7 @@ var Table = React.forwardRef(function (_a, ref) {
799
883
  /********************************************************************************************************************
800
884
  * Ref
801
885
  * ******************************************************************************************************************/
802
- var className = _a.className, initStyle = _a.style, sx = _a.sx, caption = _a.caption, topHeadRows = _a.topHeadRows, initColumns = _a.columns, initItems = _a.items, initPaging = _a.paging, _b = _a.pagingAlign, pagingAlign = _b === void 0 ? 'center' : _b, _c = _a.defaultAlign, defaultAlign = _c === void 0 ? 'left' : _c, defaultEllipsis = _a.defaultEllipsis, initStickyHeader = _a.stickyHeader, height = _a.height, minHeight = _a.minHeight, maxHeight = _a.maxHeight, fullHeight = _a.fullHeight, showOddColor = _a.showOddColor, showEvenColor = _a.showEvenColor, _d = _a.cellPadding, cellPadding = _d === void 0 ? 13 : _d, inViewRender = _a.inViewRender, footer = _a.footer, noData = _a.noData, pagination = _a.pagination, sortable = _a.sortable, onClick = _a.onClick, onGetBodyRowClassName = _a.onGetBodyRowClassName, onGetBodyRowStyle = _a.onGetBodyRowStyle, onGetBodyRowSx = _a.onGetBodyRowSx, onGetBodyColumnClassName = _a.onGetBodyColumnClassName, onGetBodyColumnStyle = _a.onGetBodyColumnStyle, onGetBodyColumnSx = _a.onGetBodyColumnSx, onPageChange = _a.onPageChange, onSortChange = _a.onSortChange, onCheckChange = _a.onCheckChange;
886
+ var className = _a.className, initStyle = _a.style, sx = _a.sx, caption = _a.caption, topHeadRows = _a.topHeadRows, initColumns = _a.columns, initItems = _a.items, initPaging = _a.paging, _b = _a.pagingAlign, pagingAlign = _b === void 0 ? 'center' : _b, _c = _a.defaultAlign, defaultAlign = _c === void 0 ? 'left' : _c, defaultEllipsis = _a.defaultEllipsis, initStickyHeader = _a.stickyHeader, height = _a.height, minHeight = _a.minHeight, maxHeight = _a.maxHeight, fullHeight = _a.fullHeight, showOddColor = _a.showOddColor, showEvenColor = _a.showEvenColor, _d = _a.cellPadding, cellPadding = _d === void 0 ? 13 : _d, footer = _a.footer, noData = _a.noData, pagination = _a.pagination, sortable = _a.sortable, progressiveVisible = _a.progressiveVisible, onClick = _a.onClick, onGetBodyRowClassName = _a.onGetBodyRowClassName, onGetBodyRowStyle = _a.onGetBodyRowStyle, onGetBodyRowSx = _a.onGetBodyRowSx, onGetBodyColumnClassName = _a.onGetBodyColumnClassName, onGetBodyColumnStyle = _a.onGetBodyColumnStyle, onGetBodyColumnSx = _a.onGetBodyColumnSx, onPageChange = _a.onPageChange, onSortChange = _a.onSortChange, onCheckChange = _a.onCheckChange;
803
887
  var localHeaderDataRef = useRef({});
804
888
  var localBodyDataRef = useRef({});
805
889
  var updateHeadCheckTimer = useRef(undefined);
@@ -865,19 +949,6 @@ var Table = React.forwardRef(function (_a, ref) {
865
949
  }
866
950
  },
867
951
  }).ref;
868
- /********************************************************************************************************************
869
- * Memo
870
- * ******************************************************************************************************************/
871
- var tableSx = useMemo(function () {
872
- var sx = {
873
- padding: typeof cellPadding === 'number' ? "".concat(cellPadding, "px") : cellPadding,
874
- };
875
- return {
876
- '> .MuiTableHead-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
877
- '> .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
878
- '> .MuiTableFooter-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
879
- };
880
- }, [cellPadding]);
881
952
  /********************************************************************************************************************
882
953
  * Function
883
954
  * ******************************************************************************************************************/
@@ -1271,28 +1342,42 @@ var Table = React.forwardRef(function (_a, ref) {
1271
1342
  var isNoData = !!sortableItems && sortableItems.length <= 0;
1272
1343
  var finalPagingHeight = paging && paging.total > 0 ? pagingHeight || 0 : 0;
1273
1344
  var stickyHeader = !isNoData && initStickyHeader;
1274
- var style = fullHeight
1275
- ? __assign(__assign({ width: '100%' }, initStyle), { flex: 1, justifyContent: 'flex-end', height: '100%', display: 'flex', flexDirection: 'column', position: 'relative' }) : __assign({ width: '100%' }, initStyle);
1276
- var simpleBarStyle = fullHeight
1277
- ? {
1278
- height: (containerHeight || 0) - (finalPagingHeight || 0) - 1,
1279
- flex: 1,
1280
- position: 'absolute',
1281
- top: 0,
1282
- left: 0,
1283
- right: 0,
1284
- marginBottom: finalPagingHeight || 0,
1285
- }
1286
- : { height: height, minHeight: minHeight, maxHeight: maxHeight, marginBottom: -1 };
1287
- var tableStyle = fullHeight && isNoData ? { flex: 1, height: (containerHeight || 0) - finalPagingHeight - 2 } : undefined;
1288
- // pageStyle
1289
- var pagingStyle = { padding: '13px 0', borderTop: '1px solid rgba(224, 224, 224, 1)' };
1290
- if (fullHeight) {
1291
- pagingStyle.position = 'sticky';
1292
- }
1293
- var tableTopHead = finalColumns && (React.createElement(TableTopHead, { caption: caption, rows: topHeadRows, columns: finalColumns, items: items, defaultAlign: defaultAlign, onCheckChange: handleHeadCheckChange }));
1345
+ var _p = useMemo(function () {
1346
+ var style = fullHeight
1347
+ ? __assign(__assign({ width: '100%' }, initStyle), { flex: 1, justifyContent: 'flex-end', height: '100%', display: 'flex', flexDirection: 'column', position: 'relative' }) : __assign({ width: '100%' }, initStyle);
1348
+ var sx = { padding: typeof cellPadding === 'number' ? "".concat(cellPadding, "px") : cellPadding };
1349
+ var tableSx = {
1350
+ '> .MuiTableHead-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
1351
+ '> .MuiTableBody-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
1352
+ '> .MuiTableFooter-root > .MuiTableRow-root > .MuiTableCell-root ': sx,
1353
+ };
1354
+ // pageStyle
1355
+ var pagingStyle = { padding: '13px 0', borderTop: '1px solid rgba(224, 224, 224, 1)' };
1356
+ if (fullHeight) {
1357
+ pagingStyle.position = 'sticky';
1358
+ }
1359
+ return { style: style, tableSx: tableSx, pagingStyle: pagingStyle };
1360
+ }, [cellPadding, fullHeight, initStyle]), style = _p.style, tableSx = _p.tableSx, pagingStyle = _p.pagingStyle;
1361
+ var _q = useMemo(function () {
1362
+ var simpleBarStyle = fullHeight
1363
+ ? {
1364
+ height: (containerHeight || 0) - (finalPagingHeight || 0) - 1,
1365
+ flex: 1,
1366
+ position: 'absolute',
1367
+ top: 0,
1368
+ left: 0,
1369
+ right: 0,
1370
+ marginBottom: finalPagingHeight || 0,
1371
+ }
1372
+ : { height: height, minHeight: minHeight, maxHeight: maxHeight, marginBottom: -1 };
1373
+ var tableStyle = fullHeight && isNoData ? { flex: 1, height: (containerHeight || 0) - finalPagingHeight - 2 } : undefined;
1374
+ return { simpleBarStyle: simpleBarStyle, tableStyle: tableStyle };
1375
+ }, [containerHeight, finalPagingHeight, fullHeight, height, isNoData, maxHeight, minHeight]), simpleBarStyle = _q.simpleBarStyle, tableStyle = _q.tableStyle;
1376
+ var tableTopHead = useMemo(function () {
1377
+ return finalColumns && (React.createElement(TableTopHead, { caption: caption, rows: topHeadRows, columns: finalColumns, items: items, defaultAlign: defaultAlign, onCheckChange: handleHeadCheckChange }));
1378
+ }, [caption, defaultAlign, finalColumns, handleHeadCheckChange, items, topHeadRows]);
1294
1379
  var tableBody = useMemo(function () {
1295
- return finalColumns && (React.createElement(TableBody, null, sortableItems ? (sortableItems.length > 0 ? (React.createElement(SortableContext, { items: sortableItems, strategy: verticalListSortingStrategy }, sortableItems.map(function (item, idx) { return (React.createElement(TableBodyRow, { key: item.id, className: classNames(!!showOddColor && 'odd-color', !!showEvenColor && 'even-color', onGetBodyRowClassName ? onGetBodyRowClassName(item, idx) : undefined), style: onGetBodyRowStyle ? onGetBodyRowStyle(item, idx) : undefined, sx: onGetBodyRowSx ? onGetBodyRowSx(item, idx) : undefined, onGetColumnClassName: onGetBodyColumnClassName, onGetColumnStyle: onGetBodyColumnStyle, onGetColumnSx: onGetBodyColumnSx, hover: true, id: item.id, index: idx, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, sortable: sortable, columns: finalColumns, item: item, onClick: onClick, onCheckChange: handleBodyCheckChange })); }))) : (React.createElement(StyledBodyRow$1, null,
1380
+ return finalColumns && (React.createElement(TableBody, null, sortableItems ? (sortableItems.length > 0 ? (React.createElement(TableSortableBody, { items: sortableItems, columns: finalColumns, showOddColor: showOddColor, showEvenColor: showEvenColor, defaultAlign: defaultAlign, defaultEllipsis: defaultEllipsis, sortable: sortable, onClick: onClick, onCheckChange: handleBodyCheckChange, onGetBodyRowClassName: onGetBodyRowClassName, onGetBodyRowStyle: onGetBodyRowStyle, onGetBodyRowSx: onGetBodyRowSx, onGetBodyColumnClassName: onGetBodyColumnClassName, onGetBodyColumnSx: onGetBodyColumnSx, onGetBodyColumnStyle: onGetBodyColumnStyle })) : (React.createElement(StyledBodyRow$1, null,
1296
1381
  React.createElement(TableCell, { colSpan: finalColumns.length, style: { flex: 1 } }, noData ? (noData) : (React.createElement(StyledNoDataDiv, null,
1297
1382
  React.createElement("div", null,
1298
1383
  React.createElement(Icon, null, "error")),
@@ -1327,7 +1412,7 @@ var Table = React.forwardRef(function (_a, ref) {
1327
1412
  return finalColumns ? (React.createElement(TableContextProvider, { value: {
1328
1413
  menuOpen: menuOpen,
1329
1414
  openMenuId: openMenuId,
1330
- inViewRender: inViewRender,
1415
+ progressiveVisible: progressiveVisible,
1331
1416
  setMenuOpen: TableContextSetMenuOpen,
1332
1417
  setItemColumnChecked: TableContextSetItemColumnChecked,
1333
1418
  setItemColumnCheckDisabled: TableContextSetItemColumnCheckDisabled,