@jc-times/business-ui 0.3.2 → 0.4.1

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 (59) hide show
  1. package/AGENTS.md +15 -0
  2. package/CHANGELOG.md +22 -0
  3. package/README.md +2 -0
  4. package/THIRD_PARTY_NOTICES.md +3 -0
  5. package/bin/business-ui-gate.mjs +2 -2
  6. package/dist/AntDateWheelView.js +131 -0
  7. package/dist/AntOptionWheelView.js +76 -0
  8. package/dist/AsyncDirectoryPicker.js +89 -88
  9. package/dist/AsyncSearchPicker.js +136 -82
  10. package/dist/Cascader.js +56 -51
  11. package/dist/DateInput.js +84 -66
  12. package/dist/DateWheelPicker.js +58 -0
  13. package/dist/MobilePickerPanel.js +34 -0
  14. package/dist/ModalShell.js +84 -72
  15. package/dist/MultiSelect.js +5 -1
  16. package/dist/OptionWheelDialog.js +99 -0
  17. package/dist/Select.js +116 -61
  18. package/dist/StructuredAddressInput.js +72 -70
  19. package/dist/TreeSelect.js +265 -217
  20. package/dist/WheelCascader.js +123 -0
  21. package/dist/WheelDateInput.js +97 -0
  22. package/dist/business-ui.js +42 -39
  23. package/dist/date-wheel-model.js +27 -0
  24. package/dist/option-wheel-model.js +49 -0
  25. package/dist/styles.css +1 -1
  26. package/dist/types/AntDateWheelView.d.ts +9 -0
  27. package/dist/types/AntOptionWheelView.d.ts +8 -0
  28. package/dist/types/AsyncDirectoryPicker.d.ts +2 -1
  29. package/dist/types/AsyncSearchPicker.d.ts +3 -1
  30. package/dist/types/Cascader.d.ts +2 -0
  31. package/dist/types/DateInput.d.ts +4 -0
  32. package/dist/types/DateWheelPicker.d.ts +13 -0
  33. package/dist/types/MobilePickerPanel.d.ts +11 -0
  34. package/dist/types/ModalShell.d.ts +3 -1
  35. package/dist/types/OptionWheelDialog.d.ts +18 -0
  36. package/dist/types/Select.d.ts +4 -1
  37. package/dist/types/StructuredAddressInput.d.ts +3 -1
  38. package/dist/types/TreeSelect.d.ts +2 -1
  39. package/dist/types/WheelCascader.d.ts +6 -0
  40. package/dist/types/WheelDateInput.d.ts +11 -0
  41. package/dist/types/date-wheel-model.d.ts +8 -0
  42. package/dist/types/index.d.ts +3 -0
  43. package/dist/types/option-wheel-model.d.ts +19 -0
  44. package/dist/types/usePhoneWheel.d.ts +2 -0
  45. package/dist/types/useSheetViewport.d.ts +3 -0
  46. package/dist/usePhoneWheel.js +16 -0
  47. package/dist/useSheetViewport.js +26 -0
  48. package/docs/agent-guide.md +15 -5
  49. package/docs/api.md +16 -0
  50. package/docs/cascader.md +2 -0
  51. package/docs/component-strategy.md +18 -0
  52. package/docs/date-wheel.md +25 -0
  53. package/docs/dependencies.md +2 -0
  54. package/docs/mobile-controls.md +74 -0
  55. package/docs/modal-shell-migration.md +25 -0
  56. package/docs/release.md +8 -1
  57. package/docs/viewport-qa.md +52 -0
  58. package/licenses/antd-mobile-MIT.txt +22 -0
  59. package/package.json +11 -2
@@ -1,155 +1,209 @@
1
1
  import { Button as e } from "./Button.js";
2
2
  import { TextInput as t } from "./FormField.js";
