@para-ui/core 5.0.0-beta.4 → 5.0.0-beta.7

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 (46) hide show
  1. package/README.md +46 -0
  2. package/es/AutoButton/index.js +22 -22
  3. package/es/Button/index.d.ts +7 -4
  4. package/es/CheckboxGroup/index.d.ts +6 -6
  5. package/es/CheckboxGroup/index.js +21 -21
  6. package/es/FormItem/compoments/formSelect/index.d.ts +2 -2
  7. package/es/FormItem/compoments/formSelect/index.js +13 -13
  8. package/es/Pagination/index.js +11 -10
  9. package/es/RadioGroup/index.d.ts +6 -7
  10. package/es/RadioGroup/index.js +2 -2
  11. package/es/Select/index.d.ts +39 -16
  12. package/es/Select/index.js +324 -317
  13. package/es/Table/interface.d.ts +9 -11
  14. package/es/ToggleButton/ToggleButtonGroup.d.ts +8 -8
  15. package/es/ToggleButton/ToggleButtonGroup.js +27 -27
  16. package/es/ToggleButton/index.d.ts +5 -6
  17. package/es/ToggleButton/index.js +13 -13
  18. package/es/Utils/type.d.ts +3 -1
  19. package/es/_virtual/index3.js +2 -2
  20. package/es/_virtual/index4.js +2 -2
  21. package/es/node_modules/@para-snack/core/dist/index.js +1 -1
  22. package/es/node_modules/classnames/index.js +1 -1
  23. package/lib/Argv/batchEdit/index.js +1 -1
  24. package/lib/AutoButton/index.js +1 -1
  25. package/lib/Button/index.d.ts +7 -4
  26. package/lib/CheckboxGroup/index.d.ts +6 -6
  27. package/lib/CheckboxGroup/index.js +1 -1
  28. package/lib/CodeEditor/index.js +1 -1
  29. package/lib/FormItem/compoments/formSelect/index.d.ts +2 -2
  30. package/lib/FormItem/compoments/formSelect/index.js +1 -1
  31. package/lib/InputCode/index.js +1 -1
  32. package/lib/Pagination/index.js +1 -1
  33. package/lib/RadioGroup/index.d.ts +6 -7
  34. package/lib/RadioGroup/index.js +1 -1
  35. package/lib/Select/index.d.ts +39 -16
  36. package/lib/Select/index.js +1 -1
  37. package/lib/Table/interface.d.ts +9 -11
  38. package/lib/ToggleButton/ToggleButtonGroup.d.ts +8 -8
  39. package/lib/ToggleButton/ToggleButtonGroup.js +1 -1
  40. package/lib/ToggleButton/index.d.ts +5 -6
  41. package/lib/ToggleButton/index.js +1 -1
  42. package/lib/Utils/type.d.ts +3 -1
  43. package/lib/node_modules/@para-snack/core/dist/index.js +1 -1
  44. package/lib/node_modules/classnames/index.js +1 -1
  45. package/package.json +1 -1
  46. /package/lib/{CodeEditor → InputCode}/index.css +0 -0
@@ -1,79 +1,81 @@
1
1
  import { j as s } from "../_virtual/jsx-runtime.js";
2
- import xe, { useRef as _e, useState as j, useEffect as E, useMemo as H } from "react";
3
- import Nt from "../Empty/index.js";
4
- import $t from "../Label/index.js";
5
- import { Dropdown as Dt } from "../Dropdown/index.js";
6
- import { UUID as Qe, DeepClone as ye } from "@paraview/lib";
7
- import Tt from "../GlobalContext/index.js";
8
- import { Close as Xe } from "../node_modules/@para-ui/icons/Close/index.js";
9
- import { CloseCircleF as Lt } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
10
- import { Down as Mt } from "../node_modules/@para-ui/icons/Down/index.js";
11
- import { Check as Et } from "../node_modules/@para-ui/icons/Check/index.js";
12
- import Ot from "../GlobalContext/useFormatMessage.js";
13
- import Pt from "./lang/index.js";
14
- import ae from "../AutoTips/index.js";
15
- import { Loading as It } from "../Loading/index.js";
16
- import { Popover as Vt } from "../Popover/index.js";
17
- import { Search as qt } from "../Search/index.js";
18
- import { Tooltip as Ft } from "../Tooltip/index.js";
19
- import zt from "../HelperText/index.js";
20
- import Ht from "../Hooks/useGlobalProps.js";
21
- import { $prefixCls as v } from "../GlobalContext/constant.js";
2
+ import we, { useRef as Xe, useState as j, useEffect as O, useMemo as z } from "react";
3
+ import Dt from "../Empty/index.js";
4
+ import Tt from "../Label/index.js";
5
+ import { Dropdown as Lt } from "../Dropdown/index.js";
6
+ import { UUID as Ye, DeepClone as xe } from "@paraview/lib";
7
+ import Mt from "../GlobalContext/index.js";
8
+ import { Close as Ze } from "../node_modules/@para-ui/icons/Close/index.js";
9
+ import { CloseCircleF as Et } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
10
+ import { Down as Ot } from "../node_modules/@para-ui/icons/Down/index.js";
11
+ import { Check as Pt } from "../node_modules/@para-ui/icons/Check/index.js";
12
+ import It from "../GlobalContext/useFormatMessage.js";
13
+ import Vt from "./lang/index.js";
14
+ import me from "../AutoTips/index.js";
15
+ import { Loading as qt } from "../Loading/index.js";
16
+ import { Popover as Ft } from "../Popover/index.js";
17
+ import { Search as zt } from "../Search/index.js";
18
+ import { Tooltip as Ht } from "../Tooltip/index.js";
19
+ import Bt from "../HelperText/index.js";
20
+ import Kt from "../Hooks/useGlobalProps.js";
21
+ import { $prefixCls as f } from "../GlobalContext/constant.js";
22
22
  import './index.css';/* empty css */
