wimui 0.63.4 → 0.64.0
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/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.d.ts +2 -0
- package/dist/components/data-display/Carousel/Carousel.js +119 -98
- package/dist/components/feedback/Tour/tour.module.cjs +1 -1
- package/dist/components/feedback/Tour/tour.module.js +1 -1
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +134 -116
- package/dist/components/navigation/CommandPalette/command-palette.module.cjs +1 -1
- package/dist/components/navigation/CommandPalette/command-palette.module.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.d.ts +2 -0
- package/dist/components/navigation/Pagination/Pagination.js +169 -151
- package/dist/i18n/generated/common.cjs +1 -1
- package/dist/i18n/generated/common.d.ts +1 -1
- package/dist/i18n/generated/common.js +6 -3
- package/dist/i18n/generated/components.cjs +1 -1
- package/dist/i18n/generated/components.d.ts +1 -1
- package/dist/i18n/generated/components.js +9 -3
- package/dist/llms-full.txt +3 -3
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +2 -1
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/common.json +2 -1
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/common.json +2 -1
- package/dist/locales/pt/components.json +3 -1
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +2 -2
- package/package.json +1 -1
|
@@ -2,184 +2,202 @@
|
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useWimTranslation as n } from "../../../i18n/useWimTranslation.js";
|
|
4
4
|
import { OverlayBase as r } from "../../_internal/OverlayBase.js";
|
|
5
|
-
import {
|
|
6
|
-
import a from "../../../
|
|
7
|
-
import o from "../../../icon/chevron-
|
|
8
|
-
import s from "../../../icon/
|
|
9
|
-
import c from "../../../icon/
|
|
10
|
-
import l from "../../../icon/
|
|
11
|
-
import
|
|
12
|
-
import d from "
|
|
13
|
-
import
|
|
14
|
-
import _ from "
|
|
15
|
-
import
|
|
5
|
+
import { VisuallyHidden as i } from "../../layout/VisuallyHidden/VisuallyHidden.js";
|
|
6
|
+
import { componentsNs as a } from "../../../i18n/generated/components.js";
|
|
7
|
+
import o from "../../../icon/chevron-left.js";
|
|
8
|
+
import s from "../../../icon/chevron-right.js";
|
|
9
|
+
import c from "../../../icon/close.js";
|
|
10
|
+
import l from "../../../icon/minus.js";
|
|
11
|
+
import u from "../../../icon/plus.js";
|
|
12
|
+
import { Icon as d } from "../Icon/Icon.js";
|
|
13
|
+
import f from "./lightbox.module.js";
|
|
14
|
+
import { createContext as p, useCallback as m, useContext as h, useEffect as g, useState as _ } from "react";
|
|
15
|
+
import v from "classnames";
|
|
16
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/media/Lightbox/Lightbox.tsx
|
|
17
|
-
var
|
|
18
|
-
let e =
|
|
18
|
+
var x = p(void 0), S = () => {
|
|
19
|
+
let e = h(x);
|
|
19
20
|
if (!e) throw Error("Lightbox components must be used within Lightbox");
|
|
20
21
|
return e;
|
|
21
|
-
},
|
|
22
|
-
let [a, o] =
|
|
22
|
+
}, C = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1, defaultIndex: i = 0 }) => {
|
|
23
|
+
let [a, o] = _(r), [s, c] = _(i), [l, u] = _([]), d = t !== void 0, f = d ? t : a, p = m((e) => {
|
|
23
24
|
d || o(e), n?.(e);
|
|
24
|
-
}, [d, n]), h =
|
|
25
|
+
}, [d, n]), h = m((e) => {
|
|
25
26
|
let t = -1;
|
|
26
27
|
return u((n) => (t = n.length, [...n, e])), t;
|
|
27
|
-
}, []),
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
}, []), g = m((e) => {}, []);
|
|
29
|
+
return /* @__PURE__ */ y(x.Provider, {
|
|
29
30
|
value: {
|
|
30
31
|
open: f,
|
|
31
|
-
setOpen:
|
|
32
|
+
setOpen: p,
|
|
32
33
|
currentIndex: s,
|
|
33
34
|
setCurrentIndex: c,
|
|
34
35
|
items: l,
|
|
35
36
|
setItems: u,
|
|
36
37
|
registerItem: h,
|
|
37
|
-
unregisterItem:
|
|
38
|
+
unregisterItem: g
|
|
38
39
|
},
|
|
39
40
|
children: e
|
|
40
41
|
});
|
|
41
|
-
},
|
|
42
|
-
let { setOpen: m, setCurrentIndex: h, items: g, setItems:
|
|
42
|
+
}, w = ({ children: r, className: i, onClick: o, asChild: s = !1, index: c, src: l, alt: u, caption: d, ...p }) => {
|
|
43
|
+
let { setOpen: m, setCurrentIndex: h, items: g, setItems: _ } = S(), { t: b } = n(a), x = (e) => {
|
|
43
44
|
if (o?.(e), c !== void 0) h(c);
|
|
44
45
|
else if (l) {
|
|
45
46
|
let e = g.findIndex((e) => e.src === l);
|
|
46
47
|
if (e !== -1) h(e);
|
|
47
48
|
else {
|
|
48
49
|
let e = g.length;
|
|
49
|
-
|
|
50
|
+
_((e) => [...e, {
|
|
50
51
|
src: l,
|
|
51
52
|
alt: u,
|
|
52
|
-
caption:
|
|
53
|
+
caption: d
|
|
53
54
|
}]), h(e);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
m(!0);
|
|
57
58
|
}, C = s ? e : "button", w = c === void 0 ? void 0 : g[c]?.alt, T = p["aria-label"] !== void 0 || p["aria-labelledby"] !== void 0, E = u ?? w, D = T ? void 0 : E ? b("lightbox.open_named", { name: E }) : b("lightbox.open");
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ y(C, {
|
|
59
60
|
type: "button",
|
|
60
|
-
className:
|
|
61
|
-
onClick:
|
|
61
|
+
className: v(f.trigger, i),
|
|
62
|
+
onClick: x,
|
|
62
63
|
"aria-label": D,
|
|
63
64
|
...p,
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ y(t, { children: r })
|
|
65
66
|
});
|
|
66
|
-
},
|
|
67
|
-
let { open:
|
|
68
|
-
|
|
67
|
+
}, T = ({ className: e, showCloseButton: t = !0, showNavigation: p = !0, showCounter: h = !0, closeOnOverlayClick: x = !0, ...C }) => {
|
|
68
|
+
let { open: w, setOpen: T, currentIndex: E, setCurrentIndex: D, items: O } = S(), { t: k } = n(a), [A, j] = _(1), [M, N] = _("");
|
|
69
|
+
!w && M && N("");
|
|
70
|
+
let P = m((e) => {
|
|
71
|
+
let t = O[e], n = t?.title || t?.alt, r = k("lightbox.image_status", {
|
|
72
|
+
current: e + 1,
|
|
73
|
+
total: O.length
|
|
74
|
+
});
|
|
75
|
+
N(n ? `${r}: ${n}` : r), D(e), j(1);
|
|
69
76
|
}, [
|
|
70
|
-
|
|
71
|
-
D
|
|
72
|
-
|
|
73
|
-
]),
|
|
74
|
-
|
|
77
|
+
O,
|
|
78
|
+
D,
|
|
79
|
+
k
|
|
80
|
+
]), F = m(() => {
|
|
81
|
+
P((E - 1 + O.length) % O.length);
|
|
75
82
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
]),
|
|
80
|
-
|
|
83
|
+
E,
|
|
84
|
+
O.length,
|
|
85
|
+
P
|
|
86
|
+
]), I = m(() => {
|
|
87
|
+
P((E + 1) % O.length);
|
|
88
|
+
}, [
|
|
89
|
+
E,
|
|
90
|
+
O.length,
|
|
91
|
+
P
|
|
92
|
+
]), L = () => {
|
|
93
|
+
j((e) => e === 1 ? 2 : 1);
|
|
81
94
|
};
|
|
82
|
-
|
|
83
|
-
if (!
|
|
95
|
+
g(() => {
|
|
96
|
+
if (!w) return;
|
|
84
97
|
let e = (e) => {
|
|
85
|
-
e.key === "ArrowLeft" &&
|
|
98
|
+
e.key === "ArrowLeft" && F(), e.key === "ArrowRight" && I(), e.key === "Escape" && T(!1);
|
|
86
99
|
};
|
|
87
100
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
88
101
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
w,
|
|
103
|
+
F,
|
|
104
|
+
I,
|
|
105
|
+
T
|
|
93
106
|
]);
|
|
94
|
-
let
|
|
95
|
-
return
|
|
96
|
-
...
|
|
97
|
-
open:
|
|
98
|
-
onOpenChange:
|
|
99
|
-
closeOnOverlayClick:
|
|
100
|
-
overlayClassName:
|
|
101
|
-
className:
|
|
102
|
-
"aria-label":
|
|
107
|
+
let R = O[E];
|
|
108
|
+
return R ? /* @__PURE__ */ y(r, {
|
|
109
|
+
...C,
|
|
110
|
+
open: w,
|
|
111
|
+
onOpenChange: T,
|
|
112
|
+
closeOnOverlayClick: x,
|
|
113
|
+
overlayClassName: f.overlay,
|
|
114
|
+
className: v("wim-lightbox", f.contentRoot, e),
|
|
115
|
+
"aria-label": C["aria-labelledby"] ? void 0 : C["aria-label"] ?? (R.title || R.alt || k("lightbox.dialog")),
|
|
103
116
|
transitionProps: {
|
|
104
117
|
preset: "fade",
|
|
105
|
-
enter:
|
|
106
|
-
enterFrom:
|
|
107
|
-
enterTo:
|
|
118
|
+
enter: f.contentEnter,
|
|
119
|
+
enterFrom: f.contentEnterFrom,
|
|
120
|
+
enterTo: f.contentEnterTo
|
|
108
121
|
},
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
-
className:
|
|
122
|
+
children: /* @__PURE__ */ b("div", {
|
|
123
|
+
className: f.container,
|
|
111
124
|
children: [
|
|
112
|
-
/* @__PURE__ */ y(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
/* @__PURE__ */ y(i, {
|
|
126
|
+
role: "status",
|
|
127
|
+
"aria-atomic": "true",
|
|
128
|
+
children: M
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ b("div", {
|
|
131
|
+
className: f.header,
|
|
132
|
+
children: [h && O.length > 1 && /* @__PURE__ */ y("div", {
|
|
133
|
+
className: f.counter,
|
|
134
|
+
children: k("lightbox.counter", {
|
|
135
|
+
current: E + 1,
|
|
136
|
+
total: O.length
|
|
119
137
|
})
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
-
className:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
-
className:
|
|
124
|
-
onClick:
|
|
125
|
-
"aria-label":
|
|
126
|
-
children:
|
|
127
|
-
}), t && /* @__PURE__ */
|
|
128
|
-
className:
|
|
129
|
-
onClick: () =>
|
|
130
|
-
"aria-label":
|
|
131
|
-
children: /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ b("div", {
|
|
139
|
+
className: f.controls,
|
|
140
|
+
children: [/* @__PURE__ */ y("button", {
|
|
141
|
+
className: f.iconButton,
|
|
142
|
+
onClick: L,
|
|
143
|
+
"aria-label": k(A > 1 ? "lightbox.zoom_out" : "lightbox.zoom_in"),
|
|
144
|
+
children: A > 1 ? /* @__PURE__ */ y(d, { component: l }) : /* @__PURE__ */ y(d, { component: u })
|
|
145
|
+
}), t && /* @__PURE__ */ y("button", {
|
|
146
|
+
className: f.iconButton,
|
|
147
|
+
onClick: () => T(!1),
|
|
148
|
+
"aria-label": k("lightbox.close"),
|
|
149
|
+
children: /* @__PURE__ */ y(d, { component: c })
|
|
132
150
|
})]
|
|
133
151
|
})]
|
|
134
152
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
className:
|
|
153
|
+
/* @__PURE__ */ b("div", {
|
|
154
|
+
className: f.viewport,
|
|
137
155
|
children: [
|
|
138
|
-
|
|
139
|
-
className:
|
|
140
|
-
onClick:
|
|
141
|
-
"aria-label":
|
|
142
|
-
children: /* @__PURE__ */
|
|
156
|
+
p && O.length > 1 && /* @__PURE__ */ y("button", {
|
|
157
|
+
className: v(f.navButton, f.prev),
|
|
158
|
+
onClick: F,
|
|
159
|
+
"aria-label": k("lightbox.previous"),
|
|
160
|
+
children: /* @__PURE__ */ y(d, { component: o })
|
|
143
161
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
className:
|
|
146
|
-
style: { transform: `scale(${
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
src:
|
|
149
|
-
alt:
|
|
150
|
-
className:
|
|
162
|
+
/* @__PURE__ */ y("div", {
|
|
163
|
+
className: f.mediaWrapper,
|
|
164
|
+
style: { transform: `scale(${A})` },
|
|
165
|
+
children: /* @__PURE__ */ y("img", {
|
|
166
|
+
src: R.src,
|
|
167
|
+
alt: R.alt || "",
|
|
168
|
+
className: f.image
|
|
151
169
|
})
|
|
152
170
|
}),
|
|
153
|
-
|
|
154
|
-
className:
|
|
155
|
-
onClick:
|
|
156
|
-
"aria-label":
|
|
157
|
-
children: /* @__PURE__ */
|
|
171
|
+
p && O.length > 1 && /* @__PURE__ */ y("button", {
|
|
172
|
+
className: v(f.navButton, f.next),
|
|
173
|
+
onClick: I,
|
|
174
|
+
"aria-label": k("lightbox.next"),
|
|
175
|
+
children: /* @__PURE__ */ y(d, { component: s })
|
|
158
176
|
})
|
|
159
177
|
]
|
|
160
178
|
}),
|
|
161
|
-
(
|
|
162
|
-
className:
|
|
163
|
-
children: [
|
|
164
|
-
className:
|
|
165
|
-
children:
|
|
166
|
-
}),
|
|
167
|
-
className:
|
|
168
|
-
children:
|
|
179
|
+
(R.title || R.caption) && /* @__PURE__ */ b("div", {
|
|
180
|
+
className: f.footer,
|
|
181
|
+
children: [R.title && /* @__PURE__ */ y("h3", {
|
|
182
|
+
className: f.title,
|
|
183
|
+
children: R.title
|
|
184
|
+
}), R.caption && /* @__PURE__ */ y("p", {
|
|
185
|
+
className: f.caption,
|
|
186
|
+
children: R.caption
|
|
169
187
|
})]
|
|
170
188
|
})
|
|
171
189
|
]
|
|
172
190
|
})
|
|
173
191
|
}) : null;
|
|
174
|
-
},
|
|
175
|
-
let { setItems: n } =
|
|
176
|
-
return
|
|
192
|
+
}, E = ({ items: e, children: t }) => {
|
|
193
|
+
let { setItems: n } = S();
|
|
194
|
+
return g(() => {
|
|
177
195
|
n(e);
|
|
178
|
-
}, [e, n]), /* @__PURE__ */
|
|
179
|
-
className:
|
|
196
|
+
}, [e, n]), /* @__PURE__ */ y("div", {
|
|
197
|
+
className: f.gallery,
|
|
180
198
|
children: t
|
|
181
199
|
});
|
|
182
|
-
},
|
|
183
|
-
|
|
200
|
+
}, D = C;
|
|
201
|
+
D.Trigger = w, D.Content = T, D.Gallery = E, D.displayName = "Lightbox", w.displayName = "Lightbox.Trigger", T.displayName = "Lightbox.Content", E.displayName = "Lightbox.Gallery";
|
|
184
202
|
//#endregion
|
|
185
|
-
export {
|
|
203
|
+
export { C as Lightbox, T as LightboxContent, E as LightboxGallery, D as LightboxRoot, D as default, w as LightboxTrigger, S as useLightbox };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_overlay_zrsc3_23`,t=`_content_zrsc3_39`,n=`_slideIn_zrsc3_1`,r=`_inputWrapper_zrsc3_68`,i=`_inputRight_zrsc3_107`,a=`_input_zrsc3_68`,o=`_list_zrsc3_126`,s=`_group_zrsc3_136`,c=`_groupHeading_zrsc3_142`,l=`_item_zrsc3_150`,u=`_active_zrsc3_153`,d=`_shortcut_zrsc3_157`,f=`_empty_zrsc3_166`,p=`_footer_zrsc3_172`,m=`_kbd_zrsc3_186`,h=`_trigger_zrsc3_195`,g={overlay:e,content:t,slideIn:n,inputWrapper:r,inputRight:i,input:a,list:o,group:s,groupHeading:c,item:l,active:u,shortcut:d,empty:f,footer:p,kbd:m,trigger:h};exports.active=u,exports.content=t,exports.default=g,exports.empty=f,exports.footer=p,exports.group=s,exports.groupHeading=c,exports.input=a,exports.inputRight=i,exports.inputWrapper=r,exports.item=l,exports.kbd=m,exports.list=o,exports.overlay=e,exports.shortcut=d,exports.slideIn=n,exports.trigger=h;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/navigation/CommandPalette/command-palette.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_overlay_zrsc3_23", t = "_content_zrsc3_39", n = "_slideIn_zrsc3_1", r = "_inputWrapper_zrsc3_68", i = "_inputRight_zrsc3_107", a = "_input_zrsc3_68", o = "_list_zrsc3_126", s = "_group_zrsc3_136", c = "_groupHeading_zrsc3_142", l = "_item_zrsc3_150", u = "_active_zrsc3_153", d = "_shortcut_zrsc3_157", f = "_empty_zrsc3_166", p = "_footer_zrsc3_172", m = "_kbd_zrsc3_186", h = "_trigger_zrsc3_195", g = {
|
|
4
4
|
overlay: e,
|
|
5
5
|
content: t,
|
|
6
6
|
slideIn: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../../../icon/chevron-left.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),a=require("../../../icon/chevron-left.cjs"),o=require("../../../icon/chevron-right.cjs"),s=require("../../media/Icon/Icon.cjs"),ee=require("../../form/Button/Button.cjs"),te=require("../../form/Input/Input.cjs"),c=require("../../form/Select/Select.cjs"),l=require("./pagination.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=u.default.forwardRef(({asChild:e=!1,className:n,children:r,page:i,isActive:a,...o},s)=>(0,f.jsx)(e?t.Root:`button`,{ref:s,type:e?void 0:`button`,className:(0,d.default)(l.default.button,n),"aria-current":a?`page`:void 0,...o,children:e?(0,f.jsx)(t.Slottable,{children:r}):r}));p.displayName=`PaginationPage`;var m=`...`,h=({total:e,pageSize:h=10,current:g=1,onChange:_,onPageSizeChange:v,siblingCount:y=1,className:b,asChild:x=!1,children:S,renderPage:C,hideOnSinglePage:w=!1,simple:ne=!1,showSizeChanger:re=!1,pageSizeOptions:T=[10,20,50,100],showTotal:E,showQuickJumper:D=!1,labels:O={},"aria-label":k,"aria-labelledby":A})=>{let{t:j}=n.useWimTranslation(r.commonNs),{prevPage:M=j(`a11y.go_to_prev_page`),nextPage:N=j(`a11y.go_to_next_page`),pageAriaLabel:P=e=>j(`a11y.go_to_page`,{page:String(e)}),itemsPerPage:F=j(`pagination.items_per_page`),goTo:I=j(`pagination.go_to`),go:L=j(`pagination.go`),pageSizeAriaLabel:R=j(`a11y.items_per_page`),jumpToPageAriaLabel:z=j(`a11y.jump_to_page`),navAriaLabel:B=j(`a11y.pagination_nav`),pageStatus:V=(e,t)=>j(`pagination.page_status`,{current:String(e),total:String(t)})}=O,[H,U]=(0,u.useState)(h),[W,G]=(0,u.useState)(``),K=H,q=Math.ceil(e/K),[J,Y]=(0,u.useState)(g),[ie,ae]=(0,u.useState)(``);g!==J&&(Y(g),ae(V(g,q)));let X=(0,f.jsx)(i.VisuallyHidden,{role:`status`,"aria-atomic":`true`,children:ie}),oe=(0,u.useMemo)(()=>{if(y+5>=q)return Array.from({length:q},(e,t)=>t+1);let e=Math.max(g-y,1),t=Math.min(g+y,q),n=e>2,r=t<q-2,i=q;if(!n&&r){let e=3+2*y;return[...Array.from({length:e},(e,t)=>t+1),m,q]}if(n&&!r){let e=3+2*y;return[1,m,...Array.from({length:e},(t,n)=>q-e+n+1)]}return n&&r?[1,m,...Array.from({length:t-e+1},(t,n)=>e+n),m,i]:[]},[q,y,g]);if(w&&q<=1)return null;let Z=e=>{e<1||e>q||e===g||_?.(e,K)},se=e=>{U(e),v?.(e),_?.(1,e)},Q=()=>{let e=parseInt(W);!isNaN(e)&&e>=1&&e<=q&&(Z(e),G(``))},ce=e=>{e.key===`Enter`&&Q()},le=(g-1)*K+1,ue=Math.min(g*K,e),$=x?t.Root:`nav`,de=e=>{let t={page:e,isActive:e===g,onClick:()=>Z(e),"aria-label":P(e)};return C?C(e,t):(0,f.jsx)(p,{...t,children:e})};return ne?(0,f.jsxs)($,{className:(0,d.default)(`wim-pagination`,l.default.root,l.default.simple,b),"aria-label":A?void 0:k??B,"aria-labelledby":A,children:[(0,f.jsx)(t.Slottable,{children:S}),X,(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>Z(g-1),disabled:g===1,"aria-label":M,children:(0,f.jsx)(s.Icon,{component:a.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.simplePager),children:(0,f.jsxs)(`span`,{children:[g,` / `,q]})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===q&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>Z(g+1),disabled:g===q,"aria-label":N,children:(0,f.jsx)(s.Icon,{component:o.default,size:`sm`})})})]})]}):(0,f.jsx)(`div`,{className:(0,d.default)(`wim-pagination`,l.default.container,b),children:(0,f.jsxs)(`div`,{className:l.default.wrapper,children:[E&&(0,f.jsx)(`div`,{className:l.default.total,children:E(e,[le,ue])}),(0,f.jsxs)($,{className:l.default.root,"aria-label":A?void 0:k??B,"aria-labelledby":A,children:[(0,f.jsx)(t.Slottable,{children:S}),X,(0,f.jsxs)(`ul`,{className:l.default.root,children:[(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===1&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>Z(g-1),disabled:g===1,"aria-label":M,children:(0,f.jsx)(s.Icon,{component:a.default,size:`sm`})})}),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.mobileIndicator),children:(0,f.jsxs)(`span`,{children:[g,` / `,q]})}),oe.map((e,t)=>e===m?(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.ellipsis),"aria-hidden":`true`,children:m},`ellipsis-${t}`):(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,l.default.number,e===g&&l.default.active),children:de(e)},e)),(0,f.jsx)(`li`,{className:(0,d.default)(l.default.item,g===q&&l.default.disabled),children:(0,f.jsx)(`button`,{className:l.default.button,onClick:()=>Z(g+1),disabled:g===q,"aria-label":N,children:(0,f.jsx)(s.Icon,{component:o.default,size:`sm`})})})]})]}),re&&(0,f.jsx)(`div`,{className:l.default.sizeChanger,children:(0,f.jsx)(c.Select,{value:String(K),onChange:e=>se(Number(e)),options:T.map(e=>({label:`${e} ${F}`,value:String(e)})),width:`auto`,"aria-label":R})}),D&&(0,f.jsxs)(`div`,{className:l.default.quickJumper,children:[(0,f.jsx)(`span`,{children:I}),(0,f.jsx)(te.Input,{type:`number`,min:1,max:q,value:W,onChange:e=>G(e.target.value),onKeyDown:ce,width:`60px`,"aria-label":z}),(0,f.jsx)(ee.Button,{size:`sm`,variant:`outline`,onClick:Q,disabled:!W,children:L})]})]})})};exports.Pagination=h,exports.default=h,exports.PaginationPage=p;
|
|
@@ -76,6 +76,8 @@ export interface PaginationProps {
|
|
|
76
76
|
jumpToPageAriaLabel?: string;
|
|
77
77
|
navAriaLabel?: string;
|
|
78
78
|
totalLabel?: string;
|
|
79
|
+
/** Announced to screen readers when the page changes. Receives the current page and the page count. */
|
|
80
|
+
pageStatus?: (current: number, totalPages: number) => string;
|
|
79
81
|
};
|
|
80
82
|
/** Accessible name for the navigation landmark. Takes precedence over `labels.navAriaLabel`. */
|
|
81
83
|
"aria-label"?: string;
|