@australiangreens/ag-internal-components 0.0.65 → 0.0.67
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/AgDialog/AgDialog.d.ts +4 -2
- package/dist/components/AgDialog/AgDialog.d.ts.map +1 -1
- package/dist/esm/index.js +291 -287
- package/dist/esm/index.js.map +1 -1
- package/package.json +21 -19
- package/dist/.gitignore +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ot = Object.defineProperty, $t = Object.defineProperties;
|
|
2
2
|
var It = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ee = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var ge = (e, t, n) => t in e ?
|
|
4
|
+
var Fe = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ge = (e, t, n) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, i = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
Fe.call(t, n) && ge(e, n, t[n]);
|
|
8
8
|
if (ee)
|
|
9
9
|
for (var n of ee(t))
|
|
10
|
-
|
|
10
|
+
ye.call(t, n) && ge(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, S = (e, t) => $t(e, It(t));
|
|
13
|
+
var Pe = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var r in e)
|
|
16
|
-
|
|
16
|
+
Fe.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
17
17
|
if (e != null && ee)
|
|
18
18
|
for (var r of ee(e))
|
|
19
|
-
t.indexOf(r) < 0 &&
|
|
19
|
+
t.indexOf(r) < 0 && ye.call(e, r) && (n[r] = e[r]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
22
|
+
var Ne = (e, t, n) => (ge(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
23
|
+
var N = (e, t, n) => new Promise((r, s) => {
|
|
24
|
+
var l = (p) => {
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
g(n.next(p));
|
|
27
27
|
} catch (u) {
|
|
28
28
|
s(u);
|
|
29
29
|
}
|
|
30
30
|
}, d = (p) => {
|
|
31
31
|
try {
|
|
32
|
-
|
|
32
|
+
g(n.throw(p));
|
|
33
33
|
} catch (u) {
|
|
34
34
|
s(u);
|
|
35
35
|
}
|
|
36
|
-
},
|
|
37
|
-
|
|
36
|
+
}, g = (p) => p.done ? r(p.value) : Promise.resolve(p.value).then(l, d);
|
|
37
|
+
g((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as f, Fragment as
|
|
40
|
-
import { useState as
|
|
41
|
-
import { Typography as E, Button as Tt, Paper as Ze, Box as D, Drawer as be, Autocomplete as Ae, TextField as Se, CircularProgress as De, Chip as
|
|
39
|
+
import { jsxs as f, Fragment as B, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as O, createContext as Je, useCallback as oe, useContext as Ye, useEffect as re, useMemo as Et, createElement as xe, useRef as fe } from "react";
|
|
41
|
+
import { Typography as E, Button as Tt, Paper as Ze, Box as D, Drawer as be, Autocomplete as Ae, TextField as Se, CircularProgress as De, Chip as Ft, Tooltip as yt, Stack as Pt, styled as ke, IconButton as Q, Container as et, useTheme as ae, useMediaQuery as Nt, Collapse as Bt, Avatar as Be, Fade as Lt, Skeleton as Le, Toolbar as Mt, Divider as Me, CssBaseline as _t, Snackbar as Ht, Alert as Rt, LinearProgress as Wt, FormHelperText as zt } from "@mui/material";
|
|
42
42
|
import Gt from "@mui/material/CssBaseline";
|
|
43
|
-
import { styled as
|
|
43
|
+
import { styled as L, createTheme as tt, alpha as me } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Ut } from "@australiangreens/ag-error";
|
|
45
45
|
import { createHelper as se } from "souvlaki";
|
|
46
46
|
import nt from "@mui/material/List";
|
|
@@ -52,11 +52,11 @@ import jt from "@mui/material/DialogTitle";
|
|
|
52
52
|
import { Cancel as Qt, ArrowDropDown as Kt, ArrowForward as ot, ArrowBack as rt, ViewHeadline as Jt } from "@mui/icons-material";
|
|
53
53
|
import Yt from "autosuggest-highlight/parse";
|
|
54
54
|
import Zt from "autosuggest-highlight/match";
|
|
55
|
-
import { atom as
|
|
55
|
+
import { atom as M, useSetAtom as it, useAtomValue as He, useAtom as X, getDefaultStore as en, Provider as at } from "jotai";
|
|
56
56
|
import { useHydrateAtoms as st } from "jotai/utils";
|
|
57
57
|
function fo({ text: e }) {
|
|
58
|
-
const [t, n] =
|
|
59
|
-
return /* @__PURE__ */ f(
|
|
58
|
+
const [t, n] = O(0);
|
|
59
|
+
return /* @__PURE__ */ f(B, { children: [
|
|
60
60
|
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
61
|
/* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
62
62
|
/* @__PURE__ */ o(
|
|
@@ -86,7 +86,7 @@ const lt = 330, ct = 73, G = "Navbar", V = {
|
|
|
86
86
|
userInfoHolder: `${G}-userInfoHolder`,
|
|
87
87
|
settings: `${G}-settings`,
|
|
88
88
|
pieChartIcon: `${G}-pieChartIcon`
|
|
89
|
-
}, tn =
|
|
89
|
+
}, tn = L(D, {
|
|
90
90
|
name: "NavBar"
|
|
91
91
|
})(({ theme: e }) => ({
|
|
92
92
|
[`&.${V.root}`]: {
|
|
@@ -119,7 +119,7 @@ const lt = 330, ct = 73, G = "Navbar", V = {
|
|
|
119
119
|
width: lt
|
|
120
120
|
}, dt()), on = () => i({
|
|
121
121
|
width: ct
|
|
122
|
-
}, dt()), rn =
|
|
122
|
+
}, dt()), rn = L(be, {
|
|
123
123
|
shouldForwardProp: (e) => e !== "open"
|
|
124
124
|
})(({ theme: e, open: t }) => i(i({
|
|
125
125
|
width: t ? lt : ct,
|
|
@@ -132,34 +132,34 @@ const lt = 330, ct = 73, G = "Navbar", V = {
|
|
|
132
132
|
}), !t && {
|
|
133
133
|
"& .MuiDrawer-paper": on()
|
|
134
134
|
}));
|
|
135
|
-
class
|
|
135
|
+
class Oe extends Ut {
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
Ne(Oe, "errorName", "ContextError");
|
|
138
138
|
const pt = Je(null), an = {}, sn = {}, ln = ({
|
|
139
139
|
overrideState: e = an,
|
|
140
140
|
overrideActions: t = sn,
|
|
141
141
|
children: n
|
|
142
142
|
}) => {
|
|
143
|
-
const [{ open: r }, s] =
|
|
143
|
+
const [{ open: r }, s] = O({ open: !0 }), l = oe((p) => {
|
|
144
144
|
s({ open: p });
|
|
145
145
|
}, []), d = oe(() => {
|
|
146
|
-
s((p) =>
|
|
147
|
-
}, []),
|
|
146
|
+
s((p) => S(i({}, p), { open: !p.open }));
|
|
147
|
+
}, []), g = i(i({
|
|
148
148
|
open: r,
|
|
149
|
-
setOpen:
|
|
149
|
+
setOpen: l,
|
|
150
150
|
toggleOpen: d
|
|
151
151
|
}, e), t);
|
|
152
|
-
return /* @__PURE__ */ o(pt.Provider, { value:
|
|
152
|
+
return /* @__PURE__ */ o(pt.Provider, { value: g, children: n });
|
|
153
153
|
}, cn = () => {
|
|
154
154
|
const e = Ye(pt);
|
|
155
155
|
if (e === null)
|
|
156
|
-
throw new
|
|
156
|
+
throw new Oe("Error: Tried to useNavBar outside of a <NavBarProvider>");
|
|
157
157
|
return e;
|
|
158
158
|
}, dn = (e = {}) => i({
|
|
159
159
|
open: !0
|
|
160
160
|
}, e), mo = se(
|
|
161
161
|
(e = dn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(ln, { overrideState: e, overrideActions: t, children: n })
|
|
162
|
-
), Re = 7, Co =
|
|
162
|
+
), Re = 7, Co = L(nt)(({ theme: e }) => ({
|
|
163
163
|
backgroundColor: "black",
|
|
164
164
|
color: "white",
|
|
165
165
|
"& .MuiListItem-root": {
|
|
@@ -197,7 +197,7 @@ const pt = Je(null), an = {}, sn = {}, ln = ({
|
|
|
197
197
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
198
198
|
// },
|
|
199
199
|
}
|
|
200
|
-
})), We = 7, vo =
|
|
200
|
+
})), We = 7, vo = L(nt)(({ theme: e }) => ({
|
|
201
201
|
backgroundColor: "#e8e8e8",
|
|
202
202
|
color: "inherit",
|
|
203
203
|
"& .MuiListItem-root": {
|
|
@@ -261,20 +261,24 @@ const pn = ({
|
|
|
261
261
|
children: n,
|
|
262
262
|
maxWidth: r,
|
|
263
263
|
primaryButton: s,
|
|
264
|
-
secondaryButton:
|
|
265
|
-
onClose: d
|
|
264
|
+
secondaryButton: l,
|
|
265
|
+
onClose: d,
|
|
266
|
+
sx: g,
|
|
267
|
+
"data-testid": p
|
|
266
268
|
}) => {
|
|
267
|
-
var
|
|
268
|
-
const [
|
|
269
|
+
var b, A;
|
|
270
|
+
const [u, w] = O(!1);
|
|
269
271
|
return /* @__PURE__ */ f(
|
|
270
272
|
Vt,
|
|
271
273
|
{
|
|
272
274
|
open: e,
|
|
273
|
-
onClose: () => {
|
|
274
|
-
|
|
275
|
-
},
|
|
275
|
+
onClose: () => N(void 0, null, function* () {
|
|
276
|
+
u || (l != null && l.onClick ? yield l.onClick() : d());
|
|
277
|
+
}),
|
|
276
278
|
fullWidth: !0,
|
|
277
279
|
maxWidth: r != null ? r : "xs",
|
|
280
|
+
"data-testid": p,
|
|
281
|
+
sx: g,
|
|
278
282
|
children: [
|
|
279
283
|
/* @__PURE__ */ o(jt, { children: t }),
|
|
280
284
|
/* @__PURE__ */ o(Xt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
@@ -282,22 +286,22 @@ const pn = ({
|
|
|
282
286
|
/* @__PURE__ */ o(
|
|
283
287
|
_e,
|
|
284
288
|
{
|
|
285
|
-
onClick: (
|
|
286
|
-
"data-testid":
|
|
287
|
-
disabled: (
|
|
288
|
-
color:
|
|
289
|
-
children: (
|
|
289
|
+
onClick: (b = l == null ? void 0 : l.onClick) != null ? b : d,
|
|
290
|
+
"data-testid": l == null ? void 0 : l.testId,
|
|
291
|
+
disabled: (l == null ? void 0 : l.disabled) || u,
|
|
292
|
+
color: l == null ? void 0 : l.buttonColor,
|
|
293
|
+
children: (A = l == null ? void 0 : l.text) != null ? A : "Cancel"
|
|
290
294
|
}
|
|
291
295
|
),
|
|
292
296
|
s && /* @__PURE__ */ o(
|
|
293
297
|
_e,
|
|
294
298
|
{
|
|
295
|
-
onClick: () =>
|
|
296
|
-
var
|
|
297
|
-
|
|
299
|
+
onClick: () => N(void 0, null, function* () {
|
|
300
|
+
var C;
|
|
301
|
+
w(!0), yield (C = s.onClick) == null ? void 0 : C.call(s), w(!1);
|
|
298
302
|
}),
|
|
299
303
|
"data-testid": s.testId,
|
|
300
|
-
disabled: s.disabled ||
|
|
304
|
+
disabled: s.disabled || u,
|
|
301
305
|
color: s == null ? void 0 : s.buttonColor,
|
|
302
306
|
children: s.text
|
|
303
307
|
}
|
|
@@ -308,36 +312,36 @@ const pn = ({
|
|
|
308
312
|
);
|
|
309
313
|
};
|
|
310
314
|
function wo({
|
|
311
|
-
lookup: e = () =>
|
|
315
|
+
lookup: e = () => N(this, null, function* () {
|
|
312
316
|
}),
|
|
313
317
|
enableHighlighting: t = !0,
|
|
314
318
|
onChange: n,
|
|
315
319
|
minLength: r,
|
|
316
320
|
label: s,
|
|
317
|
-
value:
|
|
321
|
+
value: l,
|
|
318
322
|
"data-testid": d,
|
|
319
|
-
sx:
|
|
323
|
+
sx: g,
|
|
320
324
|
textFieldColor: p,
|
|
321
325
|
textFieldVariant: u = "filled",
|
|
322
326
|
loadingText: w = "Loading...",
|
|
323
327
|
noOptionsText: b = "No options",
|
|
324
|
-
popupIcon:
|
|
325
|
-
error:
|
|
326
|
-
helperText:
|
|
327
|
-
preLoadedOptions:
|
|
328
|
+
popupIcon: A = /* @__PURE__ */ o(Kt, {}),
|
|
329
|
+
error: C = !1,
|
|
330
|
+
helperText: k = "",
|
|
331
|
+
preLoadedOptions: v = void 0,
|
|
328
332
|
disablePortal: m = !1
|
|
329
333
|
}) {
|
|
330
|
-
const [
|
|
331
|
-
const x =
|
|
334
|
+
const [h, T] = O(""), [_, F] = O(v || []), [y, $] = O(!1), [H, P] = O(!1), R = (a, c) => {
|
|
335
|
+
const x = l.filter((q) => q.id !== c);
|
|
332
336
|
n(x, "delete", a);
|
|
333
337
|
};
|
|
334
338
|
re(() => {
|
|
335
339
|
let a;
|
|
336
|
-
const
|
|
340
|
+
const c = () => N(this, null, function* () {
|
|
337
341
|
a = new AbortController();
|
|
338
342
|
try {
|
|
339
|
-
const x = yield e(
|
|
340
|
-
|
|
343
|
+
const x = yield e(h, a.signal);
|
|
344
|
+
F(x != null ? x : []), P(!1);
|
|
341
345
|
} catch (x) {
|
|
342
346
|
if (x instanceof Error && x.name === "AbortError")
|
|
343
347
|
console.debug("Previous lookup request was cancelled");
|
|
@@ -345,74 +349,74 @@ function wo({
|
|
|
345
349
|
throw x;
|
|
346
350
|
}
|
|
347
351
|
});
|
|
348
|
-
if (
|
|
349
|
-
return (!r ||
|
|
352
|
+
if (h !== "")
|
|
353
|
+
return (!r || h.length >= r) && !v ? (P(!0), c()) : P(!1), function() {
|
|
350
354
|
a && a.abort();
|
|
351
355
|
};
|
|
352
|
-
}, [
|
|
353
|
-
!
|
|
354
|
-
}, [
|
|
355
|
-
const
|
|
356
|
-
(x) => x.label.toLowerCase().includes(
|
|
357
|
-
) : (a) => a, [
|
|
356
|
+
}, [h, e, r, v]), re(() => {
|
|
357
|
+
!y && !v && F([]), !y && v && F(v);
|
|
358
|
+
}, [y, v]);
|
|
359
|
+
const W = Et(() => v ? (a, c) => a.filter(
|
|
360
|
+
(x) => x.label.toLowerCase().includes(c.inputValue.toLowerCase())
|
|
361
|
+
) : (a) => a, [v]);
|
|
358
362
|
return /* @__PURE__ */ f("div", { "data-testid": d, children: [
|
|
359
363
|
/* @__PURE__ */ o(
|
|
360
364
|
Ae,
|
|
361
365
|
{
|
|
362
|
-
sx:
|
|
366
|
+
sx: g,
|
|
363
367
|
"data-testid": d ? `${d}:Autocomplete` : void 0,
|
|
364
368
|
disablePortal: m,
|
|
365
369
|
multiple: !0,
|
|
366
370
|
getOptionLabel: (a) => typeof a == "string" ? a : a.label,
|
|
367
|
-
filterOptions:
|
|
368
|
-
loading:
|
|
369
|
-
options: [...
|
|
371
|
+
filterOptions: W,
|
|
372
|
+
loading: H,
|
|
373
|
+
options: [...l, ..._],
|
|
370
374
|
filterSelectedOptions: !0,
|
|
371
375
|
includeInputInList: !0,
|
|
372
|
-
value:
|
|
373
|
-
onOpen: () =>
|
|
374
|
-
onClose: () =>
|
|
375
|
-
onChange: (a,
|
|
376
|
-
n(
|
|
376
|
+
value: l,
|
|
377
|
+
onOpen: () => $(!0),
|
|
378
|
+
onClose: () => $(!1),
|
|
379
|
+
onChange: (a, c, x) => {
|
|
380
|
+
n(c, x, a);
|
|
377
381
|
},
|
|
378
|
-
onInputChange: (a,
|
|
382
|
+
onInputChange: (a, c) => T(c),
|
|
379
383
|
noOptionsText: b,
|
|
380
384
|
loadingText: w,
|
|
381
|
-
popupIcon:
|
|
385
|
+
popupIcon: A,
|
|
382
386
|
renderInput: (a) => /* @__PURE__ */ o(
|
|
383
387
|
Se,
|
|
384
|
-
|
|
388
|
+
S(i({}, a), {
|
|
385
389
|
label: s,
|
|
386
390
|
fullWidth: !0,
|
|
387
391
|
variant: u,
|
|
388
|
-
error:
|
|
389
|
-
helperText:
|
|
390
|
-
InputProps:
|
|
391
|
-
endAdornment: /* @__PURE__ */ f(
|
|
392
|
-
|
|
392
|
+
error: C,
|
|
393
|
+
helperText: k,
|
|
394
|
+
InputProps: S(i({}, a.InputProps), {
|
|
395
|
+
endAdornment: /* @__PURE__ */ f(B, { children: [
|
|
396
|
+
H ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
|
|
393
397
|
a.InputProps.endAdornment
|
|
394
398
|
] })
|
|
395
399
|
}),
|
|
396
400
|
"data-testid": d ? `${d}:Autocomplete:TextField` : void 0,
|
|
397
|
-
onKeyDown: (
|
|
398
|
-
(
|
|
401
|
+
onKeyDown: (c) => {
|
|
402
|
+
(c.key === "Backspace" || c.key === "Delete") && c.stopPropagation();
|
|
399
403
|
},
|
|
400
404
|
color: p
|
|
401
405
|
})
|
|
402
406
|
),
|
|
403
407
|
renderTags: () => null,
|
|
404
|
-
isOptionEqualToValue: (a,
|
|
405
|
-
renderOption: (a,
|
|
408
|
+
isOptionEqualToValue: (a, c) => a.id === c.id,
|
|
409
|
+
renderOption: (a, c, x) => {
|
|
406
410
|
if (t) {
|
|
407
|
-
const q = Zt(
|
|
411
|
+
const q = Zt(c.label, x.inputValue, {
|
|
408
412
|
insideWords: !0,
|
|
409
413
|
findAllOccurrences: !0
|
|
410
|
-
}), le = Yt(
|
|
414
|
+
}), le = Yt(c.label, q);
|
|
411
415
|
return /* @__PURE__ */ xe(
|
|
412
416
|
"li",
|
|
413
|
-
|
|
414
|
-
key:
|
|
415
|
-
"data-testid": d ? `${d}:Autocomplete:option(${
|
|
417
|
+
S(i({}, a), {
|
|
418
|
+
key: c.id,
|
|
419
|
+
"data-testid": d ? `${d}:Autocomplete:option(${c.id.toString()})` : void 0
|
|
416
420
|
}),
|
|
417
421
|
/* @__PURE__ */ o("div", { children: le.map((J, ce) => /* @__PURE__ */ o(
|
|
418
422
|
"span",
|
|
@@ -428,17 +432,17 @@ function wo({
|
|
|
428
432
|
} else
|
|
429
433
|
return /* @__PURE__ */ xe(
|
|
430
434
|
"li",
|
|
431
|
-
|
|
432
|
-
key:
|
|
433
|
-
"data-testid": d ? `${d}:option(${
|
|
435
|
+
S(i({}, a), {
|
|
436
|
+
key: c.id,
|
|
437
|
+
"data-testid": d ? `${d}:option(${c.id.toString()})` : void 0
|
|
434
438
|
}),
|
|
435
|
-
|
|
439
|
+
c.label
|
|
436
440
|
);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
439
443
|
),
|
|
440
|
-
|
|
441
|
-
|
|
444
|
+
l.length > 0 && /* @__PURE__ */ o(D, { children: l.map((a) => /* @__PURE__ */ o(
|
|
445
|
+
Ft,
|
|
442
446
|
{
|
|
443
447
|
sx: {
|
|
444
448
|
marginTop: 1,
|
|
@@ -446,7 +450,7 @@ function wo({
|
|
|
446
450
|
height: "auto"
|
|
447
451
|
},
|
|
448
452
|
label: /* @__PURE__ */ o(
|
|
449
|
-
|
|
453
|
+
yt,
|
|
450
454
|
{
|
|
451
455
|
title: a.tooltipContent || "",
|
|
452
456
|
placement: "bottom-start",
|
|
@@ -464,7 +468,7 @@ function wo({
|
|
|
464
468
|
}
|
|
465
469
|
),
|
|
466
470
|
"data-testid": d ? `${d}:Chip(${a.id.toString()})` : void 0,
|
|
467
|
-
onDelete: (
|
|
471
|
+
onDelete: (c) => R(c, a.id),
|
|
468
472
|
deleteIcon: /* @__PURE__ */ o(
|
|
469
473
|
Qt,
|
|
470
474
|
{
|
|
@@ -482,35 +486,35 @@ const bo = ({
|
|
|
482
486
|
label: n,
|
|
483
487
|
value: r,
|
|
484
488
|
sx: s,
|
|
485
|
-
textFieldColor:
|
|
489
|
+
textFieldColor: l,
|
|
486
490
|
textFieldVariant: d = "filled",
|
|
487
|
-
"data-testid":
|
|
491
|
+
"data-testid": g,
|
|
488
492
|
minLength: p = 3,
|
|
489
493
|
disablePortal: u = !1
|
|
490
494
|
}) => {
|
|
491
|
-
const [w, b] =
|
|
492
|
-
let
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
+
const [w, b] = O([]), [A, C] = O(!1);
|
|
496
|
+
let k;
|
|
497
|
+
const v = (m) => N(void 0, null, function* () {
|
|
498
|
+
k = new AbortController();
|
|
495
499
|
try {
|
|
496
|
-
const
|
|
497
|
-
b(
|
|
498
|
-
} catch (
|
|
499
|
-
if (
|
|
500
|
+
const h = yield e(m, k.signal);
|
|
501
|
+
b(h != null ? h : []), C(!1);
|
|
502
|
+
} catch (h) {
|
|
503
|
+
if (h instanceof Error && h.name === "AbortError")
|
|
500
504
|
console.debug("Previous lookup request was cancelled");
|
|
501
505
|
else
|
|
502
|
-
throw
|
|
506
|
+
throw h;
|
|
503
507
|
}
|
|
504
508
|
});
|
|
505
|
-
return /* @__PURE__ */ o("div", { "data-testid":
|
|
509
|
+
return /* @__PURE__ */ o("div", { "data-testid": g, children: /* @__PURE__ */ o(Pt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
506
510
|
Ae,
|
|
507
511
|
{
|
|
508
512
|
sx: s,
|
|
509
|
-
"data-testid":
|
|
510
|
-
loading:
|
|
513
|
+
"data-testid": g ? `${g}:Autocomplete` : void 0,
|
|
514
|
+
loading: A,
|
|
511
515
|
options: w,
|
|
512
|
-
onChange: (m,
|
|
513
|
-
t(m,
|
|
516
|
+
onChange: (m, h) => {
|
|
517
|
+
t(m, h);
|
|
514
518
|
},
|
|
515
519
|
disablePortal: u,
|
|
516
520
|
filterOptions: (m) => m,
|
|
@@ -518,25 +522,25 @@ const bo = ({
|
|
|
518
522
|
getOptionLabel: (m) => m.label,
|
|
519
523
|
renderInput: (m) => /* @__PURE__ */ o(
|
|
520
524
|
Se,
|
|
521
|
-
|
|
522
|
-
"data-testid":
|
|
525
|
+
S(i({
|
|
526
|
+
"data-testid": g ? `${g}:Autocomplete:TextField` : void 0
|
|
523
527
|
}, m), {
|
|
524
528
|
variant: d,
|
|
525
529
|
label: n,
|
|
526
|
-
color:
|
|
530
|
+
color: l
|
|
527
531
|
})
|
|
528
532
|
),
|
|
529
|
-
isOptionEqualToValue: (m,
|
|
530
|
-
onInputChange: (m,
|
|
531
|
-
(
|
|
533
|
+
isOptionEqualToValue: (m, h) => m.id === h.id,
|
|
534
|
+
onInputChange: (m, h) => {
|
|
535
|
+
(h == null ? void 0 : h.length) >= p && (C(!0), v(h));
|
|
532
536
|
},
|
|
533
|
-
renderOption: (m,
|
|
537
|
+
renderOption: (m, h) => /* @__PURE__ */ xe(
|
|
534
538
|
"li",
|
|
535
|
-
|
|
536
|
-
key:
|
|
537
|
-
"data-testid":
|
|
539
|
+
S(i({}, m), {
|
|
540
|
+
key: h.id,
|
|
541
|
+
"data-testid": g ? `${g}:Autocomplete:option(${h.id.toString()})` : void 0
|
|
538
542
|
}),
|
|
539
|
-
|
|
543
|
+
h.label
|
|
540
544
|
)
|
|
541
545
|
}
|
|
542
546
|
) }) });
|
|
@@ -547,7 +551,7 @@ const bo = ({
|
|
|
547
551
|
titleText: `${U}-titleText`,
|
|
548
552
|
leftPanelButton: `${U}-leftPanelButton`,
|
|
549
553
|
rightPanelButton: `${U}-leftPanelButton`
|
|
550
|
-
}, gn =
|
|
554
|
+
}, gn = ke("div", {
|
|
551
555
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
552
556
|
name: U
|
|
553
557
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -642,7 +646,7 @@ function fn({
|
|
|
642
646
|
] }) })
|
|
643
647
|
] });
|
|
644
648
|
}
|
|
645
|
-
const ut = 400, mn =
|
|
649
|
+
const ut = 400, mn = ke(be, {
|
|
646
650
|
shouldForwardProp: (e) => (
|
|
647
651
|
// Note we do want anchor to be forwarded to the Drawer component
|
|
648
652
|
![
|
|
@@ -656,7 +660,7 @@ const ut = 400, mn = Oe(be, {
|
|
|
656
660
|
),
|
|
657
661
|
name: "SidePanelDrawer"
|
|
658
662
|
})(
|
|
659
|
-
({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: s, navBarWidthClosed:
|
|
663
|
+
({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: r, navBarWidthOpen: s, navBarWidthClosed: l }) => ({
|
|
660
664
|
width: e,
|
|
661
665
|
"& .MuiDrawer-paper": i(i({
|
|
662
666
|
position: "absolute",
|
|
@@ -667,14 +671,14 @@ const ut = 400, mn = Oe(be, {
|
|
|
667
671
|
}, t && {
|
|
668
672
|
opacity: "50%"
|
|
669
673
|
}), n === "left" && i({
|
|
670
|
-
marginLeft: `${
|
|
674
|
+
marginLeft: `${l}px`
|
|
671
675
|
}, r && {
|
|
672
676
|
marginLeft: `${s}px`
|
|
673
677
|
}))
|
|
674
678
|
})
|
|
675
|
-
), Cn =
|
|
679
|
+
), Cn = ke(D, {
|
|
676
680
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
677
|
-
})(({ theme: e, anchor: t }) =>
|
|
681
|
+
})(({ theme: e, anchor: t }) => S(i({
|
|
678
682
|
display: "flex",
|
|
679
683
|
alignItems: "center",
|
|
680
684
|
padding: e.spacing(2)
|
|
@@ -699,16 +703,16 @@ function ze({
|
|
|
699
703
|
onClose: r = () => {
|
|
700
704
|
},
|
|
701
705
|
titleText: s = "",
|
|
702
|
-
width:
|
|
706
|
+
width: l = ut,
|
|
703
707
|
showCloseArrow: d = !0,
|
|
704
|
-
debugOpacity:
|
|
708
|
+
debugOpacity: g = !1,
|
|
705
709
|
headerBoxProps: p = {},
|
|
706
710
|
onOpened: u,
|
|
707
711
|
onClosed: w,
|
|
708
712
|
"data-testid": b,
|
|
709
|
-
navBarOpen:
|
|
710
|
-
navBarWidthOpen:
|
|
711
|
-
navBarWidthClosed:
|
|
713
|
+
navBarOpen: A = !1,
|
|
714
|
+
navBarWidthOpen: C = 0,
|
|
715
|
+
navBarWidthClosed: k = 0
|
|
712
716
|
}) {
|
|
713
717
|
return /* @__PURE__ */ f(
|
|
714
718
|
mn,
|
|
@@ -720,20 +724,20 @@ function ze({
|
|
|
720
724
|
variant: "persistent",
|
|
721
725
|
anchor: t,
|
|
722
726
|
open: n,
|
|
723
|
-
width:
|
|
724
|
-
debugOpacity:
|
|
727
|
+
width: l,
|
|
728
|
+
debugOpacity: g,
|
|
725
729
|
"data-testid": b,
|
|
726
|
-
navBarOpen:
|
|
727
|
-
navBarWidthOpen:
|
|
728
|
-
navBarWidthClosed:
|
|
730
|
+
navBarOpen: A,
|
|
731
|
+
navBarWidthOpen: C,
|
|
732
|
+
navBarWidthClosed: k,
|
|
729
733
|
children: [
|
|
730
|
-
/* @__PURE__ */ o(Cn,
|
|
734
|
+
/* @__PURE__ */ o(Cn, S(i({ anchor: t }, p), { children: t === "left" ? /* @__PURE__ */ f(B, { children: [
|
|
731
735
|
/* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: s }),
|
|
732
736
|
d && /* @__PURE__ */ f(Q, { onClick: r, size: "large", "aria-label": "Close left side panel", children: [
|
|
733
737
|
/* @__PURE__ */ o(rt, { "data-testid": "arrowbackicon" }),
|
|
734
738
|
" "
|
|
735
739
|
] })
|
|
736
|
-
] }) : /* @__PURE__ */ f(
|
|
740
|
+
] }) : /* @__PURE__ */ f(B, { children: [
|
|
737
741
|
d && /* @__PURE__ */ f(Q, { onClick: r, size: "large", "aria-label": "Close right side panel", children: [
|
|
738
742
|
/* @__PURE__ */ o(ot, {}),
|
|
739
743
|
" "
|
|
@@ -745,7 +749,7 @@ function ze({
|
|
|
745
749
|
}
|
|
746
750
|
);
|
|
747
751
|
}
|
|
748
|
-
const vn =
|
|
752
|
+
const vn = L(D, {
|
|
749
753
|
shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
|
|
750
754
|
name: "PanelAwareMargins"
|
|
751
755
|
})(({ theme: e, leftPanel: t, rightPanel: n }) => {
|
|
@@ -768,7 +772,7 @@ const vn = N(D, {
|
|
|
768
772
|
}),
|
|
769
773
|
marginRight: `${(s = n == null ? void 0 : n.width) != null ? s : 0}px`
|
|
770
774
|
});
|
|
771
|
-
}), xn =
|
|
775
|
+
}), xn = L(et, {
|
|
772
776
|
name: "PageContainer"
|
|
773
777
|
})(({ theme: e }) => ({
|
|
774
778
|
// Horizontal padding comes from the Container's gutter
|
|
@@ -783,7 +787,7 @@ const vn = N(D, {
|
|
|
783
787
|
startOpen: !1,
|
|
784
788
|
open: void 0,
|
|
785
789
|
onChangeOpen: void 0,
|
|
786
|
-
content: /* @__PURE__ */ o(
|
|
790
|
+
content: /* @__PURE__ */ o(B, {}),
|
|
787
791
|
onOpened: void 0,
|
|
788
792
|
onClosed: void 0,
|
|
789
793
|
dataTestId: void 0
|
|
@@ -794,22 +798,22 @@ function Ao({
|
|
|
794
798
|
leftPanel: n,
|
|
795
799
|
rightPanel: r,
|
|
796
800
|
sidePanelsAreMutuallyExclusive: s = !0,
|
|
797
|
-
debugOpacity:
|
|
801
|
+
debugOpacity: l = !1,
|
|
798
802
|
pageContainerProps: d,
|
|
799
|
-
pageContentDataTestId:
|
|
803
|
+
pageContentDataTestId: g,
|
|
800
804
|
topBarDataTestId: p,
|
|
801
805
|
navBarOpen: u,
|
|
802
806
|
navBarWidthOpen: w,
|
|
803
807
|
navBarWidthClosed: b
|
|
804
808
|
}) {
|
|
805
|
-
const [
|
|
806
|
-
titleText:
|
|
807
|
-
content:
|
|
808
|
-
flavour:
|
|
809
|
-
open:
|
|
810
|
-
onChangeOpen:
|
|
809
|
+
const [A, C] = O(Ce), [k, v] = O(ve), [m, h] = O(Ce), [T, _] = O(ve), F = n !== void 0, y = r !== void 0, {
|
|
810
|
+
titleText: $,
|
|
811
|
+
content: H,
|
|
812
|
+
flavour: P,
|
|
813
|
+
open: R,
|
|
814
|
+
onChangeOpen: W,
|
|
811
815
|
width: a,
|
|
812
|
-
arrowButtons:
|
|
816
|
+
arrowButtons: c,
|
|
813
817
|
startOpen: x,
|
|
814
818
|
onOpened: q,
|
|
815
819
|
onClosed: le,
|
|
@@ -817,7 +821,7 @@ function Ao({
|
|
|
817
821
|
} = n ? i(i({}, te), n) : i({}, te), {
|
|
818
822
|
titleText: ce,
|
|
819
823
|
content: At,
|
|
820
|
-
flavour:
|
|
824
|
+
flavour: $e,
|
|
821
825
|
open: de,
|
|
822
826
|
onChangeOpen: Ie,
|
|
823
827
|
width: pe,
|
|
@@ -825,20 +829,20 @@ function Ao({
|
|
|
825
829
|
startOpen: Z,
|
|
826
830
|
onOpened: St,
|
|
827
831
|
onClosed: Dt,
|
|
828
|
-
dataTestId:
|
|
832
|
+
dataTestId: kt
|
|
829
833
|
} = r ? i(i({}, te), r) : i({}, te);
|
|
830
834
|
re(() => {
|
|
831
|
-
x !== Ce && (
|
|
835
|
+
x !== Ce && (C(x), h(x));
|
|
832
836
|
}, [x]), re(() => {
|
|
833
|
-
Z !== ve && (
|
|
837
|
+
Z !== ve && (v(Z), _(Z));
|
|
834
838
|
}, [Z]);
|
|
835
|
-
const ue =
|
|
836
|
-
|
|
837
|
-
}, Te = (
|
|
838
|
-
de === void 0 && (
|
|
839
|
+
const ue = R === void 0 ? A : R, he = de === void 0 ? k : de, Ee = (z) => {
|
|
840
|
+
R === void 0 && (C(z), s && y && (z ? (v(!1), _(k)) : v(T))), W && W(z);
|
|
841
|
+
}, Te = (z) => {
|
|
842
|
+
de === void 0 && (v(z), s && F && (z ? (C(!1), h(A)) : C(m))), Ie && Ie(z);
|
|
839
843
|
};
|
|
840
844
|
return /* @__PURE__ */ f(D, { children: [
|
|
841
|
-
|
|
845
|
+
F && /* @__PURE__ */ o(
|
|
842
846
|
ze,
|
|
843
847
|
{
|
|
844
848
|
"data-testid": J,
|
|
@@ -846,27 +850,27 @@ function Ao({
|
|
|
846
850
|
open: ue,
|
|
847
851
|
onClose: () => Ee(!1),
|
|
848
852
|
width: a,
|
|
849
|
-
titleText:
|
|
850
|
-
debugOpacity:
|
|
851
|
-
showCloseArrow:
|
|
853
|
+
titleText: $,
|
|
854
|
+
debugOpacity: l,
|
|
855
|
+
showCloseArrow: c === "both" || c === "close",
|
|
852
856
|
onOpened: q,
|
|
853
857
|
onClosed: le,
|
|
854
858
|
navBarOpen: u,
|
|
855
859
|
navBarWidthOpen: w,
|
|
856
860
|
navBarWidthClosed: b,
|
|
857
|
-
children:
|
|
861
|
+
children: H
|
|
858
862
|
}
|
|
859
863
|
),
|
|
860
|
-
|
|
864
|
+
y && /* @__PURE__ */ o(
|
|
861
865
|
ze,
|
|
862
866
|
{
|
|
863
|
-
"data-testid":
|
|
867
|
+
"data-testid": kt,
|
|
864
868
|
anchor: "right",
|
|
865
869
|
open: he,
|
|
866
870
|
onClose: () => Te(!1),
|
|
867
871
|
width: pe,
|
|
868
872
|
titleText: ce,
|
|
869
|
-
debugOpacity:
|
|
873
|
+
debugOpacity: l,
|
|
870
874
|
showCloseArrow: Y === "both" || Y === "close",
|
|
871
875
|
onOpened: St,
|
|
872
876
|
onClosed: Dt,
|
|
@@ -881,14 +885,14 @@ function Ao({
|
|
|
881
885
|
i(i({
|
|
882
886
|
titleText: t,
|
|
883
887
|
"data-testid": p
|
|
884
|
-
},
|
|
888
|
+
}, F && P === "push" ? {
|
|
885
889
|
leftPanel: {
|
|
886
890
|
open: ue,
|
|
887
891
|
width: a,
|
|
888
892
|
onOpen: () => Ee(!0),
|
|
889
|
-
showOpenArrow:
|
|
893
|
+
showOpenArrow: c === "both" || c === "open"
|
|
890
894
|
}
|
|
891
|
-
} : {}),
|
|
895
|
+
} : {}), y && $e === "push" ? {
|
|
892
896
|
rightPanel: {
|
|
893
897
|
open: he,
|
|
894
898
|
width: pe,
|
|
@@ -899,26 +903,26 @@ function Ao({
|
|
|
899
903
|
),
|
|
900
904
|
/* @__PURE__ */ o(
|
|
901
905
|
vn,
|
|
902
|
-
|
|
906
|
+
S(i(i({}, P === "push" ? {
|
|
903
907
|
leftPanel: {
|
|
904
908
|
open: ue,
|
|
905
909
|
width: a
|
|
906
910
|
}
|
|
907
|
-
} : {}),
|
|
911
|
+
} : {}), $e === "push" ? {
|
|
908
912
|
rightPanel: {
|
|
909
913
|
open: he,
|
|
910
914
|
width: pe
|
|
911
915
|
}
|
|
912
916
|
} : {}), {
|
|
913
|
-
children: /* @__PURE__ */ o(xn,
|
|
917
|
+
children: /* @__PURE__ */ o(xn, S(i({ "data-testid": g }, d), { children: e }))
|
|
914
918
|
})
|
|
915
919
|
)
|
|
916
920
|
] });
|
|
917
921
|
}
|
|
918
922
|
const ht = () => {
|
|
919
923
|
const e = ae();
|
|
920
|
-
return
|
|
921
|
-
}, wn = 64, bn = 64, An = 256, K =
|
|
924
|
+
return Nt(e.breakpoints.down("sm"));
|
|
925
|
+
}, wn = 64, bn = 64, An = 256, K = M(!0), gt = M(An), ft = M(bn), we = M(""), mt = M(wn), Ct = M(void 0);
|
|
922
926
|
function Sn({ links: e }) {
|
|
923
927
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
924
928
|
}
|
|
@@ -930,7 +934,7 @@ const ne = "Navbar", j = {
|
|
|
930
934
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
931
935
|
// settings: `${PREFIX}-settings`,
|
|
932
936
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
933
|
-
}, Dn =
|
|
937
|
+
}, Dn = L(D, { name: "NavBar" })(({ theme: e }) => ({
|
|
934
938
|
[`&.${j.root}`]: {
|
|
935
939
|
display: "flex"
|
|
936
940
|
},
|
|
@@ -952,10 +956,10 @@ const ne = "Navbar", j = {
|
|
|
952
956
|
})), ie = (e, t, n) => e.transitions.create(t, {
|
|
953
957
|
easing: e.transitions.easing.sharp,
|
|
954
958
|
duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
955
|
-
}),
|
|
959
|
+
}), kn = (e) => {
|
|
956
960
|
const t = ae();
|
|
957
961
|
return /* @__PURE__ */ o(
|
|
958
|
-
|
|
962
|
+
Bt,
|
|
959
963
|
i({
|
|
960
964
|
easing: t.transitions.easing.sharp,
|
|
961
965
|
timeout: {
|
|
@@ -978,7 +982,7 @@ const ne = "Navbar", j = {
|
|
|
978
982
|
}, vt(e)), Ue = (e, t) => i({
|
|
979
983
|
width: t,
|
|
980
984
|
transition: ie(e, "width", "leaving")
|
|
981
|
-
}, vt(e)),
|
|
985
|
+
}, vt(e)), On = L(be, {
|
|
982
986
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
983
987
|
})(({ theme: e, open: t, widthOpen: n, widthClosed: r, isSmallScreen: s }) => i(i({
|
|
984
988
|
flexShrink: 0,
|
|
@@ -986,14 +990,14 @@ const ne = "Navbar", j = {
|
|
|
986
990
|
boxSizing: "border-box",
|
|
987
991
|
display: "flex",
|
|
988
992
|
flexDirection: "column"
|
|
989
|
-
}, t &&
|
|
993
|
+
}, t && S(i({}, Ge(e, n)), {
|
|
990
994
|
backgroundColor: "",
|
|
991
995
|
"& .MuiDrawer-paper": Ge(e, n)
|
|
992
|
-
})), !t &&
|
|
996
|
+
})), !t && S(i({}, Ue(e, s ? n : r)), {
|
|
993
997
|
backgroundColor: "",
|
|
994
998
|
"& .MuiDrawer-paper": Ue(e, s ? n : r)
|
|
995
999
|
})));
|
|
996
|
-
function
|
|
1000
|
+
function $n(e) {
|
|
997
1001
|
let t = 0;
|
|
998
1002
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
999
1003
|
const s = e.charCodeAt(n);
|
|
@@ -1024,20 +1028,20 @@ function En({ user: e, domainCode: t, open: n }) {
|
|
|
1024
1028
|
aspectRatio: 1
|
|
1025
1029
|
},
|
|
1026
1030
|
children: e != null && e.name ? /* @__PURE__ */ o(
|
|
1027
|
-
|
|
1031
|
+
Be,
|
|
1028
1032
|
{
|
|
1029
1033
|
src: e == null ? void 0 : e.picture,
|
|
1030
1034
|
sx: {
|
|
1031
1035
|
width: "100%",
|
|
1032
1036
|
height: "100%",
|
|
1033
|
-
bgcolor: Ve[Math.abs(
|
|
1037
|
+
bgcolor: Ve[Math.abs($n(e.name)) % Ve.length]
|
|
1034
1038
|
},
|
|
1035
1039
|
children: In(e.name)
|
|
1036
1040
|
}
|
|
1037
|
-
) : /* @__PURE__ */ o(
|
|
1041
|
+
) : /* @__PURE__ */ o(Be, { sx: { width: "100%", height: "100%" } })
|
|
1038
1042
|
}
|
|
1039
1043
|
),
|
|
1040
|
-
/* @__PURE__ */ o(
|
|
1044
|
+
/* @__PURE__ */ o(kn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Lt, { in: n, children: /* @__PURE__ */ f(D, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
1041
1045
|
e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Le, { animation: !1, width: "50%" }),
|
|
1042
1046
|
t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Le, { animation: !1, width: "25%" })
|
|
1043
1047
|
] }) }) })
|
|
@@ -1051,14 +1055,14 @@ function Tn({
|
|
|
1051
1055
|
widthOpen: n,
|
|
1052
1056
|
"data-testid": r,
|
|
1053
1057
|
top: s,
|
|
1054
|
-
middle:
|
|
1058
|
+
middle: l,
|
|
1055
1059
|
bottom: d,
|
|
1056
|
-
user:
|
|
1060
|
+
user: g,
|
|
1057
1061
|
domainCode: p
|
|
1058
1062
|
}) {
|
|
1059
1063
|
const u = ht(), w = it(K);
|
|
1060
1064
|
return /* @__PURE__ */ o(Dn, { className: j.root, "data-testid": r, children: /* @__PURE__ */ f(
|
|
1061
|
-
|
|
1065
|
+
On,
|
|
1062
1066
|
{
|
|
1063
1067
|
open: e,
|
|
1064
1068
|
widthOpen: n,
|
|
@@ -1078,17 +1082,17 @@ function Tn({
|
|
|
1078
1082
|
s,
|
|
1079
1083
|
/* @__PURE__ */ o(Me, { variant: "middle" })
|
|
1080
1084
|
] }),
|
|
1081
|
-
/* @__PURE__ */ o(D, { flexGrow: "1", children: Array.isArray(
|
|
1085
|
+
/* @__PURE__ */ o(D, { flexGrow: "1", children: Array.isArray(l) ? /* @__PURE__ */ o(Sn, { links: l }) : l }),
|
|
1082
1086
|
/* @__PURE__ */ f(D, { flexGrow: "0", children: [
|
|
1083
1087
|
/* @__PURE__ */ o(Me, { variant: "middle" }),
|
|
1084
|
-
/* @__PURE__ */ o(En, { user:
|
|
1085
|
-
d && /* @__PURE__ */ o(
|
|
1088
|
+
/* @__PURE__ */ o(En, { user: g, domainCode: p, open: e }),
|
|
1089
|
+
d && /* @__PURE__ */ o(B, { children: d })
|
|
1086
1090
|
] })
|
|
1087
1091
|
]
|
|
1088
1092
|
}
|
|
1089
1093
|
) });
|
|
1090
1094
|
}
|
|
1091
|
-
function
|
|
1095
|
+
function Fn({
|
|
1092
1096
|
children: e,
|
|
1093
1097
|
topBarHeight: t,
|
|
1094
1098
|
maxWidth: n = !1
|
|
@@ -1116,11 +1120,11 @@ function yn({
|
|
|
1116
1120
|
}
|
|
1117
1121
|
);
|
|
1118
1122
|
}
|
|
1119
|
-
const
|
|
1120
|
-
titleText: `${
|
|
1123
|
+
const yn = "TopBar", Pn = {
|
|
1124
|
+
titleText: `${yn}-titleText`
|
|
1121
1125
|
};
|
|
1122
|
-
function
|
|
1123
|
-
const r = it(K), s = () => r((
|
|
1126
|
+
function Nn({ titleText: e = "", height: t, "data-testid": n }) {
|
|
1127
|
+
const r = it(K), s = () => r((g) => !g), l = ae(), d = ht();
|
|
1124
1128
|
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ f(
|
|
1125
1129
|
Ze,
|
|
1126
1130
|
{
|
|
@@ -1136,11 +1140,11 @@ function Pn({ titleText: e = "", height: t, "data-testid": n }) {
|
|
|
1136
1140
|
gap: 2,
|
|
1137
1141
|
flexShrink: 0,
|
|
1138
1142
|
height: t,
|
|
1139
|
-
zIndex: d ? 0 :
|
|
1143
|
+
zIndex: d ? 0 : l.zIndex.drawer + 1
|
|
1140
1144
|
},
|
|
1141
1145
|
children: [
|
|
1142
1146
|
/* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(Jt, { fontSize: "medium" }) }),
|
|
1143
|
-
/* @__PURE__ */ o(E, { className:
|
|
1147
|
+
/* @__PURE__ */ o(E, { className: Pn.titleText, variant: "h6", children: e })
|
|
1144
1148
|
]
|
|
1145
1149
|
}
|
|
1146
1150
|
) });
|
|
@@ -1151,9 +1155,9 @@ function So({
|
|
|
1151
1155
|
initialNavBarOpen: n,
|
|
1152
1156
|
pageContainerProps: r,
|
|
1153
1157
|
pageContentDataTestId: s,
|
|
1154
|
-
topBarDataTestId:
|
|
1158
|
+
topBarDataTestId: l,
|
|
1155
1159
|
navBarDataTestId: d,
|
|
1156
|
-
navBarMiddle:
|
|
1160
|
+
navBarMiddle: g,
|
|
1157
1161
|
navBarBottom: p,
|
|
1158
1162
|
user: u,
|
|
1159
1163
|
domainCode: w
|
|
@@ -1162,31 +1166,31 @@ function So({
|
|
|
1162
1166
|
[K, n != null ? n : !0],
|
|
1163
1167
|
[we, t != null ? t : ""]
|
|
1164
1168
|
]);
|
|
1165
|
-
const b = He(K), [
|
|
1169
|
+
const b = He(K), [A] = X(gt), [C] = X(ft), k = He(we), [v] = X(mt), [m] = X(Ct);
|
|
1166
1170
|
return /* @__PURE__ */ f(D, { children: [
|
|
1167
1171
|
/* @__PURE__ */ o(_t, {}),
|
|
1168
|
-
/* @__PURE__ */ o(
|
|
1172
|
+
/* @__PURE__ */ o(Nn, { titleText: k, "data-testid": l, height: v }),
|
|
1169
1173
|
/* @__PURE__ */ f(D, { sx: { display: "flex" }, children: [
|
|
1170
1174
|
/* @__PURE__ */ o(
|
|
1171
1175
|
Tn,
|
|
1172
1176
|
{
|
|
1173
1177
|
open: b,
|
|
1174
1178
|
top: m,
|
|
1175
|
-
middle:
|
|
1179
|
+
middle: g,
|
|
1176
1180
|
bottom: p,
|
|
1177
1181
|
user: u,
|
|
1178
1182
|
domainCode: w,
|
|
1179
|
-
widthOpen:
|
|
1180
|
-
widthClosed:
|
|
1181
|
-
offsetTop:
|
|
1183
|
+
widthOpen: A,
|
|
1184
|
+
widthClosed: C,
|
|
1185
|
+
offsetTop: v,
|
|
1182
1186
|
"data-testid": d
|
|
1183
1187
|
}
|
|
1184
1188
|
),
|
|
1185
1189
|
/* @__PURE__ */ o(
|
|
1186
|
-
|
|
1187
|
-
|
|
1190
|
+
Fn,
|
|
1191
|
+
S(i({
|
|
1188
1192
|
"data-testid": s,
|
|
1189
|
-
topBarHeight:
|
|
1193
|
+
topBarHeight: v
|
|
1190
1194
|
}, r), {
|
|
1191
1195
|
children: e
|
|
1192
1196
|
})
|
|
@@ -1194,7 +1198,7 @@ function So({
|
|
|
1194
1198
|
] })
|
|
1195
1199
|
] });
|
|
1196
1200
|
}
|
|
1197
|
-
const
|
|
1201
|
+
const Bn = {
|
|
1198
1202
|
autoHideDuration: 6e3,
|
|
1199
1203
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
1200
1204
|
// The default is false. If we prefer timer to continue when window loses
|
|
@@ -1215,75 +1219,75 @@ const Nn = {
|
|
|
1215
1219
|
borderBottomLeftRadius: "0px",
|
|
1216
1220
|
borderBottomRightRadius: "0px"
|
|
1217
1221
|
}, Rn = {}, Wn = {}, xt = Je(null);
|
|
1218
|
-
function zn(
|
|
1219
|
-
var d =
|
|
1222
|
+
function zn(l) {
|
|
1223
|
+
var d = l, {
|
|
1220
1224
|
overrideState: e = Rn,
|
|
1221
1225
|
overrideActions: t = Wn,
|
|
1222
1226
|
shouldClose: n = Ln.shouldClose,
|
|
1223
1227
|
children: r
|
|
1224
|
-
} = d, s =
|
|
1228
|
+
} = d, s = Pe(d, [
|
|
1225
1229
|
"overrideState",
|
|
1226
1230
|
"overrideActions",
|
|
1227
1231
|
"shouldClose",
|
|
1228
1232
|
"children"
|
|
1229
1233
|
]);
|
|
1230
|
-
var
|
|
1231
|
-
const [{ open:
|
|
1234
|
+
var W;
|
|
1235
|
+
const [{ open: g }, p] = O({ open: !1 }), u = fe([]), w = fe(Date.now()), b = fe(0), A = oe((a) => {
|
|
1232
1236
|
p({ open: a });
|
|
1233
|
-
}, []),
|
|
1237
|
+
}, []), C = oe((a = {}) => {
|
|
1234
1238
|
b.current += 1, u.current.length >= Xe && Date.now() - w.current >= je && (w.current = Date.now(), console.error(
|
|
1235
1239
|
`SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${b.current} times in last ${je}ms)`
|
|
1236
1240
|
), b.current = 0);
|
|
1237
|
-
const
|
|
1241
|
+
const c = i(S(i({}, qe), {
|
|
1238
1242
|
key: _n()
|
|
1239
1243
|
}), a);
|
|
1240
|
-
return u.current.push(
|
|
1241
|
-
}, []),
|
|
1242
|
-
const
|
|
1243
|
-
if (
|
|
1244
|
-
return
|
|
1245
|
-
},
|
|
1246
|
-
n(a,
|
|
1244
|
+
return u.current.push(c), u.current.length === 1 && p({ open: !0 }), c.key;
|
|
1245
|
+
}, []), k = (a = "", c = {}) => C(i({ message: a, severity: "success" }, c)), v = (a = "", c = {}) => C(i({ message: a, severity: "info" }, c)), m = (a = "", c = {}) => C(i({ message: a, severity: "warning" }, c)), h = (a = "", c = {}) => C(i({ message: a, severity: "error" }, c)), T = (a) => {
|
|
1246
|
+
const c = u.current.findIndex((x) => x.key === a);
|
|
1247
|
+
if (c !== -1)
|
|
1248
|
+
return c === 0 ? (p({ open: !1 }), u.current[0]) : u.current.splice(c, 1);
|
|
1249
|
+
}, _ = (a, c) => {
|
|
1250
|
+
n(a, c) && p({ open: !1 });
|
|
1251
|
+
}, F = () => {
|
|
1247
1252
|
}, y = () => {
|
|
1248
|
-
}, B = () => {
|
|
1249
1253
|
u.current.shift(), u.current.length > 0 && p({ open: !0 });
|
|
1250
|
-
},
|
|
1251
|
-
"autoHideDuration" in
|
|
1252
|
-
const
|
|
1253
|
-
open:
|
|
1254
|
-
setOpen:
|
|
1255
|
-
enqueueNotification:
|
|
1256
|
-
enqueueSuccessNotification:
|
|
1257
|
-
enqueueInfoNotification:
|
|
1254
|
+
}, $ = (W = u.current[0]) != null ? W : i({}, qe), H = {};
|
|
1255
|
+
"autoHideDuration" in $ && (H.autoHideDuration = $.autoHideDuration);
|
|
1256
|
+
const P = i(i({}, Bn), s), R = i(i({
|
|
1257
|
+
open: g,
|
|
1258
|
+
setOpen: A,
|
|
1259
|
+
enqueueNotification: C,
|
|
1260
|
+
enqueueSuccessNotification: k,
|
|
1261
|
+
enqueueInfoNotification: v,
|
|
1258
1262
|
enqueueWarningNotification: m,
|
|
1259
|
-
enqueueErrorNotification:
|
|
1263
|
+
enqueueErrorNotification: h,
|
|
1260
1264
|
removeNotification: T
|
|
1261
1265
|
}, e), t);
|
|
1262
|
-
return /* @__PURE__ */ f(xt.Provider, { value:
|
|
1266
|
+
return /* @__PURE__ */ f(xt.Provider, { value: R, children: [
|
|
1263
1267
|
r,
|
|
1264
1268
|
/* @__PURE__ */ o(
|
|
1265
1269
|
Ht,
|
|
1266
|
-
|
|
1267
|
-
open:
|
|
1268
|
-
onClose:
|
|
1270
|
+
S(i(i({}, P), H), {
|
|
1271
|
+
open: g,
|
|
1272
|
+
onClose: _,
|
|
1269
1273
|
TransitionProps: {
|
|
1270
|
-
onExited:
|
|
1271
|
-
onExit:
|
|
1274
|
+
onExited: y,
|
|
1275
|
+
onExit: F
|
|
1272
1276
|
},
|
|
1273
1277
|
sx: { zIndex: Mn },
|
|
1274
1278
|
children: /* @__PURE__ */ f("div", { children: [
|
|
1275
1279
|
/* @__PURE__ */ o(
|
|
1276
1280
|
Rt,
|
|
1277
1281
|
{
|
|
1278
|
-
onClose: (a) =>
|
|
1279
|
-
severity:
|
|
1282
|
+
onClose: (a) => _(a, "closeAlert"),
|
|
1283
|
+
severity: $.severity,
|
|
1280
1284
|
variant: "filled",
|
|
1281
|
-
icon:
|
|
1282
|
-
style:
|
|
1283
|
-
children:
|
|
1285
|
+
icon: $.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
|
|
1286
|
+
style: $.progressIndicator === "linear" ? Hn : void 0,
|
|
1287
|
+
children: $.message
|
|
1284
1288
|
}
|
|
1285
1289
|
),
|
|
1286
|
-
|
|
1290
|
+
$.progressIndicator === "linear" && /* @__PURE__ */ o(Wt, { color: "primary" })
|
|
1287
1291
|
] })
|
|
1288
1292
|
})
|
|
1289
1293
|
)
|
|
@@ -1292,19 +1296,19 @@ function zn(c) {
|
|
|
1292
1296
|
function Gn() {
|
|
1293
1297
|
const e = Ye(xt);
|
|
1294
1298
|
if (e === null)
|
|
1295
|
-
throw new
|
|
1299
|
+
throw new Oe("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
1296
1300
|
return e;
|
|
1297
1301
|
}
|
|
1298
1302
|
const Do = se(
|
|
1299
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(zn,
|
|
1300
|
-
), Un = en(),
|
|
1303
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(zn, S(i({}, e), { overrideState: t, overrideActions: n, children: r }))
|
|
1304
|
+
), Un = en(), ko = ({
|
|
1301
1305
|
children: e,
|
|
1302
1306
|
store: t
|
|
1303
1307
|
}) => /* @__PURE__ */ o(at, { store: t != null ? t : Un, children: e }), wt = "domainCode";
|
|
1304
1308
|
var Ke;
|
|
1305
|
-
const Qe =
|
|
1309
|
+
const Qe = M(
|
|
1306
1310
|
JSON.parse((Ke = localStorage.getItem(wt)) != null ? Ke : '{"domainCode": ""}').domainCode
|
|
1307
|
-
), bt =
|
|
1311
|
+
), bt = M(
|
|
1308
1312
|
(e) => e(Qe),
|
|
1309
1313
|
(e, t, n) => {
|
|
1310
1314
|
t(Qe, n), localStorage.setItem(wt, JSON.stringify({ domainCode: n }));
|
|
@@ -1324,36 +1328,36 @@ const Qe = L(
|
|
|
1324
1328
|
}, qn = (e) => {
|
|
1325
1329
|
var t;
|
|
1326
1330
|
return e === null ? "N/A" : (t = Vn[e]) != null ? t : "";
|
|
1327
|
-
},
|
|
1331
|
+
}, Oo = ({
|
|
1328
1332
|
isLoading: e,
|
|
1329
1333
|
isOpen: t,
|
|
1330
1334
|
onClose: n,
|
|
1331
1335
|
domainOptions: r,
|
|
1332
1336
|
applicationName: s,
|
|
1333
|
-
handleLogout:
|
|
1337
|
+
handleLogout: l
|
|
1334
1338
|
}) => {
|
|
1335
|
-
const [d,
|
|
1336
|
-
p ? (
|
|
1337
|
-
}),
|
|
1338
|
-
d && !b && !
|
|
1339
|
+
const [d, g] = X(bt), [p, u] = O(d), { enqueueSuccessNotification: w } = Gn(), b = r.length === 0, A = !!d && !r.includes(d) && !r.includes(p), C = !d || b || A, k = () => N(void 0, null, function* () {
|
|
1340
|
+
p ? (g(p), w(`Set domain to ${p}`), n()) : g("");
|
|
1341
|
+
}), v = () => N(void 0, null, function* () {
|
|
1342
|
+
d && !b && !A ? (u(d), n()) : C && l();
|
|
1339
1343
|
});
|
|
1340
1344
|
let m;
|
|
1341
|
-
return b ? m = "Unable to retrieve your active organisations. Try logging in again." :
|
|
1345
|
+
return b ? m = "Unable to retrieve your active organisations. Try logging in again." : A && (m = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ f(
|
|
1342
1346
|
pn,
|
|
1343
1347
|
{
|
|
1344
1348
|
isOpen: t,
|
|
1345
1349
|
dialogTitle: "Select an organisation",
|
|
1346
1350
|
primaryButton: {
|
|
1347
1351
|
text: "Confirm",
|
|
1348
|
-
onClick:
|
|
1349
|
-
disabled: !p || b ||
|
|
1352
|
+
onClick: k,
|
|
1353
|
+
disabled: !p || b || A,
|
|
1350
1354
|
buttonColor: "primary"
|
|
1351
1355
|
},
|
|
1352
1356
|
secondaryButton: {
|
|
1353
|
-
text:
|
|
1354
|
-
onClick:
|
|
1357
|
+
text: C ? "Logout" : "Cancel",
|
|
1358
|
+
onClick: v
|
|
1355
1359
|
},
|
|
1356
|
-
onClose:
|
|
1360
|
+
onClose: C ? () => {
|
|
1357
1361
|
} : n,
|
|
1358
1362
|
children: [
|
|
1359
1363
|
/* @__PURE__ */ f(E, { marginBottom: 2, children: [
|
|
@@ -1368,18 +1372,18 @@ const Qe = L(
|
|
|
1368
1372
|
multiple: !1,
|
|
1369
1373
|
disableClearable: !1,
|
|
1370
1374
|
value: p !== "" ? p : null,
|
|
1371
|
-
onChange: (
|
|
1375
|
+
onChange: (h, T) => u(T != null ? T : ""),
|
|
1372
1376
|
getOptionLabel: qn,
|
|
1373
1377
|
options: [...r],
|
|
1374
|
-
renderInput: (
|
|
1378
|
+
renderInput: (h) => /* @__PURE__ */ o(
|
|
1375
1379
|
Se,
|
|
1376
|
-
|
|
1380
|
+
S(i({}, h), {
|
|
1377
1381
|
variant: "filled",
|
|
1378
1382
|
label: "Select organisation",
|
|
1379
|
-
InputProps:
|
|
1380
|
-
endAdornment: /* @__PURE__ */ f(
|
|
1383
|
+
InputProps: S(i({}, h.InputProps), {
|
|
1384
|
+
endAdornment: /* @__PURE__ */ f(B, { children: [
|
|
1381
1385
|
e ? /* @__PURE__ */ o(De, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1382
|
-
|
|
1386
|
+
h.InputProps.endAdornment
|
|
1383
1387
|
] })
|
|
1384
1388
|
})
|
|
1385
1389
|
})
|
|
@@ -1390,7 +1394,7 @@ const Qe = L(
|
|
|
1390
1394
|
]
|
|
1391
1395
|
}
|
|
1392
1396
|
);
|
|
1393
|
-
},
|
|
1397
|
+
}, $o = tt({
|
|
1394
1398
|
palette: {
|
|
1395
1399
|
primary: {
|
|
1396
1400
|
dark: "#00A651",
|
|
@@ -1543,7 +1547,7 @@ const Qe = L(
|
|
|
1543
1547
|
}, Eo = se(() => ({ children: e }) => /* @__PURE__ */ o(at, { children: e })), jn = ({
|
|
1544
1548
|
initialValues: e,
|
|
1545
1549
|
children: t
|
|
1546
|
-
}) => (st(e), /* @__PURE__ */ o(
|
|
1550
|
+
}) => (st(e), /* @__PURE__ */ o(B, { children: t })), To = se(
|
|
1547
1551
|
(e) => ({ children: t }) => /* @__PURE__ */ o(
|
|
1548
1552
|
jn,
|
|
1549
1553
|
{
|
|
@@ -1560,10 +1564,10 @@ const Qe = L(
|
|
|
1560
1564
|
export {
|
|
1561
1565
|
pn as AgDialog,
|
|
1562
1566
|
So as AppLayout,
|
|
1563
|
-
|
|
1567
|
+
ko as AtomProvider,
|
|
1564
1568
|
xt as Context,
|
|
1565
|
-
|
|
1566
|
-
|
|
1569
|
+
Oe as ContextError,
|
|
1570
|
+
Oo as DomainCodeDialog,
|
|
1567
1571
|
fo as ExampleComponent,
|
|
1568
1572
|
wo as FetchAutocomplete,
|
|
1569
1573
|
jn as HydrateAtoms,
|
|
@@ -1579,7 +1583,7 @@ export {
|
|
|
1579
1583
|
Un as atomStore,
|
|
1580
1584
|
dn as buildNavBarState,
|
|
1581
1585
|
bt as domainCodeAtom,
|
|
1582
|
-
|
|
1586
|
+
$o as fed21Theme,
|
|
1583
1587
|
Io as internalAgSystemsTheme,
|
|
1584
1588
|
V as navBarClasses,
|
|
1585
1589
|
K as navBarOpenAtom,
|