23
- const Bt = (f, B, O) => {
24
- const h = document.createElement("span");
25
- h.id = "referenceSpan";
26
- const b = { width: 0, height: 0 };
27
- b.width = h.offsetWidth, b.height = h.offsetHeight, h.style.visibility = "hidden", h.style.fontSize = f, h.style.fontFamily = B, h.style.display = "inline-block";
28
- const P = document.getElementById("referenceSpan");
29
- return P && document.body.removeChild(P), document.body.appendChild(h), typeof h.textContent < "u" ? h.textContent = O : h.innerText = O, b.width = parseFloat(window.getComputedStyle(h).width) - b.width, b.height = parseFloat(window.getComputedStyle(h).height) - b.height, document.body.removeChild(h), b;
30
- }, Ye = (f, B) => {
31
- const O = xe.useRef(!1);
32
- xe.useEffect(() => {
33
- O.current ? f() : O.current = !0;
34
- }, B);
35
- }, uo = (f) => {
36
- const {
37
- className: B,
38
- style: O,
39
- showSelect: h = !0,
40
- allowClear: b = !1,
41
- emptyProps: P,
42
- size: K = "large",
23
+ const At = (W, h, E) => {
24
+ const g = document.createElement("span");
25
+ g.id = "referenceSpan";
26
+ const S = { width: 0, height: 0 };
27
+ S.width = g.offsetWidth, S.height = g.offsetHeight, g.style.visibility = "hidden", g.style.fontSize = W, g.style.fontFamily = h, g.style.display = "inline-block";
28
+ const H = document.getElementById("referenceSpan");
29
+ return H && document.body.removeChild(H), document.body.appendChild(g), typeof g.textContent < "u" ? g.textContent = E : g.innerText = E, S.width = parseFloat(window.getComputedStyle(g).width) - S.width, S.height = parseFloat(window.getComputedStyle(g).height) - S.height, document.body.removeChild(g), S;
30
+ }, et = (W, h) => {
31
+ const E = we.useRef(!1);
32
+ we.useEffect(() => {
33
+ E.current ? W() : E.current = !0;
34
+ }, h);
35
+ };
36
+ function fo(W) {
37
+ const h = W, {
38
+ className: E,
39
+ style: g,
40
+ showSelect: S = !0,
41
+ allowClear: H = !1,
42
+ emptyProps: se,
43
+ size: B = "large",
43
44
  labelMode: _ = "outside",
44
45
  labelTooltip: Q,
45
- placeholder: se = "",
46
- searchPlaceholder: we,
47
- label: A = "",
48
- input: I = !1,
46
+ placeholder: le = "",
47
+ searchPlaceholder: je,
48
+ label: K = "",
49
+ input: P = !1,
49
50
  disabled: d = !1,
50
- disabledTooltip: je,
51
+ disabledTooltip: Se,
51
52
  multiple: m = !1,
52
- required: R = !1,
53
- labelSign: V,
54
- error: Se = !1,
55
- hideErrorDom: Ze,
56
- helperText: et = "",
57
- list: le,
53
+ required: A = !1,
54
+ labelSign: I,
55
+ error: ke = !1,
56
+ hideErrorDom: tt,
57
+ helperText: ot = "",
58
+ list: ne,
58
59
  showName: N = "label",
59
60
  showValue: $ = "value",
60
61
  childrenName: D = "children",
61
- value: k,
62
- onChange: C,
63
- overLine: ke = !1,
64
- search: q = !1,
62
+ value: b,
63
+ onChange: v,
64
+ overLine: be = !1,
65
+ search: V = !1,
65
66
  searchModel: y = "inside",
66
- selectPopoverClassName: be,
67
- morePopoverClassName: Ne,
68
- searchInputProps: g,
69
- onEnter: G,
70
- onEnterInput: $e,
71
- onClear: me,
72
- getPopupContainer: tt,
73
- renderContent: S,
74
- selectCheckIcon: ue = !0,
75
- blurChangeValueBol: ne = !1
76
- } = Ht(f, "Select"), de = (e = []) => {
67
+ selectPopoverClassName: Ne,
68
+ morePopoverClassName: $e,
69
+ fetchSuggestions: De,
70
+ searchInputProps: C,
71
+ onEnter: R,
72
+ onEnterInput: Te,
73
+ onClear: ue,
74
+ getPopupContainer: st,
75
+ renderContent: k,
76
+ selectCheckIcon: de = !0,
77
+ blurChangeValueBol: re = !1
78
+ } = Kt(h, "Select"), pe = (e = []) => {
77
79
  const o = [];
78
80
  for (let t = 0, n = e.length; t < n; t++) {
79
81
  const l = e[t];
@@ -88,11 +90,11 @@ const Bt = (f, B, O) => {
88
90
  }
89
91
  }
90
92
  return o;
91
- }, ot = () => {
93
+ }, lt = () => {
92
94
  let e = [];
93
- return f.defaultValue !== void 0 && (f.multiple ? e = ye(f.defaultValue || []) : e = f.defaultValue === "" ? [] : [f.defaultValue]), k !== void 0 && (m ? e = ye(k || []) : e = k === "" ? [] : [k]), e;
94
- }, De = () => {
95
- const e = de(le), o = {};
95
+ return h.defaultValue !== void 0 && (m ? e = xe(h.defaultValue || []) : e = h.defaultValue === "" ? [] : [h.defaultValue]), b !== void 0 && (m ? e = xe(b || []) : e = b === "" ? [] : [b]), e;
96
+ }, Le = () => {
97
+ const e = pe(ne), o = {};
96
98
  for (let t = 0, n = e.length; t < n; t++) {
97
99
  const l = e[t];
98
100
  if (l[D] && l[D].length > 0) {
@@ -107,160 +109,165 @@ const Bt = (f, B, O) => {
107
109
  }
108
110
  }
109
111
  return o;
110
- }, J = _e(null), [Te] = j(`${v}-select-${Qe()}`), [X] = j(`select-popover-${Qe()}`), [F, Y] = j(!1), [Z, fe] = j(!1), [r, T] = j(ot()), [U, st] = j([]), [x, lt] = j(De()), [L, pe] = j(null), [he, Le] = j(!1), [u, W] = j(""), [z, Me] = j(!1), [ee, re] = j(!1), [ve, nt] = j(!1), te = _e(null), [i] = j({
112
+ }, G = Xe(null), [Me] = j(`${f}-select-${Ye()}`), [X] = j(`select-popover-${Ye()}`), [q, Y] = j(!1), [Z, fe] = j(!1), [r, T] = j(lt()), [J, nt] = j([]), [x, rt] = j(Le()), [L, he] = j(null), [ve, Ee] = j(!1), [u, U] = j(""), [F, Oe] = j(!1), [ee, ie] = j(!1), [Ce, it] = j(!1), te = Xe(null), [i] = j({
111
113
  valueCom: [],
112
114
  listCom: [],
113
115
  searchModel: "inside",
114
116
  // default
115
117
  openMore: !1
116
- }), { language: Ee, locale: Oe } = xe.useContext(Tt), Pe = Ot("Select", Pt);
117
- i.valueCom = [...r], i.listCom = U, i.searchModel = y, i.openMore = he, E(() => () => {
118
+ }), { language: Pe, locale: Ie } = we.useContext(Mt), Ve = It("Select", Vt);
119
+ i.valueCom = [...r], i.listCom = J, i.searchModel = y, i.openMore = ve, O(() => () => {
118
120
  clearTimeout(i.searchTimer), clearTimeout(i.timer), clearTimeout(i.scrollTimer), clearTimeout(i.dropDownTimer);
119
- }, []), Ye(() => {
120
- k !== void 0 && T(m ? ye(k || []) : k === "" ? [] : [k]);
121
- }, [k, m]), E(() => {
122
- ie();
123
- }, [r, k]), E(() => {
121
+ }, []), et(() => {
122
+ if (b === void 0) {
123
+ T([]);
124
+ return;
125
+ }
126
+ T(m ? xe(b || []) : b === "" ? [] : [b]);
127
+ }, [b, m]), O(() => {
128
+ ce();
129
+ }, [r, b]), O(() => {
124
130
  if (y === "outside" && m)
125
- return Me(!0);
126
- Me(ke);
127
- }, [ke, y, m, I]), Ye(() => {
128
- lt(De());
129
- }, [le]), E(() => (!z && m ? window.addEventListener("resize", ie) : window.removeEventListener("resize", ie), () => {
130
- window.removeEventListener("resize", ie);
131
- }), [z, m]), E(() => {
131
+ return Oe(!0);
132
+ Oe(be);
133
+ }, [be, y, m, P]), et(() => {
134
+ rt(Le());
135
+ }, [ne]), O(() => (!F && m ? window.addEventListener("resize", ce) : window.removeEventListener("resize", ce), () => {
136
+ window.removeEventListener("resize", ce);
137
+ }), [F, m]), O(() => {
132
138
  r && r.length > 0 ? fe(!0) : (fe(!1), y === "outside" && fe(u !== ""));
133
- }, [q, u, y, r, I]), E(() => {
134
- if (F)
135
- if (re(!0), f.fetchSuggestions)
136
- f.fetchSuggestions(u, (e) => {
137
- const o = de(e);
138
- Ve(o, !0), re(!1);
139
+ }, [V, u, y, r, P]), O(() => {
140
+ if (q)
141
+ if (ie(!0), De)
142
+ De(u, (e) => {
143
+ const o = pe(e);
144
+ Fe(o, !0), ie(!1);
139
145
  });
140
146
  else {
141
- const e = de(le);
142
- Ve(e), re(!1);
147
+ const e = pe(ne);
148
+ Fe(e), ie(!1);
143
149
  }
144
- }, [q, u, le, F]), E(() => (F ? (clearTimeout(i.openTimer), i.openTimer = setTimeout(() => {
145
- qe(), window.addEventListener("keydown", Ce);
146
- })) : (W(""), window.removeEventListener("keydown", Ce)), () => {
147
- clearTimeout(i.openTimer), window.removeEventListener("keydown", Ce);
148
- }), [F]), E(() => {
149
- d !== !0 && m && y === "outside" && ht(u);
150
- }, [u, m, d, y, I]);
151
- const Ie = (e) => {
150
+ }, [V, u, ne, q]), O(() => (q ? (clearTimeout(i.openTimer), i.openTimer = setTimeout(() => {
151
+ ze(), window.addEventListener("keydown", ge);
152
+ })) : (U(""), window.removeEventListener("keydown", ge)), () => {
153
+ clearTimeout(i.openTimer), window.removeEventListener("keydown", ge);
154
+ }), [q]), O(() => {
155
+ d !== !0 && m && y === "outside" && Ct(u);
156
+ }, [u, m, d, y, P]);
157
+ const qe = (e) => {
152
158
  if (e === null || e === 0) return;
153
159
  e === void 0 && (e = i.valueCom.length);
154
- const o = document.querySelector(`.${Te} > .select-content > .check-select-content`);
160
+ const o = document.querySelector(`.${Me} > .select-content > .check-select-content`);
155
161
  if (o)
156
162
  if (o.scrollHeight > o.clientHeight) {
157
163
  const t = Number(e) - 1;
158
- pe(t), Ie(t);
164
+ he(t), qe(t);
159
165
  } else
160
- i.valueCom.length <= e && He();
161
- }, ie = () => {
162
- if (i.valueCom.length === 0) return pe(null);
166
+ i.valueCom.length <= e && Ke();
167
+ }, ce = () => {
168
+ if (i.valueCom.length === 0) return he(null);
163
169
  clearTimeout(i.timer), i.timer = setTimeout(() => {
164
- pe(i.valueCom.length), Ie();
170
+ he(i.valueCom.length), qe();
165
171
  }, 50);
166
- }, Ve = (e, o) => {
172
+ }, Fe = (e, o) => {
167
173
  const t = [], n = [...e];
168
174
  for (let l = 0, c = n.length; l < c; l++) {
169
175
  const a = { ...n[l] };
170
176
  if (a[D] && a[D].length > 0) {
171
177
  const w = a[D], p = [];
172
178
  for (let M = 0, oe = w.length; M < oe; M++) {
173
- const ge = w[M];
174
- (o || ze(ge)) && p.push(ge);
179
+ const ye = w[M];
180
+ (o || Be(ye)) && p.push(ye);
175
181
  }
176
182
  p.length > 0 && (a[D] = p, t.push(a));
177
183
  } else
178
- (o || ze(a)) && t.push(a);
184
+ (o || Be(a)) && t.push(a);
179
185
  }
180
- st(t), re(!1), nt(t.length === 0);
181
- }, qe = () => {
186
+ nt(t), ie(!1), it(t.length === 0);
187
+ }, ze = () => {
182
188
  const e = te && te.current;
183
189
  i.searchModel !== "inside" && e && e.focus({ preventScroll: !0 });
184
- }, Fe = (e, o) => {
190
+ }, He = (e, o) => {
185
191
  let t = e;
186
- const n = t.matches || t.webkitMatchesSelector || t.mozMatchesSelector || t.msMatchesSelector;
192
+ const n = t && (t.matches || t.webkitMatchesSelector || t.mozMatchesSelector || t.msMatchesSelector);
193
+ if (!n) return null;
187
194
  for (; t && !n.call(t, o); )
188
195
  t = t.parentElement;
189
196
  return t;
190
- }, ze = (e) => {
197
+ }, Be = (e) => {
191
198
  let o = !0;
192
199
  if (u.trim() === "") return o;
193
200
  const t = e[N];
194
201
  return t && (typeof t == "number" || typeof t == "string") ? t.toString().toLowerCase().indexOf(u.trim().toLowerCase()) === -1 && (o = !1) : o = !1, o;
195
- }, rt = () => {
202
+ }, ct = () => {
196
203
  d !== !0 && Y(!0);
197
- }, it = () => {
204
+ }, at = () => {
198
205
  Y(!1);
199
- }, ct = (e) => {
200
- Le(!0), Y(!1), e.stopPropagation();
201
- }, He = () => {
202
- i.openMore && Le(!1);
203
- }, ce = (e, o) => (t) => {
206
+ }, mt = (e) => {
207
+ Ee(!0), Y(!1), e.stopPropagation();
208
+ }, Ke = () => {
209
+ i.openMore && Ee(!1);
210
+ }, ae = (e, o) => (t) => {
204
211
  const n = e[$];
205
212
  if (!(typeof d == "object" && d.indexOf(n) !== -1))
206
213
  if (m) {
207
214
  const l = i.valueCom.indexOf(n);
208
- l !== -1 ? i.valueCom.splice(l, 1) : i.valueCom.push(n), f.value === void 0 && T([...i.valueCom]), C && C([...i.valueCom], t), o && G && G([...i.valueCom]), qe();
215
+ l !== -1 ? i.valueCom.splice(l, 1) : i.valueCom.push(n), h.value === void 0 && T([...i.valueCom]), v && v([...i.valueCom], t), o && R && R([...i.valueCom]), ze();
209
216
  } else
210
- f.value === void 0 && T([n]), C && C(n, t), o && G && G(n), it(), W("");
211
- }, Be = (e, o) => (t) => {
217
+ h.value === void 0 && T([n]), v && v(n, t), o && R && R(n), at(), U("");
218
+ }, Ae = (e, o) => (t) => {
212
219
  e || (e = {
213
220
  [$]: o,
214
221
  children: []
215
- }), ce(e)(t), t.stopPropagation();
216
- }, at = () => {
217
- let e = `${v}-select`;
218
- return m && !z && (e += ` ${Te}`), B && (e += ` ${B}`), K && (e += ` ${v}-select-${K}`), Se && (e += ` ${v}-select-error`), d === !0 && (e += ` ${v}-select-disabled`), F && (e += ` ${v}-select-open`), m && (e += ` ${v}-select-multiple`), z && (e += ` ${v}-select-over-line`), h && (e += ` ${v}-select-show-select`), r.length > 0 && (e += ` ${v}-select-value`), b && (e += ` ${v}-select-allow-clear`), e;
219
- }, mt = () => {
220
- let e = `${v}-select-popover ${v}-scrollbar-small`;
221
- return K && (e += ` ${v}-select-popover-${K}`), m ? e += ` ${v}-select-popover-multiple` : e += ` ${v}-select-popover-radio`, be && (e += ` ${be}`), h || (e += ` ${v}-select-popover-hide`), e;
222
+ }), ae(e)(t), t.stopPropagation();
222
223
  }, ut = () => {
223
- let e = `${v}-select-more-popover ${v}-scrollbar-small`;
224
- return K && (e += ` ${v}-select-more-popover-${K}`), Ne && (e += ` ${Ne}`), e;
225
- }, dt = (e) => {
226
- W(e.target.value), g && g.onChange && g.onChange(e);
227
- }, ft = (e, o) => {
228
- W(e), o && g?.onChange && g.onChange(o);
229
- }, Ke = (e) => {
224
+ let e = `${f}-select`;
225
+ return m && !F && (e += ` ${Me}`), E && (e += ` ${E}`), B && (e += ` ${f}-select-${B}`), ke && (e += ` ${f}-select-error`), d === !0 && (e += ` ${f}-select-disabled`), q && (e += ` ${f}-select-open`), m && (e += ` ${f}-select-multiple`), F && (e += ` ${f}-select-over-line`), S && (e += ` ${f}-select-show-select`), r.length > 0 && (e += ` ${f}-select-value`), H && (e += ` ${f}-select-allow-clear`), e;
226
+ }, dt = () => {
227
+ let e = `${f}-select-popover ${f}-scrollbar-small`;
228
+ return B && (e += ` ${f}-select-popover-${B}`), m ? e += ` ${f}-select-popover-multiple` : e += ` ${f}-select-popover-radio`, Ne && (e += ` ${Ne}`), S || (e += ` ${f}-select-popover-hide`), e;
229
+ }, pt = () => {
230
+ let e = `${f}-select-more-popover ${f}-scrollbar-small`;
231
+ return B && (e += ` ${f}-select-more-popover-${B}`), $e && (e += ` ${$e}`), e;
232
+ }, ft = (e) => {
233
+ U(e.target.value), C && C.onChange && C.onChange(e);
234
+ }, ht = (e, o) => {
235
+ U(e), o && C?.onChange && C.onChange(o);
236
+ }, Re = (e) => {
230
237
  if (e.keyCode === 13) {
231
- $e && $e(u);
238
+ Te && Te(u);
232
239
  const o = document.querySelector(`.${X} .select-popover-list`);
233
240
  if (o) {
234
241
  const t = o.querySelector(".select-popover-list-item-hover");
235
242
  if (o.querySelector(".select-popover-list-item-keydown") || t) return;
236
243
  }
237
- if (f.input && u.trim() !== "") {
244
+ if (h.input && u.trim() !== "") {
238
245
  if (m) {
239
246
  const t = [...r, u];
240
- f.value === void 0 && T(t), C && C(t, e);
247
+ h.value === void 0 && T(t), v && v(t, e);
241
248
  } else
242
- f.value === void 0 && T([u]), C && C(u, e);
243
- W("");
249
+ h.value === void 0 && T([u]), v && v(u, e);
250
+ U("");
244
251
  }
245
252
  }
246
- g && g.onKeyDown && g.onKeyDown(e);
247
- }, pt = (e) => {
248
- if (f.input && ne && u.trim() !== "") {
253
+ C && C.onKeyDown && C.onKeyDown(e);
254
+ }, vt = (e) => {
255
+ if (h.input && re && u.trim() !== "") {
249
256
  if (m) {
250
257
  const o = [...r, u];
251
- f.value === void 0 && T(o), C && C(o, e);
258
+ h.value === void 0 && T(o), v && v(o, e);
252
259
  } else
253
- f.value === void 0 && T([u]), C && C(u, e);
254
- W("");
260
+ h.value === void 0 && T([u]), v && v(u, e);
261
+ U("");
255
262
  }
256
- i.inputOpen = !1, g && g.onBlur?.(e);
257
- }, ht = (e) => {
263
+ i.inputOpen = !1, C && C.onBlur?.(e);
264
+ }, Ct = (e) => {
258
265
  const o = te && te.current;
259
266
  if (!o) return null;
260
267
  const t = window.getComputedStyle(o), n = t.fontFamily, l = t.fontSize;
261
- let a = Bt(l, n, e).width;
268
+ let a = At(l, n, e).width;
262
269
  a < 10 && (a = 10), o.style.width = `${a}px`;
263
- }, Ae = (e) => {
270
+ }, Ge = (e) => {
264
271
  const { selectDom: o, keyCode: t, currentKeydownDom: n } = e;
265
272
  let l = null, c = "nextElementSibling", a = ".select-popover-list > div", w = ".select-popover-list-item";
266
273
  if (t === 38 && (c = "previousElementSibling", a = ".select-popover-list > div:last-child", w = ".select-popover-list-item:last-child"), !n)
@@ -277,16 +284,16 @@ const Bt = (f, B, O) => {
277
284
  if (l)
278
285
  if (l.className.indexOf("select-popover-list-group") !== -1) {
279
286
  const p = l.querySelector(w);
280
- p && (p.classList.add("select-popover-list-item-keydown"), Re(p, o));
287
+ p && (p.classList.add("select-popover-list-item-keydown"), Je(p, o));
281
288
  } else
282
- l.classList.add("select-popover-list-item-keydown"), Re(l, o);
283
- }, Re = (e, o) => {
289
+ l.classList.add("select-popover-list-item-keydown"), Je(l, o);
290
+ }, Je = (e, o) => {
284
291
  clearTimeout(i.scrollTimer);
285
292
  const t = o.clientHeight, l = e.offsetTop + e.clientHeight - t;
286
293
  i.scroll = !0, l > 0 ? o.scrollTop = l : o.scrollTop = 0, i.scrollTimer = setTimeout(() => {
287
294
  i.scroll = !1;
288
295
  }, 100);
289
- }, Ce = (e) => {
296
+ }, ge = (e) => {
290
297
  const o = document.querySelector(`.${X} .select-popover-list`);
291
298
  if (!o) return;
292
299
  const t = o.querySelector(".select-popover-list-item-select"), n = o.querySelector(".select-popover-list-item-hover"), l = o.querySelector(".select-popover-list-item-keydown");
@@ -295,100 +302,100 @@ const Bt = (f, B, O) => {
295
302
  const a = l || n;
296
303
  if (a) {
297
304
  const w = a.dataset.val;
298
- ce(x[w], !0)({ target: l });
305
+ ae(x[w], !0)({ target: l });
299
306
  } else
300
- G && k !== void 0 && G(k);
307
+ R && b !== void 0 && R(b);
301
308
  }
302
- l && (c = l, l.classList.remove("select-popover-list-item-keydown")), e.keyCode === 40 && Ae({
309
+ l && (c = l, l.classList.remove("select-popover-list-item-keydown")), e.keyCode === 40 && Ge({
303
310
  selectDom: o,
304
311
  keyCode: e.keyCode,
305
312
  currentKeydownDom: c
306
- }), e.keyCode === 38 && Ae({
313
+ }), e.keyCode === 38 && Ge({
307
314
  selectDom: o,
308
315
  keyCode: e.keyCode,
309
316
  currentKeydownDom: c
310
317
  });
311
- }, Ge = (e) => {
318
+ }, Ue = (e) => {
312
319
  if (i.scroll) return;
313
- const o = Fe(e.target, ".select-popover-list-item");
320
+ const o = He(e.target, ".select-popover-list-item");
314
321
  if (!o) return;
315
322
  o.classList.add("select-popover-list-item-hover");
316
323
  const t = document.querySelector(`.${X}`);
317
324
  if (!t) return;
318
325
  const n = t.querySelector(".select-popover-list-item-keydown");
319
326
  n && n.classList.remove("select-popover-list-item-keydown");
320
- }, Je = (e) => {
321
- const o = Fe(e.target, ".select-popover-list-item");
327
+ }, We = (e) => {
328
+ const o = He(e.target, ".select-popover-list-item");
322
329
  o && o.classList.remove("select-popover-list-item-hover");
323
- }, vt = H(() => {
324
- const e = !!(A || R || V), o = () => {
330
+ }, gt = z(() => {
331
+ const e = !!(K || A || I), o = () => {
325
332
  let t = "select-label";
326
333
  return Q && Q.className && (t += ` ${Q.className}`), t;
327
334
  };
328
335
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: _ === "outside" && e && /* @__PURE__ */ s.jsx(
329
- $t,
336
+ Tt,
330
337
  {
331
- label: A,
332
- required: R,
333
- labelSign: V,
338
+ label: K,
339
+ required: A,
340
+ labelSign: I,
334
341
  ...Q,
335
342
  className: o()
336
343
  }
337
344
  ) });
338
- }, [_, A, V, R, Q]), Ct = H(() => {
339
- const e = () => _ === "outside" ? se : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
340
- A || se,
341
- R && /* @__PURE__ */ s.jsx("span", { className: "select-required", children: "*" }),
342
- V && /* @__PURE__ */ s.jsx("span", { children: V })
345
+ }, [_, K, I, A, Q]), yt = z(() => {
346
+ const e = () => _ === "outside" ? le : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
347
+ K || le,
348
+ A && /* @__PURE__ */ s.jsx("span", { className: "select-required", children: "*" }),
349
+ I && /* @__PURE__ */ s.jsx("span", { children: I })
343
350
  ] });
344
351
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: !Z && /* @__PURE__ */ s.jsx("span", { className: "select-label-placeholder", children: e() }) });
345
- }, [Z, _, se, A, V, R]), Ue = (e) => {
352
+ }, [Z, _, le, K, I, A]), _e = (e) => {
346
353
  if (d === !0) return null;
347
354
  const o = `${e}-search-outside`;
348
355
  return y === "outside" ? /* @__PURE__ */ s.jsx(
349
356
  "input",
350
357
  {
351
- ...g,
358
+ ...C,
352
359
  onClick: (t) => {
353
- i.inputOpen = !0, g && g.onClick?.(t);
360
+ i.inputOpen = !0, C && C.onClick?.(t);
354
361
  },
355
- onBlur: pt,
362
+ onBlur: vt,
356
363
  className: o,
357
364
  value: u,
358
- onChange: dt,
359
- onKeyDown: Ke,
365
+ onChange: ft,
366
+ onKeyDown: Re,
360
367
  ref: te
361
368
  }
362
369
  ) : null;
363
- }, gt = H(() => {
370
+ }, xt = z(() => {
364
371
  const e = () => {
365
- if (u !== "" && (y === "outside" || I)) return null;
366
- const o = String(r[0]), t = x[o] && x[o][N] || r[0], n = S && S(x[o], !1);
367
- return z ? n || t : /* @__PURE__ */ s.jsx(ae, { placement: "top-start", children: n || t });
372
+ if (u !== "" && (y === "outside" || P)) return null;
373
+ const o = String(r[0]), t = x[o] && x[o][N] || r[0], n = k && k(x[o], !1);
374
+ return F ? n || t : /* @__PURE__ */ s.jsx(me, { placement: "top-start", children: n || t });
368
375
  };
369
376
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: !m && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
370
377
  /* @__PURE__ */ s.jsx("div", { className: "radio-select-content", children: e() }),
371
- Ue("radio")
378
+ _e("radio")
372
379
  ] }) });
373
380
  }, [
374
381
  m,
375
382
  Z,
376
- z,
383
+ F,
377
384
  x,
378
385
  r,
379
386
  N,
380
- q,
387
+ V,
381
388
  y,
382
389
  u,
383
390
  d,
384
- I,
385
- g,
386
- S,
387
- ne
388
- ]), yt = H(() => {
391
+ P,
392
+ C,
393
+ k,
394
+ re
395
+ ]), wt = z(() => {
389
396
  const e = (o) => {
390
397
  const t = String(r[o]), n = x[t] && x[t][N] || r[o];
391
- return S && S(x[t], !1) || n;
398
+ return k && k(x[t], !1) || n;
392
399
  };
393
400
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: m && /* @__PURE__ */ s.jsxs("div", { className: "check-select-content", children: [
394
401
  r && r.map((o, t) => {
@@ -401,11 +408,11 @@ const Bt = (f, B, O) => {
401
408
  {
402
409
  className: l,
403
410
  children: [
404
- /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx(ae, { placement: "top-start", children: e(t) }) }),
411
+ /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx(me, { placement: "top-start", children: e(t) }) }),
405
412
  n && /* @__PURE__ */ s.jsx(
406
- Xe,
413
+ Ze,
407
414
  {
408
- onClick: Be(x[String(r[t])], r[t])
415
+ onClick: Ae(x[String(r[t])], r[t])
409
416
  }
410
417
  )
411
418
  ]
@@ -419,7 +426,7 @@ const Bt = (f, B, O) => {
419
426
  "div",
420
427
  {
421
428
  className: "check-select-content-item check-select-content-item-more",
422
- onClick: ct,
429
+ onClick: mt,
423
430
  children: /* @__PURE__ */ s.jsxs("span", { children: [
424
431
  "+",
425
432
  r.length - L
@@ -427,7 +434,7 @@ const Bt = (f, B, O) => {
427
434
  }
428
435
  );
429
436
  })(),
430
- Ue("check")
437
+ _e("check")
431
438
  ] }) });
432
439
  }, [
433
440
  m,
@@ -436,41 +443,41 @@ const Bt = (f, B, O) => {
436
443
  L,
437
444
  x,
438
445
  d,
439
- C,
446
+ v,
440
447
  u,
441
- q,
448
+ V,
442
449
  y,
443
- I,
444
- g,
445
- S,
446
- ne
447
- ]), xt = (e) => {
450
+ P,
451
+ C,
452
+ k,
453
+ re
454
+ ]), jt = (e) => {
448
455
  e.stopPropagation();
449
- let o = "";
450
- const t = [];
451
- if (m && (o = [], d instanceof Array))
456
+ const o = [];
457
+ let t;
458
+ if (m && (t = [], d instanceof Array))
452
459
  for (let n = 0, l = r.length; n < l; n++) {
453
460
  const c = r[n];
454
- d.indexOf(c) !== -1 && (o.push(c), t.push(c));
461
+ d.indexOf(c) !== -1 && (t.push(c), o.push(c));
455
462
  }
456
- f.value === void 0 && T(t), C && C(o, e), Y(!1), me && me();
457
- }, wt = () => {
458
- if (r.length > 0 && d !== !0 && b)
463
+ h.value === void 0 && T(o), v && v(t, e), Y(!1), ue && ue();
464
+ }, St = () => {
465
+ if (r.length > 0 && d !== !0 && H)
459
466
  return /* @__PURE__ */ s.jsx(
460
467
  "span",
461
468
  {
462
469
  className: "clean-up-icon",
463
- onClick: xt,
464
- children: /* @__PURE__ */ s.jsx(Lt, {})
470
+ onClick: jt,
471
+ children: /* @__PURE__ */ s.jsx(Et, {})
465
472
  }
466
473
  );
467
- }, jt = () => {
474
+ }, kt = () => {
468
475
  const e = (o) => {
469
476
  const t = String(r[o]), n = x[t] && x[t][N] || r[o];
470
- return S && S(x[t], "more") || n;
477
+ return k && k(x[t], "more") || n;
471
478
  };
472
479
  return /* @__PURE__ */ s.jsxs("div", { className: "select-more", children: [
473
- /* @__PURE__ */ s.jsx("div", { className: "select-more-title", children: /* @__PURE__ */ s.jsx("span", { children: Pe({ id: "more" }) }) }),
480
+ /* @__PURE__ */ s.jsx("div", { className: "select-more-title", children: /* @__PURE__ */ s.jsx("span", { children: Ve({ id: "more" }) }) }),
474
481
  /* @__PURE__ */ s.jsx("div", { className: "select-more-content", children: r && r.map((o, t) => {
475
482
  if (L !== null && L > t) return null;
476
483
  let n = !0;
@@ -479,11 +486,11 @@ const Bt = (f, B, O) => {
479
486
  {
480
487
  className: "select-more-content-item",
481
488
  children: [
482
- /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx(ae, { placement: "top-start", children: e(t) }) }),
489
+ /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx(me, { placement: "top-start", children: e(t) }) }),
483
490
  n && /* @__PURE__ */ s.jsx(
484
- Xe,
491
+ Ze,
485
492
  {
486
- onClick: Be(x[String(r[t])], r[t])
493
+ onClick: Ae(x[String(r[t])], r[t])
487
494
  }
488
495
  )
489
496
  ]
@@ -492,67 +499,67 @@ const Bt = (f, B, O) => {
492
499
  );
493
500
  }) })
494
501
  ] });
