bj-web-components 0.2.28 → 0.2.29
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/index.js +1 -51
- package/dist/index.mjs +49 -49
- package/dist/style.css +1 -3744
- package/dist/web/BasicInput/BInput.js +1 -208
- package/dist/web/BasicInput/BInput.mjs +132 -164
- package/dist/web/BasicInput/utils.js +1 -47
- package/dist/web/BasicInput/utils.mjs +28 -38
- package/dist/web/CategoryDropdown/CategoryDropdown.js +1 -307
- package/dist/web/CategoryDropdown/CategoryDropdown.mjs +170 -218
- package/dist/web/CheckBox/BCheckBox.js +1 -116
- package/dist/web/CheckBox/BCheckBox.mjs +70 -86
- package/dist/web/CheckBox/Group.js +1 -73
- package/dist/web/CheckBox/Group.mjs +56 -63
- package/dist/web/CheckBox/context.js +1 -5
- package/dist/web/CheckBox/context.mjs +3 -3
- package/dist/web/CheckBox/index.js +1 -8
- package/dist/web/CheckBox/index.mjs +6 -6
- package/dist/web/Dropdown/BDropdown.js +1 -186
- package/dist/web/Dropdown/BDropdown.mjs +106 -132
- package/dist/web/EmptyInputBox/EmptyInputBox.js +1 -77
- package/dist/web/EmptyInputBox/EmptyInputBox.mjs +48 -52
- package/dist/web/FileCard/FileCard.js +1 -157
- package/dist/web/FileCard/FileCard.mjs +82 -112
- package/dist/web/Icon/Icon.js +1 -9
- package/dist/web/Icon/Icon.mjs +6 -6
- package/dist/web/Input/Input.js +1 -181
- package/dist/web/Input/Input.mjs +113 -122
- package/dist/web/InputNumber/BInputNumber.js +1 -311
- package/dist/web/InputNumber/BInputNumber.mjs +167 -275
- package/dist/web/InputNumber/StepHandler.js +1 -69
- package/dist/web/InputNumber/StepHandler.mjs +32 -38
- package/dist/web/InputNumber/hooks/useCursor.js +1 -40
- package/dist/web/InputNumber/hooks/useCursor.mjs +33 -35
- package/dist/web/InputNumber/hooks/useFrame.js +1 -12
- package/dist/web/InputNumber/hooks/useFrame.mjs +6 -9
- package/dist/web/InputNumber/utils/decimal.js +1 -147
- package/dist/web/InputNumber/utils/decimal.mjs +81 -109
- package/dist/web/Modal/Modal.js +1 -84
- package/dist/web/Modal/Modal.mjs +49 -52
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.js +1 -232
- package/dist/web/OverlayScrollbar/BOverlayScrollbar.mjs +125 -206
- package/dist/web/Pagination/Pagination.js +1 -328
- package/dist/web/Pagination/Pagination.mjs +178 -254
- package/dist/web/ProductField/ProductField.js +1 -272
- package/dist/web/ProductField/ProductField.mjs +143 -190
- package/dist/web/ProductField/arrow-up.svg.js +1 -3
- package/dist/web/ProductField/arrow-up.svg.mjs +2 -2
- package/dist/web/ProductField/checkbox-no.svg.js +1 -3
- package/dist/web/ProductField/checkbox-no.svg.mjs +2 -2
- package/dist/web/ProductField/checkbox-ok.svg.js +1 -3
- package/dist/web/ProductField/checkbox-ok.svg.mjs +2 -2
- package/dist/web/ProductField/no_data_light.svg.js +1 -3
- package/dist/web/ProductField/no_data_light.svg.mjs +2 -2
- package/dist/web/ProductField/search.svg.js +1 -3
- package/dist/web/ProductField/search.svg.mjs +2 -2
- package/dist/web/ProductField/sort.svg.js +1 -3
- package/dist/web/ProductField/sort.svg.mjs +2 -2
- package/dist/web/SkuInputCard/SkuInputCard.js +1 -276
- package/dist/web/SkuInputCard/SkuInputCard.mjs +149 -188
- package/dist/web/SkuInputCard/spin_loading_red.gif.js +1 -3
- package/dist/web/SkuInputCard/spin_loading_red.gif.mjs +2 -2
- package/dist/web/Switch/Switch.js +1 -70
- package/dist/web/Switch/Switch.mjs +37 -47
- package/dist/web/Table/BTable.js +1 -950
- package/dist/web/Table/BTable.mjs +521 -767
- package/dist/web/Table/Column.js +1 -5
- package/dist/web/Table/Column.mjs +2 -2
- package/dist/web/Table/ColumnGroup.js +1 -5
- package/dist/web/Table/ColumnGroup.mjs +2 -2
- package/dist/web/Table/utils/columns.js +1 -48
- package/dist/web/Table/utils/columns.mjs +30 -35
- package/dist/web/Table/utils/sortFilter.js +1 -84
- package/dist/web/Table/utils/sortFilter.mjs +52 -73
- package/dist/web/Tabs/BTabs.js +1 -150
- package/dist/web/Tabs/BTabs.mjs +98 -118
- package/dist/web/Tabs/TabPane.js +1 -8
- package/dist/web/Tabs/TabPane.mjs +4 -4
- package/dist/web/Tooltip/ConfirmTooltip.js +1 -26
- package/dist/web/Tooltip/ConfirmTooltip.mjs +19 -20
- package/dist/web/Tooltip/ContentTooltip.js +1 -94
- package/dist/web/Tooltip/ContentTooltip.mjs +62 -72
- package/dist/web/Tooltip/ProgressTooltip.js +1 -36
- package/dist/web/Tooltip/ProgressTooltip.mjs +20 -22
- package/dist/web/Tooltip/TooltipWrapper.js +1 -12
- package/dist/web/Tooltip/TooltipWrapper.mjs +8 -8
- package/dist/web/Tooltip/useAutoPlacement.js +1 -41
- package/dist/web/Tooltip/useAutoPlacement.mjs +25 -34
- package/dist/web.js +1 -51
- package/dist/web.mjs +49 -49
- package/package.json +1 -1
|
@@ -1,329 +1,253 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect, useMemo } from "react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
1
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as T, useEffect as rt, useMemo as ct } from "react";
|
|
3
|
+
import { createPortal as dt } from "react-dom";
|
|
4
4
|
/* empty css */
|
|
5
|
-
function
|
|
6
|
-
triggerRect,
|
|
7
|
-
dropdownHeight,
|
|
8
|
-
viewportHeight
|
|
5
|
+
function pt({
|
|
6
|
+
triggerRect: v,
|
|
7
|
+
dropdownHeight: r,
|
|
8
|
+
viewportHeight: k
|
|
9
9
|
}) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
return spaceBelow < dropdownHeight && spaceAbove >= dropdownHeight ? "top" : "bottom";
|
|
10
|
+
const L = k - v.bottom, z = v.top;
|
|
11
|
+
return L < r && z >= r ? "top" : "bottom";
|
|
13
12
|
}
|
|
14
|
-
const
|
|
13
|
+
const ft = (v) => {
|
|
15
14
|
const {
|
|
16
|
-
current:
|
|
17
|
-
defaultCurrent = 1,
|
|
18
|
-
pageSize:
|
|
19
|
-
defaultPageSize = 10,
|
|
20
|
-
total = 0,
|
|
21
|
-
onChange,
|
|
22
|
-
onShowSizeChange,
|
|
23
|
-
showSizeChanger =
|
|
24
|
-
showQuickJumper =
|
|
25
|
-
pageSizeOptions = [10, 20, 50, 100],
|
|
26
|
-
disabled =
|
|
27
|
-
hideOnSinglePage =
|
|
28
|
-
showTotal,
|
|
29
|
-
size = "medium",
|
|
30
|
-
align = "start",
|
|
31
|
-
simple =
|
|
32
|
-
popupPlacement,
|
|
33
|
-
resolvePopupPlacement,
|
|
34
|
-
dropdownClassName,
|
|
35
|
-
t = (
|
|
36
|
-
className,
|
|
37
|
-
style
|
|
38
|
-
} =
|
|
39
|
-
|
|
40
|
-
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
41
|
-
const [isSizeDropdownOpen, setIsSizeDropdownOpen] = useState(false);
|
|
42
|
-
const [dropdownPlacement, setDropdownPlacement] = useState("bottom");
|
|
43
|
-
const [dropdownAnchor, setDropdownAnchor] = useState(null);
|
|
44
|
-
const sizeDropdownRef = useRef(null);
|
|
45
|
-
const dropdownPortalRef = useRef(null);
|
|
46
|
-
const current = controlledCurrent ?? internalCurrent;
|
|
47
|
-
const pageSize = controlledPageSize ?? internalPageSize;
|
|
48
|
-
const totalPages = Math.ceil(total / pageSize);
|
|
49
|
-
if (hideOnSinglePage && totalPages <= 1) {
|
|
15
|
+
current: r,
|
|
16
|
+
defaultCurrent: k = 1,
|
|
17
|
+
pageSize: L,
|
|
18
|
+
defaultPageSize: z = 10,
|
|
19
|
+
total: b = 0,
|
|
20
|
+
onChange: c,
|
|
21
|
+
onShowSizeChange: x,
|
|
22
|
+
showSizeChanger: H = !1,
|
|
23
|
+
showQuickJumper: J = !1,
|
|
24
|
+
pageSizeOptions: $ = [10, 20, 50, 100],
|
|
25
|
+
disabled: l = !1,
|
|
26
|
+
hideOnSinglePage: Q = !1,
|
|
27
|
+
showTotal: M,
|
|
28
|
+
size: W = "medium",
|
|
29
|
+
align: q = "start",
|
|
30
|
+
simple: F = !1,
|
|
31
|
+
popupPlacement: d,
|
|
32
|
+
resolvePopupPlacement: y,
|
|
33
|
+
dropdownClassName: S,
|
|
34
|
+
t: N = (t) => t,
|
|
35
|
+
className: E,
|
|
36
|
+
style: B
|
|
37
|
+
} = v, [G, O] = w(k), [K, U] = w(z), [m, g] = w(!1), [f, V] = w("bottom"), [P, X] = w(null), p = T(null), R = T(null), o = r ?? G, u = L ?? K, s = Math.ceil(b / u);
|
|
38
|
+
if (Q && s <= 1)
|
|
50
39
|
return null;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const newTotalPages = Math.ceil(total / newPageSize);
|
|
63
|
-
const newCurrent = Math.min(current, newTotalPages) || 1;
|
|
64
|
-
if (controlledPageSize === void 0) {
|
|
65
|
-
setInternalPageSize(newPageSize);
|
|
66
|
-
if (controlledCurrent === void 0) {
|
|
67
|
-
setInternalCurrent(newCurrent);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
onShowSizeChange == null ? void 0 : onShowSizeChange(newCurrent, newPageSize);
|
|
71
|
-
onChange == null ? void 0 : onChange(newCurrent, newPageSize);
|
|
72
|
-
};
|
|
73
|
-
const updateDropdownPosition = (placement) => {
|
|
74
|
-
if (!sizeDropdownRef.current) return;
|
|
75
|
-
const triggerRect = sizeDropdownRef.current.getBoundingClientRect();
|
|
76
|
-
setDropdownAnchor({
|
|
77
|
-
left: triggerRect.left + triggerRect.width / 2,
|
|
78
|
-
top: placement === "bottom" ? triggerRect.bottom + 4 : triggerRect.top - 4
|
|
40
|
+
const h = (t) => {
|
|
41
|
+
l || t < 1 || t > s || t === o || (r === void 0 && O(t), c == null || c(t, u));
|
|
42
|
+
}, Y = (t) => {
|
|
43
|
+
const n = Math.ceil(b / t), e = Math.min(o, n) || 1;
|
|
44
|
+
L === void 0 && (U(t), r === void 0 && O(e)), x == null || x(e, t), c == null || c(e, t);
|
|
45
|
+
}, D = (t) => {
|
|
46
|
+
if (!p.current) return;
|
|
47
|
+
const n = p.current.getBoundingClientRect();
|
|
48
|
+
X({
|
|
49
|
+
left: n.left + n.width / 2,
|
|
50
|
+
top: t === "bottom" ? n.bottom + 4 : n.top - 4
|
|
79
51
|
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
setIsSizeDropdownOpen(false);
|
|
52
|
+
}, _ = () => {
|
|
53
|
+
if (l) return;
|
|
54
|
+
if (m) {
|
|
55
|
+
g(!1);
|
|
85
56
|
return;
|
|
86
57
|
}
|
|
87
|
-
let
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
const viewportHeight = window.innerHeight;
|
|
92
|
-
placement = (resolvePopupPlacement == null ? void 0 : resolvePopupPlacement({ triggerRect, dropdownHeight, viewportHeight })) ?? defaultResolvePopupPlacement({ triggerRect, dropdownHeight, viewportHeight });
|
|
93
|
-
setDropdownPlacement(placement);
|
|
58
|
+
let t = f;
|
|
59
|
+
if (d === void 0 && p.current) {
|
|
60
|
+
const n = p.current.getBoundingClientRect(), e = $.length * 40 + 8, C = window.innerHeight;
|
|
61
|
+
t = (y == null ? void 0 : y({ triggerRect: n, dropdownHeight: e, viewportHeight: C })) ?? pt({ triggerRect: n, dropdownHeight: e, viewportHeight: C }), V(t);
|
|
94
62
|
}
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
D(d ?? t), g(!0);
|
|
64
|
+
}, tt = (t) => {
|
|
65
|
+
Y(t), g(!1);
|
|
97
66
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
setIsSizeDropdownOpen(false);
|
|
110
|
-
};
|
|
111
|
-
const handleScroll = () => setIsSizeDropdownOpen(false);
|
|
112
|
-
const handleResize = () => updateDropdownPosition(popupPlacement ?? dropdownPlacement);
|
|
113
|
-
if (isSizeDropdownOpen) {
|
|
114
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
115
|
-
document.addEventListener("scroll", handleScroll, true);
|
|
116
|
-
window.addEventListener("resize", handleResize);
|
|
117
|
-
return () => {
|
|
118
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
119
|
-
document.removeEventListener("scroll", handleScroll, true);
|
|
120
|
-
window.removeEventListener("resize", handleResize);
|
|
67
|
+
rt(() => {
|
|
68
|
+
const t = (C) => {
|
|
69
|
+
var Z, A;
|
|
70
|
+
const I = C.target;
|
|
71
|
+
(Z = p.current) != null && Z.contains(I) || (A = R.current) != null && A.contains(I) || g(!1);
|
|
72
|
+
}, n = () => g(!1), e = () => D(d ?? f);
|
|
73
|
+
if (m)
|
|
74
|
+
return document.addEventListener("mousedown", t), document.addEventListener("scroll", n, !0), window.addEventListener("resize", e), () => {
|
|
75
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("scroll", n, !0), window.removeEventListener("resize", e);
|
|
121
76
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
}, [m, d, f]);
|
|
78
|
+
const et = (t) => {
|
|
79
|
+
const n = parseInt(t.target.value);
|
|
80
|
+
!isNaN(n) && n >= 1 && n <= s && h(n);
|
|
81
|
+
}, nt = ct(() => {
|
|
82
|
+
const t = [];
|
|
83
|
+
if (s <= 7)
|
|
84
|
+
for (let e = 1; e <= s; e++)
|
|
85
|
+
t.push(e);
|
|
86
|
+
else if (o <= 4) {
|
|
87
|
+
for (let e = 1; e <= 5; e++)
|
|
88
|
+
t.push(e);
|
|
89
|
+
t.push("..."), t.push(s);
|
|
90
|
+
} else if (o >= s - 3) {
|
|
91
|
+
t.push(1), t.push("...");
|
|
92
|
+
for (let e = s - 4; e <= s; e++)
|
|
93
|
+
t.push(e);
|
|
137
94
|
} else {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
pages.push("...");
|
|
143
|
-
pages.push(totalPages);
|
|
144
|
-
} else if (current >= totalPages - 3) {
|
|
145
|
-
pages.push(1);
|
|
146
|
-
pages.push("...");
|
|
147
|
-
for (let i = totalPages - 4; i <= totalPages; i++) {
|
|
148
|
-
pages.push(i);
|
|
149
|
-
}
|
|
150
|
-
} else {
|
|
151
|
-
pages.push(1);
|
|
152
|
-
pages.push("...");
|
|
153
|
-
for (let i = current - 1; i <= current + 1; i++) {
|
|
154
|
-
pages.push(i);
|
|
155
|
-
}
|
|
156
|
-
pages.push("...");
|
|
157
|
-
pages.push(totalPages);
|
|
158
|
-
}
|
|
95
|
+
t.push(1), t.push("...");
|
|
96
|
+
for (let e = o - 1; e <= o + 1; e++)
|
|
97
|
+
t.push(e);
|
|
98
|
+
t.push("..."), t.push(s);
|
|
159
99
|
}
|
|
160
|
-
return
|
|
161
|
-
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
100
|
+
return t;
|
|
101
|
+
}, [o, s]), it = (o - 1) * u + 1, ot = Math.min(o * u, b), st = `pagination-${W}`, at = `pagination-${q}`, j = l ? "pagination-disabled" : "", lt = (t, n) => t === "..." ? /* @__PURE__ */ i("span", { className: "pagination-item pagination-ellipsis", children: "..." }, `ellipsis-${n}`) : /* @__PURE__ */ i(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
className: `pagination-item ${t === o ? "pagination-item-active" : ""}`,
|
|
106
|
+
onClick: () => h(t),
|
|
107
|
+
disabled: l,
|
|
108
|
+
children: t
|
|
109
|
+
},
|
|
110
|
+
t
|
|
111
|
+
);
|
|
112
|
+
return F ? /* @__PURE__ */ i(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: `pagination pagination-simple ${j} ${E || ""}`,
|
|
116
|
+
style: B,
|
|
117
|
+
children: /* @__PURE__ */ a("div", { className: "pagination-simple-list", children: [
|
|
118
|
+
/* @__PURE__ */ i(
|
|
119
|
+
"button",
|
|
120
|
+
{
|
|
121
|
+
type: "button",
|
|
122
|
+
className: "pagination-simple-item pagination-simple-prev",
|
|
123
|
+
onClick: () => h(o - 1),
|
|
124
|
+
disabled: l || o === 1,
|
|
125
|
+
children: /* @__PURE__ */ i("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ i("path", { d: "M8 2L4 6L8 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ a("span", { className: "pagination-simple-text", children: [
|
|
129
|
+
o,
|
|
130
|
+
" / ",
|
|
131
|
+
s || 0
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ i(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
className: "pagination-simple-item pagination-simple-next",
|
|
138
|
+
onClick: () => h(o + 1),
|
|
139
|
+
disabled: l || o === s,
|
|
140
|
+
children: /* @__PURE__ */ i("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ i("path", { d: "M4 2L8 6L4 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] })
|
|
170
144
|
}
|
|
171
|
-
|
|
172
|
-
const activeClass = isActive ? "pagination-item-active" : "";
|
|
173
|
-
return /* @__PURE__ */ jsx(
|
|
174
|
-
"button",
|
|
175
|
-
{
|
|
176
|
-
type: "button",
|
|
177
|
-
className: `pagination-item ${activeClass}`,
|
|
178
|
-
onClick: () => handlePageChange(page),
|
|
179
|
-
disabled,
|
|
180
|
-
children: page
|
|
181
|
-
},
|
|
182
|
-
page
|
|
183
|
-
);
|
|
184
|
-
};
|
|
185
|
-
if (simple) {
|
|
186
|
-
return /* @__PURE__ */ jsx(
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
className: `pagination pagination-simple ${disabledClass} ${className || ""}`,
|
|
190
|
-
style,
|
|
191
|
-
children: /* @__PURE__ */ jsxs("div", { className: "pagination-simple-list", children: [
|
|
192
|
-
/* @__PURE__ */ jsx(
|
|
193
|
-
"button",
|
|
194
|
-
{
|
|
195
|
-
type: "button",
|
|
196
|
-
className: "pagination-simple-item pagination-simple-prev",
|
|
197
|
-
onClick: () => handlePageChange(current - 1),
|
|
198
|
-
disabled: disabled || current === 1,
|
|
199
|
-
children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M8 2L4 6L8 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
200
|
-
}
|
|
201
|
-
),
|
|
202
|
-
/* @__PURE__ */ jsxs("span", { className: "pagination-simple-text", children: [
|
|
203
|
-
current,
|
|
204
|
-
" / ",
|
|
205
|
-
totalPages || 0
|
|
206
|
-
] }),
|
|
207
|
-
/* @__PURE__ */ jsx(
|
|
208
|
-
"button",
|
|
209
|
-
{
|
|
210
|
-
type: "button",
|
|
211
|
-
className: "pagination-simple-item pagination-simple-next",
|
|
212
|
-
onClick: () => handlePageChange(current + 1),
|
|
213
|
-
disabled: disabled || current === totalPages,
|
|
214
|
-
children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M4 2L8 6L4 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
215
|
-
}
|
|
216
|
-
)
|
|
217
|
-
] })
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
return /* @__PURE__ */ jsxs(
|
|
145
|
+
) : /* @__PURE__ */ a(
|
|
222
146
|
"div",
|
|
223
147
|
{
|
|
224
|
-
className: `pagination ${
|
|
225
|
-
style,
|
|
148
|
+
className: `pagination ${st} ${at} ${j} ${E || ""}`,
|
|
149
|
+
style: B,
|
|
226
150
|
children: [
|
|
227
|
-
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
151
|
+
M && /* @__PURE__ */ i("div", { className: "pagination-total", children: M(b, [it, ot]) }),
|
|
152
|
+
/* @__PURE__ */ a("div", { className: "pagination-list", children: [
|
|
153
|
+
/* @__PURE__ */ i(
|
|
230
154
|
"button",
|
|
231
155
|
{
|
|
232
156
|
type: "button",
|
|
233
157
|
className: "pagination-item pagination-prev",
|
|
234
|
-
onClick: () =>
|
|
235
|
-
disabled:
|
|
236
|
-
children: /* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
158
|
+
onClick: () => h(o - 1),
|
|
159
|
+
disabled: l || o === 1,
|
|
160
|
+
children: /* @__PURE__ */ a("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
161
|
+
/* @__PURE__ */ i("path", { d: "M11.1749 5.57516C11.3377 5.41245 11.6014 5.41245 11.7641 5.57516C11.9268 5.73788 11.9268 6.00164 11.7641 6.16436L7.8945 10.034L11.7617 13.8366C11.9257 13.998 11.9279 14.2617 11.7666 14.4258C11.6052 14.5899 11.3414 14.592 11.1774 14.4307L7.2105 10.5299C6.93541 10.2594 6.93349 9.81648 7.20629 9.54367L11.1749 5.57516Z", fill: "#333333" }),
|
|
162
|
+
/* @__PURE__ */ i("path", { d: "M11.1749 5.57516C11.3377 5.41245 11.6014 5.41245 11.7641 5.57516C11.9268 5.73788 11.9268 6.00164 11.7641 6.16436L7.8945 10.034L11.7617 13.8366C11.9257 13.998 11.9279 14.2617 11.7666 14.4258C11.6052 14.5899 11.3414 14.592 11.1774 14.4307L7.2105 10.5299C6.93541 10.2594 6.93349 9.81648 7.20629 9.54367L11.1749 5.57516Z", fill: "black", fillOpacity: "0.2" })
|
|
239
163
|
] })
|
|
240
164
|
}
|
|
241
165
|
),
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */
|
|
166
|
+
nt.map((t, n) => lt(t, n)),
|
|
167
|
+
/* @__PURE__ */ i(
|
|
244
168
|
"button",
|
|
245
169
|
{
|
|
246
170
|
type: "button",
|
|
247
171
|
className: "pagination-item pagination-next",
|
|
248
|
-
onClick: () =>
|
|
249
|
-
disabled:
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
172
|
+
onClick: () => h(o + 1),
|
|
173
|
+
disabled: l || o === s,
|
|
174
|
+
children: /* @__PURE__ */ a("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
175
|
+
/* @__PURE__ */ i("path", { d: "M8.82507 5.57516C8.66235 5.41245 8.39859 5.41245 8.23587 5.57516C8.07315 5.73788 8.07315 6.00164 8.23587 6.16436L12.1055 10.034L8.23831 13.8366C8.07427 13.998 8.0721 14.2617 8.23343 14.4258C8.39478 14.5899 8.65856 14.592 8.82262 14.4307L12.7895 10.5299C13.0646 10.2594 13.0665 9.81648 12.7937 9.54367L8.82507 5.57516Z", fill: "#333333" }),
|
|
176
|
+
/* @__PURE__ */ i("path", { d: "M8.82507 5.57516C8.66235 5.41245 8.39859 5.41245 8.23587 5.57516C8.07315 5.73788 8.07315 6.00164 8.23587 6.16436L12.1055 10.034L8.23831 13.8366C8.07427 13.998 8.0721 14.2617 8.23343 14.4258C8.39478 14.5899 8.65856 14.592 8.82262 14.4307L12.7895 10.5299C13.0646 10.2594 13.0665 9.81648 12.7937 9.54367L8.82507 5.57516Z", fill: "black", "fill-opacity": "0.2" })
|
|
253
177
|
] })
|
|
254
178
|
}
|
|
255
179
|
)
|
|
256
180
|
] }),
|
|
257
|
-
|
|
258
|
-
/* @__PURE__ */
|
|
181
|
+
H && /* @__PURE__ */ a("div", { className: "pagination-sizer", ref: p, children: [
|
|
182
|
+
/* @__PURE__ */ a(
|
|
259
183
|
"button",
|
|
260
184
|
{
|
|
261
185
|
type: "button",
|
|
262
186
|
className: "pagination-sizer-select",
|
|
263
|
-
onClick:
|
|
264
|
-
disabled,
|
|
187
|
+
onClick: _,
|
|
188
|
+
disabled: l,
|
|
265
189
|
children: [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
190
|
+
u,
|
|
191
|
+
N("条/页"),
|
|
192
|
+
/* @__PURE__ */ a("svg", { className: `pagination-sizer-icon${m ? " pagination-sizer-icon-open" : ""}`, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
193
|
+
/* @__PURE__ */ i("path", { d: "M5.57321 8.828C5.41049 8.66528 5.41049 8.40152 5.57321 8.2388C5.73593 8.07608 5.99969 8.07608 6.1624 8.2388L10.032 12.1084L13.8347 8.24124C13.996 8.0772 14.2598 8.07503 14.4239 8.23636C14.5879 8.39771 14.5901 8.66149 14.4287 8.82555L10.5279 12.7924C10.2574 13.0675 9.81452 13.0694 9.54172 12.7966L5.57321 8.828Z", fill: "#333333" }),
|
|
194
|
+
/* @__PURE__ */ i("path", { d: "M5.57321 8.828C5.41049 8.66528 5.41049 8.40152 5.57321 8.2388C5.73593 8.07608 5.99969 8.07608 6.1624 8.2388L10.032 12.1084L13.8347 8.24124C13.996 8.0772 14.2598 8.07503 14.4239 8.23636C14.5879 8.39771 14.5901 8.66149 14.4287 8.82555L10.5279 12.7924C10.2574 13.0675 9.81452 13.0694 9.54172 12.7966L5.57321 8.828Z", fill: "black", fillOpacity: "0.2" })
|
|
271
195
|
] })
|
|
272
196
|
]
|
|
273
197
|
}
|
|
274
198
|
),
|
|
275
|
-
|
|
276
|
-
/* @__PURE__ */
|
|
199
|
+
m && P && dt(
|
|
200
|
+
/* @__PURE__ */ i(
|
|
277
201
|
"div",
|
|
278
202
|
{
|
|
279
|
-
ref:
|
|
280
|
-
className: `pagination-sizer-dropdown pagination-sizer-dropdown-${
|
|
203
|
+
ref: R,
|
|
204
|
+
className: `pagination-sizer-dropdown pagination-sizer-dropdown-${d ?? f}${S ? ` ${S}` : ""}`,
|
|
281
205
|
style: {
|
|
282
206
|
position: "fixed",
|
|
283
|
-
left:
|
|
284
|
-
top:
|
|
207
|
+
left: P.left,
|
|
208
|
+
top: P.top,
|
|
285
209
|
zIndex: 99999,
|
|
286
|
-
transform: (
|
|
210
|
+
transform: (d ?? f) === "bottom" ? "translate(-50%, 0)" : "translate(-50%, -100%)"
|
|
287
211
|
},
|
|
288
|
-
children:
|
|
212
|
+
children: $.map((t) => /* @__PURE__ */ a(
|
|
289
213
|
"button",
|
|
290
214
|
{
|
|
291
215
|
type: "button",
|
|
292
216
|
className: "pagination-sizer-option",
|
|
293
|
-
onClick: () =>
|
|
294
|
-
"data-selected":
|
|
217
|
+
onClick: () => tt(t),
|
|
218
|
+
"data-selected": t === u,
|
|
295
219
|
children: [
|
|
296
|
-
|
|
297
|
-
|
|
220
|
+
t,
|
|
221
|
+
N("条/页")
|
|
298
222
|
]
|
|
299
223
|
},
|
|
300
|
-
|
|
224
|
+
t
|
|
301
225
|
))
|
|
302
226
|
}
|
|
303
227
|
),
|
|
304
228
|
document.body
|
|
305
229
|
)
|
|
306
230
|
] }),
|
|
307
|
-
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
231
|
+
J && /* @__PURE__ */ a("div", { className: "pagination-jumper", children: [
|
|
232
|
+
/* @__PURE__ */ i("span", { children: N("跳至") }),
|
|
233
|
+
/* @__PURE__ */ i(
|
|
310
234
|
"input",
|
|
311
235
|
{
|
|
312
236
|
type: "number",
|
|
313
237
|
className: "pagination-jumper-input",
|
|
314
238
|
min: 1,
|
|
315
|
-
max:
|
|
316
|
-
onChange:
|
|
317
|
-
disabled,
|
|
239
|
+
max: s,
|
|
240
|
+
onChange: et,
|
|
241
|
+
disabled: l,
|
|
318
242
|
placeholder: ""
|
|
319
243
|
}
|
|
320
244
|
),
|
|
321
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ i("span", { children: N("页") })
|
|
322
246
|
] })
|
|
323
247
|
]
|
|
324
248
|
}
|
|
325
249
|
);
|
|
326
250
|
};
|
|
327
251
|
export {
|
|
328
|
-
|
|
252
|
+
ft as default
|
|
329
253
|
};
|