@para-ui/core 5.0.0-beta.13 → 5.0.0-beta.14

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.
@@ -1,123 +1,130 @@
1
1
  import { j as t } from "../_virtual/jsx-runtime.js";
2
- import Jt, { useRef as v, useState as g, useEffect as S, useMemo as N, useImperativeHandle as Ut } from "react";
3
- import { Down as Qt } from "../node_modules/@para-ui/icons/Down/index.js";
4
- import { Search as Xt } from "../node_modules/@para-ui/icons/Search/index.js";
5
- import { Close as ot } from "../node_modules/@para-ui/icons/Close/index.js";
6
- import { CloseCircleF as Yt } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
7
- import Zt from "../Table/index.js";
8
- import eo from "../Tree/Tree.js";
2
+ import Qt, { useRef as v, useEffect as N, useState as x, useMemo as T, useImperativeHandle as Xt } from "react";
3
+ import { Down as Yt } from "../node_modules/@para-ui/icons/Down/index.js";
4
+ import { Search as Zt } from "../node_modules/@para-ui/icons/Search/index.js";
5
+ import { Close as st } from "../node_modules/@para-ui/icons/Close/index.js";
6
+ import { CloseCircleF as eo } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
7
+ import to from "../Table/index.js";
8
+ import oo from "../Tree/Tree.js";
9
9
  import './index.css';import '../Tree/style/index.css';/* empty css */
10
- import { Button as rt } from "../Button/index.js";
11
- import { Dropdown as to } from "../Dropdown/index.js";
12
- import { Popover as st } from "../Popover/index.js";
13
- import xe from "../AutoTips/index.js";
14
- import { Tooltip as oo } from "../Tooltip/index.js";
15
- import I from "clsx";
16
- import { getReplaceField as ro, isRemoteLoad as so, debounce as lo, toArray as lt, closest as no, getOverlaySize as co } from "./utils.js";
17
- import { DeepClone as io } from "@snack-kit/lib";
18
- import { ArrayToObject as ao } from "../Utils/snack-kit-shims.js";
19
- import mo from "../GlobalContext/index.js";
20
- import uo from "../Hooks/useGlobalProps.js";
21
- import fo from "../GlobalContext/useFormatMessage.js";
22
- import po from "./lang/index.js";
23
- import ho from "../Label/index.js";
24
- import bo from "../HelperText/index.js";
10
+ import { Button as lt } from "../Button/index.js";
11
+ import { Dropdown as ro } from "../Dropdown/index.js";
12
+ import { Popover as nt } from "../Popover/index.js";
13
+ import ge from "../AutoTips/index.js";
14
+ import { Tooltip as so } from "../Tooltip/index.js";
15
+ import A from "clsx";
16
+ import { getReplaceField as lo, isRemoteLoad as no, debounce as co, toArray as ct, closest as ao, getOverlaySize as io } from "./utils.js";
17
+ import { DeepClone as mo } from "@snack-kit/lib";
18
+ import { ArrayToObject as uo } from "../Utils/snack-kit-shims.js";
19
+ import fo from "../GlobalContext/index.js";
20
+ import po from "../Hooks/useGlobalProps.js";
21
+ import ho from "../GlobalContext/useFormatMessage.js";
22
+ import bo from "./lang/index.js";
23
+ import vo from "../Label/index.js";
24
+ import xo from "../HelperText/index.js";
25
25
  import { $prefixCls as m } from "../GlobalContext/constant.js";
26
- import { Search as vo } from "../Search/index.js";
27
- import { LoadingF as go } from "../node_modules/@para-ui/icons/LoadingF/index.js";
26
+ import { Search as go } from "../Search/index.js";
27
+ import { LoadingF as jo } from "../node_modules/@para-ui/icons/LoadingF/index.js";
28
28
  /* empty css */
