@robert-stackflow/oneui 0.6.48 → 0.6.50
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/README.md
CHANGED
|
@@ -240,7 +240,7 @@ export function App() {
|
|
|
240
240
|
|
|
241
241
|
`Dialog` 和 `Drawer` 在普通关闭、条件卸载时都会恢复触发控件的焦点,支持 StrictMode 和嵌套弹窗。异步打开导致触发按钮在加载期间失焦时,可传入 `returnFocus={triggerRef}` 明确返回位置;已卸载、禁用或位于其他模态层之外的目标不会被聚焦。
|
|
242
242
|
|
|
243
|
-
`Pagination` 的 `total` 是总条数,`pageSize` 是每页条数。`compact` 移除外层留白并在窄屏重排页码、统计和跳转,`size="small"`
|
|
243
|
+
`Pagination` 的 `total` 是总条数,`pageSize` 是每页条数。`compact` 移除外层留白并在窄屏重排页码、统计和跳转,`size="small"` 使用当前主题的小尺寸控件;正常和紧凑模式均支持长页码列表换行。`showJump={false}` 隐藏跳转输入,配合 `showSummary={false}` 和省略 `onPageSizeChange` 可只展示首末页、前后页与页码。宿主可通过 `className` 调整外层位置。
|
|
244
244
|
|
|
245
245
|
```tsx
|
|
246
246
|
<Pagination
|
package/components/Drawer.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type DrawerProps = {
|
|
|
5
5
|
onClose(): void;
|
|
6
6
|
onAfterClose?(): void;
|
|
7
7
|
title: ReactNode;
|
|
8
|
+
/** Contextual actions next to the close control, outside the title heading. */
|
|
9
|
+
headerActions?: ReactNode;
|
|
8
10
|
description?: ReactNode;
|
|
9
11
|
/** Hide the header divider when embedded navigation already provides one. */
|
|
10
12
|
headerDivider?: boolean;
|
|
@@ -22,4 +24,4 @@ export type DrawerProps = {
|
|
|
22
24
|
portalContainer?: HTMLElement | null;
|
|
23
25
|
className?: string;
|
|
24
26
|
};
|
|
25
|
-
export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, description, headerDivider, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
|
|
27
|
+
export declare function Drawer({ open: requestedOpen, onClose, onAfterClose, title, headerActions, description, headerDivider, children, footer, placement, size, closable, closeOnEscape, closeOnBackdrop, initialFocus, returnFocus, fallbackFocus, portalContainer, closeLabel, className, }: DrawerProps): import("react").ReactPortal | null;
|
package/components/Drawer.js
CHANGED
|
@@ -32,6 +32,7 @@ function Drawer({
|
|
|
32
32
|
onClose,
|
|
33
33
|
onAfterClose,
|
|
34
34
|
title,
|
|
35
|
+
headerActions,
|
|
35
36
|
description,
|
|
36
37
|
headerDivider = true,
|
|
37
38
|
children,
|
|
@@ -147,7 +148,10 @@ function Drawer({
|
|
|
147
148
|
/* @__PURE__ */ jsx("h2", { id: titleId, children: title }),
|
|
148
149
|
description != null && /* @__PURE__ */ jsx("div", { id: descriptionId, className: s.description, children: description })
|
|
149
150
|
] }),
|
|
150
|
-
closable && /* @__PURE__ */
|
|
151
|
+
(headerActions || closable) && /* @__PURE__ */ jsxs("div", { className: s.actions, children: [
|
|
152
|
+
headerActions,
|
|
153
|
+
closable && /* @__PURE__ */ jsx(IconButton, { label: closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx(X, {}) })
|
|
154
|
+
] })
|
|
151
155
|
] }),
|
|
152
156
|
/* @__PURE__ */ jsx("div", { className: s.body, "data-drawer-body": true, children }),
|
|
153
157
|
footer && /* @__PURE__ */ jsx("footer", { className: s.footer, children: footer })
|
|
@@ -62,9 +62,16 @@
|
|
|
62
62
|
var(--separator-color);
|
|
63
63
|
}
|
|
64
64
|
.heading {
|
|
65
|
+
flex: 1;
|
|
65
66
|
min-width: 0;
|
|
66
67
|
padding-top: 4px;
|
|
67
68
|
}
|
|
69
|
+
.actions {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex: none;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
}
|
|
68
75
|
.header[data-divider="false"] {
|
|
69
76
|
border-bottom: 0;
|
|
70
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
export declare function Pagination({ page, pageSize, total, onPageChange, onPageSizeChange, pageSizes, summary, resetPageOnSizeChange, compact, size: controlSize, className, showSummary, label, previousLabel, nextLabel, }: {
|
|
2
|
+
export declare function Pagination({ page, pageSize, total, onPageChange, onPageSizeChange, pageSizes, summary, resetPageOnSizeChange, compact, size: controlSize, className, showSummary, showJump, label, previousLabel, nextLabel, }: {
|
|
3
3
|
page: number;
|
|
4
4
|
pageSize: number;
|
|
5
5
|
total: number;
|
|
@@ -13,6 +13,8 @@ export declare function Pagination({ page, pageSize, total, onPageChange, onPage
|
|
|
13
13
|
size?: "default" | "small";
|
|
14
14
|
className?: string;
|
|
15
15
|
showSummary?: boolean;
|
|
16
|
+
/** Hide the direct page input for compact public navigation. */
|
|
17
|
+
showJump?: boolean;
|
|
16
18
|
label?: string;
|
|
17
19
|
previousLabel?: string;
|
|
18
20
|
nextLabel?: string;
|
package/components/Pagination.js
CHANGED
|
@@ -25,6 +25,7 @@ function Pagination({
|
|
|
25
25
|
size: controlSize = "default",
|
|
26
26
|
className = "",
|
|
27
27
|
showSummary = true,
|
|
28
|
+
showJump = true,
|
|
28
29
|
label,
|
|
29
30
|
previousLabel,
|
|
30
31
|
nextLabel
|
|
@@ -138,7 +139,7 @@ function Pagination({
|
|
|
138
139
|
}
|
|
139
140
|
)
|
|
140
141
|
] }),
|
|
141
|
-
/* @__PURE__ */ jsxs(
|
|
142
|
+
showJump && /* @__PURE__ */ jsxs(
|
|
142
143
|
"form",
|
|
143
144
|
{
|
|
144
145
|
className: s.jump,
|