@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,173 @@
|
|
|
1
|
+
import { _ as N, d as C } from "./useWindow-rGE2GXIv.js";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useRef as P, useState as j, useCallback as O, useReducer as I, useLayoutEffect as S, useEffect as R, useContext as m } from "react";
|
|
4
|
+
import { g as A, u as _, c as B } from "./ThemeProvider-Q3gZ4GF2.js";
|
|
5
|
+
import { A as K } from "./Anchor-DJG5WYYF.js";
|
|
6
|
+
import { u as L } from "./useEventCallback-Bfo0-hwZ.js";
|
|
7
|
+
import { B as U } from "./Button-DWo2Fl71.js";
|
|
8
|
+
import { j as h } from "./jsx-runtime-Drh4NO5G.js";
|
|
9
|
+
function x() {
|
|
10
|
+
return x = Object.assign ? Object.assign.bind() : function(t) {
|
|
11
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
12
|
+
var r = arguments[e];
|
|
13
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
}, x.apply(null, arguments);
|
|
17
|
+
}
|
|
18
|
+
var p, b;
|
|
19
|
+
function T() {
|
|
20
|
+
if (b) return p;
|
|
21
|
+
b = 1;
|
|
22
|
+
var t = function(e, r, n, u, a, c, i, l) {
|
|
23
|
+
if (process.env.NODE_ENV !== "production" && r === void 0)
|
|
24
|
+
throw new Error("invariant requires an error message argument");
|
|
25
|
+
if (!e) {
|
|
26
|
+
var s;
|
|
27
|
+
if (r === void 0)
|
|
28
|
+
s = new Error(
|
|
29
|
+
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
30
|
+
);
|
|
31
|
+
else {
|
|
32
|
+
var o = [n, u, a, c, i, l], f = 0;
|
|
33
|
+
s = new Error(
|
|
34
|
+
r.replace(/%s/g, function() {
|
|
35
|
+
return o[f++];
|
|
36
|
+
})
|
|
37
|
+
), s.name = "Invariant Violation";
|
|
38
|
+
}
|
|
39
|
+
throw s.framesToPop = 1, s;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return p = t, p;
|
|
43
|
+
}
|
|
44
|
+
var q = T();
|
|
45
|
+
const ot = /* @__PURE__ */ A(q);
|
|
46
|
+
function g(t) {
|
|
47
|
+
return "default" + t.charAt(0).toUpperCase() + t.substr(1);
|
|
48
|
+
}
|
|
49
|
+
function D(t) {
|
|
50
|
+
var e = F(t, "string");
|
|
51
|
+
return typeof e == "symbol" ? e : String(e);
|
|
52
|
+
}
|
|
53
|
+
function F(t, e) {
|
|
54
|
+
if (typeof t != "object" || t === null) return t;
|
|
55
|
+
var r = t[Symbol.toPrimitive];
|
|
56
|
+
if (r !== void 0) {
|
|
57
|
+
var n = r.call(t, e);
|
|
58
|
+
if (typeof n != "object") return n;
|
|
59
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
60
|
+
}
|
|
61
|
+
return String(t);
|
|
62
|
+
}
|
|
63
|
+
function M(t, e, r) {
|
|
64
|
+
var n = P(t !== void 0), u = j(e), a = u[0], c = u[1], i = t !== void 0, l = n.current;
|
|
65
|
+
return n.current = i, !i && l && a !== e && c(e), [i ? t : a, O(function(s) {
|
|
66
|
+
for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), v = 1; v < o; v++)
|
|
67
|
+
f[v - 1] = arguments[v];
|
|
68
|
+
r && r.apply(void 0, [s].concat(f)), c(s);
|
|
69
|
+
}, [r])];
|
|
70
|
+
}
|
|
71
|
+
function at(t, e) {
|
|
72
|
+
return Object.keys(e).reduce(function(r, n) {
|
|
73
|
+
var u, a = r, c = a[g(n)], i = a[n], l = N(a, [g(n), n].map(D)), s = e[n], o = M(i, c, t[s]), f = o[0], v = o[1];
|
|
74
|
+
return x({}, l, (u = {}, u[n] = f, u[s] = v, u));
|
|
75
|
+
}, t);
|
|
76
|
+
}
|
|
77
|
+
function st() {
|
|
78
|
+
const [, t] = I((e) => e + 1, 0);
|
|
79
|
+
return t;
|
|
80
|
+
}
|
|
81
|
+
const W = /* @__PURE__ */ d.createContext(null), w = (t, e = null) => t != null ? String(t) : e || null, y = /* @__PURE__ */ d.createContext(null);
|
|
82
|
+
y.displayName = "NavContext";
|
|
83
|
+
const V = typeof global < "u" && // @ts-ignore
|
|
84
|
+
global.navigator && // @ts-ignore
|
|
85
|
+
global.navigator.product === "ReactNative", $ = typeof document < "u", it = $ || V ? S : R, z = /* @__PURE__ */ d.createContext(null);
|
|
86
|
+
z.displayName = "NavbarContext";
|
|
87
|
+
const G = /* @__PURE__ */ d.createContext(null), H = ["as", "active", "eventKey"];
|
|
88
|
+
function J(t, e) {
|
|
89
|
+
if (t == null) return {};
|
|
90
|
+
var r = {};
|
|
91
|
+
for (var n in t) if ({}.hasOwnProperty.call(t, n)) {
|
|
92
|
+
if (e.indexOf(n) >= 0) continue;
|
|
93
|
+
r[n] = t[n];
|
|
94
|
+
}
|
|
95
|
+
return r;
|
|
96
|
+
}
|
|
97
|
+
function E({
|
|
98
|
+
key: t,
|
|
99
|
+
onClick: e,
|
|
100
|
+
active: r,
|
|
101
|
+
id: n,
|
|
102
|
+
role: u,
|
|
103
|
+
disabled: a
|
|
104
|
+
}) {
|
|
105
|
+
const c = m(W), i = m(y), l = m(G);
|
|
106
|
+
let s = r;
|
|
107
|
+
const o = {
|
|
108
|
+
role: u
|
|
109
|
+
};
|
|
110
|
+
if (i) {
|
|
111
|
+
!u && i.role === "tablist" && (o.role = "tab");
|
|
112
|
+
const f = i.getControllerId(t ?? null), v = i.getControlledId(t ?? null);
|
|
113
|
+
o[C("event-key")] = t, o.id = f || n, s = r == null && t != null ? i.activeKey === t : r, (s || !(l != null && l.unmountOnExit) && !(l != null && l.mountOnEnter)) && (o["aria-controls"] = v);
|
|
114
|
+
}
|
|
115
|
+
return o.role === "tab" && (o["aria-selected"] = s, s || (o.tabIndex = -1), a && (o.tabIndex = -1, o["aria-disabled"] = !0)), o.onClick = L((f) => {
|
|
116
|
+
a || (e == null || e(f), t != null && c && !f.isPropagationStopped() && c(t, f));
|
|
117
|
+
}), [o, {
|
|
118
|
+
isActive: s
|
|
119
|
+
}];
|
|
120
|
+
}
|
|
121
|
+
const Q = /* @__PURE__ */ d.forwardRef((t, e) => {
|
|
122
|
+
let {
|
|
123
|
+
as: r = U,
|
|
124
|
+
active: n,
|
|
125
|
+
eventKey: u
|
|
126
|
+
} = t, a = J(t, H);
|
|
127
|
+
const [c, i] = E(Object.assign({
|
|
128
|
+
key: w(u, a.href),
|
|
129
|
+
active: n
|
|
130
|
+
}, a));
|
|
131
|
+
return c[C("active")] = i.isActive, /* @__PURE__ */ h.jsx(r, Object.assign({}, a, c, {
|
|
132
|
+
ref: e
|
|
133
|
+
}));
|
|
134
|
+
});
|
|
135
|
+
Q.displayName = "NavItem";
|
|
136
|
+
const X = /* @__PURE__ */ d.forwardRef(({
|
|
137
|
+
bsPrefix: t,
|
|
138
|
+
className: e,
|
|
139
|
+
as: r = K,
|
|
140
|
+
active: n,
|
|
141
|
+
eventKey: u,
|
|
142
|
+
disabled: a = !1,
|
|
143
|
+
...c
|
|
144
|
+
}, i) => {
|
|
145
|
+
t = _(t, "nav-link");
|
|
146
|
+
const [l, s] = E({
|
|
147
|
+
key: w(u, c.href),
|
|
148
|
+
active: n,
|
|
149
|
+
disabled: a,
|
|
150
|
+
...c
|
|
151
|
+
});
|
|
152
|
+
return /* @__PURE__ */ h.jsx(r, {
|
|
153
|
+
...c,
|
|
154
|
+
...l,
|
|
155
|
+
ref: i,
|
|
156
|
+
disabled: a,
|
|
157
|
+
className: B(e, t, a && "disabled", s.isActive && "active")
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
X.displayName = "NavLink";
|
|
161
|
+
export {
|
|
162
|
+
Q as N,
|
|
163
|
+
W as S,
|
|
164
|
+
G as T,
|
|
165
|
+
y as a,
|
|
166
|
+
X as b,
|
|
167
|
+
at as c,
|
|
168
|
+
z as d,
|
|
169
|
+
it as e,
|
|
170
|
+
ot as i,
|
|
171
|
+
w as m,
|
|
172
|
+
st as u
|
|
173
|
+
};
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { j as c } from "./jsx-runtime-Drh4NO5G.js";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import z, { useMemo as j, useContext as M, useState as Z, useRef as we, useEffect as Ee, useCallback as W } from "react";
|
|
4
|
+
import "./Context/AnalyticsContext.js";
|
|
5
|
+
import { useMenu as je } from "./Context/MenuContext.js";
|
|
6
|
+
import { useRouter as $e } from "./Context/RouterContext.js";
|
|
7
|
+
import { useSession as Te } from "./Context/SessionsContext.js";
|
|
8
|
+
import { c as N, u as w } from "./ThemeProvider-Q3gZ4GF2.js";
|
|
9
|
+
import { d as B, e as Ce, c as Re, S as Oe } from "./NavLink-ebvp1HCw.js";
|
|
10
|
+
import { T as V, a as I, b as q, s as J, c as be, E as P, e as L, f as ee, h as Be, A as Se, d as ke, M as He, B as De, F as Fe, i as Me, g as Le } from "./AbstractModalHeader-UzCRSxIO.js";
|
|
11
|
+
import { b as A } from "./useWindow-rGE2GXIv.js";
|
|
12
|
+
import { C as Ae } from "./Container-BLjzOisH.js";
|
|
13
|
+
import { N as K } from "./Nav-CdxSljzW.js";
|
|
14
|
+
function O(...e) {
|
|
15
|
+
return e.filter((a) => a != null).reduce((a, n) => {
|
|
16
|
+
if (typeof n != "function")
|
|
17
|
+
throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
|
|
18
|
+
return a === null ? n : function(...o) {
|
|
19
|
+
a.apply(this, o), n.apply(this, o);
|
|
20
|
+
};
|
|
21
|
+
}, null);
|
|
22
|
+
}
|
|
23
|
+
const Ge = {
|
|
24
|
+
height: ["marginTop", "marginBottom"],
|
|
25
|
+
width: ["marginLeft", "marginRight"]
|
|
26
|
+
};
|
|
27
|
+
function Qe(e, a) {
|
|
28
|
+
const n = `offset${e[0].toUpperCase()}${e.slice(1)}`, t = a[n], o = Ge[e];
|
|
29
|
+
return t + // @ts-ignore
|
|
30
|
+
parseInt(J(a, o[0]), 10) + // @ts-ignore
|
|
31
|
+
parseInt(J(a, o[1]), 10);
|
|
32
|
+
}
|
|
33
|
+
const Ue = {
|
|
34
|
+
[Be]: "collapse",
|
|
35
|
+
[ee]: "collapsing",
|
|
36
|
+
[L]: "collapsing",
|
|
37
|
+
[P]: "collapse show"
|
|
38
|
+
}, Xe = /* @__PURE__ */ z.forwardRef(({
|
|
39
|
+
onEnter: e,
|
|
40
|
+
onEntering: a,
|
|
41
|
+
onEntered: n,
|
|
42
|
+
onExit: t,
|
|
43
|
+
onExiting: o,
|
|
44
|
+
className: r,
|
|
45
|
+
children: f,
|
|
46
|
+
dimension: s = "height",
|
|
47
|
+
in: l = !1,
|
|
48
|
+
timeout: i = 300,
|
|
49
|
+
mountOnEnter: d = !1,
|
|
50
|
+
unmountOnExit: u = !1,
|
|
51
|
+
appear: g = !1,
|
|
52
|
+
getDimensionValue: x = Qe,
|
|
53
|
+
...h
|
|
54
|
+
}, E) => {
|
|
55
|
+
const p = typeof s == "function" ? s() : s, $ = j(() => O((m) => {
|
|
56
|
+
m.style[p] = "0";
|
|
57
|
+
}, e), [p, e]), C = j(() => O((m) => {
|
|
58
|
+
const T = `scroll${p[0].toUpperCase()}${p.slice(1)}`;
|
|
59
|
+
m.style[p] = `${m[T]}px`;
|
|
60
|
+
}, a), [p, a]), R = j(() => O((m) => {
|
|
61
|
+
m.style[p] = null;
|
|
62
|
+
}, n), [p, n]), S = j(() => O((m) => {
|
|
63
|
+
m.style[p] = `${x(p, m)}px`, be(m);
|
|
64
|
+
}, t), [t, x, p]), b = j(() => O((m) => {
|
|
65
|
+
m.style[p] = null;
|
|
66
|
+
}, o), [p, o]);
|
|
67
|
+
return /* @__PURE__ */ c.jsx(V, {
|
|
68
|
+
ref: E,
|
|
69
|
+
addEndListener: q,
|
|
70
|
+
...h,
|
|
71
|
+
"aria-expanded": h.role ? l : null,
|
|
72
|
+
onEnter: $,
|
|
73
|
+
onEntering: C,
|
|
74
|
+
onEntered: R,
|
|
75
|
+
onExit: S,
|
|
76
|
+
onExiting: b,
|
|
77
|
+
childRef: I(f),
|
|
78
|
+
in: l,
|
|
79
|
+
timeout: i,
|
|
80
|
+
mountOnEnter: d,
|
|
81
|
+
unmountOnExit: u,
|
|
82
|
+
appear: g,
|
|
83
|
+
children: (m, T) => /* @__PURE__ */ z.cloneElement(f, {
|
|
84
|
+
...T,
|
|
85
|
+
className: N(r, f.props.className, Ue[m], p === "width" && "collapse-horizontal")
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}), ae = /* @__PURE__ */ v.forwardRef(({
|
|
89
|
+
bsPrefix: e,
|
|
90
|
+
className: a,
|
|
91
|
+
as: n,
|
|
92
|
+
...t
|
|
93
|
+
}, o) => {
|
|
94
|
+
e = w(e, "navbar-brand");
|
|
95
|
+
const r = n || (t.href ? "a" : "span");
|
|
96
|
+
return /* @__PURE__ */ c.jsx(r, {
|
|
97
|
+
...t,
|
|
98
|
+
ref: o,
|
|
99
|
+
className: N(a, e)
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
ae.displayName = "NavbarBrand";
|
|
103
|
+
const ne = /* @__PURE__ */ v.forwardRef(({
|
|
104
|
+
children: e,
|
|
105
|
+
bsPrefix: a,
|
|
106
|
+
...n
|
|
107
|
+
}, t) => {
|
|
108
|
+
a = w(a, "navbar-collapse");
|
|
109
|
+
const o = M(B);
|
|
110
|
+
return /* @__PURE__ */ c.jsx(Xe, {
|
|
111
|
+
in: !!(o && o.expanded),
|
|
112
|
+
...n,
|
|
113
|
+
children: /* @__PURE__ */ c.jsx("div", {
|
|
114
|
+
ref: t,
|
|
115
|
+
className: a,
|
|
116
|
+
children: e
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
ne.displayName = "NavbarCollapse";
|
|
121
|
+
const te = /* @__PURE__ */ v.forwardRef(({
|
|
122
|
+
bsPrefix: e,
|
|
123
|
+
className: a,
|
|
124
|
+
children: n,
|
|
125
|
+
label: t = "Toggle navigation",
|
|
126
|
+
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
127
|
+
as: o = "button",
|
|
128
|
+
onClick: r,
|
|
129
|
+
...f
|
|
130
|
+
}, s) => {
|
|
131
|
+
e = w(e, "navbar-toggler");
|
|
132
|
+
const {
|
|
133
|
+
onToggle: l,
|
|
134
|
+
expanded: i
|
|
135
|
+
} = M(B) || {}, d = A((u) => {
|
|
136
|
+
r && r(u), l && l();
|
|
137
|
+
});
|
|
138
|
+
return o === "button" && (f.type = "button"), /* @__PURE__ */ c.jsx(o, {
|
|
139
|
+
...f,
|
|
140
|
+
ref: s,
|
|
141
|
+
onClick: d,
|
|
142
|
+
"aria-label": t,
|
|
143
|
+
className: N(a, e, !i && "collapsed"),
|
|
144
|
+
children: n || /* @__PURE__ */ c.jsx("span", {
|
|
145
|
+
className: `${e}-icon`
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
te.displayName = "NavbarToggle";
|
|
150
|
+
const F = /* @__PURE__ */ new WeakMap(), Y = (e, a) => {
|
|
151
|
+
if (!e || !a) return;
|
|
152
|
+
const n = F.get(a) || /* @__PURE__ */ new Map();
|
|
153
|
+
F.set(a, n);
|
|
154
|
+
let t = n.get(e);
|
|
155
|
+
return t || (t = a.matchMedia(e), t.refCount = 0, n.set(t.media, t)), t;
|
|
156
|
+
};
|
|
157
|
+
function _e(e, a = typeof window > "u" ? void 0 : window) {
|
|
158
|
+
const n = Y(e, a), [t, o] = Z(() => n ? n.matches : !1);
|
|
159
|
+
return Ce(() => {
|
|
160
|
+
let r = Y(e, a);
|
|
161
|
+
if (!r)
|
|
162
|
+
return o(!1);
|
|
163
|
+
let f = F.get(a);
|
|
164
|
+
const s = () => {
|
|
165
|
+
o(r.matches);
|
|
166
|
+
};
|
|
167
|
+
return r.refCount++, r.addListener(s), s(), () => {
|
|
168
|
+
r.removeListener(s), r.refCount--, r.refCount <= 0 && (f == null || f.delete(r.media)), r = void 0;
|
|
169
|
+
};
|
|
170
|
+
}, [e]), t;
|
|
171
|
+
}
|
|
172
|
+
function ze(e) {
|
|
173
|
+
const a = Object.keys(e);
|
|
174
|
+
function n(s, l) {
|
|
175
|
+
return s === l ? l : s ? `${s} and ${l}` : l;
|
|
176
|
+
}
|
|
177
|
+
function t(s) {
|
|
178
|
+
return a[Math.min(a.indexOf(s) + 1, a.length - 1)];
|
|
179
|
+
}
|
|
180
|
+
function o(s) {
|
|
181
|
+
const l = t(s);
|
|
182
|
+
let i = e[l];
|
|
183
|
+
return typeof i == "number" ? i = `${i - 0.2}px` : i = `calc(${i} - 0.2px)`, `(max-width: ${i})`;
|
|
184
|
+
}
|
|
185
|
+
function r(s) {
|
|
186
|
+
let l = e[s];
|
|
187
|
+
return typeof l == "number" && (l = `${l}px`), `(min-width: ${l})`;
|
|
188
|
+
}
|
|
189
|
+
function f(s, l, i) {
|
|
190
|
+
let d;
|
|
191
|
+
typeof s == "object" ? (d = s, i = l, l = !0) : (l = l || !0, d = {
|
|
192
|
+
[s]: l
|
|
193
|
+
});
|
|
194
|
+
let u = j(() => Object.entries(d).reduce((g, [x, h]) => ((h === "up" || h === !0) && (g = n(g, r(x))), (h === "down" || h === !0) && (g = n(g, o(x))), g), ""), [JSON.stringify(d)]);
|
|
195
|
+
return _e(u, i);
|
|
196
|
+
}
|
|
197
|
+
return f;
|
|
198
|
+
}
|
|
199
|
+
const Je = ze({
|
|
200
|
+
xs: 0,
|
|
201
|
+
sm: 576,
|
|
202
|
+
md: 768,
|
|
203
|
+
lg: 992,
|
|
204
|
+
xl: 1200,
|
|
205
|
+
xxl: 1400
|
|
206
|
+
}), se = /* @__PURE__ */ v.forwardRef(({
|
|
207
|
+
className: e,
|
|
208
|
+
bsPrefix: a,
|
|
209
|
+
as: n = "div",
|
|
210
|
+
...t
|
|
211
|
+
}, o) => (a = w(a, "offcanvas-body"), /* @__PURE__ */ c.jsx(n, {
|
|
212
|
+
ref: o,
|
|
213
|
+
className: N(e, a),
|
|
214
|
+
...t
|
|
215
|
+
})));
|
|
216
|
+
se.displayName = "OffcanvasBody";
|
|
217
|
+
const Ke = {
|
|
218
|
+
[L]: "show",
|
|
219
|
+
[P]: "show"
|
|
220
|
+
}, oe = /* @__PURE__ */ v.forwardRef(({
|
|
221
|
+
bsPrefix: e,
|
|
222
|
+
className: a,
|
|
223
|
+
children: n,
|
|
224
|
+
in: t = !1,
|
|
225
|
+
mountOnEnter: o = !1,
|
|
226
|
+
unmountOnExit: r = !1,
|
|
227
|
+
appear: f = !1,
|
|
228
|
+
...s
|
|
229
|
+
}, l) => (e = w(e, "offcanvas"), /* @__PURE__ */ c.jsx(V, {
|
|
230
|
+
ref: l,
|
|
231
|
+
addEndListener: q,
|
|
232
|
+
in: t,
|
|
233
|
+
mountOnEnter: o,
|
|
234
|
+
unmountOnExit: r,
|
|
235
|
+
appear: f,
|
|
236
|
+
...s,
|
|
237
|
+
childRef: I(n),
|
|
238
|
+
children: (i, d) => /* @__PURE__ */ v.cloneElement(n, {
|
|
239
|
+
...d,
|
|
240
|
+
className: N(a, n.props.className, (i === L || i === ee) && `${e}-toggling`, Ke[i])
|
|
241
|
+
})
|
|
242
|
+
})));
|
|
243
|
+
oe.displayName = "OffcanvasToggling";
|
|
244
|
+
const re = /* @__PURE__ */ v.forwardRef(({
|
|
245
|
+
bsPrefix: e,
|
|
246
|
+
className: a,
|
|
247
|
+
closeLabel: n = "Close",
|
|
248
|
+
closeButton: t = !1,
|
|
249
|
+
...o
|
|
250
|
+
}, r) => (e = w(e, "offcanvas-header"), /* @__PURE__ */ c.jsx(Se, {
|
|
251
|
+
ref: r,
|
|
252
|
+
...o,
|
|
253
|
+
className: N(a, e),
|
|
254
|
+
closeLabel: n,
|
|
255
|
+
closeButton: t
|
|
256
|
+
})));
|
|
257
|
+
re.displayName = "OffcanvasHeader";
|
|
258
|
+
const Ye = ke("h5"), le = /* @__PURE__ */ v.forwardRef(({
|
|
259
|
+
className: e,
|
|
260
|
+
bsPrefix: a,
|
|
261
|
+
as: n = Ye,
|
|
262
|
+
...t
|
|
263
|
+
}, o) => (a = w(a, "offcanvas-title"), /* @__PURE__ */ c.jsx(n, {
|
|
264
|
+
ref: o,
|
|
265
|
+
className: N(e, a),
|
|
266
|
+
...t
|
|
267
|
+
})));
|
|
268
|
+
le.displayName = "OffcanvasTitle";
|
|
269
|
+
function Ze(e) {
|
|
270
|
+
return /* @__PURE__ */ c.jsx(oe, {
|
|
271
|
+
...e
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
function We(e) {
|
|
275
|
+
return /* @__PURE__ */ c.jsx(Fe, {
|
|
276
|
+
...e
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const ce = /* @__PURE__ */ v.forwardRef(({
|
|
280
|
+
bsPrefix: e,
|
|
281
|
+
className: a,
|
|
282
|
+
children: n,
|
|
283
|
+
"aria-labelledby": t,
|
|
284
|
+
placement: o = "start",
|
|
285
|
+
responsive: r,
|
|
286
|
+
/* BaseModal props */
|
|
287
|
+
show: f = !1,
|
|
288
|
+
backdrop: s = !0,
|
|
289
|
+
keyboard: l = !0,
|
|
290
|
+
scroll: i = !1,
|
|
291
|
+
onEscapeKeyDown: d,
|
|
292
|
+
onShow: u,
|
|
293
|
+
onHide: g,
|
|
294
|
+
container: x,
|
|
295
|
+
autoFocus: h = !0,
|
|
296
|
+
enforceFocus: E = !0,
|
|
297
|
+
restoreFocus: p = !0,
|
|
298
|
+
restoreFocusOptions: $,
|
|
299
|
+
onEntered: C,
|
|
300
|
+
onExit: R,
|
|
301
|
+
onExiting: S,
|
|
302
|
+
onEnter: b,
|
|
303
|
+
onEntering: m,
|
|
304
|
+
onExited: T,
|
|
305
|
+
backdropClassName: G,
|
|
306
|
+
manager: Q,
|
|
307
|
+
renderStaticNode: ue = !1,
|
|
308
|
+
...pe
|
|
309
|
+
}, me) => {
|
|
310
|
+
const k = we();
|
|
311
|
+
e = w(e, "offcanvas");
|
|
312
|
+
const [U, ge] = Z(!1), H = A(g), X = Je(r || "xs", "up");
|
|
313
|
+
Ee(() => {
|
|
314
|
+
ge(r ? f && !X : f);
|
|
315
|
+
}, [f, r, X]);
|
|
316
|
+
const he = j(() => ({
|
|
317
|
+
onHide: H
|
|
318
|
+
}), [H]);
|
|
319
|
+
function ve() {
|
|
320
|
+
return Q || (i ? (k.current || (k.current = new Me({
|
|
321
|
+
handleContainerOverflow: !1
|
|
322
|
+
})), k.current) : Le());
|
|
323
|
+
}
|
|
324
|
+
const Ne = (y, ...D) => {
|
|
325
|
+
y && (y.style.visibility = "visible"), b == null || b(y, ...D);
|
|
326
|
+
}, xe = (y, ...D) => {
|
|
327
|
+
y && (y.style.visibility = ""), T == null || T(...D);
|
|
328
|
+
}, ye = W((y) => /* @__PURE__ */ c.jsx("div", {
|
|
329
|
+
...y,
|
|
330
|
+
className: N(`${e}-backdrop`, G)
|
|
331
|
+
}), [G, e]), _ = (y) => /* @__PURE__ */ c.jsx("div", {
|
|
332
|
+
...y,
|
|
333
|
+
...pe,
|
|
334
|
+
className: N(a, r ? `${e}-${r}` : e, `${e}-${o}`),
|
|
335
|
+
"aria-labelledby": t,
|
|
336
|
+
children: n
|
|
337
|
+
});
|
|
338
|
+
return /* @__PURE__ */ c.jsxs(c.Fragment, {
|
|
339
|
+
children: [!U && (r || ue) && _({}), /* @__PURE__ */ c.jsx(He.Provider, {
|
|
340
|
+
value: he,
|
|
341
|
+
children: /* @__PURE__ */ c.jsx(De, {
|
|
342
|
+
show: U,
|
|
343
|
+
ref: me,
|
|
344
|
+
backdrop: s,
|
|
345
|
+
container: x,
|
|
346
|
+
keyboard: l,
|
|
347
|
+
autoFocus: h,
|
|
348
|
+
enforceFocus: E && !i,
|
|
349
|
+
restoreFocus: p,
|
|
350
|
+
restoreFocusOptions: $,
|
|
351
|
+
onEscapeKeyDown: d,
|
|
352
|
+
onShow: u,
|
|
353
|
+
onHide: H,
|
|
354
|
+
onEnter: Ne,
|
|
355
|
+
onEntering: m,
|
|
356
|
+
onEntered: C,
|
|
357
|
+
onExit: R,
|
|
358
|
+
onExiting: S,
|
|
359
|
+
onExited: xe,
|
|
360
|
+
manager: ve(),
|
|
361
|
+
transition: Ze,
|
|
362
|
+
backdropTransition: We,
|
|
363
|
+
renderBackdrop: ye,
|
|
364
|
+
renderDialog: _
|
|
365
|
+
})
|
|
366
|
+
})]
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
ce.displayName = "Offcanvas";
|
|
370
|
+
const Ve = Object.assign(ce, {
|
|
371
|
+
Body: se,
|
|
372
|
+
Header: re,
|
|
373
|
+
Title: le
|
|
374
|
+
}), ie = /* @__PURE__ */ v.forwardRef(({
|
|
375
|
+
onHide: e,
|
|
376
|
+
...a
|
|
377
|
+
}, n) => {
|
|
378
|
+
const t = M(B), o = A(() => {
|
|
379
|
+
t == null || t.onToggle == null || t.onToggle(), e == null || e();
|
|
380
|
+
});
|
|
381
|
+
return /* @__PURE__ */ c.jsx(Ve, {
|
|
382
|
+
ref: n,
|
|
383
|
+
show: !!(t != null && t.expanded),
|
|
384
|
+
...a,
|
|
385
|
+
renderStaticNode: !0,
|
|
386
|
+
onHide: o
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
ie.displayName = "NavbarOffcanvas";
|
|
390
|
+
const fe = /* @__PURE__ */ v.forwardRef(({
|
|
391
|
+
className: e,
|
|
392
|
+
bsPrefix: a,
|
|
393
|
+
as: n = "span",
|
|
394
|
+
...t
|
|
395
|
+
}, o) => (a = w(a, "navbar-text"), /* @__PURE__ */ c.jsx(n, {
|
|
396
|
+
ref: o,
|
|
397
|
+
className: N(e, a),
|
|
398
|
+
...t
|
|
399
|
+
})));
|
|
400
|
+
fe.displayName = "NavbarText";
|
|
401
|
+
const de = /* @__PURE__ */ v.forwardRef((e, a) => {
|
|
402
|
+
const {
|
|
403
|
+
bsPrefix: n,
|
|
404
|
+
expand: t = !0,
|
|
405
|
+
variant: o = "light",
|
|
406
|
+
bg: r,
|
|
407
|
+
fixed: f,
|
|
408
|
+
sticky: s,
|
|
409
|
+
className: l,
|
|
410
|
+
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
411
|
+
as: i = "nav",
|
|
412
|
+
expanded: d,
|
|
413
|
+
onToggle: u,
|
|
414
|
+
onSelect: g,
|
|
415
|
+
collapseOnSelect: x = !1,
|
|
416
|
+
...h
|
|
417
|
+
} = Re(e, {
|
|
418
|
+
expanded: "onToggle"
|
|
419
|
+
}), E = w(n, "navbar"), p = W((...R) => {
|
|
420
|
+
g == null || g(...R), x && d && (u == null || u(!1));
|
|
421
|
+
}, [g, x, d, u]);
|
|
422
|
+
h.role === void 0 && i !== "nav" && (h.role = "navigation");
|
|
423
|
+
let $ = `${E}-expand`;
|
|
424
|
+
typeof t == "string" && ($ = `${$}-${t}`);
|
|
425
|
+
const C = j(() => ({
|
|
426
|
+
onToggle: () => u == null ? void 0 : u(!d),
|
|
427
|
+
bsPrefix: E,
|
|
428
|
+
expanded: !!d,
|
|
429
|
+
expand: t
|
|
430
|
+
}), [E, d, t, u]);
|
|
431
|
+
return /* @__PURE__ */ c.jsx(B.Provider, {
|
|
432
|
+
value: C,
|
|
433
|
+
children: /* @__PURE__ */ c.jsx(Oe.Provider, {
|
|
434
|
+
value: p,
|
|
435
|
+
children: /* @__PURE__ */ c.jsx(i, {
|
|
436
|
+
ref: a,
|
|
437
|
+
...h,
|
|
438
|
+
className: N(l, E, t && $, o && `${E}-${o}`, r && `bg-${r}`, s && `sticky-${s}`, f && `fixed-${f}`)
|
|
439
|
+
})
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
de.displayName = "Navbar";
|
|
444
|
+
const Ie = Object.assign(de, {
|
|
445
|
+
Brand: ae,
|
|
446
|
+
Collapse: ne,
|
|
447
|
+
Offcanvas: ie,
|
|
448
|
+
Text: fe,
|
|
449
|
+
Toggle: te
|
|
450
|
+
}), fa = () => {
|
|
451
|
+
const { navigate: e } = $e(), { subMenu: a } = je(), { user: n } = Te(), t = j(() => {
|
|
452
|
+
const r = (n == null ? void 0 : n.roles) || [], f = (n == null ? void 0 : n.permissions) || [];
|
|
453
|
+
return a ? a.filter((s) => {
|
|
454
|
+
var i, d;
|
|
455
|
+
if (!((i = s == null ? void 0 : s.allowedRoles) != null && i.length) && !((d = s == null ? void 0 : s.allowedPermissions) != null && d.length))
|
|
456
|
+
return !0;
|
|
457
|
+
let l = !0;
|
|
458
|
+
return s.allowedRoles && (l = l && s.allowedRoles.some(
|
|
459
|
+
(u) => r.includes(u)
|
|
460
|
+
)), s.allowedPermissions && (l = l && s.allowedPermissions.some(
|
|
461
|
+
(u) => f.includes(u)
|
|
462
|
+
)), l;
|
|
463
|
+
}) : [];
|
|
464
|
+
}, [a, n]), o = (r) => () => {
|
|
465
|
+
e(r);
|
|
466
|
+
};
|
|
467
|
+
return t.length ? /* @__PURE__ */ c.jsx(Ie, { className: "py-1 shadow-sm bg-white", children: /* @__PURE__ */ c.jsx(Ae, { children: /* @__PURE__ */ c.jsx(K, { className: "d-flex justify-content-center w-100 gap-3", children: t.map((r) => /* @__PURE__ */ c.jsx(
|
|
468
|
+
K.Link,
|
|
469
|
+
{
|
|
470
|
+
as: "button",
|
|
471
|
+
className: "btn btn-link p-0",
|
|
472
|
+
onClick: o(r.location),
|
|
473
|
+
children: r.title
|
|
474
|
+
},
|
|
475
|
+
r.location
|
|
476
|
+
)) }) }) }) : null;
|
|
477
|
+
};
|
|
478
|
+
export {
|
|
479
|
+
Ie as N,
|
|
480
|
+
fa as S
|
|
481
|
+
};
|