@yamada-ui/pagination 1.1.5-next-20241126031955 → 1.1.6-next-20241126024522
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/chunk-5QYB2MRA.mjs +91 -0
- package/dist/chunk-5QYB2MRA.mjs.map +1 -0
- package/dist/{chunk-US4OATQR.mjs → chunk-IH2XPMDF.mjs} +2 -2
- package/dist/chunk-VZWGYG76.mjs +69 -0
- package/dist/chunk-VZWGYG76.mjs.map +1 -0
- package/dist/index.js +96 -306
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/pagination-icon.d.mts +10 -0
- package/dist/pagination-icon.d.ts +10 -0
- package/dist/pagination-icon.js +96 -0
- package/dist/pagination-icon.js.map +1 -0
- package/dist/pagination-icon.mjs +16 -0
- package/dist/pagination-icon.mjs.map +1 -0
- package/dist/pagination-item.js +65 -275
- package/dist/pagination-item.js.map +1 -1
- package/dist/pagination-item.mjs +2 -1
- package/dist/pagination.js +96 -306
- package/dist/pagination.js.map +1 -1
- package/dist/pagination.mjs +3 -2
- package/package.json +7 -7
- package/dist/chunk-4CVSJB46.mjs +0 -353
- package/dist/chunk-4CVSJB46.mjs.map +0 -1
- /package/dist/{chunk-US4OATQR.mjs.map → chunk-IH2XPMDF.mjs.map} +0 -0
package/dist/index.js
CHANGED
@@ -27,209 +27,81 @@ __export(src_exports, {
|
|
27
27
|
module.exports = __toCommonJS(src_exports);
|
28
28
|
|
29
29
|
// src/pagination.tsx
|
30
|
-
var
|
30
|
+
var import_core2 = require("@yamada-ui/core");
|
31
31
|
var import_use_value2 = require("@yamada-ui/use-value");
|
32
|
-
var
|
33
|
-
var import_react4 = require("react");
|
34
|
-
|
35
|
-
// src/pagination-item.tsx
|
36
|
-
var import_core6 = require("@yamada-ui/core");
|
37
|
-
|
38
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
32
|
+
var import_utils3 = require("@yamada-ui/utils");
|
39
33
|
var import_react2 = require("react");
|
40
34
|
|
41
|
-
//
|
42
|
-
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
43
|
-
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
44
|
-
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
45
|
-
}).join(" ").trim();
|
46
|
-
|
47
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
48
|
-
var import_react = require("react");
|
49
|
-
|
50
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
51
|
-
var defaultAttributes = {
|
52
|
-
xmlns: "http://www.w3.org/2000/svg",
|
53
|
-
width: 24,
|
54
|
-
height: 24,
|
55
|
-
viewBox: "0 0 24 24",
|
56
|
-
fill: "none",
|
57
|
-
stroke: "currentColor",
|
58
|
-
strokeWidth: 2,
|
59
|
-
strokeLinecap: "round",
|
60
|
-
strokeLinejoin: "round"
|
61
|
-
};
|
62
|
-
|
63
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
64
|
-
var Icon = (0, import_react.forwardRef)(
|
65
|
-
({
|
66
|
-
color = "currentColor",
|
67
|
-
size = 24,
|
68
|
-
strokeWidth = 2,
|
69
|
-
absoluteStrokeWidth,
|
70
|
-
className = "",
|
71
|
-
children,
|
72
|
-
iconNode,
|
73
|
-
...rest
|
74
|
-
}, ref) => {
|
75
|
-
return (0, import_react.createElement)(
|
76
|
-
"svg",
|
77
|
-
{
|
78
|
-
ref,
|
79
|
-
...defaultAttributes,
|
80
|
-
width: size,
|
81
|
-
height: size,
|
82
|
-
stroke: color,
|
83
|
-
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
84
|
-
className: mergeClasses("lucide", className),
|
85
|
-
...rest
|
86
|
-
},
|
87
|
-
[
|
88
|
-
...iconNode.map(([tag, attrs]) => (0, import_react.createElement)(tag, attrs)),
|
89
|
-
...Array.isArray(children) ? children : [children]
|
90
|
-
]
|
91
|
-
);
|
92
|
-
}
|
93
|
-
);
|
94
|
-
|
95
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
96
|
-
var createLucideIcon = (iconName, iconNode) => {
|
97
|
-
const Component = (0, import_react2.forwardRef)(
|
98
|
-
({ className, ...props }, ref) => (0, import_react2.createElement)(Icon, {
|
99
|
-
ref,
|
100
|
-
iconNode,
|
101
|
-
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
102
|
-
...props
|
103
|
-
})
|
104
|
-
);
|
105
|
-
Component.displayName = `${iconName}`;
|
106
|
-
return Component;
|
107
|
-
};
|
108
|
-
|
109
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.js
|
110
|
-
var ChevronLeft = createLucideIcon("ChevronLeft", [
|
111
|
-
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
112
|
-
]);
|
113
|
-
|
114
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
115
|
-
var ChevronRight = createLucideIcon("ChevronRight", [
|
116
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
117
|
-
]);
|
118
|
-
|
119
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevrons-left.js
|
120
|
-
var ChevronsLeft = createLucideIcon("ChevronsLeft", [
|
121
|
-
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
122
|
-
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
123
|
-
]);
|
124
|
-
|
125
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevrons-right.js
|
126
|
-
var ChevronsRight = createLucideIcon("ChevronsRight", [
|
127
|
-
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
128
|
-
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
129
|
-
]);
|
130
|
-
|
131
|
-
// ../../../node_modules/.pnpm/lucide-react@0.460.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/ellipsis.js
|
132
|
-
var Ellipsis = createLucideIcon("Ellipsis", [
|
133
|
-
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
134
|
-
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
135
|
-
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
136
|
-
]);
|
137
|
-
|
138
|
-
// ../lucide/src/icons/chevron-left.tsx
|
35
|
+
// src/pagination-item.tsx
|
139
36
|
var import_core = require("@yamada-ui/core");
|
37
|
+
var import_ripple = require("@yamada-ui/ripple");
|
38
|
+
var import_utils2 = require("@yamada-ui/utils");
|
39
|
+
|
40
|
+
// src/pagination-icon.tsx
|
140
41
|
var import_icon = require("@yamada-ui/icon");
|
141
|
-
var import_utils3 = require("@yamada-ui/utils");
|
142
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
143
|
-
var
|
144
|
-
({
|
145
|
-
|
43
|
+
var PaginationEllipsisIcon = (props) => {
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
45
|
+
"path",
|
146
46
|
{
|
147
|
-
|
148
|
-
|
149
|
-
className: (0, import_utils3.cx)("ui-lucide-icon", className),
|
150
|
-
...rest
|
47
|
+
d: "M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z",
|
48
|
+
fill: "currentColor"
|
151
49
|
}
|
152
|
-
)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
var
|
157
|
-
|
158
|
-
|
159
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
160
|
-
var ChevronRightIcon = (0, import_core2.forwardRef)(
|
161
|
-
({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
162
|
-
import_icon2.Icon,
|
50
|
+
) });
|
51
|
+
};
|
52
|
+
PaginationEllipsisIcon.displayName = "PaginationEllipsisIcon";
|
53
|
+
PaginationEllipsisIcon.__ui__ = "PaginationEllipsisIcon";
|
54
|
+
var PaginationFirstIcon = (props) => {
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
56
|
+
"path",
|
163
57
|
{
|
164
|
-
|
165
|
-
|
166
|
-
className: (0, import_utils4.cx)("ui-lucide-icon", className),
|
167
|
-
...rest
|
58
|
+
d: "M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z",
|
59
|
+
fill: "currentColor"
|
168
60
|
}
|
169
|
-
)
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
var
|
174
|
-
|
175
|
-
|
176
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
177
|
-
var ChevronsLeftIcon = (0, import_core3.forwardRef)(
|
178
|
-
({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
179
|
-
import_icon3.Icon,
|
61
|
+
) });
|
62
|
+
};
|
63
|
+
PaginationFirstIcon.displayName = "PaginationFirstIcon";
|
64
|
+
PaginationFirstIcon.__ui__ = "PaginationFirstIcon";
|
65
|
+
var PaginationLastIcon = (props) => {
|
66
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
67
|
+
"path",
|
180
68
|
{
|
181
|
-
|
182
|
-
|
183
|
-
className: (0, import_utils5.cx)("ui-lucide-icon", className),
|
184
|
-
...rest
|
69
|
+
d: "M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z",
|
70
|
+
fill: "currentColor"
|
185
71
|
}
|
186
|
-
)
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
var
|
191
|
-
|
192
|
-
|
193
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
194
|
-
var ChevronsRightIcon = (0, import_core4.forwardRef)(
|
195
|
-
({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
196
|
-
import_icon4.Icon,
|
72
|
+
) });
|
73
|
+
};
|
74
|
+
PaginationLastIcon.displayName = "PaginationLastIcon";
|
75
|
+
PaginationLastIcon.__ui__ = "PaginationLastIcon";
|
76
|
+
var PaginationPrevIcon = (props) => {
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
78
|
+
"path",
|
197
79
|
{
|
198
|
-
|
199
|
-
|
200
|
-
className: (0, import_utils6.cx)("ui-lucide-icon", className),
|
201
|
-
...rest
|
80
|
+
d: "M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z",
|
81
|
+
fill: "currentColor"
|
202
82
|
}
|
203
|
-
)
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
var
|
208
|
-
|
209
|
-
|
210
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
211
|
-
var EllipsisIcon = (0, import_core5.forwardRef)(
|
212
|
-
({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
213
|
-
import_icon5.Icon,
|
83
|
+
) });
|
84
|
+
};
|
85
|
+
PaginationPrevIcon.displayName = "PaginationPrevIcon";
|
86
|
+
PaginationPrevIcon.__ui__ = "PaginationPrevIcon";
|
87
|
+
var PaginationNextIcon = (props) => {
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.Icon, { viewBox: "0 0 16 16", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
89
|
+
"path",
|
214
90
|
{
|
215
|
-
|
216
|
-
|
217
|
-
className: (0, import_utils7.cx)("ui-lucide-icon", className),
|
218
|
-
...rest
|
91
|
+
d: "M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z",
|
92
|
+
fill: "currentColor"
|
219
93
|
}
|
220
|
-
)
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
var import_ripple = require("@yamada-ui/ripple");
|
225
|
-
var import_utils9 = require("@yamada-ui/utils");
|
94
|
+
) });
|
95
|
+
};
|
96
|
+
PaginationNextIcon.displayName = "PaginationNextIcon";
|
97
|
+
PaginationNextIcon.__ui__ = "PaginationNextIcon";
|
226
98
|
|
227
99
|
// src/use-pagination.ts
|
228
100
|
var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
|
229
101
|
var import_use_value = require("@yamada-ui/use-value");
|
230
|
-
var
|
231
|
-
var
|
232
|
-
var [PaginationProvider, usePaginationContext] = (0,
|
102
|
+
var import_utils = require("@yamada-ui/utils");
|
103
|
+
var import_react = require("react");
|
104
|
+
var [PaginationProvider, usePaginationContext] = (0, import_utils.createContext)({
|
233
105
|
name: "PaginationContext",
|
234
106
|
errorMessage: `usePaginationContext returned is 'undefined'. Seems you forgot to wrap the components in "<Pagination />"`
|
235
107
|
});
|
@@ -252,24 +124,24 @@ var usePagination = ({
|
|
252
124
|
value: page,
|
253
125
|
onChange: onChangeProp
|
254
126
|
});
|
255
|
-
const onFirst = (0,
|
256
|
-
const onLast = (0,
|
127
|
+
const onFirst = (0, import_react.useCallback)(() => setCurrentPage(1), [setCurrentPage]);
|
128
|
+
const onLast = (0, import_react.useCallback)(
|
257
129
|
() => setCurrentPage(total),
|
258
130
|
[setCurrentPage, total]
|
259
131
|
);
|
260
|
-
const onPrev = (0,
|
132
|
+
const onPrev = (0, import_react.useCallback)(
|
261
133
|
() => setCurrentPage((prev) => prev === 1 ? prev : prev - 1),
|
262
134
|
[setCurrentPage]
|
263
135
|
);
|
264
|
-
const onNext = (0,
|
136
|
+
const onNext = (0, import_react.useCallback)(
|
265
137
|
() => setCurrentPage((prev) => prev === total ? prev : prev + 1),
|
266
138
|
[setCurrentPage, total]
|
267
139
|
);
|
268
|
-
const onChange = (0,
|
140
|
+
const onChange = (0, import_react.useCallback)(
|
269
141
|
(page2) => setCurrentPage(page2),
|
270
142
|
[setCurrentPage]
|
271
143
|
);
|
272
|
-
const range = (0,
|
144
|
+
const range = (0, import_react.useMemo)(() => {
|
273
145
|
const minimumTotal = siblings * 2 + 3 + boundaries * 2;
|
274
146
|
if (minimumTotal >= total) return computedRange(1, total);
|
275
147
|
const prevSiblings = Math.max(currentPage - siblings, boundaries);
|
@@ -314,15 +186,15 @@ var usePagination = ({
|
|
314
186
|
};
|
315
187
|
|
316
188
|
// src/pagination-item.tsx
|
317
|
-
var
|
189
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
318
190
|
var iconMap = {
|
319
|
-
ellipsis: /* @__PURE__ */ (0,
|
320
|
-
first: /* @__PURE__ */ (0,
|
321
|
-
last: /* @__PURE__ */ (0,
|
322
|
-
next: /* @__PURE__ */ (0,
|
323
|
-
prev: /* @__PURE__ */ (0,
|
191
|
+
ellipsis: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationEllipsisIcon, {}),
|
192
|
+
first: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationFirstIcon, {}),
|
193
|
+
last: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationLastIcon, {}),
|
194
|
+
next: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationNextIcon, {}),
|
195
|
+
prev: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationPrevIcon, {})
|
324
196
|
};
|
325
|
-
var PaginationItem = (0,
|
197
|
+
var PaginationItem = (0, import_core.forwardRef)(
|
326
198
|
({
|
327
199
|
className,
|
328
200
|
active,
|
@@ -354,18 +226,18 @@ var PaginationItem = (0, import_core6.forwardRef)(
|
|
354
226
|
...styles.item,
|
355
227
|
...styles[page]
|
356
228
|
};
|
357
|
-
const Component =
|
358
|
-
return /* @__PURE__ */ (0,
|
229
|
+
const Component = import_core.ui[isEllipsis ? "span" : "button"];
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
359
231
|
Component,
|
360
232
|
{
|
361
233
|
ref,
|
362
234
|
...!isEllipsis ? {
|
363
235
|
type: "button",
|
364
|
-
"data-disabled": (0,
|
365
|
-
"data-selected": (0,
|
236
|
+
"data-disabled": (0, import_utils2.dataAttr)(disabled),
|
237
|
+
"data-selected": (0, import_utils2.dataAttr)(active),
|
366
238
|
disabled
|
367
239
|
} : {},
|
368
|
-
className: (0,
|
240
|
+
className: (0, import_utils2.cx)(
|
369
241
|
"ui-pagination__item",
|
370
242
|
isEllipsis ? "ui-pagination__item--ellipsis" : void 0,
|
371
243
|
className
|
@@ -376,7 +248,7 @@ var PaginationItem = (0, import_core6.forwardRef)(
|
|
376
248
|
onPointerDown,
|
377
249
|
children: [
|
378
250
|
children,
|
379
|
-
/* @__PURE__ */ (0,
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ripple.Ripple, { ...rippleProps })
|
380
252
|
]
|
381
253
|
}
|
382
254
|
);
|
@@ -386,9 +258,9 @@ PaginationItem.displayName = "PaginationItem";
|
|
386
258
|
PaginationItem.__ui__ = "PaginationItem";
|
387
259
|
|
388
260
|
// src/pagination.tsx
|
389
|
-
var
|
390
|
-
var Pagination = (0,
|
391
|
-
const [styles, mergedProps] = (0,
|
261
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
262
|
+
var Pagination = (0, import_core2.forwardRef)((props, ref) => {
|
263
|
+
const [styles, mergedProps] = (0, import_core2.useComponentMultiStyle)("Pagination", props);
|
392
264
|
let {
|
393
265
|
className,
|
394
266
|
boundaries,
|
@@ -411,7 +283,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
411
283
|
itemProps,
|
412
284
|
onChange: onChangeProp,
|
413
285
|
...rest
|
414
|
-
} = (0,
|
286
|
+
} = (0, import_core2.omitThemeProps)(mergedProps);
|
415
287
|
const withControls = (0, import_use_value2.useValue)(_withControls);
|
416
288
|
const withEdges = (0, import_use_value2.useValue)(_withEdges);
|
417
289
|
disabled != null ? disabled : disabled = isDisabled;
|
@@ -424,8 +296,8 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
424
296
|
total,
|
425
297
|
onChange: onChangeProp
|
426
298
|
});
|
427
|
-
const children = (0,
|
428
|
-
() => range.map((page2, key) => /* @__PURE__ */ (0,
|
299
|
+
const children = (0, import_react2.useMemo)(
|
300
|
+
() => range.map((page2, key) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.ui.li, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
429
301
|
Component,
|
430
302
|
{
|
431
303
|
"aria-label": page2 !== "ellipsis" ? `Go to page ${page2}` : void 0,
|
@@ -433,7 +305,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
433
305
|
disabled,
|
434
306
|
...itemProps,
|
435
307
|
page: page2,
|
436
|
-
onClick: (0,
|
308
|
+
onClick: (0, import_utils3.handlerAll)(
|
437
309
|
itemProps == null ? void 0 : itemProps.onClick,
|
438
310
|
page2 !== "ellipsis" ? () => onChange(page2) : void 0
|
439
311
|
)
|
@@ -444,19 +316,19 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
444
316
|
const css = {
|
445
317
|
...styles.container
|
446
318
|
};
|
447
|
-
return /* @__PURE__ */ (0,
|
448
|
-
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PaginationProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
320
|
+
import_core2.ui.nav,
|
449
321
|
{
|
450
322
|
ref,
|
451
|
-
className: (0,
|
452
|
-
"data-disabled": (0,
|
323
|
+
className: (0, import_utils3.cx)("ui-pagination", className),
|
324
|
+
"data-disabled": (0, import_utils3.dataAttr)(isDisabled),
|
453
325
|
__css: css,
|
454
326
|
...containerProps,
|
455
|
-
children: /* @__PURE__ */ (0,
|
456
|
-
|
327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
328
|
+
import_core2.ui.ul,
|
457
329
|
{
|
458
330
|
className: "ui-pagination-inner",
|
459
|
-
"data-disabled": (0,
|
331
|
+
"data-disabled": (0, import_utils3.dataAttr)(isDisabled),
|
460
332
|
__css: {
|
461
333
|
alignItems: "center",
|
462
334
|
display: "flex",
|
@@ -464,7 +336,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
464
336
|
},
|
465
337
|
...rest,
|
466
338
|
children: [
|
467
|
-
withEdges ? /* @__PURE__ */ (0,
|
339
|
+
withEdges ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.ui.li, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
468
340
|
Component,
|
469
341
|
{
|
470
342
|
className: "ui-pagination__item--first",
|
@@ -473,14 +345,14 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
473
345
|
page: "first",
|
474
346
|
...edgeProps,
|
475
347
|
...edgeFirstProps,
|
476
|
-
onClick: (0,
|
348
|
+
onClick: (0, import_utils3.handlerAll)(
|
477
349
|
edgeProps == null ? void 0 : edgeProps.onClick,
|
478
350
|
edgeFirstProps == null ? void 0 : edgeFirstProps.onClick,
|
479
351
|
onFirst
|
480
352
|
)
|
481
353
|
}
|
482
354
|
) }) : null,
|
483
|
-
withControls ? /* @__PURE__ */ (0,
|
355
|
+
withControls ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.ui.li, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
484
356
|
Component,
|
485
357
|
{
|
486
358
|
className: "ui-pagination__item--prev",
|
@@ -489,7 +361,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
489
361
|
page: "prev",
|
490
362
|
...controlProps,
|
491
363
|
...controlPrevProps,
|
492
|
-
onClick: (0,
|
364
|
+
onClick: (0, import_utils3.handlerAll)(
|
493
365
|
controlProps == null ? void 0 : controlProps.onClick,
|
494
366
|
controlPrevProps == null ? void 0 : controlPrevProps.onClick,
|
495
367
|
onPrev
|
@@ -497,7 +369,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
497
369
|
}
|
498
370
|
) }) : null,
|
499
371
|
children,
|
500
|
-
withControls ? /* @__PURE__ */ (0,
|
372
|
+
withControls ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.ui.li, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
501
373
|
Component,
|
502
374
|
{
|
503
375
|
className: "ui-pagination__item--next",
|
@@ -506,14 +378,14 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
506
378
|
page: "next",
|
507
379
|
...controlProps,
|
508
380
|
...controlNextProps,
|
509
|
-
onClick: (0,
|
381
|
+
onClick: (0, import_utils3.handlerAll)(
|
510
382
|
controlProps == null ? void 0 : controlProps.onClick,
|
511
383
|
controlNextProps == null ? void 0 : controlNextProps.onClick,
|
512
384
|
onNext
|
513
385
|
)
|
514
386
|
}
|
515
387
|
) }) : null,
|
516
|
-
withEdges ? /* @__PURE__ */ (0,
|
388
|
+
withEdges ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.ui.li, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
517
389
|
Component,
|
518
390
|
{
|
519
391
|
className: "ui-pagination__item--last",
|
@@ -522,7 +394,7 @@ var Pagination = (0, import_core7.forwardRef)((props, ref) => {
|
|
522
394
|
page: "last",
|
523
395
|
...edgeProps,
|
524
396
|
...edgeLastProps,
|
525
|
-
onClick: (0,
|
397
|
+
onClick: (0, import_utils3.handlerAll)(
|
526
398
|
edgeProps == null ? void 0 : edgeProps.onClick,
|
527
399
|
edgeLastProps == null ? void 0 : edgeLastProps.onClick,
|
528
400
|
onLast
|
@@ -542,86 +414,4 @@ Pagination.__ui__ = "Pagination";
|
|
542
414
|
Pagination,
|
543
415
|
usePagination
|
544
416
|
});
|
545
|
-
/*! Bundled license information:
|
546
|
-
|
547
|
-
lucide-react/dist/esm/shared/src/utils.js:
|
548
|
-
(**
|
549
|
-
* @license lucide-react v0.460.0 - ISC
|
550
|
-
*
|
551
|
-
* This source code is licensed under the ISC license.
|
552
|
-
* See the LICENSE file in the root directory of this source tree.
|
553
|
-
*)
|
554
|
-
|
555
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
556
|
-
(**
|
557
|
-
* @license lucide-react v0.460.0 - ISC
|
558
|
-
*
|
559
|
-
* This source code is licensed under the ISC license.
|
560
|
-
* See the LICENSE file in the root directory of this source tree.
|
561
|
-
*)
|
562
|
-
|
563
|
-
lucide-react/dist/esm/Icon.js:
|
564
|
-
(**
|
565
|
-
* @license lucide-react v0.460.0 - ISC
|
566
|
-
*
|
567
|
-
* This source code is licensed under the ISC license.
|
568
|
-
* See the LICENSE file in the root directory of this source tree.
|
569
|
-
*)
|
570
|
-
|
571
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
572
|
-
(**
|
573
|
-
* @license lucide-react v0.460.0 - ISC
|
574
|
-
*
|
575
|
-
* This source code is licensed under the ISC license.
|
576
|
-
* See the LICENSE file in the root directory of this source tree.
|
577
|
-
*)
|
578
|
-
|
579
|
-
lucide-react/dist/esm/icons/chevron-left.js:
|
580
|
-
(**
|
581
|
-
* @license lucide-react v0.460.0 - ISC
|
582
|
-
*
|
583
|
-
* This source code is licensed under the ISC license.
|
584
|
-
* See the LICENSE file in the root directory of this source tree.
|
585
|
-
*)
|
586
|
-
|
587
|
-
lucide-react/dist/esm/icons/chevron-right.js:
|
588
|
-
(**
|
589
|
-
* @license lucide-react v0.460.0 - ISC
|
590
|
-
*
|
591
|
-
* This source code is licensed under the ISC license.
|
592
|
-
* See the LICENSE file in the root directory of this source tree.
|
593
|
-
*)
|
594
|
-
|
595
|
-
lucide-react/dist/esm/icons/chevrons-left.js:
|
596
|
-
(**
|
597
|
-
* @license lucide-react v0.460.0 - ISC
|
598
|
-
*
|
599
|
-
* This source code is licensed under the ISC license.
|
600
|
-
* See the LICENSE file in the root directory of this source tree.
|
601
|
-
*)
|
602
|
-
|
603
|
-
lucide-react/dist/esm/icons/chevrons-right.js:
|
604
|
-
(**
|
605
|
-
* @license lucide-react v0.460.0 - ISC
|
606
|
-
*
|
607
|
-
* This source code is licensed under the ISC license.
|
608
|
-
* See the LICENSE file in the root directory of this source tree.
|
609
|
-
*)
|
610
|
-
|
611
|
-
lucide-react/dist/esm/icons/ellipsis.js:
|
612
|
-
(**
|
613
|
-
* @license lucide-react v0.460.0 - ISC
|
614
|
-
*
|
615
|
-
* This source code is licensed under the ISC license.
|
616
|
-
* See the LICENSE file in the root directory of this source tree.
|
617
|
-
*)
|
618
|
-
|
619
|
-
lucide-react/dist/esm/lucide-react.js:
|
620
|
-
(**
|
621
|
-
* @license lucide-react v0.460.0 - ISC
|
622
|
-
*
|
623
|
-
* This source code is licensed under the ISC license.
|
624
|
-
* See the LICENSE file in the root directory of this source tree.
|
625
|
-
*)
|
626
|
-
*/
|
627
417
|
//# sourceMappingURL=index.js.map
|