@jc-times/business-ui 0.2.43 → 0.2.53
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/AGENTS.md +6 -6
- package/CHANGELOG.md +51 -14
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +12 -10
- package/dist/Cascader.js +8 -0
- package/dist/Combobox.js +104 -61
- package/dist/DataTableHorizontalScrollbar.js +14 -11
- package/dist/FloatingControls.js +14 -13
- package/dist/MultilineAutoComplete.js +80 -0
- package/dist/SortableList.js +105 -32
- package/dist/UserProfilePopover.js +69 -0
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/business-ui.js +41 -38
- package/dist/document-viewer/PdfWorkspace.js +14 -12
- package/dist/document-viewer-v2/HeadlessPdfViewer.js +147 -142
- package/dist/sortable-transfer-scope.js +33 -0
- package/dist/styles.css +1 -1
- package/dist/types/Combobox.d.ts +1 -0
- package/dist/types/FloatingControls.d.ts +2 -1
- package/dist/types/MultilineAutoComplete.d.ts +20 -0
- package/dist/types/SortableList.d.ts +10 -2
- package/dist/types/UserProfilePopover.d.ts +20 -0
- package/dist/types/document-viewer/PdfWorkspace.d.ts +2 -1
- package/dist/types/document-viewer-v2/HeadlessPdfViewer.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/sortable-transfer-scope.d.ts +27 -0
- package/dist/vendor/embedpdf-zoom-react.js +187 -0
- package/docs/agent-guide.md +26 -3
- package/docs/api.md +39 -14
- package/docs/cascader.md +2 -0
- package/docs/component-strategy.md +1 -1
- package/docs/data-table.md +124 -120
- package/docs/dependencies.md +57 -57
- package/docs/document-viewer-v2.md +8 -0
- package/docs/document-viewer.md +28 -28
- package/docs/file-preparation.md +11 -11
- package/docs/maturity-migration.md +62 -62
- package/docs/mrt-poc.md +204 -204
- package/docs/release.md +32 -32
- package/docs/user-profile.md +17 -0
- package/docs/viewport-qa.md +37 -7
- package/licenses/embedpdf-MIT.txt +21 -0
- package/package.json +164 -161
- package/patches/@embedpdf__plugin-zoom@2.15.0.patch +77 -0
package/dist/SortableList.js
CHANGED
|
@@ -1,45 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { activeSortableTransfer as e, beginSortableTransfer as t, consumeSortableTransfer as n, endSortableTransfer as r, registerSortableTarget as i, routeSortableTarget as a, useSortableTransferScope as o } from "./sortable-transfer-scope.js";
|
|
2
|
+
import { GripVertical as s } from "lucide-react";
|
|
3
|
+
import { useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d } from "react";
|
|
4
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import { Button as m, GridList as h, GridListItem as g, useDragAndDrop as _ } from "react-aria-components";
|
|
5
6
|
//#region src/SortableList.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
7
|
+
function v(o) {
|
|
8
|
+
let v = d(/* @__PURE__ */ new Set()), b = d({ mime: `application/x-ui-sortable-${Math.random().toString(36).slice(2)}` }).current, x = o.transferScope?.mime ?? b.mime, S = d(o);
|
|
9
|
+
S.current = o, c(() => () => {
|
|
10
|
+
r(o.transferScope, b);
|
|
11
|
+
}, [o.transferScope, b]), c(() => {
|
|
12
|
+
o.disabled && (v.current.clear(), r(o.transferScope, b));
|
|
13
|
+
}, [
|
|
14
|
+
o.disabled,
|
|
15
|
+
o.transferScope,
|
|
16
|
+
b
|
|
17
|
+
]);
|
|
18
|
+
let C = u(() => o.items.map((e, t) => ({
|
|
8
19
|
item: e,
|
|
9
20
|
index: t,
|
|
10
|
-
key:
|
|
11
|
-
})), [
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
key: o.getKey(e)
|
|
22
|
+
})), [o.items, o.getKey]);
|
|
23
|
+
function w() {
|
|
24
|
+
let t = e(o.transferScope), n = t?.keys ?? v.current;
|
|
25
|
+
return {
|
|
26
|
+
keys: n,
|
|
27
|
+
moving: t ? t.consumed ? [] : t.resolve() : o.items.filter((e) => n.has(o.getKey(e))),
|
|
28
|
+
external: !!(t && t.source !== b)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function T(e, t) {
|
|
32
|
+
let { keys: n, moving: r, external: i } = w(), a = o.items.find((t) => o.getKey(t) === e);
|
|
33
|
+
if (o.disabled || !a || !r.length || r.length !== n.size || n.has(e)) return null;
|
|
34
|
+
if (t === "on") {
|
|
35
|
+
if (!o.onDropOnItem || o.canDropOnItem && !o.canDropOnItem(r, a)) return null;
|
|
36
|
+
} else if (i && (!o.onDropBetweenItems || o.canDropBetweenItems && !o.canDropBetweenItems(r, a, t))) return null;
|
|
37
|
+
return {
|
|
38
|
+
moving: r,
|
|
39
|
+
target: a,
|
|
40
|
+
keys: n,
|
|
41
|
+
external: i
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
let E = d(D);
|
|
45
|
+
E.current = D, l(() => i(o.transferScope, b, {
|
|
46
|
+
accepts: (e) => S.current.items.some((t) => S.current.getKey(t) === e),
|
|
47
|
+
commit: (e, t) => E.current(e, t)
|
|
48
|
+
}), [o.transferScope, b]);
|
|
49
|
+
function D(e, t) {
|
|
50
|
+
let r = T(e, t);
|
|
51
|
+
if (!r) {
|
|
52
|
+
o.items.some((t) => o.getKey(t) === e) || a(o.transferScope, b, e, t);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
n(o.transferScope), t === "on" ? o.onDropOnItem?.(r.moving, r.target) : r.external ? o.onDropBetweenItems?.(r.moving, r.target, t) : o.onReorder(y(o.items, r.keys, e, t, o.getKey));
|
|
56
|
+
}
|
|
57
|
+
function O(e) {
|
|
58
|
+
let n = new Set(e);
|
|
59
|
+
v.current = n, t(o.transferScope, {
|
|
60
|
+
source: b,
|
|
61
|
+
keys: n,
|
|
62
|
+
resolve: () => S.current.disabled ? [] : S.current.items.filter((e) => n.has(S.current.getKey(e)))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
let { dragAndDropHooks: k } = _({
|
|
66
|
+
isDisabled: o.disabled,
|
|
67
|
+
getItems: (e) => (O(e), [...e].map((e) => ({
|
|
68
|
+
"text/plain": String(e),
|
|
69
|
+
[x]: String(e)
|
|
70
|
+
}))),
|
|
14
71
|
getAllowedDropOperations: () => ["move"],
|
|
15
|
-
|
|
72
|
+
onDragStart: (e) => O(e.keys),
|
|
73
|
+
onDragEnd: () => {
|
|
74
|
+
v.current.clear(), r(o.transferScope, b);
|
|
75
|
+
},
|
|
76
|
+
shouldAcceptItemDrop: (e, t) => t.has(x) && !!T(e.key, "on"),
|
|
77
|
+
getDropOperation: (e, t) => t.has(x) && e.type === "item" && T(e.key, e.dropPosition) ? "move" : "cancel",
|
|
78
|
+
onMove: (e) => D(e.target.key, e.target.dropPosition),
|
|
79
|
+
onInsert: o.transferScope && o.onDropBetweenItems ? (e) => D(e.target.key, e.target.dropPosition) : void 0,
|
|
80
|
+
onItemDrop: o.transferScope && o.onDropOnItem ? (e) => D(e.target.key, "on") : void 0
|
|
16
81
|
});
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
"aria-label":
|
|
19
|
-
items:
|
|
82
|
+
return /* @__PURE__ */ f(h, {
|
|
83
|
+
"aria-label": o["aria-label"],
|
|
84
|
+
items: C,
|
|
20
85
|
selectionMode: "none",
|
|
21
|
-
dragAndDropHooks:
|
|
22
|
-
className: ["ui-sortable-list",
|
|
23
|
-
children: ({ item:
|
|
24
|
-
id:
|
|
25
|
-
textValue:
|
|
86
|
+
dragAndDropHooks: o.disabled ? void 0 : k,
|
|
87
|
+
className: ["ui-sortable-list", o.className].filter(Boolean).join(" "),
|
|
88
|
+
children: ({ item: e, index: t, key: n }) => /* @__PURE__ */ p(g, {
|
|
89
|
+
id: n,
|
|
90
|
+
textValue: o.getTextValue(e, t),
|
|
26
91
|
className: "ui-sortable-item",
|
|
27
|
-
children: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"aria-label": c.dragLabel?.(t, a) ?? `拖动第 ${a + 1} 项排序`,
|
|
31
|
-
children: /* @__PURE__ */ n(e, {
|
|
92
|
+
children: [
|
|
93
|
+
!o.disabled && /* @__PURE__ */ f("span", {
|
|
94
|
+
className: "ui-sortable-placeholder",
|
|
32
95
|
"aria-hidden": "true",
|
|
33
|
-
|
|
96
|
+
children: o.draggingLabel ?? "原位置保留,松开后移动"
|
|
97
|
+
}),
|
|
98
|
+
!o.disabled && /* @__PURE__ */ f(m, {
|
|
99
|
+
slot: "drag",
|
|
100
|
+
className: "ui-sortable-handle",
|
|
101
|
+
"aria-label": o.dragLabel?.(e, t) ?? `拖动第 ${t + 1} 项排序`,
|
|
102
|
+
children: /* @__PURE__ */ f(s, {
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
size: 18
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ f("div", {
|
|
108
|
+
className: "ui-sortable-content",
|
|
109
|
+
children: o.renderItem(e, t)
|
|
34
110
|
})
|
|
35
|
-
|
|
36
|
-
className: "ui-sortable-content",
|
|
37
|
-
children: c.renderItem(t, a)
|
|
38
|
-
})]
|
|
111
|
+
]
|
|
39
112
|
})
|
|
40
|
-
});
|
|
113
|
+
}, o.disabled ? "static" : "sortable");
|
|
41
114
|
}
|
|
42
|
-
function
|
|
115
|
+
function y(e, t, n, r, i) {
|
|
43
116
|
let a = e.filter((e) => t.has(i(e)));
|
|
44
117
|
if (!a.length || r === "on") return e;
|
|
45
118
|
let o = e.filter((e) => !t.has(i(e))), s = o.findIndex((e) => i(e) === n);
|
|
@@ -52,4 +125,4 @@ function l(e, t, n, r, i) {
|
|
|
52
125
|
];
|
|
53
126
|
}
|
|
54
127
|
//#endregion
|
|
55
|
-
export {
|
|
128
|
+
export { v as SortableList, y as moveSortableItems, o as useSortableTransferScope };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Popover as e } from "./FloatingControls.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/UserProfilePopover.tsx
|
|
4
|
+
function r({ name: e, url: n, large: r = !1 }) {
|
|
5
|
+
return /* @__PURE__ */ t("span", {
|
|
6
|
+
className: `ui-user-avatar${r ? " ui-user-avatar-large" : ""}`,
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
children: n ? /* @__PURE__ */ t("img", {
|
|
9
|
+
src: n,
|
|
10
|
+
alt: ""
|
|
11
|
+
}) : Array.from(e.trim())[0] ?? "?"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function i({ name: i, code: a, department: o, tag: s, avatarUrl: c, avatarColor: l, trigger: u, codeLabel: d = "编号", departmentLabel: f = "部门", side: p = "bottom", align: m = "start", open: h, defaultOpen: g, onOpenChange: _, className: v = "" }) {
|
|
15
|
+
let y = l ? { "--ui-user-avatar-bg": l } : void 0;
|
|
16
|
+
return /* @__PURE__ */ t(e, {
|
|
17
|
+
trigger: u ?? /* @__PURE__ */ n("button", {
|
|
18
|
+
type: "button",
|
|
19
|
+
className: "ui-user-chip",
|
|
20
|
+
style: y,
|
|
21
|
+
children: [/* @__PURE__ */ t(r, {
|
|
22
|
+
name: i,
|
|
23
|
+
url: c
|
|
24
|
+
}), /* @__PURE__ */ t("span", {
|
|
25
|
+
className: "ui-user-chip-name",
|
|
26
|
+
children: i
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
side: p,
|
|
30
|
+
align: m,
|
|
31
|
+
open: h,
|
|
32
|
+
defaultOpen: g,
|
|
33
|
+
onOpenChange: _,
|
|
34
|
+
contentLabel: `${i}的用户资料`,
|
|
35
|
+
contentClassName: `ui-user-profile-popover ${v}`.trim(),
|
|
36
|
+
children: /* @__PURE__ */ n("div", {
|
|
37
|
+
className: "ui-user-profile",
|
|
38
|
+
style: y,
|
|
39
|
+
children: [/* @__PURE__ */ n("div", {
|
|
40
|
+
className: "ui-user-profile-header",
|
|
41
|
+
children: [/* @__PURE__ */ t(r, {
|
|
42
|
+
name: i,
|
|
43
|
+
url: c,
|
|
44
|
+
large: !0
|
|
45
|
+
}), /* @__PURE__ */ n("div", {
|
|
46
|
+
className: "ui-user-profile-heading",
|
|
47
|
+
children: [/* @__PURE__ */ t("strong", {
|
|
48
|
+
className: "ui-user-profile-name",
|
|
49
|
+
children: i
|
|
50
|
+
}), s == null ? null : /* @__PURE__ */ t("span", {
|
|
51
|
+
className: "ui-user-profile-tag",
|
|
52
|
+
children: s
|
|
53
|
+
})]
|
|
54
|
+
})]
|
|
55
|
+
}), a == null && o == null ? null : /* @__PURE__ */ n("dl", {
|
|
56
|
+
className: "ui-user-profile-details",
|
|
57
|
+
children: [a == null ? null : /* @__PURE__ */ n("div", {
|
|
58
|
+
className: "ui-user-profile-row",
|
|
59
|
+
children: [/* @__PURE__ */ t("dt", { children: d }), /* @__PURE__ */ t("dd", { children: a })]
|
|
60
|
+
}), o == null ? null : /* @__PURE__ */ n("div", {
|
|
61
|
+
className: "ui-user-profile-row",
|
|
62
|
+
children: [/* @__PURE__ */ t("dt", { children: f }), /* @__PURE__ */ t("dd", { children: o })]
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { i as UserProfilePopover };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, a = (i, a, o, s) => {
|
|
10
|
+
if (a && typeof a == "object" || typeof a == "function") for (var c = n(a), l = 0, u = c.length, d; l < u; l++) d = c[l], !r.call(i, d) && d !== o && e(i, d, {
|
|
11
|
+
get: ((e) => a[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = t(a, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return i;
|
|
15
|
+
}, o = (e, t, n) => (a(e, t, "default"), n && a(n, t, "default"));
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as __exportAll, o as __reExport };
|
package/dist/business-ui.js
CHANGED
|
@@ -4,41 +4,44 @@ import { Alert as r } from "./Alert.js";
|
|
|
4
4
|
import { EmptyState as i } from "./EmptyState.js";
|
|
5
5
|
import { Skeleton as a, SkeletonText as o } from "./Skeleton.js";
|
|
6
6
|
import { Popconfirm as s, Popover as c, Tooltip as l } from "./FloatingControls.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
|
|
7
|
+
import { UserProfilePopover as u } from "./UserProfilePopover.js";
|
|
8
|
+
import { Checkbox as d, FormField as f, SelectInput as p, TextArea as m, TextInput as h } from "./FormField.js";
|
|
9
|
+
import { Select as g } from "./Select.js";
|
|
10
|
+
import { Combobox as _ } from "./Combobox.js";
|
|
11
|
+
import { AutoComplete as v, Autocomplete as y } from "./AutoComplete.js";
|
|
12
|
+
import { ToastProvider as b, useToast as x } from "./Toast.js";
|
|
13
|
+
import { DataTableTheme as S } from "./DataTableTheme.js";
|
|
14
|
+
import { DataTableMergedRows as C } from "./DataTableMergedRows.js";
|
|
15
|
+
import { DataTable as w, DataTableView as T, sortRows as E, useDataTable as D } from "./data-table.js";
|
|
16
|
+
import { ExplainableButton as O } from "./ExplainableButton.js";
|
|
17
|
+
import { Dialog as k, ModalShell as A } from "./ModalShell.js";
|
|
18
|
+
import { DateInput as j, calendarDays as M, parseDate as N } from "./DateInput.js";
|
|
19
|
+
import { Pagination as P, clampPage as F, pageCount as I, visiblePages as L } from "./Pagination.js";
|
|
20
|
+
import { RovingTabList as R, RovingTabPanel as z, nextRovingTabValue as B } from "./RovingTabs.js";
|
|
21
|
+
import { ToggleSwitch as V } from "./ToggleSwitch.js";
|
|
22
|
+
import { SegmentedControl as H } from "./SegmentedControl.js";
|
|
23
|
+
import { AsyncState as U, RecoverableAsyncState as W } from "./RecoverableAsyncState.js";
|
|
24
|
+
import { useModalFocusTrap as G } from "./useModalFocusTrap.js";
|
|
25
|
+
import { AsyncSearchPicker as K } from "./AsyncSearchPicker.js";
|
|
26
|
+
import { AsyncDirectoryPicker as q } from "./AsyncDirectoryPicker.js";
|
|
27
|
+
import { DropdownMenu as J, Menu as Y } from "./DropdownMenu.js";
|
|
28
|
+
import { ConfirmDialog as X } from "./ConfirmDialog.js";
|
|
29
|
+
import { useDebouncedValue as Z } from "./useDebouncedValue.js";
|
|
30
|
+
import { Badge as Q } from "./Badge.js";
|
|
31
|
+
import { MetricCard as $ } from "./MetricCard.js";
|
|
32
|
+
import { PageHeader as ee } from "./PageHeader.js";
|
|
33
|
+
import { SectionCard as te } from "./SectionCard.js";
|
|
34
|
+
import { useSortableTransferScope as ne } from "./sortable-transfer-scope.js";
|
|
35
|
+
import { SortableList as re, moveSortableItems as ie } from "./SortableList.js";
|
|
36
|
+
import { TreeSelect as ae, buildTreeSelectTree as oe, filterTreeSelectTree as se } from "./TreeSelect.js";
|
|
37
|
+
import { Cascader as ce, buildCascaderOptions as le, indexCascaderPaths as ue } from "./Cascader.js";
|
|
38
|
+
import { StructuredAddressInput as de, findAddressRegionPath as fe, flattenAddressRegions as pe, searchAddressRegions as me } from "./StructuredAddressInput.js";
|
|
39
|
+
import { FileDropzone as he, acceptsFile as ge } from "./FileDropzone.js";
|
|
40
|
+
import { useFilePreparation as _e } from "./useFilePreparation.js";
|
|
41
|
+
import { FilePreparationDialog as ve } from "./FilePreparationDialog.js";
|
|
42
|
+
import { PreparedFileDropzone as ye } from "./PreparedFileDropzone.js";
|
|
43
|
+
import { formatDecimalAmount as be, formatScaledMoney as xe } from "./amount-format.js";
|
|
44
|
+
import { NumericInput as Se, ScaledNumericInput as Ce } from "./NumericInput.js";
|
|
45
|
+
import { MultiSelect as we } from "./MultiSelect.js";
|
|
46
|
+
import { MultilineAutoComplete as Te } from "./MultilineAutoComplete.js";
|
|
47
|
+
export { r as Alert, q as AsyncDirectoryPicker, K as AsyncSearchPicker, U as AsyncState, v as AutoComplete, y as Autocomplete, Q as Badge, e as Button, ce as Cascader, d as Checkbox, _ as Combobox, X as ConfirmDialog, w as DataTable, C as DataTableMergedRows, S as DataTableTheme, T as DataTableView, j as DateInput, k as Dialog, J as DropdownMenu, i as EmptyState, O as ExplainableButton, he as FileDropzone, ve as FilePreparationDialog, f as FormField, t as LinkButton, Y as Menu, $ as MetricCard, A as ModalShell, we as MultiSelect, Te as MultilineAutoComplete, Se as NumericInput, ee as PageHeader, P as Pagination, s as Popconfirm, c as Popover, ye as PreparedFileDropzone, W as RecoverableAsyncState, R as RovingTabList, z as RovingTabPanel, Ce as ScaledNumericInput, te as SectionCard, H as SegmentedControl, g as Select, p as SelectInput, a as Skeleton, o as SkeletonText, re as SortableList, de as StructuredAddressInput, m as TextArea, h as TextInput, b as ToastProvider, V as ToggleSwitch, l as Tooltip, ae as TreeSelect, u as UserProfilePopover, ge as acceptsFile, le as buildCascaderOptions, oe as buildTreeSelectTree, n as buttonClassName, M as calendarDays, F as clampPage, se as filterTreeSelectTree, fe as findAddressRegionPath, pe as flattenAddressRegions, be as formatDecimalAmount, xe as formatScaledMoney, ue as indexCascaderPaths, ie as moveSortableItems, B as nextRovingTabValue, I as pageCount, N as parseDate, me as searchAddressRegions, E as sortRows, D as useDataTable, Z as useDebouncedValue, _e as useFilePreparation, G as useModalFocusTrap, ne as useSortableTransferScope, x as useToast, L as visiblePages };
|
|
@@ -4,21 +4,23 @@ import { createContext as r, useContext as i, useEffect as a, useState as o } fr
|
|
|
4
4
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
5
|
//#region src/document-viewer/PdfWorkspace.tsx
|
|
6
6
|
var l = r(!1), u = () => i(l);
|
|
7
|
-
function d({ rail: r, children: i,
|
|
8
|
-
let [
|
|
7
|
+
function d({ rail: r, children: i, defaultRailCollapsed: u, className: d = "", ...f }) {
|
|
8
|
+
let [p, m] = o(() => u ?? (typeof window < "u" && window.matchMedia("(max-width: 900px)").matches));
|
|
9
9
|
return a(() => {
|
|
10
|
-
let e = window.matchMedia("(max-width: 900px)"), t = () =>
|
|
10
|
+
let e = window.matchMedia("(max-width: 900px)"), t = () => {
|
|
11
|
+
(e.matches || u === void 0) && m(e.matches);
|
|
12
|
+
};
|
|
11
13
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
12
|
-
}, []), /* @__PURE__ */ c("div", {
|
|
13
|
-
...
|
|
14
|
-
className: `ui-pdf-workspace ${
|
|
14
|
+
}, [u]), /* @__PURE__ */ c("div", {
|
|
15
|
+
...f,
|
|
16
|
+
className: `ui-pdf-workspace ${p ? "ui-rail-collapsed" : ""} ${d}`,
|
|
15
17
|
children: [
|
|
16
18
|
/* @__PURE__ */ s("aside", {
|
|
17
19
|
className: "ui-viewer-rail",
|
|
18
|
-
hidden:
|
|
20
|
+
hidden: p,
|
|
19
21
|
"aria-label": "页面缩略图",
|
|
20
22
|
children: /* @__PURE__ */ s(l.Provider, {
|
|
21
|
-
value:
|
|
23
|
+
value: p,
|
|
22
24
|
children: r
|
|
23
25
|
})
|
|
24
26
|
}),
|
|
@@ -26,10 +28,10 @@ function d({ rail: r, children: i, className: u = "", ...d }) {
|
|
|
26
28
|
variant: "secondary",
|
|
27
29
|
size: "compact",
|
|
28
30
|
className: "ui-viewer-rail-toggle",
|
|
29
|
-
"aria-expanded": !
|
|
30
|
-
"aria-label":
|
|
31
|
-
onClick: () =>
|
|
32
|
-
children: [s(
|
|
31
|
+
"aria-expanded": !p,
|
|
32
|
+
"aria-label": p ? "显示页面缩略图" : "隐藏页面缩略图",
|
|
33
|
+
onClick: () => m((e) => !e),
|
|
34
|
+
children: [s(p ? n : t, { size: 17 }), /* @__PURE__ */ s("span", { children: p ? "页面" : "收起" })]
|
|
33
35
|
}),
|
|
34
36
|
/* @__PURE__ */ s("div", {
|
|
35
37
|
className: "ui-viewer-stage",
|