@uoguelph/react-components 1.3.2 → 1.3.3
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/pagination.js +18 -17
- package/package.json +2 -2
package/dist/pagination.js
CHANGED
|
@@ -32,21 +32,21 @@ function Z({
|
|
|
32
32
|
page: d,
|
|
33
33
|
count: e,
|
|
34
34
|
visible: N,
|
|
35
|
-
defaultPage:
|
|
35
|
+
defaultPage: b,
|
|
36
36
|
onChange: c,
|
|
37
37
|
color: p = "yellow",
|
|
38
38
|
hideInput: $ = !1,
|
|
39
39
|
hideList: k = !1,
|
|
40
40
|
className: L
|
|
41
41
|
}) {
|
|
42
|
-
const [t, M] = y(
|
|
42
|
+
const [t, M] = y(b ?? 0), [P, j] = y(b ?? 0), C = [...Array(e).keys()], i = Math.max(Math.ceil(N), 3);
|
|
43
43
|
q(() => {
|
|
44
44
|
g(d ?? 0);
|
|
45
45
|
}, [d]);
|
|
46
46
|
const g = (r) => {
|
|
47
47
|
const v = w(r, 0, e - 1);
|
|
48
48
|
c == null || c(v), M(v);
|
|
49
|
-
}, f = (r) => /* @__PURE__ */ o(
|
|
49
|
+
}, f = (r) => /* @__PURE__ */ o(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
className: `uofg-pagination-item ${W({ active: t === r })}`,
|
|
@@ -54,11 +54,12 @@ function Z({
|
|
|
54
54
|
g(r);
|
|
55
55
|
},
|
|
56
56
|
children: r + 1
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
},
|
|
58
|
+
r
|
|
59
|
+
);
|
|
60
|
+
let s, a, u, l;
|
|
61
|
+
e <= i || e < 5 ? (s = 1, a = e - 1, u = !1, l = !1) : t < i - 1 ? (s = 1, a = i, l = !0, u = !1) : t > e - i ? (s = e - i, a = e - 1, u = !0, l = !1) : (s = t - Math.floor(i / 2), a = s + i, u = s > 1, l = a < e);
|
|
62
|
+
const { base: I, list: z, seperator: E, control: h, item: W, inputWrapper: A, goTo: R, input: T } = F({
|
|
62
63
|
slots: {
|
|
63
64
|
base: "uog:flex uog:w-full uog:flex-col uog:md:flex-row uog:gap-4 uog:items-center uog:justify-center",
|
|
64
65
|
list: "uog:flex uog:gap-4 uog:items-center uog:justify-center",
|
|
@@ -136,30 +137,30 @@ function Z({
|
|
|
136
137
|
hideInput: $ ?? !1
|
|
137
138
|
});
|
|
138
139
|
return /* @__PURE__ */ m("div", { className: `uofg-pagination ${B(I(), L)}`, children: [
|
|
139
|
-
/* @__PURE__ */ m("
|
|
140
|
-
/* @__PURE__ */ o(
|
|
140
|
+
/* @__PURE__ */ m("div", { className: `uofg-pagination-list ${z()}`, children: [
|
|
141
|
+
/* @__PURE__ */ o(
|
|
141
142
|
"button",
|
|
142
143
|
{
|
|
143
144
|
disabled: t <= 0,
|
|
144
|
-
className: `uofg-pagination-previous ${
|
|
145
|
+
className: `uofg-pagination-previous ${h()}`,
|
|
145
146
|
onClick: () => g(t - 1),
|
|
146
147
|
children: /* @__PURE__ */ o(n, { icon: _ })
|
|
147
148
|
}
|
|
148
|
-
)
|
|
149
|
+
),
|
|
149
150
|
f(0),
|
|
150
|
-
l && /* @__PURE__ */ o(n, { icon: x }),
|
|
151
|
-
C.slice(s, a).map(f),
|
|
152
151
|
u && /* @__PURE__ */ o(n, { icon: x }),
|
|
152
|
+
C.slice(s, a).map(f),
|
|
153
|
+
l && /* @__PURE__ */ o(n, { icon: x }),
|
|
153
154
|
f(e - 1),
|
|
154
|
-
/* @__PURE__ */ o(
|
|
155
|
+
/* @__PURE__ */ o(
|
|
155
156
|
"button",
|
|
156
157
|
{
|
|
157
158
|
disabled: t >= e - 1,
|
|
158
|
-
className: `uofg-pagination-next ${
|
|
159
|
+
className: `uofg-pagination-next ${h()}`,
|
|
159
160
|
onClick: () => g(t + 1),
|
|
160
161
|
children: /* @__PURE__ */ o(n, { icon: V })
|
|
161
162
|
}
|
|
162
|
-
)
|
|
163
|
+
)
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ o("span", { className: `uofg-pagination-seperator ${E()}` }),
|
|
165
166
|
/* @__PURE__ */ m("div", { className: `uofg-pagination-go-to-wrapper ${A()}`, children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoguelph/react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "University of Guelph React Components Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"bugs": {
|
|
85
85
|
"url": "https://github.com/ccswbs/uofg-components/issues"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "3b12885d82db0a5bd8f52a8a391edc5c801e420c"
|
|
88
88
|
}
|