@jc-times/business-ui 0.3.0 → 0.3.2

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 (57) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/THIRD_PARTY_NOTICES.md +5 -0
  3. package/assets/pdf-fonts/NotoSans-Bold.ttf +0 -0
  4. package/assets/pdf-fonts/NotoSans-BoldItalic.ttf +0 -0
  5. package/assets/pdf-fonts/NotoSans-Italic.ttf +0 -0
  6. package/assets/pdf-fonts/NotoSans-Regular.ttf +0 -0
  7. package/assets/pdf-fonts/NotoSansHans-Regular.otf +0 -0
  8. package/assets/pdf-fonts/OFL-CJK.txt +92 -0
  9. package/assets/pdf-fonts/OFL-Latin.txt +94 -0
  10. package/assets/pdf-fonts/README.md +11 -0
  11. package/dist/Alert.js +5 -1
  12. package/dist/Button.js +1 -1
  13. package/dist/Cascader.js +19 -19
  14. package/dist/Combobox.js +38 -38
  15. package/dist/DataTableIcons.js +25 -25
  16. package/dist/DateInput.js +67 -67
  17. package/dist/DropdownMenu.js +35 -35
  18. package/dist/EmptyState.js +8 -8
  19. package/dist/ExplainableButton.js +11 -11
  20. package/dist/FloatingControls.js +31 -31
  21. package/dist/ModalShell.js +32 -32
  22. package/dist/MultiSelect.js +37 -37
  23. package/dist/Pagination.js +27 -27
  24. package/dist/RecoverableAsyncState.js +8 -8
  25. package/dist/Select.js +17 -17
  26. package/dist/SortableList.js +18 -18
  27. package/dist/Toast.js +30 -30
  28. package/dist/TreeSelect.js +107 -107
  29. package/dist/data-table.js +71 -71
  30. package/dist/document-viewer/PdfToolbar.js +12 -12
  31. package/dist/document-viewer/PdfWorkspace.js +15 -15
  32. package/dist/document-viewer-v2/DocumentViewerV2.js +49 -48
  33. package/dist/document-viewer-v2/HeadlessPdfViewer.js +128 -124
  34. package/dist/document-viewer-v2/pdf-font-fallback.js +35 -0
  35. package/dist/types/document-viewer-v2/pdf-font-fallback.d.ts +2 -0
  36. package/dist/vendor/embedpdf-zoom-react.js +3 -186
  37. package/dist/vendor/embedpdf-zoom-react10.js +6 -0
  38. package/dist/vendor/embedpdf-zoom-react11.js +30 -0
  39. package/dist/vendor/embedpdf-zoom-react12.js +16 -0
  40. package/dist/vendor/embedpdf-zoom-react13.js +15 -0
  41. package/dist/vendor/embedpdf-zoom-react14.js +33 -0
  42. package/dist/vendor/embedpdf-zoom-react15.js +20 -0
  43. package/dist/vendor/embedpdf-zoom-react16.js +26 -0
  44. package/dist/vendor/embedpdf-zoom-react17.js +25 -0
  45. package/dist/vendor/embedpdf-zoom-react18.js +17 -0
  46. package/dist/vendor/embedpdf-zoom-react19.js +187 -0
  47. package/dist/vendor/embedpdf-zoom-react2.js +13 -0
  48. package/dist/vendor/embedpdf-zoom-react3.js +14 -0
  49. package/dist/vendor/embedpdf-zoom-react4.js +8 -0
  50. package/dist/vendor/embedpdf-zoom-react5.js +4 -0
  51. package/dist/vendor/embedpdf-zoom-react6.js +14 -0
  52. package/dist/vendor/embedpdf-zoom-react7.js +40 -0
  53. package/dist/vendor/embedpdf-zoom-react8.js +17 -0
  54. package/dist/vendor/embedpdf-zoom-react9.js +7 -0
  55. package/docs/agent-guide.md +2 -0
  56. package/docs/document-viewer-v2.md +2 -2
  57. package/package.json +7 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.1
2
+
3
+ - 修复 `form-controls` 中图标从 `lucide-react` 根入口导入导致消费者打入完整图标集的问题。
4
+
1
5
  # 0.3.0
2
6
 
3
7
  - 新增 `@jc-times/business-ui/form-controls` 轻量入口,提供 Alert、Button、LinkButton、FormField、TextInput、TextArea、SelectInput 和 Checkbox,不引入目录、日期、表格或文档查看器依赖图。
