@unicom-cloud/ui 0.8.106 → 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 (197) hide show
  1. package/App.js +7 -0
  2. package/BackTop.js +2 -4
  3. package/Calendar.js +2 -2
  4. package/ColorPicker.js +15 -14
  5. package/Constant.js +4 -0
  6. package/Copy.js +4 -3
  7. package/Countdown.js +25 -0
  8. package/Grid.js +8 -10
  9. package/LiquidFill.js +4 -3
  10. package/List.js +7 -6
  11. package/Marquee.js +4 -3
  12. package/Modal.js +4 -2
  13. package/PageHeader.js +3 -2
  14. package/QrCode.js +4 -3
  15. package/RowCol.js +8 -0
  16. package/Segmented.js +14 -4
  17. package/Statistic.js +5 -4
  18. package/Tour.js +4 -3
  19. package/Transfer.js +4 -2
  20. package/anchor/Link.js +1 -1
  21. package/app/App.js +26 -0
  22. package/app/context.js +9 -0
  23. package/app/index.js +9 -0
  24. package/app/interface.js +1 -0
  25. package/app/useApp.js +8 -0
  26. package/avatar/Group.js +1 -1
  27. package/back-top/index.js +44 -56
  28. package/button/index.js +52 -51
  29. package/calendar/Lunar.js +71 -0
  30. package/calendar/index.js +11 -11
  31. package/cascader/base/node.js +22 -20
  32. package/cascader/base/store.js +10 -10
  33. package/cascader/util.js +29 -27
  34. package/color-picker/Mode.js +8 -7
  35. package/color-picker/hooks/useColorPicker.js +56 -55
  36. package/color-picker/index.js +49 -48
  37. package/color-picker/utils.js +58 -57
  38. package/components/common/empty/index.js +2 -2
  39. package/components/common/flex/index.js +64 -55
  40. package/components/common/flex/interface.js +6 -6
  41. package/components/common/hooks/useInterval.js +6 -6
  42. package/components/common/icons/file/index.js +13 -11
  43. package/components/common/space/index.js +53 -53
  44. package/components/common/utils/dayjs.js +114 -126
  45. package/components/common/utils/is.js +98 -104
  46. package/components/common/utils/setDir.js +12 -0
  47. package/components/common/utils/setTheme.js +13 -13
  48. package/components/common/utils/toArray.js +7 -5
  49. package/config-provider/ConfigProvider.js +32 -30
  50. package/constant/index.js +4 -0
  51. package/copy/index.js +2 -1
  52. package/countdown/index.js +113 -0
  53. package/countdown/interface.js +1 -0
  54. package/countdown/util.js +29 -0
  55. package/descriptions/index.js +45 -45
  56. package/divider/index.js +28 -20
  57. package/dropdown/Button.js +1 -1
  58. package/empty/index.js +1 -1
  59. package/flex/index.js +30 -29
  60. package/form/FormItem.js +126 -122
  61. package/grid/Grid.js +56 -90
  62. package/grid/Item.js +44 -65
  63. package/grid/context.js +2 -6
  64. package/grid/index.js +6 -8
  65. package/grid/util.js +6 -44
  66. package/hooks/useResponsiveState.js +54 -0
  67. package/index.js +614 -605
  68. package/input/Button.js +12 -12
  69. package/input/Group.js +11 -12
  70. package/input/Input.js +112 -102
  71. package/input/InputElement.js +25 -24
  72. package/input/Search.js +24 -24
  73. package/layout/Sider.js +1 -1
  74. package/liquid-fill/index.js +4 -3
  75. package/list/Item.js +21 -21
  76. package/list/index.js +53 -52
  77. package/marquee/index.js +20 -19
  78. package/marquee-/index.js +4 -3
  79. package/mentions/util.js +9 -8
  80. package/modal/Confirm.js +17 -17
  81. package/modal/Modal.js +247 -237
  82. package/modal/index.js +4 -2
  83. package/modal/use-modal/index.js +2 -2
  84. package/package.json +1 -1
  85. package/page-header/index.js +57 -56
  86. package/pagination/Pagination.js +89 -92
  87. package/qr-code/index.js +4 -3
  88. package/radio/Group.js +1 -1
  89. package/row-col/Col-.js +88 -0
  90. package/row-col/Col.js +159 -0
  91. package/row-col/Row.js +73 -0
  92. package/row-col/context.js +5 -0
  93. package/row-col/index.js +11 -0
  94. package/row-col/interface.js +1 -0
  95. package/segmented/index.js +257 -206
  96. package/select/Select.js +191 -191
  97. package/select/util.js +50 -50
  98. package/select-view/Core.js +31 -28
  99. package/space/index.js +15 -13
  100. package/splitter/SplitBar.js +44 -46
  101. package/statistic/index.js +56 -55
  102. package/statistic/interface.js +4 -1
  103. package/style.css +1 -1
  104. package/table/Table.js +198 -210
  105. package/table/hook/useColumns.js +27 -26
  106. package/table/hook/useStickyClassNames.js +9 -8
  107. package/table/hook/useThResizable.js +4 -3
  108. package/table/th-resizable/index.js +2 -2
  109. package/table/thead/index.js +18 -16
  110. package/time-picker/util.js +20 -30
  111. package/timeline/Item.js +1 -1
  112. package/tour/index.js +4 -3
  113. package/transfer/index.js +93 -91
  114. package/trigger/index.js +66 -66
  115. package/types/common/development/interface.d.ts +3 -3
  116. package/types/common/flex/index.d.ts +3 -9
  117. package/types/common/flex/interface.d.ts +15 -4
  118. package/types/common/space/index.d.ts +3 -5
  119. package/types/common/space/interface.d.ts +2 -0
  120. package/types/common/utils/dayjs.d.ts +3 -1
  121. package/types/common/utils/is.d.ts +3 -4
  122. package/types/common/utils/setDir.d.ts +2 -0
  123. package/types/pc/app/App.d.ts +6 -0
  124. package/types/pc/app/context.d.ts +4 -0
  125. package/types/pc/app/index.d.ts +5 -0
  126. package/types/pc/app/interface.d.ts +17 -0
  127. package/types/pc/app/useApp.d.ts +3 -0
  128. package/types/pc/back-top/interface.d.ts +4 -17
  129. package/types/pc/button/interface.d.ts +2 -2
  130. package/types/pc/calendar/Lunar.d.ts +17 -0
  131. package/types/pc/calendar/index.d.ts +1 -1
  132. package/types/pc/config-provider/interface.d.ts +17 -12
  133. package/types/pc/constant/index.d.ts +1 -0
  134. package/types/pc/countdown/interface.d.ts +65 -0
  135. package/types/pc/countdown/util.d.ts +7 -0
  136. package/types/pc/divider/interface.d.ts +1 -0
  137. package/types/pc/flex/index.d.ts +8 -6
  138. package/types/pc/flex/interface.d.ts +3 -10
  139. package/types/pc/form/FormItem.d.ts +1 -1
  140. package/types/pc/form/interface.d.ts +1 -1
  141. package/types/pc/grid/Grid.d.ts +2 -4
  142. package/types/pc/grid/Item.d.ts +1 -5
  143. package/types/pc/grid/context.d.ts +4 -15
  144. package/types/pc/grid/index.d.ts +4 -6
  145. package/types/pc/grid/interface.d.ts +14 -142
  146. package/types/pc/grid/util.d.ts +1 -10
  147. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  148. package/types/pc/index.d.ts +10 -4
  149. package/types/pc/input/Button.d.ts +2 -2
  150. package/types/pc/list/interface.d.ts +2 -1
  151. package/types/pc/message/index.d.ts +1 -9
  152. package/types/pc/message/interface.d.ts +8 -0
  153. package/types/pc/message/useMessage.d.ts +1 -2
  154. package/types/pc/modal/Modal.d.ts +1 -0
  155. package/types/pc/modal/config.d.ts +1 -2
  156. package/types/pc/modal/index.d.ts +2 -1
  157. package/types/pc/modal/interface.d.ts +17 -5
  158. package/types/pc/notification/index.d.ts +2 -9
  159. package/types/pc/notification/interface.d.ts +7 -0
  160. package/types/pc/notification/useNotification.d.ts +1 -2
  161. package/types/pc/pagination/PageOption.d.ts +0 -1
  162. package/types/pc/pagination/interface.d.ts +5 -6
  163. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  164. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  165. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  166. package/types/pc/row-col/context.d.ts +6 -0
  167. package/types/pc/row-col/index.d.ts +7 -0
  168. package/types/pc/row-col/interface.d.ts +112 -0
  169. package/types/pc/segmented/index.d.ts +3 -7
  170. package/types/pc/segmented/interface.d.ts +38 -5
  171. package/types/pc/select-view/Core.d.ts +1 -8
  172. package/types/pc/select-view/index.d.ts +1 -8
  173. package/types/pc/select-view/interface.d.ts +9 -2
  174. package/types/pc/space/index.d.ts +5 -7
  175. package/types/pc/space/interface.d.ts +3 -10
  176. package/types/pc/statistic/index.d.ts +1 -1
  177. package/types/pc/statistic/interface.d.ts +1 -49
  178. package/types/pc/utils/is.d.ts +1 -1
  179. package/types/pc/utils/names.d.ts +422 -111
  180. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  181. package/typography/Ellipsis.js +5 -4
  182. package/typography/Operations.js +4 -3
  183. package/utils/dayjs.js +13 -11
  184. package/utils/index.js +245 -244
  185. package/utils/is.js +65 -66
  186. package/utils/names.js +309 -150
  187. package/utils/responsiveObserve.js +43 -36
  188. package/version/index.js +1 -1
  189. package/grid/Col-.js +0 -86
  190. package/grid/Col.js +0 -169
  191. package/grid/Row.js +0 -96
  192. package/grid/hook/useResponsiveState.js +0 -38
  193. package/statistic/Countdown.js +0 -56
  194. package/statistic/util.js +0 -33
  195. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  196. package/types/pc/statistic/util.d.ts +0 -1
  197. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
