@bwp-web/components 0.11.3 → 0.11.5
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/BiampTable/BiampTable.d.ts +3 -1
- package/dist/BiampTable/BiampTable.d.ts.map +1 -1
- package/dist/BiampTable/BiampTablePagination.d.ts +5 -3
- package/dist/BiampTable/BiampTablePagination.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarSearch.d.ts.map +1 -1
- package/dist/index.cjs +246 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +252 -191
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -480,6 +480,7 @@ import {
|
|
|
480
480
|
DropdownChevronUpIcon
|
|
481
481
|
} from "@bwp-web/assets";
|
|
482
482
|
import { flexRender } from "@tanstack/react-table";
|
|
483
|
+
import { useCallback, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
483
484
|
|
|
484
485
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
485
486
|
import { NoResultsIcon } from "@bwp-web/assets";
|
|
@@ -575,12 +576,12 @@ function BiampTable({
|
|
|
575
576
|
loading,
|
|
576
577
|
error,
|
|
577
578
|
empty,
|
|
579
|
+
enableRowSelection = false,
|
|
578
580
|
hideSelectAll,
|
|
579
581
|
getRowLabel,
|
|
580
582
|
sx,
|
|
581
583
|
...boxProps
|
|
582
584
|
}) {
|
|
583
|
-
const enableRowSelection = table.options.enableRowSelection === true || typeof table.options.enableRowSelection === "function";
|
|
584
585
|
const tableMinWidth = table.getVisibleLeafColumns().reduce(
|
|
585
586
|
(sum, col) => {
|
|
586
587
|
const mw = col.columnDef.meta?.minWidth;
|
|
@@ -588,198 +589,242 @@ function BiampTable({
|
|
|
588
589
|
},
|
|
589
590
|
enableRowSelection ? 48 : 0
|
|
590
591
|
);
|
|
591
|
-
const
|
|
592
|
+
const containerRef = useRef2(null);
|
|
593
|
+
const lastScrollLeftRef = useRef2(null);
|
|
594
|
+
const onContainerScroll = useCallback((target) => {
|
|
595
|
+
const { scrollLeft, scrollWidth, clientWidth } = target;
|
|
596
|
+
if (!containerRef.current || lastScrollLeftRef.current === scrollLeft)
|
|
597
|
+
return;
|
|
598
|
+
containerRef.current.dataset["rightShadow"] = scrollWidth - clientWidth > scrollLeft ? "true" : "false";
|
|
599
|
+
lastScrollLeftRef.current = scrollLeft;
|
|
600
|
+
}, []);
|
|
601
|
+
useEffect2(() => {
|
|
602
|
+
if (!containerRef.current) return;
|
|
603
|
+
const observer = new ResizeObserver(
|
|
604
|
+
([{ target }]) => onContainerScroll(target)
|
|
605
|
+
);
|
|
606
|
+
observer.observe(containerRef.current);
|
|
607
|
+
return () => observer.disconnect();
|
|
608
|
+
}, [onContainerScroll]);
|
|
592
609
|
const showLoading = useLoadingDelay(!!loading);
|
|
593
610
|
const rows = table.getRowModel().rows;
|
|
594
|
-
const showError = !!error;
|
|
595
|
-
const showEmpty = !showError && rows.length === 0;
|
|
596
|
-
return /* @__PURE__ */
|
|
611
|
+
const showError = !!error && !loading;
|
|
612
|
+
const showEmpty = !showError && !loading && rows.length === 0;
|
|
613
|
+
return /* @__PURE__ */ jsxs5(
|
|
597
614
|
TableContainer,
|
|
598
615
|
{
|
|
599
616
|
component: Box3,
|
|
600
617
|
...boxProps,
|
|
618
|
+
ref: containerRef,
|
|
619
|
+
onScroll: (e) => onContainerScroll(e.currentTarget),
|
|
601
620
|
sx: {
|
|
602
621
|
display: "flex",
|
|
603
622
|
flexDirection: "column",
|
|
604
623
|
height: "100%",
|
|
605
624
|
overflow: "auto",
|
|
606
625
|
overscrollBehavior: "none",
|
|
626
|
+
position: "relative",
|
|
627
|
+
'& [data-sticky="right"]': {
|
|
628
|
+
transition: "box-shadow .2s"
|
|
629
|
+
},
|
|
630
|
+
'&[data-right-shadow="true"] [data-sticky="right"]': {
|
|
631
|
+
boxShadow: ({ palette }) => `-16px 0px 12px -2px ${palette.background.default}`
|
|
632
|
+
},
|
|
607
633
|
...sx
|
|
608
634
|
},
|
|
609
|
-
children:
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
minWidth: tableMinWidth,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
/* @__PURE__ */ jsx7(TableHead, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs5(TableRow, { children: [
|
|
619
|
-
enableRowSelection && /* @__PURE__ */ jsx7(
|
|
620
|
-
TableCell,
|
|
621
|
-
{
|
|
622
|
-
padding: "checkbox",
|
|
623
|
-
sx: {
|
|
624
|
-
position: "sticky",
|
|
625
|
-
left: 0,
|
|
626
|
-
zIndex: 3,
|
|
627
|
-
bgcolor: "background.paper"
|
|
628
|
-
},
|
|
629
|
-
children: !hideSelectAll && /* @__PURE__ */ jsx7(
|
|
630
|
-
Checkbox,
|
|
631
|
-
{
|
|
632
|
-
checked: table.getIsAllPageRowsSelected(),
|
|
633
|
-
indeterminate: table.getIsSomePageRowsSelected(),
|
|
634
|
-
onChange: table.getToggleAllPageRowsSelectedHandler(),
|
|
635
|
-
slotProps: { input: { "aria-label": "Select all rows" } }
|
|
636
|
-
}
|
|
637
|
-
)
|
|
638
|
-
}
|
|
639
|
-
),
|
|
640
|
-
headerGroup.headers.map((header) => {
|
|
641
|
-
const sticky = header.column.columnDef.meta?.sticky;
|
|
642
|
-
return /* @__PURE__ */ jsx7(
|
|
635
|
+
children: [
|
|
636
|
+
/* @__PURE__ */ jsxs5(
|
|
637
|
+
MuiTable,
|
|
638
|
+
{
|
|
639
|
+
"aria-busy": showLoading || void 0,
|
|
640
|
+
sx: { minWidth: tableMinWidth, tableLayout: "auto" },
|
|
641
|
+
children: [
|
|
642
|
+
/* @__PURE__ */ jsx7(TableHead, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs5(TableRow, { children: [
|
|
643
|
+
enableRowSelection && /* @__PURE__ */ jsx7(
|
|
643
644
|
TableCell,
|
|
644
645
|
{
|
|
645
|
-
|
|
646
|
-
...header.column.getCanSort() && {
|
|
647
|
-
"aria-sort": header.column.getIsSorted() ? header.column.getIsSorted() === "asc" ? "ascending" : "descending" : "none"
|
|
648
|
-
},
|
|
646
|
+
padding: "checkbox",
|
|
649
647
|
sx: {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
zIndex: 3,
|
|
655
|
-
bgcolor: "background.paper"
|
|
656
|
-
}
|
|
648
|
+
position: "sticky",
|
|
649
|
+
left: 0,
|
|
650
|
+
zIndex: 3,
|
|
651
|
+
bgcolor: "background.paper"
|
|
657
652
|
},
|
|
658
|
-
children:
|
|
659
|
-
|
|
653
|
+
children: !hideSelectAll && /* @__PURE__ */ jsx7(
|
|
654
|
+
Checkbox,
|
|
660
655
|
{
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
IconComponent: header.column.getIsSorted() === "asc" ? DropdownChevronUpIcon : DropdownChevronDownIcon
|
|
666
|
-
},
|
|
667
|
-
children: flexRender(
|
|
668
|
-
header.column.columnDef.header,
|
|
669
|
-
header.getContext()
|
|
670
|
-
)
|
|
656
|
+
checked: table.getIsAllPageRowsSelected(),
|
|
657
|
+
indeterminate: table.getIsSomePageRowsSelected(),
|
|
658
|
+
onChange: table.getToggleAllPageRowsSelectedHandler(),
|
|
659
|
+
slotProps: { input: { "aria-label": "Select all rows" } }
|
|
671
660
|
}
|
|
672
|
-
) : flexRender(
|
|
673
|
-
header.column.columnDef.header,
|
|
674
|
-
header.getContext()
|
|
675
661
|
)
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
)
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
) }) : showEmpty ? /* @__PURE__ */ jsx7(TableRow, { children: /* @__PURE__ */ jsx7(
|
|
693
|
-
TableCell,
|
|
694
|
-
{
|
|
695
|
-
colSpan: totalColumns,
|
|
696
|
-
sx: {
|
|
697
|
-
textAlign: "center",
|
|
698
|
-
verticalAlign: "middle",
|
|
699
|
-
height: "100%"
|
|
700
|
-
},
|
|
701
|
-
children: empty && empty !== true ? empty : /* @__PURE__ */ jsx7(BiampTableEmptyState, {})
|
|
702
|
-
}
|
|
703
|
-
) }) : rows.map((row) => {
|
|
704
|
-
const clickable = onRowClick ? isRowClickable ? isRowClickable(row.original) : true : false;
|
|
705
|
-
return /* @__PURE__ */ jsxs5(
|
|
706
|
-
TableRow,
|
|
707
|
-
{
|
|
708
|
-
hover: clickable,
|
|
709
|
-
selected: enableRowSelection ? row.getIsSelected() : void 0,
|
|
710
|
-
role: clickable ? "button" : void 0,
|
|
711
|
-
tabIndex: clickable ? 0 : void 0,
|
|
712
|
-
sx: { cursor: clickable ? "pointer" : void 0 },
|
|
713
|
-
onClick: clickable && onRowClick ? () => onRowClick(row.original) : void 0,
|
|
714
|
-
onKeyDown: clickable && onRowClick ? (e) => {
|
|
715
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
716
|
-
e.preventDefault();
|
|
717
|
-
onRowClick(row.original);
|
|
718
|
-
}
|
|
719
|
-
} : void 0,
|
|
720
|
-
children: [
|
|
721
|
-
enableRowSelection && /* @__PURE__ */ jsx7(
|
|
722
|
-
TableCell,
|
|
723
|
-
{
|
|
724
|
-
padding: "checkbox",
|
|
725
|
-
sx: {
|
|
662
|
+
}
|
|
663
|
+
),
|
|
664
|
+
headerGroup.headers.map((header) => {
|
|
665
|
+
const sticky = header.column.columnDef.meta?.sticky;
|
|
666
|
+
return /* @__PURE__ */ jsx7(
|
|
667
|
+
TableCell,
|
|
668
|
+
{
|
|
669
|
+
"data-sticky": sticky || void 0,
|
|
670
|
+
sortDirection: header.column.getIsSorted() || false,
|
|
671
|
+
...header.column.getCanSort() && {
|
|
672
|
+
"aria-sort": header.column.getIsSorted() ? header.column.getIsSorted() === "asc" ? "ascending" : "descending" : "none"
|
|
673
|
+
},
|
|
674
|
+
sx: {
|
|
675
|
+
minWidth: header.column.columnDef.meta?.minWidth ?? 40,
|
|
676
|
+
...sticky && {
|
|
726
677
|
position: "sticky",
|
|
727
|
-
|
|
728
|
-
zIndex:
|
|
729
|
-
bgcolor: "background.paper"
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
678
|
+
[sticky]: 0,
|
|
679
|
+
zIndex: 3,
|
|
680
|
+
bgcolor: "background.paper"
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsx7(
|
|
684
|
+
TableSortLabel,
|
|
685
|
+
{
|
|
686
|
+
active: !!header.column.getIsSorted(),
|
|
687
|
+
direction: header.column.getIsSorted() || "asc",
|
|
688
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
689
|
+
...header.column.getIsSorted() && {
|
|
690
|
+
IconComponent: header.column.getIsSorted() === "asc" ? DropdownChevronUpIcon : DropdownChevronDownIcon
|
|
691
|
+
},
|
|
692
|
+
children: flexRender(
|
|
693
|
+
header.column.columnDef.header,
|
|
694
|
+
header.getContext()
|
|
695
|
+
)
|
|
696
|
+
}
|
|
697
|
+
) : flexRender(
|
|
698
|
+
header.column.columnDef.header,
|
|
699
|
+
header.getContext()
|
|
700
|
+
)
|
|
701
|
+
},
|
|
702
|
+
header.id
|
|
703
|
+
);
|
|
704
|
+
})
|
|
705
|
+
] }, headerGroup.id)) }),
|
|
706
|
+
/* @__PURE__ */ jsx7(TableBody, { sx: { opacity: showLoading ? 0.3 : 1 }, children: !showError && rows.map((row) => {
|
|
707
|
+
const clickable = onRowClick ? isRowClickable ? isRowClickable(row.original) : true : false;
|
|
708
|
+
return /* @__PURE__ */ jsxs5(
|
|
709
|
+
TableRow,
|
|
710
|
+
{
|
|
711
|
+
hover: clickable,
|
|
712
|
+
selected: enableRowSelection ? row.getIsSelected() : void 0,
|
|
713
|
+
role: clickable ? "button" : void 0,
|
|
714
|
+
tabIndex: clickable ? 0 : void 0,
|
|
715
|
+
sx: { cursor: clickable ? "pointer" : void 0 },
|
|
716
|
+
onClick: clickable && onRowClick ? () => onRowClick(row.original) : void 0,
|
|
717
|
+
onKeyDown: clickable && onRowClick ? (e) => {
|
|
718
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
719
|
+
e.preventDefault();
|
|
720
|
+
onRowClick(row.original);
|
|
748
721
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
return /* @__PURE__ */ jsx7(
|
|
722
|
+
} : void 0,
|
|
723
|
+
children: [
|
|
724
|
+
enableRowSelection && /* @__PURE__ */ jsx7(
|
|
753
725
|
TableCell,
|
|
754
726
|
{
|
|
727
|
+
padding: "checkbox",
|
|
755
728
|
sx: {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
bgcolor: "
|
|
762
|
-
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
763
|
-
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
764
|
-
}
|
|
729
|
+
position: "sticky",
|
|
730
|
+
left: 0,
|
|
731
|
+
zIndex: 2,
|
|
732
|
+
bgcolor: "background.paper",
|
|
733
|
+
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
734
|
+
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
765
735
|
}
|
|
766
736
|
},
|
|
767
|
-
children:
|
|
768
|
-
|
|
769
|
-
|
|
737
|
+
children: /* @__PURE__ */ jsx7(
|
|
738
|
+
Checkbox,
|
|
739
|
+
{
|
|
740
|
+
checked: row.getIsSelected(),
|
|
741
|
+
disabled: !row.getCanSelect(),
|
|
742
|
+
onChange: row.getToggleSelectedHandler(),
|
|
743
|
+
onClick: (e) => e.stopPropagation(),
|
|
744
|
+
slotProps: {
|
|
745
|
+
input: {
|
|
746
|
+
"aria-label": getRowLabel ? `Select ${getRowLabel(row.original)}` : `Select row ${row.index + 1}`
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
770
750
|
)
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
)
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
751
|
+
}
|
|
752
|
+
),
|
|
753
|
+
row.getVisibleCells().map((cell) => {
|
|
754
|
+
const sticky = cell.column.columnDef.meta?.sticky;
|
|
755
|
+
return /* @__PURE__ */ jsx7(
|
|
756
|
+
TableCell,
|
|
757
|
+
{
|
|
758
|
+
"data-sticky": sticky || void 0,
|
|
759
|
+
sx: {
|
|
760
|
+
minWidth: cell.column.columnDef.meta?.minWidth ?? 40,
|
|
761
|
+
...sticky && {
|
|
762
|
+
position: "sticky",
|
|
763
|
+
[sticky]: 0,
|
|
764
|
+
zIndex: 2,
|
|
765
|
+
bgcolor: "background.paper",
|
|
766
|
+
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
767
|
+
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
children: flexRender(
|
|
772
|
+
cell.column.columnDef.cell,
|
|
773
|
+
cell.getContext()
|
|
774
|
+
)
|
|
775
|
+
},
|
|
776
|
+
cell.id
|
|
777
|
+
);
|
|
778
|
+
})
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
row.id
|
|
782
|
+
);
|
|
783
|
+
}) })
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
showError && /* @__PURE__ */ jsx7(
|
|
788
|
+
Box3,
|
|
789
|
+
{
|
|
790
|
+
sx: {
|
|
791
|
+
position: "absolute",
|
|
792
|
+
top: 0,
|
|
793
|
+
left: 0,
|
|
794
|
+
right: 0,
|
|
795
|
+
bottom: 0,
|
|
796
|
+
display: "flex",
|
|
797
|
+
alignItems: "center",
|
|
798
|
+
justifyContent: "center",
|
|
799
|
+
pointerEvents: "none"
|
|
800
|
+
},
|
|
801
|
+
children: error === true ? /* @__PURE__ */ jsx7(BiampTableErrorState, { sx: { pointerEvents: "auto" } }) : error instanceof Error ? /* @__PURE__ */ jsx7(
|
|
802
|
+
BiampTableErrorState,
|
|
803
|
+
{
|
|
804
|
+
description: error.message,
|
|
805
|
+
sx: { pointerEvents: "auto" }
|
|
806
|
+
}
|
|
807
|
+
) : error
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
showEmpty && /* @__PURE__ */ jsx7(
|
|
811
|
+
Box3,
|
|
812
|
+
{
|
|
813
|
+
sx: {
|
|
814
|
+
position: "absolute",
|
|
815
|
+
top: 0,
|
|
816
|
+
left: 0,
|
|
817
|
+
right: 0,
|
|
818
|
+
bottom: 0,
|
|
819
|
+
display: "flex",
|
|
820
|
+
alignItems: "center",
|
|
821
|
+
justifyContent: "center",
|
|
822
|
+
pointerEvents: "none"
|
|
823
|
+
},
|
|
824
|
+
children: empty && empty !== true ? empty : /* @__PURE__ */ jsx7(BiampTableEmptyState, { sx: { pointerEvents: "auto" } })
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
]
|
|
783
828
|
}
|
|
784
829
|
);
|
|
785
830
|
}
|
|
@@ -1037,29 +1082,40 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1037
1082
|
}
|
|
1038
1083
|
|
|
1039
1084
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1040
|
-
import { useRef as
|
|
1041
|
-
import {
|
|
1085
|
+
import { useRef as useRef3 } from "react";
|
|
1086
|
+
import { TablePagination } from "@mui/material";
|
|
1042
1087
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1088
|
+
var positionMap = {
|
|
1089
|
+
left: "flex-start",
|
|
1090
|
+
center: "center",
|
|
1091
|
+
right: "flex-end"
|
|
1092
|
+
};
|
|
1043
1093
|
function BiampTablePagination({
|
|
1044
1094
|
table,
|
|
1045
1095
|
rowsPerPageOptions,
|
|
1046
1096
|
loading,
|
|
1047
1097
|
autoHide = true,
|
|
1098
|
+
position = "center",
|
|
1048
1099
|
sx,
|
|
1049
1100
|
...paginationProps
|
|
1050
1101
|
}) {
|
|
1051
1102
|
const rowCount = table.getRowCount();
|
|
1052
|
-
const lastRowCountRef =
|
|
1103
|
+
const lastRowCountRef = useRef3(rowCount);
|
|
1053
1104
|
if (!loading && rowCount >= 0) {
|
|
1054
1105
|
lastRowCountRef.current = rowCount;
|
|
1055
1106
|
}
|
|
1056
1107
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1057
|
-
const pageSize = table.getState().pagination
|
|
1058
|
-
|
|
1108
|
+
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1109
|
+
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1110
|
+
if (!loading && pageIndex > maxPage) {
|
|
1111
|
+
table.setPageIndex(maxPage);
|
|
1112
|
+
}
|
|
1113
|
+
if (autoHide && !loading && (!stableCount || stableCount <= pageSize))
|
|
1114
|
+
return null;
|
|
1059
1115
|
return /* @__PURE__ */ jsx13(
|
|
1060
1116
|
TablePagination,
|
|
1061
1117
|
{
|
|
1062
|
-
component:
|
|
1118
|
+
component: "div",
|
|
1063
1119
|
count: stableCount,
|
|
1064
1120
|
page: table.getState().pagination.pageIndex,
|
|
1065
1121
|
rowsPerPage: table.getState().pagination.pageSize,
|
|
@@ -1072,6 +1128,8 @@ function BiampTablePagination({
|
|
|
1072
1128
|
showFirstButton: true,
|
|
1073
1129
|
showLastButton: true,
|
|
1074
1130
|
sx: {
|
|
1131
|
+
display: "flex",
|
|
1132
|
+
justifyContent: positionMap[position],
|
|
1075
1133
|
height: 40,
|
|
1076
1134
|
minHeight: 40,
|
|
1077
1135
|
"& .MuiToolbar-root": {
|
|
@@ -1086,7 +1144,7 @@ function BiampTablePagination({
|
|
|
1086
1144
|
}
|
|
1087
1145
|
|
|
1088
1146
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1089
|
-
import { Box as
|
|
1147
|
+
import { Box as Box5 } from "@mui/material";
|
|
1090
1148
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1091
1149
|
function BiampTableToolbar({
|
|
1092
1150
|
children,
|
|
@@ -1094,7 +1152,7 @@ function BiampTableToolbar({
|
|
|
1094
1152
|
...props
|
|
1095
1153
|
}) {
|
|
1096
1154
|
return /* @__PURE__ */ jsx14(
|
|
1097
|
-
|
|
1155
|
+
Box5,
|
|
1098
1156
|
{
|
|
1099
1157
|
role: "toolbar",
|
|
1100
1158
|
display: "flex",
|
|
@@ -1112,13 +1170,13 @@ function BiampTableToolbar({
|
|
|
1112
1170
|
}
|
|
1113
1171
|
|
|
1114
1172
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1115
|
-
import { Box as
|
|
1173
|
+
import { Box as Box6 } from "@mui/material";
|
|
1116
1174
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1117
1175
|
function BiampTableToolbarActions({
|
|
1118
1176
|
children,
|
|
1119
1177
|
...props
|
|
1120
1178
|
}) {
|
|
1121
|
-
return /* @__PURE__ */ jsx15(
|
|
1179
|
+
return /* @__PURE__ */ jsx15(Box6, { display: "flex", alignItems: "center", gap: 1, ml: "auto", ...props, children });
|
|
1122
1180
|
}
|
|
1123
1181
|
|
|
1124
1182
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
@@ -1147,7 +1205,7 @@ function BiampTableToolbarExport({
|
|
|
1147
1205
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1148
1206
|
import {
|
|
1149
1207
|
Badge as Badge2,
|
|
1150
|
-
Box as
|
|
1208
|
+
Box as Box7,
|
|
1151
1209
|
Button,
|
|
1152
1210
|
Divider as Divider2,
|
|
1153
1211
|
Drawer,
|
|
@@ -1199,16 +1257,16 @@ function BiampTableToolbarFilters({
|
|
|
1199
1257
|
...drawerProps?.PaperProps
|
|
1200
1258
|
},
|
|
1201
1259
|
children: /* @__PURE__ */ jsxs8(
|
|
1202
|
-
|
|
1260
|
+
Box7,
|
|
1203
1261
|
{
|
|
1204
1262
|
height: "100%",
|
|
1205
1263
|
display: "flex",
|
|
1206
1264
|
flexDirection: "column",
|
|
1207
1265
|
justifyContent: "space-between",
|
|
1208
1266
|
children: [
|
|
1209
|
-
/* @__PURE__ */ jsxs8(
|
|
1267
|
+
/* @__PURE__ */ jsxs8(Box7, { children: [
|
|
1210
1268
|
/* @__PURE__ */ jsxs8(
|
|
1211
|
-
|
|
1269
|
+
Box7,
|
|
1212
1270
|
{
|
|
1213
1271
|
display: "flex",
|
|
1214
1272
|
justifyContent: "space-between",
|
|
@@ -1241,7 +1299,7 @@ function BiampTableToolbarFilters({
|
|
|
1241
1299
|
),
|
|
1242
1300
|
/* @__PURE__ */ jsx17(Divider2, {}),
|
|
1243
1301
|
/* @__PURE__ */ jsx17(
|
|
1244
|
-
|
|
1302
|
+
Box7,
|
|
1245
1303
|
{
|
|
1246
1304
|
role: "group",
|
|
1247
1305
|
"aria-label": "Filter options",
|
|
@@ -1254,7 +1312,7 @@ function BiampTableToolbarFilters({
|
|
|
1254
1312
|
}
|
|
1255
1313
|
)
|
|
1256
1314
|
] }),
|
|
1257
|
-
/* @__PURE__ */ jsxs8(
|
|
1315
|
+
/* @__PURE__ */ jsxs8(Box7, { display: "flex", children: [
|
|
1258
1316
|
/* @__PURE__ */ jsx17(
|
|
1259
1317
|
Button,
|
|
1260
1318
|
{
|
|
@@ -1287,28 +1345,28 @@ function BiampTableToolbarFilters({
|
|
|
1287
1345
|
|
|
1288
1346
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1289
1347
|
import {
|
|
1290
|
-
Box as
|
|
1348
|
+
Box as Box8,
|
|
1291
1349
|
Collapse,
|
|
1292
1350
|
IconButton as IconButton4,
|
|
1293
1351
|
InputAdornment as InputAdornment2,
|
|
1294
1352
|
TextField as TextField2
|
|
1295
1353
|
} from "@mui/material";
|
|
1296
1354
|
import { CloseIcon as CloseIcon2, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
1297
|
-
import { useEffect as
|
|
1355
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1298
1356
|
|
|
1299
1357
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1300
|
-
import { useCallback, useEffect as
|
|
1358
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
1301
1359
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1302
1360
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1303
|
-
const timeoutRef =
|
|
1304
|
-
const callbackRef =
|
|
1361
|
+
const timeoutRef = useRef4(null);
|
|
1362
|
+
const callbackRef = useRef4(callback);
|
|
1305
1363
|
callbackRef.current = callback;
|
|
1306
|
-
|
|
1364
|
+
useEffect3(() => {
|
|
1307
1365
|
return () => {
|
|
1308
1366
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1309
1367
|
};
|
|
1310
1368
|
}, []);
|
|
1311
|
-
return
|
|
1369
|
+
return useCallback2(
|
|
1312
1370
|
(...args) => {
|
|
1313
1371
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1314
1372
|
timeoutRef.current = setTimeout(
|
|
@@ -1324,8 +1382,11 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
1324
1382
|
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1325
1383
|
var searchFieldSx = {
|
|
1326
1384
|
"& .MuiInputBase-root": {
|
|
1327
|
-
height:
|
|
1328
|
-
minHeight:
|
|
1385
|
+
height: "36px !important",
|
|
1386
|
+
minHeight: "36px !important"
|
|
1387
|
+
},
|
|
1388
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
1389
|
+
height: "36px !important"
|
|
1329
1390
|
}
|
|
1330
1391
|
};
|
|
1331
1392
|
function BiampTableToolbarSearch({
|
|
@@ -1344,7 +1405,7 @@ function BiampTableToolbarSearch({
|
|
|
1344
1405
|
const [inputValue, setInputValue] = useState4(defaultValue);
|
|
1345
1406
|
const [isExpanded, setIsExpanded] = useState4(false);
|
|
1346
1407
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
1347
|
-
|
|
1408
|
+
useEffect4(() => {
|
|
1348
1409
|
setInputValue(defaultValue);
|
|
1349
1410
|
}, [defaultValue]);
|
|
1350
1411
|
const handleChange = (e) => {
|
|
@@ -1405,7 +1466,7 @@ function BiampTableToolbarSearch({
|
|
|
1405
1466
|
}
|
|
1406
1467
|
);
|
|
1407
1468
|
if (expandable) {
|
|
1408
|
-
return /* @__PURE__ */ jsxs9(
|
|
1469
|
+
return /* @__PURE__ */ jsxs9(Box8, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
1409
1470
|
/* @__PURE__ */ jsx18(
|
|
1410
1471
|
IconButton4,
|
|
1411
1472
|
{
|