update style.jsx
This commit is contained in:
parent
51fb0695b7
commit
67cd686868
86
dist/index.js
vendored
86
dist/index.js
vendored
@ -1,8 +1,8 @@
|
|||||||
import { t as Z, a as w } from "./chunks/Pagination-LRiUo8_9.js";
|
import { t as Z, a as w } from "./chunks/Pagination-LRiUo8_9.js";
|
||||||
import { P as ht, b as mt } from "./chunks/Pagination-LRiUo8_9.js";
|
import { P as ht, b as mt } from "./chunks/Pagination-LRiUo8_9.js";
|
||||||
import { jsxs as D, jsx as u } from "react/jsx-runtime";
|
import { jsxs as z, jsx as u } from "react/jsx-runtime";
|
||||||
import { useState as F, useRef as q, useEffect as y, useCallback as x, createContext as G, useMemo as M, useContext as oe } from "react";
|
import { useState as F, useRef as q, useEffect as x, useCallback as y, createContext as G, useMemo as M, useContext as oe } from "react";
|
||||||
import { HStack as z, IconButton as Y, Button as V, Input as U, Text as T, extendTheme as ie, withDefaultColorScheme as re, ChakraProvider as Ae, Spinner as se, Box as de, VStack as L, Image as P } from "@chakra-ui/react";
|
import { HStack as D, IconButton as Y, Button as V, Input as U, Text as T, extendTheme as ie, withDefaultColorScheme as re, ChakraProvider as Ae, Spinner as se, Box as de, VStack as L, Image as P } from "@chakra-ui/react";
|
||||||
import { IoChevronForwardOutline as J, IoChevronBackOutline as k } from "react-icons/io5";
|
import { IoChevronForwardOutline as J, IoChevronBackOutline as k } from "react-icons/io5";
|
||||||
import le from "keycloak-js";
|
import le from "keycloak-js";
|
||||||
import { useQuery as Q, useQueryClient as ue, useMutation as ce, QueryClient as ae, QueryClientProvider as ge } from "@tanstack/react-query";
|
import { useQuery as Q, useQueryClient as ue, useMutation as ce, QueryClient as ae, QueryClientProvider as ge } from "@tanstack/react-query";
|
||||||
@ -17,13 +17,13 @@ const At = ({
|
|||||||
const [l, A] = F(Z(e)), [o, s] = F(!1), [C, d] = F(null), p = q(null), b = [.../* @__PURE__ */ new Set([1, e, t])].filter(
|
const [l, A] = F(Z(e)), [o, s] = F(!1), [C, d] = F(null), p = q(null), b = [.../* @__PURE__ */ new Set([1, e, t])].filter(
|
||||||
(i) => i >= 1 && i <= t
|
(i) => i >= 1 && i <= t
|
||||||
);
|
);
|
||||||
y(() => {
|
x(() => {
|
||||||
if (C !== null) {
|
if (C !== null) {
|
||||||
e === C && (d(null), s(!1), A(Z(e)));
|
e === C && (d(null), s(!1), A(Z(e)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
o || A(Z(e));
|
o || A(Z(e));
|
||||||
}, [e, o, C]), y(() => {
|
}, [e, o, C]), x(() => {
|
||||||
if (!o || !l || C !== null) return;
|
if (!o || !l || C !== null) return;
|
||||||
const i = parseInt(w(l), 10);
|
const i = parseInt(w(l), 10);
|
||||||
if (isNaN(i)) return;
|
if (isNaN(i)) return;
|
||||||
@ -51,8 +51,8 @@ const At = ({
|
|||||||
const I = Math.min(Math.max(i, 1), t);
|
const I = Math.min(Math.max(i, 1), t);
|
||||||
I !== e ? (d(I), A(Z(I)), r(I)) : (A(Z(e)), s(!1), d(null)), (g = p.current) == null || g.blur();
|
I !== e ? (d(I), A(Z(I)), r(I)) : (A(Z(e)), s(!1), d(null)), (g = p.current) == null || g.blur();
|
||||||
};
|
};
|
||||||
return t === 0 || !n ? null : /* @__PURE__ */ D(
|
return t === 0 || !n ? null : /* @__PURE__ */ z(
|
||||||
z,
|
D,
|
||||||
{
|
{
|
||||||
justifyContent: "space-around",
|
justifyContent: "space-around",
|
||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
@ -63,7 +63,7 @@ const At = ({
|
|||||||
borderColor: "blue.200",
|
borderColor: "blue.200",
|
||||||
w: "100%",
|
w: "100%",
|
||||||
children: [
|
children: [
|
||||||
/* @__PURE__ */ D(z, { spacing: 2, alignItems: "center", justifyContent: "center", children: [
|
/* @__PURE__ */ z(D, { spacing: 2, alignItems: "center", justifyContent: "center", children: [
|
||||||
/* @__PURE__ */ u(
|
/* @__PURE__ */ u(
|
||||||
Y,
|
Y,
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ const At = ({
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
] }),
|
] }),
|
||||||
/* @__PURE__ */ D(z, { spacing: 2, children: [
|
/* @__PURE__ */ z(D, { spacing: 2, children: [
|
||||||
/* @__PURE__ */ u(T, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }),
|
/* @__PURE__ */ u(T, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }),
|
||||||
/* @__PURE__ */ u(T, { children: Z(n) })
|
/* @__PURE__ */ u(T, { children: Z(n) })
|
||||||
] })
|
] })
|
||||||
@ -147,13 +147,13 @@ const At = ({
|
|||||||
totalCount: n,
|
totalCount: n,
|
||||||
onPageChange: r
|
onPageChange: r
|
||||||
}) => {
|
}) => {
|
||||||
const [l, A] = F(""), [o, s] = F(!1), [C, d] = F(null), p = q(null), b = C ?? e, h = x(
|
const [l, A] = F(""), [o, s] = F(!1), [C, d] = F(null), p = q(null), b = C ?? e, h = y(
|
||||||
(m) => {
|
(m) => {
|
||||||
const E = Math.min(Math.max(m, 1), t);
|
const E = Math.min(Math.max(m, 1), t);
|
||||||
s(!1), A(""), d(null), E !== e && r(E);
|
s(!1), A(""), d(null), E !== e && r(E);
|
||||||
},
|
},
|
||||||
[e, t, r]
|
[e, t, r]
|
||||||
), i = x(() => {
|
), i = y(() => {
|
||||||
if (!l) {
|
if (!l) {
|
||||||
s(!1), A(""), d(null);
|
s(!1), A(""), d(null);
|
||||||
return;
|
return;
|
||||||
@ -166,12 +166,12 @@ const At = ({
|
|||||||
const E = Math.min(Math.max(m, 1), t);
|
const E = Math.min(Math.max(m, 1), t);
|
||||||
s(!1), A(""), E !== e ? (d(E), r(E)) : d(null);
|
s(!1), A(""), E !== e ? (d(E), r(E)) : d(null);
|
||||||
}, [l, e, t, r]);
|
}, [l, e, t, r]);
|
||||||
y(() => {
|
x(() => {
|
||||||
var m;
|
var m;
|
||||||
o && ((m = p.current) == null || m.focus());
|
o && ((m = p.current) == null || m.focus());
|
||||||
}, [o]), y(() => {
|
}, [o]), x(() => {
|
||||||
C !== null && e === C && d(null);
|
C !== null && e === C && d(null);
|
||||||
}, [e, C]), y(() => {
|
}, [e, C]), x(() => {
|
||||||
if (!o || !l) return;
|
if (!o || !l) return;
|
||||||
const m = setTimeout(() => {
|
const m = setTimeout(() => {
|
||||||
i();
|
i();
|
||||||
@ -196,7 +196,7 @@ const At = ({
|
|||||||
if (t === 0 || !n) return null;
|
if (t === 0 || !n) return null;
|
||||||
const g = t > 1 && b !== 1, S = t > 1 && b !== t;
|
const g = t > 1 && b !== 1, S = t > 1 && b !== t;
|
||||||
return /* @__PURE__ */ u(
|
return /* @__PURE__ */ u(
|
||||||
z,
|
D,
|
||||||
{
|
{
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
@ -206,7 +206,7 @@ const At = ({
|
|||||||
border: "1px",
|
border: "1px",
|
||||||
borderColor: "blue.200",
|
borderColor: "blue.200",
|
||||||
w: "100%",
|
w: "100%",
|
||||||
children: /* @__PURE__ */ D(z, { spacing: 2, alignItems: "center", justifyContent: "center", children: [
|
children: /* @__PURE__ */ z(D, { spacing: 2, alignItems: "center", justifyContent: "center", children: [
|
||||||
/* @__PURE__ */ u(
|
/* @__PURE__ */ u(
|
||||||
Y,
|
Y,
|
||||||
{
|
{
|
||||||
@ -290,17 +290,17 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
initOptions: n,
|
initOptions: n,
|
||||||
loading: r = null
|
loading: r = null
|
||||||
}) => {
|
}) => {
|
||||||
const [l, A] = F(!1), [o, s] = F(!1), [C, d] = F(null), p = q(!1), b = x(() => {
|
const [l, A] = F(!1), [o, s] = F(!1), [C, d] = F(null), p = q(!1), b = y(() => {
|
||||||
c && (s(!!c.authenticated), d(c.token ?? null));
|
c && (s(!!c.authenticated), d(c.token ?? null));
|
||||||
}, []);
|
}, []);
|
||||||
y(() => (p.current = !0, _({ config: t, initOptions: n }).then((g) => {
|
x(() => (p.current = !0, _({ config: t, initOptions: n }).then((g) => {
|
||||||
p.current && (s(!!g), d((c == null ? void 0 : c.token) ?? null), A(!0));
|
p.current && (s(!!g), d((c == null ? void 0 : c.token) ?? null), A(!0));
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
p.current && (s(!1), d(null), A(!0));
|
p.current && (s(!1), d(null), A(!0));
|
||||||
}), () => {
|
}), () => {
|
||||||
p.current = !1;
|
p.current = !1;
|
||||||
}), [t, n]);
|
}), [t, n]);
|
||||||
const h = x(() => c == null ? void 0 : c.login(), []), i = x((g) => c == null ? void 0 : c.logout(g), []), I = x(
|
const h = y(() => c == null ? void 0 : c.login(), []), i = y((g) => c == null ? void 0 : c.logout(g), []), I = y(
|
||||||
async (g = 30) => {
|
async (g = 30) => {
|
||||||
if (!c) return !1;
|
if (!c) return !1;
|
||||||
const S = await c.updateToken(g);
|
const S = await c.updateToken(g);
|
||||||
@ -329,16 +329,16 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
const A = Se(n), [o, s] = F(
|
const A = Se(n), [o, s] = F(
|
||||||
() => Fe(A)
|
() => Fe(A)
|
||||||
), { data: C, isLoading: d, error: p } = we(n), b = C ?? o;
|
), { data: C, isLoading: d, error: p } = we(n), b = C ?? o;
|
||||||
y(() => {
|
x(() => {
|
||||||
C && (ye(A, C), s(C));
|
C && (xe(A, C), s(C));
|
||||||
}, [C, A]);
|
}, [C, A]);
|
||||||
const h = M(
|
const h = M(
|
||||||
() => xe(b),
|
() => ye(b),
|
||||||
[b]
|
[b]
|
||||||
), i = x(
|
), i = y(
|
||||||
(g = "") => De(h, g),
|
(g = "") => ze(h, g),
|
||||||
[h]
|
[h]
|
||||||
), I = x((g = "") => !i(g), [i]), a = M(
|
), I = y((g = "") => !i(g), [i]), a = M(
|
||||||
() => ({
|
() => ({
|
||||||
user: e,
|
user: e,
|
||||||
can: i,
|
can: i,
|
||||||
@ -358,7 +358,7 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, ye = (e = v, t) => {
|
}, xe = (e = v, t) => {
|
||||||
if (!(typeof window > "u"))
|
if (!(typeof window > "u"))
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(e, JSON.stringify(t));
|
localStorage.setItem(e, JSON.stringify(t));
|
||||||
@ -370,7 +370,7 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
localStorage.removeItem(e);
|
localStorage.removeItem(e);
|
||||||
} catch {
|
} catch {
|
||||||
}
|
}
|
||||||
}, xe = (e) => e ? new Set(e.map((t) => t.name)) : /* @__PURE__ */ new Set(), De = (e, t = "") => {
|
}, ye = (e) => e ? new Set(e.map((t) => t.name)) : /* @__PURE__ */ new Set(), ze = (e, t = "") => {
|
||||||
if (!t) return !1;
|
if (!t) return !1;
|
||||||
if (e.has(t) || [...e].some((r) => r.startsWith(t))) return !0;
|
if (e.has(t) || [...e].some((r) => r.startsWith(t))) return !0;
|
||||||
let n = t;
|
let n = t;
|
||||||
@ -380,7 +380,7 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
}, ee = {
|
}, ee = {
|
||||||
all: ["permissions"],
|
all: ["permissions"],
|
||||||
list: (e) => [...ee.all, e]
|
list: (e) => [...ee.all, e]
|
||||||
}, ze = async (e) => {
|
}, De = async (e) => {
|
||||||
if (!(e != null && e.url) || !(e != null && e.clientId))
|
if (!(e != null && e.url) || !(e != null && e.clientId))
|
||||||
throw new Error("Permission config requires url and clientId.");
|
throw new Error("Permission config requires url and clientId.");
|
||||||
const t = f(), n = new URL(e.url);
|
const t = f(), n = new URL(e.url);
|
||||||
@ -401,7 +401,7 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
return e;
|
return e;
|
||||||
}, we = (e) => Q({
|
}, we = (e) => Q({
|
||||||
queryKey: ee.list(e == null ? void 0 : e.clientId),
|
queryKey: ee.list(e == null ? void 0 : e.clientId),
|
||||||
queryFn: () => ze(e),
|
queryFn: () => De(e),
|
||||||
enabled: !!(e != null && e.url) && !!(e != null && e.clientId) && H(),
|
enabled: !!(e != null && e.url) && !!(e != null && e.clientId) && H(),
|
||||||
staleTime: 1 / 0,
|
staleTime: 1 / 0,
|
||||||
refetchOnWindowFocus: !1,
|
refetchOnWindowFocus: !1,
|
||||||
@ -418,7 +418,7 @@ const pe = G(null), be = ({ url: e, realm: t, clientId: n }) => (c || (c = new l
|
|||||||
return n && t("admin") ? e : null;
|
return n && t("admin") ? e : null;
|
||||||
}, at = ({ children: e }) => {
|
}, at = ({ children: e }) => {
|
||||||
const { can: t, isLoading: n } = R();
|
const { can: t, isLoading: n } = R();
|
||||||
return y(() => {
|
return x(() => {
|
||||||
n || t("panel_access") || j();
|
n || t("panel_access") || j();
|
||||||
}, [n, t]), e;
|
}, [n, t]), e;
|
||||||
};
|
};
|
||||||
@ -551,7 +551,7 @@ function gt({
|
|||||||
}
|
}
|
||||||
function Ne() {
|
function Ne() {
|
||||||
const [e, t] = F(!1), n = q(null);
|
const [e, t] = F(!1), n = q(null);
|
||||||
return y(() => {
|
return x(() => {
|
||||||
if (process.env.NODE_ENV !== "production") return;
|
if (process.env.NODE_ENV !== "production") return;
|
||||||
let r;
|
let r;
|
||||||
const l = async () => {
|
const l = async () => {
|
||||||
@ -611,9 +611,11 @@ const Re = new ae({
|
|||||||
styles: {
|
styles: {
|
||||||
global: {
|
global: {
|
||||||
html: {
|
html: {
|
||||||
|
fontSize: "14px",
|
||||||
direction: "rtl"
|
direction: "rtl"
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
|
bg: "white",
|
||||||
direction: "rtl"
|
direction: "rtl"
|
||||||
},
|
},
|
||||||
"*": {
|
"*": {
|
||||||
@ -681,16 +683,16 @@ function Ct({
|
|||||||
r
|
r
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
if (y(() => {
|
if (x(() => {
|
||||||
i(!0);
|
i(!0);
|
||||||
}, []), y(() => {
|
}, []), x(() => {
|
||||||
h && fe(g);
|
h && fe(g);
|
||||||
}, [h, g]), !h)
|
}, [h, g]), !h)
|
||||||
return null;
|
return null;
|
||||||
let S = e;
|
let S = e;
|
||||||
return a && (S = /* @__PURE__ */ u(Ee, { config: g.permission, loading: l, children: S })), I && (S = /* @__PURE__ */ u(Ze, { config: g.keycloak, loading: l, children: S })), /* @__PURE__ */ D(Ae, { theme: Oe, children: [
|
return a && (S = /* @__PURE__ */ u(Ee, { config: g.permission, loading: l, children: S })), I && (S = /* @__PURE__ */ u(Ze, { config: g.keycloak, loading: l, children: S })), /* @__PURE__ */ z(Ae, { theme: Oe, children: [
|
||||||
/* @__PURE__ */ u(Ge, {}),
|
/* @__PURE__ */ u(Ge, {}),
|
||||||
/* @__PURE__ */ D(ge, { client: Re, children: [
|
/* @__PURE__ */ z(ge, { client: Re, children: [
|
||||||
A && /* @__PURE__ */ u(Ne, { ...o }),
|
A && /* @__PURE__ */ u(Ne, { ...o }),
|
||||||
S
|
S
|
||||||
] })
|
] })
|
||||||
@ -712,12 +714,12 @@ function Ue({ children: e, ...t }) {
|
|||||||
position: "fixed",
|
position: "fixed",
|
||||||
color: "white",
|
color: "white",
|
||||||
...t,
|
...t,
|
||||||
children: /* @__PURE__ */ u(z, { h: "100%", alignItems: "center", justifyContent: "space-between", children: e })
|
children: /* @__PURE__ */ u(D, { h: "100%", alignItems: "center", justifyContent: "space-between", children: e })
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function Le({ children: e, ...t }) {
|
function Le({ children: e, ...t }) {
|
||||||
return /* @__PURE__ */ u(z, { alignItems: "center", h: "100%", py: "10px", ...t, children: e });
|
return /* @__PURE__ */ u(D, { alignItems: "center", h: "100%", py: "10px", ...t, children: e });
|
||||||
}
|
}
|
||||||
function Pe(e) {
|
function Pe(e) {
|
||||||
return /* @__PURE__ */ u(P, { loading: "lazy", alt: "logo", maxW: "80px", maxH: "80px", ...e });
|
return /* @__PURE__ */ u(P, { loading: "lazy", alt: "logo", maxW: "80px", maxH: "80px", ...e });
|
||||||
@ -742,7 +744,7 @@ function Qe({ children: e, ...t }) {
|
|||||||
return /* @__PURE__ */ u(T, { ...t, children: e });
|
return /* @__PURE__ */ u(T, { ...t, children: e });
|
||||||
}
|
}
|
||||||
function He({ logoSrc: e = Ve, ...t }) {
|
function He({ logoSrc: e = Ve, ...t }) {
|
||||||
return /* @__PURE__ */ D(
|
return /* @__PURE__ */ z(
|
||||||
L,
|
L,
|
||||||
{
|
{
|
||||||
w: "fit-content",
|
w: "fit-content",
|
||||||
@ -777,23 +779,23 @@ export {
|
|||||||
Ee as PermissionProvider,
|
Ee as PermissionProvider,
|
||||||
st as SimplePagination,
|
st as SimplePagination,
|
||||||
te as api,
|
te as api,
|
||||||
De as checkPermission,
|
ze as checkPermission,
|
||||||
lt as clearCachedPermissions,
|
lt as clearCachedPermissions,
|
||||||
fe as configureApi,
|
fe as configureApi,
|
||||||
gt as createApi,
|
gt as createApi,
|
||||||
xe as createPermissionSet,
|
ye as createPermissionSet,
|
||||||
Ye as fetcher,
|
Ye as fetcher,
|
||||||
Me as getApi,
|
Me as getApi,
|
||||||
Fe as getCachedPermissions,
|
Fe as getCachedPermissions,
|
||||||
f as getKeycloakToken,
|
f as getKeycloakToken,
|
||||||
ze as getPermissions,
|
De as getPermissions,
|
||||||
_ as initKeycloak,
|
_ as initKeycloak,
|
||||||
H as isKeycloakAuthenticated,
|
H as isKeycloakAuthenticated,
|
||||||
me as isKeycloakInitialized,
|
me as isKeycloakInitialized,
|
||||||
dt as loginKeycloak,
|
dt as loginKeycloak,
|
||||||
j as logoutKeycloak,
|
j as logoutKeycloak,
|
||||||
ee as permissionKeys,
|
ee as permissionKeys,
|
||||||
ye as setCachedPermissions,
|
xe as setCachedPermissions,
|
||||||
w as toEnDigits,
|
w as toEnDigits,
|
||||||
Z as toFaDigits,
|
Z as toFaDigits,
|
||||||
mt as toFaNumber,
|
mt as toFaNumber,
|
||||||
|
|||||||
@ -8,9 +8,11 @@ export const theme = extendTheme(
|
|||||||
styles: {
|
styles: {
|
||||||
global: {
|
global: {
|
||||||
html: {
|
html: {
|
||||||
|
fontSize: "14px",
|
||||||
direction: "rtl",
|
direction: "rtl",
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
|
bg: "white",
|
||||||
direction: "rtl",
|
direction: "rtl",
|
||||||
},
|
},
|
||||||
"*": {
|
"*": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user