fix bug
This commit is contained in:
parent
f153156a66
commit
e9d96339e2
33
dist/remote/Pagination.js
vendored
33
dist/remote/Pagination.js
vendored
@ -161,7 +161,7 @@ function ge({
|
||||
}) {
|
||||
const { React: n, Button: X, HStack: x, IconButton: D, Input: te, Text: f } = I(), { useCallback: T, useEffect: z, useMemo: ne, useRef: re, useState: M } = n, H = fe(F), h = Z[H], a = H === "simple", g = H === "minimal", u = j === !0, G = Number(m), oe = Number.isFinite(G) && G > 0 ? G : 10, O = Number(e), B = Number.isFinite(O) && O > 0 ? O : 0, V = Number(E), i = Number.isFinite(V) && V > 0 ? Math.ceil(V) : Math.ceil(B / oe), l = u && i <= 0 && B <= 0, N = u && !l, s = l ? 1 : U(t, i), [P, d] = M(
|
||||
a ? "" : c(s)
|
||||
), [k, _] = M(!1), [w, b] = M(null), y = re(null), p = w ?? s, $ = B > 0, ie = ne(() => a ? [] : l ? [1] : i <= 0 ? [] : Array.from(
|
||||
), [k, S] = M(!1), [w, b] = M(null), y = re(null), p = w ?? s, $ = B > 0, ie = ne(() => a ? [] : l ? [1] : i <= 0 ? [] : Array.from(
|
||||
new Set(
|
||||
h.getPageNumbers({
|
||||
currentPage: s,
|
||||
@ -169,12 +169,12 @@ function ge({
|
||||
})
|
||||
)
|
||||
).filter((r) => r >= 1 && r <= i).sort((r, o) => r - o), [h, l, a, s, i]), R = T(() => {
|
||||
d(a ? "" : c(s)), _(!1), b(null);
|
||||
d(a ? "" : c(s)), S(!1), b(null);
|
||||
}, [a, s]), v = T(
|
||||
(r) => {
|
||||
if (u) return;
|
||||
const o = U(r, i);
|
||||
_(!1), d(a ? "" : c(s)), b(null), o !== s && C?.(o);
|
||||
S(!1), d(a ? "" : c(s)), b(null), o !== s && C?.(o);
|
||||
},
|
||||
[u, a, C, s, i]
|
||||
), W = T(() => {
|
||||
@ -189,10 +189,10 @@ function ge({
|
||||
}
|
||||
const o = U(r, i);
|
||||
if (a) {
|
||||
_(!1), d(""), o !== s ? (b(o), C?.(o)) : b(null), y.current?.blur();
|
||||
S(!1), d(""), o !== s ? (b(o), C?.(o)) : b(null), y.current?.blur();
|
||||
return;
|
||||
}
|
||||
o !== s ? (b(o), d(c(o)), C?.(o)) : (d(c(s)), _(!1), b(null)), y.current?.blur();
|
||||
o !== s ? (b(o), d(c(o)), C?.(o)) : (d(c(s)), S(!1), b(null)), y.current?.blur();
|
||||
}, [
|
||||
P,
|
||||
a,
|
||||
@ -201,7 +201,7 @@ function ge({
|
||||
s,
|
||||
i
|
||||
]), ae = T(() => {
|
||||
u || (b(null), d(""), _(!0));
|
||||
u || (b(null), d(""), S(!0));
|
||||
}, [u]), se = T((r) => {
|
||||
if (u) return;
|
||||
const o = r.target.value, ce = J(o).replace(/\D/g, "");
|
||||
@ -213,7 +213,7 @@ function ge({
|
||||
return;
|
||||
}
|
||||
if (w !== null) {
|
||||
s === w && (b(null), _(!1), d(c(s)));
|
||||
s === w && (b(null), S(!1), d(c(s)));
|
||||
return;
|
||||
}
|
||||
k || d(c(s));
|
||||
@ -226,7 +226,7 @@ function ge({
|
||||
}, 1e3);
|
||||
return () => clearTimeout(r);
|
||||
}, [W, P, k, a, w]), i <= 0 && !l) return null;
|
||||
const S = (r = 14, o) => n.createElement(he, { size: r, color: o }), K = () => {
|
||||
const _ = (r = 14, o) => n.createElement(he, { size: r, color: o }), K = () => {
|
||||
const r = n.createElement(te, {
|
||||
ref: y,
|
||||
type: "text",
|
||||
@ -236,7 +236,7 @@ function ge({
|
||||
value: g && N ? "" : P,
|
||||
readOnly: u,
|
||||
onFocus: () => {
|
||||
u || a || (_(!0), b(null), d(""));
|
||||
u || a || (S(!0), b(null), d(""));
|
||||
},
|
||||
onChange: se,
|
||||
onBlur: () => {
|
||||
@ -285,7 +285,7 @@ function ge({
|
||||
pointerEvents: "none"
|
||||
}
|
||||
},
|
||||
S(13)
|
||||
_(13)
|
||||
)
|
||||
);
|
||||
}, A = (r, o = !1) => n.createElement(
|
||||
@ -300,7 +300,7 @@ function ge({
|
||||
onClick: a && o ? ae : () => v(r),
|
||||
variant: "soft"
|
||||
},
|
||||
o && N ? S(14, "#FFFFFF") : c(r)
|
||||
o && N ? _(14, "#FFFFFF") : c(r)
|
||||
), q = () => n.createElement(
|
||||
X,
|
||||
{
|
||||
@ -313,7 +313,7 @@ function ge({
|
||||
cursor: "default",
|
||||
"aria-label": "در حال دریافت تعداد صفحات"
|
||||
},
|
||||
S(14)
|
||||
_(14)
|
||||
), le = a && i > 1 && p !== 1, ue = a && i > 1 && p !== i;
|
||||
return g ? n.createElement(
|
||||
x,
|
||||
@ -365,7 +365,7 @@ function ge({
|
||||
i > 0 && v(i);
|
||||
}
|
||||
},
|
||||
l ? S(13) : c(i)
|
||||
l ? _(13) : c(i)
|
||||
),
|
||||
n.createElement(D, {
|
||||
size: "sm",
|
||||
@ -393,7 +393,7 @@ function ge({
|
||||
n.createElement(
|
||||
f,
|
||||
{ color: "#1D2939", fontSize: "sm", fontWeight: "700" },
|
||||
l ? S(13) : c(B)
|
||||
l ? _(13) : c(B)
|
||||
),
|
||||
n.createElement(
|
||||
f,
|
||||
@ -424,7 +424,7 @@ function ge({
|
||||
n.createElement(
|
||||
f,
|
||||
null,
|
||||
l ? S(13) : c(i)
|
||||
l ? _(13) : c(i)
|
||||
)
|
||||
),
|
||||
n.createElement(
|
||||
@ -482,7 +482,7 @@ function ge({
|
||||
n.createElement(
|
||||
f,
|
||||
null,
|
||||
l ? S(13) : c(B)
|
||||
l ? _(13) : c(B)
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -521,6 +521,7 @@ class de extends HTMLElement {
|
||||
{
|
||||
theme: F || m,
|
||||
resetCSS: !1,
|
||||
disableGlobalStyle: !0,
|
||||
...C || {},
|
||||
...j || {}
|
||||
},
|
||||
|
||||
@ -792,6 +792,7 @@ class PaginationElement extends HTMLElement {
|
||||
{
|
||||
theme: theme || defaultTheme,
|
||||
resetCSS: false,
|
||||
disableGlobalStyle: true,
|
||||
...(defaultProviderProps || {}),
|
||||
...(chakraProviderProps || {}),
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user