@jc-times/business-ui 0.2.53 → 0.2.54

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 CHANGED
@@ -48,6 +48,10 @@
48
48
 
49
49
  # Changelog
50
50
 
51
+ ## 0.2.54
52
+
53
+ - PDFium Headless 新增 `mobileMode="continuous-reader"`:手机/粗指针连续阅读时恢复原生纵向滚动,收起缩略图与分页底栏,并压缩工具栏;`searchMode="collapsible"` 统一提供搜索开关和手机图标布局。
54
+
51
55
  ## 0.2.48
52
56
 
53
57
  - Cascader:按可见视口处理多列展开的边缘碰撞,修复右侧表单区县列超出屏幕的问题。
package/README.md CHANGED
@@ -21,18 +21,18 @@ React 等 peer dependencies 按所安装版本的 package.json 配置。应用
21
21
 
22
22
  | 文档 | 用途 |
23
23
  | --- | --- |
24
- | [Agent 使用指南](docs/agent-guide.md) | 场景选型、组件组合、边界和接入检查 |
25
- | [依赖维护](docs/dependencies.md) | 稳定版本核查、兼容例外、消费迁移要求 |
26
- | [公共 API](docs/api.md) | 公共行为、参数说明、数字输入与装饰示例;完整签名见安装包类型声明 |
27
- | [DataTable 与 MRT 迁移](docs/data-table.md) | 公共表格替代、旧参数兼容、完整配置、独立入口与合并明细;0.2.31起提供 |
28
- | [表格能力与 MRT 样例](docs/mrt-poc.md) | DataTable边界、筛选/列管理、产品行合并/展开、配置及性能;包含业务样例与公共API边界 |
24
+ | [Agent 使用指南](docs/agent-guide.md) | 场景选型、组件组合、边界和接入检查 |
25
+ | [依赖维护](docs/dependencies.md) | 稳定版本核查、兼容例外、消费迁移要求 |
26
+ | [公共 API](docs/api.md) | 公共行为、参数说明、数字输入与装饰示例;完整签名见安装包类型声明 |
27
+ | [DataTable 与 MRT 迁移](docs/data-table.md) | 公共表格替代、旧参数兼容、完整配置、独立入口与合并明细;0.2.31起提供 |
28
+ | [表格能力与 MRT 样例](docs/mrt-poc.md) | DataTable边界、筛选/列管理、产品行合并/展开、配置及性能;包含业务样例与公共API边界 |
29
29
  | [分段控制器](docs/api.md#分段控制器-segmentedcontrol) | 少量互斥选项、浅底/图标/纵向示例、兼容边界 |
30
30
  | [组件设计策略](docs/component-strategy.md) | 设计依据、公共能力范围和交互内核策略 |
31
31
  | [弹窗迁移](docs/modal-shell-migration.md) | header/content/footer 稳定插槽与历史写法迁移 |
32
32
  | [成熟度迁移](docs/maturity-migration.md) | 日期、多选、目录缓存、表格、文件限制及 Toast 行为 |
33
33
  | [上传前处理](docs/file-preparation.md) | 文件异步前处理、整批提交与取消 |
34
34
  | [文档查看器](docs/document-viewer.md) | PDF.js 与图片查看入口 |
35
- | [文档与图片查看器 V2](docs/document-viewer-v2.md) | PDFium/WASM、原生页面叠层、图片及 V1 兼容入口与迁移边界 |
35
+ | [文档与图片查看器 V2](docs/document-viewer-v2.md) | PDFium/WASM、原生页面叠层、图片及 V1 兼容入口与迁移边界 |
36
36
  | [多视口验收](docs/viewport-qa.md) | 桌面、移动与交互验证 |
37
37
  | [发布流程](docs/release.md) | registry、版本、制品与发布检查 |
38
38
  | [变更记录](CHANGELOG.md) | 按版本查看变化 |
@@ -52,4 +52,4 @@ React 等 peer dependencies 按所安装版本的 package.json 配置。应用
52
52
 
53
53
  仓库通过 `v<package.version>` 标签触发受控发布。公共包本地验证、正式发布、消费应用升级和生产部署是不同状态,应分别验证和记录。
54
54
 
55
- - [通用级联选择与部门/地址适配](docs/cascader.md)
55
+ - [通用级联选择与部门/地址适配](docs/cascader.md)
@@ -2,16 +2,16 @@
2
2
 
3
3
  `@jc-times/business-ui` 使用以下固定版本开源依赖。依赖源码未复制到本仓库;最终安装包由包管理器连同各自许可证一并解析。
4
4
 
5
- | Package | Version | License | Project |
6
- | --- | --- | --- | --- |
7
- | `lucide-react` | 1.45.0(开发验证版本) | ISC | https://github.com/lucide-icons/lucide |
8
- | `pdfjs-dist` | 6.3.289 | Apache-2.0 | https://github.com/mozilla/pdf.js |
9
- | `material-react-table` | 3.2.1 | MIT | https://github.com/KevinVandy/material-react-table |
10
- | `@mui/material`, `@mui/icons-material` | 7.3.11 | MIT | https://github.com/mui/material-ui |
11
- | `@mui/x-date-pickers` | 9.13.0 | MIT | https://github.com/mui/mui-x |
12
- | `@emotion/react`, `@emotion/styled` | 11.14.0 / 11.14.1 | MIT | https://github.com/emotion-js/emotion |
13
- | `@embedpdf/react-pdf-viewer` | 2.15.0 | MIT | https://github.com/embedpdf/embed-pdf-viewer |
14
- | `@embedpdf/core`, `@embedpdf/engines`, `@embedpdf/plugin-document-manager`, `@embedpdf/plugin-viewport`, `@embedpdf/plugin-scroll`, `@embedpdf/plugin-render`, `@embedpdf/plugin-zoom`, `@embedpdf/plugin-rotate`, `@embedpdf/plugin-thumbnail` | 2.15.0 | MIT | https://github.com/embedpdf/embed-pdf-viewer |
5
+ | Package | Version | License | Project |
6
+ | --- | --- | --- | --- |
7
+ | `lucide-react` | 1.45.0(开发验证版本) | ISC | https://github.com/lucide-icons/lucide |
8
+ | `pdfjs-dist` | 6.3.289 | Apache-2.0 | https://github.com/mozilla/pdf.js |
9
+ | `material-react-table` | 3.2.1 | MIT | https://github.com/KevinVandy/material-react-table |
10
+ | `@mui/material`, `@mui/icons-material` | 7.3.11 | MIT | https://github.com/mui/material-ui |
11
+ | `@mui/x-date-pickers` | 9.13.0 | MIT | https://github.com/mui/mui-x |
12
+ | `@emotion/react`, `@emotion/styled` | 11.14.0 / 11.14.1 | MIT | https://github.com/emotion-js/emotion |
13
+ | `@embedpdf/react-pdf-viewer` | 2.15.0 | MIT | https://github.com/embedpdf/embed-pdf-viewer |
14
+ | `@embedpdf/core`, `@embedpdf/engines`, `@embedpdf/plugin-document-manager`, `@embedpdf/plugin-viewport`, `@embedpdf/plugin-scroll`, `@embedpdf/plugin-render`, `@embedpdf/plugin-zoom`, `@embedpdf/plugin-rotate`, `@embedpdf/plugin-thumbnail` | 2.15.0 | MIT | https://github.com/embedpdf/embed-pdf-viewer |
15
15
  | PDFium(由 `@embedpdf/pdfium` 随查看器分发) | 2.15.0 | BSD-3-Clause / Apache-2.0 等,详见依赖内 `LICENSE.pdfium` | https://pdfium.googlesource.com/pdfium/ |
16
16
  | `@radix-ui/react-popover` | 1.1.23 | MIT | https://github.com/radix-ui/primitives |
17
17
  | `@radix-ui/react-dialog` | 1.1.23 | MIT | https://github.com/radix-ui/primitives |
@@ -26,6 +26,6 @@
26
26
 
27
27
  ## @rc-component/cascader 1.25.0
28
28
 
29
- MIT, Copyright (c) 2019-present react-component. Source: https://github.com/react-component/cascader. Used as the external Cascader interaction dependency; license reproduced in licenses/rc-cascader-MIT.txt. Transitive dependencies retain their own notices in their installed packages.
30
-
31
- 0.2.46 additionally bundles the React gesture entry of @embedpdf/plugin-zoom@2.15.0 with a pinned bounds/precision patch. Original MIT license: licenses/embedpdf-MIT.txt; patch: patches/@embedpdf__plugin-zoom@2.15.0.patch. Engine and core plugin implementations remain external.
29
+ MIT, Copyright (c) 2019-present react-component. Source: https://github.com/react-component/cascader. Used as the external Cascader interaction dependency; license reproduced in licenses/rc-cascader-MIT.txt. Transitive dependencies retain their own notices in their installed packages.
30
+
31
+ 0.2.46 additionally bundles the React gesture entry of @embedpdf/plugin-zoom@2.15.0 with a pinned bounds/precision patch. Original MIT license: licenses/embedpdf-MIT.txt; patch: patches/@embedpdf__plugin-zoom@2.15.0.patch. Engine and core plugin implementations remain external.
package/dist/Cascader.js CHANGED
@@ -53,14 +53,6 @@ function m(m) {
53
53
  displayRender: (e) => e.join(" / "),
54
54
  getPopupContainer: (e) => x instanceof HTMLElement ? x : e.ownerDocument.body,
55
55
  popupMatchSelectWidth: !1,
56
- popupAlign: {
57
- htmlRegion: "visible",
58
- overflow: {
59
- adjustX: 1,
60
- adjustY: 1,
61
- shiftX: !0
62
- }
63
- },
64
56
  components: { input: /* @__PURE__ */ d("input", {
65
57
  ...S,
66
58
  ref: O,
package/dist/Combobox.js CHANGED
@@ -1,149 +1,106 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
2
  import { Check as t, ChevronDown as n, LoaderCircle as r } from "lucide-react";
3
- import { useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c } from "react";
4
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
5
- import { Button as f, Collection as p, ComboBox as m, ComboBoxStateContext as h, Header as g, Input as _, Label as v, ListBox as y, ListBoxItem as b, ListBoxSection as x, Popover as S, Text as C } from "react-aria-components";
6
- import { ListLayout as w, Virtualizer as T } from "react-aria-components/Virtualizer";
3
+ import { useId as i, useMemo as a } from "react";
4
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
5
+ import { Button as l, ComboBox as u, Input as d, Label as f, ListBox as p, ListBoxItem as m, Popover as h, Text as g } from "react-aria-components";
6
+ import { ListLayout as _, Virtualizer as v } from "react-aria-components/Virtualizer";
7
7
  //#region src/Combobox.tsx
8
- var E = {
8
+ var y = {
9
9
  rowSize: 48,
10
10
  gap: 2,
11
11
  padding: 4
12
12
  };
13
- function D({ items: i, label: a, placeholder: c = "搜索或选择", inputValue: h, defaultInputValue: D, selectedKey: k, defaultSelectedKey: A, onInputChange: j, onSelectionChange: M, loading: N = !1, disabled: P = !1, required: F = !1, allowsCustomValue: I = !1, emptyText: L = "没有匹配项", helpText: R, error: z, virtualized: B = i.length > 100, className: V = "", inputRef: H, inputProps: U, placement: W = "bottom start", portalContainer: G }) {
14
- let K = `ui-combobox-${o().replaceAll(":", "")}`, q = e(G), J = s(() => Array.from(i), [i]), Y = s(() => {
15
- let e = /* @__PURE__ */ new Map();
16
- for (let t of J) {
17
- let n = t.group ?? "";
18
- e.has(n) || e.set(n, {
19
- id: `group:${n}`,
20
- label: n,
21
- items: []
22
- }), e.get(n).items.push(t);
23
- }
24
- return Array.from(e.values());
25
- }, [J]), X = J.some((e) => e.group !== void 0), Z = (e) => /* @__PURE__ */ u(b, {
26
- id: e.id,
27
- textValue: e.label,
28
- isDisabled: e.disabled,
29
- className: "ui-combobox-item",
30
- children: ({ isSelected: n }) => /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("span", { children: [/* @__PURE__ */ u("strong", { children: e.label }), e.description && /* @__PURE__ */ u("small", { children: e.description })] }), n && /* @__PURE__ */ u(t, {
31
- size: 15,
32
- "aria-hidden": "true"
33
- })] })
34
- }), Q = () => /* @__PURE__ */ u("div", {
35
- className: "ui-combobox-empty",
36
- children: N ? "正在加载…" : L
37
- }), $ = X ? /* @__PURE__ */ u(y, {
13
+ function b({ items: b, label: x, placeholder: S = "搜索或选择", inputValue: C, defaultInputValue: w, selectedKey: T, defaultSelectedKey: E, onInputChange: D, onSelectionChange: O, loading: k = !1, disabled: A = !1, required: j = !1, allowsCustomValue: M = !1, emptyText: N = "没有匹配项", helpText: P, error: F, virtualized: I = b.length > 100, className: L = "", inputRef: R, inputProps: z, placement: B = "bottom start", portalContainer: V }) {
14
+ let H = `ui-combobox-${i().replaceAll(":", "")}`, U = e(V), W = a(() => Array.from(b), [b]), G = /* @__PURE__ */ s(p, {
38
15
  className: "ui-combobox-list",
39
- items: Y,
40
- layout: "stack",
41
- renderEmptyState: Q,
42
- children: (e) => /* @__PURE__ */ d(x, {
16
+ items: W,
17
+ layout: I ? "grid" : "stack",
18
+ renderEmptyState: () => /* @__PURE__ */ s("div", {
19
+ className: "ui-combobox-empty",
20
+ children: k ? "正在加载…" : N
21
+ }),
22
+ children: (e) => /* @__PURE__ */ s(m, {
43
23
  id: e.id,
44
- "aria-label": e.label || "选项",
45
- children: [e.label && /* @__PURE__ */ u(g, {
46
- className: "ui-combobox-group-heading",
47
- children: e.label
48
- }), /* @__PURE__ */ u(p, {
49
- items: e.items,
50
- children: Z
51
- })]
24
+ textValue: e.label,
25
+ isDisabled: e.disabled,
26
+ className: "ui-combobox-item",
27
+ children: ({ isSelected: n }) => /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("span", { children: [/* @__PURE__ */ s("strong", { children: e.label }), e.description && /* @__PURE__ */ s("small", { children: e.description })] }), n && /* @__PURE__ */ s(t, {
28
+ size: 15,
29
+ "aria-hidden": "true"
30
+ })] })
52
31
  })
53
- }) : /* @__PURE__ */ u(y, {
54
- className: "ui-combobox-list",
55
- items: J,
56
- layout: B ? "grid" : "stack",
57
- renderEmptyState: Q,
58
- children: Z
59
32
  });
60
- return /* @__PURE__ */ d(m, {
61
- items: J,
62
- className: `ui-combobox ${V}`.trim(),
63
- inputValue: h,
64
- defaultInputValue: D,
65
- selectedKey: k,
66
- defaultSelectedKey: A,
67
- onInputChange: j,
68
- onSelectionChange: (e) => M?.(e === null ? null : String(e)),
69
- isDisabled: P,
70
- isRequired: F,
71
- allowsCustomValue: I,
33
+ return /* @__PURE__ */ c(u, {
34
+ className: `ui-combobox ${L}`.trim(),
35
+ inputValue: C,
36
+ defaultInputValue: w,
37
+ selectedKey: T,
38
+ defaultSelectedKey: E,
39
+ onInputChange: D,
40
+ onSelectionChange: (e) => O?.(e === null ? null : String(e)),
41
+ isDisabled: A,
42
+ isRequired: j,
43
+ allowsCustomValue: M,
72
44
  menuTrigger: "focus",
73
- "aria-label": a === void 0 ? U?.["aria-label"] : void 0,
74
- "aria-labelledby": a === void 0 ? U?.["aria-labelledby"] : void 0,
45
+ "aria-label": x === void 0 ? z?.["aria-label"] : void 0,
46
+ "aria-labelledby": x === void 0 ? z?.["aria-labelledby"] : void 0,
75
47
  children: [
76
- a === void 0 ? null : /* @__PURE__ */ d(v, {
48
+ x === void 0 ? null : /* @__PURE__ */ c(f, {
77
49
  className: "ui-form-label",
78
- children: [a, F && /* @__PURE__ */ u("span", {
50
+ children: [x, j && /* @__PURE__ */ s("span", {
79
51
  className: "ui-form-required",
80
52
  "aria-hidden": "true",
81
53
  children: "*"
82
54
  })]
83
55
  }),
84
- I && /* @__PURE__ */ u(O, {
85
- count: J.length,
86
- loading: N
87
- }),
88
- /* @__PURE__ */ d("div", {
56
+ /* @__PURE__ */ c("div", {
89
57
  className: "ui-combobox-control",
90
- children: [/* @__PURE__ */ u(_, {
91
- ...U,
92
- ref: H,
93
- id: K,
58
+ children: [/* @__PURE__ */ s(d, {
59
+ ...z,
60
+ ref: R,
61
+ id: H,
94
62
  className: "ui-input",
95
- placeholder: c,
96
- "aria-invalid": z ? !0 : U?.["aria-invalid"]
97
- }), /* @__PURE__ */ u(f, {
63
+ placeholder: S,
64
+ "aria-invalid": F ? !0 : z?.["aria-invalid"]
65
+ }), /* @__PURE__ */ s(l, {
98
66
  className: "ui-combobox-trigger",
99
67
  "aria-label": "展开选项",
100
- children: N ? /* @__PURE__ */ u(r, {
68
+ children: k ? /* @__PURE__ */ s(r, {
101
69
  className: "spin",
102
70
  size: 16
103
- }) : /* @__PURE__ */ u(n, { size: 16 })
71
+ }) : /* @__PURE__ */ s(n, { size: 16 })
104
72
  })]
105
73
  }),
106
- R === void 0 ? null : /* @__PURE__ */ u(C, {
74
+ P === void 0 ? null : /* @__PURE__ */ s(g, {
107
75
  slot: "description",
108
76
  className: "ui-form-help",
109
- children: R
77
+ children: P
110
78
  }),
111
- z === void 0 || z === "" ? null : /* @__PURE__ */ u(C, {
79
+ F === void 0 || F === "" ? null : /* @__PURE__ */ s(g, {
112
80
  slot: "errorMessage",
113
81
  className: "ui-form-error",
114
- children: z
82
+ children: F
115
83
  }),
116
- /* @__PURE__ */ d(S, {
84
+ /* @__PURE__ */ c(h, {
117
85
  className: "ui-combobox-popover",
118
86
  "data-ui-aria-overlay": "",
119
87
  maxHeight: 320,
120
- placement: W,
121
- UNSTABLE_portalContainer: q,
122
- children: [N && /* @__PURE__ */ d("div", {
88
+ placement: B,
89
+ UNSTABLE_portalContainer: U,
90
+ children: [k && /* @__PURE__ */ c("div", {
123
91
  className: "ui-combobox-loading",
124
- children: [/* @__PURE__ */ u(r, {
92
+ children: [/* @__PURE__ */ s(r, {
125
93
  className: "spin",
126
94
  size: 15
127
95
  }), "正在加载"]
128
- }), B ? /* @__PURE__ */ u(T, {
129
- layout: w,
130
- layoutOptions: E,
131
- children: $
132
- }) : $]
96
+ }), I ? /* @__PURE__ */ s(v, {
97
+ layout: _,
98
+ layoutOptions: y,
99
+ children: G
100
+ }) : G]
133
101
  })
134
102
  ]
135
103
  });
136
104
  }
137
- function O({ count: e, loading: t }) {
138
- let n = i(h), r = c(n);
139
- return r.current = n, a(() => {
140
- let n = r.current;
141
- e && !t && n?.isFocused && !n.isOpen && n.open(null, "manual");
142
- }, [
143
- e,
144
- t,
145
- n?.collection.size
146
- ]), null;
147
- }
148
105
  //#endregion
149
- export { D as Combobox };
106
+ export { b as Combobox };
@@ -1,118 +1,45 @@
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";
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";
6
5
  //#region src/SortableList.tsx
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) => ({
6
+ function c(c) {
7
+ let u = t(() => c.items.map((e, t) => ({
19
8
  item: e,
20
9
  index: t,
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
- }))),
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) })),
71
14
  getAllowedDropOperations: () => ["move"],
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
15
+ onReorder: (e) => c.onReorder(l(c.items, e.keys, e.target.key, e.target.dropPosition, c.getKey))
81
16
  });
82
- return /* @__PURE__ */ f(h, {
83
- "aria-label": o["aria-label"],
84
- items: C,
17
+ return /* @__PURE__ */ n(a, {
18
+ "aria-label": c["aria-label"],
19
+ items: u,
85
20
  selectionMode: "none",
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),
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),
91
26
  className: "ui-sortable-item",
92
- children: [
93
- !o.disabled && /* @__PURE__ */ f("span", {
94
- className: "ui-sortable-placeholder",
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, {
95
32
  "aria-hidden": "true",
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)
33
+ size: 18
110
34
  })
111
- ]
35
+ }), /* @__PURE__ */ n("div", {
36
+ className: "ui-sortable-content",
37
+ children: c.renderItem(t, a)
38
+ })]
112
39
  })
113
- }, o.disabled ? "static" : "sortable");
40
+ });
114
41
  }
115
- function y(e, t, n, r, i) {
42
+ function l(e, t, n, r, i) {
116
43
  let a = e.filter((e) => t.has(i(e)));
117
44
  if (!a.length || r === "on") return e;
118
45
  let o = e.filter((e) => !t.has(i(e))), s = o.findIndex((e) => i(e) === n);
@@ -125,4 +52,4 @@ function y(e, t, n, r, i) {
125
52
  ];
126
53
  }
127
54
  //#endregion
128
- export { v as SortableList, y as moveSortableItems, o as useSortableTransferScope };
55
+ export { c as SortableList, l as moveSortableItems };
@@ -31,17 +31,15 @@ import { Badge as Q } from "./Badge.js";
31
31
  import { MetricCard as $ } from "./MetricCard.js";
32
32
  import { PageHeader as ee } from "./PageHeader.js";
33
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 };
34
+ import { SortableList as ne, moveSortableItems as re } from "./SortableList.js";
35
+ import { TreeSelect as ie, buildTreeSelectTree as ae, filterTreeSelectTree as oe } from "./TreeSelect.js";
36
+ import { Cascader as se, buildCascaderOptions as ce, indexCascaderPaths as le } from "./Cascader.js";
37
+ import { StructuredAddressInput as ue, findAddressRegionPath as de, flattenAddressRegions as fe, searchAddressRegions as pe } from "./StructuredAddressInput.js";
38
+ import { FileDropzone as me, acceptsFile as he } from "./FileDropzone.js";
39
+ import { useFilePreparation as ge } from "./useFilePreparation.js";
40
+ import { FilePreparationDialog as _e } from "./FilePreparationDialog.js";
41
+ import { PreparedFileDropzone as ve } from "./PreparedFileDropzone.js";
42
+ import { formatDecimalAmount as ye, formatScaledMoney as be } from "./amount-format.js";
43
+ import { NumericInput as xe, ScaledNumericInput as Se } from "./NumericInput.js";
44
+ import { MultiSelect as Ce } from "./MultiSelect.js";
45
+ 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, se 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, me as FileDropzone, _e as FilePreparationDialog, f as FormField, t as LinkButton, Y as Menu, $ as MetricCard, A as ModalShell, Ce as MultiSelect, xe as NumericInput, ee as PageHeader, P as Pagination, s as Popconfirm, c as Popover, ve as PreparedFileDropzone, W as RecoverableAsyncState, R as RovingTabList, z as RovingTabPanel, Se as ScaledNumericInput, te as SectionCard, H as SegmentedControl, g as Select, p as SelectInput, a as Skeleton, o as SkeletonText, ne as SortableList, ue as StructuredAddressInput, m as TextArea, h as TextInput, b as ToastProvider, V as ToggleSwitch, l as Tooltip, ie as TreeSelect, u as UserProfilePopover, he as acceptsFile, ce as buildCascaderOptions, ae as buildTreeSelectTree, n as buttonClassName, M as calendarDays, F as clampPage, oe as filterTreeSelectTree, de as findAddressRegionPath, fe as flattenAddressRegions, ye as formatDecimalAmount, be as formatScaledMoney, le as indexCascaderPaths, re as moveSortableItems, B as nextRovingTabValue, I as pageCount, N as parseDate, pe as searchAddressRegions, E as sortRows, D as useDataTable, Z as useDebouncedValue, ge as useFilePreparation, G as useModalFocusTrap, x as useToast, L as visiblePages };