495
- }, We = H(() => /* @__PURE__ */ s.jsx(
496
- Vt,
502
+ }, Qe = z(() => /* @__PURE__ */ s.jsx(
503
+ Ft,
497
504
  {
498
505
  placement: "bottom-end",
499
- visible: he,
500
- content: jt(),
501
- onVisibleChange: He,
502
- overlayClassName: ut(),
506
+ visible: ve,
507
+ content: kt(),
508
+ onVisibleChange: Ke,
509
+ overlayClassName: pt(),
503
510
  children: /* @__PURE__ */ s.jsxs(
504
511
  "div",
505
512
  {
506
513
  className: "select-content",
507
- onClick: rt,
508
- ref: J,
514
+ onClick: ct,
515
+ ref: G,
509
516
  children: [
510
- Ct,
517
+ yt,
511
518
  /* @__PURE__ */ s.jsxs("span", { className: "select-svg", children: [
512
- /* @__PURE__ */ s.jsx(Mt, {}),
513
- wt()
519
+ /* @__PURE__ */ s.jsx(Ot, {}),
520
+ St()
514
521
  ] }),
515
- gt,
516
- yt
522
+ xt,
523
+ wt
517
524
  ]
518
525
  }
519
526
  )
520
527
  }
521
528
  ), [
522
- J,
529
+ G,
523
530
  Z,
524
531
  _,
525
- se,
532
+ le,
533
+ K,
534
+ I,
526
535
  A,
527
- V,
528
- R,
529
- z,
536
+ F,
530
537
  x,
531
538
  r,
532
539
  N,
533
540
  m,
534
541
  L,
535
542
  d,
536
- C,
543
+ v,
537
544
  u,
538
545
  y,
539
- I,
540
- h,
541
- g,
542
- b,
543
- me,
544
- he,
546
+ P,
545
547
  S,
546
- ne
547
- ]), St = H(() => {
548
+ C,
549
+ H,
550
+ ue,
551
+ ve,
552
+ k,
553
+ re
554
+ ]), bt = z(() => {
548
555
  const e = () => {
549
556
  let t = "select-popover-list";
550
557
  return ee && (t += " select-popover-list-loading"), t;
551
558
  }, o = (t) => {
552
- const n = t[N] || t[$], l = S && S(t, !0);
559
+ const n = t[N] || t[$], l = k && k(t, !0);
553
560
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
554
- /* @__PURE__ */ s.jsx("span", { className: "select-popover-list-item-label", children: /* @__PURE__ */ s.jsx(ae, { placement: "top-start", children: l || n }) }),
555
- m && ue && /* @__PURE__ */ s.jsx("span", { className: "select-popover-list-item-svg", children: /* @__PURE__ */ s.jsx(Et, {}) })
561
+ /* @__PURE__ */ s.jsx("span", { className: "select-popover-list-item-label", children: /* @__PURE__ */ s.jsx(me, { placement: "top-start", children: l || n }) }),
562
+ m && de && /* @__PURE__ */ s.jsx("span", { className: "select-popover-list-item-svg", children: /* @__PURE__ */ s.jsx(Pt, {}) })
556
563
  ] });
557
564
  };