@@ -317,3 +321,9 @@
317
321
 
318
322
  ## 0.2.52
319
323
  - AutoComplete and Combobox accept grouped options with non-selectable, muted headings and preserve filtering and keyboard selection.
324
+ # 0.3.2 — 2026-09-22 (patch)
325
+
326
+ - Render existing signature Widget appearances in Headless pages and thumbnails (`withForms: true`); rendering does not enable form editing or alter signed bytes. Add failed-before/passed-after Widget regression coverage.
327
+
328
+ - Fix missing Chinese and substituted Latin text in PDFs with unembedded fonts. Both PDFium viewers use stable same-origin Noto fallback configuration; assets and OFL licenses ship with the package, with no external CDN requests.
329
+ - Add desktop/mobile real PDF rendering coverage. Restoring `fontFallback: null` makes the same Chinese test fail with zero text pixels; explicit caller overrides remain supported.
@@ -29,3 +29,8 @@
29
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
30
 
31
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.
32
+ # PDF fallback fonts
33
+
34
+ `assets/pdf-fonts` contains unmodified Noto Sans Hans and Noto Sans fonts from
35
+ `@embedpdf/fonts-sc@1.0.0` and `@embedpdf/fonts-latin@1.0.0`, under SIL OFL 1.1.
36
+ See the accompanying `OFL-CJK.txt`, `OFL-Latin.txt`, and source README.
@@ -0,0 +1,92 @@
1
+ This Font Software is licensed under the SIL Open Font License,
2
+ Version 1.1.
3
+
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font
14
+ creation efforts of academic and linguistic communities, and to
15
+ provide a free and open framework in which fonts may be shared and
16
+ improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply to
25
+ any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software
36
+ components as distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to,
39
+ deleting, or substituting -- in part or in whole -- any of the
40
+ components of the Original Version, by changing formats or by porting
41
+ the Font Software to a new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION & CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed,
49
+ modify, redistribute, and sell modified and unmodified copies of the
50
+ Font Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components, in
53
+ Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the
64
+ corresponding Copyright Holder. This restriction only applies to the
65
+ primary font name as presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created using
77
+ the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,94 @@
1
+ Copyright 2018 The Noto Project Authors (github.com/googlei18n/noto-fonts)
2
+
3
+ This Font Software is licensed under the SIL Open Font License,
4
+ Version 1.1.
5
+
6
+ This license is copied below, and is also available with a FAQ at:
7
+ http://scripts.sil.org/OFL
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to
17
+ provide a free and open framework in which fonts may be shared and
18
+ improved in partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software
38
+ components as distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to,
41
+ deleting, or substituting -- in part or in whole -- any of the
42
+ components of the Original Version, by changing formats or by porting
43
+ the Font Software to a new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed,
51
+ modify, redistribute, and sell modified and unmodified copies of the
52
+ Font Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components, in
55
+ Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the
66
+ corresponding Copyright Holder. This restriction only applies to the
67
+ primary font name as presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created using
79
+ the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,11 @@
1
+ # PDFium fallback fonts
2
+
3
+ Unmodified assets copied from exact npm packages `@embedpdf/fonts-sc@1.0.0`
4
+ and `@embedpdf/fonts-latin@1.0.0` (their `fonts/` directories). Noto Sans Hans
5
+ Regular provides Chinese glyphs; Noto Sans Regular/Bold/Italic/BoldItalic
6
+ provides Latin variants. Licenses accompany the font files.
7
+
8
+ The public viewer imports these through `@jc-times/business-ui/pdf-fonts/*?url`.
9
+ Consumer bundlers emit static same-origin assets. The renderer requests the
10
+ required font only when a PDF lacks its own font. These files must not be
11
+ inlined into the main JavaScript entry or loaded from a public CDN.
package/dist/Alert.js CHANGED
@@ -1,4 +1,8 @@
1
- import { AlertCircle as e, CheckCircle2 as t, Info as n, TriangleAlert as r, X as i } from "lucide-react";
1
+ import e from "./vendor/embedpdf-zoom-react14.js";
2
+ import t from "./vendor/embedpdf-zoom-react15.js";
3
+ import n from "./vendor/embedpdf-zoom-react16.js";
4
+ import r from "./vendor/embedpdf-zoom-react17.js";
5
+ import i from "./vendor/embedpdf-zoom-react18.js";
2
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
7
  //#region src/Alert.tsx