3
- import { RecoverableAsyncState as n } from "./RecoverableAsyncState.js";
4
- import { memo as r, useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { usePhoneWheel as n } from "./usePhoneWheel.js";
4
+ import { RecoverableAsyncState as r } from "./RecoverableAsyncState.js";
5
+ import { MobilePickerPanel as i } from "./MobilePickerPanel.js";
6
+ import { memo as a, useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
7
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
6
8
  //#region src/AsyncSearchPicker.tsx
7
- function d({ query: r, onQueryChange: d, onSearch: p, items: h, getKey: g, getText: _, renderItem: v, onSelect: y, status: b = "idle", error: x, label: S, searchLabel: C = "查询", loadingTitle: w = "正在查询", emptyText: T = "没有匹配项", minimumCharacters: E = 0, minimumCharactersText: D = (e) => `请至少输入 ${e} 个字符`, busy: O = !1, disabled: k = !1, className: A = "", inputRef: j, inputProps: M }) {
8
- let N = `ui-async-picker-${o().replaceAll(":", "")}`, [P, F] = c(-1), [I, L] = c(!1), R = s(/* @__PURE__ */ new Map()), z = s(null), [B, V] = c(320), H = k || O || b === "loading", U = r.trim().length < E, W = !I && b === "success" && !U, G = P >= 0 && P < h.length ? h[P] : void 0;
9
- a(() => {
10
- F(-1);
11
- }, [r, h]), a(() => {
9
+ function m({ query: a, onQueryChange: m, onSearch: g, items: _, getKey: v, getText: te, renderItem: y, onSelect: b, status: x = "idle", error: S, label: C, searchLabel: w = "查询", loadingTitle: ne = "正在查询", emptyText: re = "没有匹配项", minimumCharacters: T = 0, minimumCharactersText: ie = (e) => `请至少输入 ${e} 个字符`, busy: E = !1, disabled: D = !1, className: O = "", inputRef: k, inputProps: A, mobileMode: ae = "inline" }) {
10
+ let j = n(ae === "bottom-sheet"), [M, N] = u(!1), P = l(null), F = l(null);
11
+ s(() => {
12
+ (D || !j) && N(!1);
13
+ }, [D, j]);
14
+ let I = `ui-async-picker-${c().replaceAll(":", "")}`, [L, R] = u(-1), [z, B] = u(!1), V = l(/* @__PURE__ */ new Map()), H = l(null), [U, W] = u(320), G = D || E || x === "loading", K = a.trim().length < T, q = !z && x === "success" && !K, J = L >= 0 && L < _.length ? _[L] : void 0;
15
+ s(() => {
16
+ R(-1);
17
+ }, [a, _]), s(() => {
18
+ if (j) return;
12
19
  let e = (e) => {
13
- z.current?.contains(e.target) || (L(!0), F(-1));
20
+ H.current?.contains(e.target) || (B(!0), R(-1));
14
21
  };
15
22
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
16
- }, []), a(() => {
17
- if (!W || h.length === 0) return;
23
+ }, [j]), s(() => {
24
+ if (j || !q || _.length === 0) return;
18
25
  let e = window.visualViewport, t = 0, n = () => {
19
26
  t && window.cancelAnimationFrame(t), t = window.requestAnimationFrame(() => {
20
27
  t = 0;
21
- let n = z.current?.querySelector(".ui-async-search-control");
28
+ let n = H.current?.querySelector(".ui-async-search-control");
22
29
  if (!n) return;
23
30
  let r = (e?.offsetTop ?? 0) + (e?.height ?? window.innerHeight), i = Math.floor(r - n.getBoundingClientRect().bottom - 12);
24
- V(Math.max(96, Math.min(320, i)));
31
+ W(Math.max(96, Math.min(320, i)));
25
32
  });
26
33
  };
27
34
  return n(), e?.addEventListener("resize", n), e?.addEventListener("scroll", n), window.addEventListener("resize", n), () => {
28
35
  t && window.cancelAnimationFrame(t), e?.removeEventListener("resize", n), e?.removeEventListener("scroll", n), window.removeEventListener("resize", n);
29
36
  };
30
- }, [h.length, W]);
31
- function K() {
32
- !H && !U && (L(!1), p(r));
37
+ }, [
38
+ _.length,
39
+ q,
40
+ j
41
+ ]);
42
+ function Y() {
43
+ !G && !K && (B(!1), g(a));
33
44
  }
34
- let q = i((e) => {
35
- H || (y(e), L(!0), F(-1));
36
- }, [H, y]);
37
- function J(e) {
38
- if (!h.length) return;
39
- let t = (e + h.length) % h.length;
40
- F(t);
41
- let n = R.current.get(g(h[t]));
45
+ let X = o((e) => {
46
+ G || (b(e), B(!0), R(-1), N(!1));
47
+ }, [G, b]);
48
+ function Z(e) {
49
+ if (!_.length) return;
50
+ let t = (e + _.length) % _.length;
51
+ R(t);
52
+ let n = V.current.get(v(_[t]));
42
53
  typeof n?.scrollIntoView == "function" && n.scrollIntoView({ block: "nearest" });
43
54
  }
44
- function Y(e) {
45
- M?.onKeyDown?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "ArrowDown" && W && h.length ? (e.preventDefault(), J(P + 1)) : e.key === "ArrowUp" && W && h.length ? (e.preventDefault(), J(P <= 0 ? h.length - 1 : P - 1)) : e.key === "Enter" ? (e.preventDefault(), G && W ? q(G) : K()) : (e.key === "Escape" || e.key === "Tab") && (L(!0), F(-1)));
55
+ function oe(e) {
56
+ A?.onKeyDown?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "ArrowDown" && q && _.length ? (e.preventDefault(), Z(L + 1)) : e.key === "ArrowUp" && q && _.length ? (e.preventDefault(), Z(L <= 0 ? _.length - 1 : L - 1)) : e.key === "Enter" ? (e.preventDefault(), J && q ? X(J) : Y()) : (e.key === "Escape" || e.key === "Tab" && !j) && (B(!0), R(-1)));
46
57
  }
47
- return /* @__PURE__ */ u("div", {
48
- ref: z,
49
- className: `ui-async-search-picker ${A}`.trim(),
58
+ let Q = /* @__PURE__ */ p("div", {
59
+ ref: H,
60
+ className: `ui-async-search-picker ${O}`.trim(),
50
61
  onBlur: (e) => {
51
- e.currentTarget.contains(e.relatedTarget) || (L(!0), F(-1));
62
+ !j && !e.currentTarget.contains(e.relatedTarget) && (B(!0), R(-1));
52
63
  },
53
64
  children: [
54
- /* @__PURE__ */ u("div", {
65
+ /* @__PURE__ */ p("div", {
55
66
  className: "ui-async-search-control",
56
- children: [/* @__PURE__ */ l(t, {
57
- ...M,
58
- ref: j,
59
- label: S,
60
- value: r,
61
- disabled: k || O,
67
+ children: [/* @__PURE__ */ f(t, {
68
+ ...A,
69
+ ref: j ? F : k,
70
+ label: C,
71
+ value: a,
72
+ disabled: D || E,
73
+ id: j ? `${I}-search` : A?.id,
74
+ name: j ? void 0 : A?.name,
75
+ form: j ? void 0 : A?.form,
76
+ required: !j && A?.required,
62
77
  onFocus: (e) => {
63
- L(!1), M?.onFocus?.(e);
78
+ B(!1), A?.onFocus?.(e);
64
79
  },
65
80
  onChange: (e) => {
66
- L(!1), d(e.target.value);
81
+ B(!1), m(e.target.value);
67
82
  },
68
- onKeyDown: Y,
83
+ onKeyDown: oe,
69
84
  role: "combobox",
70
85
  "aria-autocomplete": "list",
71
- "aria-expanded": W && h.length > 0,
72
- "aria-controls": W && h.length > 0 ? `${N}-list` : void 0,
73
- "aria-activedescendant": W && G ? `${N}-${f(g(G))}` : void 0
74
- }), /* @__PURE__ */ l(e, {
86
+ "aria-expanded": q && _.length > 0,
87
+ "aria-controls": q && _.length > 0 ? `${I}-list` : void 0,
88
+ "aria-activedescendant": q && J ? `${I}-${h(v(J))}` : void 0
89
+ }), /* @__PURE__ */ f(e, {
75
90
  variant: "primary",
76
- busy: O || b === "loading",
77
- disabled: k || U,
78
- onClick: K,
79
- children: C
91
+ busy: E || x === "loading",
92
+ disabled: D || K,
93
+ onClick: Y,
94
+ children: w
80
95
  })]
81
96
  }),
82
- /* @__PURE__ */ u("div", {
97
+ /* @__PURE__ */ p("div", {
83
98
  className: "ui-async-search-status",
84
99
  "aria-live": "polite",
85
100
  children: [
86
- U ? D(E) : null,
87
- !I && !U && b === "loading" ? /* @__PURE__ */ l(n, {
101
+ K ? ie(T) : null,
102
+ !z && !K && x === "loading" ? /* @__PURE__ */ f(r, {
88
103
  compact: !0,
89
104
  phase: "loading",
90
- loadingTitle: w,
105
+ loadingTitle: ne,
91
106
  errorTitle: ""
92
107
  }) : null,
93
- !I && !U && b === "error" ? /* @__PURE__ */ l(n, {
108
+ !z && !K && x === "error" ? /* @__PURE__ */ f(r, {
94
109
  compact: !0,
95
110
  phase: "error",
96
111
  loadingTitle: "",
97
112
  errorTitle: "查询失败",
98
- detail: x,
99
- onRetry: H ? void 0 : K,
113
+ detail: S,
114
+ onRetry: G ? void 0 : Y,
100
115
  retryLabel: "重试"
101
116
  }) : null,
102
- W && h.length === 0 ? /* @__PURE__ */ l("div", {
117
+ q && _.length === 0 ? /* @__PURE__ */ f("div", {
103
118
  className: "ui-async-search-empty",
104
- children: T
119
+ children: re
105
120
  }) : null
106
121
  ]
107
122
  }),
108
- W && h.length > 0 ? /* @__PURE__ */ l("div", {
109
- id: `${N}-list`,
123
+ q && _.length > 0 ? /* @__PURE__ */ f("div", {
124
+ id: `${I}-list`,
110
125
  role: "listbox",
111
126
  className: "ui-async-search-list",
112
- style: { maxHeight: B },
113
- children: h.map((e, t) => {
114
- let n = g(e);
115
- return /* @__PURE__ */ l(m, {
127
+ style: { maxHeight: U },
128
+ children: _.map((e, t) => {
129
+ let n = v(e);
130
+ return /* @__PURE__ */ f(ee, {
116
131
  item: e,
117
132
  index: t,
118
133
  optionKey: n,
119
- id: `${N}-${f(n)}`,
120
- selected: P === t,
121
- refs: R.current,
122
- activate: F,
123
- select: q,
124
- getText: _,
125
- renderItem: v
134
+ id: `${I}-${h(n)}`,
135
+ selected: L === t,
136
+ refs: V.current,
137
+ activate: R,
138
+ select: X,
139
+ getText: te,
140
+ renderItem: y
126
141
  }, n);
127
142
  })
128
143
  }) : null
129
144
  ]
130
145
  });
146
+ if (!j) return Q;
147
+ function se() {
148
+ N(!1), B(!0), R(-1);
149
+ }
150
+ function $() {
151
+ !D && !E && (B(!1), N(!0));
152
+ }
153
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(t, {
154
+ ...A,
155
+ ref: (e) => {
156
+ P.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
157
+ },
158
+ label: C,
159
+ value: a,
160
+ inputMode: "none",
161
+ disabled: D,
162
+ "aria-disabled": E || D || void 0,
163
+ readOnly: E || A?.readOnly,
164
+ className: `ui-mobile-picker-trigger ${O}`,
165
+ "aria-haspopup": "dialog",
166
+ "aria-expanded": M,
167
+ onFocus: void 0,
168
+ onBlur: void 0,
169
+ onChange: (e) => {
170
+ E || (m(e.target.value), $());
171
+ },
172
+ onClick: (e) => {
173
+ A?.onClick?.(e), e.defaultPrevented || $();
174
+ },
175
+ onKeyDown: (e) => {
176
+ A?.onKeyDown?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.keyCode === 229) && (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), $());
177
+ }
178
+ }), M && /* @__PURE__ */ f(i, {
179
+ title: C ?? "搜索选择",
180
+ returnFocus: P,
181
+ initialFocus: F,
182
+ onClose: se,
183
+ children: Q
184
+ })] });
131
185
  }
132
- function f(e) {
186
+ function h(e) {
133
187
  return e.replace(/[^a-zA-Z0-9_-]/g, "-");
134
188
  }
135
- function p({ item: e, index: t, optionKey: n, id: r, selected: a, refs: o, activate: s, select: c, getText: u, renderItem: d }) {
136
- let f = i((e) => {
137
- e ? o.set(n, e) : o.delete(n);
138
- }, [o, n]);
139
- return /* @__PURE__ */ l("button", {
140
- ref: f,
189
+ function g({ item: e, index: t, optionKey: n, id: r, selected: i, refs: a, activate: s, select: c, getText: l, renderItem: u }) {
190
+ let d = o((e) => {
191
+ e ? a.set(n, e) : a.delete(n);
192
+ }, [a, n]);
193
+ return /* @__PURE__ */ f("button", {
194
+ ref: d,
141
195
  id: r,
142
196
  type: "button",
143
197
  role: "option",
144
- "aria-selected": a,
198
+ "aria-selected": i,
145
199
  className: "ui-async-search-option",
146
200
  tabIndex: -1,
147
201
  onMouseEnter: () => s(t),
148
202
  onClick: () => c(e),
149
- "aria-label": u(e),
150
- children: d(e)
203
+ "aria-label": l(e),
204
+ children: u(e)
151
205
  });
152
206
  }
153
- var m = r(p);
207
+ var ee = a(g);
154
208
  //#endregion
155
- export { d as AsyncSearchPicker };
209
+ export { m as AsyncSearchPicker };
package/dist/Cascader.js CHANGED
@@ -1,52 +1,57 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
2
  import { FormField as t } from "./FormField.js";
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
- import p from "@rc-component/cascader";
3
+ import { usePhoneWheel as n } from "./usePhoneWheel.js";
4
+ import { WheelCascader as r } from "./WheelCascader.js";
5
+ import { useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
6
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ import { ChevronDown as d, ChevronRight as f, LoaderCircle as p, X as m } from "lucide-react";
8
+ import h from "@rc-component/cascader";
7
9
  //#region src/Cascader.tsx
8
- function m(m) {
9
- let g = i(), [_, v] = o(!1);
10
- r(() => {
11
- m.disabled && v(!1);
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 = a(null), O = n((e) => {
10
+ function g(e) {
11
+ return n(e.mobileMode === "wheel") && !e.multiple && !e.loadData && !e.changeOnSelect ? /* @__PURE__ */ l(r, { ...e }) : /* @__PURE__ */ l(_, { ...e });
12
+ }
13
+ function _(n) {
14
+ let r = o(), [g, _] = c(!1);
15
+ a(() => {
16
+ n.disabled && _(!1);
17
+ }, [n.disabled]);
18
+ let y = !n.disabled && (n.open ?? g), b = n.id ?? n.inputProps?.id ?? r, x = e(), { inputProps: S, inputRef: C, label: w, helpText: T, error: E } = n, D = s(null), O = i((e) => {
14
19
  D.current = e, typeof C == "function" ? C(e) : C && (C.current = e);
15
20
  }, [C]);
16
- r(() => {
17
- D.current?.setCustomValidity(m.required && !m.value.length ? "请选择一个选项" : "");
18
- }, [m.required, m.value.length]);
21
+ a(() => {
22
+ D.current?.setCustomValidity(n.required && !n.value.length ? "请选择一个选项" : "");
23
+ }, [n.required, n.value.length]);
19
24
  let k = [
20
25
  S?.["aria-describedby"],
21
26
  T !== void 0 && `${b}-help`,
22
27
  E && `${b}-error`
23
28
  ].filter(Boolean).join(" ") || void 0, A = {
24
29
  id: b,
25
- options: m.options,
30
+ options: n.options,
26
31
  prefixCls: "ui-cascader",
27
- className: m.className,
28
- disabled: m.disabled,
32
+ className: n.className,
33
+ disabled: n.disabled,
29
34
  open: y,
30
35
  onPopupVisibleChange: (e) => {
31
- v(e), m.onOpenChange?.(e);
36
+ _(e), n.onOpenChange?.(e);
32
37
  },
33
38
  onInputKeyDown: (e) => {
34
- e.key === "Escape" && y && !e.nativeEvent.isComposing && (e.preventDefault(), e.stopPropagation(), v(!1), m.onOpenChange?.(!1));
39
+ e.key === "Escape" && y && !e.nativeEvent.isComposing && (e.preventDefault(), e.stopPropagation(), _(!1), n.onOpenChange?.(!1));
35
40
  },
36
41
  showAction: [],
37
- placeholder: m.placeholder ?? "请选择或搜索",
38
- notFoundContent: m.emptyText ?? "没有匹配的选项",
39
- allowClear: m.allowClear !== !1 && {
40
- clearIcon: /* @__PURE__ */ s(f, { size: 14 }),
41
- label: m.clearLabel ?? "清除选择"
42
+ placeholder: n.placeholder ?? "请选择或搜索",
43
+ notFoundContent: n.emptyText ?? "没有匹配的选项",
44
+ allowClear: n.allowClear !== !1 && {
45
+ clearIcon: /* @__PURE__ */ l(m, { size: 14 }),
46
+ label: n.clearLabel ?? "清除选择"
42
47
  },
43
- suffix: /* @__PURE__ */ s(l, { size: 16 }),
44
- expandIcon: /* @__PURE__ */ s(u, { size: 14 }),
45
- loadingIcon: /* @__PURE__ */ s(d, { size: 14 }),
46
- changeOnSelect: m.changeOnSelect,
47
- loadData: m.loadData,
48
- showSearch: m.searchable ?? !m.loadData ? {
49
- filter: (e, t) => h(t.map((e) => e.label).join("/")).includes(h(e)),
48
+ suffix: /* @__PURE__ */ l(d, { size: 16 }),
49
+ expandIcon: /* @__PURE__ */ l(f, { size: 14 }),
50
+ loadingIcon: /* @__PURE__ */ l(p, { size: 14 }),
51
+ changeOnSelect: n.changeOnSelect,
52
+ loadData: n.loadData,
53
+ showSearch: n.searchable ?? !n.loadData ? {
54
+ filter: (e, t) => v(t.map((e) => e.label).join("/")).includes(v(e)),
50
55
  render: (e, t) => t.map((e) => e.label).join(" / "),
51
56
  limit: 50
52
57
  } : !1,
@@ -61,19 +66,19 @@ function m(m) {
61
66
  shiftX: !0
62
67
  }
63
68
  },
64
- components: { input: /* @__PURE__ */ s("input", {
69
+ components: { input: /* @__PURE__ */ l("input", {
65
70
  ...S,
66
71
  ref: O,
67
72
  id: b,
68
73
  placeholder: "",
69
- required: m.required && !m.value.length,
70
- "aria-required": m.required || void 0,
74
+ required: n.required && !n.value.length,
75
+ "aria-required": n.required || void 0,
71
76
  "aria-invalid": E ? !0 : S?.["aria-invalid"],
72
77
  "aria-describedby": k
73
78
  }) },
74
- tagRender: ({ label: e, closable: t, onClose: n }) => /* @__PURE__ */ c("span", {
79
+ tagRender: ({ label: e, closable: t, onClose: n }) => /* @__PURE__ */ u("span", {
75
80
  className: "ui-cascader-tag",
76
- children: [/* @__PURE__ */ s("span", { children: e }), t && /* @__PURE__ */ s("button", {
81
+ children: [/* @__PURE__ */ l("span", { children: e }), t && /* @__PURE__ */ l("button", {
77
82
  type: "button",
78
83
  "aria-label": `移除 ${String(e)}`,
79
84
  onMouseDown: (e) => {
@@ -82,37 +87,37 @@ function m(m) {
82
87
  onClick: (e) => {
83
88
  e.stopPropagation(), n();
84
89
  },
85
- children: /* @__PURE__ */ s(f, { size: 12 })
90
+ children: /* @__PURE__ */ l(m, { size: 12 })
86
91
  })]
87
92
  })
88
93
  };
89
- return /* @__PURE__ */ c(t, {
94
+ return /* @__PURE__ */ u(t, {
90
95
  controlId: b,
91
96
  label: w,
92
97
  helpText: T,
93
98
  error: E,
94
- required: m.required,
95
- children: [y && /* @__PURE__ */ s("span", {
99
+ required: n.required,
100
+ children: [y && /* @__PURE__ */ l("span", {
96
101
  hidden: !0,
97
102
  "data-ui-aria-overlay": ""
98
- }), m.multiple ? /* @__PURE__ */ s(p, {
103
+ }), n.multiple ? /* @__PURE__ */ l(h, {
99
104
  ...A,
100
105
  checkable: !0,
101
- checkStrictly: m.checkStrictly ?? !0,
102
- maxTagCount: m.maxTagCount ?? 3,
103
- value: m.value,
104
- onChange: (e, t) => m.onValueChange(e ?? [], t ?? [])
105
- }) : /* @__PURE__ */ s(p, {
106
+ checkStrictly: n.checkStrictly ?? !0,
107
+ maxTagCount: n.maxTagCount ?? 3,
108
+ value: n.value,
109
+ onChange: (e, t) => n.onValueChange(e ?? [], t ?? [])
110
+ }) : /* @__PURE__ */ l(h, {
106
111
  ...A,
107
- value: m.value,
108
- onChange: (e, t) => m.onValueChange(e ?? [], t ?? [])
112
+ value: n.value,
113
+ onChange: (e, t) => n.onValueChange(e ?? [], t ?? [])
109
114
  })]
110
115
  });
111
116
  }
112
- function h(e) {
117
+ function v(e) {
113
118
  return e.replace(/[\s/]+/gu, "").toLocaleLowerCase();
114
119
  }
115
- function g(e) {
120
+ function y(e) {
116
121
  let t = /* @__PURE__ */ new Map(), n = new Map(e.map((e) => [e.id, e.parentId]));
117
122
  for (let n of e) {
118
123
  if (!n.id || t.has(n.id)) throw Error("Cascader IDs must be nonempty and unique");
@@ -134,7 +139,7 @@ function g(e) {
134
139
  }
135
140
  return r;
136
141
  }
137
- function _(e) {
142
+ function b(e) {
138
143
  let t = /* @__PURE__ */ new Map();
139
144
  function n(e, r) {
140
145
  for (let i of e) {
@@ -146,4 +151,4 @@ function _(e) {
146
151
  return n(e, []), t;
147
152
  }
148
153
  //#endregion
149
- export { m as Cascader, g as buildCascaderOptions, _ as indexCascaderPaths };
154
+ export { g as Cascader, y as buildCascaderOptions, b as indexCascaderPaths };