558
565
  return /* @__PURE__ */ s.jsxs(
@@ -561,7 +568,7 @@ const Bt = (f, B, O) => {
561
568
  className: e(),
562
569
  style: { outline: "1px solid transparent" },
563
570
  children: [
564
- U && U.length > 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: U.map((t, n) => {
571
+ J && J.length > 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: J.map((t, n) => {
565
572
  if (t[D] && t[D].length > 0) {
566
573
  const a = t[D];
567
574
  return /* @__PURE__ */ s.jsxs(
@@ -576,10 +583,10 @@ const Bt = (f, B, O) => {
576
583
  return r.indexOf(M) !== -1 && (oe += " select-popover-list-item-select"), typeof d == "object" && d.indexOf(M) !== -1 && (oe += " select-popover-list-item-disabled"), /* @__PURE__ */ s.jsx(
577
584
  "div",
578
585
  {
579
- onClick: ce(w),
586
+ onClick: ae(w),
580
587
  className: oe,
581
- onMouseEnter: Ge,
582
- onMouseLeave: Je,
588
+ onMouseEnter: Ue,
589
+ onMouseLeave: We,
583
590
  "data-val": M,
584
591
  children: o(w)
585
592
  },
@@ -596,135 +603,135 @@ const Bt = (f, B, O) => {
596
603
  return r.indexOf(l) !== -1 && (c += " select-popover-list-item-select"), typeof d == "object" && d.indexOf(l) !== -1 && (c += " select-popover-list-item-disabled"), /* @__PURE__ */ s.jsx(
597
604
  "div",
598
605
  {
599
- onClick: ce(t),
606
+ onClick: ae(t),
600
607
  className: c,
601
- onMouseEnter: Ge,
602
- onMouseLeave: Je,
608
+ onMouseEnter: Ue,
609
+ onMouseLeave: We,
603
610
  "data-val": l,
604
611
  children: o(t)
605
612
  },
606
613
  n
607
614
  );
608
- }) }) : !ee && ve && /* @__PURE__ */ s.jsx("div", { className: "select-nodata", children: /* @__PURE__ */ s.jsx(
609
- Nt,
615
+ }) }) : !ee && Ce && /* @__PURE__ */ s.jsx("div", { className: "select-nodata", children: /* @__PURE__ */ s.jsx(
616
+ Dt,
610
617
  {
611
- ...P,
612
- size: P?.size || "small"
618
+ ...se,
619
+ size: se?.size || "small"
613
620
  }
614
621
  ) }),
615
- ee && /* @__PURE__ */ s.jsx(It, {})
622
+ ee && /* @__PURE__ */ s.jsx(qt, {})
616
623
  ]
617
624
  }
618
625
  );
619
626
  }, [
620
- U,
627
+ J,
621
628
  N,
622
629
  $,
623
630
  r,
624
- C,
631
+ v,
625
632
  m,
626
633
  ee,
627
- Ee,
628
- Oe,
629
- P,
630
- ve,
631
- S,
632
- ue
633
- ]), kt = H(() => {
634
- if (!h) return "";
634
+ Pe,
635
+ Ie,
636
+ se,
637
+ Ce,
638
+ k,
639
+ de
640
+ ]), Nt = z(() => {
641
+ if (!S) return "";
635
642
  const e = () => {
636
643
  let o = `select-popover-content ${X}`;
637
- return q && y === "inside" && (o += " select-popover-content-search"), o;
644
+ return V && y === "inside" && (o += " select-popover-content-search"), o;
638
645
  };
639
646
  return /* @__PURE__ */ s.jsxs(
640
647
  "div",
641
648
  {
642
- style: { width: `${J && J.current ? J.current.offsetWidth : 0}px` },
649
+ style: { width: `${G && G.current ? G.current.offsetWidth : 0}px` },
643
650
  className: e(),
644
651
  children: [
645
- q && y === "inside" && /* @__PURE__ */ s.jsx(
646
- qt,
652
+ V && y === "inside" && /* @__PURE__ */ s.jsx(
653
+ zt,
647
654
  {
648
- placeholder: we || Pe({ id: "searchPlaceholder" }),
649
- onKeydown: Ke,
655
+ placeholder: je || Ve({ id: "searchPlaceholder" }),
656
+ onKeydown: Re,
650
657
  value: u,
651
- onChange: ft,
658
+ onChange: ht,
652
659
  className: "select-popover-search"
653
660
  }
654
661
  ),
655
- St
662
+ bt
656
663
  ]
657
664
  }
658
665
  );
659
666
  }, [
660
- F,
667
+ q,
668
+ G,
661
669
  J,
662
- U,
663
670
  D,
664
671
  $,
665
672
  N,
666
673
  r,
667
674
  u,
668
- q,
675
+ V,
669
676
  X,
670
677
  y,
671
678
  m,
672
- we,
673
- h,
674
- ee,
675
- g,
676
- Ee,
677
- Oe,
678
- P,
679
- ve,
679
+ je,
680
680
  S,
681
- ue
682
- ]), bt = () => /* @__PURE__ */ s.jsx(
683
- Dt,
681
+ ee,
682
+ C,
683
+ Pe,
684
+ Ie,
685
+ se,
686
+ Ce,
687
+ k,
688
+ de
689
+ ]), $t = () => /* @__PURE__ */ s.jsx(
690
+ Lt,
684
691
  {
685
- visible: F,
692
+ visible: q,
686
693
  placement: "bottomLeft",
687
694
  trigger: ["click"],
688
- overlay: /* @__PURE__ */ s.jsx(s.Fragment, { children: kt }),
689
- overlayClassName: mt(),
690
- getPopupContainer: tt,
695
+ overlay: /* @__PURE__ */ s.jsx(s.Fragment, { children: Nt }),
696
+ overlayClassName: dt(),
697
+ getPopupContainer: st,
691
698
  onVisibleChange: (e) => {
692
699
  e || (clearTimeout(i.dropDownTimer), i.dropDownTimer = setTimeout(() => {
693
700
  i.inputOpen || Y(!1);
694
701
  }, 0));
695
702
  },
696
- children: je ? /* @__PURE__ */ s.jsx(
697
- Ft,
703
+ children: Se ? /* @__PURE__ */ s.jsx(
704
+ Ht,
698
705
  {
699
706
  disabled: !0,
700
- ...je,
701
- children: We
707
+ ...Se,
708
+ children: Qe
702
709
  }
703
- ) : We
710
+ ) : Qe
704
711
  }
705
712
  );
706
713
  return /* @__PURE__ */ s.jsxs(
707
714
  "div",
708
715
  {
709
- className: at(),
710
- style: O,
716
+ className: ut(),
717
+ style: g,
711
718
  children: [
712
- vt,
713
- bt(),
719
+ gt,
720
+ $t(),
714
721
  /* @__PURE__ */ s.jsx(
715
- zt,
722
+ Bt,
716
723
  {
717
724
  className: "select-error-text",
718
- error: Se,
719
- helperText: et,
720
- hideErrorDom: Ze
725
+ error: ke,
726
+ helperText: ot,
727
+ hideErrorDom: tt
721
728
  }
722
729
  )
723
730
  ]
724
731
  }
725
732
  );
726
- };
733
+ }
727
734
  export {
728
- uo as default
735
+ fo as default
729
736
  };
730
737
  //# sourceMappingURL=index.js.map