4
8
  var s = {
package/dist/Button.js CHANGED
@@ -1,4 +1,4 @@
1
- import { LoaderCircle as e } from "lucide-react";
1
+ import e from "./vendor/embedpdf-zoom-react13.js";
2
2
  import { forwardRef as t } from "react";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/Button.tsx
package/dist/Cascader.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
2
  import { FormField as t } from "./FormField.js";
3
- import { ChevronDown as n, ChevronRight as r, LoaderCircle as i, X as a } from "lucide-react";
4
- import { useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
5
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
3
+ import { useCallback as n, useEffect as r, useId as i, useRef as a, useState as o } from "react";
4
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
+ import { ChevronDown as l, ChevronRight as u, LoaderCircle as d, X as f } from "lucide-react";
6
6
  import p from "@rc-component/cascader";
7
7
  //#region src/Cascader.tsx
8
8
  function m(m) {
9
- let g = c(), [_, v] = u(!1);
10
- s(() => {
9
+ let g = i(), [_, v] = o(!1);
10
+ r(() => {
11
11
  m.disabled && v(!1);
12
12
  }, [m.disabled]);
13
- let y = !m.disabled && (m.open ?? _), b = m.id ?? m.inputProps?.id ?? g, x = e(), { inputProps: S, inputRef: C, label: w, helpText: T, error: E } = m, D = l(null), O = o((e) => {
13
+ let y = !m.disabled && (m.open ?? _), b = m.id ?? m.inputProps?.id ?? g, x = e(), { inputProps: S, inputRef: C, label: w, helpText: T, error: E } = m, D = a(null), O = n((e) => {
14
14
  D.current = e, typeof C == "function" ? C(e) : C && (C.current = e);
15
15
  }, [C]);
16
- s(() => {
16
+ r(() => {
17
17
  D.current?.setCustomValidity(m.required && !m.value.length ? "请选择一个选项" : "");
18
18
  }, [m.required, m.value.length]);
19
19
  let k = [
@@ -37,12 +37,12 @@ function m(m) {
37
37
  placeholder: m.placeholder ?? "请选择或搜索",
38
38
  notFoundContent: m.emptyText ?? "没有匹配的选项",
39
39
  allowClear: m.allowClear !== !1 && {
40
- clearIcon: /* @__PURE__ */ d(a, { size: 14 }),
40
+ clearIcon: /* @__PURE__ */ s(f, { size: 14 }),
41
41
  label: m.clearLabel ?? "清除选择"
42
42
  },
43
- suffix: /* @__PURE__ */ d(n, { size: 16 }),
44
- expandIcon: /* @__PURE__ */ d(r, { size: 14 }),
45
- loadingIcon: /* @__PURE__ */ d(i, { size: 14 }),
43
+ suffix: /* @__PURE__ */ s(l, { size: 16 }),
44
+ expandIcon: /* @__PURE__ */ s(u, { size: 14 }),
45
+ loadingIcon: /* @__PURE__ */ s(d, { size: 14 }),
46
46
  changeOnSelect: m.changeOnSelect,
47
47
  loadData: m.loadData,
48
48
  showSearch: m.searchable ?? !m.loadData ? {
@@ -61,7 +61,7 @@ function m(m) {
61
61
  shiftX: !0
62
62
  }
63
63
  },
64
- components: { input: /* @__PURE__ */ d("input", {
64
+ components: { input: /* @__PURE__ */ s("input", {
65
65
  ...S,
66
66
  ref: O,
67
67
  id: b,
@@ -71,9 +71,9 @@ function m(m) {
71
71
  "aria-invalid": E ? !0 : S?.["aria-invalid"],
72
72
  "aria-describedby": k
73
73
  }) },
74
- tagRender: ({ label: e, closable: t, onClose: n }) => /* @__PURE__ */ f("span", {
74
+ tagRender: ({ label: e, closable: t, onClose: n }) => /* @__PURE__ */ c("span", {
75
75
  className: "ui-cascader-tag",
76
- children: [/* @__PURE__ */ d("span", { children: e }), t && /* @__PURE__ */ d("button", {
76
+ children: [/* @__PURE__ */ s("span", { children: e }), t && /* @__PURE__ */ s("button", {
77
77
  type: "button",
78
78
  "aria-label": `移除 ${String(e)}`,
79
79
  onMouseDown: (e) => {
@@ -82,27 +82,27 @@ function m(m) {
82
82
  onClick: (e) => {
83
83
  e.stopPropagation(), n();
84
84
  },
85
- children: /* @__PURE__ */ d(a, { size: 12 })
85
+ children: /* @__PURE__ */ s(f, { size: 12 })
86
86
  })]
87
87
  })
88
88
  };
89
- return /* @__PURE__ */ f(t, {
89
+ return /* @__PURE__ */ c(t, {
90
90
  controlId: b,
91
91
  label: w,
92
92
  helpText: T,
93
93
  error: E,
94
94
  required: m.required,
95
- children: [y && /* @__PURE__ */ d("span", {
95
+ children: [y && /* @__PURE__ */ s("span", {
96
96
  hidden: !0,
97
97
  "data-ui-aria-overlay": ""
98
- }), m.multiple ? /* @__PURE__ */ d(p, {
98
+ }), m.multiple ? /* @__PURE__ */ s(p, {
99
99
  ...A,
100
100
  checkable: !0,
101
101
  checkStrictly: m.checkStrictly ?? !0,
102
102
  maxTagCount: m.maxTagCount ?? 3,
103
103
  value: m.value,
104
104
  onChange: (e, t) => m.onValueChange(e ?? [], t ?? [])
105
- }) : /* @__PURE__ */ d(p, {
105
+ }) : /* @__PURE__ */ s(p, {
106
106
  ...A,
107
107
  value: m.value,
108
108
  onChange: (e, t) => m.onValueChange(e ?? [], t ?? [])
package/dist/Combobox.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
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";
2
+ import { useContext as t, useEffect as n, useId as r, useMemo as i, useRef as a } from "react";
3
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ import { Check as l, ChevronDown as u, LoaderCircle as d } from "lucide-react";
5
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
6
  import { ListLayout as w, Virtualizer as T } from "react-aria-components/Virtualizer";
7
7
  //#region src/Combobox.tsx
@@ -10,8 +10,8 @@ var E = {
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(() => {
13
+ function D({ items: t, label: n, placeholder: a = "搜索或选择", 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 = t.length > 100, className: V = "", inputRef: H, inputProps: U, placement: W = "bottom start", portalContainer: G }) {
14
+ let K = `ui-combobox-${r().replaceAll(":", "")}`, q = e(G), J = i(() => Array.from(t), [t]), Y = i(() => {
15
15
  let e = /* @__PURE__ */ new Map();
16
16
  for (let t of J) {
17
17
  let n = t.group ?? "";
@@ -22,42 +22,42 @@ function D({ items: i, label: a, placeholder: c = "搜索或选择", inputValue:
22
22
  }), e.get(n).items.push(t);
23
23
  }
24
24
  return Array.from(e.values());
25
- }, [J]), X = J.some((e) => e.group !== void 0), Z = (e) => /* @__PURE__ */ u(b, {
25
+ }, [J]), X = J.some((e) => e.group !== void 0), Z = (e) => /* @__PURE__ */ s(b, {
26
26
  id: e.id,
27
27
  textValue: e.label,
28
28
  isDisabled: e.disabled,
29
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, {
30
+ children: ({ isSelected: t }) => /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("span", { children: [/* @__PURE__ */ s("strong", { children: e.label }), e.description && /* @__PURE__ */ s("small", { children: e.description })] }), t && /* @__PURE__ */ s(l, {
31
31
  size: 15,
32
32
  "aria-hidden": "true"
33
33
  })] })
34
- }), Q = () => /* @__PURE__ */ u("div", {
34
+ }), Q = () => /* @__PURE__ */ s("div", {
35
35
  className: "ui-combobox-empty",
36
36
  children: N ? "正在加载…" : L
37
- }), $ = X ? /* @__PURE__ */ u(y, {
37
+ }), $ = X ? /* @__PURE__ */ s(y, {
38
38
  className: "ui-combobox-list",
39
39
  items: Y,
40
40
  layout: "stack",
41
41
  renderEmptyState: Q,
42
- children: (e) => /* @__PURE__ */ d(x, {
42
+ children: (e) => /* @__PURE__ */ c(x, {
43
43
  id: e.id,
44
44
  "aria-label": e.label || "选项",
45
- children: [e.label && /* @__PURE__ */ u(g, {
45
+ children: [e.label && /* @__PURE__ */ s(g, {
46
46
  className: "ui-combobox-group-heading",
47
47
  children: e.label
48
- }), /* @__PURE__ */ u(p, {
48
+ }), /* @__PURE__ */ s(p, {
49
49
  items: e.items,
50
50
  children: Z
51
51
  })]
52
52
  })
53
- }) : /* @__PURE__ */ u(y, {
53
+ }) : /* @__PURE__ */ s(y, {
54
54
  className: "ui-combobox-list",
55
55
  items: J,
56
56
  layout: B ? "grid" : "stack",
57
57
  renderEmptyState: Q,
58
58
  children: Z
59
59
  });
60
- return /* @__PURE__ */ d(m, {
60
+ return /* @__PURE__ */ c(m, {
61
61
  items: J,
62
62
  className: `ui-combobox ${V}`.trim(),
63
63
  inputValue: h,
@@ -70,62 +70,62 @@ function D({ items: i, label: a, placeholder: c = "搜索或选择", inputValue:
70
70
  isRequired: F,
71
71
  allowsCustomValue: I,
72
72
  menuTrigger: "focus",
73
- "aria-label": a === void 0 ? U?.["aria-label"] : void 0,
74
- "aria-labelledby": a === void 0 ? U?.["aria-labelledby"] : void 0,
73
+ "aria-label": n === void 0 ? U?.["aria-label"] : void 0,
74
+ "aria-labelledby": n === void 0 ? U?.["aria-labelledby"] : void 0,
75
75
  children: [
76
- a === void 0 ? null : /* @__PURE__ */ d(v, {
76
+ n === void 0 ? null : /* @__PURE__ */ c(v, {
77
77
  className: "ui-form-label",
78
- children: [a, F && /* @__PURE__ */ u("span", {
78
+ children: [n, F && /* @__PURE__ */ s("span", {
79
79
  className: "ui-form-required",
80
80
  "aria-hidden": "true",
81
81
  children: "*"
82
82
  })]
83
83
  }),
84
- I && /* @__PURE__ */ u(O, {
84
+ I && /* @__PURE__ */ s(O, {
85
85
  count: J.length,
86
86
  loading: N
87
87
  }),
88
- /* @__PURE__ */ d("div", {
88
+ /* @__PURE__ */ c("div", {
89
89
  className: "ui-combobox-control",
90
- children: [/* @__PURE__ */ u(_, {
90
+ children: [/* @__PURE__ */ s(_, {
91
91
  ...U,
92
92
  ref: H,
93
93
  id: K,
94
94
  className: "ui-input",
95
- placeholder: c,
95
+ placeholder: a,
96
96
  "aria-invalid": z ? !0 : U?.["aria-invalid"]
97
- }), /* @__PURE__ */ u(f, {
97
+ }), /* @__PURE__ */ s(f, {
98
98
  className: "ui-combobox-trigger",
99
99
  "aria-label": "展开选项",
100
- children: N ? /* @__PURE__ */ u(r, {
100
+ children: N ? /* @__PURE__ */ s(d, {
101
101
  className: "spin",
102
102
  size: 16
103
- }) : /* @__PURE__ */ u(n, { size: 16 })
103
+ }) : /* @__PURE__ */ s(u, { size: 16 })
104
104
  })]
105
105
  }),
106
- R === void 0 ? null : /* @__PURE__ */ u(C, {
106
+ R === void 0 ? null : /* @__PURE__ */ s(C, {
107
107
  slot: "description",
108
108
  className: "ui-form-help",
109
109
  children: R
110
110
  }),
111
- z === void 0 || z === "" ? null : /* @__PURE__ */ u(C, {
111
+ z === void 0 || z === "" ? null : /* @__PURE__ */ s(C, {
112
112
  slot: "errorMessage",
113
113
  className: "ui-form-error",
114
114
  children: z
115
115
  }),
116
- /* @__PURE__ */ d(S, {
116
+ /* @__PURE__ */ c(S, {
117
117
  className: "ui-combobox-popover",
118
118
  "data-ui-aria-overlay": "",
119
119
  maxHeight: 320,
120
120
  placement: W,
121
121
  UNSTABLE_portalContainer: q,
122
- children: [N && /* @__PURE__ */ d("div", {
122
+ children: [N && /* @__PURE__ */ c("div", {
123
123
  className: "ui-combobox-loading",
124
- children: [/* @__PURE__ */ u(r, {
124
+ children: [/* @__PURE__ */ s(d, {
125
125
  className: "spin",
126
126
  size: 15
127
127
  }), "正在加载"]
128
- }), B ? /* @__PURE__ */ u(T, {
128
+ }), B ? /* @__PURE__ */ s(T, {
129
129
  layout: w,
130
130
  layoutOptions: E,
131
131
  children: $
@@ -134,15 +134,15 @@ function D({ items: i, label: a, placeholder: c = "搜索或选择", inputValue:
134
134
  ]
135
135
  });
136
136
  }
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");
137
+ function O({ count: e, loading: r }) {
138
+ let i = t(h), o = a(i);
139
+ return o.current = i, n(() => {
140
+ let t = o.current;
141
+ e && !r && t?.isFocused && !t.isOpen && t.open(null, "manual");
142
142
  }, [
143
143
  e,
144
- t,
145
- n?.collection.size
144
+ r,
145
+ i?.collection.size
146
146
  ]), null;
147
147
  }
148
148
  //#endregion
@@ -1,37 +1,37 @@
1
- import { ArrowDown as e, ArrowLeftRight as t, ChevronDown as n, ChevronRight as r, Columns3 as i, EllipsisVertical as a, EyeOff as o, Filter as s, FilterX as c, GripHorizontal as l, Pin as u, RotateCcw as d, Search as f, X as p } from "lucide-react";
2
- import { forwardRef as m } from "react";
3
- import { jsx as h } from "react/jsx-runtime";
1
+ import { forwardRef as e } from "react";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { ArrowDown as n, ArrowLeftRight as r, ChevronDown as i, ChevronRight as a, Columns3 as o, EllipsisVertical as s, EyeOff as c, Filter as l, FilterX as u, GripHorizontal as d, Pin as f, RotateCcw as p, Search as m, X as h } from "lucide-react";
4
4
  import g from "@mui/material/SvgIcon";
5
5
  //#region src/DataTableIcons.tsx
6
- function _(e) {
7
- return m((t, n) => /* @__PURE__ */ h(g, {
8
- ...t,
9
- ref: n,
10
- component: e,
6
+ function _(n) {
7
+ return e((e, r) => /* @__PURE__ */ t(g, {
8
+ ...e,
9
+ ref: r,
10
+ component: n,
11
11
  inheritViewBox: !0,
12
12
  sx: [{
13
13
  fontSize: 18,
14
14
  fill: "none"
15
- }, ...Array.isArray(t.sx) ? t.sx : [t.sx ?? {}]]
15
+ }, ...Array.isArray(e.sx) ? e.sx : [e.sx ?? {}]]
16
16
  }));
17
17
  }
18
18
  var v = {
19
- SearchIcon: _(f),
20
- CloseIcon: _(p),
21
- CancelIcon: _(p),
22
- ArrowDownwardIcon: _(e),
23
- ExpandMoreIcon: _(n),
24
- ArrowRightIcon: _(r),
25
- SyncAltIcon: _(t),
26
- MoreVertIcon: _(a),
27
- ViewColumnIcon: _(i),
28
- FilterListIcon: _(s),
29
- FilterAltIcon: _(s),
30
- FilterListOffIcon: _(c),
31
- PushPinIcon: _(u),
32
- DragHandleIcon: _(l),
33
- RestartAltIcon: _(d),
34
- VisibilityOffIcon: _(o)
19
+ SearchIcon: _(m),
20
+ CloseIcon: _(h),
21
+ CancelIcon: _(h),
22
+ ArrowDownwardIcon: _(n),
23
+ ExpandMoreIcon: _(i),
24
+ ArrowRightIcon: _(a),
25
+ SyncAltIcon: _(r),
26
+ MoreVertIcon: _(s),
27
+ ViewColumnIcon: _(o),
28
+ FilterListIcon: _(l),
29
+ FilterAltIcon: _(l),
30
+ FilterListOffIcon: _(u),
31
+ PushPinIcon: _(f),
32
+ DragHandleIcon: _(d),
33
+ RestartAltIcon: _(p),
34
+ VisibilityOffIcon: _(c)
35
35
  };
36
36
  //#endregion
37
37
  export { v as icons };