@bwp-web/components 1.3.1 → 1.4.0
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/README.md +52 -39
- package/dist/BiampHeader/BiampHeader.d.ts.map +1 -1
- package/dist/BiampSidebar/BiampSidebar.d.ts +8 -2
- package/dist/BiampSidebar/BiampSidebar.d.ts.map +1 -1
- package/dist/BiampTable/BiampTable.d.ts +5 -1
- package/dist/BiampTable/BiampTable.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts +5 -0
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts.map +1 -0
- package/dist/BiampTable/BiampTableRow.d.ts +28 -0
- package/dist/BiampTable/BiampTableRow.d.ts.map +1 -0
- package/dist/BiampTable/cellSx.d.ts +27 -0
- package/dist/BiampTable/cellSx.d.ts.map +1 -0
- package/dist/index.cjs +701 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +649 -327
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -421,37 +421,138 @@ function BiampWrapper({ children, sx, ...props }) {
|
|
|
421
421
|
import {
|
|
422
422
|
Box,
|
|
423
423
|
ListItemButton,
|
|
424
|
-
Stack as Stack2
|
|
424
|
+
Stack as Stack2,
|
|
425
|
+
Typography
|
|
425
426
|
} from "@mui/material";
|
|
426
|
-
import { BiampLogoIcon } from "@bwp-web/assets";
|
|
427
|
+
import { BiampLogoIcon, SquareRoundedArrowRightIcon } from "@bwp-web/assets";
|
|
428
|
+
import { createContext, useContext, useState } from "react";
|
|
427
429
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
430
|
+
var BiampSidebarContext = createContext({
|
|
431
|
+
expanded: false
|
|
432
|
+
});
|
|
428
433
|
function BiampSidebar({
|
|
429
434
|
children,
|
|
430
435
|
bottomLogoIcon,
|
|
436
|
+
bottomLogoText,
|
|
437
|
+
expandable = true,
|
|
438
|
+
expanded: expandedProp,
|
|
439
|
+
defaultExpanded = false,
|
|
440
|
+
onExpandedChange,
|
|
431
441
|
sx,
|
|
432
442
|
...props
|
|
433
443
|
}) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
444
|
+
const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);
|
|
445
|
+
const isControlled = expandedProp !== void 0;
|
|
446
|
+
const expanded = isControlled ? expandedProp : internalExpanded;
|
|
447
|
+
const toggleExpanded = () => {
|
|
448
|
+
const next = !expanded;
|
|
449
|
+
if (!isControlled) setInternalExpanded(next);
|
|
450
|
+
onExpandedChange?.(next);
|
|
451
|
+
};
|
|
452
|
+
const width = expanded ? "240px" : "48px";
|
|
453
|
+
return /* @__PURE__ */ jsx2(BiampSidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ jsxs(
|
|
454
|
+
Stack2,
|
|
455
|
+
{
|
|
456
|
+
sx: {
|
|
457
|
+
width,
|
|
458
|
+
minWidth: width,
|
|
459
|
+
height: "100%",
|
|
460
|
+
overflowX: "hidden",
|
|
461
|
+
transition: ({ transitions }) => transitions.create(["width", "min-width"], {
|
|
462
|
+
easing: transitions.easing.sharp,
|
|
463
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
464
|
+
}),
|
|
465
|
+
...sx
|
|
466
|
+
},
|
|
467
|
+
...props,
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx2(Stack2, { sx: { flex: 1, minHeight: 0 }, children }),
|
|
470
|
+
expandable && /* @__PURE__ */ jsx2(
|
|
471
|
+
BiampSidebarIcon,
|
|
472
|
+
{
|
|
473
|
+
icon: /* @__PURE__ */ jsx2(
|
|
474
|
+
SquareRoundedArrowRightIcon,
|
|
475
|
+
{
|
|
476
|
+
sx: {
|
|
477
|
+
transform: expanded ? "rotate(180deg)" : "none",
|
|
478
|
+
transition: ({ transitions }) => transitions.create("transform", {
|
|
479
|
+
duration: transitions.duration.shorter
|
|
480
|
+
})
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
name: "Collapse menu",
|
|
485
|
+
onClick: toggleExpanded
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
/* @__PURE__ */ jsxs(
|
|
489
|
+
Stack2,
|
|
490
|
+
{
|
|
491
|
+
direction: "row",
|
|
492
|
+
alignItems: "center",
|
|
493
|
+
justifyContent: "space-between",
|
|
494
|
+
sx: { mt: 2, overflow: "hidden" },
|
|
495
|
+
children: [
|
|
496
|
+
bottomLogoIcon ?? /* @__PURE__ */ jsx2(
|
|
497
|
+
BiampLogoIcon,
|
|
498
|
+
{
|
|
499
|
+
sx: { width: "48px", height: "15px", flexShrink: 0 }
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
bottomLogoText && /* @__PURE__ */ jsx2(
|
|
503
|
+
Typography,
|
|
504
|
+
{
|
|
505
|
+
variant: "caption",
|
|
506
|
+
fontWeight: 500,
|
|
507
|
+
color: "sidebar.main",
|
|
508
|
+
noWrap: true,
|
|
509
|
+
sx: {
|
|
510
|
+
opacity: expanded ? 1 : 0,
|
|
511
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
512
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
513
|
+
})
|
|
514
|
+
},
|
|
515
|
+
children: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} ${bottomLogoText}`
|
|
516
|
+
}
|
|
517
|
+
)
|
|
518
|
+
]
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
) });
|
|
438
524
|
}
|
|
439
525
|
function BiampSidebarIconList({
|
|
440
526
|
children,
|
|
441
527
|
sx,
|
|
442
528
|
...props
|
|
443
529
|
}) {
|
|
444
|
-
return /* @__PURE__ */ jsx2(
|
|
530
|
+
return /* @__PURE__ */ jsx2(
|
|
531
|
+
Stack2,
|
|
532
|
+
{
|
|
533
|
+
sx: {
|
|
534
|
+
flex: 1,
|
|
535
|
+
minHeight: 0,
|
|
536
|
+
gap: "4px",
|
|
537
|
+
overflowY: "auto",
|
|
538
|
+
...sx
|
|
539
|
+
},
|
|
540
|
+
...props,
|
|
541
|
+
children
|
|
542
|
+
}
|
|
543
|
+
);
|
|
445
544
|
}
|
|
446
545
|
function BiampSidebarIcon({
|
|
447
546
|
selected,
|
|
448
547
|
icon,
|
|
449
548
|
selectedIcon,
|
|
549
|
+
name,
|
|
450
550
|
sx,
|
|
451
551
|
...props
|
|
452
552
|
}) {
|
|
553
|
+
const { expanded } = useContext(BiampSidebarContext);
|
|
453
554
|
const displayedSelectedIcon = selectedIcon ?? icon;
|
|
454
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ jsxs(
|
|
455
556
|
ListItemButton,
|
|
456
557
|
{
|
|
457
558
|
selected,
|
|
@@ -459,16 +560,50 @@ function BiampSidebarIcon({
|
|
|
459
560
|
disableRipple: true,
|
|
460
561
|
sx: {
|
|
461
562
|
minWidth: "48px",
|
|
462
|
-
maxWidth: "48px",
|
|
463
563
|
minHeight: "48px",
|
|
464
564
|
maxHeight: "48px",
|
|
465
565
|
borderRadius: "8px",
|
|
466
|
-
justifyContent: "
|
|
566
|
+
justifyContent: "flex-start",
|
|
467
567
|
alignItems: "center",
|
|
568
|
+
padding: 0,
|
|
569
|
+
overflow: "hidden",
|
|
570
|
+
color: "text.secondary",
|
|
468
571
|
...sx
|
|
469
572
|
},
|
|
470
573
|
...props,
|
|
471
|
-
children:
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx2(
|
|
576
|
+
Box,
|
|
577
|
+
{
|
|
578
|
+
sx: {
|
|
579
|
+
width: "48px",
|
|
580
|
+
height: "48px",
|
|
581
|
+
display: "flex",
|
|
582
|
+
alignItems: "center",
|
|
583
|
+
justifyContent: "center",
|
|
584
|
+
flexShrink: 0
|
|
585
|
+
},
|
|
586
|
+
children: selected ? displayedSelectedIcon : icon
|
|
587
|
+
}
|
|
588
|
+
),
|
|
589
|
+
name && /* @__PURE__ */ jsx2(
|
|
590
|
+
Typography,
|
|
591
|
+
{
|
|
592
|
+
variant: "body1",
|
|
593
|
+
fontWeight: 600,
|
|
594
|
+
color: "inherit",
|
|
595
|
+
noWrap: true,
|
|
596
|
+
sx: {
|
|
597
|
+
pr: 2,
|
|
598
|
+
opacity: expanded ? 1 : 0,
|
|
599
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
600
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
601
|
+
})
|
|
602
|
+
},
|
|
603
|
+
children: name
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
]
|
|
472
607
|
}
|
|
473
608
|
);
|
|
474
609
|
}
|
|
@@ -507,8 +642,9 @@ import {
|
|
|
507
642
|
Popover,
|
|
508
643
|
Stack as Stack3,
|
|
509
644
|
TextField,
|
|
510
|
-
Typography
|
|
645
|
+
Typography as Typography2
|
|
511
646
|
} from "@mui/material";
|
|
647
|
+
import { Children } from "react";
|
|
512
648
|
import { BiampRedLogo, ExternalLinkIcon, SearchIcon } from "@bwp-web/assets";
|
|
513
649
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
514
650
|
function BiampHeader({ children, sx, ...props }) {
|
|
@@ -558,8 +694,8 @@ function BiampHeaderTitle({
|
|
|
558
694
|
}
|
|
559
695
|
),
|
|
560
696
|
/* @__PURE__ */ jsxs2(Stack3, { direction: "row", gap: 0.5, children: [
|
|
561
|
-
title && /* @__PURE__ */ jsx3(
|
|
562
|
-
subtitle && /* @__PURE__ */ jsx3(
|
|
697
|
+
title && /* @__PURE__ */ jsx3(Typography2, { variant: "h4", children: title }),
|
|
698
|
+
subtitle && /* @__PURE__ */ jsx3(Typography2, { variant: "h4", color: "text.secondary", children: subtitle })
|
|
563
699
|
] })
|
|
564
700
|
]
|
|
565
701
|
}
|
|
@@ -739,8 +875,8 @@ function BiampBuildAppContentItem({
|
|
|
739
875
|
...props,
|
|
740
876
|
children: [
|
|
741
877
|
/* @__PURE__ */ jsx3(Box2, { sx: { width: 54, height: 54 }, mb: 0.5, children: image }),
|
|
742
|
-
/* @__PURE__ */ jsx3(
|
|
743
|
-
/* @__PURE__ */ jsx3(
|
|
878
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", fontWeight: 600, mb: 0.5, children: name }),
|
|
879
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", color: "text.secondary", children: description }),
|
|
744
880
|
button && /* @__PURE__ */ jsx3(Box2, { position: "absolute", top: "12px", right: "12px", children: button })
|
|
745
881
|
]
|
|
746
882
|
}
|
|
@@ -751,12 +887,17 @@ function BiampEndUserAppContent({
|
|
|
751
887
|
sx,
|
|
752
888
|
...props
|
|
753
889
|
}) {
|
|
890
|
+
const isGrid = Children.count(children) > 1;
|
|
754
891
|
return /* @__PURE__ */ jsx3(
|
|
755
892
|
Stack3,
|
|
756
893
|
{
|
|
757
894
|
direction: "column",
|
|
758
895
|
sx: {
|
|
759
896
|
gap: 1.5,
|
|
897
|
+
...isGrid && {
|
|
898
|
+
display: "grid",
|
|
899
|
+
gridTemplateColumns: "1fr 1fr"
|
|
900
|
+
},
|
|
760
901
|
...sx
|
|
761
902
|
},
|
|
762
903
|
...props,
|
|
@@ -797,8 +938,8 @@ function BiampEndUserAppContentItem({
|
|
|
797
938
|
children: [
|
|
798
939
|
/* @__PURE__ */ jsx3(Box2, { sx: { width: 32, height: 32 }, children: image }),
|
|
799
940
|
/* @__PURE__ */ jsxs2(Stack3, { direction: "column", children: [
|
|
800
|
-
/* @__PURE__ */ jsx3(
|
|
801
|
-
/* @__PURE__ */ jsx3(
|
|
941
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", fontWeight: 600, children: name }),
|
|
942
|
+
/* @__PURE__ */ jsx3(Typography2, { variant: "caption", color: "text.secondary", children: description })
|
|
802
943
|
] }),
|
|
803
944
|
/* @__PURE__ */ jsx3(ExternalLinkIcon, { sx: { width: 16, height: 16, ml: "auto" } })
|
|
804
945
|
]
|
|
@@ -892,33 +1033,30 @@ function BiampLayout({
|
|
|
892
1033
|
|
|
893
1034
|
// src/BiampTable/BiampTable.tsx
|
|
894
1035
|
import {
|
|
895
|
-
Box as
|
|
896
|
-
Checkbox,
|
|
897
|
-
IconButton,
|
|
1036
|
+
Box as Box6,
|
|
1037
|
+
Checkbox as Checkbox2,
|
|
898
1038
|
Table as MuiTable,
|
|
899
1039
|
TableBody,
|
|
900
|
-
TableCell,
|
|
1040
|
+
TableCell as TableCell2,
|
|
901
1041
|
TableContainer,
|
|
902
1042
|
TableHead,
|
|
903
|
-
TableRow,
|
|
1043
|
+
TableRow as TableRow2,
|
|
904
1044
|
TableSortLabel
|
|
905
1045
|
} from "@mui/material";
|
|
906
1046
|
import {
|
|
907
|
-
ChevronDownIcon,
|
|
908
|
-
ChevronRightIcon,
|
|
909
1047
|
DropdownChevronDownIcon,
|
|
910
1048
|
DropdownChevronUpIcon
|
|
911
1049
|
} from "@bwp-web/assets";
|
|
912
1050
|
import {
|
|
913
|
-
flexRender
|
|
1051
|
+
flexRender as flexRender2
|
|
914
1052
|
} from "@tanstack/react-table";
|
|
915
|
-
import
|
|
1053
|
+
import { useEffect as useEffect2, useRef as useRef3 } from "react";
|
|
916
1054
|
|
|
917
1055
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
918
1056
|
import { NoResultsIcon } from "@bwp-web/assets";
|
|
919
1057
|
|
|
920
1058
|
// src/BiampTable/BiampTableStatusMessage.tsx
|
|
921
|
-
import { Stack as Stack5, Typography as
|
|
1059
|
+
import { Stack as Stack5, Typography as Typography3 } from "@mui/material";
|
|
922
1060
|
import { cloneElement } from "react";
|
|
923
1061
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
924
1062
|
function BiampTableStatusMessage({
|
|
@@ -933,8 +1071,8 @@ function BiampTableStatusMessage({
|
|
|
933
1071
|
"aria-hidden": true,
|
|
934
1072
|
sx: { width: 56, height: 56, ...icon.props.sx }
|
|
935
1073
|
}),
|
|
936
|
-
/* @__PURE__ */ jsx4(
|
|
937
|
-
description && /* @__PURE__ */ jsx4(
|
|
1074
|
+
/* @__PURE__ */ jsx4(Typography3, { variant: "h2", children: title }),
|
|
1075
|
+
description && /* @__PURE__ */ jsx4(Typography3, { variant: "body1", children: description }),
|
|
938
1076
|
children
|
|
939
1077
|
] });
|
|
940
1078
|
}
|
|
@@ -968,15 +1106,27 @@ function BiampTableErrorState({
|
|
|
968
1106
|
return /* @__PURE__ */ jsx6(BiampTableStatusMessage, { role: "alert", icon, title, ...rest });
|
|
969
1107
|
}
|
|
970
1108
|
|
|
1109
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1110
|
+
import {
|
|
1111
|
+
Box as Box5,
|
|
1112
|
+
Checkbox,
|
|
1113
|
+
IconButton,
|
|
1114
|
+
TableCell,
|
|
1115
|
+
TableRow
|
|
1116
|
+
} from "@mui/material";
|
|
1117
|
+
import { ChevronDownIcon, ChevronRightIcon } from "@bwp-web/assets";
|
|
1118
|
+
import { flexRender } from "@tanstack/react-table";
|
|
1119
|
+
import React2 from "react";
|
|
1120
|
+
|
|
971
1121
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
972
1122
|
import { Box as Box3, Tooltip } from "@mui/material";
|
|
973
|
-
import { useCallback, useRef, useState } from "react";
|
|
1123
|
+
import { useCallback, useRef, useState as useState2 } from "react";
|
|
974
1124
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
975
1125
|
function BiampTableTruncatedCell({
|
|
976
1126
|
children
|
|
977
1127
|
}) {
|
|
978
1128
|
const textRef = useRef(null);
|
|
979
|
-
const [open, setOpen] =
|
|
1129
|
+
const [open, setOpen] = useState2(false);
|
|
980
1130
|
const handleMouseEnter = useCallback(() => {
|
|
981
1131
|
const el = textRef.current;
|
|
982
1132
|
if (el && el.scrollWidth > el.clientWidth) {
|
|
@@ -1014,37 +1164,6 @@ function BiampTableTruncatedCell({
|
|
|
1014
1164
|
);
|
|
1015
1165
|
}
|
|
1016
1166
|
|
|
1017
|
-
// src/BiampTable/useLoadingDelay.ts
|
|
1018
|
-
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
1019
|
-
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1020
|
-
const [status, setStatus] = useState2("idle");
|
|
1021
|
-
const timeoutRef = useRef2(null);
|
|
1022
|
-
function clearPending() {
|
|
1023
|
-
if (timeoutRef.current !== null) {
|
|
1024
|
-
clearTimeout(timeoutRef.current);
|
|
1025
|
-
timeoutRef.current = null;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
useEffect(() => {
|
|
1029
|
-
if (loading && status === "idle") {
|
|
1030
|
-
clearPending();
|
|
1031
|
-
timeoutRef.current = setTimeout(() => {
|
|
1032
|
-
timeoutRef.current = setTimeout(() => {
|
|
1033
|
-
setStatus("ending");
|
|
1034
|
-
}, minDuration);
|
|
1035
|
-
setStatus("loading");
|
|
1036
|
-
}, delay);
|
|
1037
|
-
setStatus("delaying");
|
|
1038
|
-
}
|
|
1039
|
-
if (!loading && status !== "loading") {
|
|
1040
|
-
clearPending();
|
|
1041
|
-
setStatus("idle");
|
|
1042
|
-
}
|
|
1043
|
-
}, [loading, delay, minDuration, status]);
|
|
1044
|
-
useEffect(() => clearPending, []);
|
|
1045
|
-
return status === "loading" || status === "ending";
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
1167
|
// src/BiampTable/slotProps.ts
|
|
1049
1168
|
function resolveSlot(slot, ctx) {
|
|
1050
1169
|
if (!slot) return void 0;
|
|
@@ -1054,19 +1173,7 @@ function mergeSx(...inputs) {
|
|
|
1054
1173
|
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
1055
1174
|
}
|
|
1056
1175
|
|
|
1057
|
-
// src/BiampTable/
|
|
1058
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1059
|
-
var overlaySx = {
|
|
1060
|
-
position: "absolute",
|
|
1061
|
-
top: 0,
|
|
1062
|
-
left: 0,
|
|
1063
|
-
right: 0,
|
|
1064
|
-
bottom: 0,
|
|
1065
|
-
display: "flex",
|
|
1066
|
-
alignItems: "center",
|
|
1067
|
-
justifyContent: "center",
|
|
1068
|
-
pointerEvents: "none"
|
|
1069
|
-
};
|
|
1176
|
+
// src/BiampTable/cellSx.ts
|
|
1070
1177
|
var stickyHoverBg = {
|
|
1071
1178
|
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
1072
1179
|
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
@@ -1092,6 +1199,126 @@ function cellSx(sticky, minWidth, zIndex) {
|
|
|
1092
1199
|
"&:has([data-truncate])": { maxWidth: mw, whiteSpace: "normal" }
|
|
1093
1200
|
};
|
|
1094
1201
|
}
|
|
1202
|
+
|
|
1203
|
+
// src/BiampTable/BiampTableExpandGuidelines.tsx
|
|
1204
|
+
import { Box as Box4 } from "@mui/material";
|
|
1205
|
+
import { Fragment, jsx as jsx8 } from "react/jsx-runtime";
|
|
1206
|
+
var guidelineIndent = 28;
|
|
1207
|
+
var guidelineCellPaddingLeft = 12;
|
|
1208
|
+
var guidelineLineOffsetFromParentText = 4;
|
|
1209
|
+
var guidelineElbowGapToChildText = 12;
|
|
1210
|
+
var guidelineFirstChildTopExtension = 12;
|
|
1211
|
+
var guidelineColor = ({ palette }) => palette.dividers.secondary;
|
|
1212
|
+
var guidelineStroke = "0.6px";
|
|
1213
|
+
function isLastChildOfParent(row) {
|
|
1214
|
+
const parent = row.getParentRow();
|
|
1215
|
+
if (!parent) return false;
|
|
1216
|
+
const siblings = parent.subRows;
|
|
1217
|
+
return siblings[siblings.length - 1]?.id === row.id;
|
|
1218
|
+
}
|
|
1219
|
+
function isFirstChildOfParent(row) {
|
|
1220
|
+
const parent = row.getParentRow();
|
|
1221
|
+
if (!parent) return false;
|
|
1222
|
+
return parent.subRows[0]?.id === row.id;
|
|
1223
|
+
}
|
|
1224
|
+
function getAncestorAtDepth(row, targetDepth) {
|
|
1225
|
+
let current = row;
|
|
1226
|
+
while (current && current.depth > targetDepth) {
|
|
1227
|
+
current = current.getParentRow();
|
|
1228
|
+
}
|
|
1229
|
+
return current && current.depth === targetDepth ? current : void 0;
|
|
1230
|
+
}
|
|
1231
|
+
function ExpandGuidelines({ row }) {
|
|
1232
|
+
const verticalX = (k) => guidelineCellPaddingLeft + (k - 1) * guidelineIndent + guidelineLineOffsetFromParentText;
|
|
1233
|
+
const elbowEnd = guidelineCellPaddingLeft + row.depth * guidelineIndent - guidelineElbowGapToChildText;
|
|
1234
|
+
const lines = [];
|
|
1235
|
+
for (let k = 1; k < row.depth; k++) {
|
|
1236
|
+
const ancestor = getAncestorAtDepth(row, k);
|
|
1237
|
+
if (!ancestor || isLastChildOfParent(ancestor)) continue;
|
|
1238
|
+
lines.push(
|
|
1239
|
+
/* @__PURE__ */ jsx8(
|
|
1240
|
+
Box4,
|
|
1241
|
+
{
|
|
1242
|
+
"aria-hidden": true,
|
|
1243
|
+
sx: {
|
|
1244
|
+
position: "absolute",
|
|
1245
|
+
left: `${verticalX(k)}px`,
|
|
1246
|
+
top: 0,
|
|
1247
|
+
bottom: 0,
|
|
1248
|
+
width: guidelineStroke,
|
|
1249
|
+
bgcolor: guidelineColor,
|
|
1250
|
+
pointerEvents: "none"
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
`v-${k}`
|
|
1254
|
+
)
|
|
1255
|
+
);
|
|
1256
|
+
}
|
|
1257
|
+
const elbowX = verticalX(row.depth);
|
|
1258
|
+
const rowIsLast = isLastChildOfParent(row);
|
|
1259
|
+
const rowIsFirst = isFirstChildOfParent(row);
|
|
1260
|
+
const elbowTopOffset = rowIsFirst ? -guidelineFirstChildTopExtension : 0;
|
|
1261
|
+
lines.push(
|
|
1262
|
+
/* @__PURE__ */ jsx8(
|
|
1263
|
+
Box4,
|
|
1264
|
+
{
|
|
1265
|
+
"aria-hidden": true,
|
|
1266
|
+
sx: {
|
|
1267
|
+
position: "absolute",
|
|
1268
|
+
left: `${elbowX}px`,
|
|
1269
|
+
top: `${elbowTopOffset}px`,
|
|
1270
|
+
height: `calc(50% - ${elbowTopOffset}px)`,
|
|
1271
|
+
width: guidelineStroke,
|
|
1272
|
+
bgcolor: guidelineColor,
|
|
1273
|
+
pointerEvents: "none"
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
"v-elbow-top"
|
|
1277
|
+
)
|
|
1278
|
+
);
|
|
1279
|
+
if (!rowIsLast) {
|
|
1280
|
+
lines.push(
|
|
1281
|
+
/* @__PURE__ */ jsx8(
|
|
1282
|
+
Box4,
|
|
1283
|
+
{
|
|
1284
|
+
"aria-hidden": true,
|
|
1285
|
+
sx: {
|
|
1286
|
+
position: "absolute",
|
|
1287
|
+
left: `${elbowX}px`,
|
|
1288
|
+
top: "50%",
|
|
1289
|
+
bottom: 0,
|
|
1290
|
+
width: guidelineStroke,
|
|
1291
|
+
bgcolor: guidelineColor,
|
|
1292
|
+
pointerEvents: "none"
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
"v-elbow-bottom"
|
|
1296
|
+
)
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
lines.push(
|
|
1300
|
+
/* @__PURE__ */ jsx8(
|
|
1301
|
+
Box4,
|
|
1302
|
+
{
|
|
1303
|
+
"aria-hidden": true,
|
|
1304
|
+
sx: {
|
|
1305
|
+
position: "absolute",
|
|
1306
|
+
left: `${elbowX}px`,
|
|
1307
|
+
top: "50%",
|
|
1308
|
+
width: `${elbowEnd - elbowX}px`,
|
|
1309
|
+
height: guidelineStroke,
|
|
1310
|
+
bgcolor: guidelineColor,
|
|
1311
|
+
pointerEvents: "none"
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
"h-elbow"
|
|
1315
|
+
)
|
|
1316
|
+
);
|
|
1317
|
+
return /* @__PURE__ */ jsx8(Fragment, { children: lines });
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1321
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1095
1322
|
var rowCursorPointerSx = { cursor: "pointer" };
|
|
1096
1323
|
var selectionCellSx = {
|
|
1097
1324
|
position: "sticky",
|
|
@@ -1107,13 +1334,80 @@ var expandCellBaseSx = {
|
|
|
1107
1334
|
gap: "2px"
|
|
1108
1335
|
};
|
|
1109
1336
|
var expandPlaceholderSx = { width: 28 };
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1337
|
+
function ExpandToggle({
|
|
1338
|
+
row,
|
|
1339
|
+
isExpanded,
|
|
1340
|
+
hasExpandableRows,
|
|
1341
|
+
rowLabel
|
|
1342
|
+
}) {
|
|
1343
|
+
if (row.getCanExpand()) {
|
|
1344
|
+
return /* @__PURE__ */ jsx9(
|
|
1345
|
+
IconButton,
|
|
1346
|
+
{
|
|
1347
|
+
variant: "none",
|
|
1348
|
+
onClick: (e) => {
|
|
1349
|
+
e.stopPropagation();
|
|
1350
|
+
row.toggleExpanded();
|
|
1351
|
+
},
|
|
1352
|
+
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1353
|
+
"aria-expanded": isExpanded,
|
|
1354
|
+
children: isExpanded ? /* @__PURE__ */ jsx9(
|
|
1355
|
+
ChevronDownIcon,
|
|
1356
|
+
{
|
|
1357
|
+
variant: "xs",
|
|
1358
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1359
|
+
}
|
|
1360
|
+
) : /* @__PURE__ */ jsx9(
|
|
1361
|
+
ChevronRightIcon,
|
|
1362
|
+
{
|
|
1363
|
+
variant: "xs",
|
|
1364
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
}
|
|
1370
|
+
if (hasExpandableRows) return /* @__PURE__ */ jsx9(Box5, { sx: expandPlaceholderSx });
|
|
1371
|
+
return null;
|
|
1372
|
+
}
|
|
1373
|
+
function renderCellContent({
|
|
1374
|
+
cell,
|
|
1375
|
+
row,
|
|
1376
|
+
isExpandCell,
|
|
1377
|
+
alwaysExpanded,
|
|
1378
|
+
isExpanded,
|
|
1379
|
+
hasExpandableRows,
|
|
1380
|
+
getRowLabel
|
|
1381
|
+
}) {
|
|
1382
|
+
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1383
|
+
const content = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
1384
|
+
if (sticky) return content;
|
|
1385
|
+
const truncate = cell.column.columnDef.meta?.truncate ?? true;
|
|
1386
|
+
const truncated = truncate ? /* @__PURE__ */ jsx9(BiampTableTruncatedCell, { children: content }) : content;
|
|
1387
|
+
if (!isExpandCell) return truncated;
|
|
1388
|
+
if (alwaysExpanded) {
|
|
1389
|
+
return row.depth > 0 ? /* @__PURE__ */ jsx9(Box5, { sx: { pl: `${row.depth * 28}px` }, children: truncated }) : truncated;
|
|
1390
|
+
}
|
|
1391
|
+
const rowLabel = getRowLabel ? getRowLabel(row.original) : `row ${row.index + 1}`;
|
|
1392
|
+
return /* @__PURE__ */ jsxs5(
|
|
1393
|
+
Box5,
|
|
1394
|
+
{
|
|
1395
|
+
sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
|
|
1396
|
+
children: [
|
|
1397
|
+
/* @__PURE__ */ jsx9(
|
|
1398
|
+
ExpandToggle,
|
|
1399
|
+
{
|
|
1400
|
+
row,
|
|
1401
|
+
isExpanded,
|
|
1402
|
+
hasExpandableRows,
|
|
1403
|
+
rowLabel
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
truncated
|
|
1407
|
+
]
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1117
1411
|
function BiampTableRowInner({
|
|
1118
1412
|
row,
|
|
1119
1413
|
isExpanded,
|
|
@@ -1122,7 +1416,9 @@ function BiampTableRowInner({
|
|
|
1122
1416
|
isRowClickable,
|
|
1123
1417
|
enableRowSelection,
|
|
1124
1418
|
enableExpanding,
|
|
1419
|
+
alwaysExpanded,
|
|
1125
1420
|
selectChildrenWithParent,
|
|
1421
|
+
showExpandGuidelines,
|
|
1126
1422
|
getRowLabel,
|
|
1127
1423
|
hasExpandableRows,
|
|
1128
1424
|
customColor,
|
|
@@ -1162,7 +1458,7 @@ function BiampTableRowInner({
|
|
|
1162
1458
|
userRowOnKeyDown?.(e);
|
|
1163
1459
|
} : userRowOnKeyDown,
|
|
1164
1460
|
children: [
|
|
1165
|
-
enableRowSelection && /* @__PURE__ */
|
|
1461
|
+
enableRowSelection && /* @__PURE__ */ jsx9(
|
|
1166
1462
|
TableCell,
|
|
1167
1463
|
{
|
|
1168
1464
|
padding: "checkbox",
|
|
@@ -1170,7 +1466,7 @@ function BiampTableRowInner({
|
|
|
1170
1466
|
selectionCellSx,
|
|
1171
1467
|
customColor ? { backgroundColor: customColor } : void 0
|
|
1172
1468
|
),
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1469
|
+
children: /* @__PURE__ */ jsx9(
|
|
1174
1470
|
Checkbox,
|
|
1175
1471
|
{
|
|
1176
1472
|
checked: isSelected,
|
|
@@ -1192,68 +1488,33 @@ function BiampTableRowInner({
|
|
|
1192
1488
|
row.getVisibleCells().map((cell, cellIndex, cells) => {
|
|
1193
1489
|
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1194
1490
|
const isExpandCell = enableExpanding && !sticky && cellIndex === cells.findIndex((c) => !c.column.columnDef.meta?.sticky);
|
|
1195
|
-
const
|
|
1196
|
-
cell.column.columnDef.cell,
|
|
1197
|
-
cell.getContext()
|
|
1198
|
-
);
|
|
1491
|
+
const showGuidelinesOnCell = isExpandCell && showExpandGuidelines && alwaysExpanded && row.depth > 0;
|
|
1199
1492
|
const resolvedCell = resolveSlot(cellSlotProps, { cell });
|
|
1200
1493
|
const { sx: userCellSx, ...restCellProps } = resolvedCell ?? {};
|
|
1201
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ jsxs5(
|
|
1202
1495
|
TableCell,
|
|
1203
1496
|
{
|
|
1204
1497
|
...restCellProps,
|
|
1205
1498
|
"data-sticky": sticky || void 0,
|
|
1206
1499
|
sx: mergeSx(
|
|
1207
1500
|
cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
1208
|
-
{ pl: isExpandCell ? "6px" : "12px" },
|
|
1501
|
+
{ pl: isExpandCell && !alwaysExpanded ? "6px" : "12px" },
|
|
1502
|
+
showGuidelinesOnCell ? { position: "relative" } : void 0,
|
|
1209
1503
|
sticky && customColor ? { backgroundColor: customColor } : void 0,
|
|
1210
1504
|
userCellSx
|
|
1211
1505
|
),
|
|
1212
|
-
children:
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
IconButton,
|
|
1225
|
-
{
|
|
1226
|
-
variant: "none",
|
|
1227
|
-
onClick: (e) => {
|
|
1228
|
-
e.stopPropagation();
|
|
1229
|
-
row.toggleExpanded();
|
|
1230
|
-
},
|
|
1231
|
-
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1232
|
-
"aria-expanded": isExpanded,
|
|
1233
|
-
children: isExpanded ? /* @__PURE__ */ jsx8(
|
|
1234
|
-
ChevronDownIcon,
|
|
1235
|
-
{
|
|
1236
|
-
variant: "xs",
|
|
1237
|
-
sx: {
|
|
1238
|
-
color: ({ palette }) => palette.text.secondary
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
) : /* @__PURE__ */ jsx8(
|
|
1242
|
-
ChevronRightIcon,
|
|
1243
|
-
{
|
|
1244
|
-
variant: "xs",
|
|
1245
|
-
sx: {
|
|
1246
|
-
color: ({ palette }) => palette.text.secondary
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
)
|
|
1250
|
-
}
|
|
1251
|
-
) : hasExpandableRows ? /* @__PURE__ */ jsx8(Box4, { sx: expandPlaceholderSx }) : null,
|
|
1252
|
-
truncated
|
|
1253
|
-
]
|
|
1254
|
-
}
|
|
1255
|
-
);
|
|
1256
|
-
})()
|
|
1506
|
+
children: [
|
|
1507
|
+
showGuidelinesOnCell && /* @__PURE__ */ jsx9(ExpandGuidelines, { row }),
|
|
1508
|
+
renderCellContent({
|
|
1509
|
+
cell,
|
|
1510
|
+
row,
|
|
1511
|
+
isExpandCell,
|
|
1512
|
+
alwaysExpanded,
|
|
1513
|
+
isExpanded,
|
|
1514
|
+
hasExpandableRows,
|
|
1515
|
+
getRowLabel
|
|
1516
|
+
})
|
|
1517
|
+
]
|
|
1257
1518
|
},
|
|
1258
1519
|
cell.id
|
|
1259
1520
|
);
|
|
@@ -1264,12 +1525,64 @@ function BiampTableRowInner({
|
|
|
1264
1525
|
);
|
|
1265
1526
|
}
|
|
1266
1527
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
1267
|
-
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel && prev.customColor === next.customColor && prev.rowSlotProps === next.rowSlotProps && prev.cellSlotProps === next.cellSlotProps;
|
|
1528
|
+
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.alwaysExpanded === next.alwaysExpanded && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.showExpandGuidelines === next.showExpandGuidelines && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel && prev.customColor === next.customColor && prev.rowSlotProps === next.rowSlotProps && prev.cellSlotProps === next.cellSlotProps;
|
|
1268
1529
|
}
|
|
1269
1530
|
var BiampTableRow = React2.memo(
|
|
1270
1531
|
BiampTableRowInner,
|
|
1271
1532
|
biampTableRowPropsAreEqual
|
|
1272
1533
|
);
|
|
1534
|
+
|
|
1535
|
+
// src/BiampTable/useLoadingDelay.ts
|
|
1536
|
+
import { useEffect, useRef as useRef2, useState as useState3 } from "react";
|
|
1537
|
+
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1538
|
+
const [status, setStatus] = useState3("idle");
|
|
1539
|
+
const timeoutRef = useRef2(null);
|
|
1540
|
+
function clearPending() {
|
|
1541
|
+
if (timeoutRef.current !== null) {
|
|
1542
|
+
clearTimeout(timeoutRef.current);
|
|
1543
|
+
timeoutRef.current = null;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
useEffect(() => {
|
|
1547
|
+
if (loading && status === "idle") {
|
|
1548
|
+
clearPending();
|
|
1549
|
+
timeoutRef.current = setTimeout(() => {
|
|
1550
|
+
timeoutRef.current = setTimeout(() => {
|
|
1551
|
+
setStatus("ending");
|
|
1552
|
+
}, minDuration);
|
|
1553
|
+
setStatus("loading");
|
|
1554
|
+
}, delay);
|
|
1555
|
+
setStatus("delaying");
|
|
1556
|
+
}
|
|
1557
|
+
if (!loading && status !== "loading") {
|
|
1558
|
+
clearPending();
|
|
1559
|
+
setStatus("idle");
|
|
1560
|
+
}
|
|
1561
|
+
}, [loading, delay, minDuration, status]);
|
|
1562
|
+
useEffect(() => clearPending, []);
|
|
1563
|
+
return status === "loading" || status === "ending";
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// src/BiampTable/BiampTable.tsx
|
|
1567
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1568
|
+
var overlaySx = {
|
|
1569
|
+
position: "absolute",
|
|
1570
|
+
top: 0,
|
|
1571
|
+
left: 0,
|
|
1572
|
+
right: 0,
|
|
1573
|
+
bottom: 0,
|
|
1574
|
+
display: "flex",
|
|
1575
|
+
alignItems: "center",
|
|
1576
|
+
justifyContent: "center",
|
|
1577
|
+
pointerEvents: "none"
|
|
1578
|
+
};
|
|
1579
|
+
var headerSelectionCellSx = {
|
|
1580
|
+
position: "sticky",
|
|
1581
|
+
left: 0,
|
|
1582
|
+
zIndex: 3,
|
|
1583
|
+
bgcolor: "background.paper"
|
|
1584
|
+
};
|
|
1585
|
+
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
1273
1586
|
function BiampTable({
|
|
1274
1587
|
table,
|
|
1275
1588
|
onRowClick,
|
|
@@ -1279,8 +1592,10 @@ function BiampTable({
|
|
|
1279
1592
|
empty,
|
|
1280
1593
|
enableRowSelection = false,
|
|
1281
1594
|
enableExpanding = false,
|
|
1595
|
+
alwaysExpanded = false,
|
|
1282
1596
|
hideSelectAll,
|
|
1283
1597
|
selectChildrenWithParent = false,
|
|
1598
|
+
showExpandGuidelines = false,
|
|
1284
1599
|
getRowLabel,
|
|
1285
1600
|
setRowColor,
|
|
1286
1601
|
slotProps,
|
|
@@ -1299,15 +1614,20 @@ function BiampTable({
|
|
|
1299
1614
|
enableRowSelection ? 48 : 0
|
|
1300
1615
|
);
|
|
1301
1616
|
const containerRef = useRef3(null);
|
|
1617
|
+
useEffect2(() => {
|
|
1618
|
+
if (enableExpanding && alwaysExpanded) {
|
|
1619
|
+
table.toggleAllRowsExpanded(true);
|
|
1620
|
+
}
|
|
1621
|
+
}, [enableExpanding, alwaysExpanded, table]);
|
|
1302
1622
|
const showLoading = useLoadingDelay(!!loading);
|
|
1303
1623
|
const rows = table.getRowModel().rows;
|
|
1304
1624
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
1305
1625
|
const showError = !!error && !loading;
|
|
1306
1626
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
1307
|
-
return /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ jsxs6(
|
|
1308
1628
|
TableContainer,
|
|
1309
1629
|
{
|
|
1310
|
-
component:
|
|
1630
|
+
component: Box6,
|
|
1311
1631
|
...boxProps,
|
|
1312
1632
|
ref: containerRef,
|
|
1313
1633
|
sx: {
|
|
@@ -1318,7 +1638,7 @@ function BiampTable({
|
|
|
1318
1638
|
...sx
|
|
1319
1639
|
},
|
|
1320
1640
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ jsxs6(
|
|
1322
1642
|
MuiTable,
|
|
1323
1643
|
{
|
|
1324
1644
|
"aria-busy": showLoading || void 0,
|
|
@@ -1328,14 +1648,14 @@ function BiampTable({
|
|
|
1328
1648
|
userTableSx
|
|
1329
1649
|
),
|
|
1330
1650
|
children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
|
|
1651
|
+
/* @__PURE__ */ jsx10(TableHead, { ...restHeadSlotProps, sx: mergeSx(userHeadSx), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs6(
|
|
1652
|
+
TableRow2,
|
|
1333
1653
|
{
|
|
1334
1654
|
...restHeaderRowSlotProps,
|
|
1335
1655
|
sx: mergeSx(userHeaderRowSx),
|
|
1336
1656
|
children: [
|
|
1337
|
-
enableRowSelection && /* @__PURE__ */
|
|
1338
|
-
|
|
1657
|
+
enableRowSelection && /* @__PURE__ */ jsx10(TableCell2, { padding: "checkbox", sx: headerSelectionCellSx, children: !hideSelectAll && /* @__PURE__ */ jsx10(
|
|
1658
|
+
Checkbox2,
|
|
1339
1659
|
{
|
|
1340
1660
|
checked: table.getIsAllPageRowsSelected(),
|
|
1341
1661
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
@@ -1350,8 +1670,8 @@ function BiampTable({
|
|
|
1350
1670
|
header
|
|
1351
1671
|
});
|
|
1352
1672
|
const { sx: userHeaderCellSx, ...restHeaderCellProps } = resolvedHeaderCell ?? {};
|
|
1353
|
-
return /* @__PURE__ */
|
|
1354
|
-
|
|
1673
|
+
return /* @__PURE__ */ jsx10(
|
|
1674
|
+
TableCell2,
|
|
1355
1675
|
{
|
|
1356
1676
|
...restHeaderCellProps,
|
|
1357
1677
|
"data-sticky": sticky || void 0,
|
|
@@ -1363,7 +1683,7 @@ function BiampTable({
|
|
|
1363
1683
|
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
1364
1684
|
userHeaderCellSx
|
|
1365
1685
|
),
|
|
1366
|
-
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */
|
|
1686
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsx10(
|
|
1367
1687
|
TableSortLabel,
|
|
1368
1688
|
{
|
|
1369
1689
|
active: !!header.column.getIsSorted(),
|
|
@@ -1372,12 +1692,12 @@ function BiampTable({
|
|
|
1372
1692
|
...header.column.getIsSorted() && {
|
|
1373
1693
|
IconComponent: header.column.getIsSorted() === "asc" ? DropdownChevronUpIcon : DropdownChevronDownIcon
|
|
1374
1694
|
},
|
|
1375
|
-
children:
|
|
1695
|
+
children: flexRender2(
|
|
1376
1696
|
header.column.columnDef.header,
|
|
1377
1697
|
header.getContext()
|
|
1378
1698
|
)
|
|
1379
1699
|
}
|
|
1380
|
-
) :
|
|
1700
|
+
) : flexRender2(
|
|
1381
1701
|
header.column.columnDef.header,
|
|
1382
1702
|
header.getContext()
|
|
1383
1703
|
)
|
|
@@ -1389,12 +1709,12 @@ function BiampTable({
|
|
|
1389
1709
|
},
|
|
1390
1710
|
headerGroup.id
|
|
1391
1711
|
)) }),
|
|
1392
|
-
/* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ jsx10(
|
|
1393
1713
|
TableBody,
|
|
1394
1714
|
{
|
|
1395
1715
|
...restBodySlotProps,
|
|
1396
1716
|
sx: mergeSx({ opacity: showLoading ? 0.3 : 1 }, userBodySx),
|
|
1397
|
-
children: !showError && rows.map((row) => /* @__PURE__ */
|
|
1717
|
+
children: !showError && rows.map((row) => /* @__PURE__ */ jsx10(
|
|
1398
1718
|
BiampTableRow,
|
|
1399
1719
|
{
|
|
1400
1720
|
row,
|
|
@@ -1404,7 +1724,9 @@ function BiampTable({
|
|
|
1404
1724
|
isRowClickable,
|
|
1405
1725
|
enableRowSelection,
|
|
1406
1726
|
enableExpanding,
|
|
1727
|
+
alwaysExpanded,
|
|
1407
1728
|
selectChildrenWithParent,
|
|
1729
|
+
showExpandGuidelines,
|
|
1408
1730
|
getRowLabel,
|
|
1409
1731
|
hasExpandableRows,
|
|
1410
1732
|
customColor: setRowColor?.(row.original),
|
|
@@ -1418,14 +1740,14 @@ function BiampTable({
|
|
|
1418
1740
|
]
|
|
1419
1741
|
}
|
|
1420
1742
|
),
|
|
1421
|
-
showError && /* @__PURE__ */
|
|
1743
|
+
showError && /* @__PURE__ */ jsx10(Box6, { sx: overlaySx, children: error === true ? /* @__PURE__ */ jsx10(BiampTableErrorState, { sx: { pointerEvents: "auto" } }) : error instanceof Error ? /* @__PURE__ */ jsx10(
|
|
1422
1744
|
BiampTableErrorState,
|
|
1423
1745
|
{
|
|
1424
1746
|
description: error.message,
|
|
1425
1747
|
sx: { pointerEvents: "auto" }
|
|
1426
1748
|
}
|
|
1427
1749
|
) : error }),
|
|
1428
|
-
showEmpty && /* @__PURE__ */
|
|
1750
|
+
showEmpty && /* @__PURE__ */ jsx10(Box6, { sx: overlaySx, children: empty && empty !== true ? empty : /* @__PURE__ */ jsx10(BiampTableEmptyState, { sx: { pointerEvents: "auto" } }) })
|
|
1429
1751
|
]
|
|
1430
1752
|
}
|
|
1431
1753
|
);
|
|
@@ -1433,7 +1755,7 @@ function BiampTable({
|
|
|
1433
1755
|
|
|
1434
1756
|
// src/BiampTable/BiampTableContainer.tsx
|
|
1435
1757
|
import { Stack as Stack6 } from "@mui/material";
|
|
1436
|
-
import { jsx as
|
|
1758
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1437
1759
|
function BiampTableContainer({
|
|
1438
1760
|
withBorderTop = true,
|
|
1439
1761
|
withBorderBottom = false,
|
|
@@ -1441,7 +1763,7 @@ function BiampTableContainer({
|
|
|
1441
1763
|
sx,
|
|
1442
1764
|
...props
|
|
1443
1765
|
}) {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ jsx11(
|
|
1445
1767
|
Stack6,
|
|
1446
1768
|
{
|
|
1447
1769
|
direction: "column",
|
|
@@ -1461,9 +1783,9 @@ function BiampTableContainer({
|
|
|
1461
1783
|
|
|
1462
1784
|
// src/BiampTable/BiampTableCellActionButton.tsx
|
|
1463
1785
|
import { IconButton as IconButton2, Tooltip as Tooltip2 } from "@mui/material";
|
|
1464
|
-
import { jsx as
|
|
1786
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1465
1787
|
function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
1466
|
-
return /* @__PURE__ */
|
|
1788
|
+
return /* @__PURE__ */ jsx12(
|
|
1467
1789
|
Tooltip2,
|
|
1468
1790
|
{
|
|
1469
1791
|
title: label,
|
|
@@ -1471,7 +1793,7 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
|
1471
1793
|
enterDelay: 500,
|
|
1472
1794
|
enterNextDelay: 500,
|
|
1473
1795
|
disableInteractive: true,
|
|
1474
|
-
children: /* @__PURE__ */
|
|
1796
|
+
children: /* @__PURE__ */ jsx12("span", { children: /* @__PURE__ */ jsx12(IconButton2, { "aria-label": label, ...props, children: icon }) })
|
|
1475
1797
|
}
|
|
1476
1798
|
);
|
|
1477
1799
|
}
|
|
@@ -1479,15 +1801,15 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
|
1479
1801
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
1480
1802
|
import {
|
|
1481
1803
|
alpha as alpha2,
|
|
1482
|
-
Box as
|
|
1483
|
-
Checkbox as
|
|
1804
|
+
Box as Box7,
|
|
1805
|
+
Checkbox as Checkbox3,
|
|
1484
1806
|
Divider,
|
|
1485
1807
|
List,
|
|
1486
1808
|
ListItem,
|
|
1487
1809
|
Popover as Popover2,
|
|
1488
|
-
Typography as
|
|
1810
|
+
Typography as Typography4
|
|
1489
1811
|
} from "@mui/material";
|
|
1490
|
-
import { jsx as
|
|
1812
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1491
1813
|
function toVisibilityState(visibility) {
|
|
1492
1814
|
return visibility;
|
|
1493
1815
|
}
|
|
@@ -1530,7 +1852,7 @@ function BiampTableColumnVisibility({
|
|
|
1530
1852
|
...popoverProps
|
|
1531
1853
|
}) {
|
|
1532
1854
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
1533
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ jsx13(
|
|
1534
1856
|
Popover2,
|
|
1535
1857
|
{
|
|
1536
1858
|
anchorEl,
|
|
@@ -1551,41 +1873,41 @@ function BiampTableColumnVisibility({
|
|
|
1551
1873
|
}
|
|
1552
1874
|
},
|
|
1553
1875
|
...popoverProps,
|
|
1554
|
-
children: /* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1876
|
+
children: /* @__PURE__ */ jsxs7(List, { dense: true, disablePadding: true, children: [
|
|
1877
|
+
/* @__PURE__ */ jsxs7(
|
|
1556
1878
|
ListItem,
|
|
1557
1879
|
{
|
|
1558
1880
|
dense: true,
|
|
1559
1881
|
sx: columnListItemSx,
|
|
1560
1882
|
onClick: () => table.toggleAllColumnsVisible(!allVisible),
|
|
1561
1883
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1884
|
+
/* @__PURE__ */ jsx13(
|
|
1885
|
+
Checkbox3,
|
|
1564
1886
|
{
|
|
1565
1887
|
checked: allVisible,
|
|
1566
1888
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1567
1889
|
}
|
|
1568
1890
|
),
|
|
1569
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsx13(Typography4, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1570
1892
|
]
|
|
1571
1893
|
}
|
|
1572
1894
|
),
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
|
|
1895
|
+
/* @__PURE__ */ jsx13(Divider, {}),
|
|
1896
|
+
/* @__PURE__ */ jsx13(
|
|
1897
|
+
Box7,
|
|
1576
1898
|
{
|
|
1577
1899
|
sx: { maxHeight: 340, overflow: "auto", overscrollBehavior: "none" },
|
|
1578
1900
|
children: table.getAllLeafColumns().map((column) => {
|
|
1579
1901
|
const columnName = column.columnDef.meta?.columnLabel ?? (typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ jsxs7(
|
|
1581
1903
|
ListItem,
|
|
1582
1904
|
{
|
|
1583
1905
|
dense: true,
|
|
1584
1906
|
sx: columnListItemSx,
|
|
1585
1907
|
onClick: column.getToggleVisibilityHandler(),
|
|
1586
1908
|
children: [
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
|
|
1909
|
+
/* @__PURE__ */ jsx13(
|
|
1910
|
+
Checkbox3,
|
|
1589
1911
|
{
|
|
1590
1912
|
checked: column.getIsVisible(),
|
|
1591
1913
|
sx: { py: 1 },
|
|
@@ -1594,7 +1916,7 @@ function BiampTableColumnVisibility({
|
|
|
1594
1916
|
}
|
|
1595
1917
|
}
|
|
1596
1918
|
),
|
|
1597
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsx13(Typography4, { variant: "caption", children: columnName })
|
|
1598
1920
|
]
|
|
1599
1921
|
},
|
|
1600
1922
|
column.id
|
|
@@ -1609,14 +1931,14 @@ function BiampTableColumnVisibility({
|
|
|
1609
1931
|
|
|
1610
1932
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1611
1933
|
import { ColumnsIcon } from "@bwp-web/assets";
|
|
1612
|
-
import { useState as
|
|
1934
|
+
import { useState as useState4 } from "react";
|
|
1613
1935
|
|
|
1614
1936
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
1615
1937
|
import {
|
|
1616
1938
|
Badge,
|
|
1617
1939
|
IconButton as IconButton3
|
|
1618
1940
|
} from "@mui/material";
|
|
1619
|
-
import { jsx as
|
|
1941
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1620
1942
|
function BiampTableToolbarActionButton({
|
|
1621
1943
|
label,
|
|
1622
1944
|
icon,
|
|
@@ -1624,12 +1946,12 @@ function BiampTableToolbarActionButton({
|
|
|
1624
1946
|
...props
|
|
1625
1947
|
}) {
|
|
1626
1948
|
const showBadge = badgeContent != null && badgeContent !== 0;
|
|
1627
|
-
return /* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ jsx14(
|
|
1628
1950
|
IconButton3,
|
|
1629
1951
|
{
|
|
1630
1952
|
"aria-label": showBadge ? `${label} (${badgeContent})` : label,
|
|
1631
1953
|
...props,
|
|
1632
|
-
children: showBadge ? /* @__PURE__ */
|
|
1954
|
+
children: showBadge ? /* @__PURE__ */ jsx14(
|
|
1633
1955
|
Badge,
|
|
1634
1956
|
{
|
|
1635
1957
|
badgeContent,
|
|
@@ -1653,20 +1975,20 @@ function BiampTableToolbarActionButton({
|
|
|
1653
1975
|
}
|
|
1654
1976
|
|
|
1655
1977
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1656
|
-
import { Fragment, jsx as
|
|
1978
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1657
1979
|
function BiampTableToolbarColumnVisibility({
|
|
1658
1980
|
table,
|
|
1659
|
-
icon = /* @__PURE__ */
|
|
1981
|
+
icon = /* @__PURE__ */ jsx15(ColumnsIcon, { variant: "xs" }),
|
|
1660
1982
|
label = "Columns",
|
|
1661
1983
|
defaultColumnVisibility,
|
|
1662
1984
|
showAllLabel,
|
|
1663
1985
|
...actionButtonProps
|
|
1664
1986
|
}) {
|
|
1665
|
-
const [anchorEl, setAnchorEl] =
|
|
1987
|
+
const [anchorEl, setAnchorEl] = useState4(null);
|
|
1666
1988
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1667
1989
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1668
|
-
return /* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1991
|
+
/* @__PURE__ */ jsx15(
|
|
1670
1992
|
BiampTableToolbarActionButton,
|
|
1671
1993
|
{
|
|
1672
1994
|
label,
|
|
@@ -1676,7 +1998,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1676
1998
|
...actionButtonProps
|
|
1677
1999
|
}
|
|
1678
2000
|
),
|
|
1679
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ jsx15(
|
|
1680
2002
|
BiampTableColumnVisibility,
|
|
1681
2003
|
{
|
|
1682
2004
|
table,
|
|
@@ -1689,9 +2011,9 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1689
2011
|
}
|
|
1690
2012
|
|
|
1691
2013
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1692
|
-
import { useEffect as
|
|
2014
|
+
import { useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
1693
2015
|
import { TablePagination } from "@mui/material";
|
|
1694
|
-
import { jsx as
|
|
2016
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1695
2017
|
var positionMap = {
|
|
1696
2018
|
left: "flex-start",
|
|
1697
2019
|
center: "center",
|
|
@@ -1714,13 +2036,13 @@ function BiampTablePagination({
|
|
|
1714
2036
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1715
2037
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1716
2038
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1717
|
-
|
|
2039
|
+
useEffect3(() => {
|
|
1718
2040
|
if (!loading && pageIndex > maxPage) {
|
|
1719
2041
|
table.setPageIndex(maxPage);
|
|
1720
2042
|
}
|
|
1721
2043
|
}, [loading, pageIndex, maxPage, table]);
|
|
1722
2044
|
if (autoHide && (!stableCount || stableCount <= pageSize)) return null;
|
|
1723
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ jsx16(
|
|
1724
2046
|
TablePagination,
|
|
1725
2047
|
{
|
|
1726
2048
|
component: "div",
|
|
@@ -1752,15 +2074,15 @@ function BiampTablePagination({
|
|
|
1752
2074
|
}
|
|
1753
2075
|
|
|
1754
2076
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1755
|
-
import { Box as
|
|
1756
|
-
import { jsx as
|
|
2077
|
+
import { Box as Box8 } from "@mui/material";
|
|
2078
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1757
2079
|
function BiampTableToolbar({
|
|
1758
2080
|
children,
|
|
1759
2081
|
sx,
|
|
1760
2082
|
...props
|
|
1761
2083
|
}) {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1763
|
-
|
|
2084
|
+
return /* @__PURE__ */ jsx17(
|
|
2085
|
+
Box8,
|
|
1764
2086
|
{
|
|
1765
2087
|
role: "toolbar",
|
|
1766
2088
|
display: "flex",
|
|
@@ -1778,14 +2100,14 @@ function BiampTableToolbar({
|
|
|
1778
2100
|
}
|
|
1779
2101
|
|
|
1780
2102
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1781
|
-
import { Box as
|
|
1782
|
-
import { jsx as
|
|
2103
|
+
import { Box as Box9 } from "@mui/material";
|
|
2104
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1783
2105
|
function BiampTableToolbarActions({
|
|
1784
2106
|
children,
|
|
1785
2107
|
...props
|
|
1786
2108
|
}) {
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
|
|
2109
|
+
return /* @__PURE__ */ jsx18(
|
|
2110
|
+
Box9,
|
|
1789
2111
|
{
|
|
1790
2112
|
display: "flex",
|
|
1791
2113
|
alignItems: "center",
|
|
@@ -1801,19 +2123,19 @@ function BiampTableToolbarActions({
|
|
|
1801
2123
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
1802
2124
|
import { CircularProgress } from "@mui/material";
|
|
1803
2125
|
import { DownloadIcon } from "@bwp-web/assets";
|
|
1804
|
-
import { jsx as
|
|
2126
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1805
2127
|
function BiampTableToolbarExport({
|
|
1806
2128
|
onExport,
|
|
1807
2129
|
loading,
|
|
1808
|
-
icon = /* @__PURE__ */
|
|
2130
|
+
icon = /* @__PURE__ */ jsx19(DownloadIcon, { variant: "xs" }),
|
|
1809
2131
|
label = "Export",
|
|
1810
2132
|
...props
|
|
1811
2133
|
}) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ jsx19(
|
|
1813
2135
|
BiampTableToolbarActionButton,
|
|
1814
2136
|
{
|
|
1815
2137
|
label: loading ? `${label}, loading` : label,
|
|
1816
|
-
icon: loading ? /* @__PURE__ */
|
|
2138
|
+
icon: loading ? /* @__PURE__ */ jsx19(CircularProgress, { size: 20, color: "inherit" }) : icon,
|
|
1817
2139
|
disabled: loading,
|
|
1818
2140
|
onClick: onExport,
|
|
1819
2141
|
...props
|
|
@@ -1824,22 +2146,22 @@ function BiampTableToolbarExport({
|
|
|
1824
2146
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1825
2147
|
import {
|
|
1826
2148
|
Badge as Badge2,
|
|
1827
|
-
Box as
|
|
2149
|
+
Box as Box10,
|
|
1828
2150
|
Button,
|
|
1829
2151
|
Divider as Divider2,
|
|
1830
2152
|
Drawer,
|
|
1831
2153
|
IconButton as IconButton4,
|
|
1832
|
-
Typography as
|
|
2154
|
+
Typography as Typography5
|
|
1833
2155
|
} from "@mui/material";
|
|
1834
2156
|
import { CloseIcon, FilterIcon } from "@bwp-web/assets";
|
|
1835
|
-
import { useId, useState as
|
|
1836
|
-
import { Fragment as
|
|
2157
|
+
import { useId, useState as useState5 } from "react";
|
|
2158
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1837
2159
|
function BiampTableToolbarFilters({
|
|
1838
2160
|
activeFilterCount,
|
|
1839
2161
|
children,
|
|
1840
2162
|
onReset,
|
|
1841
2163
|
onApply,
|
|
1842
|
-
icon = /* @__PURE__ */
|
|
2164
|
+
icon = /* @__PURE__ */ jsx20(FilterIcon, { variant: "xs" }),
|
|
1843
2165
|
title = "Filters",
|
|
1844
2166
|
resetLabel = "Clear filters",
|
|
1845
2167
|
applyLabel = "Apply",
|
|
@@ -1847,14 +2169,14 @@ function BiampTableToolbarFilters({
|
|
|
1847
2169
|
buttonLabel = "Filters",
|
|
1848
2170
|
DrawerProps: drawerProps
|
|
1849
2171
|
}) {
|
|
1850
|
-
const [open, setOpen] =
|
|
2172
|
+
const [open, setOpen] = useState5(false);
|
|
1851
2173
|
const titleId = useId();
|
|
1852
2174
|
function handleClose() {
|
|
1853
2175
|
onApply?.();
|
|
1854
2176
|
setOpen(false);
|
|
1855
2177
|
}
|
|
1856
|
-
return /* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
2178
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
2179
|
+
/* @__PURE__ */ jsx20(
|
|
1858
2180
|
BiampTableToolbarActionButton,
|
|
1859
2181
|
{
|
|
1860
2182
|
label: buttonLabel,
|
|
@@ -1863,7 +2185,7 @@ function BiampTableToolbarFilters({
|
|
|
1863
2185
|
onClick: () => setOpen(true)
|
|
1864
2186
|
}
|
|
1865
2187
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ jsx20(
|
|
1867
2189
|
Drawer,
|
|
1868
2190
|
{
|
|
1869
2191
|
anchor: "right",
|
|
@@ -1875,17 +2197,17 @@ function BiampTableToolbarFilters({
|
|
|
1875
2197
|
sx: { width: { xs: "100%", sm: 480 } },
|
|
1876
2198
|
...drawerProps?.PaperProps
|
|
1877
2199
|
},
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1879
|
-
|
|
2200
|
+
children: /* @__PURE__ */ jsxs9(
|
|
2201
|
+
Box10,
|
|
1880
2202
|
{
|
|
1881
2203
|
height: "100%",
|
|
1882
2204
|
display: "flex",
|
|
1883
2205
|
flexDirection: "column",
|
|
1884
2206
|
justifyContent: "space-between",
|
|
1885
2207
|
children: [
|
|
1886
|
-
/* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
|
|
2208
|
+
/* @__PURE__ */ jsxs9(Box10, { children: [
|
|
2209
|
+
/* @__PURE__ */ jsxs9(
|
|
2210
|
+
Box10,
|
|
1889
2211
|
{
|
|
1890
2212
|
display: "flex",
|
|
1891
2213
|
justifyContent: "space-between",
|
|
@@ -1893,9 +2215,9 @@ function BiampTableToolbarFilters({
|
|
|
1893
2215
|
px: 3.5,
|
|
1894
2216
|
py: 2.5,
|
|
1895
2217
|
children: [
|
|
1896
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ jsxs9(Typography5, { id: titleId, variant: "h2", children: [
|
|
1897
2219
|
title,
|
|
1898
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ jsx20(
|
|
1899
2221
|
Badge2,
|
|
1900
2222
|
{
|
|
1901
2223
|
badgeContent: activeFilterCount,
|
|
@@ -1904,21 +2226,21 @@ function BiampTableToolbarFilters({
|
|
|
1904
2226
|
}
|
|
1905
2227
|
)
|
|
1906
2228
|
] }),
|
|
1907
|
-
/* @__PURE__ */
|
|
2229
|
+
/* @__PURE__ */ jsx20(
|
|
1908
2230
|
IconButton4,
|
|
1909
2231
|
{
|
|
1910
2232
|
size: "medium",
|
|
1911
2233
|
onClick: handleClose,
|
|
1912
2234
|
"aria-label": closeLabel,
|
|
1913
|
-
children: /* @__PURE__ */
|
|
2235
|
+
children: /* @__PURE__ */ jsx20(CloseIcon, {})
|
|
1914
2236
|
}
|
|
1915
2237
|
)
|
|
1916
2238
|
]
|
|
1917
2239
|
}
|
|
1918
2240
|
),
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
-
|
|
2241
|
+
/* @__PURE__ */ jsx20(Divider2, {}),
|
|
2242
|
+
/* @__PURE__ */ jsx20(
|
|
2243
|
+
Box10,
|
|
1922
2244
|
{
|
|
1923
2245
|
role: "group",
|
|
1924
2246
|
"aria-label": "Filter options",
|
|
@@ -1931,8 +2253,8 @@ function BiampTableToolbarFilters({
|
|
|
1931
2253
|
}
|
|
1932
2254
|
)
|
|
1933
2255
|
] }),
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */
|
|
2256
|
+
/* @__PURE__ */ jsxs9(Box10, { display: "flex", children: [
|
|
2257
|
+
/* @__PURE__ */ jsx20(
|
|
1936
2258
|
Button,
|
|
1937
2259
|
{
|
|
1938
2260
|
variant: "overlay",
|
|
@@ -1943,7 +2265,7 @@ function BiampTableToolbarFilters({
|
|
|
1943
2265
|
children: resetLabel
|
|
1944
2266
|
}
|
|
1945
2267
|
),
|
|
1946
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx20(
|
|
1947
2269
|
Button,
|
|
1948
2270
|
{
|
|
1949
2271
|
variant: "overlay",
|
|
@@ -1964,7 +2286,7 @@ function BiampTableToolbarFilters({
|
|
|
1964
2286
|
|
|
1965
2287
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1966
2288
|
import {
|
|
1967
|
-
Box as
|
|
2289
|
+
Box as Box11,
|
|
1968
2290
|
Collapse,
|
|
1969
2291
|
IconButton as IconButton5,
|
|
1970
2292
|
InputAdornment as InputAdornment2,
|
|
@@ -1973,16 +2295,16 @@ import {
|
|
|
1973
2295
|
useMediaQuery
|
|
1974
2296
|
} from "@mui/material";
|
|
1975
2297
|
import { CloseIcon as CloseIcon2, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
1976
|
-
import { useEffect as
|
|
2298
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
1977
2299
|
|
|
1978
2300
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1979
|
-
import { useCallback as useCallback2, useEffect as
|
|
2301
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef5 } from "react";
|
|
1980
2302
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1981
2303
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1982
2304
|
const timeoutRef = useRef5(null);
|
|
1983
2305
|
const callbackRef = useRef5(callback);
|
|
1984
2306
|
callbackRef.current = callback;
|
|
1985
|
-
|
|
2307
|
+
useEffect4(() => {
|
|
1986
2308
|
return () => {
|
|
1987
2309
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
1988
2310
|
};
|
|
@@ -2000,7 +2322,7 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
2000
2322
|
}
|
|
2001
2323
|
|
|
2002
2324
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
2003
|
-
import { jsx as
|
|
2325
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2004
2326
|
var searchFieldSx = {
|
|
2005
2327
|
"& .MuiInputBase-root": {
|
|
2006
2328
|
height: "36px !important",
|
|
@@ -2025,10 +2347,10 @@ function BiampTableToolbarSearch({
|
|
|
2025
2347
|
...textFieldProps
|
|
2026
2348
|
}) {
|
|
2027
2349
|
const isMobile = useMediaQuery((t) => t.breakpoints.down("md"));
|
|
2028
|
-
const [inputValue, setInputValue] =
|
|
2029
|
-
const [isExpanded, setIsExpanded] =
|
|
2350
|
+
const [inputValue, setInputValue] = useState6(defaultValue);
|
|
2351
|
+
const [isExpanded, setIsExpanded] = useState6(false);
|
|
2030
2352
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2031
|
-
|
|
2353
|
+
useEffect5(() => {
|
|
2032
2354
|
setInputValue(defaultValue);
|
|
2033
2355
|
}, [defaultValue]);
|
|
2034
2356
|
const handleChange = (e) => {
|
|
@@ -2044,17 +2366,17 @@ function BiampTableToolbarSearch({
|
|
|
2044
2366
|
setIsExpanded(false);
|
|
2045
2367
|
}
|
|
2046
2368
|
};
|
|
2047
|
-
const clearButton = inputValue ? /* @__PURE__ */
|
|
2369
|
+
const clearButton = inputValue ? /* @__PURE__ */ jsx21(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx21(
|
|
2048
2370
|
IconButton5,
|
|
2049
2371
|
{
|
|
2050
2372
|
size: "small",
|
|
2051
2373
|
onClick: handleClear,
|
|
2052
2374
|
"aria-label": clearLabel,
|
|
2053
2375
|
sx: { mr: 0.5 },
|
|
2054
|
-
children: /* @__PURE__ */
|
|
2376
|
+
children: /* @__PURE__ */ jsx21(CloseIcon2, { variant: "xs", sx: { width: 20, height: 20 } })
|
|
2055
2377
|
}
|
|
2056
2378
|
) }) : null;
|
|
2057
|
-
const textField = /* @__PURE__ */
|
|
2379
|
+
const textField = /* @__PURE__ */ jsx21(
|
|
2058
2380
|
TextField2,
|
|
2059
2381
|
{
|
|
2060
2382
|
name: "search",
|
|
@@ -2063,7 +2385,7 @@ function BiampTableToolbarSearch({
|
|
|
2063
2385
|
slotProps: {
|
|
2064
2386
|
htmlInput: { maxLength, "aria-label": placeholder },
|
|
2065
2387
|
input: {
|
|
2066
|
-
startAdornment: /* @__PURE__ */
|
|
2388
|
+
startAdornment: /* @__PURE__ */ jsx21(InputAdornment2, { position: "start", sx: { ml: 1 }, children: /* @__PURE__ */ jsx21(
|
|
2067
2389
|
SearchIcon2,
|
|
2068
2390
|
{
|
|
2069
2391
|
variant: "xs",
|
|
@@ -2089,9 +2411,9 @@ function BiampTableToolbarSearch({
|
|
|
2089
2411
|
}
|
|
2090
2412
|
);
|
|
2091
2413
|
if (isMobile && enableMobileView) {
|
|
2092
|
-
return /* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsxs10(Box11, { display: "flex", alignItems: "center", width: "100%", pr: 1, gap: 1, children: [
|
|
2415
|
+
/* @__PURE__ */ jsx21(SearchIcon2, { sx: { width: 16, height: 16 } }),
|
|
2416
|
+
/* @__PURE__ */ jsx21(
|
|
2095
2417
|
InputBase,
|
|
2096
2418
|
{
|
|
2097
2419
|
name: "search",
|
|
@@ -2113,14 +2435,14 @@ function BiampTableToolbarSearch({
|
|
|
2113
2435
|
] });
|
|
2114
2436
|
}
|
|
2115
2437
|
if (expandable) {
|
|
2116
|
-
return /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsxs10(Box11, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
2439
|
+
/* @__PURE__ */ jsx21(
|
|
2118
2440
|
IconButton5,
|
|
2119
2441
|
{
|
|
2120
2442
|
"aria-label": expandLabel ?? placeholder,
|
|
2121
2443
|
onClick: () => setIsExpanded(true),
|
|
2122
2444
|
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
2123
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ jsx21(
|
|
2124
2446
|
SearchIcon2,
|
|
2125
2447
|
{
|
|
2126
2448
|
variant: "xs",
|
|
@@ -2130,7 +2452,7 @@ function BiampTableToolbarSearch({
|
|
|
2130
2452
|
)
|
|
2131
2453
|
}
|
|
2132
2454
|
),
|
|
2133
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ jsx21(
|
|
2134
2456
|
Collapse,
|
|
2135
2457
|
{
|
|
2136
2458
|
in: isExpanded || !!inputValue,
|
|
@@ -2356,9 +2678,9 @@ function downloadCsv(csvContent, filename) {
|
|
|
2356
2678
|
|
|
2357
2679
|
// src/BiampBanner/BiampBanner.tsx
|
|
2358
2680
|
import {
|
|
2359
|
-
Box as
|
|
2681
|
+
Box as Box12,
|
|
2360
2682
|
Collapse as Collapse2,
|
|
2361
|
-
Typography as
|
|
2683
|
+
Typography as Typography6
|
|
2362
2684
|
} from "@mui/material";
|
|
2363
2685
|
import {
|
|
2364
2686
|
ErrorStatusIcon,
|
|
@@ -2366,10 +2688,10 @@ import {
|
|
|
2366
2688
|
SuccessStatusIcon,
|
|
2367
2689
|
WarningStatusIcon
|
|
2368
2690
|
} from "@bwp-web/assets";
|
|
2369
|
-
import { Fragment as
|
|
2691
|
+
import { Fragment as Fragment4, jsx as jsx22 } from "react/jsx-runtime";
|
|
2370
2692
|
function BiampBanner({ show, children, severity }) {
|
|
2371
|
-
return /* @__PURE__ */
|
|
2372
|
-
|
|
2693
|
+
return /* @__PURE__ */ jsx22(Collapse2, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ jsx22(
|
|
2694
|
+
Box12,
|
|
2373
2695
|
{
|
|
2374
2696
|
bgcolor: ({ palette }) => palette.background[severity],
|
|
2375
2697
|
display: "flex",
|
|
@@ -2387,25 +2709,25 @@ function BiampBanner({ show, children, severity }) {
|
|
|
2387
2709
|
) });
|
|
2388
2710
|
}
|
|
2389
2711
|
var iconMapping = {
|
|
2390
|
-
error: /* @__PURE__ */
|
|
2391
|
-
warning: /* @__PURE__ */
|
|
2392
|
-
success: /* @__PURE__ */
|
|
2393
|
-
info: /* @__PURE__ */
|
|
2712
|
+
error: /* @__PURE__ */ jsx22(ErrorStatusIcon, { color: "error", sx: { width: 14, height: 14 } }),
|
|
2713
|
+
warning: /* @__PURE__ */ jsx22(WarningStatusIcon, { color: "warning", sx: { width: 16, height: 14 } }),
|
|
2714
|
+
success: /* @__PURE__ */ jsx22(SuccessStatusIcon, { color: "success", sx: { width: 14, height: 14 } }),
|
|
2715
|
+
info: /* @__PURE__ */ jsx22(InfoStatusIcon, { color: "info", sx: { width: 14, height: 14 } })
|
|
2394
2716
|
};
|
|
2395
2717
|
function BiampBannerIcon({ severity, children }) {
|
|
2396
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ jsx22(Fragment4, { children: severity ? iconMapping[severity] : children });
|
|
2397
2719
|
}
|
|
2398
2720
|
function BiampBannerContent({ children, ...props }) {
|
|
2399
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsx22(Typography6, { textAlign: "center", variant: "h3", ...props, children });
|
|
2400
2722
|
}
|
|
2401
2723
|
function BiampBannerActions({ children, ...props }) {
|
|
2402
|
-
return /* @__PURE__ */
|
|
2724
|
+
return /* @__PURE__ */ jsx22(Box12, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
2403
2725
|
}
|
|
2404
2726
|
|
|
2405
2727
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
2406
2728
|
import { Button as Button2, useTheme } from "@mui/material";
|
|
2407
2729
|
import { alpha as alpha3 } from "@mui/material/styles";
|
|
2408
|
-
import { jsx as
|
|
2730
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2409
2731
|
function SegmentedButton({
|
|
2410
2732
|
children,
|
|
2411
2733
|
active,
|
|
@@ -2418,7 +2740,7 @@ function SegmentedButton({
|
|
|
2418
2740
|
const backgroundColor = active ? isDarkMode ? theme.palette.grey[900] : theme.palette.common.white : "transparent";
|
|
2419
2741
|
const textColor = active ? theme.palette.text.primary : theme.palette.text.secondary;
|
|
2420
2742
|
const border = active ? "solid" : void 0;
|
|
2421
|
-
return /* @__PURE__ */
|
|
2743
|
+
return /* @__PURE__ */ jsx23(
|
|
2422
2744
|
Button2,
|
|
2423
2745
|
{
|
|
2424
2746
|
sx: {
|
|
@@ -2443,11 +2765,11 @@ function SegmentedButton({
|
|
|
2443
2765
|
|
|
2444
2766
|
// src/BiampSegmentedButton/SegmentedButtonGroup.tsx
|
|
2445
2767
|
import { Stack as Stack7, useTheme as useTheme2 } from "@mui/material";
|
|
2446
|
-
import { jsx as
|
|
2768
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2447
2769
|
function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
2448
2770
|
const theme = useTheme2();
|
|
2449
2771
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2450
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ jsx24(
|
|
2451
2773
|
Stack7,
|
|
2452
2774
|
{
|
|
2453
2775
|
direction: "row",
|
|
@@ -2465,19 +2787,19 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2465
2787
|
}
|
|
2466
2788
|
|
|
2467
2789
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
2468
|
-
import { createContext, forwardRef, useContext } from "react";
|
|
2790
|
+
import { createContext as createContext2, forwardRef, useContext as useContext2 } from "react";
|
|
2469
2791
|
import {
|
|
2470
2792
|
Autocomplete,
|
|
2471
|
-
Box as
|
|
2793
|
+
Box as Box13,
|
|
2472
2794
|
Chip,
|
|
2473
2795
|
InputAdornment as InputAdornment3,
|
|
2474
2796
|
Paper,
|
|
2475
2797
|
TextField as TextField3,
|
|
2476
|
-
Typography as
|
|
2798
|
+
Typography as Typography7
|
|
2477
2799
|
} from "@mui/material";
|
|
2478
2800
|
import { KeyArrowDownIcon, KeyArrowUpIcon, SearchIcon as SearchIcon3 } from "@bwp-web/assets";
|
|
2479
|
-
import { Fragment as
|
|
2480
|
-
var SearchContext =
|
|
2801
|
+
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2802
|
+
var SearchContext = createContext2({
|
|
2481
2803
|
hasOptions: true,
|
|
2482
2804
|
loading: false,
|
|
2483
2805
|
noResultsText: "No results found",
|
|
@@ -2487,8 +2809,8 @@ function KeyCap({
|
|
|
2487
2809
|
children,
|
|
2488
2810
|
variant = "icon"
|
|
2489
2811
|
}) {
|
|
2490
|
-
return /* @__PURE__ */
|
|
2491
|
-
|
|
2812
|
+
return /* @__PURE__ */ jsx25(
|
|
2813
|
+
Box13,
|
|
2492
2814
|
{
|
|
2493
2815
|
component: "kbd",
|
|
2494
2816
|
sx: {
|
|
@@ -2514,10 +2836,10 @@ function KeyCap({
|
|
|
2514
2836
|
}
|
|
2515
2837
|
var BiampGlobalSearchPaper = forwardRef(
|
|
2516
2838
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2517
|
-
const { hasOptions, loading, noResultsText } =
|
|
2518
|
-
return /* @__PURE__ */
|
|
2519
|
-
hasOptions || loading ? children : /* @__PURE__ */
|
|
2520
|
-
|
|
2839
|
+
const { hasOptions, loading, noResultsText } = useContext2(SearchContext);
|
|
2840
|
+
return /* @__PURE__ */ jsxs11(Paper, { ref, ...props, children: [
|
|
2841
|
+
hasOptions || loading ? children : /* @__PURE__ */ jsx25(
|
|
2842
|
+
Typography7,
|
|
2521
2843
|
{
|
|
2522
2844
|
variant: "body2",
|
|
2523
2845
|
color: "text.secondary",
|
|
@@ -2525,8 +2847,8 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2525
2847
|
children: noResultsText
|
|
2526
2848
|
}
|
|
2527
2849
|
),
|
|
2528
|
-
hasOptions && /* @__PURE__ */
|
|
2529
|
-
|
|
2850
|
+
hasOptions && /* @__PURE__ */ jsxs11(
|
|
2851
|
+
Box13,
|
|
2530
2852
|
{
|
|
2531
2853
|
sx: {
|
|
2532
2854
|
borderTop: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`,
|
|
@@ -2536,13 +2858,13 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2536
2858
|
p: 1.5
|
|
2537
2859
|
},
|
|
2538
2860
|
children: [
|
|
2539
|
-
/* @__PURE__ */
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2862
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
2863
|
+
/* @__PURE__ */ jsx25(KeyCap, { children: /* @__PURE__ */ jsx25(KeyArrowDownIcon, {}) }),
|
|
2864
|
+
/* @__PURE__ */ jsx25(KeyCap, { children: /* @__PURE__ */ jsx25(KeyArrowUpIcon, {}) })
|
|
2543
2865
|
] }),
|
|
2544
|
-
/* @__PURE__ */
|
|
2545
|
-
|
|
2866
|
+
/* @__PURE__ */ jsx25(
|
|
2867
|
+
Typography7,
|
|
2546
2868
|
{
|
|
2547
2869
|
variant: "caption",
|
|
2548
2870
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2551,10 +2873,10 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2551
2873
|
}
|
|
2552
2874
|
)
|
|
2553
2875
|
] }),
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
|
|
2876
|
+
/* @__PURE__ */ jsxs11(Box13, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2877
|
+
/* @__PURE__ */ jsx25(KeyCap, { variant: "text", children: "Enter" }),
|
|
2878
|
+
/* @__PURE__ */ jsx25(
|
|
2879
|
+
Typography7,
|
|
2558
2880
|
{
|
|
2559
2881
|
variant: "caption",
|
|
2560
2882
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2570,16 +2892,16 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
2570
2892
|
}
|
|
2571
2893
|
);
|
|
2572
2894
|
function HighlightText({ text, query }) {
|
|
2573
|
-
if (!query) return /* @__PURE__ */
|
|
2895
|
+
if (!query) return /* @__PURE__ */ jsx25(Fragment5, { children: text });
|
|
2574
2896
|
const index = text.toLowerCase().indexOf(query.toLowerCase());
|
|
2575
|
-
if (index === -1) return /* @__PURE__ */
|
|
2897
|
+
if (index === -1) return /* @__PURE__ */ jsx25(Fragment5, { children: text });
|
|
2576
2898
|
const before = text.slice(0, index);
|
|
2577
2899
|
const match = text.slice(index, index + query.length);
|
|
2578
2900
|
const after = text.slice(index + query.length);
|
|
2579
|
-
return /* @__PURE__ */
|
|
2901
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
2580
2902
|
before,
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
|
|
2903
|
+
/* @__PURE__ */ jsx25(
|
|
2904
|
+
Box13,
|
|
2583
2905
|
{
|
|
2584
2906
|
component: "span",
|
|
2585
2907
|
sx: {
|
|
@@ -2599,12 +2921,12 @@ function BiampGlobalSearchListItem({
|
|
|
2599
2921
|
option,
|
|
2600
2922
|
props: liProps
|
|
2601
2923
|
}) {
|
|
2602
|
-
const { query } =
|
|
2924
|
+
const { query } = useContext2(SearchContext);
|
|
2603
2925
|
const { key, ...rest } = liProps;
|
|
2604
2926
|
const maxChips = 3;
|
|
2605
2927
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
2606
2928
|
const overflow = (option.associatedItems?.length ?? 0) - maxChips;
|
|
2607
|
-
return /* @__PURE__ */
|
|
2929
|
+
return /* @__PURE__ */ jsxs11(
|
|
2608
2930
|
"li",
|
|
2609
2931
|
{
|
|
2610
2932
|
...rest,
|
|
@@ -2616,8 +2938,8 @@ function BiampGlobalSearchListItem({
|
|
|
2616
2938
|
...rest.style
|
|
2617
2939
|
},
|
|
2618
2940
|
children: [
|
|
2619
|
-
option.icon && /* @__PURE__ */
|
|
2620
|
-
|
|
2941
|
+
option.icon && /* @__PURE__ */ jsx25(
|
|
2942
|
+
Box13,
|
|
2621
2943
|
{
|
|
2622
2944
|
sx: {
|
|
2623
2945
|
width: 24,
|
|
@@ -2630,9 +2952,9 @@ function BiampGlobalSearchListItem({
|
|
|
2630
2952
|
children: option.icon
|
|
2631
2953
|
}
|
|
2632
2954
|
),
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
option.subtitle && /* @__PURE__ */
|
|
2635
|
-
|
|
2955
|
+
/* @__PURE__ */ jsx25(Typography7, { variant: "body2", noWrap: true, sx: { flexShrink: 0 }, children: /* @__PURE__ */ jsx25(HighlightText, { text: option.title, query }) }),
|
|
2956
|
+
option.subtitle && /* @__PURE__ */ jsx25(
|
|
2957
|
+
Typography7,
|
|
2636
2958
|
{
|
|
2637
2959
|
className: "hoverContent",
|
|
2638
2960
|
variant: "body2",
|
|
@@ -2642,8 +2964,8 @@ function BiampGlobalSearchListItem({
|
|
|
2642
2964
|
children: option.subtitle
|
|
2643
2965
|
}
|
|
2644
2966
|
),
|
|
2645
|
-
chips.length > 0 && /* @__PURE__ */
|
|
2646
|
-
|
|
2967
|
+
chips.length > 0 && /* @__PURE__ */ jsxs11(
|
|
2968
|
+
Box13,
|
|
2647
2969
|
{
|
|
2648
2970
|
className: "hoverContent",
|
|
2649
2971
|
sx: {
|
|
@@ -2655,7 +2977,7 @@ function BiampGlobalSearchListItem({
|
|
|
2655
2977
|
px: 2
|
|
2656
2978
|
},
|
|
2657
2979
|
children: [
|
|
2658
|
-
chips.map((item, i) => /* @__PURE__ */
|
|
2980
|
+
chips.map((item, i) => /* @__PURE__ */ jsx25(
|
|
2659
2981
|
Chip,
|
|
2660
2982
|
{
|
|
2661
2983
|
size: "small",
|
|
@@ -2673,7 +2995,7 @@ function BiampGlobalSearchListItem({
|
|
|
2673
2995
|
},
|
|
2674
2996
|
i
|
|
2675
2997
|
)),
|
|
2676
|
-
overflow > 0 && /* @__PURE__ */
|
|
2998
|
+
overflow > 0 && /* @__PURE__ */ jsx25(
|
|
2677
2999
|
Chip,
|
|
2678
3000
|
{
|
|
2679
3001
|
size: "small",
|
|
@@ -2693,8 +3015,8 @@ function BiampGlobalSearchListItem({
|
|
|
2693
3015
|
]
|
|
2694
3016
|
}
|
|
2695
3017
|
),
|
|
2696
|
-
option.endIcon && /* @__PURE__ */
|
|
2697
|
-
|
|
3018
|
+
option.endIcon && /* @__PURE__ */ jsx25(
|
|
3019
|
+
Box13,
|
|
2698
3020
|
{
|
|
2699
3021
|
className: "endIcon",
|
|
2700
3022
|
sx: {
|
|
@@ -2741,7 +3063,7 @@ function BiampGlobalSearch({
|
|
|
2741
3063
|
}
|
|
2742
3064
|
onInputChange?.(event, value, reason);
|
|
2743
3065
|
};
|
|
2744
|
-
return /* @__PURE__ */
|
|
3066
|
+
return /* @__PURE__ */ jsx25(
|
|
2745
3067
|
SearchContext.Provider,
|
|
2746
3068
|
{
|
|
2747
3069
|
value: {
|
|
@@ -2750,7 +3072,7 @@ function BiampGlobalSearch({
|
|
|
2750
3072
|
noResultsText,
|
|
2751
3073
|
query: inputValueProp ?? ""
|
|
2752
3074
|
},
|
|
2753
|
-
children: /* @__PURE__ */
|
|
3075
|
+
children: /* @__PURE__ */ jsx25(
|
|
2754
3076
|
Autocomplete,
|
|
2755
3077
|
{
|
|
2756
3078
|
options,
|
|
@@ -2758,7 +3080,7 @@ function BiampGlobalSearch({
|
|
|
2758
3080
|
loading,
|
|
2759
3081
|
onChange: handleChange,
|
|
2760
3082
|
onInputChange: handleInputChange,
|
|
2761
|
-
loadingText: /* @__PURE__ */
|
|
3083
|
+
loadingText: /* @__PURE__ */ jsx25(Typography7, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2762
3084
|
freeSolo: true,
|
|
2763
3085
|
filterOptions: (x) => x,
|
|
2764
3086
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -2782,7 +3104,7 @@ function BiampGlobalSearch({
|
|
|
2782
3104
|
}
|
|
2783
3105
|
}
|
|
2784
3106
|
},
|
|
2785
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3107
|
+
renderInput: (params) => /* @__PURE__ */ jsx25(
|
|
2786
3108
|
TextField3,
|
|
2787
3109
|
{
|
|
2788
3110
|
...params,
|
|
@@ -2798,15 +3120,15 @@ function BiampGlobalSearch({
|
|
|
2798
3120
|
slotProps: {
|
|
2799
3121
|
input: {
|
|
2800
3122
|
...params.InputProps,
|
|
2801
|
-
startAdornment: /* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
3123
|
+
startAdornment: /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
3124
|
+
/* @__PURE__ */ jsx25(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx25(SearchIcon3, {}) }),
|
|
2803
3125
|
params.InputProps.startAdornment
|
|
2804
3126
|
] })
|
|
2805
3127
|
}
|
|
2806
3128
|
}
|
|
2807
3129
|
}
|
|
2808
3130
|
),
|
|
2809
|
-
renderOption: (optionProps, option) => /* @__PURE__ */
|
|
3131
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ jsx25(
|
|
2810
3132
|
BiampGlobalSearchListItem,
|
|
2811
3133
|
{
|
|
2812
3134
|
option,
|
|
@@ -2823,9 +3145,9 @@ function BiampGlobalSearch({
|
|
|
2823
3145
|
|
|
2824
3146
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
2825
3147
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
2826
|
-
import { Box as
|
|
3148
|
+
import { Box as Box14, Typography as Typography8 } from "@mui/material";
|
|
2827
3149
|
import { darken } from "@mui/material/styles";
|
|
2828
|
-
import { jsx as
|
|
3150
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2829
3151
|
var DEFAULT_SIZE = 40;
|
|
2830
3152
|
var DEFAULT_BORDER_RADIUS = 1.5;
|
|
2831
3153
|
var TEXT_RATIO = 0.4;
|
|
@@ -2843,8 +3165,8 @@ function UserInitialsIcon({
|
|
|
2843
3165
|
const textColor = darken((0, import_randomcolor.default)({ luminosity: "dark", seed: id }), 0.3);
|
|
2844
3166
|
const size = typeof width === "number" ? width : DEFAULT_SIZE;
|
|
2845
3167
|
const fontSize = size * TEXT_RATIO;
|
|
2846
|
-
return /* @__PURE__ */
|
|
2847
|
-
|
|
3168
|
+
return /* @__PURE__ */ jsx26(
|
|
3169
|
+
Box14,
|
|
2848
3170
|
{
|
|
2849
3171
|
minWidth: width,
|
|
2850
3172
|
width,
|
|
@@ -2857,8 +3179,8 @@ function UserInitialsIcon({
|
|
|
2857
3179
|
justifyContent: "center",
|
|
2858
3180
|
sx: { ...sx },
|
|
2859
3181
|
...props,
|
|
2860
|
-
children: /* @__PURE__ */
|
|
2861
|
-
|
|
3182
|
+
children: /* @__PURE__ */ jsx26(
|
|
3183
|
+
Typography8,
|
|
2862
3184
|
{
|
|
2863
3185
|
variant: "h3",
|
|
2864
3186
|
color: textColor,
|
|
@@ -2880,9 +3202,9 @@ var getInitials = (name) => {
|
|
|
2880
3202
|
};
|
|
2881
3203
|
|
|
2882
3204
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
2883
|
-
import { SvgIcon, Skeleton, Box as
|
|
2884
|
-
import { useEffect as
|
|
2885
|
-
import { jsx as
|
|
3205
|
+
import { SvgIcon, Skeleton, Box as Box15 } from "@mui/material";
|
|
3206
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
3207
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2886
3208
|
var svgCache = /* @__PURE__ */ new Map();
|
|
2887
3209
|
function clearDynamicSvgIconCache() {
|
|
2888
3210
|
svgCache.clear();
|
|
@@ -2893,17 +3215,17 @@ function applyCurrentColor(svg) {
|
|
|
2893
3215
|
function useDynamicSvgIcon(url, options = {}) {
|
|
2894
3216
|
const { replaceColors = false, onLoad, onError } = options;
|
|
2895
3217
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
2896
|
-
const [svgContent, setSvgContent] =
|
|
3218
|
+
const [svgContent, setSvgContent] = useState7(() => {
|
|
2897
3219
|
const cached = svgCache.get(url);
|
|
2898
3220
|
return cached ? transform(cached.innerContent) : null;
|
|
2899
3221
|
});
|
|
2900
|
-
const [svgViewBox, setSvgViewBox] =
|
|
3222
|
+
const [svgViewBox, setSvgViewBox] = useState7(() => {
|
|
2901
3223
|
const cached = svgCache.get(url);
|
|
2902
3224
|
return cached?.viewBox ?? null;
|
|
2903
3225
|
});
|
|
2904
|
-
const [loading, setLoading] =
|
|
2905
|
-
const [error, setError] =
|
|
2906
|
-
|
|
3226
|
+
const [loading, setLoading] = useState7(() => !svgCache.has(url));
|
|
3227
|
+
const [error, setError] = useState7(null);
|
|
3228
|
+
useEffect6(() => {
|
|
2907
3229
|
if (!url) {
|
|
2908
3230
|
setLoading(false);
|
|
2909
3231
|
setError("No URL provided");
|
|
@@ -2984,7 +3306,7 @@ function DynamicSvgIcon({
|
|
|
2984
3306
|
onError
|
|
2985
3307
|
});
|
|
2986
3308
|
if (loading) {
|
|
2987
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx27(
|
|
2988
3310
|
Skeleton,
|
|
2989
3311
|
{
|
|
2990
3312
|
variant: skeletonVariant,
|
|
@@ -2994,8 +3316,8 @@ function DynamicSvgIcon({
|
|
|
2994
3316
|
);
|
|
2995
3317
|
}
|
|
2996
3318
|
if (error || !svgContent) {
|
|
2997
|
-
return /* @__PURE__ */
|
|
2998
|
-
|
|
3319
|
+
return /* @__PURE__ */ jsx27(
|
|
3320
|
+
Box15,
|
|
2999
3321
|
{
|
|
3000
3322
|
sx: {
|
|
3001
3323
|
width,
|
|
@@ -3014,7 +3336,7 @@ function DynamicSvgIcon({
|
|
|
3014
3336
|
}
|
|
3015
3337
|
);
|
|
3016
3338
|
}
|
|
3017
|
-
return /* @__PURE__ */
|
|
3339
|
+
return /* @__PURE__ */ jsx27(
|
|
3018
3340
|
SvgIcon,
|
|
3019
3341
|
{
|
|
3020
3342
|
...svgIconProps,
|
|
@@ -3024,7 +3346,7 @@ function DynamicSvgIcon({
|
|
|
3024
3346
|
width,
|
|
3025
3347
|
height
|
|
3026
3348
|
},
|
|
3027
|
-
children: /* @__PURE__ */
|
|
3349
|
+
children: /* @__PURE__ */ jsx27("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
3028
3350
|
}
|
|
3029
3351
|
);
|
|
3030
3352
|
}
|