@australiangreens/ag-internal-components 0.0.98 → 0.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -24,19 +24,19 @@ var L = (e, t, n) => new Promise((i, r) => {
|
|
|
24
24
|
var s = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
d(n.next(l));
|
|
27
|
-
} catch (
|
|
28
|
-
r(
|
|
27
|
+
} catch (p) {
|
|
28
|
+
r(p);
|
|
29
29
|
}
|
|
30
30
|
}, c = (l) => {
|
|
31
31
|
try {
|
|
32
32
|
d(n.throw(l));
|
|
33
|
-
} catch (
|
|
34
|
-
r(
|
|
33
|
+
} catch (p) {
|
|
34
|
+
r(p);
|
|
35
35
|
}
|
|
36
36
|
}, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
|
|
37
37
|
d((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as
|
|
39
|
+
import { jsxs as u, Fragment as E, jsx as o } from "react/jsx-runtime";
|
|
40
40
|
import { useState as B, createContext as Je, useCallback as ie, useContext as Ze, useEffect as re, createElement as xe, useRef as ge } from "react";
|
|
41
41
|
import { Typography as F, Button as ae, Paper as je, Box as y, Drawer as we, styled as Ae, IconButton as K, Container as et, useTheme as se, useMediaQuery as Rt, Collapse as Ht, Avatar as Pe, Fade as Wt, Skeleton as Ne, Toolbar as zt, Divider as Le, CssBaseline as Ut, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as be, TextField as Se, CircularProgress as ke, Chip as Gt, Tooltip as Vt, Stack as qt, Snackbar as Xt, Alert as Qt, FormHelperText as Yt } from "@mui/material";
|
|
42
42
|
import Kt from "@mui/material/CssBaseline";
|
|
@@ -46,8 +46,8 @@ import { createHelper as Q } from "souvlaki";
|
|
|
46
46
|
import { BrowserRouter as Zt } from "react-router-dom";
|
|
47
47
|
import st from "@mui/material/List";
|
|
48
48
|
import { ArrowForward as lt, ArrowBack as ct, ViewHeadline as jt, Cancel as en, ArrowDropDown as tn } from "@mui/icons-material";
|
|
49
|
-
import { atom as _, useSetAtom as dt, useAtomValue as _e, useAtom as V, getDefaultStore as nn, Provider as
|
|
50
|
-
import { useHydrateAtoms as
|
|
49
|
+
import { atom as _, useSetAtom as dt, useAtomValue as _e, useAtom as V, getDefaultStore as nn, Provider as pt } from "jotai";
|
|
50
|
+
import { useHydrateAtoms as ut } from "jotai/utils";
|
|
51
51
|
import Me from "react-avatar";
|
|
52
52
|
import on from "autosuggest-highlight/match";
|
|
53
53
|
import rn from "autosuggest-highlight/parse";
|
|
@@ -57,7 +57,7 @@ import { Buffer as cn } from "buffer";
|
|
|
57
57
|
import dn from "@mui/material/Skeleton";
|
|
58
58
|
function Oo({ text: e }) {
|
|
59
59
|
const [t, n] = B(0);
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ u(E, { children: [
|
|
61
61
|
/* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
62
62
|
/* @__PURE__ */ o(F, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
63
63
|
/* @__PURE__ */ o(
|
|
@@ -69,11 +69,11 @@ function Oo({ text: e }) {
|
|
|
69
69
|
children: "Hello I am a button"
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ u("p", { children: [
|
|
73
73
|
"This is some text: ",
|
|
74
74
|
/* @__PURE__ */ o("span", { children: e })
|
|
75
75
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ u(je, { children: [
|
|
77
77
|
"This number will incremember when button pressed: ",
|
|
78
78
|
t
|
|
79
79
|
] })
|
|
@@ -87,7 +87,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
|
|
|
87
87
|
userInfoHolder: `${U}-userInfoHolder`,
|
|
88
88
|
settings: `${U}-settings`,
|
|
89
89
|
pieChartIcon: `${U}-pieChartIcon`
|
|
90
|
-
},
|
|
90
|
+
}, pn = R(y, {
|
|
91
91
|
name: "NavBar"
|
|
92
92
|
})(({ theme: e }) => ({
|
|
93
93
|
[`&.${q.root}`]: {
|
|
@@ -116,7 +116,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
|
|
|
116
116
|
color: "white",
|
|
117
117
|
backgroundColor: "black"
|
|
118
118
|
// backgroundColor: '#e8e8e8',
|
|
119
|
-
}),
|
|
119
|
+
}), un = () => a({
|
|
120
120
|
width: gt
|
|
121
121
|
}, mt()), hn = () => a({
|
|
122
122
|
width: ft
|
|
@@ -129,7 +129,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
|
|
|
129
129
|
boxSizing: "border-box",
|
|
130
130
|
zIndex: e.zIndex.drawer + 100
|
|
131
131
|
}, t && {
|
|
132
|
-
"& .MuiDrawer-paper":
|
|
132
|
+
"& .MuiDrawer-paper": un()
|
|
133
133
|
}), !t && {
|
|
134
134
|
"& .MuiDrawer-paper": hn()
|
|
135
135
|
}));
|
|
@@ -242,7 +242,7 @@ function Po({
|
|
|
242
242
|
children: t
|
|
243
243
|
}) {
|
|
244
244
|
const { open: n } = xn();
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ u(pn, { className: q.root, "data-testid": e, children: [
|
|
246
246
|
/* @__PURE__ */ o(Kt, {}),
|
|
247
247
|
/* @__PURE__ */ o(
|
|
248
248
|
gn,
|
|
@@ -321,10 +321,10 @@ function Sn({
|
|
|
321
321
|
rightPanel: n,
|
|
322
322
|
"data-testid": i
|
|
323
323
|
}) {
|
|
324
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ u(bn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
325
325
|
/* @__PURE__ */ o("div", { className: T.topStripe }),
|
|
326
|
-
/* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */
|
|
327
|
-
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */ u(y, { className: T.titleSlider, children: [
|
|
327
|
+
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ u(
|
|
328
328
|
K,
|
|
329
329
|
{
|
|
330
330
|
className: T.leftPanelButton,
|
|
@@ -340,7 +340,7 @@ function Sn({
|
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
342
|
/* @__PURE__ */ o(F, { className: T.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
343
|
-
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */
|
|
343
|
+
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ u(
|
|
344
344
|
K,
|
|
345
345
|
{
|
|
346
346
|
className: T.rightPanelButton,
|
|
@@ -419,18 +419,18 @@ function We({
|
|
|
419
419
|
showCloseArrow: c = !0,
|
|
420
420
|
debugOpacity: d = !1,
|
|
421
421
|
headerBoxProps: l = {},
|
|
422
|
-
onOpened:
|
|
422
|
+
onOpened: p,
|
|
423
423
|
onClosed: v,
|
|
424
424
|
"data-testid": C,
|
|
425
425
|
navBarOpen: A = !1,
|
|
426
426
|
navBarWidthOpen: g = 0,
|
|
427
427
|
navBarWidthClosed: $ = 0
|
|
428
428
|
}) {
|
|
429
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ u(
|
|
430
430
|
kn,
|
|
431
431
|
{
|
|
432
432
|
SlideProps: {
|
|
433
|
-
onEntered: () =>
|
|
433
|
+
onEntered: () => p == null ? void 0 : p(),
|
|
434
434
|
onExited: () => v == null ? void 0 : v()
|
|
435
435
|
},
|
|
436
436
|
variant: "persistent",
|
|
@@ -443,14 +443,14 @@ function We({
|
|
|
443
443
|
navBarWidthOpen: g,
|
|
444
444
|
navBarWidthClosed: $,
|
|
445
445
|
children: [
|
|
446
|
-
/* @__PURE__ */ o(Dn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ o(Dn, k(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ u(E, { children: [
|
|
447
447
|
/* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
448
|
-
c && /* @__PURE__ */
|
|
448
|
+
c && /* @__PURE__ */ u(K, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
449
449
|
/* @__PURE__ */ o(ct, { "data-testid": "arrowbackicon" }),
|
|
450
450
|
" "
|
|
451
451
|
] })
|
|
452
|
-
] }) : /* @__PURE__ */
|
|
453
|
-
c && /* @__PURE__ */
|
|
452
|
+
] }) : /* @__PURE__ */ u(E, { children: [
|
|
453
|
+
c && /* @__PURE__ */ u(K, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
454
454
|
/* @__PURE__ */ o(lt, {}),
|
|
455
455
|
" "
|
|
456
456
|
] }),
|
|
@@ -514,11 +514,11 @@ function No({
|
|
|
514
514
|
pageContainerProps: c,
|
|
515
515
|
pageContentDataTestId: d,
|
|
516
516
|
topBarDataTestId: l,
|
|
517
|
-
navBarOpen:
|
|
517
|
+
navBarOpen: p,
|
|
518
518
|
navBarWidthOpen: v,
|
|
519
519
|
navBarWidthClosed: C
|
|
520
520
|
}) {
|
|
521
|
-
const [A, g] = B(me), [$,
|
|
521
|
+
const [A, g] = B(me), [$, D] = B(Ce), [b, I] = B(me), [O, P] = B(Ce), N = n !== void 0, S = i !== void 0, {
|
|
522
522
|
titleText: w,
|
|
523
523
|
content: H,
|
|
524
524
|
flavour: W,
|
|
@@ -546,20 +546,20 @@ function No({
|
|
|
546
546
|
re(() => {
|
|
547
547
|
M !== me && (g(M), I(M));
|
|
548
548
|
}, [M]), re(() => {
|
|
549
|
-
ee !== Ce && (
|
|
549
|
+
ee !== Ce && (D(ee), P(ee));
|
|
550
550
|
}, [ee]);
|
|
551
|
-
const
|
|
552
|
-
h === void 0 && (g(z), r && S && (z ? (
|
|
551
|
+
const pe = h === void 0 ? A : h, ue = ce === void 0 ? $ : ce, Ie = (z) => {
|
|
552
|
+
h === void 0 && (g(z), r && S && (z ? (D(!1), P($)) : D(O))), f && f(z);
|
|
553
553
|
}, Oe = (z) => {
|
|
554
|
-
ce === void 0 && (
|
|
554
|
+
ce === void 0 && (D(z), r && N && (z ? (g(!1), I(A)) : g(b))), $e && $e(z);
|
|
555
555
|
};
|
|
556
|
-
return /* @__PURE__ */
|
|
556
|
+
return /* @__PURE__ */ u(y, { children: [
|
|
557
557
|
N && /* @__PURE__ */ o(
|
|
558
558
|
We,
|
|
559
559
|
{
|
|
560
560
|
"data-testid": Tt,
|
|
561
561
|
anchor: "left",
|
|
562
|
-
open:
|
|
562
|
+
open: pe,
|
|
563
563
|
onClose: () => Ie(!1),
|
|
564
564
|
width: m,
|
|
565
565
|
titleText: w,
|
|
@@ -567,7 +567,7 @@ function No({
|
|
|
567
567
|
showCloseArrow: x === "both" || x === "close",
|
|
568
568
|
onOpened: Z,
|
|
569
569
|
onClosed: le,
|
|
570
|
-
navBarOpen:
|
|
570
|
+
navBarOpen: p,
|
|
571
571
|
navBarWidthOpen: v,
|
|
572
572
|
navBarWidthClosed: C,
|
|
573
573
|
children: H
|
|
@@ -578,7 +578,7 @@ function No({
|
|
|
578
578
|
{
|
|
579
579
|
"data-testid": Nt,
|
|
580
580
|
anchor: "right",
|
|
581
|
-
open:
|
|
581
|
+
open: ue,
|
|
582
582
|
onClose: () => Oe(!1),
|
|
583
583
|
width: de,
|
|
584
584
|
titleText: Bt,
|
|
@@ -586,7 +586,7 @@ function No({
|
|
|
586
586
|
showCloseArrow: j === "both" || j === "close",
|
|
587
587
|
onOpened: Ft,
|
|
588
588
|
onClosed: Pt,
|
|
589
|
-
navBarOpen:
|
|
589
|
+
navBarOpen: p,
|
|
590
590
|
navBarWidthOpen: v,
|
|
591
591
|
navBarWidthClosed: C,
|
|
592
592
|
children: Et
|
|
@@ -599,14 +599,14 @@ function No({
|
|
|
599
599
|
"data-testid": l
|
|
600
600
|
}, N && W === "push" ? {
|
|
601
601
|
leftPanel: {
|
|
602
|
-
open:
|
|
602
|
+
open: pe,
|
|
603
603
|
width: m,
|
|
604
604
|
onOpen: () => Ie(!0),
|
|
605
605
|
showOpenArrow: x === "both" || x === "open"
|
|
606
606
|
}
|
|
607
607
|
} : {}), S && ye === "push" ? {
|
|
608
608
|
rightPanel: {
|
|
609
|
-
open:
|
|
609
|
+
open: ue,
|
|
610
610
|
width: de,
|
|
611
611
|
onOpen: () => Oe(!0),
|
|
612
612
|
showOpenArrow: j === "both" || j === "open"
|
|
@@ -617,12 +617,12 @@ function No({
|
|
|
617
617
|
yn,
|
|
618
618
|
k(a(a({}, W === "push" ? {
|
|
619
619
|
leftPanel: {
|
|
620
|
-
open:
|
|
620
|
+
open: pe,
|
|
621
621
|
width: m
|
|
622
622
|
}
|
|
623
623
|
} : {}), ye === "push" ? {
|
|
624
624
|
rightPanel: {
|
|
625
|
-
open:
|
|
625
|
+
open: ue,
|
|
626
626
|
width: de
|
|
627
627
|
}
|
|
628
628
|
} : {}), {
|
|
@@ -720,7 +720,7 @@ function Ln(e) {
|
|
|
720
720
|
const Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ve = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
721
721
|
function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
722
722
|
const r = se();
|
|
723
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ u(
|
|
724
724
|
y,
|
|
725
725
|
{
|
|
726
726
|
sx: {
|
|
@@ -761,7 +761,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
761
761
|
transition: n ? X(r, ["width", "height"], "entering") : X(r, ["width", "height"], "leaving"),
|
|
762
762
|
aspectRatio: 1
|
|
763
763
|
},
|
|
764
|
-
children: e != null && e.name ? /* @__PURE__ */ o(E, { children: /* @__PURE__ */
|
|
764
|
+
children: e != null && e.name ? /* @__PURE__ */ o(E, { children: /* @__PURE__ */ u(Me, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
|
|
765
765
|
" ",
|
|
766
766
|
Ve(e == null ? void 0 : e.name),
|
|
767
767
|
" ",
|
|
@@ -769,7 +769,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
769
769
|
] }) }) : /* @__PURE__ */ o(Me, {})
|
|
770
770
|
}
|
|
771
771
|
),
|
|
772
|
-
/* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u(y, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
773
773
|
e != null && e.name ? /* @__PURE__ */ o(F, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
|
|
774
774
|
t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
|
|
775
775
|
] }) }) })
|
|
@@ -787,10 +787,10 @@ function Mn({
|
|
|
787
787
|
bottom: c,
|
|
788
788
|
user: d,
|
|
789
789
|
domainCode: l,
|
|
790
|
-
useNewAvatar:
|
|
790
|
+
useNewAvatar: p = !1
|
|
791
791
|
}) {
|
|
792
792
|
const v = vt(), C = dt(J);
|
|
793
|
-
return /* @__PURE__ */ o(Fn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ o(Fn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
|
|
794
794
|
Nn,
|
|
795
795
|
{
|
|
796
796
|
open: e,
|
|
@@ -807,14 +807,14 @@ function Mn({
|
|
|
807
807
|
isSmallScreen: v,
|
|
808
808
|
children: [
|
|
809
809
|
!v && /* @__PURE__ */ o(zt, {}),
|
|
810
|
-
r && /* @__PURE__ */
|
|
810
|
+
r && /* @__PURE__ */ u(y, { flexGrow: "0", children: [
|
|
811
811
|
r,
|
|
812
812
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
813
813
|
] }),
|
|
814
814
|
/* @__PURE__ */ o(y, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(En, { links: s }) : s }),
|
|
815
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ u(y, { flexGrow: "0", children: [
|
|
816
816
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
817
|
-
/* @__PURE__ */ o(_n, { user: d, domainCode: l, open: e, useNewAvatar:
|
|
817
|
+
/* @__PURE__ */ o(_n, { user: d, domainCode: l, open: e, useNewAvatar: p }),
|
|
818
818
|
c && /* @__PURE__ */ o(E, { children: c })
|
|
819
819
|
] })
|
|
820
820
|
]
|
|
@@ -858,7 +858,7 @@ function zn({
|
|
|
858
858
|
middle: i
|
|
859
859
|
}) {
|
|
860
860
|
const r = dt(J), s = () => r((l) => !l), c = se(), d = vt();
|
|
861
|
-
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ u(
|
|
862
862
|
je,
|
|
863
863
|
{
|
|
864
864
|
square: !0,
|
|
@@ -902,40 +902,41 @@ function Lo({
|
|
|
902
902
|
navBarDataTestId: c,
|
|
903
903
|
navBarMiddle: d,
|
|
904
904
|
navBarBottom: l,
|
|
905
|
-
user:
|
|
906
|
-
domainCode: v
|
|
905
|
+
user: p,
|
|
906
|
+
domainCode: v,
|
|
907
|
+
useNewAvatar: C = !1
|
|
907
908
|
}) {
|
|
908
|
-
|
|
909
|
+
ut([
|
|
909
910
|
[J, n != null ? n : !0],
|
|
910
911
|
[ve, t != null ? t : ""]
|
|
911
912
|
]);
|
|
912
|
-
const
|
|
913
|
-
return /* @__PURE__ */
|
|
913
|
+
const A = _e(J), [g] = V(wt), [$] = V(At), D = _e(ve), [b] = V(bt), [I] = V(Bn), [O] = V(St);
|
|
914
|
+
return /* @__PURE__ */ u(y, { children: [
|
|
914
915
|
/* @__PURE__ */ o(Ut, {}),
|
|
915
916
|
/* @__PURE__ */ o(
|
|
916
917
|
zn,
|
|
917
918
|
{
|
|
918
|
-
titleText:
|
|
919
|
+
titleText: D,
|
|
919
920
|
"data-testid": s,
|
|
920
921
|
height: b,
|
|
921
|
-
middle:
|
|
922
|
+
middle: I
|
|
922
923
|
}
|
|
923
924
|
),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ u(y, { sx: { display: "flex" }, children: [
|
|
925
926
|
/* @__PURE__ */ o(
|
|
926
927
|
Mn,
|
|
927
928
|
{
|
|
928
|
-
open:
|
|
929
|
-
top:
|
|
929
|
+
open: A,
|
|
930
|
+
top: O,
|
|
930
931
|
middle: d,
|
|
931
932
|
bottom: l,
|
|
932
|
-
user:
|
|
933
|
+
user: p,
|
|
933
934
|
domainCode: v,
|
|
934
|
-
widthOpen:
|
|
935
|
-
widthClosed:
|
|
935
|
+
widthOpen: g,
|
|
936
|
+
widthClosed: $,
|
|
936
937
|
offsetTop: b,
|
|
937
938
|
"data-testid": c,
|
|
938
|
-
useNewAvatar:
|
|
939
|
+
useNewAvatar: C
|
|
939
940
|
}
|
|
940
941
|
),
|
|
941
942
|
/* @__PURE__ */ o(
|
|
@@ -960,17 +961,17 @@ const Dt = ({
|
|
|
960
961
|
onClose: c,
|
|
961
962
|
sx: d,
|
|
962
963
|
"data-testid": l,
|
|
963
|
-
disableCloseOnBackdropOrEscape:
|
|
964
|
+
disableCloseOnBackdropOrEscape: p = !1,
|
|
964
965
|
isLoading: v = !1
|
|
965
966
|
}) => {
|
|
966
967
|
var g, $;
|
|
967
968
|
const [C, A] = B(!1);
|
|
968
|
-
return /* @__PURE__ */
|
|
969
|
+
return /* @__PURE__ */ u(
|
|
969
970
|
tt,
|
|
970
971
|
{
|
|
971
972
|
open: e,
|
|
972
|
-
onClose: (
|
|
973
|
-
|
|
973
|
+
onClose: (D, b) => L(void 0, null, function* () {
|
|
974
|
+
p && (b === "backdropClick" || b === "escapeKeyDown") || C || (s != null && s.onClick ? yield s.onClick() : c());
|
|
974
975
|
}),
|
|
975
976
|
fullWidth: !0,
|
|
976
977
|
maxWidth: i != null ? i : "xs",
|
|
@@ -980,7 +981,7 @@ const Dt = ({
|
|
|
980
981
|
v && /* @__PURE__ */ o(nt, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
981
982
|
/* @__PURE__ */ o(ot, { children: t }),
|
|
982
983
|
/* @__PURE__ */ o(it, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ u(rt, { children: [
|
|
984
985
|
/* @__PURE__ */ o(
|
|
985
986
|
ae,
|
|
986
987
|
{
|
|
@@ -995,8 +996,8 @@ const Dt = ({
|
|
|
995
996
|
ae,
|
|
996
997
|
{
|
|
997
998
|
onClick: () => L(void 0, null, function* () {
|
|
998
|
-
var
|
|
999
|
-
A(!0), yield (
|
|
999
|
+
var D;
|
|
1000
|
+
A(!0), yield (D = r.onClick) == null ? void 0 : D.call(r), A(!1);
|
|
1000
1001
|
}),
|
|
1001
1002
|
"data-testid": r.testId,
|
|
1002
1003
|
disabled: r.disabled || C,
|
|
@@ -1031,14 +1032,14 @@ function _o({
|
|
|
1031
1032
|
"data-testid": c,
|
|
1032
1033
|
sx: d,
|
|
1033
1034
|
boxSx: l,
|
|
1034
|
-
textFieldColor:
|
|
1035
|
+
textFieldColor: p,
|
|
1035
1036
|
textFieldVariant: v = "filled",
|
|
1036
1037
|
loadingText: C = "Loading...",
|
|
1037
1038
|
noOptionsText: A = "No options",
|
|
1038
1039
|
popupIcon: g = /* @__PURE__ */ o(tn, {}),
|
|
1039
1040
|
error: $ = !1,
|
|
1040
|
-
helperText:
|
|
1041
|
-
preLoadedOptions:
|
|
1041
|
+
helperText: D = "",
|
|
1042
|
+
preLoadedOptions: b = void 0,
|
|
1042
1043
|
disablePortal: I = !1,
|
|
1043
1044
|
disableIconFlip: O = !1
|
|
1044
1045
|
}) {
|
|
@@ -1050,9 +1051,9 @@ function _o({
|
|
|
1050
1051
|
label: r,
|
|
1051
1052
|
lookup: e,
|
|
1052
1053
|
minLength: i,
|
|
1053
|
-
preLoadedOptions:
|
|
1054
|
+
preLoadedOptions: b
|
|
1054
1055
|
}), W = P.length >= i;
|
|
1055
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ u("div", { "data-testid": c, children: [
|
|
1056
1057
|
/* @__PURE__ */ o(
|
|
1057
1058
|
be,
|
|
1058
1059
|
{
|
|
@@ -1080,9 +1081,9 @@ function _o({
|
|
|
1080
1081
|
fullWidth: !0,
|
|
1081
1082
|
variant: v,
|
|
1082
1083
|
error: $,
|
|
1083
|
-
helperText:
|
|
1084
|
+
helperText: D,
|
|
1084
1085
|
InputProps: k(a({}, h.InputProps), {
|
|
1085
|
-
endAdornment: /* @__PURE__ */
|
|
1086
|
+
endAdornment: /* @__PURE__ */ u(E, { children: [
|
|
1086
1087
|
H ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20 }) : null,
|
|
1087
1088
|
h.InputProps.endAdornment
|
|
1088
1089
|
] })
|
|
@@ -1091,7 +1092,7 @@ function _o({
|
|
|
1091
1092
|
onKeyDown: (f) => {
|
|
1092
1093
|
(f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
|
|
1093
1094
|
},
|
|
1094
|
-
color:
|
|
1095
|
+
color: p
|
|
1095
1096
|
})
|
|
1096
1097
|
),
|
|
1097
1098
|
renderTags: () => null,
|
|
@@ -1181,25 +1182,25 @@ const Mo = ({
|
|
|
1181
1182
|
textFieldVariant: c = "filled",
|
|
1182
1183
|
"data-testid": d,
|
|
1183
1184
|
noOptionsText: l = "No options",
|
|
1184
|
-
minLength:
|
|
1185
|
+
minLength: p = 3,
|
|
1185
1186
|
disablePortal: v = !1,
|
|
1186
1187
|
preLoadedOptions: C,
|
|
1187
1188
|
helperText: A = "",
|
|
1188
1189
|
disabled: g,
|
|
1189
1190
|
popupIcon: $,
|
|
1190
|
-
disableIconFlip:
|
|
1191
|
+
disableIconFlip: D
|
|
1191
1192
|
}) => {
|
|
1192
|
-
const [
|
|
1193
|
-
inputValue:
|
|
1193
|
+
const [b, I] = B(""), { data: O, isLoading: P } = yt({
|
|
1194
|
+
inputValue: b,
|
|
1194
1195
|
label: n,
|
|
1195
1196
|
lookup: e,
|
|
1196
|
-
minLength:
|
|
1197
|
+
minLength: p != null ? p : 0,
|
|
1197
1198
|
preLoadedOptions: C
|
|
1198
|
-
}), N =
|
|
1199
|
+
}), N = b.length >= p;
|
|
1199
1200
|
return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
1200
1201
|
be,
|
|
1201
1202
|
{
|
|
1202
|
-
sx: a(a({}, r),
|
|
1203
|
+
sx: a(a({}, r), D ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1203
1204
|
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
1204
1205
|
loading: N ? P : !1,
|
|
1205
1206
|
options: O != null ? O : [],
|
|
@@ -1325,7 +1326,7 @@ function Ho({
|
|
|
1325
1326
|
s(d);
|
|
1326
1327
|
}, [i, n, r, s]), r && Gn(r)) {
|
|
1327
1328
|
let d = "Auth error", l = "An unknown Auth0 error occurred.";
|
|
1328
|
-
return qn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : Xn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */
|
|
1329
|
+
return qn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : Xn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ u(tt, { open: !0, children: [
|
|
1329
1330
|
/* @__PURE__ */ o(ot, { children: d }),
|
|
1330
1331
|
/* @__PURE__ */ o(it, { children: /* @__PURE__ */ o(F, { children: l }) }),
|
|
1331
1332
|
/* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
|
|
@@ -1367,38 +1368,38 @@ function to(s) {
|
|
|
1367
1368
|
"children"
|
|
1368
1369
|
]);
|
|
1369
1370
|
var f;
|
|
1370
|
-
const [{ open: d }, l] = B({ open: !1 }),
|
|
1371
|
+
const [{ open: d }, l] = B({ open: !1 }), p = ge([]), v = ge(Date.now()), C = ge(0), A = ie((m) => {
|
|
1371
1372
|
l({ open: m });
|
|
1372
1373
|
}, []), g = ie((m = {}) => {
|
|
1373
|
-
C.current += 1,
|
|
1374
|
+
C.current += 1, p.current.length >= Xe && Date.now() - v.current >= Qe && (v.current = Date.now(), console.error(
|
|
1374
1375
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${C.current} times in last ${Qe}ms)`
|
|
1375
1376
|
), C.current = 0);
|
|
1376
1377
|
const x = a(k(a({}, qe), {
|
|
1377
1378
|
key: Jn()
|
|
1378
1379
|
}), m);
|
|
1379
|
-
return
|
|
1380
|
-
}, []), $ = (m = "", x = {}) => g(a({ message: m, severity: "success" }, x)),
|
|
1381
|
-
const x =
|
|
1380
|
+
return p.current.push(x), p.current.length === 1 && l({ open: !0 }), x.key;
|
|
1381
|
+
}, []), $ = (m = "", x = {}) => g(a({ message: m, severity: "success" }, x)), D = (m = "", x = {}) => g(a({ message: m, severity: "info" }, x)), b = (m = "", x = {}) => g(a({ message: m, severity: "warning" }, x)), I = (m = "", x = {}) => g(a({ message: m, severity: "error" }, x)), O = (m) => {
|
|
1382
|
+
const x = p.current.findIndex((M) => M.key === m);
|
|
1382
1383
|
if (x !== -1)
|
|
1383
|
-
return x === 0 ? (l({ open: !1 }),
|
|
1384
|
+
return x === 0 ? (l({ open: !1 }), p.current[0]) : p.current.splice(x, 1);
|
|
1384
1385
|
}, P = (m, x) => {
|
|
1385
1386
|
n(m, x) && l({ open: !1 });
|
|
1386
1387
|
}, N = () => {
|
|
1387
1388
|
}, S = () => {
|
|
1388
|
-
|
|
1389
|
-
}, w = (f =
|
|
1389
|
+
p.current.shift(), p.current.length > 0 && l({ open: !0 });
|
|
1390
|
+
}, w = (f = p.current[0]) != null ? f : a({}, qe), H = {};
|
|
1390
1391
|
"autoHideDuration" in w && (H.autoHideDuration = w.autoHideDuration);
|
|
1391
1392
|
const W = a(a({}, Qn), r), h = a(a({
|
|
1392
1393
|
open: d,
|
|
1393
1394
|
setOpen: A,
|
|
1394
1395
|
enqueueNotification: g,
|
|
1395
1396
|
enqueueSuccessNotification: $,
|
|
1396
|
-
enqueueInfoNotification:
|
|
1397
|
-
enqueueWarningNotification:
|
|
1397
|
+
enqueueInfoNotification: D,
|
|
1398
|
+
enqueueWarningNotification: b,
|
|
1398
1399
|
enqueueErrorNotification: I,
|
|
1399
1400
|
removeNotification: O
|
|
1400
1401
|
}, e), t);
|
|
1401
|
-
return /* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ u($t.Provider, { value: h, children: [
|
|
1402
1403
|
i,
|
|
1403
1404
|
/* @__PURE__ */ o(
|
|
1404
1405
|
Xt,
|
|
@@ -1410,7 +1411,7 @@ function to(s) {
|
|
|
1410
1411
|
onExit: N
|
|
1411
1412
|
},
|
|
1412
1413
|
sx: { zIndex: Kn },
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1414
|
+
children: /* @__PURE__ */ u("div", { children: [
|
|
1414
1415
|
/* @__PURE__ */ o(
|
|
1415
1416
|
Qt,
|
|
1416
1417
|
{
|
|
@@ -1439,7 +1440,7 @@ const Wo = Q(
|
|
|
1439
1440
|
), oo = nn(), zo = ({
|
|
1440
1441
|
children: e,
|
|
1441
1442
|
store: t
|
|
1442
|
-
}) => /* @__PURE__ */ o(
|
|
1443
|
+
}) => /* @__PURE__ */ o(pt, { store: t != null ? t : oo, children: e }), It = "domainCode";
|
|
1443
1444
|
var Ke;
|
|
1444
1445
|
const Ye = _(
|
|
1445
1446
|
JSON.parse((Ke = localStorage.getItem(It)) != null ? Ke : '{"domainCode": ""}').domainCode
|
|
@@ -1471,13 +1472,13 @@ const Ye = _(
|
|
|
1471
1472
|
applicationName: r,
|
|
1472
1473
|
handleLogout: s
|
|
1473
1474
|
}) => {
|
|
1474
|
-
const [c, d] = V(Ot), [l,
|
|
1475
|
+
const [c, d] = V(Ot), [l, p] = B(c), { enqueueSuccessNotification: v } = no(), C = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || C || A, $ = () => L(void 0, null, function* () {
|
|
1475
1476
|
l ? (d(l), v(`Set domain to ${l}`), n()) : d("");
|
|
1476
|
-
}),
|
|
1477
|
-
c && !C && !A ? (
|
|
1477
|
+
}), D = () => L(void 0, null, function* () {
|
|
1478
|
+
c && !C && !A ? (p(c), n()) : g && s();
|
|
1478
1479
|
});
|
|
1479
|
-
let
|
|
1480
|
-
return C ?
|
|
1480
|
+
let b;
|
|
1481
|
+
return C ? b = "Unable to retrieve your active organisations. Try logging in again." : A && (b = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ u(
|
|
1481
1482
|
Dt,
|
|
1482
1483
|
{
|
|
1483
1484
|
isOpen: t,
|
|
@@ -1490,12 +1491,12 @@ const Ye = _(
|
|
|
1490
1491
|
},
|
|
1491
1492
|
secondaryButton: {
|
|
1492
1493
|
text: g ? "Logout" : "Cancel",
|
|
1493
|
-
onClick:
|
|
1494
|
+
onClick: D
|
|
1494
1495
|
},
|
|
1495
1496
|
onClose: g ? () => {
|
|
1496
1497
|
} : n,
|
|
1497
1498
|
children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ u(F, { marginBottom: 2, children: [
|
|
1499
1500
|
"Select the default organisation that you want to use with the ",
|
|
1500
1501
|
r,
|
|
1501
1502
|
"."
|
|
@@ -1507,7 +1508,7 @@ const Ye = _(
|
|
|
1507
1508
|
multiple: !1,
|
|
1508
1509
|
disableClearable: !1,
|
|
1509
1510
|
value: l !== "" ? l : null,
|
|
1510
|
-
onChange: (I, O) =>
|
|
1511
|
+
onChange: (I, O) => p(O != null ? O : ""),
|
|
1511
1512
|
getOptionLabel: ro,
|
|
1512
1513
|
options: [...i],
|
|
1513
1514
|
renderInput: (I) => /* @__PURE__ */ o(
|
|
@@ -1516,7 +1517,7 @@ const Ye = _(
|
|
|
1516
1517
|
variant: "filled",
|
|
1517
1518
|
label: "Select organisation",
|
|
1518
1519
|
InputProps: k(a({}, I.InputProps), {
|
|
1519
|
-
endAdornment: /* @__PURE__ */
|
|
1520
|
+
endAdornment: /* @__PURE__ */ u(E, { children: [
|
|
1520
1521
|
e ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1521
1522
|
I.InputProps.endAdornment
|
|
1522
1523
|
] })
|
|
@@ -1525,7 +1526,7 @@ const Ye = _(
|
|
|
1525
1526
|
)
|
|
1526
1527
|
}
|
|
1527
1528
|
),
|
|
1528
|
-
|
|
1529
|
+
b && /* @__PURE__ */ o(Yt, { error: !0, children: b })
|
|
1529
1530
|
]
|
|
1530
1531
|
}
|
|
1531
1532
|
);
|
|
@@ -1682,10 +1683,10 @@ const Ye = _(
|
|
|
1682
1683
|
titleText: ve,
|
|
1683
1684
|
topBarHeight: bt,
|
|
1684
1685
|
navBarTop: St
|
|
1685
|
-
}, qo = Q(() => ({ children: e }) => /* @__PURE__ */ o(
|
|
1686
|
+
}, qo = Q(() => ({ children: e }) => /* @__PURE__ */ o(pt, { children: e })), so = ({
|
|
1686
1687
|
initialValues: e,
|
|
1687
1688
|
children: t
|
|
1688
|
-
}) => (
|
|
1689
|
+
}) => (ut(e), /* @__PURE__ */ o(E, { children: t })), Xo = Q(
|
|
1689
1690
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1690
1691
|
so,
|
|
1691
1692
|
{
|