@unicom-cloud/ui 0.8.107 → 0.8.108

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 (137) hide show
  1. package/ColorPicker.js +15 -14
  2. package/Constant.js +4 -0
  3. package/Copy.js +4 -3
  4. package/Countdown.js +25 -0
  5. package/Grid.js +8 -10
  6. package/LiquidFill.js +4 -3
  7. package/List.js +7 -6
  8. package/Marquee.js +4 -3
  9. package/PageHeader.js +3 -2
  10. package/QrCode.js +4 -3
  11. package/RowCol.js +8 -0
  12. package/Segmented.js +14 -4
  13. package/Statistic.js +5 -4
  14. package/Tour.js +4 -3
  15. package/Transfer.js +4 -2
  16. package/anchor/Link.js +1 -1
  17. package/avatar/Group.js +1 -1
  18. package/button/index.js +52 -51
  19. package/calendar/Lunar.js +21 -21
  20. package/cascader/base/node.js +22 -20
  21. package/cascader/base/store.js +10 -10
  22. package/cascader/util.js +29 -27
  23. package/color-picker/Mode.js +8 -7
  24. package/color-picker/hooks/useColorPicker.js +56 -55
  25. package/color-picker/index.js +54 -53
  26. package/color-picker/utils.js +58 -57
  27. package/components/common/empty/index.js +2 -2
  28. package/components/common/flex/index.js +64 -55
  29. package/components/common/flex/interface.js +6 -6
  30. package/components/common/hooks/useInterval.js +6 -6
  31. package/components/common/space/index.js +53 -53
  32. package/components/common/utils/dayjs.js +75 -62
  33. package/components/common/utils/toArray.js +7 -5
  34. package/constant/index.js +4 -0
  35. package/copy/index.js +2 -1
  36. package/countdown/index.js +113 -0
  37. package/countdown/interface.js +1 -0
  38. package/countdown/util.js +29 -0
  39. package/descriptions/index.js +26 -26
  40. package/dropdown/Button.js +1 -1
  41. package/flex/index.js +30 -29
  42. package/form/FormItem.js +126 -122
  43. package/grid/Grid.js +40 -41
  44. package/grid/Item.js +37 -37
  45. package/grid/context.js +2 -3
  46. package/grid/index.js +6 -8
  47. package/hooks/useResponsiveState.js +54 -0
  48. package/index.js +614 -610
  49. package/input/InputElement.js +25 -24
  50. package/layout/Sider.js +1 -1
  51. package/liquid-fill/index.js +4 -3
  52. package/list/Item.js +21 -21
  53. package/list/index.js +53 -52
  54. package/marquee/index.js +20 -19
  55. package/marquee-/index.js +4 -3
  56. package/mentions/util.js +9 -8
  57. package/package.json +1 -1
  58. package/page-header/index.js +57 -56
  59. package/pagination/Pagination.js +89 -92
  60. package/qr-code/index.js +4 -3
  61. package/radio/Group.js +1 -1
  62. package/row-col/Col-.js +88 -0
  63. package/row-col/Col.js +159 -0
  64. package/row-col/Row.js +73 -0
  65. package/row-col/context.js +5 -0
  66. package/row-col/index.js +11 -0
  67. package/row-col/interface.js +1 -0
  68. package/segmented/index.js +257 -206
  69. package/select/Select.js +191 -191
  70. package/select/util.js +50 -50
  71. package/space/index.js +15 -13
  72. package/statistic/index.js +56 -55
  73. package/statistic/interface.js +4 -1
  74. package/style.css +1 -1
  75. package/table/hook/useColumns.js +27 -26
  76. package/table/hook/useStickyClassNames.js +9 -8
  77. package/table/hook/useThResizable.js +4 -3
  78. package/table/th-resizable/index.js +11 -10
  79. package/table/thead/index.js +18 -16
  80. package/timeline/Item.js +1 -1
  81. package/tour/index.js +4 -3
  82. package/transfer/index.js +93 -91
  83. package/trigger/index.js +66 -66
  84. package/types/common/flex/index.d.ts +3 -9
  85. package/types/common/flex/interface.d.ts +15 -4
  86. package/types/common/space/index.d.ts +3 -5
  87. package/types/common/space/interface.d.ts +2 -0
  88. package/types/common/utils/dayjs.d.ts +3 -1
  89. package/types/pc/button/interface.d.ts +2 -2
  90. package/types/pc/config-provider/interface.d.ts +16 -11
  91. package/types/pc/constant/index.d.ts +1 -0
  92. package/types/pc/countdown/interface.d.ts +65 -0
  93. package/types/pc/countdown/util.d.ts +7 -0
  94. package/types/pc/flex/index.d.ts +8 -6
  95. package/types/pc/flex/interface.d.ts +3 -10
  96. package/types/pc/form/FormItem.d.ts +1 -1
  97. package/types/pc/form/interface.d.ts +1 -1
  98. package/types/pc/grid/Grid.d.ts +1 -2
  99. package/types/pc/grid/Item.d.ts +1 -2
  100. package/types/pc/grid/context.d.ts +0 -5
  101. package/types/pc/grid/index.d.ts +4 -6
  102. package/types/pc/grid/interface.d.ts +7 -125
  103. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  104. package/types/pc/index.d.ts +7 -3
  105. package/types/pc/list/interface.d.ts +2 -1
  106. package/types/pc/pagination/PageOption.d.ts +0 -1
  107. package/types/pc/pagination/interface.d.ts +5 -6
  108. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  109. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  110. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  111. package/types/pc/row-col/context.d.ts +6 -0
  112. package/types/pc/row-col/index.d.ts +7 -0
  113. package/types/pc/row-col/interface.d.ts +112 -0
  114. package/types/pc/segmented/index.d.ts +3 -7
  115. package/types/pc/segmented/interface.d.ts +38 -5
  116. package/types/pc/space/index.d.ts +5 -7
  117. package/types/pc/space/interface.d.ts +3 -10
  118. package/types/pc/statistic/index.d.ts +1 -1
  119. package/types/pc/statistic/interface.d.ts +1 -49
  120. package/types/pc/utils/names.d.ts +121 -113
  121. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  122. package/typography/Ellipsis.js +5 -4
  123. package/typography/Operations.js +4 -3
  124. package/utils/dayjs.js +13 -11
  125. package/utils/index.js +244 -242
  126. package/utils/names.js +15 -10
  127. package/utils/responsiveObserve.js +43 -36
  128. package/version/index.js +1 -1
  129. package/grid/Col-.js +0 -86
  130. package/grid/Col.js +0 -169
  131. package/grid/Row.js +0 -96
  132. package/grid/hook/useResponsiveState.js +0 -35
  133. package/statistic/Countdown.js +0 -56
  134. package/statistic/util.js +0 -33
  135. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  136. package/types/pc/statistic/util.d.ts +0 -1
  137. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
