@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.
Files changed (44) hide show
  1. package/AGENTS.md +6 -6
  2. package/CHANGELOG.md +51 -14
  3. package/README.md +7 -7
  4. package/THIRD_PARTY_NOTICES.md +12 -10
  5. package/dist/Cascader.js +8 -0
  6. package/dist/Combobox.js +104 -61
  7. package/dist/DataTableHorizontalScrollbar.js +14 -11
  8. package/dist/FloatingControls.js +14 -13
  9. package/dist/MultilineAutoComplete.js +80 -0
  10. package/dist/SortableList.js +105 -32
  11. package/dist/UserProfilePopover.js +69 -0
  12. package/dist/_virtual/_rolldown/runtime.js +17 -0
  13. package/dist/business-ui.js +41 -38
  14. package/dist/document-viewer/PdfWorkspace.js +14 -12
  15. package/dist/document-viewer-v2/HeadlessPdfViewer.js +147 -142
  16. package/dist/sortable-transfer-scope.js +33 -0
  17. package/dist/styles.css +1 -1
  18. package/dist/types/Combobox.d.ts +1 -0
  19. package/dist/types/FloatingControls.d.ts +2 -1
  20. package/dist/types/MultilineAutoComplete.d.ts +20 -0
  21. package/dist/types/SortableList.d.ts +10 -2
  22. package/dist/types/UserProfilePopover.d.ts +20 -0
  23. package/dist/types/document-viewer/PdfWorkspace.d.ts +2 -1
  24. package/dist/types/document-viewer-v2/HeadlessPdfViewer.d.ts +1 -0
  25. package/dist/types/index.d.ts +2 -0
  26. package/dist/types/sortable-transfer-scope.d.ts +27 -0
  27. package/dist/vendor/embedpdf-zoom-react.js +187 -0
  28. package/docs/agent-guide.md +26 -3
  29. package/docs/api.md +39 -14
  30. package/docs/cascader.md +2 -0
  31. package/docs/component-strategy.md +1 -1
  32. package/docs/data-table.md +124 -120
  33. package/docs/dependencies.md +57 -57
  34. package/docs/document-viewer-v2.md +8 -0
  35. package/docs/document-viewer.md +28 -28
  36. package/docs/file-preparation.md +11 -11
  37. package/docs/maturity-migration.md +62 -62
  38. package/docs/mrt-poc.md +204 -204
  39. package/docs/release.md +32 -32
  40. package/docs/user-profile.md +17 -0
  41. package/docs/viewport-qa.md +37 -7
  42. package/licenses/embedpdf-MIT.txt +21 -0
  43. package/package.json +164 -161
  44. package/patches/@embedpdf__plugin-zoom@2.15.0.patch +77 -0
