@jc-times/business-ui 0.2.54 → 0.2.55
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/CHANGELOG.md +8 -1
- package/bin/business-ui-gate.mjs +0 -0
- package/dist/Cascader.js +8 -0
- package/dist/Combobox.js +104 -61
- package/dist/MultilineAutoComplete.js +80 -0
- package/dist/SortableList.js +141 -31
- package/dist/business-ui.js +14 -12
- package/dist/document-viewer/DocumentViewer.js +42 -42
- package/dist/document-viewer-v2/DocumentViewerV2.js +19 -15
- package/dist/document-viewer-v2/HeadlessPdfViewer.js +216 -182
- package/dist/pdfium-viewer.js +1 -0
- package/dist/sortable-transfer-scope.js +36 -0
- package/dist/styles.css +1 -1
- package/dist/types/Combobox.d.ts +1 -0
- package/dist/types/MultilineAutoComplete.d.ts +20 -0
- package/dist/types/SortableList.d.ts +19 -2
- package/dist/types/UserProfilePopover.d.ts +0 -1
- package/dist/types/document-viewer/DocumentViewer.d.ts +2 -0
- package/dist/types/document-viewer-v2/DocumentViewerV2.d.ts +1 -0
- package/dist/types/document-viewer-v2/HeadlessPdfViewer.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/sortable-transfer-scope.d.ts +30 -0
- package/docs/agent-guide.md +1 -1
- package/docs/api.md +1 -1
- package/docs/document-viewer-v2.md +5 -4
- package/docs/release.md +7 -6
- package/docs/sortable-list.md +1 -1
- package/docs/viewport-qa.md +9 -3
- package/package.json +167 -168
|
@@ -12,17 +12,17 @@ import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
|
12
12
|
function f(e) {
|
|
13
13
|
return /* @__PURE__ */ u(p, { ...e }, `${e.source.kind}:${e.source.id}`);
|
|
14
14
|
}
|
|
15
|
-
function p({ source: f, title: p, className: m = "", style: h,
|
|
16
|
-
let
|
|
17
|
-
|
|
15
|
+
function p({ source: f, title: p, className: m = "", style: h, layoutMode: g = "standalone", ariaLabel: _ = "文档查看器", toolbar: v, footer: y, currentPage: b, onCurrentPageChange: x, pageMode: S = "continuous", renderPage: C }) {
|
|
16
|
+
let w = s(f.id), [T, E] = l(1), D = f.kind === "pdf" ? f.document.numPages : f.images.length, O = Math.max(1, Math.min(D, b ?? T)), k = c(() => Array.from({ length: D }, (e, t) => t + 1), [D]), A = (e) => {
|
|
17
|
+
E(e), x?.(e);
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ u("section", {
|
|
20
|
-
ref:
|
|
21
|
-
"aria-label":
|
|
20
|
+
ref: w.containerRef,
|
|
21
|
+
"aria-label": _,
|
|
22
22
|
style: h,
|
|
23
|
-
className: `ui-document-viewer ${
|
|
23
|
+
className: `ui-document-viewer ${g === "fill" ? "ui-viewer-fill" : ""} ${w.fullscreen ? "ui-viewer-fullscreen" : ""} ${m}`,
|
|
24
24
|
children: /* @__PURE__ */ d(t.Provider, {
|
|
25
|
-
value:
|
|
25
|
+
value: w.containerRef.current,
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ d("div", {
|
|
28
28
|
className: "ui-viewer-toolbar",
|
|
@@ -31,37 +31,37 @@ function p({ source: f, title: p, className: m = "", style: h, ariaLabel: g = "
|
|
|
31
31
|
className: "ui-viewer-title",
|
|
32
32
|
children: p
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
v,
|
|
35
35
|
/* @__PURE__ */ u(o, {
|
|
36
|
-
zoom:
|
|
37
|
-
disabled: !
|
|
38
|
-
fullscreen:
|
|
39
|
-
canZoomIn:
|
|
40
|
-
canZoomOut:
|
|
41
|
-
onZoomIn:
|
|
42
|
-
onZoomOut:
|
|
43
|
-
onRotate:
|
|
44
|
-
onToggleFullscreen:
|
|
36
|
+
zoom: w.zoom,
|
|
37
|
+
disabled: !D,
|
|
38
|
+
fullscreen: w.fullscreen,
|
|
39
|
+
canZoomIn: w.canZoomIn,
|
|
40
|
+
canZoomOut: w.canZoomOut,
|
|
41
|
+
onZoomIn: w.zoomIn,
|
|
42
|
+
onZoomOut: w.zoomOut,
|
|
43
|
+
onRotate: w.rotate,
|
|
44
|
+
onToggleFullscreen: w.toggleFullscreen
|
|
45
45
|
})
|
|
46
46
|
]
|
|
47
47
|
}),
|
|
48
|
-
|
|
48
|
+
D ? f.kind === "pdf" ? /* @__PURE__ */ u(r, {
|
|
49
49
|
document: f.document,
|
|
50
|
-
pages:
|
|
51
|
-
pageMode:
|
|
52
|
-
currentPage:
|
|
53
|
-
onCurrentPageChange:
|
|
54
|
-
zoom:
|
|
55
|
-
rotation:
|
|
50
|
+
pages: k,
|
|
51
|
+
pageMode: S,
|
|
52
|
+
currentPage: O,
|
|
53
|
+
onCurrentPageChange: A,
|
|
54
|
+
zoom: w.zoom,
|
|
55
|
+
rotation: w.rotation,
|
|
56
56
|
rail: /* @__PURE__ */ u(a, {
|
|
57
57
|
document: f.document,
|
|
58
|
-
currentPage:
|
|
59
|
-
onCurrentPageChange:
|
|
58
|
+
currentPage: O,
|
|
59
|
+
onCurrentPageChange: A
|
|
60
60
|
}),
|
|
61
|
-
renderPage:
|
|
61
|
+
renderPage: C ? (e) => C({
|
|
62
62
|
page: e,
|
|
63
|
-
zoom:
|
|
64
|
-
rotation:
|
|
63
|
+
zoom: w.zoom,
|
|
64
|
+
rotation: w.rotation
|
|
65
65
|
}) : void 0
|
|
66
66
|
}) : /* @__PURE__ */ u(n, {
|
|
67
67
|
rail: /* @__PURE__ */ u("div", {
|
|
@@ -69,8 +69,8 @@ function p({ source: f, title: p, className: m = "", style: h, ariaLabel: g = "
|
|
|
69
69
|
children: f.images.map((t, n) => /* @__PURE__ */ d(e, {
|
|
70
70
|
variant: "ghost",
|
|
71
71
|
className: "ui-page-thumbnail",
|
|
72
|
-
"aria-current":
|
|
73
|
-
onClick: () =>
|
|
72
|
+
"aria-current": O === n + 1 ? "page" : void 0,
|
|
73
|
+
onClick: () => A(n + 1),
|
|
74
74
|
children: [/* @__PURE__ */ u("img", {
|
|
75
75
|
src: t.src,
|
|
76
76
|
alt: "",
|
|
@@ -79,10 +79,10 @@ function p({ source: f, title: p, className: m = "", style: h, ariaLabel: g = "
|
|
|
79
79
|
}, `${n}:${t.src}`))
|
|
80
80
|
}),
|
|
81
81
|
children: /* @__PURE__ */ u(i, {
|
|
82
|
-
image: f.images[
|
|
83
|
-
zoom:
|
|
84
|
-
rotation:
|
|
85
|
-
}, f.images[
|
|
82
|
+
image: f.images[O - 1],
|
|
83
|
+
zoom: w.zoom,
|
|
84
|
+
rotation: w.rotation
|
|
85
|
+
}, f.images[O - 1].src)
|
|
86
86
|
}) : /* @__PURE__ */ u("div", {
|
|
87
87
|
role: "status",
|
|
88
88
|
children: "没有可预览的页面"
|
|
@@ -93,26 +93,26 @@ function p({ source: f, title: p, className: m = "", style: h, ariaLabel: g = "
|
|
|
93
93
|
/* @__PURE__ */ u(e, {
|
|
94
94
|
variant: "ghost",
|
|
95
95
|
size: "compact",
|
|
96
|
-
disabled:
|
|
97
|
-
onClick: () =>
|
|
96
|
+
disabled: O <= 1,
|
|
97
|
+
onClick: () => A(O - 1),
|
|
98
98
|
children: "上一页"
|
|
99
99
|
}),
|
|
100
100
|
/* @__PURE__ */ d("span", {
|
|
101
101
|
"aria-live": "polite",
|
|
102
102
|
children: [
|
|
103
|
-
|
|
103
|
+
D ? O : 0,
|
|
104
104
|
" / ",
|
|
105
|
-
|
|
105
|
+
D
|
|
106
106
|
]
|
|
107
107
|
}),
|
|
108
108
|
/* @__PURE__ */ u(e, {
|
|
109
109
|
variant: "ghost",
|
|
110
110
|
size: "compact",
|
|
111
|
-
disabled:
|
|
112
|
-
onClick: () =>
|
|
111
|
+
disabled: O >= D,
|
|
112
|
+
onClick: () => A(O + 1),
|
|
113
113
|
children: "下一页"
|
|
114
114
|
}),
|
|
115
|
-
|
|
115
|
+
y
|
|
116
116
|
]
|
|
117
117
|
})
|
|
118
118
|
]
|
|
@@ -132,21 +132,25 @@ function g(n) {
|
|
|
132
132
|
function _(e) {
|
|
133
133
|
return e.source.kind === "url" || e.source.kind === "buffer";
|
|
134
134
|
}
|
|
135
|
-
function v({ source: e, config: n, className: c, style: l,
|
|
136
|
-
let
|
|
137
|
-
f(e),
|
|
138
|
-
}, [
|
|
135
|
+
function v({ source: e, config: n, className: c, style: l, layoutMode: u = "standalone", ariaLabel: d = "PDF 文档查看器", onInit: p, onReady: m, title: g, toolbar: _, footer: v }) {
|
|
136
|
+
let y = i(() => h(e, n), [e, n]), b = r((e) => {
|
|
137
|
+
f(e), p?.(e);
|
|
138
|
+
}, [p]);
|
|
139
139
|
return /* @__PURE__ */ o("section", {
|
|
140
|
-
className: [
|
|
140
|
+
className: [
|
|
141
|
+
"ui-document-viewer-v2",
|
|
142
|
+
u === "fill" && "ui-viewer-fill",
|
|
143
|
+
c
|
|
144
|
+
].filter(Boolean).join(" "),
|
|
141
145
|
style: l,
|
|
142
|
-
"aria-label":
|
|
146
|
+
"aria-label": d,
|
|
143
147
|
children: [
|
|
144
|
-
(
|
|
148
|
+
(g !== void 0 || _ !== void 0) && /* @__PURE__ */ o("div", {
|
|
145
149
|
className: "ui-viewer-toolbar",
|
|
146
|
-
children: [
|
|
150
|
+
children: [g !== void 0 && /* @__PURE__ */ a("div", {
|
|
147
151
|
className: "ui-viewer-title",
|
|
148
|
-
children:
|
|
149
|
-
}),
|
|
152
|
+
children: g
|
|
153
|
+
}), _]
|
|
150
154
|
}),
|
|
151
155
|
/* @__PURE__ */ a(t, {
|
|
152
156
|
fallback: /* @__PURE__ */ a("div", {
|
|
@@ -155,14 +159,14 @@ function v({ source: e, config: n, className: c, style: l, ariaLabel: u = "PDF
|
|
|
155
159
|
}),
|
|
156
160
|
children: /* @__PURE__ */ a(s, {
|
|
157
161
|
className: "ui-document-viewer-v2-engine",
|
|
158
|
-
config:
|
|
159
|
-
onInit:
|
|
160
|
-
onReady:
|
|
162
|
+
config: y,
|
|
163
|
+
onInit: b,
|
|
164
|
+
onReady: m
|
|
161
165
|
}, e.id)
|
|
162
166
|
}),
|
|
163
|
-
|
|
167
|
+
v !== void 0 && /* @__PURE__ */ a("div", {
|
|
164
168
|
className: "ui-viewer-footer",
|
|
165
|
-
children:
|
|
169
|
+
children: v
|
|
166
170
|
})
|
|
167
171
|
]
|
|
168
172
|
});
|