package/select/Select.js CHANGED
@@ -1,29 +1,29 @@
1
- import { jsx as I, jsxs as ct } from "react/jsx-runtime";
2
- import T from "lodash/isArray";
1
+ import { jsx as E, jsxs as ct } from "react/jsx-runtime";
2
+ import m from "lodash/isArray";
3
3
  import ft from "lodash/isFunction";
4
- import dt, { useContext as mt, useState as j, useMemo as Ae, useRef as v, useCallback as ne, useEffect as b, useImperativeHandle as gt } from "react";
4
+ import dt, { useContext as mt, useState as j, useMemo as Pe, useRef as b, useCallback as ne, useEffect as V, useImperativeHandle as gt } from "react";
5
5
  import ht from "../checkbox/Checkbox.js";
6
6
  import "../checkbox/Group.js";
7
7
  import "../config-provider/ConfigProvider.js";
8
8
  import Ct from "../components/common/hooks/useId.js";
9
9
  import Ot from "../components/common/hooks/useMergeProps.js";
10
- import Pe from "../components/common/hooks/useMergeValue.js";
10
+ import Ie from "../components/common/hooks/useMergeValue.js";
11
11
  import vt from "../select-view/index.js";
12
12
  import bt from "../trigger/index.js";
13
- import re from "@unicom-cloud/utils/class-name";
14
- import { getHotkeyHandler as yt } from "../components/common/utils/getHotkeyHandler.js";
13
+ import oe from "@unicom-cloud/utils/class-name";
14
+ import { getHotkeyHandler as Vt } from "../components/common/utils/getHotkeyHandler.js";
15
15
  import "../components/common/utils/is.js";
16
- import { Esc as Vt, Enter as Ie, Tab as _e, ArrowUp as wt, ArrowDown as kt } from "@unicom-cloud/utils/constant/keyboardCode";
16
+ import { Esc as yt, Enter as _e, Tab as Ee, ArrowUp as wt, ArrowDown as kt } from "@unicom-cloud/utils/constant/keyboardCode";
17
17
  import { omit as xt } from "../components/common/utils/omit.js";
18
18
  import { resizeObserver as St } from "../components/common/utils/resizeObserver.js";