@@ -1,45 +1,118 @@
1
- import { GripVertical as e } from "lucide-react";
2
- import { useMemo as t } from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { Button as i, GridList as a, GridListItem as o, useDragAndDrop as s } from "react-aria-components";
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 c(c) {
7
- let u = t(() => c.items.map((e, t) => ({
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: c.getKey(e)
11
- })), [c.items, c.getKey]), { dragAndDropHooks: d } = s({
12
- isDisabled: c.disabled,
13
- getItems: (e) => [...e].map((e) => ({ "text/plain": String(e) })),
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
- onReorder: (e) => c.onReorder(l(c.items, e.keys, e.target.key, e.target.dropPosition, c.getKey))
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__ */ n(a, {
18
- "aria-label": c["aria-label"],
19
- items: u,
82
+ return /* @__PURE__ */ f(h, {
83
+ "aria-label": o["aria-label"],
84
+ items: C,
20
85
  selectionMode: "none",
21
- dragAndDropHooks: d,
22
- className: ["ui-sortable-list", c.className].filter(Boolean).join(" "),
23
- children: ({ item: t, index: a, key: s }) => /* @__PURE__ */ r(o, {
24
- id: s,
25
- textValue: c.getTextValue(t, a),
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: [!c.disabled && /* @__PURE__ */ n(i, {
28
- slot: "drag",
29
- className: "ui-sortable-handle",
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
- size: 18
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
- }), /* @__PURE__ */ n("div", {
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 l(e, t, n, r, i) {
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 { c as SortableList, l as moveSortableItems };
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 };
@@ -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 { Checkbox as u, FormField as d, SelectInput as f, TextArea as p, TextInput as m } from "./FormField.js";
8
- import { Select as h } from "./Select.js";
9
- import { Combobox as g } from "./Combobox.js";
10
- import { AutoComplete as _, Autocomplete as v } from "./AutoComplete.js";
11
- import { ToastProvider as y, useToast as b } from "./Toast.js";
12
- import { DataTableTheme as x } from "./DataTableTheme.js";
13
- import { DataTableMergedRows as S } from "./DataTableMergedRows.js";
14
- import { DataTable as C, DataTableView as w, sortRows as T, useDataTable as E } from "./data-table.js";
15
- import { ExplainableButton as D } from "./ExplainableButton.js";
16
- import { Dialog as O, ModalShell as k } from "./ModalShell.js";
17
- import { DateInput as A, calendarDays as j, parseDate as M } from "./DateInput.js";
18
- import { Pagination as N, clampPage as P, pageCount as F, visiblePages as I } from "./Pagination.js";
19
- import { RovingTabList as L, RovingTabPanel as R, nextRovingTabValue as z } from "./RovingTabs.js";
20
- import { ToggleSwitch as B } from "./ToggleSwitch.js";
21
- import { SegmentedControl as V } from "./SegmentedControl.js";
22
- import { AsyncState as H, RecoverableAsyncState as U } from "./RecoverableAsyncState.js";
23
- import { useModalFocusTrap as W } from "./useModalFocusTrap.js";
24
- import { AsyncSearchPicker as G } from "./AsyncSearchPicker.js";
25
- import { AsyncDirectoryPicker as K } from "./AsyncDirectoryPicker.js";
26
- import { DropdownMenu as q, Menu as J } from "./DropdownMenu.js";
27
- import { ConfirmDialog as Y } from "./ConfirmDialog.js";
28
- import { useDebouncedValue as X } from "./useDebouncedValue.js";
29
- import { Badge as Z } from "./Badge.js";
30
- import { MetricCard as Q } from "./MetricCard.js";
31
- import { PageHeader as $ } from "./PageHeader.js";
32
- import { SectionCard as ee } from "./SectionCard.js";
33
- import { SortableList as te, moveSortableItems as ne } from "./SortableList.js";
34
- import { TreeSelect as re, buildTreeSelectTree as ie, filterTreeSelectTree as ae } from "./TreeSelect.js";
35
- import { Cascader as oe, buildCascaderOptions as se, indexCascaderPaths as ce } from "./Cascader.js";
36
- import { StructuredAddressInput as le, findAddressRegionPath as ue, flattenAddressRegions as de, searchAddressRegions as fe } from "./StructuredAddressInput.js";
37
- import { FileDropzone as pe, acceptsFile as me } from "./FileDropzone.js";
38
- import { useFilePreparation as he } from "./useFilePreparation.js";
39
- import { FilePreparationDialog as ge } from "./FilePreparationDialog.js";
40
- import { PreparedFileDropzone as _e } from "./PreparedFileDropzone.js";
41
- import { formatDecimalAmount as ve, formatScaledMoney as ye } from "./amount-format.js";
42
- import { NumericInput as be, ScaledNumericInput as xe } from "./NumericInput.js";
43
- import { MultiSelect as Se } from "./MultiSelect.js";
44
- export { r as Alert, K as AsyncDirectoryPicker, G as AsyncSearchPicker, H as AsyncState, _ as AutoComplete, v as Autocomplete, Z as Badge, e as Button, oe as Cascader, u as Checkbox, g as Combobox, Y as ConfirmDialog, C as DataTable, S as DataTableMergedRows, x as DataTableTheme, w as DataTableView, A as DateInput, O as Dialog, q as DropdownMenu, i as EmptyState, D as ExplainableButton, pe as FileDropzone, ge as FilePreparationDialog, d as FormField, t as LinkButton, J as Menu, Q as MetricCard, k as ModalShell, Se as MultiSelect, be as NumericInput, $ as PageHeader, N as Pagination, s as Popconfirm, c as Popover, _e as PreparedFileDropzone, U as RecoverableAsyncState, L as RovingTabList, R as RovingTabPanel, xe as ScaledNumericInput, ee as SectionCard, V as SegmentedControl, h as Select, f as SelectInput, a as Skeleton, o as SkeletonText, te as SortableList, le as StructuredAddressInput, p as TextArea, m as TextInput, y as ToastProvider, B as ToggleSwitch, l as Tooltip, re as TreeSelect, me as acceptsFile, se as buildCascaderOptions, ie as buildTreeSelectTree, n as buttonClassName, j as calendarDays, P as clampPage, ae as filterTreeSelectTree, ue as findAddressRegionPath, de as flattenAddressRegions, ve as formatDecimalAmount, ye as formatScaledMoney, ce as indexCascaderPaths, ne as moveSortableItems, z as nextRovingTabValue, F as pageCount, M as parseDate, fe as searchAddressRegions, T as sortRows, E as useDataTable, X as useDebouncedValue, he as useFilePreparation, W as useModalFocusTrap, b as useToast, I as visiblePages };
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, className: u = "", ...d }) {
8
- let [f, p] = o(() => typeof window < "u" && window.matchMedia("(max-width: 900px)").matches);
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 = () => p(e.matches);
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
- ...d,
14
- className: `ui-pdf-workspace ${f ? "ui-rail-collapsed" : ""} ${u}`,
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: f,
20
+ hidden: p,
19
21
  "aria-label": "页面缩略图",
20
22
  children: /* @__PURE__ */ s(l.Provider, {
21
- value: f,
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": !f,
30
- "aria-label": f ? "显示页面缩略图" : "隐藏页面缩略图",
31
- onClick: () => p((e) => !e),
32
- children: [s(f ? n : t, { size: 17 }), /* @__PURE__ */ s("span", { children: f ? "页面" : "收起" })]
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",