@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.cjs
CHANGED
|
@@ -492,34 +492,134 @@ function BiampWrapper({ children, sx, ...props }) {
|
|
|
492
492
|
// src/BiampSidebar/BiampSidebar.tsx
|
|
493
493
|
var import_material2 = require("@mui/material");
|
|
494
494
|
var import_assets = require("@bwp-web/assets");
|
|
495
|
+
var import_react = require("react");
|
|
495
496
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
497
|
+
var BiampSidebarContext = (0, import_react.createContext)({
|
|
498
|
+
expanded: false
|
|
499
|
+
});
|
|
496
500
|
function BiampSidebar({
|
|
497
501
|
children,
|
|
498
502
|
bottomLogoIcon,
|
|
503
|
+
bottomLogoText,
|
|
504
|
+
expandable = true,
|
|
505
|
+
expanded: expandedProp,
|
|
506
|
+
defaultExpanded = false,
|
|
507
|
+
onExpandedChange,
|
|
499
508
|
sx,
|
|
500
509
|
...props
|
|
501
510
|
}) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
511
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react.useState)(defaultExpanded);
|
|
512
|
+
const isControlled = expandedProp !== void 0;
|
|
513
|
+
const expanded = isControlled ? expandedProp : internalExpanded;
|
|
514
|
+
const toggleExpanded = () => {
|
|
515
|
+
const next = !expanded;
|
|
516
|
+
if (!isControlled) setInternalExpanded(next);
|
|
517
|
+
onExpandedChange?.(next);
|
|
518
|
+
};
|
|
519
|
+
const width = expanded ? "240px" : "48px";
|
|
520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BiampSidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
521
|
+
import_material2.Stack,
|
|
522
|
+
{
|
|
523
|
+
sx: {
|
|
524
|
+
width,
|
|
525
|
+
minWidth: width,
|
|
526
|
+
height: "100%",
|
|
527
|
+
overflowX: "hidden",
|
|
528
|
+
transition: ({ transitions }) => transitions.create(["width", "min-width"], {
|
|
529
|
+
easing: transitions.easing.sharp,
|
|
530
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
531
|
+
}),
|
|
532
|
+
...sx
|
|
533
|
+
},
|
|
534
|
+
...props,
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Stack, { sx: { flex: 1, minHeight: 0 }, children }),
|
|
537
|
+
expandable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
538
|
+
BiampSidebarIcon,
|
|
539
|
+
{
|
|
540
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
541
|
+
import_assets.SquareRoundedArrowRightIcon,
|
|
542
|
+
{
|
|
543
|
+
sx: {
|
|
544
|
+
transform: expanded ? "rotate(180deg)" : "none",
|
|
545
|
+
transition: ({ transitions }) => transitions.create("transform", {
|
|
546
|
+
duration: transitions.duration.shorter
|
|
547
|
+
})
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
),
|
|
551
|
+
name: "Collapse menu",
|
|
552
|
+
onClick: toggleExpanded
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
556
|
+
import_material2.Stack,
|
|
557
|
+
{
|
|
558
|
+
direction: "row",
|
|
559
|
+
alignItems: "center",
|
|
560
|
+
justifyContent: "space-between",
|
|
561
|
+
sx: { mt: 2, overflow: "hidden" },
|
|
562
|
+
children: [
|
|
563
|
+
bottomLogoIcon ?? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
564
|
+
import_assets.BiampLogoIcon,
|
|
565
|
+
{
|
|
566
|
+
sx: { width: "48px", height: "15px", flexShrink: 0 }
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
bottomLogoText && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
570
|
+
import_material2.Typography,
|
|
571
|
+
{
|
|
572
|
+
variant: "caption",
|
|
573
|
+
fontWeight: 500,
|
|
574
|
+
color: "sidebar.main",
|
|
575
|
+
noWrap: true,
|
|
576
|
+
sx: {
|
|
577
|
+
opacity: expanded ? 1 : 0,
|
|
578
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
579
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
580
|
+
})
|
|
581
|
+
},
|
|
582
|
+
children: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} ${bottomLogoText}`
|
|
583
|
+
}
|
|
584
|
+
)
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
]
|
|
589
|
+
}
|
|
590
|
+
) });
|
|
506
591
|
}
|
|
507
592
|
function BiampSidebarIconList({
|
|
508
593
|
children,
|
|
509
594
|
sx,
|
|
510
595
|
...props
|
|
511
596
|
}) {
|
|
512
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
598
|
+
import_material2.Stack,
|
|
599
|
+
{
|
|
600
|
+
sx: {
|
|
601
|
+
flex: 1,
|
|
602
|
+
minHeight: 0,
|
|
603
|
+
gap: "4px",
|
|
604
|
+
overflowY: "auto",
|
|
605
|
+
...sx
|
|
606
|
+
},
|
|
607
|
+
...props,
|
|
608
|
+
children
|
|
609
|
+
}
|
|
610
|
+
);
|
|
513
611
|
}
|
|
514
612
|
function BiampSidebarIcon({
|
|
515
613
|
selected,
|
|
516
614
|
icon,
|
|
517
615
|
selectedIcon,
|
|
616
|
+
name,
|
|
518
617
|
sx,
|
|
519
618
|
...props
|
|
520
619
|
}) {
|
|
620
|
+
const { expanded } = (0, import_react.useContext)(BiampSidebarContext);
|
|
521
621
|
const displayedSelectedIcon = selectedIcon ?? icon;
|
|
522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
523
623
|
import_material2.ListItemButton,
|
|
524
624
|
{
|
|
525
625
|
selected,
|
|
@@ -527,16 +627,50 @@ function BiampSidebarIcon({
|
|
|
527
627
|
disableRipple: true,
|
|
528
628
|
sx: {
|
|
529
629
|
minWidth: "48px",
|
|
530
|
-
maxWidth: "48px",
|
|
531
630
|
minHeight: "48px",
|
|
532
631
|
maxHeight: "48px",
|
|
533
632
|
borderRadius: "8px",
|
|
534
|
-
justifyContent: "
|
|
633
|
+
justifyContent: "flex-start",
|
|
535
634
|
alignItems: "center",
|
|
635
|
+
padding: 0,
|
|
636
|
+
overflow: "hidden",
|
|
637
|
+
color: "text.secondary",
|
|
536
638
|
...sx
|
|
537
639
|
},
|
|
538
640
|
...props,
|
|
539
|
-
children:
|
|
641
|
+
children: [
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
643
|
+
import_material2.Box,
|
|
644
|
+
{
|
|
645
|
+
sx: {
|
|
646
|
+
width: "48px",
|
|
647
|
+
height: "48px",
|
|
648
|
+
display: "flex",
|
|
649
|
+
alignItems: "center",
|
|
650
|
+
justifyContent: "center",
|
|
651
|
+
flexShrink: 0
|
|
652
|
+
},
|
|
653
|
+
children: selected ? displayedSelectedIcon : icon
|
|
654
|
+
}
|
|
655
|
+
),
|
|
656
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
657
|
+
import_material2.Typography,
|
|
658
|
+
{
|
|
659
|
+
variant: "body1",
|
|
660
|
+
fontWeight: 600,
|
|
661
|
+
color: "inherit",
|
|
662
|
+
noWrap: true,
|
|
663
|
+
sx: {
|
|
664
|
+
pr: 2,
|
|
665
|
+
opacity: expanded ? 1 : 0,
|
|
666
|
+
transition: ({ transitions }) => transitions.create("opacity", {
|
|
667
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
668
|
+
})
|
|
669
|
+
},
|
|
670
|
+
children: name
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
]
|
|
540
674
|
}
|
|
541
675
|
);
|
|
542
676
|
}
|
|
@@ -568,6 +702,7 @@ function BiampSidebarComponent({
|
|
|
568
702
|
|
|
569
703
|
// src/BiampHeader/BiampHeader.tsx
|
|
570
704
|
var import_material3 = require("@mui/material");
|
|
705
|
+
var import_react2 = require("react");
|
|
571
706
|
var import_assets2 = require("@bwp-web/assets");
|
|
572
707
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
573
708
|
function BiampHeader({ children, sx, ...props }) {
|
|
@@ -810,12 +945,17 @@ function BiampEndUserAppContent({
|
|
|
810
945
|
sx,
|
|
811
946
|
...props
|
|
812
947
|
}) {
|
|
948
|
+
const isGrid = import_react2.Children.count(children) > 1;
|
|
813
949
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
814
950
|
import_material3.Stack,
|
|
815
951
|
{
|
|
816
952
|
direction: "column",
|
|
817
953
|
sx: {
|
|
818
954
|
gap: 1.5,
|
|
955
|
+
...isGrid && {
|
|
956
|
+
display: "grid",
|
|
957
|
+
gridTemplateColumns: "1fr 1fr"
|
|
958
|
+
},
|
|
819
959
|
...sx
|
|
820
960
|
},
|
|
821
961
|
...props,
|
|
@@ -950,17 +1090,17 @@ function BiampLayout({
|
|
|
950
1090
|
}
|
|
951
1091
|
|
|
952
1092
|
// src/BiampTable/BiampTable.tsx
|
|
953
|
-
var
|
|
954
|
-
var
|
|
955
|
-
var
|
|
956
|
-
var
|
|
1093
|
+
var import_material9 = require("@mui/material");
|
|
1094
|
+
var import_assets6 = require("@bwp-web/assets");
|
|
1095
|
+
var import_react_table2 = require("@tanstack/react-table");
|
|
1096
|
+
var import_react7 = require("react");
|
|
957
1097
|
|
|
958
1098
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
959
1099
|
var import_assets3 = require("@bwp-web/assets");
|
|
960
1100
|
|
|
961
1101
|
// src/BiampTable/BiampTableStatusMessage.tsx
|
|
962
1102
|
var import_material5 = require("@mui/material");
|
|
963
|
-
var
|
|
1103
|
+
var import_react3 = require("react");
|
|
964
1104
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
965
1105
|
function BiampTableStatusMessage({
|
|
966
1106
|
icon,
|
|
@@ -970,7 +1110,7 @@ function BiampTableStatusMessage({
|
|
|
970
1110
|
...stackProps
|
|
971
1111
|
}) {
|
|
972
1112
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.Stack, { alignItems: "center", gap: 1.5, ...stackProps, children: [
|
|
973
|
-
(0,
|
|
1113
|
+
(0, import_react3.cloneElement)(icon, {
|
|
974
1114
|
"aria-hidden": true,
|
|
975
1115
|
sx: { width: 56, height: 56, ...icon.props.sx }
|
|
976
1116
|
}),
|
|
@@ -1009,22 +1149,28 @@ function BiampTableErrorState({
|
|
|
1009
1149
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BiampTableStatusMessage, { role: "alert", icon, title, ...rest });
|
|
1010
1150
|
}
|
|
1011
1151
|
|
|
1152
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1153
|
+
var import_material8 = require("@mui/material");
|
|
1154
|
+
var import_assets5 = require("@bwp-web/assets");
|
|
1155
|
+
var import_react_table = require("@tanstack/react-table");
|
|
1156
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
1157
|
+
|
|
1012
1158
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
1013
1159
|
var import_material6 = require("@mui/material");
|
|
1014
|
-
var
|
|
1160
|
+
var import_react4 = require("react");
|
|
1015
1161
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1016
1162
|
function BiampTableTruncatedCell({
|
|
1017
1163
|
children
|
|
1018
1164
|
}) {
|
|
1019
|
-
const textRef = (0,
|
|
1020
|
-
const [open, setOpen] = (0,
|
|
1021
|
-
const handleMouseEnter = (0,
|
|
1165
|
+
const textRef = (0, import_react4.useRef)(null);
|
|
1166
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
1167
|
+
const handleMouseEnter = (0, import_react4.useCallback)(() => {
|
|
1022
1168
|
const el = textRef.current;
|
|
1023
1169
|
if (el && el.scrollWidth > el.clientWidth) {
|
|
1024
1170
|
setOpen(true);
|
|
1025
1171
|
}
|
|
1026
1172
|
}, []);
|
|
1027
|
-
const handleMouseLeave = (0,
|
|
1173
|
+
const handleMouseLeave = (0, import_react4.useCallback)(() => {
|
|
1028
1174
|
setOpen(false);
|
|
1029
1175
|
}, []);
|
|
1030
1176
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -1055,37 +1201,6 @@ function BiampTableTruncatedCell({
|
|
|
1055
1201
|
);
|
|
1056
1202
|
}
|
|
1057
1203
|
|
|
1058
|
-
// src/BiampTable/useLoadingDelay.ts
|
|
1059
|
-
var import_react3 = require("react");
|
|
1060
|
-
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1061
|
-
const [status, setStatus] = (0, import_react3.useState)("idle");
|
|
1062
|
-
const timeoutRef = (0, import_react3.useRef)(null);
|
|
1063
|
-
function clearPending() {
|
|
1064
|
-
if (timeoutRef.current !== null) {
|
|
1065
|
-
clearTimeout(timeoutRef.current);
|
|
1066
|
-
timeoutRef.current = null;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
(0, import_react3.useEffect)(() => {
|
|
1070
|
-
if (loading && status === "idle") {
|
|
1071
|
-
clearPending();
|
|
1072
|
-
timeoutRef.current = setTimeout(() => {
|
|
1073
|
-
timeoutRef.current = setTimeout(() => {
|
|
1074
|
-
setStatus("ending");
|
|
1075
|
-
}, minDuration);
|
|
1076
|
-
setStatus("loading");
|
|
1077
|
-
}, delay);
|
|
1078
|
-
setStatus("delaying");
|
|
1079
|
-
}
|
|
1080
|
-
if (!loading && status !== "loading") {
|
|
1081
|
-
clearPending();
|
|
1082
|
-
setStatus("idle");
|
|
1083
|
-
}
|
|
1084
|
-
}, [loading, delay, minDuration, status]);
|
|
1085
|
-
(0, import_react3.useEffect)(() => clearPending, []);
|
|
1086
|
-
return status === "loading" || status === "ending";
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
1204
|
// src/BiampTable/slotProps.ts
|
|
1090
1205
|
function resolveSlot(slot, ctx) {
|
|
1091
1206
|
if (!slot) return void 0;
|
|
@@ -1095,19 +1210,7 @@ function mergeSx(...inputs) {
|
|
|
1095
1210
|
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
1096
1211
|
}
|
|
1097
1212
|
|
|
1098
|
-
// src/BiampTable/
|
|
1099
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1100
|
-
var overlaySx = {
|
|
1101
|
-
position: "absolute",
|
|
1102
|
-
top: 0,
|
|
1103
|
-
left: 0,
|
|
1104
|
-
right: 0,
|
|
1105
|
-
bottom: 0,
|
|
1106
|
-
display: "flex",
|
|
1107
|
-
alignItems: "center",
|
|
1108
|
-
justifyContent: "center",
|
|
1109
|
-
pointerEvents: "none"
|
|
1110
|
-
};
|
|
1213
|
+
// src/BiampTable/cellSx.ts
|
|
1111
1214
|
var stickyHoverBg = {
|
|
1112
1215
|
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
1113
1216
|
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.grey[100]
|
|
@@ -1133,6 +1236,126 @@ function cellSx(sticky, minWidth, zIndex) {
|
|
|
1133
1236
|
"&:has([data-truncate])": { maxWidth: mw, whiteSpace: "normal" }
|
|
1134
1237
|
};
|
|
1135
1238
|
}
|
|
1239
|
+
|
|
1240
|
+
// src/BiampTable/BiampTableExpandGuidelines.tsx
|
|
1241
|
+
var import_material7 = require("@mui/material");
|
|
1242
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1243
|
+
var guidelineIndent = 28;
|
|
1244
|
+
var guidelineCellPaddingLeft = 12;
|
|
1245
|
+
var guidelineLineOffsetFromParentText = 4;
|
|
1246
|
+
var guidelineElbowGapToChildText = 12;
|
|
1247
|
+
var guidelineFirstChildTopExtension = 12;
|
|
1248
|
+
var guidelineColor = ({ palette }) => palette.dividers.secondary;
|
|
1249
|
+
var guidelineStroke = "0.6px";
|
|
1250
|
+
function isLastChildOfParent(row) {
|
|
1251
|
+
const parent = row.getParentRow();
|
|
1252
|
+
if (!parent) return false;
|
|
1253
|
+
const siblings = parent.subRows;
|
|
1254
|
+
return siblings[siblings.length - 1]?.id === row.id;
|
|
1255
|
+
}
|
|
1256
|
+
function isFirstChildOfParent(row) {
|
|
1257
|
+
const parent = row.getParentRow();
|
|
1258
|
+
if (!parent) return false;
|
|
1259
|
+
return parent.subRows[0]?.id === row.id;
|
|
1260
|
+
}
|
|
1261
|
+
function getAncestorAtDepth(row, targetDepth) {
|
|
1262
|
+
let current = row;
|
|
1263
|
+
while (current && current.depth > targetDepth) {
|
|
1264
|
+
current = current.getParentRow();
|
|
1265
|
+
}
|
|
1266
|
+
return current && current.depth === targetDepth ? current : void 0;
|
|
1267
|
+
}
|
|
1268
|
+
function ExpandGuidelines({ row }) {
|
|
1269
|
+
const verticalX = (k) => guidelineCellPaddingLeft + (k - 1) * guidelineIndent + guidelineLineOffsetFromParentText;
|
|
1270
|
+
const elbowEnd = guidelineCellPaddingLeft + row.depth * guidelineIndent - guidelineElbowGapToChildText;
|
|
1271
|
+
const lines = [];
|
|
1272
|
+
for (let k = 1; k < row.depth; k++) {
|
|
1273
|
+
const ancestor = getAncestorAtDepth(row, k);
|
|
1274
|
+
if (!ancestor || isLastChildOfParent(ancestor)) continue;
|
|
1275
|
+
lines.push(
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1277
|
+
import_material7.Box,
|
|
1278
|
+
{
|
|
1279
|
+
"aria-hidden": true,
|
|
1280
|
+
sx: {
|
|
1281
|
+
position: "absolute",
|
|
1282
|
+
left: `${verticalX(k)}px`,
|
|
1283
|
+
top: 0,
|
|
1284
|
+
bottom: 0,
|
|
1285
|
+
width: guidelineStroke,
|
|
1286
|
+
bgcolor: guidelineColor,
|
|
1287
|
+
pointerEvents: "none"
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
`v-${k}`
|
|
1291
|
+
)
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
const elbowX = verticalX(row.depth);
|
|
1295
|
+
const rowIsLast = isLastChildOfParent(row);
|
|
1296
|
+
const rowIsFirst = isFirstChildOfParent(row);
|
|
1297
|
+
const elbowTopOffset = rowIsFirst ? -guidelineFirstChildTopExtension : 0;
|
|
1298
|
+
lines.push(
|
|
1299
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1300
|
+
import_material7.Box,
|
|
1301
|
+
{
|
|
1302
|
+
"aria-hidden": true,
|
|
1303
|
+
sx: {
|
|
1304
|
+
position: "absolute",
|
|
1305
|
+
left: `${elbowX}px`,
|
|
1306
|
+
top: `${elbowTopOffset}px`,
|
|
1307
|
+
height: `calc(50% - ${elbowTopOffset}px)`,
|
|
1308
|
+
width: guidelineStroke,
|
|
1309
|
+
bgcolor: guidelineColor,
|
|
1310
|
+
pointerEvents: "none"
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
"v-elbow-top"
|
|
1314
|
+
)
|
|
1315
|
+
);
|
|
1316
|
+
if (!rowIsLast) {
|
|
1317
|
+
lines.push(
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1319
|
+
import_material7.Box,
|
|
1320
|
+
{
|
|
1321
|
+
"aria-hidden": true,
|
|
1322
|
+
sx: {
|
|
1323
|
+
position: "absolute",
|
|
1324
|
+
left: `${elbowX}px`,
|
|
1325
|
+
top: "50%",
|
|
1326
|
+
bottom: 0,
|
|
1327
|
+
width: guidelineStroke,
|
|
1328
|
+
bgcolor: guidelineColor,
|
|
1329
|
+
pointerEvents: "none"
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
"v-elbow-bottom"
|
|
1333
|
+
)
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
lines.push(
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1338
|
+
import_material7.Box,
|
|
1339
|
+
{
|
|
1340
|
+
"aria-hidden": true,
|
|
1341
|
+
sx: {
|
|
1342
|
+
position: "absolute",
|
|
1343
|
+
left: `${elbowX}px`,
|
|
1344
|
+
top: "50%",
|
|
1345
|
+
width: `${elbowEnd - elbowX}px`,
|
|
1346
|
+
height: guidelineStroke,
|
|
1347
|
+
bgcolor: guidelineColor,
|
|
1348
|
+
pointerEvents: "none"
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
"h-elbow"
|
|
1352
|
+
)
|
|
1353
|
+
);
|
|
1354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: lines });
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
// src/BiampTable/BiampTableRow.tsx
|
|
1358
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1136
1359
|
var rowCursorPointerSx = { cursor: "pointer" };
|
|
1137
1360
|
var selectionCellSx = {
|
|
1138
1361
|
position: "sticky",
|
|
@@ -1148,13 +1371,80 @@ var expandCellBaseSx = {
|
|
|
1148
1371
|
gap: "2px"
|
|
1149
1372
|
};
|
|
1150
1373
|
var expandPlaceholderSx = { width: 28 };
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1374
|
+
function ExpandToggle({
|
|
1375
|
+
row,
|
|
1376
|
+
isExpanded,
|
|
1377
|
+
hasExpandableRows,
|
|
1378
|
+
rowLabel
|
|
1379
|
+
}) {
|
|
1380
|
+
if (row.getCanExpand()) {
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1382
|
+
import_material8.IconButton,
|
|
1383
|
+
{
|
|
1384
|
+
variant: "none",
|
|
1385
|
+
onClick: (e) => {
|
|
1386
|
+
e.stopPropagation();
|
|
1387
|
+
row.toggleExpanded();
|
|
1388
|
+
},
|
|
1389
|
+
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1390
|
+
"aria-expanded": isExpanded,
|
|
1391
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1392
|
+
import_assets5.ChevronDownIcon,
|
|
1393
|
+
{
|
|
1394
|
+
variant: "xs",
|
|
1395
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1396
|
+
}
|
|
1397
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1398
|
+
import_assets5.ChevronRightIcon,
|
|
1399
|
+
{
|
|
1400
|
+
variant: "xs",
|
|
1401
|
+
sx: { color: ({ palette }) => palette.text.secondary }
|
|
1402
|
+
}
|
|
1403
|
+
)
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
if (hasExpandableRows) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material8.Box, { sx: expandPlaceholderSx });
|
|
1408
|
+
return null;
|
|
1409
|
+
}
|
|
1410
|
+
function renderCellContent({
|
|
1411
|
+
cell,
|
|
1412
|
+
row,
|
|
1413
|
+
isExpandCell,
|
|
1414
|
+
alwaysExpanded,
|
|
1415
|
+
isExpanded,
|
|
1416
|
+
hasExpandableRows,
|
|
1417
|
+
getRowLabel
|
|
1418
|
+
}) {
|
|
1419
|
+
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1420
|
+
const content = (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext());
|
|
1421
|
+
if (sticky) return content;
|
|
1422
|
+
const truncate = cell.column.columnDef.meta?.truncate ?? true;
|
|
1423
|
+
const truncated = truncate ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BiampTableTruncatedCell, { children: content }) : content;
|
|
1424
|
+
if (!isExpandCell) return truncated;
|
|
1425
|
+
if (alwaysExpanded) {
|
|
1426
|
+
return row.depth > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material8.Box, { sx: { pl: `${row.depth * 28}px` }, children: truncated }) : truncated;
|
|
1427
|
+
}
|
|
1428
|
+
const rowLabel = getRowLabel ? getRowLabel(row.original) : `row ${row.index + 1}`;
|
|
1429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1430
|
+
import_material8.Box,
|
|
1431
|
+
{
|
|
1432
|
+
sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
|
|
1433
|
+
children: [
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1435
|
+
ExpandToggle,
|
|
1436
|
+
{
|
|
1437
|
+
row,
|
|
1438
|
+
isExpanded,
|
|
1439
|
+
hasExpandableRows,
|
|
1440
|
+
rowLabel
|
|
1441
|
+
}
|
|
1442
|
+
),
|
|
1443
|
+
truncated
|
|
1444
|
+
]
|
|
1445
|
+
}
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1158
1448
|
function BiampTableRowInner({
|
|
1159
1449
|
row,
|
|
1160
1450
|
isExpanded,
|
|
@@ -1163,7 +1453,9 @@ function BiampTableRowInner({
|
|
|
1163
1453
|
isRowClickable,
|
|
1164
1454
|
enableRowSelection,
|
|
1165
1455
|
enableExpanding,
|
|
1456
|
+
alwaysExpanded,
|
|
1166
1457
|
selectChildrenWithParent,
|
|
1458
|
+
showExpandGuidelines,
|
|
1167
1459
|
getRowLabel,
|
|
1168
1460
|
hasExpandableRows,
|
|
1169
1461
|
customColor,
|
|
@@ -1178,8 +1470,8 @@ function BiampTableRowInner({
|
|
|
1178
1470
|
onKeyDown: userRowOnKeyDown,
|
|
1179
1471
|
...restRowProps
|
|
1180
1472
|
} = resolvedRow ?? {};
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
1182
|
-
|
|
1473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1474
|
+
import_material8.TableRow,
|
|
1183
1475
|
{
|
|
1184
1476
|
...restRowProps,
|
|
1185
1477
|
hover: clickable,
|
|
@@ -1203,16 +1495,16 @@ function BiampTableRowInner({
|
|
|
1203
1495
|
userRowOnKeyDown?.(e);
|
|
1204
1496
|
} : userRowOnKeyDown,
|
|
1205
1497
|
children: [
|
|
1206
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1207
|
-
|
|
1498
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1499
|
+
import_material8.TableCell,
|
|
1208
1500
|
{
|
|
1209
1501
|
padding: "checkbox",
|
|
1210
1502
|
sx: mergeSx(
|
|
1211
1503
|
selectionCellSx,
|
|
1212
1504
|
customColor ? { backgroundColor: customColor } : void 0
|
|
1213
1505
|
),
|
|
1214
|
-
children: /* @__PURE__ */ (0,
|
|
1215
|
-
|
|
1506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1507
|
+
import_material8.Checkbox,
|
|
1216
1508
|
{
|
|
1217
1509
|
checked: isSelected,
|
|
1218
1510
|
disabled: !row.getCanSelect(),
|
|
@@ -1233,68 +1525,33 @@ function BiampTableRowInner({
|
|
|
1233
1525
|
row.getVisibleCells().map((cell, cellIndex, cells) => {
|
|
1234
1526
|
const sticky = cell.column.columnDef.meta?.sticky;
|
|
1235
1527
|
const isExpandCell = enableExpanding && !sticky && cellIndex === cells.findIndex((c) => !c.column.columnDef.meta?.sticky);
|
|
1236
|
-
const
|
|
1237
|
-
cell.column.columnDef.cell,
|
|
1238
|
-
cell.getContext()
|
|
1239
|
-
);
|
|
1528
|
+
const showGuidelinesOnCell = isExpandCell && showExpandGuidelines && alwaysExpanded && row.depth > 0;
|
|
1240
1529
|
const resolvedCell = resolveSlot(cellSlotProps, { cell });
|
|
1241
1530
|
const { sx: userCellSx, ...restCellProps } = resolvedCell ?? {};
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
-
|
|
1531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1532
|
+
import_material8.TableCell,
|
|
1244
1533
|
{
|
|
1245
1534
|
...restCellProps,
|
|
1246
1535
|
"data-sticky": sticky || void 0,
|
|
1247
1536
|
sx: mergeSx(
|
|
1248
1537
|
cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
1249
|
-
{ pl: isExpandCell ? "6px" : "12px" },
|
|
1538
|
+
{ pl: isExpandCell && !alwaysExpanded ? "6px" : "12px" },
|
|
1539
|
+
showGuidelinesOnCell ? { position: "relative" } : void 0,
|
|
1250
1540
|
sticky && customColor ? { backgroundColor: customColor } : void 0,
|
|
1251
1541
|
userCellSx
|
|
1252
1542
|
),
|
|
1253
|
-
children:
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
import_material7.IconButton,
|
|
1266
|
-
{
|
|
1267
|
-
variant: "none",
|
|
1268
|
-
onClick: (e) => {
|
|
1269
|
-
e.stopPropagation();
|
|
1270
|
-
row.toggleExpanded();
|
|
1271
|
-
},
|
|
1272
|
-
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
1273
|
-
"aria-expanded": isExpanded,
|
|
1274
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1275
|
-
import_assets5.ChevronDownIcon,
|
|
1276
|
-
{
|
|
1277
|
-
variant: "xs",
|
|
1278
|
-
sx: {
|
|
1279
|
-
color: ({ palette }) => palette.text.secondary
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1283
|
-
import_assets5.ChevronRightIcon,
|
|
1284
|
-
{
|
|
1285
|
-
variant: "xs",
|
|
1286
|
-
sx: {
|
|
1287
|
-
color: ({ palette }) => palette.text.secondary
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
)
|
|
1291
|
-
}
|
|
1292
|
-
) : hasExpandableRows ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material7.Box, { sx: expandPlaceholderSx }) : null,
|
|
1293
|
-
truncated
|
|
1294
|
-
]
|
|
1295
|
-
}
|
|
1296
|
-
);
|
|
1297
|
-
})()
|
|
1543
|
+
children: [
|
|
1544
|
+
showGuidelinesOnCell && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExpandGuidelines, { row }),
|
|
1545
|
+
renderCellContent({
|
|
1546
|
+
cell,
|
|
1547
|
+
row,
|
|
1548
|
+
isExpandCell,
|
|
1549
|
+
alwaysExpanded,
|
|
1550
|
+
isExpanded,
|
|
1551
|
+
hasExpandableRows,
|
|
1552
|
+
getRowLabel
|
|
1553
|
+
})
|
|
1554
|
+
]
|
|
1298
1555
|
},
|
|
1299
1556
|
cell.id
|
|
1300
1557
|
);
|
|
@@ -1305,12 +1562,64 @@ function BiampTableRowInner({
|
|
|
1305
1562
|
);
|
|
1306
1563
|
}
|
|
1307
1564
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
1308
|
-
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;
|
|
1565
|
+
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;
|
|
1309
1566
|
}
|
|
1310
|
-
var BiampTableRow =
|
|
1567
|
+
var BiampTableRow = import_react5.default.memo(
|
|
1311
1568
|
BiampTableRowInner,
|
|
1312
1569
|
biampTableRowPropsAreEqual
|
|
1313
1570
|
);
|
|
1571
|
+
|
|
1572
|
+
// src/BiampTable/useLoadingDelay.ts
|
|
1573
|
+
var import_react6 = require("react");
|
|
1574
|
+
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
1575
|
+
const [status, setStatus] = (0, import_react6.useState)("idle");
|
|
1576
|
+
const timeoutRef = (0, import_react6.useRef)(null);
|
|
1577
|
+
function clearPending() {
|
|
1578
|
+
if (timeoutRef.current !== null) {
|
|
1579
|
+
clearTimeout(timeoutRef.current);
|
|
1580
|
+
timeoutRef.current = null;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
(0, import_react6.useEffect)(() => {
|
|
1584
|
+
if (loading && status === "idle") {
|
|
1585
|
+
clearPending();
|
|
1586
|
+
timeoutRef.current = setTimeout(() => {
|
|
1587
|
+
timeoutRef.current = setTimeout(() => {
|
|
1588
|
+
setStatus("ending");
|
|
1589
|
+
}, minDuration);
|
|
1590
|
+
setStatus("loading");
|
|
1591
|
+
}, delay);
|
|
1592
|
+
setStatus("delaying");
|
|
1593
|
+
}
|
|
1594
|
+
if (!loading && status !== "loading") {
|
|
1595
|
+
clearPending();
|
|
1596
|
+
setStatus("idle");
|
|
1597
|
+
}
|
|
1598
|
+
}, [loading, delay, minDuration, status]);
|
|
1599
|
+
(0, import_react6.useEffect)(() => clearPending, []);
|
|
1600
|
+
return status === "loading" || status === "ending";
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
// src/BiampTable/BiampTable.tsx
|
|
1604
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1605
|
+
var overlaySx = {
|
|
1606
|
+
position: "absolute",
|
|
1607
|
+
top: 0,
|
|
1608
|
+
left: 0,
|
|
1609
|
+
right: 0,
|
|
1610
|
+
bottom: 0,
|
|
1611
|
+
display: "flex",
|
|
1612
|
+
alignItems: "center",
|
|
1613
|
+
justifyContent: "center",
|
|
1614
|
+
pointerEvents: "none"
|
|
1615
|
+
};
|
|
1616
|
+
var headerSelectionCellSx = {
|
|
1617
|
+
position: "sticky",
|
|
1618
|
+
left: 0,
|
|
1619
|
+
zIndex: 3,
|
|
1620
|
+
bgcolor: "background.paper"
|
|
1621
|
+
};
|
|
1622
|
+
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
1314
1623
|
function BiampTable({
|
|
1315
1624
|
table,
|
|
1316
1625
|
onRowClick,
|
|
@@ -1320,8 +1629,10 @@ function BiampTable({
|
|
|
1320
1629
|
empty,
|
|
1321
1630
|
enableRowSelection = false,
|
|
1322
1631
|
enableExpanding = false,
|
|
1632
|
+
alwaysExpanded = false,
|
|
1323
1633
|
hideSelectAll,
|
|
1324
1634
|
selectChildrenWithParent = false,
|
|
1635
|
+
showExpandGuidelines = false,
|
|
1325
1636
|
getRowLabel,
|
|
1326
1637
|
setRowColor,
|
|
1327
1638
|
slotProps,
|
|
@@ -1339,16 +1650,21 @@ function BiampTable({
|
|
|
1339
1650
|
},
|
|
1340
1651
|
enableRowSelection ? 48 : 0
|
|
1341
1652
|
);
|
|
1342
|
-
const containerRef = (0,
|
|
1653
|
+
const containerRef = (0, import_react7.useRef)(null);
|
|
1654
|
+
(0, import_react7.useEffect)(() => {
|
|
1655
|
+
if (enableExpanding && alwaysExpanded) {
|
|
1656
|
+
table.toggleAllRowsExpanded(true);
|
|
1657
|
+
}
|
|
1658
|
+
}, [enableExpanding, alwaysExpanded, table]);
|
|
1343
1659
|
const showLoading = useLoadingDelay(!!loading);
|
|
1344
1660
|
const rows = table.getRowModel().rows;
|
|
1345
1661
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
1346
1662
|
const showError = !!error && !loading;
|
|
1347
1663
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1349
|
-
|
|
1664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1665
|
+
import_material9.TableContainer,
|
|
1350
1666
|
{
|
|
1351
|
-
component:
|
|
1667
|
+
component: import_material9.Box,
|
|
1352
1668
|
...boxProps,
|
|
1353
1669
|
ref: containerRef,
|
|
1354
1670
|
sx: {
|
|
@@ -1359,8 +1675,8 @@ function BiampTable({
|
|
|
1359
1675
|
...sx
|
|
1360
1676
|
},
|
|
1361
1677
|
children: [
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1363
|
-
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1679
|
+
import_material9.Table,
|
|
1364
1680
|
{
|
|
1365
1681
|
"aria-busy": showLoading || void 0,
|
|
1366
1682
|
...restTableSlotProps,
|
|
@@ -1369,14 +1685,14 @@ function BiampTable({
|
|
|
1369
1685
|
userTableSx
|
|
1370
1686
|
),
|
|
1371
1687
|
children: [
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.TableHead, { ...restHeadSlotProps, sx: mergeSx(userHeadSx), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1689
|
+
import_material9.TableRow,
|
|
1374
1690
|
{
|
|
1375
1691
|
...restHeaderRowSlotProps,
|
|
1376
1692
|
sx: mergeSx(userHeaderRowSx),
|
|
1377
1693
|
children: [
|
|
1378
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
1379
|
-
|
|
1694
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.TableCell, { padding: "checkbox", sx: headerSelectionCellSx, children: !hideSelectAll && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1695
|
+
import_material9.Checkbox,
|
|
1380
1696
|
{
|
|
1381
1697
|
checked: table.getIsAllPageRowsSelected(),
|
|
1382
1698
|
indeterminate: table.getIsSomePageRowsSelected(),
|
|
@@ -1391,8 +1707,8 @@ function BiampTable({
|
|
|
1391
1707
|
header
|
|
1392
1708
|
});
|
|
1393
1709
|
const { sx: userHeaderCellSx, ...restHeaderCellProps } = resolvedHeaderCell ?? {};
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
-
|
|
1710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1711
|
+
import_material9.TableCell,
|
|
1396
1712
|
{
|
|
1397
1713
|
...restHeaderCellProps,
|
|
1398
1714
|
"data-sticky": sticky || void 0,
|
|
@@ -1404,21 +1720,21 @@ function BiampTable({
|
|
|
1404
1720
|
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
1405
1721
|
userHeaderCellSx
|
|
1406
1722
|
),
|
|
1407
|
-
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0,
|
|
1408
|
-
|
|
1723
|
+
children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1724
|
+
import_material9.TableSortLabel,
|
|
1409
1725
|
{
|
|
1410
1726
|
active: !!header.column.getIsSorted(),
|
|
1411
1727
|
direction: header.column.getIsSorted() || "asc",
|
|
1412
1728
|
onClick: header.column.getToggleSortingHandler(),
|
|
1413
1729
|
...header.column.getIsSorted() && {
|
|
1414
|
-
IconComponent: header.column.getIsSorted() === "asc" ?
|
|
1730
|
+
IconComponent: header.column.getIsSorted() === "asc" ? import_assets6.DropdownChevronUpIcon : import_assets6.DropdownChevronDownIcon
|
|
1415
1731
|
},
|
|
1416
|
-
children: (0,
|
|
1732
|
+
children: (0, import_react_table2.flexRender)(
|
|
1417
1733
|
header.column.columnDef.header,
|
|
1418
1734
|
header.getContext()
|
|
1419
1735
|
)
|
|
1420
1736
|
}
|
|
1421
|
-
) : (0,
|
|
1737
|
+
) : (0, import_react_table2.flexRender)(
|
|
1422
1738
|
header.column.columnDef.header,
|
|
1423
1739
|
header.getContext()
|
|
1424
1740
|
)
|
|
@@ -1430,12 +1746,12 @@ function BiampTable({
|
|
|
1430
1746
|
},
|
|
1431
1747
|
headerGroup.id
|
|
1432
1748
|
)) }),
|
|
1433
|
-
/* @__PURE__ */ (0,
|
|
1434
|
-
|
|
1749
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1750
|
+
import_material9.TableBody,
|
|
1435
1751
|
{
|
|
1436
1752
|
...restBodySlotProps,
|
|
1437
1753
|
sx: mergeSx({ opacity: showLoading ? 0.3 : 1 }, userBodySx),
|
|
1438
|
-
children: !showError && rows.map((row) => /* @__PURE__ */ (0,
|
|
1754
|
+
children: !showError && rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1439
1755
|
BiampTableRow,
|
|
1440
1756
|
{
|
|
1441
1757
|
row,
|
|
@@ -1445,7 +1761,9 @@ function BiampTable({
|
|
|
1445
1761
|
isRowClickable,
|
|
1446
1762
|
enableRowSelection,
|
|
1447
1763
|
enableExpanding,
|
|
1764
|
+
alwaysExpanded,
|
|
1448
1765
|
selectChildrenWithParent,
|
|
1766
|
+
showExpandGuidelines,
|
|
1449
1767
|
getRowLabel,
|
|
1450
1768
|
hasExpandableRows,
|
|
1451
1769
|
customColor: setRowColor?.(row.original),
|
|
@@ -1459,22 +1777,22 @@ function BiampTable({
|
|
|
1459
1777
|
]
|
|
1460
1778
|
}
|
|
1461
1779
|
),
|
|
1462
|
-
showError && /* @__PURE__ */ (0,
|
|
1780
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.Box, { sx: overlaySx, children: error === true ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BiampTableErrorState, { sx: { pointerEvents: "auto" } }) : error instanceof Error ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1463
1781
|
BiampTableErrorState,
|
|
1464
1782
|
{
|
|
1465
1783
|
description: error.message,
|
|
1466
1784
|
sx: { pointerEvents: "auto" }
|
|
1467
1785
|
}
|
|
1468
1786
|
) : error }),
|
|
1469
|
-
showEmpty && /* @__PURE__ */ (0,
|
|
1787
|
+
showEmpty && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material9.Box, { sx: overlaySx, children: empty && empty !== true ? empty : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BiampTableEmptyState, { sx: { pointerEvents: "auto" } }) })
|
|
1470
1788
|
]
|
|
1471
1789
|
}
|
|
1472
1790
|
);
|
|
1473
1791
|
}
|
|
1474
1792
|
|
|
1475
1793
|
// src/BiampTable/BiampTableContainer.tsx
|
|
1476
|
-
var
|
|
1477
|
-
var
|
|
1794
|
+
var import_material10 = require("@mui/material");
|
|
1795
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1478
1796
|
function BiampTableContainer({
|
|
1479
1797
|
withBorderTop = true,
|
|
1480
1798
|
withBorderBottom = false,
|
|
@@ -1482,8 +1800,8 @@ function BiampTableContainer({
|
|
|
1482
1800
|
sx,
|
|
1483
1801
|
...props
|
|
1484
1802
|
}) {
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1486
|
-
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1804
|
+
import_material10.Stack,
|
|
1487
1805
|
{
|
|
1488
1806
|
direction: "column",
|
|
1489
1807
|
height: "100%",
|
|
@@ -1501,25 +1819,25 @@ function BiampTableContainer({
|
|
|
1501
1819
|
}
|
|
1502
1820
|
|
|
1503
1821
|
// src/BiampTable/BiampTableCellActionButton.tsx
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1822
|
+
var import_material11 = require("@mui/material");
|
|
1823
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1506
1824
|
function BiampTableCellActionButton({ label, icon, ...props }) {
|
|
1507
|
-
return /* @__PURE__ */ (0,
|
|
1508
|
-
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1826
|
+
import_material11.Tooltip,
|
|
1509
1827
|
{
|
|
1510
1828
|
title: label,
|
|
1511
1829
|
placement: "top",
|
|
1512
1830
|
enterDelay: 500,
|
|
1513
1831
|
enterNextDelay: 500,
|
|
1514
1832
|
disableInteractive: true,
|
|
1515
|
-
children: /* @__PURE__ */ (0,
|
|
1833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material11.IconButton, { "aria-label": label, ...props, children: icon }) })
|
|
1516
1834
|
}
|
|
1517
1835
|
);
|
|
1518
1836
|
}
|
|
1519
1837
|
|
|
1520
1838
|
// src/BiampTable/BiampTableColumnVisibility.tsx
|
|
1521
|
-
var
|
|
1522
|
-
var
|
|
1839
|
+
var import_material12 = require("@mui/material");
|
|
1840
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1523
1841
|
function toVisibilityState(visibility) {
|
|
1524
1842
|
return visibility;
|
|
1525
1843
|
}
|
|
@@ -1562,8 +1880,8 @@ function BiampTableColumnVisibility({
|
|
|
1562
1880
|
...popoverProps
|
|
1563
1881
|
}) {
|
|
1564
1882
|
const allVisible = table.getAllLeafColumns().every((col) => col.getIsVisible());
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1566
|
-
|
|
1883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1884
|
+
import_material12.Popover,
|
|
1567
1885
|
{
|
|
1568
1886
|
anchorEl,
|
|
1569
1887
|
open: Boolean(anchorEl),
|
|
@@ -1576,48 +1894,48 @@ function BiampTableColumnVisibility({
|
|
|
1576
1894
|
borderRadius: "6px",
|
|
1577
1895
|
backgroundImage: "none",
|
|
1578
1896
|
border: `0.6px solid ${palette.dividers.secondary}`,
|
|
1579
|
-
boxShadow: `0px 1px 1px 0px ${(0,
|
|
1897
|
+
boxShadow: `0px 1px 1px 0px ${(0, import_material12.alpha)(palette.common.black, 0.05)}`,
|
|
1580
1898
|
minWidth: "150px"
|
|
1581
1899
|
}),
|
|
1582
1900
|
...slotProps?.paper ?? {}
|
|
1583
1901
|
}
|
|
1584
1902
|
},
|
|
1585
1903
|
...popoverProps,
|
|
1586
|
-
children: /* @__PURE__ */ (0,
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
|
|
1904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material12.List, { dense: true, disablePadding: true, children: [
|
|
1905
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1906
|
+
import_material12.ListItem,
|
|
1589
1907
|
{
|
|
1590
1908
|
dense: true,
|
|
1591
1909
|
sx: columnListItemSx,
|
|
1592
1910
|
onClick: () => table.toggleAllColumnsVisible(!allVisible),
|
|
1593
1911
|
children: [
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1913
|
+
import_material12.Checkbox,
|
|
1596
1914
|
{
|
|
1597
1915
|
checked: allVisible,
|
|
1598
1916
|
slotProps: { input: { "aria-label": `${showAllLabel} columns` } }
|
|
1599
1917
|
}
|
|
1600
1918
|
),
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", fontWeight: 600, children: showAllLabel })
|
|
1602
1920
|
]
|
|
1603
1921
|
}
|
|
1604
1922
|
),
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
|
|
1923
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Divider, {}),
|
|
1924
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1925
|
+
import_material12.Box,
|
|
1608
1926
|
{
|
|
1609
1927
|
sx: { maxHeight: 340, overflow: "auto", overscrollBehavior: "none" },
|
|
1610
1928
|
children: table.getAllLeafColumns().map((column) => {
|
|
1611
1929
|
const columnName = column.columnDef.meta?.columnLabel ?? (typeof column.columnDef.header === "string" ? column.columnDef.header : column.id);
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
-
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1931
|
+
import_material12.ListItem,
|
|
1614
1932
|
{
|
|
1615
1933
|
dense: true,
|
|
1616
1934
|
sx: columnListItemSx,
|
|
1617
1935
|
onClick: column.getToggleVisibilityHandler(),
|
|
1618
1936
|
children: [
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1620
|
-
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1938
|
+
import_material12.Checkbox,
|
|
1621
1939
|
{
|
|
1622
1940
|
checked: column.getIsVisible(),
|
|
1623
1941
|
sx: { py: 1 },
|
|
@@ -1626,7 +1944,7 @@ function BiampTableColumnVisibility({
|
|
|
1626
1944
|
}
|
|
1627
1945
|
}
|
|
1628
1946
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Typography, { variant: "caption", children: columnName })
|
|
1630
1948
|
]
|
|
1631
1949
|
},
|
|
1632
1950
|
column.id
|
|
@@ -1640,12 +1958,12 @@ function BiampTableColumnVisibility({
|
|
|
1640
1958
|
}
|
|
1641
1959
|
|
|
1642
1960
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1643
|
-
var
|
|
1644
|
-
var
|
|
1961
|
+
var import_assets7 = require("@bwp-web/assets");
|
|
1962
|
+
var import_react8 = require("react");
|
|
1645
1963
|
|
|
1646
1964
|
// src/BiampTable/BiampTableToolbarActionButton.tsx
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1965
|
+
var import_material13 = require("@mui/material");
|
|
1966
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1649
1967
|
function BiampTableToolbarActionButton({
|
|
1650
1968
|
label,
|
|
1651
1969
|
icon,
|
|
@@ -1653,13 +1971,13 @@ function BiampTableToolbarActionButton({
|
|
|
1653
1971
|
...props
|
|
1654
1972
|
}) {
|
|
1655
1973
|
const showBadge = badgeContent != null && badgeContent !== 0;
|
|
1656
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
-
|
|
1974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1975
|
+
import_material13.IconButton,
|
|
1658
1976
|
{
|
|
1659
1977
|
"aria-label": showBadge ? `${label} (${badgeContent})` : label,
|
|
1660
1978
|
...props,
|
|
1661
|
-
children: showBadge ? /* @__PURE__ */ (0,
|
|
1662
|
-
|
|
1979
|
+
children: showBadge ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1980
|
+
import_material13.Badge,
|
|
1663
1981
|
{
|
|
1664
1982
|
badgeContent,
|
|
1665
1983
|
color: "info",
|
|
@@ -1682,20 +2000,20 @@ function BiampTableToolbarActionButton({
|
|
|
1682
2000
|
}
|
|
1683
2001
|
|
|
1684
2002
|
// src/BiampTable/BiampTableToolbarColumnVisibility.tsx
|
|
1685
|
-
var
|
|
2003
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1686
2004
|
function BiampTableToolbarColumnVisibility({
|
|
1687
2005
|
table,
|
|
1688
|
-
icon = /* @__PURE__ */ (0,
|
|
2006
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_assets7.ColumnsIcon, { variant: "xs" }),
|
|
1689
2007
|
label = "Columns",
|
|
1690
2008
|
defaultColumnVisibility,
|
|
1691
2009
|
showAllLabel,
|
|
1692
2010
|
...actionButtonProps
|
|
1693
2011
|
}) {
|
|
1694
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
2012
|
+
const [anchorEl, setAnchorEl] = (0, import_react8.useState)(null);
|
|
1695
2013
|
const defaults = defaultColumnVisibility ?? getDefaultColumnVisibility(table);
|
|
1696
2014
|
const dirtyCount = getColumnVisibilityDirtyCount(table, defaults);
|
|
1697
|
-
return /* @__PURE__ */ (0,
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
2015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1699
2017
|
BiampTableToolbarActionButton,
|
|
1700
2018
|
{
|
|
1701
2019
|
label,
|
|
@@ -1705,7 +2023,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1705
2023
|
...actionButtonProps
|
|
1706
2024
|
}
|
|
1707
2025
|
),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1709
2027
|
BiampTableColumnVisibility,
|
|
1710
2028
|
{
|
|
1711
2029
|
table,
|
|
@@ -1718,9 +2036,9 @@ function BiampTableToolbarColumnVisibility({
|
|
|
1718
2036
|
}
|
|
1719
2037
|
|
|
1720
2038
|
// src/BiampTable/BiampTablePagination.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
2039
|
+
var import_react9 = require("react");
|
|
2040
|
+
var import_material14 = require("@mui/material");
|
|
2041
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1724
2042
|
var positionMap = {
|
|
1725
2043
|
left: "flex-start",
|
|
1726
2044
|
center: "center",
|
|
@@ -1736,21 +2054,21 @@ function BiampTablePagination({
|
|
|
1736
2054
|
...paginationProps
|
|
1737
2055
|
}) {
|
|
1738
2056
|
const rowCount = table.getRowCount();
|
|
1739
|
-
const lastRowCountRef = (0,
|
|
2057
|
+
const lastRowCountRef = (0, import_react9.useRef)(rowCount);
|
|
1740
2058
|
if (!loading && rowCount >= 0) {
|
|
1741
2059
|
lastRowCountRef.current = rowCount;
|
|
1742
2060
|
}
|
|
1743
2061
|
const stableCount = loading ? lastRowCountRef.current : rowCount;
|
|
1744
2062
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
1745
2063
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
1746
|
-
(0,
|
|
2064
|
+
(0, import_react9.useEffect)(() => {
|
|
1747
2065
|
if (!loading && pageIndex > maxPage) {
|
|
1748
2066
|
table.setPageIndex(maxPage);
|
|
1749
2067
|
}
|
|
1750
2068
|
}, [loading, pageIndex, maxPage, table]);
|
|
1751
2069
|
if (autoHide && (!stableCount || stableCount <= pageSize)) return null;
|
|
1752
|
-
return /* @__PURE__ */ (0,
|
|
1753
|
-
|
|
2070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2071
|
+
import_material14.TablePagination,
|
|
1754
2072
|
{
|
|
1755
2073
|
component: "div",
|
|
1756
2074
|
count: stableCount,
|
|
@@ -1781,15 +2099,15 @@ function BiampTablePagination({
|
|
|
1781
2099
|
}
|
|
1782
2100
|
|
|
1783
2101
|
// src/BiampTable/BiampTableToolbar.tsx
|
|
1784
|
-
var
|
|
1785
|
-
var
|
|
2102
|
+
var import_material15 = require("@mui/material");
|
|
2103
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1786
2104
|
function BiampTableToolbar({
|
|
1787
2105
|
children,
|
|
1788
2106
|
sx,
|
|
1789
2107
|
...props
|
|
1790
2108
|
}) {
|
|
1791
|
-
return /* @__PURE__ */ (0,
|
|
1792
|
-
|
|
2109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2110
|
+
import_material15.Box,
|
|
1793
2111
|
{
|
|
1794
2112
|
role: "toolbar",
|
|
1795
2113
|
display: "flex",
|
|
@@ -1807,14 +2125,14 @@ function BiampTableToolbar({
|
|
|
1807
2125
|
}
|
|
1808
2126
|
|
|
1809
2127
|
// src/BiampTable/BiampTableToolbarActions.tsx
|
|
1810
|
-
var
|
|
1811
|
-
var
|
|
2128
|
+
var import_material16 = require("@mui/material");
|
|
2129
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1812
2130
|
function BiampTableToolbarActions({
|
|
1813
2131
|
children,
|
|
1814
2132
|
...props
|
|
1815
2133
|
}) {
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1817
|
-
|
|
2134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2135
|
+
import_material16.Box,
|
|
1818
2136
|
{
|
|
1819
2137
|
display: "flex",
|
|
1820
2138
|
alignItems: "center",
|
|
@@ -1828,21 +2146,21 @@ function BiampTableToolbarActions({
|
|
|
1828
2146
|
}
|
|
1829
2147
|
|
|
1830
2148
|
// src/BiampTable/BiampTableToolbarExport.tsx
|
|
1831
|
-
var
|
|
1832
|
-
var
|
|
1833
|
-
var
|
|
2149
|
+
var import_material17 = require("@mui/material");
|
|
2150
|
+
var import_assets8 = require("@bwp-web/assets");
|
|
2151
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1834
2152
|
function BiampTableToolbarExport({
|
|
1835
2153
|
onExport,
|
|
1836
2154
|
loading,
|
|
1837
|
-
icon = /* @__PURE__ */ (0,
|
|
2155
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_assets8.DownloadIcon, { variant: "xs" }),
|
|
1838
2156
|
label = "Export",
|
|
1839
2157
|
...props
|
|
1840
2158
|
}) {
|
|
1841
|
-
return /* @__PURE__ */ (0,
|
|
2159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1842
2160
|
BiampTableToolbarActionButton,
|
|
1843
2161
|
{
|
|
1844
2162
|
label: loading ? `${label}, loading` : label,
|
|
1845
|
-
icon: loading ? /* @__PURE__ */ (0,
|
|
2163
|
+
icon: loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.CircularProgress, { size: 20, color: "inherit" }) : icon,
|
|
1846
2164
|
disabled: loading,
|
|
1847
2165
|
onClick: onExport,
|
|
1848
2166
|
...props
|
|
@@ -1851,16 +2169,16 @@ function BiampTableToolbarExport({
|
|
|
1851
2169
|
}
|
|
1852
2170
|
|
|
1853
2171
|
// src/BiampTable/BiampTableToolbarFilters.tsx
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
1857
|
-
var
|
|
2172
|
+
var import_material18 = require("@mui/material");
|
|
2173
|
+
var import_assets9 = require("@bwp-web/assets");
|
|
2174
|
+
var import_react10 = require("react");
|
|
2175
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1858
2176
|
function BiampTableToolbarFilters({
|
|
1859
2177
|
activeFilterCount,
|
|
1860
2178
|
children,
|
|
1861
2179
|
onReset,
|
|
1862
2180
|
onApply,
|
|
1863
|
-
icon = /* @__PURE__ */ (0,
|
|
2181
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.FilterIcon, { variant: "xs" }),
|
|
1864
2182
|
title = "Filters",
|
|
1865
2183
|
resetLabel = "Clear filters",
|
|
1866
2184
|
applyLabel = "Apply",
|
|
@@ -1868,14 +2186,14 @@ function BiampTableToolbarFilters({
|
|
|
1868
2186
|
buttonLabel = "Filters",
|
|
1869
2187
|
DrawerProps: drawerProps
|
|
1870
2188
|
}) {
|
|
1871
|
-
const [open, setOpen] = (0,
|
|
1872
|
-
const titleId = (0,
|
|
2189
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
2190
|
+
const titleId = (0, import_react10.useId)();
|
|
1873
2191
|
function handleClose() {
|
|
1874
2192
|
onApply?.();
|
|
1875
2193
|
setOpen(false);
|
|
1876
2194
|
}
|
|
1877
|
-
return /* @__PURE__ */ (0,
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
2195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1879
2197
|
BiampTableToolbarActionButton,
|
|
1880
2198
|
{
|
|
1881
2199
|
label: buttonLabel,
|
|
@@ -1884,8 +2202,8 @@ function BiampTableToolbarFilters({
|
|
|
1884
2202
|
onClick: () => setOpen(true)
|
|
1885
2203
|
}
|
|
1886
2204
|
),
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1888
|
-
|
|
2205
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2206
|
+
import_material18.Drawer,
|
|
1889
2207
|
{
|
|
1890
2208
|
anchor: "right",
|
|
1891
2209
|
open,
|
|
@@ -1896,17 +2214,17 @@ function BiampTableToolbarFilters({
|
|
|
1896
2214
|
sx: { width: { xs: "100%", sm: 480 } },
|
|
1897
2215
|
...drawerProps?.PaperProps
|
|
1898
2216
|
},
|
|
1899
|
-
children: /* @__PURE__ */ (0,
|
|
1900
|
-
|
|
2217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2218
|
+
import_material18.Box,
|
|
1901
2219
|
{
|
|
1902
2220
|
height: "100%",
|
|
1903
2221
|
display: "flex",
|
|
1904
2222
|
flexDirection: "column",
|
|
1905
2223
|
justifyContent: "space-between",
|
|
1906
2224
|
children: [
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1909
|
-
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { children: [
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2227
|
+
import_material18.Box,
|
|
1910
2228
|
{
|
|
1911
2229
|
display: "flex",
|
|
1912
2230
|
justifyContent: "space-between",
|
|
@@ -1914,10 +2232,10 @@ function BiampTableToolbarFilters({
|
|
|
1914
2232
|
px: 3.5,
|
|
1915
2233
|
py: 2.5,
|
|
1916
2234
|
children: [
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Typography, { id: titleId, variant: "h2", children: [
|
|
1918
2236
|
title,
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
1920
|
-
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2238
|
+
import_material18.Badge,
|
|
1921
2239
|
{
|
|
1922
2240
|
badgeContent: activeFilterCount,
|
|
1923
2241
|
color: "secondary",
|
|
@@ -1925,21 +2243,21 @@ function BiampTableToolbarFilters({
|
|
|
1925
2243
|
}
|
|
1926
2244
|
)
|
|
1927
2245
|
] }),
|
|
1928
|
-
/* @__PURE__ */ (0,
|
|
1929
|
-
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2247
|
+
import_material18.IconButton,
|
|
1930
2248
|
{
|
|
1931
2249
|
size: "medium",
|
|
1932
2250
|
onClick: handleClose,
|
|
1933
2251
|
"aria-label": closeLabel,
|
|
1934
|
-
children: /* @__PURE__ */ (0,
|
|
2252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets9.CloseIcon, {})
|
|
1935
2253
|
}
|
|
1936
2254
|
)
|
|
1937
2255
|
]
|
|
1938
2256
|
}
|
|
1939
2257
|
),
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1942
|
-
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Divider, {}),
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2260
|
+
import_material18.Box,
|
|
1943
2261
|
{
|
|
1944
2262
|
role: "group",
|
|
1945
2263
|
"aria-label": "Filter options",
|
|
@@ -1952,9 +2270,9 @@ function BiampTableToolbarFilters({
|
|
|
1952
2270
|
}
|
|
1953
2271
|
)
|
|
1954
2272
|
] }),
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { display: "flex", children: [
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2275
|
+
import_material18.Button,
|
|
1958
2276
|
{
|
|
1959
2277
|
variant: "overlay",
|
|
1960
2278
|
color: "secondary",
|
|
@@ -1964,8 +2282,8 @@ function BiampTableToolbarFilters({
|
|
|
1964
2282
|
children: resetLabel
|
|
1965
2283
|
}
|
|
1966
2284
|
),
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
1968
|
-
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2286
|
+
import_material18.Button,
|
|
1969
2287
|
{
|
|
1970
2288
|
variant: "overlay",
|
|
1971
2289
|
color: "primary",
|
|
@@ -1984,23 +2302,23 @@ function BiampTableToolbarFilters({
|
|
|
1984
2302
|
}
|
|
1985
2303
|
|
|
1986
2304
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
1987
|
-
var
|
|
1988
|
-
var
|
|
1989
|
-
var
|
|
2305
|
+
var import_material19 = require("@mui/material");
|
|
2306
|
+
var import_assets10 = require("@bwp-web/assets");
|
|
2307
|
+
var import_react12 = require("react");
|
|
1990
2308
|
|
|
1991
2309
|
// src/BiampTable/useDebouncedCallback.ts
|
|
1992
|
-
var
|
|
2310
|
+
var import_react11 = require("react");
|
|
1993
2311
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
1994
2312
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
1995
|
-
const timeoutRef = (0,
|
|
1996
|
-
const callbackRef = (0,
|
|
2313
|
+
const timeoutRef = (0, import_react11.useRef)(null);
|
|
2314
|
+
const callbackRef = (0, import_react11.useRef)(callback);
|
|
1997
2315
|
callbackRef.current = callback;
|
|
1998
|
-
(0,
|
|
2316
|
+
(0, import_react11.useEffect)(() => {
|
|
1999
2317
|
return () => {
|
|
2000
2318
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
2001
2319
|
};
|
|
2002
2320
|
}, []);
|
|
2003
|
-
return (0,
|
|
2321
|
+
return (0, import_react11.useCallback)(
|
|
2004
2322
|
(...args) => {
|
|
2005
2323
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
2006
2324
|
timeoutRef.current = setTimeout(
|
|
@@ -2013,7 +2331,7 @@ function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
|
2013
2331
|
}
|
|
2014
2332
|
|
|
2015
2333
|
// src/BiampTable/BiampTableToolbarSearch.tsx
|
|
2016
|
-
var
|
|
2334
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2017
2335
|
var searchFieldSx = {
|
|
2018
2336
|
"& .MuiInputBase-root": {
|
|
2019
2337
|
height: "36px !important",
|
|
@@ -2037,11 +2355,11 @@ function BiampTableToolbarSearch({
|
|
|
2037
2355
|
sx,
|
|
2038
2356
|
...textFieldProps
|
|
2039
2357
|
}) {
|
|
2040
|
-
const isMobile = (0,
|
|
2041
|
-
const [inputValue, setInputValue] = (0,
|
|
2042
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
2358
|
+
const isMobile = (0, import_material19.useMediaQuery)((t) => t.breakpoints.down("md"));
|
|
2359
|
+
const [inputValue, setInputValue] = (0, import_react12.useState)(defaultValue);
|
|
2360
|
+
const [isExpanded, setIsExpanded] = (0, import_react12.useState)(false);
|
|
2043
2361
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
2044
|
-
(0,
|
|
2362
|
+
(0, import_react12.useEffect)(() => {
|
|
2045
2363
|
setInputValue(defaultValue);
|
|
2046
2364
|
}, [defaultValue]);
|
|
2047
2365
|
const handleChange = (e) => {
|
|
@@ -2057,18 +2375,18 @@ function BiampTableToolbarSearch({
|
|
|
2057
2375
|
setIsExpanded(false);
|
|
2058
2376
|
}
|
|
2059
2377
|
};
|
|
2060
|
-
const clearButton = inputValue ? /* @__PURE__ */ (0,
|
|
2061
|
-
|
|
2378
|
+
const clearButton = inputValue ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material19.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2379
|
+
import_material19.IconButton,
|
|
2062
2380
|
{
|
|
2063
2381
|
size: "small",
|
|
2064
2382
|
onClick: handleClear,
|
|
2065
2383
|
"aria-label": clearLabel,
|
|
2066
2384
|
sx: { mr: 0.5 },
|
|
2067
|
-
children: /* @__PURE__ */ (0,
|
|
2385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_assets10.CloseIcon, { variant: "xs", sx: { width: 20, height: 20 } })
|
|
2068
2386
|
}
|
|
2069
2387
|
) }) : null;
|
|
2070
|
-
const textField = /* @__PURE__ */ (0,
|
|
2071
|
-
|
|
2388
|
+
const textField = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2389
|
+
import_material19.TextField,
|
|
2072
2390
|
{
|
|
2073
2391
|
name: "search",
|
|
2074
2392
|
type: "text",
|
|
@@ -2076,8 +2394,8 @@ function BiampTableToolbarSearch({
|
|
|
2076
2394
|
slotProps: {
|
|
2077
2395
|
htmlInput: { maxLength, "aria-label": placeholder },
|
|
2078
2396
|
input: {
|
|
2079
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2080
|
-
|
|
2397
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material19.InputAdornment, { position: "start", sx: { ml: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2398
|
+
import_assets10.SearchIcon,
|
|
2081
2399
|
{
|
|
2082
2400
|
variant: "xs",
|
|
2083
2401
|
color: "inherit",
|
|
@@ -2102,10 +2420,10 @@ function BiampTableToolbarSearch({
|
|
|
2102
2420
|
}
|
|
2103
2421
|
);
|
|
2104
2422
|
if (isMobile && enableMobileView) {
|
|
2105
|
-
return /* @__PURE__ */ (0,
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2108
|
-
|
|
2423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material19.Box, { display: "flex", alignItems: "center", width: "100%", pr: 1, gap: 1, children: [
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_assets10.SearchIcon, { sx: { width: 16, height: 16 } }),
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2426
|
+
import_material19.InputBase,
|
|
2109
2427
|
{
|
|
2110
2428
|
name: "search",
|
|
2111
2429
|
type: "text",
|
|
@@ -2126,15 +2444,15 @@ function BiampTableToolbarSearch({
|
|
|
2126
2444
|
] });
|
|
2127
2445
|
}
|
|
2128
2446
|
if (expandable) {
|
|
2129
|
-
return /* @__PURE__ */ (0,
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2131
|
-
|
|
2447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material19.Box, { display: "flex", alignItems: "center", minWidth: 28, children: [
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2449
|
+
import_material19.IconButton,
|
|
2132
2450
|
{
|
|
2133
2451
|
"aria-label": expandLabel ?? placeholder,
|
|
2134
2452
|
onClick: () => setIsExpanded(true),
|
|
2135
2453
|
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
2136
|
-
children: /* @__PURE__ */ (0,
|
|
2137
|
-
|
|
2454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2455
|
+
import_assets10.SearchIcon,
|
|
2138
2456
|
{
|
|
2139
2457
|
variant: "xs",
|
|
2140
2458
|
color: "inherit",
|
|
@@ -2143,8 +2461,8 @@ function BiampTableToolbarSearch({
|
|
|
2143
2461
|
)
|
|
2144
2462
|
}
|
|
2145
2463
|
),
|
|
2146
|
-
/* @__PURE__ */ (0,
|
|
2147
|
-
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2465
|
+
import_material19.Collapse,
|
|
2148
2466
|
{
|
|
2149
2467
|
in: isExpanded || !!inputValue,
|
|
2150
2468
|
orientation: "horizontal",
|
|
@@ -2158,8 +2476,8 @@ function BiampTableToolbarSearch({
|
|
|
2158
2476
|
}
|
|
2159
2477
|
|
|
2160
2478
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2161
|
-
var
|
|
2162
|
-
var
|
|
2479
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
2480
|
+
var import_react13 = require("react");
|
|
2163
2481
|
|
|
2164
2482
|
// src/BiampTable/serverSideTableUtils.ts
|
|
2165
2483
|
function orderToSorting(order, fieldToColumnId) {
|
|
@@ -2215,8 +2533,8 @@ function getDirtyColumnVisibility(visibility, defaults) {
|
|
|
2215
2533
|
}
|
|
2216
2534
|
|
|
2217
2535
|
// src/BiampTable/useBiampServerSideTable.ts
|
|
2218
|
-
var coreRowModel = (0,
|
|
2219
|
-
var expandedRowModel = (0,
|
|
2536
|
+
var coreRowModel = (0, import_react_table3.getCoreRowModel)();
|
|
2537
|
+
var expandedRowModel = (0, import_react_table3.getExpandedRowModel)();
|
|
2220
2538
|
var defaultGetRowId = (row) => row.id;
|
|
2221
2539
|
function useBiampServerSideTable({
|
|
2222
2540
|
data,
|
|
@@ -2237,35 +2555,35 @@ function useBiampServerSideTable({
|
|
|
2237
2555
|
onExpandedChange,
|
|
2238
2556
|
getSubRows
|
|
2239
2557
|
}) {
|
|
2240
|
-
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0,
|
|
2558
|
+
const { defaultColumnVisibility, columnIdToField, fieldToColumnId } = (0, import_react13.useMemo)(
|
|
2241
2559
|
() => ({
|
|
2242
2560
|
defaultColumnVisibility: getDefaultColumnVisibilityFromDefs(columns),
|
|
2243
2561
|
...getOrderFieldMappings(columns)
|
|
2244
2562
|
}),
|
|
2245
2563
|
[columns]
|
|
2246
2564
|
);
|
|
2247
|
-
const sorting = (0,
|
|
2565
|
+
const sorting = (0, import_react13.useMemo)(
|
|
2248
2566
|
() => orderToSorting(order, fieldToColumnId),
|
|
2249
2567
|
[order, fieldToColumnId]
|
|
2250
2568
|
);
|
|
2251
2569
|
const hasPagination = page != null && rowsPerPage != null;
|
|
2252
|
-
const pagination = (0,
|
|
2570
|
+
const pagination = (0, import_react13.useMemo)(
|
|
2253
2571
|
() => hasPagination ? { pageIndex: page, pageSize: rowsPerPage } : void 0,
|
|
2254
2572
|
[hasPagination, page, rowsPerPage]
|
|
2255
2573
|
);
|
|
2256
2574
|
const hasSelection = selectedRowIds != null;
|
|
2257
|
-
const rowSelection = (0,
|
|
2575
|
+
const rowSelection = (0, import_react13.useMemo)(
|
|
2258
2576
|
() => hasSelection ? selectedIdsToRowSelection(selectedRowIds) : void 0,
|
|
2259
2577
|
[hasSelection, selectedRowIds]
|
|
2260
2578
|
);
|
|
2261
|
-
const mergedVisibility = (0,
|
|
2579
|
+
const mergedVisibility = (0, import_react13.useMemo)(
|
|
2262
2580
|
() => toVisibilityState({
|
|
2263
2581
|
...defaultColumnVisibility,
|
|
2264
2582
|
...columnVisibility
|
|
2265
2583
|
}),
|
|
2266
2584
|
[defaultColumnVisibility, columnVisibility]
|
|
2267
2585
|
);
|
|
2268
|
-
return (0,
|
|
2586
|
+
return (0, import_react_table3.useReactTable)({
|
|
2269
2587
|
data,
|
|
2270
2588
|
columns,
|
|
2271
2589
|
getCoreRowModel: coreRowModel,
|
|
@@ -2364,12 +2682,12 @@ function downloadCsv(csvContent, filename) {
|
|
|
2364
2682
|
}
|
|
2365
2683
|
|
|
2366
2684
|
// src/BiampBanner/BiampBanner.tsx
|
|
2367
|
-
var
|
|
2368
|
-
var
|
|
2369
|
-
var
|
|
2685
|
+
var import_material20 = require("@mui/material");
|
|
2686
|
+
var import_assets11 = require("@bwp-web/assets");
|
|
2687
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2370
2688
|
function BiampBanner({ show, children, severity }) {
|
|
2371
|
-
return /* @__PURE__ */ (0,
|
|
2372
|
-
|
|
2689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Collapse, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2690
|
+
import_material20.Box,
|
|
2373
2691
|
{
|
|
2374
2692
|
bgcolor: ({ palette }) => palette.background[severity],
|
|
2375
2693
|
display: "flex",
|
|
@@ -2387,25 +2705,25 @@ function BiampBanner({ show, children, severity }) {
|
|
|
2387
2705
|
) });
|
|
2388
2706
|
}
|
|
2389
2707
|
var iconMapping = {
|
|
2390
|
-
error: /* @__PURE__ */ (0,
|
|
2391
|
-
warning: /* @__PURE__ */ (0,
|
|
2392
|
-
success: /* @__PURE__ */ (0,
|
|
2393
|
-
info: /* @__PURE__ */ (0,
|
|
2708
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.ErrorStatusIcon, { color: "error", sx: { width: 14, height: 14 } }),
|
|
2709
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.WarningStatusIcon, { color: "warning", sx: { width: 16, height: 14 } }),
|
|
2710
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.SuccessStatusIcon, { color: "success", sx: { width: 14, height: 14 } }),
|
|
2711
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_assets11.InfoStatusIcon, { color: "info", sx: { width: 14, height: 14 } })
|
|
2394
2712
|
};
|
|
2395
2713
|
function BiampBannerIcon({ severity, children }) {
|
|
2396
|
-
return /* @__PURE__ */ (0,
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: severity ? iconMapping[severity] : children });
|
|
2397
2715
|
}
|
|
2398
2716
|
function BiampBannerContent({ children, ...props }) {
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Typography, { textAlign: "center", variant: "h3", ...props, children });
|
|
2400
2718
|
}
|
|
2401
2719
|
function BiampBannerActions({ children, ...props }) {
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material20.Box, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
2403
2721
|
}
|
|
2404
2722
|
|
|
2405
2723
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
2406
|
-
var
|
|
2724
|
+
var import_material21 = require("@mui/material");
|
|
2407
2725
|
var import_styles = require("@mui/material/styles");
|
|
2408
|
-
var
|
|
2726
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2409
2727
|
function SegmentedButton({
|
|
2410
2728
|
children,
|
|
2411
2729
|
active,
|
|
@@ -2413,13 +2731,13 @@ function SegmentedButton({
|
|
|
2413
2731
|
sx,
|
|
2414
2732
|
...props
|
|
2415
2733
|
}) {
|
|
2416
|
-
const theme = (0,
|
|
2734
|
+
const theme = (0, import_material21.useTheme)();
|
|
2417
2735
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2418
2736
|
const backgroundColor = active ? isDarkMode ? theme.palette.grey[900] : theme.palette.common.white : "transparent";
|
|
2419
2737
|
const textColor = active ? theme.palette.text.primary : theme.palette.text.secondary;
|
|
2420
2738
|
const border = active ? "solid" : void 0;
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
-
|
|
2739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2740
|
+
import_material21.Button,
|
|
2423
2741
|
{
|
|
2424
2742
|
sx: {
|
|
2425
2743
|
backgroundColor,
|
|
@@ -2442,13 +2760,13 @@ function SegmentedButton({
|
|
|
2442
2760
|
}
|
|
2443
2761
|
|
|
2444
2762
|
// src/BiampSegmentedButton/SegmentedButtonGroup.tsx
|
|
2445
|
-
var
|
|
2446
|
-
var
|
|
2763
|
+
var import_material22 = require("@mui/material");
|
|
2764
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2447
2765
|
function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
2448
|
-
const theme = (0,
|
|
2766
|
+
const theme = (0, import_material22.useTheme)();
|
|
2449
2767
|
const isDarkMode = theme.palette.mode === "dark";
|
|
2450
|
-
return /* @__PURE__ */ (0,
|
|
2451
|
-
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2769
|
+
import_material22.Stack,
|
|
2452
2770
|
{
|
|
2453
2771
|
direction: "row",
|
|
2454
2772
|
p: 0.5,
|
|
@@ -2465,11 +2783,11 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
2465
2783
|
}
|
|
2466
2784
|
|
|
2467
2785
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
2468
|
-
var
|
|
2469
|
-
var
|
|
2470
|
-
var
|
|
2471
|
-
var
|
|
2472
|
-
var SearchContext = (0,
|
|
2786
|
+
var import_react14 = require("react");
|
|
2787
|
+
var import_material23 = require("@mui/material");
|
|
2788
|
+
var import_assets12 = require("@bwp-web/assets");
|
|
2789
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2790
|
+
var SearchContext = (0, import_react14.createContext)({
|
|
2473
2791
|
hasOptions: true,
|
|
2474
2792
|
loading: false,
|
|
2475
2793
|
noResultsText: "No results found",
|
|
@@ -2479,8 +2797,8 @@ function KeyCap({
|
|
|
2479
2797
|
children,
|
|
2480
2798
|
variant = "icon"
|
|
2481
2799
|
}) {
|
|
2482
|
-
return /* @__PURE__ */ (0,
|
|
2483
|
-
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2801
|
+
import_material23.Box,
|
|
2484
2802
|
{
|
|
2485
2803
|
component: "kbd",
|
|
2486
2804
|
sx: {
|
|
@@ -2504,12 +2822,12 @@ function KeyCap({
|
|
|
2504
2822
|
}
|
|
2505
2823
|
);
|
|
2506
2824
|
}
|
|
2507
|
-
var BiampGlobalSearchPaper = (0,
|
|
2825
|
+
var BiampGlobalSearchPaper = (0, import_react14.forwardRef)(
|
|
2508
2826
|
function BiampGlobalSearchPaper2({ children, ...props }, ref) {
|
|
2509
|
-
const { hasOptions, loading, noResultsText } = (0,
|
|
2510
|
-
return /* @__PURE__ */ (0,
|
|
2511
|
-
hasOptions || loading ? children : /* @__PURE__ */ (0,
|
|
2512
|
-
|
|
2827
|
+
const { hasOptions, loading, noResultsText } = (0, import_react14.useContext)(SearchContext);
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Paper, { ref, ...props, children: [
|
|
2829
|
+
hasOptions || loading ? children : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2830
|
+
import_material23.Typography,
|
|
2513
2831
|
{
|
|
2514
2832
|
variant: "body2",
|
|
2515
2833
|
color: "text.secondary",
|
|
@@ -2517,8 +2835,8 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2517
2835
|
children: noResultsText
|
|
2518
2836
|
}
|
|
2519
2837
|
),
|
|
2520
|
-
hasOptions && /* @__PURE__ */ (0,
|
|
2521
|
-
|
|
2838
|
+
hasOptions && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2839
|
+
import_material23.Box,
|
|
2522
2840
|
{
|
|
2523
2841
|
sx: {
|
|
2524
2842
|
borderTop: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`,
|
|
@@ -2528,13 +2846,13 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2528
2846
|
p: 1.5
|
|
2529
2847
|
},
|
|
2530
2848
|
children: [
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2532
|
-
/* @__PURE__ */ (0,
|
|
2533
|
-
/* @__PURE__ */ (0,
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.KeyArrowDownIcon, {}) }),
|
|
2852
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.KeyArrowUpIcon, {}) })
|
|
2535
2853
|
] }),
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2855
|
+
import_material23.Typography,
|
|
2538
2856
|
{
|
|
2539
2857
|
variant: "caption",
|
|
2540
2858
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2543,10 +2861,10 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2543
2861
|
}
|
|
2544
2862
|
)
|
|
2545
2863
|
] }),
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2549
|
-
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KeyCap, { variant: "text", children: "Enter" }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2867
|
+
import_material23.Typography,
|
|
2550
2868
|
{
|
|
2551
2869
|
variant: "caption",
|
|
2552
2870
|
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
@@ -2562,16 +2880,16 @@ var BiampGlobalSearchPaper = (0, import_react11.forwardRef)(
|
|
|
2562
2880
|
}
|
|
2563
2881
|
);
|
|
2564
2882
|
function HighlightText({ text, query }) {
|
|
2565
|
-
if (!query) return /* @__PURE__ */ (0,
|
|
2883
|
+
if (!query) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2566
2884
|
const index = text.toLowerCase().indexOf(query.toLowerCase());
|
|
2567
|
-
if (index === -1) return /* @__PURE__ */ (0,
|
|
2885
|
+
if (index === -1) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: text });
|
|
2568
2886
|
const before = text.slice(0, index);
|
|
2569
2887
|
const match = text.slice(index, index + query.length);
|
|
2570
2888
|
const after = text.slice(index + query.length);
|
|
2571
|
-
return /* @__PURE__ */ (0,
|
|
2889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2572
2890
|
before,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2892
|
+
import_material23.Box,
|
|
2575
2893
|
{
|
|
2576
2894
|
component: "span",
|
|
2577
2895
|
sx: {
|
|
@@ -2591,12 +2909,12 @@ function BiampGlobalSearchListItem({
|
|
|
2591
2909
|
option,
|
|
2592
2910
|
props: liProps
|
|
2593
2911
|
}) {
|
|
2594
|
-
const { query } = (0,
|
|
2912
|
+
const { query } = (0, import_react14.useContext)(SearchContext);
|
|
2595
2913
|
const { key, ...rest } = liProps;
|
|
2596
2914
|
const maxChips = 3;
|
|
2597
2915
|
const chips = option.associatedItems?.slice(0, maxChips) ?? [];
|
|
2598
2916
|
const overflow = (option.associatedItems?.length ?? 0) - maxChips;
|
|
2599
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2600
2918
|
"li",
|
|
2601
2919
|
{
|
|
2602
2920
|
...rest,
|
|
@@ -2608,8 +2926,8 @@ function BiampGlobalSearchListItem({
|
|
|
2608
2926
|
...rest.style
|
|
2609
2927
|
},
|
|
2610
2928
|
children: [
|
|
2611
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2612
|
-
|
|
2929
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2930
|
+
import_material23.Box,
|
|
2613
2931
|
{
|
|
2614
2932
|
sx: {
|
|
2615
2933
|
width: 24,
|
|
@@ -2622,9 +2940,9 @@ function BiampGlobalSearchListItem({
|
|
|
2622
2940
|
children: option.icon
|
|
2623
2941
|
}
|
|
2624
2942
|
),
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2626
|
-
option.subtitle && /* @__PURE__ */ (0,
|
|
2627
|
-
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.Typography, { variant: "body2", noWrap: true, sx: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(HighlightText, { text: option.title, query }) }),
|
|
2944
|
+
option.subtitle && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2945
|
+
import_material23.Typography,
|
|
2628
2946
|
{
|
|
2629
2947
|
className: "hoverContent",
|
|
2630
2948
|
variant: "body2",
|
|
@@ -2634,8 +2952,8 @@ function BiampGlobalSearchListItem({
|
|
|
2634
2952
|
children: option.subtitle
|
|
2635
2953
|
}
|
|
2636
2954
|
),
|
|
2637
|
-
chips.length > 0 && /* @__PURE__ */ (0,
|
|
2638
|
-
|
|
2955
|
+
chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2956
|
+
import_material23.Box,
|
|
2639
2957
|
{
|
|
2640
2958
|
className: "hoverContent",
|
|
2641
2959
|
sx: {
|
|
@@ -2647,8 +2965,8 @@ function BiampGlobalSearchListItem({
|
|
|
2647
2965
|
px: 2
|
|
2648
2966
|
},
|
|
2649
2967
|
children: [
|
|
2650
|
-
chips.map((item, i) => /* @__PURE__ */ (0,
|
|
2651
|
-
|
|
2968
|
+
chips.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2969
|
+
import_material23.Chip,
|
|
2652
2970
|
{
|
|
2653
2971
|
size: "small",
|
|
2654
2972
|
label: item.label,
|
|
@@ -2665,8 +2983,8 @@ function BiampGlobalSearchListItem({
|
|
|
2665
2983
|
},
|
|
2666
2984
|
i
|
|
2667
2985
|
)),
|
|
2668
|
-
overflow > 0 && /* @__PURE__ */ (0,
|
|
2669
|
-
|
|
2986
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2987
|
+
import_material23.Chip,
|
|
2670
2988
|
{
|
|
2671
2989
|
size: "small",
|
|
2672
2990
|
label: `+${overflow}`,
|
|
@@ -2685,8 +3003,8 @@ function BiampGlobalSearchListItem({
|
|
|
2685
3003
|
]
|
|
2686
3004
|
}
|
|
2687
3005
|
),
|
|
2688
|
-
option.endIcon && /* @__PURE__ */ (0,
|
|
2689
|
-
|
|
3006
|
+
option.endIcon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3007
|
+
import_material23.Box,
|
|
2690
3008
|
{
|
|
2691
3009
|
className: "endIcon",
|
|
2692
3010
|
sx: {
|
|
@@ -2733,7 +3051,7 @@ function BiampGlobalSearch({
|
|
|
2733
3051
|
}
|
|
2734
3052
|
onInputChange?.(event, value, reason);
|
|
2735
3053
|
};
|
|
2736
|
-
return /* @__PURE__ */ (0,
|
|
3054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2737
3055
|
SearchContext.Provider,
|
|
2738
3056
|
{
|
|
2739
3057
|
value: {
|
|
@@ -2742,15 +3060,15 @@ function BiampGlobalSearch({
|
|
|
2742
3060
|
noResultsText,
|
|
2743
3061
|
query: inputValueProp ?? ""
|
|
2744
3062
|
},
|
|
2745
|
-
children: /* @__PURE__ */ (0,
|
|
2746
|
-
|
|
3063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3064
|
+
import_material23.Autocomplete,
|
|
2747
3065
|
{
|
|
2748
3066
|
options,
|
|
2749
3067
|
inputValue: inputValueProp,
|
|
2750
3068
|
loading,
|
|
2751
3069
|
onChange: handleChange,
|
|
2752
3070
|
onInputChange: handleInputChange,
|
|
2753
|
-
loadingText: /* @__PURE__ */ (0,
|
|
3071
|
+
loadingText: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.Typography, { variant: "body2", color: "text.secondary", children: "Loading\u2026" }),
|
|
2754
3072
|
freeSolo: true,
|
|
2755
3073
|
filterOptions: (x) => x,
|
|
2756
3074
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -2774,8 +3092,8 @@ function BiampGlobalSearch({
|
|
|
2774
3092
|
}
|
|
2775
3093
|
}
|
|
2776
3094
|
},
|
|
2777
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
2778
|
-
|
|
3095
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3096
|
+
import_material23.TextField,
|
|
2779
3097
|
{
|
|
2780
3098
|
...params,
|
|
2781
3099
|
placeholder,
|
|
@@ -2790,15 +3108,15 @@ function BiampGlobalSearch({
|
|
|
2790
3108
|
slotProps: {
|
|
2791
3109
|
input: {
|
|
2792
3110
|
...params.InputProps,
|
|
2793
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
3111
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material23.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_assets12.SearchIcon, {}) }),
|
|
2795
3113
|
params.InputProps.startAdornment
|
|
2796
3114
|
] })
|
|
2797
3115
|
}
|
|
2798
3116
|
}
|
|
2799
3117
|
}
|
|
2800
3118
|
),
|
|
2801
|
-
renderOption: (optionProps, option) => /* @__PURE__ */ (0,
|
|
3119
|
+
renderOption: (optionProps, option) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2802
3120
|
BiampGlobalSearchListItem,
|
|
2803
3121
|
{
|
|
2804
3122
|
option,
|
|
@@ -2814,10 +3132,10 @@ function BiampGlobalSearch({
|
|
|
2814
3132
|
}
|
|
2815
3133
|
|
|
2816
3134
|
// src/UserInitialsIcon/UserInitialsIcon.tsx
|
|
2817
|
-
var
|
|
3135
|
+
var import_material24 = require("@mui/material");
|
|
2818
3136
|
var import_styles2 = require("@mui/material/styles");
|
|
2819
3137
|
var import_randomcolor = __toESM(require_randomColor(), 1);
|
|
2820
|
-
var
|
|
3138
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2821
3139
|
var DEFAULT_SIZE = 40;
|
|
2822
3140
|
var DEFAULT_BORDER_RADIUS = 1.5;
|
|
2823
3141
|
var TEXT_RATIO = 0.4;
|
|
@@ -2835,8 +3153,8 @@ function UserInitialsIcon({
|
|
|
2835
3153
|
const textColor = (0, import_styles2.darken)((0, import_randomcolor.default)({ luminosity: "dark", seed: id }), 0.3);
|
|
2836
3154
|
const size = typeof width === "number" ? width : DEFAULT_SIZE;
|
|
2837
3155
|
const fontSize = size * TEXT_RATIO;
|
|
2838
|
-
return /* @__PURE__ */ (0,
|
|
2839
|
-
|
|
3156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3157
|
+
import_material24.Box,
|
|
2840
3158
|
{
|
|
2841
3159
|
minWidth: width,
|
|
2842
3160
|
width,
|
|
@@ -2849,8 +3167,8 @@ function UserInitialsIcon({
|
|
|
2849
3167
|
justifyContent: "center",
|
|
2850
3168
|
sx: { ...sx },
|
|
2851
3169
|
...props,
|
|
2852
|
-
children: /* @__PURE__ */ (0,
|
|
2853
|
-
|
|
3170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3171
|
+
import_material24.Typography,
|
|
2854
3172
|
{
|
|
2855
3173
|
variant: "h3",
|
|
2856
3174
|
color: textColor,
|
|
@@ -2872,9 +3190,9 @@ var getInitials = (name) => {
|
|
|
2872
3190
|
};
|
|
2873
3191
|
|
|
2874
3192
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
2875
|
-
var
|
|
2876
|
-
var
|
|
2877
|
-
var
|
|
3193
|
+
var import_material25 = require("@mui/material");
|
|
3194
|
+
var import_react15 = require("react");
|
|
3195
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2878
3196
|
var svgCache = /* @__PURE__ */ new Map();
|
|
2879
3197
|
function clearDynamicSvgIconCache() {
|
|
2880
3198
|
svgCache.clear();
|
|
@@ -2885,17 +3203,17 @@ function applyCurrentColor(svg) {
|
|
|
2885
3203
|
function useDynamicSvgIcon(url, options = {}) {
|
|
2886
3204
|
const { replaceColors = false, onLoad, onError } = options;
|
|
2887
3205
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
2888
|
-
const [svgContent, setSvgContent] = (0,
|
|
3206
|
+
const [svgContent, setSvgContent] = (0, import_react15.useState)(() => {
|
|
2889
3207
|
const cached = svgCache.get(url);
|
|
2890
3208
|
return cached ? transform(cached.innerContent) : null;
|
|
2891
3209
|
});
|
|
2892
|
-
const [svgViewBox, setSvgViewBox] = (0,
|
|
3210
|
+
const [svgViewBox, setSvgViewBox] = (0, import_react15.useState)(() => {
|
|
2893
3211
|
const cached = svgCache.get(url);
|
|
2894
3212
|
return cached?.viewBox ?? null;
|
|
2895
3213
|
});
|
|
2896
|
-
const [loading, setLoading] = (0,
|
|
2897
|
-
const [error, setError] = (0,
|
|
2898
|
-
(0,
|
|
3214
|
+
const [loading, setLoading] = (0, import_react15.useState)(() => !svgCache.has(url));
|
|
3215
|
+
const [error, setError] = (0, import_react15.useState)(null);
|
|
3216
|
+
(0, import_react15.useEffect)(() => {
|
|
2899
3217
|
if (!url) {
|
|
2900
3218
|
setLoading(false);
|
|
2901
3219
|
setError("No URL provided");
|
|
@@ -2976,8 +3294,8 @@ function DynamicSvgIcon({
|
|
|
2976
3294
|
onError
|
|
2977
3295
|
});
|
|
2978
3296
|
if (loading) {
|
|
2979
|
-
return /* @__PURE__ */ (0,
|
|
2980
|
-
|
|
3297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3298
|
+
import_material25.Skeleton,
|
|
2981
3299
|
{
|
|
2982
3300
|
variant: skeletonVariant,
|
|
2983
3301
|
animation: skeletonAnimation,
|
|
@@ -2986,8 +3304,8 @@ function DynamicSvgIcon({
|
|
|
2986
3304
|
);
|
|
2987
3305
|
}
|
|
2988
3306
|
if (error || !svgContent) {
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2990
|
-
|
|
3307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3308
|
+
import_material25.Box,
|
|
2991
3309
|
{
|
|
2992
3310
|
sx: {
|
|
2993
3311
|
width,
|
|
@@ -3006,8 +3324,8 @@ function DynamicSvgIcon({
|
|
|
3006
3324
|
}
|
|
3007
3325
|
);
|
|
3008
3326
|
}
|
|
3009
|
-
return /* @__PURE__ */ (0,
|
|
3010
|
-
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3328
|
+
import_material25.SvgIcon,
|
|
3011
3329
|
{
|
|
3012
3330
|
...svgIconProps,
|
|
3013
3331
|
...svgViewBox && { viewBox: svgViewBox },
|
|
@@ -3016,7 +3334,7 @@ function DynamicSvgIcon({
|
|
|
3016
3334
|
width,
|
|
3017
3335
|
height
|
|
3018
3336
|
},
|
|
3019
|
-
children: /* @__PURE__ */ (0,
|
|
3337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
3020
3338
|
}
|
|
3021
3339
|
);
|
|
3022
3340
|
}
|