@variamosple/variamos-components 0.0.19
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 +50 -0
- package/dist/AbstractModalHeader-UzCRSxIO.js +1690 -0
- package/dist/Anchor-DJG5WYYF.js +40 -0
- package/dist/Button-DWo2Fl71.js +78 -0
- package/dist/Button-GQJKgb76.js +33 -0
- package/dist/Common/Events.d.ts +9 -0
- package/dist/Common/Events.js +18 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/Common/index.js +4 -0
- package/dist/Components/AuthWrapper/index.d.ts +7 -0
- package/dist/Components/AuthWrapper/index.js +52 -0
- package/dist/Components/ConfirmationModal/index.d.ts +12 -0
- package/dist/Components/ConfirmationModal/index.js +293 -0
- package/dist/Components/Footer/index.d.ts +5 -0
- package/dist/Components/Footer/index.js +11 -0
- package/dist/Components/Header/HeaderOptions.d.ts +2 -0
- package/dist/Components/Header/HeaderOptions.js +39 -0
- package/dist/Components/Header/MenuItem.d.ts +3 -0
- package/dist/Components/Header/MenuItem.js +51 -0
- package/dist/Components/Header/SubHeader.d.ts +2 -0
- package/dist/Components/Header/SubHeader.js +12 -0
- package/dist/Components/Header/index.d.ts +7 -0
- package/dist/Components/Header/index.js +46 -0
- package/dist/Components/NotAuthorized/index.d.ts +5 -0
- package/dist/Components/NotAuthorized/index.js +18 -0
- package/dist/Components/Paginator/index.d.ts +7 -0
- package/dist/Components/Paginator/index.js +156 -0
- package/dist/Components/ProtectedRoute/index.d.ts +8 -0
- package/dist/Components/ProtectedRoute/index.js +32 -0
- package/dist/Components/index.d.ts +7 -0
- package/dist/Components/index.js +16 -0
- package/dist/Container-BLjzOisH.js +22 -0
- package/dist/Context/AnalyticsContext.d.ts +9 -0
- package/dist/Context/AnalyticsContext.js +23 -0
- package/dist/Context/MenuContext.d.ts +15 -0
- package/dist/Context/MenuContext.js +61 -0
- package/dist/Context/RouterContext.d.ts +15 -0
- package/dist/Context/RouterContext.js +18 -0
- package/dist/Context/SessionsContext.d.ts +22 -0
- package/dist/Context/SessionsContext.js +81 -0
- package/dist/Context/index.d.ts +4 -0
- package/dist/Context/index.js +18 -0
- package/dist/HOC/WithPageVisit.d.ts +2 -0
- package/dist/HOC/WithPageVisit.js +12 -0
- package/dist/HOC/index.d.ts +1 -0
- package/dist/HOC/index.js +4 -0
- package/dist/Hooks/index.d.ts +4 -0
- package/dist/Hooks/index.js +10 -0
- package/dist/Hooks/useDebouncedValue.d.ts +1 -0
- package/dist/Hooks/useDebouncedValue.js +19 -0
- package/dist/Hooks/usePageVisibility.d.ts +1 -0
- package/dist/Hooks/usePageVisibility.js +15 -0
- package/dist/Hooks/usePaginatedQuery.d.ts +21 -0
- package/dist/Hooks/usePaginatedQuery.js +38 -0
- package/dist/Hooks/useQuery.d.ts +15 -0
- package/dist/Hooks/useQuery.js +22 -0
- package/dist/Model/Credentials.d.ts +5 -0
- package/dist/Model/Credentials.js +13 -0
- package/dist/Model/Menu.d.ts +28 -0
- package/dist/Model/Menu.js +1 -0
- package/dist/Model/PagedModel.d.ts +5 -0
- package/dist/Model/PagedModel.js +8 -0
- package/dist/Model/ResponseModel.d.ts +10 -0
- package/dist/Model/ResponseModel.js +14 -0
- package/dist/Model/Router.d.ts +3 -0
- package/dist/Model/Router.js +9 -0
- package/dist/Model/SessionUser.d.ts +8 -0
- package/dist/Model/SessionUser.js +1 -0
- package/dist/Model/SingInResponse.d.ts +4 -0
- package/dist/Model/SingInResponse.js +1 -0
- package/dist/Model/UserRegistration.d.ts +6 -0
- package/dist/Model/UserRegistration.js +9 -0
- package/dist/Model/index.d.ts +8 -0
- package/dist/Model/index.js +12 -0
- package/dist/Nav-CdxSljzW.js +144 -0
- package/dist/NavDropdown-AuV3RgfC.js +1764 -0
- package/dist/NavLink-ebvp1HCw.js +173 -0
- package/dist/SubHeader-DNc4qWBV.js +481 -0
- package/dist/ThemeProvider-Q3gZ4GF2.js +72 -0
- package/dist/assets/index.css +1 -0
- package/dist/jsx-runtime-Drh4NO5G.js +633 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.js +54 -0
- package/dist/useEventCallback-Bfo0-hwZ.js +16 -0
- package/dist/useMergedRefs-BpAaCckn.js +16 -0
- package/dist/useWindow-rGE2GXIv.js +118 -0
- package/package.json +50 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { u as c } from "./useEventCallback-Bfo0-hwZ.js";
|
|
3
|
+
import { u as f } from "./Button-DWo2Fl71.js";
|
|
4
|
+
import { j as a } from "./jsx-runtime-Drh4NO5G.js";
|
|
5
|
+
const l = ["onKeyDown"];
|
|
6
|
+
function p(o, e) {
|
|
7
|
+
if (o == null) return {};
|
|
8
|
+
var t = {};
|
|
9
|
+
for (var n in o) if ({}.hasOwnProperty.call(o, n)) {
|
|
10
|
+
if (e.indexOf(n) >= 0) continue;
|
|
11
|
+
t[n] = o[n];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function m(o) {
|
|
16
|
+
return !o || o.trim() === "#";
|
|
17
|
+
}
|
|
18
|
+
const j = /* @__PURE__ */ u.forwardRef((o, e) => {
|
|
19
|
+
let {
|
|
20
|
+
onKeyDown: t
|
|
21
|
+
} = o, n = p(o, l);
|
|
22
|
+
const [r] = f(Object.assign({
|
|
23
|
+
tagName: "a"
|
|
24
|
+
}, n)), i = c((s) => {
|
|
25
|
+
r.onKeyDown(s), t == null || t(s);
|
|
26
|
+
});
|
|
27
|
+
return m(n.href) || n.role === "button" ? /* @__PURE__ */ a.jsx("a", Object.assign({
|
|
28
|
+
ref: e
|
|
29
|
+
}, n, r, {
|
|
30
|
+
onKeyDown: i
|
|
31
|
+
})) : /* @__PURE__ */ a.jsx("a", Object.assign({
|
|
32
|
+
ref: e
|
|
33
|
+
}, n, {
|
|
34
|
+
onKeyDown: t
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
j.displayName = "Anchor";
|
|
38
|
+
export {
|
|
39
|
+
j as A
|
|
40
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { j as b } from "./jsx-runtime-Drh4NO5G.js";
|
|
3
|
+
const x = ["as", "disabled"];
|
|
4
|
+
function j(n, t) {
|
|
5
|
+
if (n == null) return {};
|
|
6
|
+
var o = {};
|
|
7
|
+
for (var u in n) if ({}.hasOwnProperty.call(n, u)) {
|
|
8
|
+
if (t.indexOf(u) >= 0) continue;
|
|
9
|
+
o[u] = n[u];
|
|
10
|
+
}
|
|
11
|
+
return o;
|
|
12
|
+
}
|
|
13
|
+
function y(n) {
|
|
14
|
+
return !n || n.trim() === "#";
|
|
15
|
+
}
|
|
16
|
+
function P({
|
|
17
|
+
tagName: n,
|
|
18
|
+
disabled: t,
|
|
19
|
+
href: o,
|
|
20
|
+
target: u,
|
|
21
|
+
rel: e,
|
|
22
|
+
role: r,
|
|
23
|
+
onClick: s,
|
|
24
|
+
tabIndex: a = 0,
|
|
25
|
+
type: p
|
|
26
|
+
}) {
|
|
27
|
+
n || (o != null || u != null || e != null ? n = "a" : n = "button");
|
|
28
|
+
const f = {
|
|
29
|
+
tagName: n
|
|
30
|
+
};
|
|
31
|
+
if (n === "button")
|
|
32
|
+
return [{
|
|
33
|
+
type: p || "button",
|
|
34
|
+
disabled: t
|
|
35
|
+
}, f];
|
|
36
|
+
const l = (i) => {
|
|
37
|
+
if ((t || n === "a" && y(o)) && i.preventDefault(), t) {
|
|
38
|
+
i.stopPropagation();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
s == null || s(i);
|
|
42
|
+
}, c = (i) => {
|
|
43
|
+
i.key === " " && (i.preventDefault(), l(i));
|
|
44
|
+
};
|
|
45
|
+
return n === "a" && (o || (o = "#"), t && (o = void 0)), [{
|
|
46
|
+
role: r ?? "button",
|
|
47
|
+
// explicitly undefined so that it overrides the props disabled in a spread
|
|
48
|
+
// e.g. <Tag {...props} {...hookProps} />
|
|
49
|
+
disabled: void 0,
|
|
50
|
+
tabIndex: t ? void 0 : a,
|
|
51
|
+
href: o,
|
|
52
|
+
target: n === "a" ? u : void 0,
|
|
53
|
+
"aria-disabled": t || void 0,
|
|
54
|
+
rel: n === "a" ? e : void 0,
|
|
55
|
+
onClick: l,
|
|
56
|
+
onKeyDown: c
|
|
57
|
+
}, f];
|
|
58
|
+
}
|
|
59
|
+
const w = /* @__PURE__ */ d.forwardRef((n, t) => {
|
|
60
|
+
let {
|
|
61
|
+
as: o,
|
|
62
|
+
disabled: u
|
|
63
|
+
} = n, e = j(n, x);
|
|
64
|
+
const [r, {
|
|
65
|
+
tagName: s
|
|
66
|
+
}] = P(Object.assign({
|
|
67
|
+
tagName: o,
|
|
68
|
+
disabled: u
|
|
69
|
+
}, e));
|
|
70
|
+
return /* @__PURE__ */ b.jsx(s, Object.assign({}, e, r, {
|
|
71
|
+
ref: t
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
w.displayName = "Button";
|
|
75
|
+
export {
|
|
76
|
+
w as B,
|
|
77
|
+
P as u
|
|
78
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { u as x, c as l } from "./ThemeProvider-Q3gZ4GF2.js";
|
|
2
|
+
import * as B from "react";
|
|
3
|
+
import { u as N } from "./Button-DWo2Fl71.js";
|
|
4
|
+
import { j as $ } from "./jsx-runtime-Drh4NO5G.js";
|
|
5
|
+
const j = /* @__PURE__ */ B.forwardRef(({
|
|
6
|
+
as: e,
|
|
7
|
+
bsPrefix: m,
|
|
8
|
+
variant: a = "primary",
|
|
9
|
+
size: r,
|
|
10
|
+
active: f = !1,
|
|
11
|
+
disabled: t = !1,
|
|
12
|
+
className: n,
|
|
13
|
+
...o
|
|
14
|
+
}, u) => {
|
|
15
|
+
const s = x(m, "btn"), [c, {
|
|
16
|
+
tagName: p
|
|
17
|
+
}] = N({
|
|
18
|
+
tagName: e,
|
|
19
|
+
disabled: t,
|
|
20
|
+
...o
|
|
21
|
+
}), i = p;
|
|
22
|
+
return /* @__PURE__ */ $.jsx(i, {
|
|
23
|
+
...c,
|
|
24
|
+
...o,
|
|
25
|
+
ref: u,
|
|
26
|
+
disabled: t,
|
|
27
|
+
className: l(n, s, f && "active", a && `${s}-${a}`, r && `${s}-${r}`, o.href && t && "disabled")
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
j.displayName = "Button";
|
|
31
|
+
export {
|
|
32
|
+
j as B
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare function subscribe<T>(eventName: string, listener: (event: CustomEvent<T>) => void): void;
|
|
2
|
+
declare function unsubscribe<T>(eventName: string, listener: (event: CustomEvent<T>) => void): void;
|
|
3
|
+
declare function publish<T>(eventName: string, data: T): void;
|
|
4
|
+
export declare const Events: Readonly<{
|
|
5
|
+
subscribe: typeof subscribe;
|
|
6
|
+
unsubscribe: typeof unsubscribe;
|
|
7
|
+
publish: typeof publish;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function c(e, n) {
|
|
2
|
+
document.addEventListener(e, n);
|
|
3
|
+
}
|
|
4
|
+
function s(e, n) {
|
|
5
|
+
document.removeEventListener(e, n);
|
|
6
|
+
}
|
|
7
|
+
function o(e, n) {
|
|
8
|
+
const t = new CustomEvent(e, { detail: n });
|
|
9
|
+
document.dispatchEvent(t);
|
|
10
|
+
}
|
|
11
|
+
const u = Object.freeze({
|
|
12
|
+
subscribe: c,
|
|
13
|
+
unsubscribe: s,
|
|
14
|
+
publish: o
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
u as Events
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Events';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { j as o } from "../../jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import f, { useEffect as u } from "react";
|
|
4
|
+
import "../../Context/AnalyticsContext.js";
|
|
5
|
+
import "../../Context/MenuContext.js";
|
|
6
|
+
import { useRouter as l } from "../../Context/RouterContext.js";
|
|
7
|
+
import { useSession as h } from "../../Context/SessionsContext.js";
|
|
8
|
+
import { u as g, c as x } from "../../ThemeProvider-Q3gZ4GF2.js";
|
|
9
|
+
const p = /* @__PURE__ */ d.forwardRef(({
|
|
10
|
+
bsPrefix: e,
|
|
11
|
+
variant: i,
|
|
12
|
+
animation: n = "border",
|
|
13
|
+
size: a,
|
|
14
|
+
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
15
|
+
as: t = "div",
|
|
16
|
+
className: r,
|
|
17
|
+
...m
|
|
18
|
+
}, c) => {
|
|
19
|
+
e = g(e, "spinner");
|
|
20
|
+
const s = `${e}-${n}`;
|
|
21
|
+
return /* @__PURE__ */ o.jsx(t, {
|
|
22
|
+
ref: c,
|
|
23
|
+
...m,
|
|
24
|
+
className: x(r, s, a && `${s}-${a}`, i && `text-${i}`)
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
p.displayName = "Spinner";
|
|
28
|
+
const v = ({
|
|
29
|
+
redirectPath: e,
|
|
30
|
+
children: i
|
|
31
|
+
}) => {
|
|
32
|
+
const [n, a] = f.useState(!1), { isAuthenticated: t, isLoading: r } = h(), { navigate: m } = l();
|
|
33
|
+
return u(() => {
|
|
34
|
+
if (!r && !t && !n) {
|
|
35
|
+
const c = window.location.href, s = new URLSearchParams();
|
|
36
|
+
s.set("redirectTo", encodeURIComponent(c)), a(!0), setTimeout(
|
|
37
|
+
() => m(`${e}?${s.toString()}`),
|
|
38
|
+
300
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}, [t, r, e, m, n]), r || !t ? /* @__PURE__ */ o.jsx("div", { className: "d-flex justify-content-center align-items-center w-100 h-100", children: /* @__PURE__ */ o.jsx(
|
|
42
|
+
p,
|
|
43
|
+
{
|
|
44
|
+
animation: "border",
|
|
45
|
+
variant: "primary",
|
|
46
|
+
style: { width: "3rem", height: "3rem", borderWidth: "0.5rem" }
|
|
47
|
+
}
|
|
48
|
+
) }) : /* @__PURE__ */ o.jsx(o.Fragment, { children: i });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
v as AuthWrapper
|
|
52
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConfirmationModalProps {
|
|
2
|
+
show: boolean;
|
|
3
|
+
onCancel: () => void;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
message: string;
|
|
6
|
+
confirmLabel?: string;
|
|
7
|
+
confirmButtonVariant?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
cancelButtonVariant?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const confirmationModalDefaultProps: ConfirmationModalProps;
|
|
12
|
+
export default function ConfirmationModal({ show, onCancel, onConfirm, message, confirmLabel, confirmButtonVariant, cancelButtonVariant, cancelLabel, }: ConfirmationModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { j as n } from "../../jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import { u as c, c as d, a as $e } from "../../ThemeProvider-Q3gZ4GF2.js";
|
|
3
|
+
import { c as V, u as xe, b as q, r as G, e as De, o as Fe } from "../../useWindow-rGE2GXIv.js";
|
|
4
|
+
import * as u from "react";
|
|
5
|
+
import { useRef as N, useEffect as Oe, useState as E, useMemo as be, useCallback as Ie } from "react";
|
|
6
|
+
import { A as Ue, d as He, M as ze, B as Le, F as X, g as We, t as _e } from "../../AbstractModalHeader-UzCRSxIO.js";
|
|
7
|
+
import { B as J } from "../../Button-GQJKgb76.js";
|
|
8
|
+
function Ke(e) {
|
|
9
|
+
const t = N(e);
|
|
10
|
+
return t.current = e, t;
|
|
11
|
+
}
|
|
12
|
+
function qe(e) {
|
|
13
|
+
const t = Ke(e);
|
|
14
|
+
Oe(() => () => t.current(), []);
|
|
15
|
+
}
|
|
16
|
+
var R;
|
|
17
|
+
function Q(e) {
|
|
18
|
+
if ((!R && R !== 0 || e) && V) {
|
|
19
|
+
var t = document.createElement("div");
|
|
20
|
+
t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "50px", t.style.height = "50px", t.style.overflow = "scroll", document.body.appendChild(t), R = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
21
|
+
}
|
|
22
|
+
return R;
|
|
23
|
+
}
|
|
24
|
+
function Ge() {
|
|
25
|
+
return E(null);
|
|
26
|
+
}
|
|
27
|
+
const Y = /* @__PURE__ */ u.forwardRef(({
|
|
28
|
+
className: e,
|
|
29
|
+
bsPrefix: t,
|
|
30
|
+
as: r = "div",
|
|
31
|
+
...s
|
|
32
|
+
}, o) => (t = c(t, "modal-body"), /* @__PURE__ */ n.jsx(r, {
|
|
33
|
+
ref: o,
|
|
34
|
+
className: d(e, t),
|
|
35
|
+
...s
|
|
36
|
+
})));
|
|
37
|
+
Y.displayName = "ModalBody";
|
|
38
|
+
const A = /* @__PURE__ */ u.forwardRef(({
|
|
39
|
+
bsPrefix: e,
|
|
40
|
+
className: t,
|
|
41
|
+
contentClassName: r,
|
|
42
|
+
centered: s,
|
|
43
|
+
size: o,
|
|
44
|
+
fullscreen: l,
|
|
45
|
+
children: f,
|
|
46
|
+
scrollable: m,
|
|
47
|
+
...j
|
|
48
|
+
}, C) => {
|
|
49
|
+
e = c(e, "modal");
|
|
50
|
+
const g = `${e}-dialog`, S = typeof l == "string" ? `${e}-fullscreen-${l}` : `${e}-fullscreen`;
|
|
51
|
+
return /* @__PURE__ */ n.jsx("div", {
|
|
52
|
+
...j,
|
|
53
|
+
ref: C,
|
|
54
|
+
className: d(g, t, o && `${e}-${o}`, s && `${g}-centered`, m && `${g}-scrollable`, l && S),
|
|
55
|
+
children: /* @__PURE__ */ n.jsx("div", {
|
|
56
|
+
className: d(`${e}-content`, r),
|
|
57
|
+
children: f
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
A.displayName = "ModalDialog";
|
|
62
|
+
const Z = /* @__PURE__ */ u.forwardRef(({
|
|
63
|
+
className: e,
|
|
64
|
+
bsPrefix: t,
|
|
65
|
+
as: r = "div",
|
|
66
|
+
...s
|
|
67
|
+
}, o) => (t = c(t, "modal-footer"), /* @__PURE__ */ n.jsx(r, {
|
|
68
|
+
ref: o,
|
|
69
|
+
className: d(e, t),
|
|
70
|
+
...s
|
|
71
|
+
})));
|
|
72
|
+
Z.displayName = "ModalFooter";
|
|
73
|
+
const P = /* @__PURE__ */ u.forwardRef(({
|
|
74
|
+
bsPrefix: e,
|
|
75
|
+
className: t,
|
|
76
|
+
closeLabel: r = "Close",
|
|
77
|
+
closeButton: s = !1,
|
|
78
|
+
...o
|
|
79
|
+
}, l) => (e = c(e, "modal-header"), /* @__PURE__ */ n.jsx(Ue, {
|
|
80
|
+
ref: l,
|
|
81
|
+
...o,
|
|
82
|
+
className: d(t, e),
|
|
83
|
+
closeLabel: r,
|
|
84
|
+
closeButton: s
|
|
85
|
+
})));
|
|
86
|
+
P.displayName = "ModalHeader";
|
|
87
|
+
const Je = He("h4"), ee = /* @__PURE__ */ u.forwardRef(({
|
|
88
|
+
className: e,
|
|
89
|
+
bsPrefix: t,
|
|
90
|
+
as: r = Je,
|
|
91
|
+
...s
|
|
92
|
+
}, o) => (t = c(t, "modal-title"), /* @__PURE__ */ n.jsx(r, {
|
|
93
|
+
ref: o,
|
|
94
|
+
className: d(e, t),
|
|
95
|
+
...s
|
|
96
|
+
})));
|
|
97
|
+
ee.displayName = "ModalTitle";
|
|
98
|
+
function Qe(e) {
|
|
99
|
+
return /* @__PURE__ */ n.jsx(X, {
|
|
100
|
+
...e,
|
|
101
|
+
timeout: null
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function Ve(e) {
|
|
105
|
+
return /* @__PURE__ */ n.jsx(X, {
|
|
106
|
+
...e,
|
|
107
|
+
timeout: null
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
const te = /* @__PURE__ */ u.forwardRef(({
|
|
111
|
+
bsPrefix: e,
|
|
112
|
+
className: t,
|
|
113
|
+
style: r,
|
|
114
|
+
dialogClassName: s,
|
|
115
|
+
contentClassName: o,
|
|
116
|
+
children: l,
|
|
117
|
+
dialogAs: f = A,
|
|
118
|
+
"data-bs-theme": m,
|
|
119
|
+
"aria-labelledby": j,
|
|
120
|
+
"aria-describedby": C,
|
|
121
|
+
"aria-label": g,
|
|
122
|
+
/* BaseModal props */
|
|
123
|
+
show: S = !1,
|
|
124
|
+
animation: h = !0,
|
|
125
|
+
backdrop: M = !0,
|
|
126
|
+
keyboard: ae = !0,
|
|
127
|
+
onEscapeKeyDown: $,
|
|
128
|
+
onShow: ne,
|
|
129
|
+
onHide: w,
|
|
130
|
+
container: oe,
|
|
131
|
+
autoFocus: re = !0,
|
|
132
|
+
enforceFocus: se = !0,
|
|
133
|
+
restoreFocus: le = !0,
|
|
134
|
+
restoreFocusOptions: de,
|
|
135
|
+
onEntered: ie,
|
|
136
|
+
onExit: x,
|
|
137
|
+
onExiting: ce,
|
|
138
|
+
onEnter: D,
|
|
139
|
+
onEntering: F,
|
|
140
|
+
onExited: O,
|
|
141
|
+
backdropClassName: b,
|
|
142
|
+
manager: I,
|
|
143
|
+
...ue
|
|
144
|
+
}, fe) => {
|
|
145
|
+
const [me, ge] = E({}), [he, U] = E(!1), v = N(!1), B = N(!1), p = N(null), [y, pe] = Ge(), ye = xe(fe, pe), H = q(w), Me = $e();
|
|
146
|
+
e = c(e, "modal");
|
|
147
|
+
const we = be(() => ({
|
|
148
|
+
onHide: H
|
|
149
|
+
}), [H]);
|
|
150
|
+
function z() {
|
|
151
|
+
return I || We({
|
|
152
|
+
isRTL: Me
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function L(a) {
|
|
156
|
+
if (!V) return;
|
|
157
|
+
const i = z().getScrollbarWidth() > 0, K = a.scrollHeight > Fe(a).documentElement.clientHeight;
|
|
158
|
+
ge({
|
|
159
|
+
paddingRight: i && !K ? Q() : void 0,
|
|
160
|
+
paddingLeft: !i && K ? Q() : void 0
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
const T = q(() => {
|
|
164
|
+
y && L(y.dialog);
|
|
165
|
+
});
|
|
166
|
+
qe(() => {
|
|
167
|
+
G(window, "resize", T), p.current == null || p.current();
|
|
168
|
+
});
|
|
169
|
+
const Re = () => {
|
|
170
|
+
v.current = !0;
|
|
171
|
+
}, Ne = (a) => {
|
|
172
|
+
v.current && y && a.target === y.dialog && (B.current = !0), v.current = !1;
|
|
173
|
+
}, W = () => {
|
|
174
|
+
U(!0), p.current = _e(y.dialog, () => {
|
|
175
|
+
U(!1);
|
|
176
|
+
});
|
|
177
|
+
}, je = (a) => {
|
|
178
|
+
a.target === a.currentTarget && W();
|
|
179
|
+
}, Ce = (a) => {
|
|
180
|
+
if (M === "static") {
|
|
181
|
+
je(a);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (B.current || a.target !== a.currentTarget) {
|
|
185
|
+
B.current = !1;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
w == null || w();
|
|
189
|
+
}, Se = (a) => {
|
|
190
|
+
ae ? $ == null || $(a) : (a.preventDefault(), M === "static" && W());
|
|
191
|
+
}, ve = (a, i) => {
|
|
192
|
+
a && L(a), D == null || D(a, i);
|
|
193
|
+
}, Be = (a) => {
|
|
194
|
+
p.current == null || p.current(), x == null || x(a);
|
|
195
|
+
}, Te = (a, i) => {
|
|
196
|
+
F == null || F(a, i), De(window, "resize", T);
|
|
197
|
+
}, ke = (a) => {
|
|
198
|
+
a && (a.style.display = ""), O == null || O(a), G(window, "resize", T);
|
|
199
|
+
}, Ee = Ie((a) => /* @__PURE__ */ n.jsx("div", {
|
|
200
|
+
...a,
|
|
201
|
+
className: d(`${e}-backdrop`, b, !h && "show")
|
|
202
|
+
}), [h, b, e]), _ = {
|
|
203
|
+
...r,
|
|
204
|
+
...me
|
|
205
|
+
};
|
|
206
|
+
_.display = "block";
|
|
207
|
+
const Ae = (a) => /* @__PURE__ */ n.jsx("div", {
|
|
208
|
+
role: "dialog",
|
|
209
|
+
...a,
|
|
210
|
+
style: _,
|
|
211
|
+
className: d(t, e, he && `${e}-static`, !h && "show"),
|
|
212
|
+
onClick: M ? Ce : void 0,
|
|
213
|
+
onMouseUp: Ne,
|
|
214
|
+
"data-bs-theme": m,
|
|
215
|
+
"aria-label": g,
|
|
216
|
+
"aria-labelledby": j,
|
|
217
|
+
"aria-describedby": C,
|
|
218
|
+
children: /* @__PURE__ */ n.jsx(f, {
|
|
219
|
+
...ue,
|
|
220
|
+
onMouseDown: Re,
|
|
221
|
+
className: s,
|
|
222
|
+
contentClassName: o,
|
|
223
|
+
children: l
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
return /* @__PURE__ */ n.jsx(ze.Provider, {
|
|
227
|
+
value: we,
|
|
228
|
+
children: /* @__PURE__ */ n.jsx(Le, {
|
|
229
|
+
show: S,
|
|
230
|
+
ref: ye,
|
|
231
|
+
backdrop: M,
|
|
232
|
+
container: oe,
|
|
233
|
+
keyboard: !0,
|
|
234
|
+
autoFocus: re,
|
|
235
|
+
enforceFocus: se,
|
|
236
|
+
restoreFocus: le,
|
|
237
|
+
restoreFocusOptions: de,
|
|
238
|
+
onEscapeKeyDown: Se,
|
|
239
|
+
onShow: ne,
|
|
240
|
+
onHide: w,
|
|
241
|
+
onEnter: ve,
|
|
242
|
+
onEntering: Te,
|
|
243
|
+
onEntered: ie,
|
|
244
|
+
onExit: Be,
|
|
245
|
+
onExiting: ce,
|
|
246
|
+
onExited: ke,
|
|
247
|
+
manager: z(),
|
|
248
|
+
transition: h ? Qe : void 0,
|
|
249
|
+
backdropTransition: h ? Ve : void 0,
|
|
250
|
+
renderBackdrop: Ee,
|
|
251
|
+
renderDialog: Ae
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
te.displayName = "Modal";
|
|
256
|
+
const k = Object.assign(te, {
|
|
257
|
+
Body: Y,
|
|
258
|
+
Header: P,
|
|
259
|
+
Title: ee,
|
|
260
|
+
Footer: Z,
|
|
261
|
+
Dialog: A,
|
|
262
|
+
TRANSITION_DURATION: 300,
|
|
263
|
+
BACKDROP_TRANSITION_DURATION: 150
|
|
264
|
+
}), at = Object.freeze({
|
|
265
|
+
message: "",
|
|
266
|
+
show: !1,
|
|
267
|
+
onCancel: () => {
|
|
268
|
+
},
|
|
269
|
+
onConfirm: () => {
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
function nt({
|
|
273
|
+
show: e,
|
|
274
|
+
onCancel: t,
|
|
275
|
+
onConfirm: r,
|
|
276
|
+
message: s,
|
|
277
|
+
confirmLabel: o = "Accept",
|
|
278
|
+
confirmButtonVariant: l = "primary",
|
|
279
|
+
cancelButtonVariant: f = "secondary",
|
|
280
|
+
cancelLabel: m = "Cancel"
|
|
281
|
+
}) {
|
|
282
|
+
return /* @__PURE__ */ n.jsxs(k, { show: e, onHide: t, children: [
|
|
283
|
+
/* @__PURE__ */ n.jsx(k.Body, { children: s }),
|
|
284
|
+
/* @__PURE__ */ n.jsxs(k.Footer, { children: [
|
|
285
|
+
/* @__PURE__ */ n.jsx(J, { variant: f, onClick: t, children: m }),
|
|
286
|
+
/* @__PURE__ */ n.jsx(J, { variant: l, onClick: r, children: o })
|
|
287
|
+
] })
|
|
288
|
+
] });
|
|
289
|
+
}
|
|
290
|
+
export {
|
|
291
|
+
at as confirmationModalDefaultProps,
|
|
292
|
+
nt as default
|
|
293
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { j as o } from "../../jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import '../../assets/index.css';const s = "_footer_chhcn_1", t = {
|
|
3
|
+
footer: s
|
|
4
|
+
}, c = ({ version: r = "" }) => /* @__PURE__ */ o.jsx("footer", { className: `container-fluid ${t.footer}`, children: /* @__PURE__ */ o.jsx("div", { className: "row copyright", children: /* @__PURE__ */ o.jsxs("p", { className: "mb-0", children: [
|
|
5
|
+
"©",
|
|
6
|
+
" Copyright 2023 VariaMos.",
|
|
7
|
+
r && ` ${r}`
|
|
8
|
+
] }) }) });
|
|
9
|
+
export {
|
|
10
|
+
c as Footer
|
|
11
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { j as s } from "../../jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import "../../Context/AnalyticsContext.js";
|
|
4
|
+
import { useMenu as w } from "../../Context/MenuContext.js";
|
|
5
|
+
import { useRouter as x } from "../../Context/RouterContext.js";
|
|
6
|
+
import { useSession as j } from "../../Context/SessionsContext.js";
|
|
7
|
+
import { mapToWebTarget as R } from "../../Model/Router.js";
|
|
8
|
+
import { N as a } from "../../NavDropdown-AuV3RgfC.js";
|
|
9
|
+
const E = () => {
|
|
10
|
+
const { user: o, isAuthenticated: d, logout: g } = j(), { options: t } = w(), { navigate: m } = x(), l = p(() => {
|
|
11
|
+
const i = (o == null ? void 0 : o.permissions) || [], h = (o == null ? void 0 : o.roles) || [];
|
|
12
|
+
return t != null && t.length ? t.filter((r) => {
|
|
13
|
+
var n, f;
|
|
14
|
+
if (!((n = r == null ? void 0 : r.allowedPermissions) != null && n.length) && !((f = r == null ? void 0 : r.allowedRoles) != null && f.length))
|
|
15
|
+
return !0;
|
|
16
|
+
let e = !0;
|
|
17
|
+
return r.allowedRoles && (e = e && r.allowedRoles.some((c) => h.includes(c))), r.allowedPermissions && (e = e && r.allowedPermissions.some(
|
|
18
|
+
(c) => i.includes(c)
|
|
19
|
+
)), e;
|
|
20
|
+
}) : [];
|
|
21
|
+
}, [t, o]);
|
|
22
|
+
return !(l != null && l.length) && !d ? null : /* @__PURE__ */ s.jsxs(a, { title: (o == null ? void 0 : o.name) || "Options", id: "nav-dropdown", children: [
|
|
23
|
+
l == null ? void 0 : l.map((i) => /* @__PURE__ */ s.jsx(
|
|
24
|
+
a.Item,
|
|
25
|
+
{
|
|
26
|
+
onClick: () => m(i.location, {
|
|
27
|
+
target: R(i.target)
|
|
28
|
+
}),
|
|
29
|
+
children: i.title
|
|
30
|
+
},
|
|
31
|
+
i.title
|
|
32
|
+
)),
|
|
33
|
+
d && !!(l != null && l.length) && /* @__PURE__ */ s.jsx(a.Divider, {}),
|
|
34
|
+
d && /* @__PURE__ */ s.jsx(a.Item, { onClick: g, children: "Logout" })
|
|
35
|
+
] });
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
E as HeaderOptions
|
|
39
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { j as n } from "../../jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import { useMemo as N } from "react";
|
|
3
|
+
import "../../Context/AnalyticsContext.js";
|
|
4
|
+
import "../../Context/MenuContext.js";
|
|
5
|
+
import { useRouter as R } from "../../Context/RouterContext.js";
|
|
6
|
+
import { useSession as k } from "../../Context/SessionsContext.js";
|
|
7
|
+
import { mapToWebTarget as m } from "../../Model/Router.js";
|
|
8
|
+
import { N as h } from "../../Nav-CdxSljzW.js";
|
|
9
|
+
import { N as d } from "../../NavDropdown-AuV3RgfC.js";
|
|
10
|
+
const y = ({
|
|
11
|
+
title: e,
|
|
12
|
+
type: w,
|
|
13
|
+
location: g,
|
|
14
|
+
target: x,
|
|
15
|
+
children: l
|
|
16
|
+
}) => {
|
|
17
|
+
const { user: r } = k(), { navigate: p } = R(), s = N(() => {
|
|
18
|
+
const i = (r == null ? void 0 : r.permissions) || [], j = (r == null ? void 0 : r.roles) || [];
|
|
19
|
+
return l ? l.filter((o) => {
|
|
20
|
+
var c, f;
|
|
21
|
+
if (!((c = o == null ? void 0 : o.allowedPermissions) != null && c.length) && !((f = o == null ? void 0 : o.allowedRoles) != null && f.length))
|
|
22
|
+
return !0;
|
|
23
|
+
let t = !0;
|
|
24
|
+
return o.allowedRoles && (t = t && o.allowedRoles.some((a) => j.includes(a))), o.allowedPermissions && (t = t && o.allowedPermissions.some(
|
|
25
|
+
(a) => i.includes(a)
|
|
26
|
+
)), t;
|
|
27
|
+
}) : [];
|
|
28
|
+
}, [l, r]);
|
|
29
|
+
return w === "location" ? /* @__PURE__ */ n.jsx(
|
|
30
|
+
h.Link,
|
|
31
|
+
{
|
|
32
|
+
as: "button",
|
|
33
|
+
className: "btn btn-link",
|
|
34
|
+
onClick: () => p(g, { target: m(x) }),
|
|
35
|
+
children: e
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ n.jsx(d, { title: e, children: s == null ? void 0 : s.map((i) => /* @__PURE__ */ n.jsx(
|
|
38
|
+
d.Item,
|
|
39
|
+
{
|
|
40
|
+
as: "button",
|
|
41
|
+
onClick: () => p(i.location, {
|
|
42
|
+
target: m(i.target)
|
|
43
|
+
}),
|
|
44
|
+
children: i.title
|
|
45
|
+
},
|
|
46
|
+
i.title
|
|
47
|
+
)) });
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
y as MenuItemComponent
|
|
51
|
+
};
|