@bwp-web/components 1.11.0 → 2.0.0-alpha.1
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 +4 -8
- package/dist/BiampBanner/BiampBanner.d.ts +4 -4
- package/dist/BiampBanner/BiampBanner.d.ts.map +1 -1
- package/dist/BiampCheckboxListPopover/BiampCheckboxListPopover.d.ts +1 -1
- package/dist/BiampCheckboxListPopover/BiampCheckboxListPopover.d.ts.map +1 -1
- package/dist/BiampGlobalSearch/BiampGlobalSearch.d.ts +1 -1
- package/dist/BiampGlobalSearch/BiampGlobalSearch.d.ts.map +1 -1
- package/dist/BiampHeader/BiampHeader.d.ts +11 -38
- package/dist/BiampHeader/BiampHeader.d.ts.map +1 -1
- package/dist/BiampHeader/index.d.ts +1 -1
- package/dist/BiampHeader/index.d.ts.map +1 -1
- package/dist/BiampLayout/BiampLayout.d.ts +1 -1
- package/dist/BiampLayout/BiampLayout.d.ts.map +1 -1
- package/dist/BiampListPopover/BiampListPopover.d.ts +3 -3
- package/dist/BiampListPopover/BiampListPopover.d.ts.map +1 -1
- package/dist/BiampNotificationPopover/BiampNotificationPopover.d.ts +3 -3
- package/dist/BiampNotificationPopover/BiampNotificationPopover.d.ts.map +1 -1
- package/dist/BiampSegmentedButton/SegmentedButton.d.ts +1 -1
- package/dist/BiampSegmentedButton/SegmentedButton.d.ts.map +1 -1
- package/dist/BiampSegmentedButton/SegmentedButtonGroup.d.ts +1 -1
- package/dist/BiampSegmentedButton/SegmentedButtonGroup.d.ts.map +1 -1
- package/dist/BiampSidebar/BiampSidebar.d.ts +4 -4
- package/dist/BiampSidebar/BiampSidebar.d.ts.map +1 -1
- package/dist/BiampTable/BiampTable.d.ts +23 -2
- package/dist/BiampTable/BiampTable.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableCellActionButton.d.ts +1 -1
- package/dist/BiampTable/BiampTableCellActionButton.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableColumnVisibility.d.ts +1 -1
- package/dist/BiampTable/BiampTableColumnVisibility.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableContainer.d.ts +1 -1
- package/dist/BiampTable/BiampTableContainer.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableEmptyState.d.ts +1 -1
- package/dist/BiampTable/BiampTableEmptyState.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableErrorState.d.ts +1 -1
- package/dist/BiampTable/BiampTableErrorState.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts +1 -1
- package/dist/BiampTable/BiampTableExpandGuidelines.d.ts.map +1 -1
- package/dist/BiampTable/BiampTablePagination.d.ts +1 -1
- package/dist/BiampTable/BiampTablePagination.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableRow.d.ts +2 -1
- package/dist/BiampTable/BiampTableRow.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableStatusMessage.d.ts +1 -1
- package/dist/BiampTable/BiampTableStatusMessage.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbar.d.ts +1 -1
- package/dist/BiampTable/BiampTableToolbar.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarActionButton.d.ts +1 -1
- package/dist/BiampTable/BiampTableToolbarActionButton.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarActions.d.ts +1 -1
- package/dist/BiampTable/BiampTableToolbarActions.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarColumnVisibility.d.ts +2 -2
- package/dist/BiampTable/BiampTableToolbarColumnVisibility.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarExport.d.ts +2 -2
- package/dist/BiampTable/BiampTableToolbarExport.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarFilters.d.ts +1 -1
- package/dist/BiampTable/BiampTableToolbarFilters.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableToolbarSearch.d.ts +1 -1
- package/dist/BiampTable/BiampTableToolbarSearch.d.ts.map +1 -1
- package/dist/BiampTable/BiampTableTruncatedCell.d.ts +1 -1
- package/dist/BiampTable/BiampTableTruncatedCell.d.ts.map +1 -1
- package/dist/BiampTable/useDebouncedCallback.d.ts.map +1 -1
- package/dist/BiampWrapper/BiampWrapper.d.ts +1 -1
- package/dist/BiampWrapper/BiampWrapper.d.ts.map +1 -1
- package/dist/DynamicSvgIcon/DynamicSvgIcon.d.ts +1 -1
- package/dist/DynamicSvgIcon/DynamicSvgIcon.d.ts.map +1 -1
- package/dist/LandingPage/LandingFormPanel.d.ts +4 -4
- package/dist/LandingPage/LandingFormPanel.d.ts.map +1 -1
- package/dist/LandingPage/OrganizationsPanel.d.ts +4 -4
- package/dist/LandingPage/OrganizationsPanel.d.ts.map +1 -1
- package/dist/OrganizationSelector/OrganizationSelector.d.ts +5 -5
- package/dist/OrganizationSelector/OrganizationSelector.d.ts.map +1 -1
- package/dist/UserInitialsIcon/UserInitialsIcon.d.ts +7 -1
- package/dist/UserInitialsIcon/UserInitialsIcon.d.ts.map +1 -1
- package/dist/hooks/useLoadingDelay.d.ts.map +1 -1
- package/dist/index.cjs +1049 -793
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1027 -766
- package/dist/index.js.map +1 -1
- package/dist/slotProps.d.ts +5 -5
- package/dist/slotProps.d.ts.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -395,36 +395,34 @@ var require_randomColor = __commonJS({
|
|
|
395
395
|
import { Box, LinearProgress, Stack } from "@mui/material";
|
|
396
396
|
|
|
397
397
|
// src/hooks/useLoadingDelay.ts
|
|
398
|
-
import { useEffect,
|
|
398
|
+
import { useEffect, useState } from "react";
|
|
399
399
|
function useLoadingDelay(loading, { delay = 150, minDuration = 500 } = {}) {
|
|
400
400
|
const [status, setStatus] = useState("idle");
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
timeoutRef.current = null;
|
|
406
|
-
}
|
|
401
|
+
if (loading && status === "idle") {
|
|
402
|
+
setStatus("delaying");
|
|
403
|
+
} else if (!loading && (status === "delaying" || status === "ending")) {
|
|
404
|
+
setStatus("idle");
|
|
407
405
|
}
|
|
408
406
|
useEffect(() => {
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}, delay);
|
|
417
|
-
setStatus("delaying");
|
|
418
|
-
}
|
|
419
|
-
if (!loading && status !== "loading") {
|
|
420
|
-
clearPending();
|
|
421
|
-
setStatus("idle");
|
|
422
|
-
}
|
|
423
|
-
}, [loading, delay, minDuration, status]);
|
|
424
|
-
useEffect(() => clearPending, []);
|
|
407
|
+
if (status !== "delaying" && status !== "loading") return;
|
|
408
|
+
const timeout = setTimeout(
|
|
409
|
+
() => setStatus(status === "delaying" ? "loading" : "ending"),
|
|
410
|
+
status === "delaying" ? delay : minDuration
|
|
411
|
+
);
|
|
412
|
+
return () => clearTimeout(timeout);
|
|
413
|
+
}, [status, delay, minDuration]);
|
|
425
414
|
return status === "loading" || status === "ending";
|
|
426
415
|
}
|
|
427
416
|
|
|
417
|
+
// src/slotProps.ts
|
|
418
|
+
function resolveSlot(slot, ctx) {
|
|
419
|
+
if (!slot) return void 0;
|
|
420
|
+
return typeof slot === "function" ? slot(ctx) : slot;
|
|
421
|
+
}
|
|
422
|
+
function mergeSx(...inputs) {
|
|
423
|
+
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
424
|
+
}
|
|
425
|
+
|
|
428
426
|
// src/BiampWrapper/BiampWrapper.tsx
|
|
429
427
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
430
428
|
function BiampWrapper({
|
|
@@ -439,19 +437,21 @@ function BiampWrapper({
|
|
|
439
437
|
Stack,
|
|
440
438
|
{
|
|
441
439
|
direction: "column",
|
|
442
|
-
padding: "16px",
|
|
443
|
-
sx: {
|
|
444
|
-
position: "relative",
|
|
445
|
-
flex: 1,
|
|
446
|
-
height: "100%",
|
|
447
|
-
width: "100%",
|
|
448
|
-
borderRadius: "8px",
|
|
449
|
-
overflow: "auto",
|
|
450
|
-
overscrollBehavior: "none",
|
|
451
|
-
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.common.white,
|
|
452
|
-
...sx
|
|
453
|
-
},
|
|
454
440
|
...props,
|
|
441
|
+
sx: mergeSx(
|
|
442
|
+
{
|
|
443
|
+
padding: "16px",
|
|
444
|
+
position: "relative",
|
|
445
|
+
flex: 1,
|
|
446
|
+
height: "100%",
|
|
447
|
+
width: "100%",
|
|
448
|
+
borderRadius: "8px",
|
|
449
|
+
overflow: "auto",
|
|
450
|
+
overscrollBehavior: "none",
|
|
451
|
+
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[800] : palette.common.white
|
|
452
|
+
},
|
|
453
|
+
sx
|
|
454
|
+
),
|
|
455
455
|
children: [
|
|
456
456
|
showLoading && /* @__PURE__ */ jsx(
|
|
457
457
|
Box,
|
|
@@ -538,24 +538,28 @@ function BiampLayout({
|
|
|
538
538
|
Stack2,
|
|
539
539
|
{
|
|
540
540
|
direction: "column",
|
|
541
|
-
height: "100vh",
|
|
542
|
-
sx: {
|
|
543
|
-
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[900] : palette.grey[100],
|
|
544
|
-
...sx
|
|
545
|
-
},
|
|
546
541
|
...props,
|
|
542
|
+
sx: mergeSx(
|
|
543
|
+
{
|
|
544
|
+
height: "100vh",
|
|
545
|
+
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[900] : palette.grey[100]
|
|
546
|
+
},
|
|
547
|
+
sx
|
|
548
|
+
),
|
|
547
549
|
children: [
|
|
548
550
|
header,
|
|
549
551
|
/* @__PURE__ */ jsxs2(
|
|
550
552
|
Stack2,
|
|
551
553
|
{
|
|
552
554
|
direction: "row",
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
555
|
+
sx: {
|
|
556
|
+
flex: 1,
|
|
557
|
+
minHeight: 0,
|
|
558
|
+
gap: { xs: 1.5, md: 2.5 },
|
|
559
|
+
px: { xs: 1.5, md: 2.5 },
|
|
560
|
+
pb: { xs: 1.5, md: 2.5 },
|
|
561
|
+
pt: { xs: header ? 0 : 1.5, md: header ? 0 : 2.5 }
|
|
562
|
+
},
|
|
559
563
|
children: [
|
|
560
564
|
!isDrawer && !(responsive && mobileSidebarOnly) && sidebar,
|
|
561
565
|
children
|
|
@@ -583,9 +587,13 @@ function BiampLayout({
|
|
|
583
587
|
Stack2,
|
|
584
588
|
{
|
|
585
589
|
direction: "row",
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
590
|
+
sx: {
|
|
591
|
+
alignItems: "center",
|
|
592
|
+
gap: 1,
|
|
593
|
+
height: 40,
|
|
594
|
+
mb: 1.5,
|
|
595
|
+
flexShrink: 0
|
|
596
|
+
},
|
|
589
597
|
children: [
|
|
590
598
|
/* @__PURE__ */ jsx2(
|
|
591
599
|
IconButton,
|
|
@@ -647,16 +655,18 @@ function BiampSidebar({
|
|
|
647
655
|
return /* @__PURE__ */ jsx3(BiampSidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ jsxs3(
|
|
648
656
|
Stack3,
|
|
649
657
|
{
|
|
650
|
-
sx:
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
sx: mergeSx(
|
|
659
|
+
{
|
|
660
|
+
width,
|
|
661
|
+
minWidth: width,
|
|
662
|
+
height: "100%",
|
|
663
|
+
transition: ({ transitions }) => transitions.create(["width", "min-width"], {
|
|
664
|
+
easing: transitions.easing.sharp,
|
|
665
|
+
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
666
|
+
})
|
|
667
|
+
},
|
|
668
|
+
sx
|
|
669
|
+
),
|
|
660
670
|
...props,
|
|
661
671
|
children: [
|
|
662
672
|
/* @__PURE__ */ jsx3(Stack3, { sx: { flex: 1, minHeight: 0 }, children }),
|
|
@@ -682,9 +692,12 @@ function BiampSidebar({
|
|
|
682
692
|
Stack3,
|
|
683
693
|
{
|
|
684
694
|
direction: "row",
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
695
|
+
sx: {
|
|
696
|
+
alignItems: "center",
|
|
697
|
+
justifyContent: "space-between",
|
|
698
|
+
mt: 2,
|
|
699
|
+
overflow: "hidden"
|
|
700
|
+
},
|
|
688
701
|
children: [
|
|
689
702
|
bottomLogoIcon ?? /* @__PURE__ */ jsx3(
|
|
690
703
|
BiampLogoIcon,
|
|
@@ -696,10 +709,10 @@ function BiampSidebar({
|
|
|
696
709
|
Typography,
|
|
697
710
|
{
|
|
698
711
|
variant: "caption",
|
|
699
|
-
fontWeight: 500,
|
|
700
|
-
color: "text.secondary",
|
|
701
712
|
noWrap: true,
|
|
702
713
|
sx: {
|
|
714
|
+
fontWeight: 500,
|
|
715
|
+
color: "text.secondary",
|
|
703
716
|
opacity: expanded ? 1 : 0,
|
|
704
717
|
transition: ({ transitions }) => transitions.create("opacity", {
|
|
705
718
|
duration: expanded ? transitions.duration.enteringScreen : transitions.duration.leavingScreen
|
|
@@ -723,14 +736,16 @@ function BiampSidebarIconList({
|
|
|
723
736
|
return /* @__PURE__ */ jsx3(
|
|
724
737
|
Stack3,
|
|
725
738
|
{
|
|
726
|
-
sx:
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
739
|
+
sx: mergeSx(
|
|
740
|
+
{
|
|
741
|
+
flex: 1,
|
|
742
|
+
minHeight: 0,
|
|
743
|
+
gap: "4px",
|
|
744
|
+
overflowY: "auto",
|
|
745
|
+
overscrollBehavior: "none"
|
|
746
|
+
},
|
|
747
|
+
sx
|
|
748
|
+
),
|
|
734
749
|
...props,
|
|
735
750
|
children
|
|
736
751
|
}
|
|
@@ -761,21 +776,23 @@ function BiampSidebarIcon({
|
|
|
761
776
|
layoutDrawer.setOpen(false);
|
|
762
777
|
}
|
|
763
778
|
},
|
|
764
|
-
sx:
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
779
|
+
sx: mergeSx(
|
|
780
|
+
{
|
|
781
|
+
minWidth: "48px",
|
|
782
|
+
minHeight: "48px",
|
|
783
|
+
maxHeight: "48px",
|
|
784
|
+
borderRadius: "8px",
|
|
785
|
+
justifyContent: "flex-start",
|
|
786
|
+
alignItems: "center",
|
|
787
|
+
padding: 0,
|
|
788
|
+
overflow: "hidden",
|
|
789
|
+
color: "text.secondary",
|
|
790
|
+
"&.Mui-selected": {
|
|
791
|
+
color: "primary.main"
|
|
792
|
+
}
|
|
776
793
|
},
|
|
777
|
-
|
|
778
|
-
|
|
794
|
+
sx
|
|
795
|
+
),
|
|
779
796
|
...props,
|
|
780
797
|
children: [
|
|
781
798
|
/* @__PURE__ */ jsx3(
|
|
@@ -805,10 +822,10 @@ function BiampSidebarIcon({
|
|
|
805
822
|
Typography,
|
|
806
823
|
{
|
|
807
824
|
variant: "body1",
|
|
808
|
-
fontWeight: 600,
|
|
809
|
-
color: "inherit",
|
|
810
825
|
noWrap: true,
|
|
811
826
|
sx: {
|
|
827
|
+
fontWeight: 600,
|
|
828
|
+
color: "inherit",
|
|
812
829
|
pr: 2,
|
|
813
830
|
opacity: expanded ? 1 : 0,
|
|
814
831
|
transition: ({ transitions }) => transitions.create("opacity", {
|
|
@@ -830,18 +847,20 @@ function BiampSidebarComponent({
|
|
|
830
847
|
return /* @__PURE__ */ jsx3(
|
|
831
848
|
Box2,
|
|
832
849
|
{
|
|
833
|
-
sx:
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
850
|
+
sx: mergeSx(
|
|
851
|
+
{
|
|
852
|
+
minWidth: "48px",
|
|
853
|
+
maxWidth: "48px",
|
|
854
|
+
minHeight: "48px",
|
|
855
|
+
maxHeight: "48px",
|
|
856
|
+
borderRadius: "8px",
|
|
857
|
+
overflow: "hidden",
|
|
858
|
+
justifyContent: "center",
|
|
859
|
+
alignItems: "center",
|
|
860
|
+
border: ({ palette }) => `0.6px solid ${palette.divider}`
|
|
861
|
+
},
|
|
862
|
+
sx
|
|
863
|
+
),
|
|
845
864
|
...props,
|
|
846
865
|
children
|
|
847
866
|
}
|
|
@@ -859,7 +878,6 @@ import {
|
|
|
859
878
|
Stack as Stack4,
|
|
860
879
|
Typography as Typography3
|
|
861
880
|
} from "@mui/material";
|
|
862
|
-
import { Children } from "react";
|
|
863
881
|
import { BiampRedLogo, ColumnsIcon, ExternalLinkIcon } from "@bwp-web/assets";
|
|
864
882
|
|
|
865
883
|
// src/BiampGlobalSearch/BiampGlobalSearch.tsx
|
|
@@ -874,6 +892,7 @@ import {
|
|
|
874
892
|
Typography as Typography2,
|
|
875
893
|
useMediaQuery as useMediaQuery2
|
|
876
894
|
} from "@mui/material";
|
|
895
|
+
import { mergeSlotProps } from "@mui/material/utils";
|
|
877
896
|
import { KeyArrowDownIcon, KeyArrowUpIcon, SearchIcon } from "@bwp-web/assets";
|
|
878
897
|
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
879
898
|
var SearchContext = createContext3({
|
|
@@ -919,8 +938,11 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
919
938
|
Typography2,
|
|
920
939
|
{
|
|
921
940
|
variant: "body2",
|
|
922
|
-
|
|
923
|
-
|
|
941
|
+
sx: {
|
|
942
|
+
color: "text.secondary",
|
|
943
|
+
px: 2,
|
|
944
|
+
py: 1.5
|
|
945
|
+
},
|
|
924
946
|
children: noResultsText
|
|
925
947
|
}
|
|
926
948
|
),
|
|
@@ -944,8 +966,10 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
944
966
|
Typography2,
|
|
945
967
|
{
|
|
946
968
|
variant: "caption",
|
|
947
|
-
|
|
948
|
-
|
|
969
|
+
sx: {
|
|
970
|
+
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
971
|
+
color: "text.secondary"
|
|
972
|
+
},
|
|
949
973
|
children: "Select"
|
|
950
974
|
}
|
|
951
975
|
)
|
|
@@ -956,8 +980,10 @@ var BiampGlobalSearchPaper = forwardRef(
|
|
|
956
980
|
Typography2,
|
|
957
981
|
{
|
|
958
982
|
variant: "caption",
|
|
959
|
-
|
|
960
|
-
|
|
983
|
+
sx: {
|
|
984
|
+
fontWeight: (theme) => theme.typography.fontWeightMedium,
|
|
985
|
+
color: "text.secondary"
|
|
986
|
+
},
|
|
961
987
|
children: "Open"
|
|
962
988
|
}
|
|
963
989
|
)
|
|
@@ -1043,9 +1069,13 @@ function BiampGlobalSearchListItem({
|
|
|
1043
1069
|
{
|
|
1044
1070
|
className: "hoverContent",
|
|
1045
1071
|
variant: "body2",
|
|
1046
|
-
color: "text.secondary",
|
|
1047
1072
|
noWrap: true,
|
|
1048
|
-
sx: {
|
|
1073
|
+
sx: {
|
|
1074
|
+
color: "text.secondary",
|
|
1075
|
+
flexShrink: 1,
|
|
1076
|
+
minWidth: 0,
|
|
1077
|
+
display: "none"
|
|
1078
|
+
},
|
|
1049
1079
|
children: option.subtitle
|
|
1050
1080
|
}
|
|
1051
1081
|
),
|
|
@@ -1138,6 +1168,7 @@ function BiampGlobalSearch({
|
|
|
1138
1168
|
onChange,
|
|
1139
1169
|
onInputChange,
|
|
1140
1170
|
sx,
|
|
1171
|
+
slotProps,
|
|
1141
1172
|
...props
|
|
1142
1173
|
}) {
|
|
1143
1174
|
const hasOptions = options.length > 0;
|
|
@@ -1178,25 +1209,36 @@ function BiampGlobalSearch({
|
|
|
1178
1209
|
inputValue,
|
|
1179
1210
|
loading,
|
|
1180
1211
|
fullWidth,
|
|
1181
|
-
sx:
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1212
|
+
sx: mergeSx(
|
|
1213
|
+
{
|
|
1214
|
+
px: 1.5,
|
|
1215
|
+
"& .MuiOutlinedInput-root": {
|
|
1216
|
+
height: "40px !important",
|
|
1217
|
+
minHeight: "40px"
|
|
1218
|
+
},
|
|
1219
|
+
"& .MuiOutlinedInput-input": {
|
|
1220
|
+
height: "40px !important"
|
|
1221
|
+
},
|
|
1222
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
1223
|
+
height: "40px !important",
|
|
1224
|
+
border: "none",
|
|
1225
|
+
boxShadow: "none"
|
|
1226
|
+
}
|
|
1194
1227
|
},
|
|
1195
|
-
|
|
1196
|
-
|
|
1228
|
+
sx
|
|
1229
|
+
),
|
|
1197
1230
|
onChange: handleChange,
|
|
1198
1231
|
onInputChange: handleInputChange,
|
|
1199
|
-
loadingText: /* @__PURE__ */ jsx4(
|
|
1232
|
+
loadingText: /* @__PURE__ */ jsx4(
|
|
1233
|
+
Typography2,
|
|
1234
|
+
{
|
|
1235
|
+
variant: "body2",
|
|
1236
|
+
sx: {
|
|
1237
|
+
color: "text.secondary"
|
|
1238
|
+
},
|
|
1239
|
+
children: "Loading\u2026"
|
|
1240
|
+
}
|
|
1241
|
+
),
|
|
1200
1242
|
freeSolo: true,
|
|
1201
1243
|
filterOptions: (x) => x,
|
|
1202
1244
|
getOptionLabel: (option) => typeof option === "string" ? option : option.title,
|
|
@@ -1204,7 +1246,14 @@ function BiampGlobalSearch({
|
|
|
1204
1246
|
noOptionsText: noResultsText,
|
|
1205
1247
|
slots: { paper: BiampGlobalSearchPaper },
|
|
1206
1248
|
slotProps: {
|
|
1207
|
-
|
|
1249
|
+
...slotProps,
|
|
1250
|
+
// In freeSolo mode MUI 9 skips the Popper when there are no options
|
|
1251
|
+
// (unless `keepMounted`), so the Paper's `noResultsText` would never
|
|
1252
|
+
// show. A closed, kept-mounted Popper is `display: none`.
|
|
1253
|
+
popper: mergeSlotProps(slotProps?.popper, {
|
|
1254
|
+
keepMounted: !hasOptions
|
|
1255
|
+
}),
|
|
1256
|
+
listbox: mergeSlotProps(slotProps?.listbox, {
|
|
1208
1257
|
sx: {
|
|
1209
1258
|
"& .MuiAutocomplete-option": {
|
|
1210
1259
|
paddingRight: "0px !important"
|
|
@@ -1219,7 +1268,7 @@ function BiampGlobalSearch({
|
|
|
1219
1268
|
visibility: "visible"
|
|
1220
1269
|
}
|
|
1221
1270
|
}
|
|
1222
|
-
}
|
|
1271
|
+
})
|
|
1223
1272
|
},
|
|
1224
1273
|
renderInput: (params) => /* @__PURE__ */ jsx4(
|
|
1225
1274
|
TextField,
|
|
@@ -1232,11 +1281,12 @@ function BiampGlobalSearch({
|
|
|
1232
1281
|
"& .MuiInputBase-input": { paddingLeft: "8px !important" }
|
|
1233
1282
|
},
|
|
1234
1283
|
slotProps: {
|
|
1284
|
+
...params.slotProps,
|
|
1235
1285
|
input: {
|
|
1236
|
-
...params.
|
|
1286
|
+
...params.slotProps.input,
|
|
1237
1287
|
startAdornment: /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1238
1288
|
/* @__PURE__ */ jsx4(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx4(SearchIcon, {}) }),
|
|
1239
|
-
params.
|
|
1289
|
+
params.slotProps.input.startAdornment
|
|
1240
1290
|
] })
|
|
1241
1291
|
}
|
|
1242
1292
|
}
|
|
@@ -1264,10 +1314,16 @@ function BiampHeader({ children, sx, ...props }) {
|
|
|
1264
1314
|
Stack4,
|
|
1265
1315
|
{
|
|
1266
1316
|
direction: "row",
|
|
1267
|
-
alignItems: "center",
|
|
1268
|
-
gap: { xs: 0.5, md: 3 },
|
|
1269
|
-
sx: { px: 2.5, py: 1.5, ...sx },
|
|
1270
1317
|
...props,
|
|
1318
|
+
sx: mergeSx(
|
|
1319
|
+
{
|
|
1320
|
+
alignItems: "center",
|
|
1321
|
+
gap: { xs: 0.5, md: 3 },
|
|
1322
|
+
px: 2.5,
|
|
1323
|
+
py: 1.5
|
|
1324
|
+
},
|
|
1325
|
+
sx
|
|
1326
|
+
),
|
|
1271
1327
|
children
|
|
1272
1328
|
}
|
|
1273
1329
|
);
|
|
@@ -1282,12 +1338,7 @@ function BiampHeaderTitle({
|
|
|
1282
1338
|
return /* @__PURE__ */ jsxs5(
|
|
1283
1339
|
Box4,
|
|
1284
1340
|
{
|
|
1285
|
-
sx: {
|
|
1286
|
-
display: "flex",
|
|
1287
|
-
alignItems: "center",
|
|
1288
|
-
gap: "12px",
|
|
1289
|
-
...sx
|
|
1290
|
-
},
|
|
1341
|
+
sx: mergeSx({ display: "flex", alignItems: "center", gap: "12px" }, sx),
|
|
1291
1342
|
...props,
|
|
1292
1343
|
children: [
|
|
1293
1344
|
icon ? /* @__PURE__ */ jsx5(
|
|
@@ -1311,10 +1362,28 @@ function BiampHeaderTitle({
|
|
|
1311
1362
|
sx: { width: 24, height: 24 }
|
|
1312
1363
|
}
|
|
1313
1364
|
),
|
|
1314
|
-
/* @__PURE__ */ jsxs5(
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1365
|
+
/* @__PURE__ */ jsxs5(
|
|
1366
|
+
Stack4,
|
|
1367
|
+
{
|
|
1368
|
+
direction: "row",
|
|
1369
|
+
sx: {
|
|
1370
|
+
gap: 0.5
|
|
1371
|
+
},
|
|
1372
|
+
children: [
|
|
1373
|
+
title && /* @__PURE__ */ jsx5(Typography3, { variant: "h4", children: title }),
|
|
1374
|
+
subtitle && /* @__PURE__ */ jsx5(
|
|
1375
|
+
Typography3,
|
|
1376
|
+
{
|
|
1377
|
+
variant: "h4",
|
|
1378
|
+
sx: {
|
|
1379
|
+
color: "text.secondary"
|
|
1380
|
+
},
|
|
1381
|
+
children: subtitle
|
|
1382
|
+
}
|
|
1383
|
+
)
|
|
1384
|
+
]
|
|
1385
|
+
}
|
|
1386
|
+
)
|
|
1318
1387
|
]
|
|
1319
1388
|
}
|
|
1320
1389
|
);
|
|
@@ -1333,13 +1402,15 @@ function BiampHeaderActions({
|
|
|
1333
1402
|
return /* @__PURE__ */ jsx5(
|
|
1334
1403
|
Box4,
|
|
1335
1404
|
{
|
|
1336
|
-
sx:
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1405
|
+
sx: mergeSx(
|
|
1406
|
+
{
|
|
1407
|
+
ml: "auto",
|
|
1408
|
+
gap: { xs: 1, md: 2 },
|
|
1409
|
+
display: "flex",
|
|
1410
|
+
alignItems: "center"
|
|
1411
|
+
},
|
|
1412
|
+
sx
|
|
1413
|
+
),
|
|
1343
1414
|
...props,
|
|
1344
1415
|
children
|
|
1345
1416
|
}
|
|
@@ -1353,12 +1424,10 @@ function BiampHeaderButtonList({
|
|
|
1353
1424
|
return /* @__PURE__ */ jsx5(
|
|
1354
1425
|
Box4,
|
|
1355
1426
|
{
|
|
1356
|
-
sx:
|
|
1357
|
-
display: "flex",
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
...sx
|
|
1361
|
-
},
|
|
1427
|
+
sx: mergeSx(
|
|
1428
|
+
{ display: "flex", alignItems: "center", gap: { xs: 0, md: 0.5 } },
|
|
1429
|
+
sx
|
|
1430
|
+
),
|
|
1362
1431
|
...props,
|
|
1363
1432
|
children
|
|
1364
1433
|
}
|
|
@@ -1407,16 +1476,18 @@ function BiampHeaderButton({
|
|
|
1407
1476
|
selected,
|
|
1408
1477
|
disableGutters: true,
|
|
1409
1478
|
disableRipple: true,
|
|
1410
|
-
sx:
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1479
|
+
sx: mergeSx(
|
|
1480
|
+
{
|
|
1481
|
+
minWidth: "40px",
|
|
1482
|
+
maxWidth: "40px",
|
|
1483
|
+
minHeight: "40px",
|
|
1484
|
+
maxHeight: "40px",
|
|
1485
|
+
borderRadius: "4px",
|
|
1486
|
+
justifyContent: "center",
|
|
1487
|
+
alignItems: "center"
|
|
1488
|
+
},
|
|
1489
|
+
sx
|
|
1490
|
+
),
|
|
1420
1491
|
...props,
|
|
1421
1492
|
children: selected ? displayedSelectedIcon : icon
|
|
1422
1493
|
}
|
|
@@ -1435,7 +1506,7 @@ function BiampAppPopover({
|
|
|
1435
1506
|
open,
|
|
1436
1507
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1437
1508
|
transformOrigin: { vertical: -4, horizontal: APP_POPOVER_MAX_WIDTH },
|
|
1438
|
-
sx
|
|
1509
|
+
sx,
|
|
1439
1510
|
slotProps: {
|
|
1440
1511
|
paper: {
|
|
1441
1512
|
sx: {
|
|
@@ -1459,120 +1530,6 @@ function BiampAppPopover({
|
|
|
1459
1530
|
}
|
|
1460
1531
|
);
|
|
1461
1532
|
}
|
|
1462
|
-
function BiampBuildAppContent({
|
|
1463
|
-
children,
|
|
1464
|
-
sx,
|
|
1465
|
-
...props
|
|
1466
|
-
}) {
|
|
1467
|
-
return /* @__PURE__ */ jsx5(
|
|
1468
|
-
Box4,
|
|
1469
|
-
{
|
|
1470
|
-
sx: {
|
|
1471
|
-
display: "grid",
|
|
1472
|
-
gridTemplateColumns: "1fr 1fr",
|
|
1473
|
-
gap: 1.5,
|
|
1474
|
-
...sx
|
|
1475
|
-
},
|
|
1476
|
-
...props,
|
|
1477
|
-
children
|
|
1478
|
-
}
|
|
1479
|
-
);
|
|
1480
|
-
}
|
|
1481
|
-
function BiampBuildAppContentItem({
|
|
1482
|
-
image,
|
|
1483
|
-
name,
|
|
1484
|
-
description,
|
|
1485
|
-
button,
|
|
1486
|
-
sx,
|
|
1487
|
-
...props
|
|
1488
|
-
}) {
|
|
1489
|
-
return /* @__PURE__ */ jsxs5(
|
|
1490
|
-
Stack4,
|
|
1491
|
-
{
|
|
1492
|
-
direction: "column",
|
|
1493
|
-
position: "relative",
|
|
1494
|
-
sx: {
|
|
1495
|
-
p: 1.5,
|
|
1496
|
-
borderRadius: 1.5,
|
|
1497
|
-
outlineWidth: "1px",
|
|
1498
|
-
outlineStyle: "solid",
|
|
1499
|
-
outlineColor: ({ palette }) => palette.dividers,
|
|
1500
|
-
...sx
|
|
1501
|
-
},
|
|
1502
|
-
...props,
|
|
1503
|
-
children: [
|
|
1504
|
-
/* @__PURE__ */ jsx5(Box4, { sx: { width: 54, height: 54 }, mb: 0.5, children: image }),
|
|
1505
|
-
/* @__PURE__ */ jsx5(Typography3, { variant: "caption", fontWeight: 600, mb: 0.5, children: name }),
|
|
1506
|
-
/* @__PURE__ */ jsx5(Typography3, { variant: "caption", color: "text.secondary", children: description }),
|
|
1507
|
-
button && /* @__PURE__ */ jsx5(Box4, { position: "absolute", top: "12px", right: "12px", children: button })
|
|
1508
|
-
]
|
|
1509
|
-
}
|
|
1510
|
-
);
|
|
1511
|
-
}
|
|
1512
|
-
function BiampEndUserAppContent({
|
|
1513
|
-
children,
|
|
1514
|
-
sx,
|
|
1515
|
-
...props
|
|
1516
|
-
}) {
|
|
1517
|
-
const isGrid = Children.count(children) > 1;
|
|
1518
|
-
return /* @__PURE__ */ jsx5(
|
|
1519
|
-
Stack4,
|
|
1520
|
-
{
|
|
1521
|
-
direction: "column",
|
|
1522
|
-
sx: {
|
|
1523
|
-
gap: 1.5,
|
|
1524
|
-
...isGrid && {
|
|
1525
|
-
display: "grid",
|
|
1526
|
-
gridTemplateColumns: "1fr 1fr"
|
|
1527
|
-
},
|
|
1528
|
-
...sx
|
|
1529
|
-
},
|
|
1530
|
-
...props,
|
|
1531
|
-
children
|
|
1532
|
-
}
|
|
1533
|
-
);
|
|
1534
|
-
}
|
|
1535
|
-
function BiampEndUserAppContentItem({
|
|
1536
|
-
image,
|
|
1537
|
-
name,
|
|
1538
|
-
description,
|
|
1539
|
-
href,
|
|
1540
|
-
target,
|
|
1541
|
-
sx,
|
|
1542
|
-
...props
|
|
1543
|
-
}) {
|
|
1544
|
-
return /* @__PURE__ */ jsxs5(
|
|
1545
|
-
Stack4,
|
|
1546
|
-
{
|
|
1547
|
-
component: href ? "a" : "div",
|
|
1548
|
-
href,
|
|
1549
|
-
target,
|
|
1550
|
-
direction: "row",
|
|
1551
|
-
alignItems: "center",
|
|
1552
|
-
sx: {
|
|
1553
|
-
gap: 1.5,
|
|
1554
|
-
p: 1.5,
|
|
1555
|
-
borderRadius: 1.5,
|
|
1556
|
-
outlineWidth: "1px",
|
|
1557
|
-
outlineStyle: "solid",
|
|
1558
|
-
outlineColor: ({ palette }) => palette.divider,
|
|
1559
|
-
textDecoration: "none",
|
|
1560
|
-
color: "inherit",
|
|
1561
|
-
cursor: href ? "pointer" : void 0,
|
|
1562
|
-
...sx
|
|
1563
|
-
},
|
|
1564
|
-
...props,
|
|
1565
|
-
children: [
|
|
1566
|
-
/* @__PURE__ */ jsx5(Box4, { sx: { width: 32, height: 32 }, children: image }),
|
|
1567
|
-
/* @__PURE__ */ jsxs5(Stack4, { direction: "column", children: [
|
|
1568
|
-
/* @__PURE__ */ jsx5(Typography3, { variant: "caption", fontWeight: 600, children: name }),
|
|
1569
|
-
/* @__PURE__ */ jsx5(Typography3, { variant: "caption", color: "text.secondary", children: description })
|
|
1570
|
-
] }),
|
|
1571
|
-
/* @__PURE__ */ jsx5(ExternalLinkIcon, { sx: { width: 16, height: 16, ml: "auto" } })
|
|
1572
|
-
]
|
|
1573
|
-
}
|
|
1574
|
-
);
|
|
1575
|
-
}
|
|
1576
1533
|
function BiampAppListContent({
|
|
1577
1534
|
children,
|
|
1578
1535
|
sx,
|
|
@@ -1588,12 +1545,14 @@ function BiampAppListContent({
|
|
|
1588
1545
|
sx: { borderColor: ({ palette }) => palette.dividers.secondary }
|
|
1589
1546
|
}
|
|
1590
1547
|
),
|
|
1591
|
-
sx:
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1548
|
+
sx: mergeSx(
|
|
1549
|
+
{
|
|
1550
|
+
borderRadius: 2,
|
|
1551
|
+
border: ({ palette }) => `1px solid ${palette.dividers.secondary}`,
|
|
1552
|
+
overflow: "hidden"
|
|
1553
|
+
},
|
|
1554
|
+
sx
|
|
1555
|
+
),
|
|
1597
1556
|
...props,
|
|
1598
1557
|
children
|
|
1599
1558
|
}
|
|
@@ -1612,12 +1571,29 @@ function BiampAppListItem({
|
|
|
1612
1571
|
Stack4,
|
|
1613
1572
|
{
|
|
1614
1573
|
direction: "row",
|
|
1615
|
-
alignItems: "center",
|
|
1616
|
-
sx: { gap: 1.5, py: 1.5, px: 2, ...sx },
|
|
1617
1574
|
...props,
|
|
1575
|
+
sx: mergeSx(
|
|
1576
|
+
{
|
|
1577
|
+
alignItems: "center",
|
|
1578
|
+
gap: 1.5,
|
|
1579
|
+
py: 1.5,
|
|
1580
|
+
px: 2
|
|
1581
|
+
},
|
|
1582
|
+
sx
|
|
1583
|
+
),
|
|
1618
1584
|
children: [
|
|
1619
1585
|
/* @__PURE__ */ jsx5(Box4, { sx: { width: 40, height: 40, flexShrink: 0 }, children: image }),
|
|
1620
|
-
/* @__PURE__ */ jsx5(
|
|
1586
|
+
/* @__PURE__ */ jsx5(
|
|
1587
|
+
Typography3,
|
|
1588
|
+
{
|
|
1589
|
+
variant: "body2",
|
|
1590
|
+
sx: {
|
|
1591
|
+
fontWeight: 600,
|
|
1592
|
+
flex: 1
|
|
1593
|
+
},
|
|
1594
|
+
children: name
|
|
1595
|
+
}
|
|
1596
|
+
),
|
|
1621
1597
|
hasActions && /* @__PURE__ */ jsxs5(
|
|
1622
1598
|
Stack4,
|
|
1623
1599
|
{
|
|
@@ -1697,16 +1673,18 @@ function BiampHeaderProfile({
|
|
|
1697
1673
|
selected,
|
|
1698
1674
|
disableGutters: true,
|
|
1699
1675
|
disableRipple: true,
|
|
1700
|
-
sx:
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1676
|
+
sx: mergeSx(
|
|
1677
|
+
{
|
|
1678
|
+
minWidth: "36px",
|
|
1679
|
+
maxWidth: "36px",
|
|
1680
|
+
minHeight: "36px",
|
|
1681
|
+
maxHeight: "36px",
|
|
1682
|
+
borderRadius: "6px",
|
|
1683
|
+
justifyContent: "center",
|
|
1684
|
+
alignItems: "center"
|
|
1685
|
+
},
|
|
1686
|
+
sx
|
|
1687
|
+
),
|
|
1710
1688
|
...props,
|
|
1711
1689
|
children: image ? /* @__PURE__ */ jsx5(
|
|
1712
1690
|
Box4,
|
|
@@ -1750,7 +1728,7 @@ function BiampNotificationPopover({
|
|
|
1750
1728
|
vertical: -4,
|
|
1751
1729
|
horizontal: NOTIFICATION_POPOVER_MAX_WIDTH
|
|
1752
1730
|
},
|
|
1753
|
-
sx
|
|
1731
|
+
sx,
|
|
1754
1732
|
slotProps: {
|
|
1755
1733
|
paper: {
|
|
1756
1734
|
sx: {
|
|
@@ -1782,16 +1760,18 @@ function BiampNotificationPopoverHeader({
|
|
|
1782
1760
|
Stack5,
|
|
1783
1761
|
{
|
|
1784
1762
|
direction: "row",
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1763
|
+
...props,
|
|
1764
|
+
sx: mergeSx(
|
|
1765
|
+
{
|
|
1766
|
+
alignItems: "center",
|
|
1767
|
+
justifyContent: "space-between",
|
|
1768
|
+
flexShrink: 0,
|
|
1769
|
+
gap: 2,
|
|
1770
|
+
px: 2,
|
|
1771
|
+
pt: 2
|
|
1772
|
+
},
|
|
1773
|
+
sx
|
|
1774
|
+
)
|
|
1795
1775
|
}
|
|
1796
1776
|
);
|
|
1797
1777
|
}
|
|
@@ -1802,15 +1782,17 @@ function BiampNotificationPopoverBody({
|
|
|
1802
1782
|
return /* @__PURE__ */ jsx6(
|
|
1803
1783
|
Box5,
|
|
1804
1784
|
{
|
|
1805
|
-
sx:
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1785
|
+
sx: mergeSx(
|
|
1786
|
+
{
|
|
1787
|
+
flex: 1,
|
|
1788
|
+
minHeight: 0,
|
|
1789
|
+
overflowY: "auto",
|
|
1790
|
+
overscrollBehavior: "none",
|
|
1791
|
+
px: 2,
|
|
1792
|
+
pb: 2
|
|
1793
|
+
},
|
|
1794
|
+
sx
|
|
1795
|
+
),
|
|
1814
1796
|
...props
|
|
1815
1797
|
}
|
|
1816
1798
|
);
|
|
@@ -1865,14 +1847,7 @@ function BiampListPopoverItem({
|
|
|
1865
1847
|
sx,
|
|
1866
1848
|
...props
|
|
1867
1849
|
}) {
|
|
1868
|
-
return /* @__PURE__ */ jsx7(
|
|
1869
|
-
ListItem,
|
|
1870
|
-
{
|
|
1871
|
-
dense: true,
|
|
1872
|
-
sx: [listItemSx, ...Array.isArray(sx) ? sx : [sx]],
|
|
1873
|
-
...props
|
|
1874
|
-
}
|
|
1875
|
-
);
|
|
1850
|
+
return /* @__PURE__ */ jsx7(ListItem, { dense: true, sx: mergeSx(listItemSx, sx), ...props });
|
|
1876
1851
|
}
|
|
1877
1852
|
function BiampListPopoverScrollArea({
|
|
1878
1853
|
maxHeight = 340,
|
|
@@ -1882,7 +1857,10 @@ function BiampListPopoverScrollArea({
|
|
|
1882
1857
|
return /* @__PURE__ */ jsx7(
|
|
1883
1858
|
Box6,
|
|
1884
1859
|
{
|
|
1885
|
-
sx:
|
|
1860
|
+
sx: mergeSx(
|
|
1861
|
+
{ maxHeight, overflow: "auto", overscrollBehavior: "none" },
|
|
1862
|
+
sx
|
|
1863
|
+
),
|
|
1886
1864
|
...props
|
|
1887
1865
|
}
|
|
1888
1866
|
);
|
|
@@ -1915,7 +1893,16 @@ function BiampCheckboxListPopover({
|
|
|
1915
1893
|
slotProps: { input: { "aria-label": selectAllLabel } }
|
|
1916
1894
|
}
|
|
1917
1895
|
),
|
|
1918
|
-
/* @__PURE__ */ jsx8(
|
|
1896
|
+
/* @__PURE__ */ jsx8(
|
|
1897
|
+
Typography4,
|
|
1898
|
+
{
|
|
1899
|
+
variant: "caption",
|
|
1900
|
+
sx: {
|
|
1901
|
+
fontWeight: 600
|
|
1902
|
+
},
|
|
1903
|
+
children: selectAllLabel
|
|
1904
|
+
}
|
|
1905
|
+
)
|
|
1919
1906
|
] }),
|
|
1920
1907
|
/* @__PURE__ */ jsx8(Divider2, {})
|
|
1921
1908
|
] }),
|
|
@@ -1952,6 +1939,7 @@ import {
|
|
|
1952
1939
|
TableBody,
|
|
1953
1940
|
TableCell as TableCell2,
|
|
1954
1941
|
TableContainer,
|
|
1942
|
+
TableFooter,
|
|
1955
1943
|
TableHead,
|
|
1956
1944
|
TableRow as TableRow2,
|
|
1957
1945
|
TableSortLabel
|
|
@@ -1963,7 +1951,7 @@ import {
|
|
|
1963
1951
|
import {
|
|
1964
1952
|
flexRender as flexRender2
|
|
1965
1953
|
} from "@tanstack/react-table";
|
|
1966
|
-
import { useEffect as useEffect2, useRef as
|
|
1954
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1967
1955
|
|
|
1968
1956
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
1969
1957
|
import { NoResultsIcon } from "@bwp-web/assets";
|
|
@@ -1979,15 +1967,28 @@ function BiampTableStatusMessage({
|
|
|
1979
1967
|
children,
|
|
1980
1968
|
...stackProps
|
|
1981
1969
|
}) {
|
|
1982
|
-
return /* @__PURE__ */ jsxs7(
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1970
|
+
return /* @__PURE__ */ jsxs7(
|
|
1971
|
+
Stack6,
|
|
1972
|
+
{
|
|
1973
|
+
...stackProps,
|
|
1974
|
+
sx: mergeSx(
|
|
1975
|
+
{
|
|
1976
|
+
alignItems: "center",
|
|
1977
|
+
gap: 1.5
|
|
1978
|
+
},
|
|
1979
|
+
stackProps.sx
|
|
1980
|
+
),
|
|
1981
|
+
children: [
|
|
1982
|
+
cloneElement(icon, {
|
|
1983
|
+
"aria-hidden": true,
|
|
1984
|
+
sx: mergeSx({ width: 56, height: 56 }, icon.props.sx)
|
|
1985
|
+
}),
|
|
1986
|
+
/* @__PURE__ */ jsx9(Typography5, { variant: "h2", children: title }),
|
|
1987
|
+
description && /* @__PURE__ */ jsx9(Typography5, { variant: "body1", children: description }),
|
|
1988
|
+
children
|
|
1989
|
+
]
|
|
1990
|
+
}
|
|
1991
|
+
);
|
|
1991
1992
|
}
|
|
1992
1993
|
|
|
1993
1994
|
// src/BiampTable/BiampTableEmptyState.tsx
|
|
@@ -2033,12 +2034,12 @@ import React4 from "react";
|
|
|
2033
2034
|
|
|
2034
2035
|
// src/BiampTable/BiampTableTruncatedCell.tsx
|
|
2035
2036
|
import { Box as Box7, Tooltip as Tooltip2 } from "@mui/material";
|
|
2036
|
-
import { useCallback, useRef
|
|
2037
|
+
import { useCallback, useRef, useState as useState5 } from "react";
|
|
2037
2038
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2038
2039
|
function BiampTableTruncatedCell({
|
|
2039
2040
|
children
|
|
2040
2041
|
}) {
|
|
2041
|
-
const textRef =
|
|
2042
|
+
const textRef = useRef(null);
|
|
2042
2043
|
const [open, setOpen] = useState5(false);
|
|
2043
2044
|
const handleMouseEnter = useCallback(() => {
|
|
2044
2045
|
const el = textRef.current;
|
|
@@ -2077,21 +2078,6 @@ function BiampTableTruncatedCell({
|
|
|
2077
2078
|
);
|
|
2078
2079
|
}
|
|
2079
2080
|
|
|
2080
|
-
// src/slotProps.ts
|
|
2081
|
-
function resolveSlot(slot, ctx) {
|
|
2082
|
-
if (!slot) return void 0;
|
|
2083
|
-
return typeof slot === "function" ? slot(ctx) : slot;
|
|
2084
|
-
}
|
|
2085
|
-
function mergeSx(...inputs) {
|
|
2086
|
-
return inputs.filter((v) => Boolean(v)).flatMap((v) => Array.isArray(v) ? v : [v]);
|
|
2087
|
-
}
|
|
2088
|
-
function mergeSlotProps(ownProps, userProps) {
|
|
2089
|
-
return typeof userProps === "function" ? (ownerState) => ({
|
|
2090
|
-
...ownProps,
|
|
2091
|
-
...userProps(ownerState)
|
|
2092
|
-
}) : { ...ownProps, ...userProps };
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
2081
|
// src/BiampTable/cellSx.ts
|
|
2096
2082
|
var stickyHoverBg = {
|
|
2097
2083
|
".MuiTableRow-hover:hover > &, .Mui-selected > &": {
|
|
@@ -2472,6 +2458,33 @@ var headerSelectionCellSx = {
|
|
|
2472
2458
|
bgcolor: ({ palette }) => palette.mode === "dark" ? palette.grey[900] : palette.background.paper
|
|
2473
2459
|
};
|
|
2474
2460
|
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
2461
|
+
var footerBg = ({ palette }) => palette.mode === "dark" ? palette.grey[900] : palette.grey[100];
|
|
2462
|
+
var footerRowSx = { bgcolor: footerBg };
|
|
2463
|
+
var footerCellSx = {
|
|
2464
|
+
height: 44,
|
|
2465
|
+
color: "text.primary",
|
|
2466
|
+
fontSize: 14,
|
|
2467
|
+
fontWeight: 600,
|
|
2468
|
+
lineHeight: 1.5,
|
|
2469
|
+
borderTop: ({ palette }) => `0.6px solid ${palette.divider}`,
|
|
2470
|
+
borderBottom: "none"
|
|
2471
|
+
};
|
|
2472
|
+
var footerPinnedCellSx = { bgcolor: footerBg };
|
|
2473
|
+
var stickyFooterSx = {
|
|
2474
|
+
position: "sticky",
|
|
2475
|
+
bottom: 0,
|
|
2476
|
+
zIndex: 2,
|
|
2477
|
+
filter: "drop-shadow(0px -1px 3.5px rgba(0, 0, 0, 0.05))"
|
|
2478
|
+
};
|
|
2479
|
+
var fillerRowSx = { height: "100%" };
|
|
2480
|
+
var fitHeightBodySx = {
|
|
2481
|
+
"& > tr:nth-last-of-type(2) > td": { borderBottom: "none" }
|
|
2482
|
+
};
|
|
2483
|
+
var fillerCellSx = {
|
|
2484
|
+
height: "auto",
|
|
2485
|
+
p: 0,
|
|
2486
|
+
border: "none"
|
|
2487
|
+
};
|
|
2475
2488
|
function BiampTable({
|
|
2476
2489
|
table,
|
|
2477
2490
|
onRowClick,
|
|
@@ -2488,6 +2501,8 @@ function BiampTable({
|
|
|
2488
2501
|
getRowLabel,
|
|
2489
2502
|
setRowColor,
|
|
2490
2503
|
slotProps,
|
|
2504
|
+
stickyFooter = false,
|
|
2505
|
+
fitHeight = false,
|
|
2491
2506
|
sx,
|
|
2492
2507
|
...boxProps
|
|
2493
2508
|
}) {
|
|
@@ -2503,7 +2518,7 @@ function BiampTable({
|
|
|
2503
2518
|
enableRowSelection ? 48 : 0
|
|
2504
2519
|
);
|
|
2505
2520
|
const visibleColumnsKey = table.getVisibleLeafColumns().map((col) => col.id).join(",");
|
|
2506
|
-
const containerRef =
|
|
2521
|
+
const containerRef = useRef2(null);
|
|
2507
2522
|
useEffect2(() => {
|
|
2508
2523
|
if (enableExpanding && alwaysExpanded) {
|
|
2509
2524
|
table.toggleAllRowsExpanded(true);
|
|
@@ -2514,19 +2529,25 @@ function BiampTable({
|
|
|
2514
2529
|
const hasExpandableRows = enableExpanding && rows.some((r) => r.getCanExpand());
|
|
2515
2530
|
const showError = !!error && !loading;
|
|
2516
2531
|
const showEmpty = !showError && !loading && rows.length === 0;
|
|
2532
|
+
const footerGroup = table.getFooterGroups()[0];
|
|
2533
|
+
const hasFooter = table.getVisibleLeafColumns().some((col) => col.columnDef.footer !== void 0);
|
|
2534
|
+
const { sx: userFooterSx, ...restFooterSlotProps } = slotProps?.footer ?? {};
|
|
2535
|
+
const { sx: userFooterRowSx, ...restFooterRowSlotProps } = slotProps?.footerRow ?? {};
|
|
2517
2536
|
return /* @__PURE__ */ jsxs9(
|
|
2518
2537
|
TableContainer,
|
|
2519
2538
|
{
|
|
2520
2539
|
component: Box10,
|
|
2521
2540
|
...boxProps,
|
|
2522
2541
|
ref: containerRef,
|
|
2523
|
-
sx:
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2542
|
+
sx: mergeSx(
|
|
2543
|
+
{
|
|
2544
|
+
display: "flex",
|
|
2545
|
+
flexDirection: "column",
|
|
2546
|
+
height: "100%",
|
|
2547
|
+
position: "relative"
|
|
2548
|
+
},
|
|
2549
|
+
sx
|
|
2550
|
+
),
|
|
2530
2551
|
children: [
|
|
2531
2552
|
/* @__PURE__ */ jsxs9(
|
|
2532
2553
|
MuiTable,
|
|
@@ -2534,7 +2555,11 @@ function BiampTable({
|
|
|
2534
2555
|
"aria-busy": showLoading || void 0,
|
|
2535
2556
|
...restTableSlotProps,
|
|
2536
2557
|
sx: mergeSx(
|
|
2537
|
-
{
|
|
2558
|
+
{
|
|
2559
|
+
minWidth: tableMinWidth,
|
|
2560
|
+
tableLayout: "auto",
|
|
2561
|
+
...fitHeight && { height: "100%" }
|
|
2562
|
+
},
|
|
2538
2563
|
userTableSx
|
|
2539
2564
|
),
|
|
2540
2565
|
children: [
|
|
@@ -2599,33 +2624,102 @@ function BiampTable({
|
|
|
2599
2624
|
},
|
|
2600
2625
|
headerGroup.id
|
|
2601
2626
|
)) }),
|
|
2602
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ jsxs9(
|
|
2603
2628
|
TableBody,
|
|
2604
2629
|
{
|
|
2605
2630
|
...restBodySlotProps,
|
|
2606
|
-
sx: mergeSx(
|
|
2607
|
-
|
|
2608
|
-
|
|
2631
|
+
sx: mergeSx(
|
|
2632
|
+
{ opacity: showLoading ? 0.3 : 1 },
|
|
2633
|
+
fitHeight && !showError ? fitHeightBodySx : void 0,
|
|
2634
|
+
userBodySx
|
|
2635
|
+
),
|
|
2636
|
+
children: [
|
|
2637
|
+
!showError && rows.map((row) => /* @__PURE__ */ jsx15(
|
|
2638
|
+
BiampTableRow,
|
|
2639
|
+
{
|
|
2640
|
+
row,
|
|
2641
|
+
visibleColumnsKey,
|
|
2642
|
+
isExpanded: row.getIsExpanded(),
|
|
2643
|
+
isSelected: row.getIsSelected(),
|
|
2644
|
+
onRowClick,
|
|
2645
|
+
isRowClickable,
|
|
2646
|
+
enableRowSelection,
|
|
2647
|
+
enableExpanding,
|
|
2648
|
+
alwaysExpanded,
|
|
2649
|
+
selectChildrenWithParent,
|
|
2650
|
+
showExpandGuidelines,
|
|
2651
|
+
getRowLabel,
|
|
2652
|
+
hasExpandableRows,
|
|
2653
|
+
customColor: setRowColor?.(row.original),
|
|
2654
|
+
rowSlotProps: slotProps?.row,
|
|
2655
|
+
cellSlotProps: slotProps?.cell
|
|
2656
|
+
},
|
|
2657
|
+
row.id
|
|
2658
|
+
)),
|
|
2659
|
+
fitHeight && !showError && /* @__PURE__ */ jsx15(TableRow2, { "aria-hidden": true, sx: fillerRowSx, children: /* @__PURE__ */ jsx15(
|
|
2660
|
+
TableCell2,
|
|
2661
|
+
{
|
|
2662
|
+
colSpan: table.getVisibleLeafColumns().length + (enableRowSelection ? 1 : 0),
|
|
2663
|
+
sx: fillerCellSx
|
|
2664
|
+
}
|
|
2665
|
+
) })
|
|
2666
|
+
]
|
|
2667
|
+
}
|
|
2668
|
+
),
|
|
2669
|
+
hasFooter && footerGroup && !showError && /* @__PURE__ */ jsx15(
|
|
2670
|
+
TableFooter,
|
|
2671
|
+
{
|
|
2672
|
+
...restFooterSlotProps,
|
|
2673
|
+
sx: mergeSx(
|
|
2674
|
+
stickyFooter ? stickyFooterSx : void 0,
|
|
2675
|
+
userFooterSx
|
|
2676
|
+
),
|
|
2677
|
+
children: /* @__PURE__ */ jsxs9(
|
|
2678
|
+
TableRow2,
|
|
2609
2679
|
{
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2680
|
+
...restFooterRowSlotProps,
|
|
2681
|
+
sx: mergeSx(footerRowSx, userFooterRowSx),
|
|
2682
|
+
children: [
|
|
2683
|
+
enableRowSelection && /* @__PURE__ */ jsx15(
|
|
2684
|
+
TableCell2,
|
|
2685
|
+
{
|
|
2686
|
+
padding: "checkbox",
|
|
2687
|
+
sx: mergeSx(footerCellSx, footerPinnedCellSx, {
|
|
2688
|
+
position: "sticky",
|
|
2689
|
+
left: 0,
|
|
2690
|
+
zIndex: 1
|
|
2691
|
+
})
|
|
2692
|
+
}
|
|
2693
|
+
),
|
|
2694
|
+
footerGroup.headers.map((header) => {
|
|
2695
|
+
const sticky = header.column.columnDef.meta?.sticky;
|
|
2696
|
+
const resolvedFooterCell = resolveSlot(slotProps?.footerCell, {
|
|
2697
|
+
header
|
|
2698
|
+
});
|
|
2699
|
+
const { sx: userFooterCellSx, ...restFooterCellProps } = resolvedFooterCell ?? {};
|
|
2700
|
+
return /* @__PURE__ */ jsx15(
|
|
2701
|
+
TableCell2,
|
|
2702
|
+
{
|
|
2703
|
+
...restFooterCellProps,
|
|
2704
|
+
"data-sticky": sticky || void 0,
|
|
2705
|
+
sx: mergeSx(
|
|
2706
|
+
cellSx(sticky, header.column.columnDef.meta?.minWidth, 3),
|
|
2707
|
+
footerCellSx,
|
|
2708
|
+
sticky ? footerPinnedCellSx : void 0,
|
|
2709
|
+
sticky ? { zIndex: 1 } : void 0,
|
|
2710
|
+
userFooterCellSx
|
|
2711
|
+
),
|
|
2712
|
+
children: header.isPlaceholder ? null : flexRender2(
|
|
2713
|
+
header.column.columnDef.footer,
|
|
2714
|
+
header.getContext()
|
|
2715
|
+
)
|
|
2716
|
+
},
|
|
2717
|
+
header.id
|
|
2718
|
+
);
|
|
2719
|
+
})
|
|
2720
|
+
]
|
|
2721
|
+
}
|
|
2722
|
+
)
|
|
2629
2723
|
}
|
|
2630
2724
|
)
|
|
2631
2725
|
]
|
|
@@ -2658,14 +2752,18 @@ function BiampTableContainer({
|
|
|
2658
2752
|
Stack7,
|
|
2659
2753
|
{
|
|
2660
2754
|
direction: "column",
|
|
2661
|
-
width: "100%",
|
|
2662
|
-
height: "100%",
|
|
2663
|
-
overflow: "hidden",
|
|
2664
|
-
pt: { xs: 0, md: 1.5 },
|
|
2665
|
-
borderTop: withBorderTop ? ({ palette }) => `0.6px solid ${palette.divider}` : void 0,
|
|
2666
|
-
borderBottom: withBorderBottom ? ({ palette }) => `0.6px solid ${palette.divider}` : void 0,
|
|
2667
|
-
sx: { ...sx },
|
|
2668
2755
|
...props,
|
|
2756
|
+
sx: mergeSx(
|
|
2757
|
+
{
|
|
2758
|
+
width: "100%",
|
|
2759
|
+
height: "100%",
|
|
2760
|
+
overflow: "hidden",
|
|
2761
|
+
pt: { xs: 0, md: 1.5 },
|
|
2762
|
+
borderTop: withBorderTop ? ({ palette }) => `0.6px solid ${palette.divider}` : void 0,
|
|
2763
|
+
borderBottom: withBorderBottom ? ({ palette }) => `0.6px solid ${palette.divider}` : void 0
|
|
2764
|
+
},
|
|
2765
|
+
sx
|
|
2766
|
+
),
|
|
2669
2767
|
children
|
|
2670
2768
|
}
|
|
2671
2769
|
);
|
|
@@ -2839,7 +2937,7 @@ function BiampTableToolbarColumnVisibility({
|
|
|
2839
2937
|
}
|
|
2840
2938
|
|
|
2841
2939
|
// src/BiampTable/BiampTablePagination.tsx
|
|
2842
|
-
import { useEffect as useEffect3,
|
|
2940
|
+
import { useEffect as useEffect3, useState as useState7 } from "react";
|
|
2843
2941
|
import { TablePagination } from "@mui/material";
|
|
2844
2942
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2845
2943
|
var positionMap = {
|
|
@@ -2857,11 +2955,11 @@ function BiampTablePagination({
|
|
|
2857
2955
|
...paginationProps
|
|
2858
2956
|
}) {
|
|
2859
2957
|
const rowCount = table.getRowCount();
|
|
2860
|
-
const
|
|
2861
|
-
if (!loading && rowCount >= 0) {
|
|
2862
|
-
|
|
2958
|
+
const [lastRowCount, setLastRowCount] = useState7(rowCount);
|
|
2959
|
+
if (!loading && rowCount >= 0 && rowCount !== lastRowCount) {
|
|
2960
|
+
setLastRowCount(rowCount);
|
|
2863
2961
|
}
|
|
2864
|
-
const stableCount = loading ?
|
|
2962
|
+
const stableCount = loading ? lastRowCount : rowCount;
|
|
2865
2963
|
const { pageSize, pageIndex } = table.getState().pagination;
|
|
2866
2964
|
const maxPage = Math.max(0, Math.ceil(stableCount / pageSize) - 1);
|
|
2867
2965
|
useEffect3(() => {
|
|
@@ -2885,17 +2983,19 @@ function BiampTablePagination({
|
|
|
2885
2983
|
rowsPerPageOptions: rowsPerPageOptions ?? [],
|
|
2886
2984
|
showFirstButton: true,
|
|
2887
2985
|
showLastButton: true,
|
|
2888
|
-
sx:
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
"& .MuiToolbar-root": {
|
|
2986
|
+
sx: mergeSx(
|
|
2987
|
+
{
|
|
2988
|
+
display: "flex",
|
|
2989
|
+
justifyContent: positionMap[position],
|
|
2990
|
+
height: 40,
|
|
2894
2991
|
minHeight: 40,
|
|
2895
|
-
|
|
2992
|
+
"& .MuiToolbar-root": {
|
|
2993
|
+
minHeight: 40,
|
|
2994
|
+
px: 0
|
|
2995
|
+
}
|
|
2896
2996
|
},
|
|
2897
|
-
|
|
2898
|
-
|
|
2997
|
+
sx
|
|
2998
|
+
),
|
|
2899
2999
|
...paginationProps
|
|
2900
3000
|
}
|
|
2901
3001
|
);
|
|
@@ -2913,14 +3013,18 @@ function BiampTableToolbar({
|
|
|
2913
3013
|
Box11,
|
|
2914
3014
|
{
|
|
2915
3015
|
role: "toolbar",
|
|
2916
|
-
display: "flex",
|
|
2917
|
-
justifyContent: "space-between",
|
|
2918
|
-
alignItems: "center",
|
|
2919
|
-
gap: { xs: 0, md: 1 },
|
|
2920
|
-
width: "100%",
|
|
2921
|
-
minHeight: 44,
|
|
2922
|
-
sx: { ...sx },
|
|
2923
3016
|
...props,
|
|
3017
|
+
sx: mergeSx(
|
|
3018
|
+
{
|
|
3019
|
+
display: "flex",
|
|
3020
|
+
justifyContent: "space-between",
|
|
3021
|
+
alignItems: "center",
|
|
3022
|
+
gap: { xs: 0, md: 1 },
|
|
3023
|
+
width: "100%",
|
|
3024
|
+
minHeight: 44
|
|
3025
|
+
},
|
|
3026
|
+
sx
|
|
3027
|
+
),
|
|
2924
3028
|
children
|
|
2925
3029
|
}
|
|
2926
3030
|
);
|
|
@@ -2936,12 +3040,17 @@ function BiampTableToolbarActions({
|
|
|
2936
3040
|
return /* @__PURE__ */ jsx23(
|
|
2937
3041
|
Box12,
|
|
2938
3042
|
{
|
|
2939
|
-
display: "flex",
|
|
2940
|
-
alignItems: "center",
|
|
2941
|
-
ml: "auto",
|
|
2942
|
-
gap: { xs: 0, md: 1 },
|
|
2943
|
-
mr: { xs: 1, md: 0 },
|
|
2944
3043
|
...props,
|
|
3044
|
+
sx: mergeSx(
|
|
3045
|
+
{
|
|
3046
|
+
display: "flex",
|
|
3047
|
+
alignItems: "center",
|
|
3048
|
+
ml: "auto",
|
|
3049
|
+
gap: { xs: 0, md: 1 },
|
|
3050
|
+
mr: { xs: 1, md: 0 }
|
|
3051
|
+
},
|
|
3052
|
+
props.sx
|
|
3053
|
+
),
|
|
2945
3054
|
children
|
|
2946
3055
|
}
|
|
2947
3056
|
);
|
|
@@ -3002,7 +3111,8 @@ import {
|
|
|
3002
3111
|
useTheme as useTheme2
|
|
3003
3112
|
} from "@mui/material";
|
|
3004
3113
|
import { CloseIcon as CloseIcon2, FilterIcon } from "@bwp-web/assets";
|
|
3005
|
-
import { useId, useState as
|
|
3114
|
+
import { useId, useState as useState8 } from "react";
|
|
3115
|
+
import { mergeSlotProps as mergeSlotProps2 } from "@mui/material/utils";
|
|
3006
3116
|
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3007
3117
|
function BiampTableToolbarFilters({
|
|
3008
3118
|
activeFilterCount,
|
|
@@ -3017,7 +3127,7 @@ function BiampTableToolbarFilters({
|
|
|
3017
3127
|
buttonLabel = "Filters",
|
|
3018
3128
|
DrawerProps: drawerProps
|
|
3019
3129
|
}) {
|
|
3020
|
-
const [open, setOpen] =
|
|
3130
|
+
const [open, setOpen] = useState8(false);
|
|
3021
3131
|
const titleId = useId();
|
|
3022
3132
|
const theme = useTheme2();
|
|
3023
3133
|
function handleClose() {
|
|
@@ -3042,27 +3152,33 @@ function BiampTableToolbarFilters({
|
|
|
3042
3152
|
onClose: handleClose,
|
|
3043
3153
|
"aria-labelledby": titleId,
|
|
3044
3154
|
...drawerProps,
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3155
|
+
slotProps: {
|
|
3156
|
+
...drawerProps?.slotProps,
|
|
3157
|
+
paper: mergeSlotProps2(drawerProps?.slotProps?.paper, {
|
|
3158
|
+
sx: { width: { xs: "100%", sm: 480 } }
|
|
3159
|
+
})
|
|
3048
3160
|
},
|
|
3049
3161
|
children: /* @__PURE__ */ jsxs11(
|
|
3050
3162
|
Box13,
|
|
3051
3163
|
{
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3164
|
+
sx: {
|
|
3165
|
+
height: "100%",
|
|
3166
|
+
display: "flex",
|
|
3167
|
+
flexDirection: "column",
|
|
3168
|
+
justifyContent: "space-between"
|
|
3169
|
+
},
|
|
3056
3170
|
children: [
|
|
3057
3171
|
/* @__PURE__ */ jsxs11(Box13, { children: [
|
|
3058
3172
|
/* @__PURE__ */ jsxs11(
|
|
3059
3173
|
Box13,
|
|
3060
3174
|
{
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3175
|
+
sx: {
|
|
3176
|
+
display: "flex",
|
|
3177
|
+
justifyContent: "space-between",
|
|
3178
|
+
alignItems: "center",
|
|
3179
|
+
px: 3.5,
|
|
3180
|
+
py: 2.5
|
|
3181
|
+
},
|
|
3066
3182
|
children: [
|
|
3067
3183
|
/* @__PURE__ */ jsxs11(Typography6, { id: titleId, variant: "h2", children: [
|
|
3068
3184
|
title,
|
|
@@ -3100,38 +3216,48 @@ function BiampTableToolbarFilters({
|
|
|
3100
3216
|
{
|
|
3101
3217
|
role: "group",
|
|
3102
3218
|
"aria-label": "Filter options",
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3219
|
+
sx: {
|
|
3220
|
+
display: "flex",
|
|
3221
|
+
flexDirection: "column",
|
|
3222
|
+
gap: 2,
|
|
3223
|
+
p: 3.5,
|
|
3224
|
+
overflow: "auto"
|
|
3225
|
+
},
|
|
3108
3226
|
children
|
|
3109
3227
|
}
|
|
3110
3228
|
)
|
|
3111
3229
|
] }),
|
|
3112
|
-
/* @__PURE__ */ jsxs11(
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
{
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3230
|
+
/* @__PURE__ */ jsxs11(
|
|
3231
|
+
Box13,
|
|
3232
|
+
{
|
|
3233
|
+
sx: {
|
|
3234
|
+
display: "flex"
|
|
3235
|
+
},
|
|
3236
|
+
children: [
|
|
3237
|
+
/* @__PURE__ */ jsx25(
|
|
3238
|
+
Button3,
|
|
3239
|
+
{
|
|
3240
|
+
variant: "overlay",
|
|
3241
|
+
color: "secondary",
|
|
3242
|
+
fullWidth: true,
|
|
3243
|
+
onClick: onReset,
|
|
3244
|
+
disabled: activeFilterCount === 0,
|
|
3245
|
+
children: resetLabel
|
|
3246
|
+
}
|
|
3247
|
+
),
|
|
3248
|
+
/* @__PURE__ */ jsx25(
|
|
3249
|
+
Button3,
|
|
3250
|
+
{
|
|
3251
|
+
variant: "overlay",
|
|
3252
|
+
color: "primary",
|
|
3253
|
+
fullWidth: true,
|
|
3254
|
+
onClick: handleClose,
|
|
3255
|
+
children: applyLabel
|
|
3256
|
+
}
|
|
3257
|
+
)
|
|
3258
|
+
]
|
|
3259
|
+
}
|
|
3260
|
+
)
|
|
3135
3261
|
]
|
|
3136
3262
|
}
|
|
3137
3263
|
)
|
|
@@ -3151,15 +3277,17 @@ import {
|
|
|
3151
3277
|
useMediaQuery as useMediaQuery3
|
|
3152
3278
|
} from "@mui/material";
|
|
3153
3279
|
import { CloseIcon as CloseIcon3, SearchIcon as SearchIcon2 } from "@bwp-web/assets";
|
|
3154
|
-
import {
|
|
3280
|
+
import { useState as useState9 } from "react";
|
|
3155
3281
|
|
|
3156
3282
|
// src/BiampTable/useDebouncedCallback.ts
|
|
3157
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useRef as
|
|
3283
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef3 } from "react";
|
|
3158
3284
|
var BIAMP_TABLE_DEBOUNCE_DELAY = 300;
|
|
3159
3285
|
function useDebouncedCallback(callback, delay = BIAMP_TABLE_DEBOUNCE_DELAY) {
|
|
3160
|
-
const timeoutRef =
|
|
3161
|
-
const callbackRef =
|
|
3162
|
-
|
|
3286
|
+
const timeoutRef = useRef3(null);
|
|
3287
|
+
const callbackRef = useRef3(callback);
|
|
3288
|
+
useEffect4(() => {
|
|
3289
|
+
callbackRef.current = callback;
|
|
3290
|
+
});
|
|
3163
3291
|
useEffect4(() => {
|
|
3164
3292
|
return () => {
|
|
3165
3293
|
if (timeoutRef.current !== null) clearTimeout(timeoutRef.current);
|
|
@@ -3203,12 +3331,14 @@ function BiampTableToolbarSearch({
|
|
|
3203
3331
|
...textFieldProps
|
|
3204
3332
|
}) {
|
|
3205
3333
|
const isMobile = useMediaQuery3((t) => t.breakpoints.down("md"));
|
|
3206
|
-
const [inputValue, setInputValue] =
|
|
3207
|
-
const [isExpanded, setIsExpanded] =
|
|
3334
|
+
const [inputValue, setInputValue] = useState9(defaultValue);
|
|
3335
|
+
const [isExpanded, setIsExpanded] = useState9(false);
|
|
3208
3336
|
const debouncedOnChange = useDebouncedCallback(onChange, debounceDelay);
|
|
3209
|
-
|
|
3337
|
+
const [prevDefaultValue, setPrevDefaultValue] = useState9(defaultValue);
|
|
3338
|
+
if (defaultValue !== prevDefaultValue) {
|
|
3339
|
+
setPrevDefaultValue(defaultValue);
|
|
3210
3340
|
setInputValue(defaultValue);
|
|
3211
|
-
}
|
|
3341
|
+
}
|
|
3212
3342
|
const handleChange = (e) => {
|
|
3213
3343
|
setInputValue(e.target.value);
|
|
3214
3344
|
debouncedOnChange(e.target.value);
|
|
@@ -3274,11 +3404,11 @@ function BiampTableToolbarSearch({
|
|
|
3274
3404
|
}
|
|
3275
3405
|
},
|
|
3276
3406
|
fullWidth: true,
|
|
3277
|
-
sx:
|
|
3407
|
+
sx: mergeSx(
|
|
3278
3408
|
searchFieldSx,
|
|
3279
3409
|
expandable ? { width: 170 } : { maxWidth },
|
|
3280
|
-
|
|
3281
|
-
|
|
3410
|
+
sx
|
|
3411
|
+
),
|
|
3282
3412
|
variant: "outlined",
|
|
3283
3413
|
value: inputValue,
|
|
3284
3414
|
onChange: handleChange,
|
|
@@ -3288,57 +3418,79 @@ function BiampTableToolbarSearch({
|
|
|
3288
3418
|
}
|
|
3289
3419
|
);
|
|
3290
3420
|
if (isMobile && enableMobileView) {
|
|
3291
|
-
return /* @__PURE__ */ jsxs12(
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
sx: {
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3421
|
+
return /* @__PURE__ */ jsxs12(
|
|
3422
|
+
Box14,
|
|
3423
|
+
{
|
|
3424
|
+
sx: {
|
|
3425
|
+
display: "flex",
|
|
3426
|
+
alignItems: "center",
|
|
3427
|
+
width: "100%",
|
|
3428
|
+
pr: 1,
|
|
3429
|
+
gap: 1
|
|
3430
|
+
},
|
|
3431
|
+
children: [
|
|
3432
|
+
/* @__PURE__ */ jsx26(SearchIcon2, { sx: { width: 16, height: 16 } }),
|
|
3433
|
+
/* @__PURE__ */ jsx26(
|
|
3434
|
+
InputBase,
|
|
3435
|
+
{
|
|
3436
|
+
name: "search",
|
|
3437
|
+
type: "text",
|
|
3438
|
+
placeholder,
|
|
3439
|
+
slotProps: { input: { maxLength, "aria-label": "Search" } },
|
|
3440
|
+
fullWidth: true,
|
|
3441
|
+
value: inputValue,
|
|
3442
|
+
sx: {
|
|
3443
|
+
paddingLeft: 1,
|
|
3444
|
+
height: "36px !important",
|
|
3445
|
+
minHeight: "36px !important",
|
|
3446
|
+
fontSize: (t) => t.typography.body2.fontSize
|
|
3447
|
+
},
|
|
3448
|
+
onChange: handleChange,
|
|
3449
|
+
endAdornment: clearButton
|
|
3450
|
+
}
|
|
3451
|
+
)
|
|
3452
|
+
]
|
|
3453
|
+
}
|
|
3454
|
+
);
|
|
3313
3455
|
}
|
|
3314
3456
|
if (expandable) {
|
|
3315
|
-
return /* @__PURE__ */ jsxs12(
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
{
|
|
3319
|
-
"
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3457
|
+
return /* @__PURE__ */ jsxs12(
|
|
3458
|
+
Box14,
|
|
3459
|
+
{
|
|
3460
|
+
sx: {
|
|
3461
|
+
display: "flex",
|
|
3462
|
+
alignItems: "center",
|
|
3463
|
+
minWidth: 28
|
|
3464
|
+
},
|
|
3465
|
+
children: [
|
|
3466
|
+
/* @__PURE__ */ jsx26(
|
|
3467
|
+
IconButton6,
|
|
3324
3468
|
{
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
sx: {
|
|
3469
|
+
"aria-label": expandLabel ?? placeholder,
|
|
3470
|
+
onClick: () => setIsExpanded(true),
|
|
3471
|
+
sx: { display: isExpanded || inputValue ? "none" : "flex" },
|
|
3472
|
+
children: /* @__PURE__ */ jsx26(
|
|
3473
|
+
SearchIcon2,
|
|
3474
|
+
{
|
|
3475
|
+
variant: "xs",
|
|
3476
|
+
color: "inherit",
|
|
3477
|
+
sx: { width: 16, height: 16 }
|
|
3478
|
+
}
|
|
3479
|
+
)
|
|
3480
|
+
}
|
|
3481
|
+
),
|
|
3482
|
+
/* @__PURE__ */ jsx26(
|
|
3483
|
+
Collapse,
|
|
3484
|
+
{
|
|
3485
|
+
in: isExpanded || !!inputValue,
|
|
3486
|
+
orientation: "horizontal",
|
|
3487
|
+
unmountOnExit: true,
|
|
3488
|
+
children: textField
|
|
3328
3489
|
}
|
|
3329
3490
|
)
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
Collapse,
|
|
3334
|
-
{
|
|
3335
|
-
in: isExpanded || !!inputValue,
|
|
3336
|
-
orientation: "horizontal",
|
|
3337
|
-
unmountOnExit: true,
|
|
3338
|
-
children: textField
|
|
3339
|
-
}
|
|
3340
|
-
)
|
|
3341
|
-
] });
|
|
3491
|
+
]
|
|
3492
|
+
}
|
|
3493
|
+
);
|
|
3342
3494
|
}
|
|
3343
3495
|
return textField;
|
|
3344
3496
|
}
|
|
@@ -3590,15 +3742,15 @@ function BiampBanner({ show, children, severity }) {
|
|
|
3590
3742
|
return /* @__PURE__ */ jsx27(Collapse2, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ jsx27(
|
|
3591
3743
|
Box15,
|
|
3592
3744
|
{
|
|
3593
|
-
bgcolor: ({ palette }) => palette.background[severity],
|
|
3594
|
-
display: "flex",
|
|
3595
|
-
flexDirection: "row",
|
|
3596
|
-
alignItems: "center",
|
|
3597
|
-
justifyContent: "space-between",
|
|
3598
|
-
gap: 1,
|
|
3599
|
-
px: { xs: 2, sm: 2.5 },
|
|
3600
|
-
minHeight: 48,
|
|
3601
3745
|
sx: {
|
|
3746
|
+
bgcolor: ({ palette }) => palette.background[severity],
|
|
3747
|
+
display: "flex",
|
|
3748
|
+
flexDirection: "row",
|
|
3749
|
+
alignItems: "center",
|
|
3750
|
+
justifyContent: "space-between",
|
|
3751
|
+
gap: 1,
|
|
3752
|
+
px: { xs: 2, sm: 2.5 },
|
|
3753
|
+
minHeight: 48,
|
|
3602
3754
|
borderBottom: ({ palette }) => `0.6px solid ${palette[severity].main}`
|
|
3603
3755
|
},
|
|
3604
3756
|
children
|
|
@@ -3615,10 +3767,37 @@ function BiampBannerIcon({ severity, children }) {
|
|
|
3615
3767
|
return /* @__PURE__ */ jsx27(Fragment6, { children: severity ? iconMapping[severity] : children });
|
|
3616
3768
|
}
|
|
3617
3769
|
function BiampBannerContent({ children, ...props }) {
|
|
3618
|
-
return /* @__PURE__ */ jsx27(
|
|
3770
|
+
return /* @__PURE__ */ jsx27(
|
|
3771
|
+
Typography7,
|
|
3772
|
+
{
|
|
3773
|
+
variant: "h3",
|
|
3774
|
+
...props,
|
|
3775
|
+
sx: mergeSx(
|
|
3776
|
+
{
|
|
3777
|
+
textAlign: "center"
|
|
3778
|
+
},
|
|
3779
|
+
props.sx
|
|
3780
|
+
),
|
|
3781
|
+
children
|
|
3782
|
+
}
|
|
3783
|
+
);
|
|
3619
3784
|
}
|
|
3620
3785
|
function BiampBannerActions({ children, ...props }) {
|
|
3621
|
-
return /* @__PURE__ */ jsx27(
|
|
3786
|
+
return /* @__PURE__ */ jsx27(
|
|
3787
|
+
Box15,
|
|
3788
|
+
{
|
|
3789
|
+
...props,
|
|
3790
|
+
sx: mergeSx(
|
|
3791
|
+
{
|
|
3792
|
+
display: "flex",
|
|
3793
|
+
gap: 1,
|
|
3794
|
+
alignItems: "center"
|
|
3795
|
+
},
|
|
3796
|
+
props.sx
|
|
3797
|
+
),
|
|
3798
|
+
children
|
|
3799
|
+
}
|
|
3800
|
+
);
|
|
3622
3801
|
}
|
|
3623
3802
|
|
|
3624
3803
|
// src/BiampSegmentedButton/SegmentedButton.tsx
|
|
@@ -3640,20 +3819,22 @@ function SegmentedButton({
|
|
|
3640
3819
|
return /* @__PURE__ */ jsx28(
|
|
3641
3820
|
Button4,
|
|
3642
3821
|
{
|
|
3643
|
-
sx:
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3822
|
+
sx: mergeSx(
|
|
3823
|
+
{
|
|
3824
|
+
backgroundColor,
|
|
3825
|
+
color: textColor,
|
|
3826
|
+
borderRadius: "4px",
|
|
3827
|
+
border,
|
|
3828
|
+
borderColor: "divider",
|
|
3829
|
+
lineHeight: 1.5,
|
|
3830
|
+
px: 1.5,
|
|
3831
|
+
py: 0,
|
|
3832
|
+
height: small ? "22px" : "26px",
|
|
3833
|
+
...small && { fontSize: "12px", letterSpacing: "-0.24px" },
|
|
3834
|
+
boxShadow: active ? `0 1px 2px 0 ${alpha4(theme.palette.common.black, 0.05)} !important` : "none !important"
|
|
3835
|
+
},
|
|
3836
|
+
sx
|
|
3837
|
+
),
|
|
3657
3838
|
...props,
|
|
3658
3839
|
children
|
|
3659
3840
|
}
|
|
@@ -3670,14 +3851,16 @@ function SegmentedButtonGroup({ children, sx, ...props }) {
|
|
|
3670
3851
|
Stack8,
|
|
3671
3852
|
{
|
|
3672
3853
|
direction: "row",
|
|
3673
|
-
p: 0.5,
|
|
3674
|
-
borderRadius: "6px",
|
|
3675
|
-
gap: 1,
|
|
3676
|
-
sx: {
|
|
3677
|
-
backgroundColor: isDarkMode ? theme.palette.grey[900] : theme.palette.grey[100],
|
|
3678
|
-
...sx
|
|
3679
|
-
},
|
|
3680
3854
|
...props,
|
|
3855
|
+
sx: mergeSx(
|
|
3856
|
+
{
|
|
3857
|
+
p: 0.5,
|
|
3858
|
+
borderRadius: "6px",
|
|
3859
|
+
gap: 1,
|
|
3860
|
+
backgroundColor: isDarkMode ? theme.palette.grey[900] : theme.palette.grey[100]
|
|
3861
|
+
},
|
|
3862
|
+
sx
|
|
3863
|
+
),
|
|
3681
3864
|
children
|
|
3682
3865
|
}
|
|
3683
3866
|
);
|
|
@@ -3697,7 +3880,7 @@ import {
|
|
|
3697
3880
|
Stack as Stack9,
|
|
3698
3881
|
Typography as Typography8
|
|
3699
3882
|
} from "@mui/material";
|
|
3700
|
-
import { Children
|
|
3883
|
+
import { Children, Fragment as Fragment7, isValidElement } from "react";
|
|
3701
3884
|
import {
|
|
3702
3885
|
ChevronDownIcon as ChevronDownIcon2,
|
|
3703
3886
|
ChevronRightIcon as ChevronRightIcon2,
|
|
@@ -3713,17 +3896,19 @@ function OrganizationSelector({
|
|
|
3713
3896
|
return /* @__PURE__ */ jsx30(
|
|
3714
3897
|
Stack9,
|
|
3715
3898
|
{
|
|
3716
|
-
sx:
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3899
|
+
sx: mergeSx(
|
|
3900
|
+
{
|
|
3901
|
+
width: "min(370px, calc(100vw - 24px))",
|
|
3902
|
+
minHeight: 64,
|
|
3903
|
+
maxHeight: "min(700px, 90vh)",
|
|
3904
|
+
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[700] : palette.grey[100],
|
|
3905
|
+
borderRadius: 3,
|
|
3906
|
+
p: 1.5,
|
|
3907
|
+
boxShadow: ({ palette }) => `0 4px 24px 0 ${alpha5(palette.common.black, 0.15)}`,
|
|
3908
|
+
overflow: "auto"
|
|
3909
|
+
},
|
|
3910
|
+
sx
|
|
3911
|
+
),
|
|
3727
3912
|
...props,
|
|
3728
3913
|
children: loading ? /* @__PURE__ */ jsx30(CircularProgress, { size: 40, sx: { mx: "auto", my: "auto" } }) : children
|
|
3729
3914
|
}
|
|
@@ -3735,22 +3920,24 @@ function OrganizationItemList({
|
|
|
3735
3920
|
maxHeight,
|
|
3736
3921
|
sx
|
|
3737
3922
|
}) {
|
|
3738
|
-
const items =
|
|
3923
|
+
const items = Children.toArray(children).filter(isValidElement);
|
|
3739
3924
|
return /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
3740
3925
|
/* @__PURE__ */ jsx30(
|
|
3741
3926
|
List2,
|
|
3742
3927
|
{
|
|
3743
3928
|
disablePadding: true,
|
|
3744
|
-
sx:
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3929
|
+
sx: mergeSx(
|
|
3930
|
+
{
|
|
3931
|
+
border: 0.6,
|
|
3932
|
+
borderColor: ({ palette }) => palette.mode === "dark" ? alpha5(palette.common.white, 0.12) : alpha5(palette.grey[900], 0.15),
|
|
3933
|
+
borderRadius: 2,
|
|
3934
|
+
...maxHeight !== void 0 && {
|
|
3935
|
+
overflow: "auto",
|
|
3936
|
+
maxHeight
|
|
3937
|
+
}
|
|
3751
3938
|
},
|
|
3752
|
-
|
|
3753
|
-
|
|
3939
|
+
sx
|
|
3940
|
+
),
|
|
3754
3941
|
children: items.map((item, i) => /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
3755
3942
|
item,
|
|
3756
3943
|
i !== items.length - 1 && /* @__PURE__ */ jsx30(Divider4, {})
|
|
@@ -3766,9 +3953,11 @@ function renderText(value, defaults) {
|
|
|
3766
3953
|
Typography8,
|
|
3767
3954
|
{
|
|
3768
3955
|
variant: defaults.variant,
|
|
3769
|
-
fontWeight: defaults.fontWeight,
|
|
3770
|
-
color: defaults.color,
|
|
3771
3956
|
noWrap: true,
|
|
3957
|
+
sx: {
|
|
3958
|
+
fontWeight: defaults.fontWeight,
|
|
3959
|
+
color: defaults.color
|
|
3960
|
+
},
|
|
3772
3961
|
children: value
|
|
3773
3962
|
}
|
|
3774
3963
|
);
|
|
@@ -3791,13 +3980,10 @@ function OrganizationItem({
|
|
|
3791
3980
|
{
|
|
3792
3981
|
disabled: disabled ?? isCurrent,
|
|
3793
3982
|
disableRipple: true,
|
|
3794
|
-
sx:
|
|
3795
|
-
p: 1,
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
"&.Mui-disabled": { opacity: 1 },
|
|
3799
|
-
...sx
|
|
3800
|
-
},
|
|
3983
|
+
sx: mergeSx(
|
|
3984
|
+
{ p: 1, pr: 1.5, gap: 1.5, "&.Mui-disabled": { opacity: 1 } },
|
|
3985
|
+
sx
|
|
3986
|
+
),
|
|
3801
3987
|
...props,
|
|
3802
3988
|
children: [
|
|
3803
3989
|
/* @__PURE__ */ jsx30(
|
|
@@ -3827,20 +4013,40 @@ function OrganizationItem({
|
|
|
3827
4013
|
) : logo
|
|
3828
4014
|
}
|
|
3829
4015
|
),
|
|
3830
|
-
/* @__PURE__ */ jsxs13(
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
4016
|
+
/* @__PURE__ */ jsxs13(
|
|
4017
|
+
Stack9,
|
|
4018
|
+
{
|
|
4019
|
+
sx: {
|
|
4020
|
+
gap: 0.25,
|
|
4021
|
+
width: "100%",
|
|
4022
|
+
minWidth: 0
|
|
4023
|
+
},
|
|
4024
|
+
children: [
|
|
4025
|
+
/* @__PURE__ */ jsxs13(
|
|
4026
|
+
Stack9,
|
|
4027
|
+
{
|
|
4028
|
+
direction: "row",
|
|
4029
|
+
sx: {
|
|
4030
|
+
justifyContent: "space-between",
|
|
4031
|
+
gap: 1
|
|
4032
|
+
},
|
|
4033
|
+
children: [
|
|
4034
|
+
renderText(primaryText, {
|
|
4035
|
+
variant: "body2",
|
|
4036
|
+
fontWeight: 600,
|
|
4037
|
+
color: "primary.main"
|
|
4038
|
+
}),
|
|
4039
|
+
meta && renderText(meta, { variant: "body2", color: "text.secondary" })
|
|
4040
|
+
]
|
|
4041
|
+
}
|
|
4042
|
+
),
|
|
4043
|
+
secondaryText && renderText(secondaryText, {
|
|
4044
|
+
variant: "caption",
|
|
4045
|
+
color: "text.secondary"
|
|
4046
|
+
})
|
|
4047
|
+
]
|
|
4048
|
+
}
|
|
4049
|
+
),
|
|
3844
4050
|
/* @__PURE__ */ jsx30(
|
|
3845
4051
|
ChevronRightIcon2,
|
|
3846
4052
|
{
|
|
@@ -3869,15 +4075,17 @@ function OrganizationSelectorButton({
|
|
|
3869
4075
|
ButtonBase,
|
|
3870
4076
|
{
|
|
3871
4077
|
disableRipple: true,
|
|
3872
|
-
sx:
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
4078
|
+
sx: mergeSx(
|
|
4079
|
+
{
|
|
4080
|
+
display: "flex",
|
|
4081
|
+
alignItems: "center",
|
|
4082
|
+
gap: 1,
|
|
4083
|
+
borderRadius: 1,
|
|
4084
|
+
p: 0.75,
|
|
4085
|
+
border: ({ palette }) => `0.6px solid ${palette.dividers.secondary}`
|
|
4086
|
+
},
|
|
4087
|
+
sx
|
|
4088
|
+
),
|
|
3881
4089
|
...props,
|
|
3882
4090
|
children: [
|
|
3883
4091
|
icon,
|
|
@@ -3885,9 +4093,11 @@ function OrganizationSelectorButton({
|
|
|
3885
4093
|
Typography8,
|
|
3886
4094
|
{
|
|
3887
4095
|
variant: "caption",
|
|
3888
|
-
fontWeight: 600,
|
|
3889
4096
|
noWrap: true,
|
|
3890
|
-
sx: {
|
|
4097
|
+
sx: {
|
|
4098
|
+
fontWeight: 600,
|
|
4099
|
+
flexShrink: 0
|
|
4100
|
+
},
|
|
3891
4101
|
children: name
|
|
3892
4102
|
}
|
|
3893
4103
|
),
|
|
@@ -3945,6 +4155,7 @@ import {
|
|
|
3945
4155
|
Typography as Typography9
|
|
3946
4156
|
} from "@mui/material";
|
|
3947
4157
|
import { useId as useId2 } from "react";
|
|
4158
|
+
import { mergeSlotProps as mergeSlotProps3 } from "@mui/material/utils";
|
|
3948
4159
|
import { jsx as jsx31, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3949
4160
|
function LandingFormPanel({
|
|
3950
4161
|
children,
|
|
@@ -3964,20 +4175,20 @@ function LandingFormPanel({
|
|
|
3964
4175
|
component: "form",
|
|
3965
4176
|
onSubmit: handleSubmit,
|
|
3966
4177
|
noValidate,
|
|
3967
|
-
|
|
3968
|
-
p: 1.5,
|
|
3969
|
-
borderRadius: 4,
|
|
3970
|
-
width,
|
|
3971
|
-
maxWidth: "100%",
|
|
4178
|
+
...stackProps,
|
|
3972
4179
|
sx: mergeSx(
|
|
3973
4180
|
{
|
|
4181
|
+
gap: 2,
|
|
4182
|
+
p: 1.5,
|
|
4183
|
+
borderRadius: 4,
|
|
4184
|
+
width,
|
|
4185
|
+
maxWidth: "100%",
|
|
3974
4186
|
// Figma's `background_default` (#F5F5F5) is `grey[100]` here, not
|
|
3975
4187
|
// `palette.background.default` — that token is #FFFFFF in light mode.
|
|
3976
4188
|
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[700] : palette.grey[100]
|
|
3977
4189
|
},
|
|
3978
4190
|
sx
|
|
3979
4191
|
),
|
|
3980
|
-
...stackProps,
|
|
3981
4192
|
children
|
|
3982
4193
|
}
|
|
3983
4194
|
);
|
|
@@ -4007,43 +4218,62 @@ function LandingFormField({
|
|
|
4007
4218
|
const generatedId = useId2();
|
|
4008
4219
|
const fieldId = id ?? generatedId;
|
|
4009
4220
|
const labelId = labelSlotProps?.id ?? `${fieldId}-label`;
|
|
4010
|
-
return /* @__PURE__ */ jsxs14(
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4221
|
+
return /* @__PURE__ */ jsxs14(
|
|
4222
|
+
Stack10,
|
|
4223
|
+
{
|
|
4224
|
+
...containerSlotProps,
|
|
4225
|
+
sx: mergeSx({ gap: 0.5, width: "100%" }, containerSlotProps?.sx),
|
|
4226
|
+
children: [
|
|
4227
|
+
/* @__PURE__ */ jsx31(
|
|
4228
|
+
Typography9,
|
|
4229
|
+
{
|
|
4230
|
+
component: "label",
|
|
4231
|
+
id: labelId,
|
|
4232
|
+
htmlFor: fieldId,
|
|
4233
|
+
color: "textPrimary",
|
|
4234
|
+
...labelSlotProps,
|
|
4235
|
+
sx: mergeSx({ fontSize: 12, fontWeight: 600 }, labelSlotProps?.sx),
|
|
4236
|
+
children: label
|
|
4237
|
+
}
|
|
4238
|
+
),
|
|
4239
|
+
/* @__PURE__ */ jsx31(
|
|
4240
|
+
TextField3,
|
|
4241
|
+
{
|
|
4242
|
+
id: fieldId,
|
|
4243
|
+
fullWidth: true,
|
|
4244
|
+
variant: "outlined",
|
|
4245
|
+
slotProps: {
|
|
4246
|
+
...fieldSlotProps,
|
|
4247
|
+
// `select` renders a `div[role="combobox"]`, which `<label for>`
|
|
4248
|
+
// cannot name — and MUI points its `aria-labelledby` at the div
|
|
4249
|
+
// itself, so the name would come out as the selected value. Naming
|
|
4250
|
+
// the label explicitly is what MUI's own floating label does.
|
|
4251
|
+
// Inert on a text field: `slotProps.select` only reaches a `Select`.
|
|
4252
|
+
select: mergeSlotProps3(fieldSlotProps.select, { labelId })
|
|
4253
|
+
},
|
|
4254
|
+
sx: mergeSx(fieldSx, sx),
|
|
4255
|
+
...textFieldProps
|
|
4256
|
+
}
|
|
4257
|
+
)
|
|
4258
|
+
]
|
|
4259
|
+
}
|
|
4260
|
+
);
|
|
4044
4261
|
}
|
|
4045
4262
|
function LandingFormActions(props) {
|
|
4046
|
-
return /* @__PURE__ */ jsx31(
|
|
4263
|
+
return /* @__PURE__ */ jsx31(
|
|
4264
|
+
Stack10,
|
|
4265
|
+
{
|
|
4266
|
+
direction: "row",
|
|
4267
|
+
...props,
|
|
4268
|
+
sx: mergeSx(
|
|
4269
|
+
{
|
|
4270
|
+
gap: 1,
|
|
4271
|
+
width: "100%"
|
|
4272
|
+
},
|
|
4273
|
+
props.sx
|
|
4274
|
+
)
|
|
4275
|
+
}
|
|
4276
|
+
);
|
|
4047
4277
|
}
|
|
4048
4278
|
function LandingFormCheckbox({
|
|
4049
4279
|
label,
|
|
@@ -4065,10 +4295,9 @@ function LandingFormCheckbox({
|
|
|
4065
4295
|
label,
|
|
4066
4296
|
slotProps: {
|
|
4067
4297
|
...labelSlotProps,
|
|
4068
|
-
typography:
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
)
|
|
4298
|
+
typography: mergeSlotProps3(labelSlotProps.typography, {
|
|
4299
|
+
variant: "body2"
|
|
4300
|
+
})
|
|
4072
4301
|
},
|
|
4073
4302
|
...formControlLabelProps,
|
|
4074
4303
|
sx: mergeSx({ m: 0, gap: 1, alignItems: "center" }, sx)
|
|
@@ -4088,12 +4317,13 @@ import {
|
|
|
4088
4317
|
Typography as Typography10
|
|
4089
4318
|
} from "@mui/material";
|
|
4090
4319
|
import {
|
|
4091
|
-
Children as
|
|
4320
|
+
Children as Children2,
|
|
4092
4321
|
cloneElement as cloneElement2,
|
|
4093
4322
|
Fragment as Fragment9,
|
|
4094
4323
|
isValidElement as isValidElement2
|
|
4095
4324
|
} from "react";
|
|
4096
4325
|
import { ChevronRightIcon as ChevronRightIcon3, SearchIcon as SearchIcon3 } from "@bwp-web/assets";
|
|
4326
|
+
import { mergeSlotProps as mergeSlotProps4 } from "@mui/material/utils";
|
|
4097
4327
|
import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4098
4328
|
function OrganizationRow({
|
|
4099
4329
|
primaryText,
|
|
@@ -4156,12 +4386,24 @@ function OrganizationRow({
|
|
|
4156
4386
|
{
|
|
4157
4387
|
noWrap: true,
|
|
4158
4388
|
variant: "body2",
|
|
4159
|
-
|
|
4160
|
-
|
|
4389
|
+
sx: {
|
|
4390
|
+
fontWeight: 600,
|
|
4391
|
+
color: disabled ? "text.secondary" : "text.primary"
|
|
4392
|
+
},
|
|
4161
4393
|
children: primaryText
|
|
4162
4394
|
}
|
|
4163
4395
|
),
|
|
4164
|
-
secondaryText && /* @__PURE__ */ jsx32(
|
|
4396
|
+
secondaryText && /* @__PURE__ */ jsx32(
|
|
4397
|
+
Typography10,
|
|
4398
|
+
{
|
|
4399
|
+
noWrap: true,
|
|
4400
|
+
variant: "caption",
|
|
4401
|
+
sx: {
|
|
4402
|
+
color: "text.secondary"
|
|
4403
|
+
},
|
|
4404
|
+
children: secondaryText
|
|
4405
|
+
}
|
|
4406
|
+
)
|
|
4165
4407
|
] }),
|
|
4166
4408
|
!disabled && /* @__PURE__ */ jsx32(
|
|
4167
4409
|
ChevronRightIcon3,
|
|
@@ -4191,7 +4433,7 @@ function OrganizationRowGroup({
|
|
|
4191
4433
|
sx,
|
|
4192
4434
|
...boxProps
|
|
4193
4435
|
}) {
|
|
4194
|
-
const items =
|
|
4436
|
+
const items = Children2.toArray(children).filter(isValidElement2);
|
|
4195
4437
|
return /* @__PURE__ */ jsx32(
|
|
4196
4438
|
Box17,
|
|
4197
4439
|
{
|
|
@@ -4242,34 +4484,53 @@ function OrganizationsEmptyState({
|
|
|
4242
4484
|
Stack11,
|
|
4243
4485
|
{
|
|
4244
4486
|
role: "status",
|
|
4245
|
-
alignItems: "center",
|
|
4246
|
-
gap: 0.5,
|
|
4247
|
-
width: "100%",
|
|
4248
|
-
py: 2,
|
|
4249
|
-
px: 2,
|
|
4250
4487
|
...stackProps,
|
|
4488
|
+
sx: mergeSx(
|
|
4489
|
+
{
|
|
4490
|
+
alignItems: "center",
|
|
4491
|
+
gap: 0.5,
|
|
4492
|
+
width: "100%",
|
|
4493
|
+
py: 2,
|
|
4494
|
+
px: 2
|
|
4495
|
+
},
|
|
4496
|
+
stackProps.sx
|
|
4497
|
+
),
|
|
4251
4498
|
children: [
|
|
4252
4499
|
cloneElement2(icon, {
|
|
4253
4500
|
"aria-hidden": true,
|
|
4254
|
-
sx:
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4501
|
+
sx: mergeSx(
|
|
4502
|
+
{
|
|
4503
|
+
width: 24,
|
|
4504
|
+
height: 24,
|
|
4505
|
+
mb: 0.5,
|
|
4506
|
+
color: "text.secondary"
|
|
4507
|
+
},
|
|
4508
|
+
icon.props.sx
|
|
4509
|
+
)
|
|
4261
4510
|
}),
|
|
4262
4511
|
/* @__PURE__ */ jsx32(
|
|
4263
4512
|
Typography10,
|
|
4264
4513
|
{
|
|
4265
4514
|
variant: "body2",
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4515
|
+
sx: {
|
|
4516
|
+
fontWeight: 600,
|
|
4517
|
+
color: "text.primary",
|
|
4518
|
+
textAlign: "center"
|
|
4519
|
+
},
|
|
4269
4520
|
children: title
|
|
4270
4521
|
}
|
|
4271
4522
|
),
|
|
4272
|
-
description && /* @__PURE__ */ jsx32(
|
|
4523
|
+
description && /* @__PURE__ */ jsx32(
|
|
4524
|
+
Typography10,
|
|
4525
|
+
{
|
|
4526
|
+
variant: "caption",
|
|
4527
|
+
sx: {
|
|
4528
|
+
color: "text.secondary",
|
|
4529
|
+
textAlign: "center"
|
|
4530
|
+
},
|
|
4531
|
+
children: description
|
|
4532
|
+
}
|
|
4533
|
+
)
|
|
4273
4534
|
]
|
|
4274
4535
|
}
|
|
4275
4536
|
);
|
|
@@ -4298,22 +4559,22 @@ function OrganizationsPanel({
|
|
|
4298
4559
|
return /* @__PURE__ */ jsxs15(
|
|
4299
4560
|
Stack11,
|
|
4300
4561
|
{
|
|
4301
|
-
|
|
4302
|
-
alignItems: "center",
|
|
4303
|
-
justifyContent: "center",
|
|
4304
|
-
p: 1.5,
|
|
4305
|
-
borderRadius: 4,
|
|
4306
|
-
width,
|
|
4307
|
-
maxWidth: "100%",
|
|
4562
|
+
...stackProps,
|
|
4308
4563
|
sx: mergeSx(
|
|
4309
4564
|
{
|
|
4565
|
+
gap: 2,
|
|
4566
|
+
alignItems: "center",
|
|
4567
|
+
justifyContent: "center",
|
|
4568
|
+
p: 1.5,
|
|
4569
|
+
borderRadius: 4,
|
|
4570
|
+
width,
|
|
4571
|
+
maxWidth: "100%",
|
|
4310
4572
|
// Figma's `background_default` (#F5F5F5) is `grey[100]` here, not
|
|
4311
4573
|
// `palette.background.default` — that token is #FFFFFF in light mode.
|
|
4312
4574
|
backgroundColor: ({ palette }) => palette.mode === "dark" ? palette.grey[700] : palette.grey[100]
|
|
4313
4575
|
},
|
|
4314
4576
|
sx
|
|
4315
4577
|
),
|
|
4316
|
-
...stackProps,
|
|
4317
4578
|
children: [
|
|
4318
4579
|
search && /* @__PURE__ */ jsx32(
|
|
4319
4580
|
TextField4,
|
|
@@ -4336,16 +4597,12 @@ function OrganizationsPanel({
|
|
|
4336
4597
|
),
|
|
4337
4598
|
slotProps: {
|
|
4338
4599
|
...searchFieldSlotProps,
|
|
4339
|
-
input:
|
|
4340
|
-
{
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
)
|
|
4345
|
-
htmlInput: mergeSlotProps(
|
|
4346
|
-
{ "aria-label": search.placeholder },
|
|
4347
|
-
searchFieldSlotProps?.htmlInput
|
|
4348
|
-
)
|
|
4600
|
+
input: mergeSlotProps4(searchFieldSlotProps?.input, {
|
|
4601
|
+
startAdornment: /* @__PURE__ */ jsx32(InputAdornment3, { position: "start", children: /* @__PURE__ */ jsx32(SearchIcon3, { sx: { ml: 1 } }) })
|
|
4602
|
+
}),
|
|
4603
|
+
htmlInput: mergeSlotProps4(searchFieldSlotProps?.htmlInput, {
|
|
4604
|
+
"aria-label": search.placeholder
|
|
4605
|
+
})
|
|
4349
4606
|
},
|
|
4350
4607
|
...searchSlotProps
|
|
4351
4608
|
}
|
|
@@ -4363,10 +4620,17 @@ function OrganizationsPanel({
|
|
|
4363
4620
|
)
|
|
4364
4621
|
] }),
|
|
4365
4622
|
empty ? empty === true ? /* @__PURE__ */ jsx32(OrganizationsEmptyState, {}) : empty : orLabel && /* @__PURE__ */ jsx32(TextDivider, { ...slotProps?.orLabel, children: orLabel }),
|
|
4366
|
-
(joinAction || createAction) && /* @__PURE__ */ jsxs15(
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4623
|
+
(joinAction || createAction) && /* @__PURE__ */ jsxs15(
|
|
4624
|
+
Stack11,
|
|
4625
|
+
{
|
|
4626
|
+
...slotProps?.actions,
|
|
4627
|
+
sx: mergeSx({ gap: 1, width: "100%" }, slotProps?.actions?.sx),
|
|
4628
|
+
children: [
|
|
4629
|
+
joinAction && /* @__PURE__ */ jsx32(OrganizationRowGroup, { ...slotProps?.joinGroup, children: joinAction }),
|
|
4630
|
+
createAction && /* @__PURE__ */ jsx32(OrganizationRowGroup, { ...slotProps?.createGroup, children: createAction })
|
|
4631
|
+
]
|
|
4632
|
+
}
|
|
4633
|
+
)
|
|
4370
4634
|
]
|
|
4371
4635
|
}
|
|
4372
4636
|
);
|
|
@@ -4397,23 +4661,27 @@ function UserInitialsIcon({
|
|
|
4397
4661
|
return /* @__PURE__ */ jsx33(
|
|
4398
4662
|
Box18,
|
|
4399
4663
|
{
|
|
4400
|
-
minWidth: width,
|
|
4401
|
-
width,
|
|
4402
|
-
minHeight: height,
|
|
4403
|
-
height,
|
|
4404
|
-
borderRadius,
|
|
4405
|
-
bgcolor: bgColor,
|
|
4406
|
-
display: "flex",
|
|
4407
|
-
alignItems: "center",
|
|
4408
|
-
justifyContent: "center",
|
|
4409
|
-
sx: { ...sx },
|
|
4410
4664
|
...props,
|
|
4665
|
+
sx: mergeSx(
|
|
4666
|
+
{
|
|
4667
|
+
minWidth: width,
|
|
4668
|
+
width,
|
|
4669
|
+
minHeight: height,
|
|
4670
|
+
height,
|
|
4671
|
+
borderRadius,
|
|
4672
|
+
bgcolor: bgColor,
|
|
4673
|
+
display: "flex",
|
|
4674
|
+
alignItems: "center",
|
|
4675
|
+
justifyContent: "center"
|
|
4676
|
+
},
|
|
4677
|
+
sx
|
|
4678
|
+
),
|
|
4411
4679
|
children: /* @__PURE__ */ jsx33(
|
|
4412
4680
|
Typography11,
|
|
4413
4681
|
{
|
|
4414
4682
|
variant: "h3",
|
|
4415
|
-
color: textColor,
|
|
4416
4683
|
sx: {
|
|
4684
|
+
color: textColor,
|
|
4417
4685
|
userSelect: "none",
|
|
4418
4686
|
fontSize: size !== DEFAULT_SIZE ? `${fontSize}px` : void 0
|
|
4419
4687
|
},
|
|
@@ -4432,9 +4700,19 @@ var getInitials = (name) => {
|
|
|
4432
4700
|
|
|
4433
4701
|
// src/DynamicSvgIcon/DynamicSvgIcon.tsx
|
|
4434
4702
|
import { SvgIcon, Skeleton, Box as Box19 } from "@mui/material";
|
|
4435
|
-
import { useEffect as
|
|
4703
|
+
import { useEffect as useEffect5, useState as useState10 } from "react";
|
|
4436
4704
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4437
4705
|
var svgCache = /* @__PURE__ */ new Map();
|
|
4706
|
+
function iconStateFor(url, transform) {
|
|
4707
|
+
const cached = url ? svgCache.get(url) : void 0;
|
|
4708
|
+
return {
|
|
4709
|
+
url,
|
|
4710
|
+
svgContent: cached ? transform(cached.innerContent) : null,
|
|
4711
|
+
svgViewBox: cached?.viewBox ?? null,
|
|
4712
|
+
loading: !!url && !cached,
|
|
4713
|
+
error: url ? null : "No URL provided"
|
|
4714
|
+
};
|
|
4715
|
+
}
|
|
4438
4716
|
function clearDynamicSvgIconCache() {
|
|
4439
4717
|
svgCache.clear();
|
|
4440
4718
|
}
|
|
@@ -4444,67 +4722,57 @@ function applyCurrentColor(svg) {
|
|
|
4444
4722
|
function useDynamicSvgIcon(url, options = {}) {
|
|
4445
4723
|
const { replaceColors = false, onLoad, onError } = options;
|
|
4446
4724
|
const transform = replaceColors ? applyCurrentColor : (s) => s;
|
|
4447
|
-
const [
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
}
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
});
|
|
4455
|
-
const [loading, setLoading] = useState9(() => !svgCache.has(url));
|
|
4456
|
-
const [error, setError] = useState9(null);
|
|
4457
|
-
useEffect6(() => {
|
|
4458
|
-
if (!url) {
|
|
4459
|
-
setLoading(false);
|
|
4460
|
-
setError("No URL provided");
|
|
4461
|
-
setSvgContent(null);
|
|
4462
|
-
setSvgViewBox(null);
|
|
4463
|
-
return;
|
|
4464
|
-
}
|
|
4465
|
-
let cancelled = false;
|
|
4466
|
-
const cached = svgCache.get(url);
|
|
4467
|
-
if (cached) {
|
|
4468
|
-
setSvgContent(transform(cached.innerContent));
|
|
4469
|
-
setSvgViewBox(cached.viewBox);
|
|
4470
|
-
setLoading(false);
|
|
4471
|
-
setError(null);
|
|
4725
|
+
const [state, setState] = useState10(() => iconStateFor(url, transform));
|
|
4726
|
+
if (state.url !== url) {
|
|
4727
|
+
setState(iconStateFor(url, transform));
|
|
4728
|
+
}
|
|
4729
|
+
useEffect5(() => {
|
|
4730
|
+
if (!url) return;
|
|
4731
|
+
if (!state.loading) {
|
|
4472
4732
|
onLoad?.();
|
|
4473
4733
|
return;
|
|
4474
4734
|
}
|
|
4475
|
-
|
|
4476
|
-
setError(null);
|
|
4477
|
-
setSvgContent(null);
|
|
4478
|
-
setSvgViewBox(null);
|
|
4735
|
+
let cancelled = false;
|
|
4479
4736
|
(async () => {
|
|
4480
4737
|
try {
|
|
4481
|
-
|
|
4482
|
-
if (!
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4738
|
+
let entry = svgCache.get(url);
|
|
4739
|
+
if (!entry) {
|
|
4740
|
+
const response = await fetch(url);
|
|
4741
|
+
if (!response.ok) {
|
|
4742
|
+
throw new Error(
|
|
4743
|
+
`Failed to fetch SVG: ${response.status} ${response.statusText}`
|
|
4744
|
+
);
|
|
4745
|
+
}
|
|
4746
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
4747
|
+
const text = await response.text();
|
|
4748
|
+
if (!text.includes("<svg") && !contentType.includes("svg")) {
|
|
4749
|
+
throw new Error("Response is not an SVG");
|
|
4750
|
+
}
|
|
4751
|
+
const viewBoxMatch = text.match(/viewBox="([^"]*)"/);
|
|
4752
|
+
const viewBox = viewBoxMatch ? viewBoxMatch[1] : null;
|
|
4753
|
+
const svgMatch = text.match(/<svg[^>]*>([\s\S]*?)<\/svg>/);
|
|
4754
|
+
const innerContent = svgMatch ? svgMatch[1] : text;
|
|
4755
|
+
entry = { innerContent, viewBox };
|
|
4756
|
+
svgCache.set(url, entry);
|
|
4491
4757
|
}
|
|
4492
|
-
const viewBoxMatch = text.match(/viewBox="([^"]*)"/);
|
|
4493
|
-
const viewBox = viewBoxMatch ? viewBoxMatch[1] : null;
|
|
4494
|
-
const svgMatch = text.match(/<svg[^>]*>([\s\S]*?)<\/svg>/);
|
|
4495
|
-
const innerContent = svgMatch ? svgMatch[1] : text;
|
|
4496
|
-
svgCache.set(url, { innerContent, viewBox });
|
|
4497
4758
|
if (!cancelled) {
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4759
|
+
const { innerContent, viewBox } = entry;
|
|
4760
|
+
setState(
|
|
4761
|
+
(prev) => prev.url === url ? {
|
|
4762
|
+
...prev,
|
|
4763
|
+
svgContent: transform(innerContent),
|
|
4764
|
+
svgViewBox: viewBox,
|
|
4765
|
+
loading: false
|
|
4766
|
+
} : prev
|
|
4767
|
+
);
|
|
4501
4768
|
onLoad?.();
|
|
4502
4769
|
}
|
|
4503
4770
|
} catch (err) {
|
|
4504
4771
|
if (!cancelled) {
|
|
4505
4772
|
const message = err instanceof Error ? err.message : "Failed to load SVG";
|
|
4506
|
-
|
|
4507
|
-
|
|
4773
|
+
setState(
|
|
4774
|
+
(prev) => prev.url === url ? { ...prev, error: message, loading: false } : prev
|
|
4775
|
+
);
|
|
4508
4776
|
onError?.(message);
|
|
4509
4777
|
}
|
|
4510
4778
|
}
|
|
@@ -4513,6 +4781,7 @@ function useDynamicSvgIcon(url, options = {}) {
|
|
|
4513
4781
|
cancelled = true;
|
|
4514
4782
|
};
|
|
4515
4783
|
}, [url]);
|
|
4784
|
+
const { loading, error, svgContent, svgViewBox } = state;
|
|
4516
4785
|
return { loading, error, svgContent, svgViewBox };
|
|
4517
4786
|
}
|
|
4518
4787
|
var DEFAULT_SIZE2 = 24;
|
|
@@ -4570,11 +4839,7 @@ function DynamicSvgIcon({
|
|
|
4570
4839
|
{
|
|
4571
4840
|
...svgIconProps,
|
|
4572
4841
|
...svgViewBox && { viewBox: svgViewBox },
|
|
4573
|
-
sx: {
|
|
4574
|
-
...typeof sx === "object" && sx !== null && !Array.isArray(sx) ? sx : void 0,
|
|
4575
|
-
width,
|
|
4576
|
-
height
|
|
4577
|
-
},
|
|
4842
|
+
sx: mergeSx(sx, { width, height }),
|
|
4578
4843
|
children: /* @__PURE__ */ jsx34("g", { dangerouslySetInnerHTML: { __html: svgContent } })
|
|
4579
4844
|
}
|
|
4580
4845
|
);
|
|
@@ -4588,11 +4853,7 @@ export {
|
|
|
4588
4853
|
BiampBannerActions,
|
|
4589
4854
|
BiampBannerContent,
|
|
4590
4855
|
BiampBannerIcon,
|
|
4591
|
-
BiampBuildAppContent,
|
|
4592
|
-
BiampBuildAppContentItem,
|
|
4593
4856
|
BiampCheckboxListPopover,
|
|
4594
|
-
BiampEndUserAppContent,
|
|
4595
|
-
BiampEndUserAppContentItem,
|
|
4596
4857
|
BiampGlobalSearch,
|
|
4597
4858
|
BiampHeader,
|
|
4598
4859
|
BiampHeaderActions,
|