package/select/util.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { jsx as K } from "react/jsx-runtime";
2
2
  import { isEmptyArray as B } from "@unicom-cloud/utils/is";
3
- import a from "lodash/get";
4
- import $ from "lodash/isArray";
3
+ import _ from "lodash/get";
4
+ import O from "lodash/isArray";
5
5
  import F from "lodash/isNil";
6
6
  import I from "lodash/isNumber";
7
- import h from "lodash/isPlainObject";
7
+ import L from "lodash/isPlainObject";
8
8
  import N from "lodash/isString";
9
- import g from "react";
9
+ import u from "react";
10
10
  import { fillNBSP as U } from "../components/common/utils/fillNBSP.js";
11
11
  import { getHighlightText as j } from "../components/common/utils/getHighlightText.js";
12
12
  import z from "./Option.js";
@@ -14,18 +14,18 @@ function ne(r) {
14
14
  r?.preventDefault?.();
15
15
  }
16
16
  function D(r, p) {
17
- return p ? !$(r) || B(r) : F(r);
17
+ return p ? !O(r) || B(r) : F(r);
18
18
  }
19
19
  function se(r, p, l) {
20
- return l && (p ? r = Array.isArray(r) ? r.map(
21
- (o) => h(o) && "label" in o ? o.value : o
22
- ) : r : r = h(r) && "label" in r ? r.value : r), D(r, p) ? p ? Array.isArray(r) ? r : [] : void 0 : r;
20
+ return l && (p ? r = O(r) ? r.map(
21
+ (o) => L(o) && "label" in o ? o.value : o
22
+ ) : r : r = L(r) && "label" in r ? r.value : r), D(r, p) ? p ? O(r) ? r : [] : void 0 : r;
23
23
  }