29
- const _o = (nt) => {
29
+ const Uo = (at) => {
30
30
  const {
31
- mode: d = "table",
31
+ mode: u = "table",
32
32
  placeholder: je,
33
- searchPlaceholder: ct,
34
- overLine: V = !1,
35
- disabled: Ce = !1,
36
- allowClear: it = !1,
37
- className: at,
38
- style: mt,
39
- maxHeight: dt,
40
- height: ut,
41
- placement: ft = "bottomLeft",
42
- popoverClassName: pt,
43
- size: ht = "large",
44
- popoverActions: ye = null,
45
- showPopoverActions: we = !1,
33
+ searchPlaceholder: it,
34
+ maxCount: Ce,
35
+ overLine: I = !1,
36
+ disabled: ye = !1,
37
+ allowClear: mt = !1,
38
+ className: ut,
39
+ style: dt,
40
+ maxHeight: ft,
41
+ height: pt,
42
+ placement: ht = "bottomLeft",
43
+ popoverClassName: bt,
44
+ size: vt = "large",
45
+ popoverActions: we = null,
46
+ showPopoverActions: Ne = !1,
46
47
  defaultOpen: te = !1,
47
- defaultValue: Ne,
48
- replaceFields: bt = { key: "key", title: "title", children: "children" },
49
- outputFields: vt = { outputKey: "key", outputTitle: "label" },
48
+ defaultValue: Te,
49
+ replaceFields: xt = { key: "key", title: "title", children: "children" },
50
+ outputFields: gt = { outputKey: "key", outputTitle: "label" },
50
51
  value: oe,
51
52
  onClear: re,
52
- onCancel: gt,
53
- onOk: xt,
54
- onClose: jt,
55
- onChange: T,
53
+ onCancel: jt,
54
+ onOk: Ct,
55
+ onClose: yt,
56
+ onChange: k,
56
57
  onSearch: se,
57
- refresh: k,
58
+ refresh: P,
58
59
  TableProps: le,
59
60
  TreeProps: M,
60
- checkable: i = !0,
61
- url: Te,
62
- ctx: ke,
61
+ checkable: a = !0,
62
+ url: ke,
63
+ ctx: Pe,
63
64
  params: R,
64
- method: Pe = "Get",
65
+ method: Se = "Get",
65
66
  showSearch: H = !1,
66
- realTimeSearch: Ct = !1,
67
- error: Se = !1,
68
- hideErrorDom: yt,
67
+ realTimeSearch: wt = !1,
68
+ error: Re = !1,
69
+ hideErrorDom: Nt,
69
70
  helperText: ne,
70
- paramsCallback: wt,
71
- fullPathKey: Nt,
72
- fullPathRender: Re,
71
+ paramsCallback: Tt,
72
+ fullPathKey: kt,
73
+ fullPathRender: $e,
73
74
  disablePopup: f = !1,
74
75
  tagRender: ce,
75
- onTagRemove: $e,
76
- action: Tt,
77
- label: Le = "",
78
- labelTooltip: kt,
79
- required: Me = !1,
80
- emptyProps: Oe,
81
- toggleSelectedOnSingle: Pt = !1,
82
- optionRender: De,
76
+ onTagRemove: Le,
77
+ action: Pt,
78
+ label: Me = "",
79
+ labelTooltip: St,
80
+ required: Oe = !1,
81
+ emptyProps: De,
82
+ toggleSelectedOnSingle: Rt = !1,
83
+ optionRender: Ee,
83
84
  getOptionLabel: ze,
84
- dropdownMatchSelectWidth: ie = !0,
85
- getPopupContainer: St,
85
+ dropdownMatchSelectWidth: ae = !0,
86
+ getPopupContainer: $t,
86
87
  maxTagTextLength: W,
87
88
  renderInputContent: q,
88
- renderTagLabel: ae,
89
- renderMoreTagLabel: Ee
90
- } = uo(nt, "ComboSelect"), { language: Fe, locale: Ke } = Jt.useContext(mo), $ = v(null), [p, me] = g(!1), [x, B] = g([]), G = v(/* @__PURE__ */ new Map()), [a, _] = g([]), [J, Ae] = g(""), U = v(void 0), [O, Ie] = g(null), [D, Rt] = g(!1), [L, $t] = g(0), [z, E] = g(!1), de = v([]), F = v(!1), Q = v(null), Ve = v({}), He = ro(
91
- d,
92
- bt,
89
+ renderTagLabel: ie,
90
+ renderMoreTagLabel: Fe
91
+ } = po(at, "ComboSelect"), { language: Ke, locale: Ve } = Qt.useContext(fo), $ = v(null), Ae = v(!1);
92
+ N(() => {
93
+ process.env.NODE_ENV !== "production" && Ce !== void 0 && !Ae.current && (Ae.current = !0, console.warn(
94
+ "[ComboSelect] maxCount 已在 v5.x 标记为 @deprecated 且自当前版本起 runtime 完全不生效(原代码 dead field)。请从 props 中移除 maxCount;tag 显示数量由 overLine 控制是否换行。v6.0 将移除该字段。"
95
+ ));
96
+ }, [Ce]);
97
+ const [p, me] = x(!1), [g, _] = x([]), B = v(/* @__PURE__ */ new Map()), [i, G] = x([]), [J, Ie] = x(""), U = v(void 0), [O, He] = x(null), [D, Lt] = x(!1), [L, Mt] = x(0), [E, z] = x(!1), ue = v([]), F = v(!1), Q = v(null), We = v({}), qe = lo(
98
+ u,
99
+ xt,
93
100
  le,
94
101
  M
95
- ), { key: Lt, title: Mt } = He, K = Lt || "", We = Mt || "", { outputKey: j = "key", outputTitle: y = "label" } = vt || {}, P = fo("ComboSelect", po), qe = v(so(d, d === "table" ? le : M)), [ue, Ot] = g(), h = v({ list: [] }), [w, fe] = g(null), pe = v(null);
96
- h.current.openMore = z, h.current.list = [...a];
97
- const Dt = () => {
98
- h.current.openMore && E(!1);
99
- }, Be = (e) => {
102
+ ), { key: Ot, title: Dt } = qe, K = Ot || "", _e = Dt || "", { outputKey: j = "key", outputTitle: y = "label" } = gt || {}, S = ho("ComboSelect", bo), Be = v(no(u, u === "table" ? le : M)), [de, Et] = x(), h = v({ list: [] }), [w, fe] = x(null), pe = v(null);
103
+ h.current.openMore = E, h.current.list = [...i];
104
+ const zt = () => {
105
+ h.current.openMore && z(!1);
106
+ }, Ge = (e) => {
100
107
  if (e === null || e === 0 || (e === void 0 && (e = h.current.list.length), !pe.current)) return;
101
108
  const o = pe.current.querySelector(".comboselect-overflow-list");
102
109
  if (o)
103
110
  if (o.scrollHeight > o.clientHeight) {
104
111
  const r = Number(e) - 1;
105
- fe(r), Be(r);
112
+ fe(r), Ge(r);
106
113
  } else
107
- h.current.list.length <= e && Dt();
114
+ h.current.list.length <= e && zt();
108
115
  }, X = () => {
109
116
  if (h.current.list.length === 0) return fe(null);
110
117
  clearTimeout(h.current.resizeTimer), h.current.resizeTimer = setTimeout(() => {
111
- fe(h.current.list.length), Be();
118
+ fe(h.current.list.length), Ge();
112
119
  }, 50);
113
120
  };
114
- S(() => (X(), () => {
121
+ N(() => (X(), () => {
115
122
  clearTimeout(h.current.resizeTimer);
116
- }), [a]), S(() => (!V && i ? window.addEventListener("resize", X) : window.removeEventListener("resize", X), () => {
123
+ }), [i]), N(() => (!I && a ? window.addEventListener("resize", X) : window.removeEventListener("resize", X), () => {
117
124
  window.removeEventListener("resize", X);
118
- }), [V, i]);
119
- const zt = (e) => {
120
- if (!f && !Ce) {
125
+ }), [I, a]);
126
+ const Ft = (e) => {
127
+ if (!f && !ye) {
121
128
  if (F.current) {
122
129
  C();
123
130
  return;
@@ -125,77 +132,77 @@ const _o = (nt) => {
125
132
  F.current = !0, me(!0);
126
133
  }
127
134
  }, C = (e, o) => {
128
- F.current = !1, U.current = void 0, Ve.current = {}, me(!1), Ie(null), Ae(""), jt?.(), o === "cancel" && Ge();
129
- }, Ge = () => {
130
- B([]), _([]);
135
+ F.current = !1, U.current = void 0, We.current = {}, me(!1), He(null), Ie(""), yt?.(), o === "cancel" && Je();
136
+ }, Je = () => {
137
+ _([]), G([]);
131
138
  }, he = (e, o) => {
132
- B(e), It(o, e);
133
- }, Et = (e) => {
134
- B((o) => {
139
+ _(e), Ht(o, e);
140
+ }, Kt = (e) => {
141
+ _((o) => {
135
142
  const r = o.findIndex((l) => l === e[j]);
136
143
  return r > -1 && o.splice(r, 1), [...o];
137
144
  });
138
- }, _e = (e, o) => {
139
- if (e.stopPropagation(), o.closable === !1 || $e?.(o) === !1) return;
140
- const r = [...a], l = r.findIndex((s) => s[j] === o[j]);
141
- l > -1 && r.splice(l, 1), _(r), Et(o), T?.(r);
142
- }, Ft = N(
143
- () => lo(async (e) => {
145
+ }, Ue = (e, o) => {
146
+ if (e.stopPropagation(), o.closable === !1 || Le?.(o) === !1) return;
147
+ const r = [...i], l = r.findIndex((s) => s[j] === o[j]);
148
+ l > -1 && r.splice(l, 1), G(r), Kt(o), k?.(r);
149
+ }, Vt = T(
150
+ () => co(async (e) => {
144
151
  Y(e);
145
152
  }, 400),
146
153
  []
147
- ), Kt = (e) => {
148
- Ae(e), Ct && Ft(e);
154
+ ), At = (e) => {
155
+ Ie(e), wt && Vt(e);
149
156
  }, Y = (e) => {
150
157
  const o = e ?? J;
151
- se ? se(o) : (U.current = o?.trim(), $t(Math.random())), qe.current && Ot([]);
152
- }, Je = (e, o) => {
153
- o ? (xt?.(a), C(null, "ok")) : (gt?.(), C(null, "cancel"));
154
- }, Ue = () => {
158
+ se ? se(o) : (U.current = o?.trim(), Mt(Math.random())), Be.current && Et([]);
159
+ }, Qe = (e, o) => {
160
+ o ? (Ct?.(i), C(null, "ok")) : (jt?.(), C(null, "cancel"));
161
+ }, Xe = () => {
155
162
  let e = "auto";
156
163
  $.current && (e = `${$.current.offsetWidth}px`);
157
- const o = co(d, qe.current, dt, ut), r = { minWidth: e, maxWidth: 960 };
158
- return typeof ie == "number" ? r.width = ie : ie && (r.width = e), {
164
+ const o = io(u, Be.current, ft, pt), r = { minWidth: e, maxWidth: 960 };
165
+ return typeof ae == "number" ? r.width = ae : ae && (r.width = e), {
159
166
  overflow: "auto",
160
167
  ...r,
161
168
  ...o
162
169
  };
163
- }, At = () => I(
170
+ }, It = () => A(
164
171
  `${m}-comboselect`,
165
- at,
172
+ ut,
166
173
  {
167
174
  [`${m}-comboselect-focused`]: p && !f,
168
- [`${m}-comboselect-disabled`]: Ce,
169
- [`${m}-comboselect-radioable`]: !i,
170
- [`${m}-comboselect-error`]: Se,
175
+ [`${m}-comboselect-disabled`]: ye,
176
+ [`${m}-comboselect-radioable`]: !a,
177
+ [`${m}-comboselect-error`]: Re,
171
178
  [`${m}-comboselect-clear`]: D,
172
179
  [`${m}-comboselect-non-popup`]: f,
173
- [`${m}-comboselect-overLine`]: V
180
+ [`${m}-comboselect-overLine`]: I
174
181
  },
175
- `${m}-comboselect-${ht}`
176
- ), It = (e, o) => {
182
+ `${m}-comboselect-${vt}`
183
+ ), Ht = (e, o) => {
177
184
  let r = [];
178
185
  if (e?.length && (r = e.map((s) => {
179
186
  const c = {};
180
- c[j] = s[K] || "", ze ? c[y] = ze(s) || "" : c[y] = s[We] || "";
181
- const n = de.current?.find((u) => u[j] === c[j]);
187
+ c[j] = s[K] || "", ze ? c[y] = ze(s) || "" : c[y] = s[_e] || "";
188
+ const n = ue.current?.find((d) => d[j] === c[j]);
182
189
  return n && (n.disabled !== void 0 && (c.disabled = n.disabled), n.closable !== void 0 && (c.closable = n.closable)), c;
183
190
  })), o?.length && e) {
184
- const s = o.filter((n) => e.findIndex((u) => u[K] === n) === -1), c = de.current?.filter((n) => s?.includes(n[j]));
191
+ const s = o.filter((n) => e.findIndex((d) => d[K] === n) === -1), c = ue.current?.filter((n) => s?.includes(n[j]));
185
192
  c && r.push(...c);
186
193
  }
187
- _(r);
188
- const l = io(e || []);
189
- i ? T?.(r, l) : T?.(r[0], l[0]);
190
- }, Qe = (e) => {
194
+ G(r);
195
+ const l = mo(e || []);
196
+ a ? k?.(r, l) : k?.(r[0], l[0]);
197
+ }, Ye = (e) => {
191
198
  const o = e.map((r) => r[j]);
192
- _(e), B(o), de.current = e;
193
- }, Vt = (e, o) => {
194
- Ie(o.node);
195
- }, Xe = () => {
199
+ G(e), _(o), ue.current = e;
200
+ }, Wt = (e, o) => {
201
+ He(o.node);
202
+ }, Ze = () => {
196
203
  let e = {};
197
204
  if (!f) {
198
- const { width: o, minWidth: r, maxWidth: l } = Ue();
205
+ const { width: o, minWidth: r, maxWidth: l } = Xe();
199
206
  e = { width: o, minWidth: r, maxWidth: l };
200
207
  }
201
208
  return /* @__PURE__ */ t.jsx(
@@ -204,16 +211,16 @@ const _o = (nt) => {
204
211
  className: "comboselect-search",
205
212
  style: e,
206
213
  children: /* @__PURE__ */ t.jsx(
207
- vo,
214
+ go,
208
215
  {
209
216
  className: "comboselect-search-input",
210
217
  rightIconExist: !0,
211
218
  showBtn: !1,
212
- rightIcon: /* @__PURE__ */ t.jsx(Xt, {}),
219
+ rightIcon: /* @__PURE__ */ t.jsx(Zt, {}),
213
220
  btnType: "inside",
214
221
  value: J,
215
- onChange: Kt,
216
- placeholder: ct ?? P({ id: "searchPlaceholder" }),
222
+ onChange: At,
223
+ placeholder: it ?? S({ id: "searchPlaceholder" }),
217
224
  onClickBtn: () => {
218
225
  Y();
219
226
  },
@@ -227,49 +234,49 @@ const _o = (nt) => {
227
234
  )
228
235
  }
229
236
  );
230
- }, Ye = () => ye ? /* @__PURE__ */ t.jsx("div", { className: "comboselect-actions", children: ye }) : /* @__PURE__ */ t.jsxs("div", { className: "comboselect-actions", children: [
237
+ }, et = () => we ? /* @__PURE__ */ t.jsx("div", { className: "comboselect-actions", children: we }) : /* @__PURE__ */ t.jsxs("div", { className: "comboselect-actions", children: [
231
238
  /* @__PURE__ */ t.jsx(
232
- rt,
239
+ lt,
233
240
  {
234
- onClick: (e) => Je(e, !1),
241
+ onClick: (e) => Qe(e, !1),
235
242
  variant: "outlined",
236
243
  size: "small",
237
- children: P({ id: "cancel" })
244
+ children: S({ id: "cancel" })
238
245
  }
239
246
  ),
240
247
  /* @__PURE__ */ t.jsx(
241
- rt,
248
+ lt,
242
249
  {
243
250
  variant: "outlined",
244
- onClick: (e) => Je(e, !0),
251
+ onClick: (e) => Qe(e, !0),
245
252
  size: "small",
246
- children: P({ id: "ok" })
253
+ children: S({ id: "ok" })
247
254
  }
248
255
  )
249
- ] }), Ze = () => d !== "tree" || !O ? null : Re ? /* @__PURE__ */ t.jsx("div", { className: "comboselect-fullPath", children: Re(O ?? {}) }) : /* @__PURE__ */ t.jsxs("div", { className: "comboselect-fullPath", children: [
250
- /* @__PURE__ */ t.jsx("span", { children: P({ id: "fullPath" }) }),
251
- O?.[Nt] ?? ""
252
- ] }), Ht = (e) => {
253
- e.stopPropagation(), Ge(), C(), E(!1), re?.(), T?.(i ? [] : {});
254
- }, Wt = (e) => {
255
- e.stopPropagation(), E(!0), C();
256
+ ] }), tt = () => u !== "tree" || !O ? null : $e ? /* @__PURE__ */ t.jsx("div", { className: "comboselect-fullPath", children: $e(O ?? {}) }) : /* @__PURE__ */ t.jsxs("div", { className: "comboselect-fullPath", children: [
257
+ /* @__PURE__ */ t.jsx("span", { children: S({ id: "fullPath" }) }),
258
+ O?.[kt] ?? ""
259
+ ] }), qt = (e) => {
260
+ e.stopPropagation(), Je(), C(), z(!1), re?.(), k?.(a ? [] : {});
261
+ }, _t = (e) => {
262
+ e.stopPropagation(), z(!0), C();
256
263
  };
257
- Ut(Tt, () => ({
264
+ Xt(Pt, () => ({
258
265
  closePopup: () => C()
259
- })), S(() => {
266
+ })), N(() => {
260
267
  !f && te && (F.current = !0, me(te));
261
- }, [te]), S(() => {
262
- Ne && Qe(lt(Ne));
263
- }, []), S(() => {
264
- oe && Qe(lt(oe));
265
- }, [oe]), S(() => {
266
- it && Rt(!!a?.length);
267
- }, [a]), S(() => {
268
+ }, [te]), N(() => {
269
+ Te && Ye(ct(Te));
270
+ }, []), N(() => {
271
+ oe && Ye(ct(oe));
272
+ }, [oe]), N(() => {
273
+ mt && Lt(!!i?.length);
274
+ }, [i]), N(() => {
268
275
  const e = (r) => r && r.ownerDocument || document, o = (r) => {
269
276
  const l = e($.current), s = r.target, c = !l.documentElement.contains(s) || Q.current?.contains(s) || $.current?.contains(s) || !1;
270
- if (d === "table") {
271
- const n = `.${m}-select-popover`, u = `.${m}-table-show-colums-popover`, b = `.${m}-filter-popover`;
272
- if (no(s, `${n}, ${u}, ${b}`)) return;
277
+ if (u === "table") {
278
+ const n = `.${m}-select-popover`, d = `.${m}-table-show-colums-popover`, b = `.${m}-filter-popover`;
279
+ if (ao(s, `${n}, ${d}, ${b}`)) return;
273
280
  }
274
281
  F.current && !c && C();
275
282
  };
@@ -284,47 +291,47 @@ const _o = (nt) => {
284
291
  };
285
292
  }
286
293
  }, [p]);
287
- const et = N(() => {
288
- if (!a?.length) return null;
294
+ const ot = T(() => {
295
+ if (!i?.length) return null;
289
296
  if (q)
290
- return q(i ? a : a[0]);
291
- if (!i)
292
- return /* @__PURE__ */ t.jsx("span", { className: "comboselect-single-content", children: /* @__PURE__ */ t.jsx(xe, { children: a[0]?.[y] }) });
293
- if (!a.length) return;
297
+ return q(a ? i : i[0]);
298
+ if (!a)
299
+ return /* @__PURE__ */ t.jsx("span", { className: "comboselect-single-content", children: /* @__PURE__ */ t.jsx(ge, { children: i[0]?.[y] }) });
300
+ if (!i.length) return;
294
301
  const e = (l) => {
295
302
  if (ce) return ce(l);
296
303
  const { disabled: s, closable: c = !0 } = l ?? {};
297
304
  let n = l[y];
298
- ae && (n = ae(l));
299
- let u = !1;
305
+ ie && (n = ie(l));
306
+ let d = !1;
300
307
  if (typeof W == "number" && (typeof n == "string" || typeof n == "number")) {
301
308
  const b = String(n);
302
- b.length > W && (n = `${b.slice(0, W)}...`, u = !0);
309
+ b.length > W && (n = `${b.slice(0, W)}...`, d = !0);
303
310
  }
304
311
  return /* @__PURE__ */ t.jsxs(
305
312
  "span",
306
313
  {
307
- className: I("comboselect-item", {
314
+ className: A("comboselect-item", {
308
315
  "comboselect-item--disabled": s,
309
316
  "comboselect-item--unclosable": !c
310
317
  }),
311
318
  children: [
312
- u ? /* @__PURE__ */ t.jsx(
313
- oo,
319
+ d ? /* @__PURE__ */ t.jsx(
320
+ so,
314
321
  {
315
322
  title: /* @__PURE__ */ t.jsx("div", { onClick: (b) => b.stopPropagation(), children: l[y] }),
316
323
  arrow: !1,
317
324
  placement: "bottomLeft",
318
325
  children: /* @__PURE__ */ t.jsx("span", { className: "comboselect-item-content", children: n })
319
326
  }
320
- ) : /* @__PURE__ */ t.jsx("span", { className: "comboselect-item-content", children: /* @__PURE__ */ t.jsx(xe, { children: n }) }),
327
+ ) : /* @__PURE__ */ t.jsx("span", { className: "comboselect-item-content", children: /* @__PURE__ */ t.jsx(ge, { children: n }) }),
321
328
  c === !0 && /* @__PURE__ */ t.jsx(
322
329
  "span",
323
330
  {
324
331
  className: "comboselect-item-remove",
325
- onClick: (b) => _e(b, l),
332
+ onClick: (b) => Ue(b, l),
326
333
  onMouseDown: (b) => b.stopPropagation(),
327
- children: /* @__PURE__ */ t.jsx(ot, {})
334
+ children: /* @__PURE__ */ t.jsx(st, {})
328
335
  }
329
336
  )
330
337
  ]
@@ -334,13 +341,13 @@ const _o = (nt) => {
334
341
  "span",
335
342
  {
336
343
  className: "comboselect-item",
337
- onClick: Wt,
344
+ onClick: _t,
338
345
  children: /* @__PURE__ */ t.jsxs("span", { className: "comboselect-item-content", children: [
339
346
  "+",
340
347
  h.current.list.length - w
341
348
  ] })
342
349
  }
343
- ) }) : null, r = a.map((l, s) => w !== null && w <= s ? null : /* @__PURE__ */ t.jsx(
350
+ ) }) : null, r = i.map((l, s) => w !== null && w <= s ? null : /* @__PURE__ */ t.jsx(
344
351
  "div",
345
352
  {
346
353
  className: "comboselect-overflow-item",
@@ -353,166 +360,166 @@ const _o = (nt) => {
353
360
  o()
354
361
  ] });
355
362
  }, [
356
- a,
357
- T,
358
363
  i,
364
+ k,
365
+ a,
359
366
  w,
360
367
  W,
361
368
  y,
362
369
  ce,
363
370
  q,
364
- ae,
365
- V
366
- ]), Z = N(() => {
367
- let e = R || Ve.current;
368
- return H && !se && U.current !== void 0 && (e = { ...e, searchKey: U.current }), wt?.(e) || e;
369
- }, [R, L, k, p]), be = N(() => {
370
- if (!f && !p || d !== "table") return null;
371
+ ie,
372
+ I
373
+ ]), Z = T(() => {
374
+ let e = R || We.current;
375
+ return H && !se && U.current !== void 0 && (e = { ...e, searchKey: U.current }), Tt?.(e) || e;
376
+ }, [R, L, P, p]), be = T(() => {
377
+ if (!f && !p || u !== "table") return null;
371
378
  const e = {
372
- url: Te,
373
- ctx: ke,
379
+ url: ke,
380
+ ctx: Pe,
374
381
  search: Z,
375
- method: Pe
382
+ method: Se
376
383
  }, o = (r, l) => {
377
- !i && (C(), x.includes(r)) || he([r], [l]);
384
+ !a && (C(), g.includes(r)) || he([r], [l]);
378
385
  };
379
386
  return /* @__PURE__ */ t.jsx("div", { className: "comboselect-table", children: /* @__PURE__ */ t.jsx(
380
- Zt,
387
+ to,
381
388
  {
382
389
  ...e,
383
390
  ...le,
384
- emptyProps: Oe,
385
- check: i,
386
- radio: !i,
391
+ emptyProps: De,
392
+ check: a,
393
+ radio: !a,
387
394
  rowKey: K,
388
395
  setCheck: he,
389
396
  setRadio: o,
390
- checkDefaultValue: x,
391
- radioDefaultValue: x[0],
392
- refresh: k ?? L,
397
+ checkDefaultValue: g,
398
+ radioDefaultValue: g[0],
399
+ refresh: P ?? L,
393
400
  autoSize: !1,
394
401
  refreshInside: !1,
395
402
  checkCount: !1,
396
403
  paginationType: "simple"
397
404
  }
398
405
  ) });
399
- }, [x, k, R, L, f, p, Z, K, i]), ve = N(() => {
400
- if (!f && !p || !["tree", "list"].includes(d)) return null;
406
+ }, [g, P, R, L, f, p, Z, K, a]), ve = T(() => {
407
+ if (!f && !p || !["tree", "list"].includes(u)) return null;
401
408
  const e = {
402
- url: Te,
403
- ctx: ke,
409
+ url: ke,
410
+ ctx: Pe,
404
411
  params: Z,
405
- method: Pe
412
+ method: Se
406
413
  }, o = (s, c) => {
407
414
  if (!c.checked) {
408
- const u = {};
409
- if (u[j] = c.node[K] || "", u[y] = c.node[We] || "", $e?.(u) === !1)
415
+ const d = {};
416
+ if (d[j] = c.node[K] || "", d[y] = c.node[_e] || "", Le?.(d) === !1)
410
417
  return;
411
418
  }
412
- if (!i && (C(), !Pt && x.includes(c.node?.key)))
419
+ if (!a && (C(), !Rt && g.includes(c.node?.key)))
413
420
  return;
414
421
  let n = c.checkedNodes;
415
- if (i || s?.length && (n = [c.node]), i) {
416
- const u = ao("key", n);
417
- Array.from(G.current.keys()).forEach((A) => {
418
- s.includes(A) || G.current.delete(A);
419
- }), s.forEach((A) => {
420
- const ge = String(A);
421
- u[ge] && G.current.set(ge, u[ge]);
422
- }), n = Array.from(G.current.values());
422
+ if (a || s?.length && (n = [c.node]), a) {
423
+ const d = uo("key", n);
424
+ Array.from(B.current.keys()).forEach((V) => {
425
+ s.includes(V) || B.current.delete(V);
426
+ }), s.forEach((V) => {
427
+ const xe = String(V);
428
+ d[xe] && B.current.set(xe, d[xe]);
429
+ }), n = Array.from(B.current.values());
423
430
  }
424
431
  he(s, n);
425
- }, r = (s) => M?.titleRender ? M.titleRender(s) : De ? De(s) : s.title, l = I("comboselect-tree", {
426
- "comboselect-list": d === "list",
427
- "comboselect-list-single": d === "list" && !i
432
+ }, r = (s) => M?.titleRender ? M.titleRender(s) : Ee ? Ee(s) : s.title, l = A("comboselect-tree", {
433
+ "comboselect-list": u === "list",
434
+ "comboselect-list-single": u === "list" && !a
428
435
  });
429
436
  return /* @__PURE__ */ t.jsx("div", { className: l, children: /* @__PURE__ */ t.jsx(
430
- eo,
437
+ oo,
431
438
  {
432
439
  blockNode: !0,
433
440
  ...e,
434
441
  ...M,
435
442
  wrapperStyle: { position: "static" },
436
- emptyProps: { size: "small", ...Oe },
437
- replaceFields: He,
438
- checkable: i,
439
- radioable: !i,
443
+ emptyProps: { size: "small", ...De },
444
+ replaceFields: qe,
445
+ checkable: a,
446
+ radioable: !a,
440
447
  showRadio: !1,
441
- selectable: d !== "list",
442
- loadedKeys: ue,
443
- checkedKeys: x,
448
+ selectable: u !== "list",
449
+ loadedKeys: de,
450
+ checkedKeys: g,
444
451
  onCheck: o,
445
- onSelect: Vt,
452
+ onSelect: Wt,
446
453
  titleRender: r,
447
- refresh: k ?? L,
454
+ refresh: P ?? L,
448
455
  loadingNode: /* @__PURE__ */ t.jsxs("div", { className: "loading-node-content", children: [
449
- /* @__PURE__ */ t.jsx("div", { className: "loading-icon", children: /* @__PURE__ */ t.jsx(go, {}) }),
450
- P({ id: "searching" })
456
+ /* @__PURE__ */ t.jsx("div", { className: "loading-icon", children: /* @__PURE__ */ t.jsx(jo, {}) }),
457
+ S({ id: "searching" })
451
458
  ] })
452
459
  }
453
460
  ) });
454
- }, [x, k, R, L, f, p, ue, d, Z, i]), ee = N(() => /* @__PURE__ */ t.jsxs(
461
+ }, [g, P, R, L, f, p, de, u, Z, a]), ee = T(() => /* @__PURE__ */ t.jsxs(
455
462
  "div",
456
463
  {
457
464
  className: "comboselect-wrapper",
458
465
  ref: $,
459
- onClick: zt,
466
+ onClick: Ft,
460
467
  children: [
461
- /* @__PURE__ */ t.jsx("div", { className: I("comboselect-overflow", !i && "comboselect-overflow-single"), children: et }),
462
- !f && /* @__PURE__ */ t.jsx("span", { className: "comboselect-arrow", children: /* @__PURE__ */ t.jsx(Qt, {}) }),
468
+ /* @__PURE__ */ t.jsx("div", { className: A("comboselect-overflow", !a && "comboselect-overflow-single"), children: ot }),
469
+ !f && /* @__PURE__ */ t.jsx("span", { className: "comboselect-arrow", children: /* @__PURE__ */ t.jsx(Yt, {}) }),
463
470
  D && /* @__PURE__ */ t.jsx(
464
471
  "span",
465
472
  {
466
473
  className: "comboselect-clear",
467
- onClick: Ht,
468
- children: /* @__PURE__ */ t.jsx(Yt, {})
474
+ onClick: qt,
475
+ children: /* @__PURE__ */ t.jsx(eo, {})
469
476
  }
470
477
  ),
471
- !a?.length && /* @__PURE__ */ t.jsx("span", { className: "comboselect-placeholder", children: je ?? P({ id: "pleaseSelect" }) })
478
+ !i?.length && /* @__PURE__ */ t.jsx("span", { className: "comboselect-placeholder", children: je ?? S({ id: "pleaseSelect" }) })
472
479
  ]
473
480
  }
474
- ), [a, et, i, D, f, je]), qt = () => Le || Me ? /* @__PURE__ */ t.jsx(
475
- ho,
481
+ ), [i, ot, a, D, f, je]), Bt = () => Me || Oe ? /* @__PURE__ */ t.jsx(
482
+ vo,
476
483
  {
477
- label: Le,
478
- required: Me,
479
- ...kt
484
+ label: Me,
485
+ required: Oe,
486
+ ...St
480
487
  }
481
- ) : null, Bt = () => /* @__PURE__ */ t.jsx(
488
+ ) : null, Gt = () => /* @__PURE__ */ t.jsx(
482
489
  "div",
483
490
  {
484
491
  ref: Q,
485
- className: `comboselect-dropdown-wrapper ${H ? "show-search" : ""} mode-${d}`,
492
+ className: `comboselect-dropdown-wrapper ${H ? "show-search" : ""} mode-${u}`,
486
493
  children: /* @__PURE__ */ t.jsxs(
487
494
  "div",
488
495
  {
489
- style: Ue(),
496
+ style: Xe(),
490
497
  className: `${m}-scrollbar-small dropdown-content`,
491
498
  children: [
492
- H && Xe(),
493
- d === "table" ? be : ve,
494
- p && Ze(),
495
- we && Ye()
499
+ H && Ze(),
500
+ u === "table" ? be : ve,
501
+ p && tt(),
502
+ Ne && et()
496
503
  ]
497
504
  }
498
505
  )
499
506
  }
500
- ), tt = () => {
501
- const e = () => a.map((o, r) => {
507
+ ), rt = () => {
508
+ const e = () => i.map((o, r) => {
502
509
  if (w !== null && w > r) return null;
503
510
  let l = o[y];
504
- return Ee && (l = Ee(o)), /* @__PURE__ */ t.jsxs(
511
+ return Fe && (l = Fe(o)), /* @__PURE__ */ t.jsxs(
505
512
  "div",
506
513
  {
507
514
  className: "comboselect-more-item",
508
515
  children: [
509
- /* @__PURE__ */ t.jsx("span", { className: "comboselect-more-item-text", children: /* @__PURE__ */ t.jsx(xe, { children: l }) }),
516
+ /* @__PURE__ */ t.jsx("span", { className: "comboselect-more-item-text", children: /* @__PURE__ */ t.jsx(ge, { children: l }) }),
510
517
  /* @__PURE__ */ t.jsx(
511
518
  "span",
512
519
  {
513
520
  className: "comboselect-more-item-remove",
514
- onClick: (s) => _e(s, o),
515
- children: /* @__PURE__ */ t.jsx(ot, {})
521
+ onClick: (s) => Ue(s, o),
522
+ children: /* @__PURE__ */ t.jsx(st, {})
516
523
  }
517
524
  )
518
525
  ]
@@ -521,26 +528,26 @@ const _o = (nt) => {
521
528
  );
522
529
  });
523
530
  return /* @__PURE__ */ t.jsxs("div", { className: "comboselect-more-wrapper", children: [
524
- /* @__PURE__ */ t.jsx("span", { className: "comboselect-more-title", children: /* @__PURE__ */ t.jsx("span", { children: P({ id: "more" }) }) }),
531
+ /* @__PURE__ */ t.jsx("span", { className: "comboselect-more-title", children: /* @__PURE__ */ t.jsx("span", { children: S({ id: "more" }) }) }),
525
532
  /* @__PURE__ */ t.jsx("div", { className: "comboselect-more-content", children: e() })
526
533
  ] });
527
- }, Gt = N(() => /* @__PURE__ */ t.jsx(
528
- to,
534
+ }, Jt = T(() => /* @__PURE__ */ t.jsx(
535
+ ro,
529
536
  {
530
- overlay: Bt(),
537
+ overlay: Gt(),
531
538
  visible: p,
532
- placement: ft,
539
+ placement: ht,
533
540
  trigger: ["click"],
534
- overlayClassName: I(`${m}-comboselect-dropdown`, pt),
535
- getPopupContainer: St,
541
+ overlayClassName: A(`${m}-comboselect-dropdown`, bt),
542
+ getPopupContainer: $t,
536
543
  children: /* @__PURE__ */ t.jsx(
537
- st,
544
+ nt,
538
545
  {
539
- visible: z,
546
+ visible: E,
540
547
  destroyTooltipOnHide: !0,
541
548
  placement: "rightTop",
542
- content: tt(),
543
- onVisibleChange: () => E(!1),
549
+ content: rt(),
550
+ onVisibleChange: () => z(!1),
544
551
  overlayClassName: `${m}-comboselect-more-popover`,
545
552
  children: ee
546
553
  }
@@ -548,74 +555,74 @@ const _o = (nt) => {
548
555
  }
549
556
  ), [
550
557
  p,
551
- x,
558
+ g,
552
559
  J,
553
- k,
560
+ P,
554
561
  R,
555
562
  O,
556
563
  L,
557
564
  D,
558
565
  ne,
559
- Fe,
560
566
  Ke,
561
- z,
562
- ue,
563
- T,
567
+ Ve,
568
+ E,
569
+ de,
570
+ k,
564
571
  re,
565
572
  ee,
566
- a
567
- ]), _t = N(() => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
573
+ i
574
+ ]), Ut = T(() => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
568
575
  /* @__PURE__ */ t.jsx(
569
- st,
576
+ nt,
570
577
  {
571
- visible: z,
578
+ visible: E,
572
579
  destroyTooltipOnHide: !0,
573
580
  placement: "rightTop",
574
- content: tt(),
575
- onVisibleChange: () => E(!1),
581
+ content: rt(),
582
+ onVisibleChange: () => z(!1),
576
583
  overlayClassName: `${m}-comboselect-more-popover`,
577
584
  children: ee
578
585
  }
579
586
  ),
580
587
  /* @__PURE__ */ t.jsxs("div", { className: "comboselect-non-popup-content", children: [
581
- H && Xe(),
582
- d === "table" ? be : ve,
583
- Ze(),
584
- we && Ye()
588
+ H && Ze(),
589
+ u === "table" ? be : ve,
590
+ tt(),
591
+ Ne && et()
585
592
  ] })
586
593
  ] }), [
587
- x,
594
+ g,
588
595
  J,
589
- k,
596
+ P,
590
597
  R,
591
598
  O,
592
599
  D,
593
600
  ne,
594
- Fe,
595
601
  Ke,
596
- T,
602
+ Ve,
603
+ k,
597
604
  re,
598
605
  be,
599
606
  ve,
600
607
  ee,
601
- z,
602
- a
608
+ E,
609
+ i
603
610
  ]);
604
611
  return /* @__PURE__ */ t.jsxs(
605
612
  "div",
606
613
  {
607
- className: At(),
608
- style: mt,
614
+ className: It(),
615
+ style: dt,
609
616
  ref: pe,
610
617
  children: [
611
- qt(),
612
- f ? _t : Gt,
618
+ Bt(),
619
+ f ? Ut : Jt,
613
620
  f ? null : /* @__PURE__ */ t.jsx(
614
- bo,
621
+ xo,
615
622
  {
616
- error: Se,
623
+ error: Re,
617
624
  helperText: ne,
618
- hideErrorDom: yt
625
+ hideErrorDom: Nt
619
626
  }
620
627
  )
621
628
  ]
@@ -623,7 +630,7 @@ const _o = (nt) => {
623
630
  );
624
631
  };
625
632
  export {
626
- _o as ComboSelect,
627
- _o as default
633
+ Uo as ComboSelect,
634
+ Uo as default
628
635
  };
629
636
  //# sourceMappingURL=index.js.map