@bwp-web/components 0.11.3 → 0.11.4
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.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 +238 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +244 -188
- 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";
|
|
@@ -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 },
|
|
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,19 +1082,25 @@ 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
|
}
|
|
@@ -1059,7 +1110,7 @@ function BiampTablePagination({
|
|
|
1059
1110
|
return /* @__PURE__ */ jsx13(
|
|
1060
1111
|
TablePagination,
|
|
1061
1112
|
{
|
|
1062
|
-
component:
|
|
1113
|
+
component: "div",
|
|
1063
1114
|
count: stableCount,
|
|
1064
1115
|
page: table.getState().pagination.pageIndex,
|
|
1065
1116
|
rowsPerPage: table.getState().pagination.pageSize,
|
|
@@ -1072,6 +1123,8 @@ function BiampTablePagination({
|
|
|
1072
1123
|
showFirstButton: true,
|
|
1073
1124
|
showLastButton: true,
|
|
1074
1125
|
sx: {
|
|
1126
|
+
display: "flex",
|
|
1127
|
+
justifyContent: positionMap[position],
|
|
1075
1128
|
height: 40,
|
|
1076
1129
|
minHeight: 40,
|
|
1077
1130
|
"& .MuiToolbar-root": {
|
|
@@ -1086,7 +1139,7 @@ function BiampTablePagination({
|
|
|
1086
1139
|
}
|
|
1087
1140
|
|
|
1088
1141
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1089
|
-
import { Box as
|
|
1142
|
+
import { Box as Box5 } from "@mui/material";
|
|
1090
1143
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1091
1144
|
function BiampTableToolbar({
|
|
1092
1145
|
children,
|
|
@@ -1094,7 +1147,7 @@ function BiampTableToolbar({
|
|
|
1094
1147
|
...props
|
|
1095
1148
|
}) {
|
|
1096
1149
|
return /* @__PURE__ */ jsx14(
|
|
1097
|
-
|
|
1150
|
+
Box5,
|
|
1098
1151
|
{
|
|
1099
1152
|
role: "toolbar",
|
|
1100
1153
|
display: "flex",
|
|
@@ -1112,13 +1165,13 @@ function BiampTableToolbar({
|
|
|
1112
1165
|
}
|
|
1113
1166
|
|
|
1114
1167
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1115
|
-
import { Box as
|
|
1168
|
+
import { Box as Box6 } from "@mui/material";
|
|
1116
1169
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1117
1170
|
function BiampTableToolbarActions({
|
|
1118
1171
|
children,
|
|
1119
1172
|
...props
|
|
1120
1173
|
}) {
|
|
1121
|
-
return /* @__PURE__ */ jsx15(
|
|
1174
|
+
return /* @__PURE__ */ jsx15(Box6, { display: "flex", alignItems: "center", gap: 1, ml: "auto", ...props, children });
|
|
1122
1175
|
}
|
|
1123
1176
|
|
|
1124
1177
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
@@ -1147,7 +1200,7 @@ function BiampTableToolbarExport({
|
|
|
1147
1200
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1148
1201
|
import {
|
|
1149
1202
|
Badge as Badge2,
|
|
1150
|
-
Box as
|
|
1203
|
+
Box as Box7,
|
|
1151
1204
|
Button,
|
|
1152
1205
|
Divider as Divider2,
|
|
1153
1206
|
Drawer,
|
|
@@ -1199,16 +1252,16 @@ function BiampTableToolbarFilters({
|
|
|
1199
1252
|
...drawerProps?.PaperProps
|
|
1200
1253
|
},
|
|
1201
1254
|
children: /* @__PURE__ */ jsxs8(
|
|
1202
|
-
|
|
1255
|
+
Box7,
|
|
1203
1256
|
{
|
|
1204
1257
|
height: "100%",
|
|
1205
1258
|
display: "flex",
|
|
1206
1259
|
flexDirection: "column",
|
|
1207
1260
|
justifyContent: "space-between",
|
|
1208
1261
|
children: [
|
|
1209
|
-
/* @__PURE__ */ jsxs8(
|
|
1262
|
+
/* @__PURE__ */ jsxs8(Box7, { children: [
|
|
1210
1263
|
/* @__PURE__ */ jsxs8(
|
|
1211
|
-
|
|
1264
|
+
Box7,
|
|
1212
1265
|
{
|
|
1213
1266
|
display: "flex",
|
|
1214
1267
|
justifyContent: "space-between",
|
|
@@ -1241,7 +1294,7 @@ function BiampTableToolbarFilters({
|
|
|
1241
1294
|
),
|
|
1242
1295
|
/* @__PURE__ */ jsx17(Divider2, {}),
|
|
1243
1296
|
/* @__PURE__ */ jsx17(
|
|
1244
|
-
|
|
1297
|
+
Box7,
|
|
1245
1298
|
{
|
|
1246
1299
|
role: "group",
|
|
1247
1300
|
"aria-label": "Filter options",
|
|
@@ -1254,7 +1307,7 @@ function BiampTableToolbarFilters({
|
|
|
1254
1307
|
}
|
|
1255
1308
|
)
|
|
1256
1309
|
] }),
|
|
1257
|
-
/* @__PURE__ */ jsxs8(
|
|
1310
|
+
/* @__PURE__ */ jsxs8(Box7, { display: "flex", children: [
|
|
1258
1311
|
/* @__PURE__ */ jsx17(
|
|
1259
1312
|
Button,
|
|
1260
1313
|
{
|
|
@@ -1287,28 +1340,28 @@ function BiampTableToolbarFilters({
|
|
|
1287
1340
|
|
|
1288
1341
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1289
1342
|
import {
|
|
1290
|
-
Box as
|
|
1343
|
+
Box as Box8,
|
|
1291
1344
|
Collapse,
|
|
1292
1345
|
IconButton as IconButton4,
|
|
1293
1346
|
InputAdornment as InputAdornment2,
|
|
1294
1347
|
TextField as TextField2
|
|
1295
1348
|
} from "@mui/material";
|
|
1296
1349
|
import { CloseIcon as CloseIcon2, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
1297
|
-
import { useEffect as
|
|
1350
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1298
1351
|
|
|
1299
1352
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1300
|
-
import { useCallback, useEffect as
|
|
1353
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
1301
1354
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1302
1355
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1303
|
-
const timeoutRef =
|
|
1304
|
-
const callbackRef =
|
|
1356
|
+
const timeoutRef = useRef4(null);
|
|
1357
|
+
const callbackRef = useRef4(callback);
|
|
1305
1358
|
callbackRef.current = callback;
|
|
1306
|
-
|
|
1359
|
+
useEffect3(() => {
|
|
1307
1360
|
return () => {
|
|
1308
1361
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1309
1362
|
};
|
|
1310
1363
|
}, []);
|
|
1311
|
-
return
|
|
1364
|
+
return useCallback2(
|
|
1312
1365
|
(...args) => {
|
|
1313
1366
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1314
1367
|
timeoutRef.current = setTimeout(
|
|
@@ -1324,8 +1377,11 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
1324
1377
|
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1325
1378
|
var searchFieldSx = {
|
|
1326
1379
|
"& .MuiInputBase-root": {
|
|
1327
|
-
height:
|
|
1328
|
-
minHeight:
|
|
1380
|
+
height: "36px !important",
|
|
1381
|
+
minHeight: "36px !important"
|
|
1382
|
+
},
|
|
1383
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
1384
|
+
height: "36px !important"
|
|
1329
1385
|
}
|
|
1330
1386
|
};
|
|
1331
1387
|
function BiampTableToolbarSearch({
|
|
@@ -1344,7 +1400,7 @@ function BiampTableToolbarSearch({
|
|
|
1344
1400
|
const [inputValue, setInputValue] = useState4(defaultValue);
|
|
1345
1401
|
const [isExpanded, setIsExpanded] = useState4(false);
|
|
1346
1402
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
1347
|
-
|
|
1403
|
+
useEffect4(() => {
|
|
1348
1404
|
setInputValue(defaultValue);
|
|
1349
1405
|
}, [defaultValue]);
|
|
1350
1406
|
const handleChange = (e) => {
|
|
@@ -1405,7 +1461,7 @@ function BiampTableToolbarSearch({
|
|
|
1405
1461
|
}
|
|
1406
1462
|
);
|
|
1407
1463
|
if (expandable) {
|
|
1408
|
-
return /* @__PURE__ */ jsxs9(
|
|
1464
|
+
return /* @__PURE__ */ jsxs9(Box8, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
1409
1465
|
/* @__PURE__ */ jsx18(
|
|
1410
1466
|
IconButton4,
|
|
1411
1467
|
{
|