@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/input/Button.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import m from "lodash/isPlainObject";
3
3
  import A, { useContext as B } from "react";
4
- import P from "../button/index.js";
4
+ import I from "../button/index.js";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import $ from "../components/common/hooks/useMergeValue.js";
6
+ import P from "../components/common/hooks/useMergeValue.js";
7
7
  import c from "@unicom-cloud/utils/class-name";
8
- import j, { formatValue as d } from "./Input.js";
9
- import z from "../config-provider/context.js";
10
- const I = A.forwardRef(
8
+ import $, { formatValue as d } from "./Input.js";
9
+ import j from "../config-provider/context.js";
10
+ const z = A.forwardRef(
11
11
  (t, f) => {
12
- const { getPrefixCls: g } = B(z), {
12
+ const { getPrefixCls: g } = B(j), {
13
13
  className: h,
14
14
  style: x,
15
15
  placeholder: C,
@@ -26,7 +26,7 @@ const I = A.forwardRef(
26
26
  warning: "warning",
27
27
  success: "success"
28
28
  }, V = t.status ? N[t.status] : void 0, i = l === void 0 ? /* @__PURE__ */ u(
29
- P,
29
+ I,
30
30
  {
31
31
  type: "primary",
32
32
  disabled: o,
@@ -38,14 +38,14 @@ const I = A.forwardRef(
38
38
  onClick: (e) => {
39
39
  L?.(k), t.onClick?.(e), a?.onClick?.(e);
40
40
  },
41
- children: b ?? "确定"
41
+ children: a?.children ?? b ?? "确定"
42
42
  }
43
- ) : l, y = m(t.maxLength) ? t.maxLength.length : t.maxLength, r = m(t.maxLength) && t.maxLength.errorOnly ? void 0 : y, [k, M] = $("", {
43
+ ) : l, y = m(t.maxLength) ? t.maxLength.length : t.maxLength, r = m(t.maxLength) && t.maxLength.errorOnly ? void 0 : y, [k, M] = P("", {
44
44
  defaultValue: "defaultValue" in t ? d(t.defaultValue, r) : void 0,
45
45
  value: "value" in t ? d(t.value, r) : void 0
46
46
  });
47
47
  return /* @__PURE__ */ u(
48
- j,
48
+ $,
49
49
  {
50
50
  ...s,
51
51
  className: c(
@@ -66,7 +66,7 @@ const I = A.forwardRef(
66
66
  );
67
67
  }
68
68
  );
69
- I.displayName = "Input.Button";
69
+ z.displayName = "Input.Button";
70
70
  export {
71
- I as default
71
+ z as default
72
72
  };
package/input/Group.js CHANGED
@@ -1,19 +1,18 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import l, { useContext as f } from "react";
2
+ import f, { useContext as u } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
- import u from "@unicom-cloud/utils/class-name";
5
- import x from "../config-provider/context.js";
6
- const N = l.forwardRef((o, s) => {
7
- const { getPrefixCls: r } = f(x), { className: e, style: a, children: m, compact: c, ...p } = o, t = r?.("input-group"), i = u(
4
+ import x from "@unicom-cloud/utils/class-name";
5
+ import N from "../config-provider/context.js";
6
+ const d = f.forwardRef((o, s) => {
7
+ const { getPrefixCls: r, rtl: e } = u(N), { className: a, style: m, children: c, compact: p, ...l } = o, t = r?.("input-group"), i = x(
8
8
  t,
9
- {
10
- [`${t}-compact`]: c
11
- },
12
- e
9
+ p && [`${t}-compact`],
10
+ e && `${t}-rtl`,
11
+ a
13
12
  );
14
- return /* @__PURE__ */ n("div", { ref: s, className: i, style: a, ...p, children: m });
13
+ return /* @__PURE__ */ n("div", { ref: s, className: i, style: m, ...l, children: c });
15
14
  });
16
- N.displayName = "InputGroup";
15
+ d.displayName = "InputGroup";
17
16
  export {
18
- N as default
17
+ d as default
19
18
  };
package/input/Input.js CHANGED
@@ -1,90 +1,90 @@
1
1
  import { jsxs as R, jsx as $ } from "react/jsx-runtime";
2
- import nr from "lodash/isNil";
2
+ import sr from "lodash/isNil";
3
3
  import B from "lodash/isPlainObject";
4
- import sr from "lodash/isString";
5
- import { forwardRef as ar, useContext as ir, useState as ur, useRef as A, useImperativeHandle as pr, useMemo as lr } from "react";
4
+ import ar from "lodash/isString";
5
+ import { forwardRef as ir, useContext as ur, useState as pr, useRef as A, useImperativeHandle as fr, useMemo as lr } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
7
  import cr from "../components/common/hooks/useMergeProps.js";
8
- import fr from "../components/common/hooks/useMergeValue.js";
8
+ import mr from "../components/common/hooks/useMergeValue.js";
9
9
  import h from "@unicom-cloud/utils/class-name";
10
- import { contains as O } from "../components/common/utils/dom.js";
11
- import U from "./Button.js";
12
- import mr from "./Group.js";
10
+ import { contains as H } from "../components/common/utils/dom.js";
11
+ import q from "./Button.js";
12
+ import J from "./Group.js";
13
13
  import dr from "./InputElement.js";
14
- import q from "../input-number/index.js";
14
+ import K from "../input-number/index.js";
15
15
  import gr from "./Password.js";
16
16
  import hr from "./Search.js";
17
- import J from "../input-tag/InputTag.js";
17
+ import Q from "../input-tag/InputTag.js";
18
18
  import wr from "./Textarea.js";
19
19
  import $r from "../config-provider/context.js";
20
20
  const xr = (o) => {
21
21
  o.target.tagName === "INPUT" || o.preventDefault();
22
- }, w = (o, i, a = {}, x) => i ? /* @__PURE__ */ $("span", { style: a, className: o, onClick: x, children: i }) : null;
23
- function H(o, i) {
24
- let a = o || "";
25
- return sr(o) || nr(o) || (a = String(o)), i && (a = a.slice(0, i)), a;
22
+ }, w = (o, a, s = {}, x) => a ? /* @__PURE__ */ $("span", { style: s, className: o, onClick: x, children: a }) : null;
23
+ function U(o, a) {
24
+ let s = o || "";
25
+ return ar(o) || sr(o) || (s = String(o)), a && (s = s.slice(0, a)), s;
26
26
  }
27
- function Ir(o, i) {
27
+ function Ir(o, a) {
28
28
  const {
29
- getPrefixCls: a,
29
+ getPrefixCls: s,
30
30
  size: x,
31
- componentConfig: K,
31
+ componentConfig: X,
32
32
  rtl: I
33
- } = ir($r), e = cr(
33
+ } = ur($r), e = cr(
34
34
  o,
35
35
  {},
36
- K?.Input
36
+ X?.Input
37
37
  ), {
38
38
  className: F,
39
- style: Q,
39
+ style: Y,
40
40
  addBefore: V,
41
41
  addAfter: D,
42
- suffix: X,
42
+ suffix: Z,
43
43
  prefix: N,
44
- beforeStyle: Y,
45
- afterStyle: Z,
44
+ beforeStyle: _,
45
+ afterStyle: rr,
46
46
  height: z,
47
47
  disabled: L,
48
48
  maxLength: p,
49
- showWordLimit: _,
49
+ showWordLimit: er,
50
50
  allowClear: C,
51
51
  autoWidth: W
52
- } = e, l = W ? {
52
+ } = e, f = W ? {
53
53
  minWidth: 0,
54
54
  maxWidth: "100%",
55
55
  ...B(W) ? W : {}
56
56
  } : null, b = {
57
- minWidth: l?.minWidth,
58
- maxWidth: l?.maxWidth,
59
- width: l && "auto",
60
- ...Q
61
- }, u = B(p) ? p.length : p, f = B(p) && p.errorOnly ? void 0 : u, [rr, j] = ur(!1), s = A(), v = A(), c = A(), [S, er] = fr("", {
62
- defaultValue: "defaultValue" in e ? H(e.defaultValue, f) : void 0,
63
- value: "value" in e ? H(e.value, f) : void 0
57
+ minWidth: f?.minWidth,
58
+ maxWidth: f?.maxWidth,
59
+ width: f && "auto",
60
+ ...Y
61
+ }, i = B(p) ? p.length : p, c = B(p) && p.errorOnly ? void 0 : i, [j, k] = pr(!1), u = A(), v = A(), l = A(), [S, tr] = mr("", {
62
+ defaultValue: "defaultValue" in e ? U(e.defaultValue, c) : void 0,
63
+ value: "value" in e ? U(e.value, c) : void 0
64
64
  });
65
- pr(
66
- i,
65
+ fr(
66
+ a,
67
67
  () => ({
68
- focus: s.current?.focus,
69
- blur: s.current?.blur,
70
- dom: s.current?.dom,
68
+ focus: u.current?.focus,
69
+ blur: u.current?.blur,
70
+ dom: u.current?.dom,
71
71
  // 保持之前逻辑
72
- getRootDOMNode: () => v.current || s.current?.dom
72
+ getRootDOMNode: () => v.current || u.current?.dom
73
73
  }),
74
74
  []
75
75
  );
76
- const tr = (t, M) => {
77
- "value" in e || er(t), e.onChange?.(t, M);
78
- }, r = a?.("input"), m = e.size || x, y = "height" in e;
79
- let d = X;
80
- const g = S ? S.length : 0, k = lr(() => !f && u ? g > u : !1, [g, u, f]);
81
- if (u && _) {
82
- const [t, M] = I ? [u, g] : [g, u];
76
+ const or = (t, M) => {
77
+ "value" in e || tr(t), e.onChange?.(t, M);
78
+ }, r = s?.("input"), m = e.size || x, y = "height" in e;
79
+ let d = Z;
80
+ const g = S ? S.length : 0, E = lr(() => !c && i ? g > i : !1, [g, i, c]);
81
+ if (i && er) {
82
+ const [t, M] = I ? [i, g] : [g, i];
83
83
  d = /* @__PURE__ */ R(
84
84
  "span",
85
85
  {
86
86
  className: h(`${r}-word-limit`, {
87
- [`${r}-word-limit-error`]: k
87
+ [`${r}-word-limit-error`]: E
88
88
  }),
89
89
  children: [
90
90
  t,
@@ -94,110 +94,120 @@ function Ir(o, i) {
94
94
  }
95
95
  );
96
96
  }
97
- const or = h(
97
+ const nr = h(
98
98
  `${r}-group-wrapper`,
99
99
  `${r}-group-wrapper-${m}`,
100
+ !!j && `${r}-group-wrapper-focus`,
101
+ // 潘启宝添加
100
102
  {
101
103
  [`${r}-custom-height`]: y,
102
104
  [`${r}-has-suffix`]: d,
103
105
  [`${r}-group-wrapper-disabled`]: L,
104
106
  [`${r}-group-wrapper-rtl`]: I,
105
- [`${r}-group-wrapper-autowidth`]: l
107
+ [`${r}-group-wrapper-autowidth`]: f
106
108
  },
107
109
  F
108
- ), P = e.status || (e.error || k ? "error" : void 0), E = V || D || d || N, T = /* @__PURE__ */ $(
110
+ ), P = e.status || (e.error || E ? "error" : void 0), G = V || D || d || N, T = /* @__PURE__ */ $(
109
111
  dr,
110
112
  {
111
- ref: s,
113
+ ref: u,
112
114
  ...e,
113
- autoFitWidth: !!l,
115
+ autoFitWidth: !!f,
114
116
  style: b,
115
117
  status: P,
116
118
  onFocus: (t) => {
117
- j(!0), e.onFocus?.(t);
119
+ k(!0), e.onFocus?.(t);
118
120
  },
119
121
  onBlur: (t) => {
120
- j(!1), e.onBlur?.(t);
122
+ k(!1), e.onBlur?.(t);
121
123
  },
122
- onChange: tr,
124
+ onChange: or,
123
125
  prefixCls: r,
124
126
  value: S,
125
- hasParent: !!E || C,
127
+ hasParent: !!G || C,
126
128
  size: m
127
129
  }
128
- ), G = h(`${r}-inner-wrapper`, {
129
- [`${r}-inner-wrapper-${P}`]: P,
130
- [`${r}-inner-wrapper-disabled`]: L,
131
- [`${r}-inner-wrapper-focus`]: rr,
132
- [`${r}-inner-wrapper-has-prefix`]: N,
133
- [`${r}-inner-wrapper-${m}`]: m,
134
- [`${r}-clear-wrapper`]: C,
135
- [`${r}-inner-wrapper-rtl`]: I
136
- });
137
- return E ? /* @__PURE__ */ $(
130
+ ), O = h(
131
+ `${r}-inner-wrapper`,
132
+ {
133
+ [`${r}-inner-wrapper-${P}`]: P,
134
+ [`${r}-inner-wrapper-disabled`]: L,
135
+ [`${r}-inner-wrapper-focus`]: j,
136
+ [`${r}-inner-wrapper-has-prefix`]: N,
137
+ [`${r}-inner-wrapper-${m}`]: m,
138
+ [`${r}-clear-wrapper`]: C
139
+ },
140
+ I ? `${r}-inner-wrapper-rtl` : `${r}-inner-wrapper-ltr`
141
+ );
142
+ return G ? /* @__PURE__ */ $(
138
143
  "div",
139
144
  {
140
145
  ref: v,
141
- className: or,
146
+ className: nr,
142
147
  style: { ...b, ...y ? { height: z } : {} },
143
- children: /* @__PURE__ */ R("span", { className: `${r}-group`, children: [
144
- w(`${r}-group-addbefore`, V, Y),
145
- /* @__PURE__ */ R(
146
- "span",
147
- {
148
- className: G,
149
- ref: c,
150
- onMouseDown: (t) => {
151
- t.target.tagName !== "INPUT" && c.current && O(c.current, t.target) && t.preventDefault();
152
- },
153
- onClick: (t) => {
154
- c.current && O(c.current, t.target) && s.current && s.current.focus();
155
- },
156
- children: [
157
- w(`${r}-group-prefix`, N),
158
- T,
159
- w(`${r}-group-suffix`, d)
160
- ]
161
- }
162
- ),
163
- w(`${r}-group-addafter`, D, Z)
164
- ] })
148
+ children: /* @__PURE__ */ R(
149
+ J,
150
+ {
151
+ children: [
152
+ w(`${r}-group-addbefore`, V, _),
153
+ /* @__PURE__ */ R(
154
+ "span",
155
+ {
156
+ className: O,
157
+ ref: l,
158
+ onMouseDown: (t) => {
159
+ t.target.tagName !== "INPUT" && l.current && H(l.current, t.target) && t.preventDefault();
160
+ },
161
+ onClick: (t) => {
162
+ l.current && H(l.current, t.target) && u.current?.focus?.();
163
+ },
164
+ children: [
165
+ w(`${r}-group-prefix`, N),
166
+ T,
167
+ w(`${r}-group-suffix`, d)
168
+ ]
169
+ }
170
+ ),
171
+ w(`${r}-group-addafter`, D, rr)
172
+ ]
173
+ }
174
+ )
165
175
  }
166
176
  ) : C ? /* @__PURE__ */ $(
167
177
  "span",
168
178
  {
169
179
  ref: v,
170
- className: h(F, G),
180
+ className: h(F, O),
171
181
  style: { ...b, ...y ? { height: z } : {} },
172
182
  onMouseDown: xr,
173
183
  onClick: () => {
174
- s.current && s.current.focus();
184
+ u.current?.focus?.();
175
185
  },
176
186
  children: T
177
187
  }
178
188
  ) : T;
179
189
  }
180
- const Nr = ar(Ir), n = Nr;
190
+ const Nr = ir(Ir), n = Nr;
181
191
  n.displayName = "Input";
182
192
  n.Search = hr;
183
- n.Button = U;
184
- n.InputButton = U;
193
+ n.Button = q;
194
+ n.InputButton = q;
185
195
  n.TextArea = wr;
186
196
  n.Password = gr;
187
- n.Number = q;
188
- n.InputNumber = q;
189
- n.Tag = J;
190
- n.InputTag = J;
191
- n.Group = mr;
197
+ n.Number = K;
198
+ n.InputNumber = K;
199
+ n.Tag = Q;
200
+ n.InputTag = Q;
201
+ n.Group = J;
192
202
  export {
193
- U as InputButton,
194
- mr as InputGroup,
195
- q as InputNumber,
203
+ q as InputButton,
204
+ J as InputGroup,
205
+ K as InputNumber,
196
206
  gr as InputPassword,
197
207
  hr as InputSearch,
198
- J as InputTag,
208
+ Q as InputTag,
199
209
  wr as InputTextArea,
200
210
  wr as TextArea,
201
211
  n as default,
202
- H as formatValue
212
+ U as formatValue
203
213
  };
@@ -1,17 +1,18 @@
1
1
  import { jsxs as H, Fragment as K, jsx as l } from "react/jsx-runtime";
2
2
  import Y from "@unicom-cloud/icons/IconUiClose";
3
- import Z from "lodash/isFunction";
4
- import _, { useState as ee, useRef as b, useImperativeHandle as te, useEffect as L } from "react";
5
- import oe from "../components/common/hooks/useKeyboardEvent.js";
6
- import re from "../icon-hover/index.js";
3
+ import Z from "lodash/isArray";
4
+ import _ from "lodash/isFunction";
5
+ import ee, { useState as te, useRef as b, useImperativeHandle as oe, useEffect as L } from "react";
6
+ import re from "../components/common/hooks/useKeyboardEvent.js";
7
+ import ne from "../icon-hover/index.js";
7
8
  import O from "@unicom-cloud/utils/class-name";
8
- import { fillNBSP as ne } from "../components/common/utils/fillNBSP.js";
9
+ import { fillNBSP as ie } from "../components/common/utils/fillNBSP.js";
9
10
  import "../components/common/utils/is.js";
10
- import { omit as ie } from "../components/common/utils/omit.js";
11
- import { resizeObserver as ae } from "../components/common/utils/resizeObserver.js";
12
- import se from "./useComposition.js";
11
+ import { omit as ae } from "../components/common/utils/omit.js";
12
+ import { resizeObserver as se } from "../components/common/utils/resizeObserver.js";
13
+ import le from "./useComposition.js";
13
14
  import { isPlainObject as p } from "@unicom-cloud/utils/is";
14
- const le = 2, ue = (o) => {
15
+ const ue = 2, ce = (o) => {
15
16
  if (!o)
16
17
  return {};
17
18
  const h = window.getComputedStyle(o);
@@ -31,7 +32,7 @@ const le = 2, ue = (o) => {
31
32
  "borderRight",
32
33
  "boxSizing"
33
34
  ].reduce((a, u) => (a[u] = h[u], a), {});
34
- }, ce = _.forwardRef(
35
+ }, de = ee.forwardRef(
35
36
  (o, h) => {
36
37
  const {
37
38
  allowClear: g,
@@ -53,7 +54,7 @@ const le = 2, ue = (o) => {
53
54
  maxLength: c,
54
55
  clearIcon: W,
55
56
  ...d
56
- } = o, V = ie(d, [
57
+ } = o, V = ae(d, [
57
58
  "error",
58
59
  "status",
59
60
  "showWordLimit",
@@ -68,17 +69,17 @@ const le = 2, ue = (o) => {
68
69
  "normalize",
69
70
  "normalizeTrigger",
70
71
  "autoWidth"
71
- ]), [N, A] = ee(), P = oe(), r = b(), s = b(), $ = b(null), D = p(c) ? c.errorOnly ? void 0 : c.length : c, E = (e) => {
72
+ ]), [N, U] = te(), P = re(), r = b(), s = b(), $ = b(null), D = p(c) ? c.errorOnly ? void 0 : c.length : c, E = (e) => {
72
73
  let i;
73
74
  const R = o.normalizeTrigger || ["onBlur"];
74
- return Array.isArray(R) && R.indexOf(e) > -1 && Z(o.normalize) && (i = o.normalize), i;
75
+ return Z(R) && R.indexOf(e) > -1 && _(o.normalize) && (i = o.normalize), i;
75
76
  }, {
76
- compositionValue: U,
77
+ compositionValue: A,
77
78
  valueChangeHandler: q,
78
79
  compositionHandler: v,
79
80
  keyDownHandler: G,
80
81
  triggerValueChangeCallback: B
81
- } = se({
82
+ } = le({
82
83
  value: C,
83
84
  maxLength: D,
84
85
  onChange: T,
@@ -101,7 +102,7 @@ const le = 2, ue = (o) => {
101
102
  maxLength: D,
102
103
  disabled: a,
103
104
  placeholder: u,
104
- value: U || C || "",
105
+ value: A || C || "",
105
106
  className: J,
106
107
  onKeyDown: G,
107
108
  onChange: q,
@@ -120,7 +121,7 @@ const le = 2, ue = (o) => {
120
121
  i && B(i(e.target.value), e);
121
122
  }
122
123
  };
123
- te(h, () => ({
124
+ oe(h, () => ({
124
125
  dom: r.current,
125
126
  getRootDOMNode: () => r.current,
126
127
  focus: () => {
@@ -133,11 +134,11 @@ const le = 2, ue = (o) => {
133
134
  const m = () => {
134
135
  if (s.current && r.current) {
135
136
  const e = s.current.offsetWidth;
136
- r.current.style.width = `${e + le}px`;
137
+ r.current.style.width = `${e + ue}px`;
137
138
  }
138
139
  };
139
140
  L(() => {
140
- t && ((!p(t) || !t.pure) && A(ue(r.current)), m());
141
+ t && ((!p(t) || !t.pure) && U(ce(r.current)), m());
141
142
  }, [t]);
142
143
  const Q = x.value || u, f = (e) => {
143
144
  r.current && r.current.focus && r.current.focus(), B("", e), M?.();
@@ -152,7 +153,7 @@ const le = 2, ue = (o) => {
152
153
  $.current = e;
153
154
  }
154
155
  return L(() => {
155
- const e = ae([s.current], X);
156
+ const e = se([s.current], X);
156
157
  return () => {
157
158
  e();
158
159
  };
@@ -174,7 +175,7 @@ const le = 2, ue = (o) => {
174
175
  children: W
175
176
  }
176
177
  ) : /* @__PURE__ */ l(
177
- re,
178
+ ne,
178
179
  {
179
180
  tabIndex: 0,
180
181
  className: `${n}-clear-icon`,
@@ -215,13 +216,13 @@ const le = 2, ue = (o) => {
215
216
  ..."height" in o ? { height: S } : {}
216
217
  },
217
218
  ref: s,
218
- children: ne(Q)
219
+ children: ie(Q)
219
220
  }
220
221
  )
221
222
  ] });
222
223
  }
223
224
  );
224
- ce.displayName = "InputComponent";
225
+ de.displayName = "InputComponent";
225
226
  export {
226
- ce as default
227
+ de as default
227
228
  };
package/input/Search.js CHANGED
@@ -1,38 +1,38 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import S from "@unicom-cloud/icons/IconUiLoading";
3
3
  import f from "@unicom-cloud/icons/IconUiSearch";
4
4
  import s from "lodash/isPlainObject";
5
5
  import V, { useContext as k } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
- import M from "../components/common/hooks/useMergeValue.js";
8
- import $ from "@unicom-cloud/utils/class-name";
9
- import { omit as j } from "../components/common/utils/omit.js";
10
- import y from "./Button.js";
7
+ import I from "../components/common/hooks/useMergeValue.js";
8
+ import M from "@unicom-cloud/utils/class-name";
9
+ import { omit as $ } from "../components/common/utils/omit.js";
10
+ import j from "./Button.js";
11
11
  import { formatValue as d } from "./Input.js";
12
- import A from "../config-provider/context.js";
13
- const B = V.forwardRef(
12
+ import y from "../config-provider/context.js";
13
+ const A = V.forwardRef(
14
14
  (e, h) => {
15
- const { getPrefixCls: g } = k(A), {
15
+ const { getPrefixCls: g } = k(y), {
16
16
  className: x,
17
17
  disabled: m,
18
18
  searchButton: t,
19
- loading: n,
19
+ loading: o,
20
20
  addAfter: C,
21
21
  suffix: l,
22
- buttonProps: c,
22
+ buttonProps: u,
23
23
  ...L
24
- } = e, r = g?.("input-search"), b = s(e.maxLength) ? e.maxLength.length : e.maxLength, u = s(e.maxLength) && e.maxLength.errorOnly ? void 0 : b, [v, N] = M("", {
25
- defaultValue: "defaultValue" in e ? d(e.defaultValue, u) : void 0,
26
- value: "value" in e ? d(e.value, u) : void 0
24
+ } = e, r = g?.("input-search"), b = s(e.maxLength) ? e.maxLength.length : e.maxLength, c = s(e.maxLength) && e.maxLength.errorOnly ? void 0 : b, [v, N] = I("", {
25
+ defaultValue: "defaultValue" in e ? d(e.defaultValue, c) : void 0,
26
+ value: "value" in e ? d(e.value, c) : void 0
27
27
  }), i = () => {
28
28
  m || e.onSearch?.(v);
29
29
  };
30
- return /* @__PURE__ */ o(
31
- y,
30
+ return /* @__PURE__ */ n(
31
+ j,
32
32
  {
33
- ...j(L, ["onSearch"]),
33
+ ...$(L, ["onSearch"]),
34
34
  disabled: m,
35
- className: $(
35
+ className: M(
36
36
  r,
37
37
  t && `${r}-button`,
38
38
  x
@@ -40,14 +40,14 @@ const B = V.forwardRef(
40
40
  ref: h,
41
41
  label: t !== !0 && t,
42
42
  addAfter: t ? C : null,
43
- suffix: l === void 0 ? t ? null : n ? /* @__PURE__ */ o(S, {}) : /* @__PURE__ */ o(f, { onClick: i }) : l,
43
+ suffix: l === void 0 ? t ? null : o ? /* @__PURE__ */ n(S, {}) : /* @__PURE__ */ n(f, { onClick: i }) : l,
44
44
  buttonProps: {
45
45
  className: `${r}-btn`,
46
- loading: n,
47
- icon: t === !0 && !n && /* @__PURE__ */ o(f, {}),
48
- ...c,
46
+ loading: o,
47
+ icon: t === !0 && !o && /* @__PURE__ */ n(f, {}),
48
+ ...u,
49
49
  onClick(a) {
50
- i(), c?.onClick?.(a);
50
+ i(), u?.onClick?.(a);
51
51
  }
52
52
  },
53
53
  onChange: (a, P) => {
@@ -60,7 +60,7 @@ const B = V.forwardRef(
60
60
  );
61
61
  }
62
62
  );
63
- B.displayName = "Search";
63
+ A.displayName = "Search";
64
64
  export {
65
- B as default
65
+ A as default
66
66
  };
package/layout/Sider.js CHANGED
@@ -40,7 +40,7 @@ function ae(o, p) {
40
40
  defaultValue: o.defaultCollapsed
41
41
  }), g = v(m) ? `${m}px` : String(m), L = v(r) ? `${r}` : String(r), [d, k] = ee(
42
42
  e ? L : g
43
- ), h = B(null), y = B(null);
43
+ ), h = B(), y = B(null);
44
44
  y.current = {
45
45
  breakpoint: $,
46
46
  collapsed: e,
@@ -46,7 +46,7 @@ import "../dist/react-transition-group/src/ReplaceTransition.js";
46
46
  import "../dist/react-transition-group/src/SwitchTransition.js";
47
47
  import "../dist/react-transition-group/chunk/CPfP7aNL.js";
48
48
  import "../dist/react-transition-group/src/TransitionGroup.js";
49
- import { v4 as A } from "uuid";
49
+ import "../utils/responsiveObserve.js";
50
50
  import "@unicom-cloud/utils/file/saveAs";
51
51
  import "@unicom-cloud/utils/screenfull";
52
52
  import "@unicom-cloud/utils/tinycolor";
@@ -55,6 +55,7 @@ import "@unicom-cloud/utils/constant/ui.js";
55
55
  import "react-is";
56
56
  import "@unicom-cloud/utils/tree";
57
57
  import { isNumber as ct } from "@unicom-cloud/utils/is";
58
+ import { v4 as A } from "uuid";
58
59
  import "../dist/validate/src/index.js";
59
60
  import pt from "../config-provider/context.js";
60
61
  const dt = {
@@ -74,7 +75,7 @@ const dt = {
74
75
  decimalPlaces: 0,
75
76
  percentFontScale: 0.5,
76
77
  waveSpeedVariation: 0.5
77
- }, we = (E) => {
78
+ }, xe = (E) => {
78
79
  const { getPrefixCls: I, componentConfig: _ } = at(pt), i = I?.("liquid-fill"), H = st(
79
80
  E,
80
81
  dt,
@@ -255,5 +256,5 @@ const dt = {
255
256
  );
256
257
  };
257
258
  export {
258
- we as default
259
+ xe as default
259
260
  };