19
- import { warning as At } from "../components/common/utils/warning.js";
20
- import Pt from "../virtual-list/VirtualList.js";
21
- import It from "./OptGroup.js";
22
- import _t from "./Option.js";
23
- import { getValidValue as Ee, flatChildren as Et, isEmpty as oe, preventDefaultEvent as Mt, isSelectOptGroup as Ft, isSelectOption as Lt } from "./util.js";
19
+ import { warning as Pt } from "../components/common/utils/warning.js";
20
+ import It from "../virtual-list/VirtualList.js";
21
+ import _t from "./OptGroup.js";
22
+ import Et from "./Option.js";
23
+ import { getValidValue as Me, flatChildren as Mt, isEmpty as re, preventDefaultEvent as At, isSelectOptGroup as Ft, isSelectOption as Lt } from "./util.js";
24
24
  import Nt from "../config-provider/context.js";
25
- import { isPlainObject as C } from "@unicom-cloud/utils/is";
26
- const Me = "userCreatingOption", Tt = {
25
+ import { isPlainObject as O } from "@unicom-cloud/utils/is";
26
+ const Ae = "userCreatingOption", Tt = {
27
27
  trigger: "click",
28
28
  bordered: !0,
29
29
  filterOption: !0,
@@ -71,172 +71,172 @@ function Dt(Fe, Le) {
71
71
  onKeyDown: Ze
72
72
  } = a;
73
73
  let { mode: q, allowCheckAll: Oe, allowCreate: c } = a;
74
- q === "tags" && (q = "multiple", c = !0, At(
74
+ q === "tags" && (q = "multiple", c = !0, Pt(
75
75
  !0,
76
76
  `[Pqb Select] The 'tags' mode will be removed in the next major version, please use {mode: "multiple", allowCreate: true} instead.`
77
77
  ));
78
78
  const f = Ne?.("select"), u = q === "multiple";
79
79
  u || (Oe = !1);
80
80
  const [et, z] = j(
81
- Ee(a.defaultValue, u, U)
82
- ), n = "value" in a ? Ee(a.value, u, U) : et, [d, tt, nt] = Pe("", {
81
+ Me(a.defaultValue, u, U)
82
+ ), n = "value" in a ? Me(a.value, u, U) : et, [d, tt, nt] = Ie("", {
83
83
  value: "inputValue" in a ? a.inputValue || "" : void 0
84
- }), [m, rt] = Pe(!1, {
84
+ }), [g, ot] = Ie(!1, {
85
85
  defaultValue: a.defaultPopupVisible,
86
86
  value: "popupVisible" in a ? a.popupVisible : y && "popupVisible" in y ? y.popupVisible : void 0
87
- }), [M, ot] = j(null), [F, it] = j([]), [g, _] = j(
88
- T(n) ? n[0] : n
87
+ }), [F, rt] = j(null), [L, it] = j([]), [h, M] = j(
88
+ m(n) ? n[0] : n
89
89
  ), {
90
90
  childrenList: J,
91
91
  optionInfoMap: p,
92
- optionValueList: V,
93
- optionIndexListForArrowKey: x,
92
+ optionValueList: w,
93
+ optionIndexListForArrowKey: S,
94
94
  hasOptGroup: lt,
95
95
  hasComplexLabelInOptions: st
96
- } = Ae(() => Et(
96
+ } = Pe(() => Mt(
97
97
  { children: se, options: ce, filterOption: fe },
98
98
  {
99
99
  prefixCls: f,
100
100
  inputValue: d,
101
- userCreatedOptions: F,
102
- userCreatingOption: M
101
+ userCreatedOptions: L,
102
+ userCreatingOption: F
103
103
  }
104
104
  ), [
105
105
  se,
106
106
  ce,
107
107
  fe,
108
108
  d,
109
- M,
110
- F
111
- ]), Q = v(null), ve = v(null), O = v(null), S = v([]), w = v(null), be = v(d), X = v(null), D = v(0), Y = v(!1), ye = Ct(`${f}-popup-`), R = oe(n, u), Ve = Ae(() => {
109
+ F,
110
+ L
111
+ ]), Q = b(null), ve = b(null), v = b(null), P = b([]), k = b(null), be = b(d), X = b(null), D = b(0), Y = b(!1), Ve = Ct(`${f}-popup-`), R = re(n, u), ye = Pe(() => {
112
112
  if (ue) {
113
- const e = T(n) ? n[0] : n, t = !R && p.get(e)?._valid, o = p?.get(V[0])?._origin === Me;
114
- return t && !o ? e : V[x[0]];
113
+ const e = m(n) ? n[0] : n, t = !R && p.get(e)?._valid, r = p?.get(w[0])?._origin === Ae;
114
+ return t && !r ? e : w[S[0]];
115
115
  }
116
116
  }, [
117
117
  n,
118
118
  p,
119
- V,
120
- x,
119
+ w,
120
+ S,
121
121
  ue,
122
122
  R
123
123
  ]), H = ne(
124
124
  (e, t) => {
125
- const o = p.get(e);
126
- Q.current && o?.child?.props && Q.current.scrollTo({
127
- key: o.child.props._key,
125
+ const r = p.get(e);
126
+ Q.current && r?.child?.props && Q.current.scrollTo({
127
+ key: r.child.props._key,
128
128
  options: t
129
129
  });
130
130
  },
131
131
  [p]
132
132
  ), $ = ne(
133
- (e, t = !1) => C(c) && typeof c?.formatter == "function" ? c.formatter(e, t) : e,
133
+ (e, t = !1) => O(c) && typeof c?.formatter == "function" ? c.formatter(e, t) : e,
134
134
  [c]
135
- ), A = (e, t) => {
135
+ ), I = (e, t) => {
136
136
  (e !== be.current || t !== X.current) && (tt(e), be.current = e, X.current = t, Xe?.(e, t));
137
- }, E = (e) => {
138
- m !== e && (rt(e), Qe?.(e), y?.onVisibleChange?.(e));
137
+ }, A = (e) => {
138
+ g !== e && (ot(e), Qe?.(e), y?.onVisibleChange?.(e));
139
139
  };
140
- b(() => {
141
- u ? Array.isArray(n) || z(n === void 0 ? [] : [n]) : Array.isArray(n) && z(n.length === 0 ? void 0 : n[0]);
142
- }, [u, n]), b(() => {
143
- if (m) {
144
- _(Ve);
145
- const e = T(n) ? n[0] : n;
140
+ V(() => {
141
+ u ? m(n) || z(n === void 0 ? [] : [n]) : m(n) && z(n.length === 0 ? void 0 : n[0]);
142
+ }, [u, n]), V(() => {
143
+ if (g) {
144
+ M(ye);
145
+ const e = m(n) ? n[0] : n;
146
146
  !R && p.has(e) && setTimeout(() => H(e));
147
147
  }
148
- }, [m]), b(() => {
149
- (w.current === "up" || w.current === "down") && (H(g), w.current = "none");
150
- }, [g]), b(() => {
151
- _(Ve);
152
- }, [JSON.stringify(J.map((e) => e?.props?.value))]), b(() => {
153
- S.current = S.current.filter((e) => u ? T(n) && n.indexOf(e.value) > -1 : e.value === n);
154
- }, [n, u]), b(() => {
148
+ }, [g]), V(() => {
149
+ (k.current === "up" || k.current === "down") && (H(h), k.current = "none");
150
+ }, [h]), V(() => {
151
+ M(ye);
152
+ }, [JSON.stringify(J.map((e) => e?.props?.value))]), V(() => {
153
+ P.current = P.current.filter((e) => u ? m(n) && n.indexOf(e.value) > -1 : e.value === n);
154
+ }, [n, u]), V(() => {
155
155
  if (c) {
156
156
  let e;
157
- if (oe(n, u))
157
+ if (re(n, u))
158
158
  e = [];
159
159
  else {
160
- const o = Array.isArray(n) ? n : [n], r = o.filter((i, l, h) => {
161
- const k = p.get(i) || S.current.find((te) => te.value === i)?.option;
162
- return !k || k._origin === Me;
160
+ const r = m(n) ? n : [n], o = r.filter((i, l, C) => {
161
+ const x = p.get(i) || P.current.find((te) => te.value === i)?.option;
162
+ return !x || x._origin === Ae;
163
163
  }).map((i) => $(i));
164
- e = F.filter((i) => {
165
- const l = C(i) ? i.value : i;
166
- return o.indexOf(l) !== -1;
164
+ e = L.filter((i) => {
165
+ const l = O(i) ? i.value : i;
166
+ return r.indexOf(l) !== -1;
167
167
  }).concat(
168
- r
168
+ o
169
169
  );
170
170
  }
171
- const t = (o) => o.map((r) => C(r) ? r.value : r).toString();
172
- t(e) !== t(F) && it(e);
171
+ const t = (r) => r.map((o) => O(o) ? o.value : o).toString();
172
+ t(e) !== t(L) && it(e);
173
173
  }
174
- }, [n, c, u, $]), b(() => {
175
- c && ot(
174
+ }, [n, c, u, $]), V(() => {
175
+ c && rt(
176
176
  d && !p.has(d) ? $(d, !0) : null
177
177
  );
178
- }, [d, $]), b(() => {
178
+ }, [d, $]), V(() => {
179
179
  const { current: e } = X;
180
180
  nt === d && (e === "manual" || e === "optionListHide") && Be?.(d, e);
181
181
  }, [d]);
182
- const L = ne(
182
+ const N = ne(
183
183
  (e) => {
184
184
  const t = p.get(e);
185
185
  if (t) {
186
- const r = S.current.findIndex(
186
+ const o = P.current.findIndex(
187
187
  (s) => s.value === e
188
188
  );
189
- return r > -1 ? S.current.splice(r, 1, { value: e, option: t }) : S.current.push({ value: e, option: t }), t;
189
+ return o > -1 ? P.current.splice(o, 1, { value: e, option: t }) : P.current.push({ value: e, option: t }), t;
190
190
  }
191
- const o = S.current.find((r) => r.value === e);
192
- return o && o.option;
191
+ const r = P.current.find((o) => o.value === e);
192
+ return r && r.option;
193
193
  },
194
194
  [p]
195
195
  ), we = (e) => {
196
- if (!x.length)
196
+ if (!S.length)
197
197
  return;
198
- if (g === void 0 || !p.has(g))
199
- return V[x[0]];
200
- const o = p.get(g)._index, r = x.indexOf(o), s = x.length;
201
- return V[x[((e === "up" ? r - 1 : r + 1) + s) % s]];
202
- }, G = (e, t = oe(e, u)) => {
203
- let o = e;
204
- const r = e === void 0 ? void 0 : Array.isArray(e) ? e.map(L) : L(e);
198
+ if (h === void 0 || !p.has(h))
199
+ return w[S[0]];
200
+ const r = p.get(h)._index, o = S.indexOf(r), s = S.length;
201
+ return w[S[((e === "up" ? o - 1 : o + 1) + s) % s]];
202
+ }, G = (e, t = re(e, u)) => {
203
+ let r = e;
204
+ const o = e === void 0 ? void 0 : m(e) ? e.map(N) : N(e);
205
205
  if (U && !t) {
206
206
  const s = (i, l) => {
207
207
  if (l)
208
208
  return l.children;
209
- const h = "value" in a ? a.value : "defaultValue" in a ? a.defaultValue : null;
210
- if (Array.isArray(h)) {
211
- for (const k of h)
212
- if (C(k) && k.value === i)
213
- return k.label;
214
- } else if (C(h) && h.value === i)
215
- return h.label;
209
+ const C = "value" in a ? a.value : "defaultValue" in a ? a.defaultValue : null;
210
+ if (m(C)) {
211
+ for (const x of C)
212
+ if (O(x) && x.value === i)
213
+ return x.label;
214
+ } else if (O(C) && C.value === i)
215
+ return C.label;
216
216
  };
217
- Array.isArray(e) ? o = e.map((i, l) => ({
217
+ m(e) ? r = e.map((i, l) => ({
218
218
  value: i,
219
- label: s(i, r[l])
220
- })) : o = {
219
+ label: s(i, o[l])
220
+ })) : r = {
221
221
  value: e,
222
- label: s(e, r)
222
+ label: s(e, o)
223
223
  };
224
224
  }
225
- return { option: r, value: o };
226
- }, P = (e) => {
225
+ return { option: o, value: r };
226
+ }, _ = (e) => {
227
227
  if (z(e), Ce) {
228
228
  const t = G(e);
229
229
  Ce(t.value, t.option);
230
230
  }
231
231
  }, ke = (e, t) => {
232
232
  if (t === "remove" || t === "add" && p.get(e)) {
233
- const o = t === "add" ? n.concat(e) : n.filter((s, i, l) => s !== e), r = t === "add" ? Ke : je;
234
- if (P(o), typeof r == "function") {
233
+ const r = t === "add" ? n.concat(e) : n.filter((s, i, l) => s !== e), o = t === "add" ? Ke : je;
234
+ if (_(r), typeof o == "function") {
235
235
  const s = G(
236
236
  e,
237
237
  !1
238
238
  );
239
- r(
239
+ o(
240
240
  s.value,
241
241
  s.option
242
242
  );
@@ -246,207 +246,207 @@ function Dt(Fe, Le) {
246
246
  t || (u ? (ke(
247
247
  e,
248
248
  n.indexOf(e) === -1 ? "add" : "remove"
249
- ), (!C(pe) || !pe.retainInputValueWhileSelect) && A("", "optionChecked")) : (e !== n && P(e), setTimeout(() => {
250
- E(!1);
249
+ ), (!O(pe) || !pe.retainInputValueWhileSelect) && I("", "optionChecked")) : (e !== n && _(e), setTimeout(() => {
250
+ A(!1);
251
251
  })));
252
- }, K = yt(
252
+ }, K = Vt(
253
253
  /* @__PURE__ */ new Map([
254
- [Vt.key, () => E(!1)],
254
+ [yt.key, () => A(!1)],
255
255
  [
256
- Ie.key,
256
+ _e.key,
257
257
  () => {
258
- if (m) {
259
- const e = p.get(g);
260
- e && xe(g, e.disabled);
258
+ if (g) {
259
+ const e = p.get(h);
260
+ e && xe(h, e.disabled);
261
261
  } else
262
- E(!0);
262
+ A(!0);
263
263
  }
264
264
  ],
265
265
  [
266
- _e.key,
266
+ Ee.key,
267
267
  // 按tab键切换,关闭开启的弹出框
268
- () => E(!1)
268
+ () => A(!1)
269
269
  ],
270
270
  [
271
271
  wt.key,
272
272
  () => {
273
- if (m)
274
- return w.current = "up", _(we("up")), !1;
273
+ if (g)
274
+ return k.current = "up", M(we("up")), !1;
275
275
  }
276
276
  ],
277
277
  [
278
278
  kt.key,
279
279
  () => {
280
- if (m)
281
- return w.current = "down", _(we("down")), !1;
280
+ if (g)
281
+ return k.current = "down", M(we("down")), !1;
282
282
  }
283
283
  ]
284
284
  ])
285
285
  ), at = () => {
286
- const e = y?.autoAlignPopupWidth === !1 && (!y?.style?.width || y?.style?.width === "auto"), t = e && st, o = "notFoundContent" in a ? He : Te("Select"), r = J.length ? /* @__PURE__ */ I(
287
- Pt,
286
+ const e = y?.autoAlignPopupWidth === !1 && (!y?.style?.width || y?.style?.width === "auto"), t = e && st, r = "notFoundContent" in a ? He : Te("Select"), o = J.length ? /* @__PURE__ */ E(
287
+ It,
288
288
  {
289
- id: ye,
289
+ id: Ve,
290
290
  role: "listbox",
291
291
  style: me,
292
- className: re(`${f}-popup-inner`, ge),
292
+ className: oe(`${f}-popup-inner`, ge),
293
293
  ref: Q,
294
294
  data: J,
295
295
  height: null,
296
296
  isStaticItemHeight: !lt,
297
297
  measureLongestItem: e,
298
298
  itemKey: (l) => l.props._key,
299
- onMouseDown: Mt,
299
+ onMouseDown: At,
300
300
  onMouseMove: () => {
301
- w.current = null;
301
+ k.current = null;
302
302
  },
303
303
  onScroll: (l) => Je?.(l.target),
304
304
  ...he,
305
305
  threshold: t ? null : he?.threshold,
306
306
  children: (l) => {
307
307
  if (Ft(l))
308
- return /* @__PURE__ */ I(l.type, { ...l.props, prefixCls: f });
308
+ return /* @__PURE__ */ E(l.type, { ...l.props, prefixCls: f });
309
309
  if (Lt(l)) {
310
- const h = l.props?.value, k = C(M) ? M.value : M, te = F.map(
311
- (N) => C(N) ? N.value : N
310
+ const C = l.props?.value, x = O(F) ? F.value : F, te = L.map(
311
+ (T) => O(T) ? T.value : T
312
312
  ), pt = {
313
313
  prefixCls: f,
314
314
  rtl: le,
315
- _valueActive: g,
315
+ _valueActive: h,
316
316
  _valueSelect: n,
317
317
  _isMultipleMode: u,
318
- _isUserCreatingOption: c && k === h,
319
- _isUserCreatedOption: c && te.indexOf(h) > -1,
318
+ _isUserCreatingOption: c && x === C,
319
+ _isUserCreatedOption: c && te.indexOf(C) > -1,
320
320
  _onClick: xe,
321
- _onMouseEnter: (N) => {
322
- w.current === null && _(N);
321
+ _onMouseEnter: (T) => {
322
+ k.current === null && M(T);
323
323
  },
324
324
  _onMouseLeave: () => {
325
- w.current === null && _(void 0);
325
+ k.current === null && M(void 0);
326
326
  }
327
327
  };
328
- return l && /* @__PURE__ */ I(l.type, { ...l.props, ...pt });
328
+ return l && /* @__PURE__ */ E(l.type, { ...l.props, ...pt });
329
329
  }
330
330
  return l;
331
331
  }
332
332
  }
333
- ) : null, i = o && !(c && d) ? /* @__PURE__ */ I(
333
+ ) : null, i = r && !(c && d) ? /* @__PURE__ */ E(
334
334
  "div",
335
335
  {
336
336
  style: me,
337
- className: re(`${f}-popup-inner`, ge),
338
- children: o
337
+ className: oe(`${f}-popup-inner`, ge),
338
+ children: r
339
339
  }
340
340
  ) : null;
341
341
  return /* @__PURE__ */ ct(
342
342
  "div",
343
343
  {
344
- className: re(`${f}-popup`, {
345
- [`${f}-popup-hidden`]: r === null && i === null,
344
+ className: oe(`${f}-popup`, {
345
+ [`${f}-popup-hidden`]: o === null && i === null,
346
346
  [`${f}-popup-multiple`]: u
347
347
  }),
348
348
  tabIndex: -1,
349
349
  onKeyDown: (l) => K(l),
350
350
  children: [
351
- !!u && !!r && !!Oe && // 潘启宝添加
352
- /* @__PURE__ */ I(
351
+ !!u && !!o && !!Oe && // 潘启宝添加
352
+ /* @__PURE__ */ E(
353
353
  ht,
354
354
  {
355
355
  "aria-hidden": "true",
356
356
  className: `${f}-checkbox ${f}-checkbox-all`,
357
- checked: V.length === n.length,
358
- indeterminate: V.length !== n.length && n.length !== 0,
357
+ checked: w.length === n.length,
358
+ indeterminate: w.length !== n.length && n.length !== 0,
359
359
  onChange: (l) => {
360
- P(l ? [...V] : []);
360
+ _(l ? [...w] : []);
361
361
  },
362
362
  children: "全选"
363
363
  }
364
364
  ),
365
- typeof de == "function" ? de(r || i) : r || i
365
+ typeof de == "function" ? de(o || i) : o || i
366
366
  ]
367
367
  }
368
368
  );
369
369
  }, Z = (e) => {
370
- if (D.current = null, u && T(W) && W.length) {
370
+ if (D.current = null, u && m(W) && W.length) {
371
371
  const t = e.split(new RegExp(`[${W.join("")}]`));
372
372
  if (t.length > 1) {
373
373
  D.current = Date.now();
374
- const o = t.filter(
374
+ const r = t.filter(
375
375
  (i, l) => i && t.indexOf(i) === l
376
- ), r = n.slice(0);
376
+ ), o = n.slice(0);
377
377
  let s = !1;
378
- o.forEach((i, l, h) => {
379
- r.indexOf(i) === -1 && (c || p.get(i)) && (r.push(i), s = !0);
380
- }), s && P(r);
378
+ r.forEach((i, l, C) => {
379
+ o.indexOf(i) === -1 && (c || p.get(i)) && (o.push(i), s = !0);
380
+ }), s && _(o);
381
381
  }
382
382
  }
383
383
  return !!D.current;
384
384
  }, ut = {
385
385
  onFocus: qe,
386
386
  onBlur: (e) => {
387
- ze?.(e), !m && !Y.current && A("", "optionListHide");
387
+ ze?.(e), !g && !Y.current && I("", "optionListHide");
388
388
  },
389
389
  onKeyDown: (e) => {
390
390
  if (e.target.tagName === "INPUT" && e.target.value) {
391
- const t = e.key === _e.key, o = e.key === Ie.key;
392
- if (o || t) {
393
- const r = o ? `
391
+ const t = e.key === Ee.key, r = e.key === _e.key;
392
+ if (r || t) {
393
+ const o = r ? `
394
394
  ` : t ? " " : "";
395
- Z(e.target.value + r) && A("", "tokenSeparator");
395
+ Z(e.target.value + o) && I("", "tokenSeparator");
396
396
  }
397
397
  }
398
398
  K(e), Ze?.(e);
399
399
  },
400
400
  onChangeInputValue: (e, { nativeEvent: { inputType: t } }) => {
401
- t !== "insertFromPaste" && Z(e), D.current ? A("", "tokenSeparator") : A(e, "manual"), !m && e && E(!0);
401
+ t !== "insertFromPaste" && Z(e), D.current ? I("", "tokenSeparator") : I(e, "manual"), !g && e && A(!0);
402
402
  },
403
403
  onPaste: (e) => {
404
404
  Z(e.clipboardData.getData("text")), Ye?.(e);
405
405
  },
406
406
  // Option Items
407
- onRemoveCheckedItem: (e, t, o) => {
408
- o.stopPropagation(), ke(n[t], "remove");
407
+ onRemoveCheckedItem: (e, t, r) => {
408
+ r.stopPropagation(), ke(n[t], "remove");
409
409
  },
410
410
  onClear: (e) => {
411
411
  if (e.stopPropagation(), u) {
412
- const t = n.filter((o, r, s) => {
413
- const i = p.get(o);
412
+ const t = n.filter((r, o, s) => {
413
+ const i = p.get(r);
414
414
  return i && i.disabled;
415
415
  });
416
- P(t);
416
+ _(t);
417
417
  } else
418
- P(void 0);
419
- A("", "manual"), We?.(m);
418
+ _(void 0);
419
+ I("", "manual"), We?.(g);
420
420
  }
421
421
  };
422
422
  gt(
423
423
  Le,
424
424
  () => ({
425
- dom: O.current?.dom,
425
+ dom: v.current?.dom,
426
426
  focus() {
427
- O.current && O.current.focus();
427
+ v.current && v.current.focus();
428
428
  },
429
429
  blur() {
430
- O.current && O.current.blur();
430
+ v.current && v.current.blur();
431
431
  },
432
432
  hotkeyHandler: K,
433
- activeOptionValue: g,
434
- getOptionInfoByValue: L,
433
+ activeOptionValue: h,
434
+ getOptionInfoByValue: N,
435
435
  getOptionInfoList: () => [...p.values()].filter((e) => e._valid),
436
436
  scrollIntoView: H,
437
437
  getRootDOMNode() {
438
- return O.current?.getRootDOMNode?.();
438
+ return v.current?.getRootDOMNode?.();
439
439
  }
440
440
  }),
441
441
  [
442
442
  K,
443
443
  p,
444
- g,
445
- L,
444
+ h,
445
+ N,
446
446
  H
447
447
  ]
448
448
  );
449
- const Se = (e) => /* @__PURE__ */ I(
449
+ const Se = (e) => /* @__PURE__ */ E(
450
450
  bt,
451
451
  {
452
452
  ref: ve,
@@ -457,66 +457,66 @@ function Dt(Fe, Le) {
457
457
  classNames: "slideDynamicOrigin",
458
458
  autoAlignPopupWidth: !0,
459
459
  popupAlign: Ut,
460
- popupVisible: m,
460
+ popupVisible: g,
461
461
  unmountOnExit: Re,
462
- onVisibleChange: E,
462
+ onVisibleChange: A,
463
463
  __onExit: () => {
464
464
  Y.current = !0;
465
465
  },
466
466
  __onExited: () => {
467
- Y.current = !1, A("", "optionListHide");
467
+ Y.current = !1, I("", "optionListHide");
468
468
  },
469
469
  ...xt(y, ["popupVisible", "onVisibleChange"]),
470
470
  children: e
471
471
  }
472
472
  ), ee = typeof B == "function" ? B(G(n)) : B;
473
- return b(() => {
474
- const e = St([O.current?.dom], () => {
473
+ return V(() => {
474
+ const e = St([v.current?.dom], () => {
475
475
  ve.current?.updatePopupPosition?.();
476
476
  });
477
477
  return () => {
478
478
  e();
479
479
  };
480
- }, [O.current?.dom]), ee != null ? Se(ee) : /* @__PURE__ */ I(
480
+ }, [v.current?.dom]), ee != null ? Se(ee) : /* @__PURE__ */ E(
481
481
  vt,
482
482
  {
483
483
  ...a,
484
484
  ...ut,
485
- ref: O,
485
+ ref: v,
486
486
  value: n,
487
487
  inputValue: d,
488
- popupVisible: m,
488
+ popupVisible: g,
489
489
  rtl: le,
490
490
  prefixCls: f,
491
491
  allowCreate: !!c,
492
- ariaControls: ye,
492
+ ariaControls: Ve,
493
493
  isEmptyValue: R,
494
494
  isMultiple: u,
495
- onSort: P,
495
+ onSort: _,
496
496
  renderText: (e) => {
497
- const t = L(e);
498
- let o = e;
497
+ const t = N(e);
498
+ let r = e;
499
499
  if (ft(ae)) {
500
- const r = G(e, !1);
501
- o = ae(
502
- r.option || null,
503
- r.value
500
+ const o = G(e, !1);
501
+ r = ae(
502
+ o.option || null,
503
+ o.value
504
504
  );
505
505
  } else {
506
- let r = !1;
506
+ let o = !1;
507
507
  if (U) {
508
508
  const s = a.value || a.defaultValue;
509
- if (Array.isArray(s)) {
509
+ if (m(s)) {
510
510
  const i = s.find(
511
- (l) => C(l) && l.value === e
511
+ (l) => O(l) && l.value === e
512
512
  );
513
- i && (o = i.label, r = !0);
514
- } else C(s) && (o = s.label, r = !0);
513
+ i && (r = i.label, o = !0);
514
+ } else O(s) && (r = s.label, o = !0);
515
515
  }
516
- !r && t && "children" in t && (o = t.children);
516
+ !o && t && "children" in t && (r = t.children);
517
517
  }
518
518
  return {
519
- text: o,
519
+ text: r,
520
520
  disabled: t && t.disabled
521
521
  };
522
522
  },
@@ -526,10 +526,10 @@ function Dt(Fe, Le) {
526
526
  }
527
527
  const Rt = dt.forwardRef(Dt), ie = Rt;
528
528
  ie.displayName = "Select";
529
- ie.Option = _t;
530
- ie.OptGroup = It;
529
+ ie.Option = Et;
530
+ ie.OptGroup = _t;
531
531
  export {
532
- _t as SelectOption,
533
- It as SelectOptionGroup,
532
+ Et as SelectOption,
533
+ _t as SelectOptionGroup,
534
534
  ie as default
535
535
  };