24
24
  function Q(r) {
25
- return a(r, "props.isSelectOption") || a(r, "type.__PQB_SELECT_OPTION__");
25
+ return _(r, "props.isSelectOption") || _(r, "type.__PQB_SELECT_OPTION__");
26
26
  }
27
27
  function R(r) {
28
- return a(r, "props.isSelectOptGroup") || a(r, "type.__PQB_SELECT_OPTGROUP__");
28
+ return _(r, "props.isSelectOptGroup") || _(r, "type.__PQB_SELECT_OPTGROUP__");
29
29
  }
30
30
  function v({
31
31
  children: r,
@@ -33,46 +33,46 @@ function v({
33
33
  filterOption: l
34
34
  }, {
35
35
  inputValue: o = "",
36
- userCreatedOptions: k,
37
- userCreatingOption: L,
38
- prefixCls: E
36
+ userCreatedOptions: T,
37
+ userCreatingOption: E,
38
+ prefixCls: b
39
39
  }, {
40
40
  optionInfoMap: m = /* @__PURE__ */ new Map(),
41
- optionValueList: u = [],
42
- customNodeCount: O = 0
41
+ optionValueList: y = [],
42
+ customNodeCount: x = 0
43
43
  } = {}) {
44
- let b = !1, c = !1, i = [], y = [];
45
- const T = (e) => {
46
- const s = a(e, "props.value"), t = a(e, "props.children");
44
+ let S = !1, c = !1, i = [], d = [];
45
+ const A = (e) => {
46
+ const s = _(e, "props.value"), t = _(e, "props.children");
47
47
  return s === void 0 && t !== null && t !== void 0 ? t.toString() : s;
48
- }, d = ({ label: e, value: s }, t, n) => !e && !s && !t ? (O++, `custom_node_${O}`) : n ? t || `group_${e}` : t || `${typeof s}_${s}` || `${e}_${m.size}`, S = (e, s, t) => {
49
- const n = T(e);
48
+ }, g = ({ label: e, value: s }, t, n) => !e && !s && !t ? (x++, `custom_node_${x}`) : n ? t || `group_${e}` : t || `${typeof s}_${s}` || `${e}_${m.size}`, w = (e, s, t) => {
49
+ const n = A(e);
50
50
  let f = !0;
51
51
  l === !0 ? f = n !== void 0 && String(n).toLowerCase().indexOf(o.toLowerCase()) !== -1 : typeof l == "function" && (f = !o || l(o, e, t));
52
- const _ = m.get(n), A = _?._origin === "userCreatedOptions" || _?._origin === "userCreatingOption";
53
- if (!_ || A) {
54
- "_key" in e.props || (e = g.cloneElement(e, {
55
- _key: d(e.props, e.key)
52
+ const a = m.get(n), P = a?._origin === "userCreatedOptions" || a?._origin === "userCreatingOption";
53
+ if (!a || P) {
54
+ "_key" in e.props || (e = u.cloneElement(e, {
55
+ _key: g(e.props, e.key)
56
56
  }));
57
- const w = m.size, P = {
57
+ const $ = m.size, k = {
58
58
  child: e,
59
59
  ...e.props,
60
60
  value: n,
61
- _index: w,
61
+ _index: $,
62
62
  _origin: s,
63
63
  _valid: f
64
64
  };
65
- if (m.set(n, P), A) {
66
- const C = i.findIndex(
65
+ if (m.set(n, k), P) {
66
+ const h = i.findIndex(
67
67
  (G) => G?.props?.value === n
68
68
  );
69
- C > -1 && (f ? i[C] = e : i.splice(C, 1));
69
+ h > -1 && (f ? i[h] = e : i.splice(h, 1));
70
70
  } else
71
- u.push(n), f && (i.push(e), P.disabled || y.push(w));
71
+ y.push(n), f && (i.push(e), k.disabled || d.push($));
72
72
  }
73
73
  typeof e.props.children != "string" && (c = !0);
74
- }, x = (e, s) => {
75
- s && $(e) && e.length && e.forEach((t) => {
74
+ }, C = (e, s) => {
75
+ s && O(e) && e.length && e.forEach((t) => {
76
76
  (N(t) || I(t)) && (t = {
77
77
  label: t,
78
78
  value: t
@@ -80,50 +80,50 @@ function v({
80
80
  const n = /* @__PURE__ */ K(
81
81
  z,
82
82
  {
83
- _key: d(t),
83
+ _key: g(t),
84
84
  value: t.value,
85
85
  disabled: t.disabled === !0,
86
86
  extra: t.extra,
87
87
  children: U(t.label)
88
88
  }
89
89
  );
90
- S(n, s, t);
90
+ w(n, s, t);
91
91
  });
92
92
  };
93
- return L && x([L], "userCreatingOption"), r && g.Children.map(r, (e) => {
93
+ return E && C([E], "userCreatingOption"), r && u.Children.map(r, (e) => {
94
94
  if (R(e)) {
95
95
  const { children: s, options: t } = e.props, {
96
96
  childrenList: n,
97
97
  optionIndexListForArrowKey: f,
98
- hasComplexLabelInOptions: _
98
+ hasComplexLabelInOptions: a
99
99
  } = v(
100
100
  { children: s, options: t, filterOption: l },
101
- { inputValue: o, prefixCls: E },
102
- { optionInfoMap: m, optionValueList: u, customNodeCount: O }
101
+ { inputValue: o, prefixCls: b },
102
+ { optionInfoMap: m, optionValueList: y, customNodeCount: x }
103
103
  );
104
104
  n.length && (i.push(
105
- g.cloneElement(e, {
105
+ u.cloneElement(e, {
106
106
  children: null,
107
- _key: d(e.props, e.key, !0)
107
+ _key: g(e.props, e.key, !0)
108
108
  })
109
- ), i = i.concat(n), y = y.concat(
109
+ ), i = i.concat(n), d = d.concat(
110
110
  f
111
- ), b = !0, c = c || _);
112
- } else Q(e) ? S(e, "children", null) : h(e) && e.props && i.push(
113
- g.cloneElement(e, {
114
- _key: d(e.props, e.key)
111
+ ), S = !0, c = c || a);
112
+ } else Q(e) ? w(e, "children", null) : L(e) && e.props && i.push(
113
+ u.cloneElement(e, {
114
+ _key: g(e.props, e.key)
115
115
  })
116
116
  );
117
- }), x(p, "options"), x(k, "userCreatedOptions"), {
117
+ }), C(p, "options"), C(T, "userCreatedOptions"), {
118
118
  childrenList: j({
119
119
  nodeList: i,
120
120
  pattern: o,
121
- highlightClassName: `${E}-highlight`
121
+ highlightClassName: `${b}-highlight`
122
122
  }),
123
123
  optionInfoMap: m,
124
- optionValueList: u,
125
- optionIndexListForArrowKey: y,
126
- hasOptGroup: b,
124
+ optionValueList: y,
125
+ optionIndexListForArrowKey: d,
126
+ hasOptGroup: S,
127
127
  hasComplexLabelInOptions: c
128
128
  };
129
129
  }
@@ -36,7 +36,7 @@ const K = "__pqb_value_tag_placeholder", w = {
36
36
  allowCreate: Ce,
37
37
  status: xe,
38
38
  loading: Ie,
39
- disabled: g,
39
+ disabled: b,
40
40
  animation: we,
41
41
  prefixCls: n,
42
42
  suffixIcon: G,
@@ -45,7 +45,7 @@ const K = "__pqb_value_tag_placeholder", w = {
45
45
  clearIcon: D,
46
46
  placeholder: q,
47
47
  renderText: X,
48
- value: b,
48
+ value: v,
49
49
  inputValue: F,
50
50
  popupVisible: p,
51
51
  maxTagCount: c,
@@ -66,7 +66,7 @@ const K = "__pqb_value_tag_placeholder", w = {
66
66
  onRemoveCheckedItem: Re,
67
67
  onSort: A,
68
68
  ...Oe
69
- } = x, N = ae(null), f = ae(null), { size: Me, getPrefixCls: Q } = qe(fo), [Ae, Y] = ce(w.NONE), [B, Z] = ce(!1), Be = to(), T = "showSearch" in x ? x.showSearch : I, m = T || Ce, y = ge || Me, V = B || p, Ve = C(T) && T.retainInputValue, v = !I && b !== void 0 ? X(b).text : "", _ = (e) => {
69
+ } = x, N = ae(null), f = ae(null), { size: Me, getPrefixCls: Q } = qe(fo), [Ae, Y] = ce(w.NONE), [B, Z] = ce(!1), Be = to(), T = "showSearch" in x ? x.showSearch : I, m = T || Ce, y = ge || Me, V = B || p, Ve = C(T) && T.retainInputValue, h = !I && v !== void 0 ? X(v).text : "", _ = (e) => {
70
70
  e?.preventDefault?.();
71
71
  }, U = (e) => {
72
72
  const o = m ? N.current : f.current;
@@ -103,13 +103,13 @@ const K = "__pqb_value_tag_placeholder", w = {
103
103
  let e;
104
104
  switch (Ae) {
105
105
  case w.BEFORE:
106
- e = F || (Ve ? v : "");
106
+ e = F || (Ve ? h : "");
107
107
  break;
108
108
  case w.EDITING:
109
109
  e = F || "";
110
110
  break;
111
111
  default:
112
- e = v;
112
+ e = h;
113
113
  break;
114
114
  }
115
115
  const o = !!(V && m || R), s = {
@@ -117,7 +117,8 @@ const K = "__pqb_value_tag_placeholder", w = {
117
117
  // _inputValue after renderText(value) may be rich text, but the value of <input> cannot be object
118
118
  value: o && typeof e != "object" ? e : "",
119
119
  // Allow placeholder to display the selected value first when searching
120
- placeholder: m && v && typeof v != "object" ? v : q
120
+ placeholder: m && // 0 can also be used as a placeholder, because when options is number[], the selected value may be 0
121
+ (h || h === 0) && typeof h != "object" ? h : q
121
122
  };
122
123
  return m ? (s.onPaste = i.paste, s.onKeyDown = i.keyDown, s.onFocus = i.focus, s.onBlur = i.blur, s.onChange = i.change) : (s.tabIndex = -1, s.style.pointerEvents = "none"), /* @__PURE__ */ k("span", { className: `${n}-view-selector`, children: [
123
124
  /* @__PURE__ */ t(
@@ -125,7 +126,7 @@ const K = "__pqb_value_tag_placeholder", w = {
125
126
  {
126
127
  "aria-hidden": !o || void 0,
127
128
  ref: N,
128
- disabled: g,
129
+ disabled: b,
129
130
  className: E(`${n}-view-input`, {
130
131
  [`${n}-hidden`]: !o
131
132
  }),
@@ -149,9 +150,9 @@ const K = "__pqb_value_tag_placeholder", w = {
149
150
  }, L = Qe(() => {
150
151
  if (!I)
151
152
  return [];
152
- const e = le(b) ? [] : [].concat(b);
153
- return (de(oe) ? e.slice(0, oe) : e).map((P, h, te) => ne(P));
154
- }, [b, I, c, z]), Le = () => {
153
+ const e = le(v) ? [] : [].concat(v);
154
+ return (de(oe) ? e.slice(0, oe) : e).map((P, g, te) => ne(P));
155
+ }, [v, I, c, z]), Le = () => {
155
156
  const e = C(c) ? c.count : c, o = C(c) && c.showPopover, s = Q?.("input-tag"), P = (r) => C(c) && ro(c.render) ? c.render(r) : e === "responsive" ? /* @__PURE__ */ k(
156
157
  ie,
157
158
  {
@@ -163,9 +164,9 @@ const K = "__pqb_value_tag_placeholder", w = {
163
164
  ]
164
165
  },
165
166
  K
166
- ) : `+${r}...`, h = le(b) ? [] : [].concat(b), te = () => {
167
- for (let r = h.length - 1; r >= 0; r--) {
168
- const l = h[r];
167
+ ) : `+${r}...`, g = le(v) ? [] : [].concat(v), te = () => {
168
+ for (let r = g.length - 1; r >= 0; r--) {
169
+ const l = g[r];
169
170
  if (!z(l).disabled)
170
171
  return r;
171
172
  }
@@ -179,7 +180,7 @@ const K = "__pqb_value_tag_placeholder", w = {
179
180
  onRemove: (r, l, u) => {
180
181
  const $ = u.key;
181
182
  let a = -1;
182
- $ === po.key && (a = te()) !== -1 && (r = h[a], l = a), c && Be(), Re?.(r, l, u);
183
+ $ === po.key && (a = te()) !== -1 && (r = g[a], l = a), c && Be(), Re?.(r, l, u);
183
184
  }
184
185
  }, Ke = {
185
186
  suffix: null,
@@ -190,7 +191,7 @@ const K = "__pqb_value_tag_placeholder", w = {
190
191
  labelInValue: !1
191
192
  }, se = (() => {
192
193
  if (de(e)) {
193
- const r = h.length - e;
194
+ const r = g.length - e;
194
195
  if (r > 0) {
195
196
  const l = {
196
197
  label: P(r),
@@ -199,14 +200,16 @@ const K = "__pqb_value_tag_placeholder", w = {
199
200
  value: K
200
201
  };
201
202
  if (o) {
202
- const u = h.map((a, d) => ({ val: a, index: d })).slice(e).map((a) => {
203
+ const u = g.map((a, d) => ({ val: a, index: d })).slice(e).map((a) => {
203
204
  const d = ne(a.val);
204
205
  return M ? M(
205
206
  {
206
207
  ...d,
207
- onClose: (H) => {
208
- j.onRemove(d.value, a.index, H);
209
- }
208
+ onClose: (H) => j.onRemove(
209
+ d.value,
210
+ a.index,
211
+ H
212
+ )
210
213
  },
211
214
  a.index,
212
215
  L.concat(l)
@@ -248,7 +251,7 @@ const K = "__pqb_value_tag_placeholder", w = {
248
251
  ...Ke,
249
252
  className: V ? `${Q?.("input-tag")}-focus` : "",
250
253
  ref: N,
251
- disabled: g,
254
+ disabled: b,
252
255
  dragToSort: J,
253
256
  disableInput: !T,
254
257
  animation: we,
@@ -270,8 +273,8 @@ const K = "__pqb_value_tag_placeholder", w = {
270
273
  K
271
274
  );
272
275
  if (u > -1) {
273
- const $ = r.slice(0, u), a = r.slice(u + 1), d = h.slice(
274
- r.length - 1 - h.length
276
+ const $ = r.slice(0, u), a = r.slice(u + 1), d = g.slice(
277
+ r.length - 1 - g.length
275
278
  );
276
279
  A($.concat(d, a));
277
280
  } else
@@ -281,7 +284,7 @@ const K = "__pqb_value_tag_placeholder", w = {
281
284
  ...j
282
285
  }
283
286
  );
284
- }, re = xe || (x.error ? "error" : void 0), je = !g && !R && ve ? /* @__PURE__ */ t(
287
+ }, re = xe || (x.error ? "error" : void 0), je = !b && !R && ve ? /* @__PURE__ */ t(
285
288
  ao,
286
289
  {
287
290
  size: y,
@@ -300,7 +303,7 @@ const K = "__pqb_value_tag_placeholder", w = {
300
303
  [`${n}-size-${y}`]: y,
301
304
  [`${n}-focused`]: V,
302
305
  [`${n}-${re}`]: re,
303
- [`${n}-disabled`]: g,
306
+ [`${n}-disabled`]: b,
304
307
  [`${n}-no-border`]: !be,
305
308
  [`${n}-rtl`]: $e
306
309
  },
@@ -313,24 +316,24 @@ const K = "__pqb_value_tag_placeholder", w = {
313
316
  "aria-haspopup": "listbox",
314
317
  "aria-autocomplete": "list",
315
318
  "aria-expanded": p,
316
- "aria-disabled": g,
319
+ "aria-disabled": b,
317
320
  "aria-controls": Te,
318
321
  ...uo(Oe, ["onClick", "onMouseEnter", "onMouseLeave"]),
319
322
  ...ye,
320
323
  ref: f,
321
- tabIndex: g ? -1 : 0,
324
+ tabIndex: b ? -1 : 0,
322
325
  id: pe,
323
326
  style: fe,
324
327
  className: He,
325
328
  onKeyDown: ee,
326
329
  onFocus: (e) => {
327
- !g && !J && (m ? N.current && N.current.focus() : S("focus", e));
330
+ !b && !J && (m ? N.current && N.current.focus() : S("focus", e));
328
331
  },
329
332
  onBlur: (e) => S("blur", e),
330
333
  children: /* @__PURE__ */ k(
331
334
  "div",
332
335
  {
333
- title: typeof v == "string" ? v : void 0,
336
+ title: typeof h == "string" ? h : void 0,
334
337
  className: E(`${n}-view`, {
335
338
  [`${n}-view-with-prefix`]: O
336
339
  }),
package/space/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as s, useContext as S } from "react";
3
- import x from "../components/common/space/index.js";
3
+ import u from "../components/common/space/index.js";
4
4
  import "../config-provider/ConfigProvider.js";
5
5
  import "lodash/isEqualWith";
6
6
  import "../components/common/utils/is.js";
@@ -9,35 +9,35 @@ import "lodash/isNumber";
9
9
  import "lodash/merge";
10
10
  import "../components/common/utils/dom.js";
11
11
  import "../components/common/hooks/useIntersectionObserver.js";
12
- import N from "../components/common/hooks/useMergeProps.js";
12
+ import x from "../components/common/hooks/useMergeProps.js";
13
13
  import "../components/common/utils/reactDOM.js";
14
14
  import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
- import g from "@unicom-cloud/utils/class-name";
17
- import u from "../config-provider/context.js";
16
+ import N from "@unicom-cloud/utils/class-name";
17
+ import g from "../config-provider/context.js";
18
18
  const $ = {
19
19
  size: "small",
20
20
  direction: "horizontal"
21
21
  }, i = s(
22
- (o, t) => {
23
- const { getPrefixCls: c, componentConfig: n, rtl: l } = S(u), f = N(
22
+ (o, r) => {
23
+ const { getPrefixCls: c, componentConfig: n, rtl: l } = S(g), f = x(
24
24
  o,
25
25
  $,
26
26
  n?.Space
27
- ), { className: d, direction: r = "horizontal", wrap: p, ...C } = f, e = c?.("space");
27
+ ), { className: d, direction: t = "horizontal", wrap: p, ...C } = f, e = c?.("space");
28
28
  return /* @__PURE__ */ a(
29
- x,
29
+ u,
30
30
  {
31
- ref: t,
32
- className: g(
31
+ ref: r,
32
+ className: N(
33
33
  e,
34
34
  {
35
35
  [`${e}-wrap`]: p,
36
- [`${e}-${r}`]: r
36
+ [`${e}-${t}`]: t
37
37
  },
38
38
  d
39
39
  ),
40
- direction: r,
40
+ direction: t,
41
41
  wrap: p,
42
42
  rtl: l,
43
43
  ...C
@@ -46,7 +46,9 @@ const $ = {
46
46
  }
47
47
  );
48
48
  i.displayName = "Space";
49
- const m = s((o, t) => /* @__PURE__ */ a(i, { ref: t, direction: "vertical", ...o }));
49
+ const m = s(
50
+ (o, r) => /* @__PURE__ */ a(i, { ...o, ref: r, direction: "vertical" })
51
+ );
50
52
  m.displayName = "SpaceVertical";
51
53
  const E = Object.assign(i, {
52
54
  Vertical: m
@@ -3,68 +3,66 @@ import H from "@unicom-cloud/icons/IconUiDown";
3
3
  import J from "@unicom-cloud/icons/IconUiLeft";
4
4
  import K from "@unicom-cloud/icons/IconUiRight";
5
5
  import Q from "@unicom-cloud/icons/IconUiUp";
6
- import E from "react";
6
+ import { useContext as W, useState as X, useEffect as Z } from "react";
7
7
  import "../config-provider/ConfigProvider.js";
8
8
  import f from "@unicom-cloud/utils/class-name";
9
9
  import Y from "./hooks/useEvent.js";
10
- import W from "../config-provider/context.js";
11
- function O(d) {
10
+ import _ from "../config-provider/context.js";
11
+ function b(d) {
12
12
  return typeof d == "number" && !Number.isNaN(d) ? Math.round(d) : 0;
13
13
  }
14
- const ie = (d) => {
15
- const { getPrefixCls: y } = E.useContext(W), {
14
+ const fe = (d) => {
15
+ const { getPrefixCls: y } = W(_), {
16
16
  prefixCls: I,
17
17
  vertical: s,
18
18
  index: n,
19
19
  active: z,
20
- ariaNow: $,
21
- ariaMin: M,
22
- ariaMax: N,
20
+ ariaNow: E,
21
+ ariaMin: $,
22
+ ariaMax: M,
23
23
  startCollapsible: T,
24
24
  endCollapsible: j,
25
- onOffsetStart: S,
25
+ onOffsetStart: O,
26
26
  onOffsetUpdate: v,
27
27
  onOffsetEnd: h,
28
28
  onCollapse: P,
29
29
  lazy: a,
30
30
  containerSize: m
31
- } = d, e = y?.("bar", I), [r, w] = E.useState(
32
- null
33
- ), [g, U] = E.useState(0), k = s ? 0 : g, A = s ? g : 0, D = (t) => {
34
- t.currentTarget && (w([t.pageX, t.pageY]), S(n));
35
- }, R = (t) => {
36
- if (t.touches.length === 1) {
37
- const o = t.touches[0];
38
- w([o.pageX, o.pageY]), S(n);
31
+ } = d, e = y?.("bar", I), [r, w] = X(null), [g, S] = X(0), k = s ? 0 : g, A = s ? g : 0, D = (o) => {
32
+ o.currentTarget && (w([o.pageX, o.pageY]), O(n));
33
+ }, V = (o) => {
34
+ if (o.touches.length === 1) {
35
+ const t = o.touches[0];
36
+ w([t.pageX, t.pageY]), O(n);
39
37
  }
40
- }, V = (t) => {
41
- const o = m * $ / 100, c = o + t, x = Math.max(0, m * M / 100), i = Math.min(m, m * N / 100);
42
- return Math.max(x, Math.min(i, c)) - o;
43
- }, L = Y((t, o) => {
44
- const c = V(
45
- s ? o : t
38
+ }, B = (o) => {
39
+ const t = m * E / 100, c = t + o, x = Math.max(0, m * $ / 100), i = Math.min(m, m * M / 100);
40
+ return Math.max(x, Math.min(i, c)) - t;
41
+ }, N = Y((o, t) => {
42
+ const c = B(
43
+ s ? t : o
46
44
  );
47
- U(c);
48
- }), b = Y(() => {
49
- v(n, k, A, !0), U(0), h(!0);
45
+ S(c);
46
+ }), L = Y(() => {
47
+ v(n, k, A, !0), S(0), h(!0);
50
48
  });
51
- E.useEffect(() => {
49
+ Z(() => {
52
50
  if (r) {
53
- const t = (i) => {
54
- const { pageX: u, pageY: C } = i, p = u - r[0], X = C - r[1];
55
- a ? L(p, X) : v(n, p, X);
56
- }, o = () => {
57
- a ? b() : h(), w(null);
51
+ const o = (i) => {
52
+ const { pageX: p, pageY: C } = i, u = p - r[0], U = C - r[1];
53
+ a ? N(u, U) : v(n, u, U);
54
+ }, t = () => {
55
+ a ? L() : h(), w(null);
58
56
  }, c = (i) => {
59
57
  if (i.touches.length === 1) {
60
- const u = i.touches[0], C = u.pageX - r[0], p = u.pageY - r[1];
61
- a ? L(C, p) : v(n, C, p);
58
+ const p = i.touches[0], C = p.pageX - r[0], u = p.pageY - r[1];
59
+ a ? N(C, u) : v(n, C, u);
62
60
  }
63
61
  }, x = () => {
64
- a ? b() : h(), w(null);
62
+ a ? L() : h(), w(null);
65
63
  };
66
- return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove", t), window.addEventListener("mouseup", o), () => {
67
- window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", o), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", x);
64
+ return window.addEventListener("touchmove", c), window.addEventListener("touchend", x), window.addEventListener("mousemove", o), window.addEventListener("mouseup", t), () => {
65
+ window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", x);
68
66
  };
69
67
  }
70
68
  }, [
@@ -73,15 +71,15 @@ const ie = (d) => {
73
71
  s,
74
72
  n,
75
73
  m,
74
+ E,
76
75
  $,
77
76
  M,
78
77
  N,
79
- L,
80
78
  v,
81
- b,
79
+ L,
82
80
  h
83
81
  ]);
84
- const B = {
82
+ const R = {
85
83
  [`--${e}-preview-offset`]: `${g}px`
86
84
  }, q = s ? Q : J, F = s ? H : K;
87
85
  return /* @__PURE__ */ G(
@@ -89,9 +87,9 @@ const ie = (d) => {
89
87
  {
90
88
  className: e,
91
89
  role: "separator",
92
- "aria-valuenow": O($),
93
- "aria-valuemin": O(M),
94
- "aria-valuemax": O(N),
90
+ "aria-valuenow": b(E),
91
+ "aria-valuemin": b($),
92
+ "aria-valuemax": b(M),
95
93
  children: [
96
94
  a && /* @__PURE__ */ l(
97
95
  "div",
@@ -99,7 +97,7 @@ const ie = (d) => {
99
97
  className: f(`${e}-preview`, {
100
98
  [`${e}-preview-active`]: !!g
101
99
  }),
102
- style: B
100
+ style: R
103
101
  }
104
102
  ),
105
103
  /* @__PURE__ */ l(
@@ -109,7 +107,7 @@ const ie = (d) => {
109
107
  [`${e}-dragger-active`]: z
110
108
  }),
111
109
  onMouseDown: D,
112
- onTouchStart: R
110
+ onTouchStart: V
113
111
  }
114
112
  ),
115
113
  T && /* @__PURE__ */ l(
@@ -155,5 +153,5 @@ const ie = (d) => {
155
153
  );
156
154
  };
157
155
  export {
158
- ie as default
156
+ fe as default
159
157
  };